Browse Source

更新拼团bug

release_toaliyun_real
xiaohanzi 6 years ago
parent
commit
ff64d8c9c2
1 changed files with 6 additions and 6 deletions
  1. +6
    -6
      mallinkService/src/main/java/com/iformall/service/impl/WxOrderGroupServiceImpl.java

+ 6
- 6
mallinkService/src/main/java/com/iformall/service/impl/WxOrderGroupServiceImpl.java View File

@@ -75,14 +75,14 @@ public class WxOrderGroupServiceImpl implements WxOrderGroupService {
// 参与拼团 // 参与拼团
WxOrderGroup wxOrderGroup = wxOrderGroupMapper.selectById(orderGroupId); WxOrderGroup wxOrderGroup = wxOrderGroupMapper.selectById(orderGroupId);
if (null == wxOrderGroup) { if (null == wxOrderGroup) {
//错误,更新状态,定时任务会发起退款
order.setOrderStatus(EnumOrderStatus.ORDER_STATUS_COOPERATING_FAILD.getCode());
//错误,更新状态,定时任务会发起退款,回滚库存
order.setOrderStatus(EnumOrderStatus.ORDER_STATUS_COOPERATING_UNPAID.getCode());
wxOrderMapper.updateById(order); wxOrderMapper.updateById(order);
throw new MallinkException(ErrorCode.ORDER_GROUP_COOPERATING_FAILD.getCode(),"WxOrderGroup is null."+orderGroupId); throw new MallinkException(ErrorCode.ORDER_GROUP_COOPERATING_FAILD.getCode(),"WxOrderGroup is null."+orderGroupId);
} }
if(wxOrderGroup.getRemainPeople()<1) { if(wxOrderGroup.getRemainPeople()<1) {
//错误,更新状态,定时任务会发起退款
order.setOrderStatus(EnumOrderStatus.ORDER_STATUS_COOPERATING_FAILD.getCode());
//错误,更新状态,定时任务会发起退款,回滚库存
order.setOrderStatus(EnumOrderStatus.ORDER_STATUS_COOPERATING_UNPAID.getCode());
wxOrderMapper.updateById(order); wxOrderMapper.updateById(order);
throw new MallinkException(ErrorCode.ORDER_GROUP_COOPERATING_FAILD.getCode(),"参团人数已满,将稍后退款。"); throw new MallinkException(ErrorCode.ORDER_GROUP_COOPERATING_FAILD.getCode(),"参团人数已满,将稍后退款。");
} }
@@ -102,8 +102,8 @@ public class WxOrderGroupServiceImpl implements WxOrderGroupService {
logger.info("非首次拼团,更新拼团信息, 剩余人数-1"); logger.info("非首次拼团,更新拼团信息, 剩余人数-1");
int row = wxOrderGroupMapper.updateOrderGroup(wxOrderGroup); int row = wxOrderGroupMapper.updateOrderGroup(wxOrderGroup);
if (row != 1) { if (row != 1) {
//这个时候应该要发起异步退款。
order.setOrderStatus(EnumOrderStatus.ORDER_STATUS_COOPERATING_FAILD.getCode());
//错误,更新状态,定时任务会发起退款,回滚库存
order.setOrderStatus(EnumOrderStatus.ORDER_STATUS_COOPERATING_UNPAID.getCode());
wxOrderMapper.updateById(order); wxOrderMapper.updateById(order);
redisLock.unlock("grouppeopleLock_"+orderGroupId, String.valueOf(orderGroupId)); redisLock.unlock("grouppeopleLock_"+orderGroupId, String.valueOf(orderGroupId));
throw new MallinkException(ErrorCode.ORDER_GROUP_COOPERATING_FAILD.getCode(),"参团失败,将稍后退款."); throw new MallinkException(ErrorCode.ORDER_GROUP_COOPERATING_FAILD.getCode(),"参团失败,将稍后退款.");


Loading…
Cancel
Save