上传代码

master
zhiyong.ning 4 years ago
parent 5585f78693
commit d6d4ef9b92
  1. 20
      pom.xml
  2. 2
      src/main/java/com/yipin/liuwanr/UserTest.java
  3. 119
      src/main/java/com/yipin/liuwanr/controller/StaffController.java
  4. 304
      src/main/java/com/yipin/liuwanr/controller/UserInfoController.java
  5. 414
      src/main/java/com/yipin/liuwanr/entity/StuStaff.java
  6. 72
      src/main/java/com/yipin/liuwanr/entity/UserInfo.java
  7. 35
      src/main/java/com/yipin/liuwanr/mapper/StaffMapper.java
  8. 10
      src/main/java/com/yipin/liuwanr/mapper/UserInfoMapper.java
  9. 36
      src/main/java/com/yipin/liuwanr/service/StaffService.java
  10. 28
      src/main/java/com/yipin/liuwanr/service/UserInfoService.java
  11. 9
      src/main/java/com/yipin/liuwanr/vo/UserInfoVO.java
  12. 12
      src/test/java/com/yipin/liuwanr/service/StaffServiceTest.java

@ -71,6 +71,10 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</exclusion>
<!--<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</exclusion>-->
</exclusions>
</dependency>
<dependency>
@ -241,7 +245,7 @@
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.21</version>
<version>1.7.12</version>
</dependency>
<dependency>
<groupId>commons-fileupload</groupId>
@ -249,10 +253,24 @@
<version>1.4</version>
<scope>test</scope>
</dependency>
<!--添加servlet-api的依赖,用来打war包 -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<finalName>ROOT</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.20.1</version>
<configuration>
<skipTests>true</skipTests>
</configuration>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>

@ -21,8 +21,8 @@ import javax.crypto.IllegalBlockSizeException;
import javax.crypto.NoSuchPaddingException;
import javax.crypto.spec.SecretKeySpec;
import org.apache.commons.codec.binary.Base64;
import org.apache.commons.lang3.ArrayUtils;
import org.apache.tomcat.util.codec.binary.Base64;
import com.aliyun.oss.OSSClient;
import com.yipin.liuwanr.entity.Speed;

@ -293,33 +293,128 @@ public class StaffController {
@PostMapping("/addStaff")
Response addStaff(@RequestBody UserInfoVO vo) {
Response resp = new Response();
//组织架构list
List<OrganizationRelationship> ORList = vo.getOrganizationRelationshipList();
UserInfo userInfo = vo.getUserInfo();
Integer userId = userInfo.getUserId();
String account = userInfo.getAccount();
Integer isNewUser = userInfo.getIsNewUser();
if (account==null||account=="") {
resp.setStatus(300);
resp.setErrmessage("账号为空添加失败!");
} else {
HashMap<String, Object> ret = userInfoService.logins(userInfo);
if (isNewUser==0){
HashMap<String, Object> sta = userInfoService.addStuStaff(ORList,userId);
int status = (int) sta.get("retcode");
if (status == 200){
resp.setStatus(status);
resp.setMessage(sta.get("retvalue"));
}else{
resp.setStatus(status);
resp.setErrmessage(sta.get("retvalue").toString());
throw new RuntimeException();
}
}else if(isNewUser==1){
HashMap<String, Object> ret = userInfoService.addUser(userInfo);
userId = (int) ret.get("userId");
int status = (int) ret.get("retcode");
if (status == 200){
HashMap<String, Object> sta = userInfoService.addStuStaff(ORList,userId);
int status1 = (int) sta.get("retcode");
if (status1 == 200){
resp.setStatus(status1);
resp.setMessage(sta.get("retvalue"));
}else{
resp.setStatus(status1);
resp.setErrmessage(sta.get("retvalue").toString());
throw new RuntimeException();
}
}else{
resp.setStatus(status);
resp.setErrmessage(ret.get("retvalue").toString());
throw new RuntimeException();
}
}else{
resp.setStatus(300);
resp.setErrmessage("新老用户为空添加失败!");
}
}
return resp;
}
/**
* 更新员工
*/
@PostMapping("/updateStaff")
Response updateStaff(@RequestBody UserInfoVO vo) {
Response resp = new Response();
OrganizationRelationship or = vo.getOrganizationRelationship();
UserInfo userInfo = vo.getUserInfo();
if (or==null) {
resp.setStatus(300);
resp.setErrmessage("组织架构为空,修改失败!");
}else if (userInfo.getUserId()==null){
resp.setStatus(300);
resp.setErrmessage("用户为空,修改失败!");
} else {
HashMap<String, Object> ret = staffService.updateNewStaff(vo);
int status = (int) ret.get("retcode");
if (200 == status) {
resp.setStatus(status);
resp.setMessage(ret.get("retvalue"));
HashMap<String, Object> ret1 = userInfoService.addUser(userInfo);
int status1 = (int) ret1.get("retcode");
if (status1 == 200){
resp.setStatus(status1);
resp.setMessage(ret1.get("retvalue"));
}else{
resp.setStatus(status1);
resp.setErrmessage(ret1.get("retvalue").toString());
throw new RuntimeException();
}
} else {
resp.setStatus(status);
resp.setErrmessage(ret.get("retvalue").toString());
throw new RuntimeException();
}
}
return resp;
}
/**
* 删除员工
*/
@PostMapping("/deleteStaff")
Response deleteStaff(@RequestBody List<OrganizationRelationship> OrganizationRelationshipList) {
Response resp = new Response();
if (OrganizationRelationshipList.isEmpty()){
resp.setStatus(300);
resp.setErrmessage("员工为空,删除失败!");
} else {
HashMap<String, Object> ret = staffService.deleteStaff(OrganizationRelationshipList);
int status = (int) ret.get("retcode");
if (200 == status) {
resp.setStatus(status);
resp.setMessage(ret.get("retvalue"));
} else {
resp.setStatus(status);
resp.setErrmessage(ret.get("retvalue").toString());
}
}
return resp;
}
/**
* 查询员工详情
*/
@GetMapping("/queryStaffDetails")
Response queryStaffDetails(@RequestParam Integer userId,Integer roleId) {
Response resp = new Response();
if (userId==null) {
resp.setStatus(300);
resp.setErrmessage("用户id为空,查询失败!");
}else if (roleId==null){
resp.setStatus(300);
resp.setErrmessage("角色id为空,查询失败!");
} else {
HashMap<String, Object> ret = staffService.queryStaffDetails(userId,roleId);
int status = (int) ret.get("retcode");
if (200 == status) {
resp.setStatus(status);
resp.setMessage(ret.get("retvalue"));
} else {
resp.setStatus(status);
resp.setErrmessage(ret.get("retvalue").toString());
}
}
return resp;
}
}

@ -1,13 +1,11 @@
package com.yipin.liuwanr.controller;
import com.yipin.liuwanr.entity.*;
import com.yipin.liuwanr.helper.QueryStudentUtils;
import com.yipin.liuwanr.helper.RedisHelper;
import com.yipin.liuwanr.service.StaffService;
import com.yipin.liuwanr.service.StudentService;
import com.yipin.liuwanr.service.UserInfoService;
import com.yipin.liuwanr.vo.UserInfoVO;
import jdk.nashorn.internal.ir.IfNode;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
@ -15,7 +13,6 @@ import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
@ -159,7 +156,7 @@ public class UserInfoController {
}
/**
* 添加用户
* 添加用户
*/
@Transactional
@PostMapping("/addUser")
@ -167,63 +164,54 @@ public class UserInfoController {
Response resp = new Response();
//个人档案实体
List<UserProfiles> userProfilesList = vo.getUserProfilesList();
//学生员工实体list
List<StuStaff> stuStaffList = vo.getStuStaffList();
//组织架构list
List<OrganizationRelationship> ORList = vo.getOrganizationRelationshipList();
//用户实体
UserInfo user = vo.getUserInfo();
//用户手机号
String phone = user.getPhone();
String account = user.getAccount();
//用户名称
String name = user.getUserName();
//省份id
Integer provinceId = user.getProvinceId();
//用户角色id
Integer roleId = user.getRoleId();
//城市id
Integer cityId = user.getCityId();
//学校id
Integer schoolId = user.getSchoolId();
if (name == null || name == "") {
if(name==null||name==""){
resp.setStatus(300);
resp.setErrmessage("姓名不能为空!");
} else if (provinceId == null) {
resp.setStatus(300);
resp.setErrmessage("省份不能为空!");
} else if (cityId == null) {
}else if(account==null||account==""){
resp.setStatus(300);
resp.setErrmessage("城市不能为空!");
} else if (schoolId == null) {
resp.setErrmessage("账号不能为空!");
}else if(schoolId==null){
resp.setStatus(300);
resp.setErrmessage("学校不能为空!");
} else {
}else {
HashMap<String, Object> ret = userInfoService.addUser(user);
Integer userId = user.getUserId();
int status = (int) ret.get("retcode");
if (200 == status) {
resp.setStatus(status);
resp.setMessage(ret.get("retvalue"));
HashMap<String, Object> stu = userInfoService.addPersonalFile(userProfilesList, userId);
int stuStatus = (int) stu.get("retcode");
if (stuStatus == 200) {
resp.setStatus(stuStatus);
resp.setMessage(stu.get("retvalue"));
} else {
resp.setStatus(stuStatus);
resp.setErrmessage(stu.get("retvalue").toString());
throw new RuntimeException();
}
HashMap<String, Object> sta = userInfoService.addStuStaff(ORList, userId);
int staStatus = (int) sta.get("retcode");
if (staStatus == 200) {
resp.setStatus(staStatus);
resp.setMessage(sta.get("retvalue"));
} else {
resp.setStatus(staStatus);
resp.setErrmessage(sta.get("retvalue").toString());
throw new RuntimeException();
}
HashMap<String, Object> stu = userInfoService.addPersonalFile(userProfilesList,userId);
int stuStatus = (int) stu.get("retcode");
if (stuStatus == 200){
resp.setStatus(stuStatus);
resp.setMessage(stu.get("retvalue"));
}else {
resp.setStatus(stuStatus);
resp.setErrmessage(stu.get("retvalue").toString());
throw new RuntimeException();
}
HashMap<String, Object> sta = userInfoService.addStuStaff(ORList,userId);
int staStatus = (int) sta.get("retcode");
if (staStatus == 200){
resp.setStatus(staStatus);
resp.setMessage(sta.get("retvalue"));
}else {
resp.setStatus(staStatus);
resp.setErrmessage(sta.get("retvalue").toString());
throw new RuntimeException();
}
} else {
resp.setStatus(status);
resp.setErrmessage(ret.get("retvalue").toString());
@ -234,50 +222,49 @@ public class UserInfoController {
}
/**
* 查询用户(根据国家省份城市)
* 查询用户(根据国家省份城市)
*/
@GetMapping("/queryUserInfo")
Response queryUserInfo(@RequestParam String countries, Integer provinceId, Integer cityId, Integer pageNo, Integer pageSize, Integer schoolId, Integer roleId, String searchContent, Integer month, String creationTime, String endTime) {
Response resp = new Response();
UserInfo userInfo = new UserInfo();
UserInfo userInfo = new UserInfo();
//设置国家
if (countries != null && countries != "") {
if (countries != null&&countries!="") {
userInfo.setCountries(countries);
}
//设置省份
if (provinceId != null) {
if(provinceId!=null) {
userInfo.setProvinceId(provinceId);
}
//设置城市
if (cityId != null) {
if(cityId!=null) {
userInfo.setCityId(cityId);
}
//学校
if (schoolId != null) {
if (schoolId!=null) {
userInfo.setSchoolId(schoolId);
}
//角色
if (roleId != null) {
if (roleId!=null) {
userInfo.setRoleId(roleId);
}
//搜索内容
if (searchContent != null && searchContent != "") {
if (searchContent!=null&&searchContent!="") {
userInfo.setSearchContent(searchContent);
}
//月份
if (month != null) {
userInfo.setMonth(month);
;
if (month!=null) {
userInfo.setMonth(month);;
}
//创建时间
if (creationTime != null && creationTime != "") {
if (creationTime!=null&&creationTime!="") {
userInfo.setCreationTime(creationTime);
}
//结束时间
if (endTime != null && endTime != "") {
if (endTime!=null&&endTime!="") {
userInfo.setEndTime(endTime);
}
HashMap<String, Object> ret = userInfoService.queryUserInfo(userInfo, pageNo, pageSize);
HashMap<String, Object> ret = userInfoService.queryUserInfo(userInfo,pageNo,pageSize);
int status = (int) ret.get("retcode");
if (200 == status) {
resp.setStatus(status);
@ -290,49 +277,49 @@ public class UserInfoController {
}
/**
* 删除用户(根据ID修改isdel状态,0可见 1不可见)
* 删除用户(根据ID修改isdel状态,0可见 1不可见)
*/
@Transactional
@PostMapping("/deleteUserInfo")
public Response deleteUserInfo(@RequestBody List<Integer> userIdList) {
Response resp = new Response();
if (userIdList == null) {
resp.setStatus(300);
resp.setErrmessage("用户id为空,删除用户失败!");
} else {
HashMap<String, Object> ret = userInfoService.deleteUserInfo(userIdList);
int status = (int) ret.get("retcode");
if (200 == status) {
resp.setStatus(status);
resp.setMessage(ret.get("retvalue"));
HashMap<String, Object> sta = userInfoService.deleteOrganizationRelationship(userIdList);
int staStatus = (int) sta.get("retcode");
if (200 == staStatus) {
resp.setStatus(staStatus);
resp.setMessage(sta.get("retvalue"));
} else {
resp.setStatus(staStatus);
resp.setErrmessage(sta.get("retvalue").toString());
if (userIdList==null) {
resp.setStatus(300);
resp.setErrmessage("用户id为空,删除用户失败!");
} else {
HashMap<String, Object> ret = userInfoService.deleteUserInfo(userIdList);
int status = (int) ret.get("retcode");
if (200 == status) {
resp.setStatus(status);
resp.setMessage(ret.get("retvalue"));
HashMap<String, Object> sta = userInfoService.deleteOrganizationRelationship(userIdList);
int staStatus = (int) sta.get("retcode");
if (200 == staStatus) {
resp.setStatus(staStatus);
resp.setMessage(sta.get("retvalue"));
}else{
resp.setStatus(staStatus);
resp.setErrmessage(sta.get("retvalue").toString());
throw new RuntimeException();
}
}else {
resp.setStatus(status);
resp.setErrmessage(ret.get("retvalue").toString());
throw new RuntimeException();
}
} else {
resp.setStatus(status);
resp.setErrmessage(ret.get("retvalue").toString());
throw new RuntimeException();
}
}
return resp;
}
/**
* 更新用户
* 更新用户
*/
@Transactional
@PostMapping("/updateUserInfo")
public Response updateUserInfo(@RequestBody UserInfo userInfo) {
Response resp = new Response();
Integer userId = userInfo.getUserId();
if (userId == null) {
if (userId==null) {
resp.setStatus(300);
resp.setErrmessage("用户ID为空,修改用户失败!");
} else {
@ -351,7 +338,7 @@ public class UserInfoController {
}
/**
* 更新用户个人档案
* 更新用户个人档案
*/
@Transactional
@PostMapping("/updateUserProfiles")
@ -377,7 +364,7 @@ public class UserInfoController {
}
/**
* 更新用户组织关系
* 更新用户组织关系
*/
@Transactional
@PostMapping("/updateOR")
@ -402,19 +389,19 @@ public class UserInfoController {
}
/**
* 登陆查询学校
* 登陆查询学校
*/
@GetMapping("/loginSchool")
Response loginSchool(@RequestParam("account") String account, @RequestParam("password") String password, HttpServletRequest req, HttpServletResponse res) {
Response resp = new Response();
UserInfo userInfo = new UserInfo();
if (account == null || account == "") {
UserInfo userInfo = new UserInfo();
if (account == null || account=="") {
resp.setStatus(300);
resp.setErrmessage("用户账号为空,登录失败!");
} else if (password == null || password == "") {
}else if(password ==null || password=="") {
resp.setStatus(300);
resp.setErrmessage("用户密码为空,登录失败!");
} else {
}else{
userInfo.setAccount(account);
userInfo.setPassword(password);
HashMap<String, Object> ret = userInfoService.loginSchool(userInfo);
@ -431,22 +418,23 @@ public class UserInfoController {
}
/**
* 登陆
* 登陆
*/
@GetMapping("/logins")
Response logins(@RequestParam("userId") Integer userId, @RequestParam("schoolId") Integer schoolId, @RequestParam("roleId") Integer roleId, HttpServletRequest req, HttpServletResponse res) {
Response logins(@RequestParam("userId") Integer userId, @RequestParam("schoolId") Integer schoolId,@RequestParam("roleId") Integer roleId, HttpServletRequest req, HttpServletResponse res) {
Response resp = new Response();
UserInfo userInfo = new UserInfo();
UserInfo userInfo = new UserInfo();
if (userId == null) {
resp.setStatus(300);
resp.setErrmessage("用户id为空,登录失败!");
} else if (schoolId == null) {
}else if(schoolId ==null) {
resp.setStatus(300);
resp.setErrmessage("用户学校id为空,登录失败!");
} else if (roleId == null) {
}else if(roleId ==null) {
resp.setStatus(300);
resp.setErrmessage("用户角色id为空,登录失败!");
} else {
}
else{
userInfo.setRoleId(roleId);
userInfo.setUserId(userId);
userInfo.setSchoolId(schoolId);
@ -464,19 +452,19 @@ public class UserInfoController {
}
/**
* 登陆查询角色
* 登陆查询角色
*/
@GetMapping("/loginRole")
Response loginRole(@RequestParam("userId") Integer userId, @RequestParam("schoolId") Integer schoolId, HttpServletRequest req, HttpServletResponse res) {
Response resp = new Response();
OrganizationRelationship OR = new OrganizationRelationship();
OrganizationRelationship OR = new OrganizationRelationship();
if (userId == null) {
resp.setStatus(300);
resp.setErrmessage("用户id为空,登录失败!");
} else if (schoolId == null) {
}else if(schoolId ==null) {
resp.setStatus(300);
resp.setErrmessage("角色id为空,登录失败!");
} else {
}else{
OR.setUserId(userId);
OR.setSchoolId(schoolId);
HashMap<String, Object> ret = userInfoService.loginRole(OR);
@ -493,15 +481,15 @@ public class UserInfoController {
}
/**
* 查询用户详情(ID)
* 查询用户详情(ID)
*/
@GetMapping("/queryUserInfoDetails")
Response queryUserInfoDetails(@RequestParam Integer userId) {
Response resp = new Response();
if (userId == null) {
if (userId==null) {
resp.setStatus(300);
resp.setErrmessage("用户id为空!查询失败!");
} else {
}else {
HashMap<String, Object> ret = userInfoService.queryUserInfoDetails(userId);
int status = (int) ret.get("retcode");
if (200 == status) {
@ -516,19 +504,19 @@ public class UserInfoController {
}
/**
* 查询用户组织架构OR(organization relationship)
* 查询用户组织架构OR(organization relationship)
*/
@GetMapping("/queryUserOR")
Response queryUserOR(@RequestParam Integer userId, Integer platformId) {
Response queryUserOR(@RequestParam Integer userId,Integer platformId) {
Response resp = new Response();
if (userId == null) {
if (userId==null) {
resp.setStatus(300);
resp.setErrmessage("用户id为空!查询失败!");
} else if (platformId == null) {
}else if (platformId==null){
resp.setStatus(300);
resp.setErrmessage("平台id为空!查询失败!");
} else {
HashMap<String, Object> ret = userInfoService.queryUserOR(userId, platformId);
HashMap<String, Object> ret = userInfoService.queryUserOR(userId,platformId);
int status = (int) ret.get("retcode");
if (200 == status) {
resp.setStatus(status);
@ -542,15 +530,15 @@ public class UserInfoController {
}
/**
* 查询用户个人档案
* 查询用户个人档案
*/
@GetMapping("/queryUserProfiles")
Response queryUserProfiles(@RequestParam Integer userId) {
Response resp = new Response();
if (userId == null) {
if (userId==null) {
resp.setStatus(300);
resp.setErrmessage("用户id为空!查询失败!");
} else {
}else {
HashMap<String, Object> ret = userInfoService.queryUserProfiles(userId);
int status = (int) ret.get("retcode");
if (200 == status) {
@ -567,11 +555,11 @@ public class UserInfoController {
@PostMapping("/uploadUserAvatars")
Response uploadUserAvatars(MultipartFile file, Integer userId) {
Response resp = new Response();
if (userId == null) {//前台传来的值是否为空
if (userId==null) {//前台传来的值是否为空
resp.setStatus(300);
resp.setErrmessage("Parameter Invalid");
} else {
HashMap<String, Object> ret = userInfoService.uploadUserAvatars(file, userId);
}else {
HashMap<String, Object> ret = userInfoService.uploadUserAvatars(file,userId);
int status = (int) ret.get("retcode");
if (200 == status) {
@ -586,7 +574,7 @@ public class UserInfoController {
}
/**
* 更新登录次数和时间
* 更新登录次数和时间
*/
@PostMapping("/updateLogInNumber")
Response updateLogInNumber(@RequestBody UserM user) {
@ -594,13 +582,13 @@ public class UserInfoController {
Integer userId = user.getUserId();
String phone = user.getPhone();
Integer accountRole = user.getAccountRole();
if (userId == null) {
if (userId==null) {
resp.setStatus(300);
resp.setErrmessage("用户id不能为空!");
} else if (phone == null || phone == "") {
}else if(phone==null||phone==""){
resp.setStatus(300);
resp.setErrmessage("用户电话不能为空!");
} else if (accountRole == null) {
} else if(accountRole==null){
resp.setStatus(300);
resp.setErrmessage("用户角色不能为空!");
} else {
@ -616,36 +604,62 @@ public class UserInfoController {
}
return resp;
}
/**
* 用户模块查询客户
* 用户模块查询客户
*/
@GetMapping("/queryCustomer")
Response queryCustomer(@RequestParam String searchContent, @RequestParam List<Integer> customerIds) {
Response queryCustomer(@RequestParam String searchContent,@RequestParam List<Integer> customerIds) {
Response resp = new Response();
HashMap<String, Object> ret = userInfoService.queryCustomer(searchContent, customerIds);
int status = (int) ret.get("retcode");
if (200 == status) {
resp.setStatus(status);
resp.setMessage(ret.get("retvalue"));
} else {
resp.setStatus(status);
resp.setErrmessage(ret.get("retvalue").toString());
}
HashMap<String, Object> ret = userInfoService.queryCustomer(searchContent,customerIds);
int status = (int) ret.get("retcode");
if (200 == status) {
resp.setStatus(status);
resp.setMessage(ret.get("retvalue"));
} else {
resp.setStatus(status);
resp.setErrmessage(ret.get("retvalue").toString());
}
return resp;
}
/**
* 查询账号是否存在
* 查询账号是否存在
*/
@GetMapping("/queryAccountIsExist")
Response queryAccountIsExist(@RequestParam String account) {
Response queryAccountIsExist(@RequestParam String account,Integer schoolId) {
Response resp = new Response();
if (account == null && account == "") {
resp.setStatus(300);
resp.setErrmessage("账号为空!");
}else if (schoolId==null){
resp.setStatus(300);
resp.setErrmessage("学校为空!");
}
else {
HashMap<String, Object> ret = userInfoService.queryAccountIsExist(account,schoolId);
int status = (int) ret.get("retcode");
if (200 == status) {
resp.setStatus(status);
resp.setMessage(ret.get("retvalue"));
} else {
resp.setStatus(status);
resp.setErrmessage(ret.get("retvalue").toString());
}
}
return resp;
}
/**
* 查询服务端账号是否存在
*/
@GetMapping("/queryServerAccountIsExist")
Response queryServerAccountIsExist(@RequestParam String account) {
Response resp = new Response();
if (account==null&&account=="") {
resp.setStatus(300);
resp.setErrmessage("账号为空!");
} else {
HashMap<String, Object> ret = userInfoService.queryAccountIsExist(account);
HashMap<String, Object> ret = userInfoService.queryServerAccountIsExist(account);
int status = (int) ret.get("retcode");
if (200 == status) {
resp.setStatus(status);
@ -662,16 +676,17 @@ public class UserInfoController {
* 查询学号工号是否存在
*/
@GetMapping("/queryWorkNumberIsExist")
Response queryWorkNumberIsExist(@RequestParam String workNumber, Integer roleId, Integer schoolId) {
Response queryWorkNumberIsExist(@RequestParam String workNumber,Integer roleId,Integer schoolId) {
Response resp = new Response();
if (workNumber == null) {
if (workNumber==null) {
resp.setStatus(300);
resp.setErrmessage("学号、工号为空!");
} else if (roleId == null) {
resp.setStatus(300);
resp.setErrmessage("角色id为空!");
} else {
HashMap<String, Object> ret = userInfoService.queryWorkNumberIsExist(workNumber, roleId, schoolId);
}else if (roleId==null){
resp.setStatus(300);
resp.setErrmessage("角色id为空!");
}
else {
HashMap<String, Object> ret = userInfoService.queryWorkNumberIsExist(workNumber,roleId,schoolId);
int status = (int) ret.get("retcode");
if (200 == status) {
resp.setStatus(status);
@ -685,17 +700,17 @@ public class UserInfoController {
}
/**
* 查询平台
* 查询平台
*/
@GetMapping("/queryPlatform")
Response queryPlatform(@RequestParam String platformId) {
Response resp = new Response();
UserInfo userInfo = new UserInfo();
UserInfo userInfo = new UserInfo();
//平台id
if (platformId == null && platformId == "") {
if (platformId==null&&platformId=="") {
resp.setStatus(300);
resp.setErrmessage("平台id为空!");
} else {
}else{
HashMap<String, Object> ret = userInfoService.queryPlatform(platformId);
int status = (int) ret.get("retcode");
if (200 == status) {
@ -710,7 +725,7 @@ public class UserInfoController {
}
/**
* 删除平台
* 删除平台
*/
@PostMapping("/deletePlatform")
Response deletePlatform(@RequestBody OrganizationRelationship OR) {
@ -718,14 +733,15 @@ public class UserInfoController {
Integer platformId = OR.getPlatformId();
Integer userId = OR.getUserId();
//平台id
if (platformId == null) {
if (platformId==null) {
resp.setStatus(300);
resp.setErrmessage("平台id为空!");
} else if (userId == null) {
}else if(userId==null){
resp.setStatus(300);
resp.setErrmessage("用户id为空!");
} else {
HashMap<String, Object> ret = userInfoService.deletePlatform(platformId, userId);
}
else{
HashMap<String, Object> ret = userInfoService.deletePlatform(platformId,userId);
int status = (int) ret.get("retcode");
if (200 == status) {
resp.setStatus(status);

@ -1,207 +1,207 @@
package com.yipin.liuwanr.entity;
import java.util.List;
//学生和老师管理员组织关系信息实体
public class StuStaff {
//主键ID
private Integer id;
//账号
private String account;
//用户id
private Integer userId;
//名字
private String name;
//角色Id
private Integer roleId;
//工号
private String workNumber;
//电话
private String phone;
//邮件
private String email;
//绑定员工年级架构ID
private Integer staffGradeId;
//绑定专业ID
private Integer staffProfessionalArchitectureId;
//绑定专业名称
private String staffProfessionalArchitectureName;
//绑定员工年级名称
private String staffGradeName;
//唯一标示性账号
private String uniqueIdentificationAccount;
//绑定学校id
private Integer schoolId;
//绑定专业ID
private Integer professionalId;
//绑定年级ID
private Integer gradeId;
//绑定班级ID
private Integer classId;
//专业名称
private String professionalName;
//年级名称
private String gradeName;
//绑定班级名称
private String className;
public Integer getUserId() {
return userId;
}
public void setUserId(Integer userId) {
this.userId = userId;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getAccount() {
return account;
}
public void setAccount(String account) {
this.account = account;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getWorkNumber() {
return workNumber;
}
public void setWorkNumber(String workNumber) {
this.workNumber = workNumber;
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public Integer getStaffGradeId() {
return staffGradeId;
}
public void setStaffGradeId(Integer staffGradeId) {
this.staffGradeId = staffGradeId;
}
public Integer getStaffProfessionalArchitectureId() {
return staffProfessionalArchitectureId;
}
public void setStaffProfessionalArchitectureId(Integer staffProfessionalArchitectureId) {
this.staffProfessionalArchitectureId = staffProfessionalArchitectureId;
}
public String getStaffProfessionalArchitectureName() {
return staffProfessionalArchitectureName;
}
public void setStaffProfessionalArchitectureName(String staffProfessionalArchitectureName) {
this.staffProfessionalArchitectureName = staffProfessionalArchitectureName;
}
public Integer getRoleId() {
return roleId;
}
public void setRoleId(Integer roleId) {
this.roleId = roleId;
}
public String getStaffGradeName() {
return staffGradeName;
}
public void setStaffGradeName(String staffGradeName) {
this.staffGradeName = staffGradeName;
}
public String getUniqueIdentificationAccount() {
return uniqueIdentificationAccount;
}
public void setUniqueIdentificationAccount(String uniqueIdentificationAccount) {
this.uniqueIdentificationAccount = uniqueIdentificationAccount;
}
public Integer getSchoolId() {
return schoolId;
}
public void setSchoolId(Integer schoolId) {
this.schoolId = schoolId;
}
public Integer getProfessionalId() {
return professionalId;
}
public void setProfessionalId(Integer professionalId) {
this.professionalId = professionalId;
}
public Integer getGradeId() {
return gradeId;
}
public void setGradeId(Integer gradeId) {
this.gradeId = gradeId;
}
public Integer getClassId() {
return classId;
}
public void setClassId(Integer classId) {
this.classId = classId;
}
public String getProfessionalName() {
return professionalName;
}
public void setProfessionalName(String professionalName) {
this.professionalName = professionalName;
}
public String getGradeName() {
return gradeName;
}
public void setGradeName(String gradeName) {
this.gradeName = gradeName;
}
public String getClassName() {
return className;
}
public void setClassName(String className) {
this.className = className;
}
}
//package com.yipin.liuwanr.entity;
//
//import java.util.List;
//
////学生和老师管理员组织关系信息实体
//public class StuStaff {
// //主键ID
// private Integer id;
// //账号
// private String account;
// //用户id
// private Integer userId;
// //名字
// private String name;
// //角色Id
// private Integer roleId;
// //工号
// private String workNumber;
// //电话
// private String phone;
// //邮件
// private String email;
// //绑定员工年级架构ID
// private Integer staffGradeId;
// //绑定专业ID
// private Integer staffProfessionalArchitectureId;
// //绑定专业名称
// private String staffProfessionalArchitectureName;
// //绑定员工年级名称
// private String staffGradeName;
// //唯一标示性账号
// private String uniqueIdentificationAccount;
// //绑定学校id
// private Integer schoolId;
// //绑定专业ID
// private Integer professionalId;
// //绑定年级ID
// private Integer gradeId;
// //绑定班级ID
// private Integer classId;
// //专业名称
// private String professionalName;
// //年级名称
// private String gradeName;
// //绑定班级名称
// private String className;
//
// public Integer getUserId() {
// return userId;
// }
//
// public void setUserId(Integer userId) {
// this.userId = userId;
// }
//
// public Integer getId() {
// return id;
// }
//
// public void setId(Integer id) {
// this.id = id;
// }
//
// public String getAccount() {
// return account;
// }
//
// public void setAccount(String account) {
// this.account = account;
// }
//
// public String getName() {
// return name;
// }
//
// public void setName(String name) {
// this.name = name;
// }
//
// public String getWorkNumber() {
// return workNumber;
// }
//
// public void setWorkNumber(String workNumber) {
// this.workNumber = workNumber;
// }
//
// public String getPhone() {
// return phone;
// }
//
// public void setPhone(String phone) {
// this.phone = phone;
// }
//
// public String getEmail() {
// return email;
// }
//
// public void setEmail(String email) {
// this.email = email;
// }
//
// public Integer getStaffGradeId() {
// return staffGradeId;
// }
//
// public void setStaffGradeId(Integer staffGradeId) {
// this.staffGradeId = staffGradeId;
// }
//
// public Integer getStaffProfessionalArchitectureId() {
// return staffProfessionalArchitectureId;
// }
//
// public void setStaffProfessionalArchitectureId(Integer staffProfessionalArchitectureId) {
// this.staffProfessionalArchitectureId = staffProfessionalArchitectureId;
// }
//
// public String getStaffProfessionalArchitectureName() {
// return staffProfessionalArchitectureName;
// }
//
// public void setStaffProfessionalArchitectureName(String staffProfessionalArchitectureName) {
// this.staffProfessionalArchitectureName = staffProfessionalArchitectureName;
// }
//
// public Integer getRoleId() {
// return roleId;
// }
//
// public void setRoleId(Integer roleId) {
// this.roleId = roleId;
// }
//
// public String getStaffGradeName() {
// return staffGradeName;
// }
//
// public void setStaffGradeName(String staffGradeName) {
// this.staffGradeName = staffGradeName;
// }
//
// public String getUniqueIdentificationAccount() {
// return uniqueIdentificationAccount;
// }
//
// public void setUniqueIdentificationAccount(String uniqueIdentificationAccount) {
// this.uniqueIdentificationAccount = uniqueIdentificationAccount;
// }
//
// public Integer getSchoolId() {
// return schoolId;
// }
//
// public void setSchoolId(Integer schoolId) {
// this.schoolId = schoolId;
// }
//
// public Integer getProfessionalId() {
// return professionalId;
// }
//
// public void setProfessionalId(Integer professionalId) {
// this.professionalId = professionalId;
// }
//
// public Integer getGradeId() {
// return gradeId;
// }
//
// public void setGradeId(Integer gradeId) {
// this.gradeId = gradeId;
// }
//
// public Integer getClassId() {
// return classId;
// }
//
// public void setClassId(Integer classId) {
// this.classId = classId;
// }
//
// public String getProfessionalName() {
// return professionalName;
// }
//
// public void setProfessionalName(String professionalName) {
// this.professionalName = professionalName;
// }
//
// public String getGradeName() {
// return gradeName;
// }
//
// public void setGradeName(String gradeName) {
// this.gradeName = gradeName;
// }
//
// public String getClassName() {
// return className;
// }
//
// public void setClassName(String className) {
// this.className = className;
// }
//}

@ -28,8 +28,8 @@ public class UserInfo {
private String creationTime;
//登陆次数
private Integer logInNumber;
//上次登陆时间
private String lastTimeOfLanding;
//最后登陆时间
private String lastLoginTime;
//性别
private Integer sex;
//证件类型(1、身份证)
@ -92,6 +92,26 @@ public class UserInfo {
private String oneDepartmentName;
//二级部门名称
private String twoDepartmentName;
//是否新用户
private Integer isNewUser;
//组织架构id
private Integer organizationRelationshipId;
public Integer getOrganizationRelationshipId() {
return organizationRelationshipId;
}
public void setOrganizationRelationshipId(Integer organizationRelationshipId) {
this.organizationRelationshipId = organizationRelationshipId;
}
public Integer getIsNewUser() {
return isNewUser;
}
public void setIsNewUser(Integer isNewUser) {
this.isNewUser = isNewUser;
}
public String getWorkNumber() {
return workNumber;
@ -221,12 +241,12 @@ public class UserInfo {
this.logInNumber = logInNumber;
}
public String getLastTimeOfLanding() {
return lastTimeOfLanding;
public String getLastLoginTime() {
return lastLoginTime;
}
public void setLastTimeOfLanding(String lastTimeOfLanding) {
this.lastTimeOfLanding = lastTimeOfLanding;
public void setLastLoginTime(String lastLoginTime) {
this.lastLoginTime = lastLoginTime;
}
public Integer getSex() {
@ -429,44 +449,4 @@ public class UserInfo {
this.roleId = roleId;
}
@Override
public String toString() {
return "UserInfo{" +
"userId=" + userId +
", roleId=" + roleId +
", userName='" + userName + '\'' +
", account='" + account + '\'' +
", password='" + password + '\'' +
", countries='" + countries + '\'' +
", provinceId=" + provinceId +
", cityId=" + cityId +
", creationTime='" + creationTime + '\'' +
", logInNumber=" + logInNumber +
", lastTimeOfLanding='" + lastTimeOfLanding + '\'' +
", sex=" + sex +
", documentType=" + documentType +
", IDNumber='" + IDNumber + '\'' +
", educationDegree=" + educationDegree +
", phone='" + phone + '\'' +
", WeChatID='" + WeChatID + '\'' +
", dateBirth='" + dateBirth + '\'' +
", email='" + email + '\'' +
", schoolId=" + schoolId +
", uniqueIdentificationAccount='" + uniqueIdentificationAccount + '\'' +
", searchContent='" + searchContent + '\'' +
", user=" + user +
", userAvatars='" + userAvatars + '\'' +
", schoolName='" + schoolName + '\'' +
", provinceName='" + provinceName + '\'' +
", cityName='" + cityName + '\'' +
", month=" + month +
", endTime='" + endTime + '\'' +
", professionalClassId=" + professionalClassId +
", professionalClassName='" + professionalClassName + '\'' +
", disciplineId=" + disciplineId +
", disciplineName='" + disciplineName + '\'' +
", professionalId=" + professionalId +
", professionalName='" + professionalName + '\'' +
'}';
}
}

@ -17,7 +17,7 @@ public interface StaffMapper {
void addStaff(Staff staff);
@Select({"<script>",
"SELECT hui.userName,hor.workNumber,hor.oneDepartmentId,hor.twoDepartmentId,hor.roleId,hui.logInNumber as logInNumber,hui.lastLoginTime as lastTimeOfLanding FROM hr_user_info hui,hr_organization_relationship hor WHERE hui.userId = hor.userId and hor.roleId != 1 and hor.roleId !=4 and hor.schoolId = #{schoolId}",
"SELECT hui.lastLoginTime,hor.userId,hor.organizationRelationshipId,hui.userName,hor.workNumber,hor.oneDepartmentId,hor.oneDepartmentName,hor.twoDepartmentId,hor.twoDepartmentName,hor.roleId,hui.logInNumber as logInNumber,hui.lastLoginTime as lastTimeOfLanding FROM hr_user_info hui,hr_organization_relationship hor WHERE hui.userId = hor.userId and hor.roleId != 1 and hor.roleId !=4 and hor.schoolId = #{schoolId} and hor.isdel=0",
" <if test='searchContent!=null'> and hui.userName like CONCAT('%',#{searchContent},'%') or hor.workNumber like CONCAT('%',#{searchContent},'%')</if>",
" <if test='oneDepartmentIds!=null'>and FIND_IN_SET(hor.oneDepartmentId,#{oneDepartmentIds})</if>",
" <if test='twoDepartmentIds!=null'> and FIND_IN_SET(hor.twoDepartmentId,#{twoDepartmentIds}) </if>",
@ -26,9 +26,9 @@ public interface StaffMapper {
List<UserInfo> queryStaff(UserInfo userInfo);
@Update({"<script>",
"UPDATE staff SET isdel = 1 where staffId = #{staffId}",
"UPDATE hr_organization_relationship SET isdel = 1 where organizationRelationshipId = #{organizationRelationshipId}",
"</script> "})
void deleteStaff(Integer staffId);
void deleteStaff(Integer organizationRelationshipId);
@Update({"<script>",
"UPDATE user SET isdel = 1 where phone = #{phone}",
@ -36,25 +36,21 @@ public interface StaffMapper {
void deleteUser(String phone);
@Select({"<script>",
"SELECT staffId,staffName,staffWorkNumber,phone,email,logNumber,lastTimeOfLanding,staffGradeId,staffProfessionalArchitectureId,roleId,uniqueIdentificationAccount,schoolId from staff where isdel = 0 and staffId = #{staffId}",
"SELECT roleId,oneDepartmentId,oneDepartmentName,twoDepartmentId,twoDepartmentName,workNumber from hr_organization_relationship where userId = #{userId} and roleId = #{roleId}",
"</script> "})
List<Staff> queryStaffDetails(Integer staffId);
List<OrganizationRelationship> queryStaffDetails(Integer userId,Integer roleId);
//查询学生详情
//查询员工用户详情
@Select({ "<script>",
"SELECT * from staff where isdel = 0 and staffId = #{staffId}",
"SELECT userId,userName,uniqueIdentificationAccount,account,phone,email from hr_user_info where isdel = 0 and userId = #{userId}",
"</script> " })
@Results({
@Result(property = "staff", column = "staffId",one = @One(select = "com.yipin.liuwanr.mapper.StaffMapper.queryStaffDetails")),
@Result(property = "user", column = "staffId",one = @One(select = "com.yipin.liuwanr.mapper.StaffMapper.queryStaffDetailsU"))
})
List<UserVO> queryStaffDetailsUser(Integer staffId);
List<UserInfo> queryStaffDetailsU(Integer userId);
//查询学生详情
//查询用户角色
@Select({ "<script>",
"SELECT s.phone,s.staffId,u.* from staff s,user u where u.isdel = 0 and s.staffId = #{staffId} and s.phone = u.phone",
"SELECT roleId from hr_organization_relationship where userId = #{userId}",
"</script> " })
List<UserM> queryStaffDetailsU(Integer staffId);
List<OrganizationRelationship> queryRole(Integer userId);
//修改员工
@Update("UPDATE staff SET staffName = #{staffName},staffWorkNumber = #{staffWorkNumber},phone = #{phone},email = #{email},staffProfessionalArchitectureId = #{staffProfessionalArchitectureId},"
@ -65,6 +61,15 @@ public interface StaffMapper {
@Update("UPDATE user SET phone = #{phone},name = #{name},userAccount = #{userAccount},workNumber = #{workNumber},provinceId = #{provinceId},cityId = #{cityId},email = #{email},schoolId = #{schoolId},uniqueIdentificationAccount = #{uniqueIdentificationAccount},disciplineId = #{disciplineId},professionalClassId = #{professionalClassId},professionalId = #{professionalId} where phone = #{phone}")
void updateUser(UserM user);
//修改员工
@Update("UPDATE hr_organization_relationship SET oneDepartmentId = #{oneDepartmentId},oneDepartmentName = #{oneDepartmentName},twoDepartmentId = #{twoDepartmentId},twoDepartmentName = #{twoDepartmentName},workNumber = #{workNumber}"
+ "where organizationRelationshipId = #{organizationRelationshipId}")
void updateNewStaff(OrganizationRelationship organizationRelationship);
//修改用户
@Update("UPDATE hr_user_info SET userName = #{userName},uniqueIdentificationAccount = #{uniqueIdentificationAccount},account = #{account},phone = #{phone},email = #{email} where userId = #{userId}")
void updateNewUser(UserInfo userInfo);
/**
* 得到所有未删除的部门信息
* @return

@ -150,8 +150,8 @@ public interface UserInfoMapper{
List<Platform> queryUserPlatform(Integer userId);
//查询用户手机
@Select("SELECT u.* from user u where isdel=0 and phone = #{phone}")
List<UserM> queryPhone(String phone);
@Select("SELECT userId from hr_user_info where isdel=0 and phone = #{phone}")
List<UserInfo> queryPhone(String phone);
//查询用户详情
@Select({"<script>",
@ -219,9 +219,13 @@ public interface UserInfoMapper{
void updateStaffLogInNumber(UserM user);
//查询账号是否存在
@Select("SELECT userId,account from hr_user_info where isdel = 0 and account = #{account}")
@Select("SELECT account,email,userName,userId,uniqueIdentificationAccount,phone from hr_user_info where isdel = 0 and account = #{account}")
List<UserInfo> queryAccountIsExist(String account);
//查询账号是否存在
@Select("SELECT hor.* from hr_organization_relationship hor,hr_user_info hui where hor.isdel = 0 and hui.account = #{account} and hor.userId = hui.userId and hor.schoolId = #{schoolId}")
List<OrganizationRelationship> queryAccountIsExistOR(String account,Integer schoolId);
//查询学号、工号是否存在
@Select("SELECT userId,workNumber,schoolId,roleId from hr_organization_relationship where workNumber = #{workNumber} and roleId = #{roleId} and schoolId = #{schoolId}")
List<OrganizationRelationship> queryWorkNumberIsExist(String workNumber,Integer roleId,Integer schoolId);

@ -144,11 +144,14 @@ public class StaffService {
// }
//删除员工
public HashMap<String, Object> deleteStaff(Integer staffId,String phone){
public HashMap<String, Object> deleteStaff(List<OrganizationRelationship> OrganizationRelationshipList){
HashMap<String, Object> resp = new HashMap<String, Object>();
try {
staffMapper.deleteStaff(staffId);
staffMapper.deleteUser(phone);
Integer size = OrganizationRelationshipList.size();
for (int i = 0;i<size;i++){
Integer organizationRelationshipId = OrganizationRelationshipList.get(i).getOrganizationRelationshipId();
staffMapper.deleteStaff(organizationRelationshipId);
}
resp.put("retcode", 200);
} catch (RuntimeException e) {
logger.error(e.getMessage());
@ -160,10 +163,14 @@ public class StaffService {
}
//查询员工详情
public HashMap<String, Object> queryStaffDetails(Integer staffId){
public HashMap<String, Object> queryStaffDetails(Integer userId,Integer roleId){
HashMap<String, Object> resp = new HashMap<String, Object>();
HashMap<String, Object> obj = new HashMap<String, Object>();
try {
resp.put("retvalue", staffMapper.queryStaffDetailsUser(staffId));
obj.put("staff", staffMapper.queryStaffDetails(userId,roleId));
obj.put("user", staffMapper.queryStaffDetailsU(userId));
obj.put("roleId", staffMapper.queryRole(userId));
resp.put("retvalue",obj);
resp.put("retcode", 200);
} catch (RuntimeException e) {
logger.error(e.getMessage());
@ -192,6 +199,25 @@ public class StaffService {
return resp;
}
//修改员工
@Transactional
public HashMap<String, Object> updateNewStaff(UserInfoVO vo){
HashMap<String, Object> resp = new HashMap<String, Object>();
OrganizationRelationship OR = vo.getOrganizationRelationship();
UserInfo userInfo = vo.getUserInfo();
try {
staffMapper.updateNewStaff(OR);
staffMapper.updateNewUser(userInfo);
resp.put("retcode", 200);
} catch (RuntimeException e) {
logger.error(e.getMessage());
resp.put("retcode", 500);
resp.put("retvalue", "修改员工失败!");
throw new RuntimeException();
}
return resp;
}
//查询员工
public HashMap<String, Object> queryStaff(UserInfo userInfo, Integer pageNo, Integer pageSize){
HashMap<String, Object> resp = new HashMap<String, Object>();

@ -391,15 +391,15 @@ public class UserInfoService {
try {
UserInfo user=userInfoMapper.loginsAP(userInfo);
// obj.put("user",user);
Integer userId = user.getUserId();
if(userId!=null) {
if(user!=null) {
Integer userId = user.getUserId();
List<OrganizationRelationship> organizationRelationship = userInfoMapper.queryOrganizationRelationship(userId);
obj.put("organizationRelationship",organizationRelationship);
resp.put("retcode", 200);
resp.put("retvalue", obj);
}else {
resp.put("retcode", 300);
resp.put("retvalue", "登录失败,账号密码有误或不存在!");
resp.put("retvalue", "登录失败,账号密码有误!");
}
} catch (RuntimeException e) {
logger.error(e.getMessage());
@ -584,10 +584,28 @@ public class UserInfoService {
}
//查询账号是否存在
public HashMap<String, Object> queryAccountIsExist(String account){
public HashMap<String, Object> queryAccountIsExist(String account,Integer schoolId){
HashMap<String, Object> resp = new HashMap<String, Object>();
HashMap<String, Object> obj = new HashMap<String, Object>();
try {
obj.put("user", userInfoMapper.queryAccountIsExist(account));
obj.put("OR", userInfoMapper.queryAccountIsExistOR(account,schoolId));
resp.put("retcode", 200);
resp.put("retvalue",obj);
} catch (RuntimeException e) {
logger.error(e.getMessage());
resp.put("retcode", 500);
resp.put("retvalue", "查询账号是否存在失败!");
return resp;
}
return resp;
}
//后端查询账号是否存在
public HashMap<String, Object> queryServerAccountIsExist(String account){
HashMap<String, Object> resp = new HashMap<String, Object>();
try {
resp.put("retvalue", userInfoMapper.queryAccountIsExist(account));
resp.put("retvalue",userInfoMapper.queryAccountIsExist(account));
resp.put("retcode", 200);
} catch (RuntimeException e) {
logger.error(e.getMessage());

@ -26,7 +26,6 @@ public class UserInfoVO {
private List<Student> studentList;
private List<Staff> staffList;
private List<UserProfiles> userProfilesList;
private List<StuStaff> stuStaffList;
public OrganizationRelationship getOrganizationRelationship() {
return organizationRelationship;
@ -44,14 +43,6 @@ public class UserInfoVO {
this.organizationRelationshipList = organizationRelationshipList;
}
public List<StuStaff> getStuStaffList() {
return stuStaffList;
}
public void setStuStaffList(List<StuStaff> stuStaffList) {
this.stuStaffList = stuStaffList;
}
public UserProfiles getUserProfiles() {
return userProfiles;
}

@ -17,7 +17,9 @@ import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;
import java.io.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
/**
* @auther River
@ -132,9 +134,8 @@ public class StaffServiceTest {
@Test
@Transactional
public void deleteStaffTest(){
Integer staffId = 118;
String phone = "13137366427";
HashMap<String, Object> deleteStaff = staffService.deleteStaff(staffId, phone);
List<OrganizationRelationship> OrganizationRelationshipList = new ArrayList<>();
HashMap<String, Object> deleteStaff = staffService.deleteStaff(OrganizationRelationshipList);
for (String s : deleteStaff.keySet()) {
System.out.println("key:" + s + "," + "value:" + deleteStaff.get(s));
}
@ -146,8 +147,9 @@ public class StaffServiceTest {
@Test
@Transactional
public void queryStaffDetailsTest(){
Integer staffId = 118;
HashMap<String, Object> staffDetails = staffService.queryStaffDetails(staffId);
Integer userId = 2;
Integer roleId = 3;
HashMap<String, Object> staffDetails = staffService.queryStaffDetails(userId,roleId);
for (String s : staffDetails.keySet()) {
System.out.println("key:" + s + "," + "value:" + staffDetails.get(s));
}

Loading…
Cancel
Save