提交代码

yy_dev
胡锐 1 year ago
parent b7520ed38e
commit e466112f39
  1. 2
      cweb/src/main/java/com/cweb/controller/TestController.java
  2. 52
      open-api/src/main/java/com/api/controller/v1/TradeController.java
  3. 3
      schedule/src/main/java/com/hfkj/schedule/TradeOrderSchedule.java
  4. 1
      service/src/main/java/com/hfkj/channel/lakala/LaKaLaTradeService.java
  5. 39
      service/src/main/java/com/hfkj/dao/BsTradeOrderRefundMapper.java
  6. 14
      service/src/main/java/com/hfkj/dao/BsTradeOrderRefundSqlProvider.java
  7. 30
      service/src/main/java/com/hfkj/dao/BsTradeSettleMapper.java
  8. 28
      service/src/main/java/com/hfkj/dao/BsTradeSettleSqlProvider.java
  9. 40
      service/src/main/java/com/hfkj/dao/OpenApiTradeOrderMapper.java
  10. 16
      service/src/main/java/com/hfkj/entity/BsTradeOrderRefund.java
  11. 70
      service/src/main/java/com/hfkj/entity/BsTradeOrderRefundExample.java
  12. 32
      service/src/main/java/com/hfkj/entity/BsTradeSettle.java
  13. 140
      service/src/main/java/com/hfkj/entity/BsTradeSettleExample.java
  14. 106
      service/src/main/java/com/hfkj/openapi/v1/model/TradeDetailBillsModel.java
  15. 40
      service/src/main/java/com/hfkj/openapi/v1/model/request/RequestTradeSettleBillsModel.java
  16. 10
      service/src/main/java/com/hfkj/openapi/v1/service/OpenApiTradeOrderService.java
  17. 9
      service/src/main/java/com/hfkj/openapi/v1/service/impl/OpenApiTradeOrderServiceImpl.java
  18. 4
      service/src/main/java/com/hfkj/openapi/v1/utils/SignatureUtil.java

@ -292,7 +292,7 @@ public class TestController {
try { try {
JSONObject object = new JSONObject(); JSONObject object = new JSONObject();
object.put("cid", "69511c3be97a4f02fb99d8ab181980b6"); object.put("cid", code);
object.put("price", "0.01"); object.put("price", "0.01");
// 获取语音播报地址 // 获取语音播报地址

@ -36,6 +36,7 @@ import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotBlank;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Calendar;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -320,4 +321,55 @@ public class TradeController {
} }
} }
@RequestMapping(value="/tradeSettleBills",method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "交易结算账单下载")
public ResponseData tradeSettleBills(@RequestBody RequestTradeSettleBillsModel body) {
log.info("========= Start 交易结算账单下载 Start ===========");
log.info("请求参数:" + JSONObject.toJSONString(body));
try {
// 验证签名
if (!SignatureUtil.checkSign(body.getSign(), body, merKeyService.getKeyByMerNo(body.getMerchantNo()))) {
throw ErrorHelp.genException(SysCode.OpenApi, ErrorCode.OPEN_API_SIGN_ERR, "");
}
// 最大周期范围1个月 30天
Long maxTime = 60*24*30L;
if (maxTime.compareTo(DateUtil.getMinutesDiff(new Date(body.getBillDateS()), new Date(body.getBillDateE()))) < 0) {
throw ErrorHelp.genException(SysCode.OpenApi, ErrorCode.OPEN_API_COMMON, "时间范围大于1个月");
}
Calendar billDateE = Calendar.getInstance();
billDateE.setTime(new Date(body.getBillDateE()));
billDateE.set(Calendar.HOUR_OF_DAY, 00);
billDateE.set(Calendar.MINUTE, 00);
billDateE.set(Calendar.SECOND, 00);
// 当前时间
Calendar currentDate = Calendar.getInstance();
currentDate.set(Calendar.HOUR_OF_DAY, 00);
currentDate.set(Calendar.MINUTE, 00);
currentDate.set(Calendar.SECOND, 00);
if (DateUtil.getMinutesDiff(billDateE.getTime(),currentDate.getTime()) <= 0) {
currentDate.add(Calendar.DAY_OF_MONTH, -1);
body.setBillDateE(currentDate.getTimeInMillis());
}
List<TradeDetailBillsModel> tradeBills = openApiTradeOrderService.tradeSettleBills(body.getMerchantNo(), body.getBillDateS(), body.getBillDateE());
String fileName = "/temporary/" + System.currentTimeMillis() + ".xlsx";
EasyExcel.write(CommonSysConst.getSysConfig().getFilesystem() + fileName, TradeDetailBillsModel.class)
.sheet("交易结算账单")
.doWrite(tradeBills);
String fileUrl = CommonSysConst.getSysConfig().getDomainName() + "/filesystem" + fileName;
log.info("返回参数:" + fileUrl);
return ResponseMsgUtil.success(fileUrl);
} catch (Exception e) {
log.info("出现异常:", e);
return ResponseMsgUtil.exception(e);
} finally {
log.info("========= END 交易结算账单下载 END ===========");
}
}
} }

@ -294,6 +294,7 @@ public class TradeOrderSchedule {
tradeSettle.setPlatformLogNo(tradeOrder.getPlatformLogNo()); tradeSettle.setPlatformLogNo(tradeOrder.getPlatformLogNo());
tradeSettle.setPayMode(tradeOrder.getPayMode()); tradeSettle.setPayMode(tradeOrder.getPayMode());
tradeSettle.setOutTradeNo(tradeOrder.getOutTradeNo()); tradeSettle.setOutTradeNo(tradeOrder.getOutTradeNo());
tradeSettle.setAccTradeNo(tradeOrder.getAccTradeNo());
tradeSettle.setTradeAmount(tradeOrder.getAccSettleAmount()); tradeSettle.setTradeAmount(tradeOrder.getAccSettleAmount());
tradeSettle.setTradeType(TradeSettleTradeType.type1.getNumber()); tradeSettle.setTradeType(TradeSettleTradeType.type1.getNumber());
tradeSettle.setSettleAmount(tradeOrder.getAccSettleAmount()); tradeSettle.setSettleAmount(tradeOrder.getAccSettleAmount());
@ -372,6 +373,7 @@ public class TradeOrderSchedule {
tradeSettle.setPlatformLogNo(tradeOrderRefund.getPlatformLogNo()); tradeSettle.setPlatformLogNo(tradeOrderRefund.getPlatformLogNo());
tradeSettle.setPayMode(tradeOrder.getPayMode()); tradeSettle.setPayMode(tradeOrder.getPayMode());
tradeSettle.setOutTradeNo(tradeOrderRefund.getRefundNo()); tradeSettle.setOutTradeNo(tradeOrderRefund.getRefundNo());
tradeSettle.setAccTradeNo(tradeOrderRefund.getAccTradeNo());
tradeSettle.setTradeType(TradeSettleTradeType.type2.getNumber()); tradeSettle.setTradeType(TradeSettleTradeType.type2.getNumber());
tradeSettle.setTradeAmount(tradeOrderRefund.getRefundAmount()); tradeSettle.setTradeAmount(tradeOrderRefund.getRefundAmount());
tradeSettle.setTradeTime(tradeOrderRefund.getRefundTime()); tradeSettle.setTradeTime(tradeOrderRefund.getRefundTime());
@ -379,6 +381,7 @@ public class TradeOrderSchedule {
tradeSettle.setSettleAmount(tradeOrderRefund.getSettleAmount()); tradeSettle.setSettleAmount(tradeOrderRefund.getSettleAmount());
tradeSettle.setSettleDate(tradeOrderRefund.getSettleDate()); tradeSettle.setSettleDate(tradeOrderRefund.getSettleDate());
tradeSettle.setFeeRate(tradeOrder.getFeeRate()); tradeSettle.setFeeRate(tradeOrder.getFeeRate());
tradeSettle.setOrgOutTradeNo(tradeOrder.getOutTradeNo());
tradeSettleService.editData(tradeSettle); tradeSettleService.editData(tradeSettle);
} }
} }

@ -549,6 +549,7 @@ public class LaKaLaTradeService {
if (responseBody.getString("code").equals("BBS00000")) { if (responseBody.getString("code").equals("BBS00000")) {
orderRefund.setPlatformOrderNo(data.getString("trade_no")); orderRefund.setPlatformOrderNo(data.getString("trade_no"));
orderRefund.setPlatformLogNo(data.getString("log_no")); orderRefund.setPlatformLogNo(data.getString("log_no"));
orderRefund.setAccTradeNo(data.getString("acc_trade_no"));
orderRefund.setTotalAmount(data.getBigDecimal("total_amount").divide(new BigDecimal("100"))); orderRefund.setTotalAmount(data.getBigDecimal("total_amount").divide(new BigDecimal("100")));
orderRefund.setRefundAmount(data.getBigDecimal("refund_amount").divide(new BigDecimal("100"))); orderRefund.setRefundAmount(data.getBigDecimal("refund_amount").divide(new BigDecimal("100")));
orderRefund.setPayerAmount(data.getBigDecimal("payer_amount").divide(new BigDecimal("100"))); orderRefund.setPayerAmount(data.getBigDecimal("payer_amount").divide(new BigDecimal("100")));

@ -43,26 +43,28 @@ public interface BsTradeOrderRefundMapper extends BsTradeOrderRefundMapperExt {
"agent_id, salesman_id, ", "agent_id, salesman_id, ",
"mer_id, store_id, platform_type, ", "mer_id, store_id, platform_type, ",
"platform_order_no, platform_log_no, ", "platform_order_no, platform_log_no, ",
"refund_no, total_amount, ", "refund_no, acc_trade_no, ",
"refund_amount, payer_amount, ", "total_amount, refund_amount, ",
"shd_fee_amt, settle_amount, ", "payer_amount, shd_fee_amt, ",
"settle_date, refund_reason, ", "settle_amount, settle_date, ",
"`status`, refund_time, ", "refund_reason, `status`, ",
"create_time, update_time, ", "refund_time, create_time, ",
"operator_id, operator_name, ", "update_time, operator_id, ",
"ext_1, ext_2, ext_3)", "operator_name, ext_1, ",
"ext_2, ext_3)",
"values (#{tradeOrderId,jdbcType=BIGINT}, #{outTradeNo,jdbcType=VARCHAR}, ", "values (#{tradeOrderId,jdbcType=BIGINT}, #{outTradeNo,jdbcType=VARCHAR}, ",
"#{agentId,jdbcType=BIGINT}, #{salesmanId,jdbcType=BIGINT}, ", "#{agentId,jdbcType=BIGINT}, #{salesmanId,jdbcType=BIGINT}, ",
"#{merId,jdbcType=BIGINT}, #{storeId,jdbcType=BIGINT}, #{platformType,jdbcType=INTEGER}, ", "#{merId,jdbcType=BIGINT}, #{storeId,jdbcType=BIGINT}, #{platformType,jdbcType=INTEGER}, ",
"#{platformOrderNo,jdbcType=VARCHAR}, #{platformLogNo,jdbcType=VARCHAR}, ", "#{platformOrderNo,jdbcType=VARCHAR}, #{platformLogNo,jdbcType=VARCHAR}, ",
"#{refundNo,jdbcType=VARCHAR}, #{totalAmount,jdbcType=DECIMAL}, ", "#{refundNo,jdbcType=VARCHAR}, #{accTradeNo,jdbcType=VARCHAR}, ",
"#{refundAmount,jdbcType=DECIMAL}, #{payerAmount,jdbcType=DECIMAL}, ", "#{totalAmount,jdbcType=DECIMAL}, #{refundAmount,jdbcType=DECIMAL}, ",
"#{shdFeeAmt,jdbcType=DECIMAL}, #{settleAmount,jdbcType=DECIMAL}, ", "#{payerAmount,jdbcType=DECIMAL}, #{shdFeeAmt,jdbcType=DECIMAL}, ",
"#{settleDate,jdbcType=DATE}, #{refundReason,jdbcType=VARCHAR}, ", "#{settleAmount,jdbcType=DECIMAL}, #{settleDate,jdbcType=DATE}, ",
"#{status,jdbcType=INTEGER}, #{refundTime,jdbcType=TIMESTAMP}, ", "#{refundReason,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, ",
"#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, ", "#{refundTime,jdbcType=TIMESTAMP}, #{createTime,jdbcType=TIMESTAMP}, ",
"#{operatorId,jdbcType=BIGINT}, #{operatorName,jdbcType=VARCHAR}, ", "#{updateTime,jdbcType=TIMESTAMP}, #{operatorId,jdbcType=BIGINT}, ",
"#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" "#{operatorName,jdbcType=VARCHAR}, #{ext1,jdbcType=VARCHAR}, ",
"#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
}) })
@Options(useGeneratedKeys=true,keyProperty="id") @Options(useGeneratedKeys=true,keyProperty="id")
int insert(BsTradeOrderRefund record); int insert(BsTradeOrderRefund record);
@ -84,6 +86,7 @@ public interface BsTradeOrderRefundMapper extends BsTradeOrderRefundMapperExt {
@Result(column="platform_order_no", property="platformOrderNo", jdbcType=JdbcType.VARCHAR), @Result(column="platform_order_no", property="platformOrderNo", jdbcType=JdbcType.VARCHAR),
@Result(column="platform_log_no", property="platformLogNo", jdbcType=JdbcType.VARCHAR), @Result(column="platform_log_no", property="platformLogNo", jdbcType=JdbcType.VARCHAR),
@Result(column="refund_no", property="refundNo", jdbcType=JdbcType.VARCHAR), @Result(column="refund_no", property="refundNo", jdbcType=JdbcType.VARCHAR),
@Result(column="acc_trade_no", property="accTradeNo", jdbcType=JdbcType.VARCHAR),
@Result(column="total_amount", property="totalAmount", jdbcType=JdbcType.DECIMAL), @Result(column="total_amount", property="totalAmount", jdbcType=JdbcType.DECIMAL),
@Result(column="refund_amount", property="refundAmount", jdbcType=JdbcType.DECIMAL), @Result(column="refund_amount", property="refundAmount", jdbcType=JdbcType.DECIMAL),
@Result(column="payer_amount", property="payerAmount", jdbcType=JdbcType.DECIMAL), @Result(column="payer_amount", property="payerAmount", jdbcType=JdbcType.DECIMAL),
@ -106,7 +109,7 @@ public interface BsTradeOrderRefundMapper extends BsTradeOrderRefundMapperExt {
@Select({ @Select({
"select", "select",
"id, trade_order_id, out_trade_no, agent_id, salesman_id, mer_id, store_id, platform_type, ", "id, trade_order_id, out_trade_no, agent_id, salesman_id, mer_id, store_id, platform_type, ",
"platform_order_no, platform_log_no, refund_no, total_amount, refund_amount, ", "platform_order_no, platform_log_no, refund_no, acc_trade_no, total_amount, refund_amount, ",
"payer_amount, shd_fee_amt, settle_amount, settle_date, refund_reason, `status`, ", "payer_amount, shd_fee_amt, settle_amount, settle_date, refund_reason, `status`, ",
"refund_time, create_time, update_time, operator_id, operator_name, ext_1, ext_2, ", "refund_time, create_time, update_time, operator_id, operator_name, ext_1, ext_2, ",
"ext_3", "ext_3",
@ -125,6 +128,7 @@ public interface BsTradeOrderRefundMapper extends BsTradeOrderRefundMapperExt {
@Result(column="platform_order_no", property="platformOrderNo", jdbcType=JdbcType.VARCHAR), @Result(column="platform_order_no", property="platformOrderNo", jdbcType=JdbcType.VARCHAR),
@Result(column="platform_log_no", property="platformLogNo", jdbcType=JdbcType.VARCHAR), @Result(column="platform_log_no", property="platformLogNo", jdbcType=JdbcType.VARCHAR),
@Result(column="refund_no", property="refundNo", jdbcType=JdbcType.VARCHAR), @Result(column="refund_no", property="refundNo", jdbcType=JdbcType.VARCHAR),
@Result(column="acc_trade_no", property="accTradeNo", jdbcType=JdbcType.VARCHAR),
@Result(column="total_amount", property="totalAmount", jdbcType=JdbcType.DECIMAL), @Result(column="total_amount", property="totalAmount", jdbcType=JdbcType.DECIMAL),
@Result(column="refund_amount", property="refundAmount", jdbcType=JdbcType.DECIMAL), @Result(column="refund_amount", property="refundAmount", jdbcType=JdbcType.DECIMAL),
@Result(column="payer_amount", property="payerAmount", jdbcType=JdbcType.DECIMAL), @Result(column="payer_amount", property="payerAmount", jdbcType=JdbcType.DECIMAL),
@ -165,6 +169,7 @@ public interface BsTradeOrderRefundMapper extends BsTradeOrderRefundMapperExt {
"platform_order_no = #{platformOrderNo,jdbcType=VARCHAR},", "platform_order_no = #{platformOrderNo,jdbcType=VARCHAR},",
"platform_log_no = #{platformLogNo,jdbcType=VARCHAR},", "platform_log_no = #{platformLogNo,jdbcType=VARCHAR},",
"refund_no = #{refundNo,jdbcType=VARCHAR},", "refund_no = #{refundNo,jdbcType=VARCHAR},",
"acc_trade_no = #{accTradeNo,jdbcType=VARCHAR},",
"total_amount = #{totalAmount,jdbcType=DECIMAL},", "total_amount = #{totalAmount,jdbcType=DECIMAL},",
"refund_amount = #{refundAmount,jdbcType=DECIMAL},", "refund_amount = #{refundAmount,jdbcType=DECIMAL},",
"payer_amount = #{payerAmount,jdbcType=DECIMAL},", "payer_amount = #{payerAmount,jdbcType=DECIMAL},",

@ -68,6 +68,10 @@ public class BsTradeOrderRefundSqlProvider {
sql.VALUES("refund_no", "#{refundNo,jdbcType=VARCHAR}"); sql.VALUES("refund_no", "#{refundNo,jdbcType=VARCHAR}");
} }
if (record.getAccTradeNo() != null) {
sql.VALUES("acc_trade_no", "#{accTradeNo,jdbcType=VARCHAR}");
}
if (record.getTotalAmount() != null) { if (record.getTotalAmount() != null) {
sql.VALUES("total_amount", "#{totalAmount,jdbcType=DECIMAL}"); sql.VALUES("total_amount", "#{totalAmount,jdbcType=DECIMAL}");
} }
@ -152,6 +156,7 @@ public class BsTradeOrderRefundSqlProvider {
sql.SELECT("platform_order_no"); sql.SELECT("platform_order_no");
sql.SELECT("platform_log_no"); sql.SELECT("platform_log_no");
sql.SELECT("refund_no"); sql.SELECT("refund_no");
sql.SELECT("acc_trade_no");
sql.SELECT("total_amount"); sql.SELECT("total_amount");
sql.SELECT("refund_amount"); sql.SELECT("refund_amount");
sql.SELECT("payer_amount"); sql.SELECT("payer_amount");
@ -229,6 +234,10 @@ public class BsTradeOrderRefundSqlProvider {
sql.SET("refund_no = #{record.refundNo,jdbcType=VARCHAR}"); sql.SET("refund_no = #{record.refundNo,jdbcType=VARCHAR}");
} }
if (record.getAccTradeNo() != null) {
sql.SET("acc_trade_no = #{record.accTradeNo,jdbcType=VARCHAR}");
}
if (record.getTotalAmount() != null) { if (record.getTotalAmount() != null) {
sql.SET("total_amount = #{record.totalAmount,jdbcType=DECIMAL}"); sql.SET("total_amount = #{record.totalAmount,jdbcType=DECIMAL}");
} }
@ -312,6 +321,7 @@ public class BsTradeOrderRefundSqlProvider {
sql.SET("platform_order_no = #{record.platformOrderNo,jdbcType=VARCHAR}"); sql.SET("platform_order_no = #{record.platformOrderNo,jdbcType=VARCHAR}");
sql.SET("platform_log_no = #{record.platformLogNo,jdbcType=VARCHAR}"); sql.SET("platform_log_no = #{record.platformLogNo,jdbcType=VARCHAR}");
sql.SET("refund_no = #{record.refundNo,jdbcType=VARCHAR}"); sql.SET("refund_no = #{record.refundNo,jdbcType=VARCHAR}");
sql.SET("acc_trade_no = #{record.accTradeNo,jdbcType=VARCHAR}");
sql.SET("total_amount = #{record.totalAmount,jdbcType=DECIMAL}"); sql.SET("total_amount = #{record.totalAmount,jdbcType=DECIMAL}");
sql.SET("refund_amount = #{record.refundAmount,jdbcType=DECIMAL}"); sql.SET("refund_amount = #{record.refundAmount,jdbcType=DECIMAL}");
sql.SET("payer_amount = #{record.payerAmount,jdbcType=DECIMAL}"); sql.SET("payer_amount = #{record.payerAmount,jdbcType=DECIMAL}");
@ -378,6 +388,10 @@ public class BsTradeOrderRefundSqlProvider {
sql.SET("refund_no = #{refundNo,jdbcType=VARCHAR}"); sql.SET("refund_no = #{refundNo,jdbcType=VARCHAR}");
} }
if (record.getAccTradeNo() != null) {
sql.SET("acc_trade_no = #{accTradeNo,jdbcType=VARCHAR}");
}
if (record.getTotalAmount() != null) { if (record.getTotalAmount() != null) {
sql.SET("total_amount = #{totalAmount,jdbcType=DECIMAL}"); sql.SET("total_amount = #{totalAmount,jdbcType=DECIMAL}");
} }

@ -46,10 +46,11 @@ public interface BsTradeSettleMapper extends BsTradeSettleMapperExt {
"platform_type, platform_mer_no, ", "platform_type, platform_mer_no, ",
"platform_trade_no, platform_log_no, ", "platform_trade_no, platform_log_no, ",
"pay_mode, out_trade_no, ", "pay_mode, out_trade_no, ",
"trade_type, trade_amount, ", "acc_trade_no, trade_type, ",
"trade_time, shd_fee_amt, ", "trade_amount, trade_time, ",
"settle_amount, settle_date, ", "shd_fee_amt, settle_amount, ",
"fee_rate, `status`, ", "settle_date, fee_rate, ",
"org_out_trade_no, `status`, ",
"create_time, ext_1, ", "create_time, ext_1, ",
"ext_2, ext_3)", "ext_2, ext_3)",
"values (#{companyId,jdbcType=BIGINT}, #{agentId,jdbcType=BIGINT}, ", "values (#{companyId,jdbcType=BIGINT}, #{agentId,jdbcType=BIGINT}, ",
@ -59,10 +60,11 @@ public interface BsTradeSettleMapper extends BsTradeSettleMapperExt {
"#{platformType,jdbcType=INTEGER}, #{platformMerNo,jdbcType=VARCHAR}, ", "#{platformType,jdbcType=INTEGER}, #{platformMerNo,jdbcType=VARCHAR}, ",
"#{platformTradeNo,jdbcType=VARCHAR}, #{platformLogNo,jdbcType=VARCHAR}, ", "#{platformTradeNo,jdbcType=VARCHAR}, #{platformLogNo,jdbcType=VARCHAR}, ",
"#{payMode,jdbcType=VARCHAR}, #{outTradeNo,jdbcType=VARCHAR}, ", "#{payMode,jdbcType=VARCHAR}, #{outTradeNo,jdbcType=VARCHAR}, ",
"#{tradeType,jdbcType=INTEGER}, #{tradeAmount,jdbcType=DECIMAL}, ", "#{accTradeNo,jdbcType=VARCHAR}, #{tradeType,jdbcType=INTEGER}, ",
"#{tradeTime,jdbcType=TIMESTAMP}, #{shdFeeAmt,jdbcType=DECIMAL}, ", "#{tradeAmount,jdbcType=DECIMAL}, #{tradeTime,jdbcType=TIMESTAMP}, ",
"#{settleAmount,jdbcType=DECIMAL}, #{settleDate,jdbcType=DATE}, ", "#{shdFeeAmt,jdbcType=DECIMAL}, #{settleAmount,jdbcType=DECIMAL}, ",
"#{feeRate,jdbcType=DECIMAL}, #{status,jdbcType=INTEGER}, ", "#{settleDate,jdbcType=DATE}, #{feeRate,jdbcType=DECIMAL}, ",
"#{orgOutTradeNo,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, ",
"#{createTime,jdbcType=TIMESTAMP}, #{ext1,jdbcType=VARCHAR}, ", "#{createTime,jdbcType=TIMESTAMP}, #{ext1,jdbcType=VARCHAR}, ",
"#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" "#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
}) })
@ -92,6 +94,7 @@ public interface BsTradeSettleMapper extends BsTradeSettleMapperExt {
@Result(column="platform_log_no", property="platformLogNo", jdbcType=JdbcType.VARCHAR), @Result(column="platform_log_no", property="platformLogNo", jdbcType=JdbcType.VARCHAR),
@Result(column="pay_mode", property="payMode", jdbcType=JdbcType.VARCHAR), @Result(column="pay_mode", property="payMode", jdbcType=JdbcType.VARCHAR),
@Result(column="out_trade_no", property="outTradeNo", jdbcType=JdbcType.VARCHAR), @Result(column="out_trade_no", property="outTradeNo", jdbcType=JdbcType.VARCHAR),
@Result(column="acc_trade_no", property="accTradeNo", jdbcType=JdbcType.VARCHAR),
@Result(column="trade_type", property="tradeType", jdbcType=JdbcType.INTEGER), @Result(column="trade_type", property="tradeType", jdbcType=JdbcType.INTEGER),
@Result(column="trade_amount", property="tradeAmount", jdbcType=JdbcType.DECIMAL), @Result(column="trade_amount", property="tradeAmount", jdbcType=JdbcType.DECIMAL),
@Result(column="trade_time", property="tradeTime", jdbcType=JdbcType.TIMESTAMP), @Result(column="trade_time", property="tradeTime", jdbcType=JdbcType.TIMESTAMP),
@ -99,6 +102,7 @@ public interface BsTradeSettleMapper extends BsTradeSettleMapperExt {
@Result(column="settle_amount", property="settleAmount", jdbcType=JdbcType.DECIMAL), @Result(column="settle_amount", property="settleAmount", jdbcType=JdbcType.DECIMAL),
@Result(column="settle_date", property="settleDate", jdbcType=JdbcType.DATE), @Result(column="settle_date", property="settleDate", jdbcType=JdbcType.DATE),
@Result(column="fee_rate", property="feeRate", jdbcType=JdbcType.DECIMAL), @Result(column="fee_rate", property="feeRate", jdbcType=JdbcType.DECIMAL),
@Result(column="org_out_trade_no", property="orgOutTradeNo", jdbcType=JdbcType.VARCHAR),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER), @Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR), @Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR),
@ -111,9 +115,9 @@ public interface BsTradeSettleMapper extends BsTradeSettleMapperExt {
"select", "select",
"id, company_id, agent_id, salesman_id, salesman_name, mer_id, mer_name, mer_abbreviate, ", "id, company_id, agent_id, salesman_id, salesman_name, mer_id, mer_name, mer_abbreviate, ",
"mer_no, store_id, store_name, platform_type, platform_mer_no, platform_trade_no, ", "mer_no, store_id, store_name, platform_type, platform_mer_no, platform_trade_no, ",
"platform_log_no, pay_mode, out_trade_no, trade_type, trade_amount, trade_time, ", "platform_log_no, pay_mode, out_trade_no, acc_trade_no, trade_type, trade_amount, ",
"shd_fee_amt, settle_amount, settle_date, fee_rate, `status`, create_time, ext_1, ", "trade_time, shd_fee_amt, settle_amount, settle_date, fee_rate, org_out_trade_no, ",
"ext_2, ext_3", "`status`, create_time, ext_1, ext_2, ext_3",
"from bs_trade_settle", "from bs_trade_settle",
"where id = #{id,jdbcType=BIGINT}" "where id = #{id,jdbcType=BIGINT}"
}) })
@ -135,6 +139,7 @@ public interface BsTradeSettleMapper extends BsTradeSettleMapperExt {
@Result(column="platform_log_no", property="platformLogNo", jdbcType=JdbcType.VARCHAR), @Result(column="platform_log_no", property="platformLogNo", jdbcType=JdbcType.VARCHAR),
@Result(column="pay_mode", property="payMode", jdbcType=JdbcType.VARCHAR), @Result(column="pay_mode", property="payMode", jdbcType=JdbcType.VARCHAR),
@Result(column="out_trade_no", property="outTradeNo", jdbcType=JdbcType.VARCHAR), @Result(column="out_trade_no", property="outTradeNo", jdbcType=JdbcType.VARCHAR),
@Result(column="acc_trade_no", property="accTradeNo", jdbcType=JdbcType.VARCHAR),
@Result(column="trade_type", property="tradeType", jdbcType=JdbcType.INTEGER), @Result(column="trade_type", property="tradeType", jdbcType=JdbcType.INTEGER),
@Result(column="trade_amount", property="tradeAmount", jdbcType=JdbcType.DECIMAL), @Result(column="trade_amount", property="tradeAmount", jdbcType=JdbcType.DECIMAL),
@Result(column="trade_time", property="tradeTime", jdbcType=JdbcType.TIMESTAMP), @Result(column="trade_time", property="tradeTime", jdbcType=JdbcType.TIMESTAMP),
@ -142,6 +147,7 @@ public interface BsTradeSettleMapper extends BsTradeSettleMapperExt {
@Result(column="settle_amount", property="settleAmount", jdbcType=JdbcType.DECIMAL), @Result(column="settle_amount", property="settleAmount", jdbcType=JdbcType.DECIMAL),
@Result(column="settle_date", property="settleDate", jdbcType=JdbcType.DATE), @Result(column="settle_date", property="settleDate", jdbcType=JdbcType.DATE),
@Result(column="fee_rate", property="feeRate", jdbcType=JdbcType.DECIMAL), @Result(column="fee_rate", property="feeRate", jdbcType=JdbcType.DECIMAL),
@Result(column="org_out_trade_no", property="orgOutTradeNo", jdbcType=JdbcType.VARCHAR),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER), @Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR), @Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR),
@ -177,6 +183,7 @@ public interface BsTradeSettleMapper extends BsTradeSettleMapperExt {
"platform_log_no = #{platformLogNo,jdbcType=VARCHAR},", "platform_log_no = #{platformLogNo,jdbcType=VARCHAR},",
"pay_mode = #{payMode,jdbcType=VARCHAR},", "pay_mode = #{payMode,jdbcType=VARCHAR},",
"out_trade_no = #{outTradeNo,jdbcType=VARCHAR},", "out_trade_no = #{outTradeNo,jdbcType=VARCHAR},",
"acc_trade_no = #{accTradeNo,jdbcType=VARCHAR},",
"trade_type = #{tradeType,jdbcType=INTEGER},", "trade_type = #{tradeType,jdbcType=INTEGER},",
"trade_amount = #{tradeAmount,jdbcType=DECIMAL},", "trade_amount = #{tradeAmount,jdbcType=DECIMAL},",
"trade_time = #{tradeTime,jdbcType=TIMESTAMP},", "trade_time = #{tradeTime,jdbcType=TIMESTAMP},",
@ -184,6 +191,7 @@ public interface BsTradeSettleMapper extends BsTradeSettleMapperExt {
"settle_amount = #{settleAmount,jdbcType=DECIMAL},", "settle_amount = #{settleAmount,jdbcType=DECIMAL},",
"settle_date = #{settleDate,jdbcType=DATE},", "settle_date = #{settleDate,jdbcType=DATE},",
"fee_rate = #{feeRate,jdbcType=DECIMAL},", "fee_rate = #{feeRate,jdbcType=DECIMAL},",
"org_out_trade_no = #{orgOutTradeNo,jdbcType=VARCHAR},",
"`status` = #{status,jdbcType=INTEGER},", "`status` = #{status,jdbcType=INTEGER},",
"create_time = #{createTime,jdbcType=TIMESTAMP},", "create_time = #{createTime,jdbcType=TIMESTAMP},",
"ext_1 = #{ext1,jdbcType=VARCHAR},", "ext_1 = #{ext1,jdbcType=VARCHAR},",

@ -92,6 +92,10 @@ public class BsTradeSettleSqlProvider {
sql.VALUES("out_trade_no", "#{outTradeNo,jdbcType=VARCHAR}"); sql.VALUES("out_trade_no", "#{outTradeNo,jdbcType=VARCHAR}");
} }
if (record.getAccTradeNo() != null) {
sql.VALUES("acc_trade_no", "#{accTradeNo,jdbcType=VARCHAR}");
}
if (record.getTradeType() != null) { if (record.getTradeType() != null) {
sql.VALUES("trade_type", "#{tradeType,jdbcType=INTEGER}"); sql.VALUES("trade_type", "#{tradeType,jdbcType=INTEGER}");
} }
@ -120,6 +124,10 @@ public class BsTradeSettleSqlProvider {
sql.VALUES("fee_rate", "#{feeRate,jdbcType=DECIMAL}"); sql.VALUES("fee_rate", "#{feeRate,jdbcType=DECIMAL}");
} }
if (record.getOrgOutTradeNo() != null) {
sql.VALUES("org_out_trade_no", "#{orgOutTradeNo,jdbcType=VARCHAR}");
}
if (record.getStatus() != null) { if (record.getStatus() != null) {
sql.VALUES("`status`", "#{status,jdbcType=INTEGER}"); sql.VALUES("`status`", "#{status,jdbcType=INTEGER}");
} }
@ -166,6 +174,7 @@ public class BsTradeSettleSqlProvider {
sql.SELECT("platform_log_no"); sql.SELECT("platform_log_no");
sql.SELECT("pay_mode"); sql.SELECT("pay_mode");
sql.SELECT("out_trade_no"); sql.SELECT("out_trade_no");
sql.SELECT("acc_trade_no");
sql.SELECT("trade_type"); sql.SELECT("trade_type");
sql.SELECT("trade_amount"); sql.SELECT("trade_amount");
sql.SELECT("trade_time"); sql.SELECT("trade_time");
@ -173,6 +182,7 @@ public class BsTradeSettleSqlProvider {
sql.SELECT("settle_amount"); sql.SELECT("settle_amount");
sql.SELECT("settle_date"); sql.SELECT("settle_date");
sql.SELECT("fee_rate"); sql.SELECT("fee_rate");
sql.SELECT("org_out_trade_no");
sql.SELECT("`status`"); sql.SELECT("`status`");
sql.SELECT("create_time"); sql.SELECT("create_time");
sql.SELECT("ext_1"); sql.SELECT("ext_1");
@ -263,6 +273,10 @@ public class BsTradeSettleSqlProvider {
sql.SET("out_trade_no = #{record.outTradeNo,jdbcType=VARCHAR}"); sql.SET("out_trade_no = #{record.outTradeNo,jdbcType=VARCHAR}");
} }
if (record.getAccTradeNo() != null) {
sql.SET("acc_trade_no = #{record.accTradeNo,jdbcType=VARCHAR}");
}
if (record.getTradeType() != null) { if (record.getTradeType() != null) {
sql.SET("trade_type = #{record.tradeType,jdbcType=INTEGER}"); sql.SET("trade_type = #{record.tradeType,jdbcType=INTEGER}");
} }
@ -291,6 +305,10 @@ public class BsTradeSettleSqlProvider {
sql.SET("fee_rate = #{record.feeRate,jdbcType=DECIMAL}"); sql.SET("fee_rate = #{record.feeRate,jdbcType=DECIMAL}");
} }
if (record.getOrgOutTradeNo() != null) {
sql.SET("org_out_trade_no = #{record.orgOutTradeNo,jdbcType=VARCHAR}");
}
if (record.getStatus() != null) { if (record.getStatus() != null) {
sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); sql.SET("`status` = #{record.status,jdbcType=INTEGER}");
} }
@ -336,6 +354,7 @@ public class BsTradeSettleSqlProvider {
sql.SET("platform_log_no = #{record.platformLogNo,jdbcType=VARCHAR}"); sql.SET("platform_log_no = #{record.platformLogNo,jdbcType=VARCHAR}");
sql.SET("pay_mode = #{record.payMode,jdbcType=VARCHAR}"); sql.SET("pay_mode = #{record.payMode,jdbcType=VARCHAR}");
sql.SET("out_trade_no = #{record.outTradeNo,jdbcType=VARCHAR}"); sql.SET("out_trade_no = #{record.outTradeNo,jdbcType=VARCHAR}");
sql.SET("acc_trade_no = #{record.accTradeNo,jdbcType=VARCHAR}");
sql.SET("trade_type = #{record.tradeType,jdbcType=INTEGER}"); sql.SET("trade_type = #{record.tradeType,jdbcType=INTEGER}");
sql.SET("trade_amount = #{record.tradeAmount,jdbcType=DECIMAL}"); sql.SET("trade_amount = #{record.tradeAmount,jdbcType=DECIMAL}");
sql.SET("trade_time = #{record.tradeTime,jdbcType=TIMESTAMP}"); sql.SET("trade_time = #{record.tradeTime,jdbcType=TIMESTAMP}");
@ -343,6 +362,7 @@ public class BsTradeSettleSqlProvider {
sql.SET("settle_amount = #{record.settleAmount,jdbcType=DECIMAL}"); sql.SET("settle_amount = #{record.settleAmount,jdbcType=DECIMAL}");
sql.SET("settle_date = #{record.settleDate,jdbcType=DATE}"); sql.SET("settle_date = #{record.settleDate,jdbcType=DATE}");
sql.SET("fee_rate = #{record.feeRate,jdbcType=DECIMAL}"); sql.SET("fee_rate = #{record.feeRate,jdbcType=DECIMAL}");
sql.SET("org_out_trade_no = #{record.orgOutTradeNo,jdbcType=VARCHAR}");
sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); sql.SET("`status` = #{record.status,jdbcType=INTEGER}");
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}");
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}"); sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}");
@ -422,6 +442,10 @@ public class BsTradeSettleSqlProvider {
sql.SET("out_trade_no = #{outTradeNo,jdbcType=VARCHAR}"); sql.SET("out_trade_no = #{outTradeNo,jdbcType=VARCHAR}");
} }
if (record.getAccTradeNo() != null) {
sql.SET("acc_trade_no = #{accTradeNo,jdbcType=VARCHAR}");
}
if (record.getTradeType() != null) { if (record.getTradeType() != null) {
sql.SET("trade_type = #{tradeType,jdbcType=INTEGER}"); sql.SET("trade_type = #{tradeType,jdbcType=INTEGER}");
} }
@ -450,6 +474,10 @@ public class BsTradeSettleSqlProvider {
sql.SET("fee_rate = #{feeRate,jdbcType=DECIMAL}"); sql.SET("fee_rate = #{feeRate,jdbcType=DECIMAL}");
} }
if (record.getOrgOutTradeNo() != null) {
sql.SET("org_out_trade_no = #{orgOutTradeNo,jdbcType=VARCHAR}");
}
if (record.getStatus() != null) { if (record.getStatus() != null) {
sql.SET("`status` = #{status,jdbcType=INTEGER}"); sql.SET("`status` = #{status,jdbcType=INTEGER}");
} }

@ -1,6 +1,7 @@
package com.hfkj.dao; package com.hfkj.dao;
import com.hfkj.openapi.v1.model.TradeBillsModel; import com.hfkj.openapi.v1.model.TradeBillsModel;
import com.hfkj.openapi.v1.model.TradeDetailBillsModel;
import com.hfkj.openapi.v1.model.TradeRefundBillsModel; import com.hfkj.openapi.v1.model.TradeRefundBillsModel;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Select;
@ -55,7 +56,6 @@ public interface OpenApiTradeOrderMapper {
}) })
List<TradeBillsModel> queryTradeBills(@Param("merNo") String merNo,@Param("billDateS") String billDateS, @Param("billDateE") String billDateE); List<TradeBillsModel> queryTradeBills(@Param("merNo") String merNo,@Param("billDateS") String billDateS, @Param("billDateE") String billDateE);
@Select({ @Select({
"<script>" + "<script>" +
" select " + " select " +
@ -84,4 +84,42 @@ public interface OpenApiTradeOrderMapper {
}) })
List<TradeRefundBillsModel> queryRefundBills(@Param("merNo") String merNo, @Param("billDateS") String billDateS, @Param("billDateE") String billDateE); List<TradeRefundBillsModel> queryRefundBills(@Param("merNo") String merNo, @Param("billDateS") String billDateS, @Param("billDateE") String billDateE);
@Select("<script>" +
" SET @i=0;" +
" select" +
" @i := @i+1 serialNumber," +
" mer_no merchantNo," +
" mer_name merchantName," +
" trade_time tradeTime," +
" case trade_type" +
" when 2 then CONCAT('-',trade_amount)" +
" else trade_amount end tradeAmount," +
" case trade_type" +
" when 2 then CONCAT('-',shd_fee_amt)" +
" else shd_fee_amt end shdFeeAmt," +
" case trade_type" +
" when 2 then CONCAT('-',settle_amount)" +
" else settle_amount end settleAmount," +
" case trade_type " +
" when 1 then '交易支付' " +
" when 2 then '交易退款'" +
" end tradeType," +
" case pay_mode " +
" when 'WECHAT' then '微信' " +
" when 'ALIPAY' then '支付宝'" +
" when 'UQRCODEPAY' then '云闪付'" +
" end payMode," +
" out_trade_no outTradeNo," +
" acc_trade_no accTradeNo," +
" settle_date settleDate," +
" CONCAT(fee_rate,'%') feeRate," +
" org_out_trade_no orgOutTradeNo" +
" from bs_trade_settle " +
" where `status` = 1" +
" and mer_no = #{merNo}" +
" and settle_date BETWEEN #{billDateS} and #{billDateE} "+
" ORDER BY trade_time " +
"</script>")
List<TradeDetailBillsModel> queryTradeSettleBills(@Param("merNo") String merNo, @Param("billDateS") String billDateS, @Param("billDateE") String billDateE);
} }

@ -69,6 +69,11 @@ public class BsTradeOrderRefund implements Serializable {
*/ */
private String refundNo; private String refundNo;
/**
* 账户端订单号
*/
private String accTradeNo;
/** /**
* 交易金额 * 交易金额
*/ */
@ -230,6 +235,14 @@ public class BsTradeOrderRefund implements Serializable {
this.refundNo = refundNo; this.refundNo = refundNo;
} }
public String getAccTradeNo() {
return accTradeNo;
}
public void setAccTradeNo(String accTradeNo) {
this.accTradeNo = accTradeNo;
}
public BigDecimal getTotalAmount() { public BigDecimal getTotalAmount() {
return totalAmount; return totalAmount;
} }
@ -381,6 +394,7 @@ public class BsTradeOrderRefund implements Serializable {
&& (this.getPlatformOrderNo() == null ? other.getPlatformOrderNo() == null : this.getPlatformOrderNo().equals(other.getPlatformOrderNo())) && (this.getPlatformOrderNo() == null ? other.getPlatformOrderNo() == null : this.getPlatformOrderNo().equals(other.getPlatformOrderNo()))
&& (this.getPlatformLogNo() == null ? other.getPlatformLogNo() == null : this.getPlatformLogNo().equals(other.getPlatformLogNo())) && (this.getPlatformLogNo() == null ? other.getPlatformLogNo() == null : this.getPlatformLogNo().equals(other.getPlatformLogNo()))
&& (this.getRefundNo() == null ? other.getRefundNo() == null : this.getRefundNo().equals(other.getRefundNo())) && (this.getRefundNo() == null ? other.getRefundNo() == null : this.getRefundNo().equals(other.getRefundNo()))
&& (this.getAccTradeNo() == null ? other.getAccTradeNo() == null : this.getAccTradeNo().equals(other.getAccTradeNo()))
&& (this.getTotalAmount() == null ? other.getTotalAmount() == null : this.getTotalAmount().equals(other.getTotalAmount())) && (this.getTotalAmount() == null ? other.getTotalAmount() == null : this.getTotalAmount().equals(other.getTotalAmount()))
&& (this.getRefundAmount() == null ? other.getRefundAmount() == null : this.getRefundAmount().equals(other.getRefundAmount())) && (this.getRefundAmount() == null ? other.getRefundAmount() == null : this.getRefundAmount().equals(other.getRefundAmount()))
&& (this.getPayerAmount() == null ? other.getPayerAmount() == null : this.getPayerAmount().equals(other.getPayerAmount())) && (this.getPayerAmount() == null ? other.getPayerAmount() == null : this.getPayerAmount().equals(other.getPayerAmount()))
@ -414,6 +428,7 @@ public class BsTradeOrderRefund implements Serializable {
result = prime * result + ((getPlatformOrderNo() == null) ? 0 : getPlatformOrderNo().hashCode()); result = prime * result + ((getPlatformOrderNo() == null) ? 0 : getPlatformOrderNo().hashCode());
result = prime * result + ((getPlatformLogNo() == null) ? 0 : getPlatformLogNo().hashCode()); result = prime * result + ((getPlatformLogNo() == null) ? 0 : getPlatformLogNo().hashCode());
result = prime * result + ((getRefundNo() == null) ? 0 : getRefundNo().hashCode()); result = prime * result + ((getRefundNo() == null) ? 0 : getRefundNo().hashCode());
result = prime * result + ((getAccTradeNo() == null) ? 0 : getAccTradeNo().hashCode());
result = prime * result + ((getTotalAmount() == null) ? 0 : getTotalAmount().hashCode()); result = prime * result + ((getTotalAmount() == null) ? 0 : getTotalAmount().hashCode());
result = prime * result + ((getRefundAmount() == null) ? 0 : getRefundAmount().hashCode()); result = prime * result + ((getRefundAmount() == null) ? 0 : getRefundAmount().hashCode());
result = prime * result + ((getPayerAmount() == null) ? 0 : getPayerAmount().hashCode()); result = prime * result + ((getPayerAmount() == null) ? 0 : getPayerAmount().hashCode());
@ -450,6 +465,7 @@ public class BsTradeOrderRefund implements Serializable {
sb.append(", platformOrderNo=").append(platformOrderNo); sb.append(", platformOrderNo=").append(platformOrderNo);
sb.append(", platformLogNo=").append(platformLogNo); sb.append(", platformLogNo=").append(platformLogNo);
sb.append(", refundNo=").append(refundNo); sb.append(", refundNo=").append(refundNo);
sb.append(", accTradeNo=").append(accTradeNo);
sb.append(", totalAmount=").append(totalAmount); sb.append(", totalAmount=").append(totalAmount);
sb.append(", refundAmount=").append(refundAmount); sb.append(", refundAmount=").append(refundAmount);
sb.append(", payerAmount=").append(payerAmount); sb.append(", payerAmount=").append(payerAmount);

@ -853,6 +853,76 @@ public class BsTradeOrderRefundExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andAccTradeNoIsNull() {
addCriterion("acc_trade_no is null");
return (Criteria) this;
}
public Criteria andAccTradeNoIsNotNull() {
addCriterion("acc_trade_no is not null");
return (Criteria) this;
}
public Criteria andAccTradeNoEqualTo(String value) {
addCriterion("acc_trade_no =", value, "accTradeNo");
return (Criteria) this;
}
public Criteria andAccTradeNoNotEqualTo(String value) {
addCriterion("acc_trade_no <>", value, "accTradeNo");
return (Criteria) this;
}
public Criteria andAccTradeNoGreaterThan(String value) {
addCriterion("acc_trade_no >", value, "accTradeNo");
return (Criteria) this;
}
public Criteria andAccTradeNoGreaterThanOrEqualTo(String value) {
addCriterion("acc_trade_no >=", value, "accTradeNo");
return (Criteria) this;
}
public Criteria andAccTradeNoLessThan(String value) {
addCriterion("acc_trade_no <", value, "accTradeNo");
return (Criteria) this;
}
public Criteria andAccTradeNoLessThanOrEqualTo(String value) {
addCriterion("acc_trade_no <=", value, "accTradeNo");
return (Criteria) this;
}
public Criteria andAccTradeNoLike(String value) {
addCriterion("acc_trade_no like", value, "accTradeNo");
return (Criteria) this;
}
public Criteria andAccTradeNoNotLike(String value) {
addCriterion("acc_trade_no not like", value, "accTradeNo");
return (Criteria) this;
}
public Criteria andAccTradeNoIn(List<String> values) {
addCriterion("acc_trade_no in", values, "accTradeNo");
return (Criteria) this;
}
public Criteria andAccTradeNoNotIn(List<String> values) {
addCriterion("acc_trade_no not in", values, "accTradeNo");
return (Criteria) this;
}
public Criteria andAccTradeNoBetween(String value1, String value2) {
addCriterion("acc_trade_no between", value1, value2, "accTradeNo");
return (Criteria) this;
}
public Criteria andAccTradeNoNotBetween(String value1, String value2) {
addCriterion("acc_trade_no not between", value1, value2, "accTradeNo");
return (Criteria) this;
}
public Criteria andTotalAmountIsNull() { public Criteria andTotalAmountIsNull() {
addCriterion("total_amount is null"); addCriterion("total_amount is null");
return (Criteria) this; return (Criteria) this;

@ -103,6 +103,11 @@ public class BsTradeSettle implements Serializable {
*/ */
private String outTradeNo; private String outTradeNo;
/**
* 账户端交易流水号
*/
private String accTradeNo;
/** /**
* 交易类型 1支付 2交易退款 * 交易类型 1支付 2交易退款
*/ */
@ -138,6 +143,11 @@ public class BsTradeSettle implements Serializable {
*/ */
private BigDecimal feeRate; private BigDecimal feeRate;
/**
* 原商户交易流水
*/
private String orgOutTradeNo;
/** /**
* 状态 0删除 1正常 * 状态 0删除 1正常
*/ */
@ -292,6 +302,14 @@ public class BsTradeSettle implements Serializable {
this.outTradeNo = outTradeNo; this.outTradeNo = outTradeNo;
} }
public String getAccTradeNo() {
return accTradeNo;
}
public void setAccTradeNo(String accTradeNo) {
this.accTradeNo = accTradeNo;
}
public Integer getTradeType() { public Integer getTradeType() {
return tradeType; return tradeType;
} }
@ -348,6 +366,14 @@ public class BsTradeSettle implements Serializable {
this.feeRate = feeRate; this.feeRate = feeRate;
} }
public String getOrgOutTradeNo() {
return orgOutTradeNo;
}
public void setOrgOutTradeNo(String orgOutTradeNo) {
this.orgOutTradeNo = orgOutTradeNo;
}
public Integer getStatus() { public Integer getStatus() {
return status; return status;
} }
@ -417,6 +443,7 @@ public class BsTradeSettle implements Serializable {
&& (this.getPlatformLogNo() == null ? other.getPlatformLogNo() == null : this.getPlatformLogNo().equals(other.getPlatformLogNo())) && (this.getPlatformLogNo() == null ? other.getPlatformLogNo() == null : this.getPlatformLogNo().equals(other.getPlatformLogNo()))
&& (this.getPayMode() == null ? other.getPayMode() == null : this.getPayMode().equals(other.getPayMode())) && (this.getPayMode() == null ? other.getPayMode() == null : this.getPayMode().equals(other.getPayMode()))
&& (this.getOutTradeNo() == null ? other.getOutTradeNo() == null : this.getOutTradeNo().equals(other.getOutTradeNo())) && (this.getOutTradeNo() == null ? other.getOutTradeNo() == null : this.getOutTradeNo().equals(other.getOutTradeNo()))
&& (this.getAccTradeNo() == null ? other.getAccTradeNo() == null : this.getAccTradeNo().equals(other.getAccTradeNo()))
&& (this.getTradeType() == null ? other.getTradeType() == null : this.getTradeType().equals(other.getTradeType())) && (this.getTradeType() == null ? other.getTradeType() == null : this.getTradeType().equals(other.getTradeType()))
&& (this.getTradeAmount() == null ? other.getTradeAmount() == null : this.getTradeAmount().equals(other.getTradeAmount())) && (this.getTradeAmount() == null ? other.getTradeAmount() == null : this.getTradeAmount().equals(other.getTradeAmount()))
&& (this.getTradeTime() == null ? other.getTradeTime() == null : this.getTradeTime().equals(other.getTradeTime())) && (this.getTradeTime() == null ? other.getTradeTime() == null : this.getTradeTime().equals(other.getTradeTime()))
@ -424,6 +451,7 @@ public class BsTradeSettle implements Serializable {
&& (this.getSettleAmount() == null ? other.getSettleAmount() == null : this.getSettleAmount().equals(other.getSettleAmount())) && (this.getSettleAmount() == null ? other.getSettleAmount() == null : this.getSettleAmount().equals(other.getSettleAmount()))
&& (this.getSettleDate() == null ? other.getSettleDate() == null : this.getSettleDate().equals(other.getSettleDate())) && (this.getSettleDate() == null ? other.getSettleDate() == null : this.getSettleDate().equals(other.getSettleDate()))
&& (this.getFeeRate() == null ? other.getFeeRate() == null : this.getFeeRate().equals(other.getFeeRate())) && (this.getFeeRate() == null ? other.getFeeRate() == null : this.getFeeRate().equals(other.getFeeRate()))
&& (this.getOrgOutTradeNo() == null ? other.getOrgOutTradeNo() == null : this.getOrgOutTradeNo().equals(other.getOrgOutTradeNo()))
&& (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus())) && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime())) && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
&& (this.getExt1() == null ? other.getExt1() == null : this.getExt1().equals(other.getExt1())) && (this.getExt1() == null ? other.getExt1() == null : this.getExt1().equals(other.getExt1()))
@ -452,6 +480,7 @@ public class BsTradeSettle implements Serializable {
result = prime * result + ((getPlatformLogNo() == null) ? 0 : getPlatformLogNo().hashCode()); result = prime * result + ((getPlatformLogNo() == null) ? 0 : getPlatformLogNo().hashCode());
result = prime * result + ((getPayMode() == null) ? 0 : getPayMode().hashCode()); result = prime * result + ((getPayMode() == null) ? 0 : getPayMode().hashCode());
result = prime * result + ((getOutTradeNo() == null) ? 0 : getOutTradeNo().hashCode()); result = prime * result + ((getOutTradeNo() == null) ? 0 : getOutTradeNo().hashCode());
result = prime * result + ((getAccTradeNo() == null) ? 0 : getAccTradeNo().hashCode());
result = prime * result + ((getTradeType() == null) ? 0 : getTradeType().hashCode()); result = prime * result + ((getTradeType() == null) ? 0 : getTradeType().hashCode());
result = prime * result + ((getTradeAmount() == null) ? 0 : getTradeAmount().hashCode()); result = prime * result + ((getTradeAmount() == null) ? 0 : getTradeAmount().hashCode());
result = prime * result + ((getTradeTime() == null) ? 0 : getTradeTime().hashCode()); result = prime * result + ((getTradeTime() == null) ? 0 : getTradeTime().hashCode());
@ -459,6 +488,7 @@ public class BsTradeSettle implements Serializable {
result = prime * result + ((getSettleAmount() == null) ? 0 : getSettleAmount().hashCode()); result = prime * result + ((getSettleAmount() == null) ? 0 : getSettleAmount().hashCode());
result = prime * result + ((getSettleDate() == null) ? 0 : getSettleDate().hashCode()); result = prime * result + ((getSettleDate() == null) ? 0 : getSettleDate().hashCode());
result = prime * result + ((getFeeRate() == null) ? 0 : getFeeRate().hashCode()); result = prime * result + ((getFeeRate() == null) ? 0 : getFeeRate().hashCode());
result = prime * result + ((getOrgOutTradeNo() == null) ? 0 : getOrgOutTradeNo().hashCode());
result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode()); result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode()); result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
result = prime * result + ((getExt1() == null) ? 0 : getExt1().hashCode()); result = prime * result + ((getExt1() == null) ? 0 : getExt1().hashCode());
@ -490,6 +520,7 @@ public class BsTradeSettle implements Serializable {
sb.append(", platformLogNo=").append(platformLogNo); sb.append(", platformLogNo=").append(platformLogNo);
sb.append(", payMode=").append(payMode); sb.append(", payMode=").append(payMode);
sb.append(", outTradeNo=").append(outTradeNo); sb.append(", outTradeNo=").append(outTradeNo);
sb.append(", accTradeNo=").append(accTradeNo);
sb.append(", tradeType=").append(tradeType); sb.append(", tradeType=").append(tradeType);
sb.append(", tradeAmount=").append(tradeAmount); sb.append(", tradeAmount=").append(tradeAmount);
sb.append(", tradeTime=").append(tradeTime); sb.append(", tradeTime=").append(tradeTime);
@ -497,6 +528,7 @@ public class BsTradeSettle implements Serializable {
sb.append(", settleAmount=").append(settleAmount); sb.append(", settleAmount=").append(settleAmount);
sb.append(", settleDate=").append(settleDate); sb.append(", settleDate=").append(settleDate);
sb.append(", feeRate=").append(feeRate); sb.append(", feeRate=").append(feeRate);
sb.append(", orgOutTradeNo=").append(orgOutTradeNo);
sb.append(", status=").append(status); sb.append(", status=").append(status);
sb.append(", createTime=").append(createTime); sb.append(", createTime=").append(createTime);
sb.append(", ext1=").append(ext1); sb.append(", ext1=").append(ext1);

@ -1273,6 +1273,76 @@ public class BsTradeSettleExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andAccTradeNoIsNull() {
addCriterion("acc_trade_no is null");
return (Criteria) this;
}
public Criteria andAccTradeNoIsNotNull() {
addCriterion("acc_trade_no is not null");
return (Criteria) this;
}
public Criteria andAccTradeNoEqualTo(String value) {
addCriterion("acc_trade_no =", value, "accTradeNo");
return (Criteria) this;
}
public Criteria andAccTradeNoNotEqualTo(String value) {
addCriterion("acc_trade_no <>", value, "accTradeNo");
return (Criteria) this;
}
public Criteria andAccTradeNoGreaterThan(String value) {
addCriterion("acc_trade_no >", value, "accTradeNo");
return (Criteria) this;
}
public Criteria andAccTradeNoGreaterThanOrEqualTo(String value) {
addCriterion("acc_trade_no >=", value, "accTradeNo");
return (Criteria) this;
}
public Criteria andAccTradeNoLessThan(String value) {
addCriterion("acc_trade_no <", value, "accTradeNo");
return (Criteria) this;
}
public Criteria andAccTradeNoLessThanOrEqualTo(String value) {
addCriterion("acc_trade_no <=", value, "accTradeNo");
return (Criteria) this;
}
public Criteria andAccTradeNoLike(String value) {
addCriterion("acc_trade_no like", value, "accTradeNo");
return (Criteria) this;
}
public Criteria andAccTradeNoNotLike(String value) {
addCriterion("acc_trade_no not like", value, "accTradeNo");
return (Criteria) this;
}
public Criteria andAccTradeNoIn(List<String> values) {
addCriterion("acc_trade_no in", values, "accTradeNo");
return (Criteria) this;
}
public Criteria andAccTradeNoNotIn(List<String> values) {
addCriterion("acc_trade_no not in", values, "accTradeNo");
return (Criteria) this;
}
public Criteria andAccTradeNoBetween(String value1, String value2) {
addCriterion("acc_trade_no between", value1, value2, "accTradeNo");
return (Criteria) this;
}
public Criteria andAccTradeNoNotBetween(String value1, String value2) {
addCriterion("acc_trade_no not between", value1, value2, "accTradeNo");
return (Criteria) this;
}
public Criteria andTradeTypeIsNull() { public Criteria andTradeTypeIsNull() {
addCriterion("trade_type is null"); addCriterion("trade_type is null");
return (Criteria) this; return (Criteria) this;
@ -1693,6 +1763,76 @@ public class BsTradeSettleExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andOrgOutTradeNoIsNull() {
addCriterion("org_out_trade_no is null");
return (Criteria) this;
}
public Criteria andOrgOutTradeNoIsNotNull() {
addCriterion("org_out_trade_no is not null");
return (Criteria) this;
}
public Criteria andOrgOutTradeNoEqualTo(String value) {
addCriterion("org_out_trade_no =", value, "orgOutTradeNo");
return (Criteria) this;
}
public Criteria andOrgOutTradeNoNotEqualTo(String value) {
addCriterion("org_out_trade_no <>", value, "orgOutTradeNo");
return (Criteria) this;
}
public Criteria andOrgOutTradeNoGreaterThan(String value) {
addCriterion("org_out_trade_no >", value, "orgOutTradeNo");
return (Criteria) this;
}
public Criteria andOrgOutTradeNoGreaterThanOrEqualTo(String value) {
addCriterion("org_out_trade_no >=", value, "orgOutTradeNo");
return (Criteria) this;
}
public Criteria andOrgOutTradeNoLessThan(String value) {
addCriterion("org_out_trade_no <", value, "orgOutTradeNo");
return (Criteria) this;
}
public Criteria andOrgOutTradeNoLessThanOrEqualTo(String value) {
addCriterion("org_out_trade_no <=", value, "orgOutTradeNo");
return (Criteria) this;
}
public Criteria andOrgOutTradeNoLike(String value) {
addCriterion("org_out_trade_no like", value, "orgOutTradeNo");
return (Criteria) this;
}
public Criteria andOrgOutTradeNoNotLike(String value) {
addCriterion("org_out_trade_no not like", value, "orgOutTradeNo");
return (Criteria) this;
}
public Criteria andOrgOutTradeNoIn(List<String> values) {
addCriterion("org_out_trade_no in", values, "orgOutTradeNo");
return (Criteria) this;
}
public Criteria andOrgOutTradeNoNotIn(List<String> values) {
addCriterion("org_out_trade_no not in", values, "orgOutTradeNo");
return (Criteria) this;
}
public Criteria andOrgOutTradeNoBetween(String value1, String value2) {
addCriterion("org_out_trade_no between", value1, value2, "orgOutTradeNo");
return (Criteria) this;
}
public Criteria andOrgOutTradeNoNotBetween(String value1, String value2) {
addCriterion("org_out_trade_no not between", value1, value2, "orgOutTradeNo");
return (Criteria) this;
}
public Criteria andStatusIsNull() { public Criteria andStatusIsNull() {
addCriterion("`status` is null"); addCriterion("`status` is null");
return (Criteria) this; return (Criteria) this;

@ -0,0 +1,106 @@
package com.hfkj.openapi.v1.model;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.ContentStyle;
import com.alibaba.excel.annotation.write.style.HeadFontStyle;
import lombok.Data;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
import java.util.Date;
/**
* 交易账单模型
* @className: TradeBillsModel
* @author: HuRui
* @date: 2023/5/25
**/
@Data
public class TradeDetailBillsModel {
@ColumnWidth(10)
@ExcelProperty("序号")
@HeadFontStyle(bold = true)
@ContentStyle(horizontalAlignment = HorizontalAlignment.CENTER)
private Long serialNumber;
@ColumnWidth(25)
@ExcelProperty("商户号")
@HeadFontStyle(bold = true)
@ContentStyle(horizontalAlignment = HorizontalAlignment.CENTER)
private String merchantNo;
@ColumnWidth(30)
@ExcelProperty("商户名称")
@HeadFontStyle(bold = true)
@ContentStyle(horizontalAlignment = HorizontalAlignment.CENTER)
private String merchantName;
@ColumnWidth(25)
@ExcelProperty("交易日期")
@HeadFontStyle(bold = true)
@ContentStyle(horizontalAlignment = HorizontalAlignment.CENTER)
private Date tradeTime;
@ColumnWidth(15)
@ExcelProperty("交易金额")
@HeadFontStyle(bold = true)
@ContentStyle(horizontalAlignment = HorizontalAlignment.CENTER)
private String tradeAmount;
@ColumnWidth(15)
@ExcelProperty("交易手续费")
@HeadFontStyle(bold = true)
@ContentStyle(horizontalAlignment = HorizontalAlignment.CENTER)
private String shdFeeAmt;
@ColumnWidth(15)
@ExcelProperty("结算金额")
@HeadFontStyle(bold = true)
@ContentStyle(horizontalAlignment = HorizontalAlignment.CENTER)
private String settleAmount;
@ColumnWidth(15)
@ExcelProperty("交易类型")
@HeadFontStyle(bold = true)
@ContentStyle(horizontalAlignment = HorizontalAlignment.CENTER)
private String tradeType;
@ColumnWidth(15)
@ExcelProperty("支付渠道")
@HeadFontStyle(bold = true)
@ContentStyle(horizontalAlignment = HorizontalAlignment.CENTER)
private String payMode;
@ColumnWidth(35)
@ExcelProperty("商户订单号")
@HeadFontStyle(bold = true)
@ContentStyle(horizontalAlignment = HorizontalAlignment.CENTER)
private String outTradeNo;
@ColumnWidth(35)
@ExcelProperty("渠道订单号")
@HeadFontStyle(bold = true)
@ContentStyle(horizontalAlignment = HorizontalAlignment.CENTER)
private String accTradeNo;
@ColumnWidth(15)
@ExcelProperty("清算日期")
@HeadFontStyle(bold = true)
@ContentStyle(horizontalAlignment = HorizontalAlignment.CENTER)
private String settleDate;
@ColumnWidth(15)
@ExcelProperty("手续费率")
@HeadFontStyle(bold = true)
@ContentStyle(horizontalAlignment = HorizontalAlignment.CENTER)
private String feeRate;
@ColumnWidth(35)
@ExcelProperty("原商户订单号")
@HeadFontStyle(bold = true)
@ContentStyle(horizontalAlignment = HorizontalAlignment.CENTER)
private String orgOutTradeNo;
}

@ -0,0 +1,40 @@
package com.hfkj.openapi.v1.model.request;
import lombok.Data;
import javax.validation.constraints.NotBlank;
/**
* 请求账单下载模型
* @className: TradePreorderModel
* @author: HuRui
* @date: 2023/5/23
**/
@Data
public class RequestTradeSettleBillsModel {
/**
* 商户号
*/
@NotBlank(message = "商户号必填项")
private String merchantNo;
/**
* 报表开始时间
*/
@NotBlank(message = "开始时间必填项")
private Long billDateS;
/**
* 报表结束时间
*/
@NotBlank(message = "结束时间必填项")
private Long billDateE;
/**
* 签名参数
*/
@NotBlank(message = "签名必填项")
private String sign;
}

@ -6,6 +6,7 @@ import com.hfkj.openapi.v1.model.TradeRefundBillsModel;
import com.hfkj.openapi.v1.model.request.RequestRefundTradeModel; import com.hfkj.openapi.v1.model.request.RequestRefundTradeModel;
import com.hfkj.openapi.v1.model.response.ResponseRefundTradeModel; import com.hfkj.openapi.v1.model.response.ResponseRefundTradeModel;
import com.hfkj.openapi.v1.model.TradeBillsModel; import com.hfkj.openapi.v1.model.TradeBillsModel;
import com.hfkj.openapi.v1.model.TradeDetailBillsModel;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -61,4 +62,13 @@ public interface OpenApiTradeOrderService {
* @return * @return
*/ */
List<TradeRefundBillsModel> tradeRefundBills(String merNo, Long billDateS, Long billDateE); List<TradeRefundBillsModel> tradeRefundBills(String merNo, Long billDateS, Long billDateE);
/**
* 交易结算明细
* @param merNo
* @param billDateS
* @param billDateE
* @return
*/
List<TradeDetailBillsModel> tradeSettleBills(String merNo, Long billDateS, Long billDateE);
} }

@ -9,6 +9,7 @@ import com.hfkj.common.utils.DateUtil;
import com.hfkj.entity.BsTradeOrder; import com.hfkj.entity.BsTradeOrder;
import com.hfkj.entity.BsTradeOrderRefund; import com.hfkj.entity.BsTradeOrderRefund;
import com.hfkj.dao.OpenApiTradeOrderMapper; import com.hfkj.dao.OpenApiTradeOrderMapper;
import com.hfkj.openapi.v1.model.TradeDetailBillsModel;
import com.hfkj.openapi.v1.model.TradeRefundBillsModel; import com.hfkj.openapi.v1.model.TradeRefundBillsModel;
import com.hfkj.openapi.v1.model.request.RequestRefundTradeModel; import com.hfkj.openapi.v1.model.request.RequestRefundTradeModel;
import com.hfkj.openapi.v1.model.response.ResponseRefundTradeModel; import com.hfkj.openapi.v1.model.response.ResponseRefundTradeModel;
@ -152,4 +153,12 @@ public class OpenApiTradeOrderServiceImpl implements OpenApiTradeOrderService {
); );
} }
@Override
public List<TradeDetailBillsModel> tradeSettleBills(String merNo, Long billDateS, Long billDateE) {
return openApiTradeOrderMapper.queryTradeSettleBills(merNo,
DateUtil.date2String(new Date(billDateS), DateUtil.Y_M_D),
DateUtil.date2String(new Date(billDateE), DateUtil.Y_M_D)
);
}
} }

@ -83,8 +83,8 @@ public class SignatureUtil {
public static void main(String[] args) throws Exception { public static void main(String[] args) throws Exception {
String paramStr = "{\n" + String paramStr = "{\n" +
" \"merchantNo\": \"2023051910562136809\",\n" + " \"merchantNo\": \"2023051910562136809\",\n" +
" \"billDateS\": 1684568344000,\n" + " \"billDateS\": 1690819200000,\n" +
" \"billDateE\": 1690527064867" + " \"billDateE\": 1691078400000" +
"}"; "}";
String sign = createSign(JSONObject.parseObject(paramStr), "NGixVhkzVYFFMj8tjj4zOkYQtUiU3bd4"); String sign = createSign(JSONObject.parseObject(paramStr), "NGixVhkzVYFFMj8tjj4zOkYQtUiU3bd4");
System.out.println(sign); System.out.println(sign);

Loading…
Cancel
Save