From d175b69f930a295abafdf3e45d9584263521ce54 Mon Sep 17 00:00:00 2001 From: "kuang.yife" Date: Sat, 18 Mar 2023 23:51:51 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B7=A5=E5=9C=88=E5=AD=90=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ghy/web/controller/goods/GoodsController.java | 9 +++++++++ .../web/controller/order/OrderMasterController.java | 11 +++++++++++ .../java/com/ghy/web/pojo/vo/OrderListResponse.java | 3 +++ .../service/impl/DeptGoodsCategoryServiceImpl.java | 1 + 4 files changed, 24 insertions(+) diff --git a/ghy-admin/src/main/java/com/ghy/web/controller/goods/GoodsController.java b/ghy-admin/src/main/java/com/ghy/web/controller/goods/GoodsController.java index 7a13ef90..5a1e6e35 100644 --- a/ghy-admin/src/main/java/com/ghy/web/controller/goods/GoodsController.java +++ b/ghy-admin/src/main/java/com/ghy/web/controller/goods/GoodsController.java @@ -277,6 +277,15 @@ public class GoodsController extends BaseController { try { Goods result = goodsService.selectById(goods.getGoodsId()); + // 补全商品类目及父级类目信息 + GoodsCategory goodsCategory = goodsCategoryService.selectById(result.getDeptGoodsCategoryId()); + result.setDeptGoodsCategoryName(goodsCategory.getGoodsCategoryName()); + if (goodsCategory.getParentCategoryId() != null) { + GoodsCategory parGoodsCategory = goodsCategoryService.selectById(goodsCategory.getParentCategoryId()); + result.setParGoodsCategoryId(parGoodsCategory.getGoodsCategoryId()); + result.setParGoodsCategoryName(parGoodsCategory.getGoodsCategoryName()); + } + // 补全商品图片信息 List goodsImgs = goodsImgsService.selectByGoodsId(result.getGoodsId()); Map> listMap = new HashMap<>(); diff --git a/ghy-admin/src/main/java/com/ghy/web/controller/order/OrderMasterController.java b/ghy-admin/src/main/java/com/ghy/web/controller/order/OrderMasterController.java index d1873a27..4e821382 100644 --- a/ghy-admin/src/main/java/com/ghy/web/controller/order/OrderMasterController.java +++ b/ghy-admin/src/main/java/com/ghy/web/controller/order/OrderMasterController.java @@ -15,8 +15,10 @@ import com.ghy.common.utils.poi.ExcelUtil; import com.ghy.customer.domain.CustomerAddress; import com.ghy.customer.service.CustomerAddressService; import com.ghy.goods.domain.Goods; +import com.ghy.goods.domain.GoodsArea; import com.ghy.goods.domain.GoodsImgs; import com.ghy.goods.domain.GoodsStandard; +import com.ghy.goods.service.GoodsAreaService; import com.ghy.goods.service.GoodsImgsService; import com.ghy.goods.service.GoodsService; import com.ghy.goods.service.GoodsStandardService; @@ -49,6 +51,7 @@ import com.ghy.worker.service.WorkerService; import com.huifu.adapay.core.exception.BaseAdaPayException; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.ModelMap; import org.springframework.validation.annotation.Validated; @@ -74,6 +77,10 @@ public class OrderMasterController extends BaseController { @Resource private OrderMasterService orderMasterService; + + @Autowired + private GoodsAreaService goodsAreaService; + @Resource private WorkerService workerService; @Resource @@ -529,6 +536,9 @@ public class OrderMasterController extends BaseController { GoodsStandard goodsStandard = goodsStandardService.selectById(orderStandardList.get(0).getGoodsStandardId()); Goods goods = goodsService.selectById(goodsStandard.getGoodsId()); + // 补全商品服务区域 + List goodsAreas = goodsAreaService.selectByGoodsId(goods.getGoodsId()); + goods.setGoodsAreaList(goodsAreas); // 地址信息 CustomerAddress customerAddress = addressService.selectByCustomerAddressId(orderMaster.getAddressId()); @@ -593,6 +603,7 @@ public class OrderMasterController extends BaseController { orderListResponse.setOrderStandardDetailList(orderStandardDetails); orderListResponse.setOrderTimeoutRecords(timeoutRecords); orderListResponse.setFinalRecvMoney(finalRecvMoney); + orderListResponse.setGoodsAreaList(goods.getGoodsAreaList()); return AjaxResult.success(orderListResponse); } catch (Exception e) { diff --git a/ghy-admin/src/main/java/com/ghy/web/pojo/vo/OrderListResponse.java b/ghy-admin/src/main/java/com/ghy/web/pojo/vo/OrderListResponse.java index d517502a..f5ac7ff8 100644 --- a/ghy-admin/src/main/java/com/ghy/web/pojo/vo/OrderListResponse.java +++ b/ghy-admin/src/main/java/com/ghy/web/pojo/vo/OrderListResponse.java @@ -2,6 +2,7 @@ package com.ghy.web.pojo.vo; import com.alibaba.fastjson.annotation.JSONField; import com.fasterxml.jackson.annotation.JsonFormat; +import com.ghy.goods.domain.GoodsArea; import com.ghy.order.domain.AfterServiceRecord; import com.ghy.payment.domain.FinancialChangeRecord; import com.ghy.payment.domain.OrderTimeoutRecord; @@ -111,4 +112,6 @@ public class OrderListResponse { private Integer ledgerAccountStatus; private List financialChangeRecords; + + private List goodsAreaList; } diff --git a/ghy-goods/src/main/java/com/ghy/goods/service/impl/DeptGoodsCategoryServiceImpl.java b/ghy-goods/src/main/java/com/ghy/goods/service/impl/DeptGoodsCategoryServiceImpl.java index 9f60ea01..17f494ef 100644 --- a/ghy-goods/src/main/java/com/ghy/goods/service/impl/DeptGoodsCategoryServiceImpl.java +++ b/ghy-goods/src/main/java/com/ghy/goods/service/impl/DeptGoodsCategoryServiceImpl.java @@ -152,6 +152,7 @@ public class DeptGoodsCategoryServiceImpl implements DeptGoodsCategoryService { private void fillChild(List goodsCategoryList) { List childList; for (DeptGoodsCategory deptGoodsCategory : goodsCategoryList) { + deptGoodsCategory.setDeptGoodsCategoryId(null); childList = deptGoodsCategoryMapper.appList(deptGoodsCategory); if (childList.size() > 0) { deptGoodsCategory.setChild(childList);