Commit 231481a2 authored by 刘林's avatar 刘林

fix(jg):气瓶认领单瓶容积为空报错

parent 272bd805
...@@ -1144,7 +1144,6 @@ ...@@ -1144,7 +1144,6 @@
<if test="jsonObject.DATA_SOURCE == null or jsonObject.DATA_SOURCE == ''"> <if test="jsonObject.DATA_SOURCE == null or jsonObject.DATA_SOURCE == ''">
and ui."DATA_SOURCE" like 'jg%' and ui."DATA_SOURCE" like 'jg%'
</if> </if>
-- 保证使用单位选择设备时(record为null) 能选择到本单位的设备 并且 监管单位在查看时(record 不为null)可以匹配到所有的设备
<if test="jsonObject.useUnitCreditCode != null and jsonObject.useUnitCreditCode != '' and jsonObject.record == null"> <if test="jsonObject.useUnitCreditCode != null and jsonObject.useUnitCreditCode != '' and jsonObject.record == null">
and ui."USE_UNIT_CREDIT_CODE" = #{jsonObject.useUnitCreditCode} and ui."USE_UNIT_CREDIT_CODE" = #{jsonObject.useUnitCreditCode}
</if> </if>
...@@ -1291,7 +1290,6 @@ ...@@ -1291,7 +1290,6 @@
</otherwise> </otherwise>
</choose> </choose>
</if> </if>
-- 保证使用单位选择设备时(record为null) 能选择到本单位的设备 并且 监管单位在查看时(record 不为null)可以匹配到所有的设备
<if test="jsonObject.useUnitCreditCode != null and jsonObject.useUnitCreditCode != '' and jsonObject.record == null"> <if test="jsonObject.useUnitCreditCode != null and jsonObject.useUnitCreditCode != '' and jsonObject.record == null">
and ui."USE_UNIT_CREDIT_CODE" = #{jsonObject.useUnitCreditCode} and ui."USE_UNIT_CREDIT_CODE" = #{jsonObject.useUnitCreditCode}
-- 限制 没有做过使用登记的 -- 限制 没有做过使用登记的
...@@ -1348,7 +1346,6 @@ ...@@ -1348,7 +1346,6 @@
<if test="jsonObject.informationManageCode != null and jsonObject.informationManageCode != ''"> <if test="jsonObject.informationManageCode != null and jsonObject.informationManageCode != ''">
and oi.INFORMATION_MANAGE_CODE like concat('%',#{jsonObject.informationManageCode},'%') and oi.INFORMATION_MANAGE_CODE like concat('%',#{jsonObject.informationManageCode},'%')
</if> </if>
-- 保证使用单位选择设备时(record为null) 能选择到本单位的设备 并且 监管单位在查看时(record 不为null)可以匹配到所有的设备
<if test="jsonObject.useUnitCreditCode != null and jsonObject.useUnitCreditCode != '' and jsonObject.record == null"> <if test="jsonObject.useUnitCreditCode != null and jsonObject.useUnitCreditCode != '' and jsonObject.record == null">
and ui."USE_UNIT_CREDIT_CODE" = #{jsonObject.useUnitCreditCode} and ui."USE_UNIT_CREDIT_CODE" = #{jsonObject.useUnitCreditCode}
</if> </if>
...@@ -1400,7 +1397,6 @@ ...@@ -1400,7 +1397,6 @@
<if test="jsonObject.informationManageCode != null and jsonObject.informationManageCode != ''"> <if test="jsonObject.informationManageCode != null and jsonObject.informationManageCode != ''">
and oi.INFORMATION_MANAGE_CODE like concat('%',#{jsonObject.informationManageCode},'%') and oi.INFORMATION_MANAGE_CODE like concat('%',#{jsonObject.informationManageCode},'%')
</if> </if>
-- 保证使用单位选择设备时(record为null) 能选择到本单位的设备 并且 监管单位在查看时(record 不为null)可以匹配到所有的设备
<if test="jsonObject.useUnitCreditCode != null and jsonObject.useUnitCreditCode != '' and jsonObject.record == null"> <if test="jsonObject.useUnitCreditCode != null and jsonObject.useUnitCreditCode != '' and jsonObject.record == null">
and ui."USE_UNIT_CREDIT_CODE" = #{jsonObject.useUnitCreditCode} and ui."USE_UNIT_CREDIT_CODE" = #{jsonObject.useUnitCreditCode}
</if> </if>
......
...@@ -4307,7 +4307,6 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -4307,7 +4307,6 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
} }
@Override @Override
@GlobalTransactional(rollbackFor = Exception.class, timeoutMills = 6000000)
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public Object savePressureVesselData(Map<String, Object> paramMap) { public Object savePressureVesselData(Map<String, Object> paramMap) {
ReginParams reginParams = JSONObject.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())).toString(), ReginParams.class); ReginParams reginParams = JSONObject.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())).toString(), ReginParams.class);
...@@ -4688,24 +4687,39 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -4688,24 +4687,39 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
.collect(Collectors.toList()) .collect(Collectors.toList())
); );
} }
batchInsert(idxBizJgSupervisionInfoMapper, supervisionInfoList, "监督信息");
batchInsert(idxBizJgUseInfoMapper, useInfoList, "使用信息"); batchInsert(idxBizJgUseInfoMapper, useInfoList, "使用信息");
batchInsert(idxBizJgDesignInfoMapper, designInfoList, "设计信息");
batchInsert(idxBizJgRegisterInfoMapper, registerInfoList, "注册信息"); batchInsert(idxBizJgRegisterInfoMapper, registerInfoList, "注册信息");
batchInsert(idxBizJgFactoryInfoMapper, factoryInfoList, "制造信息"); List<CompletableFuture<Void>> futures = new ArrayList<>();
batchInsert(otherInfoMapper, otherInfoList, "其他信息"); futures.add(CompletableFuture.runAsync(() -> batchInsert(idxBizJgSupervisionInfoMapper, supervisionInfoList, "监督信息"), executor));
batchInsert(idxBizJgTechParamsVesselMapper, paramsVesselList, "容器参数信息"); futures.add(CompletableFuture.runAsync(() -> batchInsert(idxBizJgDesignInfoMapper, designInfoList, "设计信息"), executor));
batchInsert(idxBizJgInspectionDetectionInfoMapper, inspectionDetectionInfoList, "检验检测信息"); futures.add(CompletableFuture.runAsync(() -> batchInsert(idxBizJgFactoryInfoMapper, factoryInfoList, "制造信息"), executor));
batchInsert(certificateChangeRecordEqMapper, jgCertificateChangeRecordEqList, "登记证关系信息"); futures.add(CompletableFuture.runAsync(() -> batchInsert(otherInfoMapper, otherInfoList, "其他信息"), executor));
esEquipmentCategory.saveAll(esEquipmentCategoryList); futures.add(CompletableFuture.runAsync(() -> batchInsert(idxBizJgTechParamsVesselMapper, paramsVesselList, "容器参数信息"), executor));
eventPublisher.publish(new EquipCreateOrEditEvent(this, BusinessTypeEnum.JG_NEW_EQUIP.name(), recordSet, EquipCreateOrEditEvent.EquipType.equip)); futures.add(CompletableFuture.runAsync(() -> batchInsert(idxBizJgInspectionDetectionInfoMapper, inspectionDetectionInfoList, "检验检测信息"), executor));
futures.add(CompletableFuture.runAsync(() -> batchInsert(certificateChangeRecordEqMapper, jgCertificateChangeRecordEqList, "登记证关系信息"), executor));
futures.add(CompletableFuture.runAsync(() -> esEquipmentCategory.saveAll(esEquipmentCategoryList), executor));
futures.add(CompletableFuture.runAsync(() ->
eventPublisher.publish(
new EquipCreateOrEditEvent(
this,
BusinessTypeEnum.JG_NEW_EQUIP.name(),
recordSet,
EquipCreateOrEditEvent.EquipType.equip
)
), executor));
CompletableFuture.allOf(futures.toArray(new CompletableFuture[0])).join();
return String.format("导入完成,成功导入: %d 条数据!", useInfoList.size()); return String.format("导入完成,成功导入: %d 条数据!", useInfoList.size());
} }
// 定义线程池,CPU 核数 * 2,避免阻塞主线程
ExecutorService executor = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors() * 2);
/** 通用批量插入方法 */ /** 通用批量插入方法 */
public <T> void batchInsert(CustomBaseMapper<T> mapper, List<T> list, String name) { public <T> void batchInsert(CustomBaseMapper<T> mapper, List<T> list, String name) {
if (list != null && !list.isEmpty()) { if (list != null && !list.isEmpty()) {
mapper.insertBatchSomeColumn(list, 500); mapper.insertBatchSomeColumn(list, 200);
log.info("{} 批量插入完成,数量:{}", name, list.size()); log.info("{} 批量插入完成,数量:{}", name, list.size());
} }
} }
......
...@@ -47,7 +47,7 @@ public class JgResumeInfoServiceImpl extends BaseService<JgResumeInfoDto, JgResu ...@@ -47,7 +47,7 @@ public class JgResumeInfoServiceImpl extends BaseService<JgResumeInfoDto, JgResu
return info; return info;
}) })
.collect(Collectors.toList()); .collect(Collectors.toList());
this.baseMapper.insertBatchSomeColumn(jgResumeInfoCollection,500); this.baseMapper.insertBatchSomeColumn(jgResumeInfoCollection,200);
} }
/** /**
......
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