diff --git a/cweb/src/main/java/com/cweb/controller/TestController.java b/cweb/src/main/java/com/cweb/controller/TestController.java index 48e1355..afcf44f 100644 --- a/cweb/src/main/java/com/cweb/controller/TestController.java +++ b/cweb/src/main/java/com/cweb/controller/TestController.java @@ -292,7 +292,7 @@ public class TestController { try { JSONObject object = new JSONObject(); - object.put("cid", "69511c3be97a4f02fb99d8ab181980b6"); + object.put("cid", code); object.put("price", "0.01"); // 获取语音播报地址 diff --git a/open-api/src/main/java/com/api/controller/v1/TradeController.java b/open-api/src/main/java/com/api/controller/v1/TradeController.java index deefb8f..0911ff4 100644 --- a/open-api/src/main/java/com/api/controller/v1/TradeController.java +++ b/open-api/src/main/java/com/api/controller/v1/TradeController.java @@ -36,6 +36,7 @@ import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import javax.validation.constraints.NotBlank; import java.math.BigDecimal; +import java.util.Calendar; import java.util.Date; import java.util.List; 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 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 ==========="); + } + } + } diff --git a/schedule/src/main/java/com/hfkj/schedule/TradeOrderSchedule.java b/schedule/src/main/java/com/hfkj/schedule/TradeOrderSchedule.java index 38b1bfc..2f40fbd 100644 --- a/schedule/src/main/java/com/hfkj/schedule/TradeOrderSchedule.java +++ b/schedule/src/main/java/com/hfkj/schedule/TradeOrderSchedule.java @@ -294,6 +294,7 @@ public class TradeOrderSchedule { tradeSettle.setPlatformLogNo(tradeOrder.getPlatformLogNo()); tradeSettle.setPayMode(tradeOrder.getPayMode()); tradeSettle.setOutTradeNo(tradeOrder.getOutTradeNo()); + tradeSettle.setAccTradeNo(tradeOrder.getAccTradeNo()); tradeSettle.setTradeAmount(tradeOrder.getAccSettleAmount()); tradeSettle.setTradeType(TradeSettleTradeType.type1.getNumber()); tradeSettle.setSettleAmount(tradeOrder.getAccSettleAmount()); @@ -372,6 +373,7 @@ public class TradeOrderSchedule { tradeSettle.setPlatformLogNo(tradeOrderRefund.getPlatformLogNo()); tradeSettle.setPayMode(tradeOrder.getPayMode()); tradeSettle.setOutTradeNo(tradeOrderRefund.getRefundNo()); + tradeSettle.setAccTradeNo(tradeOrderRefund.getAccTradeNo()); tradeSettle.setTradeType(TradeSettleTradeType.type2.getNumber()); tradeSettle.setTradeAmount(tradeOrderRefund.getRefundAmount()); tradeSettle.setTradeTime(tradeOrderRefund.getRefundTime()); @@ -379,6 +381,7 @@ public class TradeOrderSchedule { tradeSettle.setSettleAmount(tradeOrderRefund.getSettleAmount()); tradeSettle.setSettleDate(tradeOrderRefund.getSettleDate()); tradeSettle.setFeeRate(tradeOrder.getFeeRate()); + tradeSettle.setOrgOutTradeNo(tradeOrder.getOutTradeNo()); tradeSettleService.editData(tradeSettle); } } diff --git a/service/src/main/java/com/hfkj/channel/lakala/LaKaLaTradeService.java b/service/src/main/java/com/hfkj/channel/lakala/LaKaLaTradeService.java index ce11109..b211856 100644 --- a/service/src/main/java/com/hfkj/channel/lakala/LaKaLaTradeService.java +++ b/service/src/main/java/com/hfkj/channel/lakala/LaKaLaTradeService.java @@ -549,6 +549,7 @@ public class LaKaLaTradeService { if (responseBody.getString("code").equals("BBS00000")) { orderRefund.setPlatformOrderNo(data.getString("trade_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.setRefundAmount(data.getBigDecimal("refund_amount").divide(new BigDecimal("100"))); orderRefund.setPayerAmount(data.getBigDecimal("payer_amount").divide(new BigDecimal("100"))); diff --git a/service/src/main/java/com/hfkj/dao/BsTradeOrderRefundMapper.java b/service/src/main/java/com/hfkj/dao/BsTradeOrderRefundMapper.java index df541f5..e195185 100644 --- a/service/src/main/java/com/hfkj/dao/BsTradeOrderRefundMapper.java +++ b/service/src/main/java/com/hfkj/dao/BsTradeOrderRefundMapper.java @@ -43,26 +43,28 @@ public interface BsTradeOrderRefundMapper extends BsTradeOrderRefundMapperExt { "agent_id, salesman_id, ", "mer_id, store_id, platform_type, ", "platform_order_no, platform_log_no, ", - "refund_no, total_amount, ", - "refund_amount, 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, ext_3)", + "refund_no, acc_trade_no, ", + "total_amount, refund_amount, ", + "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, ext_3)", "values (#{tradeOrderId,jdbcType=BIGINT}, #{outTradeNo,jdbcType=VARCHAR}, ", "#{agentId,jdbcType=BIGINT}, #{salesmanId,jdbcType=BIGINT}, ", "#{merId,jdbcType=BIGINT}, #{storeId,jdbcType=BIGINT}, #{platformType,jdbcType=INTEGER}, ", "#{platformOrderNo,jdbcType=VARCHAR}, #{platformLogNo,jdbcType=VARCHAR}, ", - "#{refundNo,jdbcType=VARCHAR}, #{totalAmount,jdbcType=DECIMAL}, ", - "#{refundAmount,jdbcType=DECIMAL}, #{payerAmount,jdbcType=DECIMAL}, ", - "#{shdFeeAmt,jdbcType=DECIMAL}, #{settleAmount,jdbcType=DECIMAL}, ", - "#{settleDate,jdbcType=DATE}, #{refundReason,jdbcType=VARCHAR}, ", - "#{status,jdbcType=INTEGER}, #{refundTime,jdbcType=TIMESTAMP}, ", - "#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, ", - "#{operatorId,jdbcType=BIGINT}, #{operatorName,jdbcType=VARCHAR}, ", - "#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" + "#{refundNo,jdbcType=VARCHAR}, #{accTradeNo,jdbcType=VARCHAR}, ", + "#{totalAmount,jdbcType=DECIMAL}, #{refundAmount,jdbcType=DECIMAL}, ", + "#{payerAmount,jdbcType=DECIMAL}, #{shdFeeAmt,jdbcType=DECIMAL}, ", + "#{settleAmount,jdbcType=DECIMAL}, #{settleDate,jdbcType=DATE}, ", + "#{refundReason,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, ", + "#{refundTime,jdbcType=TIMESTAMP}, #{createTime,jdbcType=TIMESTAMP}, ", + "#{updateTime,jdbcType=TIMESTAMP}, #{operatorId,jdbcType=BIGINT}, ", + "#{operatorName,jdbcType=VARCHAR}, #{ext1,jdbcType=VARCHAR}, ", + "#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" }) @Options(useGeneratedKeys=true,keyProperty="id") 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_log_no", property="platformLogNo", 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="refund_amount", property="refundAmount", jdbcType=JdbcType.DECIMAL), @Result(column="payer_amount", property="payerAmount", jdbcType=JdbcType.DECIMAL), @@ -106,7 +109,7 @@ public interface BsTradeOrderRefundMapper extends BsTradeOrderRefundMapperExt { @Select({ "select", "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`, ", "refund_time, create_time, update_time, operator_id, operator_name, ext_1, ext_2, ", "ext_3", @@ -125,6 +128,7 @@ public interface BsTradeOrderRefundMapper extends BsTradeOrderRefundMapperExt { @Result(column="platform_order_no", property="platformOrderNo", jdbcType=JdbcType.VARCHAR), @Result(column="platform_log_no", property="platformLogNo", 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="refund_amount", property="refundAmount", 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_log_no = #{platformLogNo,jdbcType=VARCHAR},", "refund_no = #{refundNo,jdbcType=VARCHAR},", + "acc_trade_no = #{accTradeNo,jdbcType=VARCHAR},", "total_amount = #{totalAmount,jdbcType=DECIMAL},", "refund_amount = #{refundAmount,jdbcType=DECIMAL},", "payer_amount = #{payerAmount,jdbcType=DECIMAL},", diff --git a/service/src/main/java/com/hfkj/dao/BsTradeOrderRefundSqlProvider.java b/service/src/main/java/com/hfkj/dao/BsTradeOrderRefundSqlProvider.java index a4ba584..6eb889d 100644 --- a/service/src/main/java/com/hfkj/dao/BsTradeOrderRefundSqlProvider.java +++ b/service/src/main/java/com/hfkj/dao/BsTradeOrderRefundSqlProvider.java @@ -68,6 +68,10 @@ public class BsTradeOrderRefundSqlProvider { sql.VALUES("refund_no", "#{refundNo,jdbcType=VARCHAR}"); } + if (record.getAccTradeNo() != null) { + sql.VALUES("acc_trade_no", "#{accTradeNo,jdbcType=VARCHAR}"); + } + if (record.getTotalAmount() != null) { sql.VALUES("total_amount", "#{totalAmount,jdbcType=DECIMAL}"); } @@ -152,6 +156,7 @@ public class BsTradeOrderRefundSqlProvider { sql.SELECT("platform_order_no"); sql.SELECT("platform_log_no"); sql.SELECT("refund_no"); + sql.SELECT("acc_trade_no"); sql.SELECT("total_amount"); sql.SELECT("refund_amount"); sql.SELECT("payer_amount"); @@ -229,6 +234,10 @@ public class BsTradeOrderRefundSqlProvider { 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) { 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_log_no = #{record.platformLogNo,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("refund_amount = #{record.refundAmount,jdbcType=DECIMAL}"); sql.SET("payer_amount = #{record.payerAmount,jdbcType=DECIMAL}"); @@ -378,6 +388,10 @@ public class BsTradeOrderRefundSqlProvider { sql.SET("refund_no = #{refundNo,jdbcType=VARCHAR}"); } + if (record.getAccTradeNo() != null) { + sql.SET("acc_trade_no = #{accTradeNo,jdbcType=VARCHAR}"); + } + if (record.getTotalAmount() != null) { sql.SET("total_amount = #{totalAmount,jdbcType=DECIMAL}"); } diff --git a/service/src/main/java/com/hfkj/dao/BsTradeSettleMapper.java b/service/src/main/java/com/hfkj/dao/BsTradeSettleMapper.java index 36b7fb5..8d3b4bf 100644 --- a/service/src/main/java/com/hfkj/dao/BsTradeSettleMapper.java +++ b/service/src/main/java/com/hfkj/dao/BsTradeSettleMapper.java @@ -46,10 +46,11 @@ public interface BsTradeSettleMapper extends BsTradeSettleMapperExt { "platform_type, platform_mer_no, ", "platform_trade_no, platform_log_no, ", "pay_mode, out_trade_no, ", - "trade_type, trade_amount, ", - "trade_time, shd_fee_amt, ", - "settle_amount, settle_date, ", - "fee_rate, `status`, ", + "acc_trade_no, trade_type, ", + "trade_amount, trade_time, ", + "shd_fee_amt, settle_amount, ", + "settle_date, fee_rate, ", + "org_out_trade_no, `status`, ", "create_time, ext_1, ", "ext_2, ext_3)", "values (#{companyId,jdbcType=BIGINT}, #{agentId,jdbcType=BIGINT}, ", @@ -59,10 +60,11 @@ public interface BsTradeSettleMapper extends BsTradeSettleMapperExt { "#{platformType,jdbcType=INTEGER}, #{platformMerNo,jdbcType=VARCHAR}, ", "#{platformTradeNo,jdbcType=VARCHAR}, #{platformLogNo,jdbcType=VARCHAR}, ", "#{payMode,jdbcType=VARCHAR}, #{outTradeNo,jdbcType=VARCHAR}, ", - "#{tradeType,jdbcType=INTEGER}, #{tradeAmount,jdbcType=DECIMAL}, ", - "#{tradeTime,jdbcType=TIMESTAMP}, #{shdFeeAmt,jdbcType=DECIMAL}, ", - "#{settleAmount,jdbcType=DECIMAL}, #{settleDate,jdbcType=DATE}, ", - "#{feeRate,jdbcType=DECIMAL}, #{status,jdbcType=INTEGER}, ", + "#{accTradeNo,jdbcType=VARCHAR}, #{tradeType,jdbcType=INTEGER}, ", + "#{tradeAmount,jdbcType=DECIMAL}, #{tradeTime,jdbcType=TIMESTAMP}, ", + "#{shdFeeAmt,jdbcType=DECIMAL}, #{settleAmount,jdbcType=DECIMAL}, ", + "#{settleDate,jdbcType=DATE}, #{feeRate,jdbcType=DECIMAL}, ", + "#{orgOutTradeNo,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, ", "#{createTime,jdbcType=TIMESTAMP}, #{ext1,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="pay_mode", property="payMode", 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_amount", property="tradeAmount", jdbcType=JdbcType.DECIMAL), @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_date", property="settleDate", jdbcType=JdbcType.DATE), @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="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), @Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR), @@ -111,9 +115,9 @@ public interface BsTradeSettleMapper extends BsTradeSettleMapperExt { "select", "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, ", - "platform_log_no, pay_mode, out_trade_no, trade_type, trade_amount, trade_time, ", - "shd_fee_amt, settle_amount, settle_date, fee_rate, `status`, create_time, ext_1, ", - "ext_2, ext_3", + "platform_log_no, pay_mode, out_trade_no, acc_trade_no, trade_type, trade_amount, ", + "trade_time, shd_fee_amt, settle_amount, settle_date, fee_rate, org_out_trade_no, ", + "`status`, create_time, ext_1, ext_2, ext_3", "from bs_trade_settle", "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="pay_mode", property="payMode", 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_amount", property="tradeAmount", jdbcType=JdbcType.DECIMAL), @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_date", property="settleDate", jdbcType=JdbcType.DATE), @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="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), @Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR), @@ -177,6 +183,7 @@ public interface BsTradeSettleMapper extends BsTradeSettleMapperExt { "platform_log_no = #{platformLogNo,jdbcType=VARCHAR},", "pay_mode = #{payMode,jdbcType=VARCHAR},", "out_trade_no = #{outTradeNo,jdbcType=VARCHAR},", + "acc_trade_no = #{accTradeNo,jdbcType=VARCHAR},", "trade_type = #{tradeType,jdbcType=INTEGER},", "trade_amount = #{tradeAmount,jdbcType=DECIMAL},", "trade_time = #{tradeTime,jdbcType=TIMESTAMP},", @@ -184,6 +191,7 @@ public interface BsTradeSettleMapper extends BsTradeSettleMapperExt { "settle_amount = #{settleAmount,jdbcType=DECIMAL},", "settle_date = #{settleDate,jdbcType=DATE},", "fee_rate = #{feeRate,jdbcType=DECIMAL},", + "org_out_trade_no = #{orgOutTradeNo,jdbcType=VARCHAR},", "`status` = #{status,jdbcType=INTEGER},", "create_time = #{createTime,jdbcType=TIMESTAMP},", "ext_1 = #{ext1,jdbcType=VARCHAR},", diff --git a/service/src/main/java/com/hfkj/dao/BsTradeSettleSqlProvider.java b/service/src/main/java/com/hfkj/dao/BsTradeSettleSqlProvider.java index 1e3044b..1dbccc5 100644 --- a/service/src/main/java/com/hfkj/dao/BsTradeSettleSqlProvider.java +++ b/service/src/main/java/com/hfkj/dao/BsTradeSettleSqlProvider.java @@ -92,6 +92,10 @@ public class BsTradeSettleSqlProvider { sql.VALUES("out_trade_no", "#{outTradeNo,jdbcType=VARCHAR}"); } + if (record.getAccTradeNo() != null) { + sql.VALUES("acc_trade_no", "#{accTradeNo,jdbcType=VARCHAR}"); + } + if (record.getTradeType() != null) { sql.VALUES("trade_type", "#{tradeType,jdbcType=INTEGER}"); } @@ -120,6 +124,10 @@ public class BsTradeSettleSqlProvider { sql.VALUES("fee_rate", "#{feeRate,jdbcType=DECIMAL}"); } + if (record.getOrgOutTradeNo() != null) { + sql.VALUES("org_out_trade_no", "#{orgOutTradeNo,jdbcType=VARCHAR}"); + } + if (record.getStatus() != null) { sql.VALUES("`status`", "#{status,jdbcType=INTEGER}"); } @@ -166,6 +174,7 @@ public class BsTradeSettleSqlProvider { sql.SELECT("platform_log_no"); sql.SELECT("pay_mode"); sql.SELECT("out_trade_no"); + sql.SELECT("acc_trade_no"); sql.SELECT("trade_type"); sql.SELECT("trade_amount"); sql.SELECT("trade_time"); @@ -173,6 +182,7 @@ public class BsTradeSettleSqlProvider { sql.SELECT("settle_amount"); sql.SELECT("settle_date"); sql.SELECT("fee_rate"); + sql.SELECT("org_out_trade_no"); sql.SELECT("`status`"); sql.SELECT("create_time"); sql.SELECT("ext_1"); @@ -263,6 +273,10 @@ public class BsTradeSettleSqlProvider { 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) { sql.SET("trade_type = #{record.tradeType,jdbcType=INTEGER}"); } @@ -291,6 +305,10 @@ public class BsTradeSettleSqlProvider { 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) { 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("pay_mode = #{record.payMode,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_amount = #{record.tradeAmount,jdbcType=DECIMAL}"); 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_date = #{record.settleDate,jdbcType=DATE}"); 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("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}"); @@ -422,6 +442,10 @@ public class BsTradeSettleSqlProvider { sql.SET("out_trade_no = #{outTradeNo,jdbcType=VARCHAR}"); } + if (record.getAccTradeNo() != null) { + sql.SET("acc_trade_no = #{accTradeNo,jdbcType=VARCHAR}"); + } + if (record.getTradeType() != null) { sql.SET("trade_type = #{tradeType,jdbcType=INTEGER}"); } @@ -450,6 +474,10 @@ public class BsTradeSettleSqlProvider { sql.SET("fee_rate = #{feeRate,jdbcType=DECIMAL}"); } + if (record.getOrgOutTradeNo() != null) { + sql.SET("org_out_trade_no = #{orgOutTradeNo,jdbcType=VARCHAR}"); + } + if (record.getStatus() != null) { sql.SET("`status` = #{status,jdbcType=INTEGER}"); } diff --git a/service/src/main/java/com/hfkj/dao/OpenApiTradeOrderMapper.java b/service/src/main/java/com/hfkj/dao/OpenApiTradeOrderMapper.java index 2954e3f..0c86f7c 100644 --- a/service/src/main/java/com/hfkj/dao/OpenApiTradeOrderMapper.java +++ b/service/src/main/java/com/hfkj/dao/OpenApiTradeOrderMapper.java @@ -1,6 +1,7 @@ package com.hfkj.dao; import com.hfkj.openapi.v1.model.TradeBillsModel; +import com.hfkj.openapi.v1.model.TradeDetailBillsModel; import com.hfkj.openapi.v1.model.TradeRefundBillsModel; import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Select; @@ -55,7 +56,6 @@ public interface OpenApiTradeOrderMapper { }) List queryTradeBills(@Param("merNo") String merNo,@Param("billDateS") String billDateS, @Param("billDateE") String billDateE); - @Select({ "") + List queryTradeSettleBills(@Param("merNo") String merNo, @Param("billDateS") String billDateS, @Param("billDateE") String billDateE); + } diff --git a/service/src/main/java/com/hfkj/entity/BsTradeOrderRefund.java b/service/src/main/java/com/hfkj/entity/BsTradeOrderRefund.java index 9d388c7..b78b301 100644 --- a/service/src/main/java/com/hfkj/entity/BsTradeOrderRefund.java +++ b/service/src/main/java/com/hfkj/entity/BsTradeOrderRefund.java @@ -69,6 +69,11 @@ public class BsTradeOrderRefund implements Serializable { */ private String refundNo; + /** + * 账户端订单号 + */ + private String accTradeNo; + /** * 交易金额 */ @@ -230,6 +235,14 @@ public class BsTradeOrderRefund implements Serializable { this.refundNo = refundNo; } + public String getAccTradeNo() { + return accTradeNo; + } + + public void setAccTradeNo(String accTradeNo) { + this.accTradeNo = accTradeNo; + } + public BigDecimal getTotalAmount() { return totalAmount; } @@ -381,6 +394,7 @@ public class BsTradeOrderRefund implements Serializable { && (this.getPlatformOrderNo() == null ? other.getPlatformOrderNo() == null : this.getPlatformOrderNo().equals(other.getPlatformOrderNo())) && (this.getPlatformLogNo() == null ? other.getPlatformLogNo() == null : this.getPlatformLogNo().equals(other.getPlatformLogNo())) && (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.getRefundAmount() == null ? other.getRefundAmount() == null : this.getRefundAmount().equals(other.getRefundAmount())) && (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 + ((getPlatformLogNo() == null) ? 0 : getPlatformLogNo().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 + ((getRefundAmount() == null) ? 0 : getRefundAmount().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(", platformLogNo=").append(platformLogNo); sb.append(", refundNo=").append(refundNo); + sb.append(", accTradeNo=").append(accTradeNo); sb.append(", totalAmount=").append(totalAmount); sb.append(", refundAmount=").append(refundAmount); sb.append(", payerAmount=").append(payerAmount); diff --git a/service/src/main/java/com/hfkj/entity/BsTradeOrderRefundExample.java b/service/src/main/java/com/hfkj/entity/BsTradeOrderRefundExample.java index 7a2615f..7499bbb 100644 --- a/service/src/main/java/com/hfkj/entity/BsTradeOrderRefundExample.java +++ b/service/src/main/java/com/hfkj/entity/BsTradeOrderRefundExample.java @@ -853,6 +853,76 @@ public class BsTradeOrderRefundExample { 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 values) { + addCriterion("acc_trade_no in", values, "accTradeNo"); + return (Criteria) this; + } + + public Criteria andAccTradeNoNotIn(List 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() { addCriterion("total_amount is null"); return (Criteria) this; diff --git a/service/src/main/java/com/hfkj/entity/BsTradeSettle.java b/service/src/main/java/com/hfkj/entity/BsTradeSettle.java index a5b896d..4d4fee7 100644 --- a/service/src/main/java/com/hfkj/entity/BsTradeSettle.java +++ b/service/src/main/java/com/hfkj/entity/BsTradeSettle.java @@ -103,6 +103,11 @@ public class BsTradeSettle implements Serializable { */ private String outTradeNo; + /** + * 账户端交易流水号 + */ + private String accTradeNo; + /** * 交易类型 1:支付 2:交易退款 */ @@ -138,6 +143,11 @@ public class BsTradeSettle implements Serializable { */ private BigDecimal feeRate; + /** + * 原商户交易流水 + */ + private String orgOutTradeNo; + /** * 状态 0:删除 1:正常 */ @@ -292,6 +302,14 @@ public class BsTradeSettle implements Serializable { this.outTradeNo = outTradeNo; } + public String getAccTradeNo() { + return accTradeNo; + } + + public void setAccTradeNo(String accTradeNo) { + this.accTradeNo = accTradeNo; + } + public Integer getTradeType() { return tradeType; } @@ -348,6 +366,14 @@ public class BsTradeSettle implements Serializable { this.feeRate = feeRate; } + public String getOrgOutTradeNo() { + return orgOutTradeNo; + } + + public void setOrgOutTradeNo(String orgOutTradeNo) { + this.orgOutTradeNo = orgOutTradeNo; + } + public Integer getStatus() { return status; } @@ -417,6 +443,7 @@ public class BsTradeSettle implements Serializable { && (this.getPlatformLogNo() == null ? other.getPlatformLogNo() == null : this.getPlatformLogNo().equals(other.getPlatformLogNo())) && (this.getPayMode() == null ? other.getPayMode() == null : this.getPayMode().equals(other.getPayMode())) && (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.getTradeAmount() == null ? other.getTradeAmount() == null : this.getTradeAmount().equals(other.getTradeAmount())) && (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.getSettleDate() == null ? other.getSettleDate() == null : this.getSettleDate().equals(other.getSettleDate())) && (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.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime())) && (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 + ((getPayMode() == null) ? 0 : getPayMode().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 + ((getTradeAmount() == null) ? 0 : getTradeAmount().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 + ((getSettleDate() == null) ? 0 : getSettleDate().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 + ((getCreateTime() == null) ? 0 : getCreateTime().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(", payMode=").append(payMode); sb.append(", outTradeNo=").append(outTradeNo); + sb.append(", accTradeNo=").append(accTradeNo); sb.append(", tradeType=").append(tradeType); sb.append(", tradeAmount=").append(tradeAmount); sb.append(", tradeTime=").append(tradeTime); @@ -497,6 +528,7 @@ public class BsTradeSettle implements Serializable { sb.append(", settleAmount=").append(settleAmount); sb.append(", settleDate=").append(settleDate); sb.append(", feeRate=").append(feeRate); + sb.append(", orgOutTradeNo=").append(orgOutTradeNo); sb.append(", status=").append(status); sb.append(", createTime=").append(createTime); sb.append(", ext1=").append(ext1); diff --git a/service/src/main/java/com/hfkj/entity/BsTradeSettleExample.java b/service/src/main/java/com/hfkj/entity/BsTradeSettleExample.java index 87263b7..44d74cc 100644 --- a/service/src/main/java/com/hfkj/entity/BsTradeSettleExample.java +++ b/service/src/main/java/com/hfkj/entity/BsTradeSettleExample.java @@ -1273,6 +1273,76 @@ public class BsTradeSettleExample { 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 values) { + addCriterion("acc_trade_no in", values, "accTradeNo"); + return (Criteria) this; + } + + public Criteria andAccTradeNoNotIn(List 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() { addCriterion("trade_type is null"); return (Criteria) this; @@ -1693,6 +1763,76 @@ public class BsTradeSettleExample { 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 values) { + addCriterion("org_out_trade_no in", values, "orgOutTradeNo"); + return (Criteria) this; + } + + public Criteria andOrgOutTradeNoNotIn(List 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() { addCriterion("`status` is null"); return (Criteria) this; diff --git a/service/src/main/java/com/hfkj/openapi/v1/model/TradeDetailBillsModel.java b/service/src/main/java/com/hfkj/openapi/v1/model/TradeDetailBillsModel.java new file mode 100644 index 0000000..ed8ac84 --- /dev/null +++ b/service/src/main/java/com/hfkj/openapi/v1/model/TradeDetailBillsModel.java @@ -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; + + +} diff --git a/service/src/main/java/com/hfkj/openapi/v1/model/request/RequestTradeSettleBillsModel.java b/service/src/main/java/com/hfkj/openapi/v1/model/request/RequestTradeSettleBillsModel.java new file mode 100644 index 0000000..8d3afde --- /dev/null +++ b/service/src/main/java/com/hfkj/openapi/v1/model/request/RequestTradeSettleBillsModel.java @@ -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; + +} diff --git a/service/src/main/java/com/hfkj/openapi/v1/service/OpenApiTradeOrderService.java b/service/src/main/java/com/hfkj/openapi/v1/service/OpenApiTradeOrderService.java index a25a9fb..8532618 100644 --- a/service/src/main/java/com/hfkj/openapi/v1/service/OpenApiTradeOrderService.java +++ b/service/src/main/java/com/hfkj/openapi/v1/service/OpenApiTradeOrderService.java @@ -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.response.ResponseRefundTradeModel; import com.hfkj.openapi.v1.model.TradeBillsModel; +import com.hfkj.openapi.v1.model.TradeDetailBillsModel; import java.util.List; import java.util.Map; @@ -61,4 +62,13 @@ public interface OpenApiTradeOrderService { * @return */ List tradeRefundBills(String merNo, Long billDateS, Long billDateE); + + /** + * 交易结算明细 + * @param merNo + * @param billDateS + * @param billDateE + * @return + */ + List tradeSettleBills(String merNo, Long billDateS, Long billDateE); } diff --git a/service/src/main/java/com/hfkj/openapi/v1/service/impl/OpenApiTradeOrderServiceImpl.java b/service/src/main/java/com/hfkj/openapi/v1/service/impl/OpenApiTradeOrderServiceImpl.java index 2408049..d74f6dc 100644 --- a/service/src/main/java/com/hfkj/openapi/v1/service/impl/OpenApiTradeOrderServiceImpl.java +++ b/service/src/main/java/com/hfkj/openapi/v1/service/impl/OpenApiTradeOrderServiceImpl.java @@ -9,6 +9,7 @@ import com.hfkj.common.utils.DateUtil; import com.hfkj.entity.BsTradeOrder; import com.hfkj.entity.BsTradeOrderRefund; 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.request.RequestRefundTradeModel; import com.hfkj.openapi.v1.model.response.ResponseRefundTradeModel; @@ -152,4 +153,12 @@ public class OpenApiTradeOrderServiceImpl implements OpenApiTradeOrderService { ); } + @Override + public List 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) + ); + } + } diff --git a/service/src/main/java/com/hfkj/openapi/v1/utils/SignatureUtil.java b/service/src/main/java/com/hfkj/openapi/v1/utils/SignatureUtil.java index 7790dce..97b793a 100644 --- a/service/src/main/java/com/hfkj/openapi/v1/utils/SignatureUtil.java +++ b/service/src/main/java/com/hfkj/openapi/v1/utils/SignatureUtil.java @@ -83,8 +83,8 @@ public class SignatureUtil { public static void main(String[] args) throws Exception { String paramStr = "{\n" + " \"merchantNo\": \"2023051910562136809\",\n" + - " \"billDateS\": 1684568344000,\n" + - " \"billDateE\": 1690527064867" + + " \"billDateS\": 1690819200000,\n" + + " \"billDateE\": 1691078400000" + "}"; String sign = createSign(JSONObject.parseObject(paramStr), "NGixVhkzVYFFMj8tjj4zOkYQtUiU3bd4"); System.out.println(sign);