Commit f4b258a3 authored by tianbo's avatar tianbo

feat(jg): 添加查询错误生成的安全追溯问题数据功能

- 方法功能:查询错误生成的安全追溯问题数据,包括资质超期、维保超期、检验超期和许可超期的问题 - 返回结果包含四种问题类型的错误数据集合
parent c31b5bf2
......@@ -321,4 +321,11 @@ public class SafetyProblemTracingController extends BaseController {
safetyProblemTracingGenService.executeOverDesignLifeCheck();
return ResponseHelper.buildResponse("success");
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "查询错误生成的安全追溯问题数据", notes = "查询错误生成的安全追溯问题数据")
@GetMapping(value = "/wrong/overdueData")
public ResponseModel<Map<String, Object>> wrongOverdueData() {
return ResponseHelper.buildResponse(safetyProblemTracingGenService.wrongOverdueData());
}
}
......@@ -124,14 +124,45 @@ public class SafetyProblemTracingGenServiceImpl{
logger.info("企业许可超期检查结束");
}
public Map<String, Object> wrongOverdueData() {
Map<String, Object> result = new HashMap<>();
// 查询当天资质超期的人员数据
Set<String> realOutOfCertificationRecord = commonMapper.queryOutOfCertificationRecord().stream().map(m -> m.get("problemSourceId").toString()).collect(Collectors.toSet());
// 查询当天许可超期的企业许可数据
Set<String> realOutOfQualificationRecords = commonMapper.queryOutOfQualificationRecord().stream().map(m -> m.get("problemSourceId").toString()).collect(Collectors.toSet());
// 查询当天维保超期的企业许可数据
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());
// 查询未关闭的问题
List<SafetyProblemTracing> problemList = safetyProblemTracingService.list(new LambdaQueryWrapper<SafetyProblemTracing>()
.select(SafetyProblemTracing::getSequenceNbr, SafetyProblemTracing::getProblemTypeCode, SafetyProblemTracing::getSourceId, SafetyProblemTracing::getPrincipalUnitCode)
.eq(SafetyProblemTracing::getProblemStatusCode, SafetyProblemStatusEnum.UNHANDLED.getCode())
.eq(SafetyProblemTracing::getIsDelete,Boolean.FALSE));
if(!ValidationUtil.isEmpty(problemList)) {
Set<Long> set1 = problemList.stream().filter(p -> p.getProblemTypeCode().equals(SafetyProblemTypeEnum.ZZCQ.getProblemTypeCode()) && !realOutOfCertificationRecord.contains(p.getSourceId())).map(SafetyProblemTracing::getSequenceNbr).collect(Collectors.toSet());
Set<Long> set2 = problemList.stream().filter(p -> p.getProblemTypeCode().equals(SafetyProblemTypeEnum.WBCQ.getProblemTypeCode()) && !realOutOfMaintenanceRecord.contains(p.getSourceId())).map(SafetyProblemTracing::getSequenceNbr).collect(Collectors.toSet());
Set<Long> set3 = problemList.stream().filter(p -> p.getProblemTypeCode().equals(SafetyProblemTypeEnum.JYCQ.getProblemTypeCode()) && !realOutOfInspectRecord.contains(p.getSourceId())).map(SafetyProblemTracing::getSequenceNbr).collect(Collectors.toSet());
Set<Long> set4 = problemList.stream().filter(p -> p.getProblemTypeCode().equals(SafetyProblemTypeEnum.XKCQ.getProblemTypeCode()) && !realOutOfQualificationRecords.contains(p.getSourceId())).map(SafetyProblemTracing::getSequenceNbr).collect(Collectors.toSet());
result.put("zzcq", set1);
result.put("wbqc", set2);
result.put("jyqc", set3);
result.put("xkqc", set4);
}
return result;
}
public void repairPersonnelQualificationOverdueProblem() {
logger.info("开始人员资质超期数据修正");
// 查询当天资质超期的人员数据
List<Map<String, Object>> outOfQualificationRecords = commonMapper.queryOutOfCertificationRecord();
if (ValidationUtil.isEmpty(outOfQualificationRecords)) {
List<Map<String, Object>> outOfCertificationRecord = commonMapper.queryOutOfCertificationRecord();
if (ValidationUtil.isEmpty(outOfCertificationRecord)) {
return;
}
Set<String> realOutOfQualificationRecord = outOfQualificationRecords.stream().map(m -> m.get("problemSourceId").toString()).collect(Collectors.toSet());
Set<String> realOutOfQualificationRecord = outOfCertificationRecord.stream().map(m -> m.get("problemSourceId").toString()).collect(Collectors.toSet());
// 需要修正业务表的数据
List<String> correctData = Lists.newArrayList();
List<SafetyProblemTracing> problemList = safetyProblemTracingService.list(new LambdaQueryWrapper<SafetyProblemTracing>()
......
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