|
|
|
@ -227,8 +227,7 @@ public class YxStoreSeckillServiceImpl extends BaseServiceImpl<YxStoreSeckillMap
|
|
|
|
|
return StoreSeckillVo.builder() |
|
|
|
|
.productAttr((List<YxStoreProductAttrQueryVo>)returnMap.get("productAttr")) |
|
|
|
|
.productValue((Map<String, YxStoreProductAttrValue>)returnMap.get("productValue")) |
|
|
|
|
.storeInfo(generator.convert(storeSeckill, YxStoreSeckillQueryVo.class).setConfig(storeProductMapper.selectById(storeSeckill.getProductId()).getConfig()) |
|
|
|
|
.setLinkImage(storeProductMapper.selectById(storeSeckill.getProductId()).getLinkImage())) |
|
|
|
|
.storeInfo(generator.convert(storeSeckill, YxStoreSeckillQueryVo.class).setConfig(storeProductMapper.selectById(storeSeckill.getProductId()).getConfig())) |
|
|
|
|
.reply(replyService.getReply(storeSeckill.getProductId())) |
|
|
|
|
.replyCount(replyService.productReplyCount(storeSeckill.getProductId())) |
|
|
|
|
.tempName(tempName) |
|
|
|
@ -272,8 +271,12 @@ public class YxStoreSeckillServiceImpl extends BaseServiceImpl<YxStoreSeckillMap
|
|
|
|
|
YxStoreSeckillQueryVo.class); |
|
|
|
|
yxStoreSeckillQueryVos.forEach(item->{ |
|
|
|
|
Integer sum = item.getSales() + item.getStock(); |
|
|
|
|
item.setPercent(NumberUtil.round(NumberUtil.mul(NumberUtil.div(item.getSales(),sum), |
|
|
|
|
100),0).intValue()); |
|
|
|
|
if (sum==0){ |
|
|
|
|
item.setPercent(100); |
|
|
|
|
}else { |
|
|
|
|
item.setPercent(NumberUtil.round(NumberUtil.mul(NumberUtil.div(item.getSales(),sum), |
|
|
|
|
100),0).intValue()); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
return yxStoreSeckillQueryVos; |
|
|
|
|
} |
|
|
|
@ -317,8 +320,13 @@ public class YxStoreSeckillServiceImpl extends BaseServiceImpl<YxStoreSeckillMap
|
|
|
|
|
(yxStoreSeckillMapper.selectPage(pageModel,wrapper).getRecords(), YxStoreSeckillQueryVo.class); |
|
|
|
|
yxStoreSeckillQueryVos.forEach(item->{ |
|
|
|
|
Integer sum = item.getSales() + item.getStock(); |
|
|
|
|
item.setPercent(NumberUtil.round(NumberUtil.mul(NumberUtil.div(item.getSales(),sum), |
|
|
|
|
100),0).intValue()); |
|
|
|
|
if (sum==0){ |
|
|
|
|
item.setPercent(100); |
|
|
|
|
}else { |
|
|
|
|
item.setPercent(NumberUtil.round(NumberUtil.mul(NumberUtil.div(item.getSales(),sum), |
|
|
|
|
100),0).intValue()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
return yxStoreSeckillQueryVos; |
|
|
|
|
} |
|
|
|
@ -464,6 +472,7 @@ public class YxStoreSeckillServiceImpl extends BaseServiceImpl<YxStoreSeckillMap
|
|
|
|
|
yxStoreSeckill.setCost(BigDecimal.valueOf(resultDTO.getMinCost())); |
|
|
|
|
yxStoreSeckill.setStock(resultDTO.getStock()); |
|
|
|
|
yxStoreSeckill.setImages(String.join(",", resources.getImages())); |
|
|
|
|
yxStoreSeckill.setLinkImage(resources.getLinkImage()); |
|
|
|
|
this.saveOrUpdate(yxStoreSeckill); |
|
|
|
|
|
|
|
|
|
//属性处理
|
|
|
|
|