Explorar el Código

Merge remote-tracking branch 'origin/master'

hgw hace 3 años
padre
commit
db973911d7

+ 13 - 0
cooleshow-mall/mall-admin/src/main/java/com/yonge/cooleshow/admin/service/impl/OmsOrderServiceImpl.java

@@ -186,15 +186,24 @@ public class OmsOrderServiceImpl implements OmsOrderService {
     public HomeStatistical countStatistical() {
         // 订单状态
         HomeStatistical homeStatistical = orderDao.selectOrderStatusNum();
+        if (homeStatistical == null) {
+            homeStatistical = new HomeStatistical();
+        }
 
         // 缺货登记   库存紧张
         HomeStatistical stock = productService.countLowStockCount();
+        if (stock == null) {
+            stock = new HomeStatistical();
+        }
 
         homeStatistical.setOutStock(stock.getOutStock());
         homeStatistical.setOutStockProduct(stock.getOutStockProduct());
 
         // 待处理退款申请  待处理退货订单
         HomeStatistical returnInfo = orderReturnApplyService.countReturnStatus();
+        if (returnInfo == null) {
+            returnInfo = new HomeStatistical();
+        }
 
         homeStatistical.setWaitDisposeRefund(returnInfo.getWaitDisposeRefund());
         homeStatistical.setWaitDisposeRefundOrder(returnInfo.getWaitDisposeRefundOrder());
@@ -202,6 +211,10 @@ public class OmsOrderServiceImpl implements OmsOrderService {
         // 已下架 已上架 全部商品
         HomeStatistical product = productService.countProductShowStatus();
 
+        if (product == null) {
+            product = new HomeStatistical();
+        }
+
         homeStatistical.setShelves(product.getShelves());
         homeStatistical.setDelisted(product.getDelisted());
         homeStatistical.setProductNum(product.getProductNum());