|
|
@ -107,10 +107,12 @@ public class GoodsMsgServiceImpl implements GoodsMsgService { |
|
|
|
public void editSaleNum(Long goodsId, Integer num , Integer type) { |
|
|
|
public void editSaleNum(Long goodsId, Integer num , Integer type) { |
|
|
|
|
|
|
|
|
|
|
|
String key = "GOODS" + goodsId; |
|
|
|
String key = "GOODS" + goodsId; |
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
// 分布式锁占坑
|
|
|
|
// 分布式锁占坑
|
|
|
|
Boolean lock = redisTemplate.opsForValue().setIfAbsent(key, goodsId); |
|
|
|
Boolean lock = redisTemplate.opsForValue().setIfAbsent(key, goodsId); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
|
|
|
|
System.out.println("==========================================================lock" + lock); |
|
|
|
System.out.println("==========================================================lock" + lock); |
|
|
|
GoodsMsg goodsMsg = queryDetail(goodsId); |
|
|
|
GoodsMsg goodsMsg = queryDetail(goodsId); |
|
|
|
System.out.println("==========================================================goodsMsg" + goodsMsg); |
|
|
|
System.out.println("==========================================================goodsMsg" + goodsMsg); |
|
|
|