| | |
| | | )); |
| | | for (GoodsVO good : distinctGoods) { |
| | | //价格 |
| | | Price price = getPrice( good.getGoodsId()); |
| | | if(null != price){ |
| | | //秒杀活动 |
| | | good.setSellingPrice(price.getCash()); |
| | | good.setIntegral(price.getPoint()); |
| | | good.setStartTime(price.getStartTime()); |
| | | good.setEndTime(price.getEndTime()); |
| | | good.setPurchaseLimit(price.getPurchaseLimit()); |
| | | } |
| | | // Price price = getPrice( good.getGoodsId()); |
| | | // if(null != price){ |
| | | // //秒杀活动 |
| | | // good.setSellingPrice(price.getCash()); |
| | | // good.setIntegral(price.getPoint()); |
| | | // good.setStartTime(price.getStartTime()); |
| | | // good.setEndTime(price.getEndTime()); |
| | | // good.setPurchaseLimit(price.getPurchaseLimit()); |
| | | // } |
| | | Integer point = getPoint(good.getSellingPrice()); |
| | | good.setIntegral(point); |
| | | Integer data = orderClient.getGoodsSaleNum(good.getGoodsId(), 1).getData(); |
| | | good.setSaleNum(data); |
| | | } |
| | |
| | | goodsVO.setEditNum(goods.getPurchaseLimit()); |
| | | |
| | | //计算所需价格和积分 |
| | | Price price = getPrice( goods.getId()); |
| | | if(null != price){ |
| | | //在秒杀活动时间段内 |
| | | goodsVO.setSellingPrice(price.getCash()); |
| | | goodsVO.setIntegral(price.getPoint()); |
| | | goodsVO.setStartTime(price.getStartTime()); |
| | | goodsVO.setEndTime(price.getEndTime()); |
| | | } |
| | | // Price price = getPrice( goods.getId()); |
| | | // if(null != price){ |
| | | // //在秒杀活动时间段内 |
| | | // goodsVO.setSellingPrice(price.getCash()); |
| | | // goodsVO.setIntegral(price.getPoint()); |
| | | // goodsVO.setStartTime(price.getStartTime()); |
| | | // goodsVO.setEndTime(price.getEndTime()); |
| | | // } |
| | | Integer point = getPoint(goodsVO.getSellingPrice()); |
| | | goodsVO.setIntegral(point); |
| | | //已售数量 |
| | | Integer data = orderClient.getGoodsSaleNum(goods.getId(), 1).getData(); |
| | | goodsVO.setSaleNum(data); |
| | |
| | | |
| | | //商品评价 |
| | | GoodsEvaluate goodsEvaluateOne = goodsEvaluateMapper.getGoodsEvaluateOne(goods.getId()); |
| | | AppUser appUserById = appUserClient.getAppUserById(goodsEvaluateOne.getAppUserId()); |
| | | goodsEvaluateOne.setUserName(appUserById.getName()); |
| | | goodsEvaluateOne.setAvatar(appUserById.getAvatar()); |
| | | goodsVO.setGoodsEvaluate(goodsEvaluateOne); |
| | | if(goodsEvaluateOne != null){ |
| | | AppUser appUserById = appUserClient.getAppUserById(goodsEvaluateOne.getAppUserId()); |
| | | goodsEvaluateOne.setUserName(appUserById.getName()); |
| | | goodsEvaluateOne.setAvatar(appUserById.getAvatar()); |
| | | goodsVO.setGoodsEvaluate(goodsEvaluateOne); |
| | | } |
| | | return goodsVO; |
| | | |
| | | } |