Commit c025c2e1 authored by 刘林's avatar 刘林

fix(jg):updateTechParamDynamic代码还原

parent 85a3950d
...@@ -2527,16 +2527,17 @@ ...@@ -2527,16 +2527,17 @@
and (a.apply_status <![CDATA[ <> ]]> '6617') and (a.apply_status <![CDATA[ <> ]]> '6617')
) )
</select> </select>
<update id="updateTechParamDynamic"> <update id="updateTechParamDynamic">
update ${tableName} <if test="columns != null and columns.size() > 0">
<set> update
${tableName}
set
<foreach collection="columns" item="column" separator=","> <foreach collection="columns" item="column" separator=",">
<if test="column.columnValue != null and column.columnValue != ''"> ${column.columnName} = #{column.columnValue}
${column.columnName} = #{column.columnValue}
</if>
</foreach> </foreach>
</set> where record = #{record}
where record = #{record} </if>
</update> </update>
<select id="countBizNumAfterUseReg" resultType="java.lang.Long"> <select id="countBizNumAfterUseReg" resultType="java.lang.Long">
......
...@@ -316,7 +316,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -316,7 +316,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
@Autowired @Autowired
private SnowflakeIdUtil sequence; private SnowflakeIdUtil sequence;
@Autowired @Autowired
private JgCertificateChangeRecordEqServiceImpl certificateChangeRecordEqService; private JgCertificateChangeRecordEqMapper certificateChangeRecordEqMapper;
@Autowired @Autowired
private JgUseRegistrationServiceImpl jgUseRegistrationService; private JgUseRegistrationServiceImpl jgUseRegistrationService;
@Autowired @Autowired
...@@ -4311,6 +4311,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -4311,6 +4311,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
List<JgUseRegistrationEq> jgRelationEquipList = new ArrayList<>(); List<JgUseRegistrationEq> jgRelationEquipList = new ArrayList<>();
List<Map<String, Object>> equipmentLists = new ArrayList<>(); List<Map<String, Object>> equipmentLists = new ArrayList<>();
List<IdxBizJgSupervisionInfo> supervisionInfoList = new ArrayList<>(); List<IdxBizJgSupervisionInfo> supervisionInfoList = new ArrayList<>();
List<JgCertificateChangeRecordEq> jgCertificateChangeRecordEqList = new ArrayList<>();
if (paramMap == null) { if (paramMap == null) {
throw new IllegalArgumentException("参数Map不能为空"); throw new IllegalArgumentException("参数Map不能为空");
...@@ -4325,6 +4326,9 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -4325,6 +4326,9 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
String orgBranchCode = equipInfoDto.getOrgBranchCode(); String orgBranchCode = equipInfoDto.getOrgBranchCode();
String orgBranchName = equipInfoDto.getOrgBranchName(); String orgBranchName = equipInfoDto.getOrgBranchName();
Set<String> recordSet = new HashSet<>(); Set<String> recordSet = new HashSet<>();
List<DictionarieValueModel> fillingMedium = Systemctl.dictionarieClient.dictValues("FILLING_MEDIUM").getResult();
Map<String, Object> fillingMediumMap = fillingMedium.stream().collect(Collectors.toMap(DictionarieValueModel::getDictDataValue,
DictionarieValueModel::getDictDataKey));
equipInfoCylinderExcelDtoList.forEach(data -> { equipInfoCylinderExcelDtoList.forEach(data -> {
JgUseRegistrationEq jgRelationEquip = new JgUseRegistrationEq(); JgUseRegistrationEq jgRelationEquip = new JgUseRegistrationEq();
if ("his".equals(equipInfoDto.getDataSource()) && "1".equals(data.getWhetherVehicleCylinder())) { if ("his".equals(equipInfoDto.getDataSource()) && "1".equals(data.getWhetherVehicleCylinder())) {
...@@ -4424,7 +4428,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -4424,7 +4428,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
registerInfo.setEquCategory(equipInfoDto.getEquCategoryCode()); registerInfo.setEquCategory(equipInfoDto.getEquCategoryCode());
registerInfo.setEquDefine(equipInfoDto.getEquDefineCode()); registerInfo.setEquDefine(equipInfoDto.getEquDefineCode());
registerInfo.setEquList(equipInfoDto.getEquListCode()); registerInfo.setEquList(equipInfoDto.getEquListCode());
registerInfo.setRegisterState(idxBizJgRegisterInfoService.getRegCode()); registerInfo.setRegisterState("his".equals(equipInfoDto.getDataSource()) ? "6045":"6046");
registerInfo.setProductPhoto(productPhoto); registerInfo.setProductPhoto(productPhoto);
registerInfo.setOtherAccessoriesReg(otherAccessoriesReg); registerInfo.setOtherAccessoriesReg(otherAccessoriesReg);
registerInfo.setUseOrgCode(equipInfoDto.getUseOrgCode()); registerInfo.setUseOrgCode(equipInfoDto.getUseOrgCode());
...@@ -4476,9 +4480,6 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -4476,9 +4480,6 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
setSupervisionInfo(orgBranchCode, orgBranchName, record, supervisionInfoList); setSupervisionInfo(orgBranchCode, orgBranchName, record, supervisionInfoList);
// 技术参数 // 技术参数
List<DictionarieValueModel> fillingMedium = Systemctl.dictionarieClient.dictValues("FILLING_MEDIUM").getResult();
Map<String, Object> fillingMediumMap = fillingMedium.stream().collect(Collectors.toMap(DictionarieValueModel::getDictDataValue,
DictionarieValueModel::getDictDataKey));
IdxBizJgTechParamsVessel paramsVessel = new IdxBizJgTechParamsVessel(); IdxBizJgTechParamsVessel paramsVessel = new IdxBizJgTechParamsVessel();
BeanUtils.copyProperties(data, paramsVessel); BeanUtils.copyProperties(data, paramsVessel);
paramsVessel.setRecord(record); paramsVessel.setRecord(record);
...@@ -4527,7 +4528,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -4527,7 +4528,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
changeRecordEq.setChangeRecordId(String.valueOf(changeRecordId));// 登记证记录主键 changeRecordEq.setChangeRecordId(String.valueOf(changeRecordId));// 登记证记录主键
changeRecordEq.setEquId(registerInfo.getRecord());// 设备主键 changeRecordEq.setEquId(registerInfo.getRecord());// 设备主键
changeRecordEq.setProductCode(factoryInfo.getFactoryNum());// 产品编号 changeRecordEq.setProductCode(factoryInfo.getFactoryNum());// 产品编号
certificateChangeRecordEqService.save(changeRecordEq); jgCertificateChangeRecordEqList.add(changeRecordEq);
} }
String nextInspectDateStr = Optional.ofNullable(inspectionDetectionInfo.getNextInspectDate()) String nextInspectDateStr = Optional.ofNullable(inspectionDetectionInfo.getNextInspectDate())
.map(date -> date.toInstant() .map(date -> date.toInstant()
...@@ -4661,35 +4662,16 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -4661,35 +4662,16 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
.collect(Collectors.toList()) .collect(Collectors.toList())
); );
} }
List<CompletableFuture<Void>> futures = new ArrayList<>(); batchInsert(idxBizJgSupervisionInfoMapper, supervisionInfoList, "监督信息");
futures.add(CompletableFuture.runAsync(() -> batchInsert(idxBizJgUseInfoMapper, useInfoList, "使用信息");
batchInsert(idxBizJgSupervisionInfoMapper, supervisionInfoList, "监督信息") batchInsert(idxBizJgDesignInfoMapper, designInfoList, "设计信息");
)); batchInsert(idxBizJgRegisterInfoMapper, registerInfoList, "注册信息");
futures.add(CompletableFuture.runAsync(() -> batchInsert(idxBizJgFactoryInfoMapper, factoryInfoList, "制造信息");
batchInsert(idxBizJgUseInfoMapper, useInfoList, "使用信息") batchInsert(otherInfoMapper, otherInfoList, "其他信息");
)); batchInsert(idxBizJgTechParamsVesselMapper, paramsVesselList, "容器参数信息");
futures.add(CompletableFuture.runAsync(() -> batchInsert(idxBizJgInspectionDetectionInfoMapper, inspectionDetectionInfoList, "检验检测信息");
batchInsert(idxBizJgDesignInfoMapper, designInfoList, "设计信息") batchInsert(certificateChangeRecordEqMapper, jgCertificateChangeRecordEqList, "登记证关系信息");
)); esEquipmentCategory.saveAll(esEquipmentCategoryList);
futures.add(CompletableFuture.runAsync(() ->
batchInsert(idxBizJgRegisterInfoMapper, registerInfoList, "注册信息")
));
futures.add(CompletableFuture.runAsync(() ->
batchInsert(idxBizJgFactoryInfoMapper, factoryInfoList, "制造信息")
));
futures.add(CompletableFuture.runAsync(() ->
batchInsert(otherInfoMapper, otherInfoList, "其他信息")
));
futures.add(CompletableFuture.runAsync(() ->
batchInsert(idxBizJgTechParamsVesselMapper, paramsVesselList, "容器参数信息")
));
futures.add(CompletableFuture.runAsync(() ->
batchInsert(idxBizJgInspectionDetectionInfoMapper, inspectionDetectionInfoList, "检验检测信息")
));
if (!esEquipmentCategoryList.isEmpty()) {
futures.add(CompletableFuture.runAsync(() -> esEquipmentCategory.saveAll(esEquipmentCategoryList)));
}
CompletableFuture.allOf(futures.toArray(new CompletableFuture[0])).join();
eventPublisher.publish(new EquipCreateOrEditEvent(this, BusinessTypeEnum.JG_NEW_EQUIP.name(), recordSet, EquipCreateOrEditEvent.EquipType.equip)); eventPublisher.publish(new EquipCreateOrEditEvent(this, BusinessTypeEnum.JG_NEW_EQUIP.name(), recordSet, EquipCreateOrEditEvent.EquipType.equip));
return String.format("导入完成,成功导入: %d 条数据!", useInfoList.size()); return String.format("导入完成,成功导入: %d 条数据!", useInfoList.size());
} }
......
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