From fac1f8dca8f60ba05094204b26e9c277080372eb Mon Sep 17 00:00:00 2001 From: "2265829957@qq.com" <2265829957@qq.com> Date: Wed, 25 Feb 2026 23:07:53 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B7=A1=E6=A3=80=E9=A6=96=E9=A1=B5=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../order/mapper/XhpcInspectionMapper.java | 2 +- .../impl/XhpcInspectionServiceImpl.java | 20 ++++++++++++------- .../resources/mapper/XhpcInspectionMapper.xml | 16 +++++++-------- 3 files changed, 22 insertions(+), 16 deletions(-) diff --git a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/mapper/XhpcInspectionMapper.java b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/mapper/XhpcInspectionMapper.java index dd28b4b8..9711f334 100644 --- a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/mapper/XhpcInspectionMapper.java +++ b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/mapper/XhpcInspectionMapper.java @@ -29,7 +29,7 @@ public interface XhpcInspectionMapper { int stationSum(); - int abnormalStation(@Param("time") String time); + Integer abnormalStation(@Param("time") String time); int todayOrder(@Param("time") String time); diff --git a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcInspectionServiceImpl.java b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcInspectionServiceImpl.java index 29caf352..2708cf7e 100644 --- a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcInspectionServiceImpl.java +++ b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcInspectionServiceImpl.java @@ -261,18 +261,24 @@ public class XhpcInspectionServiceImpl implements IXhpcInspectionService { int stationSum = xhpcInspectionMapper.stationSum(); map1.put("stationSum",stationSum); String today = DateUtil.today(); - int abnormalStation = xhpcInspectionMapper.abnormalStation(today); - map1.put("abnormalStation",abnormalStation); - + Integer abnormalStation = xhpcInspectionMapper.abnormalStation(today); + if(abnormalStation==null){ + map1.put("abnormalStation",0); + }else{ + map1.put("abnormalStation",abnormalStation); + } int todayOrder = xhpcInspectionMapper.todayOrder(today); map1.put("todayOrder",todayOrder); int emptyOrderRate = xhpcInspectionMapper.emptyOrderRate(today); - double result = (double) todayOrder / emptyOrderRate; - String formatted = String.format("%.2f", result); - map1.put("emptyOrderRate",formatted); - + if(emptyOrderRate==0){ + map1.put("emptyOrderRate",0); + }else{ + double result = (double) todayOrder / emptyOrderRate; + String formatted = String.format("%.2f", result); + map1.put("emptyOrderRate",formatted); + } String completionRate = xhpcInspectionMapper.completionRate(today); map1.put("completionRate",completionRate); diff --git a/xhpc-modules/xhpc-order/src/main/resources/mapper/XhpcInspectionMapper.xml b/xhpc-modules/xhpc-order/src/main/resources/mapper/XhpcInspectionMapper.xml index 4b0af612..d7354609 100644 --- a/xhpc-modules/xhpc-order/src/main/resources/mapper/XhpcInspectionMapper.xml +++ b/xhpc-modules/xhpc-order/src/main/resources/mapper/XhpcInspectionMapper.xml @@ -367,11 +367,11 @@ @@ -381,12 +381,12 @@