From a5bc7b52e55b33540f4aea0f4917ddab3591640e Mon Sep 17 00:00:00 2001 From: ty <1577900710@qq.com> Date: Tue, 13 Aug 2024 20:11:26 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=EF=BC=9A=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E6=9C=88=E6=8A=A5=E4=B8=A4=E7=A5=A8=E7=BB=9F=E8=AE=A1=E5=90=88?= =?UTF-8?q?=E6=A0=BC=E7=8E=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/hnac/hzims/ticket/allTicket/fegin/TicketInfoAllClient.java | 2 +- .../standardTicket/service/impl/StandardTicketInfoServiceImpl.java | 5 ++++- .../ticket/twoTicket/service/impl/FirstWorkTicketServiceImpl.java | 4 +++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/allTicket/fegin/TicketInfoAllClient.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/allTicket/fegin/TicketInfoAllClient.java index 0101bfa..caab640 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/allTicket/fegin/TicketInfoAllClient.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/allTicket/fegin/TicketInfoAllClient.java @@ -74,7 +74,7 @@ public class TicketInfoAllClient implements ITicketInfoAllClient { int completeNum = workTicketStatistic.stream().mapToInt(TicketInfoStatisticVO::getTicketInfoCompleteNum).sum(); int invalidatedNum = workTicketStatistic.stream().mapToInt(TicketInfoStatisticVO::getTicketInfoInvalidatedNum).sum(); int qualifiedNum = workTicketStatistic.stream().mapToInt(TicketInfoStatisticVO::getTicketInfoQualifiedNum).sum(); - Double proportion = new BigDecimal(qualifiedNum).divide(new BigDecimal(sum),2, RoundingMode.UP) + Double proportion = new BigDecimal(qualifiedNum).divide(new BigDecimal(sum),4, RoundingMode.UP) .multiply(new BigDecimal(100)).setScale(2, RoundingMode.UP).doubleValue(); ticketInfoStatisticVO.setTicketInfoNumber(sum); ticketInfoStatisticVO.setTicketInfoCompleteNum(completeNum); diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/StandardTicketInfoServiceImpl.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/StandardTicketInfoServiceImpl.java index 6094606..96c1e08 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/StandardTicketInfoServiceImpl.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/StandardTicketInfoServiceImpl.java @@ -705,7 +705,10 @@ public class StandardTicketInfoServiceImpl extends BaseServiceImpl "作废".equals(item.getFlowTaskName())).collect(Collectors.toList()).size(); //计算合格率 - double ticketInfoProportion = new BigDecimal(ticketInfoQualifiedNum / (double) operateTicketReportStatistic.size() * 100).setScale(2, RoundingMode.HALF_DOWN).doubleValue(); + Double ticketInfoProportion = new BigDecimal(ticketInfoQualifiedNum) + .divide(new BigDecimal(typeOperateTicket.getValue().size()),4, RoundingMode.HALF_UP) + .multiply(new BigDecimal(100)) + .setScale(2, RoundingMode.HALF_UP).doubleValue(); TicketInfoStatisticVO ticketInfoStatisticVO = TicketInfoStatisticVO.builder().ticketInfoType(type) .ticketInfoNumber(typeOperateTicket.getValue().size()) .ticketInfoCompleteNum(ticketInfoCompleteNum) diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/FirstWorkTicketServiceImpl.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/FirstWorkTicketServiceImpl.java index c5ac658..5080435 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/FirstWorkTicketServiceImpl.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/FirstWorkTicketServiceImpl.java @@ -1149,7 +1149,9 @@ public class FirstWorkTicketServiceImpl extends BaseServiceImpl Func.isNotEmpty(ticket.getEvaluation()) && ticket.getEvaluation().intValue() == 1) .collect(Collectors.toList()).size(); //计算合格率 - Double ticketInfoProportion = new BigDecimal(ticketInfoQualifiedNum / (double) workTicketReportStatistic.size() *100) + Double ticketInfoProportion = new BigDecimal(ticketInfoQualifiedNum) + .divide(new BigDecimal(typeWorkTicket.getValue().size()),4, RoundingMode.HALF_UP) + .multiply(new BigDecimal(100)) .setScale(2, RoundingMode.HALF_UP).doubleValue(); TicketInfoStatisticVO workTicketStatistic = TicketInfoStatisticVO.builder() .ticketInfoType(ticketInfoType)