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 UpdateSWMgDataDailyJob extends QuartzJobBean {
    @Value("${custody.quartz.updateSWMgDataDailyByScheduled.switch}")
    private Boolean updateSWMgDataDailyByScheduledSwitch;

    @Autowired
    private com.friday.custody.service.logicService.impl.LogicInternalServiceImpl LogicInternalServiceImpl;
    @Override
    protected void executeInternal(JobExecutionContext context) {
        if (!updateSWMgDataDailyByScheduledSwitch) {
            log.warn("每天10点、16点申万更新数据开关:未开启!");
            return;
        }
        log.info("UpdateSWMgDataJob 更新");
        LogicInternalServiceImpl.updateSWMgDataDaily();
    }
}
