Commit 09e982b2 authored by suhuiguang's avatar suhuiguang

1.A032 无检验信息时报错

parent 3575d333
......@@ -146,7 +146,8 @@
INSPECT_DATE as inspectDate,
NEXT_INSPECT_DATE as nextInspectDate,
INSPECT_REPORT as inspectReport,
INSPECT_ORG_CODE as inspectOrgCode
INSPECT_ORG_CODE as inspectOrgCode,
SEQUENCE_NBR as jySeq
from idx_biz_jg_inspection_detection_info
where
RECORD = #{id}
......
......@@ -209,11 +209,8 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
useInfo.setEquState(String.valueOf(EquimentEnum.ZAIYONG.getCode()));
// 更新使用信息
useInfoMapper.update(useInfo, lambda);
InspectionDetectionInfo inspectionDetectionInfo = new InspectionDetectionInfo();
BeanUtil.copyProperties(map, inspectionDetectionInfo);
// 更新检验检测信息
this.updateOrCreateInspectionDetection(map.get("equipId"), inspectionDetectionInfo);
this.updateOrCreateInspectionDetection(map);
// 更新注册登记信息表
LambdaQueryWrapper<JgUseRegistrationEq> jgUseRegEqWrapper = new QueryWrapper<JgUseRegistrationEq>().lambda();
jgUseRegEqWrapper.eq(JgUseRegistrationEq::getEquipTransferId, currentDocumentId);
......@@ -240,12 +237,22 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
createCode(map, jgUseRegistration, registerInfo, useInfo, otherInfo);
}
private void updateOrCreateInspectionDetection(Object equipId, InspectionDetectionInfo inspectionDetectionInfo) {
LambdaQueryWrapper<InspectionDetectionInfo> inspectionLambda = new QueryWrapper<InspectionDetectionInfo>().lambda();
inspectionLambda.eq(InspectionDetectionInfo::getRecord, equipId);
InspectionDetectionInfo inspectionDetectionInfoDb = inspectionDetectionInfoMapper.selectOne(inspectionLambda);
private void updateOrCreateInspectionDetection(JSONObject map) {
InspectionDetectionInfo inspectionDetectionInfo = new InspectionDetectionInfo();
BeanUtil.copyProperties(map, inspectionDetectionInfo);
if(map.get("jySeq") != null){
// 更新逻辑
InspectionDetectionInfo inspectionDetectionInfoDb = inspectionDetectionInfoMapper.selectById(map.get("jySeq").toString());
Bean.copyExistPropertis(inspectionDetectionInfo, inspectionDetectionInfoDb);
inspectionDetectionInfoMapper.update(inspectionDetectionInfo, inspectionLambda);
inspectionDetectionInfoMapper.updateById(inspectionDetectionInfo);
} else {
// 插入逻辑
if(inspectionDetectionInfo.getInspectType() != null && inspectionDetectionInfo.getInspectStaffCode() != null){
inspectionDetectionInfo.setRecDate(new Date());
inspectionDetectionInfo.setSequenceNbr(null);
inspectionDetectionInfoMapper.insert(inspectionDetectionInfo);
}
}
}
/**
......
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