|  |  | 
 |  |  | import cc.mrbird.febs.common.exception.FebsException; | 
 |  |  | import cc.mrbird.febs.mall.conversion.MallGoodsConversion; | 
 |  |  | import cc.mrbird.febs.mall.conversion.MallMemberConversion; | 
 |  |  | import cc.mrbird.febs.mall.dto.ApiMallGoodsCommentDto; | 
 |  |  | import cc.mrbird.febs.mall.dto.MallGoodsQueryDto; | 
 |  |  | import cc.mrbird.febs.mall.entity.MallGoods; | 
 |  |  | import cc.mrbird.febs.mall.entity.MallGoodsComment; | 
 |  |  | import cc.mrbird.febs.mall.mapper.MallGoodsCommentMapper; | 
 |  |  | import cc.mrbird.febs.mall.mapper.MallGoodsImagesMapper; | 
 |  |  | import cc.mrbird.febs.mall.mapper.MallGoodsMapper; | 
 |  |  | import cc.mrbird.febs.mall.service.IApiMallGoodsService; | 
 |  |  | import cc.mrbird.febs.mall.vo.MallGoodsCommentVo; | 
 |  |  | import cc.mrbird.febs.mall.vo.MallGoodsDetailsVo; | 
 |  |  | import cc.mrbird.febs.mall.vo.MallGoodsListVo; | 
 |  |  | import cn.hutool.core.collection.CollUtil; | 
 |  |  | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | 
 |  |  | import com.baomidou.mybatisplus.core.metadata.IPage; | 
 |  |  | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | 
 |  |  | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | 
 |  |  | 
 |  |  | public class ApiMallGoodsServiceImpl extends ServiceImpl<MallGoodsMapper, MallGoods> implements IApiMallGoodsService { | 
 |  |  |  | 
 |  |  |     private final MallGoodsImagesMapper goodsImagesMapper; | 
 |  |  |     private final MallGoodsCommentMapper mallGoodsCommentMapper; | 
 |  |  |  | 
 |  |  |  | 
 |  |  |     @Override | 
 |  |  |     public IPage<MallGoodsListVo> findMallGoodsListInPage(MallGoodsQueryDto queryDto) { | 
 |  |  | 
 |  |  |             mallGoodsDetailsVo.setVolume(stockAndVolume.get("volume").intValue()); | 
 |  |  |         } | 
 |  |  |         mallGoodsDetailsVo.setImages(images); | 
 |  |  |  | 
 |  |  |         QueryWrapper<MallGoodsComment> objectQueryWrapper = new QueryWrapper<>(); | 
 |  |  |         objectQueryWrapper.eq("goods_id",id); | 
 |  |  |         Integer commentCount = mallGoodsCommentMapper.selectCount(objectQueryWrapper); | 
 |  |  |         mallGoodsDetailsVo.setCommentCount(commentCount); | 
 |  |  |         Integer scorePercent = mallGoodsDetailsVo.getScorePercent(); | 
 |  |  |         mallGoodsDetailsVo.setScorePercentNum(new BigDecimal(scorePercent).multiply(new BigDecimal(0.01))); | 
 |  |  |  | 
 |  |  |         return mallGoodsDetailsVo; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     @Override | 
 |  |  |     public IPage<MallGoodsCommentVo> findMallGoodsCommentByGoodsId(ApiMallGoodsCommentDto queryDto) { | 
 |  |  |         Page<MallGoodsCommentVo> page = new Page<>(queryDto.getPageNow(), queryDto.getPageSize()); | 
 |  |  |         MallGoodsComment mallGoodsComment = new MallGoodsComment(); | 
 |  |  |         mallGoodsComment.setGoodsId(queryDto.getGoodsId()); | 
 |  |  |         return this.baseMapper.selectMallGoodsCommentListQueryInPage(page,mallGoodsComment); | 
 |  |  |     } | 
 |  |  | } |