Commit 2a12743f authored by 韩桐桐's avatar 韩桐桐

fix(jg):大屏-监督管理-登记证下钻-查看登记证详情-查看关联设备详情,设备检验和维保均未过期,错误显示红码;

parent 38722560
......@@ -878,22 +878,16 @@
si."ORG_BRANCH_CODE",
si."COMPANY_ORG_BRANCH_CODE"
FROM
(SELECT
"RECORD","NEXT_INSPECT_DATE"
FROM
(
SELECT
ROW_NUMBER () OVER (
PARTITION BY "RECORD"
ORDER BY
"REC_DATE"
) AS rowNum1,"RECORD", "NEXT_INSPECT_DATE"
FROM
idx_biz_jg_inspection_detection_info
WHERE "NEXT_INSPECT_DATE" <![CDATA[<]]> to_char(now(), 'YYYY-MM-DD')
) d
WHERE
rowNum1 = 1) tt
SELECT "RECORD","NEXT_INSPECT_DATE","rowNum1"
FROM
(
SELECT ROW_NUMBER () OVER ( PARTITION BY "RECORD" ORDER BY "REC_DATE" DESC) AS rowNum1,"RECORD", "NEXT_INSPECT_DATE"
FROM
idx_biz_jg_inspection_detection_info
) d
WHERE d.rowNum1 = 1 and d."NEXT_INSPECT_DATE" <![CDATA[<]]> to_char(now(), 'YYYY-MM-DD')
) tt
LEFT JOIN idx_biz_jg_use_info ui ON ui."RECORD" = tt."RECORD"
LEFT JOIN idx_biz_jg_register_info ri ON ri."RECORD" = tt."RECORD"
LEFT JOIN idx_biz_jg_other_info oi ON oi."RECORD" = tt."RECORD"
......
......@@ -234,4 +234,20 @@ public class SafetyProblemTracingController extends BaseController {
safetyProblemTracingGenService.executeMaintenanceCheck();
return ResponseHelper.buildResponse("success");
}
/**
* update3 -- 修复
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(httpMethod = "GET",value = "修改维保超期脏数据 && 修改检验检测超期数据",
notes = "修改维保超期脏数据 && 修改检验检测超期数据")
@GetMapping(value = "/gen/update3")
public ResponseModel<String> update3() {
safetyProblemTracingGenService.update3MaintenanceCheck();
return ResponseHelper.buildResponse("success");
}
}
......@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.jg.biz.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.google.common.collect.Lists;
import com.yeejoin.amos.boot.module.common.api.dao.ESEquipmentCategory;
import com.yeejoin.amos.boot.module.common.api.dto.ESEquipmentCategoryDto;
......@@ -67,6 +68,35 @@ public class SafetyProblemTracingGenServiceImpl{
logger.info("维保超期检查结束");
}
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());
idxBizJgOtherInfoService.lambdaUpdate()
.in(IdxBizJgOtherInfo::getRecord, errorRecord)
.set(IdxBizJgOtherInfo::getStatus, null)
.update();
List<ESEquipmentCategoryDto> esEquipmentCategoryDto = Lists.newArrayList();
for (ESEquipmentCategoryDto equipmentCategoryDto : esEquipmentCategory.findAllById(errorRecord)) {
equipmentCategoryDto.setProblemStatus(null);
esEquipmentCategoryDto.add(equipmentCategoryDto);
}
esEquipmentCategory.saveAll(esEquipmentCategoryDto);
logger.info("修改正数据条数:{}",errorRecord.size());
}
private void updateEquipAndSendMessage(List<Map<String, Object>> mapList, SafetyProblemTypeEnum safetyProblemTypeEnum) {
List<String> records = mapList.stream().map(m -> m.get("RECORD").toString()).collect(Collectors.toList());
......
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