Commit 72540bdb authored by liufan's avatar liufan

优化:设备列表查询接口

parent 6d390b8d
...@@ -638,7 +638,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -638,7 +638,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
ubuilder.should(QueryBuilders.termQuery("USE_UNIT_CREDIT_CODE.keyword", useCode)); ubuilder.should(QueryBuilders.termQuery("USE_UNIT_CREDIT_CODE.keyword", useCode));
String uscCode = QueryParser.escape(map.getString("USC_UNIT_CREDIT_CODE")); String uscCode = QueryParser.escape(map.getString("USC_UNIT_CREDIT_CODE"));
ubuilder.should(QueryBuilders.termQuery("USC_UNIT_CREDIT_CODE.keyword", uscCode)); ubuilder.should(QueryBuilders.matchPhraseQuery("USC_UNIT_CREDIT_CODE", "*" + uscCode + "*"));
ubuilder.minimumShouldMatch(1); ubuilder.minimumShouldMatch(1);
boolMust.must(ubuilder); boolMust.must(ubuilder);
}else { }else {
...@@ -651,8 +651,8 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -651,8 +651,8 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
} }
if (!ObjectUtils.isEmpty(map.getString("USC_UNIT_CREDIT_CODE"))) { if (!ObjectUtils.isEmpty(map.getString("USC_UNIT_CREDIT_CODE"))) {
BoolQueryBuilder uuccBuilder = QueryBuilders.boolQuery(); BoolQueryBuilder uuccBuilder = QueryBuilders.boolQuery();
String param = QueryParser.escape(map.getString("USC_UNIT_CREDIT_CODE")); String uscCode = QueryParser.escape(map.getString("USC_UNIT_CREDIT_CODE"));
uuccBuilder.must(QueryBuilders.matchPhraseQuery("USC_UNIT_CREDIT_CODE", param)); uuccBuilder.must(QueryBuilders.matchPhraseQuery("USC_UNIT_CREDIT_CODE", "*" + uscCode + "*"));
boolMust.must(uuccBuilder); boolMust.must(uuccBuilder);
} }
} }
...@@ -729,6 +729,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -729,6 +729,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
if (!ValidationUtil.isEmpty(company)) { if (!ValidationUtil.isEmpty(company)) {
object.put("level", company.getLevel()); object.put("level", company.getLevel());
object.put("orgCode", company.getOrgCode()); object.put("orgCode", company.getOrgCode());
object.put("companyName", company.getCompanyName());
object.put("companyCode", company.getCompanyCode()); object.put("companyCode", company.getCompanyCode());
CompanyModel result = Privilege.companyClient.queryByCompanyCode(company.getCompanyCode()).getResult(); CompanyModel result = Privilege.companyClient.queryByCompanyCode(company.getCompanyCode()).getResult();
if(!ValidationUtil.isEmpty(result)){ if(!ValidationUtil.isEmpty(result)){
...@@ -768,9 +769,15 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -768,9 +769,15 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
iIdxBizJgFactoryInfoService.saveOrUpdateData(factoryInfo); iIdxBizJgFactoryInfoService.saveOrUpdateData(factoryInfo);
//施工信息 //施工信息
JSONObject company = getCompanyType();
String companyName = company.getString("companyName");
String companyCode = company.getString("companyCode").contains("_") ?
company.getString("companyCode").split("_")[1] : company.getString("companyCode");
IdxBizJgConstructionInfo constructionInfo = JSON.parseObject(JSON.toJSONString(equipmentInfoForm), IdxBizJgConstructionInfo.class); IdxBizJgConstructionInfo constructionInfo = JSON.parseObject(JSON.toJSONString(equipmentInfoForm), IdxBizJgConstructionInfo.class);
constructionInfo.setRecord(record); constructionInfo.setRecord(record);
constructionInfo.setRecDate(date); constructionInfo.setRecDate(date);
constructionInfo.setUscUnitCreditCode(companyCode);
constructionInfo.setUscUnitName(companyName);
constructionInfo.setSequenceNbr(OPERATESAVE.equals(operateType) ? UUID.randomUUID().toString() : String.valueOf(equipmentInfoForm.get("CONSTRUCTIONINFO_SEQ"))); constructionInfo.setSequenceNbr(OPERATESAVE.equals(operateType) ? UUID.randomUUID().toString() : String.valueOf(equipmentInfoForm.get("CONSTRUCTIONINFO_SEQ")));
iIdxBizJgConstructionInfoService.saveOrUpdateData(constructionInfo); iIdxBizJgConstructionInfoService.saveOrUpdateData(constructionInfo);
......
...@@ -95,7 +95,6 @@ ...@@ -95,7 +95,6 @@
CONSTRUCTION_TYPE, CONSTRUCTION_TYPE,
USC_UNIT_CREDIT_CODE, USC_UNIT_CREDIT_CODE,
USC_UNIT_NAME, USC_UNIT_NAME,
DATE_FORMAT(USC_DATE, '%Y-%m-%d %H:%i:%s') as USC_DATE,
EQU_DEFINE, EQU_DEFINE,
EQU_DEFINE_CODE, EQU_DEFINE_CODE,
PRODUCT_NAME, PRODUCT_NAME,
......
...@@ -2471,6 +2471,8 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -2471,6 +2471,8 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
if(paramMap.isEmpty()){ if(paramMap.isEmpty()){
return null; return null;
} }
String oldUscUnitCreditCode = "";
String oldUscUnitName = "";
Map<String, Object> resultMap = new HashMap<>(); Map<String, Object> resultMap = new HashMap<>();
for (Map.Entry<String, Map<String, Object>> entry : paramMap.entrySet()) { for (Map.Entry<String, Map<String, Object>> entry : paramMap.entrySet()) {
String record = entry.getKey(); String record = entry.getKey();
...@@ -2481,15 +2483,22 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -2481,15 +2483,22 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
Optional<ESEquipmentCategoryDto> optional = esEquipmentCategory.findById(record); Optional<ESEquipmentCategoryDto> optional = esEquipmentCategory.findById(record);
if(!ObjectUtils.isEmpty(optional)){ if(!ObjectUtils.isEmpty(optional)){
oldData = optional.get(); oldData = optional.get();
oldUscUnitCreditCode = oldData.getUSC_UNIT_CREDIT_CODE();
oldUscUnitName = oldData.getUSC_UNIT_NAME();
} }
//获取Es中新的参数 //获取Es中新的参数
ESEquipmentCategoryDto newData = JSON.parseObject(toJSONString(childMap), ESEquipmentCategoryDto.class); ESEquipmentCategoryDto newData = JSON.parseObject(toJSONString(childMap), ESEquipmentCategoryDto.class);
String newUscUnitCreditCode = newData.getUSC_UNIT_CREDIT_CODE();
String newUscUnitName = newData.getUSC_UNIT_NAME();
//删除Es中旧的数据 //删除Es中旧的数据
if (!ObjectUtils.isEmpty(oldData)) { if (!ObjectUtils.isEmpty(oldData)) {
esEquipmentCategory.deleteById(record); esEquipmentCategory.deleteById(record);
//整合新旧数据 //整合新旧数据
Bean.copyExistPropertis(newData, oldData); Bean.copyExistPropertis(newData, oldData);
//处理施工单位信息
oldData.setUSC_UNIT_CREDIT_CODE(oldUscUnitCreditCode+","+newUscUnitCreditCode);
oldData.setUSC_UNIT_NAME(oldUscUnitName+","+newUscUnitName);
} }
if (!ObjectUtils.isEmpty(oldData)) { if (!ObjectUtils.isEmpty(oldData)) {
oldData.setREC_DATE(System.currentTimeMillis()); oldData.setREC_DATE(System.currentTimeMillis());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment