Commit 9d8e0b1b authored by tianbo's avatar tianbo

refactor(jg): 优化特种设备查询和维护逻辑

- 修改 CommonMapper 中的查询逻辑,使用 INSPECT_DATE 替代 NEXT_INSPECT_DATE - 优化 JgMaintenanceContractServiceImpl 中的查询条件处理 - 重构 SafetyProblemTracingGenServiceImpl 中的数据修正逻辑 - 优化 JgUseRegistrationMapper 中的查询 SQL,提高查询效率
parent dff61cf6
......@@ -1115,7 +1115,7 @@
SELECT "RECORD","NEXT_INSPECT_DATE",rowNum1
FROM
(
SELECT ROW_NUMBER () OVER ( PARTITION BY "RECORD" ORDER BY "NEXT_INSPECT_DATE" DESC) AS rowNum1,"RECORD", "NEXT_INSPECT_DATE"
SELECT ROW_NUMBER () OVER ( PARTITION BY "RECORD" ORDER BY "INSPECT_DATE" DESC) AS rowNum1,"RECORD", "NEXT_INSPECT_DATE"
FROM
idx_biz_jg_inspection_detection_info where "NEXT_INSPECT_DATE" is not null
) d
......
......@@ -380,6 +380,312 @@
</select>
<select id="getListPage1" resultType="java.util.Map">
<choose>
<!-- 情况1:有设备过滤条件 -->
<when test="dto.equList != null or dto.equCategory != null or dto.equDefine != null or
dto.equCode != null or dto.code96333 != null or dto.supervisoryCode != null">
WITH filtered_main_ids AS (
SELECT DISTINCT fu.sequence_nbr
FROM tzs_jg_use_registration fu
LEFT JOIN tzs_jg_use_registration_eq re ON fu.sequence_nbr = re.equip_transfer_id
LEFT JOIN idx_biz_jg_register_info jri ON re.equ_id = jri."RECORD"
LEFT JOIN idx_biz_jg_other_info other ON jri."RECORD" = other."RECORD"
WHERE fu.is_delete = '0'
<!-- 公共主表过滤条件 -->
<if test="dto.status != null and dto.status != ''">
AND fu.status = #{dto.status}
</if>
<if test="dto.applicationDate != null">
AND DATE(fu.create_date) = DATE(#{dto.applicationDate})
</if>
<if test="dto.fullAddress != null and dto.fullAddress != ''">
AND fu.use_address LIKE CONCAT('%', #{dto.fullAddress}, '%')
</if>
<if test="dto.useUnitName != null and dto.useUnitName != ''">
AND fu.use_unit_name LIKE CONCAT('%', #{dto.useUnitName}, '%')
</if>
<if test="dto.applyNo != null and dto.applyNo != ''">
AND fu.apply_no LIKE CONCAT(#{dto.applyNo}, '%')
</if>
<if test="dto.useRegistrationCode != null and dto.useRegistrationCode != ''">
AND fu.use_registration_code LIKE CONCAT(#{dto.useRegistrationCode}, '%')
</if>
<if test="dto.useUnitCode != null and dto.useUnitCode != ''">
AND fu.use_unit_credit_code = #{dto.useUnitCode}
</if>
<if test="dto.orgBranchCode != null and dto.orgBranchCode != ''">
<choose>
<when test="client == 'jgLook'">
AND fu.supervision_org_code LIKE CONCAT(#{dto.orgBranchCode}, '%')
</when>
<otherwise>
AND fu.supervision_org_code = #{dto.orgBranchCode}
</otherwise>
</choose>
</if>
<if test="dto.auditPassDateStart != null and dto.auditPassDateEnd != null">
AND fu.audit_pass_date BETWEEN #{dto.auditPassDateStart} AND #{dto.auditPassDateEnd}
</if>
<if test="dto.dataType == 'supervision' ">
<choose>
<when test="client == 'jgAudit'">
AND (fu.receive_company_code = #{dto.receiveCompanyCode}
OR fu.transfer_to_user_ids LIKE CONCAT('%', #{dto.currentUserId}, '%'))
</when>
<otherwise>
AND fu.supervision_org_code LIKE CONCAT(#{dto.supervisionOrgCode}, '%')
</otherwise>
</choose>
AND fu.status != '使用单位待提交'
</if>
<if test="dto.dataType == 'company' ">
AND (fu.use_unit_credit_code = #{dto.unitCode}
OR fu.transfer_to_user_ids LIKE CONCAT('%', #{dto.currentUserId}, '%'))
</if>
<!-- 设备表过滤条件 -->
<if test="dto.equList != null and dto.equList != ''">
AND jri.EQU_LIST = #{dto.equList}
</if>
<if test="dto.equCategory != null and dto.equCategory != ''">
AND jri.EQU_CATEGORY = #{dto.equCategory}
</if>
<if test="dto.equDefine != null and dto.equDefine != ''">
AND jri.EQU_DEFINE = #{dto.equDefine}
</if>
<if test="dto.equCode != null and dto.equCode != ''">
AND jri.EQU_CODE LIKE CONCAT(#{dto.equCode}, '%')
</if>
<if test="dto.code96333 != null and dto.code96333 != ''">
AND other.CODE96333 LIKE CONCAT(#{dto.code96333}, '%')
</if>
<if test="dto.supervisoryCode != null and dto.supervisoryCode != ''">
AND other.supervisory_code LIKE CONCAT(#{dto.supervisoryCode}, '%')
</if>
)
SELECT
fu.sequence_nbr AS sequenceNbr,
fu.audit_status AS auditStatus,
DATE_FORMAT(fu.reg_date,'%Y-%m-%d') AS regDate,
fu.use_unit_name AS useUnitName,
fu.supervision_org_code AS supervisionOrgCode,
fu.status,
fu.receive_org_name AS receiveOrgName,
fu.use_address AS place,
fu.instance_id AS instanceId,
fu.apply_no AS applyNo,
fu.next_execute_ids AS nextExecuteIds,
fu.promoter,
fu.use_registration_code AS useRegistrationCode,
DATE_FORMAT(fu.audit_pass_date,'%Y-%m-%d') AS auditPassDate,
DATE_FORMAT(fu.create_date,'%Y-%m-%d') AS createDate,
fu.receive_org_name AS receiveOrgName,
fu.next_execute_user_ids AS nextExecuteUserIds,
fu.next_task_id AS nextTaskId,
fu.create_user_id AS createUserId,
fu.rec_date AS recDate,
fu.manage_type AS manageType,
fu.reg_type AS regType,
fu.is_delete,
fu.create_date,
fu.receive_company_code,
fu.use_unit_credit_code,
fu.transfer_to_user_ids,
fu.supervision_org_code,
fu.use_address AS fullAddress,
fu.cancel_reason AS cancelReason,
fu.project_contraption_id AS projectContraptionId,
COALESCE(GROUP_CONCAT(DISTINCT re.equ_id), '') AS equipId,
COALESCE(GROUP_CONCAT(DISTINCT other.supervisory_code), '') AS supervisoryCode,
COALESCE(GROUP_CONCAT(DISTINCT other.CODE96333), '') AS code96333,
COALESCE(GROUP_CONCAT(DISTINCT jri.PRODUCT_NAME), '') AS productName,
COALESCE(GROUP_CONCAT(DISTINCT jri.EQU_CODE), '') AS equCode,
COALESCE(GROUP_CONCAT(DISTINCT jri.EQU_LIST), '') AS equListCode,
COALESCE(GROUP_CONCAT(DISTINCT jri.EQU_CATEGORY), '') AS equCategoryCode,
COALESCE(GROUP_CONCAT(DISTINCT jri.EQU_DEFINE), '') AS equDefineCode,
COALESCE(GROUP_CONCAT(DISTINCT c_list.name), '') AS equListName,
COALESCE(GROUP_CONCAT(DISTINCT c_cate.name), '') AS equCategory,
COALESCE(GROUP_CONCAT(DISTINCT c_def.name), '') AS equDefine
FROM filtered_main_ids fm
JOIN tzs_jg_use_registration fu ON fm.sequence_nbr = fu.sequence_nbr
LEFT JOIN tzs_jg_use_registration_eq re ON fu.sequence_nbr = re.equip_transfer_id
LEFT JOIN idx_biz_jg_register_info jri ON re.equ_id = jri."RECORD"
LEFT JOIN idx_biz_jg_other_info other ON jri."RECORD" = other."RECORD"
LEFT JOIN tz_equipment_category c_list ON jri.EQU_LIST = c_list.code
LEFT JOIN tz_equipment_category c_cate ON jri.EQU_CATEGORY = c_cate.code
LEFT JOIN tz_equipment_category c_def ON jri.EQU_DEFINE = c_def.code
GROUP BY fu.sequence_nbr
ORDER BY
<choose>
<when test="sort != null and sort.field != null and sort.sortType != null">
<choose>
<when test="sort.field == 'create_date'">fu.create_date</when>
<when test="sort.field == 'apply_no'">fu.apply_no</when>
<when test="sort.field == 'reg_date'">fu.reg_date</when>
<when test="sort.field == 'audit_pass_date'">fu.audit_pass_date</when>
<otherwise>${sort.field}</otherwise>
</choose>
${sort.sortType}
</when>
<otherwise>
fu.create_date DESC, fu.apply_no DESC
</otherwise>
</choose>
LIMIT #{size} OFFSET #{offset}
</when>
<!-- 情况2:无设备过滤条件 -->
<otherwise>
WITH paginated_ids AS (
SELECT sequence_nbr
FROM tzs_jg_use_registration fu
WHERE fu.is_delete = '0'
<!-- 公共主表过滤条件 -->
<if test="dto.status != null and dto.status != ''">
AND fu.status = #{dto.status}
</if>
<if test="dto.applicationDate != null">
AND DATE(fu.create_date) = DATE(#{dto.applicationDate})
</if>
<if test="dto.fullAddress != null and dto.fullAddress != ''">
AND fu.use_address LIKE CONCAT('%', #{dto.fullAddress}, '%')
</if>
<if test="dto.useUnitName != null and dto.useUnitName != ''">
AND fu.use_unit_name LIKE CONCAT('%', #{dto.useUnitName}, '%')
</if>
<if test="dto.applyNo != null and dto.applyNo != ''">
AND fu.apply_no LIKE CONCAT(#{dto.applyNo}, '%')
</if>
<if test="dto.useRegistrationCode != null and dto.useRegistrationCode != ''">
AND fu.use_registration_code LIKE CONCAT(#{dto.useRegistrationCode}, '%')
</if>
<if test="dto.useUnitCode != null and dto.useUnitCode != ''">
AND fu.use_unit_credit_code = #{dto.useUnitCode}
</if>
<if test="dto.orgBranchCode != null and dto.orgBranchCode != ''">
<choose>
<when test="client == 'jgLook'">
AND fu.supervision_org_code LIKE CONCAT(#{dto.orgBranchCode}, '%')
</when>
<otherwise>
AND fu.supervision_org_code = #{dto.orgBranchCode}
</otherwise>
</choose>
</if>
<if test="dto.auditPassDateStart != null and dto.auditPassDateEnd != null">
AND fu.audit_pass_date BETWEEN #{dto.auditPassDateStart} AND #{dto.auditPassDateEnd}
</if>
<if test="dto.dataType == 'supervision' ">
<choose>
<when test="client == 'jgAudit'">
AND (fu.receive_company_code = #{dto.receiveCompanyCode}
OR fu.transfer_to_user_ids LIKE CONCAT('%', #{dto.currentUserId}, '%'))
</when>
<otherwise>
AND fu.supervision_org_code LIKE CONCAT(#{dto.supervisionOrgCode}, '%')
</otherwise>
</choose>
AND fu.status != '使用单位待提交'
</if>
<if test="dto.dataType == 'company' ">
AND (fu.use_unit_credit_code = #{dto.unitCode}
OR fu.transfer_to_user_ids LIKE CONCAT('%', #{dto.currentUserId}, '%'))
</if>
ORDER BY
<choose>
<when test="sort != null and sort.field != null and sort.sortType != null">
<choose>
<when test="sort.field == 'create_date'">fu.create_date</when>
<when test="sort.field == 'apply_no'">fu.apply_no</when>
<when test="sort.field == 'reg_date'">fu.reg_date</when>
<when test="sort.field == 'audit_pass_date'">fu.audit_pass_date</when>
<otherwise>${sort.field}</otherwise>
</choose>
${sort.sortType}
</when>
<otherwise>
fu.create_date DESC, fu.apply_no DESC
</otherwise>
</choose>
LIMIT #{size} OFFSET #{offset}
)
SELECT
fu.sequence_nbr AS sequenceNbr,
fu.audit_status AS auditStatus,
DATE_FORMAT(fu.reg_date,'%Y-%m-%d') AS regDate,
fu.use_unit_name AS useUnitName,
fu.supervision_org_code AS supervisionOrgCode,
fu.status,
fu.receive_org_name AS receiveOrgName,
fu.use_address AS place,
fu.instance_id AS instanceId,
fu.apply_no AS applyNo,
fu.next_execute_ids AS nextExecuteIds,
fu.promoter,
fu.use_registration_code AS useRegistrationCode,
DATE_FORMAT(fu.audit_pass_date,'%Y-%m-%d') AS auditPassDate,
DATE_FORMAT(fu.create_date,'%Y-%m-%d') AS createDate,
fu.receive_org_name AS receiveOrgName,
fu.next_execute_user_ids AS nextExecuteUserIds,
fu.next_task_id AS nextTaskId,
fu.create_user_id AS createUserId,
fu.rec_date AS recDate,
fu.manage_type AS manageType,
fu.reg_type AS regType,
fu.is_delete,
fu.create_date,
fu.receive_company_code,
fu.use_unit_credit_code,
fu.transfer_to_user_ids,
fu.supervision_org_code,
fu.use_address AS fullAddress,
fu.cancel_reason AS cancelReason,
fu.project_contraption_id AS projectContraptionId,
COALESCE(GROUP_CONCAT(DISTINCT re.equ_id), '') AS equipId,
COALESCE(GROUP_CONCAT(DISTINCT other.supervisory_code), '') AS supervisoryCode,
COALESCE(GROUP_CONCAT(DISTINCT other.CODE96333), '') AS code96333,
COALESCE(GROUP_CONCAT(DISTINCT jri.PRODUCT_NAME), '') AS productName,
COALESCE(GROUP_CONCAT(DISTINCT jri.EQU_CODE), '') AS equCode,
COALESCE(GROUP_CONCAT(DISTINCT jri.EQU_LIST), '') AS equListCode,
COALESCE(GROUP_CONCAT(DISTINCT jri.EQU_CATEGORY), '') AS equCategoryCode,
COALESCE(GROUP_CONCAT(DISTINCT jri.EQU_DEFINE), '') AS equDefineCode,
COALESCE(GROUP_CONCAT(DISTINCT c_list.name), '') AS equListName,
COALESCE(GROUP_CONCAT(DISTINCT c_cate.name), '') AS equCategory,
COALESCE(GROUP_CONCAT(DISTINCT c_def.name), '') AS equDefine
FROM paginated_ids pi
JOIN tzs_jg_use_registration fu ON pi.sequence_nbr = fu.sequence_nbr
LEFT JOIN tzs_jg_use_registration_eq re ON fu.sequence_nbr = re.equip_transfer_id
LEFT JOIN idx_biz_jg_register_info jri ON re.equ_id = jri."RECORD"
LEFT JOIN idx_biz_jg_other_info other ON jri."RECORD" = other."RECORD"
LEFT JOIN tz_equipment_category c_list ON jri.EQU_LIST = c_list.code
LEFT JOIN tz_equipment_category c_cate ON jri.EQU_CATEGORY = c_cate.code
LEFT JOIN tz_equipment_category c_def ON jri.EQU_DEFINE = c_def.code
GROUP BY fu.sequence_nbr
ORDER BY
<choose>
<when test="sort != null and sort.field != null and sort.sortType != null">
<choose>
<when test="sort.field == 'create_date'">fu.create_date</when>
<when test="sort.field == 'apply_no'">fu.apply_no</when>
<when test="sort.field == 'reg_date'">fu.reg_date</when>
<when test="sort.field == 'audit_pass_date'">fu.audit_pass_date</when>
<otherwise>${sort.field}</otherwise>
</choose>
${sort.sortType}
</when>
<otherwise>
fu.create_date DESC, fu.apply_no DESC
</otherwise>
</choose>
</otherwise>
</choose>
</select>
<select id="getListPage2" resultType="java.util.Map">
WITH filtered_ur AS (
SELECT
sequence_nbr,
......
......@@ -135,9 +135,12 @@ public class JgMaintenanceContractServiceImpl extends BaseService<JgMaintenanceC
companyType = companyTypeMap.get("companyType").toString();
}
if ("supervision".equals(companyLevel)) {
// 监管单位用"接收机构统一使用代码"匹配
dto.setReceiveOrgCodeFilter(company.getCompanyCode());
// 监管单位查询
if (client.equals("jgLook")) {
dto.setOrgBranchCode(company.getOrgCode());
} else { // 接收机构查询
dto.setReceiveOrgCodeFilter(company.getCompanyCode());
}
} else if ("company".equals(companyLevel)) {
if (companyType.contains(CompanyTypeEnum.USE.getCode()) || companyType.contains(CompanyTypeEnum.INDIVIDUAL.getCode())) {
// 使用单位用"使用单位统一信用代码"匹配数据
......
......@@ -26,10 +26,7 @@ import org.springframework.stereotype.Service;
import org.typroject.tyboot.component.emq.EmqKeeper;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.*;
import java.util.stream.Collectors;
/**
* 安全追溯问题生成服务实现类
......@@ -123,36 +120,104 @@ public class SafetyProblemTracingGenServiceImpl{
public void update3MaintenanceCheck() {
logger.info("开始修正数据");
List<String> oldAllRecords = idxBizJgOtherInfoService.getBaseMapper()
.selectList(new LambdaQueryWrapper<IdxBizJgOtherInfo>()
.eq(IdxBizJgOtherInfo::getStatus, SafetyProblemStatusEnum.UNHANDLED.getCode()))
.stream()
.map(IdxBizJgOtherInfo::getRecord)
.collect(Collectors.toList());
logger.info("总的旧数据条数:{}",oldAllRecords.size());
List<Map<String, Object>> outOfMaintenanceRecords = commonMapper.queryOutOfMaintenanceRecord();
List<String> realRecordsMain = outOfMaintenanceRecords.stream().map(m -> m.get("RECORD").toString()).collect(Collectors.toList());
List<Map<String, Object>> outOfInspectionRecords = commonMapper.queryOutOfInspectionRecord();
List<String> realRecordsInsp = outOfInspectionRecords.stream().map(m -> m.get("RECORD").toString()).collect(Collectors.toList());
realRecordsMain.addAll(realRecordsInsp);
logger.info("正常数据条数:{}", realRecordsMain.size());
List<String> errorRecord = oldAllRecords.stream().filter(item -> !realRecordsMain.contains(item)).collect(Collectors.toList());
logger.info("异常数据条数---------------:{}",errorRecord.size());
Set<String> realOutOfMaintenanceRecord = commonMapper.queryOutOfMaintenanceRecord().stream().map(m -> m.get("RECORD").toString()).collect(Collectors.toSet());
Set<String> realOutOfInspectRecord = commonMapper.queryOutOfInspectionRecord().stream().map(m -> m.get("RECORD").toString()).collect(Collectors.toSet());
// 需要修正业务表+es的数据
List<String> correctData = Lists.newArrayList();
// 1.处理维保超期错误数据
List<String> outOfMaintenanceErrorData = handleOutOfMaintenanceErrorData(realOutOfMaintenanceRecord);
// 2.处理检验超期错误数据
List<String> outOfInspectionErrorData = handleOutOfInspectionErrorData(realOutOfInspectRecord);
// 3.修正业务表+es数据状态
if (ValidationUtil.isEmpty(outOfMaintenanceErrorData) && ValidationUtil.isEmpty(outOfInspectionErrorData)) {
// 没有需要修正的数据
return;
}
Set<String> maintenanceSet = new HashSet<>(ValidationUtil.isEmpty(outOfMaintenanceErrorData) ? Collections.emptyList() : outOfMaintenanceErrorData);
Set<String> inspectionSet = new HashSet<>(ValidationUtil.isEmpty(outOfInspectionErrorData) ? Collections.emptyList() : outOfInspectionErrorData);
if (!maintenanceSet.isEmpty() && inspectionSet.isEmpty()) {
// 仅有维保备案错误数据
correctData.addAll(maintenanceSet);
} else if (maintenanceSet.isEmpty() && !inspectionSet.isEmpty()) {
// 仅有检验超期错误数据
correctData.addAll(inspectionSet);
} else if (!maintenanceSet.isEmpty()) {
// 再次查询维保备案这些数据有没有检验超期的问题
// 没有则可以愉快地更新设备状态为正常
maintenanceSet.retainAll(realOutOfInspectRecord);
// 再次查询检验这些数据有没有维保超期问题
// 没有则可以愉快地更新设备状态为正常
inspectionSet.retainAll(realOutOfMaintenanceRecord);
correctData.addAll(maintenanceSet);
correctData.addAll(inspectionSet);
}
idxBizJgOtherInfoService.lambdaUpdate().set(IdxBizJgOtherInfo::getStatus, null)
.in(IdxBizJgOtherInfo::getRecord, correctData).update();
Iterable<ESEquipmentCategoryDto> equipEsDtoIter = esEquipmentCategory.findAllById(correctData);
for (ESEquipmentCategoryDto equipEsDto : equipEsDtoIter) {
equipEsDto.setProblemStatus(null);
}
esEquipmentCategory.saveAll(equipEsDtoIter);
logger.info("修改正数据条数:{}", correctData.size());
}
private List<String> handleOutOfMaintenanceErrorData(Set<String> realOutOfMaintenanceRecord) {
// 设备表到今日维保超期设备realOutOfMaintenanceRecord
if (ValidationUtil.isEmpty(realOutOfMaintenanceRecord)) {
return Lists.newArrayList();
}
List<SafetyProblemTracing> problemList = safetyProblemTracingService.list(new LambdaQueryWrapper<SafetyProblemTracing>()
.select(SafetyProblemTracing::getSourceId)
.eq(SafetyProblemTracing::getProblemStatusCode, SafetyProblemStatusEnum.UNHANDLED.getCode())
.eq(SafetyProblemTracing::getProblemTypeCode, SafetyProblemTypeEnum.WBCQ.getProblemTypeCode())
.eq(SafetyProblemTracing::getIsDelete,Boolean.FALSE)
);
if (ValidationUtil.isEmpty(problemList)) {
return Lists.newArrayList();
}
// 追溯问题表中未处理的维保超期设备
List<String> outOfMaintenanceEquipIds = problemList.stream().map(SafetyProblemTracing::getSourceId).collect(Collectors.toList());
// 未超期但错误生成的维保超期设备
outOfMaintenanceEquipIds.removeIf(realOutOfMaintenanceRecord::contains);
safetyProblemTracingService.lambdaUpdate()
.set(SafetyProblemTracing::getProblemStatusCode, SafetyProblemStatusEnum.HANDLED.getCode())
.set(SafetyProblemTracing::getProblemStatus, SafetyProblemStatusEnum.HANDLED.getName())
.in(SafetyProblemTracing::getSourceId, errorRecord)
.in(SafetyProblemTracing::getSourceId, outOfMaintenanceEquipIds)
.eq(SafetyProblemTracing::getProblemTypeCode, SafetyProblemTypeEnum.WBCQ.getProblemTypeCode())
.eq(SafetyProblemTracing::getIsDelete,Boolean.FALSE)
.update();
idxBizJgOtherInfoService.lambdaUpdate().set(IdxBizJgOtherInfo::getStatus, null)
.in(IdxBizJgOtherInfo::getRecord, errorRecord).update();
Iterable<ESEquipmentCategoryDto> equipEsDtoIter = esEquipmentCategory.findAllById(errorRecord);
for (ESEquipmentCategoryDto equipEsDto : equipEsDtoIter) {
equipEsDto.setProblemStatus(null);
return outOfMaintenanceEquipIds;
}
esEquipmentCategory.saveAll(equipEsDtoIter);
logger.info("修改正数据条数:{}",errorRecord.size());
private List<String> handleOutOfInspectionErrorData(Set<String> realOutOfInspectRecord) {
// 设备表到今日检验超期设备realOutOfInspectRecord
if (ValidationUtil.isEmpty(realOutOfInspectRecord)) {
return Lists.newArrayList();
}
List<SafetyProblemTracing> problemList = safetyProblemTracingService.list(new LambdaQueryWrapper<SafetyProblemTracing>()
.select(SafetyProblemTracing::getSourceId)
.eq(SafetyProblemTracing::getProblemStatusCode, SafetyProblemStatusEnum.UNHANDLED.getCode())
.eq(SafetyProblemTracing::getProblemTypeCode, SafetyProblemTypeEnum.JYCQ.getProblemTypeCode())
.eq(SafetyProblemTracing::getIsDelete,Boolean.FALSE)
);
if (ValidationUtil.isEmpty(problemList)) {
return Lists.newArrayList();
}
// 追溯问题表中未处理的检验超期设备
List<String> outOfInspectionEquipIds = problemList.stream().map(SafetyProblemTracing::getSourceId).collect(Collectors.toList());
// 未超期但错误生成的检验超期设备
outOfInspectionEquipIds.removeIf(realOutOfInspectRecord::contains);
safetyProblemTracingService.lambdaUpdate()
.set(SafetyProblemTracing::getProblemStatusCode, SafetyProblemStatusEnum.HANDLED.getCode())
.set(SafetyProblemTracing::getProblemStatus, SafetyProblemStatusEnum.HANDLED.getName())
.in(SafetyProblemTracing::getSourceId, outOfInspectionEquipIds)
.eq(SafetyProblemTracing::getProblemTypeCode, SafetyProblemTypeEnum.JYCQ.getProblemTypeCode())
.eq(SafetyProblemTracing::getIsDelete,Boolean.FALSE)
.update();
return outOfInspectionEquipIds;
}
private void updateEquipAndSendMessage(List<Map<String, Object>> mapList, SafetyProblemTypeEnum safetyProblemTypeEnum) {
......
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