|
|
|
@@ -160,21 +160,25 @@ public class WxProfitSharingOrderServiceImpl implements WxProfitSharingOrderServ |
|
|
|
PayShareResult shareResult = null; |
|
|
|
JSONArray jsonArray = null; |
|
|
|
JSONArray recordJsonArray = null; |
|
|
|
//总分模式,收款账户分账 |
|
|
|
if (EnumPayMchType.TOTAL.getCode() == payOrder.getMchType()) { |
|
|
|
if(StringUtils.isNotBlank(sharingOrder.getReceivers())){ |
|
|
|
jsonArray = JSONArray.parseArray(sharingOrder.getReceivers()); |
|
|
|
recordJsonArray = JSONArray.parseArray(sharingOrder.getReceivers()); |
|
|
|
} |
|
|
|
//直连模式,不用分账,直接完结分账 |
|
|
|
}else if (EnumPayMchType.DIRECT.getCode() == payOrder.getMchType()) { |
|
|
|
|
|
|
|
if(StringUtils.isNotBlank(sharingOrder.getReceivers())){ |
|
|
|
jsonArray = JSONArray.parseArray(sharingOrder.getReceivers()); |
|
|
|
recordJsonArray = JSONArray.parseArray(sharingOrder.getReceivers()); |
|
|
|
} |
|
|
|
|
|
|
|
//直连模式 |
|
|
|
if (EnumPayMchType.DIRECT.getCode() == payOrder.getMchType()) { |
|
|
|
//当前商户的收款账号,为了加上收款记录 |
|
|
|
WxProfitSharingReceiver receiver = payShareAdapterService.getReceiver(sharingOrder, sharingOrder.getMerchantId(), payOrder.getTtPayWay(), payOrder.getMchType()); |
|
|
|
if (null == receiver) { |
|
|
|
return new ResultData(ErrorCode.PROFIT_SHARING_REQUEST_FAILED.getCode(),"当前商户未配置收款账号"); |
|
|
|
} |
|
|
|
StringBuffer sb = new StringBuffer("[{").append("\"description\":").append(receiver.getId()).append(",\"amount\":").append(sharingOrder.getPayAmount()); |
|
|
|
recordJsonArray = JSONArray.parseArray(sb.toString()); |
|
|
|
StringBuffer sb = new StringBuffer("{").append("\"description\":").append(receiver.getId()).append(",\"amount\":").append(sharingOrder.getPayAmount()).append("}"); |
|
|
|
if (null == recordJsonArray) { |
|
|
|
recordJsonArray = JSONArray.parseArray("["+sb.toString()+"]"); |
|
|
|
}else { |
|
|
|
recordJsonArray.add(JSON.parseObject(sb.toString())); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
List<WxProfitSharingResult> resultList = new ArrayList<WxProfitSharingResult>(); |
|
|
|
|