package com.zy.asrs.task; import com.zy.asrs.entity.WrkMast; import com.zy.asrs.service.WrkMastService; import com.zy.asrs.task.core.ReturnT; import com.zy.asrs.task.handler.AutomaticallyIssueWCSTasksHandler; import com.zy.asrs.task.handler.WorkMastHandler; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; import java.util.Date; import java.util.List; @Component public class AutomaticallyIssueWCSTasksScheduler { private static final Logger log = LoggerFactory.getLogger(WorkMastScheduler.class); @Autowired private WrkMastService wrkMastService; @Autowired private AutomaticallyIssueWCSTasksHandler automaticallyIssueWCSTasksHandler; @Scheduled(cron = "0/3 * * * * ? ") private void execute(){ List wrkMasts = wrkMastService.selectToBeCompleteData(); if (wrkMasts.isEmpty()) { return; } ReturnT returnT = automaticallyIssueWCSTasksHandler.start(wrkMasts); } }