mirror of
https://gitee.com/dromara/dax-pay.git
synced 2025-09-06 12:39:38 +00:00
feat 对账明细列表查看和通用对账字段优化
This commit is contained in:
@@ -137,14 +137,14 @@ public class AliPayReconcileService {
|
||||
// 默认为支付对账记录
|
||||
PayReconcileDetail payReconcileDetail = new PayReconcileDetail()
|
||||
.setRecordOrderId(billDetail.getRecordOrderId())
|
||||
.setOrderId(billDetail.getOutTradeNo())
|
||||
.setPaymentId(billDetail.getOutTradeNo())
|
||||
.setType("pay")
|
||||
.setAmount(amount)
|
||||
.setTitle(billDetail.getSubject())
|
||||
.setGatewayOrderNo(billDetail.getTradeNo());
|
||||
// 退款覆盖更新对应的字段
|
||||
if (Objects.equals(billDetail.getTradeType(), "退款")){
|
||||
payReconcileDetail.setOrderId(billDetail.getBatchNo())
|
||||
payReconcileDetail.setRefundId(billDetail.getBatchNo())
|
||||
.setType("refund");
|
||||
}
|
||||
|
||||
|
@@ -80,7 +80,7 @@ public class WxReconcileBillDetail extends MpIdEntity {
|
||||
|
||||
@Alias("微信退款单号")
|
||||
@DbColumn(comment = "微信退款单号")
|
||||
private String name;
|
||||
private String wxRefundNo;
|
||||
|
||||
@Alias("商户退款单号")
|
||||
@DbColumn(comment = "商户退款单号")
|
||||
|
@@ -117,7 +117,7 @@ public class WechatPayReconcileService{
|
||||
// 默认为支付对账记录
|
||||
PayReconcileDetail payReconcileDetail = new PayReconcileDetail()
|
||||
.setRecordOrderId(billDetail.getRecordOrderId())
|
||||
.setOrderId(billDetail.getMchOrderNo())
|
||||
.setPaymentId(billDetail.getMchOrderNo())
|
||||
.setTitle(billDetail.getSubject())
|
||||
.setGatewayOrderNo(billDetail.getWeiXinOrderNo());
|
||||
// 支付
|
||||
@@ -136,7 +136,8 @@ public class WechatPayReconcileService{
|
||||
double v = Double.parseDouble(refundAmount) * 100;
|
||||
int amount = Math.abs(((int) v));
|
||||
payReconcileDetail.setType("refund")
|
||||
.setAmount(amount);
|
||||
.setAmount(amount)
|
||||
.setRefundId(billDetail.getMchRefundNo());
|
||||
}
|
||||
// TODO 已撤销, 暂时未处理
|
||||
if (Objects.equals(billDetail.getStatus(), "REVOKED")){
|
||||
|
@@ -27,25 +27,30 @@ public class PayReconcileDetail extends MpCreateEntity implements EntityBaseFunc
|
||||
@DbColumn(comment = "关联对账订单ID")
|
||||
private Long recordOrderId;
|
||||
|
||||
/** 交易类型 支付/退款 */
|
||||
@DbColumn(comment = "交易类型")
|
||||
private String type;
|
||||
|
||||
/** 订单id - 支付ID/退款ID等 */
|
||||
@DbColumn(comment = "订单id")
|
||||
private String orderId;
|
||||
|
||||
/** 网关订单号 - 支付宝/微信的订单号 */
|
||||
@DbColumn(comment = "网关订单号")
|
||||
private String gatewayOrderNo;
|
||||
/** 商品名称 */
|
||||
@DbColumn(comment = "商品名称")
|
||||
private String title;
|
||||
|
||||
/** 交易金额 */
|
||||
@DbColumn(comment = "交易金额")
|
||||
private Integer amount;
|
||||
|
||||
/** 商品名称 */
|
||||
@DbColumn(comment = "商品名称")
|
||||
private String title;
|
||||
/** 交易类型 pay/refund */
|
||||
@DbColumn(comment = "交易类型")
|
||||
private String type;
|
||||
|
||||
/** 本地订单ID */
|
||||
@DbColumn(comment = "本地订单ID")
|
||||
private String paymentId;
|
||||
|
||||
/** 本地退款ID */
|
||||
@DbColumn(comment = "本地退款ID")
|
||||
private String refundId;
|
||||
|
||||
/** 网关订单号 - 支付宝/微信的订单号 */
|
||||
@DbColumn(comment = "网关订单号")
|
||||
private String gatewayOrderNo;
|
||||
|
||||
|
||||
@Override
|
||||
public PayReconcileDetailDto toDto() {
|
||||
|
@@ -52,7 +52,7 @@ public class PayReconcileService {
|
||||
reconcileOrderService.update(recordOrder);
|
||||
} catch (Exception e) {
|
||||
log.error("下载对账单异常", e);
|
||||
recordOrder.setErrorMsg("错误原因: " + e.getMessage());
|
||||
recordOrder.setErrorMsg("原因: " + e.getMessage());
|
||||
reconcileOrderService.update(recordOrder);
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
@@ -17,32 +17,31 @@ import lombok.experimental.Accessors;
|
||||
@Schema(title = "对账订单详情")
|
||||
public class PayReconcileDetailDto extends BaseDto {
|
||||
|
||||
/** 关联对账订单ID */
|
||||
@Schema(description = "关联对账订单ID")
|
||||
private Long recordOrderId;
|
||||
|
||||
/**
|
||||
* @see cn.bootx.platform.daxpay.code.PayStatusEnum
|
||||
*/
|
||||
@Schema(description = "交易状态")
|
||||
private String status;
|
||||
|
||||
/** 交易类型 支付/退款 */
|
||||
@Schema(description = "交易类型")
|
||||
private String type;
|
||||
|
||||
/** 订单id - 支付ID/退款ID等 */
|
||||
@Schema(description = "订单id")
|
||||
private String orderId;
|
||||
|
||||
/** 网关订单号 - 支付宝/微信的订单号 */
|
||||
@Schema(description = "网关订单号")
|
||||
private String gatewayOrderNo;
|
||||
/** 商品名称 */
|
||||
@Schema(description = "商品名称")
|
||||
private String title;
|
||||
|
||||
/** 交易金额 */
|
||||
@Schema(description = "交易金额")
|
||||
private Integer amount;
|
||||
|
||||
/** 商品名称 */
|
||||
@Schema(description = "商品名称")
|
||||
private String title;
|
||||
/** 交易类型 pay/refund */
|
||||
@Schema(description = "交易类型")
|
||||
private String type;
|
||||
|
||||
/** 本地订单ID */
|
||||
@Schema(description = "本地订单ID")
|
||||
private String paymentId;
|
||||
|
||||
/** 本地退款ID */
|
||||
@Schema(description = "本地退款ID")
|
||||
private String refundId;
|
||||
|
||||
/** 网关订单号 - 支付宝/微信的订单号 */
|
||||
@Schema(description = "网关订单号")
|
||||
private String gatewayOrderNo;
|
||||
}
|
||||
|
@@ -19,19 +19,17 @@ public class ReconcileDetailQuery {
|
||||
@Schema(description = "关联对账订单ID")
|
||||
private Long recordOrderId;
|
||||
|
||||
/**
|
||||
* @see cn.bootx.platform.daxpay.code.PayStatusEnum
|
||||
*/
|
||||
@Schema(description = "交易状态")
|
||||
private String status;
|
||||
|
||||
/** 交易类型 支付/退款 */
|
||||
@Schema(description = "交易类型")
|
||||
private String type;
|
||||
|
||||
/** 订单id - 支付ID/退款ID等 */
|
||||
@Schema(description = "订单id")
|
||||
private String orderId;
|
||||
private String paymentId;
|
||||
|
||||
/** 本地退款ID */
|
||||
@Schema(description = "本地退款ID")
|
||||
private String refundId;
|
||||
|
||||
/** 网关订单号 - 支付宝/微信的订单号 */
|
||||
@Schema(description = "网关订单号")
|
||||
|
Reference in New Issue
Block a user