Commit a78da737 authored by suhuiguang's avatar suhuiguang

Merge branch 'develop_tzs_register' of…

Merge branch 'develop_tzs_register' of http://39.100.92.250:5000/moa/amos-boot-biz into develop_tzs_register
parents 5b0beef4 c682eb68
package com.yeejoin.amos.boot.module.jg.api.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.common.api.mapper.CustomBaseMapper;
import com.yeejoin.amos.boot.module.jg.api.dto.JgResumeInfoDto;
import com.yeejoin.amos.boot.module.jg.api.entity.JgResumeInfo;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Set;
......@@ -15,7 +14,7 @@ import java.util.Set;
* @author system_generator
* @date 2024-05-29
*/
public interface JgResumeInfoMapper extends BaseMapper<JgResumeInfo> {
public interface JgResumeInfoMapper extends CustomBaseMapper<JgResumeInfo> {
void deleteBatchByBusinessId(@Param("idList") Set<String> idList);
......
......@@ -4176,7 +4176,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
SearchRequest request = new SearchRequest(IDX_BIZ_EQUIPMENT_INFO);
SearchSourceBuilder sourceBuilder = new SearchSourceBuilder().size(10000)
.fetchSource(new String[]{"FACTORY_NUM", "PRODUCE_UNIT_NAME"}, null);
.fetchSource(new String[]{"FACTORY_NUM", "USE_UNIT_NAME"}, null);
BoolQueryBuilder boolQuery = QueryBuilders.boolQuery();
boolQuery.must(QueryBuilders.termQuery("EQU_LIST_CODE", "2000"))
......@@ -4198,8 +4198,8 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
for (SearchHit hit : response.getHits().getHits()) {
Map<String, Object> src = hit.getSourceAsMap();
String factoryNum = Objects.toString(src.get("FACTORY_NUM"), "");
String produceUnitName = Objects.toString(src.get("PRODUCE_UNIT_NAME"), "");
resultMap.put(factoryNum, produceUnitName);
String useUnitName = Objects.toString(src.get("USE_UNIT_NAME"), "");
resultMap.put(factoryNum, useUnitName);
}
return resultMap;
}
......@@ -4563,17 +4563,35 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
.collect(Collectors.toList())
);
}
batchInsert(idxBizJgSupervisionInfoMapper, supervisionInfoList, "监督信息");
batchInsert(idxBizJgUseInfoMapper, useInfoList, "使用信息");
batchInsert(idxBizJgDesignInfoMapper, designInfoList, "设计信息");
batchInsert(idxBizJgRegisterInfoMapper, registerInfoList, "注册信息");
batchInsert(idxBizJgFactoryInfoMapper, factoryInfoList, "制造信息");
batchInsert(otherInfoMapper, otherInfoList, "其他信息");
batchInsert(idxBizJgTechParamsVesselMapper, paramsVesselList, "容器参数信息");
batchInsert(idxBizJgInspectionDetectionInfoMapper, inspectionDetectionInfoList, "检验检测信息");
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()) {
esEquipmentCategory.saveAll(esEquipmentCategoryList);
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));
return String.format("导入完成,成功导入: %d 条数据!", useInfoList.size());
}
......@@ -4581,10 +4599,8 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
/** 通用批量插入方法 */
public <T> void batchInsert(CustomBaseMapper<T> mapper, List<T> list, String name) {
if (list != null && !list.isEmpty()) {
mapper.insertBatchSomeColumn(list, 1000);
mapper.insertBatchSomeColumn(list, 500);
log.info("{} 批量插入完成,数量:{}", name, list.size());
} else {
log.info("{} 列表为空,无需插入", name);
}
}
......
......@@ -40,14 +40,14 @@ public class JgResumeInfoServiceImpl extends BaseService<JgResumeInfoDto, JgResu
}
public void saveBatchResume(List<JgResumeInfoDto> jgResumeInfoDtoList) {
Collection<JgResumeInfo> jgResumeInfoCollection = jgResumeInfoDtoList.stream()
List<JgResumeInfo> jgResumeInfoCollection = jgResumeInfoDtoList.stream()
.map(dto -> {
JgResumeInfo info = new JgResumeInfo();
BeanUtils.copyProperties(dto, info);
return info;
})
.collect(Collectors.toList());
this.saveBatch(jgResumeInfoCollection);
this.baseMapper.insertBatchSomeColumn(jgResumeInfoCollection,500);
}
/**
......
......@@ -176,10 +176,10 @@ public class JyjcInspectionResultServiceImpl extends BaseService<JyjcInspectionR
model = new JyjcInspectionResultModel();
}
if (type) {
//检验检测单位分页查询
// 检验检测单位分页查询
model.setInspectionUnitCode(reginParams.getCompany().getCompanyCode());
} else {
//报检单位分页查询
// 报检单位分页查询
model.setApplicationUnitCode(reginParams.getCompany().getCompanyCode());
}
Page<JyjcInspectionResultModel> resultPage = resultMapper.selectJyjcInspectionResultpPage(page, model);
......@@ -802,12 +802,13 @@ public class JyjcInspectionResultServiceImpl extends BaseService<JyjcInspectionR
useInfoMapper.updateByRecord(inspectionDetectionInfo.getRecord(), jyjcInspectionResult.getNextInspectionDate(), jyjcInspectionResult.getInspectionType(), jyjcInspectionResult.getApplicationNo());
// 4.更新es下次检验日期
commonService.updateEquipNextInspectDate(jyjcInspectionResult, inspectionDetectionInfo.getRecord());
sendDataRefreshMsg(records);
bizEmqPublisher.sendInspectionMsgAfterSave(inspectionDetectionInfo, "insert");
} catch (Exception e) {
log.warn(e.getMessage());
throw new BadRequest("数据异常,请联系管理员!");
}
}
sendDataRefreshMsg(records);
return Boolean.TRUE;
}
......@@ -936,6 +937,7 @@ public class JyjcInspectionResultServiceImpl extends BaseService<JyjcInspectionR
commonService.updateEquipNextInspectDate(jyjcInspectionResult, inspectionDetectionInfo.getRecord());
// 发送数据变更消息
sendDataRefreshMsg(Sets.newHashSet(inspectionDetectionInfo.getRecord()));
bizEmqPublisher.sendInspectionMsgAfterSave(inspectionDetectionInfo, "update");
} catch (Exception e) {
log.error(e.getMessage(), e);
throw new BadRequest("数据异常,请联系管理员!");
......@@ -972,9 +974,33 @@ public class JyjcInspectionResultServiceImpl extends BaseService<JyjcInspectionR
jyjcInspectionHistoryService.getBaseMapper().delete(new LambdaQueryWrapper<JyjcInspectionHistory>().eq(JyjcInspectionHistory::getSSeq, resultSeq));
// 发送数据变更消息
sendDataRefreshMsg(records);
records.stream()
.filter(Objects::nonNull)
.map(this::getTheLatestInspectionInformation)
.filter(Objects::nonNull)
.forEach(info -> bizEmqPublisher.sendInspectionMsgAfterSave(info, "update"));
return Boolean.TRUE;
}
/**
* 获取最新的一条检验检测信息
*
* @param record 设备 record
* @return 最新的一条检验检测信息
*/
private IdxBizJgInspectionDetectionInfo getTheLatestInspectionInformation(String record) {
List<IdxBizJgInspectionDetectionInfo> inspectionDetectionInfoList = idxBizJgInspectionDetectionInfoMapper.selectList(
new LambdaQueryWrapper<IdxBizJgInspectionDetectionInfo>()
.eq(IdxBizJgInspectionDetectionInfo::getRecord, record)
.orderByDesc(IdxBizJgInspectionDetectionInfo::getInspectDate)
.last("LIMIT 1")
);
return inspectionDetectionInfoList.stream()
.findFirst()
.orElse(null);
}
@Transactional(rollbackFor = Exception.class)
public List<PipelineInspectionResultDto> receivePipelineResultData(List<PipelineInspectionResultDto> resultData) {
log.info("收到检验检测厂商推送的压力管道结果数据:{}", JSONArray.toJSONString(resultData));
......
......@@ -20,6 +20,7 @@
FROM
privilege_company
<where>
is_deleted = false
<if test="companyName != null and companyName != ''">
AND company_name LIKE CONCAT('%', TRIM(#{companyName}), '%')
</if>
......
......@@ -127,8 +127,7 @@ public interface EquipmentCategoryMapper extends BaseMapper<EquipmentCategory> {
"\tAND ui.IS_INTO_MANAGEMENT = 1 \n" +
"\tAND oi.SUPERVISORY_CODE IS NOT NULL \n" +
"\tAND ( oi.code96333 IS NULL OR oi.code96333 = '' ) \n" +
"\tAND ( ui.city != '610100' OR ui.\"IS_NOT_XIXIAN\" = 1 )\n" +
"\tand oi.SUPERVISORY_CODE in ('A3100-0002769')\n")
"\tAND ( ui.city != '610100' OR ui.\"IS_NOT_XIXIAN\" = 1 )\n")
List<Map<String, String>> selectExceptionCode96333();
@Select("select * from biz_jg_supervisory_code where supervisory_code = #{supervisoryCode} ORDER BY supervisory_code")
......
......@@ -2700,12 +2700,12 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
String city = jsonObj.getString("city");
String county = jsonObj.getString("county");
String isNotXixian = jsonObj.getString("isNotXixian");
if (StringUtils.isEmpty(city) || "null".equals(city)) {
// 监管码
String supervisoryCode = jsonObj.getString("supervisoryCode");
if (StringUtils.isEmpty(city) || "null".equals(city) || StringUtils.isEmpty(supervisoryCode)) {
manualProcessData.add(jsonObj);
return;
}
// 监管码
String supervisoryCode = jsonObj.getString("supervisoryCode");
// record
String record = jsonObj.getString("record");
String code96333 = "";
......
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