mirror of
				https://gitee.com/hhyykk/ipms-sjy.git
				synced 2025-11-04 04:08:43 +08:00 
			
		
		
		
	增加支付相关表的 SQL,调整相关的实体
This commit is contained in:
		@@ -0,0 +1,21 @@
 | 
			
		||||
package cn.iocoder.yudao.framework.pay.config;
 | 
			
		||||
 | 
			
		||||
import cn.iocoder.yudao.framework.pay.core.client.PayClientFactory;
 | 
			
		||||
import cn.iocoder.yudao.framework.pay.core.client.impl.PayClientFactoryImpl;
 | 
			
		||||
import org.springframework.context.annotation.Bean;
 | 
			
		||||
import org.springframework.context.annotation.Configuration;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 支付配置类
 | 
			
		||||
 *
 | 
			
		||||
 * @author 芋道源码
 | 
			
		||||
 */
 | 
			
		||||
@Configuration
 | 
			
		||||
public class YudaoPayAutoConfiguration {
 | 
			
		||||
 | 
			
		||||
    @Bean
 | 
			
		||||
    public PayClientFactory payClientFactory() {
 | 
			
		||||
        return new PayClientFactoryImpl();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@@ -1,10 +1,16 @@
 | 
			
		||||
package cn.iocoder.yudao.framework.pay.core.client;
 | 
			
		||||
 | 
			
		||||
import com.fasterxml.jackson.annotation.JsonTypeInfo;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 支付客户端的配置,本质是支付渠道的配置
 | 
			
		||||
 * 每个不同的渠道,需要不同的配置,通过子类来定义
 | 
			
		||||
 *
 | 
			
		||||
 * @author 芋道源码
 | 
			
		||||
 */
 | 
			
		||||
@JsonTypeInfo(use = JsonTypeInfo.Id.CLASS)
 | 
			
		||||
// @JsonTypeInfo 注解的作用,Jackson 多态
 | 
			
		||||
// 1. 序列化到时数据库时,增加 @class 属性。
 | 
			
		||||
// 2. 反序列化到内存对象时,通过 @class 属性,可以创建出正确的类型
 | 
			
		||||
public interface PayClientConfig {
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -16,10 +16,10 @@ import java.util.Date;
 | 
			
		||||
public class PayOrderUnifiedReqDTO {
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 客户端 IP
 | 
			
		||||
     * 用户 IP
 | 
			
		||||
     */
 | 
			
		||||
    @NotEmpty(message = "客户端 IP 不能为空")
 | 
			
		||||
    private String clientIp;
 | 
			
		||||
    @NotEmpty(message = "用户 IP 不能为空")
 | 
			
		||||
    private String userIp;
 | 
			
		||||
 | 
			
		||||
    // ========== 商户相关字段 ==========
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -49,7 +49,7 @@ public class AlipayQrPayClient extends AbstractPayClient<AlipayPayClientConfig>
 | 
			
		||||
        model.setSubject(reqDTO.getSubject());
 | 
			
		||||
        model.setBody(reqDTO.getBody());
 | 
			
		||||
        model.setTotalAmount(calculateAmount(reqDTO.getAmount()).toString()); // 单位:元
 | 
			
		||||
        // TODO 芋艿:clientIp + expireTime
 | 
			
		||||
        // TODO 芋艿:userIp + expireTime
 | 
			
		||||
        // 构建 AlipayTradePrecreateRequest
 | 
			
		||||
        AlipayTradePrecreateRequest request = new AlipayTradePrecreateRequest();
 | 
			
		||||
        request.setBizModel(model);
 | 
			
		||||
 
 | 
			
		||||
@@ -46,7 +46,7 @@ public class AlipayWapPayClient extends AbstractPayClient<AlipayPayClientConfig>
 | 
			
		||||
        model.setTotalAmount(calculateAmount(reqDTO.getAmount()).toString());
 | 
			
		||||
        model.setProductCode("QUICK_WAP_PAY"); // TODO 芋艿:这里咋整
 | 
			
		||||
        model.setSellerId("2088102147948060"); // TODO 芋艿:这里咋整
 | 
			
		||||
        // TODO 芋艿:clientIp + expireTime
 | 
			
		||||
        // TODO 芋艿:userIp + expireTime
 | 
			
		||||
        // 构建 AlipayTradeWapPayRequest
 | 
			
		||||
        AlipayTradeWapPayRequest request = new AlipayTradeWapPayRequest();
 | 
			
		||||
        request.setBizModel(model);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user