Kaynağa Gözat

首页大屏运单统计优化

donglang 12 saat önce
ebeveyn
işleme
b5b0882854

+ 3 - 0
sckw-modules-api/sckw-transport-api/src/main/java/com/sckw/transport/api/dubbo/TransportRemoteService.java

@@ -205,6 +205,9 @@ public interface TransportRemoteService {
     List<WayContaractbillOrderVo> queryLogisticContractByContTradeIds(Set<Long> contractIds);
     Long queryLogisticsCount(Long entId,Integer type);
     Long queryWaybillCount();
+
+    Long queryWaybillCount(Long entId);
+
     Long queryCount();
 
     List<LogisticsVo> logisticsList();

+ 4 - 1
sckw-modules/sckw-system/src/main/java/com/sckw/system/service/KwsMenuService.java

@@ -1081,7 +1081,10 @@ public class KwsMenuService {
                             continue;
                         }
                         if (StrUtil.equals(child.getName(), "物流运单") && hasPerm(child.getChildren(), "waybillList:verification")) {
-                            Long aLong = transportRemoteService.queryWaybillCount();
+
+                            Long entId =LoginUserHolder.getEntId();
+
+                            Long aLong = transportRemoteService.queryWaybillCount(entId);
                             child.setCount(aLong);
                             sum = sum + aLong;
                             total = total + aLong;

+ 15 - 0
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/dubbo/TransportServiceImpl.java

@@ -1634,6 +1634,21 @@ public class TransportServiceImpl implements TransportRemoteService {
 
     }
 
+    @Override
+    public Long queryWaybillCount(Long entId) {
+        log.info("开始统计物流运单信息!");
+        WaybillOrderReq req = new WaybillOrderReq();
+        req.setNewEntId(entId);
+        StatisticsWaybillResp statisticsWaybillResp = waybillOrderV1Service.statisticsWaybillOrder(req);
+        List<StatisticsWaybillResp.OrderBillStatusStatistics> orderStatusStatistics = statisticsWaybillResp.getOrderStatusStatistics();
+        if (CollUtil.isEmpty(orderStatusStatistics)) {
+            return 0L;
+        }
+        Optional<StatisticsWaybillResp.OrderBillStatusStatistics> first = orderStatusStatistics.stream().filter(d -> StrUtil.equals(d.getOrderStatus(), "20")).findFirst();
+        return first.map(contractStatusCount -> Long.parseLong(contractStatusCount.getOrderNum())).orElse(0L);
+
+    }
+
     @Override
     public Long queryCount() {
         List<Long> ids = new ArrayList<>();

+ 7 - 0
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/model/param/WaybillOrderReq.java

@@ -102,4 +102,11 @@ public class WaybillOrderReq extends PageReq implements Serializable {
      */
     @Schema(description = "状态")
     private String status;
+
+    /**
+     * 远程调用专业企业id
+     */
+    @Schema(description = "远程调用专业企业id")
+    private Long newEntId;
+
 }

+ 4 - 0
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/service/KwtWaybillOrderV1Service.java

@@ -5635,6 +5635,10 @@ public class KwtWaybillOrderV1Service {
         Long entId =LoginUserHolder.getEntId();
        // entIds.add(entId);
         log.debug("获取企业ID集合: {}", entIds);
+
+        if (entId == null) {
+            entId = req.getNewEntId();
+        }
         Set<Long> logOrderIds = getLogOrderIds(req, entIds,entId);
         // 应用数据权限过滤:个人数据权限与企业层级数据权限为并集关系
         logOrderIds = applyDataPermissionFilterToLogOrderIds(logOrderIds);