소스 검색

多角色确认稽查时、bug

qzyReal 2 년 전
부모
커밋
8bda045b1c
1개의 변경된 파일10개의 추가작업 그리고 3개의 파일을 삭제
  1. 10 3
      sp-server/src/main/java/com/pj/project/tb_fee_details/TbFeeDetailsService.java

+ 10 - 3
sp-server/src/main/java/com/pj/project/tb_fee_details/TbFeeDetailsService.java

@@ -696,9 +696,12 @@ public class TbFeeDetailsService extends ServiceImpl<TbFeeDetailsMapper, TbFeeDe
 
     public void jiChaConfirm(List<Long> ids) {
         SpAdmin admin = StpUserUtil.getAdmin();
-        SpRole role = spRoleMapper.getById(Long.valueOf(admin.getRoleId()));
-        if (!StrUtil.equals(PersonEnum.JICHA.getDesc(), role.getName()) && !StrUtil.equals("admin", role.getType())) {
-            throw new BusinessException("无操作权限");
+        List<String>roleIds=StrUtil.splitTrim(admin.getRoleId(),",");
+        for (String roleId : roleIds) {
+            SpRole role = spRoleMapper.getById(Long.valueOf(roleId));
+            if (!StrUtil.equals(PersonEnum.JICHA.getDesc(), role.getName()) && !StrUtil.equals("admin", role.getType())) {
+                throw new BusinessException("无操作权限");
+            }
         }
         List<TbFeeDetails> detailsList = this.listByIds(ids);
         Set<String> days = new HashSet<>();
@@ -717,6 +720,10 @@ public class TbFeeDetailsService extends ServiceImpl<TbFeeDetailsMapper, TbFeeDe
 
     public void kaiDanConfirm(List<Long> ids) {
         SpAdmin admin = StpUserUtil.getAdmin();
+        SpRole role = spRoleMapper.getById(Long.valueOf(admin.getRoleId()));
+        if (!StrUtil.equals(PersonEnum.KAIDAN.getDesc(), role.getName()) && !StrUtil.equals("admin", role.getType())) {
+            throw new BusinessException("无操作权限");
+        }
         List<TbFeeDetails> detailsList = this.listByIds(ids);
         Set<String> days = new HashSet<>();
         for (TbFeeDetails detail : detailsList) {