yurk 2 年之前
父节点
当前提交
f4a40346dc

+ 8 - 6
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/TaskController.java

@@ -120,12 +120,14 @@ public class TaskController {
             //检查执行人是否在当前分组的参与人当中
             List<GroupParticipator> groupParticipatorList = groupParticipatorMapper.selectList(new QueryWrapper<GroupParticipator>().eq("group_id", task.getGroupId()));
             for (TaskExecutor executor : executorList) {
-                boolean b = groupParticipatorList.stream().anyMatch(gp -> gp.getUserId().equals(executor.getExecutorId()));
-                if(!b){
-                    GroupParticipator g=new GroupParticipator();
-                    g.setGroupId(task.getGroupId());
-                    g.setUserId(executor.getExecutorId());
-                    groupParticipatorMapper.insert(g);
+                if(executor.getExecutorId()!=null){
+                    boolean b = groupParticipatorList.stream().anyMatch(gp -> gp.getUserId().equals(executor.getExecutorId()));
+                    if(!b){
+                        GroupParticipator g=new GroupParticipator();
+                        g.setGroupId(task.getGroupId());
+                        g.setUserId(executor.getExecutorId());
+                        groupParticipatorMapper.insert(g);
+                    }
                 }
             }
         }