Commit 728a3cb2 authored by hezhuozhi's avatar hezhuozhi

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

parents 996a7c8a c50ec5c7
...@@ -155,17 +155,17 @@ public class BatchDataChangeProcessStrategy implements IChangeDataProcessStrateg ...@@ -155,17 +155,17 @@ public class BatchDataChangeProcessStrategy implements IChangeDataProcessStrateg
List<String> records = eqs.stream().map(JgUseRegistrationEq::getEquId).collect(toList()); List<String> records = eqs.stream().map(JgUseRegistrationEq::getEquId).collect(toList());
IdxBizJgRegisterInfo registerInfo = useRegistrationService.getRegisterInfo(jgUseRegistration); IdxBizJgRegisterInfo registerInfo = useRegistrationService.getRegisterInfo(jgUseRegistration);
List<Map<String, Object>> tableData; List<Map<String, Object>> tableData;
if (CylinderTypeEnum.CYLINDER.getCode().equals(registerInfo.getEquCategory())) { if (EquipmentClassifityEnum.YLGD.getCode().equals(registerInfo.getEquList())){
List<DictionarieValueModel> fillingMedium = Systemctl.dictionarieClient.dictValues("FILLING_MEDIUM").getResult();
Map<String, Object> fillingMediumMap = fillingMedium.stream().collect(Collectors.toMap(DictionarieValueModel::getDictDataKey, DictionarieValueModel::getDictDataValue));
tableData = jgUseRegistrationMapper.queryForUnitVesselEquipment(records);
tableData.forEach(i -> i.put("chargingMedium", fillingMediumMap.get(i.get("chargingMedium"))));
} else {
IdxBizJgProjectContraption idxBizJgProjectContraption = idxBizJgProjectContraptionService.getById(jgUseRegistration.getProjectContraptionId()); IdxBizJgProjectContraption idxBizJgProjectContraption = idxBizJgProjectContraptionService.getById(jgUseRegistration.getProjectContraptionId());
Map<String, Object> map = IdxBizJgRegisterInfoServiceImpl.convertCamelToUnderscore(idxBizJgProjectContraption, IdxBizJgProjectContraptionServiceImpl.jsonFields); Map<String, Object> map = IdxBizJgRegisterInfoServiceImpl.convertCamelToUnderscore(idxBizJgProjectContraption, IdxBizJgProjectContraptionServiceImpl.jsonFields);
result.putAll(map); result.putAll(map);
result.put("projectContraptionId", idxBizJgProjectContraption.getSequenceNbr()); result.put("projectContraptionId", idxBizJgProjectContraption.getSequenceNbr());
tableData = jgUseRegistrationMapper.queryForUnitPipelineEquipmentForEdit(records); tableData = jgUseRegistrationMapper.queryForUnitPipelineEquipmentForEdit(records);
} else {
List<DictionarieValueModel> fillingMedium = Systemctl.dictionarieClient.dictValues("FILLING_MEDIUM").getResult();
Map<String, Object> fillingMediumMap = fillingMedium.stream().collect(Collectors.toMap(DictionarieValueModel::getDictDataKey, DictionarieValueModel::getDictDataValue));
tableData = jgUseRegistrationMapper.queryForUnitVesselEquipment(records);
tableData.forEach(i -> i.put("chargingMedium", fillingMediumMap.get(i.get("chargingMedium"))));
} }
result.put("tableData", tableData); result.put("tableData", tableData);
return result; return result;
......
...@@ -532,6 +532,7 @@ public class JgUseRegistrationManageServiceImpl extends BaseService<JgUseRegistr ...@@ -532,6 +532,7 @@ public class JgUseRegistrationManageServiceImpl extends BaseService<JgUseRegistr
JSONObject dto = jsonObject.getJSONObject("sourceAsMap"); JSONObject dto = jsonObject.getJSONObject("sourceAsMap");
dto.put("record", dto.get("SEQUENCE_NBR")); dto.put("record", dto.get("SEQUENCE_NBR"));
dto.put("equipAddress", dto.get("USE_PLACE") + "/" + dto.get("ADDRESS")); dto.put("equipAddress", dto.get("USE_PLACE") + "/" + dto.get("ADDRESS"));
dto.put("EQU_STATE_NAME",EquimentEnum.getName.get(Integer.valueOf(dto.getString("EQU_STATE"))));
list.add(dto); list.add(dto);
} }
totle = Objects.requireNonNull(response.getInternalResponse().hits().getTotalHits()).value; totle = Objects.requireNonNull(response.getInternalResponse().hits().getTotalHits()).value;
......
...@@ -2399,6 +2399,10 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD ...@@ -2399,6 +2399,10 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
for (int i = 0; i < equipmentLists.size(); i++) { for (int i = 0; i < equipmentLists.size(); i++) {
JSONObject equipmentItem = equipmentLists.getJSONObject(i); JSONObject equipmentItem = equipmentLists.getJSONObject(i);
equipmentItem.put("useDate", timeToMonths(useDateValue)); equipmentItem.put("useDate", timeToMonths(useDateValue));
// 过滤出目前在用的设备
if(!this.checkEquStatusInUse(equipmentItem.getString("record"))){
equipmentLists.remove(i);
}
} }
allEquipment.addAll(equipmentLists); allEquipment.addAll(equipmentLists);
} }
...@@ -2449,6 +2453,17 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD ...@@ -2449,6 +2453,17 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
} }
return futureList; return futureList;
} }
/**
* 根据record判断设备状态是否为【在用】
* @param record
* @return
*/
private boolean checkEquStatusInUse(String record) {
IdxBizJgUseInfo useInfo = idxBizJgUseInfoService.lambdaQuery().select(IdxBizJgUseInfo::getEquState).eq(IdxBizJgUseInfo::getRecord, record).one();
return EquimentEnum.ZAIYONG.getCode().toString().equals(useInfo.getEquState());
}
/** /**
* 导出基本信息汇总表(工业管道/气瓶) * 导出基本信息汇总表(工业管道/气瓶)
* *
......
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