Merge branch 'develop_master' into FOTON
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()){
|
||||
@@ -301,7 +314,8 @@ public class ResetSearchCenterService {
|
||||
|
||||
}
|
||||
|
||||
if(!updList.isEmpty() && ("ALL".equals(searchCenter.getExecType().toUpperCase()) || "UPD".equals(searchCenter.getExecType().toUpperCase()))){
|
||||
if(!updList.isEmpty() && ("ALL".equals(searchCenter.getExecType().toUpperCase()) || "UPD".equals(searchCenter.getExecType().toUpperCase())
|
||||
|| "UPDATENONEXISTENT".equals(searchCenter.getExecType().toUpperCase()))){
|
||||
for(SarStandardsInfo sarStandardsInfoEO : updList){
|
||||
countUpdateSuccess++;
|
||||
standFunc(sarStandardsInfoEO);
|
||||
@@ -521,7 +535,19 @@ public class ResetSearchCenterService {
|
||||
|
||||
List<Map<String, Object>> searchListData = elasticsearchService.searchAll("fulltextserch",search);
|
||||
|
||||
List<String> esIdList = searchListData.stream().map(stringObjectMap -> stringObjectMap.get("id").toString()).collect(Collectors.toList());
|
||||
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());
|
||||
}
|
||||
|
||||
sarLawsInfoEOPage.setLawsType("FOREIGN");
|
||||
|
||||
@@ -544,8 +570,9 @@ public class ResetSearchCenterService {
|
||||
if(!esIdList.isEmpty()){
|
||||
|
||||
// 交集 更新
|
||||
List<String> finalEsIdList = esIdList;
|
||||
List<SarLawsStandInfo> 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()){
|
||||
@@ -559,7 +586,8 @@ public class ResetSearchCenterService {
|
||||
|
||||
}
|
||||
|
||||
if(!updList.isEmpty() && ("ALL".equals(searchCenter.getExecType().toUpperCase()) || "UPD".equals(searchCenter.getExecType().toUpperCase()))){
|
||||
if(!updList.isEmpty() && ("ALL".equals(searchCenter.getExecType().toUpperCase()) || "UPD".equals(searchCenter.getExecType().toUpperCase())
|
||||
|| "UPDATENONEXISTENT".equals(searchCenter.getExecType().toUpperCase()))){
|
||||
for(SarLawsStandInfo sarLawsInfoEO : updList){
|
||||
countUpdateSuccess++;
|
||||
lawsAttrInfoShowSearchDetails(sarLawsInfoEO);
|
||||
@@ -839,7 +867,19 @@ public class ResetSearchCenterService {
|
||||
|
||||
List<Map<String, Object>> searchListData = elasticsearchService.searchAll("fulltextserch",search);
|
||||
|
||||
List<String> esIdList = searchListData.stream().map(stringObjectMap -> stringObjectMap.get("id").toString()).collect(Collectors.toList());
|
||||
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());
|
||||
}
|
||||
|
||||
sarBussionessStandEOPage.setValidFlag("0");
|
||||
sarBussionessStandEOPage.setOrderBy("SAR_BUSSIONESS_STAND.issue_time is null,SAR_BUSSIONESS_STAND.issue_time desc,SAR_BUSSIONESS_STAND.id");
|
||||
@@ -868,8 +908,9 @@ public class ResetSearchCenterService {
|
||||
if(!esIdList.isEmpty()){
|
||||
|
||||
// 交集 更新
|
||||
List<String> finalEsIdList = esIdList;
|
||||
List<SarBussionessStand> 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()){
|
||||
@@ -881,7 +922,8 @@ public class ResetSearchCenterService {
|
||||
}
|
||||
}
|
||||
|
||||
if(!updList.isEmpty() && ("ALL".equals(searchCenter.getExecType().toUpperCase()) || "UPD".equals(searchCenter.getExecType().toUpperCase()))){
|
||||
if(!updList.isEmpty() && ("ALL".equals(searchCenter.getExecType().toUpperCase()) || "UPD".equals(searchCenter.getExecType().toUpperCase())
|
||||
|| "UPDATENONEXISTENT".equals(searchCenter.getExecType().toUpperCase()))){
|
||||
for(SarBussionessStand sarBussionessStandEO : updList){
|
||||
countUpdateSuccess++;
|
||||
bussAttrInfoShowSearchDetails(sarBussionessStandEO);
|
||||
|
||||
Reference in New Issue
Block a user