Browse Source

多角色确认稽查时、bug

qzyReal 2 years ago
parent
commit
8bda045b1c

+ 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) {