提交代码

yy_dev
胡锐 1 year ago
parent 6aa51df13d
commit a5be76e1d4
  1. 1
      open-api/src/main/java/com/api/controller/v1/NotifyController.java
  2. 2
      open-api/src/main/java/com/api/controller/v1/TradeController.java
  3. 29
      service/src/main/java/com/hfkj/dao/BsTradeOrderMapper.java
  4. 14
      service/src/main/java/com/hfkj/dao/BsTradeOrderSqlProvider.java
  5. 16
      service/src/main/java/com/hfkj/entity/BsTradeOrder.java
  6. 70
      service/src/main/java/com/hfkj/entity/BsTradeOrderExample.java
  7. 1
      service/src/main/java/com/hfkj/openapi/v1/model/RequestTradePreorderModel.java
  8. 5
      service/src/main/java/com/hfkj/openapi/v1/model/ResponseQueryTradeModel.java

@ -96,6 +96,7 @@ public class NotifyController {
responseQueryTradeModel.setStatus(tradeOrder.getStatus()); responseQueryTradeModel.setStatus(tradeOrder.getStatus());
responseQueryTradeModel.setCreateTime(tradeOrder.getCreateTime()); responseQueryTradeModel.setCreateTime(tradeOrder.getCreateTime());
responseQueryTradeModel.setPayTime(tradeOrder.getPayTime()); responseQueryTradeModel.setPayTime(tradeOrder.getPayTime());
responseQueryTradeModel.setAttach(tradeOrder.getAttach());
responseQueryTradeModel.setSign(SignatureUtil.createSign(responseQueryTradeModel, merKeyService.getKeyByMerNo(tradeOrder.getMerNo()))); responseQueryTradeModel.setSign(SignatureUtil.createSign(responseQueryTradeModel, merKeyService.getKeyByMerNo(tradeOrder.getMerNo())));
JSONObject result = HttpsUtils.doPost(order.getPayNotifyUrl(), JSONObject.toJSONString(responseQueryTradeModel)); JSONObject result = HttpsUtils.doPost(order.getPayNotifyUrl(), JSONObject.toJSONString(responseQueryTradeModel));
BufferedOutputStream out = new BufferedOutputStream(response.getOutputStream()); BufferedOutputStream out = new BufferedOutputStream(response.getOutputStream());

@ -103,6 +103,7 @@ public class TradeController {
tradeOrder.setPayNotifyUrl(body.getNotifyUrl()); tradeOrder.setPayNotifyUrl(body.getNotifyUrl());
tradeOrder.setSubject(body.getSubject()); tradeOrder.setSubject(body.getSubject());
tradeOrder.setRefundPrice(new BigDecimal("0")); tradeOrder.setRefundPrice(new BigDecimal("0"));
tradeOrder.setAttach(body.getAttach());
// 创建交易订单 // 创建交易订单
Map<String, Object> returnParam = openApiTradeOrderService.createOrder(tradeOrder); Map<String, Object> returnParam = openApiTradeOrderService.createOrder(tradeOrder);
@ -145,6 +146,7 @@ public class TradeController {
responseQueryTradeModel.setStatus(tradeOrder.getStatus()); responseQueryTradeModel.setStatus(tradeOrder.getStatus());
responseQueryTradeModel.setCreateTime(tradeOrder.getCreateTime()); responseQueryTradeModel.setCreateTime(tradeOrder.getCreateTime());
responseQueryTradeModel.setPayTime(tradeOrder.getPayTime()); responseQueryTradeModel.setPayTime(tradeOrder.getPayTime());
responseQueryTradeModel.setAttach(tradeOrder.getAttach());
responseQueryTradeModel.setSign(SignatureUtil.createSign(responseQueryTradeModel, merKeyService.getKeyByMerNo(body.getMerchantNo()))); responseQueryTradeModel.setSign(SignatureUtil.createSign(responseQueryTradeModel, merKeyService.getKeyByMerNo(body.getMerchantNo())));
log.info("返回参数:" + JSONObject.toJSONString(responseQueryTradeModel)); log.info("返回参数:" + JSONObject.toJSONString(responseQueryTradeModel));

@ -65,11 +65,11 @@ public interface BsTradeOrderMapper extends BsTradeOrderMapperExt {
"card_type, `status`, ", "card_type, `status`, ",
"profit_sharing_status, pay_time, ", "profit_sharing_status, pay_time, ",
"timeout_express, subject, ", "timeout_express, subject, ",
"pay_notify_url, refund_type, ", "pay_notify_url, attach, ",
"refund_price, create_type, ", "refund_type, refund_price, ",
"create_time, cancel_time, ", "create_type, create_time, ",
"update_time, ext_1, ", "cancel_time, update_time, ",
"ext_2, ext_3)", "ext_1, ext_2, ext_3)",
"values (#{companyId,jdbcType=BIGINT}, #{agentId,jdbcType=BIGINT}, ", "values (#{companyId,jdbcType=BIGINT}, #{agentId,jdbcType=BIGINT}, ",
"#{salesmanId,jdbcType=BIGINT}, #{salesmanName,jdbcType=VARCHAR}, ", "#{salesmanId,jdbcType=BIGINT}, #{salesmanName,jdbcType=VARCHAR}, ",
"#{merId,jdbcType=BIGINT}, #{merName,jdbcType=VARCHAR}, #{merNo,jdbcType=VARCHAR}, ", "#{merId,jdbcType=BIGINT}, #{merName,jdbcType=VARCHAR}, #{merNo,jdbcType=VARCHAR}, ",
@ -96,11 +96,11 @@ public interface BsTradeOrderMapper extends BsTradeOrderMapperExt {
"#{cardType,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, ", "#{cardType,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, ",
"#{profitSharingStatus,jdbcType=BIT}, #{payTime,jdbcType=TIMESTAMP}, ", "#{profitSharingStatus,jdbcType=BIT}, #{payTime,jdbcType=TIMESTAMP}, ",
"#{timeoutExpress,jdbcType=INTEGER}, #{subject,jdbcType=VARCHAR}, ", "#{timeoutExpress,jdbcType=INTEGER}, #{subject,jdbcType=VARCHAR}, ",
"#{payNotifyUrl,jdbcType=VARCHAR}, #{refundType,jdbcType=INTEGER}, ", "#{payNotifyUrl,jdbcType=VARCHAR}, #{attach,jdbcType=VARCHAR}, ",
"#{refundPrice,jdbcType=DECIMAL}, #{createType,jdbcType=INTEGER}, ", "#{refundType,jdbcType=INTEGER}, #{refundPrice,jdbcType=DECIMAL}, ",
"#{createTime,jdbcType=TIMESTAMP}, #{cancelTime,jdbcType=TIMESTAMP}, ", "#{createType,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, ",
"#{updateTime,jdbcType=TIMESTAMP}, #{ext1,jdbcType=VARCHAR}, ", "#{cancelTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, ",
"#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" "#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
}) })
@Options(useGeneratedKeys=true,keyProperty="id") @Options(useGeneratedKeys=true,keyProperty="id")
int insert(BsTradeOrder record); int insert(BsTradeOrder record);
@ -166,6 +166,7 @@ public interface BsTradeOrderMapper extends BsTradeOrderMapperExt {
@Result(column="timeout_express", property="timeoutExpress", jdbcType=JdbcType.INTEGER), @Result(column="timeout_express", property="timeoutExpress", jdbcType=JdbcType.INTEGER),
@Result(column="subject", property="subject", jdbcType=JdbcType.VARCHAR), @Result(column="subject", property="subject", jdbcType=JdbcType.VARCHAR),
@Result(column="pay_notify_url", property="payNotifyUrl", jdbcType=JdbcType.VARCHAR), @Result(column="pay_notify_url", property="payNotifyUrl", jdbcType=JdbcType.VARCHAR),
@Result(column="attach", property="attach", jdbcType=JdbcType.VARCHAR),
@Result(column="refund_type", property="refundType", jdbcType=JdbcType.INTEGER), @Result(column="refund_type", property="refundType", jdbcType=JdbcType.INTEGER),
@Result(column="refund_price", property="refundPrice", jdbcType=JdbcType.DECIMAL), @Result(column="refund_price", property="refundPrice", jdbcType=JdbcType.DECIMAL),
@Result(column="create_type", property="createType", jdbcType=JdbcType.INTEGER), @Result(column="create_type", property="createType", jdbcType=JdbcType.INTEGER),
@ -190,9 +191,9 @@ public interface BsTradeOrderMapper extends BsTradeOrderMapperExt {
"user_discount_id, user_discount_name, user_discount_type, user_discount_price, ", "user_discount_id, user_discount_name, user_discount_type, user_discount_price, ",
"user_discount_actual_price, trade_actual_amount, income_amout, acc_trade_no, ", "user_discount_actual_price, trade_actual_amount, income_amout, acc_trade_no, ",
"acc_mdiscount_amount, acc_discount_amount, acc_payment_code, card_type, `status`, ", "acc_mdiscount_amount, acc_discount_amount, acc_payment_code, card_type, `status`, ",
"profit_sharing_status, pay_time, timeout_express, subject, pay_notify_url, refund_type, ", "profit_sharing_status, pay_time, timeout_express, subject, pay_notify_url, attach, ",
"refund_price, create_type, create_time, cancel_time, update_time, ext_1, ext_2, ", "refund_type, refund_price, create_type, create_time, cancel_time, update_time, ",
"ext_3", "ext_1, ext_2, ext_3",
"from bs_trade_order", "from bs_trade_order",
"where id = #{id,jdbcType=BIGINT}" "where id = #{id,jdbcType=BIGINT}"
}) })
@ -252,6 +253,7 @@ public interface BsTradeOrderMapper extends BsTradeOrderMapperExt {
@Result(column="timeout_express", property="timeoutExpress", jdbcType=JdbcType.INTEGER), @Result(column="timeout_express", property="timeoutExpress", jdbcType=JdbcType.INTEGER),
@Result(column="subject", property="subject", jdbcType=JdbcType.VARCHAR), @Result(column="subject", property="subject", jdbcType=JdbcType.VARCHAR),
@Result(column="pay_notify_url", property="payNotifyUrl", jdbcType=JdbcType.VARCHAR), @Result(column="pay_notify_url", property="payNotifyUrl", jdbcType=JdbcType.VARCHAR),
@Result(column="attach", property="attach", jdbcType=JdbcType.VARCHAR),
@Result(column="refund_type", property="refundType", jdbcType=JdbcType.INTEGER), @Result(column="refund_type", property="refundType", jdbcType=JdbcType.INTEGER),
@Result(column="refund_price", property="refundPrice", jdbcType=JdbcType.DECIMAL), @Result(column="refund_price", property="refundPrice", jdbcType=JdbcType.DECIMAL),
@Result(column="create_type", property="createType", jdbcType=JdbcType.INTEGER), @Result(column="create_type", property="createType", jdbcType=JdbcType.INTEGER),
@ -329,6 +331,7 @@ public interface BsTradeOrderMapper extends BsTradeOrderMapperExt {
"timeout_express = #{timeoutExpress,jdbcType=INTEGER},", "timeout_express = #{timeoutExpress,jdbcType=INTEGER},",
"subject = #{subject,jdbcType=VARCHAR},", "subject = #{subject,jdbcType=VARCHAR},",
"pay_notify_url = #{payNotifyUrl,jdbcType=VARCHAR},", "pay_notify_url = #{payNotifyUrl,jdbcType=VARCHAR},",
"attach = #{attach,jdbcType=VARCHAR},",
"refund_type = #{refundType,jdbcType=INTEGER},", "refund_type = #{refundType,jdbcType=INTEGER},",
"refund_price = #{refundPrice,jdbcType=DECIMAL},", "refund_price = #{refundPrice,jdbcType=DECIMAL},",
"create_type = #{createType,jdbcType=INTEGER},", "create_type = #{createType,jdbcType=INTEGER},",

@ -244,6 +244,10 @@ public class BsTradeOrderSqlProvider {
sql.VALUES("pay_notify_url", "#{payNotifyUrl,jdbcType=VARCHAR}"); sql.VALUES("pay_notify_url", "#{payNotifyUrl,jdbcType=VARCHAR}");
} }
if (record.getAttach() != null) {
sql.VALUES("attach", "#{attach,jdbcType=VARCHAR}");
}
if (record.getRefundType() != null) { if (record.getRefundType() != null) {
sql.VALUES("refund_type", "#{refundType,jdbcType=INTEGER}"); sql.VALUES("refund_type", "#{refundType,jdbcType=INTEGER}");
} }
@ -344,6 +348,7 @@ public class BsTradeOrderSqlProvider {
sql.SELECT("timeout_express"); sql.SELECT("timeout_express");
sql.SELECT("subject"); sql.SELECT("subject");
sql.SELECT("pay_notify_url"); sql.SELECT("pay_notify_url");
sql.SELECT("attach");
sql.SELECT("refund_type"); sql.SELECT("refund_type");
sql.SELECT("refund_price"); sql.SELECT("refund_price");
sql.SELECT("create_type"); sql.SELECT("create_type");
@ -590,6 +595,10 @@ public class BsTradeOrderSqlProvider {
sql.SET("pay_notify_url = #{record.payNotifyUrl,jdbcType=VARCHAR}"); sql.SET("pay_notify_url = #{record.payNotifyUrl,jdbcType=VARCHAR}");
} }
if (record.getAttach() != null) {
sql.SET("attach = #{record.attach,jdbcType=VARCHAR}");
}
if (record.getRefundType() != null) { if (record.getRefundType() != null) {
sql.SET("refund_type = #{record.refundType,jdbcType=INTEGER}"); sql.SET("refund_type = #{record.refundType,jdbcType=INTEGER}");
} }
@ -689,6 +698,7 @@ public class BsTradeOrderSqlProvider {
sql.SET("timeout_express = #{record.timeoutExpress,jdbcType=INTEGER}"); sql.SET("timeout_express = #{record.timeoutExpress,jdbcType=INTEGER}");
sql.SET("subject = #{record.subject,jdbcType=VARCHAR}"); sql.SET("subject = #{record.subject,jdbcType=VARCHAR}");
sql.SET("pay_notify_url = #{record.payNotifyUrl,jdbcType=VARCHAR}"); sql.SET("pay_notify_url = #{record.payNotifyUrl,jdbcType=VARCHAR}");
sql.SET("attach = #{record.attach,jdbcType=VARCHAR}");
sql.SET("refund_type = #{record.refundType,jdbcType=INTEGER}"); sql.SET("refund_type = #{record.refundType,jdbcType=INTEGER}");
sql.SET("refund_price = #{record.refundPrice,jdbcType=DECIMAL}"); sql.SET("refund_price = #{record.refundPrice,jdbcType=DECIMAL}");
sql.SET("create_type = #{record.createType,jdbcType=INTEGER}"); sql.SET("create_type = #{record.createType,jdbcType=INTEGER}");
@ -924,6 +934,10 @@ public class BsTradeOrderSqlProvider {
sql.SET("pay_notify_url = #{payNotifyUrl,jdbcType=VARCHAR}"); sql.SET("pay_notify_url = #{payNotifyUrl,jdbcType=VARCHAR}");
} }
if (record.getAttach() != null) {
sql.SET("attach = #{attach,jdbcType=VARCHAR}");
}
if (record.getRefundType() != null) { if (record.getRefundType() != null) {
sql.SET("refund_type = #{refundType,jdbcType=INTEGER}"); sql.SET("refund_type = #{refundType,jdbcType=INTEGER}");
} }

@ -293,6 +293,11 @@ public class BsTradeOrder implements Serializable {
*/ */
private String payNotifyUrl; private String payNotifyUrl;
/**
* 附加域
*/
private String attach;
/** /**
* 退款类型 1全额退款 2部分退款 * 退款类型 1全额退款 2部分退款
*/ */
@ -771,6 +776,14 @@ public class BsTradeOrder implements Serializable {
this.payNotifyUrl = payNotifyUrl; this.payNotifyUrl = payNotifyUrl;
} }
public String getAttach() {
return attach;
}
public void setAttach(String attach) {
this.attach = attach;
}
public Integer getRefundType() { public Integer getRefundType() {
return refundType; return refundType;
} }
@ -910,6 +923,7 @@ public class BsTradeOrder implements Serializable {
&& (this.getTimeoutExpress() == null ? other.getTimeoutExpress() == null : this.getTimeoutExpress().equals(other.getTimeoutExpress())) && (this.getTimeoutExpress() == null ? other.getTimeoutExpress() == null : this.getTimeoutExpress().equals(other.getTimeoutExpress()))
&& (this.getSubject() == null ? other.getSubject() == null : this.getSubject().equals(other.getSubject())) && (this.getSubject() == null ? other.getSubject() == null : this.getSubject().equals(other.getSubject()))
&& (this.getPayNotifyUrl() == null ? other.getPayNotifyUrl() == null : this.getPayNotifyUrl().equals(other.getPayNotifyUrl())) && (this.getPayNotifyUrl() == null ? other.getPayNotifyUrl() == null : this.getPayNotifyUrl().equals(other.getPayNotifyUrl()))
&& (this.getAttach() == null ? other.getAttach() == null : this.getAttach().equals(other.getAttach()))
&& (this.getRefundType() == null ? other.getRefundType() == null : this.getRefundType().equals(other.getRefundType())) && (this.getRefundType() == null ? other.getRefundType() == null : this.getRefundType().equals(other.getRefundType()))
&& (this.getRefundPrice() == null ? other.getRefundPrice() == null : this.getRefundPrice().equals(other.getRefundPrice())) && (this.getRefundPrice() == null ? other.getRefundPrice() == null : this.getRefundPrice().equals(other.getRefundPrice()))
&& (this.getCreateType() == null ? other.getCreateType() == null : this.getCreateType().equals(other.getCreateType())) && (this.getCreateType() == null ? other.getCreateType() == null : this.getCreateType().equals(other.getCreateType()))
@ -980,6 +994,7 @@ public class BsTradeOrder implements Serializable {
result = prime * result + ((getTimeoutExpress() == null) ? 0 : getTimeoutExpress().hashCode()); result = prime * result + ((getTimeoutExpress() == null) ? 0 : getTimeoutExpress().hashCode());
result = prime * result + ((getSubject() == null) ? 0 : getSubject().hashCode()); result = prime * result + ((getSubject() == null) ? 0 : getSubject().hashCode());
result = prime * result + ((getPayNotifyUrl() == null) ? 0 : getPayNotifyUrl().hashCode()); result = prime * result + ((getPayNotifyUrl() == null) ? 0 : getPayNotifyUrl().hashCode());
result = prime * result + ((getAttach() == null) ? 0 : getAttach().hashCode());
result = prime * result + ((getRefundType() == null) ? 0 : getRefundType().hashCode()); result = prime * result + ((getRefundType() == null) ? 0 : getRefundType().hashCode());
result = prime * result + ((getRefundPrice() == null) ? 0 : getRefundPrice().hashCode()); result = prime * result + ((getRefundPrice() == null) ? 0 : getRefundPrice().hashCode());
result = prime * result + ((getCreateType() == null) ? 0 : getCreateType().hashCode()); result = prime * result + ((getCreateType() == null) ? 0 : getCreateType().hashCode());
@ -1053,6 +1068,7 @@ public class BsTradeOrder implements Serializable {
sb.append(", timeoutExpress=").append(timeoutExpress); sb.append(", timeoutExpress=").append(timeoutExpress);
sb.append(", subject=").append(subject); sb.append(", subject=").append(subject);
sb.append(", payNotifyUrl=").append(payNotifyUrl); sb.append(", payNotifyUrl=").append(payNotifyUrl);
sb.append(", attach=").append(attach);
sb.append(", refundType=").append(refundType); sb.append(", refundType=").append(refundType);
sb.append(", refundPrice=").append(refundPrice); sb.append(", refundPrice=").append(refundPrice);
sb.append(", createType=").append(createType); sb.append(", createType=").append(createType);

@ -3646,6 +3646,76 @@ public class BsTradeOrderExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andAttachIsNull() {
addCriterion("attach is null");
return (Criteria) this;
}
public Criteria andAttachIsNotNull() {
addCriterion("attach is not null");
return (Criteria) this;
}
public Criteria andAttachEqualTo(String value) {
addCriterion("attach =", value, "attach");
return (Criteria) this;
}
public Criteria andAttachNotEqualTo(String value) {
addCriterion("attach <>", value, "attach");
return (Criteria) this;
}
public Criteria andAttachGreaterThan(String value) {
addCriterion("attach >", value, "attach");
return (Criteria) this;
}
public Criteria andAttachGreaterThanOrEqualTo(String value) {
addCriterion("attach >=", value, "attach");
return (Criteria) this;
}
public Criteria andAttachLessThan(String value) {
addCriterion("attach <", value, "attach");
return (Criteria) this;
}
public Criteria andAttachLessThanOrEqualTo(String value) {
addCriterion("attach <=", value, "attach");
return (Criteria) this;
}
public Criteria andAttachLike(String value) {
addCriterion("attach like", value, "attach");
return (Criteria) this;
}
public Criteria andAttachNotLike(String value) {
addCriterion("attach not like", value, "attach");
return (Criteria) this;
}
public Criteria andAttachIn(List<String> values) {
addCriterion("attach in", values, "attach");
return (Criteria) this;
}
public Criteria andAttachNotIn(List<String> values) {
addCriterion("attach not in", values, "attach");
return (Criteria) this;
}
public Criteria andAttachBetween(String value1, String value2) {
addCriterion("attach between", value1, value2, "attach");
return (Criteria) this;
}
public Criteria andAttachNotBetween(String value1, String value2) {
addCriterion("attach not between", value1, value2, "attach");
return (Criteria) this;
}
public Criteria andRefundTypeIsNull() { public Criteria andRefundTypeIsNull() {
addCriterion("refund_type is null"); addCriterion("refund_type is null");
return (Criteria) this; return (Criteria) this;

@ -81,6 +81,7 @@ public class RequestTradePreorderModel {
/** /**
* 附加域 * 附加域
*/ */
@Length(max = 128, message = "附加域限制在128位字符以内")
private String attach; private String attach;
/** /**

@ -66,6 +66,11 @@ public class ResponseQueryTradeModel {
*/ */
private Date payTime; private Date payTime;
/**
* 附加参数
*/
private String attach;
/** /**
* 签名参数 * 签名参数
*/ */

Loading…
Cancel
Save