Skip to content

Commit

Permalink
!146 【功能修复】PAY:修复定时任务没有返回值导致的异常
Browse files Browse the repository at this point in the history
Merge pull request !146 from Lcp/master-jdk17
  • Loading branch information
YunaiV authored and gitee-org committed Oct 27, 2024
2 parents bcc713f + 6e8329e commit 243ad66
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package cn.iocoder.yudao.module.pay.job.notify;

import cn.hutool.core.util.StrUtil;
import cn.iocoder.yudao.framework.tenant.core.job.TenantJob;
import cn.iocoder.yudao.module.pay.service.notify.PayNotifyService;
import com.xxl.job.core.handler.annotation.XxlJob;
Expand All @@ -23,9 +24,10 @@ public class PayNotifyJob {

@XxlJob("payNotifyJob")
@TenantJob // 多租户
public void execute() throws Exception {
public String execute() throws Exception {
int notifyCount = payNotifyService.executeNotify();
log.info("[execute][执行支付通知 ({}) 个]", notifyCount);
return StrUtil.format("执行支付通知 ({}) 个",notifyCount);
}

}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package cn.iocoder.yudao.module.pay.job.order;

import cn.hutool.core.util.StrUtil;
import cn.iocoder.yudao.framework.tenant.core.job.TenantJob;
import cn.iocoder.yudao.module.pay.service.order.PayOrderService;
import com.xxl.job.core.handler.annotation.XxlJob;
Expand All @@ -24,9 +25,10 @@ public class PayOrderExpireJob {

@XxlJob("payOrderExpireJob")
@TenantJob // 多租户
public void execute(String param) {
public String execute(String param) {
int count = orderService.expireOrder();
log.info("[execute][支付过期 ({}) 个]", count);
return StrUtil.format("支付过期 ({}) 个",count);
}

}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package cn.iocoder.yudao.module.pay.job.order;

import cn.hutool.core.util.StrUtil;
import cn.iocoder.yudao.framework.tenant.core.job.TenantJob;
import cn.iocoder.yudao.module.pay.service.order.PayOrderService;
import com.xxl.job.core.handler.annotation.XxlJob;
Expand Down Expand Up @@ -35,10 +36,11 @@ public class PayOrderSyncJob {

@XxlJob("payOrderSyncJob")
@TenantJob // 多租户
public void execute() {
public String execute() {
LocalDateTime minCreateTime = LocalDateTime.now().minus(CREATE_TIME_DURATION_BEFORE);
int count = orderService.syncOrder(minCreateTime);
log.info("[execute][同步支付订单 ({}) 个]", count);
return StrUtil.format("同步支付订单 ({}) 个",count);
}

}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package cn.iocoder.yudao.module.pay.job.refund;

import cn.hutool.core.util.StrUtil;
import cn.iocoder.yudao.framework.tenant.core.job.TenantJob;
import cn.iocoder.yudao.module.pay.service.refund.PayRefundService;
import com.xxl.job.core.handler.annotation.XxlJob;
Expand All @@ -24,9 +25,10 @@ public class PayRefundSyncJob {

@XxlJob("payRefundSyncJob")
@TenantJob // 多租户
public void execute() {
public String execute() {
int count = refundService.syncRefund();
log.info("[execute][同步退款订单 ({}) 个]", count);
return StrUtil.format("同步退款订单 ({}) 个",count);
}

}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package cn.iocoder.yudao.module.pay.job.transfer;

import cn.hutool.core.util.StrUtil;
import cn.iocoder.yudao.framework.tenant.core.job.TenantJob;
import cn.iocoder.yudao.module.pay.service.transfer.PayTransferService;
import com.xxl.job.core.handler.annotation.XxlJob;
Expand All @@ -24,8 +25,9 @@ public class PayTransferSyncJob {

@XxlJob("payTransferSyncJob")
@TenantJob // 多租户
public void execute(String param) {
public String execute(String param) {
int count = transferService.syncTransfer();
log.info("[execute][同步转账订单 ({}) 个]", count);
return StrUtil.format("同步转账订单 ({}) 个",count);
}
}

0 comments on commit 243ad66

Please sign in to comment.