Commit 975edcaa23d9a35d14241c6c0905b1665081f916

Authored by 廖磊
2 parents 8cbd28e9 f7e6c71a

Merge branch 'pudong' of http://222.66.0.204:8090/panzhaov5/bsth_control

into pudong
Showing 23 changed files with 481 additions and 494 deletions
src/main/java/com/bsth/XDApplication.java
... ... @@ -160,7 +160,7 @@ public class XDApplication implements CommandLineRunner {
160 160  
161 161 /** 线调业务 */
162 162 sexec.scheduleWithFixedDelay(scheduleRefreshThread, 10, 120, TimeUnit.SECONDS);//班次更新线程
163   - sexec.scheduleWithFixedDelay(scheduleLateThread, 140, 30, TimeUnit.SECONDS);//检查班次误点
  163 + sexec.scheduleWithFixedDelay(scheduleLateThread, 140, 20, TimeUnit.SECONDS);//检查班次误点
164 164 sexec.scheduleWithFixedDelay(gpsDataLoader, 100, 2, TimeUnit.SECONDS);//抓取GPS数据
165 165 sexec.scheduleWithFixedDelay(fixedCheckStationCodeThread, 60, 60 * 5, TimeUnit.SECONDS);//检查班次站点编码
166 166  
... ...
src/main/java/com/bsth/data/schedule/late_adjust/LateAdjustHandle.java
... ... @@ -15,8 +15,8 @@ import org.springframework.context.ApplicationContextAware;
15 15 import org.springframework.stereotype.Component;
16 16  
17 17 import java.util.Collection;
18   -import java.util.HashMap;
19   -import java.util.Map;
  18 +import java.util.concurrent.ConcurrentHashMap;
  19 +import java.util.concurrent.ConcurrentMap;
20 20  
21 21 /**
22 22 * 误点自动调整待发 处理程序
... ... @@ -35,7 +35,7 @@ public class LateAdjustHandle implements ApplicationContextAware {
35 35 /**
36 36 * 应发未到的班次 key : id
37 37 */
38   - private static Map<Long, ScheduleRealInfo> lateSchMap = new HashMap<>();
  38 + private static ConcurrentMap<Long, ScheduleRealInfo> lateSchMap = new ConcurrentHashMap<>();
39 39  
40 40  
41 41 /**
... ... @@ -60,8 +60,10 @@ public class LateAdjustHandle implements ApplicationContextAware {
60 60 //班次压入
61 61 if (!lateSchMap.containsKey(sch.getId())) {
62 62 logger.info("29【应发未到 班次 " + sch.getClZbh() + " -" + sch.getDfsj() + " -id: " + sch.getId() + " -加入误点调整!");
63   - //通知客户端
  63 +
64 64 sch.setLate2(true);
  65 + lateSchMap.put(sch.getId(), sch);
  66 + //通知客户端
65 67 sendUtils.sendAutoWdtz(sch, null);
66 68 }
67 69 }
... ... @@ -107,8 +109,18 @@ public class LateAdjustHandle implements ApplicationContextAware {
107 109 if (gps.getInstation() <= 0 || null == sch)
108 110 return;
109 111  
110   - if (!lateSchMap.containsKey(sch.getId()))
111   - return;
  112 + if (!lateSchMap.containsKey(sch.getId())) {
  113 + //班次是否误点(可能处于误点线程扫描的空隙,所以再判定一次)
  114 + if (sch.getDfsjT() <= gps.getTimestamp()) {
  115 + putLate(sch);
  116 +
  117 + if (!lateSchMap.containsKey(sch.getId()))
  118 + return;
  119 +
  120 + logger.info("线程空隙漏掉的误点,id: " + sch.getId());
  121 + } else
  122 + return;
  123 + }
112 124  
113 125  
114 126 //可能是延迟信号,gps时间没有误点
... ...
src/main/java/com/bsth/repository/LsStationRouteRepository.java
1 1 package com.bsth.repository;
2 2  
3 3 import java.util.List;
  4 +import java.util.Map;
4 5  
5 6 import org.springframework.data.jpa.repository.EntityGraph;
6 7 import org.springframework.data.jpa.repository.Modifying;
... ... @@ -52,4 +53,21 @@ public interface LsStationRouteRepository extends BaseRepository&lt;LsStationRoute,
52 53 @Modifying
53 54 @Query(value="UPDATE bsth_c_ls_stationroute set destroy = 1 where line = ?1 and directions = ?2 and versions = ?3", nativeQuery=true)
54 55 public void batchDestroy(Integer sectionRouteLine, Integer directions, Integer versions);
  56 +
  57 + /**
  58 + * 按线路编码查询各站点的顺序号
  59 + * @param lineCode 线路编码
  60 + * @param lineVersion 版本号
  61 + * @return
  62 + */
  63 + @Query("SELECT new map(" +
  64 + "lineCode as lineCode,directions as directions,stationName as stationName,stationCode as stationCode," +
  65 + "line.linePlayType as linePlayType,s.stationMark as stationMark) " +
  66 + "FROM " +
  67 + "LsStationRoute s " +
  68 + "WHERE " +
  69 + "s.destroy = 0 AND s.lineCode = ?1 AND s.versions = ?2 " +
  70 + "ORDER BY " +
  71 + "lineCode,directions,stationRouteCode")
  72 + List<Map<String, String>> findLineWithLineCode4Ygc(String lineCode,Integer lineVersion);
55 73 }
... ...
src/main/java/com/bsth/service/gps/GpsServiceImpl.java
... ... @@ -743,11 +743,12 @@ public class GpsServiceImpl implements GpsService {
743 743 row.setHeight((short) (1.5 * 256));
744 744 row.createCell(0).setCellValue("序号");
745 745 row.createCell(1).setCellValue("车辆");
746   - row.createCell(2).setCellValue("所在道路");
747   - row.createCell(3).setCellValue("经度");
748   - row.createCell(4).setCellValue("纬度");
749   - row.createCell(5).setCellValue("时间");
750   - row.createCell(6).setCellValue("速度");
  746 + row.createCell(2).setCellValue("牌照号");
  747 + row.createCell(3).setCellValue("所在道路");
  748 + row.createCell(4).setCellValue("经度");
  749 + row.createCell(5).setCellValue("纬度");
  750 + row.createCell(6).setCellValue("时间");
  751 + row.createCell(7).setCellValue("速度");
751 752 //数据
752 753 DateTimeFormatter fmtHHmmss = DateTimeFormat.forPattern("HH:mm.ss"),
753 754 fmt = DateTimeFormat.forPattern("yyyyMMddHHmm");
... ... @@ -756,12 +757,13 @@ public class GpsServiceImpl implements GpsService {
756 757 gps = list.get(i);
757 758 row = sheet.createRow(i + 1);
758 759 row.createCell(0).setCellValue(i + 1);
759   - row.createCell(1).setCellValue(gps.getNbbm());
760   - row.createCell(2).setCellValue(gps.getSection_name());
761   - row.createCell(3).setCellValue(gps.getLon());
762   - row.createCell(4).setCellValue(gps.getLat());
763   - row.createCell(5).setCellValue(fmtHHmmss.print(gps.getTimestamp()));
764   - row.createCell(6).setCellValue(gps.getSpeed());
  760 + row.createCell(1).setCellValue(nbbm);
  761 + row.createCell(2).setCellValue(BasicData.nbbmCompanyPlateMap.get(nbbm));
  762 + row.createCell(3).setCellValue(gps.getSection_name());
  763 + row.createCell(4).setCellValue(gps.getLon());
  764 + row.createCell(5).setCellValue(gps.getLat());
  765 + row.createCell(6).setCellValue(fmtHHmmss.print(gps.getTimestamp()));
  766 + row.createCell(7).setCellValue(gps.getSpeed());
765 767 }
766 768  
767 769 st = st * 1000;
... ...
src/main/java/com/bsth/service/impl/StationRouteServiceImpl.java
... ... @@ -743,6 +743,7 @@ public class StationRouteServiceImpl extends BaseServiceImpl&lt;StationRoute, Integ
743 743 try {
744 744 // 获取线路ID
745 745 Integer lineId = map.get("lineId").equals("") ? 0 : Integer.parseInt(map.get("lineId").toString());
  746 + Integer fileVersions = map.get("fileVersions").equals("") ? 2 : Integer.parseInt(map.get("fileVersions").toString());// 没有输入就默认2
746 747 /** 查询线路信息 @param:<lineId:线路ID> */
747 748 Line line = lineRepository.findOne(lineId);
748 749 /** 查询线路信息下的站点路由信息 @param:<lineId:线路ID> */
... ... @@ -778,7 +779,7 @@ public class StationRouteServiceImpl extends BaseServiceImpl&lt;StationRoute, Integ
778 779 textStr = newTextFileToFTP(objects,lineId);/** 双向行单文件内容 @param:<objects:站点路由;lineId:线路ID>*/
779 780 else
780 781 resultMap.put("status","NOLinePlayType");// 线路无线路规划类型
781   - textStr = line.getName() + " " + "2" + "\r" + textStr;
  782 + textStr = line.getName() + " " + fileVersions + "\r" + textStr;
782 783 InputStream input = new ByteArrayInputStream(textStr.getBytes("gbk"));
783 784 /** 生成txt文件,上传ftp */
784 785 clientUtils.uploadFile(url, port, username, password, remotePath, textFileName, input);
... ...
src/main/java/com/bsth/service/impl/TrafficManageServiceImpl.java
... ... @@ -77,6 +77,10 @@ public class TrafficManageServiceImpl implements TrafficManageService{
77 77 @Autowired
78 78 private StationRouteRepository stationRouteRepository;
79 79  
  80 + // 历史站点路由repository
  81 + @Autowired
  82 + private LsStationRouteRepository lsStationRouteRepository;
  83 +
80 84 @Autowired
81 85 private SectionRepository sectionRepository;
82 86  
... ... @@ -944,6 +948,8 @@ public class TrafficManageServiceImpl implements TrafficManageService{
944 948 String result = "failure";
945 949 StringBuffer sBuffer = new StringBuffer();
946 950 DecimalFormat df = new DecimalFormat("######0.000");
  951 + Map<String,String> lsStationCode2NameMap;
  952 + Map<String, Integer> lsStationName2YgcNumber;
947 953 try {
948 954 String[] idArray = ids.split(",");
949 955 StringBuffer sBufferA ,sBufferB ,sBufferC ;
... ... @@ -960,10 +966,17 @@ public class TrafficManageServiceImpl implements TrafficManageService{
960 966 HashMap<String,String> paramMap;
961 967 HashMap<String,String> otherMap = new HashMap<>();
962 968 for (int i = 0; i < idArray.length; i++) {
963   - ttInfo = ttInfoRepository.findOne(Long.valueOf(idArray[i]));
  969 + long ttinfoId = Long.valueOf(idArray[i]);
  970 + ttInfo = ttInfoRepository.findOne(ttinfoId);
964 971 if(ttInfo == null)
965 972 continue;
966 973 ttinfoList.add(ttInfo); // 保存时刻表
  974 + // 得到时刻表版本号
  975 + int lineVersion = ttInfo.getLineVersion();
  976 + // 查询历史站点路由
  977 + lsStationCode2NameMap = getLsStationCode(ttInfo.getXl().getLineCode(),lineVersion);
  978 + // 查询历史站点路由
  979 + lsStationName2YgcNumber = getLsStationRoute(ttInfo.getXl().getLineCode(),lineVersion);
967 980 zlc = 0.0f;
968 981 yylc = 0.0f;
969 982 // 获得时刻表
... ... @@ -1007,19 +1020,19 @@ public class TrafficManageServiceImpl implements TrafficManageService{
1007 1020 sBufferC.append("<BC>");
1008 1021 sBufferC.append("<LPBH>").append(ttInfoDetail.getLp().getLpNo()).append("</LPBH>");
1009 1022 sBufferC.append("<SXX>").append(sxx).append("</SXX>");
1010   - sBufferC.append("<FCZDMC>").append(BasicData.stationCode2NameMap.get(ttInfoDetail.getXl().getLineCode()+"_"+ttInfoDetail.getXlDir()
  1023 + sBufferC.append("<FCZDMC>").append(lsStationCode2NameMap.get(ttInfoDetail.getXl().getLineCode()+"_"+ttInfoDetail.getXlDir()
1011 1024 +"_"+ttInfoDetail.getQdzCode())).append("</FCZDMC>");
1012 1025 // 起点站的参数
1013 1026 otherMap.put("stationMark","B");
1014 1027 paramMap = packageYgcStationNumParam(ttInfoDetail,otherMap);
1015   - sBufferC.append("<ZDXH>").append(getYgcStationNumByLineCodeAndDirectionAndStationName(paramMap,null)).append("</ZDXH>");
  1028 + sBufferC.append("<ZDXH>").append(getYgcStationNumByLineCodeAndDirectionAndStationName(paramMap,lsStationName2YgcNumber)).append("</ZDXH>");
1016 1029 sBufferC.append("<JHFCSJ>").append(changeTimeFormat(ttInfoDetail)).append("</JHFCSJ>");
1017   - sBufferC.append("<DDZDMC>").append(BasicData.stationCode2NameMap.get(ttInfoDetail.getXl().getLineCode()+"_"+ttInfoDetail.getXlDir()
  1030 + sBufferC.append("<DDZDMC>").append(lsStationCode2NameMap.get(ttInfoDetail.getXl().getLineCode()+"_"+ttInfoDetail.getXlDir()
1018 1031 +"_"+ttInfoDetail.getZdzCode())).append("</DDZDMC>");
1019 1032 // 起点站的参数
1020 1033 otherMap.put("stationMark","E");
1021 1034 paramMap = packageYgcStationNumParam(ttInfoDetail,otherMap);
1022   - sBufferC.append("<DDXH>").append(getYgcStationNumByLineCodeAndDirectionAndStationName(paramMap,null)).append("</DDXH>");
  1035 + sBufferC.append("<DDXH>").append(getYgcStationNumByLineCodeAndDirectionAndStationName(paramMap,lsStationName2YgcNumber)).append("</DDXH>");
1023 1036 sBufferC.append("<JHDDSJ>").append(calcDdsj(ttInfoDetail.getFcsj(),ttInfoDetail.getBcsj())).append("</JHDDSJ>");
1024 1037 sBufferC.append("</BC>");
1025 1038 // 0:上行;1:下行
... ... @@ -1520,4 +1533,51 @@ public class TrafficManageServiceImpl implements TrafficManageService{
1520 1533 map.put("stationMark",stationMark); // 站点类型
1521 1534 return map;
1522 1535 }
  1536 +
  1537 + /**
  1538 + * 取得历史站点编码和站点名称的对应关系
  1539 + * @return
  1540 + */
  1541 + private Map<String, String> getLsStationCode(String lineCode,int lineVersion){
  1542 + Map<String,Object> map = new HashMap<>();
  1543 + map.put("lineCode_eq", lineCode);
  1544 + map.put("versions_eq",lineVersion);
  1545 + LsStationRoute lsroute;
  1546 + Iterator<LsStationRoute> iterator = lsStationRouteRepository.findAll(new CustomerSpecs<LsStationRoute>(map)).iterator();
  1547 + Map<String, String> stationCode2Name = new HashMap<>();
  1548 + while (iterator.hasNext()) {
  1549 + lsroute = iterator.next();
  1550 + stationCode2Name.put(lsroute.getLineCode() + "_" + lsroute.getDirections() + "_" + lsroute.getStationCode(), lsroute.getStationName());
  1551 + }
  1552 + return stationCode2Name;
  1553 + }
  1554 +
  1555 + private Map<String, Integer> getLsStationRoute(String xlbm,int lineVersion){
  1556 + Map<String, Integer> tempStationName2YgcNumber = new HashMap<String, Integer>();
  1557 + /**
  1558 + * 加载运管处的站点及序号
  1559 + * 上行从1开始,下行顺序续编
  1560 + */
  1561 + List<Map<String, String>> ygcLines = lsStationRouteRepository.findLineWithLineCode4Ygc(xlbm,lineVersion);
  1562 + if(ygcLines != null && ygcLines.size() > 0){
  1563 + int size = ygcLines.size();
  1564 + Map<String, String> tempMap ;
  1565 + int num = 1;
  1566 + String key;
  1567 + String lineCode = "";
  1568 + for (int i = 0; i < size; i ++){
  1569 + tempMap = ygcLines.get(i);
  1570 + if(lineCode.equals("")){
  1571 + lineCode = tempMap.get("lineCode");
  1572 + }else if(!lineCode.equals(tempMap.get("lineCode"))){
  1573 + num = 1;
  1574 + lineCode = tempMap.get("lineCode");
  1575 + }
  1576 + key = tempMap.get("lineCode") + "_"+String.valueOf(tempMap.get("directions"))
  1577 + + "_"+tempMap.get("stationCode")+ "_"+tempMap.get("stationMark");
  1578 + tempStationName2YgcNumber.put(key,num++);
  1579 + }
  1580 + }
  1581 + return tempStationName2YgcNumber;
  1582 + }
1523 1583 }
... ...
src/main/resources/static/index.html
... ... @@ -630,7 +630,8 @@
630 630 <script
631 631 src="http://webapi.amap.com/maps?v=1.3&key=16cb1c5043847e09ef9edafdd77befda"
632 632 data-exclude=1></script>
633   -
  633 +<!-- echarts -->
  634 +<script src="/metronic_v4.5.4/plugins/echarts4/echarts.min.js"></script>
634 635 <script src="/real_control_v2/assets/plugins/perfect-scrollbar/perfect-scrollbar.jquery.js" merge="plugins"></script>
635 636  
636 637 </body>
... ...
src/main/resources/static/pages/base/geo_data_edit/js/search.js
... ... @@ -27,8 +27,8 @@ var gb_ct_search = function () {
27 27 });
28 28  
29 29 var searchComplete = function (e) {
30   - //console.log('e.wr', e);
31   - var htmlStr = template('geo_d_e_search_result-temp', {list: e.yr});
  30 + console.log('e.wr', e);
  31 + var htmlStr = template('geo_d_e_search_result-temp', {list: e.Br});
32 32 $('.ct_search_result').html(htmlStr);
33 33  
34 34 };
... ...
src/main/resources/static/pages/base/line/edit.html
... ... @@ -59,7 +59,7 @@
59 59 </label>
60 60 <div class="col-md-4">
61 61 <input type="text" class="form-control" name="lineCode" id="lineCodeInput"
62   - placeholder="线路编码">
  62 + placeholder="线路编码" readonly="readonly">
63 63 </div>
64 64 </div>
65 65 <!-- 线路编码 (* 必填项) END -->
... ...
src/main/resources/static/pages/base/line/js/line-edit-form.js
... ... @@ -236,7 +236,7 @@
236 236 // 表单序列化
237 237 var params = form.serializeJSON();
238 238 // 查询线路编码的顺延号
239   - $get('/line/all', {lineCode_prefixLike: params.lineCode},function(lineCode){
  239 + $get('/line/all', {lineCode_eq: params.lineCode},function(lineCode){
240 240 // 定义返回值的长度
241 241 var len = lineCode.length;
242 242 // 如果大于零,则已存在录入的线路编码;否则不存在
... ...
src/main/resources/static/pages/base/line/js/line-list-table.js
... ... @@ -338,30 +338,54 @@
338 338 layer.msg('请选中一条线路!');
339 339 return ;
340 340 }else {
341   - id = arrChk.data('id');
342   - lineName = arrChk.val();
343   - // 请求参数
344   - var params = {lineId:id};
345   - // 弹出正在加载层
346   - var index = layer.load(0);
347   - /** 生成线路行单 @pararm:<params:请求参数> */
348   - $post('/stationroute/usingSingle',params,function(data) {
349   - // 关闭弹出框
350   - layer.close(index);
351   - if(data.status=='SUCCESS') {
352   - // 弹出添加成功提示消息
353   - layer.msg('生成线路【'+ lineName +'】路单文件成功!');
354   - }else if(data.status=='ERROR'){
355   - // 弹出添加成功提示消息
356   - layer.msg('生成线路【'+ lineName +'】路单文件失败!');
357   - }else if(data.status=='NOTDATA') {
358   - // 弹出添加成功提示消息
359   - layer.msg('系统无线路【'+ lineName +'】的站点与路段信息!');
360   - }else if(data.status=='NOLinePlayType') {
361   - // 弹出添加成功提示消息
362   - layer.msg('无法识别【'+ lineName +'】的线路规划类型,请设置为双向/环线!');
363   - }
364   - });
  341 + layer.open({
  342 + id:1,
  343 + type: 1,
  344 + title: "线路文件版本号",
  345 + // skin:'layui-layer-rim',
  346 + area:['450px', 'auto'],
  347 +
  348 + content: '<div class="col-sm-12">'
  349 + +'<div class="input-group">'
  350 + +'<span class="input-group-addon"> 线路文件版本号 :</span>'
  351 + +'<input id="fileVersionsInput" type="text" class="form-control" placeholder="没有填写默认为2">'
  352 + +'</div>'
  353 + +'</div>',
  354 + btn:['确定','取消'],
  355 + btn1: function (index,layero) {
  356 + var fileVersions = $('#fileVersionsInput').val();
  357 + id = arrChk.data('id');
  358 + lineName = arrChk.val();
  359 + // 请求参数
  360 + var params = {lineId:id, fileVersions:fileVersions};
  361 + // 弹出正在加载层
  362 + var index = layer.load(0);
  363 + /** 生成线路行单 @pararm:<params:请求参数> */
  364 + $post('/stationroute/usingSingle',params,function(data) {
  365 + // 关闭弹出框
  366 + layer.close(index);
  367 + if(data.status=='SUCCESS') {
  368 + // 弹出添加成功提示消息
  369 + layer.msg('生成线路【'+ lineName +'】路单文件成功!');
  370 + }else if(data.status=='ERROR'){
  371 + // 弹出添加成功提示消息
  372 + layer.msg('生成线路【'+ lineName +'】路单文件失败!');
  373 + }else if(data.status=='NOTDATA') {
  374 + // 弹出添加成功提示消息
  375 + layer.msg('系统无线路【'+ lineName +'】的站点与路段信息!');
  376 + }else if(data.status=='NOLinePlayType') {
  377 + // 弹出添加成功提示消息
  378 + layer.msg('无法识别【'+ lineName +'】的线路规划类型,请设置为双向/环线!');
  379 + }
  380 + });
  381 + },
  382 + btn2:function (index,layero) {
  383 + layer.close(index);
  384 + }
  385 +
  386 + });
  387 +
  388 +
365 389 }
366 390 });
367 391 /** 生成路线(路段和站点) */
... ...
src/main/resources/static/pages/base/stationroute/edit.html
... ... @@ -190,7 +190,11 @@ $(&#39;#edit_station_mobal&#39;).on(&#39;editSelectMobal_show&#39;, function(e, map_,ajaxd,stati
190 190 fun.linePanlThree(addLine.id,data,add_direction_v);
191 191 });
192 192 fun.editMapStatusRemove();
193   - }
  193 + setTimeout(function () {
  194 + var stationArray = map_.getStationArray();
  195 + map_.openStationInfoWin(stationArray[editStationParmasObj.stationRouteId]);
  196 + },1000);
  197 + }
194 198 // 编辑表单元素
195 199 var form = $('#edit_station_form');
196 200 // 获取错误提示元素
... ... @@ -206,9 +210,9 @@ $(&#39;#edit_station_mobal&#39;).on(&#39;editSelectMobal_show&#39;, function(e, map_,ajaxd,stati
206 210 errorClass : 'help-block help-block-error',
207 211 focusInvalid : false,
208 212 rules : {
209   - 'zdmc' : { required : true,maxlength : 50,},// 站点名称 必填项
210   - 'stationName' : { required : true,maxlength : 50,},// 站点名称 必填项
211   - 'stationCod': {required : true,},// 站点编码 必填项
  213 + 'zdmc' : { required : true,maxlength : 50},// 站点名称 必填项
  214 + 'stationName' : { required : true,maxlength : 50},// 站点名称 必填项
  215 + 'stationCod': {required : true},// 站点编码 必填项
212 216 'directions' : {required : true,dirIs : true},// 站点方向 必填项 必填项
213 217 'stationRouteCode' : {isStart : true},// 站点序号
214 218 'stationMark' : {required : true},// 站点类型 必填项
... ...
src/main/resources/static/pages/base/stationroute/edit_select.html
... ... @@ -14,10 +14,6 @@
14 14 <button class="close" data-close="alert"></button>
15 15 站点名称为必填项
16 16 </div>
17   - <div class="alert alert-danger display-hide" id="serchrname">
18   - <button class="close" data-close="alert"></button>
19   - 系统无法生成,请选择其他方式新增
20   - </div>
21 17 <div class="form-group" id="formRequ">
22 18 <label class="col-md-3 control-label"><span class="required"> * </span>站点名称:</label>
23 19 <div class="col-md-9" id="errorInfo">
... ... @@ -29,10 +25,13 @@
29 25 <div class="col-md-9">
30 26 <div class="icheck-list">
31 27 <label>
32   - <input type="radio" class="icheck" name="editselect" value=0> 重新绘制位置
  28 + <input type="radio" class="icheck" name="editselect" value=0> 重新绘制为多边形
33 29 </label>
34 30 <label>
35   - <input type="radio" class="icheck" name="editselect" value=1 checked> 编辑原始位置
  31 + <input type="radio" class="icheck" name="editselect" value=1> 重新绘制为圆形
  32 + </label>
  33 + <label>
  34 + <input type="radio" class="icheck" name="editselect" value=2 checked> 编辑原始位置
36 35 </label>
37 36 </div>
38 37 </div>
... ... @@ -124,6 +123,19 @@ $(&#39;#edit_select_mobal&#39;).on(&#39;editSelectMobal_show&#39;, function(e, map_,drw,ajaxd,ed
124 123 map_.localtionPoint(editStationName+"公交站点");
125 124 fun.editMapStatus();
126 125 }else if(params.editselect==1){
  126 + WorldsBMap.localSearchFromAdreesToPoint(editStationName+"公交站点", function (Points) {
  127 + if (Points) {
  128 + Station.stationJwpoints = Points;
  129 + }
  130 + Station.stationShapesType = 'r';
  131 + Station.stationGPloyonGrid = null;
  132 + Station.stationRadius = 100;
  133 + editStationObj.setEitdStation(Station);
  134 + editStationObj.setEitdStationName(editStationName);
  135 + map_.editShapes(editStationObj);
  136 + });
  137 + fun.editMapStatus();
  138 + }else if(params.editselect==2){
127 139 editStationObj.setEitdStation(Station);
128 140 editStationObj.setEitdStationName(editStationName);
129 141 map_.clearMark();
... ...
src/main/resources/static/pages/base/stationroute/editsection.html
... ... @@ -110,6 +110,9 @@ $(&#39;#edit_section_mobal&#39;).on(&#39;editSectionMobal_show&#39;, function(e, map_,ajaxd,p,fu
110 110 ajaxd.getSectionRouteInfo(lineId,dir,function(data) {
111 111 fun.linePanlThree(lineId,data,dir);
112 112 });
  113 + setTimeout(function () {
  114 + map_.openSectionInfoWin(p);
  115 + },1000);
113 116 }
114 117 // 编辑表单元素
115 118 var form = $('#edit_section__form');
... ...
src/main/resources/static/pages/base/stationroute/js/stationroute-list-map.js
... ... @@ -24,9 +24,19 @@
24 24  
25 25 window.WorldsBMap = function () {
26 26  
27   - /** WorldsBMap 全局变量定义 mapBValue:地图对象;polygon:多边形;polyUpline:走向折线;circle:圆; road_win_show_p:信息窗口打开状态的路段,map_status:地图编辑状态,drawingManager:绘画工具*/
28   - var mapBValue = '',polygon = '', polyUpline = '', circle = '', iseditStatus = false, road_win_show_p = '', editPolyline = '', sectionArray = [], stationArray = new Map(),map_status = 0,
29   - drawingManager;
  27 + /** WorldsBMap 全局变量定义 mapBValue:地图对象; road_win_show_p:信息窗口打开状态的路段,
  28 + * sectionArray: 路段集合,stationArray: 站点集合
  29 + * map_status:地图编辑状态,drawingManager:绘画工具, topOverlay:置顶视图*/
  30 + var mapBValue = '', iseditStatus = false, road_win_show_p = '', editPolyline = '',
  31 + sectionArray = [], stationArray = new Map(),
  32 + map_status = 0,drawingManager,topOverlay;
  33 +
  34 + /**
  35 + * 编辑缓冲区
  36 + * stationMarkers: 站点图标集合
  37 + */
  38 + var editCircle, editPolygon, dragMarker, stationMarkers = new Map(),centerPoint;
  39 +
30 40 var styleOptions = {
31 41 strokeColor:"blue", //边线颜色。
32 42 fillColor:"blue", //填充颜色。当参数为空时,圆形将没有填充效果。
... ... @@ -34,7 +44,39 @@ window.WorldsBMap = function () {
34 44 strokeOpacity: 0.7, //边线透明度,取值范围0 - 1。
35 45 fillOpacity: 0.6, //填充的透明度,取值范围0 - 1。
36 46 strokeStyle: 'solid' //边线的样式,solid或dashed。
37   - }
  47 + };
  48 +
  49 + // 覆盖物置顶
  50 + var setTop = function(overlay) {
  51 + if (topOverlay)
  52 + topOverlay.setTop(false);
  53 + overlay.setTop(true);
  54 + topOverlay = overlay;
  55 + };
  56 +
  57 + var setDragMarker = function (marker) {
  58 + marker.enableDragging();
  59 + dragMarker = marker;
  60 + dragMarker._old_point = dragMarker._position;
  61 + //监听拖拽事件 dragging
  62 + dragMarker.addEventListener('dragging', dragMarkerDragEvent);
  63 + };
  64 +
  65 + var dragMarkerDragEvent = function (e) {
  66 + if (editPolygon) {
  67 + if (!BMapLib.GeoUtils.isPointInPolygon(e.target._position, editPolygon))
  68 + dragMarker.setPosition(dragMarker._old_point);//还原位置
  69 +
  70 + centerPoint = e.target._position;
  71 + }
  72 + else if (editCircle) {
  73 + editCircle.disableEditing();
  74 + //缓冲区跟随点位运动
  75 + editCircle.setCenter(e.target._position);
  76 + editCircle.enableEditing();
  77 + centerPoint = e.target._position;
  78 + }
  79 + };
38 80  
39 81 var Bmap = {
40 82  
... ... @@ -44,7 +86,7 @@ window.WorldsBMap = function () {
44 86 // 百度API Key
45 87 var bdKey = 'IGGrr4UjwIYzatoCRFKEL8sT';
46 88 // 初始化百度地图
47   - mapBValue = new BMap.Map("bmap_basic");
  89 + mapBValue = new BMap.Map("bmap_basic" , {enableMapClick: false});
48 90 //中心点和缩放级别
49 91 mapBValue.centerAndZoom(new BMap.Point(CENTER_POINT.lng, CENTER_POINT.lat), 15);
50 92 //启用地图拖拽事件,默认启用(可不写)
... ... @@ -62,24 +104,21 @@ window.WorldsBMap = function () {
62 104 getmapBValue: function () {
63 105 return mapBValue;
64 106 },
65   - getPolygon: function () {
66   - return polygon;
67   - },
68   - getPolyUpline: function () {
69   - return polyUpline;
70   - },
71   - getCircle: function () {
72   - return circle;
  107 + setMap_status : function (i) {
  108 + map_status = i;
73 109 },
74 110 getIsEditStatus: function () {
75 111 return iseditStatus;
76 112 },
77   - setMap_status : function (i) {
78   - map_status = i;
79   - },
80 113 setIsEditStatus: function (v) {
81 114 iseditStatus = v;
82 115 },
  116 + getStationArray: function () {
  117 + return stationArray;
  118 + },
  119 + setStationArray : function (s) {
  120 + stationArray = s;
  121 + },
83 122 /*initDrawingManager: function (map, styleOptions) {
84 123 },*/
85 124 getDrawingManagerObj: function () {
... ... @@ -100,59 +139,35 @@ window.WorldsBMap = function () {
100 139  
101 140 /** 获取距离与时间 @param <points:坐标点集合> */
102 141 getDistanceAndDuration: function (points, callback) {
103   -
104 142 // 获取长度
105 143 var len = points.length;
106   -
107 144 (function () {
108   -
109 145 if (!arguments.callee.count) {
110   -
111 146 arguments.callee.count = 0;
112   -
113 147 }
114   -
115 148 arguments.callee.count++;
116   -
117 149 var index = parseInt(arguments.callee.count) - 1;
118   -
119 150 if (index >= len - 1) {
120   -
121 151 callback && callback(points);
122   -
123 152 return;
124 153 }
125   -
126 154 // 当函数被调用时,它的arguments.callee对象就会指向自身,也就是一个对自己的引用。(当前正在执行的函数。)
127 155 var f = arguments.callee;
128   -
129 156 // 起点坐标 <坐标格式:40.056878,116.30815>
130 157 var origin = points[index].potion.lat + ',' + points[index].potion.lng;
131   -
132 158 // 终点坐标 <坐标格式:40.056878,116.30815>
133 159 var destination = points[index + 1].potion.lat + ',' + points[index + 1].potion.lng;
134   -
135 160 var region = '上海';
136   -
137 161 var origin_region = '上海';
138   -
139 162 var destination_region = '上海';
140   -
141 163 var output = 'json';
142   -
143 164 var ak_My = 'wjlITmXeCek5MxyU3ZUBkTeU8B0o0npk';
144   -
145 165 /**
146 166 * origin:起点名称或经纬度;
147   - *
148 167 * destination:终点名称或经纬度;
149   - *
150 168 * origin_region:起始点所在城市,驾车导航时必填。
151   - *
152 169 * destination_region:终点所在城市,驾车导航时必填。
153   - *
154 170 * output :表示输出类型,可设置为xml或json,默认为xml。
155   - *
156 171 **/
157 172 var paramsB = {
158 173 origin: origin,
... ... @@ -166,60 +181,40 @@ window.WorldsBMap = function () {
166 181  
167 182 /** @description :未认证开发者默认配额为:2000次/天。 */
168 183 $.ajax({
169   -
170 184 // 百度地图根据坐标获取两点之间的时间与距离
171 185 url: 'http://api.map.baidu.com/direction/v1?mode=transit',
172   -
173 186 data: paramsB,
174   -
175 187 dataType: 'jsonp',
176   -
177 188 success: function (r) {
178   -
179 189 if (r) {
180   -
181 190 if (r.message == 'ok') {
182   -
183 191 if (r.result.taxi == null) {
184   -
185 192 // 获取距离(单位:米)
186 193 points[index + 1].distance = 0;
187   -
188 194 // 获取时间(单位:秒)
189 195 points[index + 1].duration = 0;
190   -
191 196 } else {
192   -
193 197 // 获取距离(单位:米)
194 198 points[index + 1].distance = r.result.taxi.distance;
195   -
196 199 // 获取时间(单位:秒)
197 200 points[index + 1].duration = r.result.taxi.duration;
198   -
199 201 }
200   -
201   -
202 202 }
203   -
204 203 }
205   -
206 204 f();
207 205 }
208 206 });
209   -
210 207 })();
211   -
212 208 },
  209 +
213 210 // 打开站点信息窗口
214 211 openStationInfoWin : function (objStation) {
215 212 // 将视图切换到指定的缩放等级,中心点坐标不变。注意:当有信息窗口在地图上打开时,地图缩放将保证信息窗口所在的坐标位置不动。(自1.2新增)
216   - mapBValue.setZoom(25);
217 213 if (objStation) {
218 214 // 站点形状
219 215 var shapes = objStation.stationShapesType;
220 216 // 获取中心坐标点字符串分割
221 217 var BJwpoints = objStation.stationJwpoints.split(' ');
222   -
223 218 // 中心坐标点
224 219 var point = new BMap.Point(BJwpoints[0], BJwpoints[1]);
225 220 var width = WorldsBMap.strGetLength(objStation.stationRouteName) * 11;
... ... @@ -270,102 +265,59 @@ window.WorldsBMap = function () {
270 265 //开启信息窗口
271 266 mapBValue.openInfoWindow(infoWindow_target, point);
272 267 }, 100);
273   - // 是否在平移过程中禁止动画。(自1.2新增)
274   - var PanOptions_ = {noAnimation: true};
275 268 // 将地图的中心点更改为给定的点。
276   - mapBValue.panTo(point, PanOptions_);
277   - // mapBValue.panBy(10, -150, PanOptions_);
  269 + mapBValue.panTo(point);
278 270 }
279 271 },
280 272  
281   - editPolyUpline: function () {
282   - // 禁止覆盖物在map.clearOverlays方法中被清除。(自 1.1 新增)
283   - polyUpline.disableMassClear();
284   - WorldsBMap.clearMarkAndOverlays();
285   - // 允许覆盖物在map.clearOverlays方法中被清除。(自 1.1 新增)
286   - polyUpline.enableMassClear();
287   - // 开启线路编辑
288   - polyUpline.enableEditing();
289   - // 添加双击折线保存事件
290   - polyUpline.addEventListener('dblclick', function (e) {
291   - // 关闭
292   - layer.closeAll();
293   - polyUpline.disableEditing();
294   - // 获取折线坐标集合
295   - var editPloyLineArray = polyUpline.getPath();
296   - EditSectionObj.setEitdBsectionVector(JSON.stringify(editPloyLineArray));
297   - polyUpline = '';
298   - // 加载修改路段弹出层mobal页面
299   - $.get('editsection.html', function (m) {
300   - $(pjaxContainer).append(m);
301   - $('#edit_section_mobal').trigger('editSectionMobal_show', [WorldsBMap, GetAjaxData, EditSectionObj, PublicFunctions]);
302   - });
303   - });
304   - },
305   -
306 273 // 根据地理名称获取百度经纬度坐标
307 274 localSearchFromAdreesToPoint: function (Address, callback) {
308   -
309 275 // 创建一个搜索类实例
310 276 var localSearch = new BMap.LocalSearch(mapBValue);
311   -
312 277 // 检索完成后的回调函数。
313 278 localSearch.setSearchCompleteCallback(function (searchResult) {
314   -
315 279 var resultPoints = '';
316   -
317 280 if (searchResult) {
318   -
319 281 // 返回索引指定的结果。索引0表示第1条结果
320 282 var poi = searchResult.getPoi(0);
321   -
322 283 if (poi) {
323   -
324 284 //获取经度和纬度
325 285 resultPoints = poi.point.lng + ' ' + poi.point.lat;
326   -
327 286 callback && callback(resultPoints);
328   -
329 287 } else {
330   -
331 288 callback && callback(false);
332   -
333 289 }
334   -
335 290 } else {
336   -
337 291 callback && callback(false);
338 292 }
339   -
340 293 });
341   -
342 294 // 根据检索词发起检索。
343 295 localSearch.search(Address);
344   -
345 296 },
346 297  
347   - // 编辑图形
  298 + // 编辑站点
348 299 editShapes: function (obj) {
349 300 // 关闭信息窗口
350 301 mapBValue.closeInfoWindow();
351   -
352 302 // 清除marker
353 303 // mapBValue.removeOverlay(marker);
354 304 var station = obj.getEitdStation();
355 305 var stationShapesTypeV = station.stationShapesType;
  306 + setDragMarker(stationMarkers[station.stationRouteId]);
356 307 // 编辑圆
357 308 if (stationShapesTypeV == 'r') {
358   -
359 309 // 获取中心坐标点字符串分割
360 310 var BJwpoints = station.stationJwpoints.split(' ');
361 311 // 中心坐标点
362 312 var point = new BMap.Point(BJwpoints[0], BJwpoints[1]);
363 313 //创建圆
364   - circle = new BMap.Circle(point, station.stationRadius, {
  314 + var circle = new BMap.Circle(point, station.stationRadius, {
365 315 strokeColor: "blue",
366 316 strokeWeight: 2,
367 317 strokeOpacity: 0.7
368 318 });
  319 + mapBValue.centerAndZoom(point, 18);
  320 + editCircle = circle;
369 321 // 允许覆盖物在map.clearOverlays方法中被清除
370 322 circle.enableMassClear();
371 323 // 百度地图添加覆盖物圆
... ... @@ -378,7 +330,7 @@ window.WorldsBMap = function () {
378 330 var newRadius = circle.getRadius();
379 331 // 返回圆形的中心点坐标。
380 332 var newCenter = circle.getCenter().lng + ' ' + circle.getCenter().lat;
381   - var centre_New = [{potion: {lng: circle.getCenter().lng, lat: circle.getCenter().lat}}];
  333 + // var centre_points = [{potion: {lng: circle.getCenter().lng, lat: circle.getCenter().lat}}];
382 334 /** 设置修改站点集合对象站点中心点百度坐标属性值 @param:<bJwpoints:中心点百度坐标) */
383 335 EditStationObj.setEitdStationJwpoints(newCenter);
384 336 /** 设置修改站点集合对象范围图形类型属性值 @param:<shapesType:范围图形类型) */
... ... @@ -387,13 +339,14 @@ window.WorldsBMap = function () {
387 339 EditStationObj.setEitdStationRadius(Math.round(newRadius));
388 340 /** 设置修改站点集合对象图形百度坐标集合属性值 @param:<bPolygonGrid:图形百度坐标集合) */
389 341 EditStationObj.setEitdBPolygonGrid('');
  342 + // 清除正在编辑的站点
  343 + editCircle = null;
390 344 // 加载编辑页面
391 345 $.get('edit.html', function (m) {
392 346 $(pjaxContainer).append(m);
393 347 $('#edit_station_mobal').trigger('editSelectMobal_show', [WorldsBMap, GetAjaxData, EditStationObj, LineObj, PublicFunctions]);
394 348 });
395 349 });
396   -
397 350 // 编辑多变行
398 351 } else if (stationShapesTypeV == 'd') {
399 352 // 获取中心点坐标字符串
... ... @@ -413,9 +366,8 @@ window.WorldsBMap = function () {
413 366 for (var v = 0; v < pointPolygonArray.length; v++) {
414 367 polygonP.push(new BMap.Point(pointPolygonArray[v].split(" ")[0], pointPolygonArray[v].split(" ")[1]));
415 368 }
416   -
417 369 // 画多边形
418   - polygon = new BMap.Polygon(polygonP, {
  370 + var polygon = new BMap.Polygon(polygonP, {
419 371 // 线条显色
420 372 strokeColor: "blue",
421 373 // 边线的宽度,以像素为单位。
... ... @@ -423,92 +375,46 @@ window.WorldsBMap = function () {
423 375 // 边线透明度,取值范围0 - 1。
424 376 strokeOpacity: 0.7
425 377 });
426   -
  378 + mapBValue.centerAndZoom(pointPolygon, 18);
  379 + editPolygon = polygon;
427 380 // 增加地图覆盖物多边形
428 381 mapBValue.addOverlay(polygon);
429   -
430 382 // 开启编辑功能(自 1.1 新增)
431 383 polygon.enableEditing();
432   -
433 384 // 添加多变行编辑事件
434 385 polygon.addEventListener('dblclick', function (e) {
435   -
436 386 // 获取编辑的多边形对象
437 387 var edit_pointE = polygon;
438   -
439 388 var edit_bPloygonGrid = "";
440   -
441 389 var editPolyGonLen_ = edit_pointE.getPath().length;
442   -
443 390 for (var k = 0; k < editPolyGonLen_; k++) {
444   -
445 391 if (k == 0) {
446   -
447 392 edit_bPloygonGrid = edit_pointE.getPath()[k].lng + ' ' + edit_pointE.getPath()[k].lat;
448   -
449 393 } else {
450   -
451 394 edit_bPloygonGrid = edit_bPloygonGrid + ',' + edit_pointE.getPath()[k].lng + ' ' + edit_pointE.getPath()[k].lat;
452   -
453 395 }
454   -
455 396 }
456   -
457 397 edit_bPloygonGrid = edit_bPloygonGrid + ',' + edit_pointE.getPath()[0].lng + ' ' + edit_pointE.getPath()[0].lat;
458   -
459 398 // 多边形中心点
460   - var centre_points = edit_pointE.getBounds().getCenter().lng + ' ' + edit_pointE.getBounds().getCenter().lat;
461   -
462   - /** 设置修改站点集合对象站点中心点百度坐标属性值 @param:<bJwpoints:中心点百度坐标) */
463   - EditStationObj.setEitdStationJwpoints(centre_points);
464   -
  399 + // var centre = edit_pointE.getBounds().getCenter().lng + ' ' + edit_pointE.getBounds().getCenter().lat;
  400 + /** 设置修改站点集合对象站点中心点百度坐标属性值 @param:<bJwpoints:中心点百度坐标) centerPoint可拖动点 */
  401 + EditStationObj.setEitdStationJwpoints(centerPoint.lng+' '+centerPoint.lat);
465 402 /** 设置修改站点集合对象范围图形类型属性值 @param:<shapesType:范围图形类型) */
466 403 EditStationObj.setEitdStationShapesType('d');
467   -
468 404 /** 设置修改站点集合对象圆形半径属性值 @param:<radius:圆形半径) */
469 405 EditStationObj.setEitdStationRadius('');
470   -
471 406 /** 设置修改站点集合对象图形百度坐标集合属性值 @param:<bPolygonGrid:图形百度坐标集合) */
472 407 EditStationObj.setEitdBPolygonGrid(edit_bPloygonGrid);
473   -
  408 + // 清除正在编辑的站点
  409 + editPolygon = null;
474 410 $.get('edit.html', function (m) {
475   -
476 411 $(pjaxContainer).append(m);
477   -
478 412 $('#edit_station_mobal').trigger('editSelectMobal_show', [WorldsBMap, GetAjaxData, EditStationObj, LineObj, PublicFunctions]);
479   -
480 413 });
481   -
482 414 });
483   -
484 415 }
485   -
486 416 },
487 417  
488   - // 在地图上画出上行线路走向
489   - /*drawingUpline: function (polylineArray, polyline_center, data) {
490   - /!*WorldsBMap.clearMarkAndOverlays();*!/
491   - polyUpline = '';
492   - // 创建线路走向
493   - polyUpline = new BMap.Polyline(polylineArray, {strokeColor: "red", strokeWeight: 6, strokeOpacity: 0.7});
494   - // polyUpline.data = data;
495   - // 把折线添加到地图上
496   - mapBValue.addOverlay(polyUpline);
497   - /!*var ceter_index = Math.round(resultdata.length / 2);
498   -
499   - var ceterPointsStr = resultdata[ceter_index].bJwpoints;
500   -
501   - var ceterPointsArray = ceterPointsStr.split(' ');
502   -
503   - var polyline_center = new BMap.Point(ceterPointsArray[0],ceterPointsArray[1]);*!/
504   - var PanOptions_ = {noAnimation: true};
505   - mapBValue.reset();
506   - mapBValue.panTo(polyline_center, PanOptions_);
507   - mapBValue.panBy(500, -510, PanOptions_);
508   - mapBValue.setZoom(14);
509   - },*/
510   -
511   -
512 418 // 画路段走向
513 419 drawingUpline01: function (polyline_center, datas) {
514 420 if (polyline_center && datas) {
... ... @@ -558,8 +464,9 @@ window.WorldsBMap = function () {
558 464 });
559 465 sectionArray.push(polyUpline01);
560 466 }
561   - mapBValue.setCenter(polyline_center);
562   - mapBValue.setZoom(15);
  467 + // mapBValue.setCenter(polyline_center);
  468 + mapBValue.panTo(polyline_center);
  469 + // mapBValue.setZoom(15);
563 470 // 禁止覆盖物在map.clearOverlays方法中被清除。(自 1.1 新增)
564 471 // polyUpline01.disableMassClear();
565 472 }
... ... @@ -595,6 +502,7 @@ window.WorldsBMap = function () {
595 502 WorldsBMap.openStationInfoWin(station);
596 503 });
597 504 stationArray[station.stationRouteId] = station;
  505 + stationMarkers[station.stationRouteId] = myRichMarker1;
598 506 },
599 507  
600 508 // 站点名称获取百度坐标(手动规划)
... ... @@ -725,99 +633,44 @@ window.WorldsBMap = function () {
725 633 localtionPoint: function (stationNameV) {
726 634 // 关闭信息窗口
727 635 mapBValue.closeInfoWindow();
728   -
729 636 WorldsBMap.localSearchFromAdreesToPoint(stationNameV, function (Points) {
730   -
731 637 if (Points) {
732   -
733 638 var BJwpointsArray = Points.split(' ');
734   -
735 639 var stationNameChangePoint = new BMap.Point(BJwpointsArray[0], BJwpointsArray[1]);
736   -
737 640 var marker_stargt2 = new BMap.Marker(stationNameChangePoint);
738   -
739   - var PanOptions = {noAnimation: true};
740   -
741   - mapBValue.panTo(stationNameChangePoint, PanOptions);
742   -
743   - mapBValue.panBy(0, -100);
744   -
  641 + mapBValue.panTo(stationNameChangePoint);
745 642 // 将标注添加到地图中
746 643 mapBValue.addOverlay(marker_stargt2);
747   -
748 644 //跳动的动画
749 645 marker_stargt2.setAnimation(BMAP_ANIMATION_BOUNCE);
750   -
751 646 }
752   -
753 647 });
754   -
755 648 },
756 649  
757 650 /** 系统规划抓去数据 @param lineNameValue:线路名称;i:方向*/
758 651 getBmapStationNames: function (lineNameValue, i, callback) {
759   -
760 652 var busline = new BMap.BusLineSearch(mapBValue, {
761   -
762 653 // 设置公交列表查询后的回调函数。参数:rs: BusListResult类型
763 654 onGetBusListComplete: function (BusListResult) {
764   -
765 655 // 如果不为空
766 656 if (BusListResult) {
767   -
768 657 //获取第一个公交列表显示到map上
769 658 var fstLine = BusListResult.getBusListItem(i);
770   -
771   - /*if(fstLine==undefined){
772   -
773   - layer.confirm('系统无法生成该线路【'+lineNameValue+'】的站点与路段!请点击返回选择其它方式规划', {btn : [ '返回' ],icon: 3, title:'提示' }, function(index){
774   -
775   - layer.closeAll();
776   -
777   - if(i==0){
778   -
779   - $('#upToolsMobal').show();
780   -
781   - }else if(i==1){
782   -
783   - $('#downToolsMobal').show();
784   -
785   - }
786   -
787   - return;
788   - });
789   -
790   - }*/
791   -
792 659 if (fstLine == undefined) {
793   -
794   -
795 660 callback && callback(null);
796   -
797 661 }
798   -
799 662 busline.getBusLine(fstLine);
800   -
801 663 }
802   -
803 664 },
804   -
805 665 //设置公交线路查询后的回调函数.参数:rs: BusLine类型
806 666 onGetBusLineComplete: function (BusLine) {
807   -
808 667 // 如果不为空
809 668 if (BusLine) {
810   -
811 669 callback && callback(BusLine);
812   -
813 670 }
814   -
815 671 }
816   -
817 672 });
818   -
819 673 busline.getBusList(lineNameValue);
820   -
821 674 },
822 675 // 修改站点
823 676 editStation: function (stationRouteId) {
... ... @@ -952,6 +805,9 @@ window.WorldsBMap = function () {
952 805 break;
953 806 }
954 807 }
  808 + // 路段中间点为中心
  809 + var c = p.ia[Math.floor(p.ia.length/2)];
  810 + mapBValue.centerAndZoom(new BMap.Point(c.lng, c.lat), 18);
955 811 p.addEventListener('dblclick', function () {
956 812 /** 设置修改路段集合对象为空 */
957 813 editPolyline = '';
... ... @@ -1230,8 +1086,7 @@ window.WorldsBMap = function () {
1230 1086 });
1231 1087 //开启信息窗口
1232 1088 mapBValue.openInfoWindow(infoWindow_target, centerPoint);
1233   - mapBValue.setZoom(18);
1234   - mapBValue.setCenter(centerPoint);
  1089 + mapBValue.panTo(centerPoint);
1235 1090 },
1236 1091 /**
1237 1092 * 绘制新增路段
... ... @@ -1310,7 +1165,7 @@ window.WorldsBMap = function () {
1310 1165 strGetLength: function (str) {
1311 1166 return str.replace(/[\u0391-\uFFE5]/g, "aa").length; //先把中文替换成两个字节的英文,在计算长度
1312 1167 }
1313   - }
  1168 + };
1314 1169  
1315 1170 return Bmap;
1316 1171  
... ...
src/main/resources/static/pages/base/stationroute/list.html
... ... @@ -255,6 +255,7 @@
255 255 </div>
256 256 </div>
257 257 </div>
  258 +<script src="/assets/js/baidu/bd_GeoUtils_min.js" ></script>
258 259 <!-- 线路类 -->
259 260 <script src="/pages/base/stationroute/js/line.js"></script>
260 261 <!-- 新增站点对象类 -->
... ...
src/main/resources/static/pages/base/timesmodel/js/v2/AdjustTripStrategy.js 0 → 100644
  1 +//------------------ 策略模块(以下) -----------------//
  2 +
  3 +var AdjustTripS1 = (function() {
  4 +
  5 + function _f1(aBc, schedule, paramObj, fre) {
  6 + if (fre > 0) {
  7 + aBc.sort(function (o1, o2) {
  8 + if (o1.getFcTimeObj().isBefore(o2.getFcTimeObj())) {
  9 + return -1;
  10 + } else {
  11 + return 1;
  12 + }
  13 + });
  14 +
  15 + var i;
  16 + var j;
  17 +
  18 + var iBcCountOfGroup = 3; // 3个班次取一次计算
  19 + var aBcOfGroup; // 3个班次列表
  20 + var aBcIntervalOfGroup; // 班次间隔列表,如:3个班次,2个间隔
  21 + var oBcFcTime; // 班次发车时间
  22 +
  23 + for (i = 0; i <= aBc.length - iBcCountOfGroup; i++) {
  24 + aBcOfGroup = [];
  25 + aBcIntervalOfGroup = [];
  26 + for (j = i; j < i + iBcCountOfGroup; j++) {
  27 + aBcOfGroup.push(aBc[j]);
  28 + }
  29 +
  30 + for (j = 0; j < aBcOfGroup.length; j++) {
  31 + if (j < aBcOfGroup.length - 1) {
  32 + aBcIntervalOfGroup.push(aBcOfGroup[j + 1].getFcTimeObj().diff(
  33 + aBcOfGroup[j].getFcTimeObj(), "m"));
  34 + }
  35 + }
  36 +
  37 + // 判定规则
  38 + oBcFcTime = aBcOfGroup[1].getFcTimeObj();
  39 +
  40 + // 第一个班次发车时间不动,根据间隔,调整中间一个班次
  41 + // 如果3个班次2个间隔时间差1分钟,不调整
  42 + // 如果第一个间隔大,调整第二个班次往前1分钟
  43 + // 如果第二个间隔大,调整第二个班次往后1分钟
  44 +
  45 + if (paramObj.isTroughBc(oBcFcTime) &&
  46 + aBcIntervalOfGroup[0] > paramObj.getTroughMaxFcjx()) {
  47 +
  48 + // aBcOfGroup[1].addMinuteToFcsj(-1);
  49 +
  50 + // 判定是否能调整发车时间
  51 + // if (aBcOfGroup[1].getGroup().getLp().isModifyBcFcsj(aBcOfGroup[1], -1, _paramObj)) {
  52 + aBcOfGroup[1]._$_fcsjObj.add(-1, "m");
  53 + aBcOfGroup[1].setArrTimeObj(paramObj.addMinute(
  54 + aBcOfGroup[1].getFcTimeObj(),
  55 + paramObj.calcuTravelTime(
  56 + aBcOfGroup[1].getFcTimeObj(),
  57 + aBcOfGroup[1].isUp())
  58 + ));
  59 +
  60 + // }
  61 + }
  62 +
  63 + //else if (_paramObj.isMPeakBc(oBcFcTime) &&
  64 + // aBcIntervalOfGroup[0] < _paramObj.getMPeakMinFcjx()) {
  65 + // aBcOfGroup[1].addMinuteToFcsj(1);
  66 + //} else if (_paramObj.isMPeakBc(oBcFcTime) &&
  67 + // aBcIntervalOfGroup[0] > _paramObj.getMPeakMaxFcjx()) {
  68 + // aBcOfGroup[1].addMinuteToFcsj(-1);
  69 + //} else if (_paramObj.isEPeakBc(oBcFcTime) &&
  70 + // aBcIntervalOfGroup[0] < _paramObj.getEPeakMinFcjx()) {
  71 + // aBcOfGroup[1].addMinuteToFcsj(1);
  72 + //} else if (_paramObj.isEPeakBc(oBcFcTime) &&
  73 + // aBcIntervalOfGroup[0] > _paramObj.getEPeakMaxFcjx()) {
  74 + // aBcOfGroup[1].addMinuteToFcsj(-1);
  75 + //}
  76 +
  77 +
  78 + else {
  79 + if (Math.abs(aBcIntervalOfGroup[0] - aBcIntervalOfGroup[1]) <= 1) {
  80 + //continue;
  81 + } else if (aBcIntervalOfGroup[0] > aBcIntervalOfGroup[1]) {
  82 +
  83 +
  84 + // 判定是否能调整发车时间
  85 + // if (aBcOfGroup[1].getGroup().getLp().isModifyBcFcsj(aBcOfGroup[1], -1, _paramObj)) {
  86 + aBcOfGroup[1]._$_fcsjObj.add(-1, "m");
  87 + aBcOfGroup[1].setArrTimeObj(paramObj.addMinute(
  88 + aBcOfGroup[1].getFcTimeObj(),
  89 + paramObj.calcuTravelTime(
  90 + aBcOfGroup[1].getFcTimeObj(),
  91 + aBcOfGroup[1].isUp())
  92 + ));
  93 + // }
  94 +
  95 + // aBcOfGroup[1].addMinuteToFcsj(-1);
  96 + } else {
  97 + // aBcOfGroup[1].addMinuteToFcsj(1);
  98 +
  99 + // 判定是否能调整发车时间
  100 + // if (aBcOfGroup[1].getGroup().getLp().isModifyBcFcsj(aBcOfGroup[1], 1, _paramObj)) {
  101 + aBcOfGroup[1]._$_fcsjObj.add(1, "m");
  102 + aBcOfGroup[1].setArrTimeObj(paramObj.addMinute(
  103 + aBcOfGroup[1].getFcTimeObj(),
  104 + paramObj.calcuTravelTime(
  105 + aBcOfGroup[1].getFcTimeObj(),
  106 + aBcOfGroup[1].isUp())
  107 + ));
  108 + // }
  109 + }
  110 + }
  111 +
  112 + //if (Math.abs(aBcIntervalOfGroup[0] - aBcIntervalOfGroup[1]) <= 1) {
  113 + // //continue;
  114 + //} else if (aBcIntervalOfGroup[0] > aBcIntervalOfGroup[1]) {
  115 + // aBcOfGroup[1].addMinuteToFcsj(-1);
  116 + //} else {
  117 + // aBcOfGroup[1].addMinuteToFcsj(1);
  118 + //}
  119 +
  120 +
  121 + }
  122 +
  123 + _f1(aBc, schedule, paramObj, fre - 1);
  124 +
  125 + }
  126 + }
  127 +
  128 +
  129 + function f1(aUpBc, aDownBc, schedule, paramObj) {
  130 + // TODO:9、调整纵向班次间隔
  131 + _f1(aUpBc, schedule, paramObj, 5);
  132 + _f1(aDownBc, schedule, paramObj, 5);
  133 +
  134 + schedule.fnAdjustLpBcInterval(1);
  135 +
  136 + _f1(aUpBc, schedule, paramObj, 5);
  137 + _f1(aDownBc, schedule, paramObj, 5);
  138 + }
  139 +
  140 + return f1;
  141 +}());
  142 +
  143 +//------------------ 策略模块(以上) -----------------//
  144 +
  145 +
  146 +
  147 +
  148 +
  149 +// 调整班次策略类
  150 +var AdjustTripStrategy = (function() {
  151 +
  152 + /**
  153 + * 内部策略配置封装类。
  154 + * @constructor
  155 + */
  156 + function InternalStrategy() {
  157 + // 策略函数对应,每个函数都由一个标识符号对应,类似配置函数
  158 + this._oSTRATIGIS = {
  159 + "ADJUST_TRIP": AdjustTripS1
  160 + };
  161 + }
  162 +
  163 + /**
  164 + * 返回策略函数
  165 + * @param str 标识
  166 + * @returns {function}
  167 + */
  168 + InternalStrategy.prototype.sFn = function(str) {
  169 + if (!this._oSTRATIGIS[str]) {
  170 + throw "指定标识" + str + "策略函数不存在!";
  171 + }
  172 + return this._oSTRATIGIS[str];
  173 + };
  174 + /**
  175 + * 替换策略配置
  176 + * @param str 策略函数标识
  177 + * @param fn 策略函数
  178 + */
  179 + InternalStrategy.prototype.sConfig = function(str, fn) {
  180 + this._oSTRATIGIS[str] = fn;
  181 + };
  182 +
  183 + return new InternalStrategy();
  184 +}());
0 185 \ No newline at end of file
... ...
src/main/resources/static/pages/permission/authorize_all/user_auth.html
... ... @@ -149,9 +149,9 @@
149 149 var fgs_name_mapp={
150 150 '55_3': '上南公司(六分公司)', '55_1': '上南公司(二分公司)', '55_2': '上南公司(三分公司)', '55_4': '上南公司(一分公司)', '55_5': '上南公司(培训部)',
151 151 '22_2': '金高公司(二分公司)', '22_1': '金高公司(四分公司)', '22_3': '金高公司(三分公司)', '22_5': '金高公司(一分公司)',
152   - '26_3': '南汇公司(三分公司)', '26_2': '南汇公司(南汇二分)', '26_1': '南汇公司(南汇一分)', '26_4': '南汇公司(南汇维修公司)', '26_5': '南汇公司(南汇公司)', '26_6': '南汇公司(航头枢纽站)',
  152 + '26_3': '南汇公司(三分公司)', '26_2': '南汇公司(南汇二分)', '26_1': '南汇公司(南汇一分)', '26_4': '南汇公司(南汇维修公司)', '26_5': '南汇公司(南汇公司)', '26_6': '南汇公司(南汇六分)',
153 153 '05_5': '杨高公司(杨高分公司)', '05_6': '杨高公司(周浦分公司)', '05_3': '杨高公司(芦潮港分公司)', '05_1': '杨高公司(川沙分公司)', '05_2': '杨高公司(金桥分公司)',
154   - '77_78': '闵行公司', '99_100': '青浦公交','24_1': '一车队', '24_2': '二车队', '24_3': '三车队'
  154 + '77_78': '闵行公司','300_301': '金球公交', '99_100': '青浦公交','24_1': '一车队', '24_2': '二车队', '24_3': '三车队'
155 155 };
156 156  
157 157 var defauleConfig;
... ...
src/main/resources/static/pages/scheduleApp/module/basicInfo/busInfoManage/edit.html
... ... @@ -178,6 +178,7 @@
178 178 <input type="text" class="form-control"
179 179 name="equipmentCode" ng-model="ctrl.busInfoForSave.equipmentCode"
180 180 required placeholder="请输入设备终端号"
  181 + readonly
181 182 remote-Validation
182 183 remotevtype="cars_sbbh"
183 184 remotevparam="{{ {'id_eq': ctrl.busInfoForSave.id, 'equipmentCode_eq': ctrl.busInfoForSave.equipmentCode} | json}}"
... ...
src/main/resources/static/pages/scheduleApp/module/basicInfo/busInfoManage/module.js
... ... @@ -293,6 +293,14 @@ angular.module(&#39;ScheduleApp&#39;).controller(
293 293 // 提交方法
294 294 self.submit = function() {
295 295 console.log(self.busInfoForSave);
  296 +
  297 + // 报废的车辆,修改原来的车辆终端号
  298 + if (self.busInfoForSave.scrapState == true) {
  299 + self.busInfoForSave.equipmentCode = "BF-" + self.busInfoForSave.equipmentCode;
  300 + self.busInfoForSave.scrapCode = "BF-" + self.busInfoForSave.equipmentCode;
  301 + }
  302 +
  303 +
296 304 // 保存或者更新
297 305 self.busInfoForSave.$save(function() {
298 306 DataStore.refreshData("cl");
... ...
src/main/resources/static/pages/trafficManage/lineStationUpload.html
... ... @@ -9,7 +9,7 @@
9 9 <form class="form-inline" action="">
10 10 <div style="display: inline-block;" class="param">
11 11 <span class="item-label" style="width: 80px;">线路名称: </span>
12   - <select class="form-control" name="lineCode_like" id="line" style="width: 180px;"></select>
  12 + <select class="form-control" name="id_eq" id="line" style="width: 180px;"></select>
13 13 </div>
14 14 <div class="form-group" style="display: inline-block;margin-left: 15px;">
15 15 <input class="btn btn-default" type="button" id="search" value="查询"/>
... ...
src/main/resources/static/real_control_v2/js/line_schedule/sch_table.js
... ... @@ -770,7 +770,7 @@ var gb_schedule_table = (function () {
770 770 */
771 771 var showLateBadge = function (lineCode, id, minute) {
772 772 var dfCell = cancelLateBadge(lineCode, id);
773   - $(dfCell).append('<span class="late-badge">?+5</span>');
  773 + $(dfCell).append('<span class="late-badge">?+'+minute+'</span>');
774 774 };
775 775  
776 776 /**
... ...
src/main/resources/static/real_control_v2/js/utils/svg_data_convert_bf.js deleted 100644 → 0
1   -var gb_svg_data_convert = (function () {
2   -
3   - /**
4   - * 合并上下行路由
5   - * type 0 上行 1 下行 2 同名合并 3 异名合并
6   - *
7   - * enableAttr: 是否启用配置信息
8   - */
9   - function mergeRoute(routes, enableAttr, lineCode, loopLine) {
10   - console.log('routesroutes', routes);
11   - //按上下行拆分
12   - routes = gb_common.groupBy(routes, 'directions');
13   - var up = routes[0],
14   - down = routes[1];
15   - //排序
16   - up.sort(upSort);
17   - down.sort(downSort);
18   - var data = [];
19   -
20   - //根据配置处理一下数据
21   - if (enableAttr) {
22   - var svgAttr = gb_data_basic.getSvgAttr(lineCode);
23   - if (svgAttr) {
24   - up = filterByAttrs(svgAttr, up);
25   - down = filterByAttrs(svgAttr, down);
26   - }
27   - }
28   -
29   - //环线 只画上行
30   - if(loopLine){
31   - for (var j = 0; j < up.length; j++) {
32   - var upS = nvl_get(up, j);
33   - op = {
34   - name: [upS.stationName],
35   - id: [get_station_code(upS)],
36   - type: 0,
37   - stationMark: upS.stationMark
38   - };
39   - data.push(op);
40   - }
41   -
42   - //上下行GPS容器
43   - $.each(data, function () {
44   - this.gpsUps = [];
45   - this.gpsDowns = [];
46   - });
47   -
48   - return data;
49   - }
50   -
51   -
52   - //同名站点合并
53   - for (var j = 0; j < up.length; j++) {
54   - var upS = nvl_get(up, j),
55   - downS = nvl_get(down, j),
56   - op = {
57   - name: [upS.stationName],
58   - id: [get_station_code(upS), get_station_code(downS)],
59   - type: 2,
60   - stationMark: upS.stationMark//站点标记
61   - };
62   -
63   - if (upS.stationName != downS.stationName) {
64   - //下行站点在上行路由中是否存在
65   - var dIndex = station_indexof(down, upS, j);
66   - //上行站点在下行路由中是否存在
67   - var uIndex = station_indexof(up, downS, j);
68   - if (dIndex == -1 || dIndex - j > 4) {
69   - if (uIndex == -1 && dIndex - j < 4) {
70   - op.type = 3;
71   - op.name = [upS.stationName, downS.stationName];
72   - }
73   - else {
74   - op.type = 0;
75   - op.id = [get_station_code(upS), -1];
76   - //占位
77   - down.splice(j, 0, {});
78   - }
79   - } else {
80   - for (var t = j; t < dIndex - 1; t++) {
81   - var temp = down[t];
82   - data.push({
83   - name: [temp.stationName],
84   - type: 1,
85   - id: [get_station_code(temp)]
86   - });
87   - }
88   - //delete
89   - down.splice(j, dIndex - 1 - j);
90   - j--;
91   - continue;
92   - }
93   - }
94   - data.push(op);
95   - }
96   -
97   - //将上下行挨着的异名站点合并
98   - var len = data.length - 1,
99   - first, sec;
100   - for (var s = 0; s < len; s++) {
101   - first = data[s];
102   - sec = data[s + 1];
103   -
104   - if (first.type == 0 &&
105   - sec.type == 1) {
106   - data.splice(s, 2, {
107   - name: [first['name'][0], sec['name'][0]],
108   - type: 3,
109   - id: [first['id'][0], sec['id'][0]]
110   - });
111   - len--;
112   - } else if (first.type == 1 && sec.type == 0) {
113   - data.splice(s, 2, {
114   - name: [first['name'][0], sec['name'][0]],
115   - type: 3,
116   - id: [first['id'][0], sec['id'][0]]
117   - });
118   - len--;
119   - }
120   - }
121   -
122   - //上下行GPS容器
123   - $.each(data, function () {
124   - this.gpsUps = [];
125   - this.gpsDowns = [];
126   - });
127   - return data;
128   - };
129   -
130   - var filterByAttrs = function (svgAttr, routes) {
131   - var hideStations = svgAttr.hideStations ? svgAttr.hideStations : [];
132   - var nicknames = svgAttr.nicknames ? svgAttr.nicknames : {};
133   - var stationCode;
134   - $.each(routes, function (i) {
135   - stationCode = this.stationCode
136   - //要隐藏的站点
137   - $.each(hideStations, function (j, hide) {
138   - if (stationCode == hide)
139   - delete routes[i];
140   - });
141   -
142   - //要重命名的站点
143   - if (nicknames[this.stationName]) {
144   - this.stationName = nicknames[this.stationName];
145   - }
146   - });
147   -
148   - var newRoutes = [];
149   - $.each(routes, function (i, station) {
150   - if(station)
151   - newRoutes.push(station);
152   - });
153   -
154   - return newRoutes;
155   - };
156   -
157   - var upSort = function (a, b) {
158   - return a.stationRouteCode - b.stationRouteCode;
159   - };
160   -
161   - var downSort = function (a, b) {
162   - return b.stationRouteCode - a.stationRouteCode;
163   - };
164   -
165   - var station_indexof = function (array, station, start) {
166   - var res = -1;
167   - for (var i = start, obj; obj = array[i++];) {
168   - if (obj.stationName == station.stationName) {
169   - res = i;
170   - break;
171   - }
172   - }
173   - return res;
174   - };
175   -
176   - var get_station_code = function (station) {
177   - return station.stationCode + '_' + station.directions;
178   - };
179   -
180   - var nvl_get = function (list, index) {
181   - return list[index] == null ? {} : list[index];
182   - };
183   -
184   - var groupByStationAndUpdown = function (data) {
185   - //gb_common.groupBy(data, 'stopNo')
186   - var rs = {},
187   - key;
188   - $.each(data, function () {
189   - key = this['stopNo'] + '_' + this['upDown'];
190   - if (!rs[key])
191   - rs[key] = [];
192   -
193   - rs[key].push(this);
194   - });
195   -
196   - return rs;
197   - };
198   - return {mergeRoute: mergeRoute, groupByStationAndUpdown: groupByStationAndUpdown};
199   -})();