Просмотр исходного кода

fix press

release_toaliyun_real
lin 3 лет назад
Родитель
Сommit
bf8b535eac
4 измененных файлов: 20 добавлений и 13 удалений
  1. +1
    -0
      mallinkService/src/main/java/com/iformall/common/ErrorCode.java
  2. +1
    -1
      mallinkService/src/main/java/com/iformall/service/helper/WxOrderServiceHelper.java
  3. +5
    -1
      mallinkService/src/main/java/com/iformall/service/impl/WxOrderServiceImpl.java
  4. +13
    -11
      mallinkService/src/main/java/com/iformall/service/impl/WxPayOrderServiceImpl.java

+ 1
- 0
mallinkService/src/main/java/com/iformall/common/ErrorCode.java Просмотреть файл

@@ -13,6 +13,7 @@ public enum ErrorCode{
* 系统级别
* 1000-1999
*/
SYS_TRANSCATION_NO_BACK(999,"事务无需回滚异常"),
SYS_SERVER_ERROR(1000, "系统繁忙"),
SYS_PARAMETER_ERROR(1001, "参数不合法"),
SYS_PARAMETER_NOT_NULL(1002, "参数不能为空"),


+ 1
- 1
mallinkService/src/main/java/com/iformall/service/helper/WxOrderServiceHelper.java Просмотреть файл

@@ -34,7 +34,7 @@ public class WxOrderServiceHelper {
/**
* 微信订单是否可以支付
*/
public void reduceStock(boolean isChannelStockReduce, WxCoupon coupon,Long couponChannelId,int number) {
public void reduceStock(boolean isChannelStockReduce, WxCoupon coupon,Long couponChannelId,int number) throws Exception{
if (isChannelStockReduce) {
try {
wxCouponChannelService.reduceChannelStock(coupon,couponChannelId,number);


+ 5
- 1
mallinkService/src/main/java/com/iformall/service/impl/WxOrderServiceImpl.java Просмотреть файл

@@ -1110,7 +1110,11 @@ public class WxOrderServiceImpl implements WxOrderService {
isReduceStock = false;
}
if (isReduceStock) {
wxOrderServiceHelper.reduceStock(isChannelStockReduce,coupon,couponChannelId, number);
try {
wxOrderServiceHelper.reduceStock(isChannelStockReduce,coupon,couponChannelId, number);
}catch (Exception e) {
throw new MallinkException(ErrorCode.DB_FAIL.getCode(),e.getMessage());
}
}
reduceResult.setChannelStockReduce(isChannelStockReduce);
reduceResult.setCurrentPrice(currentPrice);


+ 13
- 11
mallinkService/src/main/java/com/iformall/service/impl/WxPayOrderServiceImpl.java Просмотреть файл

@@ -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()) {


Загрузка…
Отмена
Сохранить