ludc
2024-01-24 c327574106f470c72638e9f34c7f8cd26d78a2bf
分类授权,数据授权接口修改
已修改9个文件
已添加1个文件
427 ■■■■■ 文件已修改
Source/UBCS-WEB/src/api/system/classifyAuth.js 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/components/Master/MasterTree.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/components/Theme/ClassifyAuthDialog.vue 172 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/components/Theme/DataAuthDialog.vue 155 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS/ubcs-service-api/ubcs-system-api/src/main/java/com/vci/ubcs/system/dto/ClassifyAuthDTO.java 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/CodeClassifyServiceImpl.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS/ubcs-service/ubcs-code/src/main/resources/mapper/CodeCLassifyMapper.xml 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/controller/ClassifyAuthController.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/service/IClassifyAuthService.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/service/impl/ClassifyAuthServiceImpl.java 27 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/api/system/classifyAuth.js
@@ -12,9 +12,10 @@
export const saveOrUpdate = (data) => {
    return request({
      headers:{'Content-Type':'application/json'},
      url: '/api/ubcs-system/classifyAuth/saveOrUpdate',
      method: 'post',
      data: data
      data: JSON.stringify(data)
    })
}
Source/UBCS-WEB/src/components/Master/MasterTree.vue
@@ -57,7 +57,7 @@
        delBtn: false,
        defaultExpandAll: false,
        menu: false,
        lazy: true,
        // lazy: true,
        treeLoad: (node, resolve) => {
          if (node.data != false) {
            const parentId = (node.level === 0) ? 0 : node.data.oid;
@@ -214,7 +214,7 @@
    //树点击事件
    async nodeClick(data) {
      try {
        // console.log(data)
        console.log(data)
        this.TreeValue = data.label.split("</span>")[1].trim();
        // console.log('TreeValue',this.TreeValue)
        this.$emit('TreeValue', this.TreeValue)
Source/UBCS-WEB/src/components/Theme/ClassifyAuthDialog.vue
@@ -137,76 +137,7 @@
    visible() {
      if (this.visible) {
        this.isShowDialog = this.visible;
        return new Promise((resolve, reject) => {
          getButtonByParentCode({ code: "classifyTree" })
            .then((res) => {
              // è®°å½•按钮数据
              this.classifyAuthButton = res.data.data;
              const list = res.data.data;
              let tempData = [];
              // è§’色列
              tempData.push({
                label: "角色",
                prop: "roleData",
                type: "select",
                width: 150,
              });
              // ç¼–码项分类授权
              tempData.push({
                label: "编码项分类授权",
                prop: "classifyItem",
                type: "text",
                width: 180,
              });
              list.forEach((item) => {
                let columnItem = {
                  label: item.name,
                  prop: item.id,
                  code: item.code,
                  type: "checkbox",
                  width: 180,
                };
                tempData.push(columnItem);
              });
              this.classifyAuthHeader = tempData;
              resolve();
            })
            .catch((err) => {
              reject(err);
            });
          // èŽ·å–è§’è‰²åˆ—è¡¨
          getPage(1, -1, null).then((res) => {
            this.roleList = res.data.data.records;
          });
          // èŽ·å–è¯¥åˆ†ç±»ä¸‹å·²æŽˆæƒçš„åˆ†ç±»æŽˆæƒä¿¡æ¯
          getClassifyAuthList({
            classifyId: this.classifyData.oid,
            authType: "classify_auth",
          }).then((res) => {
            //console.log(res.data.data);
            let authDatas = res.data.data;
            if (authDatas.length > 0) {
              authDatas.forEach((authData, index) => {
                let item = {
                  oid: authData.oid,
                  roleData: authData.roleId,
                  classifyItem: this.classifyData.label,
                  authButton:{},
                  index: index,
                  uuid: uuidv4(), //生成唯一的id
                };
                //将按钮设置进去
                authData.buttonIdList.forEach((data) => {
                  Vue.set(item, data, true);
                });
                this.classifyAuthData.push(item);
                this.addIndex = this.classifyAuthData.length - 1; //添加行下标等于classifyAuthData的长度-1
                this.roleHandlerMethods(authData.roleId, "create", index);
                // console.log('index', index)
              });
            }
          });
        });
        this.loadAuthPage();
      }
    },
  },
@@ -215,7 +146,6 @@
      if (this.classifyAuthData.length < 0) {
        return;
      }
      getButtonsByRoleId({ roleId: id, code: "classifyTree" }).then((res) => {
        // æ‰¾åˆ°this.classifyAuthButton中没有对应的属性
        const filteredItems = this.classifyAuthButton.filter((item) => {
@@ -344,12 +274,14 @@
      this.selectList = list;
    },
    // ä¿å­˜åˆ†ç±»æŽˆæƒä¿¡æ¯
    submit() {
      if (this.classifyAuthData.length <= 0) {
        this.$message.warning("授权列表为空!");
        return;
      }
    async submit() {
      let form = {
        classifyAuthList: [],
        isCLear: false, //默认是清空
        classifyId: this.classifyData.oid,
      };
      let isRepeat = false;
      if(this.classifyAuthData.length > 0){
      // éåŽ†æ•°ç»„ï¼Œæ¯”è¾ƒåŽé¢çš„å¯¹è±¡çš„roleData是否与前面的对象相等
      for (let i = 0; i < this.classifyAuthData.length - 1; i++) {
        let currentRoleId = this.classifyAuthData[i].roleData;
@@ -363,11 +295,12 @@
          break;
        }
      }
      if (isRepeat) {
        this.$message.warning("角色和分类已经存在,请重新配置!");
        return;
      }
      let form = [];
      let flag = false;
      this.classifyAuthData.forEach((item) => {
        let itemButtonList = [];
@@ -390,15 +323,19 @@
          buttonIds: itemButtonList.join(","),
          authType: "classify_auth",
        };
        form.push(data);
          form.classifyAuthList.push(data);
      });
      if (flag) {
        this.$message.warning("有未勾选操作的权限,不允许授权");
        return;
      }
      // console.log(form)
      }else {
        // ä¸ºç©ºè¯æ˜Žæ˜¯æ¸…空授权列表
        form.isCLear = true;
      }
      // console.log(JSON.stringify(form))
      // è°ƒç”¨ä¿å­˜åˆ†ç±»æŽˆæƒçš„æŽ¥å£
      saveOrUpdate(form).then(
      await saveOrUpdate(form).then(
        (res) => {
          this.$message({
            type: "success",
@@ -410,6 +347,8 @@
          window.console.log(error);
        }
      );
      this.classifyAuthData = [];
      this.loadAuthPage();
    },
    // å…¨é€‰æŒ‰é’®
    selectAllButton() {
@@ -423,6 +362,79 @@
      });
      //console.log("this.selectList",this.selectList);
    },
    // åŠ è½½æŽˆæƒåˆ—è¡¨
    loadAuthPage() {
      return new Promise((resolve, reject) => {
        getButtonByParentCode({ code: "classifyTree" })
          .then((res) => {
            // è®°å½•按钮数据
            this.classifyAuthButton = res.data.data;
            const list = res.data.data;
            let tempData = [];
            // è§’色列
            tempData.push({
              label: "角色",
              prop: "roleData",
              type: "select",
              width: 150,
            });
            // ç¼–码项分类授权
            tempData.push({
              label: "编码项分类授权",
              prop: "classifyItem",
              type: "text",
              width: 180,
            });
            list.forEach((item) => {
              let columnItem = {
                label: item.name,
                prop: item.id,
                code: item.code,
                type: "checkbox",
                width: 180,
              };
              tempData.push(columnItem);
            });
            this.classifyAuthHeader = tempData;
            resolve();
          })
          .catch((err) => {
            reject(err);
          });
        // èŽ·å–è§’è‰²åˆ—è¡¨
        getPage(1, -1, null).then((res) => {
          this.roleList = res.data.data.records;
        });
        // èŽ·å–è¯¥åˆ†ç±»ä¸‹å·²æŽˆæƒçš„åˆ†ç±»æŽˆæƒä¿¡æ¯
        getClassifyAuthList({
          classifyId: this.classifyData.oid,
          authType: "classify_auth",
        }).then((res) => {
          //console.log(res.data.data);
          let authDatas = res.data.data;
          if (authDatas.length > 0) {
            authDatas.forEach((authData, index) => {
              let item = {
                oid: authData.oid,
                roleData: authData.roleId,
                classifyItem: this.classifyData.label,
                authButton:{},
                index: index,
                uuid: uuidv4(), //生成唯一的id
              };
              //将按钮设置进去
              authData.buttonIdList.forEach((data) => {
                Vue.set(item, data, true);
              });
              this.classifyAuthData.push(item);
              this.addIndex = this.classifyAuthData.length - 1; //添加行下标等于classifyAuthData的长度-1
              this.roleHandlerMethods(authData.roleId, "create", index);
              // console.log('index', index)
            });
          }
        });
      });
    },
  },
};
</script>
Source/UBCS-WEB/src/components/Theme/DataAuthDialog.vue
@@ -122,70 +122,7 @@
    visible() {
      if (this.visible) {
        this.isShowDialog = this.visible;
        return new Promise((resolve, reject) => {
          getButtonByParentCode({code: this.classifyData.attributes.id}).then(res => {
            // è®°å½•按钮数据
            this.classifyAuthButton = res.data.data;
            const list = res.data.data;
            let tempData = [];
            // è§’色列
            tempData.push({
              label: "角色",
              prop: "roleData",
              type: "select",
              width: 150,
            });
            // ç¼–码项分类授权
            tempData.push({
              label: "编码项数据授权",
              prop: "classifyItem",
              type: "text",
              width: 180,
            });
            list.forEach(item => {
              let columnItem = {
                label: item.name,
                prop: item.id,
                code: item.code,
                type: "checkbox",
                width: 180,
              };
              tempData.push(columnItem);
            })
            this.classifyAuthHeader = tempData
            resolve();
          }).catch(err => {
            reject(err)
          });
          // èŽ·å–è§’è‰²åˆ—è¡¨
          getPage(1, -1, null).then(res => {
            this.roleList = res.data.data.records;
          });
          // èŽ·å–è¯¥åˆ†ç±»ä¸‹å·²æŽˆæƒçš„åˆ†ç±»æŽˆæƒä¿¡æ¯
          getClassifyAuthList({classifyId: this.classifyData.oid, authType: "data_auth"}).then(res => {
            //console.log(res.data.data);
            let authDatas = res.data.data;
            if (authDatas.length > 0) {
              authDatas.forEach((authData, index) => {
                let item = {
                  oid: authData.oid,
                  roleData: authData.roleId,
                  classifyItem: this.classifyData.label,
                  index: index,
                  authButton:{},
                  uuid: uuidv4(),//生成唯一的id
                }
                //将按钮设置进去
                authData.buttonIdList.forEach(data => {
                  Vue.set(item, data, true);
                });
                this.classifyAuthData.push(item);
                this.addIndex = this.classifyAuthData.length - 1; //添加行下标等于classifyAuthData的长度-1
                this.roleHandlerMethods(authData.roleId, 'create', index)
              })
            }
          });
        });
        this.loadAuthPage();
      }
    },
  },
@@ -323,12 +260,14 @@
      this.selectList = list;
    },
    // ä¿å­˜åˆ†ç±»æŽˆæƒä¿¡æ¯
    submit() {
      if (this.classifyAuthData.length <= 0) {
        this.$message.warning('授权列表为空!')
        return;
      }
    async submit() {
      let form = {
        classifyAuthList: [],
        isCLear: false, //默认是清空
        classifyId: this.classifyData.oid,
      };
      let isRepeat = false;
      if (this.classifyAuthData.length > 0) {
      // éåŽ†æ•°ç»„ï¼Œæ¯”è¾ƒåŽé¢çš„å¯¹è±¡çš„roleData是否与前面的对象相等
      for (let i = 0; i < this.classifyAuthData.length - 1; i++) {
        let currentRoleId = this.classifyAuthData[i].roleData;
@@ -346,7 +285,6 @@
        this.$message.warning("角色和分类已经存在,请重新配置!");
        return;
      }
      let form = [];
      let flag = false;
      this.classifyAuthData.forEach(item => {
        let itemButtonList = [];
@@ -369,7 +307,7 @@
          buttonIds: itemButtonList.join(","),
          authType: "data_auth",
        }
        form.push(data);
          form.classifyAuthList.push(data);
      });
      if (flag) {
        this.$message.warning('有未勾选操作的权限,不允许授权')
@@ -377,7 +315,7 @@
      }
      // console.log(form)
      // è°ƒç”¨ä¿å­˜åˆ†ç±»æŽˆæƒçš„æŽ¥å£
      saveOrUpdate(form).then(res => {
        await saveOrUpdate(form).then(res => {
        this.$message({
          type: "success",
          message: res.data.msg,
@@ -386,6 +324,12 @@
      }, (error) => {
        window.console.log(error);
      })
      }else{
        // ä¸ºç©ºè¯æ˜Žæ˜¯æ¸…空授权列表
        form.isCLear = true;
      }
      this.classifyAuthData = [];
      this.loadAuthPage();
    },
    // å…¨é€‰æŒ‰é’®
    selectAllButton() {
@@ -399,6 +343,73 @@
      });
      //console.log("this.selectList",this.selectList);
    },
    loadAuthPage() {
      return new Promise((resolve, reject) => {
        console.log(this.classifyData);
        getButtonByParentCode({code: this.classifyData.attributes.id}).then(res => {
          // è®°å½•按钮数据
          this.classifyAuthButton = res.data.data;
          const list = res.data.data;
          let tempData = [];
          // è§’色列
          tempData.push({
            label: "角色",
            prop: "roleData",
            type: "select",
            width: 150,
          });
          // ç¼–码项分类授权
          tempData.push({
            label: "编码项数据授权",
            prop: "classifyItem",
            type: "text",
            width: 180,
          });
          list.forEach(item => {
            let columnItem = {
              label: item.name,
              prop: item.id,
              code: item.code,
              type: "checkbox",
              width: 180,
            };
            tempData.push(columnItem);
          })
          this.classifyAuthHeader = tempData
          resolve();
        }).catch(err => {
          reject(err)
        });
        // èŽ·å–è§’è‰²åˆ—è¡¨
        getPage(1, -1, null).then(res => {
          this.roleList = res.data.data.records;
        });
        // èŽ·å–è¯¥åˆ†ç±»ä¸‹å·²æŽˆæƒçš„åˆ†ç±»æŽˆæƒä¿¡æ¯
        getClassifyAuthList({classifyId: this.classifyData.oid, authType: "data_auth"}).then(res => {
          //console.log(res.data.data);
          let authDatas = res.data.data;
          if (authDatas.length > 0) {
            authDatas.forEach((authData, index) => {
              let item = {
                oid: authData.oid,
                roleData: authData.roleId,
                classifyItem: this.classifyData.label,
                index: index,
                authButton:{},
                uuid: uuidv4(),//生成唯一的id
              }
              //将按钮设置进去
              authData.buttonIdList.forEach(data => {
                Vue.set(item, data, true);
              });
              this.classifyAuthData.push(item);
              this.addIndex = this.classifyAuthData.length - 1; //添加行下标等于classifyAuthData的长度-1
              this.roleHandlerMethods(authData.roleId, 'create', index)
            })
          }
        });
      });
    },
  },
};
</script>
Source/UBCS/ubcs-service-api/ubcs-system-api/src/main/java/com/vci/ubcs/system/dto/ClassifyAuthDTO.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,30 @@
package com.vci.ubcs.system.dto;
import com.vci.ubcs.system.entity.ClassifyAuth;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.util.List;
/**
 * @author ludc
 * @date 2024/1/24 17:57
 */
@Data
public class ClassifyAuthDTO {
    private List<ClassifyAuth> classifyAuthList;
    /**
     * æ˜¯å¦æ¸…空 true是清空,false不是清空
     */
//    @NotBlank(message = "必传参数isCLear不能为空")
    private Boolean isCLear;
    /**
     * åˆ†ç±»id
     */
//    @NotBlank(message = "必传参数classifyId不能为空")
    private String classifyId;
}
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/CodeClassifyServiceImpl.java
@@ -562,6 +562,7 @@
        }
        if(StringUtils.isNotBlank(id) || StringUtils.isNotBlank(lcStatus) ){
            //String tableName = this.getTableName(treeQueryObject.getConditionMap().get("btmTypeId"),treeQueryObject.getConditionMap().get("id"), treeQueryObject.getConditionMap().get("lcStatus"));
            // TODO: 2024-1-24 23:25我去掉了懒加载,因为会影响数据授权过滤,而且这儿感觉没必要做懒加载
            doList = codeClassifyMapper
                .selectCodeClassifyDOByTree(
                    treeQueryObject.getConditionMap().get("id"),
@@ -598,11 +599,8 @@
            if(!viewClassByRoleIds.isSuccess() && viewClassByRoleIds.getData().isEmpty()){
                throw new ServiceException("主数据查看权限未配置,或配置有误!");
            }
            long startTime = System.currentTimeMillis();
            // è¿‡æ»¤
            filterTreeNodes(tree,viewClassByRoleIds.getData());
            long endTime = System.currentTimeMillis();
            System.out.println(("执行时间:"+(endTime-startTime)/1000)+"s");
        }
        // åŠ è½½åˆ†ç±»æ˜¯å¦å…·æœ‰å­åˆ†ç±»
        tree.parallelStream().forEach(item -> {
@@ -624,7 +622,7 @@
            /*Boolean checkHasChild = checkHasChild(tree.getOid());
            tree.setLeaf(!checkHasChild);*/
            if (classifyIds.contains(tree.getOid())) {
                // å¦‚果顶层节点存在于 classifyIds ä¸­ï¼Œç›´æŽ¥ä¿ç•™å…¶å­èŠ‚ç‚¹é›†åˆ
                // å¦‚果顶层节点存在 classifyIds ï¼Œç›´æŽ¥ä¿ç•™å…¶å­èŠ‚ç‚¹é›†åˆ
                continue;
            }
            if (tree.getChildren() != null && !tree.getChildren().isEmpty()) {
Source/UBCS/ubcs-service/ubcs-code/src/main/resources/mapper/CodeCLassifyMapper.xml
@@ -320,13 +320,17 @@
        left join pl_code_resemblerule coderesembleruleoid
        on codeclassify0.codeResembleRuleOid = coderesembleruleoid.oid
        where codeclassify0.lcstatus = #{lcstatus}
        <if test="parentcodeclassifyoid != null and parentcodeclassifyoid != ''">
            and codeclassify0.parentcodeclassifyoid = #{parentcodeclassifyoid}
        </if>
        <if test="parentcodeclassifyoid == null or parentcodeclassifyoid == ''">
            and codeclassify0.parentcodeclassifyoid is null
        and codeclassify0.parentcodeclassifyoid = (
            SELECT
                OID
            FROM
                PL_CODE_CLASSIFY
            WHERE
                parentcodeclassifyoid IS NULL
                AND id = #{id}
        )
        or codeclassify0.parentcodeclassifyoid IS NULL
            and codeclassify0.id = #{id}
        </if>
        <if test="tenantId != null and tenantId != ''">
            and codeclassify0.tenant_id = #{tenantId}
        </if>
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/controller/ClassifyAuthController.java
@@ -1,10 +1,12 @@
package com.vci.ubcs.system.controller;
import com.vci.ubcs.system.dto.ClassifyAuthDTO;
import com.vci.ubcs.system.entity.ClassifyAuth;
import com.vci.ubcs.system.service.IClassifyAuthService;
import com.vci.ubcs.system.vo.ClassifyAuthVO;
import io.swagger.annotations.Api;
import lombok.AllArgsConstructor;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.tenant.annotation.NonDS;
import org.springblade.core.tool.api.R;
import org.springframework.web.bind.annotation.*;
@@ -31,12 +33,12 @@
    /**
     * åˆ†ç±»æŽˆæƒä¿å­˜æŽ¥å£
     * @param classifyAuthList
     * @param classifyAuthListDTO
     * @return
     */
    @PostMapping("/saveOrUpdate")
    public R saveOrUpdate(@RequestBody List<ClassifyAuth> classifyAuthList) {
        return classifyAuthService.submit(classifyAuthList);
    public R saveOrUpdate(@RequestBody @Valid ClassifyAuthDTO classifyAuthListDTO) throws ServiceException {
        return classifyAuthService.submit(classifyAuthListDTO);
    }
    /**
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/service/IClassifyAuthService.java
@@ -1,9 +1,11 @@
package com.vci.ubcs.system.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.vci.ubcs.system.dto.ClassifyAuthDTO;
import com.vci.ubcs.system.entity.ClassifyAuth;
import com.vci.ubcs.system.entity.Menu;
import com.vci.ubcs.system.vo.ClassifyAuthVO;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.tool.api.R;
import java.util.List;
@@ -18,10 +20,10 @@
    /**
     * åˆ†ç±»æŽˆæƒä¿å­˜æŽ¥å£
     * @param classifyAuthList
     * @param classifyAuthListDTO
     * @return
     */
    R submit(List<ClassifyAuth> classifyAuthList);
    R submit(ClassifyAuthDTO classifyAuthListDTO) throws ServiceException;
    /**
     * èŽ·å–åˆ†ç±»æŽˆæƒé›†åˆ
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/service/impl/ClassifyAuthServiceImpl.java
@@ -2,10 +2,12 @@
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.vci.ubcs.code.feign.ICodeClassifyClient;
import com.vci.ubcs.starter.web.util.VciBaseUtil;
import com.vci.ubcs.system.dto.ClassifyAuthDTO;
import com.vci.ubcs.system.entity.ClassifyAuth;
import com.vci.ubcs.system.entity.Menu;
import com.vci.ubcs.system.mapper.ClassifyAuthMapper;
@@ -44,17 +46,28 @@
    /**
     * åˆ†ç±»æŽˆæƒä¿å­˜æŽ¥å£
     * @param classifyAuthList
     * @param classifyAuthListDTO
     * @return
     */
    @Override
    @Transactional(rollbackFor = Exception.class)
    public R submit(List<ClassifyAuth> classifyAuthList) {
        if(classifyAuthList.isEmpty()){
    public R submit(ClassifyAuthDTO classifyAuthListDTO) throws ServiceException{
        // æ˜¯æ¸…空授权列表
        if(classifyAuthListDTO.getIsCLear()){
            if(Func.isEmpty(classifyAuthListDTO.getClassifyId())){
                return R.fail("清空授权列表时,未获取的分类id");
            }
            this.classifyAuthMapper.delete(Wrappers.<ClassifyAuth>update()
                .lambda().eq(ClassifyAuth::getClassifyId, classifyAuthListDTO.getClassifyId())
            );
            return R.success("授权列表清空成功");
        }
        if(!classifyAuthListDTO.getIsCLear() && classifyAuthListDTO.getClassifyAuthList().isEmpty()){
            R.fail("授权列表不能为空!");
        }
        // åˆ¤é‡ï¼ŒæŸ¥çœ‹æ˜¯å¦å­˜åœ¨åŒä¸€ä¸ªclassid下配置了相同的角色
        Map<String, Long> roleidCounts = classifyAuthList.stream()
        Map<String, Long> roleidCounts = classifyAuthListDTO.getClassifyAuthList().stream()
            .collect(Collectors.groupingBy(ClassifyAuth::getRoleId, Collectors.counting()));
        // æ£€æŸ¥æ˜¯å¦æœ‰roleid出现次数大于1的情况
@@ -65,17 +78,17 @@
        }
        // å¦‚果传过来的集合中该分类id下删除了部分角色的授权,就需要将该库中classifyId下不存在的数据删掉
        List<String> roleIds = classifyAuthList.stream().map(ClassifyAuth::getRoleId).collect(Collectors.toList());
        List<String> roleIds = classifyAuthListDTO.getClassifyAuthList().stream().map(ClassifyAuth::getRoleId).collect(Collectors.toList());
        // åˆ é™¤
        LambdaUpdateWrapper<ClassifyAuth> updateWrapper = Wrappers.<ClassifyAuth>update()
            .lambda().eq(ClassifyAuth::getClassifyId, classifyAuthList.get(0).getClassifyId())
            .lambda().eq(ClassifyAuth::getClassifyId, classifyAuthListDTO.getClassifyAuthList().get(0).getClassifyId())
            .notIn(ClassifyAuth::getRoleId, roleIds);
        try {
            this.classifyAuthMapper.delete(updateWrapper);
        }catch (Exception e){
            throw new ServiceException("分类授权过程中出现错误,错误原因:"+e.getMessage());
        }
        return R.status(saveOrUpdateBatch(classifyAuthList));
        return R.status(saveOrUpdateBatch(classifyAuthListDTO.getClassifyAuthList()));
    }
    /**