新增监管端和机构端首页数据

dev
huwei 2026-07-31 16:09:54 +08:00
parent 4d426f2bc1
commit 95b65482b1
1 changed files with 15 additions and 12 deletions

View File

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