Commit 7e9c61c693e2cbf909cbf36b3892a4c2cedf4671

Authored by ljq
1 parent 5200d8b2

1

src/main/java/com/bsth/XDApplication.java
... ... @@ -22,7 +22,6 @@ import com.bsth.data.schedule.thread.CalcOilThread;
22 22 import com.bsth.data.schedule.thread.SchedulePstThread;
23 23 import com.bsth.data.schedule.thread.ScheduleRefreshThread;
24 24 import com.bsth.data.schedule.thread.SubmitToTrafficManage;
25   -import com.bsth.data.zndd.StationAllThread;
26 25 import com.bsth.data.zndd.ZnddThread;
27 26 import com.bsth.util.DateUtils;
28 27 import com.bsth.util.Tools;
... ... @@ -87,8 +86,6 @@ public class XDApplication implements CommandLineRunner {
87 86 @Autowired
88 87 ZnddThread znddThread;
89 88 @Autowired
90   - StationAllThread stationAllThread;
91   - @Autowired
92 89 SafeDrivDataLoadThread safeDrivDataLoadThread;
93 90  
94 91 @Autowired
... ...
src/main/java/com/bsth/data/zndd/OutEntrance.java
1 1 package com.bsth.data.zndd;
2 2 import com.bsth.common.ResponseCode;
3   -import com.bsth.controller.station_signs.carMonitorThread;
4 3 import com.bsth.data.schedule.DayOfSchedule;
5 4 import com.bsth.data.schedule.ScheduleComparator;
6 5 import com.bsth.data.adjg.domain.LargeGap;
7   -import com.bsth.entity.logger.StationSignsLogger;
8   -import com.bsth.entity.realcontrol.ScheduleRealInfo;
9   -import com.bsth.entity.zndd.StationPeopleLogger;
10   -import com.bsth.service.logger.StationSignsLoggerService;
11   -import com.bsth.service.zndd.ZnddLoggerService;
12 6 import com.bsth.websocket.handler.SendUtils;
13 7 import com.fasterxml.jackson.databind.ObjectMapper;
14 8 import org.slf4j.Logger;
... ... @@ -34,85 +28,79 @@ import java.util.*;
34 28 public class OutEntrance {
35 29  
36 30 @Autowired
37   - StationSignsLoggerService stationSignsLoggerService;
38   -
39   - @Autowired
40 31 SendUtils sendUtils;
41 32 @Autowired
42 33 DayOfSchedule dayOfSchedule;
43 34  
44   - @Autowired
45   - ZnddLoggerService znddLoggerService;
46   - @Autowired
47   - carMonitorThread carMonitorThread;
48 35  
49   -
50   - @Value("${dc.imgurl}")
  36 + /* @Value("${dc.imgurl}")
51 37 private String imgurl; //存储图片地址
52 38  
53 39 @Value("${dc.profile}")
54   - private String profile; //存储图片地址
55   -
  40 + private String profile; //存储图片地址*/
  41 +
56 42 static String url= "http://58.34.52.130:9777/xxfb/carMonitor?"; //信息发布地址
57 43 Logger logger = LoggerFactory.getLogger(this.getClass());
58   -
59   -
60   -
61   - /*
62   - 调度屏小程序接口。
63   - */
64   - @RequestMapping(value = "/OutCar", method = RequestMethod.POST)
65   - public Map OutCarOutCar(@RequestParam Map m,@RequestBody Map<String, String> map) {
66 44  
67 45  
68   - Map rtn = new HashMap<>();
69   - try {
70   -
71   - ObjectMapper mapper = new ObjectMapper();
72   - m.put("image", uploadBase64Img(map.get("img").toString()));
73   - //map转换实体类
74   - StationSignsLogger ssLogger = mapper.convertValue(m, StationSignsLogger.class);
75   - //stationSignsLoggerService.save(ssLogger);
76   -
77   - //线调页面推送
78   - sendUtils.stationcf(m);
79   -
80   - //查询班次情况自动回复
81   - //当前日期
82   - //String rq = DateUtils.dqDate();
83   - List<Map> dzList = carMonitorThread.carMonitor(ssLogger.getLineCode(), ssLogger.getDir(), ssLogger.getStation()); //信息发布接口
84   - if (dzList.size() > 0){
85   - rtn.put("message","车辆还有"+dzList.get(0).get("sj")+"抵达,请耐心等待");
86   - }else {
87   - //筛选方向
88   - List<ScheduleRealInfo> rs = dayOfSchedule.findByLineCode(ssLogger.getLineCode());
89   - //排序
90   - Collections.sort(rs,new ScheduleComparator.FCSJ());
91   - SimpleDateFormat sdf= new SimpleDateFormat("HH:ss");
92   - String sjtext = "";
93   - LocalTime t1 = LocalTime.parse(sdf.format(new Date()), DateTimeFormatter.ofPattern("HH:mm"));
94   - for (ScheduleRealInfo sr:rs) {
95   - LocalTime t2 = LocalTime.parse(sr.getFcsj(), DateTimeFormatter.ofPattern("HH:mm"));
96   - //判断上下行
97   - if(t1.isAfter(t2)){
98   - sjtext = sr.getFcsj();
99   - }
100   - }
101   -
102   - rtn.put("message","航津路与杨高北路交叉口拥堵,请耐心等待");
103   - rtn.put("message_els","The intersection of Hangjin Road and Yanggao North Road is congested, please be patient and wait");
104   - }
105   -
106   -
107   -
108   - rtn.put("status",ResponseCode.SUCCESS);
109   - } catch (Exception e) {
110   - rtn.put("status", ResponseCode.ERROR);
111   - logger.info(e.getMessage());
112   - }
113   -
114   - return rtn;
115   - }
  46 +
  47 + /****
  48 + 调度屏小程序接口。
  49 +
  50 + @RequestMapping(value = "/OutCar", method = RequestMethod.POST)
  51 + public Map OutCarOutCar(@RequestParam Map m,@RequestBody Map<String, String> map) {
  52 +
  53 +
  54 + Map rtn = new HashMap<>();
  55 + try {
  56 +
  57 + ObjectMapper mapper = new ObjectMapper();
  58 + m.put("image", uploadBase64Img(map.get("img").toString()));
  59 + //map转换实体类
  60 + StationSignsLogger ssLogger = mapper.convertValue(m, StationSignsLogger.class);
  61 + //stationSignsLoggerService.save(ssLogger);
  62 +
  63 + //线调页面推送
  64 + sendUtils.stationcf(m);
  65 +
  66 + //查询班次情况自动回复
  67 + //当前日期
  68 + //String rq = DateUtils.dqDate();
  69 + List<Map> dzList = carMonitorThread.carMonitor(ssLogger.getLineCode(), ssLogger.getDir(), ssLogger.getStation()); //信息发布接口
  70 + if (dzList.size() > 0){
  71 + rtn.put("message","车辆还有"+dzList.get(0).get("sj")+"抵达,请耐心等待");
  72 + }else {
  73 + //筛选方向
  74 + List<ScheduleRealInfo> rs = dayOfSchedule.findByLineCode(ssLogger.getLineCode());
  75 + //排序
  76 + Collections.sort(rs,new ScheduleComparator.FCSJ());
  77 + SimpleDateFormat sdf= new SimpleDateFormat("HH:ss");
  78 + String sjtext = "";
  79 + LocalTime t1 = LocalTime.parse(sdf.format(new Date()), DateTimeFormatter.ofPattern("HH:mm"));
  80 + for (ScheduleRealInfo sr:rs) {
  81 + LocalTime t2 = LocalTime.parse(sr.getFcsj(), DateTimeFormatter.ofPattern("HH:mm"));
  82 + //判断上下行
  83 + if(t1.isAfter(t2)){
  84 + sjtext = sr.getFcsj();
  85 + }
  86 + }
  87 +
  88 + rtn.put("message","航津路与杨高北路交叉口拥堵,请耐心等待");
  89 + rtn.put("message_els","The intersection of Hangjin Road and Yanggao North Road is congested, please be patient and wait");
  90 + }
  91 +
  92 +
  93 +
  94 + rtn.put("status",ResponseCode.SUCCESS);
  95 + } catch (Exception e) {
  96 + rtn.put("status", ResponseCode.ERROR);
  97 + logger.info(e.getMessage());
  98 + }
  99 +
  100 + return rtn;
  101 + }
  102 +
  103 + */
116 104 /*
117 105 智能调度接口--通用测试接口
118 106 */
... ... @@ -136,7 +124,7 @@ public class OutEntrance {
136 124  
137 125 /*
138 126 智能调度接口-大客流
139   - */
  127 +
140 128 @RequestMapping(value="/dkl",method = RequestMethod.POST)
141 129 public Map ddkl(@RequestParam Map m) {
142 130 Map rtn = new HashMap<>();
... ... @@ -160,7 +148,7 @@ public class OutEntrance {
160 148 }
161 149 return rtn;
162 150 }
163   -
  151 + */
164 152  
165 153  
166 154  
... ... @@ -170,7 +158,7 @@ public class OutEntrance {
170 158 * @param 上传地址(示例:D:\\1.png)
171 159 * @return
172 160 */
173   - public String uploadBase64Img(String base) {
  161 + /*public String uploadBase64Img(String base) {
174 162  
175 163 //获取年月日
176 164 SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
... ... @@ -226,8 +214,8 @@ public class OutEntrance {
226 214 }
227 215 }
228 216 return null;
229   - }
230   -
231   -
232   -
  217 + }*/
  218 +
  219 +
  220 +
233 221 }
... ...
src/main/java/com/bsth/data/zndd/ZnddThread.java
1 1 package com.bsth.data.zndd;
2 2  
3   -import com.alibaba.fastjson.JSON;
4   -import com.alibaba.fastjson.JSONArray;
5   -import com.alibaba.fastjson.JSONObject;
6 3 import com.bsth.data.LineConfigData;
7   -import com.bsth.data.adjg.UserCarCountHandler;
8 4 import com.bsth.data.gpsdata_v2.GpsRealData;
9 5 import com.bsth.data.gpsdata_v2.entity.GpsEntity;
10 6 import com.bsth.data.schedule.DayOfSchedule;
11   -import com.bsth.data.schedule.ScheduleComparator;
12   -import com.bsth.data.adjg.domain.LargeGap;
13   -import com.bsth.entity.calc.CalcIntervalDetail;
14   -import com.bsth.entity.realcontrol.LineConfig;
15 7 import com.bsth.entity.realcontrol.ScheduleRealInfo;
16 8 import com.bsth.entity.zndd.znddStatus;
17 9 import com.bsth.repository.StationRouteRepository;
18   -import com.bsth.repository.zndd.StationPeopleLoggerRepository;
19 10 import com.bsth.repository.zndd.ZnddStatusRepository;
20   -import com.bsth.util.HttpClientUtils;
21 11 import org.slf4j.Logger;
22 12 import org.slf4j.LoggerFactory;
23 13 import org.springframework.beans.factory.annotation.Autowired;
... ... @@ -34,8 +24,8 @@ import java.util.*;
34 24 public class ZnddThread extends Thread{
35 25  
36 26 Logger logger = LoggerFactory.getLogger(this.getClass());
37   - @Autowired
38   - StationPeopleLoggerRepository stationPeopleLoggerRepository;
  27 + /*@Autowired
  28 + StationPeopleLoggerRepository stationPeopleLoggerRepository;*/
39 29 @Autowired
40 30 DayOfSchedule dayOfSchedule;
41 31 @Autowired
... ... @@ -44,8 +34,8 @@ public class ZnddThread extends Thread{
44 34 GpsRealData gpsRealData;
45 35 @Autowired
46 36 StationRouteRepository stationRouteRepository;
47   - @Autowired
48   - private UserCarCountHandler userCarCountHandler;
  37 +/* @Autowired
  38 + private UserCarCountHandler userCarCountHandler;*/
49 39 @Autowired
50 40 OutEntrance outEntrance;
51 41 @Autowired
... ... @@ -93,7 +83,7 @@ public class ZnddThread extends Thread{
93 83  
94 84 }
95 85 //满载
96   - public void MZ(){
  86 + /* public void MZ(){
97 87 try {
98 88 StringBuilder sb = HttpClientUtils.get(url);
99 89 List<Object> list = JSONArray.parseArray(String.valueOf(sb));
... ... @@ -124,7 +114,7 @@ public class ZnddThread extends Thread{
124 114 }catch (Exception e){
125 115 logger.error("满载检测接口出错-----------",e);
126 116 }
127   - }
  117 + }*/
128 118 public void ts(Map m) throws ParseException {
129 119 //记录存一下 --超过当前时间的是否推送?
130 120 String st = m.get("lineCode")+"_"+m.get("type")+"_"+m.get("rqStr");
... ... @@ -185,7 +175,7 @@ public class ZnddThread extends Thread{
185 175 */
186 176  
187 177 //发车间隔
188   - public void FCJG(){
  178 + /* public void FCJG(){
189 179 try {
190 180 //无数据情况下 查看发车间隔配置数据是否正常bsth_c_calc_interval
191 181 List<CalcIntervalDetail> fcjgList = userCarCountHandler.calcLast();
... ... @@ -207,7 +197,7 @@ public class ZnddThread extends Thread{
207 197 }catch (Exception e){
208 198 logger.error("发车间隔检测出现出错-----------",e);
209 199 }
210   - }
  200 + }*/
211 201  
212 202  
213 203 //转换
... ...
src/main/java/com/bsth/websocket/handler/SendUtils.java
... ... @@ -7,8 +7,6 @@ import com.bsth.data.gpsdata_v2.entity.GpsEntity;
7 7 import com.bsth.data.safe_driv.SafeDriv;
8 8 import com.bsth.entity.directive.D80;
9 9 import com.bsth.entity.realcontrol.ScheduleRealInfo;
10   -import com.bsth.entity.zndd.StationPeople;
11   -import com.bsth.entity.zndd.StationPeopleLogger;
12 10 import com.bsth.websocket.dto.WsScheduleRealInfo;
13 11 import com.fasterxml.jackson.core.JsonProcessingException;
14 12 import com.fasterxml.jackson.databind.ObjectMapper;
... ...