Browse Source

20241220 付费码管理

lrj 9 months ago
parent
commit
971dd1ada8

+ 0 - 1
PCS/src/main/java/cn/cslg/permission/common/model/dto/PersonnelDTO.java

@@ -18,7 +18,6 @@ public class PersonnelDTO {
     private Integer expitrDays;
     private Integer id;
     private Long size;
-
     /**
      * 当前页数
      */

+ 11 - 11
PCS/src/main/java/cn/cslg/permission/service/RoleService.java

@@ -281,7 +281,7 @@ public class RoleService extends ServiceImpl<RoleMapper, Role> {
         if (roleList == null || roleList.size() == 0) {
             throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, "无权限访问数据");
         }
-        Role role = roleList.stream().filter(item -> item.getRoleType().equals(1)).findFirst().orElse(null);
+        Role role = roleList.stream().filter(item -> item.getRoleType().equals(1) || item.getRoleType().equals(3)).findFirst().orElse(null);
         if (role == null) {
             throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, "无权限访问数据");
         }
@@ -292,7 +292,7 @@ public class RoleService extends ServiceImpl<RoleMapper, Role> {
         List<Integer> personIds = new ArrayList<>();
         // 查询租户下的角色
         LambdaQueryWrapper<Role> queryWrapper = new LambdaQueryWrapper<>();
-        queryWrapper.eq(Role::getApplicationCode,ApplicationCode)
+        queryWrapper.eq(Role::getApplicationCode, ApplicationCode)
                 .eq(Role::getRoleType, 3);
         List<Role> roleList = this.list(queryWrapper);
         if (roleList != null && roleList.size() > 0) {
@@ -310,7 +310,7 @@ public class RoleService extends ServiceImpl<RoleMapper, Role> {
         List<Integer> personIds = new ArrayList<>();
         // 查询租户下的角色
         LambdaQueryWrapper<Role> queryWrapper = new LambdaQueryWrapper<>();
-        queryWrapper.eq(Role::getTenantId,tenantId)
+        queryWrapper.eq(Role::getTenantId, tenantId)
                 .eq(Role::getRoleType, 2);
         List<Role> roleList = this.list(queryWrapper);
         if (roleList != null && roleList.size() > 0) {
@@ -326,11 +326,11 @@ public class RoleService extends ServiceImpl<RoleMapper, Role> {
     public Integer checkCompanyRootRole() {
         Integer personId = loginUtils.getId();
         PersonnelVO personnelVO = cacheUtils.getLoginUser(personId);
-        List<Role> roleList = this.getRoleByPersonId(personId,null);
+        List<Role> roleList = this.getRoleByPersonId(personId, null);
         if (roleList == null || roleList.size() == 0) {
             throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, "无权限访问数据");
         }
-        Role role = roleList.stream().filter(item -> item.getRoleType().equals(1)||item.getRoleType().equals(2)).findFirst().orElse(null);
+        Role role = roleList.stream().filter(item -> item.getRoleType().equals(1) || item.getRoleType().equals(2) || item.getRoleType().equals(3)).findFirst().orElse(null);
         if (role == null) {
             throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, "无权限访问数据");
         }
@@ -344,15 +344,15 @@ public class RoleService extends ServiceImpl<RoleMapper, Role> {
         if (roleList == null || roleList.size() == 0) {
             throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, "无权限访问数据");
         }
-        List<Role> sysRoles = roleList.stream().filter(item -> item.getRoleType().equals(1) || item.getRoleType().equals(2)||item.getRoleType().equals(3)).collect(Collectors.toList());
+        List<Role> sysRoles = roleList.stream().filter(item -> item.getRoleType().equals(1) || item.getRoleType().equals(2) || item.getRoleType().equals(3)).collect(Collectors.toList());
         if (sysRoles == null) {
             throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, "无权限访问数据");
         }
-    Role role =  sysRoles.stream().filter(item->item.getRoleType().equals(1)||(item.getRoleType().equals(3)&&item.getApplicationCode()!=null&&item.getApplicationCode().equals(ApplicationCode))).findFirst().orElse(null);
-     Boolean flag =false;
-      if(role!=null){
-         flag=true;
-      }
+        Role role = sysRoles.stream().filter(item -> item.getRoleType().equals(1) || (item.getRoleType().equals(3) && item.getApplicationCode() != null && item.getApplicationCode().equals(ApplicationCode))).findFirst().orElse(null);
+        Boolean flag = false;
+        if (role != null) {
+            flag = true;
+        }
         return flag;
     }