Commit 2cabed9cf9e7c88b9872d8d1543ebfb61774a909

Authored by 廖磊
2 parents a84e0f07 27b10d29

Merge branch 'minhang' of

http://222.66.0.204:8090/panzhaov5/bsth_control into minhang
src/main/java/com/bsth/controller/realcontrol/anomalyCheckController.java
1 1 package com.bsth.controller.realcontrol;
2 2  
  3 +import com.bsth.data.gpsdata.arrival.GeoCacheData;
3 4 import com.bsth.data.gpsdata.arrival.GpsRealAnalyse;
4 5 import com.bsth.data.gpsdata.thread.GpsDataLoaderThread;
5 6 import com.bsth.data.msg_queue.DirectivePushQueue;
... ... @@ -30,6 +31,10 @@ public class anomalyCheckController {
30 31  
31 32 @Autowired
32 33 DayOfSchedule dayOfSchedule;
  34 +
  35 + @Autowired
  36 + GeoCacheData geoCacheData;
  37 +
33 38 /**
34 39 * 出现重复班次的车辆
35 40 * @param nbbm
... ... @@ -75,4 +80,9 @@ public class anomalyCheckController {
75 80 return;
76 81 GpsDataLoaderThread.setFlag(flag);
77 82 }
  83 +
  84 + @RequestMapping(value = "/updateCacheBuff")
  85 + public void updateCacheBuff(){
  86 + geoCacheData.loadData();
  87 + }
78 88 }
... ...
src/main/java/com/bsth/data/BasicData.java
... ... @@ -274,22 +274,23 @@ public class BasicData implements CommandLineRunner {
274 274 * 加载运管处的站点及序号
275 275 * 上行从1开始,下行顺序续编
276 276 */
277   - List<Object[]> ygcLines = stationRouteRepository.findAllLineWithYgc();
  277 + List<Map<String, String>> ygcLines = stationRouteRepository.findAllLineWithYgc();
278 278 if(ygcLines != null && ygcLines.size() > 0){
279 279 int size = ygcLines.size();
280   - Object[] tempArray ;
  280 + Map<String, String> tempMap ;
281 281 int num = 1;
282 282 String key;
283 283 String lineCode = "";
284 284 for (int i = 0; i < size; i ++){
285   - tempArray = ygcLines.get(i);
  285 + tempMap = ygcLines.get(i);
286 286 if(lineCode.equals("")){
287   - lineCode = tempArray[0]+"";
288   - }else if(!lineCode.equals(tempArray[0]+"")){
  287 + lineCode = tempMap.get("lineCode");
  288 + }else if(!lineCode.equals(tempMap.get("lineCode"))){
289 289 num = 1;
290   - lineCode = tempArray[0]+"";
  290 + lineCode = tempMap.get("lineCode");
291 291 }
292   - key = tempArray[0] + "_"+tempArray[1] + "_"+tempArray[3];
  292 + key = tempMap.get("lineCode") + "_"+String.valueOf(tempMap.get("directions"))
  293 + + "_"+tempMap.get("stationCode")+ "_"+tempMap.get("stationMark");
293 294 tempStationName2YgcNumber.put(key,num++);
294 295 }
295 296 }
... ...
src/main/java/com/bsth/data/gpsdata/arrival/utils/SignalSchPlanMatcher.java
... ... @@ -46,6 +46,16 @@ public class SignalSchPlanMatcher {
46 46 return;
47 47 }
48 48 }
  49 +
  50 + //线路编码不匹配
  51 + if("out".equals(sch.getBcType()) && !sch.getXlBm().equals(outSigal.getLineId())){
  52 + ScheduleRealInfo nextOut = dayOfSchedule.nextByBcType(sch, "out");
  53 + if(nextOut != null && nextOut.getXlBm().equals(outSigal.getLineId())
  54 + && fcSpace(sch, outSigal) > fcSpace(nextOut, outSigal)){
  55 + dayOfSchedule.addExecPlan(nextOut);
  56 + return;
  57 + }
  58 + }
49 59 }catch (Exception e){
50 60 log.error("", e);
51 61 }
... ... @@ -63,4 +73,8 @@ public class SignalSchPlanMatcher {
63 73 outMatch(outSigal, next);
64 74 }
65 75 }
  76 +
  77 + public static int fcSpace(ScheduleRealInfo sch, GpsEntity gps){
  78 + return (int) Math.abs((sch.getDfsjT() - gps.getTimestamp()));
  79 + }
66 80 }
... ...
src/main/java/com/bsth/data/schedule/DayOfSchedule.java
... ... @@ -790,12 +790,13 @@ public class DayOfSchedule {
790 790  
791 791 boolean flag = false;
792 792 for(ScheduleRealInfo temp : list){
793   - if(temp == sch){
794   - flag = true;
795   - }
796 793  
797 794 if(flag && temp.getBcType().equals(bcType))
798 795 return temp;
  796 +
  797 + if(temp == sch){
  798 + flag = true;
  799 + }
799 800 }
800 801 return null;
801 802 }
... ...
src/main/java/com/bsth/repository/StationRouteRepository.java
... ... @@ -259,8 +259,9 @@ public interface StationRouteRepository extends BaseRepository&lt;StationRoute, Int
259 259 @Query("select s from StationRoute s where s.destroy=0 and s.lineCode=?1")
260 260 List<StationRoute> findByLineCode(String lineCode);
261 261  
262   - @Query("SELECT " +
263   - "lineCode,directions,stationName,stationCode " +
  262 + @Query("SELECT new map(" +
  263 + "lineCode as lineCode,directions as directions,stationName as stationName,stationCode as stationCode," +
  264 + "line.linePlayType as linePlayType,s.stationMark as stationMark) " +
264 265 "FROM " +
265 266 "StationRoute s " +
266 267 "WHERE " +
... ... @@ -268,7 +269,7 @@ public interface StationRouteRepository extends BaseRepository&lt;StationRoute, Int
268 269 "and s.lineCode in(select lineCode from Line where inUse = 1) " +
269 270 "ORDER BY " +
270 271 "lineCode,directions,stationRouteCode")
271   - List<Object[]> findAllLineWithYgc();
  272 + List<Map<String, String>> findAllLineWithYgc();
272 273  
273 274 @Modifying
274 275 @Query(value="update bsth_c_stationroute set directions = case directions when 1 then 0 when 0 then 1 end where line_code = ?1 ", nativeQuery=true)
... ...
src/main/java/com/bsth/service/impl/TrafficManageServiceImpl.java
... ... @@ -134,12 +134,19 @@ public class TrafficManageServiceImpl implements TrafficManageService{
134 134 * 上传线路信息
135 135 */
136 136 @Override
137   - public String setXL() {
  137 + public String setXL(Map<String, Object> param) {
138 138 String result = "failure";
139 139 StringBuffer sBuffer = new StringBuffer();
140 140 try {
141   - Iterator<Line> lineIterator = lineRepository.findAll().iterator();
  141 + Map<String,Object> map = new HashMap<String,Object>();
  142 + map.put("lineCode_eq", param.get("xl.lineCode_like")+"");
  143 + Iterator<Line> lineIterator;
142 144 Line line = null;
  145 + if(param.get("xl.lineCode_like").equals("")){
  146 + lineIterator = lineRepository.findAll().iterator();
  147 + }else {
  148 + line = lineRepository.findOne(new CustomerSpecs<Line>(map));
  149 + }
143 150 List<StationRoute> upStationsList = null;// 上行站点路由集
144 151 List<StationRoute> downStationsList = null;// 下行站点路由集
145 152 List<LineInformation> lineInformationsList = null;
... ... @@ -147,14 +154,15 @@ public class TrafficManageServiceImpl implements TrafficManageService{
147 154 sBuffer.append("<Data>");
148 155 sBuffer.append("<RequestOrg>上海巴士拓华科技发展有限公司</RequestOrg>");
149 156 sBuffer.append("<DataList>");
150   - while(lineIterator.hasNext()){
151   - line = lineIterator.next();
152   - if(!line.getName().equals("浦江4路")){
153   - continue;
154   - }
155   - if(BasicData.lineId2ShangHaiCodeMap.get(line.getId()) == null
  157 +// while(lineIterator.hasNext()){
  158 +// line = lineIterator.next();
  159 +// if(BasicData.lineId2ShangHaiCodeMap.get(line.getId()) == null
  160 +// || line.getInUse() == 0){
  161 +// continue;
  162 +// }
  163 + if(BasicData.lineId2ShangHaiCodeMap.get(line.getId()) == null
156 164 || line.getInUse() == 0){
157   - continue;
  165 + return result;
158 166 }
159 167 sBuffer.append("<LINE_ID>").append(line.getId()).append("</LINE_ID>");
160 168 sBuffer.append("<LINE_CODE>").append(BasicData.lineId2ShangHaiCodeMap.get(line.getId())).append("</LINE_CODE>");
... ... @@ -176,7 +184,7 @@ public class TrafficManageServiceImpl implements TrafficManageService{
176 184 startId = packagStationPointXml(upStationsList, sBuffer, startId);
177 185 packagStationPointXml(downStationsList, sBuffer, startId);
178 186 sBuffer.append("</LinePointList>");
179   - }
  187 +// }
180 188 sBuffer.append("</DataList>");
181 189 sBuffer.append("</Data>");
182 190 System.out.println(sBuffer.toString());
... ... @@ -301,6 +309,8 @@ public class TrafficManageServiceImpl implements TrafficManageService{
301 309 List<ScheduleRealInfo> list = scheduleRealInfoRepository.setLD(date);
302 310 List<Map<String,Object>> listGroup = scheduleRealInfoRepository.setLDGroup(date);
303 311 Map<String,Object> map = new HashMap<String,Object>();
  312 + HashMap<String,String> paramMap;
  313 + HashMap<String,String> otherMap = new HashMap<String, String>();
304 314 for(Map<String,Object> schRealInfo:listGroup){
305 315 if(schRealInfo != null){
306 316 //根据车辆自编号查询车牌号
... ... @@ -347,16 +357,20 @@ public class TrafficManageServiceImpl implements TrafficManageService{
347 357 sf.append("<SJGH>"+scheduleRealInfo.getjGh()+"</SJGH>");
348 358 sf.append("<SXX>"+scheduleRealInfo.getXlDir()+"</SXX>");
349 359 sf.append("<FCZDMC>"+scheduleRealInfo.getQdzName()+"</FCZDMC>");
350   - sf.append("<FCZDXH>" + getYgcStationNumByLineCodeAndDirectionAndStationName(
351   - scheduleRealInfo.getXlBm(), scheduleRealInfo.getXlDir(), scheduleRealInfo.getQdzCode()) + "</FCZDXH>");
  360 + // 起点站的参数
  361 + otherMap.put("stationMark","B");
  362 + paramMap = packageYgcStationNumParam(scheduleRealInfo,otherMap);
  363 + sf.append("<FCZDXH>" + getYgcStationNumByLineCodeAndDirectionAndStationName(paramMap) + "</FCZDXH>");
352 364 sf.append("<FCZDBM>"+scheduleRealInfo.getQdzCode()+"</FCZDBM>");
353 365 sf.append("<JHFCSJ>"+scheduleRealInfo.getFcsj()+"</JHFCSJ>");
354 366 sf.append("<DFSJ>"+scheduleRealInfo.getDfsj()+"</DFSJ>");
355 367 sf.append("<SJFCSJ>"+scheduleRealInfo.getFcsjActual()+"</SJFCSJ>");
356 368 sf.append("<FCZDLX>"+""+"</FCZDLX>");
357 369 sf.append("<DDZDMC>"+scheduleRealInfo.getZdzName()+"</DDZDMC>");
358   - sf.append("<DDZDXH>"+ getYgcStationNumByLineCodeAndDirectionAndStationName(
359   - scheduleRealInfo.getXlBm(), scheduleRealInfo.getXlDir(), scheduleRealInfo.getZdzCode()) +"</DDZDXH>");
  370 + // 终点站的参数
  371 + otherMap.put("stationMark","E");
  372 + paramMap = packageYgcStationNumParam(scheduleRealInfo,otherMap);
  373 + sf.append("<DDZDXH>"+ getYgcStationNumByLineCodeAndDirectionAndStationName(paramMap) +"</DDZDXH>");
360 374 sf.append("<DDZDBM>"+scheduleRealInfo.getZdzCode()+"</DDZDBM>");
361 375 sf.append("<JHDDSJ>"+scheduleRealInfo.getZdsj()+"</JHDDSJ>");
362 376 sf.append("<SJDDSJ>"+scheduleRealInfo.getZdsjActual()+"</SJDDSJ>");
... ... @@ -650,6 +664,8 @@ public class TrafficManageServiceImpl implements TrafficManageService{
650 664 List<SchedulePlanInfo> schedulePlanList = schedulePlanInfoRepository.findLineScheduleBc(tomorrow);
651 665 int j = 0; // 初始化标识
652 666 if(schedulePlanList != null ){
  667 + HashMap<String,String> paramMap;
  668 + HashMap<String,String> otherMap = new HashMap<String, String>();
653 669 int size = schedulePlanList.size();
654 670 for (int i = 0; i < size; i++) {
655 671 schedulePlanInfo = schedulePlanList.get(i);
... ... @@ -676,12 +692,16 @@ public class TrafficManageServiceImpl implements TrafficManageService{
676 692 sBuffer.append("<SJGH>").append(schedulePlanInfo.getjGh()).append("</SJGH>");
677 693 sBuffer.append("<SXX>").append(schedulePlanInfo.getXlDir()).append("</SXX>");
678 694 sBuffer.append("<FCZDMC>").append(schedulePlanInfo.getQdzName()).append("</FCZDMC>");
679   - sBuffer.append("<ZDXH>").append(getYgcStationNumByLineCodeAndDirectionAndStationName(
680   - schedulePlanInfo.getXlBm(), schedulePlanInfo.getXlDir(), schedulePlanInfo.getQdzCode())).append("</ZDXH>");
  695 + // 起点站的参数
  696 + otherMap.put("stationMark","B");
  697 + paramMap = packageYgcStationNumParam(schedulePlanInfo,otherMap);
  698 + sBuffer.append("<ZDXH>").append(getYgcStationNumByLineCodeAndDirectionAndStationName(paramMap)).append("</ZDXH>");
681 699 sBuffer.append("<JHFCSJ>").append(schedulePlanInfo.getFcsj()).append("</JHFCSJ>");
682 700 sBuffer.append("<DDZDMC>").append(schedulePlanInfo.getZdzName()).append("</DDZDMC>");
683   - sBuffer.append("<DDXH>").append(getYgcStationNumByLineCodeAndDirectionAndStationName(
684   - schedulePlanInfo.getXlBm(), schedulePlanInfo.getXlDir(), schedulePlanInfo.getZdzCode())).append("</DDXH>");
  701 + // 起点站的参数
  702 + otherMap.put("stationMark","E");
  703 + paramMap = packageYgcStationNumParam(schedulePlanInfo,otherMap);
  704 + sBuffer.append("<DDXH>").append(getYgcStationNumByLineCodeAndDirectionAndStationName(paramMap)).append("</DDXH>");
685 705 sBuffer.append("<JHDDSJ>").append(calcDdsj(schedulePlanInfo.getFcsj(),schedulePlanInfo.getBcsj()))
686 706 .append("</JHDDSJ>");
687 707 sBuffer.append("</BC>");
... ... @@ -743,6 +763,8 @@ public class TrafficManageServiceImpl implements TrafficManageService{
743 763 HashMap<String,Object> param = new HashMap<String, Object>();
744 764 String lineCode ;
745 765 sBuffer.append("<SKBs>");
  766 + HashMap<String,String> paramMap;
  767 + HashMap<String,String> otherMap = new HashMap<String, String>();
746 768 for (int i = 0; i < idArray.length; i++) {
747 769 ttInfo = ttInfoRepository.findOne(Long.valueOf(idArray[i]));
748 770 if(ttInfo == null)
... ... @@ -783,12 +805,16 @@ public class TrafficManageServiceImpl implements TrafficManageService{
783 805 sBuffer.append("<LPBH>").append(ttInfoDetail.getLp().getLpNo()).append("</LPBH>");
784 806 sBuffer.append("<SXX>").append(ttInfoDetail.getXlDir()).append("</SXX>");
785 807 sBuffer.append("<FCZDMC>").append(ttInfoDetail.getQdz().getStationName()).append("</FCZDMC>");
786   - sBuffer.append("<ZDXH>").append(getYgcStationNumByLineCodeAndDirectionAndStationName(
787   - lineCode, ttInfoDetail.getXlDir(), ttInfoDetail.getQdz().getStationCod())).append("</ZDXH>");
  808 + // 起点站的参数
  809 + otherMap.put("stationMark","B");
  810 + paramMap = packageYgcStationNumParam(ttInfoDetail,otherMap);
  811 + sBuffer.append("<ZDXH>").append(getYgcStationNumByLineCodeAndDirectionAndStationName(paramMap)).append("</ZDXH>");
788 812 sBuffer.append("<JHFCSJ>").append(changeTimeFormat(ttInfoDetail)).append("</JHFCSJ>");
789 813 sBuffer.append("<DDZDMC>").append(ttInfoDetail.getZdz().getStationName()).append("</DDZDMC>");
790   - sBuffer.append("<DDXH>").append(getYgcStationNumByLineCodeAndDirectionAndStationName(
791   - lineCode, ttInfoDetail.getXlDir(), ttInfoDetail.getZdz().getStationCod())).append("</DDXH>");
  814 + // 起点站的参数
  815 + otherMap.put("stationMark","E");
  816 + paramMap = packageYgcStationNumParam(ttInfoDetail,otherMap);
  817 + sBuffer.append("<DDXH>").append(getYgcStationNumByLineCodeAndDirectionAndStationName(paramMap)).append("</DDXH>");
792 818 sBuffer.append("<JHDDSJ>").append(calcDdsj(ttInfoDetail.getFcsj(),ttInfoDetail.getBcsj())).append("</JHDDSJ>");
793 819 sBuffer.append("</BC>");
794 820 }
... ... @@ -1136,6 +1162,7 @@ public class TrafficManageServiceImpl implements TrafficManageService{
1136 1162 private int packagStationXml(List<StationRoute> stationsList,StringBuffer sBuffer,int startId){
1137 1163 int size = stationsList.size();
1138 1164 StationRoute srRoute;
  1165 + HashMap<String,String> paraMap;
1139 1166 String zdlx ;// 站点类型:0:起点站、1:终点站、2:中途站
1140 1167 for (int i = 0; i < size; i++) {
1141 1168 srRoute = stationsList.get(i);
... ... @@ -1147,10 +1174,11 @@ public class TrafficManageServiceImpl implements TrafficManageService{
1147 1174 }else{
1148 1175 zdlx = "2";
1149 1176 }
  1177 + paraMap = packageYgcStationNumParam(srRoute,null);
1150 1178 sBuffer.append("<Station>");
1151   - sBuffer.append("<STATION_ID>").append(getYgcStationNumByLineCodeAndDirectionAndStationName(srRoute.getLineCode(),srRoute.getDirections()+"",srRoute.getStationCode())).append("</STATION_ID>");
  1179 + sBuffer.append("<STATION_ID>").append(getYgcStationNumByLineCodeAndDirectionAndStationName(paraMap)).append("</STATION_ID>");
1152 1180 sBuffer.append("<UPDDOWN>").append(srRoute.getDirections()).append("</UPDDOWN>");
1153   - sBuffer.append("<STATION_NO>").append(getYgcStationNumByLineCodeAndDirectionAndStationName(srRoute.getLineCode(),srRoute.getDirections()+"",srRoute.getStationCode())).append("</STATION_NO>");
  1181 + sBuffer.append("<STATION_NO>").append(i).append("</STATION_NO>");
1154 1182 sBuffer.append("<STATION_CODE>").append(srRoute.getStationCode()).append("</STATION_CODE>");
1155 1183 sBuffer.append("<STATION_NAME>").append(srRoute.getStationName()).append("</STATION_NAME>");
1156 1184 sBuffer.append("<STATION_LON>").append(srRoute.getStation().getgLonx()).append("</STATION_LON>");
... ... @@ -1173,6 +1201,7 @@ public class TrafficManageServiceImpl implements TrafficManageService{
1173 1201 private int packagStationPointXml(List<StationRoute> stationsList,StringBuffer sBuffer,int startId){
1174 1202 int size = stationsList.size();
1175 1203 StationRoute srRoute;
  1204 + HashMap<String,String> paraMap;
1176 1205 String zdlx ;// 站点类型:0:起点站、1:终点站、2:中途站
1177 1206 for (int i = 0; i < size; i++) {
1178 1207 srRoute = stationsList.get(i);
... ... @@ -1184,8 +1213,9 @@ public class TrafficManageServiceImpl implements TrafficManageService{
1184 1213 }else{
1185 1214 zdlx = "2";
1186 1215 }
  1216 + paraMap = packageYgcStationNumParam(srRoute,null);
1187 1217 sBuffer.append("<Point>");
1188   - sBuffer.append("<POINT_ID>").append(getYgcStationNumByLineCodeAndDirectionAndStationName(srRoute.getLineCode(),srRoute.getDirections()+"",srRoute.getStationCode())).append("</POINT_ID>");
  1218 + sBuffer.append("<POINT_ID>").append(getYgcStationNumByLineCodeAndDirectionAndStationName(paraMap)).append("</POINT_ID>");
1189 1219 sBuffer.append("<UPDDOWN>").append(srRoute.getDirections()).append("</UPDDOWN>");
1190 1220 sBuffer.append("<POINTLON>").append(srRoute.getStation().getgLonx()).append("</POINTLON>");
1191 1221 sBuffer.append("<POINTLAT>").append(srRoute.getStation().getgLaty()).append("</POINTLAT>");
... ... @@ -1196,15 +1226,94 @@ public class TrafficManageServiceImpl implements TrafficManageService{
1196 1226 }
1197 1227  
1198 1228 /**
1199   - *
1200   - * @param lineCode 线路编码
1201   - * @param direction 线路方向
1202   - * @param stationCode 让点名称
  1229 + * 获取运管处站点序号
  1230 + * @param map
1203 1231 * @return 运管处站点序号
1204 1232 */
1205   - private Integer getYgcStationNumByLineCodeAndDirectionAndStationName(String lineCode,String direction,String stationCode){
1206   - Integer number = 0;
1207   - number = BasicData.stationName2YgcNumber.get(lineCode+"_"+direction+"_"+stationCode);
  1233 + private Integer getYgcStationNumByLineCodeAndDirectionAndStationName(HashMap<String,String> map){
  1234 + // 线路编码
  1235 + String lineCode = map.get("lineCode");
  1236 + // 线路走向 0:上行 1:下行
  1237 + String direction = map.get("direction");
  1238 + // 站点编码
  1239 + String stationCode = map.get("stationCode");
  1240 + // 站点类型:B:起点站 Z:中途站 E:终点站 T:停车场
  1241 + String stationMark = map.get("stationMark");
  1242 + String[] marks = null;
  1243 + // 起点站,先从起点找,找不到再从中途站找,最后从终点找
  1244 + if(stationMark.equals("B")){
  1245 + marks= new String[]{"B","Z","E"};
  1246 + }else if(stationMark.equals("E")){// 终点站相反
  1247 + marks= new String[]{"E","Z","B"};
  1248 + }else if(stationMark.equals("Z")){
  1249 + marks= new String[]{"Z"};
  1250 + }
  1251 + Integer number = null;
  1252 + for (int i = 0 ;i < marks.length ; i ++){
  1253 + number = BasicData.stationName2YgcNumber.get(lineCode+"_"+direction+"_"+stationCode+"_"+marks[i]);
  1254 + if(number != null){
  1255 + break;
  1256 + }
  1257 + }
1208 1258 return number == null ? 0 : number;
1209 1259 }
  1260 +
  1261 + /**
  1262 + * 封装查询站序条件
  1263 + * @param obj
  1264 + * @return
  1265 + */
  1266 + private HashMap packageYgcStationNumParam(Object obj,HashMap<String,String> otherParam){
  1267 + HashMap<String,String> map = new HashMap<String,String>();
  1268 + String lineCode = "",direction = "",stationCode = "",stationMark = "";
  1269 + // 站点路由
  1270 + if(obj instanceof StationRoute){
  1271 + StationRoute sr = (StationRoute)obj;
  1272 + lineCode = sr.getLineCode();
  1273 + direction = String.valueOf(sr.getDirections());
  1274 + stationCode = sr.getStationCode();
  1275 + stationMark = sr.getStationMark();
  1276 + }else if(obj instanceof ScheduleRealInfo){ //实际排班计划明细。
  1277 + ScheduleRealInfo sri = (ScheduleRealInfo)obj;
  1278 + lineCode = sri.getXlBm();
  1279 + direction = sri.getXlDir();
  1280 + if(otherParam != null && otherParam.get("stationMark") != null){
  1281 + stationMark = otherParam.get("stationMark");
  1282 + if(stationMark.equals("B")){ // 起点站
  1283 + stationCode = sri.getQdzCode();
  1284 + }else if(stationMark.equals("E")){ // 终点站
  1285 + stationCode = sri.getZdzCode();
  1286 + }
  1287 + }
  1288 + }else if(obj instanceof SchedulePlanInfo){ //排班计划明细
  1289 + SchedulePlanInfo spi = (SchedulePlanInfo)obj;
  1290 + lineCode = spi.getXlBm();
  1291 + direction = spi.getXlDir();
  1292 + if(otherParam != null && otherParam.get("stationMark") != null){
  1293 + stationMark = otherParam.get("stationMark");
  1294 + if(stationMark.equals("B")){ // 起点站
  1295 + stationCode = spi.getQdzCode();
  1296 + }else if(stationMark.equals("E")){ // 终点站
  1297 + stationCode = spi.getZdzCode();
  1298 + }
  1299 + }
  1300 + }else if(obj instanceof TTInfoDetail){ //时刻表明细
  1301 + TTInfoDetail ttid = (TTInfoDetail)obj;
  1302 + lineCode = ttid.getXl().getLineCode();
  1303 + direction = ttid.getXlDir();
  1304 + if(otherParam != null && otherParam.get("stationMark") != null){
  1305 + stationMark = otherParam.get("stationMark");
  1306 + if(stationMark.equals("B")){ // 起点站
  1307 + stationCode = ttid.getQdz().getStationCod();
  1308 + }else if(stationMark.equals("E")){ // 终点站
  1309 + stationCode = ttid.getZdz().getStationCod();
  1310 + }
  1311 + }
  1312 + }
  1313 + map.put("lineCode",lineCode);// 站点编码
  1314 + map.put("direction",direction); // 上下行
  1315 + map.put("stationCode",stationCode); // 站点编号
  1316 + map.put("stationMark",stationMark); // 站点类型
  1317 + return map;
  1318 + }
1210 1319 }
... ...
src/main/java/com/bsth/util/ReportUtils.java
... ... @@ -47,10 +47,12 @@ public class ReportUtils {
47 47 POIFSFileSystem fs = new POIFSFileSystem(new FileInputStream(
48 48 sourcePath));
49 49 HSSFWorkbook wb = new HSSFWorkbook(fs);
50   - Map<String, Object> m = (Map<String, Object>)tArray[0];
51   - if(m.containsKey("sheetName") && m.get("sheetName")!=null
52   - && m.get("sheetName").toString().trim().length()!=0)
53   - wb.setSheetName(0, m.get("sheetName").toString());
  50 + if(tArray.length != 0 && tArray[0] instanceof java.util.Map){
  51 + Map<String, Object> m = (Map<String, Object>)tArray[0];
  52 + if(m.containsKey("sheetName") && m.get("sheetName")!=null
  53 + && m.get("sheetName").toString().trim().length()!=0)
  54 + wb.setSheetName(0, m.get("sheetName").toString());
  55 + }
54 56 HSSFSheet sheet = wb.getSheetAt(0);
55 57 HSSFRow row;
56 58 HSSFCell cell = null;
... ...
src/main/resources/fatso/handle_real_ctl.js
... ... @@ -17,7 +17,7 @@ var pName = &#39;bsth_control&#39;
17 17 , path = process.cwd()
18 18 //根目录
19 19 , root = path.substr(0, path.indexOf(separator + 'src'+separator+'main'))
20   - , workspace = root.substr(0, root.indexOf(separator + pName))
  20 + , workspace = root.substr(0, root.lastIndexOf(separator + pName))
21 21 //临时目录
22 22 , dest = (workspace + separator + pName + '@fatso_copy')//.replace(/\//g, '\\')
23 23 , _static = separator + 'src'+separator+'main'+separator+'resources'+separator+'static';
... ...
src/main/resources/fatso/start.js
... ... @@ -22,7 +22,7 @@ var excludes = [&#39;scheduleApp&#39;, &#39;trafficManage&#39;, &#39;control&#39;]
22 22 ,path = process.cwd()
23 23 //根目录
24 24 ,root = path.substr(0, path.indexOf(separator + 'src'+separator+'main'))
25   - ,workspace = root.substr(0, root.indexOf(separator + pName))
  25 + ,workspace = root.substr(0, root.lastIndexOf(separator + pName))
26 26 //临时目录
27 27 ,dest = (workspace + separator + pName+'@fatso_copy')
28 28 ,_static = separator + 'src'+separator+'main'+separator+'resources'+separator+'static'
... ...
src/main/resources/static/real_control_v2/fragments/home/tooltip.html
... ... @@ -19,6 +19,9 @@
19 19 </a>
20 20 </div>
21 21 <div>
  22 + <span class="field">车牌号:</span>{{plateNo}}
  23 + </div>
  24 + <div>
22 25 <span class="field">站点:</span>{{stationName}}
23 26 </div>
24 27 <!-- <div>
... ... @@ -56,6 +59,9 @@
56 59 </a>
57 60 </div>
58 61 <div>
  62 + <span class="field">车牌号:</span>{{gps.plateNo}}
  63 + </div>
  64 + <div>
59 65 <span class="field">站点:</span>{{gps.stationName}}
60 66 </div>
61 67 <div>
... ...
src/main/resources/static/real_control_v2/js/utils/svg_chart_tooltip.js
... ... @@ -13,6 +13,7 @@ var gb_svg_tooltip = (function () {
13 13 if (rect.attr('aria-describedby'))
14 14 return;
15 15 var gps = gb_data_gps.findOne($(this).attr('_id').split('_')[1]);
  16 + addPlateNo(gps);
16 17 $(this).qtip({
17 18 show: {
18 19 ready: true,
... ... @@ -70,6 +71,7 @@ var gb_svg_tooltip = (function () {
70 71 },
71 72 content: {
72 73 text: function () {
  74 + addPlateNo(gpsArray);
73 75 return temps['tooltip_multi_gps_temp']({list: gpsArray});
74 76 }
75 77 },
... ... @@ -190,6 +192,7 @@ var gb_svg_tooltip = (function () {
190 192 */
191 193 var refreshTooltip = function (deviceId, wrap) {
192 194 var gps = gb_data_gps.findOne(deviceId);
  195 + addPlateNo(gps);
193 196  
194 197 var cont = temps['tooltip_gps_temp'](gps);
195 198 var htmlStr = $(cont).find('.cont-text-panel').html();
... ... @@ -201,6 +204,21 @@ var gb_svg_tooltip = (function () {
201 204 //console.log('refreshTooltip htmlStr', htmlStr, wrap);
202 205 };
203 206  
  207 + /**
  208 + * 为GPS附加车牌号
  209 + * @param gpsArray
  210 + */
  211 + function addPlateNo(gpsArray) {
  212 + if (!isArray(gpsArray))
  213 + gpsArray = [gpsArray];
  214 + try {
  215 + $.each(gpsArray, function () {
  216 + if(!this.plateNo)
  217 + this.plateNo = gb_data_basic.nbbm2PlateMap()[this.nbbm];
  218 + });
  219 + }catch (e){}
  220 + }
  221 +
204 222 return {
205 223 update: updateFixedTip,
206 224 refresh: refresh,
... ...
src/main/resources/static/real_control_v2/mapmonitor/fragments/playback_v2/main.html
... ... @@ -1021,7 +1021,7 @@
1021 1021 //从localStorage 获取路段
1022 1022 routes = JSON.parse(storage.getItem(lineCode + '_route'));
1023 1023 routes = [routes.up_bd, routes.down_bd];
1024   - switchPolyline(lineCode, updown);
  1024 + switchPolyline(updown);
1025 1025 };
1026 1026 return {
1027 1027 initData: initData,
... ...