feat: There is no way the, 优化ES

This commit is contained in:
super_liu
2022-04-30 18:45:45 +08:00
parent bfc902b32f
commit c2049f4a9d
2 changed files with 87 additions and 34 deletions
@@ -75,6 +75,9 @@ public class ResetSearchCenterService {
int count = iSarStandardsInfoService.count(qw);
standSearch.setExecType(searchCenter.getExecType());
standSearch.setCountStand(count);
if(searchCenter.getIdList() != null && !searchCenter.getIdList().isEmpty()){
standSearch.setIdList(searchCenter.getIdList());
}
SarStandardsInfoEOPage page = new SarStandardsInfoEOPage();
ResponseMessage stand = resetStandSearchCenter(page,standSearch);
List<String> r = new ArrayList<>();
@@ -88,6 +91,9 @@ public class ResetSearchCenterService {
int count2 = iSarLawsStandInfoService.count(qw2);
lawsSearch.setExecType(searchCenter.getExecType());
lawsSearch.setCountStand(count2);
if(searchCenter.getIdList() != null && !searchCenter.getIdList().isEmpty()){
lawsSearch.setIdList(searchCenter.getIdList());
}
SarLawsStandInfoPage lawsPage = new SarLawsStandInfoPage();
ResponseMessage laws = resetLawsSearchCenter(lawsPage,lawsSearch);
if(laws.isOk() && StringUtils.isNotBlank(laws.getData().toString())){
@@ -100,6 +106,9 @@ public class ResetSearchCenterService {
int count3 = iSarBussionessStandService.count(qw3);
bussSearch.setExecType(searchCenter.getExecType());
bussSearch.setCountStand(count3);
if(searchCenter.getIdList() != null && !searchCenter.getIdList().isEmpty()){
bussSearch.setIdList(searchCenter.getIdList());
}
SarBussionessStandEOPage bussPage = new SarBussionessStandEOPage();
ResponseMessage buss = resetBussStandSearchCenter(bussPage,bussSearch);
if(buss.isOk() && StringUtils.isNotBlank(buss.getData().toString())){
@@ -200,14 +209,26 @@ public class ResetSearchCenterService {
.filter(item -> !new ArrayList<>(esIdList)
.contains(item.getId()))
.collect(Collectors.toList());
insList.addAll(distinctByUniqueList);
if(searchCenter.getIdList() != null && !searchCenter.getIdList().isEmpty() && !distinctByUniqueList.isEmpty()){
List<SarStandardsInfo> collect = distinctByUniqueList.stream()
.filter(item -> searchCenter.getIdList().contains(item.getId())).collect(Collectors.toList());
insList.addAll(collect);
}else{
insList.addAll(distinctByUniqueList);
}
// 交集 更新
List<SarStandardsInfo> intersection = rowsStand.stream()
.filter(item -> new ArrayList<>(esIdList)
.contains(item.getId()))
.collect(Collectors.toList());
updList.addAll(intersection);
if(searchCenter.getIdList() != null && !searchCenter.getIdList().isEmpty() && !intersection.isEmpty()){
List<SarStandardsInfo> collect = intersection.stream()
.filter(item -> searchCenter.getIdList().contains(item.getId())).collect(Collectors.toList());
updList.addAll(collect);
}else{
updList.addAll(intersection);
}
// 差集 (list2 - list1) 删除
List<String> delDataList = esIdList.stream().filter(num -> !standIdList.contains(num))
@@ -287,14 +308,25 @@ public class ResetSearchCenterService {
.filter(item -> !new ArrayList<>(esIdList)
.contains(item.getId()))
.collect(Collectors.toList());
insList.addAll(distinctByUniqueList);
if(searchCenter.getIdList() != null && !searchCenter.getIdList().isEmpty() && !distinctByUniqueList.isEmpty()){
List<SarLawsStandInfo> collect = distinctByUniqueList.stream()
.filter(item -> searchCenter.getIdList().contains(item.getId())).collect(Collectors.toList());
insList.addAll(collect);
}else{
insList.addAll(distinctByUniqueList);
}
// 交集 更新
List<SarLawsStandInfo> intersection = rowsStand.stream()
.filter(item -> new ArrayList<>(esIdList)
.contains(item.getId()))
.collect(Collectors.toList());
updList.addAll(intersection);
if(searchCenter.getIdList() != null && !searchCenter.getIdList().isEmpty() && !intersection.isEmpty()){
List<SarLawsStandInfo> collect = intersection.stream()
.filter(item -> searchCenter.getIdList().contains(item.getId())).collect(Collectors.toList());
updList.addAll(collect);
}else{
updList.addAll(intersection);
}
// 差集 (list2 - list1) 删除
List<String> delDataList = esIdList.stream().filter(num -> !standIdList.contains(num))
@@ -387,14 +419,26 @@ public class ResetSearchCenterService {
.filter(item -> !new ArrayList<>(esIdList)
.contains(item.getId()))
.collect(Collectors.toList());
insList.addAll(distinctByUniqueList);
if(searchCenter.getIdList() != null && !searchCenter.getIdList().isEmpty() && !distinctByUniqueList.isEmpty()){
List<SarBussionessStand> collect = distinctByUniqueList.stream()
.filter(item -> searchCenter.getIdList().contains(item.getId())).collect(Collectors.toList());
insList.addAll(collect);
}else{
insList.addAll(distinctByUniqueList);
}
// 交集 更新
List<SarBussionessStand> intersection = rowsStand.stream()
.filter(item -> new ArrayList<>(esIdList)
.contains(item.getId()))
.collect(Collectors.toList());
updList.addAll(intersection);
if(searchCenter.getIdList() != null && !searchCenter.getIdList().isEmpty() && !intersection.isEmpty()){
List<SarBussionessStand> collect = intersection.stream()
.filter(item -> searchCenter.getIdList().contains(item.getId())).collect(Collectors.toList());
updList.addAll(collect);
}else{
updList.addAll(intersection);
}
// 差集 (list2 - list1) 删除
List<String> delDataList = esIdList.stream().filter(num -> !standIdList.contains(num))