chenxiaofei 2 месяцев назад
Родитель
Сommit
66b77dee0a

+ 19 - 7
sckw-auth/src/main/java/com/sckw/auth/service/impl/AuthServiceImpl.java

@@ -71,12 +71,8 @@ public class AuthServiceImpl implements IAuthService {
         /*运营端/企业端登录(PC/APP)*/
         if (loginBase.getSystemType() == SystemTypeEnum.MANAGE.getCode()
                 || loginBase.getSystemType() == SystemTypeEnum.COMPANY.getCode()) {
-            KwsUserResDto kwsUserResDto = systemService.queryByAccount(loginBase.getAccount());
-            if (Objects.nonNull(kwsUserResDto)) {
-                loginBase.setSystemType(SystemTypeEnum.COMPANY.getCode());
-                return this.commonAuth(loginBase);
-            }
-            return this.driverAuth(loginBase);
+           // KwsUserResDto kwsUserResDto = systemService.queryByAccount(loginBase.getAccount());
+            return this.commonAuth(loginBase);
         }
 
         /*司机端*/
@@ -917,6 +913,7 @@ public class AuthServiceImpl implements IAuthService {
         boolean isDoorKeeper = StringUtils.isNotBlank(roleName) && roleName.contains("门卫");
         boolean isForkliftDriver = StringUtils.isNotBlank(roleName) && roleName.contains("铲车司机");
         boolean isBuyer = StringUtils.isNotBlank(roleName) && roleName.contains("买家");
+        boolean isDriver = StringUtils.isNotBlank(roleName) && roleName.contains("司机");
         if (isDoorKeeper) {
             return buildDoorKeeperTabBar();
         }
@@ -926,10 +923,13 @@ public class AuthServiceImpl implements IAuthService {
         if (isBuyer) {
             return buildBuyerTabBar();
         }
+        if (isDriver){
+            return buildDefaultDriverTabBar();
+        }
         if (flag == 1) {
             return buildDefaultDriverTabBar();
         }
-        if (flag == 0 && !isDoorKeeper && !isForkliftDriver && !isBuyer){
+        if (flag == 0 && !isDoorKeeper && !isForkliftDriver && !isBuyer && !isDriver){
             return buildBuyerTabBar();
         }
         return List.of();
@@ -949,6 +949,18 @@ public class AuthServiceImpl implements IAuthService {
                 "/static/tabbar/trade.png",
                 "/pages/tradeOrder/index"
         ));
+        items.add(buildTabBarItem(
+                "物流订单",
+                "/static/tabbar/logOrder_select.png",
+                "/static/tabbar/logOrder.png",
+                "/pages/logistics/order/index"
+        ));
+        items.add(buildTabBarItem(
+                "物流运单",
+                "/static/tabbar/waybill_select.png",
+                "/static/tabbar/waybill.png",
+                "/pages/logistics/waybill/index"
+        ));
         items.add(buildTabBarItem(
                 "个人中心",
                 "/static/tabbar/my_select.png",

+ 12 - 1
sckw-modules/sckw-order/src/main/java/com/sckw/order/serivce/KwoTradeOrderService.java

@@ -87,6 +87,7 @@ import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.dubbo.config.annotation.DubboReference;
 import org.jetbrains.annotations.NotNull;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.cloud.stream.function.StreamBridge;
 import org.springframework.stereotype.Service;
@@ -136,7 +137,8 @@ public class KwoTradeOrderService {
     @DubboReference(version = "1.0.0", group = "design", check = false, timeout = 6000)
     protected RemoteFleetService remoteFleetService;
 
-    private final OfflineWalletFeignService offlineWalletFeignService;
+    @Autowired(required = false)
+    private OfflineWalletFeignService offlineWalletFeignService;
 
     private final KwoTradeOrderMapper kwoTradeOrderMapper;
     private final StreamBridge streamBridge;
@@ -2185,6 +2187,9 @@ public class KwoTradeOrderService {
     }
 
     private void walletFreeze(TradeOrderParam tradeOrderParam, KwoTradeOrder order,WalletFreezeDto freezeDto) {
+        if (offlineWalletFeignService == null) {
+            throw new BusinessException("线下钱包服务未配置,无法执行冻结操作");
+        }
 
         freezeDto.setFreezeAmount(tradeOrderParam.getAmount());
         freezeDto.setOrderNo(order.getTOrderNo());
@@ -2206,6 +2211,9 @@ public class KwoTradeOrderService {
     }
 
     private void checkWallet(KwoTradeOrder order) {
+        if (offlineWalletFeignService == null) {
+            throw new BusinessException("线下钱包服务未配置,无法查询余额");
+        }
         BaseResult<BigDecimal> balanceResult;
         try {
             balanceResult = offlineWalletFeignService.queryPrepaidBalance(LoginUserHolder.getEntId());
@@ -2256,6 +2264,9 @@ public class KwoTradeOrderService {
          freezeDto.setFreezeAmount(param.getFreezeAmount());
          freezeDto.setOrderNo(order.getTOrderNo());
 
+        if (offlineWalletFeignService == null) {
+            throw new BusinessException("线下钱包服务未配置,无法执行解冻操作");
+        }
         BaseResult<Boolean> balanceResult;
         try {
             balanceResult = offlineWalletFeignService.unfreezeBalance(freezeDto);