xucaiqin 4 mesi fa
parent
commit
cfe8c256d3

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

@@ -201,7 +201,7 @@ public interface TransportRemoteService {
     List<KwtLogisticsOrderAddressVo> queryByWOrderId(Long wayBillOrderId);
 
     List<WayContaractbillOrderVo> queryLogisticContractByContTradeIds(Set<Long> contractIds);
-    Long queryLogisticsCount();
+    Long queryLogisticsCount(Long entId,Integer type);
     Long queryWaybillCount();
     Long queryCount();
 

+ 21 - 8
sckw-modules/sckw-system/src/main/java/com/sckw/system/service/KwsMenuService.java

@@ -17,7 +17,9 @@ import com.sckw.core.utils.StringUtils;
 import com.sckw.core.web.constant.HttpStatus;
 import com.sckw.core.web.context.LoginUserHolder;
 import com.sckw.order.api.dubbo.TradeOrderInfoService;
+import com.sckw.system.api.model.dto.res.EntTypeResDto;
 import com.sckw.system.dao.*;
+import com.sckw.system.dubbo.RemoteBaseService;
 import com.sckw.system.model.*;
 import com.sckw.system.model.pojo.FindEntListPojo;
 import com.sckw.system.model.pojo.FindMenuTreePojo;
@@ -70,6 +72,8 @@ public class KwsMenuService {
     @DubboReference(version = "1.0.0", group = "design", check = false, timeout = 8000)
     private TransportRemoteService transportRemoteService;
 
+    @Autowired
+    private RemoteBaseService remoteBaseService;
     /**
      * @param params 实体
      * @desc: 添加新纪录
@@ -593,7 +597,7 @@ public class KwsMenuService {
                         List<FindEntListPojo> b = collect.get(ApprovalEnum.REFRESH.getCode());
                         child.setCount((CollUtil.isNotEmpty(a) ? a.size() : 0L) + (CollUtil.isNotEmpty(b) ? b.size() : 0L));
                         sum = sum + child.getCount();
-                        total = total+ child.getCount();
+                        total = total + child.getCount();
                     }
                 }
                 findMenuTreeResVo.setCount(sum);
@@ -609,14 +613,14 @@ public class KwsMenuService {
                             Long aLong = remoteContractService.queryTradeCount();
                             child.setCount(aLong);
                             sum = sum + aLong;
-                            total = total+ aLong;
+                            total = total + aLong;
                             continue;
                         }
                         if (StrUtil.equals(child.getName(), "物流合同") && hasPerm(child.getChildren(), "logisticsContract:sign")) {
                             Long aLong = remoteContractService.queryLogisticsCount();
                             child.setCount(aLong);
                             sum = sum + aLong;
-                            total = total+ aLong;
+                            total = total + aLong;
                         }
                     }
                 }
@@ -632,21 +636,30 @@ public class KwsMenuService {
                             Long aLong = tradeOrderInfoService.queryTradeCount();
                             child.setCount(aLong);
                             sum = sum + aLong;
-                            total = total+ aLong;
+                            total = total + aLong;
                             continue;
                         }
                         if (StrUtil.equals(child.getName(), "物流订单") && hasPerm(child.getChildren(), "logisticsOrder:add")) {
-                            Long aLong = transportRemoteService.queryLogisticsCount();
+                            Long entId = LoginUserHolder.getEntId();
+                            Long aLong = 0L;
+                            List<EntTypeResDto> entTypeResDtoList = remoteBaseService.queryEntTypeById(entId);
+                            if (CollectionUtils.isNotEmpty(entTypeResDtoList)) {
+                                EntTypeResDto entTypeResDto = entTypeResDtoList.get(0);
+                                Integer type = entTypeResDto.getType();
+                                if (Objects.nonNull(type) && !Objects.equals(type, 1)) {
+                                    aLong = transportRemoteService.queryLogisticsCount(entId, type);
+                                }
+                            }
                             child.setCount(aLong);
                             sum = sum + aLong;
-                            total = total+ aLong;
+                            total = total + aLong;
                             continue;
                         }
                         if (StrUtil.equals(child.getName(), "物流运单") && hasPerm(child.getChildren(), "waybillList:verification")) {
                             Long aLong = transportRemoteService.queryWaybillCount();
                             child.setCount(aLong);
                             sum = sum + aLong;
-                            total = total+ aLong;
+                            total = total + aLong;
                         }
 
                     }
@@ -655,7 +668,7 @@ public class KwsMenuService {
                 findMenuTreeResVo.setCount(sum);
             }
         }
-        return new MenuTreeCountResVo(total,tree);
+        return new MenuTreeCountResVo(total, tree);
     }
 
     private boolean hasPerm(List<FindMenuTreeResVo> children, String perm) {

+ 8 - 2
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/dubbo/TransportServiceImpl.java

@@ -1590,8 +1590,14 @@ public class TransportServiceImpl implements TransportRemoteService {
     }
 
     @Override
-    public Long queryLogisticsCount() {
-        OrderStatusStatisticsResp orderStatusStatisticsResp = logisticsConsignmentService.orderStatusStatistics(new QueryLogisticsOrderReq());
+    public Long queryLogisticsCount(Long entId,Integer type) {
+        QueryLogisticsOrderReq queryLogisticsOrderReq = new QueryLogisticsOrderReq();
+        if(Objects.equals(type,3)){
+            queryLogisticsOrderReq.setCarriageCompanyId(String.valueOf(entId));
+        }else {
+            queryLogisticsOrderReq.setConsignCompanyId(String.valueOf(entId));
+        }
+        OrderStatusStatisticsResp orderStatusStatisticsResp = logisticsConsignmentService.orderStatusStatistics(queryLogisticsOrderReq);
         List<OrderStatusStatisticsResp.OrderStatusStatistics> orderStatusStatistics = orderStatusStatisticsResp.getOrderStatusStatistics();
 
         if (CollUtil.isEmpty(orderStatusStatistics)) {