From d31a921bb107eefbe18cc635c7f35e674a87af84 Mon Sep 17 00:00:00 2001 From: "kuang.yife" Date: Mon, 9 Jan 2023 15:06:55 +0800 Subject: [PATCH] =?UTF-8?q?=E7=B1=BB=E7=9B=AE=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../goods/GoodsCategoryController.java | 20 +++++++++---------- .../templates/goods/category/category.html | 9 +++++++++ 2 files changed, 19 insertions(+), 10 deletions(-) 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: '创建时间',