package com.friday.custody.quartz;

import lombok.extern.slf4j.Slf4j;
import org.quartz.DisallowConcurrentExecution;
import org.quartz.JobExecutionContext;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.quartz.QuartzJobBean;

@Slf4j
@DisallowConcurrentExecution
public class UpdateSWDataDailyByScheduledJob extends QuartzJobBean {
    @Value("${custody.quartz.updateSWDataDailyByScheduled.switch}")
    private Boolean updateSWDataDailyByScheduledSwitch;

    @Autowired
    private com.friday.custody.service.logicService.impl.LogicInternalServiceImpl LogicInternalServiceImpl;
    @Override
    protected void executeInternal(JobExecutionContext context) {
        if (!updateSWDataDailyByScheduledSwitch) {
            log.warn("每30min申万更新数据开关:未开启!");
            return;
        }
        log.info("UpdateDataDailyByScheduledJob 更新");
        LogicInternalServiceImpl.updateSWDataDailyByScheduled();
    }
}
