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:
@@ -26,7 +26,6 @@ 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.common.util.StringUtils;
|
||||
import com.jsowell.pile.domain.AdapayMemberAccount;
|
||||
import com.jsowell.pile.domain.OrderUnsplitRecord;
|
||||
import com.jsowell.pile.dto.QueryOrderDTO;
|
||||
@@ -76,95 +75,16 @@ public class PaymentTestController {
|
||||
@Autowired
|
||||
private OrderBasicInfoService orderBasicInfoService;
|
||||
|
||||
@Test
|
||||
public void queryCreateConfirmReverseNew() throws BaseAdaPayException {
|
||||
List<String> paymentIdList = getPaymentIdList(); // 查询分账信息
|
||||
List<String> splitInfoByPaymentIdList = adapayService.getSplitInfoByPaymentIdList(paymentIdList);
|
||||
System.out.println("未分账paymentId:" + splitInfoByPaymentIdList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 从payment_ids文件中获取支付id, 并批量查询分账信息
|
||||
* 如需撤销分账, 请使用 {@link PaymentTestController#testCreateConfirmReverse()} 可以本地运行
|
||||
* 如需重新分账, 请使用 {@link TempController#retryOrderSplit(QueryOrderDTO)} 需要使用ApiPost调用pre环境接口
|
||||
*/
|
||||
@Test
|
||||
public void queryCreateConfirmReverse() throws BaseAdaPayException {
|
||||
public void queryCreateConfirmReverseNew() throws BaseAdaPayException {
|
||||
List<String> paymentIdList = getPaymentIdList(); // 查询分账信息
|
||||
|
||||
List<String> unSplitList = Lists.newArrayList(); // 未分帐
|
||||
List<String> splitList = Lists.newArrayList(); // 已分帐
|
||||
|
||||
BigDecimal total = BigDecimal.ZERO; // 总分账金额
|
||||
BigDecimal totalWithdrawalAmt = BigDecimal.ZERO; // 实际到账金额汇总
|
||||
BigDecimal totalFeeAmt = BigDecimal.ZERO; // 手续费金额汇总
|
||||
|
||||
List<String> selfList = Lists.newArrayList();
|
||||
|
||||
Map<String, BigDecimal> map = Maps.newHashMap();
|
||||
for (String paymentId : paymentIdList) {
|
||||
if (StringUtils.isBlank(paymentId)) {
|
||||
continue;
|
||||
}
|
||||
// 查询支付确认id
|
||||
QueryPaymentConfirmDTO dto = new QueryPaymentConfirmDTO();
|
||||
dto.setPaymentId(paymentId);
|
||||
dto.setWechatAppId(wechatAppId1);
|
||||
// 查询分账信息
|
||||
QueryPaymentConfirmDetailResponse response = adapayService.queryPaymentConfirmList(dto);
|
||||
if (response != null) {
|
||||
List<PaymentConfirmInfo> confirms = response.getPaymentConfirms();
|
||||
if (CollectionUtils.isEmpty(confirms)) {
|
||||
unSplitList.add(paymentId);
|
||||
} else {
|
||||
splitList.add(paymentId);
|
||||
for (PaymentConfirmInfo confirm : confirms) {
|
||||
if (adapayService.queryConfirmReverseStatus(confirm)) {
|
||||
System.out.println("支付确认id:" + confirm.getId() + "撤销了。。。");
|
||||
continue;
|
||||
}
|
||||
JSONObject jsonObject = JSON.parseObject(confirm.getDescription());
|
||||
String adapayMemberId = jsonObject.getString("adapayMemberId");
|
||||
if (StringUtils.isBlank(adapayMemberId)) {
|
||||
adapayMemberId = jsonObject.getString("adapayMemberIds");
|
||||
}
|
||||
|
||||
BigDecimal confirmAmt = new BigDecimal(confirm.getConfirmAmt()); // 本次确认金额
|
||||
BigDecimal confirmedAmt = new BigDecimal(confirm.getConfirmedAmt()); // 已确认金额
|
||||
BigDecimal feeAmt = new BigDecimal(confirm.getFeeAmt()); // 手续费
|
||||
|
||||
// 汇总已确认金额
|
||||
total = total.add(confirmedAmt);
|
||||
|
||||
// 汇总手续费金额
|
||||
totalFeeAmt = totalFeeAmt.add(feeAmt);
|
||||
|
||||
// 汇总可提现金额
|
||||
totalWithdrawalAmt = totalWithdrawalAmt.add(confirmAmt).subtract(feeAmt);
|
||||
|
||||
// confirm
|
||||
List<DivMember> divMembers = confirm.getDivMembers();
|
||||
System.out.println("confirm:" + JSON.toJSONString(divMembers));
|
||||
for (DivMember divMember : divMembers) {
|
||||
// 放map
|
||||
map.merge(divMember.getMemberId(), new BigDecimal(divMember.getAmount()), BigDecimal::add);
|
||||
}
|
||||
|
||||
if (StringUtils.equals(adapayMemberId, "0")
|
||||
|| StringUtils.equals(adapayMemberId, "AM29102732")) {
|
||||
// 0为默认平台id, AM29102732为罗总账户
|
||||
selfList.add(paymentId);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
unSplitList.add(paymentId);
|
||||
}
|
||||
}
|
||||
System.out.println("=================未分账:" + JSON.toJSONString(unSplitList) + ", 数量:" + unSplitList.size());
|
||||
System.out.println("=================已分账:" + JSON.toJSONString(map) + ", 总分账:" + total + ", 数量:" + splitList.size());
|
||||
System.out.println("===============金额明细:" + "总到账金额:" + totalWithdrawalAmt + ", 总手续费:" + totalFeeAmt);
|
||||
System.out.println("===================自己:" + JSON.toJSONString(selfList) + ", 数量:" + selfList.size());
|
||||
List<String> splitInfoByPaymentIdList = adapayService.getSplitInfoByPaymentIdList(paymentIdList);
|
||||
System.out.println("未分账paymentId:" + splitInfoByPaymentIdList);
|
||||
}
|
||||
|
||||
public List<String> getPaymentIdList() {
|
||||
|
||||
Reference in New Issue
Block a user