ZnddThread.java
2.68 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
package com.bsth.data.zndd;
import com.bsth.data.LineConfigData;
import com.bsth.data.gpsdata_v2.GpsRealData;
import com.bsth.data.schedule.DayOfSchedule;
import com.bsth.entity.zndd.znddStatus;
import com.bsth.repository.StationRouteRepository;
import com.bsth.repository.zndd.ZnddStatusRepository;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.text.SimpleDateFormat;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 调度预案 发车间隔、误点、大间隔、满载、大客流
*/
@Component
public class ZnddThread extends Thread{
Logger logger = LoggerFactory.getLogger(this.getClass());
/*@Autowired
StationPeopleLoggerRepository stationPeopleLoggerRepository;*/
@Autowired
DayOfSchedule dayOfSchedule;
@Autowired
LineConfigData lineConfs;
@Autowired
GpsRealData gpsRealData;
@Autowired
StationRouteRepository stationRouteRepository;
@Autowired
AutomaticSch automaticSch;
@Autowired
ZnddStatusRepository znddStatusRepository;
static Map<String,List> ZNDDTYPEMAP = new HashMap<>(); //已经推送过的检测
private static SimpleDateFormat sdfHHmm = new SimpleDateFormat("HH:mm");
private static SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd");
private static SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
@Override
public void run() {
try {
List<znddStatus> znddStatusList = (List<znddStatus>) znddStatusRepository.findAll();
//GPSDJG();//大间隔
// MZ(); //满载
//DKL(); //大客流 以接口方式
//automaticSch.mz();
//automaticSch.dfTz();//大间隔
for (znddStatus zs : znddStatusList) {
if (zs.getOpenStatus() != null && zs.getOpenStatus().equals("0")) {
if (zs.getType().equals("sftz")) {
automaticSch.sftz();//实发未发
logger.info("实发执行完毕");
}
if (zs.getType().equals("ycsf")) {
automaticSch.sfCX();// 异常实发 - 实发撤销
logger.info("异常实发执行完毕");
}
if (zs.getType().equals("zlcf")){
automaticSch.drivresponse();
logger.info("设备重发执行完毕");
}
}
}
}catch (Throwable e){
logger.info("智能调度线程——————",e);
}
}
}