diff --git a/service/src/main/java/com/hfkj/dao/BsHltCardRecordMapper.java b/service/src/main/java/com/hfkj/dao/BsHltCardRecordMapper.java new file mode 100644 index 0000000..606e68a --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/BsHltCardRecordMapper.java @@ -0,0 +1,147 @@ +package com.hfkj.dao; + +import com.hfkj.entity.BsHltCardRecord; +import com.hfkj.entity.BsHltCardRecordExample; +import java.util.List; +import org.apache.ibatis.annotations.Delete; +import org.apache.ibatis.annotations.DeleteProvider; +import org.apache.ibatis.annotations.Insert; +import org.apache.ibatis.annotations.InsertProvider; +import org.apache.ibatis.annotations.Options; +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Result; +import org.apache.ibatis.annotations.Results; +import org.apache.ibatis.annotations.Select; +import org.apache.ibatis.annotations.SelectProvider; +import org.apache.ibatis.annotations.Update; +import org.apache.ibatis.annotations.UpdateProvider; +import org.apache.ibatis.type.JdbcType; +import org.springframework.stereotype.Repository; + +/** + * + * 代码由工具生成,请勿修改!!! + * 如果需要扩展请在其父类进行扩展 + * + **/ +@Repository +public interface BsHltCardRecordMapper extends BsHltCardRecordMapperExt { + @SelectProvider(type=BsHltCardRecordSqlProvider.class, method="countByExample") + long countByExample(BsHltCardRecordExample example); + + @DeleteProvider(type=BsHltCardRecordSqlProvider.class, method="deleteByExample") + int deleteByExample(BsHltCardRecordExample example); + + @Delete({ + "delete from bs_hlt_card_record", + "where id = #{id,jdbcType=BIGINT}" + }) + int deleteByPrimaryKey(Long id); + + @Insert({ + "insert into bs_hlt_card_record (order_no, card_no, ", + "user_phone, pay_order_no, ", + "pay_serial_no, pay_price, ", + "pay_status, create_time, ", + "update_time, pay_time, ", + "refund_time, exception_status, ", + "exception_content, ext_1, ", + "ext_2, ext_3)", + "values (#{orderNo,jdbcType=VARCHAR}, #{cardNo,jdbcType=VARCHAR}, ", + "#{userPhone,jdbcType=VARCHAR}, #{payOrderNo,jdbcType=VARCHAR}, ", + "#{paySerialNo,jdbcType=VARCHAR}, #{payPrice,jdbcType=DECIMAL}, ", + "#{payStatus,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, ", + "#{updateTime,jdbcType=TIMESTAMP}, #{payTime,jdbcType=TIMESTAMP}, ", + "#{refundTime,jdbcType=TIMESTAMP}, #{exceptionStatus,jdbcType=BIT}, ", + "#{exceptionContent,jdbcType=VARCHAR}, #{ext1,jdbcType=VARCHAR}, ", + "#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" + }) + @Options(useGeneratedKeys=true,keyProperty="id") + int insert(BsHltCardRecord record); + + @InsertProvider(type=BsHltCardRecordSqlProvider.class, method="insertSelective") + @Options(useGeneratedKeys=true,keyProperty="id") + int insertSelective(BsHltCardRecord record); + + @SelectProvider(type=BsHltCardRecordSqlProvider.class, method="selectByExample") + @Results({ + @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="order_no", property="orderNo", jdbcType=JdbcType.VARCHAR), + @Result(column="card_no", property="cardNo", jdbcType=JdbcType.VARCHAR), + @Result(column="user_phone", property="userPhone", jdbcType=JdbcType.VARCHAR), + @Result(column="pay_order_no", property="payOrderNo", jdbcType=JdbcType.VARCHAR), + @Result(column="pay_serial_no", property="paySerialNo", jdbcType=JdbcType.VARCHAR), + @Result(column="pay_price", property="payPrice", jdbcType=JdbcType.DECIMAL), + @Result(column="pay_status", property="payStatus", jdbcType=JdbcType.INTEGER), + @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="pay_time", property="payTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="refund_time", property="refundTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="exception_status", property="exceptionStatus", jdbcType=JdbcType.BIT), + @Result(column="exception_content", property="exceptionContent", jdbcType=JdbcType.VARCHAR), + @Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR), + @Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR), + @Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR) + }) + List selectByExample(BsHltCardRecordExample example); + + @Select({ + "select", + "id, order_no, card_no, user_phone, pay_order_no, pay_serial_no, pay_price, pay_status, ", + "create_time, update_time, pay_time, refund_time, exception_status, exception_content, ", + "ext_1, ext_2, ext_3", + "from bs_hlt_card_record", + "where id = #{id,jdbcType=BIGINT}" + }) + @Results({ + @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="order_no", property="orderNo", jdbcType=JdbcType.VARCHAR), + @Result(column="card_no", property="cardNo", jdbcType=JdbcType.VARCHAR), + @Result(column="user_phone", property="userPhone", jdbcType=JdbcType.VARCHAR), + @Result(column="pay_order_no", property="payOrderNo", jdbcType=JdbcType.VARCHAR), + @Result(column="pay_serial_no", property="paySerialNo", jdbcType=JdbcType.VARCHAR), + @Result(column="pay_price", property="payPrice", jdbcType=JdbcType.DECIMAL), + @Result(column="pay_status", property="payStatus", jdbcType=JdbcType.INTEGER), + @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="pay_time", property="payTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="refund_time", property="refundTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="exception_status", property="exceptionStatus", jdbcType=JdbcType.BIT), + @Result(column="exception_content", property="exceptionContent", jdbcType=JdbcType.VARCHAR), + @Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR), + @Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR), + @Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR) + }) + BsHltCardRecord selectByPrimaryKey(Long id); + + @UpdateProvider(type=BsHltCardRecordSqlProvider.class, method="updateByExampleSelective") + int updateByExampleSelective(@Param("record") BsHltCardRecord record, @Param("example") BsHltCardRecordExample example); + + @UpdateProvider(type=BsHltCardRecordSqlProvider.class, method="updateByExample") + int updateByExample(@Param("record") BsHltCardRecord record, @Param("example") BsHltCardRecordExample example); + + @UpdateProvider(type=BsHltCardRecordSqlProvider.class, method="updateByPrimaryKeySelective") + int updateByPrimaryKeySelective(BsHltCardRecord record); + + @Update({ + "update bs_hlt_card_record", + "set order_no = #{orderNo,jdbcType=VARCHAR},", + "card_no = #{cardNo,jdbcType=VARCHAR},", + "user_phone = #{userPhone,jdbcType=VARCHAR},", + "pay_order_no = #{payOrderNo,jdbcType=VARCHAR},", + "pay_serial_no = #{paySerialNo,jdbcType=VARCHAR},", + "pay_price = #{payPrice,jdbcType=DECIMAL},", + "pay_status = #{payStatus,jdbcType=INTEGER},", + "create_time = #{createTime,jdbcType=TIMESTAMP},", + "update_time = #{updateTime,jdbcType=TIMESTAMP},", + "pay_time = #{payTime,jdbcType=TIMESTAMP},", + "refund_time = #{refundTime,jdbcType=TIMESTAMP},", + "exception_status = #{exceptionStatus,jdbcType=BIT},", + "exception_content = #{exceptionContent,jdbcType=VARCHAR},", + "ext_1 = #{ext1,jdbcType=VARCHAR},", + "ext_2 = #{ext2,jdbcType=VARCHAR},", + "ext_3 = #{ext3,jdbcType=VARCHAR}", + "where id = #{id,jdbcType=BIGINT}" + }) + int updateByPrimaryKey(BsHltCardRecord record); +} \ No newline at end of file diff --git a/service/src/main/java/com/hfkj/dao/BsHltCardRecordMapperExt.java b/service/src/main/java/com/hfkj/dao/BsHltCardRecordMapperExt.java new file mode 100644 index 0000000..0646446 --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/BsHltCardRecordMapperExt.java @@ -0,0 +1,7 @@ +package com.hfkj.dao; + +/** + * mapper扩展类 + */ +public interface BsHltCardRecordMapperExt { +} \ No newline at end of file diff --git a/service/src/main/java/com/hfkj/dao/BsHltCardRecordSqlProvider.java b/service/src/main/java/com/hfkj/dao/BsHltCardRecordSqlProvider.java new file mode 100644 index 0000000..3bcae85 --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/BsHltCardRecordSqlProvider.java @@ -0,0 +1,402 @@ +package com.hfkj.dao; + +import com.hfkj.entity.BsHltCardRecord; +import com.hfkj.entity.BsHltCardRecordExample.Criteria; +import com.hfkj.entity.BsHltCardRecordExample.Criterion; +import com.hfkj.entity.BsHltCardRecordExample; +import java.util.List; +import java.util.Map; +import org.apache.ibatis.jdbc.SQL; + +public class BsHltCardRecordSqlProvider { + + public String countByExample(BsHltCardRecordExample example) { + SQL sql = new SQL(); + sql.SELECT("count(*)").FROM("bs_hlt_card_record"); + applyWhere(sql, example, false); + return sql.toString(); + } + + public String deleteByExample(BsHltCardRecordExample example) { + SQL sql = new SQL(); + sql.DELETE_FROM("bs_hlt_card_record"); + applyWhere(sql, example, false); + return sql.toString(); + } + + public String insertSelective(BsHltCardRecord record) { + SQL sql = new SQL(); + sql.INSERT_INTO("bs_hlt_card_record"); + + if (record.getOrderNo() != null) { + sql.VALUES("order_no", "#{orderNo,jdbcType=VARCHAR}"); + } + + if (record.getCardNo() != null) { + sql.VALUES("card_no", "#{cardNo,jdbcType=VARCHAR}"); + } + + if (record.getUserPhone() != null) { + sql.VALUES("user_phone", "#{userPhone,jdbcType=VARCHAR}"); + } + + if (record.getPayOrderNo() != null) { + sql.VALUES("pay_order_no", "#{payOrderNo,jdbcType=VARCHAR}"); + } + + if (record.getPaySerialNo() != null) { + sql.VALUES("pay_serial_no", "#{paySerialNo,jdbcType=VARCHAR}"); + } + + if (record.getPayPrice() != null) { + sql.VALUES("pay_price", "#{payPrice,jdbcType=DECIMAL}"); + } + + if (record.getPayStatus() != null) { + sql.VALUES("pay_status", "#{payStatus,jdbcType=INTEGER}"); + } + + if (record.getCreateTime() != null) { + sql.VALUES("create_time", "#{createTime,jdbcType=TIMESTAMP}"); + } + + if (record.getUpdateTime() != null) { + sql.VALUES("update_time", "#{updateTime,jdbcType=TIMESTAMP}"); + } + + if (record.getPayTime() != null) { + sql.VALUES("pay_time", "#{payTime,jdbcType=TIMESTAMP}"); + } + + if (record.getRefundTime() != null) { + sql.VALUES("refund_time", "#{refundTime,jdbcType=TIMESTAMP}"); + } + + if (record.getExceptionStatus() != null) { + sql.VALUES("exception_status", "#{exceptionStatus,jdbcType=BIT}"); + } + + if (record.getExceptionContent() != null) { + sql.VALUES("exception_content", "#{exceptionContent,jdbcType=VARCHAR}"); + } + + if (record.getExt1() != null) { + sql.VALUES("ext_1", "#{ext1,jdbcType=VARCHAR}"); + } + + if (record.getExt2() != null) { + sql.VALUES("ext_2", "#{ext2,jdbcType=VARCHAR}"); + } + + if (record.getExt3() != null) { + sql.VALUES("ext_3", "#{ext3,jdbcType=VARCHAR}"); + } + + return sql.toString(); + } + + public String selectByExample(BsHltCardRecordExample example) { + SQL sql = new SQL(); + if (example != null && example.isDistinct()) { + sql.SELECT_DISTINCT("id"); + } else { + sql.SELECT("id"); + } + sql.SELECT("order_no"); + sql.SELECT("card_no"); + sql.SELECT("user_phone"); + sql.SELECT("pay_order_no"); + sql.SELECT("pay_serial_no"); + sql.SELECT("pay_price"); + sql.SELECT("pay_status"); + sql.SELECT("create_time"); + sql.SELECT("update_time"); + sql.SELECT("pay_time"); + sql.SELECT("refund_time"); + sql.SELECT("exception_status"); + sql.SELECT("exception_content"); + sql.SELECT("ext_1"); + sql.SELECT("ext_2"); + sql.SELECT("ext_3"); + sql.FROM("bs_hlt_card_record"); + applyWhere(sql, example, false); + + if (example != null && example.getOrderByClause() != null) { + sql.ORDER_BY(example.getOrderByClause()); + } + + return sql.toString(); + } + + public String updateByExampleSelective(Map parameter) { + BsHltCardRecord record = (BsHltCardRecord) parameter.get("record"); + BsHltCardRecordExample example = (BsHltCardRecordExample) parameter.get("example"); + + SQL sql = new SQL(); + sql.UPDATE("bs_hlt_card_record"); + + if (record.getId() != null) { + sql.SET("id = #{record.id,jdbcType=BIGINT}"); + } + + if (record.getOrderNo() != null) { + sql.SET("order_no = #{record.orderNo,jdbcType=VARCHAR}"); + } + + if (record.getCardNo() != null) { + sql.SET("card_no = #{record.cardNo,jdbcType=VARCHAR}"); + } + + if (record.getUserPhone() != null) { + sql.SET("user_phone = #{record.userPhone,jdbcType=VARCHAR}"); + } + + if (record.getPayOrderNo() != null) { + sql.SET("pay_order_no = #{record.payOrderNo,jdbcType=VARCHAR}"); + } + + if (record.getPaySerialNo() != null) { + sql.SET("pay_serial_no = #{record.paySerialNo,jdbcType=VARCHAR}"); + } + + if (record.getPayPrice() != null) { + sql.SET("pay_price = #{record.payPrice,jdbcType=DECIMAL}"); + } + + if (record.getPayStatus() != null) { + sql.SET("pay_status = #{record.payStatus,jdbcType=INTEGER}"); + } + + if (record.getCreateTime() != null) { + sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); + } + + if (record.getUpdateTime() != null) { + sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}"); + } + + if (record.getPayTime() != null) { + sql.SET("pay_time = #{record.payTime,jdbcType=TIMESTAMP}"); + } + + if (record.getRefundTime() != null) { + sql.SET("refund_time = #{record.refundTime,jdbcType=TIMESTAMP}"); + } + + if (record.getExceptionStatus() != null) { + sql.SET("exception_status = #{record.exceptionStatus,jdbcType=BIT}"); + } + + if (record.getExceptionContent() != null) { + sql.SET("exception_content = #{record.exceptionContent,jdbcType=VARCHAR}"); + } + + if (record.getExt1() != null) { + sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}"); + } + + if (record.getExt2() != null) { + sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}"); + } + + if (record.getExt3() != null) { + sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}"); + } + + applyWhere(sql, example, true); + return sql.toString(); + } + + public String updateByExample(Map parameter) { + SQL sql = new SQL(); + sql.UPDATE("bs_hlt_card_record"); + + sql.SET("id = #{record.id,jdbcType=BIGINT}"); + sql.SET("order_no = #{record.orderNo,jdbcType=VARCHAR}"); + sql.SET("card_no = #{record.cardNo,jdbcType=VARCHAR}"); + sql.SET("user_phone = #{record.userPhone,jdbcType=VARCHAR}"); + sql.SET("pay_order_no = #{record.payOrderNo,jdbcType=VARCHAR}"); + sql.SET("pay_serial_no = #{record.paySerialNo,jdbcType=VARCHAR}"); + sql.SET("pay_price = #{record.payPrice,jdbcType=DECIMAL}"); + sql.SET("pay_status = #{record.payStatus,jdbcType=INTEGER}"); + sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); + sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}"); + sql.SET("pay_time = #{record.payTime,jdbcType=TIMESTAMP}"); + sql.SET("refund_time = #{record.refundTime,jdbcType=TIMESTAMP}"); + sql.SET("exception_status = #{record.exceptionStatus,jdbcType=BIT}"); + sql.SET("exception_content = #{record.exceptionContent,jdbcType=VARCHAR}"); + sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}"); + sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}"); + sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}"); + + BsHltCardRecordExample example = (BsHltCardRecordExample) parameter.get("example"); + applyWhere(sql, example, true); + return sql.toString(); + } + + public String updateByPrimaryKeySelective(BsHltCardRecord record) { + SQL sql = new SQL(); + sql.UPDATE("bs_hlt_card_record"); + + if (record.getOrderNo() != null) { + sql.SET("order_no = #{orderNo,jdbcType=VARCHAR}"); + } + + if (record.getCardNo() != null) { + sql.SET("card_no = #{cardNo,jdbcType=VARCHAR}"); + } + + if (record.getUserPhone() != null) { + sql.SET("user_phone = #{userPhone,jdbcType=VARCHAR}"); + } + + if (record.getPayOrderNo() != null) { + sql.SET("pay_order_no = #{payOrderNo,jdbcType=VARCHAR}"); + } + + if (record.getPaySerialNo() != null) { + sql.SET("pay_serial_no = #{paySerialNo,jdbcType=VARCHAR}"); + } + + if (record.getPayPrice() != null) { + sql.SET("pay_price = #{payPrice,jdbcType=DECIMAL}"); + } + + if (record.getPayStatus() != null) { + sql.SET("pay_status = #{payStatus,jdbcType=INTEGER}"); + } + + if (record.getCreateTime() != null) { + sql.SET("create_time = #{createTime,jdbcType=TIMESTAMP}"); + } + + if (record.getUpdateTime() != null) { + sql.SET("update_time = #{updateTime,jdbcType=TIMESTAMP}"); + } + + if (record.getPayTime() != null) { + sql.SET("pay_time = #{payTime,jdbcType=TIMESTAMP}"); + } + + if (record.getRefundTime() != null) { + sql.SET("refund_time = #{refundTime,jdbcType=TIMESTAMP}"); + } + + if (record.getExceptionStatus() != null) { + sql.SET("exception_status = #{exceptionStatus,jdbcType=BIT}"); + } + + if (record.getExceptionContent() != null) { + sql.SET("exception_content = #{exceptionContent,jdbcType=VARCHAR}"); + } + + if (record.getExt1() != null) { + sql.SET("ext_1 = #{ext1,jdbcType=VARCHAR}"); + } + + if (record.getExt2() != null) { + sql.SET("ext_2 = #{ext2,jdbcType=VARCHAR}"); + } + + if (record.getExt3() != null) { + sql.SET("ext_3 = #{ext3,jdbcType=VARCHAR}"); + } + + sql.WHERE("id = #{id,jdbcType=BIGINT}"); + + return sql.toString(); + } + + protected void applyWhere(SQL sql, BsHltCardRecordExample example, boolean includeExamplePhrase) { + if (example == null) { + return; + } + + String parmPhrase1; + String parmPhrase1_th; + String parmPhrase2; + String parmPhrase2_th; + String parmPhrase3; + String parmPhrase3_th; + if (includeExamplePhrase) { + parmPhrase1 = "%s #{example.oredCriteria[%d].allCriteria[%d].value}"; + parmPhrase1_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}"; + parmPhrase2 = "%s #{example.oredCriteria[%d].allCriteria[%d].value} and #{example.oredCriteria[%d].criteria[%d].secondValue}"; + parmPhrase2_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{example.oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}"; + parmPhrase3 = "#{example.oredCriteria[%d].allCriteria[%d].value[%d]}"; + parmPhrase3_th = "#{example.oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}"; + } else { + parmPhrase1 = "%s #{oredCriteria[%d].allCriteria[%d].value}"; + parmPhrase1_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}"; + parmPhrase2 = "%s #{oredCriteria[%d].allCriteria[%d].value} and #{oredCriteria[%d].criteria[%d].secondValue}"; + parmPhrase2_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}"; + parmPhrase3 = "#{oredCriteria[%d].allCriteria[%d].value[%d]}"; + parmPhrase3_th = "#{oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}"; + } + + StringBuilder sb = new StringBuilder(); + List oredCriteria = example.getOredCriteria(); + boolean firstCriteria = true; + for (int i = 0; i < oredCriteria.size(); i++) { + Criteria criteria = oredCriteria.get(i); + if (criteria.isValid()) { + if (firstCriteria) { + firstCriteria = false; + } else { + sb.append(" or "); + } + + sb.append('('); + List criterions = criteria.getAllCriteria(); + boolean firstCriterion = true; + for (int j = 0; j < criterions.size(); j++) { + Criterion criterion = criterions.get(j); + if (firstCriterion) { + firstCriterion = false; + } else { + sb.append(" and "); + } + + if (criterion.isNoValue()) { + sb.append(criterion.getCondition()); + } else if (criterion.isSingleValue()) { + if (criterion.getTypeHandler() == null) { + sb.append(String.format(parmPhrase1, criterion.getCondition(), i, j)); + } else { + sb.append(String.format(parmPhrase1_th, criterion.getCondition(), i, j,criterion.getTypeHandler())); + } + } else if (criterion.isBetweenValue()) { + if (criterion.getTypeHandler() == null) { + sb.append(String.format(parmPhrase2, criterion.getCondition(), i, j, i, j)); + } else { + sb.append(String.format(parmPhrase2_th, criterion.getCondition(), i, j, criterion.getTypeHandler(), i, j, criterion.getTypeHandler())); + } + } else if (criterion.isListValue()) { + sb.append(criterion.getCondition()); + sb.append(" ("); + List listItems = (List) criterion.getValue(); + boolean comma = false; + for (int k = 0; k < listItems.size(); k++) { + if (comma) { + sb.append(", "); + } else { + comma = true; + } + if (criterion.getTypeHandler() == null) { + sb.append(String.format(parmPhrase3, i, j, k)); + } else { + sb.append(String.format(parmPhrase3_th, i, j, k, criterion.getTypeHandler())); + } + } + sb.append(')'); + } + } + sb.append(')'); + } + } + + if (sb.length() > 0) { + sql.WHERE(sb.toString()); + } + } +} \ No newline at end of file diff --git a/service/src/main/java/com/hfkj/entity/BsHltCardRecord.java b/service/src/main/java/com/hfkj/entity/BsHltCardRecord.java new file mode 100644 index 0000000..9a8d3c2 --- /dev/null +++ b/service/src/main/java/com/hfkj/entity/BsHltCardRecord.java @@ -0,0 +1,313 @@ +package com.hfkj.entity; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +/** + * bs_hlt_card_record + * @author + */ +/** + * + * 代码由工具生成 + * + **/ +public class BsHltCardRecord implements Serializable { + /** + * 主键 + */ + private Long id; + + /** + * 订单号 + */ + private String orderNo; + + /** + * 卡号 + */ + private String cardNo; + + /** + * 用户电话 + */ + private String userPhone; + + /** + * 支付订单号 + */ + private String payOrderNo; + + /** + * 渠道支付订单号 + */ + private String paySerialNo; + + /** + * 支付金额 + */ + private BigDecimal payPrice; + + /** + * 支付状态 1:待支付 2:已支付 3:已退款 + */ + private Integer payStatus; + + /** + * 创建时间 + */ + private Date createTime; + + /** + * 修改时间 + */ + private Date updateTime; + + /** + * 支付时间 + */ + private Date payTime; + + /** + * 退款时间 + */ + private Date refundTime; + + /** + * 是否异常0:否 1:是 + */ + private Boolean exceptionStatus; + + /** + * 异常内容 + */ + private String exceptionContent; + + private String ext1; + + private String ext2; + + private String ext3; + + private static final long serialVersionUID = 1L; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getOrderNo() { + return orderNo; + } + + public void setOrderNo(String orderNo) { + this.orderNo = orderNo; + } + + public String getCardNo() { + return cardNo; + } + + public void setCardNo(String cardNo) { + this.cardNo = cardNo; + } + + public String getUserPhone() { + return userPhone; + } + + public void setUserPhone(String userPhone) { + this.userPhone = userPhone; + } + + public String getPayOrderNo() { + return payOrderNo; + } + + public void setPayOrderNo(String payOrderNo) { + this.payOrderNo = payOrderNo; + } + + public String getPaySerialNo() { + return paySerialNo; + } + + public void setPaySerialNo(String paySerialNo) { + this.paySerialNo = paySerialNo; + } + + public BigDecimal getPayPrice() { + return payPrice; + } + + public void setPayPrice(BigDecimal payPrice) { + this.payPrice = payPrice; + } + + public Integer getPayStatus() { + return payStatus; + } + + public void setPayStatus(Integer payStatus) { + this.payStatus = payStatus; + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + public Date getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(Date updateTime) { + this.updateTime = updateTime; + } + + public Date getPayTime() { + return payTime; + } + + public void setPayTime(Date payTime) { + this.payTime = payTime; + } + + public Date getRefundTime() { + return refundTime; + } + + public void setRefundTime(Date refundTime) { + this.refundTime = refundTime; + } + + public Boolean getExceptionStatus() { + return exceptionStatus; + } + + public void setExceptionStatus(Boolean exceptionStatus) { + this.exceptionStatus = exceptionStatus; + } + + public String getExceptionContent() { + return exceptionContent; + } + + public void setExceptionContent(String exceptionContent) { + this.exceptionContent = exceptionContent; + } + + public String getExt1() { + return ext1; + } + + public void setExt1(String ext1) { + this.ext1 = ext1; + } + + public String getExt2() { + return ext2; + } + + public void setExt2(String ext2) { + this.ext2 = ext2; + } + + public String getExt3() { + return ext3; + } + + public void setExt3(String ext3) { + this.ext3 = ext3; + } + + @Override + public boolean equals(Object that) { + if (this == that) { + return true; + } + if (that == null) { + return false; + } + if (getClass() != that.getClass()) { + return false; + } + BsHltCardRecord other = (BsHltCardRecord) that; + return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) + && (this.getOrderNo() == null ? other.getOrderNo() == null : this.getOrderNo().equals(other.getOrderNo())) + && (this.getCardNo() == null ? other.getCardNo() == null : this.getCardNo().equals(other.getCardNo())) + && (this.getUserPhone() == null ? other.getUserPhone() == null : this.getUserPhone().equals(other.getUserPhone())) + && (this.getPayOrderNo() == null ? other.getPayOrderNo() == null : this.getPayOrderNo().equals(other.getPayOrderNo())) + && (this.getPaySerialNo() == null ? other.getPaySerialNo() == null : this.getPaySerialNo().equals(other.getPaySerialNo())) + && (this.getPayPrice() == null ? other.getPayPrice() == null : this.getPayPrice().equals(other.getPayPrice())) + && (this.getPayStatus() == null ? other.getPayStatus() == null : this.getPayStatus().equals(other.getPayStatus())) + && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime())) + && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime())) + && (this.getPayTime() == null ? other.getPayTime() == null : this.getPayTime().equals(other.getPayTime())) + && (this.getRefundTime() == null ? other.getRefundTime() == null : this.getRefundTime().equals(other.getRefundTime())) + && (this.getExceptionStatus() == null ? other.getExceptionStatus() == null : this.getExceptionStatus().equals(other.getExceptionStatus())) + && (this.getExceptionContent() == null ? other.getExceptionContent() == null : this.getExceptionContent().equals(other.getExceptionContent())) + && (this.getExt1() == null ? other.getExt1() == null : this.getExt1().equals(other.getExt1())) + && (this.getExt2() == null ? other.getExt2() == null : this.getExt2().equals(other.getExt2())) + && (this.getExt3() == null ? other.getExt3() == null : this.getExt3().equals(other.getExt3())); + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); + result = prime * result + ((getOrderNo() == null) ? 0 : getOrderNo().hashCode()); + result = prime * result + ((getCardNo() == null) ? 0 : getCardNo().hashCode()); + result = prime * result + ((getUserPhone() == null) ? 0 : getUserPhone().hashCode()); + result = prime * result + ((getPayOrderNo() == null) ? 0 : getPayOrderNo().hashCode()); + result = prime * result + ((getPaySerialNo() == null) ? 0 : getPaySerialNo().hashCode()); + result = prime * result + ((getPayPrice() == null) ? 0 : getPayPrice().hashCode()); + result = prime * result + ((getPayStatus() == null) ? 0 : getPayStatus().hashCode()); + result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode()); + result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode()); + result = prime * result + ((getPayTime() == null) ? 0 : getPayTime().hashCode()); + result = prime * result + ((getRefundTime() == null) ? 0 : getRefundTime().hashCode()); + result = prime * result + ((getExceptionStatus() == null) ? 0 : getExceptionStatus().hashCode()); + result = prime * result + ((getExceptionContent() == null) ? 0 : getExceptionContent().hashCode()); + result = prime * result + ((getExt1() == null) ? 0 : getExt1().hashCode()); + result = prime * result + ((getExt2() == null) ? 0 : getExt2().hashCode()); + result = prime * result + ((getExt3() == null) ? 0 : getExt3().hashCode()); + return result; + } + + @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(", orderNo=").append(orderNo); + sb.append(", cardNo=").append(cardNo); + sb.append(", userPhone=").append(userPhone); + sb.append(", payOrderNo=").append(payOrderNo); + sb.append(", paySerialNo=").append(paySerialNo); + sb.append(", payPrice=").append(payPrice); + sb.append(", payStatus=").append(payStatus); + sb.append(", createTime=").append(createTime); + sb.append(", updateTime=").append(updateTime); + sb.append(", payTime=").append(payTime); + sb.append(", refundTime=").append(refundTime); + sb.append(", exceptionStatus=").append(exceptionStatus); + sb.append(", exceptionContent=").append(exceptionContent); + sb.append(", ext1=").append(ext1); + sb.append(", ext2=").append(ext2); + sb.append(", ext3=").append(ext3); + sb.append(", serialVersionUID=").append(serialVersionUID); + sb.append("]"); + return sb.toString(); + } +} \ No newline at end of file diff --git a/service/src/main/java/com/hfkj/entity/BsHltCardRecordExample.java b/service/src/main/java/com/hfkj/entity/BsHltCardRecordExample.java new file mode 100644 index 0000000..7352432 --- /dev/null +++ b/service/src/main/java/com/hfkj/entity/BsHltCardRecordExample.java @@ -0,0 +1,1334 @@ +package com.hfkj.entity; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class BsHltCardRecordExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + private Integer limit; + + private Long offset; + + public BsHltCardRecordExample() { + oredCriteria = new ArrayList(); + } + + 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 getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + public void setLimit(Integer limit) { + this.limit = limit; + } + + public Integer getLimit() { + return limit; + } + + public void setOffset(Long offset) { + this.offset = offset; + } + + public Long getOffset() { + return offset; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List 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(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andOrderNoIsNull() { + addCriterion("order_no is null"); + return (Criteria) this; + } + + public Criteria andOrderNoIsNotNull() { + addCriterion("order_no is not null"); + return (Criteria) this; + } + + public Criteria andOrderNoEqualTo(String value) { + addCriterion("order_no =", value, "orderNo"); + return (Criteria) this; + } + + public Criteria andOrderNoNotEqualTo(String value) { + addCriterion("order_no <>", value, "orderNo"); + return (Criteria) this; + } + + public Criteria andOrderNoGreaterThan(String value) { + addCriterion("order_no >", value, "orderNo"); + return (Criteria) this; + } + + public Criteria andOrderNoGreaterThanOrEqualTo(String value) { + addCriterion("order_no >=", value, "orderNo"); + return (Criteria) this; + } + + public Criteria andOrderNoLessThan(String value) { + addCriterion("order_no <", value, "orderNo"); + return (Criteria) this; + } + + public Criteria andOrderNoLessThanOrEqualTo(String value) { + addCriterion("order_no <=", value, "orderNo"); + return (Criteria) this; + } + + public Criteria andOrderNoLike(String value) { + addCriterion("order_no like", value, "orderNo"); + return (Criteria) this; + } + + public Criteria andOrderNoNotLike(String value) { + addCriterion("order_no not like", value, "orderNo"); + return (Criteria) this; + } + + public Criteria andOrderNoIn(List values) { + addCriterion("order_no in", values, "orderNo"); + return (Criteria) this; + } + + public Criteria andOrderNoNotIn(List values) { + addCriterion("order_no not in", values, "orderNo"); + return (Criteria) this; + } + + public Criteria andOrderNoBetween(String value1, String value2) { + addCriterion("order_no between", value1, value2, "orderNo"); + return (Criteria) this; + } + + public Criteria andOrderNoNotBetween(String value1, String value2) { + addCriterion("order_no not between", value1, value2, "orderNo"); + return (Criteria) this; + } + + public Criteria andCardNoIsNull() { + addCriterion("card_no is null"); + return (Criteria) this; + } + + public Criteria andCardNoIsNotNull() { + addCriterion("card_no is not null"); + return (Criteria) this; + } + + public Criteria andCardNoEqualTo(String value) { + addCriterion("card_no =", value, "cardNo"); + return (Criteria) this; + } + + public Criteria andCardNoNotEqualTo(String value) { + addCriterion("card_no <>", value, "cardNo"); + return (Criteria) this; + } + + public Criteria andCardNoGreaterThan(String value) { + addCriterion("card_no >", value, "cardNo"); + return (Criteria) this; + } + + public Criteria andCardNoGreaterThanOrEqualTo(String value) { + addCriterion("card_no >=", value, "cardNo"); + return (Criteria) this; + } + + public Criteria andCardNoLessThan(String value) { + addCriterion("card_no <", value, "cardNo"); + return (Criteria) this; + } + + public Criteria andCardNoLessThanOrEqualTo(String value) { + addCriterion("card_no <=", value, "cardNo"); + return (Criteria) this; + } + + public Criteria andCardNoLike(String value) { + addCriterion("card_no like", value, "cardNo"); + return (Criteria) this; + } + + public Criteria andCardNoNotLike(String value) { + addCriterion("card_no not like", value, "cardNo"); + return (Criteria) this; + } + + public Criteria andCardNoIn(List values) { + addCriterion("card_no in", values, "cardNo"); + return (Criteria) this; + } + + public Criteria andCardNoNotIn(List values) { + addCriterion("card_no not in", values, "cardNo"); + return (Criteria) this; + } + + public Criteria andCardNoBetween(String value1, String value2) { + addCriterion("card_no between", value1, value2, "cardNo"); + return (Criteria) this; + } + + public Criteria andCardNoNotBetween(String value1, String value2) { + addCriterion("card_no not between", value1, value2, "cardNo"); + return (Criteria) this; + } + + public Criteria andUserPhoneIsNull() { + addCriterion("user_phone is null"); + return (Criteria) this; + } + + public Criteria andUserPhoneIsNotNull() { + addCriterion("user_phone is not null"); + return (Criteria) this; + } + + public Criteria andUserPhoneEqualTo(String value) { + addCriterion("user_phone =", value, "userPhone"); + return (Criteria) this; + } + + public Criteria andUserPhoneNotEqualTo(String value) { + addCriterion("user_phone <>", value, "userPhone"); + return (Criteria) this; + } + + public Criteria andUserPhoneGreaterThan(String value) { + addCriterion("user_phone >", value, "userPhone"); + return (Criteria) this; + } + + public Criteria andUserPhoneGreaterThanOrEqualTo(String value) { + addCriterion("user_phone >=", value, "userPhone"); + return (Criteria) this; + } + + public Criteria andUserPhoneLessThan(String value) { + addCriterion("user_phone <", value, "userPhone"); + return (Criteria) this; + } + + public Criteria andUserPhoneLessThanOrEqualTo(String value) { + addCriterion("user_phone <=", value, "userPhone"); + return (Criteria) this; + } + + public Criteria andUserPhoneLike(String value) { + addCriterion("user_phone like", value, "userPhone"); + return (Criteria) this; + } + + public Criteria andUserPhoneNotLike(String value) { + addCriterion("user_phone not like", value, "userPhone"); + return (Criteria) this; + } + + public Criteria andUserPhoneIn(List values) { + addCriterion("user_phone in", values, "userPhone"); + return (Criteria) this; + } + + public Criteria andUserPhoneNotIn(List values) { + addCriterion("user_phone not in", values, "userPhone"); + return (Criteria) this; + } + + public Criteria andUserPhoneBetween(String value1, String value2) { + addCriterion("user_phone between", value1, value2, "userPhone"); + return (Criteria) this; + } + + public Criteria andUserPhoneNotBetween(String value1, String value2) { + addCriterion("user_phone not between", value1, value2, "userPhone"); + return (Criteria) this; + } + + public Criteria andPayOrderNoIsNull() { + addCriterion("pay_order_no is null"); + return (Criteria) this; + } + + public Criteria andPayOrderNoIsNotNull() { + addCriterion("pay_order_no is not null"); + return (Criteria) this; + } + + public Criteria andPayOrderNoEqualTo(String value) { + addCriterion("pay_order_no =", value, "payOrderNo"); + return (Criteria) this; + } + + public Criteria andPayOrderNoNotEqualTo(String value) { + addCriterion("pay_order_no <>", value, "payOrderNo"); + return (Criteria) this; + } + + public Criteria andPayOrderNoGreaterThan(String value) { + addCriterion("pay_order_no >", value, "payOrderNo"); + return (Criteria) this; + } + + public Criteria andPayOrderNoGreaterThanOrEqualTo(String value) { + addCriterion("pay_order_no >=", value, "payOrderNo"); + return (Criteria) this; + } + + public Criteria andPayOrderNoLessThan(String value) { + addCriterion("pay_order_no <", value, "payOrderNo"); + return (Criteria) this; + } + + public Criteria andPayOrderNoLessThanOrEqualTo(String value) { + addCriterion("pay_order_no <=", value, "payOrderNo"); + return (Criteria) this; + } + + public Criteria andPayOrderNoLike(String value) { + addCriterion("pay_order_no like", value, "payOrderNo"); + return (Criteria) this; + } + + public Criteria andPayOrderNoNotLike(String value) { + addCriterion("pay_order_no not like", value, "payOrderNo"); + return (Criteria) this; + } + + public Criteria andPayOrderNoIn(List values) { + addCriterion("pay_order_no in", values, "payOrderNo"); + return (Criteria) this; + } + + public Criteria andPayOrderNoNotIn(List values) { + addCriterion("pay_order_no not in", values, "payOrderNo"); + return (Criteria) this; + } + + public Criteria andPayOrderNoBetween(String value1, String value2) { + addCriterion("pay_order_no between", value1, value2, "payOrderNo"); + return (Criteria) this; + } + + public Criteria andPayOrderNoNotBetween(String value1, String value2) { + addCriterion("pay_order_no not between", value1, value2, "payOrderNo"); + return (Criteria) this; + } + + public Criteria andPaySerialNoIsNull() { + addCriterion("pay_serial_no is null"); + return (Criteria) this; + } + + public Criteria andPaySerialNoIsNotNull() { + addCriterion("pay_serial_no is not null"); + return (Criteria) this; + } + + public Criteria andPaySerialNoEqualTo(String value) { + addCriterion("pay_serial_no =", value, "paySerialNo"); + return (Criteria) this; + } + + public Criteria andPaySerialNoNotEqualTo(String value) { + addCriterion("pay_serial_no <>", value, "paySerialNo"); + return (Criteria) this; + } + + public Criteria andPaySerialNoGreaterThan(String value) { + addCriterion("pay_serial_no >", value, "paySerialNo"); + return (Criteria) this; + } + + public Criteria andPaySerialNoGreaterThanOrEqualTo(String value) { + addCriterion("pay_serial_no >=", value, "paySerialNo"); + return (Criteria) this; + } + + public Criteria andPaySerialNoLessThan(String value) { + addCriterion("pay_serial_no <", value, "paySerialNo"); + return (Criteria) this; + } + + public Criteria andPaySerialNoLessThanOrEqualTo(String value) { + addCriterion("pay_serial_no <=", value, "paySerialNo"); + return (Criteria) this; + } + + public Criteria andPaySerialNoLike(String value) { + addCriterion("pay_serial_no like", value, "paySerialNo"); + return (Criteria) this; + } + + public Criteria andPaySerialNoNotLike(String value) { + addCriterion("pay_serial_no not like", value, "paySerialNo"); + return (Criteria) this; + } + + public Criteria andPaySerialNoIn(List values) { + addCriterion("pay_serial_no in", values, "paySerialNo"); + return (Criteria) this; + } + + public Criteria andPaySerialNoNotIn(List values) { + addCriterion("pay_serial_no not in", values, "paySerialNo"); + return (Criteria) this; + } + + public Criteria andPaySerialNoBetween(String value1, String value2) { + addCriterion("pay_serial_no between", value1, value2, "paySerialNo"); + return (Criteria) this; + } + + public Criteria andPaySerialNoNotBetween(String value1, String value2) { + addCriterion("pay_serial_no not between", value1, value2, "paySerialNo"); + return (Criteria) this; + } + + public Criteria andPayPriceIsNull() { + addCriterion("pay_price is null"); + return (Criteria) this; + } + + public Criteria andPayPriceIsNotNull() { + addCriterion("pay_price is not null"); + return (Criteria) this; + } + + public Criteria andPayPriceEqualTo(BigDecimal value) { + addCriterion("pay_price =", value, "payPrice"); + return (Criteria) this; + } + + public Criteria andPayPriceNotEqualTo(BigDecimal value) { + addCriterion("pay_price <>", value, "payPrice"); + return (Criteria) this; + } + + public Criteria andPayPriceGreaterThan(BigDecimal value) { + addCriterion("pay_price >", value, "payPrice"); + return (Criteria) this; + } + + public Criteria andPayPriceGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("pay_price >=", value, "payPrice"); + return (Criteria) this; + } + + public Criteria andPayPriceLessThan(BigDecimal value) { + addCriterion("pay_price <", value, "payPrice"); + return (Criteria) this; + } + + public Criteria andPayPriceLessThanOrEqualTo(BigDecimal value) { + addCriterion("pay_price <=", value, "payPrice"); + return (Criteria) this; + } + + public Criteria andPayPriceIn(List values) { + addCriterion("pay_price in", values, "payPrice"); + return (Criteria) this; + } + + public Criteria andPayPriceNotIn(List values) { + addCriterion("pay_price not in", values, "payPrice"); + return (Criteria) this; + } + + public Criteria andPayPriceBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("pay_price between", value1, value2, "payPrice"); + return (Criteria) this; + } + + public Criteria andPayPriceNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("pay_price not between", value1, value2, "payPrice"); + return (Criteria) this; + } + + public Criteria andPayStatusIsNull() { + addCriterion("pay_status is null"); + return (Criteria) this; + } + + public Criteria andPayStatusIsNotNull() { + addCriterion("pay_status is not null"); + return (Criteria) this; + } + + public Criteria andPayStatusEqualTo(Integer value) { + addCriterion("pay_status =", value, "payStatus"); + return (Criteria) this; + } + + public Criteria andPayStatusNotEqualTo(Integer value) { + addCriterion("pay_status <>", value, "payStatus"); + return (Criteria) this; + } + + public Criteria andPayStatusGreaterThan(Integer value) { + addCriterion("pay_status >", value, "payStatus"); + return (Criteria) this; + } + + public Criteria andPayStatusGreaterThanOrEqualTo(Integer value) { + addCriterion("pay_status >=", value, "payStatus"); + return (Criteria) this; + } + + public Criteria andPayStatusLessThan(Integer value) { + addCriterion("pay_status <", value, "payStatus"); + return (Criteria) this; + } + + public Criteria andPayStatusLessThanOrEqualTo(Integer value) { + addCriterion("pay_status <=", value, "payStatus"); + return (Criteria) this; + } + + public Criteria andPayStatusIn(List values) { + addCriterion("pay_status in", values, "payStatus"); + return (Criteria) this; + } + + public Criteria andPayStatusNotIn(List values) { + addCriterion("pay_status not in", values, "payStatus"); + return (Criteria) this; + } + + public Criteria andPayStatusBetween(Integer value1, Integer value2) { + addCriterion("pay_status between", value1, value2, "payStatus"); + return (Criteria) this; + } + + public Criteria andPayStatusNotBetween(Integer value1, Integer value2) { + addCriterion("pay_status not between", value1, value2, "payStatus"); + 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; + } + + public Criteria andCreateTimeNotEqualTo(Date value) { + addCriterion("create_time <>", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThan(Date value) { + addCriterion("create_time >", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) { + addCriterion("create_time >=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThan(Date value) { + addCriterion("create_time <", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThanOrEqualTo(Date value) { + addCriterion("create_time <=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeIn(List values) { + addCriterion("create_time in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotIn(List 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; + } + + public Criteria andUpdateTimeNotEqualTo(Date value) { + addCriterion("update_time <>", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeGreaterThan(Date value) { + addCriterion("update_time >", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeGreaterThanOrEqualTo(Date value) { + addCriterion("update_time >=", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeLessThan(Date value) { + addCriterion("update_time <", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeLessThanOrEqualTo(Date value) { + addCriterion("update_time <=", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIn(List values) { + addCriterion("update_time in", values, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotIn(List 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 andPayTimeIsNull() { + addCriterion("pay_time is null"); + return (Criteria) this; + } + + public Criteria andPayTimeIsNotNull() { + addCriterion("pay_time is not null"); + return (Criteria) this; + } + + public Criteria andPayTimeEqualTo(Date value) { + addCriterion("pay_time =", value, "payTime"); + return (Criteria) this; + } + + public Criteria andPayTimeNotEqualTo(Date value) { + addCriterion("pay_time <>", value, "payTime"); + return (Criteria) this; + } + + public Criteria andPayTimeGreaterThan(Date value) { + addCriterion("pay_time >", value, "payTime"); + return (Criteria) this; + } + + public Criteria andPayTimeGreaterThanOrEqualTo(Date value) { + addCriterion("pay_time >=", value, "payTime"); + return (Criteria) this; + } + + public Criteria andPayTimeLessThan(Date value) { + addCriterion("pay_time <", value, "payTime"); + return (Criteria) this; + } + + public Criteria andPayTimeLessThanOrEqualTo(Date value) { + addCriterion("pay_time <=", value, "payTime"); + return (Criteria) this; + } + + public Criteria andPayTimeIn(List values) { + addCriterion("pay_time in", values, "payTime"); + return (Criteria) this; + } + + public Criteria andPayTimeNotIn(List values) { + addCriterion("pay_time not in", values, "payTime"); + return (Criteria) this; + } + + public Criteria andPayTimeBetween(Date value1, Date value2) { + addCriterion("pay_time between", value1, value2, "payTime"); + return (Criteria) this; + } + + public Criteria andPayTimeNotBetween(Date value1, Date value2) { + addCriterion("pay_time not between", value1, value2, "payTime"); + return (Criteria) this; + } + + public Criteria andRefundTimeIsNull() { + addCriterion("refund_time is null"); + return (Criteria) this; + } + + public Criteria andRefundTimeIsNotNull() { + addCriterion("refund_time is not null"); + return (Criteria) this; + } + + public Criteria andRefundTimeEqualTo(Date value) { + addCriterion("refund_time =", value, "refundTime"); + return (Criteria) this; + } + + public Criteria andRefundTimeNotEqualTo(Date value) { + addCriterion("refund_time <>", value, "refundTime"); + return (Criteria) this; + } + + public Criteria andRefundTimeGreaterThan(Date value) { + addCriterion("refund_time >", value, "refundTime"); + return (Criteria) this; + } + + public Criteria andRefundTimeGreaterThanOrEqualTo(Date value) { + addCriterion("refund_time >=", value, "refundTime"); + return (Criteria) this; + } + + public Criteria andRefundTimeLessThan(Date value) { + addCriterion("refund_time <", value, "refundTime"); + return (Criteria) this; + } + + public Criteria andRefundTimeLessThanOrEqualTo(Date value) { + addCriterion("refund_time <=", value, "refundTime"); + return (Criteria) this; + } + + public Criteria andRefundTimeIn(List values) { + addCriterion("refund_time in", values, "refundTime"); + return (Criteria) this; + } + + public Criteria andRefundTimeNotIn(List values) { + addCriterion("refund_time not in", values, "refundTime"); + return (Criteria) this; + } + + public Criteria andRefundTimeBetween(Date value1, Date value2) { + addCriterion("refund_time between", value1, value2, "refundTime"); + return (Criteria) this; + } + + public Criteria andRefundTimeNotBetween(Date value1, Date value2) { + addCriterion("refund_time not between", value1, value2, "refundTime"); + return (Criteria) this; + } + + public Criteria andExceptionStatusIsNull() { + addCriterion("exception_status is null"); + return (Criteria) this; + } + + public Criteria andExceptionStatusIsNotNull() { + addCriterion("exception_status is not null"); + return (Criteria) this; + } + + public Criteria andExceptionStatusEqualTo(Boolean value) { + addCriterion("exception_status =", value, "exceptionStatus"); + return (Criteria) this; + } + + public Criteria andExceptionStatusNotEqualTo(Boolean value) { + addCriterion("exception_status <>", value, "exceptionStatus"); + return (Criteria) this; + } + + public Criteria andExceptionStatusGreaterThan(Boolean value) { + addCriterion("exception_status >", value, "exceptionStatus"); + return (Criteria) this; + } + + public Criteria andExceptionStatusGreaterThanOrEqualTo(Boolean value) { + addCriterion("exception_status >=", value, "exceptionStatus"); + return (Criteria) this; + } + + public Criteria andExceptionStatusLessThan(Boolean value) { + addCriterion("exception_status <", value, "exceptionStatus"); + return (Criteria) this; + } + + public Criteria andExceptionStatusLessThanOrEqualTo(Boolean value) { + addCriterion("exception_status <=", value, "exceptionStatus"); + return (Criteria) this; + } + + public Criteria andExceptionStatusIn(List values) { + addCriterion("exception_status in", values, "exceptionStatus"); + return (Criteria) this; + } + + public Criteria andExceptionStatusNotIn(List values) { + addCriterion("exception_status not in", values, "exceptionStatus"); + return (Criteria) this; + } + + public Criteria andExceptionStatusBetween(Boolean value1, Boolean value2) { + addCriterion("exception_status between", value1, value2, "exceptionStatus"); + return (Criteria) this; + } + + public Criteria andExceptionStatusNotBetween(Boolean value1, Boolean value2) { + addCriterion("exception_status not between", value1, value2, "exceptionStatus"); + return (Criteria) this; + } + + public Criteria andExceptionContentIsNull() { + addCriterion("exception_content is null"); + return (Criteria) this; + } + + public Criteria andExceptionContentIsNotNull() { + addCriterion("exception_content is not null"); + return (Criteria) this; + } + + public Criteria andExceptionContentEqualTo(String value) { + addCriterion("exception_content =", value, "exceptionContent"); + return (Criteria) this; + } + + public Criteria andExceptionContentNotEqualTo(String value) { + addCriterion("exception_content <>", value, "exceptionContent"); + return (Criteria) this; + } + + public Criteria andExceptionContentGreaterThan(String value) { + addCriterion("exception_content >", value, "exceptionContent"); + return (Criteria) this; + } + + public Criteria andExceptionContentGreaterThanOrEqualTo(String value) { + addCriterion("exception_content >=", value, "exceptionContent"); + return (Criteria) this; + } + + public Criteria andExceptionContentLessThan(String value) { + addCriterion("exception_content <", value, "exceptionContent"); + return (Criteria) this; + } + + public Criteria andExceptionContentLessThanOrEqualTo(String value) { + addCriterion("exception_content <=", value, "exceptionContent"); + return (Criteria) this; + } + + public Criteria andExceptionContentLike(String value) { + addCriterion("exception_content like", value, "exceptionContent"); + return (Criteria) this; + } + + public Criteria andExceptionContentNotLike(String value) { + addCriterion("exception_content not like", value, "exceptionContent"); + return (Criteria) this; + } + + public Criteria andExceptionContentIn(List values) { + addCriterion("exception_content in", values, "exceptionContent"); + return (Criteria) this; + } + + public Criteria andExceptionContentNotIn(List values) { + addCriterion("exception_content not in", values, "exceptionContent"); + return (Criteria) this; + } + + public Criteria andExceptionContentBetween(String value1, String value2) { + addCriterion("exception_content between", value1, value2, "exceptionContent"); + return (Criteria) this; + } + + public Criteria andExceptionContentNotBetween(String value1, String value2) { + addCriterion("exception_content not between", value1, value2, "exceptionContent"); + return (Criteria) this; + } + + public Criteria andExt1IsNull() { + addCriterion("ext_1 is null"); + return (Criteria) this; + } + + public Criteria andExt1IsNotNull() { + addCriterion("ext_1 is not null"); + return (Criteria) this; + } + + public Criteria andExt1EqualTo(String value) { + addCriterion("ext_1 =", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1NotEqualTo(String value) { + addCriterion("ext_1 <>", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1GreaterThan(String value) { + addCriterion("ext_1 >", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1GreaterThanOrEqualTo(String value) { + addCriterion("ext_1 >=", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1LessThan(String value) { + addCriterion("ext_1 <", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1LessThanOrEqualTo(String value) { + addCriterion("ext_1 <=", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1Like(String value) { + addCriterion("ext_1 like", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1NotLike(String value) { + addCriterion("ext_1 not like", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1In(List values) { + addCriterion("ext_1 in", values, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1NotIn(List values) { + addCriterion("ext_1 not in", values, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1Between(String value1, String value2) { + addCriterion("ext_1 between", value1, value2, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1NotBetween(String value1, String value2) { + addCriterion("ext_1 not between", value1, value2, "ext1"); + return (Criteria) this; + } + + public Criteria andExt2IsNull() { + addCriterion("ext_2 is null"); + return (Criteria) this; + } + + public Criteria andExt2IsNotNull() { + addCriterion("ext_2 is not null"); + return (Criteria) this; + } + + public Criteria andExt2EqualTo(String value) { + addCriterion("ext_2 =", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2NotEqualTo(String value) { + addCriterion("ext_2 <>", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2GreaterThan(String value) { + addCriterion("ext_2 >", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2GreaterThanOrEqualTo(String value) { + addCriterion("ext_2 >=", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2LessThan(String value) { + addCriterion("ext_2 <", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2LessThanOrEqualTo(String value) { + addCriterion("ext_2 <=", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2Like(String value) { + addCriterion("ext_2 like", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2NotLike(String value) { + addCriterion("ext_2 not like", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2In(List values) { + addCriterion("ext_2 in", values, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2NotIn(List values) { + addCriterion("ext_2 not in", values, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2Between(String value1, String value2) { + addCriterion("ext_2 between", value1, value2, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2NotBetween(String value1, String value2) { + addCriterion("ext_2 not between", value1, value2, "ext2"); + return (Criteria) this; + } + + public Criteria andExt3IsNull() { + addCriterion("ext_3 is null"); + return (Criteria) this; + } + + public Criteria andExt3IsNotNull() { + addCriterion("ext_3 is not null"); + return (Criteria) this; + } + + public Criteria andExt3EqualTo(String value) { + addCriterion("ext_3 =", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3NotEqualTo(String value) { + addCriterion("ext_3 <>", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3GreaterThan(String value) { + addCriterion("ext_3 >", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3GreaterThanOrEqualTo(String value) { + addCriterion("ext_3 >=", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3LessThan(String value) { + addCriterion("ext_3 <", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3LessThanOrEqualTo(String value) { + addCriterion("ext_3 <=", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3Like(String value) { + addCriterion("ext_3 like", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3NotLike(String value) { + addCriterion("ext_3 not like", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3In(List values) { + addCriterion("ext_3 in", values, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3NotIn(List values) { + addCriterion("ext_3 not in", values, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3Between(String value1, String value2) { + addCriterion("ext_3 between", value1, value2, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3NotBetween(String value1, String value2) { + addCriterion("ext_3 not between", value1, value2, "ext3"); + return (Criteria) this; + } + } + + /** + */ + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + 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 diff --git a/service/src/main/java/com/hfkj/service/hlt/BsHltCardRecordService.java b/service/src/main/java/com/hfkj/service/hlt/BsHltCardRecordService.java new file mode 100644 index 0000000..707a616 --- /dev/null +++ b/service/src/main/java/com/hfkj/service/hlt/BsHltCardRecordService.java @@ -0,0 +1,59 @@ +package com.hfkj.service.hlt; + +import com.hfkj.dao.BsHltCardRecordMapper; +import com.hfkj.entity.BsHltCardRecord; +import com.hfkj.entity.BsHltCardRecordExample; +import com.hfkj.sysenum.hlt.HltCardRecordPayStatusEnum; +import org.springframework.stereotype.Component; + +import javax.annotation.Resource; +import java.util.Date; +import java.util.List; + +/** + * @className: BsHltCardRecordService + * @author: HuRui + * @date: 2024/8/21 + **/ +@Component +public class BsHltCardRecordService { + @Resource + private BsHltCardRecordMapper hltCardRecordMapper; + + /** + * 创建 + * @param record + */ + public void create(BsHltCardRecord record) { + record.setCreateTime(new Date()); + record.setUpdateTime(new Date()); + hltCardRecordMapper.insert(record); + } + + /** + * 修改 + * @param record + */ + public void update(BsHltCardRecord record) { + record.setUpdateTime(new Date()); + hltCardRecordMapper.updateByPrimaryKey(record); + } + + /** + * 获取最新支付单号 + * @param orderNo 订单号 + * @return + */ + public BsHltCardRecord getNewPayOrderNo(String orderNo) { + BsHltCardRecordExample example = new BsHltCardRecordExample(); + example.createCriteria() + .andOrderNoEqualTo(orderNo) + .andPayStatusEqualTo(HltCardRecordPayStatusEnum.status2.getCode()); + List list = hltCardRecordMapper.selectByExample(example); + if (!list.isEmpty()) { + return list.get(0); + } + return null; + } + +} diff --git a/service/src/main/java/com/hfkj/service/hlt/HltCardRefundService.java b/service/src/main/java/com/hfkj/service/hlt/HltCardRefundService.java new file mode 100644 index 0000000..d2b4e32 --- /dev/null +++ b/service/src/main/java/com/hfkj/service/hlt/HltCardRefundService.java @@ -0,0 +1,152 @@ +package com.hfkj.service.hlt; + +import com.alibaba.fastjson.JSONObject; +import com.hfkj.common.exception.BaseException; +import com.hfkj.common.exception.ErrorCode; +import com.hfkj.common.exception.ErrorHelp; +import com.hfkj.common.exception.SysCode; +import com.hfkj.common.utils.DateUtil; +import com.hfkj.common.utils.RandomUtils; +import com.hfkj.entity.BsHltCardRecord; +import com.hfkj.entity.BsMerPayConfig; +import com.hfkj.entity.BsOrderRefund; +import com.hfkj.mer.BsMerPayConfigService; +import com.hfkj.model.order.OrderChildModel; +import com.hfkj.model.order.OrderModel; +import com.hfkj.service.order.BsOrderRefundService; +import com.hfkj.service.order.BsOrderService; +import com.hfkj.sysenum.hlt.HltCardRecordPayStatusEnum; +import com.hfkj.sysenum.mer.PayPlatformEnum; +import com.hfkj.sysenum.order.OrderChildStatusEnum; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Component; + +import javax.annotation.Resource; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Date; +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; + +/** + * @className: HltCardRefundService + * @author: HuRui + * @date: 2024/8/21 + **/ +@Component +public class HltCardRefundService { + @Resource + private BsHltCardRecordService hltCardRecordService; + @Resource + private BsOrderRefundService orderRefundService; + @Resource + private BsMerPayConfigService merPayConfigService; + @Resource + private BsOrderService orderService; + /** + * 退款 + * @param orderRefund + * @return + */ + public BsOrderRefund refund(BsOrderRefund orderRefund) { + // 查询系统订单号 + BsHltCardRecord oldCardRecord = hltCardRecordService.getNewPayOrderNo(orderRefund.getOrderNo()); + if (oldCardRecord == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到最新的支付订单"); + } + try { + // 订单退款 + JSONObject refundObj = HuiLianTongUnionCardService.refund(orderRefund.getRefundOrderNo(), oldCardRecord.getPayOrderNo()); + if (!refundObj.getString("respCode").equals("0000")) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, refundObj.getString("respMessage")); + } + JSONObject consumptionResult = HuiLianTongUnionCardService.resolveResponse(refundObj.getString("data")); + if (!(consumptionResult.getBoolean("success") || Objects.equals(consumptionResult.getString("message"), "原交易已撤销,不可再次操作"))) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "退款失败!"+consumptionResult.getString("message")); + } + oldCardRecord.setRefundTime(new Date()); + oldCardRecord.setPayStatus(HltCardRecordPayStatusEnum.status3.getCode()); + hltCardRecordService.update(oldCardRecord); + + orderRefund.setRefundSerialNo(consumptionResult.getString("orderId")); + orderRefundService.editData(orderRefund); + + // 重新支付金额 + BigDecimal newPayPrice = oldCardRecord.getPayPrice().subtract(orderRefund.getRefundPrice()); + if (newPayPrice.compareTo(new BigDecimal("0")) > 0) { + BsHltCardRecord newRecord = new BsHltCardRecord(); + try { + newRecord.setOrderNo(orderRefund.getOrderNo()); + newRecord.setCardNo(oldCardRecord.getCardNo()); + newRecord.setUserPhone(oldCardRecord.getUserPhone()); + newRecord.setPayOrderNo(DateUtil.date2String(new Date(), "yyMMddHHmmss") + RandomUtils.number(6, false)); + newRecord.setPayPrice(newPayPrice); + newRecord.setPayStatus(HltCardRecordPayStatusEnum.status1.getCode()); + newRecord.setExceptionStatus(false); + hltCardRecordService.create(newRecord); + + // 查询订单 + OrderModel order = orderService.getDetail(orderRefund.getOrderNo()); + // 查询平台 + BsMerPayConfig merPay = merPayConfigService.getMerPay(order.getOrderChildList().get(0).getMerId(), PayPlatformEnum.type2); + if (merPay == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "商户未配置支付"); + } + // 重新扣款 + String goodsDesc = ""; + String tranDesc = ""; + String businessType = "HiSen_phg_goods"; + + List childModelList = order.getOrderChildList().stream() + .filter(o -> o.getStatus().equals(OrderChildStatusEnum.status2.getCode()) + || o.getStatus().equals(OrderChildStatusEnum.status3.getCode())) + .collect(Collectors.toList()); + for (OrderChildModel orderChild :childModelList) { + if (StringUtils.isBlank(tranDesc)) { + tranDesc = tranDesc + orderChild.getProductName(); + } else { + tranDesc = tranDesc +","+ orderChild.getProductName(); + } + } + // 描述超过30字符,截取加省略号 + if (tranDesc.length()>30) { + tranDesc = tranDesc.substring(1,30) + "..."; + } + JSONObject consumption = HuiLianTongUnionCardService.consumption(newRecord.getPayOrderNo(), newRecord.getCardNo(), newRecord.getPayPrice(), businessType, merPay.getHltInstCode(), goodsDesc, tranDesc); + if (!consumption.getString("respCode").equals("0000")) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, consumption.getString("respMessage")); + } + // 响应参数 + JSONObject payConsumptionResult = HuiLianTongUnionCardService.resolveResponse(consumption.getString("data")); + if (consumptionResult.getBoolean("success") != true) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, payConsumptionResult.getString("message")); + } + newRecord.setPaySerialNo(consumptionResult.getString("orderId")); + newRecord.setPayTime(new Date()); + newRecord.setPayStatus(HltCardRecordPayStatusEnum.status2.getCode()); + hltCardRecordService.update(newRecord); + + } catch (BaseException e) { + newRecord.setExceptionStatus(true); + newRecord.setExceptionContent(e.getErrorMsg()); + hltCardRecordService.update(newRecord); + } catch (Exception e) { + newRecord.setExceptionStatus(true); + newRecord.setExceptionContent("未知错误"); + hltCardRecordService.update(newRecord); + } + } + + } catch (BaseException e) { + oldCardRecord.setExceptionStatus(true); + oldCardRecord.setExceptionContent(e.getErrorMsg()); + hltCardRecordService.update(oldCardRecord); + } catch (Exception e) { + oldCardRecord.setExceptionStatus(true); + oldCardRecord.setExceptionContent("未知错误"); + hltCardRecordService.update(oldCardRecord); + } + return orderRefund; + } +} diff --git a/service/src/main/java/com/hfkj/service/order/impl/BsOrderRefundServiceImpl.java b/service/src/main/java/com/hfkj/service/order/impl/BsOrderRefundServiceImpl.java index 8b1a796..c949b28 100644 --- a/service/src/main/java/com/hfkj/service/order/impl/BsOrderRefundServiceImpl.java +++ b/service/src/main/java/com/hfkj/service/order/impl/BsOrderRefundServiceImpl.java @@ -15,6 +15,7 @@ import com.hfkj.entity.BsOrderRefundExample; import com.hfkj.mer.BsMerPayConfigService; import com.hfkj.model.order.OrderChildModel; import com.hfkj.model.order.OrderModel; +import com.hfkj.service.hlt.HltCardRefundService; import com.hfkj.service.hlt.HuiLianTongUnionCardService; import com.hfkj.service.order.BsOrderChildService; import com.hfkj.service.order.BsOrderRefundService; @@ -56,10 +57,10 @@ public class BsOrderRefundServiceImpl implements BsOrderRefundService { @Resource private UserIntegralService userIntegralService; @Resource - private BsMerPayConfigService merPayConfigService; - @Resource private TradeService huiftTradeService; @Resource + private HltCardRefundService hltCardRefundService; + @Resource private OrderRefundSuccessService orderRefundSuccessService; @Override public void editData(BsOrderRefund data) { @@ -100,19 +101,11 @@ public class BsOrderRefundServiceImpl implements BsOrderRefundService { orderRefund.setRefundPayChannelOrderNo(refundObj.getString("refundOrderNo")); return true; - } /*else if (OrderPayChannelEnum.type4.getCode() == orderRefund.getRefundPayChannel()) { + } else if (OrderPayChannelEnum.type4.getCode() == orderRefund.getRefundPayChannel()) { // 商户退款 - JSONObject refundObj = HuiLianTongUnionCardService.refund(orderRefund.getRefundOrderNo(), orderRefund.getOrderNo()); - if (!refundObj.getString("respCode").equals("0000")) { - throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, refundObj.getString("respMessage")); - } - JSONObject consumptionResult = HuiLianTongUnionCardService.resolveResponse(refundObj.getString("data")); - if (!(consumptionResult.getBoolean("success") || Objects.equals(consumptionResult.getString("message"), "原交易已撤销,不可再次操作"))) { - throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "退款失败!"+consumptionResult.getString("message")); - } - orderRefund.setRefundSerialNo(consumptionResult.getString("orderId")); + orderRefund = hltCardRefundService.refund(orderRefund); return true; - }*/ else { + } else { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "退款失败!该支付方式暂不支持退款"); } } catch (BaseException e) { diff --git a/service/src/main/java/com/hfkj/service/order/impl/BsOrderServiceImpl.java b/service/src/main/java/com/hfkj/service/order/impl/BsOrderServiceImpl.java index 7f3e170..1218391 100644 --- a/service/src/main/java/com/hfkj/service/order/impl/BsOrderServiceImpl.java +++ b/service/src/main/java/com/hfkj/service/order/impl/BsOrderServiceImpl.java @@ -231,7 +231,7 @@ public class BsOrderServiceImpl implements BsOrderService { childOrder.setSurplusRefundCount(childOrder.getProductCount()); // 计算 子订单 在交易订单金额中的占比 - BigDecimal ratio = childOrder.getProductTotalPrice().divide(order.getTotalPrice(), 2, BigDecimal.ROUND_DOWN); + BigDecimal ratio = childOrder.getProductTotalPrice().divide(order.getTotalPrice(), 4, BigDecimal.ROUND_DOWN); // 优惠券优惠 if (order.getDeduction().getCouponDiscountActualPrice().compareTo(BigDecimal.ZERO) > 0) { @@ -263,10 +263,10 @@ public class BsOrderServiceImpl implements BsOrderService { // 积分差值 Long integralDiscountDifference = order.getDeduction().getIntegralDiscountPrice() - totalIntegralDiscountPrice; - if (integralDiscountDifference > 0) { + if (integralDiscountDifference > 0L) { // 大于0 childOrder.setIntegralDiscountPrice(childOrder.getIntegralDiscountPrice() + integralDiscountDifference); - } else if (integralDiscountDifference < 0) { + } else if (integralDiscountDifference < 0L) { // 小于0 childOrder.setIntegralDiscountPrice(childOrder.getIntegralDiscountPrice() - integralDiscountDifference); } @@ -274,7 +274,6 @@ public class BsOrderServiceImpl implements BsOrderService { // 商品订单总优惠 childOrder.setTotalDeductionPrice(childOrder.getCouponDiscountPrice().add(new BigDecimal(childOrder.getIntegralDiscountPrice()).divide(new BigDecimal("100")))); - // 可退款金额 产品总价 - 优惠总价 childOrder.setSurplusRefundPrice(childOrder.getProductTotalPrice().subtract(childOrder.getTotalDeductionPrice())); // 可退款积分 积分优惠 diff --git a/service/src/main/java/com/hfkj/service/order/impl/OrderPayServiceImpl.java b/service/src/main/java/com/hfkj/service/order/impl/OrderPayServiceImpl.java index 973282e..023b8ff 100644 --- a/service/src/main/java/com/hfkj/service/order/impl/OrderPayServiceImpl.java +++ b/service/src/main/java/com/hfkj/service/order/impl/OrderPayServiceImpl.java @@ -4,13 +4,16 @@ import com.alibaba.fastjson.JSONObject; import com.hfkj.common.exception.ErrorCode; import com.hfkj.common.exception.ErrorHelp; import com.hfkj.common.exception.SysCode; +import com.hfkj.entity.BsHltCardRecord; import com.hfkj.entity.BsUserCard; import com.hfkj.model.order.OrderChildModel; import com.hfkj.model.order.OrderModel; +import com.hfkj.service.hlt.BsHltCardRecordService; import com.hfkj.service.hlt.HuiLianTongUnionCardService; import com.hfkj.service.order.BsOrderService; import com.hfkj.service.order.OrderPayService; import com.hfkj.service.order.OrderPaySuccessService; +import com.hfkj.sysenum.hlt.HltCardRecordPayStatusEnum; import com.hfkj.sysenum.order.OrderPayChannelEnum; import com.hfkj.sysenum.order.OrderPayTypeEnum; import org.apache.commons.lang3.StringUtils; @@ -28,7 +31,8 @@ import java.util.Date; public class OrderPayServiceImpl implements OrderPayService { @Resource private BsOrderService orderService; - + @Resource + private BsHltCardRecordService hltCardRecordService; @Override public OrderModel hltCardPay(String instCode,OrderModel order, BsUserCard userCard) throws Exception { String goodsDesc = ""; @@ -68,6 +72,18 @@ public class OrderPayServiceImpl implements OrderPayService { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, consumptionResult.getString("message")); } + BsHltCardRecord cardRecord = new BsHltCardRecord(); + cardRecord.setOrderNo(order.getOrderNo()); + cardRecord.setCardNo(userCard.getCardNo()); + cardRecord.setUserPhone(order.getUserPhone()); + cardRecord.setPayOrderNo(order.getOrderNo()); + cardRecord.setPaySerialNo(consumptionResult.getString("orderId")); + cardRecord.setPayPrice(order.getPayRealPrice()); + cardRecord.setPayStatus(HltCardRecordPayStatusEnum.status2.getCode()); + cardRecord.setPayTime(new Date()); + cardRecord.setExceptionStatus(false); + hltCardRecordService.create(cardRecord); + order.setPayChannel(OrderPayChannelEnum.type4.getCode()); order.setPayType(OrderPayTypeEnum.type4.getCode()); order.setPaySerialNo(consumptionResult.getString("orderId")); diff --git a/service/src/main/java/com/hfkj/sysenum/hlt/HltCardRecordPayStatusEnum.java b/service/src/main/java/com/hfkj/sysenum/hlt/HltCardRecordPayStatusEnum.java new file mode 100644 index 0000000..42dcd61 --- /dev/null +++ b/service/src/main/java/com/hfkj/sysenum/hlt/HltCardRecordPayStatusEnum.java @@ -0,0 +1,38 @@ +package com.hfkj.sysenum.hlt; + +import lombok.Getter; + +/** + * + * @author hurui + */ +@Getter +public enum HltCardRecordPayStatusEnum { + + /** + * 待支付 + */ + status1(1, "待支付"), + + /** + * 已支付 + */ + status2(2, "已支付"), + + /** + * 已退款 + */ + status3(3, "已退款"), + ; + + private int code; + + private String name; + + + HltCardRecordPayStatusEnum(int code, String name) { + this.code = code; + this.name = name; + } + +}