|
@@ -347,48 +347,17 @@ public class ExamApplyServiceImpl extends ServiceImpl<ExamApplyMapper, ExamApply
|
|
|
return tableDataInfo;
|
|
|
}
|
|
|
ActivityRecommend activityRecommend = list.stream().findFirst().get();
|
|
|
- com.baomidou.mybatisplus.extension.plugins.pagination.Page<ActivityRecommendGoods> page =
|
|
|
- iActivityRecommendGoodsService.page(new com.baomidou.mybatisplus.extension.plugins.pagination.Page<>(bo.getPageNum(), bo.getPageSize()),
|
|
|
- new LambdaQueryWrapper<ActivityRecommendGoods>()
|
|
|
- .eq(ActivityRecommendGoods::getRecommendId, activityRecommend.getRecommendId())
|
|
|
- .orderByAsc(ActivityRecommendGoods::getSort));
|
|
|
+ com.baomidou.mybatisplus.extension.plugins.pagination.Page<GoodsVo> page =
|
|
|
+ iActivityRecommendGoodsService.getGoodsListByPage(new com.baomidou.mybatisplus.extension.plugins.pagination.Page<>(bo.getPageNum(), bo.getPageSize()),activityRecommend.getRecommendId());
|
|
|
+
|
|
|
if (CollectionUtils.isEmpty(page.getRecords())){
|
|
|
return tableDataInfo;
|
|
|
}
|
|
|
|
|
|
- List<ActivityRecommendGoods> result = page.getRecords();
|
|
|
- List<ActivityRecommendGoodsVo> listVos = new ArrayList<>();
|
|
|
- for (ActivityRecommendGoods item : result) {
|
|
|
- Goods goods = iGoodsService.getOne(new LambdaQueryWrapper<Goods>()
|
|
|
- .eq(Goods::getGoodsId, item.getGoodsId())
|
|
|
- .eq(Goods::getGoodsStatus, 1));
|
|
|
- if (ObjectUtils.isNotNull(goods)){
|
|
|
- ActivityRecommendGoodsVo vo = new ActivityRecommendGoodsVo();
|
|
|
- BeanUtil.copyProperties(item, vo);
|
|
|
- vo.setGoodsName(goods.getGoodsName());
|
|
|
- vo.setGoodsType(goods.getGoodsType());
|
|
|
- vo.setCoverUrl(goods.getCoverUrl());
|
|
|
- vo.setYear(goods.getYear());
|
|
|
- vo.setStandPrice(goods.getStandPrice());
|
|
|
- vo.setLinePrice(goods.getLinePrice());
|
|
|
- listVos.add(vo);
|
|
|
- }
|
|
|
- }
|
|
|
tableDataInfo.setTotal(page.getTotal());
|
|
|
- tableDataInfo.setRows(listVos);
|
|
|
+ tableDataInfo.setRows(page.getRecords());
|
|
|
tableDataInfo.setCode(200);
|
|
|
return tableDataInfo;
|
|
|
-// List<GoodsVo> result = page.getRecords().stream().map(item -> {
|
|
|
-// Goods goods = iGoodsService.getById(item.getGoodsId());
|
|
|
-// GoodsVo goodsVo = new GoodsVo();
|
|
|
-// BeanUtil.copyProperties(goods, goodsVo);
|
|
|
-// return goodsVo;
|
|
|
-// }).collect(Collectors.toList());
|
|
|
-//
|
|
|
-// tableDataInfo.setTotal(page.getTotal());
|
|
|
-// tableDataInfo.setRows(result);
|
|
|
-// tableDataInfo.setCode(200);
|
|
|
-// return tableDataInfo;
|
|
|
}
|
|
|
|
|
|
private boolean checkNameUnique(ExamApply entity) {
|