|  |  |  | 
|---|
|  |  |  | import com.zy.acs.manager.manager.service.BusService; | 
|---|
|  |  |  | import com.zy.acs.manager.manager.service.SegmentService; | 
|---|
|  |  |  | import com.zy.acs.manager.manager.service.TaskService; | 
|---|
|  |  |  | import com.zy.acs.manager.system.service.ConfigService; | 
|---|
|  |  |  | import lombok.extern.slf4j.Slf4j; | 
|---|
|  |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
|---|
|  |  |  | import org.springframework.scheduling.annotation.Scheduled; | 
|---|
|  |  |  | 
|---|
|  |  |  | private SegmentService segmentService; | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private TrafficService trafficService; | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private ConfigService configService; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Scheduled(cron = "0/3 * * * * ? ") | 
|---|
|  |  |  | private void startupBus() throws InterruptedException { | 
|---|
|  |  |  | if (!configService.getVal("TaskAssignMode", Boolean.class)) { return; } | 
|---|
|  |  |  | if (!this.lock.tryLock(LOCK_TIMEOUT, TimeUnit.SECONDS)) { return; } | 
|---|
|  |  |  | List<Bus> busList = busService.selectBySts(BusStsType.RECEIVE); | 
|---|
|  |  |  | for (Bus bus : busList) { | 
|---|