Commit fad8996f authored by suhuiguang's avatar suhuiguang

1.使用登记修改撤回及一级一撤回时详情显示新的

parent ea048c5e
...@@ -697,41 +697,41 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD ...@@ -697,41 +697,41 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
this.update(jgUseRegistration, lambda); this.update(jgUseRegistration, lambda);
} }
public Map<String, Object> getDetail(String id, Long sequenceNbr) { public Map<String, Object> getDetail(String record, Long sequenceNbr) {
if (!ObjectUtils.isEmpty(sequenceNbr)) { if (!ObjectUtils.isEmpty(sequenceNbr)) {
JgUseRegistration jgUseRegistration = this.getBaseMapper().selectById(sequenceNbr); JgUseRegistration jgUseRegistration = this.getBaseMapper().selectById(sequenceNbr);
LambdaQueryWrapper<JgRegistrationHistory> lambda = new QueryWrapper<JgRegistrationHistory>().lambda(); LambdaQueryWrapper<JgRegistrationHistory> lambda = new QueryWrapper<JgRegistrationHistory>().lambda();
lambda.eq(JgRegistrationHistory::getCurrentDocumentId, sequenceNbr); lambda.eq(JgRegistrationHistory::getCurrentDocumentId, sequenceNbr);
// lambda.eq(JgRegistrationHistory::getEquId, id);
JgRegistrationHistory jgRegistrationHistory = jgRegistrationHistoryService.getBaseMapper().selectOne(lambda); JgRegistrationHistory jgRegistrationHistory = jgRegistrationHistoryService.getBaseMapper().selectOne(lambda);
JSONObject jsonObject = JSONObject.parseObject(jgRegistrationHistory.getChangeData()); JSONObject jsonObject = JSONObject.parseObject(jgRegistrationHistory.getChangeData());
// 需求:当申请信息由于设备信息错误被驳回及撤回时显示的数据还是旧设备数据,导致该申请单无法使用
// 解决方案:在当前状态为:使用单位已撤回、一级受理已驳回时显示最新的:设备基本信息、制造信息、设计信息
this.fillHistoryDataWithNewEquip(jsonObject, jgUseRegistration, record);
jsonObject.put("receiveOrgCode", jgUseRegistration.getReceiveCompanyCode() + "_" + jgUseRegistration.getReceiveOrgName()); jsonObject.put("receiveOrgCode", jgUseRegistration.getReceiveCompanyCode() + "_" + jgUseRegistration.getReceiveOrgName());
jsonObject.put("status", jgUseRegistration.getStatus()); jsonObject.put("status", jgUseRegistration.getStatus());
jsonObject.put("applyNo", jgUseRegistration.getApplyNo()); jsonObject.put("applyNo", jgUseRegistration.getApplyNo());
jsonObject.remove("submit"); jsonObject.remove("submit");
jsonObject.remove("instanceId"); jsonObject.remove("instanceId");
// 补充"车牌号"字段 // 补充"车牌号"字段
JgUseRegistration jgUseRegistration1 = this.getBaseMapper().selectById(sequenceNbr); jsonObject.put("licensePlateNum", jgUseRegistration.getLicensePlateNum());
jsonObject.put("licensePlateNum", jgUseRegistration1.getLicensePlateNum());
return jsonObject; return jsonObject;
} }
// 基本信息 + 制造信息 // 基本信息 + 制造信息
Map<String, Object> detail = this.baseMapper.getDetail(id); Map<String, Object> detail = this.baseMapper.getDetail(record);
// 检验信息 // 检验信息
Map<String, Object> inspectDetail = this.baseMapper.getInspectDetail(id); Map<String, Object> inspectDetail = this.baseMapper.getInspectDetail(record);
// 使用信息 // 使用信息
Map<String, Object> useDetail = this.baseMapper.getUseDetail(id); Map<String, Object> useDetail = this.baseMapper.getUseDetail(record);
// 设计信息 // 设计信息
Map<String, Object> degDestail = this.baseMapper.getDesDetail(id); Map<String, Object> desDetail = this.baseMapper.getDesDetail(record);
if (!ObjectUtils.isEmpty(inspectDetail)) { if (!ObjectUtils.isEmpty(inspectDetail)) {
detail.putAll(inspectDetail); detail.putAll(inspectDetail);
} }
if (!ObjectUtils.isEmpty(useDetail)) { if (!ObjectUtils.isEmpty(useDetail)) {
detail.putAll(useDetail); detail.putAll(useDetail);
} }
if (!ObjectUtils.isEmpty(degDestail)) { if (!ObjectUtils.isEmpty(desDetail)) {
detail.putAll(degDestail); detail.putAll(desDetail);
} }
detail.remove("safetyManager"); detail.remove("safetyManager");
detail.put("proDuctPhoto", JSON.parse(String.valueOf(detail.get("proDuctPhoto")))); detail.put("proDuctPhoto", JSON.parse(String.valueOf(detail.get("proDuctPhoto"))));
...@@ -747,6 +747,35 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD ...@@ -747,6 +747,35 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
} }
/** /**
* 填充设备最新的数据至历史json
* @param jsonObject 历史json
* @param jgUseRegistration 使用信息
* @param record 设备唯一标识
*/
private void fillHistoryDataWithNewEquip(JSONObject jsonObject, JgUseRegistration jgUseRegistration, String record) {
if(jgUseRegistration.getStatus().equals(WorkFlowStatusEnum.USE_SUBMIT.getReject())
|| jgUseRegistration.getStatus().equals(WorkFlowStatusEnum.USE_SUBMIT.getRollBack())){
// 基本信息 + 制造信息
Map<String, Object> detail = this.baseMapper.getDetail(record);
// 设计信息
Map<String, Object> desDetail = this.baseMapper.getDesDetail(record);
if (!ObjectUtils.isEmpty(desDetail)) {
detail.putAll(desDetail);
}
// 将字符串数据转为对象
detail.put("proDuctPhoto", JSON.parse(String.valueOf(detail.get("proDuctPhoto"))));
detail.put("factoryStandard", JSON.parse(String.valueOf(detail.get("factoryStandard"))));
detail.put("productQualityYieldProve", JSON.parse(String.valueOf(detail.get("productQualityYieldProve"))));
detail.put("insUseMaintainExplain", JSON.parse(String.valueOf(detail.get("insUseMaintainExplain"))));
detail.put("designStandard", JSON.parse(String.valueOf(detail.get("designStandard"))));
detail.put("designDoc", JSON.parse(String.valueOf(detail.get("designDoc"))));
// 格式化必要字段,当前页面的字段,来源his
detail.put("longitudeLatitude", JSON.parse(String.valueOf(jsonObject.get("longitudeLatitude"))));
jsonObject.putAll(detail);
}
}
/**
* 参数为监管码 * 参数为监管码
* *
* @param supervisoryCode * @param supervisoryCode
......
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