Commit 6de649ce authored by suhuiguang's avatar suhuiguang

1.管道刷历史数据

parent 6365c013
...@@ -335,5 +335,6 @@ ...@@ -335,5 +335,6 @@
where where
re.equip_transfer_id = #{useRegisterId} limit 1 re.equip_transfer_id = #{useRegisterId} limit 1
) )
limit 1
</select> </select>
</mapper> </mapper>
...@@ -544,7 +544,7 @@ public class DataHandlerServiceImpl { ...@@ -544,7 +544,7 @@ public class DataHandlerServiceImpl {
esEquipmentCategory.save(equInfoEs); esEquipmentCategory.save(equInfoEs);
}); });
} }
// 2.安装告知非已作废,但是缺少装置的数据处理:创建装置(计算管道长度)、写入安装告知表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<>();
...@@ -581,6 +581,7 @@ public class DataHandlerServiceImpl { ...@@ -581,6 +581,7 @@ public class DataHandlerServiceImpl {
.one(); .one();
Long sequenceNbr = sequence.nextId(); Long sequenceNbr = sequence.nextId();
installationNotice.setProjectContraptionId(sequenceNbr + ""); installationNotice.setProjectContraptionId(sequenceNbr + "");
// key为装置id,value为此装置下的管道数组
projectContraptionIdRecordsMap.put(sequenceNbr, records); projectContraptionIdRecordsMap.put(sequenceNbr, records);
IdxBizJgProjectContraption idxBizJgProjectContraption = IdxBizJgProjectContraption.builder() IdxBizJgProjectContraption idxBizJgProjectContraption = IdxBizJgProjectContraption.builder()
.projectContraption(installationNotice.getProjectContraption()) .projectContraption(installationNotice.getProjectContraption())
...@@ -592,7 +593,7 @@ public class DataHandlerServiceImpl { ...@@ -592,7 +593,7 @@ public class DataHandlerServiceImpl {
.equCategory(installationNotice.getEquCategoryCode()) .equCategory(installationNotice.getEquCategoryCode())
.equCategoryName(ObjectUtils.isEmpty(installationNotice.getEquCategoryCode()) ? null : equipmentCategoryMapper.selectOne(new LambdaQueryWrapper<EquipmentCategory>().eq(EquipmentCategory::getCode, installationNotice.getEquCategoryCode())).getName()) .equCategoryName(ObjectUtils.isEmpty(installationNotice.getEquCategoryCode()) ? null : equipmentCategoryMapper.selectOne(new LambdaQueryWrapper<EquipmentCategory>().eq(EquipmentCategory::getCode, installationNotice.getEquCategoryCode())).getName())
.equDefine(ObjectUtils.isEmpty(registerInfo) ? null : registerInfo.getEquDefine()) .equDefine(ObjectUtils.isEmpty(registerInfo) ? null : registerInfo.getEquDefine())
.equDefineName(ObjectUtils.isEmpty(ObjectUtils.isEmpty(registerInfo) ? null : registerInfo.getEquDefine()) ? null : equipmentCategoryMapper.selectOne(new LambdaQueryWrapper<EquipmentCategory>().eq(EquipmentCategory::getCode, (ObjectUtils.isEmpty(registerInfo) ? null : registerInfo.getEquDefine()))).getName()) .equDefineName(ObjectUtils.isEmpty(ObjectUtils.isEmpty(registerInfo) ? null : registerInfo.getEquDefine()) ? null : equipmentCategoryMapper.selectOne(new LambdaQueryWrapper<EquipmentCategory>().eq(EquipmentCategory::getCode, registerInfo.getEquDefine())).getName())
.content(null) .content(null)
.pipelineLength(pipeLengthSumBig.doubleValue()) .pipelineLength(pipeLengthSumBig.doubleValue())
.productPhoto(ObjectUtils.isEmpty(registerInfo) ? null : registerInfo.getProductPhoto()) .productPhoto(ObjectUtils.isEmpty(registerInfo) ? null : registerInfo.getProductPhoto())
...@@ -654,13 +655,14 @@ public class DataHandlerServiceImpl { ...@@ -654,13 +655,14 @@ public class DataHandlerServiceImpl {
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进行关联】
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 // 1.填充装置id
useRegistration.setProjectContraptionId(installationNotice.getProjectContraptionId()); useRegistration.setProjectContraptionId(installationNotice.getProjectContraptionId());
// 2.已完成状状态清除装置表的安装单位信息字段,填充使用信息数据, // 2.已完成状状态清除装置表的安装单位信息字段,填充使用信息数据,
if(FlowStatusEnum.TO_BE_FINISHED.getName().equals(useRegistration.getStatus())){ if(FlowStatusEnum.TO_BE_FINISHED.getName().equals(useRegistration.getStatus())){
// 特殊处理 将任意一个的 record 放入到remark字段
IdxBizJgUseInfo useInfo = getIdxBizJgUseInfo(installationNotice.getRemark()); IdxBizJgUseInfo useInfo = getIdxBizJgUseInfo(installationNotice.getRemark());
LambdaUpdateWrapper<IdxBizJgProjectContraption> updateWrapper = new LambdaUpdateWrapper<>(); LambdaUpdateWrapper<IdxBizJgProjectContraption> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(BaseEntity::getSequenceNbr, installationNotice.getProjectContraptionId()); updateWrapper.eq(BaseEntity::getSequenceNbr, installationNotice.getProjectContraptionId());
...@@ -697,6 +699,6 @@ public class DataHandlerServiceImpl { ...@@ -697,6 +699,6 @@ public class DataHandlerServiceImpl {
.ne(JgUseRegistration::getStatus, FlowStatusEnum.TO_BE_DISCARD.getName()) .ne(JgUseRegistration::getStatus, FlowStatusEnum.TO_BE_DISCARD.getName())
.ne(JgUseRegistration::getProjectContraption, "") .ne(JgUseRegistration::getProjectContraption, "")
.isNull(JgUseRegistration::getProjectContraptionId) .isNull(JgUseRegistration::getProjectContraptionId)
.select(BaseEntity::getSequenceNbr, JgUseRegistration::getProjectContraption, JgUseRegistration::getUseRegistrationCode)); .select(BaseEntity::getSequenceNbr, JgUseRegistration::getProjectContraption, JgUseRegistration::getUseRegistrationCode, JgUseRegistration::getStatus));
} }
} }
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