Commit cffdbd97 authored by suhuiguang's avatar suhuiguang

refeat(jyjc): 报检规则4.0开发

1.锅炉技术参数快捷维护报检 2.报检提交时记录历史表
parent a61b03b2
...@@ -63,4 +63,20 @@ public interface BizCommonConstant { ...@@ -63,4 +63,20 @@ public interface BizCommonConstant {
* 固定式压力容器 * 固定式压力容器
*/ */
String EQU_CATEGORY_CODE_GDYLRQ = "2100"; String EQU_CATEGORY_CODE_GDYLRQ = "2100";
/**
* 承压蒸汽锅炉
*/
String YLRQ_GL_CY = "1100";
/**
* 额定蒸发量(热功率)
*/
String TECH_PARAM1 = "ratedEvaporationCapacityThermalPower";
/**
* 额定工作压力
*/
String TECH_PARAM2 = "ratedWorkingPressure";
} }
...@@ -3,7 +3,9 @@ package com.yeejoin.amos.boot.module.jyjc.api.model; ...@@ -3,7 +3,9 @@ package com.yeejoin.amos.boot.module.jyjc.api.model;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigDecimal;
/** /**
...@@ -52,4 +54,13 @@ public class InspectionEquipInfoModel implements Serializable { ...@@ -52,4 +54,13 @@ public class InspectionEquipInfoModel implements Serializable {
@ApiModelProperty(value = "设备的使用单位,报检监督检验规则使用") @ApiModelProperty(value = "设备的使用单位,报检监督检验规则使用")
private String useUnitCreditCode; private String useUnitCreditCode;
@ApiModelProperty(value = "额定蒸发量(热功率)")
private String ratedEvaporationCapacityThermalPower;
@ApiModelProperty(value = "额定工作压力")
private String ratedWorkingPressure;
} }
...@@ -84,7 +84,6 @@ public class InspectionOrgRefreshListener extends EmqxListener { ...@@ -84,7 +84,6 @@ public class InspectionOrgRefreshListener extends EmqxListener {
} }
private void processBizMessage(BizMessage bizMessage) { private void processBizMessage(BizMessage bizMessage) {
log.info("收到前端消息:{}", bizMessage);
byte[] payload = bizMessage.getMessage().getPayload(); byte[] payload = bizMessage.getMessage().getPayload();
InspectionEquipInfoModel equipInfoModel = parseObject(new String(payload, StandardCharsets.UTF_8), InspectionEquipInfoModel.class); InspectionEquipInfoModel equipInfoModel = parseObject(new String(payload, StandardCharsets.UTF_8), InspectionEquipInfoModel.class);
String componentKey = bizMessage.getTopic().split("/")[0]; String componentKey = bizMessage.getTopic().split("/")[0];
......
...@@ -41,12 +41,14 @@ import com.yeejoin.amos.boot.module.jyjc.biz.service.TaskModelServiceImpl; ...@@ -41,12 +41,14 @@ import com.yeejoin.amos.boot.module.jyjc.biz.service.TaskModelServiceImpl;
import com.yeejoin.amos.boot.module.jyjc.biz.typeHandler.EquipCategoryTypeHandler; import com.yeejoin.amos.boot.module.jyjc.biz.typeHandler.EquipCategoryTypeHandler;
import com.yeejoin.amos.boot.module.jyjc.biz.util.CompareUtils; import com.yeejoin.amos.boot.module.jyjc.biz.util.CompareUtils;
import com.yeejoin.amos.boot.module.ymt.api.dto.TzBaseEnterpriseInfoDto; import com.yeejoin.amos.boot.module.ymt.api.dto.TzBaseEnterpriseInfoDto;
import com.yeejoin.amos.boot.module.ymt.api.entity.EquipTechParamBoiler;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgProjectConstruction; import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgProjectConstruction;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgProjectContraption; import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgProjectContraption;
import com.yeejoin.amos.boot.module.ymt.api.enums.ApplicationFormTypeEnum; import com.yeejoin.amos.boot.module.ymt.api.enums.ApplicationFormTypeEnum;
import com.yeejoin.amos.boot.module.ymt.api.enums.EquimentEnum; import com.yeejoin.amos.boot.module.ymt.api.enums.EquimentEnum;
import com.yeejoin.amos.boot.module.ymt.api.enums.EquipmentClassifityEnum; import com.yeejoin.amos.boot.module.ymt.api.enums.EquipmentClassifityEnum;
import com.yeejoin.amos.boot.module.ymt.api.enums.FlowStatusEnum; import com.yeejoin.amos.boot.module.ymt.api.enums.FlowStatusEnum;
import com.yeejoin.amos.boot.module.ymt.api.mapper.EquipTechParamBoilerMapper;
import com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgProjectContraptionMapper; import com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgProjectContraptionMapper;
import com.yeejoin.amos.feign.privilege.model.CompanyModel; import com.yeejoin.amos.feign.privilege.model.CompanyModel;
import com.yeejoin.amos.feign.systemctl.model.DictionarieModel; import com.yeejoin.amos.feign.systemctl.model.DictionarieModel;
...@@ -115,6 +117,9 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec ...@@ -115,6 +117,9 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec
@Autowired @Autowired
@Lazy @Lazy
InspectionPlanServiceImpl inspectionPlanService; InspectionPlanServiceImpl inspectionPlanService;
@Autowired
private EquipTechParamBoilerMapper equipTechParamBoilerMapper;
/** /**
* 分页查询 * 分页查询
*/ */
...@@ -198,7 +203,6 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec ...@@ -198,7 +203,6 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec
// 之前有工作流,再次提交 // 之前有工作流,再次提交
model.setOperationType("2"); model.setOperationType("2");
} }
ArrayList<String> roleListAll = new ArrayList<>(); ArrayList<String> roleListAll = new ArrayList<>();
ArrayList<String> roleListNext = new ArrayList<>(); ArrayList<String> roleListNext = new ArrayList<>();
if (!"2".equals(model.getOperationType())) { if (!"2".equals(model.getOperationType())) {
...@@ -406,9 +410,18 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec ...@@ -406,9 +410,18 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec
commonService.saveExecuteFlowData2Redis(model.getProcessInstanceId(), this.buildInstanceRuntimeData(model)); commonService.saveExecuteFlowData2Redis(model.getProcessInstanceId(), this.buildInstanceRuntimeData(model));
this.updateWithModel(model); this.updateWithModel(model);
} }
// 暂存页面数据至his表
saveHisData(obj, model);
return this.buildRedundancyField(model); return this.buildRedundancyField(model);
} }
private void saveHisData(JSONObject obj, JyjcInspectionApplicationModel model) {
JyjcInspectionApplication application = new JyjcInspectionApplication();
BeanUtils.copyProperties(model, application);
obj.putAll(BeanUtil.beanToMap(application));
inspectionHistoryService.saveBySeq(model.getSequenceNbr(), obj, model.getInspectionType());
}
private String getAllSupervisoryCode(List<JyjcInspectionApplicationEquip> equipInfos) { private String getAllSupervisoryCode(List<JyjcInspectionApplicationEquip> equipInfos) {
return equipInfos.stream().map(JyjcInspectionApplicationEquip::getSupervisoryCode).filter(supervisoryCode -> !CompareUtils.isNullOrEmpty(supervisoryCode)).collect(Collectors.joining(",")); return equipInfos.stream().map(JyjcInspectionApplicationEquip::getSupervisoryCode).filter(supervisoryCode -> !CompareUtils.isNullOrEmpty(supervisoryCode)).collect(Collectors.joining(","));
} }
...@@ -580,9 +593,9 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec ...@@ -580,9 +593,9 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec
Map<String, Object> map = BeanUtil.beanToMap(model); Map<String, Object> map = BeanUtil.beanToMap(model);
// 附件 // 附件
Map<String, Object> attMap = getAttachmentMap(sequenceNbr); Map<String, Object> attMap = getAttachmentMap(sequenceNbr);
JyjcInspectionHistory inspectionHistory = inspectionHistoryService.getBySSeq(sequenceNbr);
// 已完成的显示json数据 需兼容老数据 // 已完成的显示json数据 需兼容老数据
if (model.getStatus().equals(String.valueOf(FlowStatusEnum.TO_BE_FINISHED.getCode()))) { if (model.getStatus().equals(String.valueOf(FlowStatusEnum.TO_BE_FINISHED.getCode()))) {
JyjcInspectionHistory inspectionHistory = inspectionHistoryService.getBySSeq(sequenceNbr);
if (inspectionHistory != null) { if (inspectionHistory != null) {
// 新报检单记录历史数据的逻辑 // 新报检单记录历史数据的逻辑
map.putAll(inspectionHistory.getHistoryData()); map.putAll(inspectionHistory.getHistoryData());
...@@ -597,6 +610,9 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec ...@@ -597,6 +610,9 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec
map.put("equip", arrayList); map.put("equip", arrayList);
} }
} }
map.put("status", model.getStatus());
map.put("acceptDate", model.getAcceptDate());
map.put("applicationDate", model.getApplicationDate());
} else { } else {
// 未审批完成的显示实时数据 // 未审批完成的显示实时数据
if (model.getEquipClassify().equals(EquipmentClassifityEnum.YLGD.getCode())) { if (model.getEquipClassify().equals(EquipmentClassifityEnum.YLGD.getCode())) {
...@@ -606,6 +622,8 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec ...@@ -606,6 +622,8 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec
// 其他设备 // 其他设备
List<Map<String, Object>> arrayList = getEquipInfoList(sequenceNbr, model); List<Map<String, Object>> arrayList = getEquipInfoList(sequenceNbr, model);
map.put("equip", arrayList); map.put("equip", arrayList);
map.put(BizCommonConstant.TECH_PARAM1, inspectionHistory.getHistoryData().get(BizCommonConstant.TECH_PARAM1));
map.put(BizCommonConstant.TECH_PARAM2, inspectionHistory.getHistoryData().get(BizCommonConstant.TECH_PARAM2));
} }
} }
map.putAll(attMap); map.putAll(attMap);
...@@ -851,12 +869,20 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec ...@@ -851,12 +869,20 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec
JSONObject hisData = getDeviceListByProjectContraption2(model); JSONObject hisData = getDeviceListByProjectContraption2(model);
inspectionHistoryService.saveBySeq(model.getSequenceNbr(), hisData, model.getInspectionType()); inspectionHistoryService.saveBySeq(model.getSequenceNbr(), hisData, model.getInspectionType());
} else { } else {
JyjcInspectionHistory inspectionHistory = inspectionHistoryService.getBySSeq(model.getSequenceNbr());
if(inspectionHistory != null) {
JSONObject hisData = inspectionHistory.getHistoryData();
List<Map<String, Object>> arrayList = getEquipInfoList(model.getSequenceNbr(), model);
hisData.put("equip", arrayList);
inspectionHistoryService.saveBySeq(model.getSequenceNbr(), hisData, model.getInspectionType());
} else {
List<Map<String, Object>> arrayList = getEquipInfoList(model.getSequenceNbr(), model); List<Map<String, Object>> arrayList = getEquipInfoList(model.getSequenceNbr(), model);
JSONObject hisData = new JSONObject(); JSONObject hisData = new JSONObject();
hisData.put("equip", arrayList); hisData.put("equip", arrayList);
inspectionHistoryService.saveBySeq(model.getSequenceNbr(), hisData, model.getInspectionType()); inspectionHistoryService.saveBySeq(model.getSequenceNbr(), hisData, model.getInspectionType());
} }
} }
}
private void saveBatchResume(List<JgResumeInfoDto> jgResumeInfoDtoList) { private void saveBatchResume(List<JgResumeInfoDto> jgResumeInfoDtoList) {
...@@ -1537,6 +1563,7 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec ...@@ -1537,6 +1563,7 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec
} }
// 填充地址 // 填充地址
fillAddress(list); fillAddress(list);
fillTechParamForGl(map.getString("EQU_CATEGORY_CODE"), list);
total = response.getInternalResponse().hits().getTotalHits().value; total = response.getInternalResponse().hits().getTotalHits().value;
result.setRecords(list); result.setRecords(list);
result.setTotal(total); result.setTotal(total);
...@@ -1546,6 +1573,17 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec ...@@ -1546,6 +1573,17 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec
return result; return result;
} }
private void fillTechParamForGl(String equCategoryCode, List<JSONObject> list) {
if (BizCommonConstant.YLRQ_GL_CY.equals(equCategoryCode)) {
for (JSONObject jsonObject : list) {
String record = jsonObject.getString(SEQUENCE_NBR);
EquipTechParamBoiler paramBoiler = equipTechParamBoilerMapper.queryTechParamInUse(record);
jsonObject.put(BizCommonConstant.TECH_PARAM1, paramBoiler != null ? paramBoiler.getRatedEvaporationCapacityThermalPower() : "0");
jsonObject.put(BizCommonConstant.TECH_PARAM2, paramBoiler != null ? paramBoiler.getRatedWorkingPressure() : "0");
}
}
}
private static void setFilterByIndefinite(JSONObject map, String type, String companyCode, BoolQueryBuilder boolMust) { private static void setFilterByIndefinite(JSONObject map, String type, String companyCode, BoolQueryBuilder boolMust) {
// 根据当前登录用户类型及管辖机构筛选条件添加对应参数 // 根据当前登录用户类型及管辖机构筛选条件添加对应参数
if (!ValidationUtil.isEmpty(type) && type.contains("使用单位")) { if (!ValidationUtil.isEmpty(type) && type.contains("使用单位")) {
......
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