|
|
@@ -1,6 +1,8 @@
|
|
|
package com.yc.ship.module.trade.job;
|
|
|
|
|
|
import com.yc.ship.framework.quartz.core.handler.JobHandler;
|
|
|
+import com.yc.ship.framework.tenant.core.aop.TenantIgnore;
|
|
|
+import com.yc.ship.framework.tenant.core.util.TenantUtils;
|
|
|
import com.yc.ship.module.trade.service.insurance.InsuranceService;
|
|
|
import com.yc.ship.module.trade.service.order.TradeOrderService;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
@@ -30,8 +32,10 @@ public class InsuranceApplyJob implements JobHandler {
|
|
|
@Override
|
|
|
public String execute(String param) {
|
|
|
log.info("开始执行保险购买定时任务");
|
|
|
- List<Long> orderIdList = tradeOrderService.getCanBuyInsuranceOrder();
|
|
|
- orderIdList.stream().forEach(orderId -> insuranceService.applyInsurance(orderId));
|
|
|
+ TenantUtils.execute(1L, () -> {
|
|
|
+ List<Long> orderIdList = tradeOrderService.getCanBuyInsuranceOrder();
|
|
|
+ orderIdList.stream().forEach(orderId -> insuranceService.applyInsurance(orderId));
|
|
|
+ });
|
|
|
log.info("结束执行保险购买定时定时任务");
|
|
|
return "success";
|
|
|
}
|