feat: There is no way the,xxx
This commit is contained in:
@@ -22,7 +22,9 @@ public class SearchCenter {
|
||||
// private Integer countStand;
|
||||
|
||||
@NotNull
|
||||
@ApiModelProperty(value = "执行参数 ALL 存在更新 不存在新增 ,UPD 只 更新存在 es 里的标准 ,ADD 只新增不存在 es 的标准, DEL 只删除不存在标准库的数据(删除只能用DEL 减少自动错删)")
|
||||
@ApiModelProperty(value = "执行参数 ALL 存在更新 不存在新增 ,UPD 只 更新存在 es 里的标准 ,ADD 只新增不存在 es 的标准," +
|
||||
" DEL 只删除不存在标准库的数据(删除只能用DEL 减少自动错删)," +
|
||||
"UPDATENONEXISTENT (只支持文本查询接口)更新不存在字段业务数据(其他任务导致ES不同步)")
|
||||
private String execType;
|
||||
|
||||
@NotNull
|
||||
|
||||
@@ -263,8 +263,20 @@ public class ResetSearchCenterService {
|
||||
String search = getSearch(searchCenter);
|
||||
|
||||
List<Map<String, Object>> searchListData = elasticsearchService.searchAll("fulltextserch",search);
|
||||
List<String> esIdList = new ArrayList<>();
|
||||
if("UPDATENONEXISTENT".equals(searchCenter.getExecType().toUpperCase())){
|
||||
List<Map<String, Object>> filterList = searchListData.stream().filter(stringObjectMap -> {
|
||||
if(stringObjectMap.get("standTypeOrder") == null){
|
||||
return true;
|
||||
}else {
|
||||
return false;
|
||||
}
|
||||
}).collect(Collectors.toList());
|
||||
esIdList = filterList.stream().map(stringObjectMap -> stringObjectMap.get("id").toString()).collect(Collectors.toList());
|
||||
}else {
|
||||
esIdList = searchListData.stream().map(stringObjectMap -> stringObjectMap.get("id").toString()).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
List<String> esIdList = searchListData.stream().map(stringObjectMap -> stringObjectMap.get("id").toString()).collect(Collectors.toList());
|
||||
|
||||
page.setValidFlag("0");
|
||||
if(searchCenter.getIdList() != null && !searchCenter.getIdList().isEmpty()){
|
||||
@@ -286,8 +298,9 @@ public class ResetSearchCenterService {
|
||||
if(!esIdList.isEmpty()){
|
||||
|
||||
// 交集 更新
|
||||
List<String> finalEsIdList = esIdList;
|
||||
List<SarStandardsInfo> intersection = rowsStand.stream()
|
||||
.filter(item -> new ArrayList<>(esIdList)
|
||||
.filter(item -> new ArrayList<>(finalEsIdList)
|
||||
.contains(item.getId()))
|
||||
.collect(Collectors.toList());
|
||||
if(searchCenter.getIdList() != null && !searchCenter.getIdList().isEmpty() && !intersection.isEmpty()){
|
||||
|
||||
Reference in New Issue
Block a user