Browse Source

Merge remote-tracking branch 'origin/dev_20260131' into dev_20260131

donglang 1 month ago
parent
commit
dd0180197c

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

@@ -168,16 +168,9 @@ public class AuthServiceImpl implements IAuthService {
         loginRes.setClientType(loginBase.getClientType());
         loginRes.setSystemType(loginBase.getSystemType());
         loginRes.setToken(token);
-        List<LoginResVo1.TabBarItem> tabBar = buildAppTabBar(loginBase, null,1,loginRes.getEntTypes());
+        List<LoginResVo1.TabBarItem> tabBar = buildAppTabBar(loginRes,loginBase, null,1,loginRes.getEntTypes());
         if (org.apache.commons.collections4.CollectionUtils.isNotEmpty(tabBar)) {
             loginRes.setTabBar(tabBar);
-            if (org.apache.commons.lang3.StringUtils.equals(loginRes.getEntTypes(), "1")  ) {
-                loginRes.setRoleName("供应商管理员");
-            } else if (org.apache.commons.lang3.StringUtils.equals(loginRes.getEntTypes(), "2")) {
-                 loginRes.setRoleName("采购商管理员");
-            }else if (org.apache.commons.lang3.StringUtils.equals(loginRes.getEntTypes(), "3")) {
-                 loginRes.setRoleName("物流商管理员");
-            }
         }
         applyAppModulePermissions(loginRes, loginBase, null);
         loginRes.setRefreshToken(refreshToken);
@@ -269,7 +262,7 @@ public class AuthServiceImpl implements IAuthService {
         loginRes.setDriverId(user.getDriverId());
         loginRes.setRoleName(user.getRoleName());
         loginRes.setRoleList(user.getRoleInfoDto());
-        List<LoginResVo1.TabBarItem> tabBar = buildAppTabBar(loginBase, user.getRoleName(),0,loginRes.getEntTypes());
+        List<LoginResVo1.TabBarItem> tabBar = buildAppTabBar(loginRes,loginBase, user.getRoleName(),0,loginRes.getEntTypes());
         if (org.apache.commons.collections4.CollectionUtils.isNotEmpty(tabBar)) {
             loginRes.setTabBar(tabBar);
         }
@@ -359,9 +352,10 @@ public class AuthServiceImpl implements IAuthService {
         loginRes.setRoleId(user.getRoleId());
         loginRes.setRoleName(user.getRoleName());
         loginRes.setRoleList(user.getRoleInfoDto());
-        List<LoginResVo1.TabBarItem> tabBar = buildAppTabBar(loginBase, user.getRoleName(),0,loginRes.getEntTypes());
+        List<LoginResVo1.TabBarItem> tabBar = buildAppTabBar(loginRes,loginBase, user.getRoleName(),0,loginRes.getEntTypes());
         if (org.apache.commons.collections4.CollectionUtils.isNotEmpty(tabBar)) {
             loginRes.setTabBar(tabBar);
+
         }
         applyAppModulePermissions(loginRes, loginBase, user.getRoleName());
         if (user.getSystemType().equals(SystemTypeEnum.MANAGE.getCode())) {
@@ -865,7 +859,7 @@ public class AuthServiceImpl implements IAuthService {
         loginRes.setToken(newToken);
         loginRes.setRefreshToken(newRefreshToken);
         loginRes.setDriverId(driver.getId());
-        List<LoginResVo1.TabBarItem> tabBar = buildAppTabBar(loginBase, null,1,loginRes.getEntTypes());
+        List<LoginResVo1.TabBarItem> tabBar = buildAppTabBar(loginRes,loginBase, null,1,loginRes.getEntTypes());
         if (org.apache.commons.collections4.CollectionUtils.isNotEmpty(tabBar)) {
             loginRes.setTabBar(tabBar);
         }
@@ -903,7 +897,7 @@ public class AuthServiceImpl implements IAuthService {
         loginRes.setDriverId(user.getDriverId());
         loginRes.setRoleName(user.getRoleName());
         loginRes.setRoleList(user.getRoleInfoDto());
-        List<LoginResVo1.TabBarItem> tabBar = buildAppTabBar(loginBase, user.getRoleName(),1,loginRes.getEntTypes());
+        List<LoginResVo1.TabBarItem> tabBar = buildAppTabBar(loginRes,loginBase, user.getRoleName(),1,loginRes.getEntTypes());
         if (org.apache.commons.collections4.CollectionUtils.isNotEmpty(tabBar)) {
             loginRes.setTabBar(tabBar);
         }
@@ -925,6 +919,7 @@ public class AuthServiceImpl implements IAuthService {
     }
 
     private void applyAppModulePermissions(LoginResVo1 loginRes, LoginBase loginBase, String roleName) {
+        roleName = loginRes.getRoleName();
         loginRes.setShowOrderStatisticsModule(Boolean.FALSE);
         loginRes.setShowSalesStatisticsModule(Boolean.FALSE);
         loginRes.setShowWalletModule(Boolean.FALSE);
@@ -933,9 +928,9 @@ public class AuthServiceImpl implements IAuthService {
         if (!isAppLogin(loginBase) || StringUtils.isBlank(roleName)) {
             return;
         }
-        boolean isSeller = containsAnyRole(roleName, "销售");
+        boolean isSeller = containsAnyRole(roleName, "销售","供应商管理员");
         boolean isFinance = containsAnyRole(roleName, "财务");
-        boolean isPurchase = containsAnyRole(roleName, "采购", "买家");
+        boolean isPurchase = containsAnyRole(roleName, "采购", "买家","采购商管理员");
         if (isSeller) {
             loginRes.setShowOrderStatisticsModule(Boolean.TRUE);
             loginRes.setShowSalesStatisticsModule(Boolean.TRUE);
@@ -967,7 +962,8 @@ public class AuthServiceImpl implements IAuthService {
         return false;
     }
 
-    private List<LoginResVo1.TabBarItem> buildAppTabBar(LoginBase loginBase, String roleName,int flag,  String entTypeNames) {
+    private List<LoginResVo1.TabBarItem> buildAppTabBar(LoginResVo1 loginRes,LoginBase loginBase, String roleName,int flag,  String entTypeNames) {
+       log.info("当前用户角色:{}, 企业类型:{}", roleName, entTypeNames);
         if (!isAppLogin(loginBase)) {
             return List.of();
         }
@@ -1005,12 +1001,16 @@ public class AuthServiceImpl implements IAuthService {
             return buildLogisticsTabBar();
         }
         if (isSupplierAdmin){
+            loginRes.setRoleName("供应商管理员");
             return buildSupplierAdminTabBar();
         }
         if (isLogisticsAdmin){
+            loginRes.setRoleName("物流商管理员");
             return buildLogisticsAdminTabBar();
         }
         if (isPurchaseAdmin){
+            log.info("用户角色包含系统管理员且企业属性为采购商,返回采购管理员TabBar");
+            loginRes.setRoleName("采购商管理员");
             return buildPurchaseAdminTabBar();}
         return List.of();
     }

+ 11 - 1
sckw-modules/sckw-contract/src/main/java/com/sckw/contract/model/vo/res/QueryLogisticDetailResp.java

@@ -170,7 +170,17 @@ public class QueryLogisticDetailResp implements Serializable {
         @Schema(description = "合同状态描述")
         private String contractStatusDesc;
 
-
+        /**
+         * 结算方式 (1普通结算,2预付制结算)
+         */
+        @NotNull(message = "结算方式不能为空")
+        @Schema(description = "结算方式 (1普通结算,2记账模式)")
+        private Integer settlement;
+        /**
+         * 结算方式描述
+         */
+        @Schema(description = "结算方式描述")
+        private String settlementDesc;
     }
     @Data
     public static class TradeGoodsInfo implements Serializable{

+ 2 - 0
sckw-modules/sckw-contract/src/main/java/com/sckw/contract/service/operateService/KwcContractLogisticsService.java

@@ -1600,6 +1600,8 @@ public class KwcContractLogisticsService {
         tradeBaseInfo.setCommonPrice(logistics.getCommonPrice().compareTo(new BigDecimal("0.00"))==0 ? null: logistics.getCommonPrice());
         tradeBaseInfo.setContractStatus(String.valueOf(logistics.getStatus()));
         tradeBaseInfo.setContractStatusDesc(ContractStatusEnum.getNameByCode(logistics.getStatus()));
+        tradeBaseInfo.setSettlement(logistics.getSettlement());
+        tradeBaseInfo.setSettlementDesc(Objects.equals(1, logistics.getSettlement()) ? "普通结算" : "记账模式");
 
 
         queryLogisticListResp.setBaseInfo(tradeBaseInfo);