feat 转账订单调试

This commit is contained in:
bootx
2024-06-23 23:11:02 +08:00
parent 975ceb213d
commit d42da8fd62
27 changed files with 159 additions and 52 deletions

View File

@@ -1,6 +1,7 @@
package cn.daxpay.single.service.core.channel.alipay.service;
import cn.bootx.platform.common.core.util.LocalDateTimeUtil;
import cn.daxpay.single.core.code.TransferPayeeTypeEnum;
import cn.daxpay.single.core.code.TransferStatusEnum;
import cn.daxpay.single.core.exception.TradeFaileException;
import cn.daxpay.single.service.code.AliPayCode;
@@ -75,12 +76,16 @@ public class AliPayTransferService {
model.setOutBizNo(order.getTransferNo());
// 设置订单总金额
model.setTransAmount(PayUtil.conversionAmount(order.getAmount()).toString());
// 设置收款方信息
Participant payeeInfo = new Participant();
// 收款人账号
payeeInfo.setIdentity(order.getPayeeAccount());
// 收款人姓名
payeeInfo.setName(order.getPayeeName());
payeeInfo.setIdentityType(order.getPayeeType());
// 收款人类型
String identityType = TransferPayeeTypeEnum.findByCode(order.getPayeeType())
.getOutCode();
payeeInfo.setIdentityType(identityType);
model.setPayeeInfo(payeeInfo);
model.setRemark(order.getReason());
request.setBizModel(model);

View File

@@ -81,7 +81,7 @@ public class ClientNoticeTask extends MpBaseEntity implements EntityBaseFunction
private String url;
/** 最后发送时间 */
@DbColumn(comment = "最后发送时间", isNull = false)
@DbColumn(comment = "最后发送时间")
private LocalDateTime latestTime;
/**

View File

@@ -73,10 +73,6 @@ public class TransferOrder extends MpBaseEntity implements EntityBaseFunction<Tr
@DbColumn(comment = "转账类型, 微信使用", length = 20)
private String transferType;
/** 付款方 */
@DbColumn(comment = "付款方", length = 100)
private String payer;
/**
* 收款人类型
* @see TransferPayeeTypeEnum

View File

@@ -5,7 +5,6 @@ import cn.bootx.platform.common.core.rest.PageResult;
import cn.bootx.platform.common.core.rest.param.PageParam;
import cn.bootx.platform.common.mybatisplus.util.MpUtil;
import cn.daxpay.single.core.exception.ParamValidationFailException;
import cn.daxpay.single.core.exception.PayFailureException;
import cn.daxpay.single.core.exception.TradeNotExistException;
import cn.daxpay.single.core.param.payment.transfer.QueryTransferParam;
import cn.daxpay.single.core.result.order.TransferOrderResult;
@@ -55,7 +54,16 @@ public class TransferOrderQueryService {
*/
public TransferOrderDto findByTransferNo(String transferNo){
return transferOrderManager.findByTransferNo(transferNo).map(TransferOrder::toDto)
.orElseThrow(() -> new DataNotExistException("转账订单扩展信息不存在"));
.orElseThrow(() -> new DataNotExistException("转账订单信息不存在"));
}
/**
* 根据转账号查询
*/
public TransferOrderDto findByBizTransferNo(String bizTransferNo){
return transferOrderManager.findByBizTransferNo(bizTransferNo).map(TransferOrder::toDto)
.orElseThrow(() -> new DataNotExistException("转账订单信息不存在"));
}

View File

@@ -22,7 +22,7 @@ public class AllocationAssistService {
private final AllocationOrderManager allocationOrderManager;
/**
* 根据新传入的分账订单更新订单和扩展信息
* 根据新传入的分账订单更新订单信息
*/
@Transactional(rollbackFor = Exception.class)
public void updateOrder(AllocationParam allocationParam, AllocOrder orderExtra) {

View File

@@ -169,7 +169,7 @@ public class AllocationService {
allocationStrategy.initParam(order, details);
// 分账预处理
allocationStrategy.doBeforeHandler();
// 更新分账单扩展信息
// 更新分账单信息
allocationAssistService.updateOrder(param, order);
try {
// 重复分账处理

View File

@@ -85,7 +85,7 @@ public class PayAssistService {
}
/**
* 根据新传入的支付订单更新订单和扩展信息
* 根据新传入的支付订单更新订单信息
*/
@Transactional(rollbackFor = Exception.class)
public void updatePayOrder(PayParam payParam,PayOrder order) {

View File

@@ -175,7 +175,7 @@ public class RefundService {
}
/**
* 更新退款订单扩展信息
* 更新退款订单信息
*/
private void updateOrder(RefundParam param, RefundOrder order){
order.setAttach(param.getAttach())

View File

@@ -3,6 +3,7 @@ package cn.daxpay.single.service.core.payment.transfer.service;
import cn.daxpay.single.core.code.RefundStatusEnum;
import cn.daxpay.single.core.param.payment.transfer.TransferParam;
import cn.daxpay.single.core.result.transfer.TransferResult;
import cn.daxpay.single.service.common.context.TransferLocal;
import cn.daxpay.single.service.common.local.PaymentContextLocal;
import cn.daxpay.single.service.core.order.transfer.dao.TransferOrderManager;
import cn.daxpay.single.service.core.order.transfer.entity.TransferOrder;
@@ -63,7 +64,11 @@ public class TransferService {
*/
@Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRES_NEW)
public void successHandler(TransferOrder order){
order.setStatus(RefundStatusEnum.SUCCESS.getCode());
TransferLocal transferInfo = PaymentContextLocal.get()
.getTransferInfo();
order.setStatus(transferInfo.getStatus().getCode())
.setSuccessTime(transferInfo.getFinishTime())
.setOutTransferNo(transferInfo.getOutTransferNo());
transferOrderManager.updateById(order);
}
}

View File

@@ -48,7 +48,7 @@ public class WeChatTransferStrategy extends AbsTransferStrategy {
// 转账接收方类型校验
String payeeType = transferParam.getPayeeType();
if (!Objects.equals(WX_PERSONAL.getCode(), payeeType)){
throw new ParamValidationFailException("支付宝不支持该类型收款人");
throw new ParamValidationFailException("微信不支持该类型收款人");
}
}

View File

@@ -61,10 +61,6 @@ public class TransferOrderDto extends BaseDto {
@Schema(description = "转账类型, 微信使用")
private String transferType;
/** 付款方 */
@Schema(description = "付款方")
private String payer;
/**
* 收款人类型
* @see TransferPayeeTypeEnum

View File

@@ -62,9 +62,6 @@ public class TransferOrderQuery extends QueryOrder {
@Schema(description = "转账类型, 微信使用")
private String transferType;
/** 付款方 */
@Schema(description = "付款方")
private String payer;
/**
* 收款人类型