@Override public boolean isRestOfTask() { // 当前任务队列不为空 if (scheduler.getTaskQueue().size() > 0) { return true; } else { // 系统正在生产任务 if (scheduler.getProducerState() == ProducerState.PRODUCING) { return true; } } return false; }
@Override public void startConsumeTask(Map<String, Object> printServices) { // 获取所有打印服务 PrintService[] tempPrintServices = new PrintUtils().getAllPrintService(); List<PrintService> printServiceList = new ArrayList<PrintService>(); // 获取用户选择的打印服务对象 for (PrintService printService : tempPrintServices) { if (printServices.containsKey(printService.getName())) { printServiceList.add(printService); } } // 处理任务 scheduler.startConsumeTask(printServiceList); }
@Override public void doSwitch() { scheduler.doSwitch(); }
@Override public boolean isCanSwitch() { return scheduler.isCanSwitch(); }
@Override public void startProduceTask() { scheduler.startProduceTask(); }
@Override public SystemState getSystemState() { return scheduler.getSystemState(); }
@Override public void pause() { scheduler.pause(); }
@Override public void loadExcel(String filePath) throws ScheduleException { scheduler.loadExcel(filePath, header); }
@Override public void addTaskByIds(Set<Long> idSet) { scheduler.addTaskByIds(idSet); }