18792927508 2 lat temu
rodzic
commit
320398289d

+ 15
- 17
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationLogServiceImpl.java Wyświetl plik

21
 import org.springframework.stereotype.Service;
21
 import org.springframework.stereotype.Service;
22
 import org.springframework.transaction.annotation.Transactional;
22
 import org.springframework.transaction.annotation.Transactional;
23
 
23
 
24
-import java.util.Date;
25
-import java.util.List;
26
-import java.util.Map;
27
-import java.util.Objects;
24
+import java.util.*;
28
 import java.util.function.Function;
25
 import java.util.function.Function;
29
 import java.util.stream.Collectors;
26
 import java.util.stream.Collectors;
30
 
27
 
344
 
341
 
345
 
342
 
346
         }
343
         }
347
-        boolean notEmptyFlag = CollectionUtil.isNotEmpty(beforeCase.getCaseAttachList()) && CollectionUtil.isEmpty(afterCase.getCaseAttachList());
348
-        boolean emptyFlag = CollectionUtil.isEmpty(beforeCase.getCaseAttachList()) && CollectionUtil.isNotEmpty(afterCase.getCaseAttachList());
349
-        // 对比附件
350
-        if(notEmptyFlag || emptyFlag){
351
-            changeColumn.append("fileColumn");
352
-        }else if(CollectionUtil.isNotEmpty(beforeCase.getCaseAttachList()) && CollectionUtil.isNotEmpty(afterCase.getCaseAttachList())){
353
-            if(beforeCase.getCaseAttachList().size()!=afterCase.getCaseAttachList().size()){
344
+        List<CaseAttach> beforeAttachFilter =new ArrayList<>();
345
+        List<CaseAttach> afterAttachFilter =new ArrayList<>();
346
+        if(CollectionUtil.isNotEmpty(beforeCase.getCaseAttachList())){
347
+            beforeAttachFilter = beforeCase.getCaseAttachList().stream().filter(n -> n.getAnnexType() == 2).collect(Collectors.toList());
348
+        }
349
+        if(CollectionUtil.isNotEmpty(beforeCase.getCaseAttachList())){
350
+          afterAttachFilter = afterCase.getCaseAttachList().stream().filter(n -> n.getAnnexType() == 2).collect(Collectors.toList());
351
+        }
352
+        if(CollectionUtil.isNotEmpty(beforeAttachFilter)&& CollectionUtil.isNotEmpty(afterAttachFilter)){
353
+            if(beforeAttachFilter.size()!=afterAttachFilter.size()){
354
                 changeColumn.append("fileColumn");
354
                 changeColumn.append("fileColumn");
355
             }else {
355
             }else {
356
-                Map<String, CaseAttach> afterAttachMap = afterCase.getCaseAttachList().stream().collect(Collectors.toMap(CaseAttach::getAnnexPath, Function.identity(), (n1, n2) -> n2));
357
-
358
-
359
-                for (CaseAttach beforeCaseAttach : beforeCase.getCaseAttachList()) {
356
+                Map<String, CaseAttach> afterAttachMap = afterAttachFilter.stream().collect(Collectors.toMap(CaseAttach::getAnnexPath, Function.identity(), (n1, n2) -> n2));
357
+                for (CaseAttach beforeCaseAttach : beforeAttachFilter) {
360
                     if(!afterAttachMap.containsKey(beforeCaseAttach.getAnnexPath())) {
358
                     if(!afterAttachMap.containsKey(beforeCaseAttach.getAnnexPath())) {
361
                         changeColumn.append("fileColumn");
359
                         changeColumn.append("fileColumn");
362
                         break;
360
                         break;
363
                     }
361
                     }
364
                 }
362
                 }
365
             }
363
             }
366
-
367
-
368
         }
364
         }
365
+
366
+      
369
         compareCaseVO.setChangeColumn(changeColumn.toString());
367
         compareCaseVO.setChangeColumn(changeColumn.toString());
370
         if(CollectionUtil.isNotEmpty(afterCase.getCaseAttachList())){
368
         if(CollectionUtil.isNotEmpty(afterCase.getCaseAttachList())){
371
             List<CaseAttach> caseAttachList = afterCase.getCaseAttachList();
369
             List<CaseAttach> caseAttachList = afterCase.getCaseAttachList();