|
|
@@ -1,6 +1,14 @@
|
|
|
package com.dgtly.goods.controller;
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
+
|
|
|
+import com.dgtly.common.constant.UserConstants;
|
|
|
+import com.dgtly.common.core.domain.Ztree;
|
|
|
+import com.dgtly.common.utils.StringUtils;
|
|
|
+import com.dgtly.framework.util.ShiroUtils;
|
|
|
+import com.dgtly.system.domain.SysDept;
|
|
|
+import com.dgtly.system.domain.SysUser;
|
|
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
@@ -26,15 +34,15 @@ import com.dgtly.common.core.page.TableDataInfo;
|
|
|
* @date 2020-02-13
|
|
|
*/
|
|
|
@Controller
|
|
|
-@RequestMapping("/system/type")
|
|
|
+@RequestMapping("/goods/type")
|
|
|
public class GoodsTypeController extends BaseController
|
|
|
{
|
|
|
- private String prefix = "system/type";
|
|
|
+ private String prefix = "goods/type";
|
|
|
|
|
|
@Autowired
|
|
|
private IGoodsTypeService goodsTypeService;
|
|
|
|
|
|
- @RequiresPermissions("system:type:view")
|
|
|
+ @RequiresPermissions("goods:type:view")
|
|
|
@GetMapping()
|
|
|
public String type()
|
|
|
{
|
|
|
@@ -44,20 +52,29 @@ public class GoodsTypeController extends BaseController
|
|
|
/**
|
|
|
* 查询商品分类列列表
|
|
|
*/
|
|
|
- @RequiresPermissions("system:type:list")
|
|
|
+ @RequiresPermissions("goods:type:list")
|
|
|
@PostMapping("/list")
|
|
|
@ResponseBody
|
|
|
- public TableDataInfo list(GoodsType goodsType)
|
|
|
+ public List<GoodsType> list(GoodsType goodsType)
|
|
|
{
|
|
|
- startPage();
|
|
|
List<GoodsType> list = goodsTypeService.selectGoodsTypeList(goodsType);
|
|
|
- return getDataTable(list);
|
|
|
+ return list;
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * 加载部门列表树
|
|
|
+ */
|
|
|
+ @GetMapping("/treeData")
|
|
|
+ @ResponseBody
|
|
|
+ public List<Ztree> treeData(GoodsType goodsType)
|
|
|
+ {
|
|
|
+ List<Ztree> ztrees = goodsTypeService.selectGoodsTypeTree(goodsType);
|
|
|
+ return ztrees;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 导出商品分类列列表
|
|
|
*/
|
|
|
- @RequiresPermissions("system:type:export")
|
|
|
+ @RequiresPermissions("goods:type:export")
|
|
|
@PostMapping("/export")
|
|
|
@ResponseBody
|
|
|
public AjaxResult export(GoodsType goodsType)
|
|
|
@@ -79,7 +96,7 @@ public class GoodsTypeController extends BaseController
|
|
|
/**
|
|
|
* 新增保存商品分类列
|
|
|
*/
|
|
|
- @RequiresPermissions("system:type:add")
|
|
|
+ @RequiresPermissions("goods:type:add")
|
|
|
@Log(title = "商品分类列", businessType = BusinessType.INSERT)
|
|
|
@PostMapping("/add")
|
|
|
@ResponseBody
|
|
|
@@ -102,7 +119,7 @@ public class GoodsTypeController extends BaseController
|
|
|
/**
|
|
|
* 修改保存商品分类列
|
|
|
*/
|
|
|
- @RequiresPermissions("system:type:edit")
|
|
|
+ @RequiresPermissions("goods:type:edit")
|
|
|
@Log(title = "商品分类列", businessType = BusinessType.UPDATE)
|
|
|
@PostMapping("/edit")
|
|
|
@ResponseBody
|
|
|
@@ -114,7 +131,7 @@ public class GoodsTypeController extends BaseController
|
|
|
/**
|
|
|
* 删除商品分类列
|
|
|
*/
|
|
|
- @RequiresPermissions("system:type:remove")
|
|
|
+ @RequiresPermissions("goods:type:remove")
|
|
|
@Log(title = "商品分类列", businessType = BusinessType.DELETE)
|
|
|
@PostMapping( "/remove")
|
|
|
@ResponseBody
|
|
|
@@ -122,4 +139,6 @@ public class GoodsTypeController extends BaseController
|
|
|
{
|
|
|
return toAjax(goodsTypeService.deleteGoodsTypeByIds(ids));
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
}
|