TRX 1 рік тому
батько
коміт
2657cbd81b

+ 2 - 1
FullCardServer/src/main/java/com/zhongshu/card/server/core/service/paySetting/ProjectPaySettingServiceImpl.java

@@ -563,6 +563,7 @@ public class ProjectPaySettingServiceImpl extends SuperService {
         fields.add(PayConfigField.builder().name("多应用类型").key("withdrawAppType").type(PayFieldType.Str).isMust(Boolean.TRUE).maxLength(100).payShowField(mainFiled).build());
         fields.add(PayConfigField.builder().name("提现通知地址").key("withdrawNotify").type(PayFieldType.Str).isMust(Boolean.FALSE).payShowField(mainFiled).build());
 
+
         return fields;
     }
 
@@ -684,7 +685,7 @@ public class ProjectPaySettingServiceImpl extends SuperService {
                 appConf.setSysSource(model.getSysSource());
                 appConf.setSysSourceNo(model.getSysSourceNo());
 
-                // 退款
+                // 提现
                 appConf.setWithdrawAppId(model.getWithdrawAppId());
                 appConf.setWithdrawAppKey(model.getWithdrawAppKey());
                 appConf.setWithdrawSysId(model.getWithdrawSysid());

+ 29 - 1
FullCardServer/src/main/java/com/zhongshu/card/server/core/service/user/RoleServiceImpl.java

@@ -31,6 +31,7 @@ import com.zhongshu.card.server.core.domain.org.OrganizationUser;
 import com.zhongshu.card.server.core.domain.org.Role;
 import com.zhongshu.card.server.core.domain.org.UserAccount;
 import com.zhongshu.card.server.core.service.base.SuperService;
+import com.zhongshu.card.server.core.service.org.OrganizationServiceImpl;
 import com.zhongshu.card.server.core.util.AesUtils;
 import com.zhongshu.card.server.core.util.BeanUtils;
 import com.zhongshu.card.server.core.util.CommonUtil;
@@ -73,6 +74,9 @@ public class RoleServiceImpl extends SuperService {
     @Autowired
     private OrganizationUserDao organizationUserDao;
 
+    @Autowired
+    private OrganizationServiceImpl organizationService;
+
 
     /**
      * 添加/编辑角色
@@ -484,7 +488,14 @@ public class RoleServiceImpl extends SuperService {
      * @return
      */
     public ResultContent getCurrentUserProjectAuth(String projectOid) {
-        Set<String> auths = getUserProjectAllAuths(projectOid, getCurrentUserId());
+        String userId = getCurrentUserId();
+        Set<String> auths = getUserProjectAllAuths(projectOid, userId);
+        // 得到平台的权限
+        Organization organization = organizationService.getPlatForm();
+        Set<String> platFormAuths = getUserOrgAllAuths(organization, userId);
+        if (platFormAuths != null && !platFormAuths.isEmpty()) {
+            auths.addAll(platFormAuths);
+        }
         return ResultContent.buildSuccess(AesUtils.encryptAuth(auths));
     }
 
@@ -507,6 +518,23 @@ public class RoleServiceImpl extends SuperService {
         return auth;
     }
 
+    public Set<String> getUserOrgAllAuths(Organization organization, String userId) {
+        Set<String> auth = new HashSet<>();
+        if (StringUtils.isEmpty(userId)) {
+            return auth;
+        }
+        UserAccount userAccount = userCountDao.findTopByUserId(userId);
+        if (ObjectUtils.isEmpty(userAccount)) {
+            return auth;
+        }
+        OrganizationUser organizationUser = organizationUserDao.findTopByOrganizationAndUser(organization, userAccount);
+        if (ObjectUtils.isEmpty(organizationUser)) {
+            return auth;
+        }
+        auth.addAll(getOrganizationUserAuths(organizationUser));
+        return auth;
+    }
+
     /**
      * 得到机构用户数据权限
      *