记得上下班打卡 | git大法好,push需谨慎

Commit 749ecc84 authored by zhoujianping's avatar zhoujianping

1.退款失败定时处理

parent c477238e
......@@ -40,4 +40,14 @@ public interface FeignPlatformTaskClient {
*/
@GetMapping("platform/performance/subscribePush")
ResponseDto<Boolean> performanceSubscribePush();
/*
* @description: 自动处理退款失败
* @author: zjp
* @date: 2025/4/27 14:28
* @param: []
* @return: com.liquidnet.service.base.ResponseDto<java.lang.Boolean>
**/
@GetMapping("platform/refund/failRefund")
ResponseDto<Boolean> failRefund();
}
......@@ -99,4 +99,21 @@ public class KylinTaskHandler {
XxlJobHelper.handleFail();
}
}
/**
* 退款失败自动处理
* @author zjp
* @param null
* @return: null
* @date 2024/3/21 15:32
*/
@XxlJob(value = "sev-platform:failRefund")
public void failRefund() {
try {
XxlJobHelper.handleSuccess("结果:" + feignPlatformTaskClient.failRefund().getData());
} catch (Exception e) {
XxlJobHelper.log(e);
XxlJobHelper.handleFail();
}
}
}
package com.liquidnet.service.platform.controller.refund;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.kylin.constant.KylinRedisConst;
import com.liquidnet.service.kylin.dto.param.RefundApplyParam;
import com.liquidnet.service.kylin.dto.param.RefundCallbackParam;
import com.liquidnet.service.kylin.dto.param.RefundSearchParam;
......@@ -46,6 +47,17 @@ public class OrderRefundCallbackController {
return orderRefundsCallbackServiceImpl.automaticRefund(orderRefundsId);
}
@GetMapping(value = "failRefund")
@ApiOperation(value = "退款失败定时处理")
public ResponseDto<Boolean> performanceSubscribePush() {
try {
orderRefundsCallbackServiceImpl.failRefund();
return ResponseDto.success(true);
} catch (Exception e) {
return ResponseDto.success(false);
}
}
@GetMapping("alipayActiveCallback")
@ApiOperation("支付宝主动查询退款结果")
public ResponseDto<String> alipayActiveCallback() {
......
......@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.liquidnet.commons.lang.util.CollectionUtil;
import com.liquidnet.commons.lang.util.HttpUtil;
import com.liquidnet.commons.lang.util.JsonUtils;
import com.liquidnet.service.base.ResponseDto;
......@@ -195,6 +196,21 @@ public class OrderRefundsCallbackServiceImpl extends ServiceImpl<KylinOrderRefun
}
return ResponseDto.success("success");
}
public void failRefund(){
List<KylinOrderRefunds> kylinOrderRefunds = kylinOrderRefundsMapper.selectList(
Wrappers.lambdaQuery(KylinOrderRefunds.class)
.eq(KylinOrderRefunds::getStatus, KylinTableStatusConst.ORDER_REFUND_STATUS_ERROR)
);
log.info("自动处理退款失败开始");
if(!CollectionUtil.isEmpty(kylinOrderRefunds)){
for (KylinOrderRefunds kylinOrderRefund : kylinOrderRefunds) {
String refundId = kylinOrderRefund.getRefundId();
log.info("自动处理退款失败RefundId={}",refundId);
this.automaticRefund(refundId);
}
}
}
@Override
public String getOrderRefundCode(String orderRefundCode, int type) {
return null;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment