新增监管端和机构端首页数据
parent
4d426f2bc1
commit
95b65482b1
|
|
@ -169,10 +169,11 @@ public class RegulatorCockpitExecutor implements RegulatorCockpitApi {
|
|||
private double evalStartRate(List<EvalProjectEntity> 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<CockpitRegionDistributionCO> regionDistribution() {
|
||||
List<EvalProjectEntity> projects = listStatutoryProjects();
|
||||
Map<String, Integer> pCount = new HashMap<>();
|
||||
Map<String, String> 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<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<>();
|
||||
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<InspNoticeEntity> 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<Long> 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++;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue