Commit d736948b authored by 麻笑宇's avatar 麻笑宇

Merge remote-tracking branch 'origin/develop_tzs_bugfix' into develop_tzs_bugfix

parents 3cfd068f 6aa7da3c
package com.yeejoin.amos.boot.module.jg.biz.service.impl; package com.yeejoin.amos.boot.module.jg.biz.service.impl;
import cn.hutool.core.bean.BeanUtil;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
...@@ -7,7 +8,9 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; ...@@ -7,7 +8,9 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import com.yeejoin.amos.boot.biz.common.dao.mapper.DataDictionaryMapper;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity; import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import com.yeejoin.amos.boot.biz.common.entity.DataDictionary;
import com.yeejoin.amos.boot.biz.common.utils.SnowflakeIdUtil; import com.yeejoin.amos.boot.biz.common.utils.SnowflakeIdUtil;
import com.yeejoin.amos.boot.module.common.api.dao.ESEquipmentCategory; import com.yeejoin.amos.boot.module.common.api.dao.ESEquipmentCategory;
import com.yeejoin.amos.boot.module.common.api.dto.ESEquipmentCategoryDto; import com.yeejoin.amos.boot.module.common.api.dto.ESEquipmentCategoryDto;
...@@ -17,13 +20,17 @@ import com.yeejoin.amos.boot.module.jg.api.mapper.JgInstallationNoticeEqMapper; ...@@ -17,13 +20,17 @@ import com.yeejoin.amos.boot.module.jg.api.mapper.JgInstallationNoticeEqMapper;
import com.yeejoin.amos.boot.module.ymt.api.entity.*; 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.enums.FlowStatusEnum;
import com.yeejoin.amos.boot.module.ymt.api.mapper.EquipmentCategoryMapper; import com.yeejoin.amos.boot.module.ymt.api.mapper.EquipmentCategoryMapper;
import com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgProjectConstructionMapper;
import com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgProjectInspectionMapper;
import com.yeejoin.amos.boot.module.ymt.api.mapper.TzBaseEnterpriseInfoMapper; import com.yeejoin.amos.boot.module.ymt.api.mapper.TzBaseEnterpriseInfoMapper;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.springframework.util.StopWatch; import org.springframework.util.StopWatch;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import javax.annotation.Resource; import javax.annotation.Resource;
...@@ -34,6 +41,9 @@ import java.util.concurrent.ConcurrentHashMap; ...@@ -34,6 +41,9 @@ import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.atomic.AtomicReference; import java.util.concurrent.atomic.AtomicReference;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import static com.yeejoin.amos.boot.module.jg.biz.service.impl.JgInstallationNoticeServiceImpl.CONSTRUCTION_TYPE;
import static com.yeejoin.amos.boot.module.jg.biz.service.impl.JgInstallationNoticeServiceImpl.CONSTRUCTION_TYPE_NAME;
/** /**
* 用于业务变更过程中的历史数据处理的service层 * 用于业务变更过程中的历史数据处理的service层
*/ */
...@@ -69,6 +79,9 @@ public class DataHandlerServiceImpl { ...@@ -69,6 +79,9 @@ public class DataHandlerServiceImpl {
private IdxBizJgProjectContraptionServiceImpl projectContraptionService; private IdxBizJgProjectContraptionServiceImpl projectContraptionService;
@Resource @Resource
private IdxBizJgProjectConstructionMapper projectConstructionMapper;
@Resource
private IdxBizJgTechParamsPipelineServiceImpl techParamsPipelineService; private IdxBizJgTechParamsPipelineServiceImpl techParamsPipelineService;
@Resource @Resource
...@@ -92,6 +105,12 @@ public class DataHandlerServiceImpl { ...@@ -92,6 +105,12 @@ public class DataHandlerServiceImpl {
@Resource @Resource
private JgInstallationNoticeEqMapper jgInstallationNoticeEqMapper; private JgInstallationNoticeEqMapper jgInstallationNoticeEqMapper;
@Resource
private DataDictionaryMapper dataDictionaryMapper;
@Resource
IdxBizJgProjectInspectionMapper projectInspectionMapper;
/** /**
* 安装告知压力管道历史数据修复-详情中的设备列表修改为汇总表格式 * 安装告知压力管道历史数据修复-详情中的设备列表修改为汇总表格式
...@@ -530,7 +549,7 @@ public class DataHandlerServiceImpl { ...@@ -530,7 +549,7 @@ public class DataHandlerServiceImpl {
public void projectContraptionNoticeDataDeal() { public void projectContraptionNoticeDataDeal() {
// 1.安装告知完成但是设备状态未非已纳管状态:设备的idx_biz_jg_use_info表的IS_INTO_MANAGEMENT刷为已纳管, es的IS_INTO_MANAGEMENT刷为已纳管 // 1.安装告知完成但是设备状态未非已纳管状态:设备的idx_biz_jg_use_info表的IS_INTO_MANAGEMENT刷为已纳管, es的IS_INTO_MANAGEMENT刷为已纳管
List<JgInstallationNoticeEq> eqs = jgInstallationNoticeEqMapper.selectErrorRecordOfInIntoManage(); List<JgInstallationNoticeEq> eqs = jgInstallationNoticeEqMapper.selectErrorRecordOfInIntoManage();
log.info("处理前:1.安装告知完成但是设备状态未非已纳管状态的设备数量:{}", eqs.size()); log.info("处理前统计:1.安装告知完成但是设备状态未非已纳管状态的设备数量:{}", eqs.size());
for(JgInstallationNoticeEq eq : eqs){ for(JgInstallationNoticeEq eq : eqs){
// 使用信息表刷已纳管 // 使用信息表刷已纳管
useInfoService.lambdaUpdate() useInfoService.lambdaUpdate()
...@@ -546,11 +565,11 @@ public class DataHandlerServiceImpl { ...@@ -546,11 +565,11 @@ public class DataHandlerServiceImpl {
} }
// 2.安装告知非已作废,但是缺少装置id的数据处理:创建装置、写入安装告知表project_contraption_id、写入设备es的装置id,设备使用信息表的projectContraptionId // 2.安装告知非已作废,但是缺少装置id的数据处理:创建装置、写入安装告知表project_contraption_id、写入设备es的装置id,设备使用信息表的projectContraptionId
List<JgInstallationNotice> noticeList = getErrorInstallNoticeData(); List<JgInstallationNotice> noticeList = getErrorInstallNoticeData();
log.info("处理前:2.安装告知非已作废,但是缺少装置id安装告知单据数量:{}", noticeList.size()); log.info("处理前统计:2.安装告知非已作废,但是缺少装置id安装告知单据数量:{}", noticeList.size());
List<IdxBizJgProjectContraption> projectContraptionList = new ArrayList<>(); List<IdxBizJgProjectContraption> projectContraptionList = new ArrayList<>();
Map<Long, List<String>> projectContraptionIdRecordsMap = new HashMap<>(); Map<Long, List<String>> projectContraptionIdRecordsMap = new HashMap<>();
for(JgInstallationNotice installationNotice : noticeList){ for(JgInstallationNotice installationNotice : noticeList){
List<JgInstallationNoticeEq> noticeEqs = installationNoticeEqService.list(new LambdaQueryWrapper<JgInstallationNoticeEq>().eq(JgInstallationNoticeEq::getEquipTransferId, installationNotice.getSequenceNbr()).select(JgInstallationNoticeEq::getEquId)); List<JgInstallationNoticeEq> noticeEqs = installationNoticeEqService.list(new LambdaQueryWrapper<JgInstallationNoticeEq>().eq(JgInstallationNoticeEq::getEquipTransferId, installationNotice.getSequenceNbr()).select(JgInstallationNoticeEq::getEquId,JgInstallationNoticeEq::getInformNumber));
List<String> records = noticeEqs.stream().map(JgInstallationNoticeEq::getEquId).collect(Collectors.toList()); List<String> records = noticeEqs.stream().map(JgInstallationNoticeEq::getEquId).collect(Collectors.toList());
List<IdxBizJgUseInfo> useInfos = useInfoService.lambdaQuery() List<IdxBizJgUseInfo> useInfos = useInfoService.lambdaQuery()
.in(IdxBizJgUseInfo::getRecord, records) .in(IdxBizJgUseInfo::getRecord, records)
...@@ -583,9 +602,12 @@ public class DataHandlerServiceImpl { ...@@ -583,9 +602,12 @@ public class DataHandlerServiceImpl {
installationNotice.setProjectContraptionId(sequenceNbr + ""); installationNotice.setProjectContraptionId(sequenceNbr + "");
// key为装置id,value为此装置下的管道数组 // key为装置id,value为此装置下的管道数组
projectContraptionIdRecordsMap.put(sequenceNbr, records); projectContraptionIdRecordsMap.put(sequenceNbr, records);
boolean isFinish = String.valueOf(FlowStatusEnum.TO_BE_FINISHED.getCode()).equals(installationNotice.getNoticeStatus());
IdxBizJgProjectContraption idxBizJgProjectContraption = IdxBizJgProjectContraption.builder() IdxBizJgProjectContraption idxBizJgProjectContraption = IdxBizJgProjectContraption.builder()
.projectContraption(installationNotice.getProjectContraption()) .projectContraption(installationNotice.getProjectContraption())
.projectContraptionNo(installationNotice.getProjectContraption()) .projectContraptionNo(installationNotice.getProjectContraption())
.useUnitCreditCode(isFinish ? installationNotice.getUseUnitCreditCode() : null)
.useUnitName(isFinish ? installationNotice.getUseUnitName() : null)
.uscUnitCreditCode(installationNotice.getInstallUnitCreditCode()) .uscUnitCreditCode(installationNotice.getInstallUnitCreditCode())
.uscUnitName(installationNotice.getInstallUnitName()) .uscUnitName(installationNotice.getInstallUnitName())
.equList(installationNotice.getEquListCode()) .equList(installationNotice.getEquListCode())
...@@ -607,35 +629,83 @@ public class DataHandlerServiceImpl { ...@@ -607,35 +629,83 @@ public class DataHandlerServiceImpl {
.cityName(installationNotice.getCityName()) .cityName(installationNotice.getCityName())
.county(installationNotice.getCounty()) .county(installationNotice.getCounty())
.countyName(installationNotice.getCountyName()) .countyName(installationNotice.getCountyName())
.street(installationNotice.getStreet()) .street(installationNotice.getFactoryUseSiteStreet())
.streetName(installationNotice.getStreetName()) .streetName(installationNotice.getStreetName())
.address(installationNotice.getAddress()) .address(installationNotice.getAddress())
.startLatitudeLongitude(ObjectUtils.isEmpty(idxBizJgTechParamsPipelines) ? null : idxBizJgTechParamsPipelines.get(0).getStartePosition()) .startLatitudeLongitude(ObjectUtils.isEmpty(idxBizJgTechParamsPipelines) ? null : idxBizJgTechParamsPipelines.get(0).getStartePosition())
.endLatitudeLongitude(ObjectUtils.isEmpty(idxBizJgTechParamsPipelines) ? null : idxBizJgTechParamsPipelines.get(0).getEndPosition()) .endLatitudeLongitude(ObjectUtils.isEmpty(idxBizJgTechParamsPipelines) ? null : idxBizJgTechParamsPipelines.get(0).getEndPosition())
.supervisoryCode(installationNotice.getSupervisoryCode()) .supervisoryCode(installationNotice.getSupervisoryCode())
.isIntoManagement(String.valueOf(FlowStatusEnum.TO_BE_FINISHED.getCode()).equals(installationNotice.getNoticeStatus())) .isIntoManagement(isFinish)
.dataSource("jg") .dataSource("jg")
.build(); .build();
idxBizJgProjectContraption.setSequenceNbr(sequenceNbr); idxBizJgProjectContraption.setSequenceNbr(sequenceNbr);
idxBizJgProjectContraption.setRecDate(new Date()); idxBizJgProjectContraption.setRecDate(new Date());
idxBizJgProjectContraption.setIsDelete(Boolean.FALSE); idxBizJgProjectContraption.setIsDelete(Boolean.FALSE);
// 安装告知完成后,创建装置的施工信息表
saveProjectConstructionAfterFinish(installationNotice, isFinish, eqs, sequenceNbr, records);
// 安装告知表写入装置id
updateProjectContraptionId2Notice(installationNotice, idxBizJgProjectContraption);
projectContraptionList.add(idxBizJgProjectContraption); projectContraptionList.add(idxBizJgProjectContraption);
} }
if(!noticeList.isEmpty()){ // 创建装置
installationNoticeService.updateBatchById(noticeList);
}
if(!projectContraptionList.isEmpty()){ if(!projectContraptionList.isEmpty()){
projectContraptionService.saveBatch(projectContraptionList); projectContraptionService.saveBatch(projectContraptionList);
} }
// 更新设备es的装置id
projectContraptionIdRecordsMap.forEach((k,v)->{ projectContraptionIdRecordsMap.forEach((k,v)->{
Iterable<ESEquipmentCategoryDto> equipmentCategories = esEquipmentCategory.findAllById(v); Iterable<ESEquipmentCategoryDto> equipmentCategories = esEquipmentCategory.findAllById(v);
equipmentCategories.forEach(e-> e.setProjectContraptionId(k + "")); equipmentCategories.forEach(e-> e.setProjectContraptionId(k + ""));
esEquipmentCategory.saveAll(equipmentCategories); esEquipmentCategory.saveAll(equipmentCategories);
}); });
List<JgInstallationNoticeEq> eqsAfter = jgInstallationNoticeEqMapper.selectErrorRecordOfInIntoManage(); List<JgInstallationNoticeEq> eqsAfter = jgInstallationNoticeEqMapper.selectErrorRecordOfInIntoManage();
log.info("处理后:3.安装告知完成但是设备状态未非已纳管状态的设备数量:{}", eqsAfter.size()); log.info("处理后统计:3.安装告知完成但是设备状态未非已纳管状态的设备数量:{}", eqsAfter.size());
List<JgInstallationNotice> noticeListAfter = getErrorInstallNoticeData(); List<JgInstallationNotice> noticeListAfter = getErrorInstallNoticeData();
log.info("处理后:4.安装告知非已作废,但是缺少装置id安装告知单据数量:{}", noticeListAfter.size()); log.info("处理后统计:4.安装告知非已作废,但是缺少装置id安装告知单据数量:{}", noticeListAfter.size());
}
private void updateProjectContraptionId2Notice(JgInstallationNotice installationNotice, IdxBizJgProjectContraption idxBizJgProjectContraption) {
LambdaUpdateWrapper<JgInstallationNotice> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.set(JgInstallationNotice::getProjectContraptionId, installationNotice.getProjectContraptionId());
updateWrapper.eq(BaseEntity::getSequenceNbr, idxBizJgProjectContraption.getSequenceNbr());
installationNoticeService.update(null, updateWrapper);
}
private void saveProjectConstructionAfterFinish(JgInstallationNotice installationNotice, boolean isFinish, List<JgInstallationNoticeEq> eqs, Long sequenceNbr, List<String> records) {
if(isFinish){
IdxBizJgProjectConstruction idxBizJgProjectConstruction = new IdxBizJgProjectConstruction();
idxBizJgProjectConstruction.setUscUnitCreditCode(installationNotice.getInstallUnitCreditCode());
idxBizJgProjectConstruction.setUscUnitName(installationNotice.getInstallUnitName());
idxBizJgProjectConstruction.setUscDate(installationNotice.getInstallStartDate());
idxBizJgProjectConstruction.setRecord(String.valueOf(installationNotice.getSequenceNbr()));
idxBizJgProjectConstruction.setSequenceCode(String.valueOf(installationNotice.getSequenceNbr()));
idxBizJgProjectConstruction.setNoticeId(String.valueOf(installationNotice.getSequenceNbr()));
idxBizJgProjectConstruction.setInformCode(eqs.stream().findFirst().orElse(new JgInstallationNoticeEq()).getInformNumber());
idxBizJgProjectConstruction.setConstructionLeaderId(installationNotice.getInstallLeaderId());
idxBizJgProjectConstruction.setConstructionLeaderName(installationNotice.getInstallLeaderName());
idxBizJgProjectConstruction.setConstructionLeaderPhone(installationNotice.getInstallLeaderPhone());
idxBizJgProjectConstruction.setAddress(installationNotice.getAddress());
idxBizJgProjectConstruction.setProvinceName(installationNotice.getProvinceName());
idxBizJgProjectConstruction.setCityName(installationNotice.getCityName());
idxBizJgProjectConstruction.setCountyName(installationNotice.getCountyName());
idxBizJgProjectConstruction.setStreetName(installationNotice.getStreetName());
idxBizJgProjectConstruction.setIsXixian(installationNotice.getIsXixian());
idxBizJgProjectConstruction.setProjectContraptionId(sequenceNbr + "");
idxBizJgProjectConstruction.setEquipRecords(StringUtils.join(records, ","));
idxBizJgProjectConstruction.setConstructionContractAttachment(installationNotice.getInstallContractAttachment());
idxBizJgProjectConstruction.setProxyStatementAttachment(installationNotice.getProxyStatementAttachment());
idxBizJgProjectConstruction.setConstructionOtherAccessories(installationNotice.getOtherAccessories());
idxBizJgProjectConstruction.setRecDate(new Date());
idxBizJgProjectConstruction.setRecUserId(RequestContext.getExeUserId());
// 获取施工类型id
LambdaQueryWrapper<DataDictionary> lambda = new LambdaQueryWrapper<>();
lambda.eq(DataDictionary::getType, CONSTRUCTION_TYPE);
lambda.eq(DataDictionary::getName, CONSTRUCTION_TYPE_NAME);
List<DataDictionary> dataDictionaries = dataDictionaryMapper.selectList(lambda);
if (!CollectionUtils.isEmpty(dataDictionaries)) {
idxBizJgProjectConstruction.setConstructionType(String.valueOf(dataDictionaries.get(0).getSequenceNbr()));
}
projectConstructionMapper.insert(idxBizJgProjectConstruction);
}
} }
private List<JgInstallationNotice> getErrorInstallNoticeData() { private List<JgInstallationNotice> getErrorInstallNoticeData() {
...@@ -652,44 +722,62 @@ public class DataHandlerServiceImpl { ...@@ -652,44 +722,62 @@ public class DataHandlerServiceImpl {
public void projectContraptionUseRegisterDataDeal(){ public void projectContraptionUseRegisterDataDeal(){
// 查询使用登记:非作废状态 有装置名称但是缺少装置id的使用登记单据进行数据处理 // 查询使用登记:非作废状态 有装置名称但是缺少装置id的使用登记单据进行数据处理
List<JgUseRegistration> useRegistrations = getUseRegisterOfError(); List<JgUseRegistration> useRegistrations = getUseRegisterOfError();
log.info("处理前:1.使用登记装置id历史数据填充,存在缺少装置id的单据数量:{}", useRegistrations.size()); log.info("处理前统计:1.使用登记装置id历史数据填充,存在缺少装置id的单据数量:{}", useRegistrations.size());
// 循环按照使用登记的eq表关联安装告知eq表,在安装告知主表查询装置id // 循环按照使用登记的eq表关联安装告知eq表,在安装告知主表查询装置id
for(JgUseRegistration useRegistration : useRegistrations){ for(JgUseRegistration useRegistration : useRegistrations){
// 登记的关联的告知单据【逻辑按照eq进行关联】 // 登记的关联的告知单据【逻辑按照eq进行关联】
JgInstallationNotice installationNotice = installationNoticeService.getBaseMapper().selectNoticeDataByUseRegisterId(useRegistration.getSequenceNbr() + ""); JgInstallationNotice installationNotice = installationNoticeService.getBaseMapper().selectNoticeDataByUseRegisterId(useRegistration.getSequenceNbr() + "");
if(installationNotice != null && StringUtils.isNotEmpty(installationNotice.getProjectContraptionId())){ if(installationNotice != null && StringUtils.isNotEmpty(installationNotice.getProjectContraptionId())){
// 1.填充装置id // 0.填充装置id
useRegistration.setProjectContraptionId(installationNotice.getProjectContraptionId()); useRegistration.setProjectContraptionId(installationNotice.getProjectContraptionId());
// 2.已完成状状态清除装置表的安装单位信息字段,填充使用信息数据, // 1.已完成状状态清除装置表的安装单位信息字段,填充使用信息数据,创建装置检验信息表
if(FlowStatusEnum.TO_BE_FINISHED.getName().equals(useRegistration.getStatus())){ if(FlowStatusEnum.TO_BE_FINISHED.getName().equals(useRegistration.getStatus())){
// 特殊处理 将任意一个的 record 放入到remark字段 updateProjectContraptionAfter(useRegistration, installationNotice);
IdxBizJgUseInfo useInfo = getIdxBizJgUseInfo(installationNotice.getRemark()); // 创建装置检验流水信息
LambdaUpdateWrapper<IdxBizJgProjectContraption> updateWrapper = new LambdaUpdateWrapper<>(); createProjectInspectInfoAfter(useRegistration);
updateWrapper.eq(BaseEntity::getSequenceNbr, installationNotice.getProjectContraptionId());
updateWrapper.set(IdxBizJgProjectContraption::getUscUnitCreditCode ,null);
updateWrapper.set(IdxBizJgProjectContraption::getUscUnitName,null);
updateWrapper.set(IdxBizJgProjectContraption::getUseRegistrationCode, useRegistration.getUseRegistrationCode());
updateWrapper.set(IdxBizJgProjectContraption::getProvince, useInfo.getProvince());
updateWrapper.set(IdxBizJgProjectContraption::getProvinceName, useInfo.getProvinceName());
updateWrapper.set(IdxBizJgProjectContraption::getCity, useInfo.getCity());
updateWrapper.set(IdxBizJgProjectContraption::getCityName, useInfo.getCityName());
updateWrapper.set(IdxBizJgProjectContraption::getCounty, useInfo.getCounty());
updateWrapper.set(IdxBizJgProjectContraption::getCountyName, useInfo.getCountyName());
updateWrapper.set(IdxBizJgProjectContraption::getStreet, useInfo.getFactoryUseSiteStreet());
updateWrapper.set(IdxBizJgProjectContraption::getStreetName, useInfo.getStreetName());
updateWrapper.set(IdxBizJgProjectContraption::getAddress, useInfo.getAddress());
projectContraptionService.update(null, updateWrapper);
} }
// 2.使用登记写入装置id
LambdaUpdateWrapper<JgUseRegistration> updateWrapper = new LambdaUpdateWrapper<>(); LambdaUpdateWrapper<JgUseRegistration> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.set(JgUseRegistration::getProjectContraptionId, useRegistration.getProjectContraptionId()); updateWrapper.set(JgUseRegistration::getProjectContraptionId, useRegistration.getProjectContraptionId());
updateWrapper.eq(BaseEntity::getSequenceNbr, useRegistration.getSequenceNbr()); updateWrapper.eq(BaseEntity::getSequenceNbr, useRegistration.getSequenceNbr());
useRegistrationService.update(null, updateWrapper); useRegistrationService.update(null, updateWrapper);
} }
} }
List<JgUseRegistration> useRegistrationsAfter = getUseRegisterOfError(); List<JgUseRegistration> useRegistrationsAfter = getUseRegisterOfError();
log.info("处理后:2.使用登记装置id历史数据填充,存在缺少装置id的单据数量:{}", useRegistrationsAfter.size()); log.info("处理后统计:2.使用登记装置id历史数据填充,存在缺少装置id的单据数量:{}", useRegistrationsAfter.size());
}
private void updateProjectContraptionAfter(JgUseRegistration useRegistration, JgInstallationNotice installationNotice) {
// 特殊处理 将任意一个的 record 放入到remark字段
IdxBizJgUseInfo useInfo = getIdxBizJgUseInfo(installationNotice.getRemark());
LambdaUpdateWrapper<IdxBizJgProjectContraption> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(BaseEntity::getSequenceNbr, installationNotice.getProjectContraptionId());
updateWrapper.set(IdxBizJgProjectContraption::getUscUnitCreditCode ,null);
updateWrapper.set(IdxBizJgProjectContraption::getUscUnitName,null);
updateWrapper.set(IdxBizJgProjectContraption::getUseRegistrationCode, useRegistration.getUseRegistrationCode());
updateWrapper.set(IdxBizJgProjectContraption::getProvince, useInfo.getProvince());
updateWrapper.set(IdxBizJgProjectContraption::getProvinceName, useInfo.getProvinceName());
updateWrapper.set(IdxBizJgProjectContraption::getCity, useInfo.getCity());
updateWrapper.set(IdxBizJgProjectContraption::getCityName, useInfo.getCityName());
updateWrapper.set(IdxBizJgProjectContraption::getCounty, useInfo.getCounty());
updateWrapper.set(IdxBizJgProjectContraption::getCountyName, useInfo.getCountyName());
updateWrapper.set(IdxBizJgProjectContraption::getStreet, useInfo.getFactoryUseSiteStreet());
updateWrapper.set(IdxBizJgProjectContraption::getStreetName, useInfo.getStreetName());
updateWrapper.set(IdxBizJgProjectContraption::getAddress, useInfo.getAddress());
updateWrapper.set(IdxBizJgProjectContraption::getUseDate, useRegistration.getAuditPassDate());
projectContraptionService.update(null, updateWrapper);
}
private void createProjectInspectInfoAfter(JgUseRegistration useRegistration) {
JgRegistrationHistory jgRegistrationHistory = getRegistrationHistory(useRegistration.getSequenceNbr() + "");
JSONObject mapData = JSONObject.parseObject(jgRegistrationHistory.getChangeData());
IdxBizJgProjectInspection inspectionDetectionInfo = new IdxBizJgProjectInspection();
BeanUtil.copyProperties(mapData, inspectionDetectionInfo);
inspectionDetectionInfo.setProjectContraptionId(useRegistration.getProjectContraptionId());
inspectionDetectionInfo.setRecDate(new Date());
// 使用登记创建新增的检验信息id设置为使用登记的主键id,在作废时级联作废
inspectionDetectionInfo.setSequenceNbr(useRegistration.getSequenceNbr() + "");
projectInspectionMapper.insert(inspectionDetectionInfo);
} }
private IdxBizJgUseInfo getIdxBizJgUseInfo(String record) { private IdxBizJgUseInfo getIdxBizJgUseInfo(String record) {
......
...@@ -109,8 +109,8 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN ...@@ -109,8 +109,8 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
private static final String PROCESS_INSTALL_NOTICE_KEY = "installNotice"; private static final String PROCESS_INSTALL_NOTICE_KEY = "installNotice";
private static final String TABLE_PAGE_ID = "1734141426742095873"; private static final String TABLE_PAGE_ID = "1734141426742095873";
private static final String CONSTRUCTION_TYPE = "SGLX"; public static final String CONSTRUCTION_TYPE = "SGLX";
private static final String CONSTRUCTION_TYPE_NAME = "安装"; public static final String CONSTRUCTION_TYPE_NAME = "安装";
@Autowired @Autowired
JgInstallationNoticeEqMapper jgInstallationNoticeEqMapper; JgInstallationNoticeEqMapper jgInstallationNoticeEqMapper;
......
...@@ -25,11 +25,12 @@ ...@@ -25,11 +25,12 @@
when 0 THEN '尚未巡检' when 0 THEN '尚未巡检'
when 1 THEN '按时完成' when 1 THEN '按时完成'
else '超时漏检' END) as statusName, else '超时漏检' END) as statusName,
pc.is_ok isOk, b.status isOk,
(case pc.is_ok (case b.status
when 0 THEN '未开始'
when 1 THEN '合格' when 1 THEN '合格'
when 2 THEN '不合格' when 2 THEN '不合格'
else '漏检' END) as isOkName when 3 THEN '漏检' END) as isOkName
FROM p_plan_task_detail b FROM p_plan_task_detail b
LEFT JOIN p_check pc ON pc.plan_task_detail_id = b.id LEFT JOIN p_check pc ON pc.plan_task_detail_id = b.id
LEFT JOIN p_plan_task a ON a.id = b.task_no LEFT JOIN p_plan_task a ON a.id = b.task_no
......
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