记得上下班打卡 | git大法好,push需谨慎

Commit 022f3d73 authored by 胡佳晨's avatar 胡佳晨

添加 spu销量

parent 02a6b5a3
...@@ -579,7 +579,7 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService { ...@@ -579,7 +579,7 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService {
for (String orderSkuVoIds : skuList) { for (String orderSkuVoIds : skuList) {
GoblinOrderSkuVo orderSkuVo = redisUtils.getGoblinOrderSkuVo(orderSkuVoIds); GoblinOrderSkuVo orderSkuVo = redisUtils.getGoblinOrderSkuVo(orderSkuVoIds);
//增加销量 //增加销量
redisUtils.incrSkuSaleCount(orderSkuVo.getSkuId(), orderSkuVo.getNum()); redisUtils.incrSkuSaleCount(orderSkuVo.getSpuId(),orderSkuVo.getSkuId(), orderSkuVo.getNum());
orderSkuVo.setStatus(GoblinStatusConst.Status.ORDER_STATUS_2.getValue()); orderSkuVo.setStatus(GoblinStatusConst.Status.ORDER_STATUS_2.getValue());
//redis //redis
redisUtils.setGoblinOrderSku(orderSkuVo.getOrderSkuId(), orderSkuVo); redisUtils.setGoblinOrderSku(orderSkuVo.getOrderSkuId(), orderSkuVo);
......
...@@ -484,14 +484,16 @@ public class GoblinRedisUtils { ...@@ -484,14 +484,16 @@ public class GoblinRedisUtils {
} }
// 增加 sku销量 // 增加 sku销量
public int incrSkuSaleCount(String skuId, int number) { public int incrSkuSaleCount(String spuId,String skuId, int number) {
String redisKey = GoblinRedisConst.REDIS_GOBLIN_SALE_COUNT.concat(skuId); String redisKey = GoblinRedisConst.REDIS_GOBLIN_SALE_COUNT.concat(skuId);
incrSpuSaleCount(spuId,number);
return (int) redisUtil.incr(redisKey, number); return (int) redisUtil.incr(redisKey, number);
} }
// 减少 sku销量 // 减少 sku销量
public int decrSkuSaleCount(String skuId, int number) { public int decrSkuSaleCount(String spuId,String skuId, int number) {
String redisKey = GoblinRedisConst.REDIS_GOBLIN_SALE_COUNT.concat(skuId); String redisKey = GoblinRedisConst.REDIS_GOBLIN_SALE_COUNT.concat(skuId);
decrSpuSaleCount(spuId,number);
return (int) redisUtil.decr(redisKey, number); return (int) redisUtil.decr(redisKey, number);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment