xiaohanzi 5 лет назад
Родитель
Сommit
848def2c4b
1 измененных файлов: 23 добавлений и 3 удалений
  1. +23
    -3
      mallinkService/src/main/java/com/iformall/service/impl/WxCouponOrderServiceImpl.java

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

@@ -1353,7 +1353,13 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService {
throw new MallinkException(ErrorCode.VERIFY_ERROR.getCode(), "updatete num " + num);
}
}

WxAppinfo appInfo = wxAppinfoService.getCAppInfo(bUser,payWay);
WxPayAccount payAccount = wxPayAccountMapper.selectById(appInfo.getPayId());
EnumPayShare isShare = EnumPayShare.NO;
if (payAccount.checkShare()) {
isShare = EnumPayShare.YES;
}
final Integer shareCode = isShare.getCode();
// 添加payOrder
final IdWorker idWorker = IdWorker.get();
Long payOrderId = idWorker.nextId();
@@ -1370,7 +1376,8 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService {
setPayOrderNo(String.valueOf(payOrderId));
setIp(ipstr);
setAuthCode(authCode);
setPayAmount(microOrder.getPayment() - wxCoupon.getPrice());
Integer payAmount = microOrder.getPayment() - wxCoupon.getPrice();
setPayAmount(payAmount);
// if (microOrder.getPayment() > wxCoupon.getPrice()) {
// setPayAmount(wxCoupon.getPrice());
// } else {
@@ -1378,7 +1385,20 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService {
// }
setPayVendor(payWay.getCode());
setPayOrderStatus(EnumPayStatus.PAY_STATUS_WAIT.getCode());
setShare(EnumPayShare.NO.getCode());
setShare(shareCode);
if (shareCode.intValue() == EnumPayShare.YES.getCode().intValue()) {
// 分账金额
int iChargeFee = PayUtils.getPayRate(payAmount, payAccount.getRate(), false);
Integer share_amount = payAmount - iChargeFee;
setShareAmount(share_amount);
if(payAccount.getRealRate() != null) {
int iRealChargeFee = PayUtils.getPayRate(payAmount, payAccount.getRealRate(), true);
setRateAmount(iRealChargeFee);
}
if (share_amount <= 0) {
setShare(EnumPayShare.NO.getCode());
}
}
setPayFrom(EnumPayFrom.INSIDE_B.getCode());
setPosPayOrderId(couponOrder.getId());
}};


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