|
|
|
@@ -507,22 +507,6 @@ public class WxPayOrderServiceImpl implements WxPayOrderService { |
|
|
|
isShare = EnumPayShare.NO; |
|
|
|
record.setShare(isShare.getCode()); |
|
|
|
} |
|
|
|
|
|
|
|
//设置子订单分账金额 |
|
|
|
Map<String,WxComposeChildOrderShare> childShares = new HashMap<String,WxComposeChildOrderShare>(); |
|
|
|
OrderAdapterService orderAdapterService = orderFactory.getOrderAdapterService(composeOrder.getComposeOrderType()); |
|
|
|
List<WxOrder> orderList = orderAdapterService.getChildOrders(composeOrder, appInfo.getTenantId()); |
|
|
|
if (null != orderList && orderList.size() > 0 ) { |
|
|
|
for (WxOrder o : orderList) { |
|
|
|
WxCoupon coupon = wxCouponMapper.selectById(o.getProductId(), appInfo.getTenantId()); |
|
|
|
WxComposeChildOrderPrice price = orderAdapterService.getChildOrderPrice(coupon, false, o.getOrderGroupId(), o.getCouponNumber()); |
|
|
|
int orderMallCharge = OrderHelper.getMallCharge(price.getRealPayMent(), payAccount); |
|
|
|
Integer orderShareAmount = price.getRealPayMent() - orderMallCharge; |
|
|
|
Integer orderRateAmount = PayUtils.getPayRate(price.getRealPayMent(), payAccount.getRealRate(), true); |
|
|
|
childShares.put(String.valueOf(o.getId()), new WxComposeChildOrderShare(price.getRealPayMent(), orderShareAmount, orderRateAmount)); |
|
|
|
} |
|
|
|
record.setChildOrderShare(JSON.toJSONString(childShares)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
int sqlRow = wxPayOrderMapper.insert(record); |
|
|
|
@@ -555,7 +539,7 @@ public class WxPayOrderServiceImpl implements WxPayOrderService { |
|
|
|
record.setFailReason("do handleMicroOrderPaySuccess() error."+e.getMessage()); |
|
|
|
wxPayOrderMapper.updateById(record); |
|
|
|
} catch (Exception ex) { |
|
|
|
logger.error("pay order update error: " + ex.getMessage()); |
|
|
|
logger.error("pay order update error: " + ex.getMessage(),e); |
|
|
|
throw new MallinkException(ErrorCode.DB_FAIL); |
|
|
|
} |
|
|
|
throw new MallinkException(ErrorCode.DB_FAIL); |
|
|
|
@@ -566,15 +550,17 @@ public class WxPayOrderServiceImpl implements WxPayOrderService { |
|
|
|
record.setFailReason(payResult.getMsg()); |
|
|
|
wxPayOrderMapper.updateById(record); |
|
|
|
} catch (Exception e) { |
|
|
|
logger.error("pay order update error: " + record.toString()); |
|
|
|
logger.error("pay order update error: " + record.toString(),e); |
|
|
|
throw new MallinkException(ErrorCode.DB_FAIL); |
|
|
|
} |
|
|
|
return new ResultData(ErrorCode.PAY_ORDER_ERROR.getCode(), payResult.getMsg(), payResult.getData()); |
|
|
|
} |
|
|
|
|
|
|
|
} catch (RuntimeException e) { |
|
|
|
logger.error("pay order update error: " + record.toString(),e); |
|
|
|
throw new MallinkException(ErrorCode.PAY_ORDER_ERROR.getCode(), e.getMessage()); |
|
|
|
} catch (Exception e) { |
|
|
|
logger.error("pay order update error: " + record.toString(),e); |
|
|
|
throw new MallinkException(ErrorCode.PAY_ORDER_ERROR.getCode(), e.getMessage()); |
|
|
|
} |
|
|
|
} |
|
|
|
|