支付 回调 处理 以及 订单状态 修改

This commit is contained in:
2025-02-15 15:12:57 +08:00
parent faa6f448c0
commit 5fd691f71b
15 changed files with 285 additions and 67 deletions

View File

@@ -0,0 +1,93 @@
package com.czg.order.entity;
import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.KeyType;
import com.mybatisflex.annotation.Table;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.io.Serial;
import jakarta.validation.constraints.NotBlank;
import lombok.*;
/**
* 支付详情 实体类。
*
* @author ww
* @since 2025-02-15
*/
@Data
@Table("tb_order_payment")
public class OrderPayment implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* 主键
*/
@Id(keyType = KeyType.Auto)
private Long id;
/**
* 店铺Id
*/
private Long shopId;
/**
* 来源Id 订单Id或充值id
*/
private Long sourceId;
/**
* 支付方式order,refund, memberIn,memberRefund
*/
private String payType;
/**
* 支付单号 唯一 自己系统的 mchOrderNo
*/
private String orderNo;
/**
* 微信或支付宝支付条码
*/
private String authCode;
/**
* 金额
*/
private BigDecimal amount;
/**
* 三方支付单号 返回结果的 payOrderId
*/
private String tradeNumber;
@Column(onInsertValue = "now()")
private LocalDateTime payTime;
/**
* 支付相应结果 json
*/
private String respJson;
@Column(onInsertValue = "now()")
private LocalDateTime createTime;
@Column(onInsertValue = "now()", onUpdateValue = "now()")
private LocalDateTime updateTime;
public OrderPayment(@NonNull Long shopId, @NonNull Long sourceId, @NotBlank String payType, @NotBlank String orderNo,
String authCode,@NonNull BigDecimal amount) {
this.shopId = shopId;
this.sourceId = sourceId;
this.payType = payType;
this.orderNo = orderNo;
this.authCode = authCode;
this.amount = amount;
}
}

View File

@@ -1,5 +1,6 @@
package com.czg.order.service;
import com.alibaba.fastjson2.JSONObject;
import com.czg.order.dto.OrderInfoQueryDTO;
import com.czg.order.entity.OrderInfo;
import com.czg.order.vo.OrderInfoVo;
@@ -15,4 +16,6 @@ import com.mybatisflex.core.service.IService;
public interface OrderInfoService extends IService<OrderInfo> {
Page<OrderInfoVo> getOrderByPage(OrderInfoQueryDTO param);
void payCallBackOrder(String orderNo, JSONObject resultJson);
void refundCallBackOrder();
}

View File

@@ -0,0 +1,14 @@
package com.czg.order.service;
import com.mybatisflex.core.service.IService;
import com.czg.order.entity.OrderPayment;
/**
* 支付详情 服务层。
*
* @author ww
* @since 2025-02-15
*/
public interface OrderPaymentService extends IService<OrderPayment> {
}