Commit af793dfb authored by suhuiguang's avatar suhuiguang

1.管道刷历史数据,装置的检验信息兼容最早版本的数据(单节管道维护)

parent d736948b
......@@ -4,7 +4,8 @@
<select id="selectErrorRecordOfInIntoManage" resultType="com.yeejoin.amos.boot.module.jg.api.entity.JgInstallationNoticeEq">
SELECT
ne.equ_id
ne.equ_id,
ne.inform_number
FROM
"tzs_jg_installation_notice" n,
tzs_jg_installation_notice_eq ne,
......
......@@ -6,6 +6,7 @@ import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yeejoin.amos.boot.biz.common.dao.mapper.DataDictionaryMapper;
......@@ -17,6 +18,7 @@ import com.yeejoin.amos.boot.module.common.api.dto.ESEquipmentCategoryDto;
import com.yeejoin.amos.boot.module.jg.api.entity.*;
import com.yeejoin.amos.boot.module.jg.api.enums.PipelineEnum;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgInstallationNoticeEqMapper;
import com.yeejoin.amos.boot.module.jg.biz.service.IIdxBizJgInspectionDetectionInfoService;
import com.yeejoin.amos.boot.module.ymt.api.entity.*;
import com.yeejoin.amos.boot.module.ymt.api.enums.FlowStatusEnum;
import com.yeejoin.amos.boot.module.ymt.api.mapper.EquipmentCategoryMapper;
......@@ -25,6 +27,7 @@ import com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgProjectInspectionMapp
import com.yeejoin.amos.boot.module.ymt.api.mapper.TzBaseEnterpriseInfoMapper;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
......@@ -111,6 +114,9 @@ public class DataHandlerServiceImpl {
@Resource
IdxBizJgProjectInspectionMapper projectInspectionMapper;
@Resource
IIdxBizJgInspectionDetectionInfoService iIdxBizJgInspectionDetectionInfoService;
/**
* 安装告知压力管道历史数据修复-详情中的设备列表修改为汇总表格式
......@@ -642,7 +648,7 @@ public class DataHandlerServiceImpl {
idxBizJgProjectContraption.setRecDate(new Date());
idxBizJgProjectContraption.setIsDelete(Boolean.FALSE);
// 安装告知完成后,创建装置的施工信息表
saveProjectConstructionAfterFinish(installationNotice, isFinish, eqs, sequenceNbr, records);
saveProjectConstructionAfterFinish(installationNotice, isFinish, noticeEqs, sequenceNbr, records);
// 安装告知表写入装置id
updateProjectContraptionId2Notice(installationNotice, idxBizJgProjectContraption);
projectContraptionList.add(idxBizJgProjectContraption);
......@@ -666,7 +672,7 @@ public class DataHandlerServiceImpl {
private void updateProjectContraptionId2Notice(JgInstallationNotice installationNotice, IdxBizJgProjectContraption idxBizJgProjectContraption) {
LambdaUpdateWrapper<JgInstallationNotice> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.set(JgInstallationNotice::getProjectContraptionId, installationNotice.getProjectContraptionId());
updateWrapper.eq(BaseEntity::getSequenceNbr, idxBizJgProjectContraption.getSequenceNbr());
updateWrapper.eq(BaseEntity::getSequenceNbr, installationNotice.getSequenceNbr());
installationNoticeService.update(null, updateWrapper);
}
......@@ -773,8 +779,28 @@ public class DataHandlerServiceImpl {
JSONObject mapData = JSONObject.parseObject(jgRegistrationHistory.getChangeData());
IdxBizJgProjectInspection inspectionDetectionInfo = new IdxBizJgProjectInspection();
BeanUtil.copyProperties(mapData, inspectionDetectionInfo);
// 兼容最早的老数据,管道的检验信息单独维护
if(inspectionDetectionInfo.getInspectConclusion() == null && mapData.containsKey("equipmentLists")){
List<Map<String, Object>> equipmentLists = null;
try {
equipmentLists = objectMapper.readValue(
objectMapper.writeValueAsString(mapData.get("equipmentLists")),
new TypeReference<ArrayList<Map<String, Object>>>() {
}
);
if(!equipmentLists.isEmpty()){
Object record = equipmentLists.get(0).get("record");
IdxBizJgInspectionDetectionInfo idxBizJgInspectionDetectionInfo = iIdxBizJgInspectionDetectionInfoService.queryNewestDetailByRecord(String.valueOf(record));
BeanUtil.copyProperties(idxBizJgInspectionDetectionInfo, inspectionDetectionInfo);
inspectionDetectionInfo.setRecord(null);
}
} catch (JsonProcessingException e) {
throw new RuntimeException(e);
}
}
inspectionDetectionInfo.setProjectContraptionId(useRegistration.getProjectContraptionId());
inspectionDetectionInfo.setRecDate(new Date());
// 使用登记创建新增的检验信息id设置为使用登记的主键id,在作废时级联作废
inspectionDetectionInfo.setSequenceNbr(useRegistration.getSequenceNbr() + "");
projectInspectionMapper.insert(inspectionDetectionInfo);
......@@ -793,6 +819,6 @@ public class DataHandlerServiceImpl {
.ne(JgUseRegistration::getStatus, FlowStatusEnum.TO_BE_DISCARD.getName())
.ne(JgUseRegistration::getProjectContraption, "")
.isNull(JgUseRegistration::getProjectContraptionId)
.select(BaseEntity::getSequenceNbr, JgUseRegistration::getProjectContraption, JgUseRegistration::getUseRegistrationCode, JgUseRegistration::getStatus));
.select(BaseEntity::getSequenceNbr, JgUseRegistration::getProjectContraption, JgUseRegistration::getUseRegistrationCode, JgUseRegistration::getStatus, JgUseRegistration::getAuditPassDate));
}
}
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