Commit 51470411cd30f394cb769afab22b3cd852299409

Authored by 王通
1 parent 34e0ea6d

1.清除保养计划数据

src/main/java/com/bsth/data/schedule/thread/CalcOilThread.java
1 -package com.bsth.data.schedule.thread;  
2 -  
3 -import com.bsth.data.directive.DayOfDirectives;  
4 -import com.bsth.data.gpsdata_v2.handlers.overspeed.OverspeedProcess;  
5 -import com.bsth.data.gpsdata_v2.thread.GpsDataLoaderThread;  
6 -import com.bsth.service.calc.CalcWaybillService;  
7 -import com.bsth.service.forms.BudgetService;  
8 -import com.bsth.service.oil.DlbService;  
9 -import com.bsth.data.safe_driv.SafeDrivCenter;  
10 -import com.bsth.service.oil.YlbService;  
11 -import com.bsth.service.report.SheetService;  
12 -  
13 -import org.slf4j.Logger;  
14 -import org.slf4j.LoggerFactory;  
15 -import org.springframework.beans.factory.annotation.Autowired;  
16 -import org.springframework.stereotype.Component;  
17 -  
18 -/**  
19 - * 计算油、公里加注量 线程  
20 - * Created by panzhao on 2017/3/7.  
21 - */  
22 -@Component  
23 -public class CalcOilThread extends Thread{  
24 -  
25 - @Autowired  
26 - YlbService ylbService;  
27 - @Autowired  
28 - DlbService dlbService;  
29 -  
30 - @Autowired  
31 - SheetService sheetService;  
32 - Logger logger = LoggerFactory.getLogger(this.getClass());  
33 -  
34 - @Autowired  
35 - DayOfDirectives dayOfDirectives;  
36 -  
37 - @Autowired  
38 - CalcWaybillService calcWaybillService;  
39 -  
40 - @Autowired  
41 - BudgetService budgetService;  
42 -  
43 - @Override  
44 - public void run() {  
45 - logger.info("开始计算油量平衡表....");  
46 - try{  
47 - ylbService.obtainDsq();  
48 -// logger.info("开始计算班次准点率....");  
49 -// sheetService.saveSheetList("");  
50 -// logger.info("计算班次准点率结束!");  
51 - } catch(Exception e){  
52 - logger.error("计算油量平衡表失败",e);  
53 - }  
54 - try{  
55 - logger.info("开始计算电量平衡表....");  
56 - dlbService.obtainDsq();  
57 - } catch(Exception e){  
58 - logger.error("计算电量平衡表失败",e);  
59 - }  
60 -  
61 - try{  
62 - logger.info("计算路单里程开始");  
63 - calcWaybillService.autoGenerate("", "");  
64 - }catch(Exception e){  
65 - logger.error("计算路单里程失败",e);  
66 - }  
67 -  
68 - logger.info("开始保存统计日报....");  
69 - try{  
70 - calcWaybillService.calcDaily("", "");  
71 - }catch(Exception e){  
72 - logger.error("统计日报失败",e);  
73 - }  
74 -  
75 - logger.info("开始获取营收人次....");  
76 - try{  
77 - budgetService.updateRevenueRange("", "");  
78 - }catch(Exception e){  
79 - logger.error("获取营收人次失败",e);  
80 - }  
81 -  
82 - //清除指令数据  
83 - dayOfDirectives.clearAll();  
84 - //清除安全驾驶数据  
85 - SafeDrivCenter.clear();  
86 - //清除超速缓存数据  
87 - OverspeedProcess.clear();  
88 -  
89 - GpsDataLoaderThread.setFlag(0);  
90 -  
91 - }  
92 -} 1 +package com.bsth.data.schedule.thread;
  2 +
  3 +import com.bsth.data.directive.DayOfDirectives;
  4 +import com.bsth.data.gpsdata_v2.handlers.overspeed.OverspeedProcess;
  5 +import com.bsth.data.gpsdata_v2.thread.GpsDataLoaderThread;
  6 +import com.bsth.data.maintenance_plan.MtPlanCenter;
  7 +import com.bsth.service.calc.CalcWaybillService;
  8 +import com.bsth.service.forms.BudgetService;
  9 +import com.bsth.service.oil.DlbService;
  10 +import com.bsth.data.safe_driv.SafeDrivCenter;
  11 +import com.bsth.service.oil.YlbService;
  12 +import com.bsth.service.report.SheetService;
  13 +
  14 +import org.slf4j.Logger;
  15 +import org.slf4j.LoggerFactory;
  16 +import org.springframework.beans.factory.annotation.Autowired;
  17 +import org.springframework.stereotype.Component;
  18 +
  19 +/**
  20 + * 计算油、公里加注量 线程
  21 + * Created by panzhao on 2017/3/7.
  22 + */
  23 +@Component
  24 +public class CalcOilThread extends Thread{
  25 +
  26 + @Autowired
  27 + YlbService ylbService;
  28 + @Autowired
  29 + DlbService dlbService;
  30 +
  31 + @Autowired
  32 + SheetService sheetService;
  33 + Logger logger = LoggerFactory.getLogger(this.getClass());
  34 +
  35 + @Autowired
  36 + DayOfDirectives dayOfDirectives;
  37 +
  38 + @Autowired
  39 + CalcWaybillService calcWaybillService;
  40 +
  41 + @Autowired
  42 + BudgetService budgetService;
  43 +
  44 + @Override
  45 + public void run() {
  46 + logger.info("开始计算油量平衡表....");
  47 + try{
  48 + ylbService.obtainDsq();
  49 +// logger.info("开始计算班次准点率....");
  50 +// sheetService.saveSheetList("");
  51 +// logger.info("计算班次准点率结束!");
  52 + } catch(Exception e){
  53 + logger.error("计算油量平衡表失败",e);
  54 + }
  55 + try{
  56 + logger.info("开始计算电量平衡表....");
  57 + dlbService.obtainDsq();
  58 + } catch(Exception e){
  59 + logger.error("计算电量平衡表失败",e);
  60 + }
  61 +
  62 + try{
  63 + logger.info("计算路单里程开始");
  64 + calcWaybillService.autoGenerate("", "");
  65 + }catch(Exception e){
  66 + logger.error("计算路单里程失败",e);
  67 + }
  68 +
  69 + logger.info("开始保存统计日报....");
  70 + try{
  71 + calcWaybillService.calcDaily("", "");
  72 + }catch(Exception e){
  73 + logger.error("统计日报失败",e);
  74 + }
  75 +
  76 + logger.info("开始获取营收人次....");
  77 + try{
  78 + budgetService.updateRevenueRange("", "");
  79 + }catch(Exception e){
  80 + logger.error("获取营收人次失败",e);
  81 + }
  82 +
  83 + //清除指令数据
  84 + dayOfDirectives.clearAll();
  85 + //清除安全驾驶数据
  86 + SafeDrivCenter.clear();
  87 + //清除保养计划数据
  88 + MtPlanCenter.clear();
  89 + //清除超速缓存数据
  90 + OverspeedProcess.clear();
  91 +
  92 + GpsDataLoaderThread.setFlag(0);
  93 +
  94 + }
  95 +}