diff --git a/bweb/src/main/java/com/bweb/controller/TestController.java b/bweb/src/main/java/com/bweb/controller/TestController.java index e3b5a41..70bfd4a 100644 --- a/bweb/src/main/java/com/bweb/controller/TestController.java +++ b/bweb/src/main/java/com/bweb/controller/TestController.java @@ -15,6 +15,9 @@ import com.hfkj.channel.saas.utils.SaasMerRequest; import com.hfkj.channel.weixin.WeiXinMerService; import com.hfkj.channel.weixin.utils.WxUtils; import com.hfkj.channel.weixin.utils.sdk.WXPayConstants; +import com.hfkj.common.exception.ErrorCode; +import com.hfkj.common.exception.ErrorHelp; +import com.hfkj.common.exception.SysCode; import com.hfkj.common.utils.DateUtil; import com.hfkj.common.utils.HttpsUtils; import com.hfkj.common.utils.ResponseMsgUtil; @@ -105,6 +108,58 @@ public class TestController { } } + @RequestMapping(value="/queryTrans",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "queryTrans") + public ResponseData queryTrans(@RequestParam(value = "merId", required = true) Long merId, + @RequestParam(value = "code", required = true) String code) { + try { + // 查询商户号 + BsMerPlatformNo platformNo = merPlatformNoService.getPlatformNo(merId, PlatformTypeEnum.type1); + if (platformNo == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到商户号"); + } + // 查询终端号 + BsMerPlatformTerm merPlatformTerm = merPlatformTermService.getMerPlatformTerm(platformNo.getId(), "WECHAT_PAY"); + if (merPlatformTerm == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到商户终端号"); + } + Map commonParam = new HashMap<>(); + commonParam.put("req_time", DateUtil.format(new Date(), "yyyyMMddHHmmss")); + commonParam.put("version", "3.0"); + + Map map = new HashMap<>(); + map.put("merchant_no", platformNo.getCupNo()); + map.put("term_no", merPlatformTerm.getTermNo()); + map.put("log_no", code); + commonParam.put("req_data", map); + + Map reqParam = LaKaLaConfig.generateSignParamsV3(JSONObject.parseObject(JSONObject.toJSONString(commonParam))); + + // 头部参数 + Map heard = new HashMap<>(); + heard.put("Authorization", reqParam.get("Authorization")); + + // 请求记录 + // 请求拉卡拉接口 + JSONObject responseBody = HttpsUtils.doPost(CommonSysConst.getSysConfig().getLkl_request_url() + "/api/v3/lams/merchant/query_trans", commonParam, heard); + log.info("请求参数:"+ JSONObject.toJSONString(commonParam)); + log.info("响应参数:"+ JSONObject.toJSONString(responseBody)); + System.out.println("请求参数:"+ JSONObject.toJSONString(commonParam)); + System.out.println("响应参数:"+ JSONObject.toJSONString(responseBody)); + if (!responseBody.getString("code").equals("000000")) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, responseBody.getString("msg")); + } + return ResponseMsgUtil.success(responseBody.getJSONObject("resp_data")); + + } catch (Exception e) { + log.error(e.getMessage(), e); + return ResponseMsgUtil.exception(e); + } + } + + + @RequestMapping(value="/brushOrder",method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "saasUpdateFee") diff --git a/cweb/src/main/java/com/cweb/controller/TestController.java b/cweb/src/main/java/com/cweb/controller/TestController.java index 22c5b5d..69c128e 100644 --- a/cweb/src/main/java/com/cweb/controller/TestController.java +++ b/cweb/src/main/java/com/cweb/controller/TestController.java @@ -260,7 +260,7 @@ public class TestController { //return ResponseMsgUtil.success(saasMerService.merchantInfo("123364703")); // return ResponseMsgUtil.success(saasCommon.getCategory(null)); // return ResponseMsgUtil.success(laKaLaLedgerService.queryLedgerMer(code)); - return ResponseMsgUtil.success(laKaLaTradeService.queryTrans(code)); + return ResponseMsgUtil.success(laKaLaTradeService.queryTradeOrderTrans(code)); // return ResponseMsgUtil.success(laKaLaTradeService.queryTrade(code)); // return ResponseMsgUtil.success(""); // 1200 diff --git a/schedule/src/main/java/com/hfkj/schedule/TradeOrderSchedule.java b/schedule/src/main/java/com/hfkj/schedule/TradeOrderSchedule.java index 0dbbe06..eb8b35c 100644 --- a/schedule/src/main/java/com/hfkj/schedule/TradeOrderSchedule.java +++ b/schedule/src/main/java/com/hfkj/schedule/TradeOrderSchedule.java @@ -8,10 +8,8 @@ import com.hfkj.common.utils.DateUtil; import com.hfkj.entity.BsTradeOrder; import com.hfkj.entity.BsTradeOrderProfitSharing; import com.hfkj.entity.BsTradeOrderProfitSharingReceiver; -import com.hfkj.service.BsTradeOrderProfitSharingReceiverService; -import com.hfkj.service.BsTradeOrderProfitSharingService; -import com.hfkj.service.BsTradeOrderService; -import com.hfkj.service.BsTradeTakeConfigService; +import com.hfkj.entity.BsTradeOrderRefund; +import com.hfkj.service.*; import com.hfkj.sysenum.*; import org.apache.commons.collections4.MapUtils; import org.slf4j.Logger; @@ -35,16 +33,14 @@ public class TradeOrderSchedule { @Resource private BsTradeOrderProfitSharingService tradeOrderProfitSharingService; - @Resource private BsTradeOrderProfitSharingReceiverService tradeOrderProfitSharingReceiverService; - @Resource private LaKaLaTradeSeparateService laKaLaTradeSeparateService; - @Resource private BsTradeOrderService tradeOrderService; - + @Resource + private BsTradeOrderRefundService tradeOrderRefundService; @Resource private LaKaLaTradeService laKaLaTradeService; @@ -274,7 +270,7 @@ public class TradeOrderSchedule { for (BsTradeOrder tradeOrder : tradeOrderList) { try { // 查询手续费 - JSONObject queryTrans = laKaLaTradeService.queryTrans(tradeOrder.getOutTradeNo()); + JSONObject queryTrans = laKaLaTradeService.queryTradeOrderTrans(tradeOrder.getOutTradeNo()); if (queryTrans != null && queryTrans.getString("trade_state").equals("03")) { tradeOrder.setShdFeeAmt(queryTrans.getBigDecimal("fee_amount")); tradeOrder.setSettleAmount(new BigDecimal(queryTrans.getString("settle_amount").replace(",",""))); @@ -288,4 +284,57 @@ public class TradeOrderSchedule { } } + /** + * 交易退款结算 + * 每分钟扫描一次 + */ + @Scheduled(cron="0 0/1 * * * ?") + public void tradeOrderRefundSettle() { + Map param = new HashMap<>(); + param.put("status", TradeOrderRefundStatusEnum.status2.getNumber()); + param.put("settleAmountIsNull", true); + + Calendar calendar = Calendar.getInstance(); + calendar.add(Calendar.DAY_OF_MONTH, -2); + param.put("payTimeS", calendar.getTimeInMillis()); + + List tradeOrderRefundList = tradeOrderRefundService.getRefundList(param); + + for (BsTradeOrderRefund tradeOrderRefund : tradeOrderRefundList) { + try { + // 查询手续费 + JSONObject queryTrans = laKaLaTradeService.queryTradeOrderRefundTrans(tradeOrderRefund.getRefundNo()); + if (queryTrans != null) { + tradeOrderRefund.setShdFeeAmt(new BigDecimal(queryTrans.getString("fee_amount").replace("-",""))); + tradeOrderRefund.setSettleAmount(new BigDecimal(queryTrans.getString("settle_amount").replace(",","").replace("-",""))); + tradeOrderRefundService.editOrderRefund(tradeOrderRefund); + + // 查询交易 + BsTradeOrder tradeOrder = tradeOrderService.getOrderByOutTradeNo(tradeOrderRefund.getOutTradeNo()); + if (tradeOrder != null) { + if (tradeOrder.getSettleAmount() == null) { + // 查询手续费 + JSONObject tradeOrderTrans = laKaLaTradeService.queryTradeOrderTrans(tradeOrder.getOutTradeNo()); + if (tradeOrderTrans != null && tradeOrderTrans.getString("trade_state").equals("03")) { + tradeOrder.setShdFeeAmt(tradeOrderTrans.getBigDecimal("fee_amount")); + tradeOrder.setSettleAmount(new BigDecimal(tradeOrderTrans.getString("settle_amount").replace(",",""))); + tradeOrder.setSettleDate(tradeOrderTrans.getDate("clear_date")); + tradeOrder.setFeeRate(new BigDecimal(tradeOrderTrans.getString("fee_rate").split(",")[0])); + tradeOrderService.editOrder(tradeOrder); + } + } + tradeOrder.setShdFeeAmt(tradeOrder.getShdFeeAmt().subtract(tradeOrderRefund.getShdFeeAmt())); + tradeOrder.setSettleAmount(tradeOrder.getSettleAmount().subtract(tradeOrderRefund.getSettleAmount())); + tradeOrderService.editOrder(tradeOrder); + } + } + } catch (Exception e) { + System.out.println(e); + } + } + } + + public static void main(String[] args) { + System.out.println(new BigDecimal("-1.00".replace("-","")).toString()); + } } 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 4258eab..ce11109 100644 --- a/service/src/main/java/com/hfkj/channel/lakala/LaKaLaTradeService.java +++ b/service/src/main/java/com/hfkj/channel/lakala/LaKaLaTradeService.java @@ -347,7 +347,7 @@ public class LaKaLaTradeService { * 商户计费查询 * @param tradeNo 订单号 */ - public JSONObject queryTrans(String tradeNo) { + public JSONObject queryTradeOrderTrans(String tradeNo) { log.info("========= Start 商户计费查询 Start ==========="); try { // 查询交易订单 @@ -400,6 +400,63 @@ public class LaKaLaTradeService { } } + /** + * 商户计费查询 + * @param refundNo 订单号 + */ + public JSONObject queryTradeOrderRefundTrans(String refundNo) { + log.info("========= Start 商户计费查询 Start ==========="); + try { + // 查询交易订单 + BsTradeOrderRefund orderRefund = tradeOrderRefundService.getRefundByRefundNo(refundNo); + if (orderRefund == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到交易退款订单"); + } + // 查询商户号 + BsMerPlatformNo platformNo = merPlatformNoService.getPlatformNo(orderRefund.getMerId(), PlatformTypeEnum.type1); + if (platformNo == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到商户号"); + } + // 查询终端号 + BsMerPlatformTerm merPlatformTerm = merPlatformTermService.getMerPlatformTerm(platformNo.getId(), "WECHAT_PAY"); + if (merPlatformTerm == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到商户终端号"); + } + Map commonParam = new HashMap<>(); + commonParam.put("req_time", DateUtil.format(new Date(), "yyyyMMddHHmmss")); + commonParam.put("version", "3.0"); + + Map map = new HashMap<>(); + map.put("merchant_no", platformNo.getCupNo()); + map.put("term_no", merPlatformTerm.getTermNo()); + map.put("log_no", orderRefund.getPlatformLogNo()); + commonParam.put("req_data", map); + + Map reqParam = LaKaLaConfig.generateSignParamsV3(JSONObject.parseObject(JSONObject.toJSONString(commonParam))); + + // 头部参数 + Map heard = new HashMap<>(); + heard.put("Authorization", reqParam.get("Authorization")); + + // 请求记录 + // 请求拉卡拉接口 + JSONObject responseBody = HttpsUtils.doPost(CommonSysConst.getSysConfig().getLkl_request_url() + "/api/v3/lams/merchant/query_trans", commonParam, heard); + log.info("请求参数:"+ JSONObject.toJSONString(commonParam)); + log.info("响应参数:"+ JSONObject.toJSONString(responseBody)); + System.out.println("请求参数:"+ JSONObject.toJSONString(commonParam)); + System.out.println("响应参数:"+ JSONObject.toJSONString(responseBody)); + if (!responseBody.getString("code").equals("000000")) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, responseBody.getString("msg")); + } + return responseBody.getJSONObject("resp_data"); + + } catch (Exception e) { + return null; + } finally { + log.info("========= END 商户计费查询 END ==========="); + } + } + /** * 退款 * @param refundNo 订单号 diff --git a/service/src/main/java/com/hfkj/dao/BsTradeOrderRefundMapper.java b/service/src/main/java/com/hfkj/dao/BsTradeOrderRefundMapper.java index 7298d74..d8393b3 100644 --- a/service/src/main/java/com/hfkj/dao/BsTradeOrderRefundMapper.java +++ b/service/src/main/java/com/hfkj/dao/BsTradeOrderRefundMapper.java @@ -45,6 +45,7 @@ public interface BsTradeOrderRefundMapper extends BsTradeOrderRefundMapperExt { "platform_order_no, platform_log_no, ", "refund_no, total_amount, ", "refund_amount, payer_amount, ", + "shd_fee_amt, settle_amount, ", "refund_reason, `status`, ", "refund_time, create_time, ", "update_time, operator_id, ", @@ -56,6 +57,7 @@ public interface BsTradeOrderRefundMapper extends BsTradeOrderRefundMapperExt { "#{platformOrderNo,jdbcType=VARCHAR}, #{platformLogNo,jdbcType=VARCHAR}, ", "#{refundNo,jdbcType=VARCHAR}, #{totalAmount,jdbcType=DECIMAL}, ", "#{refundAmount,jdbcType=DECIMAL}, #{payerAmount,jdbcType=DECIMAL}, ", + "#{shdFeeAmt,jdbcType=DECIMAL}, #{settleAmount,jdbcType=DECIMAL}, ", "#{refundReason,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, ", "#{refundTime,jdbcType=TIMESTAMP}, #{createTime,jdbcType=TIMESTAMP}, ", "#{updateTime,jdbcType=TIMESTAMP}, #{operatorId,jdbcType=BIGINT}, ", @@ -85,6 +87,8 @@ public interface BsTradeOrderRefundMapper extends BsTradeOrderRefundMapperExt { @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), + @Result(column="shd_fee_amt", property="shdFeeAmt", jdbcType=JdbcType.DECIMAL), + @Result(column="settle_amount", property="settleAmount", jdbcType=JdbcType.DECIMAL), @Result(column="refund_reason", property="refundReason", jdbcType=JdbcType.VARCHAR), @Result(column="status", property="status", jdbcType=JdbcType.INTEGER), @Result(column="refund_time", property="refundTime", jdbcType=JdbcType.TIMESTAMP), @@ -102,8 +106,8 @@ public interface BsTradeOrderRefundMapper extends BsTradeOrderRefundMapperExt { "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, ", - "payer_amount, refund_reason, `status`, refund_time, create_time, update_time, ", - "operator_id, operator_name, ext_1, ext_2, ext_3", + "payer_amount, shd_fee_amt, settle_amount, refund_reason, `status`, refund_time, ", + "create_time, update_time, operator_id, operator_name, ext_1, ext_2, ext_3", "from bs_trade_order_refund", "where id = #{id,jdbcType=BIGINT}" }) @@ -122,6 +126,8 @@ public interface BsTradeOrderRefundMapper extends BsTradeOrderRefundMapperExt { @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), + @Result(column="shd_fee_amt", property="shdFeeAmt", jdbcType=JdbcType.DECIMAL), + @Result(column="settle_amount", property="settleAmount", jdbcType=JdbcType.DECIMAL), @Result(column="refund_reason", property="refundReason", jdbcType=JdbcType.VARCHAR), @Result(column="status", property="status", jdbcType=JdbcType.INTEGER), @Result(column="refund_time", property="refundTime", jdbcType=JdbcType.TIMESTAMP), @@ -159,6 +165,8 @@ public interface BsTradeOrderRefundMapper extends BsTradeOrderRefundMapperExt { "total_amount = #{totalAmount,jdbcType=DECIMAL},", "refund_amount = #{refundAmount,jdbcType=DECIMAL},", "payer_amount = #{payerAmount,jdbcType=DECIMAL},", + "shd_fee_amt = #{shdFeeAmt,jdbcType=DECIMAL},", + "settle_amount = #{settleAmount,jdbcType=DECIMAL},", "refund_reason = #{refundReason,jdbcType=VARCHAR},", "`status` = #{status,jdbcType=INTEGER},", "refund_time = #{refundTime,jdbcType=TIMESTAMP},", diff --git a/service/src/main/java/com/hfkj/dao/BsTradeOrderRefundSqlProvider.java b/service/src/main/java/com/hfkj/dao/BsTradeOrderRefundSqlProvider.java index d7e9554..e5669ea 100644 --- a/service/src/main/java/com/hfkj/dao/BsTradeOrderRefundSqlProvider.java +++ b/service/src/main/java/com/hfkj/dao/BsTradeOrderRefundSqlProvider.java @@ -80,6 +80,14 @@ public class BsTradeOrderRefundSqlProvider { sql.VALUES("payer_amount", "#{payerAmount,jdbcType=DECIMAL}"); } + if (record.getShdFeeAmt() != null) { + sql.VALUES("shd_fee_amt", "#{shdFeeAmt,jdbcType=DECIMAL}"); + } + + if (record.getSettleAmount() != null) { + sql.VALUES("settle_amount", "#{settleAmount,jdbcType=DECIMAL}"); + } + if (record.getRefundReason() != null) { sql.VALUES("refund_reason", "#{refundReason,jdbcType=VARCHAR}"); } @@ -143,6 +151,8 @@ public class BsTradeOrderRefundSqlProvider { sql.SELECT("total_amount"); sql.SELECT("refund_amount"); sql.SELECT("payer_amount"); + sql.SELECT("shd_fee_amt"); + sql.SELECT("settle_amount"); sql.SELECT("refund_reason"); sql.SELECT("`status`"); sql.SELECT("refund_time"); @@ -226,6 +236,14 @@ public class BsTradeOrderRefundSqlProvider { sql.SET("payer_amount = #{record.payerAmount,jdbcType=DECIMAL}"); } + if (record.getShdFeeAmt() != null) { + sql.SET("shd_fee_amt = #{record.shdFeeAmt,jdbcType=DECIMAL}"); + } + + if (record.getSettleAmount() != null) { + sql.SET("settle_amount = #{record.settleAmount,jdbcType=DECIMAL}"); + } + if (record.getRefundReason() != null) { sql.SET("refund_reason = #{record.refundReason,jdbcType=VARCHAR}"); } @@ -288,6 +306,8 @@ public class BsTradeOrderRefundSqlProvider { sql.SET("total_amount = #{record.totalAmount,jdbcType=DECIMAL}"); sql.SET("refund_amount = #{record.refundAmount,jdbcType=DECIMAL}"); sql.SET("payer_amount = #{record.payerAmount,jdbcType=DECIMAL}"); + sql.SET("shd_fee_amt = #{record.shdFeeAmt,jdbcType=DECIMAL}"); + sql.SET("settle_amount = #{record.settleAmount,jdbcType=DECIMAL}"); sql.SET("refund_reason = #{record.refundReason,jdbcType=VARCHAR}"); sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); sql.SET("refund_time = #{record.refundTime,jdbcType=TIMESTAMP}"); @@ -360,6 +380,14 @@ public class BsTradeOrderRefundSqlProvider { sql.SET("payer_amount = #{payerAmount,jdbcType=DECIMAL}"); } + if (record.getShdFeeAmt() != null) { + sql.SET("shd_fee_amt = #{shdFeeAmt,jdbcType=DECIMAL}"); + } + + if (record.getSettleAmount() != null) { + sql.SET("settle_amount = #{settleAmount,jdbcType=DECIMAL}"); + } + if (record.getRefundReason() != null) { sql.SET("refund_reason = #{refundReason,jdbcType=VARCHAR}"); } diff --git a/service/src/main/java/com/hfkj/entity/BsTradeOrderRefund.java b/service/src/main/java/com/hfkj/entity/BsTradeOrderRefund.java index d8f550d..f426daf 100644 --- a/service/src/main/java/com/hfkj/entity/BsTradeOrderRefund.java +++ b/service/src/main/java/com/hfkj/entity/BsTradeOrderRefund.java @@ -84,6 +84,16 @@ public class BsTradeOrderRefund implements Serializable { */ private BigDecimal payerAmount; + /** + * 交易手续费 + */ + private BigDecimal shdFeeAmt; + + /** + * 结算金额 + */ + private BigDecimal settleAmount; + /** * 退款原因 */ @@ -239,6 +249,22 @@ public class BsTradeOrderRefund implements Serializable { this.payerAmount = payerAmount; } + public BigDecimal getShdFeeAmt() { + return shdFeeAmt; + } + + public void setShdFeeAmt(BigDecimal shdFeeAmt) { + this.shdFeeAmt = shdFeeAmt; + } + + public BigDecimal getSettleAmount() { + return settleAmount; + } + + public void setSettleAmount(BigDecimal settleAmount) { + this.settleAmount = settleAmount; + } + public String getRefundReason() { return refundReason; } @@ -345,6 +371,8 @@ public class BsTradeOrderRefund implements Serializable { && (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())) + && (this.getShdFeeAmt() == null ? other.getShdFeeAmt() == null : this.getShdFeeAmt().equals(other.getShdFeeAmt())) + && (this.getSettleAmount() == null ? other.getSettleAmount() == null : this.getSettleAmount().equals(other.getSettleAmount())) && (this.getRefundReason() == null ? other.getRefundReason() == null : this.getRefundReason().equals(other.getRefundReason())) && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus())) && (this.getRefundTime() == null ? other.getRefundTime() == null : this.getRefundTime().equals(other.getRefundTime())) @@ -375,6 +403,8 @@ public class BsTradeOrderRefund implements Serializable { result = prime * result + ((getTotalAmount() == null) ? 0 : getTotalAmount().hashCode()); result = prime * result + ((getRefundAmount() == null) ? 0 : getRefundAmount().hashCode()); result = prime * result + ((getPayerAmount() == null) ? 0 : getPayerAmount().hashCode()); + result = prime * result + ((getShdFeeAmt() == null) ? 0 : getShdFeeAmt().hashCode()); + result = prime * result + ((getSettleAmount() == null) ? 0 : getSettleAmount().hashCode()); result = prime * result + ((getRefundReason() == null) ? 0 : getRefundReason().hashCode()); result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode()); result = prime * result + ((getRefundTime() == null) ? 0 : getRefundTime().hashCode()); @@ -408,6 +438,8 @@ public class BsTradeOrderRefund implements Serializable { sb.append(", totalAmount=").append(totalAmount); sb.append(", refundAmount=").append(refundAmount); sb.append(", payerAmount=").append(payerAmount); + sb.append(", shdFeeAmt=").append(shdFeeAmt); + sb.append(", settleAmount=").append(settleAmount); sb.append(", refundReason=").append(refundReason); sb.append(", status=").append(status); sb.append(", refundTime=").append(refundTime); diff --git a/service/src/main/java/com/hfkj/entity/BsTradeOrderRefundExample.java b/service/src/main/java/com/hfkj/entity/BsTradeOrderRefundExample.java index 4422f7d..ee26ff1 100644 --- a/service/src/main/java/com/hfkj/entity/BsTradeOrderRefundExample.java +++ b/service/src/main/java/com/hfkj/entity/BsTradeOrderRefundExample.java @@ -1006,6 +1006,126 @@ public class BsTradeOrderRefundExample { return (Criteria) this; } + public Criteria andShdFeeAmtIsNull() { + addCriterion("shd_fee_amt is null"); + return (Criteria) this; + } + + public Criteria andShdFeeAmtIsNotNull() { + addCriterion("shd_fee_amt is not null"); + return (Criteria) this; + } + + public Criteria andShdFeeAmtEqualTo(BigDecimal value) { + addCriterion("shd_fee_amt =", value, "shdFeeAmt"); + return (Criteria) this; + } + + public Criteria andShdFeeAmtNotEqualTo(BigDecimal value) { + addCriterion("shd_fee_amt <>", value, "shdFeeAmt"); + return (Criteria) this; + } + + public Criteria andShdFeeAmtGreaterThan(BigDecimal value) { + addCriterion("shd_fee_amt >", value, "shdFeeAmt"); + return (Criteria) this; + } + + public Criteria andShdFeeAmtGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("shd_fee_amt >=", value, "shdFeeAmt"); + return (Criteria) this; + } + + public Criteria andShdFeeAmtLessThan(BigDecimal value) { + addCriterion("shd_fee_amt <", value, "shdFeeAmt"); + return (Criteria) this; + } + + public Criteria andShdFeeAmtLessThanOrEqualTo(BigDecimal value) { + addCriterion("shd_fee_amt <=", value, "shdFeeAmt"); + return (Criteria) this; + } + + public Criteria andShdFeeAmtIn(List values) { + addCriterion("shd_fee_amt in", values, "shdFeeAmt"); + return (Criteria) this; + } + + public Criteria andShdFeeAmtNotIn(List values) { + addCriterion("shd_fee_amt not in", values, "shdFeeAmt"); + return (Criteria) this; + } + + public Criteria andShdFeeAmtBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("shd_fee_amt between", value1, value2, "shdFeeAmt"); + return (Criteria) this; + } + + public Criteria andShdFeeAmtNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("shd_fee_amt not between", value1, value2, "shdFeeAmt"); + return (Criteria) this; + } + + public Criteria andSettleAmountIsNull() { + addCriterion("settle_amount is null"); + return (Criteria) this; + } + + public Criteria andSettleAmountIsNotNull() { + addCriterion("settle_amount is not null"); + return (Criteria) this; + } + + public Criteria andSettleAmountEqualTo(BigDecimal value) { + addCriterion("settle_amount =", value, "settleAmount"); + return (Criteria) this; + } + + public Criteria andSettleAmountNotEqualTo(BigDecimal value) { + addCriterion("settle_amount <>", value, "settleAmount"); + return (Criteria) this; + } + + public Criteria andSettleAmountGreaterThan(BigDecimal value) { + addCriterion("settle_amount >", value, "settleAmount"); + return (Criteria) this; + } + + public Criteria andSettleAmountGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("settle_amount >=", value, "settleAmount"); + return (Criteria) this; + } + + public Criteria andSettleAmountLessThan(BigDecimal value) { + addCriterion("settle_amount <", value, "settleAmount"); + return (Criteria) this; + } + + public Criteria andSettleAmountLessThanOrEqualTo(BigDecimal value) { + addCriterion("settle_amount <=", value, "settleAmount"); + return (Criteria) this; + } + + public Criteria andSettleAmountIn(List values) { + addCriterion("settle_amount in", values, "settleAmount"); + return (Criteria) this; + } + + public Criteria andSettleAmountNotIn(List values) { + addCriterion("settle_amount not in", values, "settleAmount"); + return (Criteria) this; + } + + public Criteria andSettleAmountBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("settle_amount between", value1, value2, "settleAmount"); + return (Criteria) this; + } + + public Criteria andSettleAmountNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("settle_amount not between", value1, value2, "settleAmount"); + return (Criteria) this; + } + public Criteria andRefundReasonIsNull() { addCriterion("refund_reason is null"); return (Criteria) this; diff --git a/service/src/main/java/com/hfkj/service/BsTradeOrderRefundService.java b/service/src/main/java/com/hfkj/service/BsTradeOrderRefundService.java index eea6e0b..989d298 100644 --- a/service/src/main/java/com/hfkj/service/BsTradeOrderRefundService.java +++ b/service/src/main/java/com/hfkj/service/BsTradeOrderRefundService.java @@ -37,4 +37,11 @@ public interface BsTradeOrderRefundService { */ BsTradeOrderRefund getRefundByRefundNo(String refundNo); + /** + * 退款列表 + * @param param + * @return + */ + List getRefundList(Map param); + } diff --git a/service/src/main/java/com/hfkj/service/impl/BsTradeOrderRefundServiceImpl.java b/service/src/main/java/com/hfkj/service/impl/BsTradeOrderRefundServiceImpl.java index 409ad5c..cae7930 100644 --- a/service/src/main/java/com/hfkj/service/impl/BsTradeOrderRefundServiceImpl.java +++ b/service/src/main/java/com/hfkj/service/impl/BsTradeOrderRefundServiceImpl.java @@ -15,6 +15,7 @@ import com.hfkj.sysenum.PlatformTypeEnum; import com.hfkj.sysenum.StoreDiscountActivityPartakeWayEnum; import com.hfkj.sysenum.TradeOrderRefundStatusEnum; import com.hfkj.sysenum.TradeOrderStatusEnum; +import org.apache.commons.collections4.MapUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; @@ -153,4 +154,29 @@ public class BsTradeOrderRefundServiceImpl implements BsTradeOrderRefundService return null; } + @Override + public List getRefundList(Map param) { + BsTradeOrderRefundExample example = new BsTradeOrderRefundExample(); + BsTradeOrderRefundExample.Criteria criteria = example.createCriteria(); + + if (MapUtils.getInteger(param, "status") != null) { + criteria.andStatusEqualTo(MapUtils.getInteger(param, "status")); + } + + if (MapUtils.getLong(param, "refundTimeS") != null) { + criteria.andRefundTimeGreaterThanOrEqualTo(new Date(MapUtils.getLong(param, "refundTimeS"))); + } + + if (MapUtils.getLong(param, "refundTimeE") != null) { + criteria.andRefundTimeLessThanOrEqualTo(new Date(MapUtils.getLong(param, "refundTimeE"))); + } + + if (MapUtils.getBoolean(param, "settleAmountIsNull") != null) { + criteria.andSettleAmountIsNull(); + } + + example.setOrderByClause("create_time desc"); + return tradeOrderRefundMapper.selectByExample(example); + } + }