|
|
@@ -21,10 +21,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
21
|
21
|
import org.springframework.stereotype.Service;
|
|
22
|
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
|
25
|
import java.util.function.Function;
|
|
29
|
26
|
import java.util.stream.Collectors;
|
|
30
|
27
|
|
|
|
@@ -344,28 +341,29 @@ public class CaseApplicationLogServiceImpl implements CaseApplicationLogService
|
|
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
|
354
|
changeColumn.append("fileColumn");
|
|
355
|
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
|
358
|
if(!afterAttachMap.containsKey(beforeCaseAttach.getAnnexPath())) {
|
|
361
|
359
|
changeColumn.append("fileColumn");
|
|
362
|
360
|
break;
|
|
363
|
361
|
}
|
|
364
|
362
|
}
|
|
365
|
363
|
}
|
|
366
|
|
-
|
|
367
|
|
-
|
|
368
|
364
|
}
|
|
|
365
|
+
|
|
|
366
|
+
|
|
369
|
367
|
compareCaseVO.setChangeColumn(changeColumn.toString());
|
|
370
|
368
|
if(CollectionUtil.isNotEmpty(afterCase.getCaseAttachList())){
|
|
371
|
369
|
List<CaseAttach> caseAttachList = afterCase.getCaseAttachList();
|