15928045575 2 роки тому
батько
коміт
35082cb72d

+ 12 - 0
sckw-modules/sckw-system/src/main/java/com/sckw/system/service/KwsRoleService.java

@@ -2,6 +2,7 @@ package com.sckw.system.service;
 
 import java.util.Date;
 
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import com.sckw.core.exception.SystemException;
@@ -262,6 +263,16 @@ public class KwsRoleService {
                 }
             }
         }
+        //删除kws_authority表数据
+        List<KwsAuthority> kwsAuthorityList = kwsAuthorityDao.selectByRoleIds(Collections.singletonList(kwsRole.getId()));
+        if (CollectionUtils.isNotEmpty(kwsAuthorityList)) {
+            for (KwsAuthority kwsAuthority : kwsAuthorityList) {
+                kwsAuthority.setDelFlag(Global.YES);
+                if (kwsAuthorityDao.update(kwsAuthority) <= 0) {
+                    throw new SystemException(HttpStatus.CRUD_FAIL_CODE, HttpStatus.UPDATE_FAIL);
+                }
+            }
+        }
 
         KwsDept kwsDept = kwsDeptDao.selectByKey(kwsRole.getDeptId());
 
@@ -278,6 +289,7 @@ public class KwsRoleService {
         if (kwsRoleDao.update(kwsRoleTable) <= 0) {
             throw new SystemException(HttpStatus.CRUD_FAIL_CODE, HttpStatus.INSERT_FAIL);
         }
+        saveAuthority(reqVo.getId(), reqVo.getDeptIds());
 //        List<KwsUser> kwsUsers = kwsUserDao.selectByRoleIds(Collections.singletonList(reqVo.getId()));
 //
 //        //删除以前的角色

+ 1 - 0
sckw-modules/sckw-system/src/main/resources/mapper/KwsEnterpriseDao.xml

@@ -184,6 +184,7 @@
     <include refid="Base_Column_List" />
     from kws_enterprise
     where del_flag = 0
+    and approval = 1
     <if test="list != null and list.size() > 0">
       and id in
       <foreach collection="list" item="item" open="(" close=")" separator=",">