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 lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * 保险查询定时任务
 * 1. 查询需要购买保险的订单，只有确认状态并且开航前一天才可购买保险
 */
@Component
@Slf4j
public class InsuranceJob implements JobHandler {

    @Resource
    private InsuranceService insuranceService;

    /**
     * 执行定时任务
     * 定时查询保险状态
     */
    @Override
    public String execute(String param) {
        log.info("开始执行保单查询定时任务");
//        TenantUtils.execute(1L, () -> insuranceService.queryInsuranceQuey());
        log.info("结束执行保单查询定时任务");
        return "success";
    }
}
