|
@@ -2,6 +2,9 @@ package com.kmall.admin.controller;
|
|
|
|
|
|
import com.kmall.admin.entity.CategoryEntity;
|
|
|
import com.kmall.admin.service.CategoryService;
|
|
|
+import com.kmall.admin.utils.ParamUtils;
|
|
|
+import com.kmall.api.contants.Dict;
|
|
|
+import com.kmall.common.entity.SysUserEntity;
|
|
|
import com.kmall.common.utils.*;
|
|
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -31,6 +34,8 @@ public class CategoryController {
|
|
|
@RequestMapping("/list")
|
|
|
@RequiresPermissions("category:list")
|
|
|
public R list(@RequestParam Map<String, Object> params) {
|
|
|
+ ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", false);
|
|
|
+
|
|
|
//查询列表数据
|
|
|
Query query = new Query(params);
|
|
|
|
|
@@ -92,6 +97,8 @@ public class CategoryController {
|
|
|
@RequestMapping("/queryAll")
|
|
|
public R queryAll(@RequestParam Map<String, Object> params) {
|
|
|
|
|
|
+ ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", false);
|
|
|
+
|
|
|
List<CategoryEntity> list = categoryService.queryList(params);
|
|
|
//添加顶级菜单
|
|
|
CategoryEntity root = new CategoryEntity();
|
|
@@ -108,7 +115,11 @@ public class CategoryController {
|
|
|
*/
|
|
|
@RequestMapping("/getAreaTree")
|
|
|
public R getAreaTree() {
|
|
|
- List<CategoryEntity> list = categoryService.queryList(new HashMap<String, Object>());
|
|
|
+
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
+ ParamUtils.setQueryPowerByRoleType(map, "storeId", "merchSn", false);
|
|
|
+
|
|
|
+ List<CategoryEntity> list = categoryService.queryList(map);
|
|
|
for (CategoryEntity sysRegionEntity : list) {
|
|
|
sysRegionEntity.setValue(sysRegionEntity.getId() + "");
|
|
|
sysRegionEntity.setLabel(sysRegionEntity.getName());
|
|
@@ -126,6 +137,7 @@ public class CategoryController {
|
|
|
@RequestMapping("/getCategorySelect")
|
|
|
public R getCategorySelect(@RequestParam Map<String, Object> map) {
|
|
|
map.put("parentId", "0");
|
|
|
+ ParamUtils.setQueryPowerByRoleType(map, "storeId", "merchSn", false);
|
|
|
List<CategoryEntity> list = categoryService.queryList(map);
|
|
|
return R.ok().put("list", list);
|
|
|
}
|
|
@@ -140,6 +152,8 @@ public class CategoryController {
|
|
|
String parentId = map.get("parentId").toString();
|
|
|
List<CategoryEntity> list = new ArrayList<>();
|
|
|
if (StringUtils.isNotEmpty(parentId)) {
|
|
|
+ ParamUtils.setQueryPowerByRoleType(map, "storeId", "merchSn", false);
|
|
|
+
|
|
|
list = categoryService.queryList(map);
|
|
|
}
|
|
|
|
|
@@ -148,6 +162,9 @@ public class CategoryController {
|
|
|
|
|
|
@RequestMapping("/query")
|
|
|
public R query(@RequestParam Map<String, Object> params) {
|
|
|
+
|
|
|
+ ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", false);
|
|
|
+
|
|
|
params.put("isShow", 1);
|
|
|
List<CategoryEntity> list = categoryService.queryList(params);
|
|
|
//添加顶级菜单
|
|
@@ -162,6 +179,8 @@ public class CategoryController {
|
|
|
|
|
|
@RequestMapping("/getCategory")
|
|
|
public R getCategory(@RequestParam Map<String, Object> map) {
|
|
|
+ ParamUtils.setQueryPowerByRoleType(map, "storeId", "merchSn", false);
|
|
|
+
|
|
|
List<CategoryEntity> list = categoryService.queryList(map);
|
|
|
return R.ok().put("list", list);
|
|
|
}
|