Merge branch 'dev-new' into dev-new-rabbitmq

# Conflicts:
#	jsowell-admin/src/test/java/SpringBootTestController.java
#	jsowell-pile/src/main/java/com/jsowell/pile/service/OrderBasicInfoService.java
#	jsowell-pile/src/main/java/com/jsowell/pile/service/impl/OrderBasicInfoServiceImpl.java
This commit is contained in:
Guoqs
2024-12-28 15:15:15 +08:00
54 changed files with 4373 additions and 2540 deletions

View File

@@ -8,6 +8,7 @@ import com.huifu.adapay.core.exception.BaseAdaPayException;
import com.huifu.adapay.model.PaymentReverse;
import com.huifu.adapay.model.Refund;
import com.jsowell.JsowellApplication;
import com.jsowell.adapay.common.PaymentConfirmInfo;
import com.jsowell.adapay.dto.QueryConfirmReverseDTO;
import com.jsowell.adapay.dto.QueryPaymentConfirmDTO;
import com.jsowell.adapay.operation.PaymentReverseOperation;
@@ -16,9 +17,11 @@ 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.adapay.vo.OrderSplitResult;
import com.jsowell.common.enums.ykc.ScenarioEnum;
import com.jsowell.common.util.StringUtils;
import com.jsowell.pile.domain.AdapayMemberAccount;
import com.jsowell.pile.service.OrderBasicInfoService;
import org.apache.commons.collections4.CollectionUtils;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -53,6 +56,9 @@ public class PaymentTestController {
@Autowired
private AdapayService adapayService;
@Autowired
private OrderBasicInfoService orderBasicInfoService;
public List<String> getPaymentIdList() {
List<String> resultList = Lists.newArrayList();
// List<String> paymentIdList1 = getPaymentIdList1();
@@ -305,12 +311,12 @@ public class PaymentTestController {
// 查询分账信息
QueryPaymentConfirmDetailResponse response = adapayService.queryPaymentConfirmList(dto);
if (response != null) {
List<QueryPaymentConfirmDetailResponse.PaymentConfirmInfo> confirms = response.getPaymentConfirms();
List<PaymentConfirmInfo> confirms = response.getPaymentConfirms();
if (CollectionUtils.isEmpty(confirms)) {
unSplitList.add(paymentId);
} else {
splitList.add(paymentId);
for (QueryPaymentConfirmDetailResponse.PaymentConfirmInfo confirm : confirms) {
for (PaymentConfirmInfo confirm : confirms) {
if (queryConfirmReverseStatus(confirm)) {
System.out.println("支付确认id:" + confirm.getId() + "撤销了。。。");
continue;
@@ -344,7 +350,7 @@ public class PaymentTestController {
* @return
* @throws BaseAdaPayException
*/
private boolean queryConfirmReverseStatus(QueryPaymentConfirmDetailResponse.PaymentConfirmInfo confirm) throws BaseAdaPayException {
private boolean queryConfirmReverseStatus(PaymentConfirmInfo confirm) throws BaseAdaPayException {
boolean result = false;
QueryConfirmReverseDTO dto = QueryConfirmReverseDTO.builder()
.paymentConfirmId(confirm.getId())
@@ -372,10 +378,10 @@ public class PaymentTestController {
dto.setWechatAppId(wechatAppId1);
QueryPaymentConfirmDetailResponse response = adapayService.queryPaymentConfirmList(dto);
if (response != null) {
List<QueryPaymentConfirmDetailResponse.PaymentConfirmInfo> confirms = response.getPaymentConfirms();
List<PaymentConfirmInfo> confirms = response.getPaymentConfirms();
System.out.println("支付id:" + paymentId + ", 确认信息:" + JSON.toJSONString(confirms));
if (CollectionUtils.isNotEmpty(confirms)) {
for (QueryPaymentConfirmDetailResponse.PaymentConfirmInfo confirm : confirms) {
for (PaymentConfirmInfo confirm : confirms) {
adapayService.createConfirmReverse(confirm.getId(), wechatAppId1);
}
}
@@ -468,4 +474,29 @@ public class PaymentTestController {
String wechatAppId = wechatAppId1; // 万车充id
adapayService.createBalancePaymentRequest(outMemberId, inMemberId, transAmt, title, desc, wechatAppId);
}
/**
* 校验订单分账金额
*/
@Test
public void verifyOrderConfirmAmountTest() throws BaseAdaPayException {
String orderCode = "C21960272918";
List<String> paymentIds = Lists.newArrayList("002212024121307453510713429549121368064");
BigDecimal settleAmount = new BigDecimal("19.37");
String wechatAppId = wechatAppId1;
OrderSplitResult orderSplitResult = orderBasicInfoService.verifyOrderConfirmAmount(paymentIds, orderCode, settleAmount, wechatAppId);
System.out.println(JSON.toJSONString(orderSplitResult));
}
@Test
public void queryPaymentConfirmDetailTest() throws BaseAdaPayException {
// 查询支付确认id
QueryPaymentConfirmDTO dto = new QueryPaymentConfirmDTO();
dto.setPaymentId("002212024121307453510713429549121368064");
dto.setWechatAppId(wechatAppId1);
// 查询分账信息
QueryPaymentConfirmDetailResponse response = adapayService.queryPaymentConfirmList(dto);
System.out.println(JSON.toJSONString(response));
}
}

View File

@@ -18,6 +18,7 @@ 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.config.AbstractAdapayConfig;
import com.jsowell.adapay.dto.*;
import com.jsowell.adapay.factory.AdapayConfigFactory;
@@ -935,7 +936,7 @@ public class SpringBootTestController {
dto.setWechatAppId(wechatAppId1);
dto.setPaymentId("002212023122208033310584061601344237568");
QueryPaymentConfirmDetailResponse response = adapayService.queryPaymentConfirmList(dto);
List<QueryPaymentConfirmDetailResponse.PaymentConfirmInfo> paymentConfirms = response.getPaymentConfirms();
List<PaymentConfirmInfo> paymentConfirms = response.getPaymentConfirms();
// 如果没有分账信息,说明没有清分
String clearingStatus = null;
if (org.springframework.util.CollectionUtils.isEmpty(paymentConfirms)) {
@@ -1106,12 +1107,12 @@ public class SpringBootTestController {
// 查询分账信息
QueryPaymentConfirmDetailResponse response = adapayService.queryPaymentConfirmList(dto);
if (response != null) {
List<QueryPaymentConfirmDetailResponse.PaymentConfirmInfo> confirms = response.getPaymentConfirms();
List<PaymentConfirmInfo> confirms = response.getPaymentConfirms();
if (CollectionUtils.isEmpty(confirms)) {
unSplitList.add(paymentId);
} else {
splitList.add(paymentId);
for (QueryPaymentConfirmDetailResponse.PaymentConfirmInfo confirm : confirms) {
for (PaymentConfirmInfo confirm : confirms) {
if (queryConfirmReverseStatus(confirm)) {
System.out.println("支付确认id:" + confirm.getId() + "撤销了。。。");
continue;
@@ -1139,7 +1140,7 @@ public class SpringBootTestController {
System.out.println("=================自己:" + JSON.toJSONString(selfList) + ", 数量:" + selfList.size());
}
private boolean queryConfirmReverseStatus(QueryPaymentConfirmDetailResponse.PaymentConfirmInfo confirm) throws BaseAdaPayException {
private boolean queryConfirmReverseStatus(PaymentConfirmInfo confirm) throws BaseAdaPayException {
boolean result = false;
QueryConfirmReverseDTO dto = QueryConfirmReverseDTO.builder()
@@ -1205,10 +1206,10 @@ public class SpringBootTestController {
dto.setWechatAppId(wechatAppId1);
QueryPaymentConfirmDetailResponse response = adapayService.queryPaymentConfirmList(dto);
if (response != null) {
List<QueryPaymentConfirmDetailResponse.PaymentConfirmInfo> confirms = response.getPaymentConfirms();
List<PaymentConfirmInfo> confirms = response.getPaymentConfirms();
System.out.println("支付id:" + paymentId + ", 确认信息:" + JSON.toJSONString(confirms));
if (CollectionUtils.isNotEmpty(confirms)) {
for (QueryPaymentConfirmDetailResponse.PaymentConfirmInfo confirm : confirms) {
for (PaymentConfirmInfo confirm : confirms) {
adapayService.createConfirmReverse(confirm.getId(), wechatAppId1);
}
}