Commit b48392ab authored by shiyu's avatar shiyu

退款接口

parent 0d2bee3a
......@@ -37,6 +37,11 @@ public class WxPayProperties {
*/
private String payNotifyUrl;
/**
* 支付退款通知地址
*/
private String refundNotifyUrl;
/**
* 私钥地址
*/
......@@ -124,4 +129,8 @@ public class WxPayProperties {
public void setPrivateKeyPath(String privateKeyPath) {
this.privateKeyPath = privateKeyPath;
}
public String getRefundNotifyUrl() {
return refundNotifyUrl;
}
}
......@@ -19,6 +19,7 @@ import com.wechat.pay.java.service.refund.model.CreateRequest;
import com.wechat.pay.java.service.refund.model.Refund;
import com.wechat.pay.java.service.refund.model.Status;
import com.wwdz.ch.core.consts.ResultCode;
import com.wwdz.ch.core.entity.wxPay.DistributionOrderRefundRequestDto;
import com.wwdz.ch.core.type.Result;
import com.wwdz.ch.core.util.PriceUtil;
import com.wwdz.ch.core.util.UUID;
......@@ -267,4 +268,43 @@ public class WxPayServiceApi {
return Result.failed();
}
/**
* 微信支付申请退款
* @param dto
* @return
*/
public Result orderRefund(DistributionOrderRefundRequestDto dto){
try {
//构建退款service
RefundService service = new RefundService.Builder().config(rsaAutoCertificateConfig).build();
//构建退款请求
CreateRequest request = new CreateRequest();
//构建订单金额信息
AmountReq amountReq = new AmountReq();
//退款金额,单位为分
amountReq.setRefund(dto.getRefundPrice());
//原订单金额,单位为分
amountReq.setTotal(dto.getAmount());
//货币类型(默认人民币)
amountReq.setCurrency("CNY");
//退款回调地址
request.setNotifyUrl(wxPayProperties.getRefundNotifyUrl());
//商户系统单号
request.setOutTradeNo(dto.getDistributionOrderId());
request.setAmount(amountReq);
//商户退款单号
request.setOutRefundNo(dto.getRefundId());
//退款通知回调地址
request.setNotifyUrl(null);
Refund refundResponse = service.create(request);
logger.info("微信申请退款接口返回:{}", JsonUtils.from(refundResponse));
return Result.success(refundResponse);
}catch (Exception e){
logger.error("微信退款接口错误error : {}", e);
}
return Result.failed();
}
}
......@@ -10,6 +10,7 @@ public class DistributionEnum {
PRE_SEND(10, "待发货"),
PRE_SIGNED(20, "待收货"),
AFTER_SALE(30, "售后中"),
REFUNDING(80, "退款受理中"),
FINISH(100, "已完成"),
CANCEL(101, "已取消"),
......@@ -44,4 +45,41 @@ public class DistributionEnum {
}
/**
* 分销订单状态
*/
public enum RefundOrderStateEnum {
PROCESSING(10, "处理中"),
SUCCESS(100, "退款成功"),
FAILED(101, "退款失败"),
;
private int code;
private String des;
RefundOrderStateEnum(int code, String des) {
this.code = code;
this.des = des;
}
public static String getNameByCode(int code) {
for (DistributionEnum.RefundOrderStateEnum refundOrderStateEnum : DistributionEnum.RefundOrderStateEnum.values()) {
if (code == refundOrderStateEnum.getCode()) {
return refundOrderStateEnum.getDes();
}
}
return null;
}
public int getCode() {
return code;
}
public String getDes() {
return des;
}
}
}
package com.wwdz.ch.core.entity.wxPay;
import com.xxdxxs.entity.Entity;
import lombok.Data;
@Data
public class DistributionOrderRefundRequestDto implements Entity {
/**
* 分销订单号
*/
private String distributionOrderId;
/**
* 系统退款单号
*/
private String refundId;
/**
* 订单金额
*/
private Long amount;
/**
* 分销订单状态
*/
private Integer state;
/**
* 微信支付订单号
*/
private String paymentId;
/**
* 预支付单号
*/
private String prepayId;
/**
* 要退款的金额
*/
private Long refundPrice;
/**
* 退款接口请求秘钥
*/
private String secret;
}
......@@ -47,6 +47,7 @@ dts:
merchantSerialNumber: 41168B86EDCC260B11D2B0DDE8684DF148FB16F2
apiV3Key: 7e9504fd8a5c458ab7466b8aaae462a9
payNotifyUrl: https://cjxc-applet-dev.wanwudezhi.com/wxPayCallback/getPayNotify
refundNotifyUrl: https://cjxc-applet-dev.wanwudezhi.com/wxPayCallback/getRefundNotify
privateKeyPath: apiclient_key.pem
p12KeyPath: apiclient_cert.p12
tradeType: JSAPI
......
......@@ -38,6 +38,7 @@ dts:
merchantSerialNumber: 41168B86EDCC260B11D2B0DDE8684DF148FB16F2
apiV3Key: 7e9504fd8a5c458ab7466b8aaae462a9
payNotifyUrl: https://cjxc-applet.wanwudezhi.com/wxPayCallback/getPayNotify
refundNotifyUrl: https://cjxc-applet.wanwudezhi.com/wxPayCallback/getRefundNotify
privateKeyPath: apiclient_key.pem
p12KeyPath: apiclient_cert.p12
tradeType: JSAPI
......
package com.wwdz.ch.db.dao.distribution;
import com.wwdz.ch.db.domain.distribution.RefundOrder;
public interface RefundOrderDao {
/**
* 插入新记录
*
* @param refundOrder
* @return
*/
int insert(RefundOrder refundOrder);
/**
* 更新记录
*
* @param refundOrder
* @return
*/
int update(RefundOrder refundOrder);
}
package com.wwdz.ch.db.domain.distribution;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import com.xxdxxs.entity.Entity;
import lombok.Data;
/**
* @author shiyu
* @date 2024/02/26
*/
@Data
public class RefundOrder implements Entity {
private Integer id;
/**
* 系统退款单号
*/
private String refundId;
/**
* 微信退款单号
*/
private String wxRefundId;
/**
* 分销订单号
*/
private String distributionOrderId;
/**
* 分销商id
*/
private Long distributorId;
/**
* 订单金额
*/
private Long amount;
/**
* 退款金额
*/
private Long refundAmount;
/**
* 用户收款账户
*/
private String userReceivedAccount;
/**
* 创建时间
*/
private Date createTime;
/**
* 更新时间
*/
private Date updateTime;
/**
* 状态
*/
private Integer state;
/**
* 退款成功时间
*/
private Date successTime;
private static final long serialVersionUID = 1L;
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", refundId=").append(refundId);
sb.append(", wxRefundId=").append(wxRefundId);
sb.append(", distributionOrderId=").append(distributionOrderId);
sb.append(", distributorId=").append(distributorId);
sb.append(", amount=").append(amount);
sb.append(", refundAmount=").append(refundAmount);
sb.append(", userReceivedAccount=").append(userReceivedAccount);
sb.append(", createTime=").append(createTime);
sb.append(", updateTime=").append(updateTime);
sb.append(", state=").append(state);
sb.append(", successTime=").append(successTime);
sb.append(", serialVersionUID=").append(serialVersionUID);
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.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getRefundId() == null ? other.getRefundId() == null : this.getRefundId().equals(other.getRefundId()))
&& (this.getWxRefundId() == null ? other.getWxRefundId() == null : this.getWxRefundId().equals(other.getWxRefundId()))
&& (this.getDistributionOrderId() == null ? other.getDistributionOrderId() == null : this.getDistributionOrderId().equals(other.getDistributionOrderId()))
&& (this.getDistributorId() == null ? other.getDistributorId() == null : this.getDistributorId().equals(other.getDistributorId()))
&& (this.getAmount() == null ? other.getAmount() == null : this.getAmount().equals(other.getAmount()))
&& (this.getRefundAmount() == null ? other.getRefundAmount() == null : this.getRefundAmount().equals(other.getRefundAmount()))
&& (this.getUserReceivedAccount() == null ? other.getUserReceivedAccount() == null : this.getUserReceivedAccount().equals(other.getUserReceivedAccount()))
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
&& (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
&& (this.getState() == null ? other.getState() == null : this.getState().equals(other.getState()))
&& (this.getSuccessTime() == null ? other.getSuccessTime() == null : this.getSuccessTime().equals(other.getSuccessTime()));
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
result = prime * result + ((getRefundId() == null) ? 0 : getRefundId().hashCode());
result = prime * result + ((getWxRefundId() == null) ? 0 : getWxRefundId().hashCode());
result = prime * result + ((getDistributionOrderId() == null) ? 0 : getDistributionOrderId().hashCode());
result = prime * result + ((getDistributorId() == null) ? 0 : getDistributorId().hashCode());
result = prime * result + ((getAmount() == null) ? 0 : getAmount().hashCode());
result = prime * result + ((getRefundAmount() == null) ? 0 : getRefundAmount().hashCode());
result = prime * result + ((getUserReceivedAccount() == null) ? 0 : getUserReceivedAccount().hashCode());
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
result = prime * result + ((getState() == null) ? 0 : getState().hashCode());
result = prime * result + ((getSuccessTime() == null) ? 0 : getSuccessTime().hashCode());
return result;
}
/**
* This enum was generated by MyBatis Generator.
* This enum corresponds to the database table refund_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public enum Column {
id("id", "id", "INTEGER", false),
refundId("refund_id", "refundId", "VARCHAR", false),
wxRefundId("wx_refund_id", "wxRefundId", "VARCHAR", false),
distributionOrderId("distribution_order_id", "distributionOrderId", "VARCHAR", false),
distributorId("distributor_id", "distributorId", "BIGINT", false),
amount("amount", "amount", "BIGINT", false),
refundAmount("refund_amount", "refundAmount", "BIGINT", false),
userReceivedAccount("user_received_account", "userReceivedAccount", "VARCHAR", false),
createTime("create_time", "createTime", "TIMESTAMP", false),
updateTime("update_time", "updateTime", "TIMESTAMP", false),
state("state", "state", "INTEGER", true),
successTime("success_time", "successTime", "TIMESTAMP", false);
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table refund_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private static final String BEGINNING_DELIMITER = "`";
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table refund_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private static final String ENDING_DELIMITER = "`";
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table refund_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private final String column;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table refund_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private final boolean isColumnNameDelimited;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table refund_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private final String javaProperty;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table refund_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private final String jdbcType;
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table refund_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public String value() {
return this.column;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table refund_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public String getValue() {
return this.column;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table refund_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public String getJavaProperty() {
return this.javaProperty;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table refund_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public String getJdbcType() {
return this.jdbcType;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table refund_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) {
this.column = column;
this.javaProperty = javaProperty;
this.jdbcType = jdbcType;
this.isColumnNameDelimited = isColumnNameDelimited;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table refund_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public String desc() {
return this.getEscapedColumnName() + " DESC";
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table refund_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public String asc() {
return this.getEscapedColumnName() + " ASC";
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table refund_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public static Column[] excludes(Column ... excludes) {
ArrayList<Column> columns = new ArrayList<>(Arrays.asList(Column.values()));
if (excludes != null && excludes.length > 0) {
columns.removeAll(new ArrayList<>(Arrays.asList(excludes)));
}
return columns.toArray(new Column[]{});
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table refund_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public String getEscapedColumnName() {
if (this.isColumnNameDelimited) {
return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString();
} else {
return this.column;
}
}
}
}
\ No newline at end of file
package com.wwdz.ch.db.domain.distribution;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class RefundOrderExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public RefundOrderExample() {
oredCriteria = new ArrayList<Criteria>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table refund_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public RefundOrderExample orderBy(String orderByClause) {
this.setOrderByClause(orderByClause);
return this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table refund_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public RefundOrderExample orderBy(String ... orderByClauses) {
StringBuffer sb = new StringBuffer();
for (int i = 0; i < orderByClauses.length; i++) {
sb.append(orderByClauses[i]);
if (i < orderByClauses.length - 1) {
sb.append(" , ");
}
}
this.setOrderByClause(sb.toString());
return this;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria(this);
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table refund_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public static Criteria newAndCreateCriteria() {
RefundOrderExample example = new RefundOrderExample();
return example.createCriteria();
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andIdIsNull() {
addCriterion("id is null");
return (Criteria) this;
}
public Criteria andIdIsNotNull() {
addCriterion("id is not null");
return (Criteria) this;
}
public Criteria andIdEqualTo(Integer value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table refund_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIdEqualToColumn(RefundOrder.Column column) {
addCriterion(new StringBuilder("id = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andIdNotEqualTo(Integer value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table refund_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIdNotEqualToColumn(RefundOrder.Column column) {
addCriterion(new StringBuilder("id <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andIdGreaterThan(Integer value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table refund_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIdGreaterThanColumn(RefundOrder.Column column) {
addCriterion(new StringBuilder("id > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(Integer value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table refund_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIdGreaterThanOrEqualToColumn(RefundOrder.Column column) {
addCriterion(new StringBuilder("id >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andIdLessThan(Integer value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table refund_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIdLessThanColumn(RefundOrder.Column column) {
addCriterion(new StringBuilder("id < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(Integer value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table refund_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIdLessThanOrEqualToColumn(RefundOrder.Column column) {
addCriterion(new StringBuilder("id <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andIdIn(List<Integer> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<Integer> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(Integer value1, Integer value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(Integer value1, Integer value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andRefundIdIsNull() {
addCriterion("refund_id is null");
return (Criteria) this;
}
public Criteria andRefundIdIsNotNull() {
addCriterion("refund_id is not null");
return (Criteria) this;
}
public Criteria andRefundIdEqualTo(String value) {
addCriterion("refund_id =", value, "refundId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table refund_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andRefundIdEqualToColumn(RefundOrder.Column column) {
addCriterion(new StringBuilder("refund_id = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andRefundIdNotEqualTo(String value) {
addCriterion("refund_id <>", value, "refundId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table refund_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andRefundIdNotEqualToColumn(RefundOrder.Column column) {
addCriterion(new StringBuilder("refund_id <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andRefundIdGreaterThan(String value) {
addCriterion("refund_id >", value, "refundId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table refund_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andRefundIdGreaterThanColumn(RefundOrder.Column column) {
addCriterion(new StringBuilder("refund_id > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andRefundIdGreaterThanOrEqualTo(String value) {
addCriterion("refund_id >=", value, "refundId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table refund_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andRefundIdGreaterThanOrEqualToColumn(RefundOrder.Column column) {
addCriterion(new StringBuilder("refund_id >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andRefundIdLessThan(String value) {
addCriterion("refund_id <", value, "refundId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table refund_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andRefundIdLessThanColumn(RefundOrder.Column column) {
addCriterion(new StringBuilder("refund_id < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andRefundIdLessThanOrEqualTo(String value) {
addCriterion("refund_id <=", value, "refundId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table refund_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andRefundIdLessThanOrEqualToColumn(RefundOrder.Column column) {
addCriterion(new StringBuilder("refund_id <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andRefundIdLike(String value) {
addCriterion("refund_id like", value, "refundId");
return (Criteria) this;
}
public Criteria andRefundIdNotLike(String value) {
addCriterion("refund_id not like", value, "refundId");
return (Criteria) this;
}
public Criteria andRefundIdIn(List<String> values) {
addCriterion("refund_id in", values, "refundId");
return (Criteria) this;
}
public Criteria andRefundIdNotIn(List<String> values) {
addCriterion("refund_id not in", values, "refundId");
return (Criteria) this;
}
public Criteria andRefundIdBetween(String value1, String value2) {
addCriterion("refund_id between", value1, value2, "refundId");
return (Criteria) this;
}
public Criteria andRefundIdNotBetween(String value1, String value2) {
addCriterion("refund_id not between", value1, value2, "refundId");
return (Criteria) this;
}
public Criteria andWxRefundIdIsNull() {
addCriterion("wx_refund_id is null");
return (Criteria) this;
}
public Criteria andWxRefundIdIsNotNull() {
addCriterion("wx_refund_id is not null");
return (Criteria) this;
}
public Criteria andWxRefundIdEqualTo(String value) {
addCriterion("wx_refund_id =", value, "wxRefundId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table refund_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andWxRefundIdEqualToColumn(RefundOrder.Column column) {
addCriterion(new StringBuilder("wx_refund_id = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andWxRefundIdNotEqualTo(String value) {
addCriterion("wx_refund_id <>", value, "wxRefundId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table refund_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andWxRefundIdNotEqualToColumn(RefundOrder.Column column) {
addCriterion(new StringBuilder("wx_refund_id <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andWxRefundIdGreaterThan(String value) {
addCriterion("wx_refund_id >", value, "wxRefundId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table refund_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andWxRefundIdGreaterThanColumn(RefundOrder.Column column) {
addCriterion(new StringBuilder("wx_refund_id > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andWxRefundIdGreaterThanOrEqualTo(String value) {
addCriterion("wx_refund_id >=", value, "wxRefundId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table refund_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andWxRefundIdGreaterThanOrEqualToColumn(RefundOrder.Column column) {
addCriterion(new StringBuilder("wx_refund_id >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andWxRefundIdLessThan(String value) {
addCriterion("wx_refund_id <", value, "wxRefundId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table refund_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andWxRefundIdLessThanColumn(RefundOrder.Column column) {
addCriterion(new StringBuilder("wx_refund_id < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andWxRefundIdLessThanOrEqualTo(String value) {
addCriterion("wx_refund_id <=", value, "wxRefundId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table refund_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andWxRefundIdLessThanOrEqualToColumn(RefundOrder.Column column) {
addCriterion(new StringBuilder("wx_refund_id <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andWxRefundIdLike(String value) {
addCriterion("wx_refund_id like", value, "wxRefundId");
return (Criteria) this;
}
public Criteria andWxRefundIdNotLike(String value) {
addCriterion("wx_refund_id not like", value, "wxRefundId");
return (Criteria) this;
}
public Criteria andWxRefundIdIn(List<String> values) {
addCriterion("wx_refund_id in", values, "wxRefundId");
return (Criteria) this;
}
public Criteria andWxRefundIdNotIn(List<String> values) {
addCriterion("wx_refund_id not in", values, "wxRefundId");
return (Criteria) this;
}
public Criteria andWxRefundIdBetween(String value1, String value2) {
addCriterion("wx_refund_id between", value1, value2, "wxRefundId");
return (Criteria) this;
}
public Criteria andWxRefundIdNotBetween(String value1, String value2) {
addCriterion("wx_refund_id not between", value1, value2, "wxRefundId");
return (Criteria) this;
}
public Criteria andDistributionOrderIdIsNull() {
addCriterion("distribution_order_id is null");
return (Criteria) this;
}
public Criteria andDistributionOrderIdIsNotNull() {
addCriterion("distribution_order_id is not null");
return (Criteria) this;
}
public Criteria andDistributionOrderIdEqualTo(String value) {
addCriterion("distribution_order_id =", value, "distributionOrderId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table refund_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andDistributionOrderIdEqualToColumn(RefundOrder.Column column) {
addCriterion(new StringBuilder("distribution_order_id = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andDistributionOrderIdNotEqualTo(String value) {
addCriterion("distribution_order_id <>", value, "distributionOrderId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table refund_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andDistributionOrderIdNotEqualToColumn(RefundOrder.Column column) {
addCriterion(new StringBuilder("distribution_order_id <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andDistributionOrderIdGreaterThan(String value) {
addCriterion("distribution_order_id >", value, "distributionOrderId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table refund_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andDistributionOrderIdGreaterThanColumn(RefundOrder.Column column) {
addCriterion(new StringBuilder("distribution_order_id > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andDistributionOrderIdGreaterThanOrEqualTo(String value) {
addCriterion("distribution_order_id >=", value, "distributionOrderId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table refund_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andDistributionOrderIdGreaterThanOrEqualToColumn(RefundOrder.Column column) {
addCriterion(new StringBuilder("distribution_order_id >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andDistributionOrderIdLessThan(String value) {
addCriterion("distribution_order_id <", value, "distributionOrderId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table refund_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andDistributionOrderIdLessThanColumn(RefundOrder.Column column) {
addCriterion(new StringBuilder("distribution_order_id < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andDistributionOrderIdLessThanOrEqualTo(String value) {
addCriterion("distribution_order_id <=", value, "distributionOrderId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table refund_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andDistributionOrderIdLessThanOrEqualToColumn(RefundOrder.Column column) {
addCriterion(new StringBuilder("distribution_order_id <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andDistributionOrderIdLike(String value) {
addCriterion("distribution_order_id like", value, "distributionOrderId");
return (Criteria) this;
}
public Criteria andDistributionOrderIdNotLike(String value) {
addCriterion("distribution_order_id not like", value, "distributionOrderId");
return (Criteria) this;
}
public Criteria andDistributionOrderIdIn(List<String> values) {
addCriterion("distribution_order_id in", values, "distributionOrderId");
return (Criteria) this;
}
public Criteria andDistributionOrderIdNotIn(List<String> values) {
addCriterion("distribution_order_id not in", values, "distributionOrderId");
return (Criteria) this;
}
public Criteria andDistributionOrderIdBetween(String value1, String value2) {
addCriterion("distribution_order_id between", value1, value2, "distributionOrderId");
return (Criteria) this;
}
public Criteria andDistributionOrderIdNotBetween(String value1, String value2) {
addCriterion("distribution_order_id not between", value1, value2, "distributionOrderId");
return (Criteria) this;
}
public Criteria andDistributorIdIsNull() {
addCriterion("distributor_id is null");
return (Criteria) this;
}
public Criteria andDistributorIdIsNotNull() {
addCriterion("distributor_id is not null");
return (Criteria) this;
}
public Criteria andDistributorIdEqualTo(Long value) {
addCriterion("distributor_id =", value, "distributorId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table refund_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andDistributorIdEqualToColumn(RefundOrder.Column column) {
addCriterion(new StringBuilder("distributor_id = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andDistributorIdNotEqualTo(Long value) {
addCriterion("distributor_id <>", value, "distributorId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table refund_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andDistributorIdNotEqualToColumn(RefundOrder.Column column) {
addCriterion(new StringBuilder("distributor_id <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andDistributorIdGreaterThan(Long value) {
addCriterion("distributor_id >", value, "distributorId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table refund_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andDistributorIdGreaterThanColumn(RefundOrder.Column column) {
addCriterion(new StringBuilder("distributor_id > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andDistributorIdGreaterThanOrEqualTo(Long value) {
addCriterion("distributor_id >=", value, "distributorId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table refund_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andDistributorIdGreaterThanOrEqualToColumn(RefundOrder.Column column) {
addCriterion(new StringBuilder("distributor_id >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andDistributorIdLessThan(Long value) {
addCriterion("distributor_id <", value, "distributorId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table refund_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andDistributorIdLessThanColumn(RefundOrder.Column column) {
addCriterion(new StringBuilder("distributor_id < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andDistributorIdLessThanOrEqualTo(Long value) {
addCriterion("distributor_id <=", value, "distributorId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table refund_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andDistributorIdLessThanOrEqualToColumn(RefundOrder.Column column) {
addCriterion(new StringBuilder("distributor_id <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andDistributorIdIn(List<Long> values) {
addCriterion("distributor_id in", values, "distributorId");
return (Criteria) this;
}
public Criteria andDistributorIdNotIn(List<Long> values) {
addCriterion("distributor_id not in", values, "distributorId");
return (Criteria) this;
}
public Criteria andDistributorIdBetween(Long value1, Long value2) {
addCriterion("distributor_id between", value1, value2, "distributorId");
return (Criteria) this;
}
public Criteria andDistributorIdNotBetween(Long value1, Long value2) {
addCriterion("distributor_id not between", value1, value2, "distributorId");
return (Criteria) this;
}
public Criteria andAmountIsNull() {
addCriterion("amount is null");
return (Criteria) this;
}
public Criteria andAmountIsNotNull() {
addCriterion("amount is not null");
return (Criteria) this;
}
public Criteria andAmountEqualTo(Long value) {
addCriterion("amount =", value, "amount");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table refund_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andAmountEqualToColumn(RefundOrder.Column column) {
addCriterion(new StringBuilder("amount = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andAmountNotEqualTo(Long value) {
addCriterion("amount <>", value, "amount");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table refund_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andAmountNotEqualToColumn(RefundOrder.Column column) {
addCriterion(new StringBuilder("amount <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andAmountGreaterThan(Long value) {
addCriterion("amount >", value, "amount");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table refund_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andAmountGreaterThanColumn(RefundOrder.Column column) {
addCriterion(new StringBuilder("amount > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andAmountGreaterThanOrEqualTo(Long value) {
addCriterion("amount >=", value, "amount");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table refund_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andAmountGreaterThanOrEqualToColumn(RefundOrder.Column column) {
addCriterion(new StringBuilder("amount >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andAmountLessThan(Long value) {
addCriterion("amount <", value, "amount");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table refund_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andAmountLessThanColumn(RefundOrder.Column column) {
addCriterion(new StringBuilder("amount < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andAmountLessThanOrEqualTo(Long value) {
addCriterion("amount <=", value, "amount");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table refund_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andAmountLessThanOrEqualToColumn(RefundOrder.Column column) {
addCriterion(new StringBuilder("amount <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andAmountIn(List<Long> values) {
addCriterion("amount in", values, "amount");
return (Criteria) this;
}
public Criteria andAmountNotIn(List<Long> values) {
addCriterion("amount not in", values, "amount");
return (Criteria) this;
}
public Criteria andAmountBetween(Long value1, Long value2) {
addCriterion("amount between", value1, value2, "amount");
return (Criteria) this;
}
public Criteria andAmountNotBetween(Long value1, Long value2) {
addCriterion("amount not between", value1, value2, "amount");
return (Criteria) this;
}
public Criteria andRefundAmountIsNull() {
addCriterion("refund_amount is null");
return (Criteria) this;
}
public Criteria andRefundAmountIsNotNull() {
addCriterion("refund_amount is not null");
return (Criteria) this;
}
public Criteria andRefundAmountEqualTo(Long value) {
addCriterion("refund_amount =", value, "refundAmount");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table refund_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andRefundAmountEqualToColumn(RefundOrder.Column column) {
addCriterion(new StringBuilder("refund_amount = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andRefundAmountNotEqualTo(Long value) {
addCriterion("refund_amount <>", value, "refundAmount");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table refund_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andRefundAmountNotEqualToColumn(RefundOrder.Column column) {
addCriterion(new StringBuilder("refund_amount <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andRefundAmountGreaterThan(Long value) {
addCriterion("refund_amount >", value, "refundAmount");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table refund_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andRefundAmountGreaterThanColumn(RefundOrder.Column column) {
addCriterion(new StringBuilder("refund_amount > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andRefundAmountGreaterThanOrEqualTo(Long value) {
addCriterion("refund_amount >=", value, "refundAmount");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table refund_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andRefundAmountGreaterThanOrEqualToColumn(RefundOrder.Column column) {
addCriterion(new StringBuilder("refund_amount >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andRefundAmountLessThan(Long value) {
addCriterion("refund_amount <", value, "refundAmount");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table refund_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andRefundAmountLessThanColumn(RefundOrder.Column column) {
addCriterion(new StringBuilder("refund_amount < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andRefundAmountLessThanOrEqualTo(Long value) {
addCriterion("refund_amount <=", value, "refundAmount");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table refund_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andRefundAmountLessThanOrEqualToColumn(RefundOrder.Column column) {
addCriterion(new StringBuilder("refund_amount <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andRefundAmountIn(List<Long> values) {
addCriterion("refund_amount in", values, "refundAmount");
return (Criteria) this;
}
public Criteria andRefundAmountNotIn(List<Long> values) {
addCriterion("refund_amount not in", values, "refundAmount");
return (Criteria) this;
}
public Criteria andRefundAmountBetween(Long value1, Long value2) {
addCriterion("refund_amount between", value1, value2, "refundAmount");
return (Criteria) this;
}
public Criteria andRefundAmountNotBetween(Long value1, Long value2) {
addCriterion("refund_amount not between", value1, value2, "refundAmount");
return (Criteria) this;
}
public Criteria andUserReceivedAccountIsNull() {
addCriterion("user_received_account is null");
return (Criteria) this;
}
public Criteria andUserReceivedAccountIsNotNull() {
addCriterion("user_received_account is not null");
return (Criteria) this;
}
public Criteria andUserReceivedAccountEqualTo(String value) {
addCriterion("user_received_account =", value, "userReceivedAccount");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table refund_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUserReceivedAccountEqualToColumn(RefundOrder.Column column) {
addCriterion(new StringBuilder("user_received_account = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andUserReceivedAccountNotEqualTo(String value) {
addCriterion("user_received_account <>", value, "userReceivedAccount");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table refund_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUserReceivedAccountNotEqualToColumn(RefundOrder.Column column) {
addCriterion(new StringBuilder("user_received_account <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andUserReceivedAccountGreaterThan(String value) {
addCriterion("user_received_account >", value, "userReceivedAccount");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table refund_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUserReceivedAccountGreaterThanColumn(RefundOrder.Column column) {
addCriterion(new StringBuilder("user_received_account > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andUserReceivedAccountGreaterThanOrEqualTo(String value) {
addCriterion("user_received_account >=", value, "userReceivedAccount");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table refund_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUserReceivedAccountGreaterThanOrEqualToColumn(RefundOrder.Column column) {
addCriterion(new StringBuilder("user_received_account >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andUserReceivedAccountLessThan(String value) {
addCriterion("user_received_account <", value, "userReceivedAccount");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table refund_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUserReceivedAccountLessThanColumn(RefundOrder.Column column) {
addCriterion(new StringBuilder("user_received_account < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andUserReceivedAccountLessThanOrEqualTo(String value) {
addCriterion("user_received_account <=", value, "userReceivedAccount");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table refund_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUserReceivedAccountLessThanOrEqualToColumn(RefundOrder.Column column) {
addCriterion(new StringBuilder("user_received_account <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andUserReceivedAccountLike(String value) {
addCriterion("user_received_account like", value, "userReceivedAccount");
return (Criteria) this;
}
public Criteria andUserReceivedAccountNotLike(String value) {
addCriterion("user_received_account not like", value, "userReceivedAccount");
return (Criteria) this;
}
public Criteria andUserReceivedAccountIn(List<String> values) {
addCriterion("user_received_account in", values, "userReceivedAccount");
return (Criteria) this;
}
public Criteria andUserReceivedAccountNotIn(List<String> values) {
addCriterion("user_received_account not in", values, "userReceivedAccount");
return (Criteria) this;
}
public Criteria andUserReceivedAccountBetween(String value1, String value2) {
addCriterion("user_received_account between", value1, value2, "userReceivedAccount");
return (Criteria) this;
}
public Criteria andUserReceivedAccountNotBetween(String value1, String value2) {
addCriterion("user_received_account not between", value1, value2, "userReceivedAccount");
return (Criteria) this;
}
public Criteria andCreateTimeIsNull() {
addCriterion("create_time is null");
return (Criteria) this;
}
public Criteria andCreateTimeIsNotNull() {
addCriterion("create_time is not null");
return (Criteria) this;
}
public Criteria andCreateTimeEqualTo(Date value) {
addCriterion("create_time =", value, "createTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table refund_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andCreateTimeEqualToColumn(RefundOrder.Column column) {
addCriterion(new StringBuilder("create_time = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andCreateTimeNotEqualTo(Date value) {
addCriterion("create_time <>", value, "createTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table refund_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andCreateTimeNotEqualToColumn(RefundOrder.Column column) {
addCriterion(new StringBuilder("create_time <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andCreateTimeGreaterThan(Date value) {
addCriterion("create_time >", value, "createTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table refund_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andCreateTimeGreaterThanColumn(RefundOrder.Column column) {
addCriterion(new StringBuilder("create_time > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) {
addCriterion("create_time >=", value, "createTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table refund_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andCreateTimeGreaterThanOrEqualToColumn(RefundOrder.Column column) {
addCriterion(new StringBuilder("create_time >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andCreateTimeLessThan(Date value) {
addCriterion("create_time <", value, "createTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table refund_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andCreateTimeLessThanColumn(RefundOrder.Column column) {
addCriterion(new StringBuilder("create_time < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andCreateTimeLessThanOrEqualTo(Date value) {
addCriterion("create_time <=", value, "createTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table refund_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andCreateTimeLessThanOrEqualToColumn(RefundOrder.Column column) {
addCriterion(new StringBuilder("create_time <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andCreateTimeIn(List<Date> values) {
addCriterion("create_time in", values, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotIn(List<Date> values) {
addCriterion("create_time not in", values, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeBetween(Date value1, Date value2) {
addCriterion("create_time between", value1, value2, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotBetween(Date value1, Date value2) {
addCriterion("create_time not between", value1, value2, "createTime");
return (Criteria) this;
}
public Criteria andUpdateTimeIsNull() {
addCriterion("update_time is null");
return (Criteria) this;
}
public Criteria andUpdateTimeIsNotNull() {
addCriterion("update_time is not null");
return (Criteria) this;
}
public Criteria andUpdateTimeEqualTo(Date value) {
addCriterion("update_time =", value, "updateTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table refund_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUpdateTimeEqualToColumn(RefundOrder.Column column) {
addCriterion(new StringBuilder("update_time = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andUpdateTimeNotEqualTo(Date value) {
addCriterion("update_time <>", value, "updateTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table refund_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUpdateTimeNotEqualToColumn(RefundOrder.Column column) {
addCriterion(new StringBuilder("update_time <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andUpdateTimeGreaterThan(Date value) {
addCriterion("update_time >", value, "updateTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table refund_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUpdateTimeGreaterThanColumn(RefundOrder.Column column) {
addCriterion(new StringBuilder("update_time > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andUpdateTimeGreaterThanOrEqualTo(Date value) {
addCriterion("update_time >=", value, "updateTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table refund_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUpdateTimeGreaterThanOrEqualToColumn(RefundOrder.Column column) {
addCriterion(new StringBuilder("update_time >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andUpdateTimeLessThan(Date value) {
addCriterion("update_time <", value, "updateTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table refund_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUpdateTimeLessThanColumn(RefundOrder.Column column) {
addCriterion(new StringBuilder("update_time < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andUpdateTimeLessThanOrEqualTo(Date value) {
addCriterion("update_time <=", value, "updateTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table refund_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUpdateTimeLessThanOrEqualToColumn(RefundOrder.Column column) {
addCriterion(new StringBuilder("update_time <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andUpdateTimeIn(List<Date> values) {
addCriterion("update_time in", values, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeNotIn(List<Date> values) {
addCriterion("update_time not in", values, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeBetween(Date value1, Date value2) {
addCriterion("update_time between", value1, value2, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeNotBetween(Date value1, Date value2) {
addCriterion("update_time not between", value1, value2, "updateTime");
return (Criteria) this;
}
public Criteria andStateIsNull() {
addCriterion("`state` is null");
return (Criteria) this;
}
public Criteria andStateIsNotNull() {
addCriterion("`state` is not null");
return (Criteria) this;
}
public Criteria andStateEqualTo(Integer value) {
addCriterion("`state` =", value, "state");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table refund_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andStateEqualToColumn(RefundOrder.Column column) {
addCriterion(new StringBuilder("`state` = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andStateNotEqualTo(Integer value) {
addCriterion("`state` <>", value, "state");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table refund_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andStateNotEqualToColumn(RefundOrder.Column column) {
addCriterion(new StringBuilder("`state` <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andStateGreaterThan(Integer value) {
addCriterion("`state` >", value, "state");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table refund_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andStateGreaterThanColumn(RefundOrder.Column column) {
addCriterion(new StringBuilder("`state` > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andStateGreaterThanOrEqualTo(Integer value) {
addCriterion("`state` >=", value, "state");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table refund_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andStateGreaterThanOrEqualToColumn(RefundOrder.Column column) {
addCriterion(new StringBuilder("`state` >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andStateLessThan(Integer value) {
addCriterion("`state` <", value, "state");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table refund_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andStateLessThanColumn(RefundOrder.Column column) {
addCriterion(new StringBuilder("`state` < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andStateLessThanOrEqualTo(Integer value) {
addCriterion("`state` <=", value, "state");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table refund_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andStateLessThanOrEqualToColumn(RefundOrder.Column column) {
addCriterion(new StringBuilder("`state` <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andStateIn(List<Integer> values) {
addCriterion("`state` in", values, "state");
return (Criteria) this;
}
public Criteria andStateNotIn(List<Integer> values) {
addCriterion("`state` not in", values, "state");
return (Criteria) this;
}
public Criteria andStateBetween(Integer value1, Integer value2) {
addCriterion("`state` between", value1, value2, "state");
return (Criteria) this;
}
public Criteria andStateNotBetween(Integer value1, Integer value2) {
addCriterion("`state` not between", value1, value2, "state");
return (Criteria) this;
}
public Criteria andSuccessTimeIsNull() {
addCriterion("success_time is null");
return (Criteria) this;
}
public Criteria andSuccessTimeIsNotNull() {
addCriterion("success_time is not null");
return (Criteria) this;
}
public Criteria andSuccessTimeEqualTo(Date value) {
addCriterion("success_time =", value, "successTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table refund_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andSuccessTimeEqualToColumn(RefundOrder.Column column) {
addCriterion(new StringBuilder("success_time = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andSuccessTimeNotEqualTo(Date value) {
addCriterion("success_time <>", value, "successTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table refund_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andSuccessTimeNotEqualToColumn(RefundOrder.Column column) {
addCriterion(new StringBuilder("success_time <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andSuccessTimeGreaterThan(Date value) {
addCriterion("success_time >", value, "successTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table refund_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andSuccessTimeGreaterThanColumn(RefundOrder.Column column) {
addCriterion(new StringBuilder("success_time > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andSuccessTimeGreaterThanOrEqualTo(Date value) {
addCriterion("success_time >=", value, "successTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table refund_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andSuccessTimeGreaterThanOrEqualToColumn(RefundOrder.Column column) {
addCriterion(new StringBuilder("success_time >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andSuccessTimeLessThan(Date value) {
addCriterion("success_time <", value, "successTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table refund_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andSuccessTimeLessThanColumn(RefundOrder.Column column) {
addCriterion(new StringBuilder("success_time < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andSuccessTimeLessThanOrEqualTo(Date value) {
addCriterion("success_time <=", value, "successTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table refund_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andSuccessTimeLessThanOrEqualToColumn(RefundOrder.Column column) {
addCriterion(new StringBuilder("success_time <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andSuccessTimeIn(List<Date> values) {
addCriterion("success_time in", values, "successTime");
return (Criteria) this;
}
public Criteria andSuccessTimeNotIn(List<Date> values) {
addCriterion("success_time not in", values, "successTime");
return (Criteria) this;
}
public Criteria andSuccessTimeBetween(Date value1, Date value2) {
addCriterion("success_time between", value1, value2, "successTime");
return (Criteria) this;
}
public Criteria andSuccessTimeNotBetween(Date value1, Date value2) {
addCriterion("success_time not between", value1, value2, "successTime");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table refund_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private RefundOrderExample example;
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table refund_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
protected Criteria(RefundOrderExample example) {
super();
this.example = example;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table refund_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public RefundOrderExample example() {
return this.example;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table refund_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIf(boolean ifAdd, ICriteriaAdd add) {
if (ifAdd) {
add.add(this);
}
return this;
}
/**
* This interface was generated by MyBatis Generator.
* This interface corresponds to the database table refund_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public interface ICriteriaAdd {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table refund_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
Criteria add(Criteria add);
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
}
\ No newline at end of file
......@@ -127,4 +127,9 @@ public class DistributionOrderRequestDto extends BaseRequestDto implements Entit
* 要退款的金额
*/
private String refundPrice;
/**
* 退款接口请求秘钥
*/
private String secret;
}
package com.wwdz.ch.db.impl.distribution;
import com.wwdz.ch.db.dao.distribution.RefundOrderDao;
import com.wwdz.ch.db.domain.distribution.RefundOrder;
import com.wwdz.ch.db.domain.distribution.RefundOrderExample;
import com.wwdz.ch.db.mapper.distribution.RefundOrderMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
@Repository
public class RefundOrderDaoImpl implements RefundOrderDao {
@Autowired
RefundOrderMapper refundOrderMapper;
@Override
public int insert(RefundOrder refundOrder) {
return refundOrderMapper.insert(refundOrder);
}
@Override
public int update(RefundOrder refundOrder) {
RefundOrderExample example = new RefundOrderExample();
RefundOrderExample.Criteria criteria = example.createCriteria();
criteria.andRefundIdEqualTo(refundOrder.getRefundId());
return refundOrderMapper.updateByExampleSelective(refundOrder, example);
}
}
package com.wwdz.ch.db.mapper.distribution;
import com.wwdz.ch.db.domain.distribution.RefundOrder;
import com.wwdz.ch.db.domain.distribution.RefundOrderExample;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@Mapper
public interface RefundOrderMapper {
long countByExample(RefundOrderExample example);
int deleteByExample(RefundOrderExample example);
int deleteByPrimaryKey(Integer id);
int insert(RefundOrder record);
int insertSelective(RefundOrder record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table refund_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
RefundOrder selectOneByExample(RefundOrderExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table refund_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
RefundOrder selectOneByExampleSelective(@Param("example") RefundOrderExample example, @Param("selective") RefundOrder.Column ... selective);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table refund_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
List<RefundOrder> selectByExampleSelective(@Param("example") RefundOrderExample example, @Param("selective") RefundOrder.Column ... selective);
List<RefundOrder> selectByExample(RefundOrderExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table refund_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
RefundOrder selectByPrimaryKeySelective(@Param("id") Integer id, @Param("selective") RefundOrder.Column ... selective);
RefundOrder selectByPrimaryKey(Integer id);
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
<?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="com.wwdz.ch.db.mapper.distribution.RefundOrderMapper">
<resultMap id="BaseResultMap" type="com.wwdz.ch.db.domain.distribution.RefundOrder">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="refund_id" jdbcType="VARCHAR" property="refundId" />
<result column="wx_refund_id" jdbcType="VARCHAR" property="wxRefundId" />
<result column="distribution_order_id" jdbcType="VARCHAR" property="distributionOrderId" />
<result column="distributor_id" jdbcType="BIGINT" property="distributorId" />
<result column="amount" jdbcType="BIGINT" property="amount" />
<result column="refund_amount" jdbcType="BIGINT" property="refundAmount" />
<result column="user_received_account" jdbcType="VARCHAR" property="userReceivedAccount" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="state" jdbcType="INTEGER" property="state" />
<result column="success_time" jdbcType="TIMESTAMP" property="successTime" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<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 close=")" collection="criterion.value" item="listItem" open="(" 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="(" prefixOverrides="and" suffix=")">
<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 close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, refund_id, wx_refund_id, distribution_order_id, distributor_id, amount, refund_amount,
user_received_account, create_time, update_time, `state`, success_time
</sql>
<select id="selectByExample" parameterType="com.wwdz.ch.db.domain.distribution.RefundOrderExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
'true' as QUERYID,
<include refid="Base_Column_List" />
from refund_order
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByExampleSelective" parameterType="map" resultMap="BaseResultMap">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
@project https://github.com/itfsw/mybatis-generator-plugin
-->
select
'true' as QUERYID,
<if test="example.distinct">
distinct
</if>
<choose>
<when test="selective != null and selective.length &gt; 0">
<foreach collection="selective" item="column" separator=",">
${column.escapedColumnName}
</foreach>
</when>
<otherwise>
id, refund_id, wx_refund_id, distribution_order_id, distributor_id, amount, refund_amount,
user_received_account, create_time, update_time, `state`, success_time
</otherwise>
</choose>
from refund_order
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
<if test="example.orderByClause != null">
order by ${example.orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from refund_order
where id = #{id,jdbcType=INTEGER}
</select>
<select id="selectByPrimaryKeySelective" parameterType="map" resultMap="BaseResultMap">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
@project https://github.com/itfsw/mybatis-generator-plugin
-->
select
<choose>
<when test="selective != null and selective.length &gt; 0">
<foreach collection="selective" item="column" separator=",">
${column.escapedColumnName}
</foreach>
</when>
<otherwise>
id, refund_id, wx_refund_id, distribution_order_id, distributor_id, amount, refund_amount,
user_received_account, create_time, update_time, `state`, success_time
</otherwise>
</choose>
from refund_order
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from refund_order
where id = #{id,jdbcType=INTEGER}
</delete>
<delete id="deleteByExample" parameterType="com.wwdz.ch.db.domain.distribution.RefundOrderExample">
delete from refund_order
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.wwdz.ch.db.domain.distribution.RefundOrder">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
SELECT LAST_INSERT_ID()
</selectKey>
insert into refund_order (refund_id, wx_refund_id, distribution_order_id,
distributor_id, amount, refund_amount,
user_received_account, create_time, update_time,
`state`, success_time)
values (#{refundId,jdbcType=VARCHAR}, #{wxRefundId,jdbcType=VARCHAR}, #{distributionOrderId,jdbcType=VARCHAR},
#{distributorId,jdbcType=BIGINT}, #{amount,jdbcType=BIGINT}, #{refundAmount,jdbcType=BIGINT},
#{userReceivedAccount,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP},
#{state,jdbcType=INTEGER}, #{successTime,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" parameterType="com.wwdz.ch.db.domain.distribution.RefundOrder">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
SELECT LAST_INSERT_ID()
</selectKey>
insert into refund_order
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="refundId != null">
refund_id,
</if>
<if test="wxRefundId != null">
wx_refund_id,
</if>
<if test="distributionOrderId != null">
distribution_order_id,
</if>
<if test="distributorId != null">
distributor_id,
</if>
<if test="amount != null">
amount,
</if>
<if test="refundAmount != null">
refund_amount,
</if>
<if test="userReceivedAccount != null">
user_received_account,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="state != null">
`state`,
</if>
<if test="successTime != null">
success_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="refundId != null">
#{refundId,jdbcType=VARCHAR},
</if>
<if test="wxRefundId != null">
#{wxRefundId,jdbcType=VARCHAR},
</if>
<if test="distributionOrderId != null">
#{distributionOrderId,jdbcType=VARCHAR},
</if>
<if test="distributorId != null">
#{distributorId,jdbcType=BIGINT},
</if>
<if test="amount != null">
#{amount,jdbcType=BIGINT},
</if>
<if test="refundAmount != null">
#{refundAmount,jdbcType=BIGINT},
</if>
<if test="userReceivedAccount != null">
#{userReceivedAccount,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="state != null">
#{state,jdbcType=INTEGER},
</if>
<if test="successTime != null">
#{successTime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.wwdz.ch.db.domain.distribution.RefundOrderExample" resultType="java.lang.Long">
select count(*) from refund_order
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update refund_order
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=INTEGER},
</if>
<if test="record.refundId != null">
refund_id = #{record.refundId,jdbcType=VARCHAR},
</if>
<if test="record.wxRefundId != null">
wx_refund_id = #{record.wxRefundId,jdbcType=VARCHAR},
</if>
<if test="record.distributionOrderId != null">
distribution_order_id = #{record.distributionOrderId,jdbcType=VARCHAR},
</if>
<if test="record.distributorId != null">
distributor_id = #{record.distributorId,jdbcType=BIGINT},
</if>
<if test="record.amount != null">
amount = #{record.amount,jdbcType=BIGINT},
</if>
<if test="record.refundAmount != null">
refund_amount = #{record.refundAmount,jdbcType=BIGINT},
</if>
<if test="record.userReceivedAccount != null">
user_received_account = #{record.userReceivedAccount,jdbcType=VARCHAR},
</if>
<if test="record.createTime != null">
create_time = #{record.createTime,jdbcType=TIMESTAMP},
</if>
<if test="record.updateTime != null">
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
</if>
<if test="record.state != null">
`state` = #{record.state,jdbcType=INTEGER},
</if>
<if test="record.successTime != null">
success_time = #{record.successTime,jdbcType=TIMESTAMP},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update refund_order
set id = #{record.id,jdbcType=INTEGER},
refund_id = #{record.refundId,jdbcType=VARCHAR},
wx_refund_id = #{record.wxRefundId,jdbcType=VARCHAR},
distribution_order_id = #{record.distributionOrderId,jdbcType=VARCHAR},
distributor_id = #{record.distributorId,jdbcType=BIGINT},
amount = #{record.amount,jdbcType=BIGINT},
refund_amount = #{record.refundAmount,jdbcType=BIGINT},
user_received_account = #{record.userReceivedAccount,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
`state` = #{record.state,jdbcType=INTEGER},
success_time = #{record.successTime,jdbcType=TIMESTAMP}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.wwdz.ch.db.domain.distribution.RefundOrder">
update refund_order
<set>
<if test="refundId != null">
refund_id = #{refundId,jdbcType=VARCHAR},
</if>
<if test="wxRefundId != null">
wx_refund_id = #{wxRefundId,jdbcType=VARCHAR},
</if>
<if test="distributionOrderId != null">
distribution_order_id = #{distributionOrderId,jdbcType=VARCHAR},
</if>
<if test="distributorId != null">
distributor_id = #{distributorId,jdbcType=BIGINT},
</if>
<if test="amount != null">
amount = #{amount,jdbcType=BIGINT},
</if>
<if test="refundAmount != null">
refund_amount = #{refundAmount,jdbcType=BIGINT},
</if>
<if test="userReceivedAccount != null">
user_received_account = #{userReceivedAccount,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="state != null">
`state` = #{state,jdbcType=INTEGER},
</if>
<if test="successTime != null">
success_time = #{successTime,jdbcType=TIMESTAMP},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.wwdz.ch.db.domain.distribution.RefundOrder">
update refund_order
set refund_id = #{refundId,jdbcType=VARCHAR},
wx_refund_id = #{wxRefundId,jdbcType=VARCHAR},
distribution_order_id = #{distributionOrderId,jdbcType=VARCHAR},
distributor_id = #{distributorId,jdbcType=BIGINT},
amount = #{amount,jdbcType=BIGINT},
refund_amount = #{refundAmount,jdbcType=BIGINT},
user_received_account = #{userReceivedAccount,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
`state` = #{state,jdbcType=INTEGER},
success_time = #{successTime,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=INTEGER}
</update>
<select id="selectOneByExample" parameterType="com.wwdz.ch.db.domain.distribution.RefundOrderExample" resultMap="BaseResultMap">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
@project https://github.com/itfsw/mybatis-generator-plugin
-->
select
'true' as QUERYID,
<include refid="Base_Column_List" />
from refund_order
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
limit 1
</select>
<select id="selectOneByExampleSelective" parameterType="map" resultMap="BaseResultMap">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
@project https://github.com/itfsw/mybatis-generator-plugin
-->
select
'true' as QUERYID,
<choose>
<when test="selective != null and selective.length &gt; 0">
<foreach collection="selective" item="column" separator=",">
${column.escapedColumnName}
</foreach>
</when>
<otherwise>
id, refund_id, wx_refund_id, distribution_order_id, distributor_id, amount, refund_amount,
user_received_account, create_time, update_time, `state`, success_time
</otherwise>
</choose>
from refund_order
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
<if test="example.orderByClause != null">
order by ${example.orderByClause}
</if>
limit 1
</select>
</mapper>
\ No newline at end of file
......@@ -4,6 +4,7 @@ import com.wechat.pay.java.core.RSAAutoCertificateConfig;
import com.wechat.pay.java.core.notification.NotificationParser;
import com.wechat.pay.java.core.notification.RequestParam;
import com.wechat.pay.java.service.payments.model.Transaction;
import com.wechat.pay.java.service.refund.model.RefundNotification;
import com.wwdz.ch.core.api.OfficialAccountApi;
import com.wwdz.ch.core.api.wxpay.WxPayServiceApi;
import com.wwdz.ch.core.consts.DistributionEnum;
......@@ -11,14 +12,8 @@ import com.wwdz.ch.core.type.Result;
import com.wwdz.ch.core.util.PriceUtil;
import com.wwdz.ch.core.util.RedisUtils;
import com.wwdz.ch.core.util.TimeUtil;
import com.wwdz.ch.db.dao.distribution.DistributionOrderDao;
import com.wwdz.ch.db.dao.distribution.DistributorBindDao;
import com.wwdz.ch.db.dao.distribution.DistributorProfitDao;
import com.wwdz.ch.db.dao.distribution.SupplierItemDao;
import com.wwdz.ch.db.domain.distribution.DistributionOrder;
import com.wwdz.ch.db.domain.distribution.DistributorBind;
import com.wwdz.ch.db.domain.distribution.DistributorProfit;
import com.wwdz.ch.db.domain.distribution.SupplierItem;
import com.wwdz.ch.db.dao.distribution.*;
import com.wwdz.ch.db.domain.distribution.*;
import com.wwdz.ch.db.dto.request.distribution.DistributionOrderRequestDto;
import com.wwdz.ch.wx.entity.PayNoticeMsg;
import com.wwdz.ch.wx.service.distribution.SendMsgService;
......@@ -32,7 +27,7 @@ import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.interceptor.TransactionAspectSupport;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.wechat.pay.java.service.refund.model.Status;
import javax.servlet.ServletInputStream;
import javax.servlet.http.HttpServletRequest;
import java.io.BufferedReader;
......@@ -81,8 +76,11 @@ public class WxPayCallbackController {
@Autowired
DistributorBindDao distributorBindDao;
@Autowired
RefundOrderDao refundOrderDao;
@RequestMapping(value ="/getPayNotify")
public synchronized String payNotify(HttpServletRequest request) throws IOException {
public String payNotify(HttpServletRequest request) throws IOException {
logger.info("------------------ 收到微信支付回调通知 ------------------");
// 请求头Wechatpay-Signature
String signature = request.getHeader("Wechatpay-Signature");
......@@ -246,7 +244,7 @@ public class WxPayCallbackController {
sb.append(line);
}
} catch (IOException e) {
throw new IOException("读取返回支付接口数据流出现异常!");
throw new IOException("读取微信回调接口数据流出现异常!");
} finally {
if (reader != null) {
reader.close();
......@@ -259,4 +257,94 @@ public class WxPayCallbackController {
}
@RequestMapping(value ="/getRefundNotify")
@Transactional
public String refundNotify(HttpServletRequest request) throws IOException {
logger.info("------------------ 收到微信支付退款回调通知 ------------------");
// 请求头Wechatpay-Signature
String signature = request.getHeader("Wechatpay-Signature");
// 请求头Wechatpay-nonce
String nonce = request.getHeader("Wechatpay-Nonce");
// 请求头Wechatpay-Timestamp
String timestamp = request.getHeader("Wechatpay-Timestamp");
// 微信支付证书序列号
String serial = request.getHeader("Wechatpay-Serial");
// 签名方式
String signType = request.getHeader("Wechatpay-Signature-Type");
// 初始化 NotificationParser
NotificationParser parser = new NotificationParser(rsaAutoCertificateConfig);
// 构造 RequestParam
RequestParam requestParam = new RequestParam.Builder()
.serialNumber(serial)
.nonce(nonce)
.signature(signature)
.timestamp(timestamp)
.signType(signType)
.body(getRequestBody(request))
.build();
Map<String, String> returnMap = new HashMap<>();
returnMap.put("code", "FAIL");
returnMap.put("message", "失败");
RefundNotification refundNotification;
try {
refundNotification = parser.parse(requestParam, RefundNotification.class);
logger.info("验签成功!-退款回调结果:{}", refundNotification.toString());
} catch (Exception e) {
logger.error("退款回调验签失败:{}", e);
return JsonUtils.from(returnMap);
}
//商户订单号,分销订单号
String distributionOrderId = refundNotification.getOutTradeNo();
//商户退款单号
String refundId = refundNotification.getOutRefundNo();
try {
if (redisUtils.hasKey(refundId)) {
logger.info(">>>>>>>>>>> 分销单号【{}】, 退款单号【{}】, 退款回调正在被其它服务处理,当前不能操作 <<<<<<<<<<<<", distributionOrderId, refundId);
return JsonUtils.from(returnMap);
}
redisUtils.set(refundId, refundId);
//退款成功
if (refundNotification.getRefundStatus().equals(Status.SUCCESS)){
//查询系统中订单现在的状态,避免重复更新
DistributionOrder distributionOrder = distributionOrderDao.findById(distributionOrderId);
//只有在订单状态为退款处理中,才进行退款成功的状态修改
if (distributionOrder.getState() == DistributionEnum.DistributionOrderStateEnum.REFUNDING.getCode()) {
//订单改为已取消的状态
distributionOrderDao.updateState(distributionOrderId, DistributionEnum.DistributionOrderStateEnum.CANCEL.getCode());
String successTime = refundNotification.getSuccessTime();
//退款单状态改为成功
RefundOrder refundOrder = new RefundOrder();
refundOrder.setRefundId(refundId);
refundOrder.setWxRefundId(refundNotification.getRefundId());
refundOrder.setUpdateTime(new Date());
refundOrder.setSuccessTime(TimeUtil.wxTimeConvertToDate(successTime));
refundOrder.setUserReceivedAccount(refundNotification.getUserReceivedAccount());
refundOrder.setState(DistributionEnum.RefundOrderStateEnum.SUCCESS.getCode());
refundOrderDao.update(refundOrder);
//分销商利润记录改为无效
distributorProfitDao.updateValidState(distributionOrderId, false);
logger.info(">>>>>>>> 分销单号:{}, 退款单号:{},退款处理成功, 退款时间为: {}<<<<<<<<<", distributionOrderId, refundId, TimeUtil.wxTimeConvertToDate(successTime));
returnMap.put("code", "SUCCESS");
returnMap.put("message", "成功");
return JsonUtils.from(returnMap);
}
} else {
//退款单状态改为失败
RefundOrder refundOrder = new RefundOrder();
refundOrder.setRefundId(refundId);
refundOrder.setUpdateTime(new Date());
refundOrder.setState(DistributionEnum.RefundOrderStateEnum.FAILED.getCode());
refundOrderDao.update(refundOrder);
}
} catch (Exception e) {
logger.error("退款回调处理失败 : {}", e);
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
} finally {
redisUtils.delete(refundId);
}
return JsonUtils.from(returnMap);
}
}
......@@ -43,7 +43,7 @@ public class WebMvcConfiguration implements WebMvcConfigurer {
"/imCallback/**", "/wx/category/**",
"/wx/consignSale/**", "/wx/item/**",
"/wx/returnOrder/**", "/wx/distributionOrder/confirmSigned", "/wx/distributionOrder/delivery", "/wx/distributionOrder/cancel",
"/wx/supplierItem/findItemsOfCurrentDistributor"
"/wx/supplierItem/findItemsOfCurrentDistributor", "/wx/distributionOrder/refund"
// , "/wx/supplierItem/**", "/wx/shareRecord/**", "/wx/distributionOrder/**", "/wx/selfPage/**"
/* "/wx/officialAccount/**",
"/wx/item/**",
......
package com.wwdz.ch.wx.impl.distribution;
import com.github.pagehelper.PageInfo;
import com.wechat.pay.java.service.refund.model.Refund;
import com.wechat.pay.java.service.refund.model.Status;
import com.wwdz.ch.core.api.wxpay.WxPayServiceApi;
import com.wwdz.ch.core.consts.DistributionEnum;
import com.wwdz.ch.core.consts.LogisticsEnum;
import com.wwdz.ch.core.entity.wxPay.DistributionOrderRefundRequestDto;
import com.wwdz.ch.core.type.PageSearchResult;
import com.wwdz.ch.core.type.Result;
import com.wwdz.ch.core.util.*;
import com.wwdz.ch.db.dao.distribution.DistributionOrderDao;
import com.wwdz.ch.db.dao.distribution.DistributorProfitDao;
import com.wwdz.ch.db.dao.distribution.DistributorShareRecordDao;
import com.wwdz.ch.db.dao.distribution.SupplierItemDao;
import com.wwdz.ch.db.domain.distribution.DistributionOrder;
import com.wwdz.ch.db.domain.distribution.DistributorProfit;
import com.wwdz.ch.db.domain.distribution.DistributorShareRecord;
import com.wwdz.ch.db.domain.distribution.SupplierItem;
import com.wwdz.ch.core.util.UUID;
import com.wwdz.ch.db.dao.distribution.*;
import com.wwdz.ch.db.domain.distribution.*;
import com.wwdz.ch.db.dto.request.distribution.DistributionOrderRequestDto;
import com.wwdz.ch.db.dto.request.distribution.SupplierItemRequestDto;
import com.wwdz.ch.wx.entity.DeliveryNoticeMsg;
......@@ -45,6 +43,8 @@ public class DistributionOrderServiceImpl implements DistributionOrderService {
private final static String DISTRIBUTION_ORDER_PREFIX = "DA";
private final static String SECRET = "117eb48AX0864490fbe4d1ef081B9cc25";
@Autowired
DistributionOrderDao distributionOrderDao;
......@@ -69,6 +69,9 @@ public class DistributionOrderServiceImpl implements DistributionOrderService {
@Autowired
SendMsgService sendMsgService;
@Autowired
RefundOrderDao refundOrderDao;
@Transactional
@Override
public Result createDistributionOrder(DistributionOrderRequestDto dto) {
......@@ -487,4 +490,52 @@ public class DistributionOrderServiceImpl implements DistributionOrderService {
}
});
}
@Override
public Result refund(DistributionOrderRequestDto dto) {
try {
String refundId = UUID.randomUUID().toString(true);
//判断订单状态
String distributionOrderId = dto.getDistributionOrderId();
DistributionOrder distributionOrder = distributionOrderDao.findById(distributionOrderId);
if (distributionOrder.getState() != DistributionEnum.DistributionOrderStateEnum.PRE_SEND.getCode()) {
return Result.failed("订单状态不是待发货,不能退款");
}
if (!SECRET.equals(dto.getSecret())) {
return Result.failed("密钥不正确");
}
DistributionOrderRefundRequestDto refundRequestDto = new DistributionOrderRefundRequestDto();
refundRequestDto.setDistributionOrderId(distributionOrderId);
refundRequestDto.setRefundPrice(distributionOrder.getAmount());
refundRequestDto.setAmount(distributionOrder.getAmount());
refundRequestDto.setRefundId(refundId);
Result result = wxPayServiceApi.orderRefund(refundRequestDto);
if (!result.getSuccess()) {
return Result.failed("调用微信支付退款接口错误");
}
Refund refundResponse = (Refund) result.getData();
if (refundResponse.getStatus().equals(Status.SUCCESS)) {
Date now = new Date();
//创建退款单
RefundOrder refundOrder = new RefundOrder();
refundOrder.setRefundId(refundId);
refundOrder.setRefundAmount(distributionOrder.getAmount());
refundOrder.setAmount(distributionOrder.getAmount());
refundOrder.setDistributionOrderId(distributionOrderId);
refundOrder.setDistributorId(distributionOrder.getSellerId());
refundOrder.setCreateTime(now);
refundOrder.setUpdateTime(now);
refundOrder.setState(DistributionEnum.RefundOrderStateEnum.PROCESSING.getCode());
refundOrderDao.insert(refundOrder);
//退款受理成功,订单的状态改为退款受理中
distributionOrderDao.updateState(distributionOrderId, DistributionEnum.DistributionOrderStateEnum.REFUNDING.getCode());
logger.info(">>>>>>>> 分销单号:{}, 退款单号:{}, 退款申请成功,创建退款单 <<<<<<<<<", distributionOrderId, refundId);
return Result.success(refundId);
}
} catch (Exception e) {
logger.error("退款申请失败 error : {}", e);
}
return Result.failed();
}
}
......@@ -61,6 +61,13 @@ public interface DistributionOrderService {
*/
Result findOrderDetailOfUser(DistributionOrderRequestDto dto);
/**
* 订单退款
* @param dto
* @return
*/
Result refund(DistributionOrderRequestDto dto);
......
......@@ -176,4 +176,19 @@ public class DistributionOrderController {
return distributionOrderService.findOrderDetailOfUser(dto);
}
@ApiOperation(value = "订单退款")
@PostMapping("/refund")
public Result refund(@RequestBody DistributionOrderRequestDto dto) {
logger.info("订单退款,请求参数:{}", JSON.toJSONString(dto));
Validator validator = new Validator(FormHandler.ofEntity(dto));
validator.set("secret", "秘钥").must().string()
.set("distributionOrderId", "分销订单号").must().string()
.end();
if (!validator.isValid()) {
return Result.failed(validator.getErrorInfo());
}
return distributionOrderService.refund(dto);
}
}
......@@ -5,6 +5,7 @@ import com.wwdz.ch.core.api.OfficialAccountApi;
import com.wwdz.ch.core.api.wxpay.WxPayServiceApi;
import com.wwdz.ch.core.type.Result;
import com.wwdz.ch.core.util.PriceUtil;
import com.wwdz.ch.core.util.UUID;
import com.wwdz.ch.db.dao.distribution.DistributionOrderDao;
import com.wwdz.ch.db.domain.distribution.DistributionOrder;
import com.wwdz.ch.db.dto.request.distribution.DistributionOrderRequestDto;
......@@ -43,17 +44,21 @@ public class WxPayServiceTest {
@Test
public void refund() {
List<String> list = Arrays.asList("DA2402241542377839584");
List<String> list = Arrays.asList("DA2402241539558250270");
list.forEach(orderId ->{
DistributionOrderRequestDto dto = new DistributionOrderRequestDto();
dto.setDistributionOrderId(orderId);
dto.setAmount("28.8");
dto.setRefundPrice("28.8");
dto.setAmount("12.8");
dto.setRefundPrice("12.8");
Result result = wxPayServiceApi.refund(dto);
logger.info("申请微信支付退款:{}", result);
});
}
public static void main(String[] args) {
System.out.println(UUID.fastUUID().toString(true));
}
}
Markdown is supported
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