Commit c31bdb59 authored by suhuiguang's avatar suhuiguang

1、 非历史有证设备 作废时清除使用登记证编号(0-新增设备;1-历史有证设备;2-历史无证设备)-idx_biz_jg_register_info

2、非历史有证设备,作废清除使用登记证编号、 历史有证设备、历史无证设备,系统生成的96333清空-es 3、历史有证、历史无证作废时清除信息、作废时,系统生成的96333清空-idx_biz_jg_other_info,回收96333
parent dc7c769e
...@@ -3162,9 +3162,9 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD ...@@ -3162,9 +3162,9 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
//1.子工程装置作废,正常逻辑 //1.子工程装置作废,正常逻辑
else { else {
// 统一处理设备的纳管状态【注册事务提交后的操作】 // 统一处理设备的纳管状态【注册事务提交后的操作】
registerAfterCommitTask(records);
processElseDataByStatus(oldStatus, jgUseRegistration); processElseDataByStatus(oldStatus, jgUseRegistration);
this.rollBackForPieLine(jgUseRegistration); this.rollBackForPieLine(jgUseRegistration);
registerAfterCommitTask(records);
} }
} }
//气瓶 //气瓶
...@@ -3220,7 +3220,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD ...@@ -3220,7 +3220,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
// 1.使用信息表部分字段赋空 // 1.使用信息表部分字段赋空
this.rollBackUseInfo(record, flag); this.rollBackUseInfo(record, flag);
// 2.回滚更新idx_biz_jg_register_info表 // 2.回滚更新idx_biz_jg_register_info表
this.rollBackRegisterInfo(record); this.rollBackRegisterInfo(record, jgUseRegistration);
// 3.回滚更新idx_biz_jg_supervision_info表 // 3.回滚更新idx_biz_jg_supervision_info表
this.rollBackSupervisionInfo(record); this.rollBackSupervisionInfo(record);
// 4.es的EQU_STATE, USE_ORG_CODE、ORG_BRANCH_CODE、ORG_BRANCH_NAME、STATUS // 4.es的EQU_STATE, USE_ORG_CODE、ORG_BRANCH_CODE、ORG_BRANCH_NAME、STATUS
...@@ -3251,15 +3251,15 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD ...@@ -3251,15 +3251,15 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
} }
private void dealHisRegEquipData(JgUseRegistration jgUseRegistration, String record) { private void dealHisRegEquipData(JgUseRegistration jgUseRegistration, String record) {
// 历史登记时处理 // 历史有证、历史无证作废时清除信息
if("1".equals(jgUseRegistration.getRegType())){ if("1".equals(jgUseRegistration.getRegType()) || "2".equals(jgUseRegistration.getRegType())){
// 删除安装信息 // 删除安装信息
this.clearConstructionInfo(record);; this.clearConstructionInfo(record);
// 删除维保信息 // 删除维保信息
this.clearMainInfo(record); this.clearMainInfo(record);
// 删除检验检测信息 // 删除检验检测信息
this.clearInspectionInfo(record); this.clearInspectionInfo(record);
// 释放96333码为 未使用状态 // 系统生产的释放96333码为 未使用状态
this.release96333Code(record); this.release96333Code(record);
} }
} }
...@@ -3277,7 +3277,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD ...@@ -3277,7 +3277,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
) )
).ifPresent(otherInfo -> { ).ifPresent(otherInfo -> {
String supervisoryCode = otherInfo.getSupervisoryCode(); String supervisoryCode = otherInfo.getSupervisoryCode();
//手动输入直接删除 // 手动输入直接删除【1-存在96333编码,用户自行删除;2-不存在96333编码,系统自动生成】
if ("1".equals(otherInfo.getCode96333Type())) { if ("1".equals(otherInfo.getCode96333Type())) {
supervisoryCodeInfoMapper.delete(new QueryWrapper<SupervisoryCodeInfo>().eq("SUPERVISORY_CODE", supervisoryCode)); supervisoryCodeInfoMapper.delete(new QueryWrapper<SupervisoryCodeInfo>().eq("SUPERVISORY_CODE", supervisoryCode));
} else { } else {
...@@ -3328,9 +3328,21 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD ...@@ -3328,9 +3328,21 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
.orderByDesc(TzsBaseEntity::getRecDate) .orderByDesc(TzsBaseEntity::getRecDate)
.last("limit 1"); .last("limit 1");
IdxBizJgConstructionInfo jgConstructionInfo = constructionInfoMapper.selectOne(wrapper); IdxBizJgConstructionInfo jgConstructionInfo = constructionInfoMapper.selectOne(wrapper);
IdxBizJgOtherInfo otherInfo = otherInfoMapper.selectOne(
new LambdaQueryWrapper<IdxBizJgOtherInfo>()
.eq(IdxBizJgOtherInfo::getRecord, record)
.select(IdxBizJgOtherInfo::getSupervisoryCode, IdxBizJgOtherInfo::getCode96333Type));
Optional<ESEquipmentCategoryDto> optional = esEquipmentCategory.findById(record); Optional<ESEquipmentCategoryDto> optional = esEquipmentCategory.findById(record);
if (optional.isPresent()) { if (optional.isPresent()) {
ESEquipmentCategoryDto esEquipmentCategoryDto = optional.get(); ESEquipmentCategoryDto esEquipmentCategoryDto = optional.get();
// 非历史有证设备,作废清除使用登记证编号
if(!"1".equals(jgUseRegistration.getRegType())){
esEquipmentCategoryDto.setUSE_ORG_CODE(null);
}
// 历史有证设备、历史无证设备,系统生成的96333清空
if (("1".equals(jgUseRegistration.getRegType()) || "2".equals(jgUseRegistration.getRegType())) && "2".equals(otherInfo.getCode96333Type())) {
esEquipmentCategoryDto.setCODE96333(null);
}
esEquipmentCategoryDto.setUSE_ORG_CODE(null); esEquipmentCategoryDto.setUSE_ORG_CODE(null);
esEquipmentCategoryDto.setSTATUS(null); esEquipmentCategoryDto.setSTATUS(null);
esEquipmentCategoryDto.setEQU_STATE(null); esEquipmentCategoryDto.setEQU_STATE(null);
...@@ -3398,12 +3410,13 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD ...@@ -3398,12 +3410,13 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
idxBizJgSupervisionInfoMapper.update(null, updateWrapper); idxBizJgSupervisionInfoMapper.update(null, updateWrapper);
} }
private void rollBackRegisterInfo(String record) { private void rollBackRegisterInfo(String record, JgUseRegistration jgUseRegistration) {
LambdaUpdateWrapper<IdxBizJgRegisterInfo> updateWrapper = new LambdaUpdateWrapper<>(); LambdaUpdateWrapper<IdxBizJgRegisterInfo> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(IdxBizJgRegisterInfo::getRecord, record); updateWrapper.eq(IdxBizJgRegisterInfo::getRecord, record);
// 未注册,来源cb_data_dictionary type = 'ZC' // 未注册,来源cb_data_dictionary type = 'ZC'
updateWrapper.set(IdxBizJgRegisterInfo::getRegisterState, "6046"); updateWrapper.set(IdxBizJgRegisterInfo::getRegisterState, "6046");
updateWrapper.set(IdxBizJgRegisterInfo::getUseOrgCode, null); // 非历史有证设备 作废时清除使用登记证编号(0-新增设备;1-历史有证设备;2-历史无证设备)
updateWrapper.set(!"1".equals(jgUseRegistration.getRegType()),IdxBizJgRegisterInfo::getUseOrgCode, null);
updateWrapper.set(IdxBizJgRegisterInfo::getCarNumber, null); updateWrapper.set(IdxBizJgRegisterInfo::getCarNumber, null);
idxBizJgRegisterInfoService.update(updateWrapper); idxBizJgRegisterInfoService.update(updateWrapper);
} }
......
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