mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-07-09 08:27:58 +08:00
排除adapayMemberAccounts中amount为0的元素
This commit is contained in:
@@ -988,8 +988,17 @@ public class AdapayService {
|
|||||||
* 这个方法支持多用户分账
|
* 这个方法支持多用户分账
|
||||||
*/
|
*/
|
||||||
public PaymentConfirmResponse createPaymentConfirmRequest(PaymentConfirmParam param) {
|
public PaymentConfirmResponse createPaymentConfirmRequest(PaymentConfirmParam param) {
|
||||||
String paymentId = param.getPaymentId(); // 支付对象id
|
|
||||||
List<DivMember> adapayMemberAccounts = param.getDivMemberList(); // 收到该账的汇付会员信息
|
List<DivMember> adapayMemberAccounts = param.getDivMemberList(); // 收到该账的汇付会员信息
|
||||||
|
// 排除adapayMemberAccounts中amount为0的元素
|
||||||
|
if (CollectionUtils.isNotEmpty(adapayMemberAccounts)) {
|
||||||
|
adapayMemberAccounts = adapayMemberAccounts.stream().filter(item -> new BigDecimal(item.getAmount()).compareTo(BigDecimal.ZERO) > 0).collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
// 分账对象信息 一次最多7个
|
||||||
|
if (adapayMemberAccounts.size() > 7) {
|
||||||
|
throw new BusinessException("", "分账人数不能超过7人");
|
||||||
|
}
|
||||||
|
|
||||||
|
String paymentId = param.getPaymentId(); // 支付对象id
|
||||||
BigDecimal confirmAmt = param.getConfirmAmt(); // 确认的金额
|
BigDecimal confirmAmt = param.getConfirmAmt(); // 确认的金额
|
||||||
String orderCode = param.getOrderCode(); // 订单编号
|
String orderCode = param.getOrderCode(); // 订单编号
|
||||||
String wechatAppId = param.getWechatAppId(); // appId
|
String wechatAppId = param.getWechatAppId(); // appId
|
||||||
@@ -1009,10 +1018,6 @@ public class AdapayService {
|
|||||||
jsonObject.put("orderCode", orderCode);
|
jsonObject.put("orderCode", orderCode);
|
||||||
jsonObject.put("adapayMemberIds", StringUtils.join(adapayMemberIdList, ","));
|
jsonObject.put("adapayMemberIds", StringUtils.join(adapayMemberIdList, ","));
|
||||||
confirmParams.put("description", jsonObject.toJSONString());
|
confirmParams.put("description", jsonObject.toJSONString());
|
||||||
// 分账对象信息 一次最多7个
|
|
||||||
if (adapayMemberAccounts.size() > 7) {
|
|
||||||
throw new BusinessException("", "分账人数不能超过7人");
|
|
||||||
}
|
|
||||||
confirmParams.put("div_members", adapayMemberAccounts);
|
confirmParams.put("div_members", adapayMemberAccounts);
|
||||||
|
|
||||||
// 创建交易确认请求
|
// 创建交易确认请求
|
||||||
|
|||||||
Reference in New Issue
Block a user