diff --git a/blade-auth/pom.xml b/blade-auth/pom.xml
index c0329157..4c6aa5f0 100644
--- a/blade-auth/pom.xml
+++ b/blade-auth/pom.xml
@@ -8,7 +8,7 @@
BladeX
org.springblade
- 2.0.3.RELEASE
+ 2.0.4.RELEASE
blade-auth
diff --git a/blade-common/pom.xml b/blade-common/pom.xml
index 4234d604..c94c04dd 100644
--- a/blade-common/pom.xml
+++ b/blade-common/pom.xml
@@ -5,7 +5,7 @@
BladeX
org.springblade
- 2.0.3.RELEASE
+ 2.0.4.RELEASE
4.0.0
diff --git a/blade-gateway/pom.xml b/blade-gateway/pom.xml
index 04cbc383..9339981c 100644
--- a/blade-gateway/pom.xml
+++ b/blade-gateway/pom.xml
@@ -5,7 +5,7 @@
BladeX
org.springblade
- 2.0.3.RELEASE
+ 2.0.4.RELEASE
4.0.0
diff --git a/blade-ops-api/blade-flow-api/pom.xml b/blade-ops-api/blade-flow-api/pom.xml
index 697479c1..eda12fe0 100644
--- a/blade-ops-api/blade-flow-api/pom.xml
+++ b/blade-ops-api/blade-flow-api/pom.xml
@@ -5,7 +5,7 @@
blade-ops-api
org.springblade
- 2.0.3.RELEASE
+ 2.0.4.RELEASE
4.0.0
diff --git a/blade-ops-api/pom.xml b/blade-ops-api/pom.xml
index eb8d5dc4..fdcaf393 100644
--- a/blade-ops-api/pom.xml
+++ b/blade-ops-api/pom.xml
@@ -5,13 +5,13 @@
BladeX
org.springblade
- 2.0.3.RELEASE
+ 2.0.4.RELEASE
4.0.0
blade-ops-api
${project.artifactId}
- 2.0.3.RELEASE
+ 2.0.4.RELEASE
pom
BladeX 微服务API集合
diff --git a/blade-ops/blade-admin/pom.xml b/blade-ops/blade-admin/pom.xml
index 9944d72f..20137266 100644
--- a/blade-ops/blade-admin/pom.xml
+++ b/blade-ops/blade-admin/pom.xml
@@ -5,7 +5,7 @@
blade-ops
org.springblade
- 2.0.3.RELEASE
+ 2.0.4.RELEASE
4.0.0
diff --git a/blade-ops/blade-develop/pom.xml b/blade-ops/blade-develop/pom.xml
index da8c36a9..0982bdd6 100644
--- a/blade-ops/blade-develop/pom.xml
+++ b/blade-ops/blade-develop/pom.xml
@@ -6,7 +6,7 @@
org.springblade
blade-ops
- 2.0.3.RELEASE
+ 2.0.4.RELEASE
4.0.0
diff --git a/blade-ops/blade-flow-design/pom.xml b/blade-ops/blade-flow-design/pom.xml
index 2b2ecada..97426475 100644
--- a/blade-ops/blade-flow-design/pom.xml
+++ b/blade-ops/blade-flow-design/pom.xml
@@ -5,7 +5,7 @@
blade-ops
org.springblade
- 2.0.3.RELEASE
+ 2.0.4.RELEASE
4.0.0
diff --git a/blade-ops/blade-flow/pom.xml b/blade-ops/blade-flow/pom.xml
index 97050023..351871d1 100644
--- a/blade-ops/blade-flow/pom.xml
+++ b/blade-ops/blade-flow/pom.xml
@@ -5,7 +5,7 @@
blade-ops
org.springblade
- 2.0.3.RELEASE
+ 2.0.4.RELEASE
4.0.0
diff --git a/blade-ops/blade-log/pom.xml b/blade-ops/blade-log/pom.xml
index b5e1fae4..cd6bfff2 100644
--- a/blade-ops/blade-log/pom.xml
+++ b/blade-ops/blade-log/pom.xml
@@ -5,7 +5,7 @@
blade-ops
org.springblade
- 2.0.3.RELEASE
+ 2.0.4.RELEASE
4.0.0
diff --git a/blade-ops/blade-resource/pom.xml b/blade-ops/blade-resource/pom.xml
index 5c6697b8..7cd4636d 100644
--- a/blade-ops/blade-resource/pom.xml
+++ b/blade-ops/blade-resource/pom.xml
@@ -5,7 +5,7 @@
blade-ops
org.springblade
- 2.0.3.RELEASE
+ 2.0.4.RELEASE
4.0.0
diff --git a/blade-ops/pom.xml b/blade-ops/pom.xml
index 0c863271..4c8f5125 100644
--- a/blade-ops/pom.xml
+++ b/blade-ops/pom.xml
@@ -5,13 +5,13 @@
BladeX
org.springblade
- 2.0.3.RELEASE
+ 2.0.4.RELEASE
4.0.0
blade-ops
${project.artifactId}
- 2.0.3.RELEASE
+ 2.0.4.RELEASE
pom
diff --git a/blade-service-api/blade-desk-api/pom.xml b/blade-service-api/blade-desk-api/pom.xml
index 93344b77..a511e750 100644
--- a/blade-service-api/blade-desk-api/pom.xml
+++ b/blade-service-api/blade-desk-api/pom.xml
@@ -5,7 +5,7 @@
blade-service-api
org.springblade
- 2.0.3.RELEASE
+ 2.0.4.RELEASE
4.0.0
diff --git a/blade-service-api/blade-dict-api/pom.xml b/blade-service-api/blade-dict-api/pom.xml
index da7aa800..c3439bc0 100644
--- a/blade-service-api/blade-dict-api/pom.xml
+++ b/blade-service-api/blade-dict-api/pom.xml
@@ -5,7 +5,7 @@
blade-service-api
org.springblade
- 2.0.3.RELEASE
+ 2.0.4.RELEASE
4.0.0
diff --git a/blade-service-api/blade-system-api/pom.xml b/blade-service-api/blade-system-api/pom.xml
index 33b481ce..7803f89d 100644
--- a/blade-service-api/blade-system-api/pom.xml
+++ b/blade-service-api/blade-system-api/pom.xml
@@ -5,7 +5,7 @@
blade-service-api
org.springblade
- 2.0.3.RELEASE
+ 2.0.4.RELEASE
4.0.0
diff --git a/blade-service-api/blade-system-api/src/main/java/org/springblade/system/entity/DataScope.java b/blade-service-api/blade-system-api/src/main/java/org/springblade/system/entity/DataScope.java
new file mode 100644
index 00000000..bf49e25e
--- /dev/null
+++ b/blade-service-api/blade-system-api/src/main/java/org/springblade/system/entity/DataScope.java
@@ -0,0 +1,82 @@
+/*
+ * Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * Neither the name of the dreamlu.net developer nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.system.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.core.mp.base.BaseEntity;
+
+/**
+ * 实体类
+ *
+ * @author BladeX
+ * @since 2019-06-23
+ */
+@Data
+@TableName("blade_data_scope")
+@EqualsAndHashCode(callSuper = true)
+@ApiModel(value = "DataScope对象", description = "DataScope对象")
+public class DataScope extends BaseEntity {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 菜单主键
+ */
+ @ApiModelProperty(value = "菜单主键")
+ private Long menuId;
+ /**
+ * 资源编号
+ */
+ @ApiModelProperty(value = "资源编号")
+ private String resourceCode;
+ /**
+ * 数据权限名称
+ */
+ @ApiModelProperty(value = "数据权限名称")
+ private String scopeName;
+ /**
+ * 数据权限类名
+ */
+ @ApiModelProperty(value = "数据权限类名")
+ private String scopeClass;
+ /**
+ * 数据权限字段
+ */
+ @ApiModelProperty(value = "数据权限字段")
+ private String scopeColumn;
+ /**
+ * 数据权限类型
+ */
+ @ApiModelProperty(value = "数据权限类型")
+ private Integer scopeType;
+ /**
+ * 数据权限值域
+ */
+ @ApiModelProperty(value = "数据权限值域")
+ private String scopeValue;
+ /**
+ * 数据权限备注
+ */
+ @ApiModelProperty(value = "数据权限备注")
+ private String remark;
+
+
+}
diff --git a/blade-service-api/blade-system-api/src/main/java/org/springblade/system/entity/Dept.java b/blade-service-api/blade-system-api/src/main/java/org/springblade/system/entity/Dept.java
index 46e23997..348ac2ac 100644
--- a/blade-service-api/blade-system-api/src/main/java/org/springblade/system/entity/Dept.java
+++ b/blade-service-api/blade-system-api/src/main/java/org/springblade/system/entity/Dept.java
@@ -62,17 +62,29 @@ public class Dept implements Serializable {
private Long parentId;
/**
- * 部门名
+ * 机构名
*/
- @ApiModelProperty(value = "部门名")
+ @ApiModelProperty(value = "机构名")
private String deptName;
/**
- * 部门全称
+ * 机构全称
*/
- @ApiModelProperty(value = "部门全称")
+ @ApiModelProperty(value = "机构全称")
private String fullName;
+ /**
+ * 租级机构主键
+ */
+ @ApiModelProperty(value = "祖级机构主键")
+ private String ancestors;
+
+ /**
+ * 机构类型
+ */
+ @ApiModelProperty(value = "机构类型")
+ private Integer deptCategory;
+
/**
* 排序
*/
diff --git a/blade-service-api/blade-system-api/src/main/java/org/springblade/system/entity/RoleScope.java b/blade-service-api/blade-system-api/src/main/java/org/springblade/system/entity/RoleScope.java
new file mode 100644
index 00000000..84a5160e
--- /dev/null
+++ b/blade-service-api/blade-system-api/src/main/java/org/springblade/system/entity/RoleScope.java
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * Neither the name of the dreamlu.net developer nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.system.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * 实体类
+ *
+ * @author Chill
+ */
+@Data
+@TableName("blade_role_scope")
+@ApiModel(value = "RoleScope对象", description = "RoleScope对象")
+public class RoleScope implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 主键
+ */
+ @JsonSerialize(using = ToStringSerializer.class)
+ @ApiModelProperty(value = "主键")
+ @TableId(value = "id", type = IdType.ID_WORKER)
+ private Long id;
+
+ /**
+ * 数据权限id
+ */
+ @JsonSerialize(using = ToStringSerializer.class)
+ @ApiModelProperty(value = "数据权限id")
+ private Long scopeId;
+
+ /**
+ * 角色id
+ */
+ @JsonSerialize(using = ToStringSerializer.class)
+ @ApiModelProperty(value = "角色id")
+ private Long roleId;
+
+
+}
diff --git a/blade-service-api/blade-system-api/src/main/java/org/springblade/system/vo/CheckedTreeVO.java b/blade-service-api/blade-system-api/src/main/java/org/springblade/system/vo/CheckedTreeVO.java
new file mode 100644
index 00000000..4298eeb3
--- /dev/null
+++ b/blade-service-api/blade-system-api/src/main/java/org/springblade/system/vo/CheckedTreeVO.java
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * Neither the name of the dreamlu.net developer nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.system.vo;
+
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * CheckedTreeVO
+ *
+ * @author Chill
+ */
+@Data
+public class CheckedTreeVO {
+
+ private List menu;
+
+ private List scope;
+
+}
diff --git a/blade-service-api/blade-system-api/src/main/java/org/springblade/system/vo/DeptVO.java b/blade-service-api/blade-system-api/src/main/java/org/springblade/system/vo/DeptVO.java
index 56d317f0..819e5089 100644
--- a/blade-service-api/blade-system-api/src/main/java/org/springblade/system/vo/DeptVO.java
+++ b/blade-service-api/blade-system-api/src/main/java/org/springblade/system/vo/DeptVO.java
@@ -66,8 +66,13 @@ public class DeptVO extends Dept implements INode {
}
/**
- * 上级部门
+ * 上级机构
*/
private String parentName;
+ /**
+ * 机构类型名称
+ */
+ private String deptCategoryName;
+
}
diff --git a/blade-service-api/blade-system-api/src/main/java/org/springblade/system/vo/GrantTreeVO.java b/blade-service-api/blade-system-api/src/main/java/org/springblade/system/vo/GrantTreeVO.java
new file mode 100644
index 00000000..03a1dbd7
--- /dev/null
+++ b/blade-service-api/blade-system-api/src/main/java/org/springblade/system/vo/GrantTreeVO.java
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * Neither the name of the dreamlu.net developer nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.system.vo;
+
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * GrantTreeVO
+ *
+ * @author Chill
+ */
+@Data
+public class GrantTreeVO {
+
+ private List menu;
+
+ private List scope;
+
+}
diff --git a/blade-service-api/blade-user-api/pom.xml b/blade-service-api/blade-user-api/pom.xml
index 580ef98e..a1efd30e 100644
--- a/blade-service-api/blade-user-api/pom.xml
+++ b/blade-service-api/blade-user-api/pom.xml
@@ -5,7 +5,7 @@
blade-service-api
org.springblade
- 2.0.3.RELEASE
+ 2.0.4.RELEASE
4.0.0
diff --git a/blade-service-api/pom.xml b/blade-service-api/pom.xml
index d6383ed1..6be9d972 100644
--- a/blade-service-api/pom.xml
+++ b/blade-service-api/pom.xml
@@ -5,13 +5,13 @@
BladeX
org.springblade
- 2.0.3.RELEASE
+ 2.0.4.RELEASE
4.0.0
blade-service-api
${project.artifactId}
- 2.0.3.RELEASE
+ 2.0.4.RELEASE
pom
BladeX 微服务API集合
diff --git a/blade-service/blade-desk/pom.xml b/blade-service/blade-desk/pom.xml
index 205ea6da..5af561be 100644
--- a/blade-service/blade-desk/pom.xml
+++ b/blade-service/blade-desk/pom.xml
@@ -6,7 +6,7 @@
org.springblade
blade-service
- 2.0.3.RELEASE
+ 2.0.4.RELEASE
4.0.0
diff --git a/blade-service/blade-system/pom.xml b/blade-service/blade-system/pom.xml
index 2c55008c..9220a731 100644
--- a/blade-service/blade-system/pom.xml
+++ b/blade-service/blade-system/pom.xml
@@ -5,7 +5,7 @@
blade-service
org.springblade
- 2.0.3.RELEASE
+ 2.0.4.RELEASE
4.0.0
diff --git a/blade-service/blade-system/src/main/java/org/springblade/system/controller/DataScopeController.java b/blade-service/blade-system/src/main/java/org/springblade/system/controller/DataScopeController.java
new file mode 100644
index 00000000..fabc440e
--- /dev/null
+++ b/blade-service/blade-system/src/main/java/org/springblade/system/controller/DataScopeController.java
@@ -0,0 +1,113 @@
+/*
+ * Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * Neither the name of the dreamlu.net developer nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.system.controller;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import lombok.AllArgsConstructor;
+import org.springblade.core.boot.ctrl.BladeController;
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.mp.support.Query;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.Func;
+import org.springblade.system.entity.DataScope;
+import org.springblade.system.service.IDataScopeService;
+import org.springframework.cache.annotation.CacheEvict;
+import org.springframework.web.bind.annotation.*;
+
+import javax.validation.Valid;
+
+import static org.springblade.core.cache.constant.CacheConstant.SYS_CACHE;
+
+/**
+ * 数据权限控制器
+ *
+ * @author BladeX
+ * @since 2019-06-23
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("data-scope")
+@Api(value = "数据权限", tags = "接口")
+public class DataScopeController extends BladeController {
+
+ private IDataScopeService dataScopeService;
+
+ /**
+ * 详情
+ */
+ @GetMapping("/detail")
+ @ApiOperation(value = "详情", notes = "传入dataScope", position = 1)
+ public R detail(DataScope dataScope) {
+ DataScope detail = dataScopeService.getOne(Condition.getQueryWrapper(dataScope));
+ return R.data(detail);
+ }
+
+ /**
+ * 分页
+ */
+ @GetMapping("/list")
+ @ApiOperation(value = "分页", notes = "传入dataScope", position = 2)
+ public R> list(DataScope dataScope, Query query) {
+ IPage pages = dataScopeService.page(Condition.getPage(query), Condition.getQueryWrapper(dataScope));
+ return R.data(pages);
+ }
+
+ /**
+ * 新增
+ */
+ @PostMapping("/save")
+ @CacheEvict(cacheNames = {SYS_CACHE})
+ @ApiOperation(value = "新增", notes = "传入dataScope", position = 4)
+ public R save(@Valid @RequestBody DataScope dataScope) {
+ return R.status(dataScopeService.save(dataScope));
+ }
+
+ /**
+ * 修改
+ */
+ @PostMapping("/update")
+ @CacheEvict(cacheNames = {SYS_CACHE})
+ @ApiOperation(value = "修改", notes = "传入dataScope", position = 5)
+ public R update(@Valid @RequestBody DataScope dataScope) {
+ return R.status(dataScopeService.updateById(dataScope));
+ }
+
+ /**
+ * 新增或修改
+ */
+ @PostMapping("/submit")
+ @CacheEvict(cacheNames = {SYS_CACHE})
+ @ApiOperation(value = "新增或修改", notes = "传入dataScope", position = 6)
+ public R submit(@Valid @RequestBody DataScope dataScope) {
+ return R.status(dataScopeService.saveOrUpdate(dataScope));
+ }
+
+
+ /**
+ * 删除
+ */
+ @PostMapping("/remove")
+ @CacheEvict(cacheNames = {SYS_CACHE})
+ @ApiOperation(value = "逻辑删除", notes = "传入ids", position = 7)
+ public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
+ return R.status(dataScopeService.deleteLogic(Func.toLongList(ids)));
+ }
+
+}
diff --git a/blade-service/blade-system/src/main/java/org/springblade/system/controller/DeptController.java b/blade-service/blade-system/src/main/java/org/springblade/system/controller/DeptController.java
index 3c94613e..c835541c 100644
--- a/blade-service/blade-system/src/main/java/org/springblade/system/controller/DeptController.java
+++ b/blade-service/blade-system/src/main/java/org/springblade/system/controller/DeptController.java
@@ -103,7 +103,7 @@ public class DeptController extends BladeController {
if (Func.isEmpty(dept.getId())) {
dept.setTenantId(user.getTenantId());
}
- return R.status(deptService.saveOrUpdate(dept));
+ return R.status(deptService.submit(dept));
}
/**
diff --git a/blade-service/blade-system/src/main/java/org/springblade/system/controller/MenuController.java b/blade-service/blade-system/src/main/java/org/springblade/system/controller/MenuController.java
index 32763568..5db82ccd 100644
--- a/blade-service/blade-system/src/main/java/org/springblade/system/controller/MenuController.java
+++ b/blade-service/blade-system/src/main/java/org/springblade/system/controller/MenuController.java
@@ -28,6 +28,8 @@ import org.springblade.core.tool.support.Kv;
import org.springblade.core.tool.utils.Func;
import org.springblade.system.entity.Menu;
import org.springblade.system.service.IMenuService;
+import org.springblade.system.vo.CheckedTreeVO;
+import org.springblade.system.vo.GrantTreeVO;
import org.springblade.system.vo.MenuVO;
import org.springblade.system.wrapper.MenuWrapper;
import org.springframework.cache.annotation.CacheEvict;
@@ -139,8 +141,11 @@ public class MenuController extends BladeController {
*/
@GetMapping("/grant-tree")
@ApiOperation(value = "权限分配树形结构", notes = "权限分配树形结构", position = 6)
- public R> grantTree(BladeUser user) {
- return R.data(menuService.grantTree(user));
+ public R grantTree(BladeUser user) {
+ GrantTreeVO vo = new GrantTreeVO();
+ vo.setMenu(menuService.grantTree(user));
+ vo.setScope(menuService.grantScopeTree(user));
+ return R.data(vo);
}
/**
@@ -148,8 +153,11 @@ public class MenuController extends BladeController {
*/
@GetMapping("/role-tree-keys")
@ApiOperation(value = "角色所分配的树", notes = "角色所分配的树", position = 7)
- public R> roleTreeKeys(String roleIds) {
- return R.data(menuService.roleTreeKeys(roleIds));
+ public R roleTreeKeys(String roleIds) {
+ CheckedTreeVO vo = new CheckedTreeVO();
+ vo.setMenu(menuService.roleTreeKeys(roleIds));
+ vo.setScope(menuService.scopeTreeKeys(roleIds));
+ return R.data(vo);
}
/**
diff --git a/blade-service/blade-system/src/main/java/org/springblade/system/controller/RoleController.java b/blade-service/blade-system/src/main/java/org/springblade/system/controller/RoleController.java
index 498aba38..929c52cb 100644
--- a/blade-service/blade-system/src/main/java/org/springblade/system/controller/RoleController.java
+++ b/blade-service/blade-system/src/main/java/org/springblade/system/controller/RoleController.java
@@ -116,17 +116,14 @@ public class RoleController extends BladeController {
}
/**
- * 设置菜单权限
- *
- * @param roleIds
- * @param menuIds
- * @return
+ * 设置角色权限
*/
@PostMapping("/grant")
@ApiOperation(value = "权限设置", notes = "传入roleId集合以及menuId集合", position = 6)
public R grant(@ApiParam(value = "roleId集合", required = true) @RequestParam String roleIds,
- @ApiParam(value = "menuId集合", required = true) @RequestParam String menuIds) {
- boolean temp = roleService.grant(Func.toLongList(roleIds), Func.toLongList(menuIds));
+ @ApiParam(value = "menuId集合", required = true) @RequestParam String menuIds,
+ @ApiParam(value = "scopeId集合") String scopeIds) {
+ boolean temp = roleService.grant(Func.toLongList(roleIds), Func.toLongList(menuIds), Func.toLongList(scopeIds));
return R.status(temp);
}
diff --git a/blade-service/blade-system/src/main/java/org/springblade/system/mapper/DataScopeMapper.java b/blade-service/blade-system/src/main/java/org/springblade/system/mapper/DataScopeMapper.java
new file mode 100644
index 00000000..959ef558
--- /dev/null
+++ b/blade-service/blade-system/src/main/java/org/springblade/system/mapper/DataScopeMapper.java
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * Neither the name of the dreamlu.net developer nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.system.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.springblade.system.entity.DataScope;
+
+/**
+ * Mapper 接口
+ *
+ * @author BladeX
+ * @since 2019-06-23
+ */
+public interface DataScopeMapper extends BaseMapper {
+
+}
diff --git a/blade-service/blade-system/src/main/java/org/springblade/system/mapper/DataScopeMapper.xml b/blade-service/blade-system/src/main/java/org/springblade/system/mapper/DataScopeMapper.xml
new file mode 100644
index 00000000..cbb46594
--- /dev/null
+++ b/blade-service/blade-system/src/main/java/org/springblade/system/mapper/DataScopeMapper.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
diff --git a/blade-service/blade-system/src/main/java/org/springblade/system/mapper/DeptMapper.xml b/blade-service/blade-system/src/main/java/org/springblade/system/mapper/DeptMapper.xml
index 2c60cf74..a47d8515 100644
--- a/blade-service/blade-system/src/main/java/org/springblade/system/mapper/DeptMapper.xml
+++ b/blade-service/blade-system/src/main/java/org/springblade/system/mapper/DeptMapper.xml
@@ -8,6 +8,8 @@
+
+
diff --git a/blade-service/blade-system/src/main/java/org/springblade/system/mapper/MenuMapper.java b/blade-service/blade-system/src/main/java/org/springblade/system/mapper/MenuMapper.java
index d1fdbd4e..289a6706 100644
--- a/blade-service/blade-system/src/main/java/org/springblade/system/mapper/MenuMapper.java
+++ b/blade-service/blade-system/src/main/java/org/springblade/system/mapper/MenuMapper.java
@@ -24,6 +24,7 @@ import org.springblade.system.vo.MenuVO;
import java.util.List;
+
/**
* Mapper 接口
*
@@ -62,6 +63,21 @@ public interface MenuMapper extends BaseMapper