From 5b8fe3cd58acd980b4d5ad75e4e18f49400447b0 Mon Sep 17 00:00:00 2001 From: cb <275647614@qq.com> Date: Tue, 10 Jun 2025 16:55:31 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=B1=BB=E7=9B=AE=E4=B8=AD?= =?UTF-8?q?=E7=9A=84=E8=AE=BE=E7=BD=AE=E7=9A=84=E6=97=B6=E5=80=99=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E5=85=A8=E9=83=A8=E7=9A=84=E7=B1=BB=E7=9B=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/ghy/goods/domain/DeptGoodsCategory.java | 2 ++ .../service/impl/DeptGoodsCategoryServiceImpl.java | 12 ++++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) 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 a4b8232f..88669ec3 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 @@ -106,4 +106,6 @@ public class DeptGoodsCategory extends GoodsCategory { private String shopInsuranceIds; private Long customerId; + + private Integer isSetting; } 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 74a31b3c..b47cc155 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 @@ -105,10 +105,14 @@ public class DeptGoodsCategoryServiceImpl implements DeptGoodsCategoryService { List goodsCategoryList =new ArrayList<>(); log.info("用户id{}获取到的类目列表{}",customerId,customerSelections); // 第一层 - for (CustomerSelection customerSelection1 : customerSelections) { - DeptGoodsCategory deptGoodsCategory1=deptGoodsCategoryMapper.selectOneByGoodsCategoryId(customerSelection1.getDeptCategoryId()); - if (customerSelection1.getSelectionType()==1&& Objects.equals(deptGoodsCategory.getType(), deptGoodsCategory1.getType())){ - goodsCategoryList.add(deptGoodsCategory1); + if (deptGoodsCategory.getIsSetting()==1){ + goodsCategoryList = deptGoodsCategoryMapper.appList(deptGoodsCategory); + }else{ + for (CustomerSelection customerSelection1 : customerSelections) { + DeptGoodsCategory deptGoodsCategory1=deptGoodsCategoryMapper.selectOneByGoodsCategoryId(customerSelection1.getDeptCategoryId()); + if (customerSelection1.getSelectionType()==1&& Objects.equals(deptGoodsCategory.getType(), deptGoodsCategory1.getType())){ + goodsCategoryList.add(deptGoodsCategory1); + } } } log.info("筛选完的类目列表{}",goodsCategoryList);