wangliang 6 ヶ月 前
コミット
4cdddec0dd

+ 31 - 22
sop-api/src/main/java/com/qmth/sop/server/api/SysController.java

@@ -9,7 +9,6 @@ import com.google.gson.reflect.TypeToken;
 import com.qmth.boot.api.annotation.Aac;
 import com.qmth.boot.api.constant.ApiConstant;
 import com.qmth.boot.api.exception.ApiException;
-//import com.qmth.boot.core.cache.service.CacheService;
 import com.qmth.sop.business.bean.dto.*;
 import com.qmth.sop.business.bean.params.LoginParam;
 import com.qmth.sop.business.bean.result.*;
@@ -82,8 +81,8 @@ public class SysController {
     @Resource
     SysRoleService sysRoleService;
 
-//    @Resource
-//    CacheService cacheService;
+    //    @Resource
+    //    CacheService cacheService;
 
     @Resource
     TBServiceService tbServiceService;
@@ -484,25 +483,25 @@ public class SysController {
     @ApiResponses({ @ApiResponse(code = 200, message = "返回信息", response = Object.class) })
     public Result cacheClear(@ApiParam(value = "缓存值") @RequestParam(required = false) String endpoint,
             @ApiParam(value = "缓存key") @RequestParam(required = false) String key) {
-//        if (Objects.nonNull(endpoint) && Objects.nonNull(key)) {
-//            cacheService.evict(endpoint, key);
-//        } else if (Objects.nonNull(endpoint)) {
-//            cacheService.clear(endpoint);
-//        } else {
-//            cacheService.clear(SystemConstant.USER_ACCOUNT_CACHE);
-//            cacheService.clear(SystemConstant.SYS_CONFIG_CACHE);
-//            cacheService.clear(SystemConstant.USER_OAUTH_CACHE);
-//            cacheService.clear(SystemConstant.ORG_CACHE);
-//            cacheService.clear(SystemConstant.PRIVILEGE_URL_CACHE);
-//            cacheService.clear(SystemConstant.ROLE_PRIVILEGE_CACHE);
-//            cacheService.clear(SystemConstant.USER_ROLE_PRIVILEGE_CACHE);
-//            cacheService.clear(SystemConstant.FORM_WIDGET_CACHE);
-//            cacheService.clear(SystemConstant.TABLE_PROP_CACHE);
-//            cacheService.clear(SystemConstant.ROLE_CACHE);
-//            cacheService.clear(SystemConstant.USER_MENU_CACHE);
-//            cacheService.clear(SystemConstant.SCHOOL_CACHE);
-//            cacheService.clear(SystemConstant.SCHOOL_CODE_CACHE);
-//        }
+        //        if (Objects.nonNull(endpoint) && Objects.nonNull(key)) {
+        //            cacheService.evict(endpoint, key);
+        //        } else if (Objects.nonNull(endpoint)) {
+        //            cacheService.clear(endpoint);
+        //        } else {
+        //            cacheService.clear(SystemConstant.USER_ACCOUNT_CACHE);
+        //            cacheService.clear(SystemConstant.SYS_CONFIG_CACHE);
+        //            cacheService.clear(SystemConstant.USER_OAUTH_CACHE);
+        //            cacheService.clear(SystemConstant.ORG_CACHE);
+        //            cacheService.clear(SystemConstant.PRIVILEGE_URL_CACHE);
+        //            cacheService.clear(SystemConstant.ROLE_PRIVILEGE_CACHE);
+        //            cacheService.clear(SystemConstant.USER_ROLE_PRIVILEGE_CACHE);
+        //            cacheService.clear(SystemConstant.FORM_WIDGET_CACHE);
+        //            cacheService.clear(SystemConstant.TABLE_PROP_CACHE);
+        //            cacheService.clear(SystemConstant.ROLE_CACHE);
+        //            cacheService.clear(SystemConstant.USER_MENU_CACHE);
+        //            cacheService.clear(SystemConstant.SCHOOL_CACHE);
+        //            cacheService.clear(SystemConstant.SCHOOL_CODE_CACHE);
+        //        }
         return ResultUtil.ok(true);
     }
 
@@ -665,6 +664,16 @@ public class SysController {
             @ApiParam(value = "服务单元名称") @RequestParam(required = false) String name) {
         SysUser requestUser = (SysUser) ServletUtil.getRequestUser();
         DataPermissionDto dpr = sysUserService.buildUserDataPermission(requestUser.getId());
+        //TODO 财务角色暂时处理
+        List<SysRole> sysRoleList = sysUserRoleService.listRoleByUserId(requestUser.getId());
+        if (!CollectionUtils.isEmpty(sysRoleList)) {
+            List<SysRole> sysRoleTempList = sysRoleList.stream()
+                    .filter(s -> Objects.nonNull(s.getName()) && s.getName().trim().contains("财务"))
+                    .collect(Collectors.toList());
+            if (!CollectionUtils.isEmpty(sysRoleTempList)) {
+                dpr.setHasAdmin(true);
+            }
+        }
         return ResultUtil.ok(tbServiceService.queryServiceUnit(type, statusList, name, dpr));
     }
 

+ 1 - 1
sop-business/src/main/resources/mapper/TBServiceMapper.xml

@@ -67,7 +67,7 @@
                     #{item}
                 </foreach>
             </if>
-            <if test="dpr != null and !dpr.hasAdmin and !dpr.hasPmo and !dpr.hasAccountManager">
+            <if test="dpr != null and !dpr.hasAdmin and !dpr.hasPmo and !dpr.hasAccountManager and !dpr.hasDeviceDelivery">
                 <choose>
                     <when test="dpr.hasThirdPmo">
                         AND EXISTS (