|
@@ -1107,6 +1107,20 @@ public class WeiXinCorpController {
|
|
contactSyncLogMapper.insert(contactSyncLog);
|
|
contactSyncLogMapper.insert(contactSyncLog);
|
|
}else {
|
|
}else {
|
|
userMapper.insert(user);
|
|
userMapper.insert(user);
|
|
|
|
+ //处理项目参与人
|
|
|
|
+ if (user.getDepartmentId() != null && user.getDepartmentId() != 0) {
|
|
|
|
+ List<Participation> toAddList = new ArrayList<>();
|
|
|
|
+ projectDeptRelateMapper.selectList(new QueryWrapper<ProjectDeptRelate>().eq("department_id", user.getDepartmentId()).eq("company_id", companyId))
|
|
|
|
+ .forEach(projectDeptRelate -> {
|
|
|
|
+ Participation participation = new Participation();
|
|
|
|
+ participation.setProjectId(projectDeptRelate.getProjectId());
|
|
|
|
+ participation.setUserId(user.getId());
|
|
|
|
+ toAddList.add(participation);
|
|
|
|
+ });
|
|
|
|
+ if (toAddList.size() > 0) {
|
|
|
|
+ participationMapper.insertBatch(toAddList);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
wxCorpInfoService.getUserByCompanyIdAndTransferLicense(companyId,user.getCorpwxUserid());
|
|
wxCorpInfoService.getUserByCompanyIdAndTransferLicense(companyId,user.getCorpwxUserid());
|
|
contactSyncLog.setResult(1);
|
|
contactSyncLog.setResult(1);
|
|
//contactSyncLog.setMsg("同步成功");
|
|
//contactSyncLog.setMsg("同步成功");
|
|
@@ -1208,6 +1222,18 @@ public class WeiXinCorpController {
|
|
List<Department> allDeptList = departmentMapper.selectList(new QueryWrapper<Department>().eq("company_id", companyId));
|
|
List<Department> allDeptList = departmentMapper.selectList(new QueryWrapper<Department>().eq("company_id", companyId));
|
|
changeUser.setDepartmentCascade(convertDepartmentIdToCascade(changeUser.getDepartmentId(), allDeptList));
|
|
changeUser.setDepartmentCascade(convertDepartmentIdToCascade(changeUser.getDepartmentId(), allDeptList));
|
|
userMapper.updateById(changeUser);
|
|
userMapper.updateById(changeUser);
|
|
|
|
+ //处理项目参与人
|
|
|
|
+ List<Participation> toAddList = new ArrayList<>();
|
|
|
|
+ projectDeptRelateMapper.selectList(new QueryWrapper<ProjectDeptRelate>().eq("department_id", changeUser.getDepartmentId()).eq("company_id", companyId))
|
|
|
|
+ .forEach(projectDeptRelate -> {
|
|
|
|
+ Participation participation = new Participation();
|
|
|
|
+ participation.setProjectId(projectDeptRelate.getProjectId());
|
|
|
|
+ participation.setUserId(changeUser.getId());
|
|
|
|
+ toAddList.add(participation);
|
|
|
|
+ });
|
|
|
|
+ if (toAddList.size() > 0) {
|
|
|
|
+ participationMapper.insertBatch(toAddList);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|