|
@@ -1,17 +1,16 @@
|
|
|
package com.example.opc_da.dynamicSchedule;
|
|
|
|
|
|
-import com.example.opc_common.entity.DataSource;
|
|
|
-import com.example.opc_common.entity.DataSourceType;
|
|
|
-import com.example.opc_common.entity.ItemGroup;
|
|
|
-import com.example.opc_common.entity.ReportTable;
|
|
|
+import com.example.opc_common.entity.*;
|
|
|
import com.example.opc_common.util.Blank;
|
|
|
import com.example.opc_common.util.ConstantStr;
|
|
|
import com.example.opc_common.util.DateUtil;
|
|
|
import com.example.opc_common.util.OpcUtil;
|
|
|
import com.example.opc_da.dao.DataSourceDao;
|
|
|
import com.example.opc_da.dao.ItemGroupDao;
|
|
|
+import com.example.opc_da.dao.PrintDao;
|
|
|
import com.example.opc_da.dao.ReportTableDao;
|
|
|
import com.example.opc_da.task.OpcDaTask;
|
|
|
+import com.example.opc_da.task.PrintTask;
|
|
|
import com.example.opc_da.task.ReportTableTask;
|
|
|
import com.example.opc_da.util.OpcDaUtil;
|
|
|
import com.example.opc_da.util.RedisUtil;
|
|
@@ -40,6 +39,9 @@ public class DynamicScheduleConfig implements SchedulingConfigurer {
|
|
|
@Resource
|
|
|
private DataSourceDao dataSourceDao;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private PrintDao printDao;
|
|
|
+
|
|
|
@Resource
|
|
|
private CronTaskRegister cronTaskRegister;
|
|
|
|
|
@@ -71,7 +73,6 @@ public class DynamicScheduleConfig implements SchedulingConfigurer {
|
|
|
String readWeek = itemGroup.getReadWeek();
|
|
|
Integer id = itemGroup.getId();
|
|
|
DataSource dataSource = DataSource.convertPassword(dataSourceDao.getDataSourceById(itemGroup.getDataSourceId()));
|
|
|
- String clsId = dataSource.getClsId().toUpperCase();
|
|
|
DataSourceType dataSourceType = dataSourceDao.getDataSourceTypeById(dataSource.getTypeId());
|
|
|
if (OpcUtil.isOpcDa(dataSourceType.getDataSourceTypeKey())) {
|
|
|
if (itemGroup.getRunState() == ConstantStr.START_UP || itemGroup.getRunState() == ConstantStr.EXCEPT_STOP_UP) {
|
|
@@ -128,5 +129,14 @@ public class DynamicScheduleConfig implements SchedulingConfigurer {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ List<Print> printList = printDao.getAllPrint(ConstantStr.START_UP);
|
|
|
+ if (Blank.isNotEmpty(printList)) {
|
|
|
+ for (Print print : printList) {
|
|
|
+ printDao.runAutoPrintById(print.getId(), ConstantStr.START_UP);
|
|
|
+ SchedulingRunnable task = new SchedulingRunnable(PrintTask.class, "autoPrint", new Object[]{print});
|
|
|
+ cronTaskRegister.addCronTask(task, print.getCronId(), print.getCron());
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|