| | |
| | | import com.zy.asrs.service.WrkMastService; |
| | | import com.zy.asrs.task.core.ReturnT; |
| | | import com.zy.asrs.task.handler.WorkLogHandler; |
| | | import com.zy.common.properties.SchedulerProperties; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | @Autowired |
| | | private TaskService taskService; |
| | | |
| | | @Resource |
| | | private SchedulerProperties schedulerProperties; |
| | | |
| | | @Scheduled(cron = "0/3 * * * * ? ") |
| | | private void execute() { |
| | | if (!schedulerProperties.isEnabled()) { |
| | | return; |
| | | } |
| | | List<WrkMast> wrkMasts = wrkMastService.selectToBeHistoryData(); |
| | | if (wrkMasts.isEmpty()) { |
| | | return; |
| | |
| | | |
| | | @Scheduled(cron = "0/3 * * * * ? ") |
| | | private void executeTask(){ |
| | | if (!schedulerProperties.isEnabled()) { |
| | | return; |
| | | } |
| | | List<Task> taskList = taskService.selectToBeHistoryData(); |
| | | if (taskList.isEmpty()) { |
| | | return; |