|
@@ -216,6 +216,8 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
|
|
private TaskGroupService taskGroupService;
|
|
private TaskGroupService taskGroupService;
|
|
@Resource
|
|
@Resource
|
|
private ParticipationService participationService;
|
|
private ParticipationService participationService;
|
|
|
|
+ @Resource
|
|
|
|
+ private UserReportDeptService userReportDeptService;
|
|
|
|
|
|
@Resource
|
|
@Resource
|
|
private LdapTemplate ldapTemplate;
|
|
private LdapTemplate ldapTemplate;
|
|
@@ -751,6 +753,14 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
|
|
if (reportCount>0 || taskExecutorCount>0 || projectInchargerList>0){
|
|
if (reportCount>0 || taskExecutorCount>0 || projectInchargerList>0){
|
|
reportCount = 1;
|
|
reportCount = 1;
|
|
}
|
|
}
|
|
|
|
+ List<UserReportDept> userReportDepts = userReportDeptService.list(new LambdaQueryWrapper<UserReportDept>().eq(UserReportDept::getUserId, id));
|
|
|
|
+ if(userReportDepts.size()>0){
|
|
|
|
+ List<Integer> deptIds = userReportDepts.stream().map(UserReportDept::getDeptId).distinct().collect(Collectors.toList());
|
|
|
|
+ List<Department> departmentList = departmentMapper.selectList(new LambdaQueryWrapper<Department>().eq(Department::getDepartmentId, deptIds));
|
|
|
|
+ user.setUserReportDeptList(departmentList);
|
|
|
|
+ }else {
|
|
|
|
+ user.setUserReportDeptList(new ArrayList<>());
|
|
|
|
+ }
|
|
user.setIsExistsReport(reportCount);
|
|
user.setIsExistsReport(reportCount);
|
|
httpRespMsg.data = user;
|
|
httpRespMsg.data = user;
|
|
}
|
|
}
|
|
@@ -1313,7 +1323,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
|
|
@Override
|
|
@Override
|
|
public HttpRespMsg insertUser(String targetId, String name, String phone, Integer onlyAuditOnce, Integer roleId, Double monthCost, Double cost,
|
|
public HttpRespMsg insertUser(String targetId, String name, String phone, Integer onlyAuditOnce, Integer roleId, Double monthCost, Double cost,
|
|
Integer departmentId, Integer salaryType, String costApplyDate, String position, String certJson, HttpServletRequest request,String inductionDate,
|
|
Integer departmentId, Integer salaryType, String costApplyDate, String position, String certJson, HttpServletRequest request,String inductionDate,
|
|
- String superiorId, String plate1,String plate2,String plate3,String plate4,String plate5, String jobNumber, String inactiveDate) {
|
|
|
|
|
|
+ String superiorId, String plate1,String plate2,String plate3,String plate4,String plate5, String jobNumber, String inactiveDate,String reportDeptIds) {
|
|
HttpRespMsg httpRespMsg = new HttpRespMsg();
|
|
HttpRespMsg httpRespMsg = new HttpRespMsg();
|
|
DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
|
DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
|
try {
|
|
try {
|
|
@@ -1390,6 +1400,18 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
|
|
userCertService.saveBatch(certList);
|
|
userCertService.saveBatch(certList);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ if(!StringUtils.isEmpty(reportDeptIds)){
|
|
|
|
+ List<UserReportDept> userReportDeptList=new ArrayList<>();
|
|
|
|
+ String[] split = reportDeptIds.split(",");
|
|
|
|
+ List<Integer> deptIds = Arrays.asList(split).stream().map(i -> Integer.valueOf(i)).collect(Collectors.toList());
|
|
|
|
+ deptIds.forEach(d->{
|
|
|
|
+ UserReportDept userReportDept=new UserReportDept();
|
|
|
|
+ userReportDept.setUserId(user.getId());
|
|
|
|
+ userReportDept.setDeptId(d);
|
|
|
|
+ userReportDeptList.add(userReportDept);
|
|
|
|
+ });
|
|
|
|
+ userReportDeptService.saveBatch(userReportDeptList);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
@@ -1457,6 +1479,22 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
|
|
userMapper.setSuperiorNull(oldUser.getId());
|
|
userMapper.setSuperiorNull(oldUser.getId());
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ if(!StringUtils.isEmpty(reportDeptIds)){
|
|
|
|
+ userReportDeptService.remove(new LambdaQueryWrapper<UserReportDept>().eq(UserReportDept::getUserId,targetId));
|
|
|
|
+ List<UserReportDept> userReportDeptList=new ArrayList<>();
|
|
|
|
+ String[] split = reportDeptIds.split(",");
|
|
|
|
+ List<Integer> deptIds = Arrays.asList(split).stream().map(i -> Integer.valueOf(i)).collect(Collectors.toList());
|
|
|
|
+ deptIds.forEach(d->{
|
|
|
|
+ UserReportDept userReportDept=new UserReportDept();
|
|
|
|
+ userReportDept.setUserId(targetId);
|
|
|
|
+ userReportDept.setDeptId(d);
|
|
|
|
+ userReportDeptList.add(userReportDept);
|
|
|
|
+ });
|
|
|
|
+ userReportDeptService.saveBatch(userReportDeptList);
|
|
|
|
+ }else {
|
|
|
|
+ //清空数据
|
|
|
|
+ userReportDeptService.remove(new LambdaQueryWrapper<UserReportDept>().eq(UserReportDept::getUserId,targetId));
|
|
|
|
+ }
|
|
if (salaryChange) {
|
|
if (salaryChange) {
|
|
UserSalary userSalary = UserSalary.copyFromUser(oldUser);
|
|
UserSalary userSalary = UserSalary.copyFromUser(oldUser);
|
|
userSalaryMapper.insert(userSalary);
|
|
userSalaryMapper.insert(userSalary);
|