提交代码

yy_dev
胡锐 1 year ago
parent 04859b3725
commit 97256fb530
  1. 55
      bweb/src/main/java/com/bweb/controller/TestController.java
  2. 2
      cweb/src/main/java/com/cweb/controller/TestController.java
  3. 67
      schedule/src/main/java/com/hfkj/schedule/TradeOrderSchedule.java
  4. 59
      service/src/main/java/com/hfkj/channel/lakala/LaKaLaTradeService.java
  5. 12
      service/src/main/java/com/hfkj/dao/BsTradeOrderRefundMapper.java
  6. 28
      service/src/main/java/com/hfkj/dao/BsTradeOrderRefundSqlProvider.java
  7. 32
      service/src/main/java/com/hfkj/entity/BsTradeOrderRefund.java
  8. 120
      service/src/main/java/com/hfkj/entity/BsTradeOrderRefundExample.java
  9. 7
      service/src/main/java/com/hfkj/service/BsTradeOrderRefundService.java
  10. 26
      service/src/main/java/com/hfkj/service/impl/BsTradeOrderRefundServiceImpl.java

@ -15,6 +15,9 @@ import com.hfkj.channel.saas.utils.SaasMerRequest;
import com.hfkj.channel.weixin.WeiXinMerService; import com.hfkj.channel.weixin.WeiXinMerService;
import com.hfkj.channel.weixin.utils.WxUtils; import com.hfkj.channel.weixin.utils.WxUtils;
import com.hfkj.channel.weixin.utils.sdk.WXPayConstants; 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.DateUtil;
import com.hfkj.common.utils.HttpsUtils; import com.hfkj.common.utils.HttpsUtils;
import com.hfkj.common.utils.ResponseMsgUtil; 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<String, Object> commonParam = new HashMap<>();
commonParam.put("req_time", DateUtil.format(new Date(), "yyyyMMddHHmmss"));
commonParam.put("version", "3.0");
Map<String, Object> 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<String, Object> reqParam = LaKaLaConfig.generateSignParamsV3(JSONObject.parseObject(JSONObject.toJSONString(commonParam)));
// 头部参数
Map<String, Object> 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) @RequestMapping(value="/brushOrder",method = RequestMethod.GET)
@ResponseBody @ResponseBody
@ApiOperation(value = "saasUpdateFee") @ApiOperation(value = "saasUpdateFee")

@ -260,7 +260,7 @@ public class TestController {
//return ResponseMsgUtil.success(saasMerService.merchantInfo("123364703")); //return ResponseMsgUtil.success(saasMerService.merchantInfo("123364703"));
// return ResponseMsgUtil.success(saasCommon.getCategory(null)); // return ResponseMsgUtil.success(saasCommon.getCategory(null));
// return ResponseMsgUtil.success(laKaLaLedgerService.queryLedgerMer(code)); // 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(laKaLaTradeService.queryTrade(code));
// return ResponseMsgUtil.success(""); // return ResponseMsgUtil.success("");
// 1200 // 1200

@ -8,10 +8,8 @@ import com.hfkj.common.utils.DateUtil;
import com.hfkj.entity.BsTradeOrder; import com.hfkj.entity.BsTradeOrder;
import com.hfkj.entity.BsTradeOrderProfitSharing; import com.hfkj.entity.BsTradeOrderProfitSharing;
import com.hfkj.entity.BsTradeOrderProfitSharingReceiver; import com.hfkj.entity.BsTradeOrderProfitSharingReceiver;
import com.hfkj.service.BsTradeOrderProfitSharingReceiverService; import com.hfkj.entity.BsTradeOrderRefund;
import com.hfkj.service.BsTradeOrderProfitSharingService; import com.hfkj.service.*;
import com.hfkj.service.BsTradeOrderService;
import com.hfkj.service.BsTradeTakeConfigService;
import com.hfkj.sysenum.*; import com.hfkj.sysenum.*;
import org.apache.commons.collections4.MapUtils; import org.apache.commons.collections4.MapUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
@ -35,16 +33,14 @@ public class TradeOrderSchedule {
@Resource @Resource
private BsTradeOrderProfitSharingService tradeOrderProfitSharingService; private BsTradeOrderProfitSharingService tradeOrderProfitSharingService;
@Resource @Resource
private BsTradeOrderProfitSharingReceiverService tradeOrderProfitSharingReceiverService; private BsTradeOrderProfitSharingReceiverService tradeOrderProfitSharingReceiverService;
@Resource @Resource
private LaKaLaTradeSeparateService laKaLaTradeSeparateService; private LaKaLaTradeSeparateService laKaLaTradeSeparateService;
@Resource @Resource
private BsTradeOrderService tradeOrderService; private BsTradeOrderService tradeOrderService;
@Resource
private BsTradeOrderRefundService tradeOrderRefundService;
@Resource @Resource
private LaKaLaTradeService laKaLaTradeService; private LaKaLaTradeService laKaLaTradeService;
@ -274,7 +270,7 @@ public class TradeOrderSchedule {
for (BsTradeOrder tradeOrder : tradeOrderList) { for (BsTradeOrder tradeOrder : tradeOrderList) {
try { try {
// 查询手续费 // 查询手续费
JSONObject queryTrans = laKaLaTradeService.queryTrans(tradeOrder.getOutTradeNo()); JSONObject queryTrans = laKaLaTradeService.queryTradeOrderTrans(tradeOrder.getOutTradeNo());
if (queryTrans != null && queryTrans.getString("trade_state").equals("03")) { if (queryTrans != null && queryTrans.getString("trade_state").equals("03")) {
tradeOrder.setShdFeeAmt(queryTrans.getBigDecimal("fee_amount")); tradeOrder.setShdFeeAmt(queryTrans.getBigDecimal("fee_amount"));
tradeOrder.setSettleAmount(new BigDecimal(queryTrans.getString("settle_amount").replace(",",""))); 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<String, Object> 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<BsTradeOrderRefund> 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());
}
} }

@ -347,7 +347,7 @@ public class LaKaLaTradeService {
* 商户计费查询 * 商户计费查询
* @param tradeNo 订单号 * @param tradeNo 订单号
*/ */
public JSONObject queryTrans(String tradeNo) { public JSONObject queryTradeOrderTrans(String tradeNo) {
log.info("========= Start 商户计费查询 Start ==========="); log.info("========= Start 商户计费查询 Start ===========");
try { 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<String, Object> commonParam = new HashMap<>();
commonParam.put("req_time", DateUtil.format(new Date(), "yyyyMMddHHmmss"));
commonParam.put("version", "3.0");
Map<String, Object> 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<String, Object> reqParam = LaKaLaConfig.generateSignParamsV3(JSONObject.parseObject(JSONObject.toJSONString(commonParam)));
// 头部参数
Map<String, Object> 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 订单号 * @param refundNo 订单号

@ -45,6 +45,7 @@ public interface BsTradeOrderRefundMapper extends BsTradeOrderRefundMapperExt {
"platform_order_no, platform_log_no, ", "platform_order_no, platform_log_no, ",
"refund_no, total_amount, ", "refund_no, total_amount, ",
"refund_amount, payer_amount, ", "refund_amount, payer_amount, ",
"shd_fee_amt, settle_amount, ",
"refund_reason, `status`, ", "refund_reason, `status`, ",
"refund_time, create_time, ", "refund_time, create_time, ",
"update_time, operator_id, ", "update_time, operator_id, ",
@ -56,6 +57,7 @@ public interface BsTradeOrderRefundMapper extends BsTradeOrderRefundMapperExt {
"#{platformOrderNo,jdbcType=VARCHAR}, #{platformLogNo,jdbcType=VARCHAR}, ", "#{platformOrderNo,jdbcType=VARCHAR}, #{platformLogNo,jdbcType=VARCHAR}, ",
"#{refundNo,jdbcType=VARCHAR}, #{totalAmount,jdbcType=DECIMAL}, ", "#{refundNo,jdbcType=VARCHAR}, #{totalAmount,jdbcType=DECIMAL}, ",
"#{refundAmount,jdbcType=DECIMAL}, #{payerAmount,jdbcType=DECIMAL}, ", "#{refundAmount,jdbcType=DECIMAL}, #{payerAmount,jdbcType=DECIMAL}, ",
"#{shdFeeAmt,jdbcType=DECIMAL}, #{settleAmount,jdbcType=DECIMAL}, ",
"#{refundReason,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, ", "#{refundReason,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, ",
"#{refundTime,jdbcType=TIMESTAMP}, #{createTime,jdbcType=TIMESTAMP}, ", "#{refundTime,jdbcType=TIMESTAMP}, #{createTime,jdbcType=TIMESTAMP}, ",
"#{updateTime,jdbcType=TIMESTAMP}, #{operatorId,jdbcType=BIGINT}, ", "#{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="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),
@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="refund_reason", property="refundReason", jdbcType=JdbcType.VARCHAR),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER), @Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@Result(column="refund_time", property="refundTime", jdbcType=JdbcType.TIMESTAMP), @Result(column="refund_time", property="refundTime", jdbcType=JdbcType.TIMESTAMP),
@ -102,8 +106,8 @@ public interface BsTradeOrderRefundMapper extends BsTradeOrderRefundMapperExt {
"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, total_amount, refund_amount, ",
"payer_amount, refund_reason, `status`, refund_time, create_time, update_time, ", "payer_amount, shd_fee_amt, settle_amount, refund_reason, `status`, refund_time, ",
"operator_id, operator_name, ext_1, ext_2, ext_3", "create_time, update_time, operator_id, operator_name, ext_1, ext_2, ext_3",
"from bs_trade_order_refund", "from bs_trade_order_refund",
"where id = #{id,jdbcType=BIGINT}" "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="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),
@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="refund_reason", property="refundReason", jdbcType=JdbcType.VARCHAR),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER), @Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@Result(column="refund_time", property="refundTime", jdbcType=JdbcType.TIMESTAMP), @Result(column="refund_time", property="refundTime", jdbcType=JdbcType.TIMESTAMP),
@ -159,6 +165,8 @@ public interface BsTradeOrderRefundMapper extends BsTradeOrderRefundMapperExt {
"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},",
"shd_fee_amt = #{shdFeeAmt,jdbcType=DECIMAL},",
"settle_amount = #{settleAmount,jdbcType=DECIMAL},",
"refund_reason = #{refundReason,jdbcType=VARCHAR},", "refund_reason = #{refundReason,jdbcType=VARCHAR},",
"`status` = #{status,jdbcType=INTEGER},", "`status` = #{status,jdbcType=INTEGER},",
"refund_time = #{refundTime,jdbcType=TIMESTAMP},", "refund_time = #{refundTime,jdbcType=TIMESTAMP},",

@ -80,6 +80,14 @@ public class BsTradeOrderRefundSqlProvider {
sql.VALUES("payer_amount", "#{payerAmount,jdbcType=DECIMAL}"); 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) { if (record.getRefundReason() != null) {
sql.VALUES("refund_reason", "#{refundReason,jdbcType=VARCHAR}"); sql.VALUES("refund_reason", "#{refundReason,jdbcType=VARCHAR}");
} }
@ -143,6 +151,8 @@ public class BsTradeOrderRefundSqlProvider {
sql.SELECT("total_amount"); sql.SELECT("total_amount");
sql.SELECT("refund_amount"); sql.SELECT("refund_amount");
sql.SELECT("payer_amount"); sql.SELECT("payer_amount");
sql.SELECT("shd_fee_amt");
sql.SELECT("settle_amount");
sql.SELECT("refund_reason"); sql.SELECT("refund_reason");
sql.SELECT("`status`"); sql.SELECT("`status`");
sql.SELECT("refund_time"); sql.SELECT("refund_time");
@ -226,6 +236,14 @@ public class BsTradeOrderRefundSqlProvider {
sql.SET("payer_amount = #{record.payerAmount,jdbcType=DECIMAL}"); 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) { if (record.getRefundReason() != null) {
sql.SET("refund_reason = #{record.refundReason,jdbcType=VARCHAR}"); 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("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}");
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("refund_reason = #{record.refundReason,jdbcType=VARCHAR}");
sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); sql.SET("`status` = #{record.status,jdbcType=INTEGER}");
sql.SET("refund_time = #{record.refundTime,jdbcType=TIMESTAMP}"); sql.SET("refund_time = #{record.refundTime,jdbcType=TIMESTAMP}");
@ -360,6 +380,14 @@ public class BsTradeOrderRefundSqlProvider {
sql.SET("payer_amount = #{payerAmount,jdbcType=DECIMAL}"); 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) { if (record.getRefundReason() != null) {
sql.SET("refund_reason = #{refundReason,jdbcType=VARCHAR}"); sql.SET("refund_reason = #{refundReason,jdbcType=VARCHAR}");
} }

@ -84,6 +84,16 @@ public class BsTradeOrderRefund implements Serializable {
*/ */
private BigDecimal payerAmount; private BigDecimal payerAmount;
/**
* 交易手续费
*/
private BigDecimal shdFeeAmt;
/**
* 结算金额
*/
private BigDecimal settleAmount;
/** /**
* 退款原因 * 退款原因
*/ */
@ -239,6 +249,22 @@ public class BsTradeOrderRefund implements Serializable {
this.payerAmount = payerAmount; 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() { public String getRefundReason() {
return refundReason; return refundReason;
} }
@ -345,6 +371,8 @@ public class BsTradeOrderRefund implements Serializable {
&& (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()))
&& (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.getRefundReason() == null ? other.getRefundReason() == null : this.getRefundReason().equals(other.getRefundReason()))
&& (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus())) && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
&& (this.getRefundTime() == null ? other.getRefundTime() == null : this.getRefundTime().equals(other.getRefundTime())) && (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 + ((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());
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 + ((getRefundReason() == null) ? 0 : getRefundReason().hashCode());
result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode()); result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
result = prime * result + ((getRefundTime() == null) ? 0 : getRefundTime().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(", totalAmount=").append(totalAmount);
sb.append(", refundAmount=").append(refundAmount); sb.append(", refundAmount=").append(refundAmount);
sb.append(", payerAmount=").append(payerAmount); sb.append(", payerAmount=").append(payerAmount);
sb.append(", shdFeeAmt=").append(shdFeeAmt);
sb.append(", settleAmount=").append(settleAmount);
sb.append(", refundReason=").append(refundReason); sb.append(", refundReason=").append(refundReason);
sb.append(", status=").append(status); sb.append(", status=").append(status);
sb.append(", refundTime=").append(refundTime); sb.append(", refundTime=").append(refundTime);

@ -1006,6 +1006,126 @@ public class BsTradeOrderRefundExample {
return (Criteria) this; 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<BigDecimal> values) {
addCriterion("shd_fee_amt in", values, "shdFeeAmt");
return (Criteria) this;
}
public Criteria andShdFeeAmtNotIn(List<BigDecimal> 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<BigDecimal> values) {
addCriterion("settle_amount in", values, "settleAmount");
return (Criteria) this;
}
public Criteria andSettleAmountNotIn(List<BigDecimal> 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() { public Criteria andRefundReasonIsNull() {
addCriterion("refund_reason is null"); addCriterion("refund_reason is null");
return (Criteria) this; return (Criteria) this;

@ -37,4 +37,11 @@ public interface BsTradeOrderRefundService {
*/ */
BsTradeOrderRefund getRefundByRefundNo(String refundNo); BsTradeOrderRefund getRefundByRefundNo(String refundNo);
/**
* 退款列表
* @param param
* @return
*/
List<BsTradeOrderRefund> getRefundList(Map<String,Object> param);
} }

@ -15,6 +15,7 @@ import com.hfkj.sysenum.PlatformTypeEnum;
import com.hfkj.sysenum.StoreDiscountActivityPartakeWayEnum; import com.hfkj.sysenum.StoreDiscountActivityPartakeWayEnum;
import com.hfkj.sysenum.TradeOrderRefundStatusEnum; import com.hfkj.sysenum.TradeOrderRefundStatusEnum;
import com.hfkj.sysenum.TradeOrderStatusEnum; import com.hfkj.sysenum.TradeOrderStatusEnum;
import org.apache.commons.collections4.MapUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -153,4 +154,29 @@ public class BsTradeOrderRefundServiceImpl implements BsTradeOrderRefundService
return null; return null;
} }
@Override
public List<BsTradeOrderRefund> getRefundList(Map<String, Object> 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);
}
} }

Loading…
Cancel
Save