Commit c025c2e1 authored by 刘林's avatar 刘林

fix(jg):updateTechParamDynamic代码还原

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