Merge branch 'develop_migration' into 'develop_master'
feat: There is no way the, 文本索引 根据条件查询 更新索引数据 See merge request LiuChao/foton-slrs-system-rest!492
This commit is contained in:
@@ -12,6 +12,8 @@ import com.adc.da.util.http.Result;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.elasticsearch.index.query.BoolQueryBuilder;
|
||||
import org.elasticsearch.index.query.QueryBuilders;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -29,6 +31,17 @@ public class ResetSearchCenterController extends BaseController<Map<String, Obje
|
||||
|
||||
@Autowired
|
||||
private ResetSearchCenterService resetSearchCenterService;
|
||||
|
||||
@ApiOperation(value = "|Search|文本条件搜索更新标准数据索引")
|
||||
@PostMapping(value="/resetALLSearchCenterToSearch")
|
||||
public ResponseMessage resetALLSearchCenterToSearch(@RequestBody SearchCenter searchCenter) throws Exception{
|
||||
ResponseMessage x = verifySearchCenter(searchCenter);
|
||||
if (x != null){
|
||||
return x;
|
||||
}
|
||||
return resetSearchCenterService.resetALLSearchCenterToSearch(searchCenter);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "|SearchCenter|重新创建ALL标准数据索引")
|
||||
@PostMapping(value="/resetALLSearchCenter")
|
||||
public ResponseMessage resetALLSearchCenter(@RequestBody SearchCenter searchCenter) throws Exception{
|
||||
|
||||
@@ -15,6 +15,9 @@ import java.util.List;
|
||||
@Data
|
||||
public class SearchCenter {
|
||||
|
||||
@ApiModelProperty(value = "根据搜索条件")
|
||||
private String search;
|
||||
|
||||
// @ApiModelProperty(value = "分页查询总数 可不填 自动带入总数")
|
||||
// private Integer countStand;
|
||||
|
||||
|
||||
@@ -105,11 +105,66 @@ public class ResetSearchCenterService {
|
||||
client = this.transportClient;
|
||||
}
|
||||
|
||||
@Async
|
||||
public ResponseMessage resetALLSearchCenterToSearch(SearchCenter searchCenter) throws Exception{
|
||||
Boolean getFulltextserchIndex = elasticsearchService.isIndexExist("fulltextserch");
|
||||
SearchCenter standSearch = new SearchCenter();
|
||||
standSearch.setExecType(searchCenter.getExecType());
|
||||
if(StringUtils.isNotBlank(searchCenter.getSearch())){
|
||||
standSearch.setSearch(searchCenter.getSearch());
|
||||
}
|
||||
if(searchCenter.getIdList() != null && !searchCenter.getIdList().isEmpty()){
|
||||
standSearch.setIdList(searchCenter.getIdList());
|
||||
}
|
||||
SarStandardsInfoEOPage page = new SarStandardsInfoEOPage();
|
||||
ResponseMessage stand = resetStandSearchCenterToSearch(page,standSearch);
|
||||
List<String> r = new ArrayList<>();
|
||||
if(stand.isOk() && StringUtils.isNotBlank(stand.getData().toString())){
|
||||
r.add(stand.getData().toString());
|
||||
}
|
||||
|
||||
SearchCenter lawsSearch = new SearchCenter();
|
||||
lawsSearch.setExecType(searchCenter.getExecType());
|
||||
if(StringUtils.isNotBlank(searchCenter.getSearch())){
|
||||
lawsSearch.setSearch(searchCenter.getSearch());
|
||||
}
|
||||
if(searchCenter.getIdList() != null && !searchCenter.getIdList().isEmpty()){
|
||||
lawsSearch.setIdList(searchCenter.getIdList());
|
||||
}
|
||||
SarLawsStandInfoPage lawsPage = new SarLawsStandInfoPage();
|
||||
ResponseMessage laws = resetLawsSearchCenterToSearch(lawsPage,lawsSearch);
|
||||
if(laws.isOk() && StringUtils.isNotBlank(laws.getData().toString())){
|
||||
r.add(laws.getData().toString());
|
||||
}
|
||||
|
||||
SearchCenter bussSearch = new SearchCenter();
|
||||
bussSearch.setExecType(searchCenter.getExecType());
|
||||
if(searchCenter.getIdList() != null && !searchCenter.getIdList().isEmpty()){
|
||||
bussSearch.setIdList(searchCenter.getIdList());
|
||||
}
|
||||
if(StringUtils.isNotBlank(searchCenter.getSearch())){
|
||||
bussSearch.setSearch(searchCenter.getSearch());
|
||||
}
|
||||
SarBussionessStandEOPage bussPage = new SarBussionessStandEOPage();
|
||||
ResponseMessage buss = resetBussStandSearchCenterToSearch(bussPage,bussSearch);
|
||||
if(buss.isOk() && StringUtils.isNotBlank(buss.getData().toString())){
|
||||
r.add(buss.getData().toString());
|
||||
}
|
||||
|
||||
String res = String.join(", ", r);
|
||||
logger.info(res);
|
||||
|
||||
return Result.success(res);
|
||||
}
|
||||
|
||||
@Async
|
||||
public ResponseMessage resetALLSearchCenter(SearchCenter searchCenter) throws Exception{
|
||||
Boolean getFulltextserchIndex = elasticsearchService.isIndexExist("fulltextserch");
|
||||
SearchCenter standSearch = new SearchCenter();
|
||||
standSearch.setExecType(searchCenter.getExecType());
|
||||
if(StringUtils.isNotBlank(searchCenter.getSearch())){
|
||||
standSearch.setSearch(searchCenter.getSearch());
|
||||
}
|
||||
if(searchCenter.getIdList() != null && !searchCenter.getIdList().isEmpty()){
|
||||
standSearch.setIdList(searchCenter.getIdList());
|
||||
}
|
||||
@@ -122,6 +177,9 @@ public class ResetSearchCenterService {
|
||||
|
||||
SearchCenter lawsSearch = new SearchCenter();
|
||||
lawsSearch.setExecType(searchCenter.getExecType());
|
||||
if(StringUtils.isNotBlank(searchCenter.getSearch())){
|
||||
lawsSearch.setSearch(searchCenter.getSearch());
|
||||
}
|
||||
if(searchCenter.getIdList() != null && !searchCenter.getIdList().isEmpty()){
|
||||
lawsSearch.setIdList(searchCenter.getIdList());
|
||||
}
|
||||
@@ -136,6 +194,9 @@ public class ResetSearchCenterService {
|
||||
if(searchCenter.getIdList() != null && !searchCenter.getIdList().isEmpty()){
|
||||
bussSearch.setIdList(searchCenter.getIdList());
|
||||
}
|
||||
if(StringUtils.isNotBlank(searchCenter.getSearch())){
|
||||
bussSearch.setSearch(searchCenter.getSearch());
|
||||
}
|
||||
SarBussionessStandEOPage bussPage = new SarBussionessStandEOPage();
|
||||
ResponseMessage buss = resetBussStandSearchCenter(bussPage,bussSearch);
|
||||
if(buss.isOk() && StringUtils.isNotBlank(buss.getData().toString())){
|
||||
@@ -185,6 +246,78 @@ public class ResetSearchCenterService {
|
||||
return Result.success(res);
|
||||
}
|
||||
|
||||
//重建国内外标准
|
||||
@Async
|
||||
public ResponseMessage resetStandSearchCenterToSearch(SarStandardsInfoEOPage page,SearchCenter searchCenter) throws Exception{
|
||||
|
||||
int countUpdateSuccess = 0;
|
||||
int countAddSuccess = 0;
|
||||
|
||||
Boolean getStandIndex = elasticsearchService.isIndexExist("fulltextserch");
|
||||
|
||||
if(!getStandIndex){
|
||||
logger.info("ES 不存在索引:fulltextserch");
|
||||
return Result.error("ES 不存在索引:fulltextserch");
|
||||
}
|
||||
|
||||
String search = getSearch(searchCenter);
|
||||
|
||||
List<Map<String, Object>> searchListData = elasticsearchService.searchAll("fulltextserch",search);
|
||||
|
||||
List<String> esIdList = searchListData.stream().map(stringObjectMap -> stringObjectMap.get("id").toString()).collect(Collectors.toList());
|
||||
|
||||
page.setValidFlag("0");
|
||||
if(searchCenter.getIdList() != null && !searchCenter.getIdList().isEmpty()){
|
||||
String[] result = searchCenter.getIdList().toArray(new String[0]);
|
||||
page.setIdlist(result);
|
||||
}
|
||||
QueryWrapper qw = new QueryWrapper();
|
||||
qw.eq("VALID_FLAG","0");
|
||||
int count = iSarStandardsInfoService.count(qw);
|
||||
if(count > 0){
|
||||
page.setPageSize(count);
|
||||
page.setMenuId("nomenu");
|
||||
page.setStandType("ALL");
|
||||
List<SarStandardsInfo> rowsStand = iSarStandardsInfoService.getSarStandardsInfoPage(page);
|
||||
List<SarStandardsInfo> insList = new ArrayList<>();
|
||||
List<SarStandardsInfo> updList = new ArrayList<>();
|
||||
List<String> delList = new ArrayList<>();
|
||||
List<String> standIdList = rowsStand.stream().map(SarStandardsInfo::getId).collect(Collectors.toList());
|
||||
if(!esIdList.isEmpty()){
|
||||
|
||||
// 交集 更新
|
||||
List<SarStandardsInfo> intersection = rowsStand.stream()
|
||||
.filter(item -> new ArrayList<>(esIdList)
|
||||
.contains(item.getId()))
|
||||
.collect(Collectors.toList());
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
if(!updList.isEmpty() && ("ALL".equals(searchCenter.getExecType().toUpperCase()) || "UPD".equals(searchCenter.getExecType().toUpperCase()))){
|
||||
for(SarStandardsInfo sarStandardsInfoEO : updList){
|
||||
countUpdateSuccess++;
|
||||
standFunc(sarStandardsInfoEO);
|
||||
createStandMQService.sendStandMQ(sarStandardsInfoEO,"update");
|
||||
}
|
||||
}
|
||||
|
||||
logger.info("重置国内外标准:新增-"+ countAddSuccess + "条 更新-"+countUpdateSuccess+"条(国内外标准共:"+0+"条)删除-共"+delList.size()+"条数据");
|
||||
return Result.success("重置国内外标准:新增-"+ countAddSuccess + "条 更新-"+countUpdateSuccess+"条(国内外标准共:"+0+"条)删除-共"+delList.size()+"条数据");
|
||||
}else {
|
||||
logger.info("未查询到标准数据");
|
||||
return Result.error("未查询到标准数据");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//重建国内外标准
|
||||
@Async
|
||||
public ResponseMessage resetStandSearchCenter(SarStandardsInfoEOPage page,SearchCenter searchCenter) throws Exception{
|
||||
@@ -199,7 +332,9 @@ public class ResetSearchCenterService {
|
||||
return Result.error("ES 不存在索引:stand");
|
||||
}
|
||||
|
||||
List<Map<String, Object>> searchListData = elasticsearchService.searchAll("stand");
|
||||
String search = getSearch(searchCenter);
|
||||
|
||||
List<Map<String, Object>> searchListData = elasticsearchService.searchAll("stand",search);
|
||||
|
||||
List<String> esIdList = searchListData.stream().map(stringObjectMap -> stringObjectMap.get("id").toString()).collect(Collectors.toList());
|
||||
|
||||
@@ -296,6 +431,14 @@ public class ResetSearchCenterService {
|
||||
|
||||
}
|
||||
|
||||
private String getSearch(SearchCenter searchCenter) {
|
||||
String search = "";
|
||||
if(StringUtils.isNotBlank(searchCenter.getSearch())) {
|
||||
search = searchCenter.getSearch();
|
||||
}
|
||||
return search;
|
||||
}
|
||||
|
||||
private void standFunc(SarStandardsInfo sarStandardsInfoEO) throws Exception {
|
||||
attrInfoSearchDetails(sarStandardsInfoEO);
|
||||
FindSarItemsPageReqDTO pageInfo = new FindSarItemsPageReqDTO();
|
||||
@@ -365,6 +508,93 @@ public class ResetSearchCenterService {
|
||||
}
|
||||
}
|
||||
|
||||
@Async
|
||||
public ResponseMessage resetLawsSearchCenterToSearch(SarLawsStandInfoPage sarLawsInfoEOPage,SearchCenter searchCenter) throws Exception{
|
||||
Boolean getLawsIndex = elasticsearchService.isIndexExist("fulltextserch");
|
||||
|
||||
if(!getLawsIndex){
|
||||
logger.info("ES 不存在索引:fulltextserch");
|
||||
return Result.error("ES 不存在索引:fulltextserch");
|
||||
}
|
||||
|
||||
String search = getSearch(searchCenter);
|
||||
|
||||
List<Map<String, Object>> searchListData = elasticsearchService.searchAll("fulltextserch",search);
|
||||
|
||||
List<String> esIdList = searchListData.stream().map(stringObjectMap -> stringObjectMap.get("id").toString()).collect(Collectors.toList());
|
||||
|
||||
sarLawsInfoEOPage.setLawsType("FOREIGN");
|
||||
|
||||
// page idlist 赋值
|
||||
idListFunc(sarLawsInfoEOPage, searchCenter);
|
||||
|
||||
int countUpdateSuccess = 0;
|
||||
int countAddSuccess = 0;
|
||||
QueryWrapper qw2 = new QueryWrapper();
|
||||
qw2.eq("VALID_FLAG","0");
|
||||
int count2 = iSarLawsStandInfoService.count(qw2);
|
||||
if(count2 > 0){
|
||||
sarLawsInfoEOPage.setPageSize(count2);
|
||||
List<SarLawsStandInfo> rowsStand = iSarLawsStandInfoService.getSarStandardsInfoPage(sarLawsInfoEOPage);
|
||||
List<SarLawsStandInfo> insList = new ArrayList<>();
|
||||
List<SarLawsStandInfo> updList = new ArrayList<>();
|
||||
List<String> delList = new ArrayList<>();
|
||||
List<String> standIdList = rowsStand.stream().map(SarLawsStandInfo::getId).collect(Collectors.toList());
|
||||
|
||||
if(!esIdList.isEmpty()){
|
||||
|
||||
// 交集 更新
|
||||
List<SarLawsStandInfo> intersection = rowsStand.stream()
|
||||
.filter(item -> new ArrayList<>(esIdList)
|
||||
.contains(item.getId()))
|
||||
.collect(Collectors.toList());
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
if(!updList.isEmpty() && ("ALL".equals(searchCenter.getExecType().toUpperCase()) || "UPD".equals(searchCenter.getExecType().toUpperCase()))){
|
||||
for(SarLawsStandInfo sarLawsInfoEO : updList){
|
||||
countUpdateSuccess++;
|
||||
lawsAttrInfoShowSearchDetails(sarLawsInfoEO);
|
||||
FindSarItemsPageReqDTO pageInfo = new FindSarItemsPageReqDTO();
|
||||
pageInfo.setStandId(sarLawsInfoEO.getId());
|
||||
pageInfo.setFileType("FBGBJBD");
|
||||
|
||||
/**
|
||||
* SarItemVO换为sarItemVOS
|
||||
* List<SarItemVO> sarItemVOS = standItemsDao.querySarItemAndInterpretation(pageInfo);
|
||||
* .collect(Collectors.toMap(SarItemVO::getItemsNum, SarItemVO::getItemsName));
|
||||
*/
|
||||
|
||||
List<SarLawsItems> sarItemVOS = sarLawsItemsDao.querySarItemAndInterpretation(pageInfo);
|
||||
if(!sarItemVOS.isEmpty()){
|
||||
Map<String,String> collectMap = sarItemVOS.stream().filter((e) -> e.getItemsNum() != null && e.getItemsName() != null)
|
||||
.collect(Collectors.toMap(SarLawsItems::getItemsNum, SarLawsItems::getTermsConditions));
|
||||
sarLawsInfoEO.setMapItems(collectMap);
|
||||
}
|
||||
if (sarLawsInfoEO.getAttrInfoMap() != null) {
|
||||
sarLawsInfoEO.setSarStandAttrEOStr(JSONObject.toJSONString(sarLawsInfoEO.getAttrInfoMap()));
|
||||
}
|
||||
createStandMQService.sendLawsMQ(sarLawsInfoEO,"update");
|
||||
}
|
||||
}
|
||||
|
||||
logger.info("重置国内外政策:新增-"+ countAddSuccess + "条 更新-"+countUpdateSuccess+"条(国内外政策共:"+rowsStand.size()+"条)数据");
|
||||
return Result.success("");
|
||||
}else {
|
||||
logger.info("未查询到国内外政策数据");
|
||||
return Result.error("未查询到国内外政策数据");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Async
|
||||
public ResponseMessage resetLawsSearchCenter(SarLawsStandInfoPage sarLawsInfoEOPage,SearchCenter searchCenter) throws Exception{
|
||||
Boolean getLawsIndex = elasticsearchService.isIndexExist("laws");
|
||||
@@ -374,7 +604,9 @@ public class ResetSearchCenterService {
|
||||
return Result.error("ES 不存在索引:laws");
|
||||
}
|
||||
|
||||
List<Map<String, Object>> searchListData = elasticsearchService.searchAll("laws");
|
||||
String search = getSearch(searchCenter);
|
||||
|
||||
List<Map<String, Object>> searchListData = elasticsearchService.searchAll("laws",search);
|
||||
|
||||
List<String> esIdList = searchListData.stream().map(stringObjectMap -> stringObjectMap.get("id").toString()).collect(Collectors.toList());
|
||||
|
||||
@@ -442,6 +674,25 @@ public class ResetSearchCenterService {
|
||||
for(SarLawsStandInfo sarLawsInfoEO : updList){
|
||||
countUpdateSuccess++;
|
||||
lawsAttrInfoShowSearchDetails(sarLawsInfoEO);
|
||||
FindSarItemsPageReqDTO pageInfo = new FindSarItemsPageReqDTO();
|
||||
pageInfo.setStandId(sarLawsInfoEO.getId());
|
||||
pageInfo.setFileType("FBGBJBD");
|
||||
|
||||
/**
|
||||
* SarItemVO换为sarItemVOS
|
||||
* List<SarItemVO> sarItemVOS = standItemsDao.querySarItemAndInterpretation(pageInfo);
|
||||
* .collect(Collectors.toMap(SarItemVO::getItemsNum, SarItemVO::getItemsName));
|
||||
*/
|
||||
|
||||
List<SarLawsItems> sarItemVOS = sarLawsItemsDao.querySarItemAndInterpretation(pageInfo);
|
||||
if(!sarItemVOS.isEmpty()){
|
||||
Map<String,String> collectMap = sarItemVOS.stream().filter((e) -> e.getItemsNum() != null && e.getItemsName() != null)
|
||||
.collect(Collectors.toMap(SarLawsItems::getItemsNum, SarLawsItems::getTermsConditions));
|
||||
sarLawsInfoEO.setMapItems(collectMap);
|
||||
}
|
||||
if (sarLawsInfoEO.getAttrInfoMap() != null) {
|
||||
sarLawsInfoEO.setSarStandAttrEOStr(JSONObject.toJSONString(sarLawsInfoEO.getAttrInfoMap()));
|
||||
}
|
||||
createStandMQService.sendLawsMQ(sarLawsInfoEO,"update");
|
||||
}
|
||||
}
|
||||
@@ -571,6 +822,84 @@ public class ResetSearchCenterService {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 文本搜索
|
||||
*/
|
||||
|
||||
@Async
|
||||
public ResponseMessage resetBussStandSearchCenterToSearch(SarBussionessStandEOPage sarBussionessStandEOPage,SearchCenter searchCenter) throws Exception{
|
||||
Boolean getbussstandIndex = elasticsearchService.isIndexExist("fulltextserch");
|
||||
|
||||
if(!getbussstandIndex){
|
||||
logger.info("ES 不存在索引:fulltextserch");
|
||||
return Result.error("ES 不存在索引:fulltextserch");
|
||||
}
|
||||
|
||||
String search = getSearch(searchCenter);
|
||||
|
||||
List<Map<String, Object>> searchListData = elasticsearchService.searchAll("fulltextserch",search);
|
||||
|
||||
List<String> 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");
|
||||
sarBussionessStandEOPage.setMenuRoleList(null);
|
||||
if(searchCenter.getIdList() != null && !searchCenter.getIdList().isEmpty()){
|
||||
String[] result = searchCenter.getIdList().toArray(new String[0]);
|
||||
sarBussionessStandEOPage.setIdlist(result);
|
||||
}
|
||||
|
||||
int countUpdateSuccess = 0;
|
||||
int countAddSuccess = 0;
|
||||
sarBussionessStandEOPage.setMenuId("0");
|
||||
|
||||
QueryWrapper qw3 = new QueryWrapper();
|
||||
qw3.eq("VALID_FLAG","0");
|
||||
int count3 = iSarBussionessStandService.count(qw3);
|
||||
|
||||
if(count3 > 0){
|
||||
sarBussionessStandEOPage.setPageSize(count3);
|
||||
|
||||
List<SarBussionessStand> rowsStand = iSarBussionessStandService.getSarBussionStandPage(sarBussionessStandEOPage);
|
||||
List<SarBussionessStand> insList = new ArrayList<>();
|
||||
List<SarBussionessStand> updList = new ArrayList<>();
|
||||
List<String> delList = new ArrayList<>();
|
||||
List<String> standIdList = rowsStand.stream().map(SarBussionessStand::getId).collect(Collectors.toList());
|
||||
if(!esIdList.isEmpty()){
|
||||
|
||||
// 交集 更新
|
||||
List<SarBussionessStand> intersection = rowsStand.stream()
|
||||
.filter(item -> new ArrayList<>(esIdList)
|
||||
.contains(item.getId()))
|
||||
.collect(Collectors.toList());
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
if(!updList.isEmpty() && ("ALL".equals(searchCenter.getExecType().toUpperCase()) || "UPD".equals(searchCenter.getExecType().toUpperCase()))){
|
||||
for(SarBussionessStand sarBussionessStandEO : updList){
|
||||
countUpdateSuccess++;
|
||||
bussAttrInfoShowSearchDetails(sarBussionessStandEO);
|
||||
if (sarBussionessStandEO.getAttrInfoMap() != null) {
|
||||
sarBussionessStandEO.setSarStandAttrEOStr(JSONObject.toJSONString(sarBussionessStandEO.getAttrInfoMap()));
|
||||
}
|
||||
createStandMQService.sendBussStandMQ(sarBussionessStandEO,"update");
|
||||
}
|
||||
}
|
||||
logger.info("重置企标:新增-"+ countAddSuccess + "条 更新-"+countUpdateSuccess+"条(企标共:"+rowsStand.size()+"条)数据");
|
||||
return Result.success("");
|
||||
}else {
|
||||
logger.info("未查询到企标数据");
|
||||
return Result.error("未查询到企标数据");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Async
|
||||
public ResponseMessage resetBussStandSearchCenter(SarBussionessStandEOPage sarBussionessStandEOPage,SearchCenter searchCenter) throws Exception{
|
||||
Boolean getbussstandIndex = elasticsearchService.isIndexExist("bussstand");
|
||||
@@ -580,7 +909,9 @@ public class ResetSearchCenterService {
|
||||
return Result.error("ES 不存在索引:bussstand");
|
||||
}
|
||||
|
||||
List<Map<String, Object>> searchListData = elasticsearchService.searchAll("bussstand");
|
||||
String search = getSearch(searchCenter);
|
||||
|
||||
List<Map<String, Object>> searchListData = elasticsearchService.searchAll("bussstand",search);
|
||||
|
||||
List<String> esIdList = searchListData.stream().map(stringObjectMap -> stringObjectMap.get("id").toString()).collect(Collectors.toList());
|
||||
|
||||
|
||||
+16
@@ -736,6 +736,22 @@ public class SarLawsStandInfoServiceImpl extends ServiceImpl<SarLawsStandInfoDao
|
||||
saveUpdateLog(sarLawsStandInfo,beforeStandEO);
|
||||
if (elasflag) {
|
||||
attrInfoShowSearchDetails(sarLawsStandInfo,"upd");
|
||||
FindSarItemsPageReqDTO pageInfo = new FindSarItemsPageReqDTO();
|
||||
pageInfo.setStandId(sarLawsStandInfo.getId());
|
||||
pageInfo.setFileType("FBGBJBD");
|
||||
|
||||
/**
|
||||
* SarItemVO换为sarItemVOS
|
||||
* List<SarItemVO> sarItemVOS = standItemsDao.querySarItemAndInterpretation(pageInfo);
|
||||
* .collect(Collectors.toMap(SarItemVO::getItemsNum, SarItemVO::getItemsName));
|
||||
*/
|
||||
|
||||
List<SarLawsItems> sarItemVOS = sarLawsItemsDao.querySarItemAndInterpretation(pageInfo);
|
||||
if(!sarItemVOS.isEmpty()){
|
||||
Map<String,String> collectMap = sarItemVOS.stream().filter((e) -> e.getItemsNum() != null && e.getItemsName() != null)
|
||||
.collect(Collectors.toMap(SarLawsItems::getItemsNum, SarLawsItems::getTermsConditions));
|
||||
sarLawsStandInfo.setMapItems(collectMap);
|
||||
}
|
||||
createStandMQService.sendLawsMQ(sarLawsStandInfo, "update");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user