Commit 4ce1c75711b7b7016f03ef963c5c19fab4fee582

Authored by 徐烜
2 parents e8536aa7 d5deb0cd
src/main/java/com/bsth/repository/SectionRouteRepository.java
... ... @@ -52,7 +52,7 @@ public interface SectionRouteRepository extends BaseRepository<SectionRoute, Int
52 52 " b.section_type AS sectionType," +
53 53 " b.csection_vector AS sectionCsectionVector," +
54 54 " AsText(b.bsection_vector) AS sectionBsectionVector," +
55   - " AsText(b.gsection_vector) sectionGsectionVector," +
  55 + " AsText(b.gsection_vector) AS sectionGsectionVector," +
56 56 " b.road_coding AS sectionRoadCoding," +
57 57 " b.section_distance AS sectionDistance," +
58 58 " b.section_time AS sectionTime," +
... ...
src/main/java/com/bsth/service/impl/StationServiceImpl.java
... ... @@ -335,12 +335,30 @@ public class StationServiceImpl extends BaseServiceImpl<Station, Integer> implem
335 335 arg0.setDbType(dbType);
336 336  
337 337  
  338 + String gLonxStr = JSONObject.parseObject(stationsArray.getJSONObject(i).get("wgs").toString()).get("x").equals("") ? null : JSONObject.parseObject(stationsArray.getJSONObject(i).get("wgs").toString()).get("x").toString();
  339 +
  340 + String gLatyStr = JSONObject.parseObject(stationsArray.getJSONObject(i).get("wgs").toString()).get("y").equals("") ? null : JSONObject.parseObject(stationsArray.getJSONObject(i).get("wgs").toString()).get("y").toString();
  341 +
  342 + float gLonx = 0.0f;
  343 +
  344 + float gLaty = 0.0f;
  345 +
338 346 /** to WGS坐标 */
339 347 Location resultPoint = FromBDPointToWGSPoint(bLonx,bLatx);
340 348  
341   - arg0.setgLonx((float)resultPoint.getLng());
  349 + if(gLonxStr==null)
  350 + gLonx = (float)resultPoint.getLng();
  351 + else
  352 + gLonx = Float.valueOf(gLonxStr);
  353 +
  354 + if(gLatyStr==null)
  355 + gLaty = (float)resultPoint.getLat();
  356 + else
  357 + gLaty = Float.valueOf(gLatyStr);
  358 +
  359 + arg0.setgLonx(gLonx);
342 360  
343   - arg0.setgLaty((float)resultPoint.getLat());
  361 + arg0.setgLaty(gLaty);
344 362  
345 363 // 站点地理位置WGS坐标经度
346 364 // String gLonx = JSONObject.parseObject(stationsArray.getJSONObject(i).get("WGSpotion").toString()).get("Lng").toString();
... ...
src/main/resources/static/pages/base/line/add.html
... ... @@ -220,8 +220,8 @@
220 220 <input type="text" class="form-control" name="endPhone" id="startPhoneInput" placeholder="终点站调度电话">
221 221 </div>
222 222 </div>
223   - <!--
224   - 起始站名称
  223 +
  224 + <!-- 起始站名称 -->
225 225 <div class="form-group">
226 226 <label class="control-label col-md-3"> 起始站名称: </label>
227 227 <div class="col-md-4">
... ... @@ -229,6 +229,14 @@
229 229 </div>
230 230 </div>
231 231  
  232 + <!-- 终点站名称 -->
  233 + <div class="form-group">
  234 + <label class="control-label col-md-3"> 终点站名称: </label>
  235 + <div class="col-md-4">
  236 + <input type="text" class="form-control" name="endStationName" id="endStationNameInput" placeholder="终点站名称">
  237 + </div>
  238 + </div>
  239 + <!--
232 240 起始站首班车时间
233 241 <div class="form-group">
234 242 <label class="control-label col-md-3"> 起始站首班车时间: </label>
... ... @@ -246,14 +254,6 @@
246 254 </div>
247 255  
248 256  
249   - 终点站名称
250   - <div class="form-group">
251   - <label class="control-label col-md-3"> 终点站名称: </label>
252   - <div class="col-md-4">
253   - <input type="text" class="form-control" name="endStationName" id="endStationNameInput" placeholder="终点站名称">
254   - </div>
255   - </div>
256   -
257 257 终点站首班时间
258 258 <div class="form-group">
259 259 <label class="control-label col-md-3"> 终点站首班车时间: </label>
... ...
src/main/resources/static/pages/base/line/edit.html
... ... @@ -219,7 +219,23 @@
219 219 </div>
220 220 </div>
221 221  
222   - <!-- 车辆总数 -->
  222 + <!-- 起始站名称 -->
  223 + <div class="form-group">
  224 + <label class="control-label col-md-3"> 起始站名称: </label>
  225 + <div class="col-md-4">
  226 + <input type="text" class="form-control" name="startStationName" id="startStationNameInput" placeholder="起始站名称">
  227 + </div>
  228 + </div>
  229 +
  230 + <!-- 终点站名称 -->
  231 + <div class="form-group">
  232 + <label class="control-label col-md-3"> 终点站名称: </label>
  233 + <div class="col-md-4">
  234 + <input type="text" class="form-control" name="endStationName" id="endStationNameInput" placeholder="终点站名称">
  235 + </div>
  236 + </div>
  237 +
  238 + <!-- 车辆总数 -->
223 239 <div class="form-group">
224 240 <label class="control-label col-md-3"> 车辆总数: </label>
225 241 <div class="col-md-4">
... ...
src/main/resources/static/pages/base/line/list.html
... ... @@ -50,14 +50,14 @@
50 50 <tr role="row" class="heading">
51 51 <th width="2%">#</th>
52 52 <th width="4%">序号</th>
53   - <th width="7%">线路编码</th>
  53 + <th width="5%">线路编码</th>
54 54 <th width="8%">线路名称</th>
55 55 <th width="7%">所属公司</th>
56 56 <!-- 闵行没有下属公司,这里暂时注释掉 -->
57 57 <!-- <th width="8%">所属分公司</th> -->
58 58 <th width="6%">线路性质</th>
59 59 <th width="6%">线路等级</th>
60   - <th width="7%">上海市线路编码</th>
  60 + <th width="8%">上海市线路编码</th>
61 61 <th width="7%">是否撤销</th>
62 62 <th width="6%">线路标准</th>
63 63 <th width="6%">站点详情</th>
... ...
src/main/resources/static/pages/base/section/js/add-form-wizard.js
... ... @@ -304,9 +304,9 @@ var FormWizard = function() {
304 304  
305 305 var paramsStationsArray = [];
306 306  
307   - paramsStationsArray[0] = stationStartValue;
  307 + paramsStationsArray[0] = stationStartValue+'公交车站';
308 308  
309   - paramsStationsArray[1]= stationEndValue;
  309 + paramsStationsArray[1]= stationEndValue+'公交车站';
310 310  
311 311 $('#sectionNameInput').val(stationStartValue + '至' + stationEndValue );
312 312  
... ... @@ -329,9 +329,9 @@ var FormWizard = function() {
329 329  
330 330 }else if(baseResValue ==1) {
331 331  
332   - SectionVmapWorlds.localSearchFromAdreesToPoint(stationStartValue);
  332 + SectionVmapWorlds.localSearchFromAdreesToPoint(stationStartValue+'公交车站');
333 333  
334   - SectionVmapWorlds.localSearchFromAdreesToPoint(stationEndValue);
  334 + SectionVmapWorlds.localSearchFromAdreesToPoint(stationEndValue+'公交车站');
335 335  
336 336 SectionVmapWorlds.drawingManagerOpen();
337 337  
... ...
src/main/resources/static/pages/base/station/js/add-form-wizard.js
... ... @@ -322,7 +322,7 @@ var FormWizard = function() {
322 322  
323 323 if(baseResValue == 0) {
324 324  
325   - StationPVmapWorlds.localSearchFromAdreesToPoint(stationNameV,function(p) {
  325 + StationPVmapWorlds.localSearchFromAdreesToPoint(stationNameV+'公交车站',function(p) {
326 326  
327 327 if(p) {
328 328  
... ... @@ -337,7 +337,7 @@ var FormWizard = function() {
337 337  
338 338 }else if(baseResValue ==1) {
339 339  
340   - StationPVmapWorlds.localSearchFromAdreesToPoint(stationNameV,function(p) {});
  340 + StationPVmapWorlds.localSearchFromAdreesToPoint(stationNameV+'公交车站',function(p) {});
341 341  
342 342 $('.leftUtils').show();
343 343  
... ...
src/main/resources/static/pages/base/stationroute/addstationstemplate.html
... ... @@ -25,8 +25,8 @@
25 25 <label class="control-label col-md-3">
26 26 <span class="required"> * </span> 站点名称:
27 27 </label>
28   - <div class="col-md-6">
29   - <textarea class="form-control" rows="10" name="stations" id="stationsInput" placeholder="站点名称"></textarea>
  28 + <div class="col-md-9">
  29 + <textarea class="form-control" rows="12" name="stations" id="stationsInput" placeholder="站点名称"></textarea>
30 30 </div>
31 31 </div>
32 32  
... ... @@ -35,7 +35,16 @@
35 35 <div class="form-group">
36 36 <div class="alert alert-info font-blue-chambray" style="background-color: #2C3E50">
37 37 <h5 class="block"><span class="help-block" style="color:#1bbc9b;"> * 手动添加站点规划说明: </span></h5>
38   - <p><span class="help-block" style="color:#1bbc9b;">&nbsp;请在文本域中按站点顺序依次输入站点名称,每输入完一个站名时请按回车键(Enter)换行.</span> </p>
  38 + <p>
  39 + <span class="help-block" style="color:#1bbc9b;">
  40 + &nbsp;请在文本域中按站点顺序依次输入站点名称(如果已有站点GPS坐标,请将坐标跟在站点名称后面用【Tab】键隔开),每输入完一个站名时请按回车键【Enter】换行.
  41 + 例如:<br><br>
  42 + <!-- <HR style="FILTER: alpha(opacity=0,finishopacity=100,style=1)" width="80%" color=#987cb9 SIZE=3> -->
  43 + 浦东大道金桥路 121.496612 31.238960<br>
  44 + 浦东大道居家桥路 121.496618 31.238957<br>
  45 + 浦东大道德平路 121.496622 31.238948<br>
  46 + </span>
  47 + </p>
39 48 </div>
40 49 </div>
41 50 </form>
... ... @@ -143,9 +152,45 @@ $(&#39;#add_station_template_mobal&#39;).on(&#39;AddStationTempMobal.show&#39;, function(e,map,a
143 152 // 站点名称字符串切割
144 153 var paramsStationsArray = params.stations.split('\r\n');
145 154  
146   - // 根据站点名称获取百度坐标
147   - map.stationsNameToPoints(paramsStationsArray,function(resultJson) {
  155 + var stationList = [];
  156 +
  157 + var len = paramsStationsArray.length;
  158 +
  159 + if(len>0) {
  160 +
  161 + for(var k =0;k<len;k++) {
  162 +
  163 + debugger;
  164 +
  165 + if(paramsStationsArray[k]=="")
  166 + continue;
  167 +
  168 + var tempStr = paramsStationsArray[k].split('\t');
  169 +
  170 + if(tempStr.length<2){
  171 +
  172 + stationList.push({name:paramsStationsArray[k]+"公交车站",wgs:{x:'',y:''}});
  173 +
  174 + }else {
  175 +
  176 + stationList.push({name:tempStr[0]+"公交车站",wgs:{x:tempStr[1], y:tempStr[2]}});
  177 +
  178 + }
  179 +
  180 + }
  181 +
  182 + }else {
148 183  
  184 + layer.msg('请按说明规则输入站点!');
  185 +
  186 + return;
  187 +
  188 + }
  189 + console.log(stationList);
  190 + // 根据站点名称获取百度坐标
  191 + map.stationsNameToPoints(stationList,function(resultJson) {
  192 + console.log(resultJson);
  193 + debugger;
149 194 // 根据坐标点获取两点之间的时间与距离
150 195 map.getDistanceAndDuration(resultJson,function(stationdataList) {
151 196  
... ... @@ -216,7 +261,7 @@ $(&#39;#add_station_template_mobal&#39;).on(&#39;AddStationTempMobal.show&#39;, function(e,map,a
216 261 layer.closeAll();
217 262  
218 263 // 清除地图覆盖物
219   - map.clearOverlays();
  264 + map.clearMarkAndOverlays();
220 265  
221 266 // 刷新树
222 267 fun.resjtreeDate(addLine.id,directionData);
... ...
src/main/resources/static/pages/base/stationroute/js/stationroute-ajax-getdata.js
... ... @@ -184,7 +184,7 @@ var GetAjaxData = function(){
184 184 // 保存
185 185 $post('/station/manualSave',params,function(rd) {
186 186  
187   - return callback && callback(rd);
  187 + callback && callback(rd);
188 188  
189 189 });
190 190  
... ...
src/main/resources/static/pages/base/stationroute/js/stationroute-list-map.js
... ... @@ -717,11 +717,11 @@ var WorldsBMap = function () {
717 717  
718 718 var f = arguments.callee;
719 719  
720   - if(arra[index]!=''){
  720 + if(arra[index].name!=''){
721 721  
722 722 var localSearch = new BMap.LocalSearch(mapBValue);
723 723  
724   - localSearch.search(arra[index]);
  724 + localSearch.search(arra[index].name);
725 725  
726 726 localSearch.setSearchCompleteCallback(function (searchResult) {
727 727  
... ... @@ -729,7 +729,8 @@ var WorldsBMap = function () {
729 729  
730 730 if(poi) {
731 731  
732   - stationList.push({name:arra[index],potion:{lng:poi.point.lng,lat:poi.point.lat}});
  732 + /* stationList.push({name:arra[index],potion:{lng:poi.point.lng,lat:poi.point.lat}});*/
  733 + stationList.push({name:arra[index].name.replace('公交站',''),wgs:arra[index].wgs,potion:{lng:poi.point.lng,lat:poi.point.lat}});
733 734  
734 735 f();
735 736  
... ...