Commit 9dfe3ebf authored by tianbo's avatar tianbo

Merge remote-tracking branch 'origin/develop_tzs_register' into develop_tzs_register

parents 72c5331d a238fbac
...@@ -1078,42 +1078,43 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -1078,42 +1078,43 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
if(!ValidationUtil.isEmpty(list)){ if(!ValidationUtil.isEmpty(list)){
equIds = list.stream().map(item -> item.get("SEQUENCE_NBR").toString()).collect(Collectors.toList()); equIds = list.stream().map(item -> item.get("SEQUENCE_NBR").toString()).collect(Collectors.toList());
} }
//查询设备是否正在使用 if(!ValidationUtil.isEmpty(equIds)){
//设备的使用标识是,安装告知和使用登记中有使用记录。 //查询设备是否正在使用
List<JgInstallationNoticeEq> installationNoticeEqList = jgInstallationNoticeEqServiceImpl.getListByEquIds(equIds); //设备的使用标识是,安装告知和使用登记中有使用记录。
List<JgUseRegistrationEq> useRegistrationEqList = jgUseRegistrationEqServiceImpl.getListByEquIds(equIds); List<JgInstallationNoticeEq> installationNoticeEqList = jgInstallationNoticeEqServiceImpl.getListByEquIds(equIds);
Map<String, Boolean> equIsUseMap = new HashMap<>(); List<JgUseRegistrationEq> useRegistrationEqList = jgUseRegistrationEqServiceImpl.getListByEquIds(equIds);
if(!ValidationUtil.isEmpty(installationNoticeEqList) ){ Map<String, Boolean> equIsUseMap = new HashMap<>();
equIsUseMap.putAll(installationNoticeEqList.stream().collect(Collectors.toMap(JgInstallationNoticeEq::getEquId, obj -> true, (oldValue, newValue) -> oldValue))); if(!ValidationUtil.isEmpty(installationNoticeEqList) ){
} equIsUseMap.putAll(installationNoticeEqList.stream().collect(Collectors.toMap(JgInstallationNoticeEq::getEquId, obj -> true, (oldValue, newValue) -> oldValue)));
if(!ValidationUtil.isEmpty(useRegistrationEqList)){ }
equIsUseMap.putAll(useRegistrationEqList.stream().collect(Collectors.toMap(JgUseRegistrationEq::getEquId, obj -> true, (oldValue, newValue) -> oldValue))); if(!ValidationUtil.isEmpty(useRegistrationEqList)){
} equIsUseMap.putAll(useRegistrationEqList.stream().collect(Collectors.toMap(JgUseRegistrationEq::getEquId, obj -> true, (oldValue, newValue) -> oldValue)));
// 查询设备地址 }
List<IdxBizJgUseInfo> useInfoListByEquIds = idxBizJgUseInfoService.getUseInfoListByEquIds(equIds); // 查询设备地址
Map<String, String> equAddressMap = new HashMap<>(); List<IdxBizJgUseInfo> useInfoListByEquIds = idxBizJgUseInfoService.getUseInfoListByEquIds(equIds);
if(!ValidationUtil.isEmpty(useInfoListByEquIds)){ Map<String, String> equAddressMap = new HashMap<>();
equAddressMap = useInfoListByEquIds.stream().collect(Collectors.toMap(IdxBizJgUseInfo::getRecord, if(!ValidationUtil.isEmpty(useInfoListByEquIds)){
useInfo -> { equAddressMap = useInfoListByEquIds.stream().collect(Collectors.toMap(IdxBizJgUseInfo::getRecord,
String fulladdress=""; useInfo -> {
if(!ValidationUtil.isEmpty(useInfo.getProvinceName())) fulladdress += useInfo.getProvinceName(); String fulladdress="";
if(!ValidationUtil.isEmpty(useInfo.getCityName())) fulladdress += useInfo.getCityName(); if(!ValidationUtil.isEmpty(useInfo.getProvinceName())) fulladdress += useInfo.getProvinceName();
if(!ValidationUtil.isEmpty(useInfo.getCountyName())) fulladdress += useInfo.getCountyName(); if(!ValidationUtil.isEmpty(useInfo.getCityName())) fulladdress += useInfo.getCityName();
if(!ValidationUtil.isEmpty(useInfo.getStreetName())) fulladdress += useInfo.getStreetName(); if(!ValidationUtil.isEmpty(useInfo.getCountyName())) fulladdress += useInfo.getCountyName();
if(!ValidationUtil.isEmpty(useInfo.getAddress())) fulladdress += useInfo.getAddress(); if(!ValidationUtil.isEmpty(useInfo.getStreetName())) fulladdress += useInfo.getStreetName();
return fulladdress; if(!ValidationUtil.isEmpty(useInfo.getAddress())) fulladdress += useInfo.getAddress();
} return fulladdress;
) }
); )
} );
// 更新设备使用情况和设备地址 }
for(JSONObject item : list){ // 更新设备使用情况和设备地址
Boolean isUse = equIsUseMap.get(item.getString("SEQUENCE_NBR")); for(JSONObject item : list){
String fullAddress = equAddressMap.get(item.getString("SEQUENCE_NBR")); Boolean isUse = equIsUseMap.get(item.getString("SEQUENCE_NBR"));
item.put("IS_USE", !ValidationUtil.isEmpty(isUse) ? isUse ? isUse : false : false); String fullAddress = equAddressMap.get(item.getString("SEQUENCE_NBR"));
item.put("ADDRESS", !ValidationUtil.isEmpty(fullAddress) ? fullAddress : ""); item.put("IS_USE", !ValidationUtil.isEmpty(isUse) ? isUse ? isUse : false : false);
item.put("ADDRESS", !ValidationUtil.isEmpty(fullAddress) ? fullAddress : "");
}
} }
totle = response.getInternalResponse().hits().getTotalHits().value; totle = response.getInternalResponse().hits().getTotalHits().value;
result.setRecords(list); result.setRecords(list);
result.setTotal(totle); result.setTotal(totle);
......
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