Commit 27879502 authored by caotao's avatar caotao

改造登记业务代码调整解决详情报错问题

parent 5b2cd766
...@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.jg.api.mapper; ...@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.jg.api.mapper;
import com.yeejoin.amos.boot.module.jg.api.entity.JgChangeRegistrationReformEq; import com.yeejoin.amos.boot.module.jg.api.entity.JgChangeRegistrationReformEq;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update; import org.apache.ibatis.annotations.Update;
/** /**
...@@ -14,4 +15,7 @@ import org.apache.ibatis.annotations.Update; ...@@ -14,4 +15,7 @@ import org.apache.ibatis.annotations.Update;
public interface JgChangeRegistrationReformEqMapper extends BaseMapper<JgChangeRegistrationReformEq> { public interface JgChangeRegistrationReformEqMapper extends BaseMapper<JgChangeRegistrationReformEq> {
@Update("update tzs_jg_change_registration_reform_eq set is_invalid = 1 where equ_id = #{equipId} and equip_transfer_id != #{currentDocumentId} ") @Update("update tzs_jg_change_registration_reform_eq set is_invalid = 1 where equ_id = #{equipId} and equip_transfer_id != #{currentDocumentId} ")
void updateEquipIsVaildByEquipIdAndCurrentDocumentId(@Param("equipId") String equipId, @Param("currentDocumentId") String currentDocumentId); void updateEquipIsVaildByEquipIdAndCurrentDocumentId(@Param("equipId") String equipId, @Param("currentDocumentId") String currentDocumentId);
@Select("select equ_id from tzs_jg_change_registration_reform_eq where equip_transfer_id = #{currentDocumentId} ")
String selectEquipId(@Param("currentDocumentId") String currentDocumentId);
} }
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
jri.EQU_CODE as equCode, jri.EQU_CODE as equCode,
use.USE_INNER_CODE as innerCode, use.USE_INNER_CODE as innerCode,
concat(use.PROVINCE_NAME,'-',use.CITY_NAME,'-',use.COUNTY_NAME) as place, concat(use.PROVINCE_NAME,'-',use.CITY_NAME,'-',use.COUNTY_NAME) as place,
ur.instance_id as instanceId, ifnull(ur.instance_id, '') as instanceId,
re.equ_id as equipId, re.equ_id as equipId,
ur.apply_no as applyNo, ur.apply_no as applyNo,
ifnull(ur.next_executor_ids,'') as nextExecutorIds, ifnull(ur.next_executor_ids,'') as nextExecutorIds,
......
...@@ -114,7 +114,7 @@ public class JgChangeRegistrationReformController extends BaseController { ...@@ -114,7 +114,7 @@ public class JgChangeRegistrationReformController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "获取详情", notes = "获取详情") @ApiOperation(httpMethod = "GET", value = "获取详情", notes = "获取详情")
@GetMapping(value = "/getDetail") @GetMapping(value = "/getDetail")
public ResponseModel<Map<String, Object>> getDetail(@RequestParam("currentDocumentId") String currentDocumentId,@RequestParam("equipId") String equipId) { public ResponseModel<Map<String, Object>> getDetail(@RequestParam("currentDocumentId") String currentDocumentId,@RequestParam(value = "equipId",required = false) String equipId) {
return ResponseHelper.buildResponse(jgChangeRegistrationReformServiceImpl.getDetail(currentDocumentId,equipId)); return ResponseHelper.buildResponse(jgChangeRegistrationReformServiceImpl.getDetail(currentDocumentId,equipId));
} }
......
...@@ -106,20 +106,21 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR ...@@ -106,20 +106,21 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR
ReginParams reginParams = JSONObject.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())).toString(), ReginParams.class); ReginParams reginParams = JSONObject.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())).toString(), ReginParams.class);
UseInfo useInfo = new UseInfo(); UseInfo useInfo = new UseInfo();
BeanUtil.copyProperties(map, useInfo); BeanUtil.copyProperties(map, useInfo);
String equipId = map.get("record").toString();
LambdaQueryWrapper<UseInfo> lambda = new QueryWrapper<UseInfo>().lambda(); LambdaQueryWrapper<UseInfo> lambda = new QueryWrapper<UseInfo>().lambda();
lambda.eq(UseInfo::getRecord, map.get("record")); lambda.eq(UseInfo::getRecord,equipId);
// 更新使用信息 // 更新使用信息
useInfoMapper.update(useInfo, lambda); useInfoMapper.update(useInfo, lambda);
InspectionDetectionInfo inspectionDetectionInfo = new InspectionDetectionInfo(); InspectionDetectionInfo inspectionDetectionInfo = new InspectionDetectionInfo();
BeanUtil.copyProperties(map, inspectionDetectionInfo); BeanUtil.copyProperties(map, inspectionDetectionInfo);
LambdaQueryWrapper<InspectionDetectionInfo> inspectionLambda = new QueryWrapper<InspectionDetectionInfo>().lambda(); LambdaQueryWrapper<InspectionDetectionInfo> inspectionLambda = new QueryWrapper<InspectionDetectionInfo>().lambda();
inspectionLambda.eq(InspectionDetectionInfo::getRecord, map.get("record")); inspectionLambda.eq(InspectionDetectionInfo::getRecord, equipId);
// 更新检验检测信息 // 更新检验检测信息
inspectionDetectionInfoMapper.update(inspectionDetectionInfo, inspectionLambda); inspectionDetectionInfoMapper.update(inspectionDetectionInfo, inspectionLambda);
// 使用登记信息 // 使用登记信息
JgChangeRegistrationReform jgChangeRegistrationReform = new JgChangeRegistrationReform(); JgChangeRegistrationReform jgChangeRegistrationReform = new JgChangeRegistrationReform();
LambdaQueryWrapper<OtherInfo> otherLambda = new QueryWrapper<OtherInfo>().lambda(); LambdaQueryWrapper<OtherInfo> otherLambda = new QueryWrapper<OtherInfo>().lambda();
otherLambda.eq(OtherInfo::getRecord, map.get("record")); otherLambda.eq(OtherInfo::getRecord, equipId);
OtherInfo otherInfo = otherInfoMapper.selectOne(otherLambda); OtherInfo otherInfo = otherInfoMapper.selectOne(otherLambda);
String supervisoryCode = otherInfo.getSupervisoryCode(); String supervisoryCode = otherInfo.getSupervisoryCode();
jgChangeRegistrationReform.setSupervisoryCode(supervisoryCode); jgChangeRegistrationReform.setSupervisoryCode(supervisoryCode);
...@@ -154,7 +155,7 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR ...@@ -154,7 +155,7 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR
//登记类别 //登记类别
jgRegistrationHistory.setRegistrationClass("改造登记"); jgRegistrationHistory.setRegistrationClass("改造登记");
//设备id //设备id
jgRegistrationHistory.setEquId(map.get("record").toString()); jgRegistrationHistory.setEquId(equipId);
//修改数据 //修改数据
jgRegistrationHistory.setChangeData(JSONObject.toJSONString(map)); jgRegistrationHistory.setChangeData(JSONObject.toJSONString(map));
//设备监管码 //设备监管码
...@@ -165,13 +166,13 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR ...@@ -165,13 +166,13 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR
jgChangeRegistrationReform.setUseUnitCreditCode(null); jgChangeRegistrationReform.setUseUnitCreditCode(null);
jgChangeRegistrationReform.setSequenceNbr(Long.valueOf(String.valueOf(map.get("sequenceNbr")))); jgChangeRegistrationReform.setSequenceNbr(Long.valueOf(String.valueOf(map.get("sequenceNbr"))));
this.getBaseMapper().updateById(jgChangeRegistrationReform); this.getBaseMapper().updateById(jgChangeRegistrationReform);
jgRegistrationHistory.setSequenceNbr(jgRegistrationHistoryMapper.getSequenceNbrByEquidAndDocumentId(map.get("record").toString(), String.valueOf(map.get("sequenceNbr")))); jgRegistrationHistory.setSequenceNbr(jgRegistrationHistoryMapper.getSequenceNbrByEquidAndDocumentId(equipId, String.valueOf(map.get("sequenceNbr"))));
jgRegistrationHistoryMapper.updateById(jgRegistrationHistory); jgRegistrationHistoryMapper.updateById(jgRegistrationHistory);
} else { } else {
// 业务管理设备信息保存 // 业务管理设备信息保存
JgChangeRegistrationReformEq jgChangeRegistrationReformEq = new JgChangeRegistrationReformEq(); JgChangeRegistrationReformEq jgChangeRegistrationReformEq = new JgChangeRegistrationReformEq();
jgChangeRegistrationReformEq.setEquId(map.get("record").toString()); jgChangeRegistrationReformEq.setEquId(equipId);
List<String> applicationFormCode = iCreateCodeService.createApplicationFormCode(ApplicationFormTypeEnum.GZBG.getCode(), 1); List<String> applicationFormCode = iCreateCodeService.createApplicationFormCode(ApplicationFormTypeEnum.GZBG.getCode(), 1);
jgChangeRegistrationReform.setApplyNo(applicationFormCode.get(0)); jgChangeRegistrationReform.setApplyNo(applicationFormCode.get(0));
jgChangeRegistrationReform.setAuditStatus(WorkFlowStatusEnum.CHANGE_SUBMIT.getPass()); jgChangeRegistrationReform.setAuditStatus(WorkFlowStatusEnum.CHANGE_SUBMIT.getPass());
...@@ -186,7 +187,7 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR ...@@ -186,7 +187,7 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR
if (!ObjectUtils.isEmpty(map.get("submit"))) { if (!ObjectUtils.isEmpty(map.get("submit"))) {
String instanceId = ""; String instanceId = "";
if (map.containsKey("instanceId")) { if (!ObjectUtils.isEmpty(map.get("instanceId"))) {
instanceId = map.get("instanceId").toString(); instanceId = map.get("instanceId").toString();
} else { } else {
// 启动并执行流程 // 启动并执行流程
...@@ -425,14 +426,21 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR ...@@ -425,14 +426,21 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR
public Map<String, Object> getDetail(String currentDocumentId, String equipId) { public Map<String, Object> getDetail(String currentDocumentId, String equipId) {
JgChangeRegistrationReform jgChangeRegistrationReform = this.getBaseMapper().selectById(currentDocumentId); JgChangeRegistrationReform jgChangeRegistrationReform = this.getBaseMapper().selectById(currentDocumentId);
if(ObjectUtils.isEmpty(equipId)){
equipId = jgChangeRegistrationReformEqMapper.selectEquipId(currentDocumentId);
}
Map<String, Object> detail = JSONObject.parseObject(JSONObject.toJSONString(jgChangeRegistrationReform), Map.class); Map<String, Object> detail = JSONObject.parseObject(JSONObject.toJSONString(jgChangeRegistrationReform), Map.class);
Map<String, Object> originalData = new HashMap<>(); Map<String, Object> originalData = new HashMap<>();
if ((detail.get("status").equals("已完成") || detail.get("status").equals("流程结束"))) { if ((detail.get("status").equals("已完成") || detail.get("status").equals("流程结束"))) {
originalData = idxBizJgRegisterInfoService.getDetailFieldCamelCaseByRecord(equipId); originalData = idxBizJgRegisterInfoService.getDetailFieldCamelCaseByRecord(equipId);
originalData.remove("sequenceNbr"); originalData.remove("sequenceNbr");
if(!ObjectUtils.isEmpty(detail.get("transformationQualityCertificate"))){
detail.put("transformationQualityCertificate", JSONObject.parse(detail.get("transformationQualityCertificate").toString())); detail.put("transformationQualityCertificate", JSONObject.parse(detail.get("transformationQualityCertificate").toString()));
}
if(!ObjectUtils.isEmpty(detail.get("renovationSupervisioninspectionCertificate"))){
detail.put("renovationSupervisioninspectionCertificate", JSONObject.parse(detail.get("renovationSupervisioninspectionCertificate").toString())); detail.put("renovationSupervisioninspectionCertificate", JSONObject.parse(detail.get("renovationSupervisioninspectionCertificate").toString()));
}
} else { } else {
JgRegistrationHistory jgRegistrationHistory = jgRegistrationHistoryMapper.selectOne(new QueryWrapper<JgRegistrationHistory>() JgRegistrationHistory jgRegistrationHistory = jgRegistrationHistoryMapper.selectOne(new QueryWrapper<JgRegistrationHistory>()
.eq("equ_id", equipId) .eq("equ_id", equipId)
......
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