From 4ae8d364b94056bb9259270f205c3b55ad16dde0 Mon Sep 17 00:00:00 2001 From: hupeng Date: Mon, 30 Sep 2019 14:59:24 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=95=86=E5=93=81=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E5=88=86=E7=B1=BB=E4=B8=8D=E6=98=BE=E7=A4=BA=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web/controller/shop/StoreGoodsController.java | 6 ++++++ .../src/main/resources/templates/shop/goods/edit.html | 2 +- .../main/java/com/ruoyi/shop/domain/StoreGoods.java | 10 ++++++++++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/shop/StoreGoodsController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/shop/StoreGoodsController.java index 9cb7a20..cb89516 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/shop/StoreGoodsController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/shop/StoreGoodsController.java @@ -63,6 +63,9 @@ public class StoreGoodsController extends BaseController @Autowired private IStoreSpecGoodsPriceService storeSpecGoodsPriceService; + @Autowired + private IStoreGoodsCateService storeGoodsCateService; + @RequiresPermissions("shop:goods:view") @GetMapping() public String goods() @@ -477,6 +480,9 @@ public class StoreGoodsController extends BaseController public String edit(@PathVariable("goodsId") Integer goodsId, ModelMap mmap) { StoreGoods storeGoods = storeGoodsService.selectStoreGoodsById(goodsId); + StoreGoodsCate storeGoodsCate = storeGoodsCateService + .selectStoreGoodsCateById(storeGoods.getCateId()); + storeGoods.setCateName(storeGoodsCate.getCateTitle()); mmap.put("storeGoods", storeGoods); return prefix + "/edit"; } diff --git a/ruoyi-admin/src/main/resources/templates/shop/goods/edit.html b/ruoyi-admin/src/main/resources/templates/shop/goods/edit.html index 384d5a3..9a0683a 100644 --- a/ruoyi-admin/src/main/resources/templates/shop/goods/edit.html +++ b/ruoyi-admin/src/main/resources/templates/shop/goods/edit.html @@ -12,7 +12,7 @@
- +
diff --git a/ruoyi-system/src/main/java/com/ruoyi/shop/domain/StoreGoods.java b/ruoyi-system/src/main/java/com/ruoyi/shop/domain/StoreGoods.java index f15afca..8425214 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/shop/domain/StoreGoods.java +++ b/ruoyi-system/src/main/java/com/ruoyi/shop/domain/StoreGoods.java @@ -24,6 +24,8 @@ public class StoreGoods extends BaseEntity private String brandName; + private String cateName; + //private /** 扩展分类id */ @@ -165,6 +167,14 @@ public class StoreGoods extends BaseEntity /** 视频 */ private String goodsVideo; + public String getCateName() { + return cateName; + } + + public void setCateName(String cateName) { + this.cateName = cateName; + } + public String getBrandName() { return brandName; }