|
@@ -68,6 +68,8 @@ public class TaskController {
|
|
|
@Resource
|
|
|
private TaskExecutorMapper taskExecutorMapper;
|
|
|
@Resource
|
|
|
+ private ParticipationMapper participationMapper;
|
|
|
+ @Resource
|
|
|
private TaskExecutorService taskExecutorService;
|
|
|
@Resource
|
|
|
private CompanyDingdingService companyDingdingService;
|
|
@@ -122,6 +124,7 @@ public class TaskController {
|
|
|
task.setPlanHours(executorList.stream().mapToInt(TaskExecutor::getPlanHours).sum());
|
|
|
//检查执行人是否在当前分组的参与人当中
|
|
|
List<GroupParticipator> groupParticipatorList = groupParticipatorMapper.selectList(new QueryWrapper<GroupParticipator>().eq("group_id", task.getGroupId()));
|
|
|
+ List<Participation> participationList = participationMapper.selectList(new QueryWrapper<Participation>().eq("project_id", task.getProjectId()));
|
|
|
for (TaskExecutor executor : executorList) {
|
|
|
if(executor.getExecutorId()!=null){
|
|
|
boolean b = groupParticipatorList.stream().anyMatch(gp -> gp.getUserId() != null && gp.getUserId().equals(executor.getExecutorId()));
|
|
@@ -131,6 +134,13 @@ public class TaskController {
|
|
|
g.setUserId(executor.getExecutorId());
|
|
|
groupParticipatorMapper.insert(g);
|
|
|
}
|
|
|
+ boolean b1 = participationList.stream().anyMatch(pl -> pl.getUserId() != null && pl.getUserId().equals(executor.getExecutorId()));
|
|
|
+ if(!b1){
|
|
|
+ Participation participation=new Participation();
|
|
|
+ participation.setUserId(executor.getExecutorId());
|
|
|
+ participation.setProjectId(task.getProjectId());
|
|
|
+ participationMapper.insert(participation);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|