|
@@ -195,6 +195,8 @@ public class WeiXinCorpController {
|
|
|
|
|
|
@Resource
|
|
|
private RedisUtil redisUtil;
|
|
|
+ @Autowired
|
|
|
+ private ProjectDeptRelateMapper projectDeptRelateMapper;
|
|
|
|
|
|
public class Item {
|
|
|
public String jsTicket = null;
|
|
@@ -2585,6 +2587,22 @@ public class WeiXinCorpController {
|
|
|
}*/
|
|
|
List<String> stringList = newUserList.stream().filter(u -> u != null && org.apache.commons.lang3.StringUtils.isNotEmpty(u.getCorpwxUserid())).map(User::getCorpwxUserid).distinct().collect(Collectors.toList());
|
|
|
wxCorpInfoService.getUserByCompanyIdAndTransferLicenseBatch(companyId,stringList);
|
|
|
+ //员工的部门如果全部参与了项目,那这个员工也自动变成项目参与人
|
|
|
+ List<Participation> autoAddParticiList = new ArrayList<>();
|
|
|
+ for (User user : newUserList) {
|
|
|
+ List<ProjectDeptRelate> joinProjectList = projectDeptRelateMapper.selectList(new QueryWrapper<ProjectDeptRelate>().eq("department_id", user.getDepartmentId()));
|
|
|
+ if (joinProjectList.size() > 0) {
|
|
|
+ for (ProjectDeptRelate projectDeptRelate : joinProjectList) {
|
|
|
+ Participation participation = new Participation();
|
|
|
+ participation.setUserId(user.getId());
|
|
|
+ participation.setProjectId(projectDeptRelate.getProjectId());
|
|
|
+ autoAddParticiList.add(participation);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (autoAddParticiList.size() > 0) {
|
|
|
+ participationMapper.insertBatch(autoAddParticiList);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
//姓名,部门,账号的同步更新
|