Browse Source

debug 驾驶舱算法

tags/24080901
PoffyZhang 1 year ago
parent
commit
4b17b85c26
2 changed files with 14 additions and 11 deletions
  1. +5
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/common/util/BizUtils.java
  2. +9
    -9
      pmapi/src/main/java/com/ningdatech/pmapi/scheduler/task/CockpitStatsStatisticsTask.java

+ 5
- 2
pmapi/src/main/java/com/ningdatech/pmapi/common/util/BizUtils.java View File

@@ -130,8 +130,11 @@ public class BizUtils {
} }


public static String computeRise(Integer numa, Integer numb) { public static String computeRise(Integer numa, Integer numb) {
if(Objects.isNull(numa) || Objects.isNull(numb) || numa.equals(0) || numb.equals(0)){
return "0";
if(Objects.isNull(numa) || numa.equals(0)){
return "-100";
}
if(Objects.isNull(numb)|| numb.equals(0)){
return "100";
} }
return BigDecimal.valueOf((numa - numb) * 100.0).divide(BigDecimal.valueOf(numb),2, RoundingMode.CEILING) return BigDecimal.valueOf((numa - numb) * 100.0).divide(BigDecimal.valueOf(numb),2, RoundingMode.CEILING)
.stripTrailingZeros().toPlainString(); .stripTrailingZeros().toPlainString();


+ 9
- 9
pmapi/src/main/java/com/ningdatech/pmapi/scheduler/task/CockpitStatsStatisticsTask.java View File

@@ -102,7 +102,7 @@ public class CockpitStatsStatisticsTask {
StopWatch stopWatch = new StopWatch(); StopWatch stopWatch = new StopWatch();
stopWatch.start(); stopWatch.start();


List<Integer> years = Lists.newArrayList(2021,2022,2023,2024);
List<Integer> years = Lists.newArrayList(2021,2022,2023,2024,2025);


List<CockpitStats> res = Lists.newArrayList(); List<CockpitStats> res = Lists.newArrayList();
//1.根据2个维度来统计 区域和分年 //1.根据2个维度来统计 区域和分年
@@ -507,13 +507,13 @@ public class CockpitStatsStatisticsTask {
} }
cockpitStats.setMonitorOverdueConstructionProjectsRise(BizUtils.computeRise(thisYearData.getMonitorOverdueConstructionProjectsNum(), cockpitStats.setMonitorOverdueConstructionProjectsRise(BizUtils.computeRise(thisYearData.getMonitorOverdueConstructionProjectsNum(),
lastYearData.getMonitorOverdueConstructionProjectsNum())); lastYearData.getMonitorOverdueConstructionProjectsNum()));
cockpitStats.setMonitorLaggingProjectsRise(BizUtils.computeRise(thisYearData.getMonitorOverdueConstructionProjectsNum(),
lastYearData.getMonitorOverdueConstructionProjectsNum()));
cockpitStats.setMonitorRejectedApproveProjectsRise(BizUtils.computeRise(thisYearData.getMonitorOverdueConstructionProjectsNum(),
lastYearData.getMonitorOverdueConstructionProjectsNum()));
cockpitStats.setMonitorRejectedPreReviewProjectsRise(BizUtils.computeRise(thisYearData.getMonitorOverdueConstructionProjectsNum(),
lastYearData.getMonitorOverdueConstructionProjectsNum()));
cockpitStats.setMonitorAcceptConditionsNotStandardsRise(BizUtils.computeRise(thisYearData.getMonitorOverdueConstructionProjectsNum(),
lastYearData.getMonitorOverdueConstructionProjectsNum()));
cockpitStats.setMonitorLaggingProjectsRise(BizUtils.computeRise(thisYearData.getMonitorLaggingProjectsNum(),
lastYearData.getMonitorLaggingProjectsNum()));
cockpitStats.setMonitorRejectedApproveProjectsRise(BizUtils.computeRise(thisYearData.getMonitorRejectedApproveProjectsNum(),
lastYearData.getMonitorRejectedApproveProjectsNum()));
cockpitStats.setMonitorRejectedPreReviewProjectsRise(BizUtils.computeRise(thisYearData.getMonitorRejectedPreReviewProjectsNum(),
lastYearData.getMonitorRejectedPreReviewProjectsNum()));
cockpitStats.setMonitorAcceptConditionsNotStandardsRise(BizUtils.computeRise(thisYearData.getMonitorAcceptConditionsNotStandardsNum(),
lastYearData.getMonitorAcceptConditionsNotStandardsNum()));
} }
} }

Loading…
Cancel
Save