|
@@ -1,12 +1,12 @@
|
|
|
package com.steerinfo.task;
|
|
|
|
|
|
+import java.text.ParseException;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
import java.util.Properties;
|
|
|
import java.util.concurrent.ConcurrentHashMap;
|
|
|
-import java.util.concurrent.Executors;
|
|
|
import java.util.concurrent.ScheduledFuture;
|
|
|
|
|
|
import com.steerinfo.ems.ifemsmesactitem.service.IIfEmsMesActitemService;
|
|
@@ -31,7 +31,6 @@ import org.springframework.scheduling.support.CronTrigger;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import com.steerinfo.ems.Utils.DateUtils;
|
|
|
-import com.steerinfo.ems.emseotiming.service.IEmsEoTimingService;
|
|
|
import com.steerinfo.ems.emsetiming.service.IEmsETimingService;
|
|
|
import com.steerinfo.ems.ifmesemsproductorder.service.IIfMesEmsProductorderService;
|
|
|
import com.steerinfo.ems.ifmesemsswapfile.service.IIfMesEmsSwapfileService;
|
|
@@ -49,31 +48,31 @@ import com.steerinfo.ems.zghbjkbzlog.service.IZghbjkbzLogService;
|
|
|
@EnableScheduling
|
|
|
@Service(value = "springCronTask")
|
|
|
public class SpringCronTask implements SchedulingConfigurer{
|
|
|
-
|
|
|
+
|
|
|
private static final Logger logger = LoggerFactory.getLogger(SpringCronTask.class);
|
|
|
-
|
|
|
+
|
|
|
private ScheduledTaskRegistrar taskRegistrar;
|
|
|
-
|
|
|
+
|
|
|
private Map<String, ScheduledFuture<?>> taskFutures = new ConcurrentHashMap<String, ScheduledFuture<?>>();
|
|
|
-
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private JdbcTemplate jdbcTemplate;
|
|
|
@Autowired
|
|
|
- private JdbcTemplate jdbcTemplate;
|
|
|
+ IIfMesEmsSwapfileService ifMesEmsSwapfileService;
|
|
|
+ @Autowired
|
|
|
+ IIfMesEmsProductorderService ifMesEmsProductorderService;
|
|
|
+ @Autowired
|
|
|
+ ITRmWorkprocMaterialValueService tRmWorkprocMaterialValueService;
|
|
|
+ @Autowired
|
|
|
+ ITRmWorkprocProductValueService tRmWorkprocProductValueService;
|
|
|
@Autowired
|
|
|
- IIfMesEmsSwapfileService ifMesEmsSwapfileService;
|
|
|
- @Autowired
|
|
|
- IIfMesEmsProductorderService ifMesEmsProductorderService;
|
|
|
- @Autowired
|
|
|
- ITRmWorkprocMaterialValueService tRmWorkprocMaterialValueService;
|
|
|
- @Autowired
|
|
|
- ITRmWorkprocProductValueService tRmWorkprocProductValueService;
|
|
|
- @Autowired
|
|
|
ITRmCalpointValueService tRmCalpointValueService;
|
|
|
@Autowired
|
|
|
- IUsageDataService usageDataService;
|
|
|
+ IUsageDataService usageDataService;
|
|
|
@Autowired
|
|
|
- ITRmActValueService tRmActValueService;
|
|
|
+ ITRmActValueService tRmActValueService;
|
|
|
@Autowired
|
|
|
- ITRmPlanValueService tRmPlanValueService;
|
|
|
+ ITRmPlanValueService tRmPlanValueService;
|
|
|
@Autowired
|
|
|
IEmsETimingService emsETimingService;
|
|
|
@Autowired
|
|
@@ -85,21 +84,19 @@ public class SpringCronTask implements SchedulingConfigurer{
|
|
|
@Autowired
|
|
|
ITRmIndexValueService tRmIndexValueService;
|
|
|
@Autowired
|
|
|
- ITRmBalanceValueService tRmBalanceValueService;
|
|
|
+ ITRmBalanceValueService tRmBalanceValueService;
|
|
|
@Autowired
|
|
|
IZghbjkbzLogService zghbjkbzLogService;
|
|
|
@Autowired
|
|
|
- IMesEmsDieseloilService mesEmsDieseloilService;
|
|
|
+ IMesEmsDieseloilService mesEmsDieseloilService;
|
|
|
@Autowired
|
|
|
ITRmTransfereActValueService tRmTransfereActValueService;
|
|
|
@Autowired
|
|
|
- ITRmDwValueService tRmDwValueService;
|
|
|
- @Autowired
|
|
|
- ITRmCalpointService tRmCalpointService;
|
|
|
+ ITRmDwValueService tRmDwValueService;
|
|
|
@Autowired
|
|
|
- ITRmDfValueService tRmDfValueService;
|
|
|
+ ITRmCalpointService tRmCalpointService;
|
|
|
@Autowired
|
|
|
- IEmsEoTimingService emsEoTimingService;
|
|
|
+ ITRmDfValueService tRmDfValueService;
|
|
|
|
|
|
/**
|
|
|
* SchedulingConfigurer接口的方法实现,加载后自动运行
|
|
@@ -108,40 +105,34 @@ public class SpringCronTask implements SchedulingConfigurer{
|
|
|
public void configureTasks(ScheduledTaskRegistrar taskRegistrar) {
|
|
|
ThreadPoolTaskScheduler taskScheduler = new ThreadPoolTaskScheduler();
|
|
|
taskScheduler.setThreadNamePrefix("ems-task-");
|
|
|
- taskScheduler.setPoolSize(10);
|
|
|
+ taskScheduler.setPoolSize(4);
|
|
|
taskScheduler.initialize();
|
|
|
taskRegistrar.setTaskScheduler(taskScheduler);
|
|
|
- taskRegistrar.setScheduler(Executors.newScheduledThreadPool(6));
|
|
|
-
|
|
|
+
|
|
|
this.taskRegistrar = taskRegistrar;
|
|
|
- logger.info("定时任务已经转移至服务:ems-task");
|
|
|
// 初始化任务
|
|
|
- // String sql = "select * from TASK_CONF order by id";
|
|
|
- // List<Map<String, Object>> l = jdbcTemplate.queryForList(sql);
|
|
|
- // logger.info("当前定时任务队列长度:" + taskFutures.size());
|
|
|
- // if (l!=null && l.size()>0){
|
|
|
- // for(int i =0; i<l.size(); i++){
|
|
|
- // Map<String, Object> m = (Map<String, Object>)l.get(i);
|
|
|
- // String taskId = m.get("ID").toString();
|
|
|
- // String cron = m.get("CRON").toString();
|
|
|
- // String status = m.get("STATUS") == null ? "" :
|
|
|
- // m.get("STATUS").toString();
|
|
|
- // if(status.equalsIgnoreCase("1") &&
|
|
|
- // !taskFutures.containsKey(taskId)){
|
|
|
- // addTask(taskId, cron);
|
|
|
- // }
|
|
|
- // if(status.equalsIgnoreCase("0") &&
|
|
|
- // taskFutures.containsKey(taskId)){
|
|
|
- // cancelTriggerTask(taskId);
|
|
|
- // }
|
|
|
- // logger.info("定时任务" + taskId + " 启动时间表达式:" + cron);
|
|
|
- // }
|
|
|
- // }
|
|
|
+ String sql = "select * from TASK_CONF order by id";
|
|
|
+ List<Map<String, Object>> l = jdbcTemplate.queryForList(sql);
|
|
|
+ if (l!=null && l.size()>0){
|
|
|
+ for(int i =0; i<l.size(); i++){
|
|
|
+ Map<String, Object> m = (Map<String, Object>)l.get(i);
|
|
|
+ String taskId = m.get("ID").toString();
|
|
|
+ String cron = m.get("CRON").toString();
|
|
|
+ String status = m.get("STATUS") == null ? "" : m.get("STATUS").toString();
|
|
|
+ if(status.equalsIgnoreCase("1") && !taskFutures.containsKey(taskId)){
|
|
|
+ addTask(taskId, cron);
|
|
|
+ }
|
|
|
+ if(status.equalsIgnoreCase("0") && taskFutures.containsKey(taskId)){
|
|
|
+ cancelTriggerTask(taskId);
|
|
|
+ }
|
|
|
+ logger.info("定时任务-" + taskId + " cron表达式:" + cron);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 添加定时任务(初始化)
|
|
|
- *
|
|
|
+ *
|
|
|
* @param taskId
|
|
|
* @param cron
|
|
|
*/
|
|
@@ -155,10 +146,10 @@ public class SpringCronTask implements SchedulingConfigurer{
|
|
|
throw new SchedulingException("the taskId[" + taskId + "] was added.");
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 添加或者更新定时任务
|
|
|
- *
|
|
|
+ *
|
|
|
* @param taskId
|
|
|
*/
|
|
|
public void updateTask(String taskId) {
|
|
@@ -170,147 +161,131 @@ public class SpringCronTask implements SchedulingConfigurer{
|
|
|
taskFutures.put(taskId, future);
|
|
|
logger.info("当前定时任务队列长度:" + taskFutures.size());
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 取消任务
|
|
|
* @param taskId
|
|
|
*/
|
|
|
public void cancelTriggerTask(String taskId){
|
|
|
ScheduledFuture<?> future = taskFutures.get(taskId);
|
|
|
- if (future != null){
|
|
|
- future.cancel(true);
|
|
|
- }
|
|
|
- taskFutures.remove(taskId);
|
|
|
+ if (future != null){
|
|
|
+ future.cancel(true);
|
|
|
+ }
|
|
|
+ taskFutures.remove(taskId);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 业务处理
|
|
|
- *
|
|
|
+ *
|
|
|
* @param taskId
|
|
|
* @return
|
|
|
*/
|
|
|
private Runnable doTask(String taskId) {
|
|
|
Properties props = System.getProperties(); // 系统属性
|
|
|
return new Runnable() {
|
|
|
- @Override
|
|
|
- public void run() {
|
|
|
- if(!props.getProperty("os.name").equalsIgnoreCase("linux")){
|
|
|
- logger.info(taskId + "触发时间:" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")
|
|
|
- .format(new Date()));/*
|
|
|
- * try { Thread.sleep(45 * 1000); }catch(InterruptedException e) {
|
|
|
- *
|
|
|
- * }
|
|
|
- */
|
|
|
- System.out.println("操作系统:" + props.getProperty("os.name") + ", 非linux环境不运行定时任务");
|
|
|
- return;
|
|
|
- }
|
|
|
- if (taskId.equalsIgnoreCase("101")) { // 定时任务1的业务处理-MES数据同步
|
|
|
- logger.info("定时任务触发时间:" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
|
|
|
- long start = new Date().getTime();
|
|
|
- ifMesEmsSwapfileService.synchronousMesAnEmsData(); // 获取MES投入产出数据
|
|
|
- ifMesEmsProductorderService.synchronousMesAnEmsData(); // 获取MES生产计划数据
|
|
|
- usageDataService.getAutoSum(DateUtils.dateStr(new Date(start - 24*3600*1000L), "yyyy-MM-dd")); // 统计自动上传的能源上报数据(昨日)
|
|
|
- mesEmsDieseloilService.synchronousMesEmsData(); // 获取MES柴油数据
|
|
|
- logger.info("定时任务"+taskId+"执行时长:" + (new Date().getTime() - start)/1000 + "秒");
|
|
|
- } else if (taskId.equalsIgnoreCase("102")) {
|
|
|
- // 计量点定时任务
|
|
|
- long start = new Date().getTime();
|
|
|
- tRmCalpointValueService.statData(new Date());
|
|
|
- logger.info("定时任务"+taskId+"执行时长:" + (new Date().getTime() - start)/1000 + "秒");
|
|
|
- } else if (taskId.equalsIgnoreCase("103")) {
|
|
|
- long start = new Date().getTime();
|
|
|
- tRmActValueService.statDataforDay();// 每日数据统计(实绩定时任务)
|
|
|
- logger.info("定时任务"+taskId+"执行时长:" + (new Date().getTime() - start)/1000 + "秒");
|
|
|
- } else if (taskId.equalsIgnoreCase("104")) {
|
|
|
- long start = new Date().getTime();
|
|
|
- tRmPlanValueService.state();// 每日数据统计(计划定时任务)
|
|
|
- logger.info("定时任务"+taskId+"执行时长:" + (new Date().getTime() - start)/1000 + "秒");
|
|
|
- } else if (taskId.equalsIgnoreCase("105")) {
|
|
|
+ @Override
|
|
|
+ public void run() {
|
|
|
+// if(!props.getProperty("os.name").equalsIgnoreCase("linux")){
|
|
|
+// System.out.println("操作系统:" + props.getProperty("os.name") + ", 非linux环境不运行定时任务");
|
|
|
+// return;
|
|
|
+// }
|
|
|
+// if (taskId.equalsIgnoreCase("101")) { // 定时任务1的业务处理-MES数据同步
|
|
|
+// logger.info("定时任务触发时间:" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
|
|
|
+// long start = new Date().getTime();
|
|
|
+// ifMesEmsSwapfileService.synchronousMesAnEmsData(); // 获取MES投入产出数据
|
|
|
+// ifMesEmsProductorderService.synchronousMesAnEmsData(); // 获取MES生产计划数据
|
|
|
+// //usageDataService.getAutoSum(DateUtils.dateStr(new Date(start - 24*3600*1000L), "yyyy-MM-dd")); // 统计自动上传的能源上报数据(昨日)
|
|
|
+// //mesEmsDieseloilService.synchronousMesEmsData(); // 获取MES柴油数据
|
|
|
+// logger.info("定时任务"+taskId+"执行时长:" + (new Date().getTime() - start)/1000 + "秒");
|
|
|
+// } else if (taskId.equalsIgnoreCase("102")) {
|
|
|
+// // 计量点定时任务
|
|
|
+// long start = new Date().getTime();
|
|
|
+// tRmCalpointValueService.statData(new Date());
|
|
|
+// logger.info("定时任务"+taskId+"执行时长:" + (new Date().getTime() - start)/1000 + "秒");
|
|
|
+// } else if (taskId.equalsIgnoreCase("103")) {
|
|
|
+// long start = new Date().getTime();
|
|
|
+// tRmActValueService.statDataforDay();// 每日数据统计(实绩定时任务)
|
|
|
+// logger.info("定时任务"+taskId+"执行时长:" + (new Date().getTime() - start)/1000 + "秒");
|
|
|
+// } else if (taskId.equalsIgnoreCase("104")) {
|
|
|
+// long start = new Date().getTime();
|
|
|
+// tRmPlanValueService.state();// 每日数据统计(计划定时任务)
|
|
|
+// logger.info("定时任务"+taskId+"执行时长:" + (new Date().getTime() - start)/1000 + "秒");
|
|
|
+// }
|
|
|
+ if (taskId.equalsIgnoreCase("105")) {
|
|
|
// 先计算产品,因为原材料计算单耗需要产品实绩数据参与计算
|
|
|
long start = new Date().getTime();
|
|
|
+ ifMesEmsSwapfileService.getLgDateProd();
|
|
|
+ try {
|
|
|
+ ifMesEmsSwapfileService.getLgDateProd2();
|
|
|
+ } catch (ParseException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
tRmWorkprocProductValueService.setDate(new Date()); // 产品实绩产量、产品计划数据维护
|
|
|
tRmWorkprocMaterialValueService.setDate(new Date()); // 原材料数据维护
|
|
|
logger.info("定时任务"+taskId+"执行时长:" + (new Date().getTime() - start)/1000 + "秒");
|
|
|
- } else if (taskId.equalsIgnoreCase("106")) {
|
|
|
- // 获取MES水质监测数据
|
|
|
- long start = new Date().getTime();
|
|
|
- ifMesEmsWatermonitorService.synchronousMesAnEmsData();
|
|
|
- // 生成人工录入监测数据
|
|
|
- tCm0312Controller.getmanualdata();
|
|
|
- logger.info("定时任务"+taskId+"执行时长:" + (new Date().getTime() - start)/1000 + "秒");
|
|
|
- } else if (taskId.equalsIgnoreCase("107")) { // 电统计(从南瑞到EMS)
|
|
|
- long start = new Date().getTime();
|
|
|
- emsETimingService.getData();
|
|
|
- logger.info("定时任务"+taskId+"执行时长:" + (new Date().getTime() - start)/1000 + "秒");
|
|
|
- } else if (taskId.equalsIgnoreCase("108")) {
|
|
|
- // 从IF_MES_EMS_WATERMONITOR表获取水质监测数据到T_CM_0318表
|
|
|
- tCm0312Controller.synchronousData();
|
|
|
- } else if (taskId.equalsIgnoreCase("109")) { // 电计量点班数据计算
|
|
|
- tRmCalpointValueService.statDataShift(new Date());
|
|
|
- } else if (taskId.equalsIgnoreCase("110")) {
|
|
|
- // 能耗数据获取
|
|
|
- ifEmsMesActitemService.getUploadData();
|
|
|
- } else if (taskId.equalsIgnoreCase("111")) {
|
|
|
- // 指标管理数据生成
|
|
|
- long start = new Date().getTime();
|
|
|
- tRmIndexValueService.statData();
|
|
|
- logger.info("定时任务"+taskId+"执行时长:" + (new Date().getTime() - start)/1000 + "秒");
|
|
|
- } else if (taskId.equalsIgnoreCase("112")) {
|
|
|
- // 能源上报_晋泰信和
|
|
|
- usageDataService.autoUpload();
|
|
|
- } else if(taskId.equalsIgnoreCase("113")){
|
|
|
- //平衡数据维护
|
|
|
- long start = new Date().getTime();
|
|
|
- tRmBalanceValueService.state();
|
|
|
- // 上报项目数据维护
|
|
|
- tRmDwValueService.state(new Date());
|
|
|
- logger.info("定时任务"+taskId+"执行时长:" + (new Date().getTime() - start)/1000 + "秒");
|
|
|
- } else if(taskId.equalsIgnoreCase("114")){
|
|
|
- // 环保监控记录定时任务
|
|
|
- zghbjkbzLogService.record();
|
|
|
- } else if(taskId.equalsIgnoreCase("115")){
|
|
|
- // 月初自动生成宾馆转供电记录
|
|
|
- long start = new Date().getTime();
|
|
|
- tRmTransfereActValueService.createRecord();
|
|
|
- logger.info("定时任务"+taskId+"执行时长:" + (new Date().getTime() - start)/1000 + "秒");
|
|
|
- } else if(taskId.equalsIgnoreCase("116")){
|
|
|
- // 动力、水小时表定时统计(自动补全24小时内的小时用量值)
|
|
|
- long start = new Date().getTime();
|
|
|
- tRmCalpointService.statHourData();
|
|
|
- logger.info("定时任务"+taskId+"执行时长:" + (new Date().getTime() - start)/1000 + "秒");
|
|
|
- } else if(taskId.equalsIgnoreCase("117")){
|
|
|
- // 财务投入产出数据生成
|
|
|
- long start = new Date().getTime();
|
|
|
- tRmDfValueService.state(new Date());
|
|
|
- logger.info("定时任务"+taskId+"执行时长:" + (new Date().getTime() - start)/1000 + "秒");
|
|
|
- } else if(taskId.equalsIgnoreCase("118")){
|
|
|
- // 财务投入产出数据MES产量补全
|
|
|
- long start = new Date().getTime();
|
|
|
- tRmDfValueService.state1(new Date());
|
|
|
- logger.info("定时任务"+taskId+"执行时长:" + (new Date().getTime() - start)/1000 + "秒");
|
|
|
- } else if(taskId.equalsIgnoreCase("119")){
|
|
|
- // 转供电仪表自动采集
|
|
|
- long start = new Date().getTime();
|
|
|
- try {
|
|
|
- emsEoTimingService.getData();
|
|
|
- }catch(Exception e){
|
|
|
- logger.error(taskId + " 执行失败", e);
|
|
|
- }
|
|
|
- logger.info("定时任务"+taskId+"执行时长:" + (new Date().getTime() - start)/1000 + "秒");
|
|
|
- } else if(taskId.equalsIgnoreCase("120")){
|
|
|
- // 转供电仪表数据补全
|
|
|
- long start = new Date().getTime();
|
|
|
- try {
|
|
|
- //emsEoTimingService.getLaterData();
|
|
|
- }catch(Exception e){
|
|
|
- logger.error(taskId + " 执行失败", e);
|
|
|
- }
|
|
|
- logger.info("定时任务"+taskId+"执行时长:" + (new Date().getTime() - start)/1000 + "秒");
|
|
|
- }
|
|
|
- }
|
|
|
- };
|
|
|
+ }
|
|
|
+// else if (taskId.equalsIgnoreCase("106")) {
|
|
|
+// // 获取MES水质监测数据
|
|
|
+// long start = new Date().getTime();
|
|
|
+// ifMesEmsWatermonitorService.synchronousMesAnEmsData();
|
|
|
+// // 生成人工录入监测数据
|
|
|
+// tCm0312Controller.getmanualdata();
|
|
|
+// logger.info("定时任务"+taskId+"执行时长:" + (new Date().getTime() - start)/1000 + "秒");
|
|
|
+// } else if (taskId.equalsIgnoreCase("107")) { // 电统计(从南瑞到EMS)
|
|
|
+// long start = new Date().getTime();
|
|
|
+// emsETimingService.getData();
|
|
|
+// logger.info("定时任务"+taskId+"执行时长:" + (new Date().getTime() - start)/1000 + "秒");
|
|
|
+// } else if (taskId.equalsIgnoreCase("108")) {
|
|
|
+// // 从IF_MES_EMS_WATERMONITOR表获取水质监测数据到T_CM_0318表
|
|
|
+// tCm0312Controller.synchronousData();
|
|
|
+// } else if (taskId.equalsIgnoreCase("109")) { // 电计量点班数据计算
|
|
|
+// tRmCalpointValueService.statDataShift(new Date());
|
|
|
+// } else if (taskId.equalsIgnoreCase("110")) {
|
|
|
+// // 能耗数据获取
|
|
|
+// ifEmsMesActitemService.getUploadData();
|
|
|
+// } else if (taskId.equalsIgnoreCase("111")) {
|
|
|
+// // 指标管理数据生成
|
|
|
+// long start = new Date().getTime();
|
|
|
+// tRmIndexValueService.statData();
|
|
|
+// logger.info("定时任务"+taskId+"执行时长:" + (new Date().getTime() - start)/1000 + "秒");
|
|
|
+// } else if (taskId.equalsIgnoreCase("112")) {
|
|
|
+// // 能源上报_晋泰信和
|
|
|
+// usageDataService.autoUpload();
|
|
|
+// } else if(taskId.equalsIgnoreCase("113")){
|
|
|
+// //平衡数据维护
|
|
|
+// long start = new Date().getTime();
|
|
|
+// tRmBalanceValueService.state();
|
|
|
+// // 上报项目数据维护
|
|
|
+// tRmDwValueService.state(new Date());
|
|
|
+// logger.info("定时任务"+taskId+"执行时长:" + (new Date().getTime() - start)/1000 + "秒");
|
|
|
+// } else if(taskId.equalsIgnoreCase("114")){
|
|
|
+// // 环保监控记录定时任务
|
|
|
+// zghbjkbzLogService.record();
|
|
|
+// } else if(taskId.equalsIgnoreCase("115")){
|
|
|
+// // 月初自动生成宾馆转供电记录
|
|
|
+// long start = new Date().getTime();
|
|
|
+// tRmTransfereActValueService.createRecord();
|
|
|
+// logger.info("定时任务"+taskId+"执行时长:" + (new Date().getTime() - start)/1000 + "秒");
|
|
|
+// } else if(taskId.equalsIgnoreCase("116")){
|
|
|
+// // 动力、水小时表定时统计(自动补全24小时内的小时用量值)
|
|
|
+// long start = new Date().getTime();
|
|
|
+// tRmCalpointService.statHourData();
|
|
|
+// logger.info("定时任务"+taskId+"执行时长:" + (new Date().getTime() - start)/1000 + "秒");
|
|
|
+// } else if(taskId.equalsIgnoreCase("117")){
|
|
|
+// // 财务投入产出数据生成
|
|
|
+// long start = new Date().getTime();
|
|
|
+// tRmDfValueService.state(new Date());
|
|
|
+// logger.info("定时任务"+taskId+"执行时长:" + (new Date().getTime() - start)/1000 + "秒");
|
|
|
+// } else if(taskId.equalsIgnoreCase("118")){
|
|
|
+// // 财务投入产出数据MES产量补全
|
|
|
+// long start = new Date().getTime();
|
|
|
+// tRmDfValueService.state(new Date());
|
|
|
+// logger.info("定时任务"+taskId+"执行时长:" + (new Date().getTime() - start)/1000 + "秒");
|
|
|
+// }
|
|
|
+ }
|
|
|
+ };
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 获取任务时间表达式
|
|
|
* @param taskId
|
|
@@ -319,5 +294,5 @@ public class SpringCronTask implements SchedulingConfigurer{
|
|
|
public String getCron(String taskId) {
|
|
|
String sql = "select cron from TASK_CONF t where id = ?";
|
|
|
return jdbcTemplate.queryForObject(sql, new Object[]{taskId}, String.class);
|
|
|
- }
|
|
|
+ }
|
|
|
}
|