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