فهرست منبع

Merge branch 'dev' into 'mp-server-test'

Dev

See merge request quanshu/mp-server!607
jiang hao 2 سال پیش
والد
کامیت
295240f3d2

+ 2 - 2
mp-admin/src/main/java/com/qs/mp/web/controller/api/channel/mall/ChannelTicketController.java

@@ -60,7 +60,7 @@ public class ChannelTicketController extends BaseApiController {
   @ApiOperation(value = "盲票组列表" , notes = "获取所有盲票信息")
   public TableDataInfo list(@RequestBody TicketBoxParam param) {
     // TODO 根据标签过滤
-    startPage();
+
     Long channelId = SecurityUtils.getLoginUser().getChannelId();
     Channel channel = channelService.getById(channelId);
     List<Long> channelIds = new ArrayList<>();
@@ -84,7 +84,7 @@ public class ChannelTicketController extends BaseApiController {
         wrapper.or().in("t2.channel_id",channelIds);
       }
     });
-
+    startPage();
     List<TicketBox> ticketBoxes  = ticketBoxService.listBySaleChannel(queryWrapper);
 
 //    List<TicketBox> ticketBoxes = ticketBoxService.list(

+ 13 - 2
mp-admin/src/main/java/com/qs/mp/web/controller/api/user/UserExchangeController.java

@@ -129,12 +129,23 @@ public class UserExchangeController extends BaseApiController {
               .in(GoodsTagRel::getTagId, Arrays.asList(param.getTagIds().split(","))));
       goodsIds = goodsTagRelList.stream().map(GoodsTagRel::getGoodsId).collect(Collectors.toList());
     }
+    List<Long> categoryIdList = param.getCategoryIdList();
+    if (categoryIdList == null) {
+      categoryIdList = new ArrayList<>();
+    }
+    if (Objects.nonNull(param.getCategoryId()) && param.getCategoryId() != 0) {
+      List<GoodsCategory> goodsCategoryList = goodsCategoryService.list(new LambdaQueryWrapper<GoodsCategory>().eq(GoodsCategory::getParentId, param.getCategoryId()));
+      if (!CollectionUtils.isEmpty(goodsCategoryList)) {
+        List<Long> list = goodsCategoryList.stream().map(GoodsCategory::getCategoryId).collect(Collectors.toList());
+        categoryIdList.addAll(list);
+      }
+      categoryIdList.add(param.getCategoryId());
+    }
     startPage();
     LambdaQueryWrapper<Goods> queryWrapper = new LambdaQueryWrapper<Goods>()
-            .eq(null != param.getCategoryId() && 0 != param.getCategoryId(), Goods::getCategoryId, param.getCategoryIdList())
             .ge(null != param.getStartPrice() && 0 != param.getStartPrice(), Goods::getExchangePrice, param.getStartPrice())
             .le(null != param.getEndPrice() && 0 != param.getEndPrice(), Goods::getExchangePrice, param.getEndPrice())
-            .in(!CollectionUtils.isEmpty(param.getCategoryIdList()), Goods::getCategoryId, param.getCategoryIdList())
+            .in(!CollectionUtils.isEmpty(categoryIdList), Goods::getCategoryId, categoryIdList)
             .like(StringUtils.isNotBlank(param.getGoodsName()), Goods::getTitle, param.getGoodsName())
             .eq(Goods::getStatus, GoodsStatusEnum.PUT_ON)
             .eq(Goods::getExchangeShow, 1)