Przeglądaj źródła

工作台统计接口空判断

lengfaqiang 2 lat temu
rodzic
commit
e96d896584

+ 6 - 8
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/service/dubbo/TransportStatisticsServiceImpl.java

@@ -1,7 +1,6 @@
 package com.sckw.transport.service.dubbo;
 
 import com.sckw.core.common.enums.NumberConstant;
-import com.sckw.core.exception.BusinessException;
 import com.sckw.core.model.enums.CarWaybillEnum;
 import com.sckw.core.model.enums.LogisticsOrderEnum;
 import com.sckw.transport.api.dubbo.TransportStatisticsService;
@@ -14,7 +13,6 @@ import org.springframework.util.CollectionUtils;
 
 import java.util.ArrayList;
 import java.util.List;
-import java.util.Objects;
 
 /**
  * @author lfdc
@@ -40,9 +38,9 @@ public class TransportStatisticsServiceImpl implements TransportStatisticsServic
     @Override
     public Integer statisticsWaybillSendCar(Long topEntId) {
         Integer returnCount = 0;
-        if (Objects.isNull(topEntId)) {
-            throw new BusinessException("请求参数不能为空");
-        }
+//        if (Objects.isNull(topEntId)) {
+//            throw new BusinessException("请求参数不能为空");
+//        }
         List<Long> ids = logisticsOrderMapper.statisticsLogistics(topEntId);
         if (CollectionUtils.isEmpty(ids)) {
             return returnCount;
@@ -70,9 +68,9 @@ public class TransportStatisticsServiceImpl implements TransportStatisticsServic
     @Override
     public Integer statisticsPendingVerificationWaybill(Long topEntId) {
         Integer returnCount = 0;
-        if (Objects.isNull(topEntId)) {
-            throw new BusinessException("请求参数不能为空");
-        }
+//        if (Objects.isNull(topEntId)) {
+//            throw new BusinessException("请求参数不能为空");
+//        }
         List<Long> ids = logisticsOrderMapper.statisticsLogistics(topEntId);
         if (CollectionUtils.isEmpty(ids)) {
             return returnCount;

+ 6 - 2
sckw-modules/sckw-transport/src/main/resources/mapper/KwtLogisticsOrderMapper.xml

@@ -1830,7 +1830,9 @@
                  LEFT JOIN kwt_logistics_order_unit b ON b.l_order_id = a.id
         WHERE a.del_flag = 0
           AND b.del_flag = 0
-          AND (b.ent_id = #{topEntId} OR b.top_ent_id = #{topEntId})
+        <if test="topEntId != null and topEntId != ''">
+            AND (b.ent_id = #{topEntId} OR b.top_ent_id = #{topEntId})
+        </if>
     </select>
 
     <select id="statisticsLogisticsByTopEntIdAndOrderStatus" resultType="java.lang.Integer">
@@ -1842,7 +1844,9 @@
         WHERE
         a.del_flag = 0
         AND b.del_flag = 0
-        AND ( b.ent_id = #{topEntId} OR b.top_ent_id = #{topEntId} )
+        <if test="topEntId != null and topEntId != ''">
+            AND ( b.ent_id = #{topEntId} OR b.top_ent_id = #{topEntId} )
+        </if>
         And a.status in
         <foreach collection="orderList" open="(" close=")" separator="," item="item">
             #{item}