Merge branch 'develop_migration' into 'develop_master'
Develop migration See merge request LiuChao/foton-slrs-system-rest!504
This commit is contained in:
@@ -22,7 +22,9 @@ public class SearchCenter {
|
|||||||
// private Integer countStand;
|
// private Integer countStand;
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@ApiModelProperty(value = "执行参数 ALL 存在更新 不存在新增 ,UPD 只 更新存在 es 里的标准 ,ADD 只新增不存在 es 的标准, DEL 只删除不存在标准库的数据(删除只能用DEL 减少自动错删)")
|
@ApiModelProperty(value = "执行参数 ALL 存在更新 不存在新增 ,UPD 只 更新存在 es 里的标准 ,ADD 只新增不存在 es 的标准," +
|
||||||
|
" DEL 只删除不存在标准库的数据(删除只能用DEL 减少自动错删)," +
|
||||||
|
"UPDATENONEXISTENT (只支持文本查询接口)更新不存在字段业务数据(其他任务导致ES不同步)")
|
||||||
private String execType;
|
private String execType;
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
|
|||||||
@@ -263,8 +263,20 @@ public class ResetSearchCenterService {
|
|||||||
String search = getSearch(searchCenter);
|
String search = getSearch(searchCenter);
|
||||||
|
|
||||||
List<Map<String, Object>> searchListData = elasticsearchService.searchAll("fulltextserch",search);
|
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");
|
page.setValidFlag("0");
|
||||||
if(searchCenter.getIdList() != null && !searchCenter.getIdList().isEmpty()){
|
if(searchCenter.getIdList() != null && !searchCenter.getIdList().isEmpty()){
|
||||||
@@ -286,8 +298,9 @@ public class ResetSearchCenterService {
|
|||||||
if(!esIdList.isEmpty()){
|
if(!esIdList.isEmpty()){
|
||||||
|
|
||||||
// 交集 更新
|
// 交集 更新
|
||||||
|
List<String> finalEsIdList = esIdList;
|
||||||
List<SarStandardsInfo> intersection = rowsStand.stream()
|
List<SarStandardsInfo> intersection = rowsStand.stream()
|
||||||
.filter(item -> new ArrayList<>(esIdList)
|
.filter(item -> new ArrayList<>(finalEsIdList)
|
||||||
.contains(item.getId()))
|
.contains(item.getId()))
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
if(searchCenter.getIdList() != null && !searchCenter.getIdList().isEmpty() && !intersection.isEmpty()){
|
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){
|
for(SarStandardsInfo sarStandardsInfoEO : updList){
|
||||||
countUpdateSuccess++;
|
countUpdateSuccess++;
|
||||||
standFunc(sarStandardsInfoEO);
|
standFunc(sarStandardsInfoEO);
|
||||||
@@ -521,7 +535,19 @@ public class ResetSearchCenterService {
|
|||||||
|
|
||||||
List<Map<String, Object>> searchListData = elasticsearchService.searchAll("fulltextserch",search);
|
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");
|
sarLawsInfoEOPage.setLawsType("FOREIGN");
|
||||||
|
|
||||||
@@ -544,8 +570,9 @@ public class ResetSearchCenterService {
|
|||||||
if(!esIdList.isEmpty()){
|
if(!esIdList.isEmpty()){
|
||||||
|
|
||||||
// 交集 更新
|
// 交集 更新
|
||||||
|
List<String> finalEsIdList = esIdList;
|
||||||
List<SarLawsStandInfo> intersection = rowsStand.stream()
|
List<SarLawsStandInfo> intersection = rowsStand.stream()
|
||||||
.filter(item -> new ArrayList<>(esIdList)
|
.filter(item -> new ArrayList<>(finalEsIdList)
|
||||||
.contains(item.getId()))
|
.contains(item.getId()))
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
if(searchCenter.getIdList() != null && !searchCenter.getIdList().isEmpty() && !intersection.isEmpty()){
|
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){
|
for(SarLawsStandInfo sarLawsInfoEO : updList){
|
||||||
countUpdateSuccess++;
|
countUpdateSuccess++;
|
||||||
lawsAttrInfoShowSearchDetails(sarLawsInfoEO);
|
lawsAttrInfoShowSearchDetails(sarLawsInfoEO);
|
||||||
@@ -839,7 +867,19 @@ public class ResetSearchCenterService {
|
|||||||
|
|
||||||
List<Map<String, Object>> searchListData = elasticsearchService.searchAll("fulltextserch",search);
|
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.setValidFlag("0");
|
||||||
sarBussionessStandEOPage.setOrderBy("SAR_BUSSIONESS_STAND.issue_time is null,SAR_BUSSIONESS_STAND.issue_time desc,SAR_BUSSIONESS_STAND.id");
|
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()){
|
if(!esIdList.isEmpty()){
|
||||||
|
|
||||||
// 交集 更新
|
// 交集 更新
|
||||||
|
List<String> finalEsIdList = esIdList;
|
||||||
List<SarBussionessStand> intersection = rowsStand.stream()
|
List<SarBussionessStand> intersection = rowsStand.stream()
|
||||||
.filter(item -> new ArrayList<>(esIdList)
|
.filter(item -> new ArrayList<>(finalEsIdList)
|
||||||
.contains(item.getId()))
|
.contains(item.getId()))
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
if(searchCenter.getIdList() != null && !searchCenter.getIdList().isEmpty() && !intersection.isEmpty()){
|
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){
|
for(SarBussionessStand sarBussionessStandEO : updList){
|
||||||
countUpdateSuccess++;
|
countUpdateSuccess++;
|
||||||
bussAttrInfoShowSearchDetails(sarBussionessStandEO);
|
bussAttrInfoShowSearchDetails(sarBussionessStandEO);
|
||||||
|
|||||||
Reference in New Issue
Block a user