diff --git a/ghy-admin/src/main/java/com/ghy/web/controller/goods/GoodsCategoryController.java b/ghy-admin/src/main/java/com/ghy/web/controller/goods/GoodsCategoryController.java index 424902f3..3ff4d21b 100644 --- a/ghy-admin/src/main/java/com/ghy/web/controller/goods/GoodsCategoryController.java +++ b/ghy-admin/src/main/java/com/ghy/web/controller/goods/GoodsCategoryController.java @@ -72,11 +72,11 @@ public class GoodsCategoryController extends BaseController { @PostMapping("/add") @ResponseBody public AjaxResult addSave(@Validated GoodsCategory category) { - if (goodsCategoryService.checkGoodsCategoryNameUnique(category)) { - return error("新增商品类别'" + category.getGoodsCategoryName() + "'失败,商品类别名称已存在"); - } else if (goodsCategoryService.checkGoodsCategoryCodeUnique(category)) { - return error("新增商品类别'" + category.getGoodsCategoryCode() + "'失败,商品类别编码已存在"); - } +// if (goodsCategoryService.checkGoodsCategoryNameUnique(category)) { +// return error("新增商品类别'" + category.getGoodsCategoryName() + "'失败,商品类别名称已存在"); +// } else if (goodsCategoryService.checkGoodsCategoryCodeUnique(category)) { +// return error("新增商品类别'" + category.getGoodsCategoryCode() + "'失败,商品类别编码已存在"); +// } category.setCreateBy(getLoginName()); return toAjax(goodsCategoryService.insertGoodsCategory(category)); } @@ -104,11 +104,11 @@ public class GoodsCategoryController extends BaseController { @PostMapping("/edit") @ResponseBody public AjaxResult editSave(@Validated GoodsCategory category) { - if (goodsCategoryService.checkGoodsCategoryNameUnique(category)) { - return error("新增商品类别'" + category.getGoodsCategoryName() + "'失败,商品类别名称已存在"); - } else if (goodsCategoryService.checkGoodsCategoryCodeUnique(category)) { - return error("新增商品类别'" + category.getGoodsCategoryCode() + "'失败,商品类别编码已存在"); - } +// if (goodsCategoryService.checkGoodsCategoryNameUnique(category)) { +// return error("新增商品类别'" + category.getGoodsCategoryName() + "'失败,商品类别名称已存在"); +// } else if (goodsCategoryService.checkGoodsCategoryCodeUnique(category)) { +// return error("新增商品类别'" + category.getGoodsCategoryCode() + "'失败,商品类别编码已存在"); +// } category.setUpdateBy(getLoginName()); return toAjax(goodsCategoryService.updateGoodsCategory(category)); } diff --git a/ghy-admin/src/main/resources/templates/goods/category/category.html b/ghy-admin/src/main/resources/templates/goods/category/category.html index 1ed56c8b..a8d92bf8 100644 --- a/ghy-admin/src/main/resources/templates/goods/category/category.html +++ b/ghy-admin/src/main/resources/templates/goods/category/category.html @@ -53,6 +53,7 @@ var editFlag = [[${@permission.hasPermi('goods:category:edit')}]]; var removeFlag = [[${@permission.hasPermi('goods:category:remove')}]]; var datas = [[${@dict.getType('sys_normal_disable')}]]; + var levelData = [[${@dict.getType('sys_category_level')}]]; var prefix = ctx + "goods/category" $(function () { @@ -88,6 +89,14 @@ return $.table.selectDictLabel(datas, item.status); } }, + { + field: 'level', + title: '级别', + align: "left", + formatter: function (value, item, index) { + return $.table.selectDictLabel(levelData, item.level); + } + }, { field: 'createTime', title: '创建时间',