diff --git a/open-api/src/main/java/com/api/controller/v1/NotifyController.java b/open-api/src/main/java/com/api/controller/v1/NotifyController.java index dd10244..1ed7159 100644 --- a/open-api/src/main/java/com/api/controller/v1/NotifyController.java +++ b/open-api/src/main/java/com/api/controller/v1/NotifyController.java @@ -96,6 +96,7 @@ public class NotifyController { responseQueryTradeModel.setStatus(tradeOrder.getStatus()); responseQueryTradeModel.setCreateTime(tradeOrder.getCreateTime()); responseQueryTradeModel.setPayTime(tradeOrder.getPayTime()); + responseQueryTradeModel.setAttach(tradeOrder.getAttach()); responseQueryTradeModel.setSign(SignatureUtil.createSign(responseQueryTradeModel, merKeyService.getKeyByMerNo(tradeOrder.getMerNo()))); JSONObject result = HttpsUtils.doPost(order.getPayNotifyUrl(), JSONObject.toJSONString(responseQueryTradeModel)); BufferedOutputStream out = new BufferedOutputStream(response.getOutputStream()); diff --git a/open-api/src/main/java/com/api/controller/v1/TradeController.java b/open-api/src/main/java/com/api/controller/v1/TradeController.java index b70df8c..b150a55 100644 --- a/open-api/src/main/java/com/api/controller/v1/TradeController.java +++ b/open-api/src/main/java/com/api/controller/v1/TradeController.java @@ -103,6 +103,7 @@ public class TradeController { tradeOrder.setPayNotifyUrl(body.getNotifyUrl()); tradeOrder.setSubject(body.getSubject()); tradeOrder.setRefundPrice(new BigDecimal("0")); + tradeOrder.setAttach(body.getAttach()); // 创建交易订单 Map returnParam = openApiTradeOrderService.createOrder(tradeOrder); @@ -145,6 +146,7 @@ public class TradeController { responseQueryTradeModel.setStatus(tradeOrder.getStatus()); responseQueryTradeModel.setCreateTime(tradeOrder.getCreateTime()); responseQueryTradeModel.setPayTime(tradeOrder.getPayTime()); + responseQueryTradeModel.setAttach(tradeOrder.getAttach()); responseQueryTradeModel.setSign(SignatureUtil.createSign(responseQueryTradeModel, merKeyService.getKeyByMerNo(body.getMerchantNo()))); log.info("返回参数:" + JSONObject.toJSONString(responseQueryTradeModel)); diff --git a/service/src/main/java/com/hfkj/dao/BsTradeOrderMapper.java b/service/src/main/java/com/hfkj/dao/BsTradeOrderMapper.java index 22cc2ce..8c85b6e 100644 --- a/service/src/main/java/com/hfkj/dao/BsTradeOrderMapper.java +++ b/service/src/main/java/com/hfkj/dao/BsTradeOrderMapper.java @@ -65,11 +65,11 @@ public interface BsTradeOrderMapper extends BsTradeOrderMapperExt { "card_type, `status`, ", "profit_sharing_status, pay_time, ", "timeout_express, subject, ", - "pay_notify_url, refund_type, ", - "refund_price, create_type, ", - "create_time, cancel_time, ", - "update_time, ext_1, ", - "ext_2, ext_3)", + "pay_notify_url, attach, ", + "refund_type, refund_price, ", + "create_type, create_time, ", + "cancel_time, update_time, ", + "ext_1, ext_2, ext_3)", "values (#{companyId,jdbcType=BIGINT}, #{agentId,jdbcType=BIGINT}, ", "#{salesmanId,jdbcType=BIGINT}, #{salesmanName,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}, ", "#{profitSharingStatus,jdbcType=BIT}, #{payTime,jdbcType=TIMESTAMP}, ", "#{timeoutExpress,jdbcType=INTEGER}, #{subject,jdbcType=VARCHAR}, ", - "#{payNotifyUrl,jdbcType=VARCHAR}, #{refundType,jdbcType=INTEGER}, ", - "#{refundPrice,jdbcType=DECIMAL}, #{createType,jdbcType=INTEGER}, ", - "#{createTime,jdbcType=TIMESTAMP}, #{cancelTime,jdbcType=TIMESTAMP}, ", - "#{updateTime,jdbcType=TIMESTAMP}, #{ext1,jdbcType=VARCHAR}, ", - "#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" + "#{payNotifyUrl,jdbcType=VARCHAR}, #{attach,jdbcType=VARCHAR}, ", + "#{refundType,jdbcType=INTEGER}, #{refundPrice,jdbcType=DECIMAL}, ", + "#{createType,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, ", + "#{cancelTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, ", + "#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" }) @Options(useGeneratedKeys=true,keyProperty="id") int insert(BsTradeOrder record); @@ -166,6 +166,7 @@ public interface BsTradeOrderMapper extends BsTradeOrderMapperExt { @Result(column="timeout_express", property="timeoutExpress", jdbcType=JdbcType.INTEGER), @Result(column="subject", property="subject", 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_price", property="refundPrice", jdbcType=JdbcType.DECIMAL), @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_actual_price, trade_actual_amount, income_amout, acc_trade_no, ", "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, ", - "refund_price, create_type, create_time, cancel_time, update_time, ext_1, ext_2, ", - "ext_3", + "profit_sharing_status, pay_time, timeout_express, subject, pay_notify_url, attach, ", + "refund_type, refund_price, create_type, create_time, cancel_time, update_time, ", + "ext_1, ext_2, ext_3", "from bs_trade_order", "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="subject", property="subject", 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_price", property="refundPrice", jdbcType=JdbcType.DECIMAL), @Result(column="create_type", property="createType", jdbcType=JdbcType.INTEGER), @@ -329,6 +331,7 @@ public interface BsTradeOrderMapper extends BsTradeOrderMapperExt { "timeout_express = #{timeoutExpress,jdbcType=INTEGER},", "subject = #{subject,jdbcType=VARCHAR},", "pay_notify_url = #{payNotifyUrl,jdbcType=VARCHAR},", + "attach = #{attach,jdbcType=VARCHAR},", "refund_type = #{refundType,jdbcType=INTEGER},", "refund_price = #{refundPrice,jdbcType=DECIMAL},", "create_type = #{createType,jdbcType=INTEGER},", diff --git a/service/src/main/java/com/hfkj/dao/BsTradeOrderSqlProvider.java b/service/src/main/java/com/hfkj/dao/BsTradeOrderSqlProvider.java index b3acb45..3eff2b1 100644 --- a/service/src/main/java/com/hfkj/dao/BsTradeOrderSqlProvider.java +++ b/service/src/main/java/com/hfkj/dao/BsTradeOrderSqlProvider.java @@ -244,6 +244,10 @@ public class BsTradeOrderSqlProvider { sql.VALUES("pay_notify_url", "#{payNotifyUrl,jdbcType=VARCHAR}"); } + if (record.getAttach() != null) { + sql.VALUES("attach", "#{attach,jdbcType=VARCHAR}"); + } + if (record.getRefundType() != null) { sql.VALUES("refund_type", "#{refundType,jdbcType=INTEGER}"); } @@ -344,6 +348,7 @@ public class BsTradeOrderSqlProvider { sql.SELECT("timeout_express"); sql.SELECT("subject"); sql.SELECT("pay_notify_url"); + sql.SELECT("attach"); sql.SELECT("refund_type"); sql.SELECT("refund_price"); sql.SELECT("create_type"); @@ -590,6 +595,10 @@ public class BsTradeOrderSqlProvider { sql.SET("pay_notify_url = #{record.payNotifyUrl,jdbcType=VARCHAR}"); } + if (record.getAttach() != null) { + sql.SET("attach = #{record.attach,jdbcType=VARCHAR}"); + } + if (record.getRefundType() != null) { 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("subject = #{record.subject,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_price = #{record.refundPrice,jdbcType=DECIMAL}"); sql.SET("create_type = #{record.createType,jdbcType=INTEGER}"); @@ -924,6 +934,10 @@ public class BsTradeOrderSqlProvider { sql.SET("pay_notify_url = #{payNotifyUrl,jdbcType=VARCHAR}"); } + if (record.getAttach() != null) { + sql.SET("attach = #{attach,jdbcType=VARCHAR}"); + } + if (record.getRefundType() != null) { sql.SET("refund_type = #{refundType,jdbcType=INTEGER}"); } diff --git a/service/src/main/java/com/hfkj/entity/BsTradeOrder.java b/service/src/main/java/com/hfkj/entity/BsTradeOrder.java index b7b9b57..19e8ae0 100644 --- a/service/src/main/java/com/hfkj/entity/BsTradeOrder.java +++ b/service/src/main/java/com/hfkj/entity/BsTradeOrder.java @@ -293,6 +293,11 @@ public class BsTradeOrder implements Serializable { */ private String payNotifyUrl; + /** + * 附加域 + */ + private String attach; + /** * 退款类型 1:全额退款 2:部分退款 */ @@ -771,6 +776,14 @@ public class BsTradeOrder implements Serializable { this.payNotifyUrl = payNotifyUrl; } + public String getAttach() { + return attach; + } + + public void setAttach(String attach) { + this.attach = attach; + } + public Integer getRefundType() { return refundType; } @@ -910,6 +923,7 @@ public class BsTradeOrder implements Serializable { && (this.getTimeoutExpress() == null ? other.getTimeoutExpress() == null : this.getTimeoutExpress().equals(other.getTimeoutExpress())) && (this.getSubject() == null ? other.getSubject() == null : this.getSubject().equals(other.getSubject())) && (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.getRefundPrice() == null ? other.getRefundPrice() == null : this.getRefundPrice().equals(other.getRefundPrice())) && (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 + ((getSubject() == null) ? 0 : getSubject().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 + ((getRefundPrice() == null) ? 0 : getRefundPrice().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(", subject=").append(subject); sb.append(", payNotifyUrl=").append(payNotifyUrl); + sb.append(", attach=").append(attach); sb.append(", refundType=").append(refundType); sb.append(", refundPrice=").append(refundPrice); sb.append(", createType=").append(createType); diff --git a/service/src/main/java/com/hfkj/entity/BsTradeOrderExample.java b/service/src/main/java/com/hfkj/entity/BsTradeOrderExample.java index 6e2ac9b..ae05523 100644 --- a/service/src/main/java/com/hfkj/entity/BsTradeOrderExample.java +++ b/service/src/main/java/com/hfkj/entity/BsTradeOrderExample.java @@ -3646,6 +3646,76 @@ public class BsTradeOrderExample { 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 values) { + addCriterion("attach in", values, "attach"); + return (Criteria) this; + } + + public Criteria andAttachNotIn(List 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() { addCriterion("refund_type is null"); return (Criteria) this; diff --git a/service/src/main/java/com/hfkj/openapi/v1/model/RequestTradePreorderModel.java b/service/src/main/java/com/hfkj/openapi/v1/model/RequestTradePreorderModel.java index f199bad..2604684 100644 --- a/service/src/main/java/com/hfkj/openapi/v1/model/RequestTradePreorderModel.java +++ b/service/src/main/java/com/hfkj/openapi/v1/model/RequestTradePreorderModel.java @@ -81,6 +81,7 @@ public class RequestTradePreorderModel { /** * 附加域 */ + @Length(max = 128, message = "附加域限制在128位字符以内") private String attach; /** diff --git a/service/src/main/java/com/hfkj/openapi/v1/model/ResponseQueryTradeModel.java b/service/src/main/java/com/hfkj/openapi/v1/model/ResponseQueryTradeModel.java index ff1ca3d..7a464dd 100644 --- a/service/src/main/java/com/hfkj/openapi/v1/model/ResponseQueryTradeModel.java +++ b/service/src/main/java/com/hfkj/openapi/v1/model/ResponseQueryTradeModel.java @@ -66,6 +66,11 @@ public class ResponseQueryTradeModel { */ private Date payTime; + /** + * 附加参数 + */ + private String attach; + /** * 签名参数 */