企业在线充值新增支付宝充值

master
jianghaiqing 12 months ago
parent c9c0962dba
commit eee6fca395

@ -100,6 +100,16 @@
<artifactId>commons-logging</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>3.14.2</version>
</dependency>
<dependency>
<groupId>com.alipay.sdk</groupId>
<artifactId>alipay-sdk-java</artifactId>
<version>4.38.61.ALL</version>
</dependency>
</dependencies>
<build>

@ -0,0 +1,154 @@
package com.payment.djypaymentplat.config;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
/**
* @Description TODO
* @Author JHQ
* @Date 2023/12/12 15:37
*/
@Component
@ConfigurationProperties(prefix = "alipay",ignoreUnknownFields = false)
public class AliPayConfig {
/** 支付宝网关 */
public String gatewayUrl;
/** 商家APPID */
public String appId;
/** 商户私钥 */
public String merchantPrivateKeyPath;
/** 字符编码格式 */
public String charset;
/** 签名方式 */
public String signType;
/** 服务器异步通知 */
public String noticeUrl;
/** 大简云回写地址 */
public String djyNoticeUrl;
/** 应用公钥证书路径 */
public String appCertPath;
/** 支付宝公钥证书路径 */
public String alipayCertPath;
/** 支付宝根证书路径 */
public String alipayRootCertPath;
/** 支付宝网关 */
public void setGatewayUrl(String gatewayUrl) {
this.gatewayUrl = gatewayUrl;
}
/** 商家APPID */
public void setAppId(String appId) {
this.appId = appId;
}
/** 商户私钥 */
public void setMerchantPrivateKeyPath(String merchantPrivateKeyPath) {
this.merchantPrivateKeyPath = merchantPrivateKeyPath;
}
/** 字符编码格式 */
public void setCharset(String charset) {
this.charset = charset;
}
/** 签名方式 */
public void setSignType(String signType) {
this.signType = signType;
}
/** 服务器异步通知 */
public void setNoticeUrl(String noticeUrl) {
this.noticeUrl = noticeUrl;
}
/** 大简云回写地址 */
public void setDjyNoticeUrl(String djyNoticeUrl) {
this.djyNoticeUrl = djyNoticeUrl;
}
/** 应用公钥证书路径 */
public void setAppCertPath(String appCertPath) {
this.appCertPath = appCertPath;
}
/** 支付宝公钥证书路径 */
public void setAlipayCertPath(String alipayCertPath) {
this.alipayCertPath = alipayCertPath;
}
/** 支付宝根证书路径 */
public void setAlipayRootCertPath(String alipayRootCertPath) {
this.alipayRootCertPath = alipayRootCertPath;
}
/** 支付宝网关 */
public String GatewayUrl() {
return gatewayUrl;
}
/** 商家APPID */
public String AppId() {
return appId;
}
/** 商户私钥 */
public String MerchantPrivateKeyPath() {
return merchantPrivateKeyPath;
}
/** 字符编码格式 */
public String CharSet() {
return charset;
}
/** 签名方式 */
public String SignType() {
return signType;
}
/** 服务器异步通知 */
public String NoticeUrl() {
return noticeUrl;
}
/** 大简云回写地址 */
public String DjyNoticeUrl() {
return djyNoticeUrl;
}
/** 应用公钥证书路径 */
public String AppCertPath() {
return appCertPath;
}
/** 支付宝公钥证书路径 */
public String AlipayCertPath() {
return alipayCertPath;
}
/** 支付宝根证书路径 */
public String AlipayRootCertPath() {
return alipayRootCertPath;
}
}

@ -30,6 +30,9 @@ public class WeixinPayConfig {
/** 通知接收地址 **/
public String noticeUrl;
/** 大简云回写地址 */
public String djyNoticeUrl;
/** 商户号 */
public void setMerchantId(String merchantId) {
this.merchantId = merchantId;
@ -63,6 +66,11 @@ public class WeixinPayConfig {
this.noticeUrl = noticeUrl;
}
/** 大简云回写地址 */
public void setDjyNoticeUrl(String djyNoticeUrl) {
this.djyNoticeUrl = djyNoticeUrl;
}
/** 商户号 */
public String MerchantId() {
return merchantId;
@ -93,4 +101,8 @@ public class WeixinPayConfig {
return noticeUrl;
}
/** 大简云回写地址 */
public String DjyNoticeUrl() {
return djyNoticeUrl;
}
}

@ -37,4 +37,12 @@ public class CompanyChargeOrderMessageMainInfo {
/** 充值企业名称 */
@ApiModelProperty("充值企业名称")
public String companyName;
/** 充值业务单号 */
@ApiModelProperty("充值业务单号")
public String businessId;
/** 支付接口 WEIXIN-微信支付ALIPAY-支付宝 */
@ApiModelProperty("支付接口代码")
public String payApiCode;
}

@ -17,4 +17,7 @@ public class CompanyChargeResult {
/** 生成200*200的二维码BASE64字符 */
public String imgBase64;
/** 阿里支付Form展示链接 */
public String alipayFormAction;
}

@ -1,9 +1,7 @@
package com.payment.djypaymentplat.mapper;
import com.payment.djypaymentplat.model.PayOrderInfo;
import org.springframework.stereotype.Repository;
@Repository
public interface PayOrderInfoMapper {
int deleteByPrimaryKey(String pkId);

@ -1,9 +1,7 @@
package com.payment.djypaymentplat.mapper;
import com.payment.djypaymentplat.model.PayOrderQrcode;
import org.springframework.stereotype.Repository;
@Repository
public interface PayOrderQrcodeMapper {
int deleteByPrimaryKey(String pkId);

@ -131,6 +131,20 @@ public class PayOrderInfo implements Serializable {
*/
private String completeType;
/**
*
*
* @mbg.generated
*/
private String senderKey;
/**
* ID
*
* @mbg.generated
*/
private String senderPkid;
/**
*
*
@ -340,6 +354,22 @@ public class PayOrderInfo implements Serializable {
this.completeType = completeType;
}
public String getSenderKey() {
return senderKey;
}
public void setSenderKey(String senderKey) {
this.senderKey = senderKey;
}
public String getSenderPkid() {
return senderPkid;
}
public void setSenderPkid(String senderPkid) {
this.senderPkid = senderPkid;
}
public Date getCreatedtime() {
return createdtime;
}
@ -436,6 +466,8 @@ public class PayOrderInfo implements Serializable {
sb.append(", beforeChargeAmount=").append(beforeChargeAmount);
sb.append(", isComplete=").append(isComplete);
sb.append(", completeType=").append(completeType);
sb.append(", senderKey=").append(senderKey);
sb.append(", senderPkid=").append(senderPkid);
sb.append(", createdtime=").append(createdtime);
sb.append(", updatedtime=").append(updatedtime);
sb.append(", createduserid=").append(createduserid);

@ -17,6 +17,13 @@ public class PayOrderQrcode implements Serializable {
*/
private String qrcodeImg;
/**
* FROM
*
* @mbg.generated
*/
private String formActionUrl;
private static final long serialVersionUID = 1L;
public String getPkId() {
@ -35,6 +42,14 @@ public class PayOrderQrcode implements Serializable {
this.qrcodeImg = qrcodeImg;
}
public String getFormActionUrl() {
return formActionUrl;
}
public void setFormActionUrl(String formActionUrl) {
this.formActionUrl = formActionUrl;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
@ -43,6 +58,7 @@ public class PayOrderQrcode implements Serializable {
sb.append("Hash = ").append(hashCode());
sb.append(", pkId=").append(pkId);
sb.append(", qrcodeImg=").append(qrcodeImg);
sb.append(", formActionUrl=").append(formActionUrl);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");
return sb.toString();

@ -55,4 +55,7 @@ public interface ICompanyChargeService {
* @date 2023/12/7 15:02
**/
public OutResultInfo PushPaymentNotice(HttpServletRequest request, HttpServletResponse response);
public void TestSendDJY();
}

@ -1,10 +1,17 @@
package com.payment.djypaymentplat.service.impl;
import com.alipay.api.*;
import com.alipay.api.domain.AlipayTradeAppPayModel;
import com.alipay.api.domain.AlipayTradePagePayModel;
import com.alipay.api.internal.util.AlipaySignature;
import com.alipay.api.request.AlipayTradePagePayRequest;
import com.alipay.api.response.AlipayTradePagePayResponse;
import com.google.gson.Gson;
import com.google.zxing.BarcodeFormat;
import com.google.zxing.WriterException;
import com.google.zxing.common.BitMatrix;
import com.google.zxing.qrcode.QRCodeWriter;
import com.payment.djypaymentplat.config.AliPayConfig;
import com.payment.djypaymentplat.config.WeixinPayConfig;
import com.payment.djypaymentplat.domain.*;
import com.payment.djypaymentplat.mapper.PayOrderInfoMapper;
@ -12,12 +19,14 @@ import com.payment.djypaymentplat.mapper.PayOrderQrcodeMapper;
import com.payment.djypaymentplat.model.PayOrderInfo;
import com.payment.djypaymentplat.model.PayOrderQrcode;
import com.payment.djypaymentplat.service.ICompanyChargeService;
import com.payment.djypaymentplat.util.AliPayUtil;
import com.payment.djypaymentplat.util.HttpUtils;
import com.payment.djypaymentplat.util.WechatPay2ValidatorForRequest;
import com.payment.djypaymentplat.util.WeixinPayUtil;
import com.wechat.pay.contrib.apache.httpclient.util.AesUtil;
import com.wechat.pay.java.service.payments.model.Transaction;
import com.wechat.pay.java.service.payments.nativepay.model.*;
import okhttp3.*;
import org.apache.catalina.servlet4preview.http.HttpServletRequest;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -30,6 +39,8 @@ import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.math.BigDecimal;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.security.GeneralSecurityException;
import java.text.ParseException;
import java.text.SimpleDateFormat;
@ -69,6 +80,11 @@ public class CompanyChargeServiceImpl implements ICompanyChargeService {
@Autowired
private WeixinPayUtil weixinPayUtil;
@Autowired
private AliPayUtil aliPayUtil;
@Autowired
private AliPayConfig aliPayConfig;
@PostMapping("/createorder")
@Override
@ -82,13 +98,24 @@ public class CompanyChargeServiceImpl implements ICompanyChargeService {
orderInfo.setPkId(UUID.randomUUID().toString().replace("-", ""));
orderInfo.setAmount(model.main.amount);
orderInfo.setAppId(wexinConfig.Appid());
orderInfo.setMchId(wexinConfig.MerchantId());
if(model.main.payApiCode.equals("WEIXIN"))
{
orderInfo.setAppId(wexinConfig.Appid());
orderInfo.setMchId(wexinConfig.MerchantId());
}
else if(model.main.payApiCode.equals("ALIPAY"))
{
orderInfo.setAppId(aliPayConfig.AppId());
}
orderInfo.setDescription(model.main.notes);
orderInfo.setCurrency(model.main.currency);
orderInfo.setCreateduserid(model.main.operatorId);
orderInfo.setCreatedusername(model.main.operatorName);
orderInfo.setStatus("WAIT");
orderInfo.setSenderKey(model.head.senderKey);
orderInfo.setSenderPkid(model.main.businessId);
Date nowDate = new Date();
try {
@ -102,71 +129,108 @@ public class CompanyChargeServiceImpl implements ICompanyChargeService {
payOrderInfoMapper.insert(orderInfo);
PayOrderInfo payOrder = payOrderInfoMapper.selectByPrimaryKey(orderInfo.getPkId());
/*
10.1
2
3
*/
// 初始化商户配置
/*
Config config =
new RSAAutoCertificateConfig.Builder()
.merchantId(wexinConfig.MerchantId())
// 使用 com.wechat.pay.java.core.util 中的函数从本地文件中加载商户私钥,商户私钥会用来生成请求的签名
.privateKeyFromPath(wexinConfig.PrivateKeyPath())
.merchantSerialNumber(wexinConfig.MerchantSerialNumber())
.apiV3Key(wexinConfig.ApiV3Key())
.build();
String getCodeUrl = "";
String alipayFormAct = "";
if(model.main.payApiCode.equals("WEIXIN")) {
PrepayRequest request = new PrepayRequest();
request.setAppid(wexinConfig.Appid());
request.setMchid(wexinConfig.MerchantId());
request.setDescription(model.main.notes);
request.setOutTradeNo(payOrder.getOrderNo());
request.setNotifyUrl(wexinConfig.NoticeUrl());
Amount amount = new Amount();
amount.setTotal(model.main.amount.multiply(new BigDecimal(100)).intValue());
amount.setCurrency(model.main.currency);
request.setAmount(amount);
// 调用request.setXxx(val)设置所需参数具体参数可见Request定义
// 调用接口
PrepayResponse preRlt = weixinPayUtil.getNativePayService().prepay(request);
service = new NativePayService.Builder().config(config).build();
*/
log.info("支付返回={}", gson.toJson(preRlt));
if (preRlt != null && preRlt.getCodeUrl() != "") {
getCodeUrl = preRlt.getCodeUrl();
}
}else if(model.main.payApiCode.equals("ALIPAY")){
AlipayTradePagePayRequest alipayRequest = new AlipayTradePagePayRequest();
AlipayTradePagePayModel aliPayModel = new AlipayTradePagePayModel();
//aliPayModel.setBody("我是测试数据");
aliPayModel.setSubject(model.main.notes);
aliPayModel.setOutTradeNo(payOrder.getOrderNo());
aliPayModel.setTimeoutExpress("60m");
aliPayModel.setTotalAmount(model.main.amount.setScale(2, BigDecimal.ROUND_HALF_DOWN).toString());
PrepayRequest request = new PrepayRequest();
aliPayModel.setProductCode("FAST_INSTANT_TRADE_PAY");
aliPayModel.setQrPayMode("4");
request.setAppid(wexinConfig.Appid());
request.setMchid(wexinConfig.MerchantId());
request.setDescription(model.main.notes);
request.setOutTradeNo(payOrder.getOrderNo());
request.setNotifyUrl(wexinConfig.NoticeUrl());
alipayRequest.setBizModel(aliPayModel);
alipayRequest.setNotifyUrl(aliPayConfig.DjyNoticeUrl());
Amount amount = new Amount();
CertAlipayRequest certAlipayRequest = new CertAlipayRequest ();
amount.setTotal(model.main.amount.multiply(new BigDecimal(100)).intValue());
amount.setCurrency(model.main.currency);
request.setAmount(amount);
try
{
AlipayClient alipayClient = aliPayUtil.getAlipayClient();
AlipayTradePagePayResponse aliPayResult = alipayClient.pageExecute(alipayRequest,"GET");
// 调用request.setXxx(val)设置所需参数具体参数可见Request定义
// 调用接口
PrepayResponse preRlt = weixinPayUtil.getNativePayService().prepay(request);
log.info("请求支付宝下单后返回结果body={}",aliPayResult.getBody());
if(aliPayResult.isSuccess())
{
alipayFormAct = aliPayResult.getBody();
}
}
catch (AlipayApiException e)
{
e.printStackTrace();
}
}
CompanyChargeResult chargeRlt = new CompanyChargeResult();
chargeRlt.excuteDate = sdf.format(nowDate);
chargeRlt.orderNo = payOrder.getOrderNo();
log.info("支付返回={}", gson.toJson(preRlt));
if(!StringUtils.isEmpty(getCodeUrl) || !StringUtils.isEmpty(alipayFormAct)){
if(preRlt != null && preRlt.getCodeUrl() != ""){
if(!StringUtils.isEmpty(getCodeUrl)){
chargeRlt.qRCodeUrl = getCodeUrl;
chargeRlt.imgBase64 = GetQRCodeFile(getCodeUrl).getData();
payOrder.setCallbackUrl(getCodeUrl);
try {
payOrder.setUpdatedtime(sdf.parse(sdf.format(new Date())));
}catch (ParseException e)
{
e.printStackTrace();
}
}
chargeRlt.qRCodeUrl = preRlt.getCodeUrl();
chargeRlt.imgBase64 = GetQRCodeFile(preRlt.getCodeUrl()).getData();
payOrder.setCallbackUrl(preRlt.getCodeUrl());
if(!StringUtils.isEmpty(alipayFormAct)){
chargeRlt.alipayFormAction = alipayFormAct;
try {
payOrder.setUpdatedtime(sdf.parse(sdf.format(new Date())));
}catch (ParseException e)
{
e.printStackTrace();
}
payOrderInfoMapper.updateByPrimaryKey(payOrder);
PayOrderQrcode qrcode = new PayOrderQrcode();
qrcode.setPkId(payOrder.getPkId());
qrcode.setQrcodeImg(chargeRlt.imgBase64);
if(!StringUtils.isEmpty(getCodeUrl)) {
qrcode.setQrcodeImg(chargeRlt.imgBase64);
}
if(!StringUtils.isEmpty(alipayFormAct)) {
qrcode.setFormActionUrl(alipayFormAct);
}
payOrderQrcodeMapper.insert(qrcode);
@ -395,12 +459,30 @@ public class CompanyChargeServiceImpl implements ICompanyChargeService {
//解密报文
String plainText = decryptFromResource(bodyMap);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
log.info("解密报文 bodyMap={}",plainText);
//将明文转换成map
//Gson gson = new Gson();
HashMap plainTextMap = gson.fromJson(plainText, HashMap.class);
String orderNo = (String) plainTextMap.get("out_trade_no");
//更新本地记录
PayOrderInfo chargeOrder = payOrderInfoMapper.selectByOrderNo(orderNo);
if(chargeOrder != null)
{
//PAY_SUCC-支付成功
chargeOrder.setStatus("PAY_SUCC");
chargeOrder.setIsComplete(true);
chargeOrder.setCompleteType("WEIXIN_NOTICE");
chargeOrder.setUpdatedtime(new Date());
payOrderInfoMapper.updateByPrimaryKey(chargeOrder);
}
//触发大简云回写
SendNoticeToDaJanYun(chargeOrder.getSenderPkid(),chargeOrder.getAmount());
/*
@ -434,6 +516,48 @@ public class CompanyChargeServiceImpl implements ICompanyChargeService {
}*/
}
private void SendNoticeToDaJanYun(String senderPkId,BigDecimal amount){
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
Gson gson = new Gson();
log.info("充值成功回写大简云 act={} uid={} amount={}","charge",senderPkId,amount.setScale(2, BigDecimal.ROUND_HALF_DOWN).toString());
MultipartBody formBody = new MultipartBody.Builder()
.setType(MultipartBody.FORM)
.addFormDataPart("act", "charge")
.addFormDataPart("uid", senderPkId)
.addFormDataPart("amount", amount.setScale(2, BigDecimal.ROUND_HALF_DOWN).toString())
.build();
//MediaType mediaType = MediaType.parse("application/json");
//RequestBody body = RequestBody.create(mediaType, json);
Request request = new Request.Builder()
.url(wexinConfig.DjyNoticeUrl())
.method("POST", formBody)
.addHeader("Content-Type", "application/json")
.build();
try {
Response response = client.newCall(request).execute();
if(response.isSuccessful())
{
String msg = response.body().string();
log.info("发送大简云完成,返回结果={}",msg);
R<String> djyRlt = gson.fromJson(msg,R.class);
if(djyRlt.getCode() == Constants.SUCCESS){
log.info("充值成功发送大简云回写成功,消息={}",djyRlt.getMsg());
}else {
log.info("充值成功发送大简云回写失败,消息={}",djyRlt.getMsg());
}
}
} catch (IOException e) {
e.printStackTrace();
}
}
private String decryptFromResource(Map<String, Object> bodyMap) throws GeneralSecurityException {
log.info("密文解密");
@ -456,6 +580,13 @@ public class CompanyChargeServiceImpl implements ICompanyChargeService {
return plainText;
}
public void TestSendDJY()
{
//更新本地记录
PayOrderInfo chargeOrder = payOrderInfoMapper.selectByOrderNo("PWX202312080002");
SendNoticeToDaJanYun(chargeOrder.getSenderPkid(),chargeOrder.getAmount());
}
/*
public OutResultInfo PushPaymentNotice(HttpServletRequest request, HttpServletResponse response) throws Exception {

@ -0,0 +1,79 @@
package com.payment.djypaymentplat.util;
import com.alipay.api.*;
import com.payment.djypaymentplat.config.AliPayConfig;
import com.payment.djypaymentplat.config.WeixinPayConfig;
import com.wechat.pay.java.core.Config;
import com.wechat.pay.java.core.RSAAutoCertificateConfig;
import com.wechat.pay.java.service.payments.nativepay.NativePayService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Paths;
/**
* @Description TODO
* @Author JHQ
* @Date 2023/12/12 16:44
*/
@Configuration
public class AliPayUtil {
@Autowired
private AliPayConfig aliPayConfig;
@Autowired
private AlipayClient alipayClient;
/** 获取Native支付服务 **/
@Bean
public AlipayClient getAlipayClient(){
if(alipayClient != null)
return alipayClient;
CertAlipayRequest certAlipayRequest = new CertAlipayRequest();
certAlipayRequest.setServerUrl(aliPayConfig.GatewayUrl()); //设置网关地址
certAlipayRequest.setAppId(aliPayConfig.AppId()); //设置应用Id
certAlipayRequest.setFormat("json"); //设置请求格式固定值json
certAlipayRequest.setCharset(aliPayConfig.CharSet()); //设置字符集
certAlipayRequest.setSignType(aliPayConfig.SignType()); //设置签名类型
//设置应用公钥证书路径
certAlipayRequest.setCertPath(aliPayConfig.AppCertPath());
//设置支付宝公钥证书路径
certAlipayRequest.setAlipayPublicCertPath(aliPayConfig.AlipayCertPath());
//设置支付宝根证书路径
certAlipayRequest.setRootCertPath(aliPayConfig.AlipayRootCertPath());
try {
String privateKey = new String(Files.readAllBytes(Paths.get(aliPayConfig.MerchantPrivateKeyPath())));
certAlipayRequest.setPrivateKey(privateKey); //应用私钥-自己创建
}
catch (Exception e)
{
e.printStackTrace();
}
try {
alipayClient = new DefaultAlipayClient(certAlipayRequest);
}catch (AlipayApiException e) {
e.printStackTrace();
}
/*
alipayClient = new DefaultAlipayClient(aliPayConfig.GatewayUrl(),
aliPayConfig.AppId(),
aliPayConfig.MerchantPrivateKey(), "json",
aliPayConfig.CharSet(),
aliPayConfig.AlipayPublicKey(),
aliPayConfig.SignType());
*/
return alipayClient;
}
}

@ -23,3 +23,15 @@ weixinpay:
apiV3Key: DongShengCharge20231204145800V01
appId: wx029d5994ace18575
noticeUrl: https://wechat.myshipping.net:8860/payment/onlinecharge/pushnotice
djyNoticeUrl: http://60.209.125.238:30801/Interface/CompChargeCallBack.ashx
alipay:
gatewayUrl: https://openapi.alipay.com/gateway.do
appId: 2021002159639156
merchantPrivateKeyPath: D:/DjyPaymentPlat/alipaykey/alipay_pv_key.txt
charset: utf-8
appCertPath: D:/DjyPaymentPlat/alipaykey/appCertPublicKey_2021002159639156.crt
alipayCertPath: D:/DjyPaymentPlat/alipaykey/alipayCertPublicKey_RSA2.crt
alipayRootCertPath: D:/DjyPaymentPlat/alipaykey/alipayRootCert.crt
signType: RSA2
noticeUrl: https://wechat.myshipping.net:8860/payment/onlinecharge/pushalinotice
djyNoticeUrl: http://60.209.125.238:30801/Interface/CompChargeCallBack.ashx

@ -20,6 +20,8 @@
<result column="BEFORE_CHARGE_AMOUNT" jdbcType="DECIMAL" property="beforeChargeAmount" />
<result column="IS_COMPLETE" jdbcType="BIT" property="isComplete" />
<result column="COMPLETE_TYPE" jdbcType="VARCHAR" property="completeType" />
<result column="SENDER_KEY" jdbcType="VARCHAR" property="senderKey" />
<result column="SENDER_PKID" jdbcType="VARCHAR" property="senderPkid" />
<result column="CreatedTime" jdbcType="TIMESTAMP" property="createdtime" />
<result column="UpdatedTime" jdbcType="TIMESTAMP" property="updatedtime" />
<result column="CreatedUserId" jdbcType="VARCHAR" property="createduserid" />
@ -33,8 +35,8 @@
<sql id="Base_Column_List">
PK_ID, ORDER_NO, APP_ID, MCH_ID, DESCRIPTION, TIME_EXPIRE, ATTACH_DATA, AMOUNT, CURRENCY,
PAYER_OPEN_ID, PAYER_CLIENT_IP, PAY_API_CODE, CALLBACK_URL, STATUS, CODE_URL, BEFORE_CHARGE_AMOUNT,
IS_COMPLETE, COMPLETE_TYPE, CreatedTime, UpdatedTime, CreatedUserId, CreatedUserName,
UpdatedUserId, UpdatedUserName, IsDeleted, TenantId, TenantName
IS_COMPLETE, COMPLETE_TYPE, SENDER_KEY, SENDER_PKID, CreatedTime, UpdatedTime, CreatedUserId,
CreatedUserName, UpdatedUserId, UpdatedUserName, IsDeleted, TenantId, TenantName
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
select
@ -42,16 +44,16 @@
from pay_order_info
where PK_ID = #{pkId,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete from pay_order_info
where PK_ID = #{pkId,jdbcType=VARCHAR}
</delete>
<select id="selectByOrderNo" parameterType="java.lang.String" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from pay_order_info
where ORDER_NO = #{orderNo,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete from pay_order_info
where PK_ID = #{pkId,jdbcType=VARCHAR} and IsDeleted = 0
</delete>
<insert id="insert" parameterType="com.payment.djypaymentplat.model.PayOrderInfo">
insert into pay_order_info (PK_ID, ORDER_NO, APP_ID,
MCH_ID, DESCRIPTION, TIME_EXPIRE,
@ -59,20 +61,20 @@
PAYER_OPEN_ID, PAYER_CLIENT_IP, PAY_API_CODE,
CALLBACK_URL, STATUS, CODE_URL,
BEFORE_CHARGE_AMOUNT, IS_COMPLETE, COMPLETE_TYPE,
CreatedTime, UpdatedTime, CreatedUserId,
CreatedUserName, UpdatedUserId, UpdatedUserName,
IsDeleted, TenantId, TenantName
)
SENDER_KEY, SENDER_PKID, CreatedTime,
UpdatedTime, CreatedUserId, CreatedUserName,
UpdatedUserId, UpdatedUserName, IsDeleted,
TenantId, TenantName)
values (#{pkId,jdbcType=VARCHAR}, #{orderNo,jdbcType=VARCHAR}, #{appId,jdbcType=VARCHAR},
#{mchId,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR}, #{timeExpire,jdbcType=TIMESTAMP},
#{attachData,jdbcType=VARCHAR}, #{amount,jdbcType=DECIMAL}, #{currency,jdbcType=VARCHAR},
#{payerOpenId,jdbcType=VARCHAR}, #{payerClientIp,jdbcType=VARCHAR}, #{payApiCode,jdbcType=VARCHAR},
#{callbackUrl,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, #{codeUrl,jdbcType=VARCHAR},
#{beforeChargeAmount,jdbcType=DECIMAL}, #{isComplete,jdbcType=BIT}, #{completeType,jdbcType=VARCHAR},
#{createdtime,jdbcType=TIMESTAMP}, #{updatedtime,jdbcType=TIMESTAMP}, #{createduserid,jdbcType=VARCHAR},
#{createdusername,jdbcType=VARCHAR}, #{updateduserid,jdbcType=VARCHAR}, #{updatedusername,jdbcType=VARCHAR},
#{isdeleted,jdbcType=BIT}, #{tenantid,jdbcType=VARCHAR}, #{tenantname,jdbcType=VARCHAR}
)
#{senderKey,jdbcType=VARCHAR}, #{senderPkid,jdbcType=VARCHAR}, #{createdtime,jdbcType=TIMESTAMP},
#{updatedtime,jdbcType=TIMESTAMP}, #{createduserid,jdbcType=VARCHAR}, #{createdusername,jdbcType=VARCHAR},
#{updateduserid,jdbcType=VARCHAR}, #{updatedusername,jdbcType=VARCHAR}, #{isdeleted,jdbcType=BIT},
#{tenantid,jdbcType=VARCHAR}, #{tenantname,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.payment.djypaymentplat.model.PayOrderInfo">
insert into pay_order_info
@ -131,6 +133,12 @@
<if test="completeType != null">
COMPLETE_TYPE,
</if>
<if test="senderKey != null">
SENDER_KEY,
</if>
<if test="senderPkid != null">
SENDER_PKID,
</if>
<if test="createdtime != null">
CreatedTime,
</if>
@ -214,6 +222,12 @@
<if test="completeType != null">
#{completeType,jdbcType=VARCHAR},
</if>
<if test="senderKey != null">
#{senderKey,jdbcType=VARCHAR},
</if>
<if test="senderPkid != null">
#{senderPkid,jdbcType=VARCHAR},
</if>
<if test="createdtime != null">
#{createdtime,jdbcType=TIMESTAMP},
</if>
@ -297,6 +311,12 @@
<if test="completeType != null">
COMPLETE_TYPE = #{completeType,jdbcType=VARCHAR},
</if>
<if test="senderKey != null">
SENDER_KEY = #{senderKey,jdbcType=VARCHAR},
</if>
<if test="senderPkid != null">
SENDER_PKID = #{senderPkid,jdbcType=VARCHAR},
</if>
<if test="createdtime != null">
CreatedTime = #{createdtime,jdbcType=TIMESTAMP},
</if>
@ -346,6 +366,8 @@
BEFORE_CHARGE_AMOUNT = #{beforeChargeAmount,jdbcType=DECIMAL},
IS_COMPLETE = #{isComplete,jdbcType=BIT},
COMPLETE_TYPE = #{completeType,jdbcType=VARCHAR},
SENDER_KEY = #{senderKey,jdbcType=VARCHAR},
SENDER_PKID = #{senderPkid,jdbcType=VARCHAR},
CreatedTime = #{createdtime,jdbcType=TIMESTAMP},
UpdatedTime = #{updatedtime,jdbcType=TIMESTAMP},
CreatedUserId = #{createduserid,jdbcType=VARCHAR},

@ -6,12 +6,13 @@
</resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.payment.djypaymentplat.model.PayOrderQrcode">
<result column="QRCODE_IMG" jdbcType="LONGVARCHAR" property="qrcodeImg" />
<result column="FORM_ACTION_URL" jdbcType="LONGVARCHAR" property="formActionUrl" />
</resultMap>
<sql id="Base_Column_List">
PK_ID
</sql>
<sql id="Blob_Column_List">
QRCODE_IMG
QRCODE_IMG, FORM_ACTION_URL
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="ResultMapWithBLOBs">
select
@ -26,8 +27,10 @@
where PK_ID = #{pkId,jdbcType=VARCHAR}
</delete>
<insert id="insert" parameterType="com.payment.djypaymentplat.model.PayOrderQrcode">
insert into pay_order_qrcode (PK_ID, QRCODE_IMG)
values (#{pkId,jdbcType=VARCHAR}, #{qrcodeImg,jdbcType=LONGVARCHAR})
insert into pay_order_qrcode (PK_ID, QRCODE_IMG, FORM_ACTION_URL
)
values (#{pkId,jdbcType=VARCHAR}, #{qrcodeImg,jdbcType=LONGVARCHAR}, #{formActionUrl,jdbcType=LONGVARCHAR}
)
</insert>
<insert id="insertSelective" parameterType="com.payment.djypaymentplat.model.PayOrderQrcode">
insert into pay_order_qrcode
@ -38,6 +41,9 @@
<if test="qrcodeImg != null">
QRCODE_IMG,
</if>
<if test="formActionUrl != null">
FORM_ACTION_URL,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="pkId != null">
@ -46,6 +52,9 @@
<if test="qrcodeImg != null">
#{qrcodeImg,jdbcType=LONGVARCHAR},
</if>
<if test="formActionUrl != null">
#{formActionUrl,jdbcType=LONGVARCHAR},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.payment.djypaymentplat.model.PayOrderQrcode">
@ -54,12 +63,16 @@
<if test="qrcodeImg != null">
QRCODE_IMG = #{qrcodeImg,jdbcType=LONGVARCHAR},
</if>
<if test="formActionUrl != null">
FORM_ACTION_URL = #{formActionUrl,jdbcType=LONGVARCHAR},
</if>
</set>
where PK_ID = #{pkId,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKeyWithBLOBs" parameterType="com.payment.djypaymentplat.model.PayOrderQrcode">
update pay_order_qrcode
set QRCODE_IMG = #{qrcodeImg,jdbcType=LONGVARCHAR}
set QRCODE_IMG = #{qrcodeImg,jdbcType=LONGVARCHAR},
FORM_ACTION_URL = #{formActionUrl,jdbcType=LONGVARCHAR}
where PK_ID = #{pkId,jdbcType=VARCHAR}
</update>
</mapper>
Loading…
Cancel
Save