Commit deee24e5 authored by jmdhappy's avatar jmdhappy
Browse files

提交转账,退款接口;重构商户通知;修复已知Bug

parent d5333a0d
......@@ -21,10 +21,10 @@ public class PayConstant {
public final static String PAY_CHANNEL_ALIPAY_MOBILE = "ALIPAY_MOBILE"; // 支付宝移动支付
public final static String PAY_CHANNEL_ALIPAY_PC = "ALIPAY_PC"; // 支付宝PC支付
public final static String PAY_CHANNEL_ALIPAY_WAP = "ALIPAY_WAP"; // 支付宝WAP支付
public final static String PAY_CHANNEL_ALIPAY_QR = "ALIPAY_QR"; // 支付宝当面付之扫码支付
public final static String PAY_CHANNEL_ALIPAY_QR = "ALIPAY_QR"; // 支付宝当面付之扫码支付
public final static String TRANS_CHANNEL_WX_APP = "TRANS_WX_APP"; // 微信APP转账
public final static String TRANS_CHANNEL_WX_JSAPI = "TRANS_WX_JSAPI"; // 微信公众号转账
public final static String CHANNEL_NAME_WX = "WX"; // 渠道名称:微信
public final static String CHANNEL_NAME_ALIPAY = "ALIPAY"; // 渠道名称:支付宝
......@@ -41,6 +41,30 @@ public class PayConstant {
public final static byte TRANS_STATUS_FAIL = 3; // 失败
public final static byte TRANS_STATUS_COMPLETE = 4; // 业务完成
public final static byte TRANS_RESULT_INIT = 0; // 不确认结果
public final static byte TRANS_RESULT_REFUNDING = 1; // 等待手动处理
public final static byte TRANS_RESULT_SUCCESS = 2; // 确认成功
public final static byte TRANS_RESULT_FAIL = 3; // 确认失败
public final static byte REFUND_STATUS_INIT = 0; // 初始态
public final static byte REFUND_STATUS_REFUNDING = 1; // 转账中
public final static byte REFUND_STATUS_SUCCESS = 2; // 成功
public final static byte REFUND_STATUS_FAIL = 3; // 失败
public final static byte REFUND_STATUS_COMPLETE = 4; // 业务完成
public final static byte REFUND_RESULT_INIT = 0; // 不确认结果
public final static byte REFUND_RESULT_REFUNDING = 1; // 等待手动处理
public final static byte REFUND_RESULT_SUCCESS = 2; // 确认成功
public final static byte REFUND_RESULT_FAIL = 3; // 确认失败
public final static String MCH_NOTIFY_TYPE_PAY = "1"; // 商户通知类型:支付订单
public final static String MCH_NOTIFY_TYPE_TRANS = "2"; // 商户通知类型:转账订单
public final static String MCH_NOTIFY_TYPE_REFUND = "3"; // 商户通知类型:退款订单
public final static byte MCH_NOTIFY_STATUS_NOTIFYING = 1; // 通知中
public final static byte MCH_NOTIFY_STATUS_SUCCESS = 2; // 通知成功
public final static byte MCH_NOTIFY_STATUS_FAIL = 3; // 通知失败
public final static String RESP_UTF8 = "UTF-8"; // 通知业务系统使用的编码
......
......@@ -16,6 +16,8 @@ public class MySeq {
private static String pay_seq_prefix = "P";
private static AtomicLong trans_seq = new AtomicLong(0L);
private static String trans_seq_prefix = "T";
private static AtomicLong refund_seq = new AtomicLong(0L);
private static String refund_seq_prefix = "R";
private static String node = "00";
static {
......@@ -37,6 +39,9 @@ public class MySeq {
return getSeq(trans_seq_prefix, trans_seq);
}
public static String getRefund() {
return getSeq(refund_seq_prefix, refund_seq);
}
private static String getSeq(String prefix, AtomicLong seq) {
prefix += node;
......@@ -47,6 +52,7 @@ public class MySeq {
for (int i = 0; i < 100; i++) {
System.out.println("pay=" + getPay());
System.out.println("trans=" + getTrans());
System.out.println("refund=" + getRefund());
}
}
......
......@@ -114,4 +114,11 @@ public class RpcUtil {
return null;
}
public static Boolean isSuccess(Map<String, Object> result) {
if(result == null) return false;
String retCode = (String) result.get("rpcRetCode");
if("0000".equals(retCode) && result.get("bizResult") != null) return true;
return false;
}
}
package org.xxpay.common.util;
/**
* @author: dingzhiwei
* @date: 17/11/1
* @description:
*/
public class StrUtil {
public static String toString(Object obj) {
return obj == null?"":obj.toString();
}
public static String toString(Object obj, String nullStr) {
return obj == null?nullStr:obj.toString();
}
}
package org.xxpay.dal.dao.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.xxpay.dal.dao.model.MchNotify;
import org.xxpay.dal.dao.model.MchNotifyExample;
public interface MchNotifyMapper {
int countByExample(MchNotifyExample example);
int deleteByExample(MchNotifyExample example);
int deleteByPrimaryKey(String orderId);
int insert(MchNotify record);
int insertSelective(MchNotify record);
List<MchNotify> selectByExample(MchNotifyExample example);
MchNotify selectByPrimaryKey(String orderId);
int updateByExampleSelective(@Param("record") MchNotify record, @Param("example") MchNotifyExample example);
int updateByExample(@Param("record") MchNotify record, @Param("example") MchNotifyExample example);
int updateByPrimaryKeySelective(MchNotify record);
int updateByPrimaryKey(MchNotify record);
int insertSelectiveOnDuplicateKeyUpdate(MchNotify record);
}
\ No newline at end of file
package org.xxpay.dal.dao.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.xxpay.dal.dao.model.RefundOrder;
import org.xxpay.dal.dao.model.RefundOrderExample;
public interface RefundOrderMapper {
int countByExample(RefundOrderExample example);
int deleteByExample(RefundOrderExample example);
int deleteByPrimaryKey(String refundOrderId);
int insert(RefundOrder record);
int insertSelective(RefundOrder record);
List<RefundOrder> selectByExample(RefundOrderExample example);
RefundOrder selectByPrimaryKey(String refundOrderId);
int updateByExampleSelective(@Param("record") RefundOrder record, @Param("example") RefundOrderExample example);
int updateByExample(@Param("record") RefundOrder record, @Param("example") RefundOrderExample example);
int updateByPrimaryKeySelective(RefundOrder record);
int updateByPrimaryKey(RefundOrder record);
}
\ No newline at end of file
package org.xxpay.dal.dao.model;
import java.io.Serializable;
import java.util.Date;
public class MchNotify implements Serializable {
/**
* 订单ID
*
* @mbggenerated
*/
private String orderId;
/**
* 商户ID
*
* @mbggenerated
*/
private String mchId;
/**
* 商户订单号
*
* @mbggenerated
*/
private String mchOrderNo;
/**
* 订单类型:1-支付,2-转账,3-退款
*
* @mbggenerated
*/
private String orderType;
/**
* 通知地址
*
* @mbggenerated
*/
private String notifyUrl;
/**
* 通知次数
*
* @mbggenerated
*/
private Byte notifyCount;
/**
* 通知响应结果
*
* @mbggenerated
*/
private String result;
/**
* 通知状态,1-通知中,2-通知成功,3-通知失败
*
* @mbggenerated
*/
private Byte status;
/**
* 最后一次通知时间
*
* @mbggenerated
*/
private Date lastNotifyTime;
/**
* 创建时间
*
* @mbggenerated
*/
private Date createTime;
/**
* 更新时间
*
* @mbggenerated
*/
private Date updateTime;
private static final long serialVersionUID = 1L;
public String getOrderId() {
return orderId;
}
public void setOrderId(String orderId) {
this.orderId = orderId;
}
public String getMchId() {
return mchId;
}
public void setMchId(String mchId) {
this.mchId = mchId;
}
public String getMchOrderNo() {
return mchOrderNo;
}
public void setMchOrderNo(String mchOrderNo) {
this.mchOrderNo = mchOrderNo;
}
public String getOrderType() {
return orderType;
}
public void setOrderType(String orderType) {
this.orderType = orderType;
}
public String getNotifyUrl() {
return notifyUrl;
}
public void setNotifyUrl(String notifyUrl) {
this.notifyUrl = notifyUrl;
}
public Byte getNotifyCount() {
return notifyCount;
}
public void setNotifyCount(Byte notifyCount) {
this.notifyCount = notifyCount;
}
public String getResult() {
return result;
}
public void setResult(String result) {
this.result = result;
}
public Byte getStatus() {
return status;
}
public void setStatus(Byte status) {
this.status = status;
}
public Date getLastNotifyTime() {
return lastNotifyTime;
}
public void setLastNotifyTime(Date lastNotifyTime) {
this.lastNotifyTime = lastNotifyTime;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", orderId=").append(orderId);
sb.append(", mchId=").append(mchId);
sb.append(", mchOrderNo=").append(mchOrderNo);
sb.append(", orderType=").append(orderType);
sb.append(", notifyUrl=").append(notifyUrl);
sb.append(", notifyCount=").append(notifyCount);
sb.append(", result=").append(result);
sb.append(", status=").append(status);
sb.append(", lastNotifyTime=").append(lastNotifyTime);
sb.append(", createTime=").append(createTime);
sb.append(", updateTime=").append(updateTime);
sb.append("]");
return sb.toString();
}
@Override
public boolean equals(Object that) {
if (this == that) {
return true;
}
if (that == null) {
return false;
}
if (getClass() != that.getClass()) {
return false;
}
MchNotify other = (MchNotify) that;
return (this.getOrderId() == null ? other.getOrderId() == null : this.getOrderId().equals(other.getOrderId()))
&& (this.getMchId() == null ? other.getMchId() == null : this.getMchId().equals(other.getMchId()))
&& (this.getMchOrderNo() == null ? other.getMchOrderNo() == null : this.getMchOrderNo().equals(other.getMchOrderNo()))
&& (this.getOrderType() == null ? other.getOrderType() == null : this.getOrderType().equals(other.getOrderType()))
&& (this.getNotifyUrl() == null ? other.getNotifyUrl() == null : this.getNotifyUrl().equals(other.getNotifyUrl()))
&& (this.getNotifyCount() == null ? other.getNotifyCount() == null : this.getNotifyCount().equals(other.getNotifyCount()))
&& (this.getResult() == null ? other.getResult() == null : this.getResult().equals(other.getResult()))
&& (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
&& (this.getLastNotifyTime() == null ? other.getLastNotifyTime() == null : this.getLastNotifyTime().equals(other.getLastNotifyTime()))
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
&& (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()));
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((getOrderId() == null) ? 0 : getOrderId().hashCode());
result = prime * result + ((getMchId() == null) ? 0 : getMchId().hashCode());
result = prime * result + ((getMchOrderNo() == null) ? 0 : getMchOrderNo().hashCode());
result = prime * result + ((getOrderType() == null) ? 0 : getOrderType().hashCode());
result = prime * result + ((getNotifyUrl() == null) ? 0 : getNotifyUrl().hashCode());
result = prime * result + ((getNotifyCount() == null) ? 0 : getNotifyCount().hashCode());
result = prime * result + ((getResult() == null) ? 0 : getResult().hashCode());
result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
result = prime * result + ((getLastNotifyTime() == null) ? 0 : getLastNotifyTime().hashCode());
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
return result;
}
}
\ No newline at end of file
package org.xxpay.dal.dao.model;
import java.io.Serializable;
import java.util.Date;
public class RefundOrder implements Serializable {
/**
* 退款订单号
*
* @mbggenerated
*/
private String refundOrderId;
/**
* 支付订单号
*
* @mbggenerated
*/
private String payOrderId;
/**
* 渠道支付单号
*
* @mbggenerated
*/
private String channelPayOrderNo;
/**
* 商户ID
*
* @mbggenerated
*/
private String mchId;
/**
* 商户退款单号
*
* @mbggenerated
*/
private String mchRefundNo;
/**
* 渠道ID
*
* @mbggenerated
*/
private String channelId;
/**
* 支付金额,单位分
*
* @mbggenerated
*/
private Long payAmount;
/**
* 退款金额,单位分
*
* @mbggenerated
*/
private Long refundAmount;
/**
* 三位货币代码,人民币:cny
*
* @mbggenerated
*/
private String currency;
/**
* 退款状态:0-订单生成,1-退款中,2-退款成功,3-退款失败,4-业务处理完成
*
* @mbggenerated
*/
private Byte status;
/**
* 退款结果:0-不确认结果,1-等待手动处理,2-确认成功,3-确认失败
*
* @mbggenerated
*/
private Byte result;
/**
* 客户端IP
*
* @mbggenerated
*/
private String clientIp;
/**
* 设备
*
* @mbggenerated
*/
private String device;
/**
* 备注
*
* @mbggenerated
*/
private String remarkInfo;
/**
* 渠道用户标识,如微信openId,支付宝账号
*
* @mbggenerated
*/
private String channelUser;
/**
* 用户姓名
*
* @mbggenerated
*/
private String userName;
/**
* 渠道商户ID
*
* @mbggenerated
*/
private String channelMchId;
/**
* 渠道订单号
*
* @mbggenerated
*/
private String channelOrderNo;
/**
* 渠道错误码
*
* @mbggenerated
*/
private String channelErrCode;
/**
* 渠道错误描述
*
* @mbggenerated
*/
private String channelErrMsg;
/**
* 特定渠道发起时额外参数
*
* @mbggenerated
*/
private String extra;
/**
* 通知地址
*
* @mbggenerated
*/
private String notifyUrl;
/**
* 扩展参数1
*
* @mbggenerated
*/
private String param1;
/**
* 扩展参数2
*
* @mbggenerated
*/
private String param2;
/**
* 订单失效时间
*
* @mbggenerated
*/
private Date expireTime;
/**
* 订单退款成功时间
*
* @mbggenerated
*/
private Date refundSuccTime;
/**
* 创建时间
*
* @mbggenerated
*/
private Date createTime;
/**
* 更新时间
*
* @mbggenerated
*/
private Date updateTime;
private static final long serialVersionUID = 1L;
public String getRefundOrderId() {
return refundOrderId;
}
public void setRefundOrderId(String refundOrderId) {
this.refundOrderId = refundOrderId;
}
public String getPayOrderId() {
return payOrderId;
}
public void setPayOrderId(String payOrderId) {
this.payOrderId = payOrderId;
}
public String getChannelPayOrderNo() {
return channelPayOrderNo;
}
public void setChannelPayOrderNo(String channelPayOrderNo) {
this.channelPayOrderNo = channelPayOrderNo;
}
public String getMchId() {
return mchId;
}
public void setMchId(String mchId) {
this.mchId = mchId;
}
public String getMchRefundNo() {
return mchRefundNo;
}
public void setMchRefundNo(String mchRefundNo) {
this.mchRefundNo = mchRefundNo;
}
public String getChannelId() {
return channelId;
}
public void setChannelId(String channelId) {
this.channelId = channelId;
}
public Long getPayAmount() {
return payAmount;
}
public void setPayAmount(Long payAmount) {
this.payAmount = payAmount;
}
public Long getRefundAmount() {
return refundAmount;
}
public void setRefundAmount(Long refundAmount) {
this.refundAmount = refundAmount;
}
public String getCurrency() {
return currency;
}
public void setCurrency(String currency) {
this.currency = currency;
}
public Byte getStatus() {
return status;
}
public void setStatus(Byte status) {
this.status = status;
}
public Byte getResult() {
return result;
}
public void setResult(Byte result) {
this.result = result;
}
public String getClientIp() {
return clientIp;
}
public void setClientIp(String clientIp) {
this.clientIp = clientIp;
}
public String getDevice() {
return device;
}
public void setDevice(String device) {
this.device = device;
}
public String getRemarkInfo() {
return remarkInfo;
}
public void setRemarkInfo(String remarkInfo) {
this.remarkInfo = remarkInfo;
}
public String getChannelUser() {
return channelUser;
}
public void setChannelUser(String channelUser) {
this.channelUser = channelUser;
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getChannelMchId() {
return channelMchId;
}
public void setChannelMchId(String channelMchId) {
this.channelMchId = channelMchId;
}
public String getChannelOrderNo() {
return channelOrderNo;
}
public void setChannelOrderNo(String channelOrderNo) {
this.channelOrderNo = channelOrderNo;
}
public String getChannelErrCode() {
return channelErrCode;
}
public void setChannelErrCode(String channelErrCode) {
this.channelErrCode = channelErrCode;
}
public String getChannelErrMsg() {
return channelErrMsg;
}
public void setChannelErrMsg(String channelErrMsg) {
this.channelErrMsg = channelErrMsg;
}
public String getExtra() {
return extra;
}
public void setExtra(String extra) {
this.extra = extra;
}
public String getNotifyUrl() {
return notifyUrl;
}
public void setNotifyUrl(String notifyUrl) {
this.notifyUrl = notifyUrl;
}
public String getParam1() {
return param1;
}
public void setParam1(String param1) {
this.param1 = param1;
}
public String getParam2() {
return param2;
}
public void setParam2(String param2) {
this.param2 = param2;
}
public Date getExpireTime() {
return expireTime;
}
public void setExpireTime(Date expireTime) {
this.expireTime = expireTime;
}
public Date getRefundSuccTime() {
return refundSuccTime;
}
public void setRefundSuccTime(Date refundSuccTime) {
this.refundSuccTime = refundSuccTime;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", refundOrderId=").append(refundOrderId);
sb.append(", payOrderId=").append(payOrderId);
sb.append(", channelPayOrderNo=").append(channelPayOrderNo);
sb.append(", mchId=").append(mchId);
sb.append(", mchRefundNo=").append(mchRefundNo);
sb.append(", channelId=").append(channelId);
sb.append(", payAmount=").append(payAmount);
sb.append(", refundAmount=").append(refundAmount);
sb.append(", currency=").append(currency);
sb.append(", status=").append(status);
sb.append(", result=").append(result);
sb.append(", clientIp=").append(clientIp);
sb.append(", device=").append(device);
sb.append(", remarkInfo=").append(remarkInfo);
sb.append(", channelUser=").append(channelUser);
sb.append(", userName=").append(userName);
sb.append(", channelMchId=").append(channelMchId);
sb.append(", channelOrderNo=").append(channelOrderNo);
sb.append(", channelErrCode=").append(channelErrCode);
sb.append(", channelErrMsg=").append(channelErrMsg);
sb.append(", extra=").append(extra);
sb.append(", notifyUrl=").append(notifyUrl);
sb.append(", param1=").append(param1);
sb.append(", param2=").append(param2);
sb.append(", expireTime=").append(expireTime);
sb.append(", refundSuccTime=").append(refundSuccTime);
sb.append(", createTime=").append(createTime);
sb.append(", updateTime=").append(updateTime);
sb.append("]");
return sb.toString();
}
@Override
public boolean equals(Object that) {
if (this == that) {
return true;
}
if (that == null) {
return false;
}
if (getClass() != that.getClass()) {
return false;
}
RefundOrder other = (RefundOrder) that;
return (this.getRefundOrderId() == null ? other.getRefundOrderId() == null : this.getRefundOrderId().equals(other.getRefundOrderId()))
&& (this.getPayOrderId() == null ? other.getPayOrderId() == null : this.getPayOrderId().equals(other.getPayOrderId()))
&& (this.getChannelPayOrderNo() == null ? other.getChannelPayOrderNo() == null : this.getChannelPayOrderNo().equals(other.getChannelPayOrderNo()))
&& (this.getMchId() == null ? other.getMchId() == null : this.getMchId().equals(other.getMchId()))
&& (this.getMchRefundNo() == null ? other.getMchRefundNo() == null : this.getMchRefundNo().equals(other.getMchRefundNo()))
&& (this.getChannelId() == null ? other.getChannelId() == null : this.getChannelId().equals(other.getChannelId()))
&& (this.getPayAmount() == null ? other.getPayAmount() == null : this.getPayAmount().equals(other.getPayAmount()))
&& (this.getRefundAmount() == null ? other.getRefundAmount() == null : this.getRefundAmount().equals(other.getRefundAmount()))
&& (this.getCurrency() == null ? other.getCurrency() == null : this.getCurrency().equals(other.getCurrency()))
&& (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
&& (this.getResult() == null ? other.getResult() == null : this.getResult().equals(other.getResult()))
&& (this.getClientIp() == null ? other.getClientIp() == null : this.getClientIp().equals(other.getClientIp()))
&& (this.getDevice() == null ? other.getDevice() == null : this.getDevice().equals(other.getDevice()))
&& (this.getRemarkInfo() == null ? other.getRemarkInfo() == null : this.getRemarkInfo().equals(other.getRemarkInfo()))
&& (this.getChannelUser() == null ? other.getChannelUser() == null : this.getChannelUser().equals(other.getChannelUser()))
&& (this.getUserName() == null ? other.getUserName() == null : this.getUserName().equals(other.getUserName()))
&& (this.getChannelMchId() == null ? other.getChannelMchId() == null : this.getChannelMchId().equals(other.getChannelMchId()))
&& (this.getChannelOrderNo() == null ? other.getChannelOrderNo() == null : this.getChannelOrderNo().equals(other.getChannelOrderNo()))
&& (this.getChannelErrCode() == null ? other.getChannelErrCode() == null : this.getChannelErrCode().equals(other.getChannelErrCode()))
&& (this.getChannelErrMsg() == null ? other.getChannelErrMsg() == null : this.getChannelErrMsg().equals(other.getChannelErrMsg()))
&& (this.getExtra() == null ? other.getExtra() == null : this.getExtra().equals(other.getExtra()))
&& (this.getNotifyUrl() == null ? other.getNotifyUrl() == null : this.getNotifyUrl().equals(other.getNotifyUrl()))
&& (this.getParam1() == null ? other.getParam1() == null : this.getParam1().equals(other.getParam1()))
&& (this.getParam2() == null ? other.getParam2() == null : this.getParam2().equals(other.getParam2()))
&& (this.getExpireTime() == null ? other.getExpireTime() == null : this.getExpireTime().equals(other.getExpireTime()))
&& (this.getRefundSuccTime() == null ? other.getRefundSuccTime() == null : this.getRefundSuccTime().equals(other.getRefundSuccTime()))
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
&& (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()));
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((getRefundOrderId() == null) ? 0 : getRefundOrderId().hashCode());
result = prime * result + ((getPayOrderId() == null) ? 0 : getPayOrderId().hashCode());
result = prime * result + ((getChannelPayOrderNo() == null) ? 0 : getChannelPayOrderNo().hashCode());
result = prime * result + ((getMchId() == null) ? 0 : getMchId().hashCode());
result = prime * result + ((getMchRefundNo() == null) ? 0 : getMchRefundNo().hashCode());
result = prime * result + ((getChannelId() == null) ? 0 : getChannelId().hashCode());
result = prime * result + ((getPayAmount() == null) ? 0 : getPayAmount().hashCode());
result = prime * result + ((getRefundAmount() == null) ? 0 : getRefundAmount().hashCode());
result = prime * result + ((getCurrency() == null) ? 0 : getCurrency().hashCode());
result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
result = prime * result + ((getResult() == null) ? 0 : getResult().hashCode());
result = prime * result + ((getClientIp() == null) ? 0 : getClientIp().hashCode());
result = prime * result + ((getDevice() == null) ? 0 : getDevice().hashCode());
result = prime * result + ((getRemarkInfo() == null) ? 0 : getRemarkInfo().hashCode());
result = prime * result + ((getChannelUser() == null) ? 0 : getChannelUser().hashCode());
result = prime * result + ((getUserName() == null) ? 0 : getUserName().hashCode());
result = prime * result + ((getChannelMchId() == null) ? 0 : getChannelMchId().hashCode());
result = prime * result + ((getChannelOrderNo() == null) ? 0 : getChannelOrderNo().hashCode());
result = prime * result + ((getChannelErrCode() == null) ? 0 : getChannelErrCode().hashCode());
result = prime * result + ((getChannelErrMsg() == null) ? 0 : getChannelErrMsg().hashCode());
result = prime * result + ((getExtra() == null) ? 0 : getExtra().hashCode());
result = prime * result + ((getNotifyUrl() == null) ? 0 : getNotifyUrl().hashCode());
result = prime * result + ((getParam1() == null) ? 0 : getParam1().hashCode());
result = prime * result + ((getParam2() == null) ? 0 : getParam2().hashCode());
result = prime * result + ((getExpireTime() == null) ? 0 : getExpireTime().hashCode());
result = prime * result + ((getRefundSuccTime() == null) ? 0 : getRefundSuccTime().hashCode());
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
return result;
}
}
\ No newline at end of file
......@@ -19,11 +19,11 @@ public class TransOrder implements Serializable {
private String mchId;
/**
* 商户单号
* 商户转账单号
*
* @mbggenerated
*/
private String mchOrderNo;
private String mchTransNo;
/**
* 渠道ID
......@@ -47,12 +47,19 @@ public class TransOrder implements Serializable {
private String currency;
/**
* 支付状态:0-订单生成,1-转账中,2-转账成功,3-转账失败,4-业务处理完成,5-确认失败,6-不确认结果,7-等待手动处理,8-手动处理提现成功,9-手动处理提现失败
* 转账状态:0-订单生成,1-转账中,2-转账成功,3-转账失败,4-业务处理完成
*
* @mbggenerated
*/
private Byte status;
/**
* 转账结果:0-不确认结果,1-等待手动处理,2-确认成功,3-确认失败
*
* @mbggenerated
*/
private Byte result;
/**
* 客户端IP
*
......@@ -75,18 +82,11 @@ public class TransOrder implements Serializable {
private String remarkInfo;
/**
* 渠道用户标识,如微信openId
* 渠道用户标识,如微信openId,支付宝账号
*
* @mbggenerated
*/
private String openId;
/**
* 校验姓名:0-不校验真实姓名,1-强校验真实姓名,2-针对已实名认证的用户才校验真实姓名
*
* @mbggenerated
*/
private Byte checkName;
private String channelUser;
/**
* 用户姓名
......@@ -95,13 +95,6 @@ public class TransOrder implements Serializable {
*/
private String userName;
/**
* 特定渠道发起时额外参数
*
* @mbggenerated
*/
private String extra;
/**
* 渠道商户ID
*
......@@ -117,32 +110,25 @@ public class TransOrder implements Serializable {
private String channelOrderNo;
/**
* 渠道支付错误码
* 渠道错误码
*
* @mbggenerated
*/
private String errCode;
private String channelErrCode;
/**
* 渠道支付错误描述
* 渠道错误描述
*
* @mbggenerated
*/
private String errMsg;
private String channelErrMsg;
/**
* 扩展参数1
*
* @mbggenerated
*/
private String param1;
/**
* 扩展参数2
* 特定渠道发起时额外参数
*
* @mbggenerated
*/
private String param2;
private String extra;
/**
* 通知地址
......@@ -152,32 +138,32 @@ public class TransOrder implements Serializable {
private String notifyUrl;
/**
* 通知次数
* 扩展参数1
*
* @mbggenerated
*/
private Byte notifyCount;
private String param1;
/**
* 最后一次通知时间
* 扩展参数2
*
* @mbggenerated
*/
private Long lastNotifyTime;
private String param2;
/**
* 订单失效时间
*
* @mbggenerated
*/
private Long expireTime;
private Date expireTime;
/**
* 订单转账成功时间
*
* @mbggenerated
*/
private Long transSuccTime;
private Date transSuccTime;
/**
* 创建时间
......@@ -211,12 +197,12 @@ public class TransOrder implements Serializable {
this.mchId = mchId;
}
public String getMchOrderNo() {
return mchOrderNo;
public String getMchTransNo() {
return mchTransNo;
}
public void setMchOrderNo(String mchOrderNo) {
this.mchOrderNo = mchOrderNo;
public void setMchTransNo(String mchTransNo) {
this.mchTransNo = mchTransNo;
}
public String getChannelId() {
......@@ -251,6 +237,14 @@ public class TransOrder implements Serializable {
this.status = status;
}
public Byte getResult() {
return result;
}
public void setResult(Byte result) {
this.result = result;
}
public String getClientIp() {
return clientIp;
}
......@@ -275,20 +269,12 @@ public class TransOrder implements Serializable {
this.remarkInfo = remarkInfo;
}
public String getOpenId() {
return openId;
}
public void setOpenId(String openId) {
this.openId = openId;
}
public Byte getCheckName() {
return checkName;
public String getChannelUser() {
return channelUser;
}
public void setCheckName(Byte checkName) {
this.checkName = checkName;
public void setChannelUser(String channelUser) {
this.channelUser = channelUser;
}
public String getUserName() {
......@@ -299,14 +285,6 @@ public class TransOrder implements Serializable {
this.userName = userName;
}
public String getExtra() {
return extra;
}
public void setExtra(String extra) {
this.extra = extra;
}
public String getChannelMchId() {
return channelMchId;
}
......@@ -323,36 +301,28 @@ public class TransOrder implements Serializable {
this.channelOrderNo = channelOrderNo;
}
public String getErrCode() {
return errCode;
public String getChannelErrCode() {
return channelErrCode;
}
public void setErrCode(String errCode) {
this.errCode = errCode;
public void setChannelErrCode(String channelErrCode) {
this.channelErrCode = channelErrCode;
}
public String getErrMsg() {
return errMsg;
public String getChannelErrMsg() {
return channelErrMsg;
}
public void setErrMsg(String errMsg) {
this.errMsg = errMsg;
public void setChannelErrMsg(String channelErrMsg) {
this.channelErrMsg = channelErrMsg;
}
public String getParam1() {
return param1;
}
public void setParam1(String param1) {
this.param1 = param1;
}
public String getParam2() {
return param2;
public String getExtra() {
return extra;
}
public void setParam2(String param2) {
this.param2 = param2;
public void setExtra(String extra) {
this.extra = extra;
}
public String getNotifyUrl() {
......@@ -363,35 +333,35 @@ public class TransOrder implements Serializable {
this.notifyUrl = notifyUrl;
}
public Byte getNotifyCount() {
return notifyCount;
public String getParam1() {
return param1;
}
public void setNotifyCount(Byte notifyCount) {
this.notifyCount = notifyCount;
public void setParam1(String param1) {
this.param1 = param1;
}
public Long getLastNotifyTime() {
return lastNotifyTime;
public String getParam2() {
return param2;
}
public void setLastNotifyTime(Long lastNotifyTime) {
this.lastNotifyTime = lastNotifyTime;
public void setParam2(String param2) {
this.param2 = param2;
}
public Long getExpireTime() {
public Date getExpireTime() {
return expireTime;
}
public void setExpireTime(Long expireTime) {
public void setExpireTime(Date expireTime) {
this.expireTime = expireTime;
}
public Long getTransSuccTime() {
public Date getTransSuccTime() {
return transSuccTime;
}
public void setTransSuccTime(Long transSuccTime) {
public void setTransSuccTime(Date transSuccTime) {
this.transSuccTime = transSuccTime;
}
......@@ -419,27 +389,25 @@ public class TransOrder implements Serializable {
sb.append("Hash = ").append(hashCode());
sb.append(", transOrderId=").append(transOrderId);
sb.append(", mchId=").append(mchId);
sb.append(", mchOrderNo=").append(mchOrderNo);
sb.append(", mchTransNo=").append(mchTransNo);
sb.append(", channelId=").append(channelId);
sb.append(", amount=").append(amount);
sb.append(", currency=").append(currency);
sb.append(", status=").append(status);
sb.append(", result=").append(result);
sb.append(", clientIp=").append(clientIp);
sb.append(", device=").append(device);
sb.append(", remarkInfo=").append(remarkInfo);
sb.append(", openId=").append(openId);
sb.append(", checkName=").append(checkName);
sb.append(", channelUser=").append(channelUser);
sb.append(", userName=").append(userName);
sb.append(", extra=").append(extra);
sb.append(", channelMchId=").append(channelMchId);
sb.append(", channelOrderNo=").append(channelOrderNo);
sb.append(", errCode=").append(errCode);
sb.append(", errMsg=").append(errMsg);
sb.append(", channelErrCode=").append(channelErrCode);
sb.append(", channelErrMsg=").append(channelErrMsg);
sb.append(", extra=").append(extra);
sb.append(", notifyUrl=").append(notifyUrl);
sb.append(", param1=").append(param1);
sb.append(", param2=").append(param2);
sb.append(", notifyUrl=").append(notifyUrl);
sb.append(", notifyCount=").append(notifyCount);
sb.append(", lastNotifyTime=").append(lastNotifyTime);
sb.append(", expireTime=").append(expireTime);
sb.append(", transSuccTime=").append(transSuccTime);
sb.append(", createTime=").append(createTime);
......@@ -462,27 +430,25 @@ public class TransOrder implements Serializable {
TransOrder other = (TransOrder) that;
return (this.getTransOrderId() == null ? other.getTransOrderId() == null : this.getTransOrderId().equals(other.getTransOrderId()))
&& (this.getMchId() == null ? other.getMchId() == null : this.getMchId().equals(other.getMchId()))
&& (this.getMchOrderNo() == null ? other.getMchOrderNo() == null : this.getMchOrderNo().equals(other.getMchOrderNo()))
&& (this.getMchTransNo() == null ? other.getMchTransNo() == null : this.getMchTransNo().equals(other.getMchTransNo()))
&& (this.getChannelId() == null ? other.getChannelId() == null : this.getChannelId().equals(other.getChannelId()))
&& (this.getAmount() == null ? other.getAmount() == null : this.getAmount().equals(other.getAmount()))
&& (this.getCurrency() == null ? other.getCurrency() == null : this.getCurrency().equals(other.getCurrency()))
&& (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
&& (this.getResult() == null ? other.getResult() == null : this.getResult().equals(other.getResult()))
&& (this.getClientIp() == null ? other.getClientIp() == null : this.getClientIp().equals(other.getClientIp()))
&& (this.getDevice() == null ? other.getDevice() == null : this.getDevice().equals(other.getDevice()))
&& (this.getRemarkInfo() == null ? other.getRemarkInfo() == null : this.getRemarkInfo().equals(other.getRemarkInfo()))
&& (this.getOpenId() == null ? other.getOpenId() == null : this.getOpenId().equals(other.getOpenId()))
&& (this.getCheckName() == null ? other.getCheckName() == null : this.getCheckName().equals(other.getCheckName()))
&& (this.getChannelUser() == null ? other.getChannelUser() == null : this.getChannelUser().equals(other.getChannelUser()))
&& (this.getUserName() == null ? other.getUserName() == null : this.getUserName().equals(other.getUserName()))
&& (this.getExtra() == null ? other.getExtra() == null : this.getExtra().equals(other.getExtra()))
&& (this.getChannelMchId() == null ? other.getChannelMchId() == null : this.getChannelMchId().equals(other.getChannelMchId()))
&& (this.getChannelOrderNo() == null ? other.getChannelOrderNo() == null : this.getChannelOrderNo().equals(other.getChannelOrderNo()))
&& (this.getErrCode() == null ? other.getErrCode() == null : this.getErrCode().equals(other.getErrCode()))
&& (this.getErrMsg() == null ? other.getErrMsg() == null : this.getErrMsg().equals(other.getErrMsg()))
&& (this.getChannelErrCode() == null ? other.getChannelErrCode() == null : this.getChannelErrCode().equals(other.getChannelErrCode()))
&& (this.getChannelErrMsg() == null ? other.getChannelErrMsg() == null : this.getChannelErrMsg().equals(other.getChannelErrMsg()))
&& (this.getExtra() == null ? other.getExtra() == null : this.getExtra().equals(other.getExtra()))
&& (this.getNotifyUrl() == null ? other.getNotifyUrl() == null : this.getNotifyUrl().equals(other.getNotifyUrl()))
&& (this.getParam1() == null ? other.getParam1() == null : this.getParam1().equals(other.getParam1()))
&& (this.getParam2() == null ? other.getParam2() == null : this.getParam2().equals(other.getParam2()))
&& (this.getNotifyUrl() == null ? other.getNotifyUrl() == null : this.getNotifyUrl().equals(other.getNotifyUrl()))
&& (this.getNotifyCount() == null ? other.getNotifyCount() == null : this.getNotifyCount().equals(other.getNotifyCount()))
&& (this.getLastNotifyTime() == null ? other.getLastNotifyTime() == null : this.getLastNotifyTime().equals(other.getLastNotifyTime()))
&& (this.getExpireTime() == null ? other.getExpireTime() == null : this.getExpireTime().equals(other.getExpireTime()))
&& (this.getTransSuccTime() == null ? other.getTransSuccTime() == null : this.getTransSuccTime().equals(other.getTransSuccTime()))
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
......@@ -495,27 +461,25 @@ public class TransOrder implements Serializable {
int result = 1;
result = prime * result + ((getTransOrderId() == null) ? 0 : getTransOrderId().hashCode());
result = prime * result + ((getMchId() == null) ? 0 : getMchId().hashCode());
result = prime * result + ((getMchOrderNo() == null) ? 0 : getMchOrderNo().hashCode());
result = prime * result + ((getMchTransNo() == null) ? 0 : getMchTransNo().hashCode());
result = prime * result + ((getChannelId() == null) ? 0 : getChannelId().hashCode());
result = prime * result + ((getAmount() == null) ? 0 : getAmount().hashCode());
result = prime * result + ((getCurrency() == null) ? 0 : getCurrency().hashCode());
result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
result = prime * result + ((getResult() == null) ? 0 : getResult().hashCode());
result = prime * result + ((getClientIp() == null) ? 0 : getClientIp().hashCode());
result = prime * result + ((getDevice() == null) ? 0 : getDevice().hashCode());
result = prime * result + ((getRemarkInfo() == null) ? 0 : getRemarkInfo().hashCode());
result = prime * result + ((getOpenId() == null) ? 0 : getOpenId().hashCode());
result = prime * result + ((getCheckName() == null) ? 0 : getCheckName().hashCode());
result = prime * result + ((getChannelUser() == null) ? 0 : getChannelUser().hashCode());
result = prime * result + ((getUserName() == null) ? 0 : getUserName().hashCode());
result = prime * result + ((getExtra() == null) ? 0 : getExtra().hashCode());
result = prime * result + ((getChannelMchId() == null) ? 0 : getChannelMchId().hashCode());
result = prime * result + ((getChannelOrderNo() == null) ? 0 : getChannelOrderNo().hashCode());
result = prime * result + ((getErrCode() == null) ? 0 : getErrCode().hashCode());
result = prime * result + ((getErrMsg() == null) ? 0 : getErrMsg().hashCode());
result = prime * result + ((getChannelErrCode() == null) ? 0 : getChannelErrCode().hashCode());
result = prime * result + ((getChannelErrMsg() == null) ? 0 : getChannelErrMsg().hashCode());
result = prime * result + ((getExtra() == null) ? 0 : getExtra().hashCode());
result = prime * result + ((getNotifyUrl() == null) ? 0 : getNotifyUrl().hashCode());
result = prime * result + ((getParam1() == null) ? 0 : getParam1().hashCode());
result = prime * result + ((getParam2() == null) ? 0 : getParam2().hashCode());
result = prime * result + ((getNotifyUrl() == null) ? 0 : getNotifyUrl().hashCode());
result = prime * result + ((getNotifyCount() == null) ? 0 : getNotifyCount().hashCode());
result = prime * result + ((getLastNotifyTime() == null) ? 0 : getLastNotifyTime().hashCode());
result = prime * result + ((getExpireTime() == null) ? 0 : getExpireTime().hashCode());
result = prime * result + ((getTransSuccTime() == null) ? 0 : getTransSuccTime().hashCode());
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
......
......@@ -54,10 +54,13 @@
<javaClientGenerator targetPackage="org.xxpay.dal.dao.mapper" targetProject="src/main/java" type="XMLMAPPER"/>
<!-- 需要映射的表 -->
<table tableName="t_pay_order" domainObjectName="PayOrder"><property name="useActualColumnNames" value="true" /></table>
<table tableName="t_trans_order" domainObjectName="TransOrder"><property name="useActualColumnNames" value="true" /></table>
<!--<table tableName="t_pay_order" domainObjectName="PayOrder"><property name="useActualColumnNames" value="true" /></table>
<table tableName="t_pay_channel" domainObjectName="PayChannel"><property name="useActualColumnNames" value="true" /></table>
<table tableName="t_mch_info" domainObjectName="MchInfo"><property name="useActualColumnNames" value="true" /></table>
<table tableName="t_iap_receipt" domainObjectName="IapReceipt"><property name="useActualColumnNames" value="true" /></table>
<table tableName="t_iap_receipt" domainObjectName="IapReceipt"><property name="useActualColumnNames" value="true" /></table>-->
<table tableName="t_trans_order" domainObjectName="TransOrder"><property name="useActualColumnNames" value="true" /></table>
<table tableName="t_refund_order" domainObjectName="RefundOrder"><property name="useActualColumnNames" value="true" /></table>
<!--<table tableName="t_mch_notify" domainObjectName="MchNotify"><property name="useActualColumnNames" value="true" /></table>-->
</context>
</generatorConfiguration>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="org.xxpay.dal.dao.mapper.MchNotifyMapper" >
<resultMap id="BaseResultMap" type="org.xxpay.dal.dao.model.MchNotify" >
<id column="OrderId" property="orderId" jdbcType="VARCHAR" />
<result column="MchId" property="mchId" jdbcType="VARCHAR" />
<result column="MchOrderNo" property="mchOrderNo" jdbcType="VARCHAR" />
<result column="OrderType" property="orderType" jdbcType="VARCHAR" />
<result column="NotifyUrl" property="notifyUrl" jdbcType="VARCHAR" />
<result column="NotifyCount" property="notifyCount" jdbcType="TINYINT" />
<result column="Result" property="result" jdbcType="VARCHAR" />
<result column="Status" property="status" jdbcType="TINYINT" />
<result column="LastNotifyTime" property="lastNotifyTime" jdbcType="TIMESTAMP" />
<result column="CreateTime" property="createTime" jdbcType="TIMESTAMP" />
<result column="UpdateTime" property="updateTime" jdbcType="TIMESTAMP" />
</resultMap>
<sql id="Example_Where_Clause" >
<where >
<foreach collection="oredCriteria" item="criteria" separator="or" >
<if test="criteria.valid" >
<trim prefix="(" suffix=")" prefixOverrides="and" >
<foreach collection="criteria.criteria" item="criterion" >
<choose >
<when test="criterion.noValue" >
and ${criterion.condition}
</when>
<when test="criterion.singleValue" >
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue" >
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue" >
and ${criterion.condition}
<foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause" >
<where >
<foreach collection="example.oredCriteria" item="criteria" separator="or" >
<if test="criteria.valid" >
<trim prefix="(" suffix=")" prefixOverrides="and" >
<foreach collection="criteria.criteria" item="criterion" >
<choose >
<when test="criterion.noValue" >
and ${criterion.condition}
</when>
<when test="criterion.singleValue" >
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue" >
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue" >
and ${criterion.condition}
<foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List" >
OrderId, MchId, MchOrderNo, OrderType, NotifyUrl, NotifyCount, Result, Status, LastNotifyTime,
CreateTime, UpdateTime
</sql>
<select id="selectByExample" resultMap="BaseResultMap" parameterType="org.xxpay.dal.dao.model.MchNotifyExample" >
select
<if test="distinct" >
distinct
</if>
<include refid="Base_Column_List" />
from t_mch_notify
<if test="_parameter != null" >
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null" >
order by ${orderByClause}
</if>
<if test="limit != null" >
<if test="offset != null" >
limit ${offset}, ${limit}
</if>
<if test="offset == null" >
limit ${limit}
</if>
</if>
</select>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
select
<include refid="Base_Column_List" />
from t_mch_notify
where OrderId = #{orderId,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
delete from t_mch_notify
where OrderId = #{orderId,jdbcType=VARCHAR}
</delete>
<delete id="deleteByExample" parameterType="org.xxpay.dal.dao.model.MchNotifyExample" >
delete from t_mch_notify
<if test="_parameter != null" >
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="org.xxpay.dal.dao.model.MchNotify" >
insert into t_mch_notify (OrderId, MchId, MchOrderNo,
OrderType, NotifyUrl, NotifyCount,
Result, Status, LastNotifyTime,
CreateTime, UpdateTime)
values (#{orderId,jdbcType=VARCHAR}, #{mchId,jdbcType=VARCHAR}, #{mchOrderNo,jdbcType=VARCHAR},
#{orderType,jdbcType=VARCHAR}, #{notifyUrl,jdbcType=VARCHAR}, #{notifyCount,jdbcType=TINYINT},
#{result,jdbcType=VARCHAR}, #{status,jdbcType=TINYINT}, #{lastNotifyTime,jdbcType=TIMESTAMP},
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" parameterType="org.xxpay.dal.dao.model.MchNotify" >
insert into t_mch_notify
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="orderId != null" >
OrderId,
</if>
<if test="mchId != null" >
MchId,
</if>
<if test="mchOrderNo != null" >
MchOrderNo,
</if>
<if test="orderType != null" >
OrderType,
</if>
<if test="notifyUrl != null" >
NotifyUrl,
</if>
<if test="notifyCount != null" >
NotifyCount,
</if>
<if test="result != null" >
Result,
</if>
<if test="status != null" >
Status,
</if>
<if test="lastNotifyTime != null" >
LastNotifyTime,
</if>
<if test="createTime != null" >
CreateTime,
</if>
<if test="updateTime != null" >
UpdateTime,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="orderId != null" >
#{orderId,jdbcType=VARCHAR},
</if>
<if test="mchId != null" >
#{mchId,jdbcType=VARCHAR},
</if>
<if test="mchOrderNo != null" >
#{mchOrderNo,jdbcType=VARCHAR},
</if>
<if test="orderType != null" >
#{orderType,jdbcType=VARCHAR},
</if>
<if test="notifyUrl != null" >
#{notifyUrl,jdbcType=VARCHAR},
</if>
<if test="notifyCount != null" >
#{notifyCount,jdbcType=TINYINT},
</if>
<if test="result != null" >
#{result,jdbcType=VARCHAR},
</if>
<if test="status != null" >
#{status,jdbcType=TINYINT},
</if>
<if test="lastNotifyTime != null" >
#{lastNotifyTime,jdbcType=TIMESTAMP},
</if>
<if test="createTime != null" >
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null" >
#{updateTime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="org.xxpay.dal.dao.model.MchNotifyExample" resultType="java.lang.Integer" >
select count(*) from t_mch_notify
<if test="_parameter != null" >
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map" >
update t_mch_notify
<set >
<if test="record.orderId != null" >
OrderId = #{record.orderId,jdbcType=VARCHAR},
</if>
<if test="record.mchId != null" >
MchId = #{record.mchId,jdbcType=VARCHAR},
</if>
<if test="record.mchOrderNo != null" >
MchOrderNo = #{record.mchOrderNo,jdbcType=VARCHAR},
</if>
<if test="record.orderType != null" >
OrderType = #{record.orderType,jdbcType=VARCHAR},
</if>
<if test="record.notifyUrl != null" >
NotifyUrl = #{record.notifyUrl,jdbcType=VARCHAR},
</if>
<if test="record.notifyCount != null" >
NotifyCount = #{record.notifyCount,jdbcType=TINYINT},
</if>
<if test="record.result != null" >
Result = #{record.result,jdbcType=VARCHAR},
</if>
<if test="record.status != null" >
Status = #{record.status,jdbcType=TINYINT},
</if>
<if test="record.lastNotifyTime != null" >
LastNotifyTime = #{record.lastNotifyTime,jdbcType=TIMESTAMP},
</if>
<if test="record.createTime != null" >
CreateTime = #{record.createTime,jdbcType=TIMESTAMP},
</if>
<if test="record.updateTime != null" >
UpdateTime = #{record.updateTime,jdbcType=TIMESTAMP},
</if>
</set>
<if test="_parameter != null" >
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map" >
update t_mch_notify
set OrderId = #{record.orderId,jdbcType=VARCHAR},
MchId = #{record.mchId,jdbcType=VARCHAR},
MchOrderNo = #{record.mchOrderNo,jdbcType=VARCHAR},
OrderType = #{record.orderType,jdbcType=VARCHAR},
NotifyUrl = #{record.notifyUrl,jdbcType=VARCHAR},
NotifyCount = #{record.notifyCount,jdbcType=TINYINT},
Result = #{record.result,jdbcType=VARCHAR},
Status = #{record.status,jdbcType=TINYINT},
LastNotifyTime = #{record.lastNotifyTime,jdbcType=TIMESTAMP},
CreateTime = #{record.createTime,jdbcType=TIMESTAMP},
UpdateTime = #{record.updateTime,jdbcType=TIMESTAMP}
<if test="_parameter != null" >
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="org.xxpay.dal.dao.model.MchNotify" >
update t_mch_notify
<set >
<if test="mchId != null" >
MchId = #{mchId,jdbcType=VARCHAR},
</if>
<if test="mchOrderNo != null" >
MchOrderNo = #{mchOrderNo,jdbcType=VARCHAR},
</if>
<if test="orderType != null" >
OrderType = #{orderType,jdbcType=VARCHAR},
</if>
<if test="notifyUrl != null" >
NotifyUrl = #{notifyUrl,jdbcType=VARCHAR},
</if>
<if test="notifyCount != null" >
NotifyCount = #{notifyCount,jdbcType=TINYINT},
</if>
<if test="result != null" >
Result = #{result,jdbcType=VARCHAR},
</if>
<if test="status != null" >
Status = #{status,jdbcType=TINYINT},
</if>
<if test="lastNotifyTime != null" >
LastNotifyTime = #{lastNotifyTime,jdbcType=TIMESTAMP},
</if>
<if test="createTime != null" >
CreateTime = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null" >
UpdateTime = #{updateTime,jdbcType=TIMESTAMP},
</if>
</set>
where OrderId = #{orderId,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="org.xxpay.dal.dao.model.MchNotify" >
update t_mch_notify
set MchId = #{mchId,jdbcType=VARCHAR},
MchOrderNo = #{mchOrderNo,jdbcType=VARCHAR},
OrderType = #{orderType,jdbcType=VARCHAR},
NotifyUrl = #{notifyUrl,jdbcType=VARCHAR},
NotifyCount = #{notifyCount,jdbcType=TINYINT},
Result = #{result,jdbcType=VARCHAR},
Status = #{status,jdbcType=TINYINT},
LastNotifyTime = #{lastNotifyTime,jdbcType=TIMESTAMP},
CreateTime = #{createTime,jdbcType=TIMESTAMP},
UpdateTime = #{updateTime,jdbcType=TIMESTAMP}
where OrderId = #{orderId,jdbcType=VARCHAR}
</update>
<!-- 单独增加的方法 -->
<insert id="insertSelectiveOnDuplicateKeyUpdate" parameterType="org.xxpay.dal.dao.model.MchNotify" >
insert into t_mch_notify
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="orderId != null" >
OrderId,
</if>
<if test="mchId != null" >
MchId,
</if>
<if test="mchOrderNo != null" >
MchOrderNo,
</if>
<if test="orderType != null" >
OrderType,
</if>
<if test="notifyUrl != null" >
NotifyUrl,
</if>
<if test="notifyCount != null" >
NotifyCount,
</if>
<if test="result != null" >
Result,
</if>
<if test="status != null" >
Status,
</if>
<if test="lastNotifyTime != null" >
LastNotifyTime,
</if>
<if test="createTime != null" >
CreateTime,
</if>
<if test="updateTime != null" >
UpdateTime,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="orderId != null" >
#{orderId,jdbcType=VARCHAR},
</if>
<if test="mchId != null" >
#{mchId,jdbcType=VARCHAR},
</if>
<if test="mchOrderNo != null" >
#{mchOrderNo,jdbcType=VARCHAR},
</if>
<if test="orderType != null" >
#{orderType,jdbcType=VARCHAR},
</if>
<if test="notifyUrl != null" >
#{notifyUrl,jdbcType=VARCHAR},
</if>
<if test="notifyCount != null" >
#{notifyCount,jdbcType=TINYINT},
</if>
<if test="result != null" >
#{result,jdbcType=VARCHAR},
</if>
<if test="status != null" >
#{status,jdbcType=TINYINT},
</if>
<if test="lastNotifyTime != null" >
#{lastNotifyTime,jdbcType=TIMESTAMP},
</if>
<if test="createTime != null" >
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null" >
#{updateTime,jdbcType=TIMESTAMP},
</if>
</trim>
ON DUPLICATE KEY UPDATE OrderId = #{orderId,jdbcType=VARCHAR}
</insert>
</mapper>
\ No newline at end of file
package org.xxpay.mgr.controller;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.xxpay.common.util.DateUtil;
import org.xxpay.common.util.MyLog;
import org.xxpay.dal.dao.model.MchNotify;
import org.xxpay.dal.dao.plugin.PageModel;
import org.xxpay.mgr.service.MchNotifyService;
import java.util.List;
@Controller
@RequestMapping("/mch_notify")
public class MchNotifyController {
private final static MyLog _log = MyLog.getLog(MchNotifyController.class);
@Autowired
private MchNotifyService mchNotifyService;
@RequestMapping("/list.html")
public String listInput(ModelMap model) {
return "mch_notify/list";
}
@RequestMapping("/list")
@ResponseBody
public String list(@ModelAttribute MchNotify mchNotify, Integer pageIndex, Integer pageSize) {
PageModel pageModel = new PageModel();
int count = mchNotifyService.count(mchNotify);
if(count <= 0) return JSON.toJSONString(pageModel);
List<MchNotify> mchNotifyList = mchNotifyService.getMchNotifyList((pageIndex-1)*pageSize, pageSize, mchNotify);
if(!CollectionUtils.isEmpty(mchNotifyList)) {
JSONArray array = new JSONArray();
for(MchNotify po : mchNotifyList) {
JSONObject object = (JSONObject) JSONObject.toJSON(po);
if(po.getCreateTime() != null) object.put("createTime", DateUtil.date2Str(po.getCreateTime()));
if(po.getLastNotifyTime() != null) object.put("lastNotifyTime", DateUtil.date2Str(po.getLastNotifyTime()));
array.add(object);
}
pageModel.setList(array);
}
pageModel.setCount(count);
pageModel.setMsg("ok");
pageModel.setRel(true);
return JSON.toJSONString(pageModel);
}
@RequestMapping("/view.html")
public String viewInput(String orderId, ModelMap model) {
MchNotify item = null;
if(StringUtils.isNotBlank(orderId)) {
item = mchNotifyService.selectMchNotify(orderId);
}
if(item == null) {
item = new MchNotify();
model.put("item", item);
return "mch_notify/view";
}
JSONObject object = (JSONObject) JSON.toJSON(item);
if(item.getCreateTime() != null) object.put("createTime", DateUtil.date2Str(item.getCreateTime()));
if(item.getUpdateTime() != null) object.put("updateTime", DateUtil.date2Str(item.getUpdateTime()));
if(item.getLastNotifyTime() != null) object.put("lastNotifyTime", DateUtil.date2Str(item.getLastNotifyTime()));
model.put("item", object);
return "mch_notify/view";
}
}
\ No newline at end of file
package org.xxpay.mgr.controller;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.xxpay.common.util.AmountUtil;
import org.xxpay.common.util.DateUtil;
import org.xxpay.common.util.MyLog;
import org.xxpay.dal.dao.model.RefundOrder;
import org.xxpay.dal.dao.plugin.PageModel;
import org.xxpay.mgr.service.RefundOrderService;
import java.util.List;
@Controller
@RequestMapping("/refund_order")
public class RefundOrderController {
private final static MyLog _log = MyLog.getLog(RefundOrderController.class);
@Autowired
private RefundOrderService refundOrderService;
@RequestMapping("/list.html")
public String listInput(ModelMap model) {
return "refund_order/list";
}
@RequestMapping("/list")
@ResponseBody
public String list(@ModelAttribute RefundOrder refundOrder, Integer pageIndex, Integer pageSize) {
PageModel pageModel = new PageModel();
int count = refundOrderService.count(refundOrder);
if(count <= 0) return JSON.toJSONString(pageModel);
List<RefundOrder> refundOrderList = refundOrderService.getRefundOrderList((pageIndex-1)*pageSize, pageSize, refundOrder);
if(!CollectionUtils.isEmpty(refundOrderList)) {
JSONArray array = new JSONArray();
for(RefundOrder po : refundOrderList) {
JSONObject object = (JSONObject) JSONObject.toJSON(po);
if(po.getCreateTime() != null) object.put("createTime", DateUtil.date2Str(po.getCreateTime()));
if(po.getRefundAmount() != null) object.put("amount", AmountUtil.convertCent2Dollar(po.getRefundAmount()+""));
array.add(object);
}
pageModel.setList(array);
}
pageModel.setCount(count);
pageModel.setMsg("ok");
pageModel.setRel(true);
return JSON.toJSONString(pageModel);
}
@RequestMapping("/view.html")
public String viewInput(String refundOrderId, ModelMap model) {
RefundOrder item = null;
if(StringUtils.isNotBlank(refundOrderId)) {
item = refundOrderService.selectRefundOrder(refundOrderId);
}
if(item == null) {
item = new RefundOrder();
model.put("item", item);
return "refund_order/view";
}
JSONObject object = (JSONObject) JSON.toJSON(item);
if(item.getRefundSuccTime() != null) object.put("refundSuccTime", DateUtil.date2Str(item.getRefundSuccTime()));
if(item.getExpireTime() != null) object.put("expireTime", DateUtil.date2Str(item.getExpireTime()));
if(item.getRefundAmount() != null) object.put("amount", AmountUtil.convertCent2Dollar(item.getRefundAmount()+""));
model.put("item", object);
return "refund_order/view";
}
}
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment