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