From c747158393ac6a20270d8c04dd9f8f8c319b92cb Mon Sep 17 00:00:00 2001
From: cb <275647614@qq.com>
Date: Mon, 26 May 2025 16:17:34 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=B1=BB=E7=9B=AE=E8=AE=BE?=
=?UTF-8?q?=E7=BD=AE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
ghy-goods/pom.xml | 4 ++++
.../ghy/goods/domain/DeptGoodsCategory.java | 1 +
.../impl/DeptGoodsCategoryServiceImpl.java | 23 ++++++++++++++++++-
3 files changed, 27 insertions(+), 1 deletion(-)
diff --git a/ghy-goods/pom.xml b/ghy-goods/pom.xml
index 850b6717..13f47887 100644
--- a/ghy-goods/pom.xml
+++ b/ghy-goods/pom.xml
@@ -22,6 +22,10 @@
com.ghy
ghy-common
+
+ com.ghy
+ ghy-custom
+
diff --git a/ghy-goods/src/main/java/com/ghy/goods/domain/DeptGoodsCategory.java b/ghy-goods/src/main/java/com/ghy/goods/domain/DeptGoodsCategory.java
index 03c722a2..a4b8232f 100644
--- a/ghy-goods/src/main/java/com/ghy/goods/domain/DeptGoodsCategory.java
+++ b/ghy-goods/src/main/java/com/ghy/goods/domain/DeptGoodsCategory.java
@@ -105,4 +105,5 @@ public class DeptGoodsCategory extends GoodsCategory {
private String shopInsuranceIds;
+ private Long customerId;
}
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 58aaefd2..e801a919 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
@@ -6,6 +6,10 @@ import com.ghy.common.core.domain.Ztree;
import com.ghy.common.core.text.Convert;
import com.ghy.common.utils.StringUtils;
import com.ghy.common.utils.bean.BeanUtils;
+import com.ghy.customer.domain.Customer;
+import com.ghy.customer.domain.CustomerSelection;
+import com.ghy.customer.service.CustomerService;
+import com.ghy.customer.service.ICustomerSelectionService;
import com.ghy.goods.domain.DeptGoodsCategory;
import com.ghy.goods.domain.GoodsCategory;
import com.ghy.goods.domain.GoodsImgs;
@@ -36,6 +40,11 @@ public class DeptGoodsCategoryServiceImpl implements DeptGoodsCategoryService {
private DeptGoodsCategoryMapper deptGoodsCategoryMapper;
@Resource
private GoodsImgsService goodsImgsService;
+ @Resource
+ private CustomerService customerService;
+ @Resource
+ private ICustomerSelectionService customerSelectionService;
+
@Override
public List list(DeptGoodsCategory category) {
@@ -85,8 +94,20 @@ public class DeptGoodsCategoryServiceImpl implements DeptGoodsCategoryService {
@Override
public List appList(DeptGoodsCategory deptGoodsCategory) {
+ Customer customer= customerService.selectByCustomerId(deptGoodsCategory.getCustomerId());
+ Long customerId=customer.getCustomerPlace();
+ if (customer.getPlaceStatus()==2){
+ customerId=customer.getCustomerId();
+ }
+ CustomerSelection customerSelection=new CustomerSelection();
+ customerSelection.setCustomerId(customerId);
+ List customerSelections=customerSelectionService.selectCustomerSelectionList(customerSelection);
+ List goodsCategoryList =new ArrayList<>();
+ for (CustomerSelection customerSelection1 : customerSelections) {
+ DeptGoodsCategory deptGoodsCategory1=deptGoodsCategoryMapper.selectOneByGoodsCategoryId(customerSelection1.getDeptCategoryId());
+ goodsCategoryList.add(deptGoodsCategory1);
+ }
// 第一层
- List goodsCategoryList = deptGoodsCategoryMapper.appList(deptGoodsCategory);
// 第二层
this.fillChild(goodsCategoryList);
// 第三层