|
@@ -5,6 +5,9 @@ import com.steerinfo.ems.bfhyd.service.IBfhydService;
|
|
|
import com.steerinfo.ems.dzmaterialsf.service.IDzMaterialSfService;
|
|
|
import com.steerinfo.ems.emsetiming.service.IEmsETimingService;
|
|
|
import com.steerinfo.ems.emsgmpcjh.service.IEmsGmPcJhService;
|
|
|
+import com.steerinfo.ems.emsprodplanroundweight.model.EmsProdplanRoundWeight;
|
|
|
+import com.steerinfo.ems.emsprodplanroundweight.service.IEmsProdplanRoundWeightService;
|
|
|
+import com.steerinfo.ems.emsprodplanroundweight.service.impl.EmsProdplanRoundWeightServiceImpl;
|
|
|
import com.steerinfo.ems.emsscqklg.service.IEmsScqkLgService;
|
|
|
import com.steerinfo.ems.emsscqklg.service.ILgRealService;
|
|
|
import com.steerinfo.ems.emswaterrealtime.service.IEmsWaterRealtimeService;
|
|
@@ -124,6 +127,8 @@ public class SpringCronTask implements SchedulingConfigurer{
|
|
|
ILgRealService lgRealService;
|
|
|
@Autowired
|
|
|
IFoldTheValuesService foldTheValuesService;
|
|
|
+ @Autowired
|
|
|
+ IEmsProdplanRoundWeightService emsProdplanRoundWeightService;
|
|
|
/**
|
|
|
* SchedulingConfigurer接口的方法实现,加载后自动运行
|
|
|
*/
|
|
@@ -210,32 +215,32 @@ public class SpringCronTask implements SchedulingConfigurer{
|
|
|
return new Runnable() {
|
|
|
@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 = System.currentTimeMillis();
|
|
|
-// 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+"执行时长:" + (System.currentTimeMillis() - start)/1000 + "秒");
|
|
|
-// } else if (taskId.equalsIgnoreCase("102")) {
|
|
|
-// // 计量点定时任务
|
|
|
-// long start = System.currentTimeMillis();
|
|
|
-// tRmCalpointValueService.statData(new Date());
|
|
|
-// logger.info("定时任务"+taskId+"执行时长:" + (System.currentTimeMillis() - start)/1000 + "秒");
|
|
|
-// } else if (taskId.equalsIgnoreCase("103")) {
|
|
|
-// long start = System.currentTimeMillis();
|
|
|
-// tRmActValueService.statDataforDay();// 每日数据统计(实绩定时任务)
|
|
|
-// logger.info("定时任务"+taskId+"执行时长:" + (System.currentTimeMillis() - start)/1000 + "秒");
|
|
|
-// } else if (taskId.equalsIgnoreCase("104")) {
|
|
|
-// long start = System.currentTimeMillis();
|
|
|
-// tRmPlanValueService.state();// 每日数据统计(计划定时任务)
|
|
|
-// logger.info("定时任务"+taskId+"执行时长:" + (System.currentTimeMillis() - start)/1000 + "秒");
|
|
|
-// }
|
|
|
+ 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 = System.currentTimeMillis();
|
|
|
+ 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+"执行时长:" + (System.currentTimeMillis() - start)/1000 + "秒");
|
|
|
+ } else if (taskId.equalsIgnoreCase("102")) {
|
|
|
+ // 计量点定时任务
|
|
|
+ long start = System.currentTimeMillis();
|
|
|
+ tRmCalpointValueService.statData(new Date());
|
|
|
+ logger.info("定时任务"+taskId+"执行时长:" + (System.currentTimeMillis() - start)/1000 + "秒");
|
|
|
+ } else if (taskId.equalsIgnoreCase("103")) {
|
|
|
+ long start = System.currentTimeMillis();
|
|
|
+ tRmActValueService.statDataforDay();// 每日数据统计(实绩定时任务)
|
|
|
+ logger.info("定时任务"+taskId+"执行时长:" + (System.currentTimeMillis() - start)/1000 + "秒");
|
|
|
+ } else if (taskId.equalsIgnoreCase("104")) {
|
|
|
+ long start = System.currentTimeMillis();
|
|
|
+ tRmPlanValueService.state();// 每日数据统计(计划定时任务)
|
|
|
+ logger.info("定时任务"+taskId+"执行时长:" + (System.currentTimeMillis() - start)/1000 + "秒");
|
|
|
+ }
|
|
|
if (taskId.equalsIgnoreCase("105")) {
|
|
|
// 先计算产品,因为原材料计算单耗需要产品实绩数据参与计算
|
|
|
long start = System.currentTimeMillis();
|
|
@@ -336,6 +341,15 @@ public class SpringCronTask implements SchedulingConfigurer{
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
logger.info("定时任务"+taskId+"执行时长:" + (System.currentTimeMillis() - start)/1000 + "秒");
|
|
|
+ }
|
|
|
+ else if(taskId.equalsIgnoreCase("127")){
|
|
|
+ long start = System.currentTimeMillis();
|
|
|
+ try {
|
|
|
+ emsProdplanRoundWeightService.getWeightForLg();
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ logger.info("定时任务"+taskId+"执行时长:" + (System.currentTimeMillis() - start)/1000 + "秒");
|
|
|
}// else if (taskId.equalsIgnoreCase("106")) {
|
|
|
// // 获取MES水质监测数据
|
|
|
// long start = System.currentTimeMillis();
|