|
|
|
@@ -121,7 +121,7 @@ public class WxPayOrderServiceImpl implements WxPayOrderService { |
|
|
|
//方法必须为public AopContext.currentProxy() |
|
|
|
@Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) |
|
|
|
@Override |
|
|
|
public void handleSuccessOrder(WxPayOrder oldRecord,WxOrder order,Map<String, String> retMap) { |
|
|
|
public void handleSuccessOrder(WxPayOrder oldRecord,WxOrder order,Map<String, String> retMap,boolean isScheduleTask) { |
|
|
|
Date curDate = new Date(); |
|
|
|
if (oldRecord.getPayOrderStatus() != EnumPayStatus.PAY_STATUS_SUCCESS.getCode()) { |
|
|
|
//因为此处是处理订单支付成功了但是订单状态为未支付成功的异常状态,库存不应该再扣减 |
|
|
|
@@ -148,7 +148,7 @@ public class WxPayOrderServiceImpl implements WxPayOrderService { |
|
|
|
if (isOrderGroupCoupon(oldRecord, wxCoupon)) { |
|
|
|
// 如果是Coupon是拼团, 创建拼团信息, 不创建COUPON_ORDER |
|
|
|
try { |
|
|
|
wxOrderGroupService.createOrderGroup(order, wxCoupon); |
|
|
|
wxOrderGroupService.createOrderGroup(order, wxCoupon,isScheduleTask); |
|
|
|
} catch (Exception e) { |
|
|
|
logger.error("参团失败" + e.getMessage()); |
|
|
|
order.setOrderStatus(EnumOrderStatus.ORDER_STATUS_COOPERATING_FAILD.getCode()); |
|
|
|
@@ -189,7 +189,7 @@ public class WxPayOrderServiceImpl implements WxPayOrderService { |
|
|
|
if (EnumPayStatus.PAY_STATUS_SUCCESS.getCode()==wxpaystatus) { |
|
|
|
//直接调用不会触发事务,spring事务基于AOP代理 |
|
|
|
WxPayOrderServiceImpl proxy = (WxPayOrderServiceImpl) AopContext.currentProxy(); |
|
|
|
proxy.handleSuccessOrder(oldRecord,order,retMap); |
|
|
|
proxy.handleSuccessOrder(oldRecord,order,retMap,false); |
|
|
|
throw new MallinkException(ErrorCode.PAY_ORDER_EXIST.getCode(),"该订单已经支付,请勿重复支付!"); |
|
|
|
}else if (EnumPayStatus.PAY_STATUS_REFUND.getCode()==wxpaystatus) { |
|
|
|
throw new MallinkException(ErrorCode.PAY_ORDER_REFUND.getCode(),"该订单已经退款,无法支付!"); |
|
|
|
@@ -1384,7 +1384,7 @@ public class WxPayOrderServiceImpl implements WxPayOrderService { |
|
|
|
if (isOrderGroupCoupon(record, wxCoupon)) { |
|
|
|
// 如果是Coupon是拼团, 创建拼团信息, 不创建COUPON_ORDER |
|
|
|
try { |
|
|
|
wxOrderGroupService.createOrderGroup(order, wxCoupon); |
|
|
|
wxOrderGroupService.createOrderGroup(order, wxCoupon,false); |
|
|
|
} catch (Exception e) { |
|
|
|
logger.error("参团失败" + e.getMessage()); |
|
|
|
order.setOrderStatus(EnumOrderStatus.ORDER_STATUS_COOPERATING_FAILD.getCode()); |
|
|
|
|