|
|
|
@@ -49,6 +49,7 @@ import org.springframework.context.annotation.Lazy; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.transaction.annotation.Propagation; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
import org.springframework.transaction.interceptor.TransactionAspectSupport; |
|
|
|
|
|
|
|
import java.text.ParseException; |
|
|
|
import java.util.*; |
|
|
|
@@ -177,10 +178,10 @@ public class WxPayOrderServiceImpl implements WxPayOrderService { |
|
|
|
//处理其他信息 |
|
|
|
try { |
|
|
|
WxCoupon wxCoupon = wxCouponMapper.selectById(composeOrder.getSingleOrder().getProductId(),composeOrder.getSingleOrder().getTenantId()); |
|
|
|
boolean isSuccess = proxy.handelPress(wxCoupon, composeOrder.getSingleOrder()); |
|
|
|
if (isSuccess) { |
|
|
|
proxy.handleOrderPaySingleOrderSuccess(wxCoupon,composeOrder.getSingleOrder(),oldRecord, transactionId,isScheduleTask); |
|
|
|
} |
|
|
|
boolean isSuccess = proxy.handelPress(wxCoupon, composeOrder.getSingleOrder()); |
|
|
|
if (isSuccess) { |
|
|
|
proxy.handleOrderPaySingleOrderSuccess(wxCoupon,composeOrder.getSingleOrder(),oldRecord, transactionId,isScheduleTask); |
|
|
|
} |
|
|
|
}catch(Exception e) { |
|
|
|
throw new MallinkException(ErrorCode.SYS_SERVER_ERROR.getCode(),e.getMessage()); |
|
|
|
} |
|
|
|
@@ -189,10 +190,10 @@ public class WxPayOrderServiceImpl implements WxPayOrderService { |
|
|
|
for (WxOrder o : orderList) { |
|
|
|
try { |
|
|
|
WxCoupon wxCoupon = wxCouponMapper.selectById(o.getProductId(),o.getTenantId()); |
|
|
|
boolean isSuccess = proxy.handelPress(wxCoupon, o); |
|
|
|
if (isSuccess) { |
|
|
|
proxy.handleOrderPaySingleOrderSuccess(wxCoupon,o,oldRecord, transactionId, isScheduleTask); |
|
|
|
} |
|
|
|
boolean isSuccess = proxy.handelPress(wxCoupon, o); |
|
|
|
if (isSuccess) { |
|
|
|
proxy.handleOrderPaySingleOrderSuccess(wxCoupon,o,oldRecord, transactionId, isScheduleTask); |
|
|
|
} |
|
|
|
}catch(Exception e) { |
|
|
|
logger.error("handleSuccessOrder error.",e); |
|
|
|
} |
|
|
|
@@ -202,10 +203,11 @@ public class WxPayOrderServiceImpl implements WxPayOrderService { |
|
|
|
//处理其他信息 |
|
|
|
try { |
|
|
|
WxCoupon wxCoupon = wxCouponMapper.selectById(composeOrder.getSingleOrder().getProductId(),composeOrder.getSingleOrder().getTenantId()); |
|
|
|
boolean isSuccess = proxy.handelPress(wxCoupon, composeOrder.getSingleOrder()); |
|
|
|
boolean isSuccess = proxy.handelPress(wxCoupon, composeOrder.getSingleOrder()); |
|
|
|
if (isSuccess) { |
|
|
|
proxy.handleOrderPaySingleOrderSuccess(wxCoupon,composeOrder.getSingleOrder(),oldRecord, transactionId,isScheduleTask); |
|
|
|
} |
|
|
|
|
|
|
|
}catch(Exception e) { |
|
|
|
throw new MallinkException(ErrorCode.SYS_SERVER_ERROR.getCode(),e.getMessage()); |
|
|
|
} |
|
|
|
@@ -215,8 +217,8 @@ public class WxPayOrderServiceImpl implements WxPayOrderService { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@Transactional(propagation = Propagation.NESTED, readOnly = false, rollbackFor = {Exception.class}) |
|
|
|
public boolean handelPress(WxCoupon coupon,WxOrder order) { |
|
|
|
@Transactional(propagation = Propagation.NOT_SUPPORTED,noRollbackFor = {Exception.class}) |
|
|
|
public boolean handelPress(WxCoupon coupon,WxOrder order) { |
|
|
|
//如果是砍价,并且是付款扣库存 |
|
|
|
if (null != coupon && coupon.getType().intValue() == EnumCouponType.COUPON_PRESS.getCode().intValue() |
|
|
|
&& null != coupon.getPressPayReduceStock() && coupon.getPressPayReduceStock().intValue() == EnumYesOrNo.YES.getCode().intValue()) { |
|
|
|
|