diff --git a/safety-eval-app/src/main/java/org/qinan/safetyeval/app/executor/regulator/RegulatorCockpitExecutor.java b/safety-eval-app/src/main/java/org/qinan/safetyeval/app/executor/regulator/RegulatorCockpitExecutor.java index 795aeb3..0d1559d 100644 --- a/safety-eval-app/src/main/java/org/qinan/safetyeval/app/executor/regulator/RegulatorCockpitExecutor.java +++ b/safety-eval-app/src/main/java/org/qinan/safetyeval/app/executor/regulator/RegulatorCockpitExecutor.java @@ -169,10 +169,11 @@ public class RegulatorCockpitExecutor implements RegulatorCockpitApi { private double evalStartRate(List projects, LocalDateTime from, LocalDateTime to) { long den = 0, num = 0; for (EvalProjectEntity p : projects) { - if (p.getCreateTime() == null) { + if (p.getPlanStartDate() == null) { continue; } - if (!p.getCreateTime().isBefore(from) && !p.getCreateTime().isAfter(to)) { + LocalDateTime ct = p.getPlanStartDate().atStartOfDay(); + if (!ct.isBefore(from) && !ct.isAfter(to)) { den++; if (evalRiskAnalysisGateway.getByProjectId(p.getId(), p.getOrgId()) != null) { num++; @@ -188,18 +189,20 @@ public class RegulatorCockpitExecutor implements RegulatorCockpitApi { public SingleResponse regionDistribution() { List projects = listStatutoryProjects(); Map pCount = new HashMap<>(); - Map pName = new HashMap<>(); for (EvalProjectEntity p : projects) { String code = p.getDistrictCode(); if (code == null) { continue; } pCount.merge(code, 1, Integer::sum); - if (p.getDistrictName() != null) { - pName.put(code, p.getDistrictName()); - } } List orgs = allOrgs(); + Map pName = new HashMap<>(); + for (OrgInfoEntity o : orgs) { + if (o.getDistrictCode() != null && o.getDistrictName() != null) { + pName.put(o.getDistrictCode(), o.getDistrictName()); + } + } Map oCount = new HashMap<>(); for (OrgInfoEntity o : orgs) { if (!QualFilingStatusEnum.isFiled(o.getFilingRecordStatusCode())) { @@ -284,10 +287,10 @@ public class RegulatorCockpitExecutor implements RegulatorCockpitApi { for (EvalProjectEntity p : projects) { String t = p.getEvalTypeCode(); - if (t == null || p.getCreateTime() == null) { + if (t == null || p.getPlanStartDate() == null) { continue; } - int idx = bucketIndex(period, y, p.getCreateTime()); + int idx = bucketIndex(period, y, p.getPlanStartDate().atStartOfDay()); if (idx < 0) { continue; } @@ -301,10 +304,10 @@ public class RegulatorCockpitExecutor implements RegulatorCockpitApi { List insps = allInsps(); for (InspNoticeEntity ins : insps) { - if (ins.getCreateTime() == null) { + if (ins.getSendTime() == null) { continue; } - int idx = bucketIndex(period, y, ins.getCreateTime()); + int idx = bucketIndex(period, y, ins.getSendTime()); if (idx < 0) { continue; } @@ -346,7 +349,7 @@ public class RegulatorCockpitExecutor implements RegulatorCockpitApi { int inspCount = 0, onsite = 0, qualKeep = 0, special = 0, found = 0; Set orgSet = new HashSet<>(); for (InspNoticeEntity i : insps) { - if (i.getCreateTime() == null || i.getCreateTime().getYear() != y) { + if (i.getSendTime() == null || i.getSendTime().getYear() != y) { continue; } inspCount++; @@ -378,7 +381,7 @@ public class RegulatorCockpitExecutor implements RegulatorCockpitApi { } int punish = 0; for (InspNoticeEntity i : insps) { - if (i.getCreateTime() != null && i.getCreateTime().getYear() == y + if (i.getSendTime() != null && i.getSendTime().getYear() == y && i.getResultCode() != null && i.getResultCode() == 3) { punish++; }