feat 分账SDK相关接口, 版本号升级

This commit is contained in:
DaxPay
2024-12-18 14:23:33 +08:00
parent b5d10f1ead
commit 0bfc0c6c97
65 changed files with 716 additions and 770 deletions

View File

@@ -6,7 +6,7 @@
<parent>
<groupId>org.dromara.daxpay</groupId>
<artifactId>daxpay-single</artifactId>
<version>3.0.0.beta2</version>
<version>3.0.0.beta3</version>
</parent>
<artifactId>daxpay-single-service</artifactId>

View File

@@ -110,7 +110,8 @@ public class AllocationService {
return new AllocationResult()
.setAllocNo(order.getAllocNo())
.setBizAllocNo(order.getBizAllocNo())
.setStatus(order.getStatus());
.setStatus(order.getStatus())
.setResult(order.getResult());
}
// 创建分账策略并初始化
var allocationStrategy = PaymentStrategyFactory.create(payOrder.getChannel(),AbsAllocationStrategy.class);
@@ -137,7 +138,8 @@ public class AllocationService {
return new AllocationResult()
.setAllocNo(order.getAllocNo())
.setBizAllocNo(order.getBizAllocNo())
.setStatus(order.getStatus());
.setStatus(order.getStatus())
.setResult(order.getResult());
} finally {
lockTemplate.releaseLock(lock);
}
@@ -214,7 +216,8 @@ public class AllocationService {
return new AllocationResult()
.setAllocNo(order.getAllocNo())
.setBizAllocNo(order.getBizAllocNo())
.setStatus(order.getStatus());
.setStatus(order.getStatus())
.setResult(order.getResult());
} finally {
lockTemplate.releaseLock(lock);
}
@@ -296,7 +299,8 @@ public class AllocationService {
return new AllocationResult()
.setAllocNo(allocOrder.getAllocNo())
.setBizAllocNo(allocOrder.getBizAllocNo())
.setStatus(allocOrder.getStatus());
.setStatus(allocOrder.getStatus())
.setResult(allocOrder.getResult());
}

View File

@@ -95,7 +95,7 @@ public class AllocationSyncService {
// 调用同步逻辑
this.sync(allocOrder);
return new AllocSyncResult();
return new AllocSyncResult().setResult(allocOrder.getResult()).setStatus(allocOrder.getStatus());
}
/**

View File

@@ -4,6 +4,7 @@ import cn.bootx.platform.core.exception.ValidationFailedException;
import cn.bootx.platform.core.util.BigDecimalUtil;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.StrUtil;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.dromara.daxpay.core.enums.AllocDetailResultEnum;
@@ -163,10 +164,10 @@ public class AllocOrderService {
.setOrderNo(payOrder.getOrderNo())
.setBizOrderNo(payOrder.getBizOrderNo())
.setOutOrderNo(payOrder.getOutOrderNo())
.setTitle(payOrder.getTitle())
.setAllocNo(TradeNoGenerateUtil.allocation())
.setBizAllocNo(param.getBizAllocNo())
.setChannel(payOrder.getChannel())
.setTitle(param.getTitle())
.setDescription(param.getDescription())
.setStatus(AllocationStatusEnum.PROCESSING.getCode())
.setResult(AllocationResultEnum.ALL_PENDING.getCode())
@@ -174,6 +175,10 @@ public class AllocOrderService {
.setNotifyUrl(param.getNotifyUrl())
.setAttach(param.getAttach())
.setClientIp(param.getClientIp());
// 订单标题为空, 则使用支付订单标题
if (StrUtil.isBlank(allocOrder.getTitle())){
allocOrder.setTitle(payOrder.getTitle());
}
// 如果分账订单金额为0, 设置为忽略状态
if (BigDecimalUtil.isEqual(sumAmount, BigDecimal.ZERO)) {
allocOrder.setStatus(AllocationStatusEnum.IGNORE.getCode())