| | |
| | | @Component |
| | | public class ModelListener extends OrgListenerSupport implements ApplicationListener<ApplicationReadyEvent> { |
| | | |
| | | protected static final String orgKey = "tag" ; |
| | | protected static final String orgListKey = "tagList" ; |
| | | private static final String JobName = "modelCalculateJob" ; |
| | | private static final String JobGroupName = "modelCalculateGroup" ; |
| | | private static final Integer ThreadPoolMaxCount = 1 ;//线程池线程最大个数 |
| | |
| | | List<Org.OrgVo> orgList = Org.OrgList ; |
| | | if(orgList != null && orgList.size() >0){ |
| | | SchedulerTaskSupport.setThreadPoolPro(ThreadPoolMaxCount * orgList.size(), ThreadPoolPriority); |
| | | for(Org.OrgVo vo : orgList){ |
| | | HashMap<String , Object> jobDataMap = new HashMap<String , Object>() ; |
| | | jobDataMap.put(orgKey, vo.tag) ; |
| | | SchedulerTaskSupport.addDailyJob(JobName + vo.tag, JobGroupName, CalculateJob.class, jobDataMap, startHour, startMinute ) ; |
| | | } |
| | | HashMap<String , Object> jobDataMap = new HashMap<String , Object>() ; |
| | | jobDataMap.put(orgListKey,orgList) ; |
| | | SchedulerTaskSupport.addDailyJob(JobName, JobGroupName, CalculateJob.class, jobDataMap, startHour, startMinute ) ; |
| | | |
| | | } |
| | | } |
| | | } |