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 @@