1
This commit is contained in:
parent
9eceda0858
commit
51bc0851f9
@ -483,6 +483,8 @@ public class IntegralOrdersServiceImpl implements IntegralOrdersService {
|
|||||||
String lockKey = "IntegralOrders" + orderNo;
|
String lockKey = "IntegralOrders" + orderNo;
|
||||||
Boolean isLock = redisLock.tryLock(lockKey, 5000, TimeUnit.MILLISECONDS);
|
Boolean isLock = redisLock.tryLock(lockKey, 5000, TimeUnit.MILLISECONDS);
|
||||||
if (isLock && "paid".equals(listByOrderNo.get(0).getStatus()) && "0".equals(listByOrderNo.get(0).getProcessingStatus())) {
|
if (isLock && "paid".equals(listByOrderNo.get(0).getStatus()) && "0".equals(listByOrderNo.get(0).getProcessingStatus())) {
|
||||||
|
try {
|
||||||
|
|
||||||
// 查询用户信息
|
// 查询用户信息
|
||||||
LJUserVo ljUserVos = ljUserMapper.selectAllInfoById2(listByOrderNo.get(0).getUserId(), listByOrderNo.get(0).getChainStoreId());
|
LJUserVo ljUserVos = ljUserMapper.selectAllInfoById2(listByOrderNo.get(0).getUserId(), listByOrderNo.get(0).getChainStoreId());
|
||||||
// 查询用户信息
|
// 查询用户信息
|
||||||
@ -497,8 +499,14 @@ public class IntegralOrdersServiceImpl implements IntegralOrdersService {
|
|||||||
IntegralGift integralGift = integralGiftService.queryById(integralOrders.getGiftId());
|
IntegralGift integralGift = integralGiftService.queryById(integralOrders.getGiftId());
|
||||||
if (integralGift.getGiftType().equals("电子券")) {
|
if (integralGift.getGiftType().equals("电子券")) {
|
||||||
|
|
||||||
CardCoupon cardCoupon = cardCouponService.selectOneBuId(integralGift.getCouponId());
|
|
||||||
ResponseObject responseObject = cardCouponService.sendCoupon2(new CardCouponUser());
|
for (int i = 0; i <integralOrders.getExchangeQuantity() ; i++) {
|
||||||
|
CardCouponUser cardCouponUser = new CardCouponUser();
|
||||||
|
cardCouponUser.setMtUserId(ljUserVos.getId());
|
||||||
|
cardCouponUser.setStoreId(integralOrders.getStoreId());
|
||||||
|
cardCouponUser.setCardCouponId(integralGift.getCouponId());
|
||||||
|
ResponseObject responseObject = cardCouponService.sendCoupon2(cardCouponUser);
|
||||||
|
}
|
||||||
|
|
||||||
} else if (integralGift.getGiftType().equals("实物商品")) {
|
} else if (integralGift.getGiftType().equals("实物商品")) {
|
||||||
// 修改商品库存并增加记录
|
// 修改商品库存并增加记录
|
||||||
@ -533,7 +541,10 @@ public class IntegralOrdersServiceImpl implements IntegralOrdersService {
|
|||||||
integralOrdersDao.updatePaymentType(orderNo);
|
integralOrdersDao.updatePaymentType(orderNo);
|
||||||
|
|
||||||
redisLock.unlock(lockKey);
|
redisLock.unlock(lockKey);
|
||||||
|
} catch (Exception e) {
|
||||||
|
redisLock.unlock(lockKey);
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
redisLock.unlock(lockKey);
|
redisLock.unlock(lockKey);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user