Commit 737fbd0f authored by 麻笑宇's avatar 麻笑宇

修改大屏总揽办结率去掉已完成筛选

parent 55e31488
...@@ -631,14 +631,25 @@ public class JGDPStatisticsServiceImpl { ...@@ -631,14 +631,25 @@ public class JGDPStatisticsServiceImpl {
this.setDefaultFilter(dpFilterParamDto); this.setDefaultFilter(dpFilterParamDto);
result.put("xdata", Arrays.asList("安装告知", "监督检验", "使用登记", "定期检验", "变更登记", "注销报废")); result.put("xdata", Arrays.asList("安装告知", "监督检验", "使用登记", "定期检验", "变更登记", "注销报废"));
List<Long> ydata = this.countBizFinishedNum(dpFilterParamDto); List<Long> ydata = this.countBizFinishedNum(dpFilterParamDto);
Long allFinishedCount = ydata.stream().mapToLong(e -> e).sum(); Long allFinishedCount = this.calEveryAll(dpFilterParamDto, ydata).stream().mapToLong(e -> e).sum();
result.put("ydata", ydata); result.put("ydata", this.calEveryAll(dpFilterParamDto, ydata));
result.put("allCount", allFinishedCount); result.put("allCount", allFinishedCount);
result.put("percentData", this.calEveryPercent(dpFilterParamDto, ydata)); result.put("percentData", this.calEveryPercent(dpFilterParamDto, ydata));
result.put("completionRate", this.calPercentForBizCycleData(dpFilterParamDto, allFinishedCount)); result.put("completionRate", this.calPercentForBizCycleData(dpFilterParamDto, allFinishedCount));
return result; return result;
} }
private List<Long> calEveryAll(DPFilterParamDto dpFilterParamDto, List<Long> everyFinished) {
List<Long> everyInFlow = countBizDataInFlowing(dpFilterParamDto);
List<Long> allArray = new ArrayList<>();
for (int i = 0; i < everyInFlow.size(); i++) {
Long flowIng = everyInFlow.get(i);
Long finished = everyFinished.get(i);
allArray.add(flowIng+finished);
}
return allArray;
}
private List<String> calEveryPercent(DPFilterParamDto dpFilterParamDto, List<Long> everyFinished) { private List<String> calEveryPercent(DPFilterParamDto dpFilterParamDto, List<Long> everyFinished) {
List<Long> everyInFlow = countBizDataInFlowing(dpFilterParamDto); List<Long> everyInFlow = countBizDataInFlowing(dpFilterParamDto);
List<String> percentArray = new ArrayList<>(); List<String> percentArray = new ArrayList<>();
...@@ -650,8 +661,7 @@ public class JGDPStatisticsServiceImpl { ...@@ -650,8 +661,7 @@ public class JGDPStatisticsServiceImpl {
BigDecimal all = flowIngBig.add(finishedBig); BigDecimal all = flowIngBig.add(finishedBig);
if (all.compareTo(BigDecimal.ZERO) > 0) { if (all.compareTo(BigDecimal.ZERO) > 0) {
BigDecimal percent = finishedBig.divide(all, 2, RoundingMode.HALF_UP); BigDecimal percent = finishedBig.divide(all, 2, RoundingMode.HALF_UP);
BigDecimal percentX100 = percent.multiply(new BigDecimal("100")).setScale(0, RoundingMode.HALF_UP); percentArray.add(percent.toPlainString());
percentArray.add(percentX100.toPlainString());
} else { } else {
percentArray.add("0"); percentArray.add("0");
} }
...@@ -1562,12 +1572,11 @@ public class JGDPStatisticsServiceImpl { ...@@ -1562,12 +1572,11 @@ public class JGDPStatisticsServiceImpl {
BigDecimal all = everyNum.add(finishedNum); BigDecimal all = everyNum.add(finishedNum);
if (all.compareTo(BigDecimal.ZERO) > 0) { if (all.compareTo(BigDecimal.ZERO) > 0) {
BigDecimal percent = finishedNum.divide(all, 2, RoundingMode.HALF_UP); BigDecimal percent = finishedNum.divide(all, 2, RoundingMode.HALF_UP);
BigDecimal percentX100 = percent.multiply(new BigDecimal("100")).setScale(0, RoundingMode.HALF_UP); itemResult.put("percentData", percent.toPlainString());
itemResult.put("percentData", percentX100.toPlainString());
} else { } else {
itemResult.put("percentData", "0"); itemResult.put("percentData", "0");
} }
itemResult.put("finishedNum", finishedNum); itemResult.put("finishedNum", all);
return itemResult; return itemResult;
}).collect(Collectors.toList()); }).collect(Collectors.toList());
......
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