parent
d1ba6eca95
commit
2971815057
@ -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<BsHltCardRecord> 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); |
||||
} |
@ -0,0 +1,7 @@ |
||||
package com.hfkj.dao; |
||||
|
||||
/** |
||||
* mapper扩展类 |
||||
*/ |
||||
public interface BsHltCardRecordMapperExt { |
||||
} |
@ -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<String, Object> 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<String, Object> 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<Criteria> 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<Criterion> 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()); |
||||
} |
||||
} |
||||
} |
@ -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(); |
||||
} |
||||
} |
File diff suppressed because it is too large
Load Diff
@ -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<BsHltCardRecord> list = hltCardRecordMapper.selectByExample(example); |
||||
if (!list.isEmpty()) { |
||||
return list.get(0); |
||||
} |
||||
return null; |
||||
} |
||||
|
||||
} |
@ -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<OrderChildModel> 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; |
||||
} |
||||
} |
@ -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; |
||||
} |
||||
|
||||
} |
Loading…
Reference in new issue