Min 1 年之前
父節點
當前提交
414115cf89

+ 20 - 13
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/ProjectController.java

@@ -1259,6 +1259,11 @@ public class ProjectController {
                         item.setInchargerId(first.get().getId())
                                 .setInchargerName(first.get().getName());
                     }
+                    boolean isUpdate=false;
+                    if(!item.getInchargerId().equals(first.get().getId())){
+                        update++;
+                        isUpdate=true;
+                    }
                     projectService.updateById(item);
                     List<Participation> allParticipations = participationService.list(new QueryWrapper<Participation>().eq("project_id", item.getId()));
                     if(map.get("xmcygs")!=null&&!map.get("xmcygs").equals("")){
@@ -1273,19 +1278,21 @@ public class ProjectController {
                                 participationList.add(p);
                             }
                         }
-                    }
-                    List<String> collect = allParticipations.stream().map(al -> al.getUserId()).distinct().collect(Collectors.toList());
-                    List<String> collect1 = participationList.stream().map(pl -> pl.getUserId()).distinct().collect(Collectors.toList());
-                    System.out.println("之前的数据:"+collect);
-                    System.out.println("之后的数据:"+collect1);
-                    if(collect.size()!=collect1.size()){
-                        sb.append("["+item.getProjectName()+"/"+item.getProjectCode()+"]"+"\n");
-                        update++;
-                    }else if(!collect.containsAll(collect1)){
-                        sb.append("["+item.getProjectName()+"/"+item.getProjectCode()+"]"+"\n");
-                        update++;
-                    }else if(first.isPresent()&&!item.getInchargerId().equals(first.get().getId())){
-                        update++;
+                        List<String> collect = allParticipations.stream().map(al -> al.getUserId()).distinct().collect(Collectors.toList());
+                        List<String> collect1 = participationList.stream().map(pl -> pl.getUserId()).distinct().collect(Collectors.toList());
+                        System.out.println("之前的数据:"+collect);
+                        System.out.println("之后的数据:"+collect1);
+                        if(collect.size()!=collect1.size()){
+                            sb.append("["+item.getProjectName()+"/"+item.getProjectCode()+"]"+"\n");
+                            if(!isUpdate){
+                                update++;
+                            }
+                        }else if(!collect.containsAll(collect1)){
+                            sb.append("["+item.getProjectName()+"/"+item.getProjectCode()+"]"+"\n");
+                            if(!isUpdate){
+                                update++;
+                            }
+                        }
                     }
                     if(participationList.size()>0){
                         participationService.saveBatch(participationList);

+ 21 - 13
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/task/TimingTask.java

@@ -591,6 +591,11 @@ public class TimingTask {
                             item.setInchargerId(first.get().getId())
                                     .setInchargerName(first.get().getName());
                         }
+                        boolean isUpdate=false;
+                        if(!item.getInchargerId().equals(first.get().getId())){
+                            update++;
+                            isUpdate=true;
+                        }
                         projectService.updateById(item);
                         List<Participation> allParticipations = participationService.list(new QueryWrapper<Participation>().eq("project_id", item.getId()));
                         if(map.get("xmcygs")!=null&&!map.get("xmcygs").equals("")){
@@ -605,19 +610,22 @@ public class TimingTask {
                                     participationList.add(p);
                                 }
                             }
-                        }
-                        List<String> collect = allParticipations.stream().map(al -> al.getUserId()).distinct().collect(Collectors.toList());
-                        List<String> collect1 = participationList.stream().map(pl -> pl.getUserId()).distinct().collect(Collectors.toList());
-                        System.out.println("之前的数据:"+collect);
-                        System.out.println("之后的数据:"+collect1);
-                        if(collect.size()!=collect1.size()){
-                            sb.append("["+item.getProjectName()+"/"+item.getProjectCode()+"]"+"\n");
-                            update++;
-                        }else if(!collect.containsAll(collect1)){
-                            sb.append("["+item.getProjectName()+"/"+item.getProjectCode()+"]"+"\n");
-                            update++;
-                        }else if(!item.getInchargerId().equals(first.get().getId())){
-                            update++;
+                            List<String> collect = allParticipations.stream().map(al -> al.getUserId()).distinct().collect(Collectors.toList());
+                            List<String> collect1 = participationList.stream().map(pl -> pl.getUserId()).distinct().collect(Collectors.toList());
+                            System.out.println("之前的数据:"+collect);
+                            System.out.println("之后的数据:"+collect1);
+                            if(collect.size()!=collect1.size()){
+                                sb.append("["+item.getProjectName()+"/"+item.getProjectCode()+"]"+"\n");
+                                if(!isUpdate){
+                                    update++;
+                                }
+
+                            }else if(!collect.containsAll(collect1)){
+                                sb.append("["+item.getProjectName()+"/"+item.getProjectCode()+"]"+"\n");
+                                if(!isUpdate){
+                                    update++;
+                                }
+                            }
                         }
                         if(participationList.size()>0){
                             participationService.saveBatch(participationList);