From 2dd91c8e0c2308f142b7e8ffd3195c2760edd4ac Mon Sep 17 00:00:00 2001 From: liwen Date: Fri, 29 Mar 2024 10:49:32 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E6=9C=88=E6=8A=A5=E4=B8=AD=E6=97=A0=E5=B7=A1=E6=A3=80=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../report/service/impl/OperStationMonthReportServiceImpl.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/service/impl/OperStationMonthReportServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/service/impl/OperStationMonthReportServiceImpl.java index 1648d61..3f193e8 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/service/impl/OperStationMonthReportServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/service/impl/OperStationMonthReportServiceImpl.java @@ -624,7 +624,7 @@ public class OperStationMonthReportServiceImpl implements IOperStationMonthRepor map.put("inspectReportSum", sumList); continue; } - fillMapByClass(inspectReportVOList,list); + fillMapByClass(inspectReport, list); } map.put("inspectReportVOList", list); } @@ -1222,9 +1222,10 @@ public class OperStationMonthReportServiceImpl implements IOperStationMonthRepor int sum = stationReportAllVo.getTicketInfoStatisticVOList().stream().filter(s->"合计".equals(s.getTicketInfoType())).mapToInt(TicketInfoStatisticVO::getTicketInfoNumber).sum(); int qualifiedNum = stationReportAllVo.getTicketInfoStatisticVOList().stream().filter(s->"合计".equals(s.getTicketInfoType())).mapToInt(TicketInfoStatisticVO::getTicketInfoQualifiedNum).sum(); // double ticketInfoProportion = new BigDecimal(qualifiedNum ).divide(sum,2, RoundingMode.HALF_DOWN).doubleValue(); - double ticketInfoProportion = new BigDecimal(qualifiedNum ).divide(new BigDecimal(sum*100),2, RoundingMode.HALF_DOWN).doubleValue(); + double ticketInfoProportion = sum == 0 ? 0 : new BigDecimal(qualifiedNum).divide(new BigDecimal(sum*100),2, + RoundingMode.HALF_DOWN).doubleValue(); String phenomenonConclusion = "5、本月开票%s张,合格率%s;"; - conclusion.append(String.format(phenomenonConclusion,sum,ticketInfoProportion)).append(";\r\n"); + conclusion.append(String.format(phenomenonConclusion, sum, ticketInfoProportion)).append(";\r\n"); }else { conclusion.append("5、本月未开票;\r\n"); }