| | |
| | | package com.zy.asrs.task; |
| | | |
| | | import com.zy.asrs.entity.WrkMast; |
| | | import com.zy.asrs.service.WrkMastService; |
| | | import com.zy.asrs.task.handler.WorkMastHandler; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * Created by vincent on 2020/7/7 |
| | |
| | | public class WorkMastScheduler { |
| | | |
| | | @Autowired |
| | | private WrkMastService wrkMastService; |
| | | @Autowired |
| | | private WorkMastHandler workMastHandler; |
| | | |
| | | @Scheduled(cron = "0/3 * * * * ? ") |
| | | private void execute(){ |
| | | workMastHandler.start(); |
| | | List<WrkMast> wrkMasts = wrkMastService.selectToBeCompleteData(); |
| | | if (wrkMasts.isEmpty()) { |
| | | return; |
| | | } |
| | | for (WrkMast wrkMast : wrkMasts) { |
| | | ReturnT<String> start = workMastHandler.start(wrkMast); |
| | | |
| | | |
| | | |
| | | } |
| | | } |
| | | |
| | | } |