mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 02:55:04 +08:00
撤销的分账算未分帐
This commit is contained in:
@@ -8,7 +8,6 @@ import com.huifu.adapay.model.Payment;
|
||||
import com.huifu.adapay.model.PaymentReverse;
|
||||
import com.huifu.adapay.model.Refund;
|
||||
import com.jsowell.JsowellApplication;
|
||||
import com.jsowell.adapay.common.DivMember;
|
||||
import com.jsowell.adapay.common.PaymentConfirmInfo;
|
||||
import com.jsowell.adapay.dto.PaymentConfirmParam;
|
||||
import com.jsowell.adapay.dto.QueryPaymentConfirmDTO;
|
||||
@@ -21,12 +20,9 @@ import com.jsowell.adapay.vo.AdapayCorpMemberVO;
|
||||
import com.jsowell.adapay.vo.OrderSplitResult;
|
||||
import com.jsowell.api.uniapp.customer.TempController;
|
||||
import com.jsowell.common.constant.CacheConstants;
|
||||
import com.jsowell.common.constant.Constants;
|
||||
import com.jsowell.common.core.redis.RedisCache;
|
||||
import com.jsowell.common.enums.ykc.ScenarioEnum;
|
||||
import com.jsowell.common.util.AdapayUtil;
|
||||
import com.jsowell.common.util.DateUtils;
|
||||
import com.jsowell.pile.domain.AdapayMemberAccount;
|
||||
import com.jsowell.pile.domain.OrderBasicInfo;
|
||||
import com.jsowell.pile.domain.OrderDetail;
|
||||
import com.jsowell.pile.domain.OrderUnsplitRecord;
|
||||
@@ -94,6 +90,10 @@ public class PaymentTestController {
|
||||
System.out.println("耗时:" + stopWatch.getLastTaskTimeMillis() + ", splitInfoMap:" + JSON.toJSONString(splitInfoMap));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取支付idList
|
||||
* @return
|
||||
*/
|
||||
public List<String> getPaymentIdList() {
|
||||
List<String> resultList = Lists.newArrayList();
|
||||
// List<String> paymentIdList1 = getPaymentIdList1();
|
||||
@@ -126,26 +126,6 @@ public class PaymentTestController {
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取分账参数
|
||||
*/
|
||||
public Map<String, Object> getPaymentConfirmParam() {
|
||||
Map<String, Object> paramMap = Maps.newHashMap();
|
||||
|
||||
// 待分账汇付会员id, 如需分给对应商户就填写正确的汇付会员id
|
||||
String adapayMemberId = "AM44542905";
|
||||
|
||||
// 待分账订单信息, 需要重新分账的订单信息(针对未分账的订单)
|
||||
String jsonArrayString = "[" +
|
||||
"{\"orderCode\":\"C27490025494\", \"settleAmount\":\"12.95\", \"paymentId\":\"002212025040121085510753131992504455168\"}" +
|
||||
"]";
|
||||
JSONArray jsonArray = JSONArray.parseArray(jsonArrayString);
|
||||
|
||||
paramMap.put("adapayMemberId", adapayMemberId);
|
||||
paramMap.put("paymentList", jsonArray);
|
||||
return paramMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* 提现方法
|
||||
*
|
||||
@@ -272,68 +252,6 @@ public class PaymentTestController {
|
||||
return paramMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量执行分账
|
||||
* @deprecated 2025年8月16日15点48分弃用, 此分账方法不会保存分账记录, 应使用接口执行分账
|
||||
*/
|
||||
@Test
|
||||
public void batchCreatePaymentConfirm() {
|
||||
// 获取分账参数
|
||||
// Map<String, Object> confirmParam = getPaymentConfirmParam();
|
||||
Map<String, Object> confirmParam = getPaymentConfirmParamFromFile();
|
||||
// 分账到指定汇付会员账户中
|
||||
AdapayMemberAccount adapayMemberAccount = new AdapayMemberAccount();
|
||||
adapayMemberAccount.setAdapayMemberId((String) confirmParam.get("adapayMemberId"));
|
||||
// 分账订单信息
|
||||
JSONArray paymentList = (JSONArray) confirmParam.get("paymentList");
|
||||
|
||||
// 请求参数list
|
||||
List<PaymentConfirmParam> paramList = new ArrayList<>();
|
||||
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"); // 订单编号
|
||||
System.out.println("paymentId:" + paymentId + ", orderCode:" + orderCode + ", settleAmount:" + confirmAmt);
|
||||
|
||||
DivMember divMember = new DivMember();
|
||||
divMember.setMemberId(adapayMemberAccount.getAdapayMemberId());
|
||||
divMember.setAmount(AdapayUtil.formatAmount(confirmAmt));
|
||||
divMember.setFeeFlag(Constants.Y);
|
||||
|
||||
PaymentConfirmParam param = PaymentConfirmParam.builder()
|
||||
.paymentId(paymentId)
|
||||
.divMemberList(Lists.newArrayList(divMember))
|
||||
.confirmAmt(confirmAmt)
|
||||
.orderCode(orderCode)
|
||||
.wechatAppId(wechatAppId1)
|
||||
.build();
|
||||
paramList.add(param);
|
||||
}
|
||||
|
||||
// 执行分账方法
|
||||
if (!paramList.isEmpty()) {
|
||||
for (PaymentConfirmParam paymentConfirmParam : paramList) {
|
||||
// 延时分账,使用确认交易API
|
||||
PaymentConfirmResponse paymentConfirmResponse = adapayService.createPaymentConfirmRequest(paymentConfirmParam);
|
||||
// status为failed, error_code为payment_over_time_doing, error_msg为数据正在处理中,请稍后再试, 则重试最多重试2次
|
||||
if (paymentConfirmResponse.isFailed()) {
|
||||
int count = 0;
|
||||
while (count < 2) {
|
||||
count++;
|
||||
System.out.println("第" + count + "次重试");
|
||||
paymentConfirmResponse = adapayService.createPaymentConfirmRequest(paymentConfirmParam);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 执行分账并处理重试
|
||||
// for (PaymentConfirmParam param : paramList) {
|
||||
// executeWithRetry(param, 0); // 初始重试次数为0
|
||||
// }
|
||||
}
|
||||
|
||||
/**
|
||||
* 执行分账并处理重试逻辑
|
||||
* @deprecated
|
||||
|
||||
@@ -1,116 +1,23 @@
|
||||
002212025091323504710812966726266179584
|
||||
002212025091323551610812967854542348288
|
||||
002212025091323443510812965166807146496
|
||||
002212025091400460010812980620632162304
|
||||
002212025091320185210812913395464314880
|
||||
002212025091400251110812975382261035008
|
||||
002212025091401044010812985316553957376
|
||||
002212025091321044610812924946841747456
|
||||
002212025091401223210812989815599304704
|
||||
002212025091401293010812991566205321216
|
||||
002212025091322382710812948523603357696
|
||||
002212025091402331310813007603441246208
|
||||
002212025091403104610813017054747455488
|
||||
002212025091403470510813026193569619968
|
||||
002212025091403364510813023593319256064
|
||||
002212025091404221510813035044029210624
|
||||
002212025091404371410813038812812689408
|
||||
002212025091404242510813035588512813056
|
||||
002212025091405395910813054603603902464
|
||||
002212025091406230510813065451386855424
|
||||
002212025091401233010812990058088808448
|
||||
002212025091407071710813076574286831616
|
||||
002212025091407263010813081411581816832
|
||||
002212025091407361210813083852087906304
|
||||
002212025091407084910813076959223275520
|
||||
002212025091407412710813085173478223872
|
||||
002212025091408295310813097361051901952
|
||||
002212025091409055210813106416067706880
|
||||
002212025091409365110813114214897831936
|
||||
002212025091409272910813111855262109696
|
||||
002212025091409260410813111500675629056
|
||||
002212025091410255910813126576514179072
|
||||
002212025091409083010813107077513621504
|
||||
002212025091409302010813112574920761344
|
||||
002212025091410101510813122618047504384
|
||||
002212025091410192110813124908439486464
|
||||
002212025091410385710813129843407204352
|
||||
002212025091409192310813109818684239872
|
||||
002212025091410455010813131572060274688
|
||||
002212025091410404310813130285528797184
|
||||
002212025091410444310813131292816068608
|
||||
002212025091411062110813136738331271168
|
||||
002212025091410343310813128734659739648
|
||||
002212025091411305910813142936145289216
|
||||
002212025091411585210813149954511876096
|
||||
002212025091412172910813154639293620224
|
||||
002212025091412445910813161557793845248
|
||||
002212025091408225810813095620038254592
|
||||
002212025091412331610813158610146066432
|
||||
002212025091412292110813157626892177408
|
||||
002212025091412525110813163537643749376
|
||||
002212025091409393410813114895717285888
|
||||
002212025091413244110813171551461335040
|
||||
002212025091413181710813169938273316864
|
||||
002212025091413423410813176050271830016
|
||||
002212025091413222710813170987423911936
|
||||
002212025091414370510813189770993639424
|
||||
002212025091408351410813098707633233920
|
||||
002212025091412562310813164429981937664
|
||||
002212025091414283810813187644049477632
|
||||
002212025091414390410813190270287757312
|
||||
002212025091414544410813194211247403008
|
||||
002212025091414384510813190187345399808
|
||||
002212025091414001410813180495349071872
|
||||
002212025091414072510813182304213950464
|
||||
002212025091415322510813203695797710848
|
||||
002212025091414383910813190162494160896
|
||||
002212025091414511810813193346000244736
|
||||
002212025091415255110813202040716967936
|
||||
002212025091415124610813198748830040064
|
||||
002212025091415123710813198712264122368
|
||||
002212025091415473310813207501956612096
|
||||
002212025091415522110813208713183526912
|
||||
002212025091416120910813213693135167488
|
||||
002212025091416081810813212724188041216
|
||||
002212025091416244110813216848996638720
|
||||
002212025091417004010813225903483965440
|
||||
002212025091417153010813229638322929664
|
||||
002212025091417100710813228283608870912
|
||||
002212025091416503010813223346745298944
|
||||
002212025091417554710813239775674687488
|
||||
002212025091418050310813242105556033536
|
||||
002212025091417411110813236100013109248
|
||||
002212025091417544010813239495444807680
|
||||
002212025091418044110813242013499428864
|
||||
002212025091417453210813237196660043776
|
||||
002212025091418033210813241723878522880
|
||||
002212025091418160310813244875486969856
|
||||
002212025091418183410813245508386480128
|
||||
002212025091418213310813246258814541824
|
||||
002212025091418344810813249592980025344
|
||||
002212025091418512510813253775414153216
|
||||
002212025091419440810813267040580022272
|
||||
002212025091419032110813256776832937984
|
||||
002212025091419304310813263667147456512
|
||||
002212025091419405810813266245151260672
|
||||
002212025091419441810813267082254647296
|
||||
002212025091420431010813281899749203968
|
||||
002212025091420285010813278289128751104
|
||||
002212025091420150210813274815905308672
|
||||
002212025091420134410813274489814921216
|
||||
002212025091419284510813263169380052992
|
||||
002212025091421051710813287463464112128
|
||||
002212025091421285010813293388618973184
|
||||
002212025091421233010813292046483623936
|
||||
002212025091420425110813281820279746560
|
||||
002212025091421300510813293705242796032
|
||||
002212025091421330710813294468501250048
|
||||
002212025091422054510813302682269704192
|
||||
002212025091422082910813303367019192320
|
||||
002212025091422084910813303452255789056
|
||||
002212025091422432510813312159203098624
|
||||
002212025091422075510813303225775972352
|
||||
002212025091422201410813306326205493248
|
||||
002212025091422173810813305670677721088
|
||||
002212025091422075710813303232398761984
|
||||
002212025093016404610819019101213786112
|
||||
002212025093016480010819020923576094720
|
||||
002212025093016545810819022674920161280
|
||||
002212025093016591510819023753909075968
|
||||
002212025093017071710819025774825697280
|
||||
002212025093017125710819027202424025088
|
||||
002212025093017191310819028779683803136
|
||||
002212025093017213010819029354248785920
|
||||
002212025093021481910819096499045236736
|
||||
002212025093022004910819099644320247808
|
||||
002212025093021523910819097588742180864
|
||||
002212025093021455810819095906331201536
|
||||
002212025093022312610819107348346822656
|
||||
002212025093022095910819101953838235648
|
||||
002212025093022412910819109879650783232
|
||||
002212025093022355510819108477796941824
|
||||
002212025093022362310819108594562334720
|
||||
002212025093023033210819115430052962304
|
||||
002212025093022294310819106919646871552
|
||||
002212025093023092610819116914169982976
|
||||
002212025093023084710819116751426650112
|
||||
002212025093023125610819117793698590720
|
||||
002212025093023361610819123667662266368
|
||||
Reference in New Issue
Block a user