‘linchangsheng’ 2 minggu lalu
induk
melakukan
9778271547

+ 10 - 1
src/main/java/com/gree/mall/manager/logic/goods/GoodsLogic.java

@@ -447,7 +447,10 @@ public class GoodsLogic {
         }
 
         GoodsCategory goodsCategory = goodsCategoryService.getById(goodsBean.getCategoryId());
-
+        GoodsCategory goodsCategoryPid = goodsCategoryService.getById(goodsCategory.getParentId());
+        goodsBean.setCategoryName(goodsCategory.getName());
+        goodsBean.setCategoryPname(goodsCategoryPid.getName());
+        goodsBean.setCategoryPid(goodsCategoryPid.getCategoryId());
         goodsService.save(goodsBean);
 
         if (CollectionUtils.isNotEmpty(goodsBean.getGoodsSpecs())) {
@@ -572,6 +575,12 @@ public class GoodsLogic {
             throw new RemoteServiceException("至少要有一个规格!");
         }
 
+        GoodsCategory goodsCategory = goodsCategoryService.getById(goodsBean.getCategoryId());
+        GoodsCategory goodsCategoryPid = goodsCategoryService.getById(goodsCategory.getParentId());
+        goodsBean.setCategoryName(goodsCategory.getName());
+        goodsBean.setCategoryPname(goodsCategoryPid.getName());
+        goodsBean.setCategoryPid(goodsCategoryPid.getCategoryId());
+
         //设置企业微信id
         AdminUserCom adminUser = commonLogic.getAdminUser(request);