duibi #270
+15
-17
@@ -21,10 +21,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@@ -344,28 +341,29 @@ public class CaseApplicationLogServiceImpl implements CaseApplicationLogService
|
||||
|
||||
|
||||
}
|
||||
boolean notEmptyFlag = CollectionUtil.isNotEmpty(beforeCase.getCaseAttachList()) && CollectionUtil.isEmpty(afterCase.getCaseAttachList());
|
||||
boolean emptyFlag = CollectionUtil.isEmpty(beforeCase.getCaseAttachList()) && CollectionUtil.isNotEmpty(afterCase.getCaseAttachList());
|
||||
// 对比附件
|
||||
if(notEmptyFlag || emptyFlag){
|
||||
changeColumn.append("fileColumn");
|
||||
}else if(CollectionUtil.isNotEmpty(beforeCase.getCaseAttachList()) && CollectionUtil.isNotEmpty(afterCase.getCaseAttachList())){
|
||||
if(beforeCase.getCaseAttachList().size()!=afterCase.getCaseAttachList().size()){
|
||||
List<CaseAttach> beforeAttachFilter =new ArrayList<>();
|
||||
List<CaseAttach> afterAttachFilter =new ArrayList<>();
|
||||
if(CollectionUtil.isNotEmpty(beforeCase.getCaseAttachList())){
|
||||
beforeAttachFilter = beforeCase.getCaseAttachList().stream().filter(n -> n.getAnnexType() == 2).collect(Collectors.toList());
|
||||
}
|
||||
if(CollectionUtil.isNotEmpty(beforeCase.getCaseAttachList())){
|
||||
afterAttachFilter = afterCase.getCaseAttachList().stream().filter(n -> n.getAnnexType() == 2).collect(Collectors.toList());
|
||||
}
|
||||
if(CollectionUtil.isNotEmpty(beforeAttachFilter)&& CollectionUtil.isNotEmpty(afterAttachFilter)){
|
||||
if(beforeAttachFilter.size()!=afterAttachFilter.size()){
|
||||
changeColumn.append("fileColumn");
|
||||
}else {
|
||||
Map<String, CaseAttach> afterAttachMap = afterCase.getCaseAttachList().stream().collect(Collectors.toMap(CaseAttach::getAnnexPath, Function.identity(), (n1, n2) -> n2));
|
||||
|
||||
|
||||
for (CaseAttach beforeCaseAttach : beforeCase.getCaseAttachList()) {
|
||||
Map<String, CaseAttach> afterAttachMap = afterAttachFilter.stream().collect(Collectors.toMap(CaseAttach::getAnnexPath, Function.identity(), (n1, n2) -> n2));
|
||||
for (CaseAttach beforeCaseAttach : beforeAttachFilter) {
|
||||
if(!afterAttachMap.containsKey(beforeCaseAttach.getAnnexPath())) {
|
||||
changeColumn.append("fileColumn");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
compareCaseVO.setChangeColumn(changeColumn.toString());
|
||||
if(CollectionUtil.isNotEmpty(afterCase.getCaseAttachList())){
|
||||
List<CaseAttach> caseAttachList = afterCase.getCaseAttachList();
|
||||
|
||||
Reference in New Issue
Block a user