| | |
| | | package com.example.scheudleds; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.example.domain.DictHosp; |
| | | import com.example.factory.ServiceFactory; |
| | | import com.example.service.DictHospService; |
| | | import com.example.service.HisService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | import java.util.List; |
| | | import java.util.concurrent.ExecutorService; |
| | | import java.util.concurrent.Executors; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @Slf4j |
| | | @Component |
| | |
| | | |
| | | private final ExecutorService executorService = Executors.newFixedThreadPool(40); |
| | | |
| | | @Autowired |
| | | private DictHospService dictHospService; |
| | | |
| | | @Scheduled(cron = "0 0 22 * * ?") |
| | | public void executeTasks() { |
| | | List<String> list = Arrays.asList("shanxiqinxamjyy","shanxiqinpbkwyy","shanxiqinjdczgzyy","shanxiqinsqyy"); |
| | | // List<String> list = Arrays.asList("shanxiqinxamjyy","shanxiqinpbkwyy","shanxiqinjdczgzyy","shanxiqinsqyy"); |
| | | List<String> list = dictHospService.list(new LambdaQueryWrapper<DictHosp>().isNotNull(DictHosp::getBeanName)) |
| | | .stream().map(DictHosp::getBeanName).collect(Collectors.toList()); |
| | | log.info("开始执行定时任务:{}", System.currentTimeMillis()); |
| | | try { |
| | | for (String hosp : list) { |