mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 11:05:18 +08:00
test方法
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.alibaba.fastjson2.JSONArray;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.google.common.collect.Sets;
|
||||
import com.huifu.adapay.core.exception.BaseAdaPayException;
|
||||
import com.huifu.adapay.model.PaymentReverse;
|
||||
import com.huifu.adapay.model.Refund;
|
||||
@@ -11,11 +11,13 @@ import com.jsowell.adapay.dto.QueryConfirmReverseDTO;
|
||||
import com.jsowell.adapay.dto.QueryPaymentConfirmDTO;
|
||||
import com.jsowell.adapay.operation.PaymentReverseOperation;
|
||||
import com.jsowell.adapay.response.ConfirmReverseResponse;
|
||||
import com.jsowell.adapay.response.PaymentConfirmResponse;
|
||||
import com.jsowell.adapay.response.PaymentReverseResponse;
|
||||
import com.jsowell.adapay.response.QueryPaymentConfirmDetailResponse;
|
||||
import com.jsowell.adapay.service.AdapayService;
|
||||
import com.jsowell.common.enums.ykc.ScenarioEnum;
|
||||
import com.jsowell.common.util.StringUtils;
|
||||
import com.jsowell.pile.domain.AdapayMemberAccount;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
@@ -82,169 +84,6 @@ public class PaymentTestController {
|
||||
return list;
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
List<String> list1 = Lists.newArrayList(
|
||||
"C84866578627",
|
||||
"C69407733440",
|
||||
"C46698893183",
|
||||
"C23481086913",
|
||||
"C46631353044",
|
||||
"C82315862441",
|
||||
"C48515444163",
|
||||
"C88894523461",
|
||||
"C63539142496",
|
||||
"C88227376749",
|
||||
"C69808468000",
|
||||
"C29756635462",
|
||||
"C48171513017",
|
||||
"C82929694510",
|
||||
"C42286214889",
|
||||
"C40531240168",
|
||||
"C42818195903",
|
||||
"C44772182853",
|
||||
"C63995701102",
|
||||
"C84653836282",
|
||||
"C82929004110",
|
||||
"C42248888826",
|
||||
"C42871512014",
|
||||
"C61630741271",
|
||||
"C44120948533",
|
||||
"C86510728306",
|
||||
"C23698728789",
|
||||
"C40725164803",
|
||||
"C46426468297",
|
||||
"C80876734677",
|
||||
"C65208404269",
|
||||
"C48131292456",
|
||||
"C27264263390",
|
||||
"C42620874381",
|
||||
"C27264478506",
|
||||
"C82758563554",
|
||||
"C44588350706",
|
||||
"C86153980315",
|
||||
"C86782182478",
|
||||
"C42077527679",
|
||||
"C80606430852",
|
||||
"C21377880382",
|
||||
"C63590496985",
|
||||
"C25745398205",
|
||||
"C63136978056",
|
||||
"C21983806615",
|
||||
"C42016184953",
|
||||
"C27458903931",
|
||||
"C40590975531",
|
||||
"C44987731257",
|
||||
"C63554143992",
|
||||
"C46468609277",
|
||||
"C23483139052",
|
||||
"C67759764676",
|
||||
"C65286550984",
|
||||
"C44772583755",
|
||||
"C65037735356",
|
||||
"C23065540340",
|
||||
"C82330428460",
|
||||
"C40136408323",
|
||||
"C65896968515",
|
||||
"C80093965053",
|
||||
"C23029064125",
|
||||
"C46291260090",
|
||||
"C40915419435",
|
||||
"C69234709266",
|
||||
"C61064626771",
|
||||
"C84216893653",
|
||||
"C69869670458",
|
||||
"C44755242724",
|
||||
"C63706872923",
|
||||
"C61047783388",
|
||||
"C80663278468",
|
||||
"C46232390797",
|
||||
"C44561702210",
|
||||
"C61404525849",
|
||||
"C80813608253"
|
||||
);
|
||||
List<String> list2 = Lists.newArrayList(
|
||||
"C69407733440",
|
||||
"C84866578627",
|
||||
"C46698893183",
|
||||
"C46631353044",
|
||||
"C23481086913",
|
||||
"C88894523461",
|
||||
"C48515444163",
|
||||
"C82315862441",
|
||||
"C48171513017",
|
||||
"C29756635462",
|
||||
"C69808468000",
|
||||
"C88227376749",
|
||||
"C63539142496",
|
||||
"C42818195903",
|
||||
"C40531240168",
|
||||
"C42286214889",
|
||||
"C82929694510",
|
||||
"C63995701102",
|
||||
"C44772182853",
|
||||
"C84653836282",
|
||||
"C42871512014",
|
||||
"C42248888826",
|
||||
"C82929004110",
|
||||
"C44120948533",
|
||||
"C61630741271",
|
||||
"C23698728789",
|
||||
"C86510728306",
|
||||
"C80876734677",
|
||||
"C46426468297",
|
||||
"C40725164803",
|
||||
"C48131292456",
|
||||
"C65208404269",
|
||||
"C82758563554",
|
||||
"C27264263390",
|
||||
"C27264478506",
|
||||
"C42620874381",
|
||||
"C25745398205",
|
||||
"C86153980315",
|
||||
"C63590496985",
|
||||
"C21377880382",
|
||||
"C80606430852",
|
||||
"C44588350706",
|
||||
"C42077527679",
|
||||
"C86782182478",
|
||||
"C40590975531",
|
||||
"C27458903931",
|
||||
"C42016184953",
|
||||
"C21983806615",
|
||||
"C63136978056",
|
||||
"C44772583755",
|
||||
"C46468609277",
|
||||
"C65286550984",
|
||||
"C63554143992",
|
||||
"C67759764676",
|
||||
"C44987731257",
|
||||
"C23483139052",
|
||||
"C23065540340",
|
||||
"C65037735356",
|
||||
"C80093965053",
|
||||
"C65896968515",
|
||||
"C82330428460",
|
||||
"C40136408323",
|
||||
"C23029064125",
|
||||
"C63706872923",
|
||||
"C40915419435",
|
||||
"C44755242724",
|
||||
"C69869670458",
|
||||
"C84216893653",
|
||||
"C61064626771",
|
||||
"C69234709266",
|
||||
"C46291260090",
|
||||
"C80813608253",
|
||||
"C61404525849",
|
||||
"C61047783388",
|
||||
"C44561702210",
|
||||
"C46232390797",
|
||||
"C80663278468");
|
||||
Sets.SetView<String> difference = Sets.intersection(Sets.newHashSet(list1), Sets.newHashSet(list2));
|
||||
System.out.println(difference);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询分账信息
|
||||
* @throws BaseAdaPayException
|
||||
@@ -434,4 +273,35 @@ public class PaymentTestController {
|
||||
String wechatAppId = wechatAppId1; // 万车充id
|
||||
adapayService.createBalancePaymentRequest(outMemberId, inMemberId, transAmt, title, desc, wechatAppId);
|
||||
}
|
||||
|
||||
// 需要重新分账的订单信息(针对未分账的订单)
|
||||
public JSONArray getPaymentList() {
|
||||
String jsonArrayString = "[" +
|
||||
"{\"orderCode\":\"C25133803815\", \"settleAmount\":\"42.94\", \"paymentId\":\"002212024071413111510658428550211133440\"}" +
|
||||
"]";
|
||||
return JSONArray.parseArray(jsonArrayString);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量执行分账
|
||||
*/
|
||||
@Test
|
||||
public void batchCreatePaymentConfirm() {
|
||||
JSONArray paymentList = getPaymentList();
|
||||
// TODO 获取默认结算账户,如需分给对应商户就填写正确的汇付会员id
|
||||
// AdapayMemberAccount adapayMemberAccount = adapayMemberAccountService.getDefault();
|
||||
AdapayMemberAccount adapayMemberAccount = new AdapayMemberAccount();
|
||||
adapayMemberAccount.setAdapayMemberId("ACM25158725");
|
||||
for (int i = 0; i < paymentList.size(); i++) {
|
||||
JSONObject jsonObject = (JSONObject) paymentList.get(i);
|
||||
BigDecimal confirmAmt = jsonObject.getBigDecimal("settleAmount"); // 确认金额就是结算金额
|
||||
String paymentId = jsonObject.getString("paymentId"); // 支付id
|
||||
String orderCode = jsonObject.getString("orderCode"); // 订单编号
|
||||
|
||||
// 延时分账,使用确认交易API
|
||||
PaymentConfirmResponse paymentConfirmResponse = adapayService.createPaymentConfirmRequest(paymentId,
|
||||
adapayMemberAccount, confirmAmt, orderCode, wechatAppId1);
|
||||
System.out.println(JSON.toJSONString(paymentConfirmResponse));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user