From 660acc64ee83cfd41ff57cdafafd16a25e2ef613 Mon Sep 17 00:00:00 2001 From: "kuang.yife" Date: Sat, 2 Mar 2024 20:54:15 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8D=E5=AD=97=E4=B8=8D=E6=98=BE=E7=A4=BA?= =?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/order/OrderController.java | 57 ++++++++++++++++--- 1 file changed, 49 insertions(+), 8 deletions(-) diff --git a/ghy-admin/src/main/java/com/ghy/web/controller/order/OrderController.java b/ghy-admin/src/main/java/com/ghy/web/controller/order/OrderController.java index 9b421539..96eee4c2 100644 --- a/ghy-admin/src/main/java/com/ghy/web/controller/order/OrderController.java +++ b/ghy-admin/src/main/java/com/ghy/web/controller/order/OrderController.java @@ -10,15 +10,9 @@ import com.ghy.customer.domain.Customer; import com.ghy.customer.domain.CustomerAddress; import com.ghy.customer.service.CustomerAddressService; import com.ghy.customer.service.CustomerService; -import com.ghy.goods.domain.DeptGoodsCategory; -import com.ghy.goods.domain.Goods; -import com.ghy.goods.domain.GoodsImgs; -import com.ghy.goods.domain.GoodsStandard; +import com.ghy.goods.domain.*; import com.ghy.goods.request.AppGoodsRequest; -import com.ghy.goods.service.DeptGoodsCategoryService; -import com.ghy.goods.service.GoodsImgsService; -import com.ghy.goods.service.GoodsService; -import com.ghy.goods.service.GoodsStandardService; +import com.ghy.goods.service.*; import com.ghy.order.domain.*; import com.ghy.order.request.AppOrderAssignRequest; import com.ghy.order.request.AppOrderRequest; @@ -111,6 +105,9 @@ public class OrderController extends BaseController { @Resource private GoodsImgsService goodsImgsService; + @Resource + private GoodsCategoryService goodsCategoryService; + @GetMapping("/imgs") public String orderImgs(Long orderId, ModelMap mmap){ @@ -1389,6 +1386,28 @@ public class OrderController extends BaseController { GoodsStandard goodsStandard = goodsStandardService.selectById(orderStandardList.get(0).getGoodsStandardId()); Goods goods = goodsService.selectById(goodsStandard.getGoodsId()); + // 填充商品三级类目 + if(goods.getDeptGoodsCategoryId() != null){ + DeptGoodsCategory deptGoodsCategory = deptGoodsCategoryService.get(goods.getDeptGoodsCategoryId()); + if(deptGoodsCategory == null){ + deptGoodsCategory = new DeptGoodsCategory(); + deptGoodsCategory.setGoodsCategoryId(goods.getDeptGoodsCategoryId()); + } + if(deptGoodsCategory != null){ + GoodsCategory one = goodsCategoryService.selectById(deptGoodsCategory.getGoodsCategoryId()); + if(one != null && one.getParentCategoryId() != null){ + GoodsCategory two = goodsCategoryService.selectById(one.getParentCategoryId()); + if(two != null && two.getParentCategoryId() != null){ + GoodsCategory three = goodsCategoryService.selectById(two.getParentCategoryId()); + if(three != null){ + goods.setGoodsName("【" + three.getGoodsCategoryName() + + "-" + two.getGoodsCategoryName() + + "-" + one.getGoodsCategoryName() + "】"); + } + } + } + } + } // 财务信息 FinancialMaster financialMaster = financialMasterService.selectByOrderMasterId(master.getId()); @@ -1492,6 +1511,28 @@ public class OrderController extends BaseController { GoodsStandard goodsStandard = goodsStandardService.selectById(orderStandardList.get(0).getGoodsStandardId()); Goods goods = goodsService.selectById(goodsStandard.getGoodsId()); + // 填充商品三级类目 + if(goods.getDeptGoodsCategoryId() != null){ + DeptGoodsCategory deptGoodsCategory = deptGoodsCategoryService.get(goods.getDeptGoodsCategoryId()); + if(deptGoodsCategory == null){ + deptGoodsCategory = new DeptGoodsCategory(); + deptGoodsCategory.setGoodsCategoryId(goods.getDeptGoodsCategoryId()); + } + if(deptGoodsCategory != null){ + GoodsCategory one = goodsCategoryService.selectById(deptGoodsCategory.getGoodsCategoryId()); + if(one != null && one.getParentCategoryId() != null){ + GoodsCategory two = goodsCategoryService.selectById(one.getParentCategoryId()); + if(two != null && two.getParentCategoryId() != null){ + GoodsCategory three = goodsCategoryService.selectById(two.getParentCategoryId()); + if(three != null){ + goods.setGoodsName("【" + three.getGoodsCategoryName() + + "-" + two.getGoodsCategoryName() + + "-" + one.getGoodsCategoryName() + "】"); + } + } + } + } + } // 财务信息 FinancialDetail financialDetail = financialDetailService.selectByOrderDetailId(detail.getId());