master
zhiyong.ning 4 years ago
parent fce3cccd0d
commit 82a8abb906
  1. 17
      src/main/java/com/yipin/liuwanr/controller/ExperimentalClassController.java
  2. 40
      src/main/java/com/yipin/liuwanr/controller/StaffController.java
  3. 105
      src/main/java/com/yipin/liuwanr/controller/UserInfoController.java
  4. 10
      src/main/java/com/yipin/liuwanr/entity/OrganizationRelationship.java
  5. 4
      src/main/java/com/yipin/liuwanr/mapper/ExperimentalClassMapper.java
  6. 2
      src/main/java/com/yipin/liuwanr/mapper/StaffMapper.java
  7. 2
      src/main/java/com/yipin/liuwanr/mapper/StudentMapper.java
  8. 72
      src/main/java/com/yipin/liuwanr/mapper/UserInfoMapper.java
  9. 4
      src/main/java/com/yipin/liuwanr/service/ExperimentalClassService.java
  10. 89
      src/main/java/com/yipin/liuwanr/service/UserInfoService.java
  11. 30
      src/main/java/com/yipin/liuwanr/service/UserService.java

@ -254,23 +254,6 @@ public class ExperimentalClassController {
}
//新增学生显示数据
@GetMapping("/queryExperimentalClass")
Response queryExperimentalClass(@RequestParam Integer experimentalClassId) {
Response resp = new Response();
HashMap<String, Object> ret=classService.queryExperimentalClass(experimentalClassId);
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;
}
/**
* 查询学生行政班级
* @param experimentalClassId

@ -62,7 +62,7 @@ public class StaffController {
*/
@Transactional
@PostMapping("/addStaff")
Response addCustomer(@RequestBody UserVO vo) {
Response addStaff(@RequestBody UserVO vo) {
Response resp = new Response();
Staff staff = vo.getStaff();
UserM user = vo.getUser();
@ -98,7 +98,7 @@ public class StaffController {
* 查询员工
*/
@GetMapping("/queryStaff")
Response queryCustomer(@RequestParam Integer schoolId,String nameAndNumber,String staffProfessionalArchitectureIds,Integer pageNo,Integer pageSize,String staffGradeIds) {
Response queryStaff(@RequestParam Integer schoolId,String nameAndNumber,String staffProfessionalArchitectureIds,Integer pageNo,Integer pageSize,String staffGradeIds) {
Response resp = new Response();
Staff staff = new Staff();
if (schoolId==null){
@ -126,7 +126,7 @@ public class StaffController {
}
}
return resp;
}
}
/**
* 查询员工详情
@ -151,6 +151,40 @@ public class StaffController {
return resp;
}
/**
* 查询员工
*/
@GetMapping("/getStaff")
Response getStaff(@RequestParam Integer schoolId,String nameAndNumber,String staffProfessionalArchitectureIds,Integer pageNo,Integer pageSize,String staffGradeIds) {
Response resp = new Response();
Staff staff = new Staff();
if (schoolId==null){
resp.setStatus(300);
resp.setErrmessage("学校id为空,查询失败!");
}else {
if (nameAndNumber!=null&&nameAndNumber!="") {
staff.setNameAndNumber(nameAndNumber);
}
if (staffProfessionalArchitectureIds!=null&&staffProfessionalArchitectureIds!="") {
staff.setStaffProfessionalArchitectureIds(staffProfessionalArchitectureIds);
}
if (staffGradeIds!=null&&staffGradeIds!="") {
staff.setStaffGradeIds(staffGradeIds);
}
staff.setSchoolId(schoolId);
HashMap<String, Object> ret = staffService.queryStaff(staff,pageNo,pageSize);
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;
}
/**
* 删除员工
*/

@ -6,7 +6,6 @@ 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 com.yipin.liuwanr.vo.UserVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
@ -223,42 +222,69 @@ public class UserInfoController {
* 更新用户
*/
@Transactional
@PostMapping("/updateUser")
public Response updateUser(@RequestBody UserInfoVO vo) {
@PostMapping("/updateUserInfo")
public Response updateUserInfo(@RequestBody UserInfo userInfo) {
Response resp = new Response();
UserInfo user = vo.getUserInfo();
Staff staff = vo.getStaff();
Student student = vo.getStudent();
Integer userId = user.getUserId();
Integer userId = userInfo.getUserId();
if (userId==null) {
resp.setStatus(300);
resp.setErrmessage("用户ID为空,修改用户失败!");
} else {
HashMap<String, Object> ret = userInfoService.updateUser(user);
HashMap<String, Object> ret = userInfoService.updateUser(userInfo);
int status = (int) ret.get("retcode");
if (200 == status) {
resp.setStatus(status);
resp.setMessage(ret.get("retvalue"));
HashMap<String, Object> sta = userInfoService.updateStaff(staff);
int staStatus = (int) sta.get("retcode");
if (200 == status) {
resp.setStatus(staStatus);
resp.setMessage(sta.get("retvalue"));
HashMap<String, Object> stu = userInfoService.updateStudent(student);
int stuStatus = (int) stu.get("retcode");
} else {
resp.setStatus(status);
resp.setErrmessage(ret.get("retvalue").toString());
throw new RuntimeException("修改用户失败!");
}
}
return resp;
}
/**
* 更新用户个人档案
*/
@Transactional
@PostMapping("/updateUserProfiles")
public Response updateUserProfiles(@RequestBody List<UserProfiles> userProfilesList) {
Response resp = new Response();
if (userProfilesList.isEmpty()) {
resp.setStatus(300);
resp.setErrmessage("用户个人档案为空,修改失败!");
} else {
HashMap<String, Object> ret = userInfoService.updateUserProfiles(userProfilesList);
int status = (int) ret.get("retcode");
if (200 == status) {
resp.setStatus(stuStatus);
resp.setMessage(stu.get("retvalue"));
}else{
resp.setStatus(stuStatus);
resp.setErrmessage(stu.get("retvalue").toString());
throw new RuntimeException("修改学生失败!");
resp.setStatus(status);
resp.setMessage(ret.get("retvalue"));
} else {
resp.setStatus(status);
resp.setErrmessage(ret.get("retvalue").toString());
throw new RuntimeException("修改用户个人档案失败!");
}
}else{
resp.setStatus(staStatus);
resp.setErrmessage(sta.get("retvalue").toString());
throw new RuntimeException("修改员工失败!");
}
return resp;
}
/**
* 更新用户组织关系
*/
@Transactional
@PostMapping("/updateOR")
public Response updateOrganizationRelationship(@RequestBody List<OrganizationRelationship> OrganizationRelationshipList) {
Response resp = new Response();
if (OrganizationRelationshipList.isEmpty()) {
resp.setStatus(300);
resp.setErrmessage("用户组织关系为空,修改组织关系失败!");
} else {
HashMap<String, Object> ret = userInfoService.updateOrganizationRelationship(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());
@ -268,7 +294,6 @@ public class UserInfoController {
return resp;
}
/**
* 登陆(前台传来的key必须是phonepassword)
*/
@ -401,18 +426,9 @@ public class UserInfoController {
* 用户模块查询客户
*/
@GetMapping("/queryCustomer")
Response queryCustomer(@RequestParam Integer cityId, Integer provinceId) {
Response queryCustomer(@RequestParam String searchContent,@RequestParam List<Integer> customerIds) {
Response resp = new Response();
if(provinceId == null){
resp.setStatus(300);
resp.setErrmessage("省份id为空!查询失败!");
}else if (cityId==null) {
resp.setStatus(300);
resp.setErrmessage("城市id为空!查询失败!");
}else {
HashMap<String, Object> ret = userInfoService.queryCustomer(cityId,provinceId);
resp.setStatus(200);
resp.setErrmessage("查询成功!");
HashMap<String, Object> ret = userInfoService.queryCustomer(searchContent,customerIds);
int status = (int) ret.get("retcode");
if (200 == status) {
resp.setStatus(status);
@ -421,7 +437,6 @@ public class UserInfoController {
resp.setStatus(status);
resp.setErrmessage(ret.get("retvalue").toString());
}
}
return resp;
}
@ -452,13 +467,17 @@ public class UserInfoController {
* 查询学号工号是否存在
*/
@GetMapping("/queryWorkNumberIsExist")
Response queryWorkNumberIsExist(@RequestParam String workNumber) {
Response queryWorkNumberIsExist(@RequestParam String workNumber,Integer roleId,Integer schoolId) {
Response resp = new Response();
if (workNumber==null) {
resp.setStatus(300);
resp.setErrmessage("账号为空!");
}else {
HashMap<String, Object> ret = userInfoService.queryWorkNumberIsExist(workNumber);
resp.setErrmessage("学号、工号为空!");
}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);
@ -470,4 +489,6 @@ public class UserInfoController {
}
return resp;
}
}

@ -1,6 +1,8 @@
package com.yipin.liuwanr.entity;
public class OrganizationRelationship {
//组织关系id
private Integer organizationRelationshipId;
//用户id
private Integer userId;
//平台ID
@ -34,6 +36,14 @@ public class OrganizationRelationship {
//班级名称
private String className;
public Integer getOrganizationRelationshipId() {
return organizationRelationshipId;
}
public void setOrganizationRelationshipId(Integer organizationRelationshipId) {
this.organizationRelationshipId = organizationRelationshipId;
}
public Integer getUserId() {
return userId;
}

@ -33,9 +33,9 @@ public interface ExperimentalClassMapper {
@Select({"<script>",
"SELECT experimentalClassId,experimentalClassName,classSize,creationTime,founder,courseId,userId,schoolId "
+ "from experimental_class_ning where isdel = 0 and schoolId = #{schoolId} and courseId=#{courseId}",
+ "from experimental_class_ning where isdel = 0 and schoolId = #{schoolId} and courseId=#{courseId} and userId = #{userId}",
"</script> "})
List<ExperimentalClass> queryExperimentalClass(Integer schoolId,Integer courseId);
List<ExperimentalClass> queryExperimentalClass(Integer schoolId,Integer courseId,Integer userId);
//查询实验班级学生专业
@Select({"<script>",

@ -110,7 +110,7 @@ public interface StaffMapper {
"<if test='workNumber!=null'>and staffWorkNumber=#{workNumber} </if>",
"<if test='uniqueIdentificationAccount!=null'>and uniqueIdentificationAccount=#{uniqueIdentificationAccount} </if>",
"</script>"})
Staff queryStaffQ(UserInfo user);
Staff queryStaffQ(UserM user);
@Update("update staff set lastTimeOfLanding=#{lastTime},logNumber=#{logNumber} where staffId=#{staffId}")

@ -113,7 +113,7 @@ public interface StudentMapper {
"<if test='workNumber!=null'>and studentNumber=#{workNumber} </if>",
"<if test='uniqueIdentificationAccount!=null'>and uniqueIdentificationAccount=#{uniqueIdentificationAccount} </if>",
"</script>"})
Student queryStudentQ(UserInfo user);
Student queryStudentQ(UserM user);
@Update("update student set lastLoginTime=#{lastTime},loginNumber=#{loginNumber} where studentId=#{studentId}")

@ -64,11 +64,49 @@ public interface UserInfoMapper {
void deleteStudent(UserInfo user);
//修改用户
@Update("UPDATE user SET name = #{name},sex = #{sex},documentType = #{documentType},countries = #{countries},educationDegree = #{educationDegree},"
+ "IDNumber = #{IDNumber},accountRole = #{accountRole},provinceId = #{provinceId},subjectsTaught = #{subjectsTaught},cityId = #{cityId},"
+ "phone = #{phone},teachingProfessional = #{teachingProfessional},WeChatID = #{WeChatID},dateBirth = #{dateBirth},email = #{email},schoolId = #{schoolId},disciplineId = #{disciplineId},professionalId = #{professionalId},professionalClassId = #{professionalClassId} where userId = #{userId}")
@Update("UPDATE hr_user_info SET userName = #{userName},uniqueIdentificationAccount = #{uniqueIdentificationAccount},documentType = #{documentType},IDNumber = #{IDNumber},provinceId = #{provinceId},"
+ "cityId = #{cityId},countries = #{countries},dateBirth = #{dateBirth},educationDegree = #{educationDegree},schoolId = #{schoolId},"
+ "phone = #{phone},weChatID = #{weChatID},email = #{email},account = #{account},creationTime = #{creationTime},logInNumber = #{logInNumber},sex = #{sex},userAvatars = #{userAvatars} where userId = #{userId}")
void updateUser(UserInfo user);
//修改用户个人档案
@Update({ "<script>",
"UPDATE hr_personal_file SET ",
"<when test='personalCareerId!=null'>", "personalCareerId = #{personalCareerId},", "</when>",
"<when test='schoolId!=null'>", "schoolId = #{schoolId},", "</when>",
"<when test='schoolName!=null'>", "schoolName = #{schoolName},", "</when>",
"<when test='disciplineId!=null'>", "disciplineId = #{disciplineId},", "</when>",
"<when test='disciplineName!=null'>", "disciplineName = #{disciplineName},", "</when>",
"<when test='professionalClassId!=null'>", "professionalClassId = #{professionalClassId},", "</when>",
"<when test='professionalClassName!=null'>", "professionalClassName = #{professionalClassName},", "</when>",
"<when test='professionalId!=null'>", "professionalId = #{professionalId},", "</when>",
"<when test='professionalName!=null'>", "professionalName = #{professionalName},", "</when>",
"updatetime=now() where personalFileId = #{personalFileId}",
"</script>" })
void updateUserProfiles(UserProfiles userProfiles);
//修改用户组织关系
@Update({ "<script>",
"UPDATE hr_organization_relationship SET ",
"<when test='platformId!=null'>", "platformId = #{platformId},", "</when>",
"<when test='schoolId!=null'>", "schoolId = #{schoolId},", "</when>",
"<when test='schoolName!=null'>", "schoolName = #{schoolName},", "</when>",
"<when test='roleId!=null'>", "roleId = #{roleId},", "</when>",
"<when test='workNumber!=null'>", "workNumber = #{workNumber},", "</when>",
"<when test='oneDepartmentId!=null'>", "oneDepartmentId = #{oneDepartmentId},", "</when>",
"<when test='oneDepartmentName!=null'>", "oneDepartmentName = #{oneDepartmentName},", "</when>",
"<when test='twoDepartmentId!=null'>", "twoDepartmentId = #{twoDepartmentId},", "</when>",
"<when test='twoDepartmentName!=null'>", "twoDepartmentName = #{twoDepartmentName},", "</when>",
"<when test='professionalId!=null'>", "professionalId = #{professionalId},", "</when>",
"<when test='professionalName!=null'>", "professionalName = #{professionalName},", "</when>",
"<when test='gradeId!=null'>", "gradeId = #{gradeId},", "</when>",
"<when test='gradeName!=null'>", "gradeName = #{gradeName},", "</when>",
"<when test='classId!=null'>", "classId = #{classId},", "</when>",
"<when test='className!=null'>", "className = #{className},", "</when>",
"updatetime=now() where organizationRelationshipId = #{organizationRelationshipId}",
"</script>" })
void updateOrganizationRelationship(OrganizationRelationship organizationRelationship);
//修改员工
@Update("UPDATE staff SET staffName = #{staffName},staffWorkNumber = #{staffWorkNumber},phone = #{phone},email = #{email},staffProfessionalArchitectureId = #{staffProfessionalArchitectureId},"
+ "staffProfessionalArchitectureId = #{staffProfessionalArchitectureId},staffGradeId = #{staffGradeId},roleId = #{roleId} where phone = #{phone}")
@ -80,12 +118,12 @@ public interface UserInfoMapper {
void updateStudent(Student student);
//登陆
@Select("SELECT * from hr_user_info where isdel=0 and account = #{account} and password = #{password}")
@Select("SELECT hui.account,hui.cityId,hui.countries,hui.creationTime,hui.dateBirth,hui.documentType,hui.educationDegree,hui.email,hui.iDNumber,hui.logInNumber,hui.phone,hui.provinceId,hui.schoolId,hui.sex,hui.uniqueIdentificationAccount,hui.userAvatars,hui.userId,hui.userName,hui.weChatID from hr_user_info hui where hui.isdel=0 and hui.account = #{account} and hui.password = #{password}")
UserInfo logins(UserInfo userInfo);
//查询用户roleId
@Select("SELECT schoolId,roleId from hr_organization_relationship where userId = #{userId}")
OrganizationRelationship queryOrganizationRelationship(Integer userId);
//查询用户组织关系
@Select("SELECT * from hr_organization_relationship where userId = #{userId}")
List<OrganizationRelationship> queryOrganizationRelationship(Integer userId);
//查询用户手机
@Select("SELECT u.* from user u where isdel=0 and phone = #{phone}")
@ -95,7 +133,7 @@ public interface UserInfoMapper {
@Select({"<script>",
"SELECT * from hr_user_info where isdel = 0 and userId = #{userId}",
"</script> "})
List<UserInfoVO> queryUserInfoDetails(Integer userId);
UserInfo queryUserInfoDetails(Integer userId);
//查询用户详情
@Select({"<script>",
@ -103,14 +141,20 @@ public interface UserInfoMapper {
"</script> "})
List<UserProfiles> queryUserProfiles(Integer userId);
//模糊查询客户
@Select({"<script>",
"SELECT customerId,customerName,schoolId FROM customer where isdel = 0 and provinceId = #{provinceId} and cityId = #{cityId}",
"SELECT customerId,customerName,schoolId FROM customer where isdel = 0",
" <if test='searchContent!=null and searchContent !=\"\" '>and customerName like CONCAT('%',#{searchContent},'%')</if>",
" <if test='customerIds!=null'>"
+ "<foreach collection='customerIds' item='customerIds' open='and customerId not in (' separator=',' close=')'> #{customerIds}"
+"</foreach>"
+ "</if>",
"</script> "})
List<Customer> queryCustomer(Integer cityId, Integer provinceId);
List<Customer> queryCustomer(@Param("searchContent")String searchContent, @Param("customerIds")List<Integer> customerIds);
/**
* 批量插入用户
* @param user
* @param users
*/
@Insert({
"<script>",
@ -123,7 +167,7 @@ public interface UserInfoMapper {
void addUserM(@Param("users") List<UserM> users);
//修改用户头像
@Update("update user set userAvatars=#{userAvatars} where userId=#{userId}")
@Update("update hr_user_info set userAvatars=#{userAvatars} where userId=#{userId}")
void updateUserAvatars(@Param("userAvatars") String userAvatars, @Param("userId") Integer userId);
//更新用户登录次数和最后一次登录时间
@ -143,8 +187,8 @@ public interface UserInfoMapper {
List<UserInfo> queryAccountIsExist(String account);
//查询学号、工号是否存在
@Select("SELECT userId,workNumber from user where isdel = 0 and workNumber = #{workNumber}")
List<UserM> queryWorkNumberIsExist(String workNumber);
@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);
//========全承珠
@Select("select userId,password,accountRole,logInNumber,workNumber,phone,uniqueIdentificationAccount,schoolId from user "

@ -96,11 +96,11 @@ public class ExperimentalClassService {
return resp;
}
public HashMap<String, Object> queryExperimentalClass(Integer schoolId,Integer courseId) {
public HashMap<String, Object> queryExperimentalClass(Integer schoolId,Integer courseId,Integer userId) {
HashMap<String, Object> resp = new HashMap<String, Object>();
try {
if(!StringUtils.isEmpty(courseId)){
resp.put("retvalue", experimentalClassMapper.queryExperimentalClass(schoolId,courseId));
resp.put("retvalue", experimentalClassMapper.queryExperimentalClass(schoolId,courseId,userId));
resp.put("retcode", 200);
}
} catch (RuntimeException e) {

@ -196,6 +196,46 @@ public class UserInfoService {
return resp;
}
//更新个人档案
@Transactional
public HashMap<String, Object> updateUserProfiles(List<UserProfiles> userProfilesList){
HashMap<String, Object> resp = new HashMap<String, Object>();
try {
Integer size = userProfilesList.size();
for (int i=0; i<size; i++){
UserProfiles userProfiles = userProfilesList.get(i);
userInfoMapper.updateUserProfiles(userProfiles);
}
resp.put("retcode", 200);
} catch (RuntimeException e) {
logger.error(e.getMessage());
resp.put("retcode", 500);
resp.put("retvalue", "更新用户个人档案失败!");
throw new RuntimeException();
}
return resp;
}
//更新用户组织架构
@Transactional
public HashMap<String, Object> updateOrganizationRelationship(List<OrganizationRelationship> OrganizationRelationshipList){
HashMap<String, Object> resp = new HashMap<String, Object>();
try {
Integer size = OrganizationRelationshipList.size();
for (int i=0; i<size; i++){
OrganizationRelationship organizationRelationship = OrganizationRelationshipList.get(i);
userInfoMapper.updateOrganizationRelationship(organizationRelationship);
}
resp.put("retcode", 200);
} catch (RuntimeException e) {
logger.error(e.getMessage());
resp.put("retcode", 500);
resp.put("retvalue", "更新用户个人档案失败!");
throw new RuntimeException();
}
return resp;
}
//更新学生
@Transactional
public HashMap<String, Object> updateStudent(Student student){
@ -236,33 +276,11 @@ public class UserInfoService {
Staff staff;
try {
UserInfo user=userInfoMapper.logins(userInfo);
obj.put("user",user);
if(user!=null) {
Integer userId = user.getUserId();
OrganizationRelationship organizationRelationship = userInfoMapper.queryOrganizationRelationship(userId);
// user.setRoleId(roleId);
// int loginNumber=user.getLogInNumber()+1;
// long time=System.currentTimeMillis();
// Date date = new Date(time);
// SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
// String lastTime=sd.format(date);
// if(roleId.equals(4)) {
// student=studentMapper.queryStudentQ(user);
// if(student!=null) {
// Integer studentId=student.getStudentId();
// studentMapper.updateStudentQ(lastTime,loginNumber, studentId);
// obj.put("student",student);
// }
// }else if(roleId.equals(3)) {
// staff =staffMapper.queryStaffQ(user);
// if(staff!=null) {
// Integer staffId=staff.getStaffId();
// staffMapper.updateStaffQ(lastTime,loginNumber, staffId);
// obj.put("staff",staff);
// }
// }
// user.setPassword(null);
// obj.put("user",user);
// userInfoMapper.updateUserQ(lastTime,loginNumber, userId);
List<OrganizationRelationship> organizationRelationship = userInfoMapper.queryOrganizationRelationship(userId);
obj.put("organizationRelationship",organizationRelationship);
resp.put("retcode", 200);
resp.put("retvalue", obj);
}else {
@ -281,9 +299,18 @@ public class UserInfoService {
//查询用户详情
public HashMap<String, Object> queryUserInfoDetails(Integer userId){
HashMap<String, Object> resp = new HashMap<String, Object>();
HashMap<String, Object> obj = new HashMap<String, Object>();
try {
resp.put("retvalue", userInfoMapper.queryUserInfoDetails(userId));
UserInfo userInfo = userInfoMapper.queryUserInfoDetails(userId);
obj.put("userInfo",userInfo);
if (userInfo!=null){
List<UserProfiles> userProfiles = userInfoMapper.queryUserProfiles(userId);
obj.put("userProfilesList",userProfiles);
List<OrganizationRelationship> organizationRelationshipsList = userInfoMapper.queryOrganizationRelationship(userId);
obj.put("organizationRelationshipsList",organizationRelationshipsList);
resp.put("retvalue", obj);
resp.put("retcode", 200);
}
} catch (RuntimeException e) {
logger.error(e.getMessage());
resp.put("retcode", 500);
@ -293,7 +320,7 @@ public class UserInfoService {
return resp;
}
//查询用户详情
//查询用户档案
public HashMap<String, Object> queryUserProfiles(Integer userId){
HashMap<String, Object> resp = new HashMap<String, Object>();
try {
@ -309,10 +336,10 @@ public class UserInfoService {
}
//查询客户
public HashMap<String, Object> queryCustomer(Integer cityId,Integer provinceId){
public HashMap<String, Object> queryCustomer(String searchContent, List<Integer> customerIds){
HashMap<String, Object> resp = new HashMap<String, Object>();
try {
resp.put("retvalue", userInfoMapper.queryCustomer(cityId,provinceId));
resp.put("retvalue", userInfoMapper.queryCustomer(searchContent,customerIds));
resp.put("retcode", 200);
} catch (RuntimeException e) {
logger.error(e.getMessage());
@ -384,10 +411,10 @@ public class UserInfoService {
}
//查询学号、工号是否存在
public HashMap<String, Object> queryWorkNumberIsExist(String workNumber){
public HashMap<String, Object> queryWorkNumberIsExist(String workNumber,Integer roleId,Integer schoolId){
HashMap<String, Object> resp = new HashMap<String, Object>();
try {
resp.put("retvalue", userInfoMapper.queryWorkNumberIsExist(workNumber));
resp.put("retvalue", userInfoMapper.queryWorkNumberIsExist(workNumber,roleId,schoolId));
resp.put("retcode", 200);
} catch (RuntimeException e) {
logger.error(e.getMessage());

@ -278,21 +278,21 @@ public class UserService {
Date date = new Date(time);
SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String lastTime=sd.format(date);
// if(user.getAccountRole().equals(4)) {
// student=studentMapper.queryStudentQ(user);
// if(student!=null) {
// Integer studentId=student.getStudentId();
// studentMapper.updateStudentQ(lastTime,loginNumber, studentId);
// obj.put("student",student);
// }
// }else if(user.getAccountRole().equals(3)) {
// staff =staffMapper.queryStaffQ(user);
// if(staff!=null) {
// Integer staffId=staff.getStaffId();
// staffMapper.updateStaffQ(lastTime,loginNumber, staffId);
// obj.put("staff",staff);
// }
// }
if(user.getAccountRole().equals(4)) {
student=studentMapper.queryStudentQ(user);
if(student!=null) {
Integer studentId=student.getStudentId();
studentMapper.updateStudentQ(lastTime,loginNumber, studentId);
obj.put("student",student);
}
}else if(user.getAccountRole().equals(3)) {
staff =staffMapper.queryStaffQ(user);
if(staff!=null) {
Integer staffId=staff.getStaffId();
staffMapper.updateStaffQ(lastTime,loginNumber, staffId);
obj.put("staff",staff);
}
}
user.setPassword(null);
obj.put("user",user);
userMapper.updateUserQ(lastTime,loginNumber, userId);

Loading…
Cancel
Save