...
|
...
|
@@ -6,6 +6,7 @@ import com.yoho.core.common.helpers.ImagesHelper; |
|
|
import com.yoho.core.common.utils.DateUtil;
|
|
|
import com.yoho.core.rest.client.ServiceCaller;
|
|
|
import com.yoho.error.exception.ServiceException;
|
|
|
import com.yohobuy.platform.dal.common.BeanConvertUtil;
|
|
|
import com.yohobuy.platform.dal.grass.IGrassGoodsCommentDao;
|
|
|
import com.yohobuy.platform.dal.grass.IGrassGoodsDao;
|
|
|
import com.yohobuy.platform.dal.grass.model.GrassGoods;
|
...
|
...
|
@@ -63,14 +64,14 @@ public class GrassGoodsServiceImpl implements IGrassGoodsService{ |
|
|
logger.info("queryGoods#selectTotalByGoodsQueryReq total is 0.param is {}",req);
|
|
|
return result;
|
|
|
}
|
|
|
List<GoodsQueryRsp> goodsBoList = grassGoodsDao.selectByGoodsQueryReq(req);
|
|
|
List<GoodsQueryRsp> goodsBoList = BeanConvertUtil.convertList(grassGoodsDao.selectByGoodsQueryReq(req),GoodsQueryRsp.class);
|
|
|
if(CollectionUtils.isEmpty(goodsBoList)){
|
|
|
logger.info("queryGoods#selectByGoodsQueryReq goodsBoList is empty.param is {}",req);
|
|
|
return result;
|
|
|
}
|
|
|
// 查询评论总数
|
|
|
List<Integer> goodsIds = goodsBoList.stream().map(goods->goods.getId()).collect(Collectors.toList());
|
|
|
Map<Integer,GoodsCommentTotalBo> commentMap = grassGoodsCommentDao.selectTotalMapByGoodsIds(goodsIds);
|
|
|
Map<Integer,GoodsCommentTotalBo> commentMap = BeanConvertUtil.convertMap(grassGoodsCommentDao.selectTotalMapByGoodsIds(goodsIds),GoodsCommentTotalBo.class);
|
|
|
// 查询商品信息
|
|
|
String skns = goodsBoList.stream().filter(goods-> StringUtils.isNotBlank(goods.getProductSkn())).map(goods->goods.getProductSkn()).collect(Collectors.joining(","));
|
|
|
Map<String,JSONObject> productMap = buildProductMap(skns,1);
|
...
|
...
|
|