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