| @@ -1353,7 +1353,13 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { | |||||
| throw new MallinkException(ErrorCode.VERIFY_ERROR.getCode(), "updatete num " + num); | 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 | // 添加payOrder | ||||
| final IdWorker idWorker = IdWorker.get(); | final IdWorker idWorker = IdWorker.get(); | ||||
| Long payOrderId = idWorker.nextId(); | Long payOrderId = idWorker.nextId(); | ||||
| @@ -1370,7 +1376,8 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { | |||||
| setPayOrderNo(String.valueOf(payOrderId)); | setPayOrderNo(String.valueOf(payOrderId)); | ||||
| setIp(ipstr); | setIp(ipstr); | ||||
| setAuthCode(authCode); | setAuthCode(authCode); | ||||
| setPayAmount(microOrder.getPayment() - wxCoupon.getPrice()); | |||||
| Integer payAmount = microOrder.getPayment() - wxCoupon.getPrice(); | |||||
| setPayAmount(payAmount); | |||||
| // if (microOrder.getPayment() > wxCoupon.getPrice()) { | // if (microOrder.getPayment() > wxCoupon.getPrice()) { | ||||
| // setPayAmount(wxCoupon.getPrice()); | // setPayAmount(wxCoupon.getPrice()); | ||||
| // } else { | // } else { | ||||
| @@ -1378,7 +1385,20 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { | |||||
| // } | // } | ||||
| setPayVendor(payWay.getCode()); | setPayVendor(payWay.getCode()); | ||||
| setPayOrderStatus(EnumPayStatus.PAY_STATUS_WAIT.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()); | setPayFrom(EnumPayFrom.INSIDE_B.getCode()); | ||||
| setPosPayOrderId(couponOrder.getId()); | setPosPayOrderId(couponOrder.getId()); | ||||
| }}; | }}; | ||||