Commit 7e9c61c693e2cbf909cbf36b3892a4c2cedf4671
1 parent
5200d8b2
1
Showing
4 changed files
with
76 additions
and
103 deletions
src/main/java/com/bsth/XDApplication.java
| @@ -22,7 +22,6 @@ import com.bsth.data.schedule.thread.CalcOilThread; | @@ -22,7 +22,6 @@ import com.bsth.data.schedule.thread.CalcOilThread; | ||
| 22 | import com.bsth.data.schedule.thread.SchedulePstThread; | 22 | import com.bsth.data.schedule.thread.SchedulePstThread; |
| 23 | import com.bsth.data.schedule.thread.ScheduleRefreshThread; | 23 | import com.bsth.data.schedule.thread.ScheduleRefreshThread; |
| 24 | import com.bsth.data.schedule.thread.SubmitToTrafficManage; | 24 | import com.bsth.data.schedule.thread.SubmitToTrafficManage; |
| 25 | -import com.bsth.data.zndd.StationAllThread; | ||
| 26 | import com.bsth.data.zndd.ZnddThread; | 25 | import com.bsth.data.zndd.ZnddThread; |
| 27 | import com.bsth.util.DateUtils; | 26 | import com.bsth.util.DateUtils; |
| 28 | import com.bsth.util.Tools; | 27 | import com.bsth.util.Tools; |
| @@ -87,8 +86,6 @@ public class XDApplication implements CommandLineRunner { | @@ -87,8 +86,6 @@ public class XDApplication implements CommandLineRunner { | ||
| 87 | @Autowired | 86 | @Autowired |
| 88 | ZnddThread znddThread; | 87 | ZnddThread znddThread; |
| 89 | @Autowired | 88 | @Autowired |
| 90 | - StationAllThread stationAllThread; | ||
| 91 | - @Autowired | ||
| 92 | SafeDrivDataLoadThread safeDrivDataLoadThread; | 89 | SafeDrivDataLoadThread safeDrivDataLoadThread; |
| 93 | 90 | ||
| 94 | @Autowired | 91 | @Autowired |
src/main/java/com/bsth/data/zndd/OutEntrance.java
| 1 | package com.bsth.data.zndd; | 1 | package com.bsth.data.zndd; |
| 2 | import com.bsth.common.ResponseCode; | 2 | import com.bsth.common.ResponseCode; |
| 3 | -import com.bsth.controller.station_signs.carMonitorThread; | ||
| 4 | import com.bsth.data.schedule.DayOfSchedule; | 3 | import com.bsth.data.schedule.DayOfSchedule; |
| 5 | import com.bsth.data.schedule.ScheduleComparator; | 4 | import com.bsth.data.schedule.ScheduleComparator; |
| 6 | import com.bsth.data.adjg.domain.LargeGap; | 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 | import com.bsth.websocket.handler.SendUtils; | 6 | import com.bsth.websocket.handler.SendUtils; |
| 13 | import com.fasterxml.jackson.databind.ObjectMapper; | 7 | import com.fasterxml.jackson.databind.ObjectMapper; |
| 14 | import org.slf4j.Logger; | 8 | import org.slf4j.Logger; |
| @@ -34,85 +28,79 @@ import java.util.*; | @@ -34,85 +28,79 @@ import java.util.*; | ||
| 34 | public class OutEntrance { | 28 | public class OutEntrance { |
| 35 | 29 | ||
| 36 | @Autowired | 30 | @Autowired |
| 37 | - StationSignsLoggerService stationSignsLoggerService; | ||
| 38 | - | ||
| 39 | - @Autowired | ||
| 40 | SendUtils sendUtils; | 31 | SendUtils sendUtils; |
| 41 | @Autowired | 32 | @Autowired |
| 42 | DayOfSchedule dayOfSchedule; | 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 | private String imgurl; //存储图片地址 | 37 | private String imgurl; //存储图片地址 |
| 52 | 38 | ||
| 53 | @Value("${dc.profile}") | 39 | @Value("${dc.profile}") |
| 54 | - private String profile; //存储图片地址 | ||
| 55 | - | 40 | + private String profile; //存储图片地址*/ |
| 41 | + | ||
| 56 | static String url= "http://58.34.52.130:9777/xxfb/carMonitor?"; //信息发布地址 | 42 | static String url= "http://58.34.52.130:9777/xxfb/carMonitor?"; //信息发布地址 |
| 57 | Logger logger = LoggerFactory.getLogger(this.getClass()); | 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,7 +124,7 @@ public class OutEntrance { | ||
| 136 | 124 | ||
| 137 | /* | 125 | /* |
| 138 | 智能调度接口-大客流 | 126 | 智能调度接口-大客流 |
| 139 | - */ | 127 | + |
| 140 | @RequestMapping(value="/dkl",method = RequestMethod.POST) | 128 | @RequestMapping(value="/dkl",method = RequestMethod.POST) |
| 141 | public Map ddkl(@RequestParam Map m) { | 129 | public Map ddkl(@RequestParam Map m) { |
| 142 | Map rtn = new HashMap<>(); | 130 | Map rtn = new HashMap<>(); |
| @@ -160,7 +148,7 @@ public class OutEntrance { | @@ -160,7 +148,7 @@ public class OutEntrance { | ||
| 160 | } | 148 | } |
| 161 | return rtn; | 149 | return rtn; |
| 162 | } | 150 | } |
| 163 | - | 151 | + */ |
| 164 | 152 | ||
| 165 | 153 | ||
| 166 | 154 | ||
| @@ -170,7 +158,7 @@ public class OutEntrance { | @@ -170,7 +158,7 @@ public class OutEntrance { | ||
| 170 | * @param 上传地址(示例:D:\\1.png) | 158 | * @param 上传地址(示例:D:\\1.png) |
| 171 | * @return | 159 | * @return |
| 172 | */ | 160 | */ |
| 173 | - public String uploadBase64Img(String base) { | 161 | + /*public String uploadBase64Img(String base) { |
| 174 | 162 | ||
| 175 | //获取年月日 | 163 | //获取年月日 |
| 176 | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); | 164 | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| @@ -226,8 +214,8 @@ public class OutEntrance { | @@ -226,8 +214,8 @@ public class OutEntrance { | ||
| 226 | } | 214 | } |
| 227 | } | 215 | } |
| 228 | return null; | 216 | return null; |
| 229 | - } | ||
| 230 | - | ||
| 231 | - | ||
| 232 | - | 217 | + }*/ |
| 218 | + | ||
| 219 | + | ||
| 220 | + | ||
| 233 | } | 221 | } |
src/main/java/com/bsth/data/zndd/ZnddThread.java
| 1 | package com.bsth.data.zndd; | 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 | import com.bsth.data.LineConfigData; | 3 | import com.bsth.data.LineConfigData; |
| 7 | -import com.bsth.data.adjg.UserCarCountHandler; | ||
| 8 | import com.bsth.data.gpsdata_v2.GpsRealData; | 4 | import com.bsth.data.gpsdata_v2.GpsRealData; |
| 9 | import com.bsth.data.gpsdata_v2.entity.GpsEntity; | 5 | import com.bsth.data.gpsdata_v2.entity.GpsEntity; |
| 10 | import com.bsth.data.schedule.DayOfSchedule; | 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 | import com.bsth.entity.realcontrol.ScheduleRealInfo; | 7 | import com.bsth.entity.realcontrol.ScheduleRealInfo; |
| 16 | import com.bsth.entity.zndd.znddStatus; | 8 | import com.bsth.entity.zndd.znddStatus; |
| 17 | import com.bsth.repository.StationRouteRepository; | 9 | import com.bsth.repository.StationRouteRepository; |
| 18 | -import com.bsth.repository.zndd.StationPeopleLoggerRepository; | ||
| 19 | import com.bsth.repository.zndd.ZnddStatusRepository; | 10 | import com.bsth.repository.zndd.ZnddStatusRepository; |
| 20 | -import com.bsth.util.HttpClientUtils; | ||
| 21 | import org.slf4j.Logger; | 11 | import org.slf4j.Logger; |
| 22 | import org.slf4j.LoggerFactory; | 12 | import org.slf4j.LoggerFactory; |
| 23 | import org.springframework.beans.factory.annotation.Autowired; | 13 | import org.springframework.beans.factory.annotation.Autowired; |
| @@ -34,8 +24,8 @@ import java.util.*; | @@ -34,8 +24,8 @@ import java.util.*; | ||
| 34 | public class ZnddThread extends Thread{ | 24 | public class ZnddThread extends Thread{ |
| 35 | 25 | ||
| 36 | Logger logger = LoggerFactory.getLogger(this.getClass()); | 26 | Logger logger = LoggerFactory.getLogger(this.getClass()); |
| 37 | - @Autowired | ||
| 38 | - StationPeopleLoggerRepository stationPeopleLoggerRepository; | 27 | + /*@Autowired |
| 28 | + StationPeopleLoggerRepository stationPeopleLoggerRepository;*/ | ||
| 39 | @Autowired | 29 | @Autowired |
| 40 | DayOfSchedule dayOfSchedule; | 30 | DayOfSchedule dayOfSchedule; |
| 41 | @Autowired | 31 | @Autowired |
| @@ -44,8 +34,8 @@ public class ZnddThread extends Thread{ | @@ -44,8 +34,8 @@ public class ZnddThread extends Thread{ | ||
| 44 | GpsRealData gpsRealData; | 34 | GpsRealData gpsRealData; |
| 45 | @Autowired | 35 | @Autowired |
| 46 | StationRouteRepository stationRouteRepository; | 36 | StationRouteRepository stationRouteRepository; |
| 47 | - @Autowired | ||
| 48 | - private UserCarCountHandler userCarCountHandler; | 37 | +/* @Autowired |
| 38 | + private UserCarCountHandler userCarCountHandler;*/ | ||
| 49 | @Autowired | 39 | @Autowired |
| 50 | OutEntrance outEntrance; | 40 | OutEntrance outEntrance; |
| 51 | @Autowired | 41 | @Autowired |
| @@ -93,7 +83,7 @@ public class ZnddThread extends Thread{ | @@ -93,7 +83,7 @@ public class ZnddThread extends Thread{ | ||
| 93 | 83 | ||
| 94 | } | 84 | } |
| 95 | //满载 | 85 | //满载 |
| 96 | - public void MZ(){ | 86 | + /* public void MZ(){ |
| 97 | try { | 87 | try { |
| 98 | StringBuilder sb = HttpClientUtils.get(url); | 88 | StringBuilder sb = HttpClientUtils.get(url); |
| 99 | List<Object> list = JSONArray.parseArray(String.valueOf(sb)); | 89 | List<Object> list = JSONArray.parseArray(String.valueOf(sb)); |
| @@ -124,7 +114,7 @@ public class ZnddThread extends Thread{ | @@ -124,7 +114,7 @@ public class ZnddThread extends Thread{ | ||
| 124 | }catch (Exception e){ | 114 | }catch (Exception e){ |
| 125 | logger.error("满载检测接口出错-----------",e); | 115 | logger.error("满载检测接口出错-----------",e); |
| 126 | } | 116 | } |
| 127 | - } | 117 | + }*/ |
| 128 | public void ts(Map m) throws ParseException { | 118 | public void ts(Map m) throws ParseException { |
| 129 | //记录存一下 --超过当前时间的是否推送? | 119 | //记录存一下 --超过当前时间的是否推送? |
| 130 | String st = m.get("lineCode")+"_"+m.get("type")+"_"+m.get("rqStr"); | 120 | String st = m.get("lineCode")+"_"+m.get("type")+"_"+m.get("rqStr"); |
| @@ -185,7 +175,7 @@ public class ZnddThread extends Thread{ | @@ -185,7 +175,7 @@ public class ZnddThread extends Thread{ | ||
| 185 | */ | 175 | */ |
| 186 | 176 | ||
| 187 | //发车间隔 | 177 | //发车间隔 |
| 188 | - public void FCJG(){ | 178 | + /* public void FCJG(){ |
| 189 | try { | 179 | try { |
| 190 | //无数据情况下 查看发车间隔配置数据是否正常bsth_c_calc_interval | 180 | //无数据情况下 查看发车间隔配置数据是否正常bsth_c_calc_interval |
| 191 | List<CalcIntervalDetail> fcjgList = userCarCountHandler.calcLast(); | 181 | List<CalcIntervalDetail> fcjgList = userCarCountHandler.calcLast(); |
| @@ -207,7 +197,7 @@ public class ZnddThread extends Thread{ | @@ -207,7 +197,7 @@ public class ZnddThread extends Thread{ | ||
| 207 | }catch (Exception e){ | 197 | }catch (Exception e){ |
| 208 | logger.error("发车间隔检测出现出错-----------",e); | 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,8 +7,6 @@ import com.bsth.data.gpsdata_v2.entity.GpsEntity; | ||
| 7 | import com.bsth.data.safe_driv.SafeDriv; | 7 | import com.bsth.data.safe_driv.SafeDriv; |
| 8 | import com.bsth.entity.directive.D80; | 8 | import com.bsth.entity.directive.D80; |
| 9 | import com.bsth.entity.realcontrol.ScheduleRealInfo; | 9 | import com.bsth.entity.realcontrol.ScheduleRealInfo; |
| 10 | -import com.bsth.entity.zndd.StationPeople; | ||
| 11 | -import com.bsth.entity.zndd.StationPeopleLogger; | ||
| 12 | import com.bsth.websocket.dto.WsScheduleRealInfo; | 10 | import com.bsth.websocket.dto.WsScheduleRealInfo; |
| 13 | import com.fasterxml.jackson.core.JsonProcessingException; | 11 | import com.fasterxml.jackson.core.JsonProcessingException; |
| 14 | import com.fasterxml.jackson.databind.ObjectMapper; | 12 | import com.fasterxml.jackson.databind.ObjectMapper; |