bug
This commit is contained in:
parent
e2f89bd897
commit
ccde099d3d
@ -227,14 +227,16 @@ public class IntegralGiftServiceImpl implements IntegralGiftService {
|
|||||||
String lockKey = "integralGift-"+id;
|
String lockKey = "integralGift-"+id;
|
||||||
Boolean isLock = redisLock.tryLock(lockKey,500,5000, TimeUnit.MILLISECONDS);
|
Boolean isLock = redisLock.tryLock(lockKey,500,5000, TimeUnit.MILLISECONDS);
|
||||||
if (isLock) {
|
if (isLock) {
|
||||||
redisLock.unlock(lockKey);
|
try {
|
||||||
|
|
||||||
IntegralGift integralGift = integralGiftDao.queryById(id);
|
IntegralGift integralGift = integralGiftDao.queryById(id);
|
||||||
if (editInventory.compareTo(integralGift.getRemainingInventory())>0) {
|
if (editInventory.compareTo(integralGift.getRemainingInventory())>0) {
|
||||||
throw new RuntimeException("该积分商品库存不足!");
|
throw new RuntimeException("该积分商品库存不足!");
|
||||||
}else {
|
}else {
|
||||||
integralGiftDao.updateInventoryByLock(id, editInventory);
|
integralGiftDao.updateInventoryByLock(id, editInventory);
|
||||||
}
|
}
|
||||||
|
}finally {
|
||||||
|
redisLock.unlock(lockKey);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -113,5 +113,12 @@ public class CardValueOrdersController extends BaseController {
|
|||||||
String status = map.get("status");
|
String status = map.get("status");
|
||||||
cardValueOrdersService.updateOrderStatus(orderNo,status);
|
cardValueOrdersService.updateOrderStatus(orderNo,status);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@PostMapping("getOneByOrderNo")
|
||||||
|
public void getOneByOrderNo(@RequestBody Map<String,String> map){
|
||||||
|
String orderNo = map.get("orderNo");
|
||||||
|
cardValueOrdersService.getOneByOrderNo(orderNo);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -68,7 +68,11 @@ public class OilTagController extends BaseController {
|
|||||||
}
|
}
|
||||||
// queryWrapper.eq(OilTag::getDeptId,nowAccountInfo.getDeptId());
|
// queryWrapper.eq(OilTag::getDeptId,nowAccountInfo.getDeptId());
|
||||||
// FIND_IN_SET
|
// FIND_IN_SET
|
||||||
queryWrapper.apply("FIND_IN_SET('" + nowAccountInfo.getDeptId() + "', dept_ids)");
|
if (100!=nowAccountInfo.getDeptId()){
|
||||||
|
queryWrapper.apply("FIND_IN_SET('" + nowAccountInfo.getDeptId() + "', dept_ids)");
|
||||||
|
//queryWrapper.eq(OilTag::getDeptId,nowAccountInfo.getDeptId());
|
||||||
|
}
|
||||||
|
//queryWrapper.apply("FIND_IN_SET('" + nowAccountInfo.getDeptId() + "', dept_ids)");
|
||||||
|
|
||||||
if (ObjectUtils.isNotEmpty(oilTag.getSnCode())){
|
if (ObjectUtils.isNotEmpty(oilTag.getSnCode())){
|
||||||
queryWrapper.eq(OilTag::getSnCode,oilTag.getSnCode());
|
queryWrapper.eq(OilTag::getSnCode,oilTag.getSnCode());
|
||||||
|
Loading…
Reference in New Issue
Block a user