|
|
|
@@ -546,17 +546,14 @@ public class WxProfitSharingOrderServiceImpl implements WxProfitSharingOrderServ |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_ERROR); |
|
|
|
} |
|
|
|
|
|
|
|
final IdWorker idworker = IdWorker.get(); |
|
|
|
|
|
|
|
|
|
|
|
WxAppinfo appInfo = getAppinfo(wxPayOrder.getTenantId(),wxPayOrder.getPayVendor()); |
|
|
|
WxPayAccount payAccount = wxPayAccountMapper.selectById(appInfo.getPayId()); |
|
|
|
|
|
|
|
|
|
|
|
//分账检查是否已创建分账订单 |
|
|
|
WxProfitSharingOrder record = new WxProfitSharingOrder(); |
|
|
|
//创建分账订单 |
|
|
|
Date currentDate = new Date(); |
|
|
|
final IdWorker idworker = IdWorker.get(); |
|
|
|
record.setId(idworker.nextId()); |
|
|
|
record.updateTenantInfo(payAccount); |
|
|
|
record.setTransactionId(wxPayOrder.getTransactionId()); |
|
|
|
@@ -571,21 +568,21 @@ public class WxProfitSharingOrderServiceImpl implements WxProfitSharingOrderServ |
|
|
|
record.setType(EnumProfitSharingOrderType.PROFIT_SHARING_DOUYIN_SINGLE.getCode()); |
|
|
|
wxProfitSharingOrderMapper.insert(record); |
|
|
|
|
|
|
|
//分账提交 |
|
|
|
PayShareResult shareResult = payServiceFactory.getPayShareAdapterService(wxPayOrder.getPayVendor()).noReciverShare(appInfo,payAccount,record,wxPayOrder.getPayOrderNo(),wxPayOrder.getShareAmount()); |
|
|
|
if (!shareResult.isSuccess()) { |
|
|
|
record.setSharingStatus(shareResult.getCode()); |
|
|
|
record.setErrorMsg(shareResult.getMsg()); |
|
|
|
record.setUpdateTime(new Date()); |
|
|
|
wxProfitSharingOrderMapper.updateById(record); |
|
|
|
return new ResultData(ErrorCode.PROFIT_SHARING_REQUEST_FAILED.getCode(),record.getErrorMsg()); |
|
|
|
} |
|
|
|
|
|
|
|
record.setSharingOrderNo(shareResult.getShareOrderNo()); |
|
|
|
record.setSharingStatus(EnumProfitSharingOrderStatus.PROFIT_SHARING_ACCEPTED.getCode()); |
|
|
|
record.setUpdateTime(new Date()); |
|
|
|
wxProfitSharingOrderMapper.updateById(record); |
|
|
|
return new ResultData(shareResult.getData()); |
|
|
|
// //分账提交 |
|
|
|
// PayShareResult shareResult = payServiceFactory.getPayShareAdapterService(wxPayOrder.getPayVendor()).noReciverShare(appInfo,payAccount,record,wxPayOrder.getPayOrderNo(),wxPayOrder.getShareAmount()); |
|
|
|
// if (!shareResult.isSuccess()) { |
|
|
|
// record.setSharingStatus(shareResult.getCode()); |
|
|
|
// record.setErrorMsg(shareResult.getMsg()); |
|
|
|
// record.setUpdateTime(new Date()); |
|
|
|
// wxProfitSharingOrderMapper.updateById(record); |
|
|
|
// return new ResultData(ErrorCode.PROFIT_SHARING_REQUEST_FAILED.getCode(),record.getErrorMsg()); |
|
|
|
// } |
|
|
|
// |
|
|
|
// record.setSharingOrderNo(shareResult.getShareOrderNo()); |
|
|
|
// record.setSharingStatus(EnumProfitSharingOrderStatus.PROFIT_SHARING_ACCEPTED.getCode()); |
|
|
|
// record.setUpdateTime(new Date()); |
|
|
|
// wxProfitSharingOrderMapper.updateById(record); |
|
|
|
return new ResultData(); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
|