|
@@ -21,6 +21,7 @@ import com.zhongzheng.modules.activity.vo.ActivityRecommendGoodsVo;
|
|
import com.zhongzheng.modules.activity.vo.ActivityRecommendVo;
|
|
import com.zhongzheng.modules.activity.vo.ActivityRecommendVo;
|
|
import com.zhongzheng.modules.goods.domain.Goods;
|
|
import com.zhongzheng.modules.goods.domain.Goods;
|
|
import com.zhongzheng.modules.goods.service.IGoodsService;
|
|
import com.zhongzheng.modules.goods.service.IGoodsService;
|
|
|
|
+import com.zhongzheng.modules.goods.vo.GoodsVo;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
@@ -169,33 +170,13 @@ public class ActivityRecommendServiceImpl extends ServiceImpl<ActivityRecommendM
|
|
@Override
|
|
@Override
|
|
public TableDataInfo<ActivityRecommendGoodsVo> getGoodsList(ActivityRecommendGoodsQueryBo bo) {
|
|
public TableDataInfo<ActivityRecommendGoodsVo> getGoodsList(ActivityRecommendGoodsQueryBo bo) {
|
|
TableDataInfo<ActivityRecommendGoodsVo> result = new TableDataInfo<>();
|
|
TableDataInfo<ActivityRecommendGoodsVo> result = new TableDataInfo<>();
|
|
- 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, bo.getRecommendId())
|
|
|
|
- .orderByAsc(ActivityRecommendGoods::getSort));
|
|
|
|
|
|
+ com.baomidou.mybatisplus.extension.plugins.pagination.Page<ActivityRecommendGoodsVo> page =
|
|
|
|
+ iActivityRecommendGoodsService.getRecommendGoodsListByPage(new com.baomidou.mybatisplus.extension.plugins.pagination.Page<>(bo.getPageNum(), bo.getPageSize()),bo.getRecommendId());
|
|
if (CollectionUtils.isEmpty(page.getRecords())){
|
|
if (CollectionUtils.isEmpty(page.getRecords())){
|
|
return result;
|
|
return result;
|
|
}
|
|
}
|
|
- List<ActivityRecommendGoods> list = page.getRecords();
|
|
|
|
- List<ActivityRecommendGoodsVo> listVos = new ArrayList<>();
|
|
|
|
- for (ActivityRecommendGoods item : list) {
|
|
|
|
- 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);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
result.setTotal(page.getTotal());
|
|
result.setTotal(page.getTotal());
|
|
- result.setRows(listVos);
|
|
|
|
|
|
+ result.setRows(page.getRecords());
|
|
result.setCode(200);
|
|
result.setCode(200);
|
|
return result;
|
|
return result;
|
|
}
|
|
}
|