Commit da339ef1b976abf39eeb3d38c17ad65255091961

Authored by 潘钊
2 parents e8c553e5 5fef2d7b

update...

Showing 35 changed files with 1685 additions and 1434 deletions

Too many changes to show.

To preserve performance only 35 of 62 files are displayed.

src/main/java/com/bsth/controller/SectionRouteController.java
... ... @@ -37,14 +37,22 @@ public class SectionRouteController extends BaseController<SectionRoute, Integer
37 37 SectionRouteService routeService;
38 38  
39 39 /**
40   - * @param String
  40 + * @param map
41 41 * @throws
42 42 * @Description: TODO(批量撤销路段)
43 43 */
44   - @RequestMapping(value = "/batchDestroy", method = RequestMethod.GET)
  44 + @RequestMapping(value = "/batchDestroy", method = RequestMethod.POST)
45 45 public Map<String, Object> updateBatch(@RequestParam Map<String, Object> map) {
46 46 return routeService.updateSectionRouteInfoFormId(map);
47 47 }
  48 + /**
  49 + * @param id //路段路由id
  50 + * @Description: TODO(撤销路段)
  51 + */
  52 + @RequestMapping(value = "/destroy", method = RequestMethod.POST)
  53 + public Map<String, Object> destroy(@RequestParam Integer id) {
  54 + return routeService.destroy(id);
  55 + }
48 56  
49 57 /**
50 58 * @param @param map
... ...
src/main/java/com/bsth/controller/StationRouteController.java
... ... @@ -137,6 +137,18 @@ public class StationRouteController extends BaseController&lt;StationRoute, Integer
137 137 public List<Map<String, Object>> getStationRouteCenterPoints(@RequestParam Map<String, Object> map) {
138 138 return service.getStationRouteCenterPoints(map);
139 139 }
  140 +
  141 + /**
  142 + * @Description :TODO(查询线路某方向下所有站点)
  143 + *
  144 + * @param map <lineId:线路ID; direction:方向>
  145 + *
  146 + * @return List<Map<String, Object>>
  147 + */
  148 + @RequestMapping(value = "/getStationRouteList" , method = RequestMethod.GET)
  149 + public List<Map<String, Object>> getStationRouteList(@RequestParam Map<String, Object> map) {
  150 + return service.getStationRouteList(map);
  151 + }
140 152  
141 153 /**
142 154 * @Description :TODO(查询线路某方向下所有站点的中心百度坐标)
... ...
src/main/java/com/bsth/controller/realcontrol/AdminUtilsController.java
... ... @@ -162,4 +162,4 @@ public class AdminUtilsController {
162 162 logger.info("手动入库指令....");
163 163 directivesPstThread.run();
164 164 }
165 165 -}
  166 +}
166 167 \ No newline at end of file
... ...
src/main/java/com/bsth/repository/StationRouteRepository.java
... ... @@ -301,7 +301,77 @@ public interface StationRouteRepository extends BaseRepository&lt;StationRoute, Int
301 301 " s.update_date AS stationRouteUpdateDate FROM bsth_c_stationroute s WHERE s.id = ?1 ) a " +
302 302 " LEFT JOIN bsth_c_station b ON a.stationRouteStation = b.id", nativeQuery=true)
303 303 List<Object[]> findStationRouteInfo(Integer id);
304   -
  304 +
  305 + /**
  306 + * @Description : TODO(根据站点路由Id查询详情)
  307 + *
  308 + * @param id:站点路由ID
  309 + *
  310 + * @return List<Object[]>
  311 + */
  312 + @Query(value = "SELECT a.stationRouteLine," +
  313 + " a.stationRouteStation," +
  314 + " a.stationRouteCode," +
  315 + " a.stationRouteLIneCode," +
  316 + " a.stationRouteStationMark," +
  317 + " a.stationOutStationNmber," +
  318 + " a.stationRoutedirections," +
  319 + " a.stationRouteDistances," +
  320 + " a.stationRouteToTime," +
  321 + " a.staitonRouteFirstTime," +
  322 + " a.stationRouteEndTime," +
  323 + " a.stationRouteDescriptions," +
  324 + " a.stationRouteDestroy," +
  325 + " a.stationRouteVersions," +
  326 + " a.stationRouteCreateBy," +
  327 + " a.stationRouteCreateDate," +
  328 + " a.stationRouteUpdateBy," +
  329 + " a.stationRouteUpdateDate," +
  330 + " b.id AS stationId," +
  331 + " b.station_cod AS stationCode," +
  332 + " a.stationRouteName," +
  333 + " b.road_coding AS stationRoadCoding," +
  334 + " b.db_type AS stationDbType," +
  335 + " b.b_jwpoints AS stationJwpoints," +
  336 + " b.g_lonx AS stationGlonx," +
  337 + " b.g_laty AS stationGlaty," +
  338 + " b.x AS stationX," +
  339 + " b.y AS stationY," +
  340 + " ST_AsText(b.b_polygon_grid) as stationBPolyonGrid," +
  341 + " ST_AsText(b.g_polygon_grid) AS stationGPloyonGrid, " +
  342 + " b.destroy AS stationDestroy," +
  343 + " b.radius AS stationRadius," +
  344 + " b.shapes_type AS stationShapesType," +
  345 + " b.versions AS stationVersions," +
  346 + " b.descriptions AS sttationDescriptions," +
  347 + " b.create_by AS stationCreateBy," +
  348 + " b.create_date AS stationCreateDate," +
  349 + " b.update_by AS stationUpdateBy," +
  350 + " b.update_date AS stationUpdateDate," +
  351 + " a.stationRouteId,b.station_name as zdmc "+
  352 + " FROM ( SELECT s.id AS stationRouteId," +
  353 + " s.line AS stationRouteLine," +
  354 + " s.station as stationRouteStation," +
  355 + " s.station_name AS stationRouteName," +
  356 + " s.station_route_code as stationRouteCode," +
  357 + " s.line_code AS stationRouteLIneCode," +
  358 + " s.station_mark AS stationRouteStationMark," +
  359 + " s.out_station_nmber AS stationOutStationNmber," +
  360 + " s.directions AS stationRoutedirections," +
  361 + " s.distances AS stationRouteDistances," +
  362 + " s.to_time AS stationRouteToTime," +
  363 + " s.first_time AS staitonRouteFirstTime," +
  364 + " s.end_time AS stationRouteEndTime," +
  365 + " s.descriptions AS stationRouteDescriptions," +
  366 + " s.destroy AS stationRouteDestroy," +
  367 + " s.versions AS stationRouteVersions," +
  368 + " s.create_by AS stationRouteCreateBy," +
  369 + " s.create_date AS stationRouteCreateDate," +
  370 + " s.update_by AS stationRouteUpdateBy," +
  371 + " s.update_date AS stationRouteUpdateDate FROM bsth_c_stationroute s WHERE s.line = ?1 and s.directions = ?2 and s.destroy = 0) a " +
  372 + " LEFT JOIN bsth_c_station b ON a.stationRouteStation = b.id", nativeQuery=true)
  373 + List<Object[]> getStationRouteList(Integer lineId, Integer dir);
  374 +
305 375 List<StationRoute> findByLine(Line line);
306 376  
307 377 @EntityGraph(value = "stationRoute_station", type = EntityGraph.EntityGraphType.FETCH)
... ...
src/main/java/com/bsth/service/SectionRouteService.java
... ... @@ -67,5 +67,5 @@ public interface SectionRouteService extends BaseService&lt;SectionRoute, Integer&gt;
67 67  
68 68 void batchUpdate(Integer lineId, String lineCode);
69 69  
70   -
  70 + Map<String,Object> destroy(Integer id);
71 71 }
... ...
src/main/java/com/bsth/service/StationRouteService.java
... ... @@ -92,6 +92,15 @@ public interface StationRouteService extends BaseService&lt;StationRoute, Integer&gt;
92 92 * @return List<Map<String, Object>>
93 93 */
94 94 List<Map<String, Object>> getStationRouteCenterPoints(Map<String, Object> map);
  95 +
  96 + /**
  97 + * @Description :TODO(查询线路某方向下所有站点)
  98 + *
  99 + * @param map <lineId:线路ID; direction:方向>
  100 + *
  101 + * @return List<Map<String, Object>>
  102 + */
  103 + List<Map<String, Object>> getStationRouteList(Map<String, Object> map);
95 104  
96 105 /**
97 106 * @Description :TODO(撤销站点)
... ...
src/main/java/com/bsth/service/impl/BusIntervalServiceImpl.java
... ... @@ -215,7 +215,8 @@ public class BusIntervalServiceImpl implements BusIntervalService {
215 215  
216 216 if(model.length() != 0){
217 217 // sql = "select * from bsth_c_s_ttinfo_detail where ttinfo = '"+model+"' and bc_type != 'in' and bc_type != 'out'";
218   - sql = "select id from bsth_c_s_sp_info where tt_info = '" + model + "' and bc_type != 'in' and bc_type != 'out' and bc_type != 'ldks'";
  218 + sql = "select id from bsth_c_s_sp_info where tt_info = '" + model + "' and bc_type != 'in' and bc_type != 'out'" +
  219 + " and bc_type != 'ldks' and schedule_date >= '"+startDate+"' and schedule_date <= '"+endDate+"'";
219 220  
220 221 ttList = jdbcTemplate.query(sql,
221 222 new RowMapper<Long>(){
... ... @@ -1843,7 +1844,7 @@ public class BusIntervalServiceImpl implements BusIntervalService {
1843 1844 }else if(schedule.getAdjustExps() != null && schedule.getAdjustExps().indexOf("气候") != -1){
1844 1845 qhbc++;
1845 1846 // qhlc = qhlc.add(lc);
1846   - }else if(schedule.getAdjustExps() != null && schedule.getAdjustExps().indexOf("外援") != -1){
  1847 + }else if(schedule.getAdjustExps() != null && schedule.getAdjustExps().indexOf("援外") != -1){
1847 1848 wybc++;
1848 1849 // wylc = wylc.add(lc);
1849 1850 } else {
... ... @@ -3003,6 +3004,27 @@ public class BusIntervalServiceImpl implements BusIntervalService {
3003 3004 tempMap.put("zdzdl", (bcs>0?df.format((double)zdzd/bcs*100):0)+"%");
3004 3005 resList.add(tempMap);
3005 3006 }
  3007 +
  3008 + if(map.containsKey("type") && map.get("type").toString().equals("export")){
  3009 + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"),
  3010 + sdfSimple = new SimpleDateFormat("yyyyMMdd");
  3011 + List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
  3012 + Map<String,Object> m = new HashMap<String, Object>();
  3013 + ReportUtils ee = new ReportUtils();
  3014 + try {
  3015 + listI.add(resList.iterator());
  3016 + m.put("date1", startDate);
  3017 + m.put("date2", endDate);
  3018 + String path = this.getClass().getResource("/").getPath()+"static/pages/forms/";
  3019 + ee.excelReplace(listI, new Object[] { m }, path+"mould/onTime.xls",
  3020 + path+"export/发车到站准点率" + sdfSimple.format(sdfMonth.parse(startDate)) +
  3021 + (startDate.equals(endDate)?"":"-"+sdfSimple.format(sdfMonth.parse(endDate))) + ".xls");
  3022 + } catch (Exception e) {
  3023 + // TODO: handle exception
  3024 + e.printStackTrace();
  3025 + }
  3026 + }
  3027 +
3006 3028 } else if(map.get("flag").toString().trim().equals("1")) {
3007 3029 for(String xl : keyMap.keySet()){
3008 3030 List<List<Map<String, Object>>> list1 = keyMap.get(xl);
... ... @@ -3031,17 +3053,61 @@ public class BusIntervalServiceImpl implements BusIntervalService {
3031 3053 resList.add(tempMap);
3032 3054 }
3033 3055 }
  3056 +
  3057 + if(map.containsKey("type") && map.get("type").toString().equals("export")){
  3058 + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"),
  3059 + sdfSimple = new SimpleDateFormat("yyyyMMdd");
  3060 + List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
  3061 + Map<String,Object> m = new HashMap<String, Object>();
  3062 + ReportUtils ee = new ReportUtils();
  3063 + try {
  3064 + listI.add(resList.iterator());
  3065 + m.put("date1", startDate);
  3066 + m.put("date2", endDate);
  3067 + String path = this.getClass().getResource("/").getPath()+"static/pages/forms/";
  3068 + ee.excelReplace(listI, new Object[] { m }, path+"mould/onTime1.xls",
  3069 + path+"export/发车到站准点率明细.xls");
  3070 + } catch (Exception e) {
  3071 + // TODO: handle exception
  3072 + e.printStackTrace();
  3073 + }
  3074 + }
  3075 +
3034 3076 } else if(map.get("flag").toString().trim().equals("2")) {
  3077 + int i = 0;
3035 3078 for(String xl : keyMap.keySet()){
3036 3079 List<List<Map<String, Object>>> list1 = keyMap.get(xl);
3037 3080 if(list1.size() == 0 || list1.get(0).size() == 0)
3038 3081 continue;
3039 3082 for(List<Map<String, Object>> list2 : list1){
3040 3083 for(Map<String, Object> m : list2){
  3084 + m.put("no", ++i);
  3085 + if(m.containsKey("line"))
  3086 + line = m.get("line").toString();
3041 3087 resList.add(m);
3042 3088 }
3043 3089 }
3044 3090 }
  3091 +
  3092 + if(map.containsKey("type") && map.get("type").toString().equals("export")){
  3093 + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"),
  3094 + sdfSimple = new SimpleDateFormat("yyyyMMdd");
  3095 + List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
  3096 + Map<String,Object> m = new HashMap<String, Object>();
  3097 + ReportUtils ee = new ReportUtils();
  3098 + try {
  3099 + listI.add(resList.iterator());
  3100 + m.put("date", startDate);
  3101 + m.put("line", line);
  3102 + String path = this.getClass().getResource("/").getPath()+"static/pages/forms/";
  3103 + ee.excelReplace(listI, new Object[] { m }, path+"mould/onTime2.xls",
  3104 + path+"export/发车到站准点率详细"+sdfSimple.format(sdfMonth.parse(startDate))+".xls");
  3105 + } catch (Exception e) {
  3106 + // TODO: handle exception
  3107 + e.printStackTrace();
  3108 + }
  3109 + }
  3110 +
3045 3111 }
3046 3112  
3047 3113 return resList;
... ...
src/main/java/com/bsth/service/impl/SectionRouteServiceImpl.java
... ... @@ -122,7 +122,7 @@ public class SectionRouteServiceImpl extends BaseServiceImpl&lt;SectionRoute, Integ
122 122 }
123 123  
124 124 /**
125   - * @Description :TODO(查询路段信息)
  125 + * @Description :TODO(查询缓存路段信息)
126 126 *
127 127 * @param map <line.id_eq:线路ID; directions_eq:方向>
128 128 *
... ... @@ -408,4 +408,25 @@ public class SectionRouteServiceImpl extends BaseServiceImpl&lt;SectionRoute, Integ
408 408 public void batchUpdate(Integer lineId, String lineCode) {
409 409 repository.batchUpdate(lineId,lineCode);
410 410 }
  411 +
  412 +
  413 +
  414 + /**
  415 + * @Description : TODO(根据路段路由Id批量撤销路段)
  416 + *
  417 + * @param id <id:路段路由ID>
  418 + */
  419 + @Override
  420 + @Transactional
  421 + public Map<String, Object> destroy(Integer id) {
  422 + Map<String, Object> resultMap = new HashMap<String, Object>();
  423 + try {
  424 + repository.sectionRouteIsDestroyUpdBatch(id);
  425 + resultMap.put("status", ResponseCode.SUCCESS);
  426 + } catch (Exception e) {
  427 + resultMap.put("status", ResponseCode.ERROR);
  428 + logger.error("save erro.", e);
  429 + }
  430 + return resultMap;
  431 + }
411 432 }
412 433 \ No newline at end of file
... ...
src/main/java/com/bsth/service/impl/SectionServiceImpl.java
... ... @@ -453,7 +453,7 @@ public class SectionServiceImpl extends BaseServiceImpl&lt;Section, Integer&gt; implem
453 453 if(!sectionsBpoints.equals("")) {
454 454 bsectionVectorS = "LINESTRING(" + sectionsBpoints + ")";
455 455 }
456   - repository.systemSave(sectionCode, sectionName, "", "", "", "", gsectionVector, bsectionVectorS, "", "", "", 0, 0, "", 0, "", 1, sectionId);
  456 + repository.systemSave(sectionCode, sectionName, null, "", "", "", gsectionVector, bsectionVectorS, "", "", "", 0, 0, "", 0, "", 1, sectionId);
457 457  
458 458 routeRepository.sectionUpdSectionRouteCode(lineId, directions,routeCode+i);
459 459 SectionRoute route = new SectionRoute();
... ... @@ -636,7 +636,7 @@ public class SectionServiceImpl extends BaseServiceImpl&lt;Section, Integer&gt; implem
636 636 // 原坐标类型
637 637 String dbType = map.get("dbType").equals("") ? "" : map.get("dbType").toString();
638 638 // 说明
639   - String descriptions = map.get("descriptions").equals("") ? "" : map.get("descriptions").toString();
  639 + String descriptions = "";
640 640 // 是否撤销
641 641 Integer destroy = map.get("destroy").equals("") ? null : Integer.parseInt(map.get("destroy").toString());
642 642 // 方向
... ... @@ -662,14 +662,19 @@ public class SectionServiceImpl extends BaseServiceImpl&lt;Section, Integer&gt; implem
662 662 // 路段路由
663 663 Integer sectionrouteCode = map.get("sectionrouteCode").equals("") ? null : Integer.valueOf(map.get("sectionrouteCode").toString());
664 664 SectionRoute resultS = routeRepository.findOne(sectionRouteId);
665   -// int old_code = resultS.getSectionrouteCode();
666   - // 如果为空,默认在第一个路段
667   - if(sectionrouteCode!=null) {
668   - sectionrouteCode += 1;
669   - }else {
670   - sectionrouteCode = 1;
671   - }
672   - routeRepository.sectionUpdSectionRouteCode(lineCode, directions,sectionrouteCode);
  665 + int old_code = resultS.getSectionrouteCode();
  666 + // 是否修改路段序号标记
  667 + boolean type = false;
  668 + if(sectionrouteCode!=null) {
  669 + if(++sectionrouteCode == old_code) {
  670 + type = true;
  671 + }
  672 + // 默认是最前面路段
  673 + }else {
  674 + sectionrouteCode = 1;
  675 + }
  676 + if(!type)
  677 + routeRepository.sectionUpdSectionRouteCode(lineCode, directions,sectionrouteCode);
673 678 // 限速
674 679 Double speedLimit = map.get("speedLimit").equals("") ? null : Double.valueOf(map.get("speedLimit").toString());
675 680 // 版本
... ... @@ -709,7 +714,6 @@ public class SectionServiceImpl extends BaseServiceImpl&lt;Section, Integer&gt; implem
709 714 route.setDirections(directions);
710 715 route.setVersions(version);
711 716 route.setDestroy(destroy);
712   - route.setDescriptions(descriptions);
713 717 route.setCreateBy(createBy);
714 718 route.setUpdateBy(updateBy);
715 719 route.setLine(line);
... ... @@ -784,17 +788,24 @@ public class SectionServiceImpl extends BaseServiceImpl&lt;Section, Integer&gt; implem
784 788 // 路段时长
785 789 Double sectionTime = map.get("sectionTime").equals("") ? null : Double.valueOf(map.get("sectionTime").toString());
786 790 // 路段路由
787   -// Integer sectionrouteCode = map.get("sectionrouteCode").equals("") ? null : Integer.valueOf(map.get("sectionrouteCode").toString());
788   - Integer sectionrouteCode = 1;
  791 + Integer sectionrouteCode = map.get("sectionrouteCode").equals("") ? null : Integer.valueOf(map.get("sectionrouteCode").toString());
  792 +// Integer sectionrouteCode = 1;
789 793 SectionRouteCache resultS = routeCacheRepository.findOne(sectionRouteId);
790 794 int old_code = resultS.getSectionrouteCode();
  795 + // 是否修改路段序号标记
  796 + boolean type = false;
791 797 if(sectionrouteCode!=null) {
792   - sectionrouteCode += 1;
  798 + if(sectionrouteCode == old_code) {
  799 + type = true;
  800 + } else {
  801 + sectionrouteCode += 1;
  802 + }
793 803 // 默认是最前面路段
794 804 }else {
795 805 sectionrouteCode = 1;
796 806 }
797   - routeRepository.sectionUpdSectionRouteCode(lineCode, directions,sectionrouteCode);
  807 + if(!type)
  808 + routeRepository.sectionUpdSectionRouteCode(lineCode, directions,sectionrouteCode);
798 809 // 限速
799 810 Double speedLimit = map.get("speedLimit").equals("") ? null : Double.valueOf(map.get("speedLimit").toString());
800 811 // 版本
... ...
src/main/java/com/bsth/service/impl/StationRouteServiceImpl.java
... ... @@ -196,123 +196,80 @@ public class StationRouteServiceImpl extends BaseServiceImpl&lt;StationRoute, Integ
196 196 List<Map<String, Object>> staitonChildren= new ArrayList<Map<String, Object>>();
197 197  
198 198 if(stationList.size()>0) {
199   -
200 199 for(int i = 0 ; i < stationList.size(); i++) {
201   -
202 200 Map<String, Object> tempM = new HashMap<String, Object>();
203   -
204 201 // 站点路由ID
205 202 tempM.put("stationRouteId", stationList.get(i)[0]);
206   -
207 203 // 站点路由线路ID
208 204 tempM.put("stationRouteLine", stationList.get(i)[1]);
209   -
210 205 // 站点路由站点ID
211 206 tempM.put("stationRouteStation", stationList.get(i)[2]);
212   -
213 207 // 站点路由名称
214   - tempM.put("stationRouteStationName", stationList.get(i)[3]);
215   -
  208 + tempM.put("stationRouteName", stationList.get(i)[3]);
216 209 // 站点路由站点序号
217   - tempM.put("stationRouteStationRouteCode", stationList.get(i)[4]);
218   -
  210 + tempM.put("stationRouteCode", stationList.get(i)[4]);
219 211 // 站点路由线路编码
220 212 tempM.put("stationRouteLineCode", stationList.get(i)[5]);
221   -
222 213 // 站点路由站点类型
223 214 tempM.put("stationRouteStationMark", stationList.get(i)[6]);
224   -
225 215 // 站点路由出站的序号
226 216 tempM.put("stationRouteOutStationNmber", stationList.get(i)[7]);
227   -
228 217 // 站点路由站点方向
229   - tempM.put("stationRouteDirections", stationList.get(i)[8]);
230   -
  218 + tempM.put("stationRoutedirections", stationList.get(i)[8]);
231 219 // 站点路由站点到站距离
232 220 tempM.put("stationRouteDistances", stationList.get(i)[9]);
233   -
234 221 // 站点路由到站时间
235 222 tempM.put("stationRouteToTime", stationList.get(i)[10]);
236   -
237 223 // 站点路由站点首班时间
238 224 tempM.put("stationRouteFirstTime", stationList.get(i)[11]);
239   -
240 225 // 站点路由站点末班时间
241 226 tempM.put("stationRouteEndTime", stationList.get(i)[12]);
242   -
243 227 // 站点路由站点说明
244 228 tempM.put("stationRouteDescriptions", stationList.get(i)[13]);
245   -
246 229 // 站点路由版本
247 230 tempM.put("stationRouteVersions", stationList.get(i)[14]);
248   -
249 231 // 站点ID
250 232 tempM.put("stationId", stationList.get(i)[15]);
251   -
252 233 // 站点编码
253   - tempM.put("stationStationCod", stationList.get(i)[16]);
254   -
  234 + tempM.put("stationCode", stationList.get(i)[16]);
255 235 // 站点名称
256 236 tempM.put("stationStationName", stationList.get(i)[17]);
257   -
258 237 // 路段编码
259 238 tempM.put("stationRoadCoding", stationList.get(i)[18]);
260   -
261 239 // 原坐标类型
262 240 tempM.put("stationDbType", stationList.get(i)[19]);
263   -
264 241 // 中心点(百度坐标)
265   - tempM.put("stationBJwpoints", stationList.get(i)[20]);
266   -
  242 + tempM.put("stationJwpoints", stationList.get(i)[20]);
267 243 // 中心点(WGS经度)
268 244 tempM.put("stationGLonx", stationList.get(i)[21]);
269   -
270 245 // 中心点(WGS纬度)
271 246 tempM.put("stationGLaty", stationList.get(i)[22]);
272   -
273 247 // 城建坐标x
274 248 tempM.put("stationx", stationList.get(i)[23]);
275   -
276 249 // 城建坐标y
277 250 tempM.put("stationy", stationList.get(i)[24]);
278   -
279 251 // 站点图形类型
280 252 tempM.put("stationShapesType", stationList.get(i)[25]);
281   -
282 253 // 站点圆半径
283 254 tempM.put("stationRadius", stationList.get(i)[26]);
284   -
285 255 // 站点图形WGS坐标
286 256 tempM.put("stationGPolygonGrid", stationList.get(i)[27]);
287   -
288 257 // 站点图形百度坐标
289 258 tempM.put("stationBPolygonGrid", stationList.get(i)[28]);
290   -
291 259 // 是否撤销
292 260 tempM.put("stationDestroy", stationList.get(i)[29]);
293   -
294 261 // 站点版本
295 262 tempM.put("stationVersions", stationList.get(i)[30]);
296   -
297 263 // 站点说明
298 264 tempM.put("stationDescriptions", stationList.get(i)[31]);
299   -
300   - tempM.put("name", stationList.get(i)[3]);
301   -
  265 + tempM.put("zdmc", stationList.get(i)[3]);
302 266 tempM.put("text", stationList.get(i)[3]);
303   -
304 267 tempM.put("icon", "fa fa-bus");
305   -
306 268 tempM.put("pId", 200);
307   -
308 269 tempM.put("id", i+1);
309   -
310 270 tempM.put("groupType", "3");
311   -
312 271 tempM.put("chaildredType", "station");
313   -
314 272 tempM.put("enable", true);
315   -
316 273 staitonChildren.add(tempM);
317 274 }
318 275 }
... ... @@ -321,107 +278,87 @@ public class StationRouteServiceImpl extends BaseServiceImpl&lt;StationRoute, Integ
321 278 List<Map<String, Object>> sectionChildren = new ArrayList<Map<String, Object>>();
322 279  
323 280 if(sectionList.size()>0) {
324   -
325 281 for(int i = 0 ; i<sectionList.size() ; i++){
326   -
327 282 Map<String, Object> tempM = new HashMap<String, Object>();
328   -
329 283 // 路段路由ID
330 284 tempM.put("sectionrouteId",sectionList.get(i)[0]);
331   -
332 285 // 路段路由线路ID
333 286 tempM.put("sectionrouteLine",sectionList.get(i)[1]);
334   -
335 287 // 路段路由线路编码
336 288 tempM.put("sectionrouteLineCode",sectionList.get(i)[2]);
337   -
338 289 // 路段路由路段ID
339 290 tempM.put("sectionrouteSection",sectionList.get(i)[3]);
340   -
341 291 // 路段路由路段编码
342 292 tempM.put("sectionrouteSectionCode",sectionList.get(i)[4]);
343   -
344 293 tempM.put("sectionrouteCode",sectionList.get(i)[5]);
345   -
346 294 tempM.put("sectionrouteDirections",sectionList.get(i)[6]);
347   -
348 295 // 路段ID
349 296 tempM.put("sectionId",sectionList.get(i)[7]);
350   -
351 297 // 路段编码
352 298 tempM.put("sectionCode",sectionList.get(i)[8]);
353   -
354 299 // 路段名称
355 300 tempM.put("sectionName",sectionList.get(i)[9]);
356   -
357 301 // 道路编码
358 302 tempM.put("sectionCrosesRoad",sectionList.get(i)[10]);
359   -
360 303 // 终点站
361 304 tempM.put("sectionEndNode",sectionList.get(i)[11]);
362   -
363 305 // 起始节点
364 306 tempM.put("sectionStartNode",sectionList.get(i)[12]);
365   -
366 307 // 中间节点
367 308 tempM.put("sectionMiddleNode",sectionList.get(i)[13]);
368   -
369 309 // 路段类型
370 310 tempM.put("sectionType",sectionList.get(i)[14]);
371   -
372 311 // 路段折线图形城建坐标
373 312 tempM.put("sectionCsectionVector",sectionList.get(i)[15]);
374   -
375 313 // 路段折线图形百度坐标
376 314 tempM.put("sectionBsectionVector",sectionList.get(i)[16]);
377   -
378 315 // 路段折线图形WGS坐标
379 316 tempM.put("sectionGsectionVector",sectionList.get(i)[17]);
380   -
381 317 // 道路编码
382 318 tempM.put("sectionRoadCoding",sectionList.get(i)[18]);
383   -
384 319 // 路段距离
385 320 tempM.put("sectionDistance",sectionList.get(i)[19]);
386   -
387 321 // 路段时间
388 322 tempM.put("sectionTime",sectionList.get(i)[20]);
389   -
390 323 // 路段原坐标类型
391 324 tempM.put("sectiondbType",sectionList.get(i)[21]);
392   -
393 325 // 限速
394 326 tempM.put("sectionSpeedLimet",sectionList.get(i)[22]);
395   -
396 327 // 是否撤销
397 328 tempM.put("destroy",sectionList.get(i)[23]);
398   -
399 329 // 版本号
400 330 tempM.put("versions",sectionList.get(i)[24]);
401   -
402 331 // 说明
403 332 tempM.put("descriptions",sectionList.get(i)[25]);
404 333 // 说明
405 334 tempM.put("isRoadeSpeed",sectionList.get(i)[26]);
406   -
407 335 tempM.put("name", sectionList.get(i)[9]);
408   -
409 336 tempM.put("text", sectionList.get(i)[9]);
410   -
411 337 tempM.put("icon", null);
412   -
413 338 tempM.put("pId", 300);
414   -
415 339 tempM.put("id", (i+1)*1000);
416   -
417 340 tempM.put("groupType", "3");
418   -
419 341 tempM.put("chaildredType", "section");
420   -
421 342 tempM.put("enable", true);
422   -
423 343 sectionChildren.add(tempM);
424   -
  344 + }
  345 + } else {
  346 + if(stationList.size()>0) {
  347 + Map<String, Object> tempM = new HashMap<String, Object>();
  348 + tempM.put("name", "添加路段");
  349 + tempM.put("text", "添加路段");
  350 + tempM.put("lineId", stationList.get(0)[1]);
  351 + tempM.put("lineCode", stationList.get(0)[5]);
  352 + tempM.put("dir", stationList.get(0)[8]);
  353 + tempM.put("versions", stationList.get(0)[14]);
  354 + tempM.put("icon", null);
  355 + tempM.put("pId", 300);
  356 + tempM.put("id", 1000);
  357 + tempM.put("groupType", "3");
  358 + tempM.put("chaildredType", "addSection");
  359 + tempM.put("sectionBsectionVector", "LINESTRING("+stationList.get(0)[20]+")");
  360 + tempM.put("enable", true);
  361 + sectionChildren.add(tempM);
425 362 }
426 363 }
427 364  
... ... @@ -563,98 +500,102 @@ public class StationRouteServiceImpl extends BaseServiceImpl&lt;StationRoute, Integ
563 500 int len = objects.size();
564 501  
565 502 if(objects.size()>0) {
  503 + // 遍历站点
  504 + traversalStation(objects, resultList, len);
  505 + }
  506 + return resultList;
  507 + }
566 508  
567   - for(int i = 0 ; i < len; i++) {
568   - Map<String, Object> tempM = new HashMap<String,Object>();
  509 + private void traversalStation(List<Object[]> objects, List<Map<String, Object>> resultList, int len) {
  510 + for(int i = 0 ; i < len; i++) {
  511 + Map<String, Object> tempM = new HashMap<String,Object>();
569 512  
570   - tempM.put("stationRouteLine", objects.get(i)[0]);
  513 + tempM.put("stationRouteLine", objects.get(i)[0]);
571 514  
572   - tempM.put("stationRouteStation", objects.get(i)[1]);
  515 + tempM.put("stationRouteStation", objects.get(i)[1]);
573 516  
574   - tempM.put("stationRouteCode", objects.get(i)[2]);
  517 + tempM.put("stationRouteCode", objects.get(i)[2]);
575 518  
576   - tempM.put("stationRouteLIneCode", objects.get(i)[3]);
  519 + tempM.put("stationRouteLIneCode", objects.get(i)[3]);
577 520  
578   - tempM.put("stationRouteStationMark", objects.get(i)[4]);
  521 + tempM.put("stationRouteStationMark", objects.get(i)[4]);
579 522  
580   - tempM.put("stationOutStationNmber", objects.get(i)[5]);
  523 + tempM.put("stationOutStationNmber", objects.get(i)[5]);
581 524  
582   - tempM.put("stationRoutedirections", objects.get(i)[6]);
  525 + tempM.put("stationRoutedirections", objects.get(i)[6]);
583 526  
584   - tempM.put("stationRouteDistances", objects.get(i)[7]);
  527 + tempM.put("stationRouteDistances", objects.get(i)[7]);
585 528  
586   - tempM.put("stationRouteToTime", objects.get(i)[8]);
  529 + tempM.put("stationRouteToTime", objects.get(i)[8]);
587 530  
588   - tempM.put("staitonRouteFirstTime", objects.get(i)[9]);
  531 + tempM.put("staitonRouteFirstTime", objects.get(i)[9]);
589 532  
590   - tempM.put("stationRouteEndTime", objects.get(i)[10]);
  533 + tempM.put("stationRouteEndTime", objects.get(i)[10]);
591 534  
592   - tempM.put("stationRouteDescriptions", objects.get(i)[11]);
  535 + tempM.put("stationRouteDescriptions", objects.get(i)[11]);
593 536  
594   - tempM.put("stationRouteDestroy", objects.get(i)[12]);
  537 + tempM.put("stationRouteDestroy", objects.get(i)[12]);
595 538  
596   - tempM.put("stationRouteVersions", objects.get(i)[13]);
  539 + tempM.put("stationRouteVersions", objects.get(i)[13]);
597 540  
598   - tempM.put("stationRouteCreateBy", objects.get(i)[14]);
  541 + tempM.put("stationRouteCreateBy", objects.get(i)[14]);
599 542  
600   - tempM.put("stationRouteCreateDate", objects.get(i)[15]);
  543 + tempM.put("stationRouteCreateDate", objects.get(i)[15]);
601 544  
602   - tempM.put("stationRouteUpdateBy", objects.get(i)[16]);
  545 + tempM.put("stationRouteUpdateBy", objects.get(i)[16]);
603 546  
604   - tempM.put("stationRouteUpdateDate", objects.get(i)[17]);
  547 + tempM.put("stationRouteUpdateDate", objects.get(i)[17]);
605 548  
606   - tempM.put("stationId", objects.get(i)[18]);
  549 + tempM.put("stationId", objects.get(i)[18]);
607 550  
608   - tempM.put("stationCode", objects.get(i)[19]);
  551 + tempM.put("stationCode", objects.get(i)[19]);
609 552  
610   - tempM.put("stationRouteName", objects.get(i)[20]);
  553 + tempM.put("stationRouteName", objects.get(i)[20]);
611 554  
612   - tempM.put("stationRoadCoding", objects.get(i)[21]);
  555 + tempM.put("stationRoadCoding", objects.get(i)[21]);
613 556  
614   - tempM.put("stationDbType", objects.get(i)[22]);
  557 + tempM.put("stationDbType", objects.get(i)[22]);
615 558  
616   - tempM.put("stationJwpoints", objects.get(i)[23]);
  559 + tempM.put("stationJwpoints", objects.get(i)[23]);
617 560  
618   - tempM.put("stationGlonx", objects.get(i)[24]);
  561 + tempM.put("stationGlonx", objects.get(i)[24]);
619 562  
620   - tempM.put("stationGlaty", objects.get(i)[25]);
  563 + tempM.put("stationGlaty", objects.get(i)[25]);
621 564  
622   - tempM.put("stationX", objects.get(i)[26]);
  565 + tempM.put("stationX", objects.get(i)[26]);
623 566  
624   - tempM.put("stationY", objects.get(i)[27]);
  567 + tempM.put("stationY", objects.get(i)[27]);
625 568  
626   - tempM.put("stationBPolyonGrid", objects.get(i)[28]);
  569 + tempM.put("stationBPolyonGrid", objects.get(i)[28]);
627 570  
628   - tempM.put("stationGPloyonGrid", objects.get(i)[29]);
  571 + tempM.put("stationGPloyonGrid", objects.get(i)[29]);
629 572  
630   - tempM.put("stationDestroy", objects.get(i)[30]);
  573 + tempM.put("stationDestroy", objects.get(i)[30]);
631 574  
632   - tempM.put("stationRadius", objects.get(i)[31]);
  575 + tempM.put("stationRadius", objects.get(i)[31]);
633 576  
634   - tempM.put("stationShapesType", objects.get(i)[32]);
  577 + tempM.put("stationShapesType", objects.get(i)[32]);
635 578  
636   - tempM.put("stationVersions", objects.get(i)[33]);
  579 + tempM.put("stationVersions", objects.get(i)[33]);
637 580  
638   - tempM.put("sttationDescriptions", objects.get(i)[34]);
  581 + tempM.put("sttationDescriptions", objects.get(i)[34]);
639 582  
640   - tempM.put("stationCreateBy", objects.get(i)[35]);
  583 + tempM.put("stationCreateBy", objects.get(i)[35]);
641 584  
642   - tempM.put("stationCreateDate", objects.get(i)[36]);
  585 + tempM.put("stationCreateDate", objects.get(i)[36]);
643 586  
644   - tempM.put("stationUpdateBy", objects.get(i)[37]);
  587 + tempM.put("stationUpdateBy", objects.get(i)[37]);
645 588  
646   - tempM.put("stationUpdateDate", objects.get(i)[38]);
  589 + tempM.put("stationUpdateDate", objects.get(i)[38]);
647 590  
648   - tempM.put("stationRouteId", objects.get(i)[39]);
649   - tempM.put("zdmc", objects.get(i)[40]);
  591 + tempM.put("stationRouteId", objects.get(i)[39]);
  592 + tempM.put("zdmc", objects.get(i)[40]);
650 593  
651   - resultList.add(tempM);
652   - }
653   - }
654   - return resultList;
  594 + resultList.add(tempM);
  595 + }
655 596 }
656 597  
657   - /**
  598 + /**
658 599 * @Description :TODO(查询线路某方向下所有站点的中心百度坐标)
659 600 *
660 601 * @param map <lineId:线路ID; direction:方向>
... ... @@ -692,6 +633,29 @@ public class StationRouteServiceImpl extends BaseServiceImpl&lt;StationRoute, Integ
692 633  
693 634 return resultList;
694 635 }
  636 +
  637 + /**
  638 + * @Description :TODO(查询线路某方向下所有站点)
  639 + *
  640 + * @param map <lineId:线路ID; direction:方向>
  641 + *
  642 + * @return List<Map<String, Object>>
  643 + */
  644 + @Override
  645 + public List<Map<String, Object>> getStationRouteList(Map<String, Object> map) {
  646 + Integer lineId = map.get("lineId").equals("") ? null : Integer.parseInt(map.get("lineId").toString());
  647 + Integer direction = map.get("direction").equals("") ? null : Integer.parseInt(map.get("direction").toString());
  648 + List<Object[]> objects = repository.getStationRouteList(lineId, direction);
  649 + List<Map<String, Object>> resultList = new ArrayList<Map<String,Object>>();
  650 +
  651 + int len = objects.size();
  652 +
  653 + if(objects.size()>0) {
  654 + // 遍历站点
  655 + traversalStation(objects, resultList, len);
  656 + }
  657 + return resultList;
  658 + }
695 659  
696 660  
697 661 /**
... ... @@ -774,109 +738,72 @@ public class StationRouteServiceImpl extends BaseServiceImpl&lt;StationRoute, Integ
774 738 */
775 739 @Override
776 740 public Map<String, Object> usingSingle(Map<String, Object> map) {
777   -
778 741 // 返回值map
779 742 Map<String, Object> resultMap = new HashMap<String,Object>();
780   -
781 743 try {
782   -
783 744 // 获取线路ID
784 745 Integer lineId = map.get("lineId").equals("") ? 0 : Integer.parseInt(map.get("lineId").toString());
785   -
786 746 /** 查询线路信息 @param:<lineId:线路ID> */
787 747 Line line = lineRepository.findOne(lineId);
788   -
789 748 /** 查询线路信息下的站点路由信息 @param:<lineId:线路ID> */
790 749 List<Object[]> objects = repository.usingSingle(lineId);
791   -
792 750 if (objects.size()>0) {
793   -
794 751 /** 获取配置文件里的ftp登录参数 */
795 752 Map<String, Object> FTPParamMap = readPropertiesGetFTPParam();
796   -
797 753 // 压缩文件名
798 754 String odlGzFileName = line.getLineCode() + ".txt.gz";
799   -
800 755 // txt文件名
801 756 String textFileName = line.getLineCode() + ".txt";
802   -
803 757 // 创建一个ftp上传实例
804 758 FTPClientUtils clientUtils = new FTPClientUtils();
805   -
806 759 // IP
807 760 String url = FTPParamMap.get("url").toString();
808   -
809 761 // 端口
810 762 int port = Integer.valueOf(FTPParamMap.get("port").toString());
811   -
812 763 // 用户名
813 764 String username = FTPParamMap.get("username").toString();
814   -
815 765 // 密码
816 766 String password = FTPParamMap.get("password").toString();
817   -
818 767 // 相对路径
819 768 String remotePath = FTPParamMap.get("remotePath").toString();
820   -
821 769 /** 如果已存在相同行单文件名则先删除 */
822 770 clientUtils.deleteFtpFile(url, port, username, password, remotePath, odlGzFileName);
823   -
824 771 clientUtils.deleteFtpFile(url, port, username, password, remotePath, textFileName);
825   -
826 772 String textStr = "";
827   -
828   - boolean tempTag = ishxType(objects);
829   -
830   - if(tempTag)
  773 +// boolean tempTag = ishxType(objects);
  774 + Integer linePlayType = line.getLinePlayType() == null ? -1:line.getLinePlayType();
  775 + if(linePlayType == 1)
831 776 textStr = hxTextFileToFtp(objects,lineId);// 环线行单文件内容
832   - else
  777 + else if (linePlayType == 0)
833 778 textStr = newTextFileToFTP(objects,lineId);/** 双向行单文件内容 @param:<objects:站点路由;lineId:线路ID>*/
834   -
835   - /*textStr = line.getName() + "\t" + "2" + "\r" + textStr;*/
836   -
  779 + else
  780 + resultMap.put("status","NOLinePlayType");// 线路无线路规划类型
837 781 textStr = line.getName() + " " + "2" + "\r" + textStr;
838   -
839 782 InputStream input = new ByteArrayInputStream(textStr.getBytes("gbk"));
840   -
841 783 /** 生成txt文件,上传ftp */
842 784 clientUtils.uploadFile(url, port, username, password, remotePath, textFileName, input);
843   -
844 785 // 创建打包实例
845 786 PackTarGZUtils packTarGZUtils= new PackTarGZUtils();
846   -
847 787 /** 获取txt文件 */
848 788 File textFile = clientUtils.GetFtpFile(url, port, username, password, remotePath, textFileName);
849   -
850 789 File target = new File(odlGzFileName);
851   -
852 790 // 将txt文件打包
853 791 File targetFile = PackTarGZUtils.compress(textFile, target);
854   -
855   - /*clientUtils.testUpLoadFromDisk(targetFile,targetFile.getName());*/
856   -
857 792 clientUtils.FTPUpLoadFromDisk(targetFile, targetFile.getName(), url, port, username, password, remotePath);
858   -
859 793 // 删除文件
860 794 textFile.delete();
861 795 targetFile.delete();
862   -
863 796 resultMap.put("status", ResponseCode.SUCCESS);
864   -
865 797 }else {
866   -
867 798 resultMap.put("status","NOTDATA");
868 799 }
869   -
870   -
871 800 } catch (Exception e) {
872   -
873 801 resultMap.put("status", ResponseCode.ERROR);
874   -
875 802 logger.error("save erro.", e);
876   -
877   - }
  803 + }
878 804 return resultMap;
879 805 }
  806 + // 判断线路走向是环线还是双向
880 807 public boolean ishxType(List<Object[]> listObj) {
881 808 boolean tag = true;
882 809 String pointBStr[] = null,pointEStr[] = null;
... ... @@ -889,9 +816,9 @@ public class StationRouteServiceImpl extends BaseServiceImpl&lt;StationRoute, Integ
889 816 if(Integer.valueOf(listObj.get(i)[8].toString())==1)
890 817 numzd++;
891 818 }
892   - Point p1 = new Point(Double.valueOf(pointBStr[0]),Double.valueOf(pointBStr[1]));
  819 + Point p1 = new Point(Double.valueOf(pointBStr[0]),Double.valueOf(pointBStr[1]));
893 820 Point p2 = new Point(Double.valueOf(pointEStr[0]),Double.valueOf(pointEStr[1]));
894   - if(GeoUtils.getDistance(p1, p2)>100 && numzd>2)
  821 + if(GeoUtils.getDistance(p1, p2)>100 && numzd>2)
895 822 tag = false;
896 823 return tag;
897 824 }
... ... @@ -1241,95 +1168,10 @@ public class StationRouteServiceImpl extends BaseServiceImpl&lt;StationRoute, Integ
1241 1168 int len = objects.size();
1242 1169  
1243 1170 if(objects.size()>0) {
1244   -
1245   - for(int i = 0 ; i < len; i++) {
1246   - Map<String, Object> tempM = new HashMap<String,Object>();
1247   -
1248   - tempM.put("stationRouteLine", objects.get(i)[0]);
1249   -
1250   - tempM.put("stationRouteStation", objects.get(i)[1]);
1251   -
1252   - tempM.put("stationRouteCode", objects.get(i)[2]);
1253   -
1254   - tempM.put("stationRouteLIneCode", objects.get(i)[3]);
1255   -
1256   - tempM.put("stationRouteStationMark", objects.get(i)[4]);
1257   -
1258   - tempM.put("stationOutStationNmber", objects.get(i)[5]);
1259   -
1260   - tempM.put("stationRoutedirections", objects.get(i)[6]);
1261   -
1262   - tempM.put("stationRouteDistances", objects.get(i)[7]);
1263   -
1264   - tempM.put("stationRouteToTime", objects.get(i)[8]);
1265   -
1266   - tempM.put("staitonRouteFirstTime", objects.get(i)[9]);
1267   -
1268   - tempM.put("stationRouteEndTime", objects.get(i)[10]);
1269   -
1270   - tempM.put("stationRouteDescriptions", objects.get(i)[11]);
1271   -
1272   - tempM.put("stationRouteDestroy", objects.get(i)[12]);
1273   -
1274   - tempM.put("stationRouteVersions", objects.get(i)[13]);
1275   -
1276   - tempM.put("stationRouteCreateBy", objects.get(i)[14]);
1277   -
1278   - tempM.put("stationRouteCreateDate", objects.get(i)[15]);
1279   -
1280   - tempM.put("stationRouteUpdateBy", objects.get(i)[16]);
1281   -
1282   - tempM.put("stationRouteUpdateDate", objects.get(i)[17]);
1283   -
1284   - tempM.put("stationId", objects.get(i)[18]);
1285   -
1286   - tempM.put("stationCode", objects.get(i)[19]);
1287   -
1288   - tempM.put("stationRouteName", objects.get(i)[20]);
1289   -
1290   - tempM.put("stationRoadCoding", objects.get(i)[21]);
1291   -
1292   - tempM.put("stationDbType", objects.get(i)[22]);
1293   -
1294   - tempM.put("stationJwpoints", objects.get(i)[23]);
1295   -
1296   - tempM.put("stationGlonx", objects.get(i)[24]);
1297   -
1298   - tempM.put("stationGlaty", objects.get(i)[25]);
1299   -
1300   - tempM.put("stationX", objects.get(i)[26]);
1301   -
1302   - tempM.put("stationY", objects.get(i)[27]);
1303   -
1304   - tempM.put("stationBPolyonGrid", objects.get(i)[28]);
1305   -
1306   - tempM.put("stationGPloyonGrid", objects.get(i)[29]);
1307   -
1308   - tempM.put("stationDestroy", objects.get(i)[30]);
1309   -
1310   - tempM.put("stationRadius", objects.get(i)[31]);
1311   -
1312   - tempM.put("stationShapesType", objects.get(i)[32]);
1313   -
1314   - tempM.put("stationVersions", objects.get(i)[33]);
1315   -
1316   - tempM.put("sttationDescriptions", objects.get(i)[34]);
1317   -
1318   - tempM.put("stationCreateBy", objects.get(i)[35]);
1319   -
1320   - tempM.put("stationCreateDate", objects.get(i)[36]);
1321   -
1322   - tempM.put("stationUpdateBy", objects.get(i)[37]);
1323   -
1324   - tempM.put("stationUpdateDate", objects.get(i)[38]);
1325   -
1326   - tempM.put("stationRouteId", objects.get(i)[39]);
1327   - tempM.put("zdmc", objects.get(i)[40]);
1328   -
1329   - resultList.add(tempM);
1330   - }
1331   -
1332   - }
  1171 +
  1172 + traversalStation(objects, resultList, len);
  1173 +
  1174 + }
1333 1175  
1334 1176 return resultList;
1335 1177 }
... ...
src/main/java/com/bsth/service/report/impl/SheetServiceImpl.java
... ... @@ -44,6 +44,7 @@ import com.bsth.util.BatchSaveUtils;
44 44 import com.bsth.util.ComparableChild;
45 45 import com.bsth.util.ComparableReal;
46 46 import com.bsth.util.ReportRelatedUtils;
  47 +import com.bsth.util.ReportUtils;
47 48 import com.google.common.util.concurrent.AbstractScheduledService.Scheduler;
48 49  
49 50 @Service
... ... @@ -611,6 +612,24 @@ public class SheetServiceImpl extends BaseServiceImpl&lt;Sheet, Integer&gt; implements
611 612 }
612 613  
613 614 }
  615 +
  616 + if(map.containsKey("type") && map.get("type").toString().equals("export")){
  617 + List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
  618 + Map<String, Object> m = new HashMap<String, Object>();
  619 + m.put("date", date);
  620 + m.put("endDate", endDate);
  621 + ReportUtils ee = new ReportUtils();
  622 + try {
  623 + listI.add(listmap.iterator());
  624 + String path = this.getClass().getResource("/").getPath() + "static/pages/forms/";
  625 + ee.excelReplace(listI, new Object[]{m}, path + "mould/" + "sheetList.xls",
  626 + path + "export/发车准点率"+date.replaceAll("-", "")+"-"+endDate.replaceAll("-", "")+".xls");
  627 + } catch (Exception e) {
  628 + // TODO: handle exception
  629 + e.printStackTrace();
  630 + }
  631 + }
  632 +
614 633 return listmap;
615 634 }
616 635  
... ... @@ -738,7 +757,33 @@ public class SheetServiceImpl extends BaseServiceImpl&lt;Sheet, Integer&gt; implements
738 757 // TODO Auto-generated catch block
739 758 e.printStackTrace();
740 759 }
741   -
  760 + }
  761 +
  762 + List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
  763 + Map<String, Object> m = new HashMap<String, Object>();
  764 + ReportUtils ee = new ReportUtils();
  765 + try {
  766 + List<Map<String, Object>> tempList = new ArrayList<Map<String, Object>>();
  767 + for(int i = 0; i < list.size(); i++){
  768 + Map<String, Object> temp = new HashMap<String, Object>();
  769 + Sheet s = list.get(i);
  770 + temp.put("id", i+1);
  771 + temp.put("date", s.getDate());
  772 + temp.put("line", s.getLine());
  773 + temp.put("zdname", s.getZdname());
  774 + temp.put("jhsj", s.getJhsj());
  775 + temp.put("sjsj", s.getSjsj());
  776 + temp.put("sfzd", s.getSfzd());
  777 + tempList.add(temp);
  778 + }
  779 + listI.add(tempList.iterator());
  780 + m.put("date", sheet.getDate());
  781 + String path = this.getClass().getResource("/").getPath() + "static/pages/forms/";
  782 + ee.excelReplace(listI, new Object[]{m}, path + "mould/sheetList2.xls",
  783 + path + "export/发车准点率"+sheet.getDate().replaceAll("-", "")+".xls");
  784 + } catch (Exception e) {
  785 + // TODO: handle exception
  786 + e.printStackTrace();
742 787 }
743 788  
744 789 return list;
... ... @@ -800,6 +845,24 @@ public class SheetServiceImpl extends BaseServiceImpl&lt;Sheet, Integer&gt; implements
800 845 listmap.add(newmap);
801 846 }
802 847 }
  848 +
  849 + if(map.containsKey("type") && map.get("type").toString().equals("export")){
  850 + List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
  851 + Map<String, Object> m = new HashMap<String, Object>();
  852 + m.put("date", date);
  853 + m.put("endDate", endDate);
  854 + ReportUtils ee = new ReportUtils();
  855 + try {
  856 + listI.add(listmap.iterator());
  857 + String path = this.getClass().getResource("/").getPath() + "static/pages/forms/";
  858 + ee.excelReplace(listI, new Object[]{m}, path + "mould/" + "sheetList1.xls",
  859 + path + "export/发车准点率"+date.replaceAll("-", "")+"-"+endDate.replaceAll("-", "")+".xls");
  860 + } catch (Exception e) {
  861 + // TODO: handle exception
  862 + e.printStackTrace();
  863 + }
  864 + }
  865 +
803 866 return listmap;
804 867 }
805 868  
... ...
src/main/java/com/bsth/service/schedule/datatools/TTInfoDetailDataToolsImpl.java
... ... @@ -556,15 +556,33 @@ public class TTInfoDetailDataToolsImpl implements DataToolsService, TTInfoDetail
556 556 Station station1 = stationService.findById(lpObjList.get(0).getStationRouteId1());
557 557 Station station2 = stationService.findById(lpObjList.get(1).getStationRouteId2());
558 558 PoiUtils.createStringXSSFCell(wb, lpHeadRow, (short) (1),
  559 + "报到", new Color(0x96b9d7));
  560 + PoiUtils.createStringXSSFCell(wb, lpHeadRow, (short) (2),
559 561 "出场", new Color(0x96b9d7));
560 562 for (int i = 1; i <= groupCount; i++) {
561   - PoiUtils.createStringXSSFCell(wb, lpHeadRow, (short) (i * 2),
562   - station1.getStationName(), new Color(0x96b9d7));
563 563 PoiUtils.createStringXSSFCell(wb, lpHeadRow, (short) (i * 2 + 1),
  564 + station1.getStationName(), new Color(0x96b9d7));
  565 + PoiUtils.createStringXSSFCell(wb, lpHeadRow, (short) (i * 2 + 2),
564 566 station2.getStationName(), new Color(0x96b9d7));
565 567 }
566   - PoiUtils.createStringXSSFCell(wb, lpHeadRow, (short) (groupCount * 2 + 2),
  568 + PoiUtils.createStringXSSFCell(wb, lpHeadRow, (short) (groupCount * 2 + 3),
567 569 "进场", new Color(0x96b9d7));
  570 + PoiUtils.createStringXSSFCell(wb, lpHeadRow, (short) (groupCount * 2 + 4),
  571 + "离场", new Color(0x96b9d7));
  572 +
  573 + // 路牌统计字段
  574 + PoiUtils.createStringXSSFCell(wb, lpHeadRow, (short) (groupCount * 2 + 5),
  575 + "总公里", new Color(0x96b9d7));
  576 + PoiUtils.createStringXSSFCell(wb, lpHeadRow, (short) (groupCount * 2 + 6),
  577 + "营业公里", new Color(0x96b9d7));
  578 + PoiUtils.createStringXSSFCell(wb, lpHeadRow, (short) (groupCount * 2 + 7),
  579 + "空驶公里", new Color(0x96b9d7));
  580 + PoiUtils.createStringXSSFCell(wb, lpHeadRow, (short) (groupCount * 2 + 8),
  581 + "总工时", new Color(0x96b9d7));
  582 + PoiUtils.createStringXSSFCell(wb, lpHeadRow, (short) (groupCount * 2 + 9),
  583 + "营业工时", new Color(0x96b9d7));
  584 + PoiUtils.createStringXSSFCell(wb, lpHeadRow, (short) (groupCount * 2 + 10),
  585 + "营运班次", new Color(0x96b9d7));
568 586  
569 587 // 构建每个路牌的班次数据
570 588 for (int i = 0; i < lpObjList.size(); i++) {
... ... @@ -572,34 +590,86 @@ public class TTInfoDetailDataToolsImpl implements DataToolsService, TTInfoDetail
572 590 XSSFRow lpRow = sheet.createRow((short) (i + 1));
573 591 PoiUtils.createStringXSSFCell(wb, lpRow, (short) 0, lpObj.getLpname());
574 592 PoiUtils.createBlankXSSFCell(wb, lpRow, (short) (1));
  593 + PoiUtils.createBlankXSSFCell(wb, lpRow, (short) (2));
575 594 for (int j = 1; j <= groupCount; j++) {
576   - PoiUtils.createBlankXSSFCell(wb, lpRow, (short) (j * 2));
577 595 PoiUtils.createBlankXSSFCell(wb, lpRow, (short) (j * 2 + 1));
  596 + PoiUtils.createBlankXSSFCell(wb, lpRow, (short) (j * 2 + 2));
578 597 }
579   - PoiUtils.createBlankXSSFCell(wb, lpRow, (short) (groupCount * 2 + 2));
  598 +
  599 + PoiUtils.createBlankXSSFCell(wb, lpRow, (short) (groupCount * 2 + 3));
  600 + PoiUtils.createBlankXSSFCell(wb, lpRow, (short) (groupCount * 2 + 4));
580 601  
581 602 for (BcObj bcObj : lpObj.getBcObjList()) {
582 603 if (bcObj.getBcType() == BcType.NORMAL) {
583   - Cell cell = lpRow.getCell((short) (bcObj.getGroupNo() * 2 + bcObj.getGroupBcNo() + 2));
  604 + Cell cell = lpRow.getCell((short) (bcObj.getGroupNo() * 2 + bcObj.getGroupBcNo() + 3));
584 605 cell.setCellValue(bcObj.getFcsj());
  606 +
  607 + } else if (bcObj.getBcType() == BcType.BD) {
  608 + if (bcObj.getGroupNo() == -1) {
  609 + Cell cell = lpRow.getCell((short) 1);
  610 + cell.setCellValue(bcObj.getFcsj());
  611 + } else if (bcObj.getGroupNo() > 0) { // 分班报到
  612 + Cell cell = lpRow.getCell((short) (bcObj.getGroupNo() * 2 + bcObj.getGroupBcNo() + 3));
  613 + cell.setCellValue("报" + bcObj.getFcsj());
  614 +
  615 + }
  616 +
585 617 } else if (bcObj.getBcType() == BcType.OUT) {
586   - Cell cell = lpRow.getCell((short) (1));
587   - cell.setCellValue(bcObj.getFcsj());
  618 + if (bcObj.getGroupNo() == -1) {
  619 + Cell cell = lpRow.getCell((short) (2));
  620 + cell.setCellValue(bcObj.getFcsj());
  621 + } else if (bcObj.getGroupNo() > 0) { // 分班出场
  622 + Cell cell = lpRow.getCell((short) (bcObj.getGroupNo() * 2 + bcObj.getGroupBcNo() + 3));
  623 + cell.setCellValue("出" + bcObj.getFcsj());
  624 + }
  625 +
588 626 } else if (bcObj.getBcType() == BcType.IN) {
589   - Cell cell = lpRow.getCell((short) (groupCount * 2 + 2));
590   - cell.setCellValue(bcObj.getFcsj());
  627 + if (bcObj.getGroupNo() == -2) {
  628 + Cell cell = lpRow.getCell((short) (groupCount * 2 + 3));
  629 + cell.setCellValue(bcObj.getFcsj());
  630 + } else if (bcObj.getGroupNo() > 0) { //分班进场
  631 + Cell cell = lpRow.getCell((short) (bcObj.getGroupNo() * 2 + bcObj.getGroupBcNo() + 3));
  632 + // 停驶用 ※
  633 + cell.setCellValue(bcObj.getFcsj() + "X");
  634 + }
  635 +
  636 + } else if (bcObj.getBcType() == BcType.LC) {
  637 + if (bcObj.getGroupNo() == -2) {
  638 + Cell cell = lpRow.getCell((short) (groupCount * 2 + 4));
  639 + cell.setCellValue(bcObj.getFcsj());
  640 + }
  641 +
591 642 }
592 643 }
  644 +
  645 + // 路牌统计字段
  646 + PoiUtils.createDoubleXSSFCell(wb, lpRow, (short) (groupCount * 2 + 5), lpObj.getZlc());
  647 + PoiUtils.createDoubleXSSFCell(wb, lpRow, (short) (groupCount * 2 + 6), lpObj.getYylc());
  648 + PoiUtils.createDoubleXSSFCell(wb, lpRow, (short) (groupCount * 2 + 7), lpObj.getKslc());
  649 + PoiUtils.createStringXSSFCell(wb, lpRow, (short) (groupCount * 2 + 8),
  650 + String.format("%d小时%d分钟", (int) (lpObj.getZgs() / 60), (int) (lpObj.getZgs() % 60)));
  651 + PoiUtils.createStringXSSFCell(wb, lpRow, (short) (groupCount * 2 + 9),
  652 + String.format("%d小时%d分钟", (int) (lpObj.getYygs() / 60), (int) (lpObj.getYygs() % 60)));
  653 + PoiUtils.createIntegerXSSFCell(wb, lpRow, (short) (groupCount * 2 + 10), lpObj.getYybc());
  654 +
593 655 }
594 656  
595 657 // 自适应单元格长宽
596 658 sheet.autoSizeColumn(0);
597 659 sheet.autoSizeColumn(1);
  660 + sheet.autoSizeColumn(2);
598 661 for (int i = 1; i <= groupCount; i++) {
599   - sheet.autoSizeColumn(i * 2);
600 662 sheet.autoSizeColumn(i * 2 + 1);
  663 + sheet.autoSizeColumn(i * 2 + 2);
601 664 }
602   -
  665 + sheet.autoSizeColumn(groupCount * 2 + 3);
  666 + sheet.autoSizeColumn(groupCount * 2 + 4);
  667 + sheet.autoSizeColumn(groupCount * 2 + 5);
  668 + sheet.autoSizeColumn(groupCount * 2 + 6);
  669 + sheet.autoSizeColumn(groupCount * 2 + 7);
  670 + sheet.autoSizeColumn(groupCount * 2 + 8);
  671 + sheet.autoSizeColumn(groupCount * 2 + 9);
  672 + sheet.autoSizeColumn(groupCount * 2 + 10);
603 673 }
604 674  
605 675 @Override
... ...
src/main/java/com/bsth/service/schedule/datatools/TTinfoDetailDynamicData.java
1   -package com.bsth.service.schedule.datatools;
2   -
3   -import com.bsth.service.schedule.exception.ScheduleException;
4   -import com.bsth.service.schedule.utils.DataToolsFile;
5   -import com.fasterxml.jackson.annotation.JsonCreator;
6   -import com.fasterxml.jackson.annotation.JsonValue;
7   -
8   -import java.util.List;
9   -
10   -/**
11   - * 动态时刻表数据。
12   - */
13   -public interface TTinfoDetailDynamicData {
14   -
15   - //---------------------- 生成时刻表用对象(以下) ---------------------//
16   - public static enum BcType { // 班次类型枚举
17   - IN("in"), // 进场
18   - OUT("out"), // 出场
19   - BD("bd"), // 早例保
20   - LC("lc"), // 晚例保
21   - NORMAL("normal"); // 正常
22   - private String flag;
23   -
24   - @JsonCreator
25   - private BcType(String flag) {
26   - this.flag = flag;
27   - }
28   -
29   - @JsonValue
30   - public String getFlag() {
31   - return flag;
32   - }
33   -
34   - public void setFlag(String flag) {
35   - this.flag = flag;
36   - }
37   - }
38   -
39   - public static class BcObj { // 班次对象
40   - /** 班次时间 */
41   - private Integer bcsj;
42   - /** 停站时间 */
43   - private Integer ssj;
44   - /** 吃饭时间 */
45   - private Integer eatsj;
46   -
47   - /** 停车场id */
48   - private Integer tccid;
49   - /** 起点站id */
50   - private Integer qdzid;
51   - /** 终点站id */
52   - private Integer zdzid;
53   -
54   - /** 是否上行 */
55   - private Boolean isUp;
56   -
57   - /** 班次类型 */
58   - private BcType bcType;
59   - /** 发车时刻 */
60   - private String fcsj;
61   - /** 用于统计的发车时间描述(把进出场,保养,吃饭时间写在一起) */
62   - private String fcsjDesc;
63   -
64   - /** 第几圈(从1开始) */
65   - private Integer groupNo;
66   - /** 圈里第几个班次(1或者2) */
67   - private Integer groupBcNo;
68   -
69   - public Integer getBcsj() {
70   - return bcsj;
71   - }
72   -
73   - public void setBcsj(Integer bcsj) {
74   - this.bcsj = bcsj;
75   - }
76   -
77   - public Integer getSsj() {
78   - return ssj;
79   - }
80   -
81   - public void setSsj(Integer ssj) {
82   - this.ssj = ssj;
83   - }
84   -
85   - public Integer getEatsj() {
86   - return eatsj;
87   - }
88   -
89   - public void setEatsj(Integer eatsj) {
90   - this.eatsj = eatsj;
91   - }
92   -
93   - public Integer getTccid() {
94   - return tccid;
95   - }
96   -
97   - public void setTccid(Integer tccid) {
98   - this.tccid = tccid;
99   - }
100   -
101   - public Integer getQdzid() {
102   - return qdzid;
103   - }
104   -
105   - public void setQdzid(Integer qdzid) {
106   - this.qdzid = qdzid;
107   - }
108   -
109   - public Integer getZdzid() {
110   - return zdzid;
111   - }
112   -
113   - public void setZdzid(Integer zdzid) {
114   - this.zdzid = zdzid;
115   - }
116   -
117   - public BcType getBcType() {
118   - return bcType;
119   - }
120   -
121   - public void setBcType(BcType bcType) {
122   - this.bcType = bcType;
123   - }
124   -
125   - public String getFcsj() {
126   - return fcsj;
127   - }
128   -
129   - public void setFcsj(String fcsj) {
130   - this.fcsj = fcsj;
131   - }
132   -
133   - public Boolean getIsUp() {
134   - return isUp;
135   - }
136   -
137   - public void setIsUp(Boolean isUp) {
138   - this.isUp = isUp;
139   - }
140   -
141   - public Integer getGroupNo() {
142   - return groupNo;
143   - }
144   -
145   - public void setGroupNo(Integer groupNo) {
146   - this.groupNo = groupNo;
147   - }
148   -
149   - public Integer getGroupBcNo() {
150   - return groupBcNo;
151   - }
152   -
153   - public void setGroupBcNo(Integer groupBcNo) {
154   - this.groupBcNo = groupBcNo;
155   - }
156   -
157   - public Boolean getUp() {
158   - return isUp;
159   - }
160   -
161   - public void setUp(Boolean up) {
162   - isUp = up;
163   - }
164   -
165   - public String getFcsjDesc() {
166   - return fcsjDesc;
167   - }
168   -
169   - public void setFcsjDesc(String fcsjDesc) {
170   - this.fcsjDesc = fcsjDesc;
171   - }
172   - }
173   -
174   - public static class LpObj { // 路牌对象
175   - /** 路牌名字 */
176   - private String lpname;
177   - /** 每圈的第一个班次是否上行 */
178   - private Boolean isUp;
179   -
180   - /** 第一个班次起点站路由id */
181   - private Integer stationRouteId1;
182   - /** 第二个班次起点站路由id */
183   - private Integer stationRouteId2;
184   -
185   - /** 班次列表 */
186   - private List<BcObj> bcObjList;
187   - /** 总圈数 */
188   - private Integer groupCount;
189   -
190   - /** 总工时 */
191   - private Double zgs;
192   - /** 总班次 */
193   - private Integer zbc;
194   -
195   -
196   - public String getLpname() {
197   - return lpname;
198   - }
199   -
200   - public void setLpname(String lpname) {
201   - this.lpname = lpname;
202   - }
203   -
204   - public Boolean getIsUp() {
205   - return isUp;
206   - }
207   -
208   - public void setIsUp(Boolean isUp) {
209   - this.isUp = isUp;
210   - }
211   -
212   - public List<BcObj> getBcObjList() {
213   - return bcObjList;
214   - }
215   -
216   - public void setBcObjList(List<BcObj> bcObjList) {
217   - this.bcObjList = bcObjList;
218   - }
219   -
220   - public Integer getGroupCount() {
221   - return groupCount;
222   - }
223   -
224   - public void setGroupCount(Integer groupCount) {
225   - this.groupCount = groupCount;
226   - }
227   -
228   - public Double getZgs() {
229   - return zgs;
230   - }
231   -
232   - public void setZgs(Double zgs) {
233   - this.zgs = zgs;
234   - }
235   -
236   - public Integer getZbc() {
237   - return zbc;
238   - }
239   -
240   - public void setZbc(Integer zbc) {
241   - this.zbc = zbc;
242   - }
243   -
244   - public Integer getStationRouteId1() {
245   - return stationRouteId1;
246   - }
247   -
248   - public void setStationRouteId1(Integer stationRouteId1) {
249   - this.stationRouteId1 = stationRouteId1;
250   - }
251   -
252   - public Integer getStationRouteId2() {
253   - return stationRouteId2;
254   - }
255   -
256   - public void setStationRouteId2(Integer stationRouteId2) {
257   - this.stationRouteId2 = stationRouteId2;
258   - }
259   - }
260   -
261   - public static class StatInfo { // 统计数据对象
262   - /** 统计项目 */
263   - private String statItem;
264   - /** 统计值 */
265   - private Double statValue;
266   -
267   - public String getStatItem() {
268   - return statItem;
269   - }
270   -
271   - public void setStatItem(String statItem) {
272   - this.statItem = statItem;
273   - }
274   -
275   - public Double getStatValue() {
276   - return statValue;
277   - }
278   -
279   - public void setStatValue(Double statValue) {
280   - this.statValue = statValue;
281   - }
282   - }
283   -
284   - public static class DTInfos { // 所有数据信息
285   - /** 路牌班次数据列表 */
286   - private List<LpObj> lpObjList;
287   - /** 统计数据列表 */
288   - private List<StatInfo> statInfoList;
289   -
290   - public List<LpObj> getLpObjList() {
291   - return lpObjList;
292   - }
293   -
294   - public void setLpObjList(List<LpObj> lpObjList) {
295   - this.lpObjList = lpObjList;
296   - }
297   -
298   - public List<StatInfo> getStatInfoList() {
299   - return statInfoList;
300   - }
301   -
302   - public void setStatInfoList(List<StatInfo> statInfoList) {
303   - this.statInfoList = statInfoList;
304   - }
305   - }
306   -
307   - //---------------------- 生成时刻表用对象(以上) ---------------------//
308   -
309   - /**
310   - * 导出动态时刻表数据。
311   - * @param dtInfos
312   - * @return
313   - * @throws ScheduleException
314   - */
315   - public DataToolsFile exportDynamicTTinfo(DTInfos dtInfos) throws ScheduleException;
316   -}
  1 +package com.bsth.service.schedule.datatools;
  2 +
  3 +import com.bsth.service.schedule.exception.ScheduleException;
  4 +import com.bsth.service.schedule.utils.DataToolsFile;
  5 +import com.fasterxml.jackson.annotation.JsonCreator;
  6 +import com.fasterxml.jackson.annotation.JsonValue;
  7 +
  8 +import java.util.List;
  9 +
  10 +/**
  11 + * 动态时刻表数据。
  12 + */
  13 +public interface TTinfoDetailDynamicData {
  14 +
  15 + //---------------------- 生成时刻表用对象(以下) ---------------------//
  16 + public static enum BcType { // 班次类型枚举
  17 + IN("in"), // 进场
  18 + OUT("out"), // 出场
  19 + BD("bd"), // 早例保
  20 + LC("lc"), // 晚例保
  21 + NORMAL("normal"); // 正常
  22 + private String flag;
  23 +
  24 + @JsonCreator
  25 + private BcType(String flag) {
  26 + this.flag = flag;
  27 + }
  28 +
  29 + @JsonValue
  30 + public String getFlag() {
  31 + return flag;
  32 + }
  33 +
  34 + public void setFlag(String flag) {
  35 + this.flag = flag;
  36 + }
  37 + }
  38 +
  39 + public static class BcObj { // 班次对象
  40 + /** 班次时间 */
  41 + private Integer bcsj;
  42 + /** 停站时间 */
  43 + private Integer ssj;
  44 + /** 吃饭时间 */
  45 + private Integer eatsj;
  46 +
  47 + /** 停车场id */
  48 + private Integer tccid;
  49 + /** 起点站id */
  50 + private Integer qdzid;
  51 + /** 终点站id */
  52 + private Integer zdzid;
  53 +
  54 + /** 是否上行 */
  55 + private Boolean isUp;
  56 +
  57 + /** 班次类型 */
  58 + private BcType bcType;
  59 + /** 发车时刻 */
  60 + private String fcsj;
  61 + /** 用于统计的发车时间描述(把进出场,保养,吃饭时间写在一起) */
  62 + private String fcsjDesc;
  63 +
  64 + /** 第几圈(从1开始) */
  65 + private Integer groupNo;
  66 + /** 圈里第几个班次(1或者2) */
  67 + private Integer groupBcNo;
  68 +
  69 + public Integer getBcsj() {
  70 + return bcsj;
  71 + }
  72 +
  73 + public void setBcsj(Integer bcsj) {
  74 + this.bcsj = bcsj;
  75 + }
  76 +
  77 + public Integer getSsj() {
  78 + return ssj;
  79 + }
  80 +
  81 + public void setSsj(Integer ssj) {
  82 + this.ssj = ssj;
  83 + }
  84 +
  85 + public Integer getEatsj() {
  86 + return eatsj;
  87 + }
  88 +
  89 + public void setEatsj(Integer eatsj) {
  90 + this.eatsj = eatsj;
  91 + }
  92 +
  93 + public Integer getTccid() {
  94 + return tccid;
  95 + }
  96 +
  97 + public void setTccid(Integer tccid) {
  98 + this.tccid = tccid;
  99 + }
  100 +
  101 + public Integer getQdzid() {
  102 + return qdzid;
  103 + }
  104 +
  105 + public void setQdzid(Integer qdzid) {
  106 + this.qdzid = qdzid;
  107 + }
  108 +
  109 + public Integer getZdzid() {
  110 + return zdzid;
  111 + }
  112 +
  113 + public void setZdzid(Integer zdzid) {
  114 + this.zdzid = zdzid;
  115 + }
  116 +
  117 + public BcType getBcType() {
  118 + return bcType;
  119 + }
  120 +
  121 + public void setBcType(BcType bcType) {
  122 + this.bcType = bcType;
  123 + }
  124 +
  125 + public String getFcsj() {
  126 + return fcsj;
  127 + }
  128 +
  129 + public void setFcsj(String fcsj) {
  130 + this.fcsj = fcsj;
  131 + }
  132 +
  133 + public Boolean getIsUp() {
  134 + return isUp;
  135 + }
  136 +
  137 + public void setIsUp(Boolean isUp) {
  138 + this.isUp = isUp;
  139 + }
  140 +
  141 + public Integer getGroupNo() {
  142 + return groupNo;
  143 + }
  144 +
  145 + public void setGroupNo(Integer groupNo) {
  146 + this.groupNo = groupNo;
  147 + }
  148 +
  149 + public Integer getGroupBcNo() {
  150 + return groupBcNo;
  151 + }
  152 +
  153 + public void setGroupBcNo(Integer groupBcNo) {
  154 + this.groupBcNo = groupBcNo;
  155 + }
  156 +
  157 + public Boolean getUp() {
  158 + return isUp;
  159 + }
  160 +
  161 + public void setUp(Boolean up) {
  162 + isUp = up;
  163 + }
  164 +
  165 + public String getFcsjDesc() {
  166 + return fcsjDesc;
  167 + }
  168 +
  169 + public void setFcsjDesc(String fcsjDesc) {
  170 + this.fcsjDesc = fcsjDesc;
  171 + }
  172 + }
  173 +
  174 + public static class LpObj { // 路牌对象
  175 + /** 路牌名字 */
  176 + private String lpname;
  177 + /** 每圈的第一个班次是否上行 */
  178 + private Boolean isUp;
  179 +
  180 + /** 第一个班次起点站路由id */
  181 + private Integer stationRouteId1;
  182 + /** 第二个班次起点站路由id */
  183 + private Integer stationRouteId2;
  184 +
  185 + /** 班次列表 */
  186 + private List<BcObj> bcObjList;
  187 + /** 总圈数 */
  188 + private Integer groupCount;
  189 +
  190 + //---------------- 路牌统计 ---------------//
  191 + /** 总里程 */
  192 + private Double zlc;
  193 + /** 营运里程 */
  194 + private Double yylc;
  195 + /** 空驶里程 */
  196 + private Double kslc;
  197 + /** 总工时 */
  198 + private Double zgs;
  199 + /** 总班次 */
  200 + private Integer zbc;
  201 + /** 营运工时 */
  202 + private Double yygs;
  203 + /** 营运班次 */
  204 + private Integer yybc;
  205 +
  206 + public String getLpname() {
  207 + return lpname;
  208 + }
  209 +
  210 + public void setLpname(String lpname) {
  211 + this.lpname = lpname;
  212 + }
  213 +
  214 + public Boolean getIsUp() {
  215 + return isUp;
  216 + }
  217 +
  218 + public void setIsUp(Boolean isUp) {
  219 + this.isUp = isUp;
  220 + }
  221 +
  222 + public List<BcObj> getBcObjList() {
  223 + return bcObjList;
  224 + }
  225 +
  226 + public void setBcObjList(List<BcObj> bcObjList) {
  227 + this.bcObjList = bcObjList;
  228 + }
  229 +
  230 + public Integer getGroupCount() {
  231 + return groupCount;
  232 + }
  233 +
  234 + public void setGroupCount(Integer groupCount) {
  235 + this.groupCount = groupCount;
  236 + }
  237 +
  238 + public Integer getStationRouteId1() {
  239 + return stationRouteId1;
  240 + }
  241 +
  242 + public void setStationRouteId1(Integer stationRouteId1) {
  243 + this.stationRouteId1 = stationRouteId1;
  244 + }
  245 +
  246 + public Integer getStationRouteId2() {
  247 + return stationRouteId2;
  248 + }
  249 +
  250 + public void setStationRouteId2(Integer stationRouteId2) {
  251 + this.stationRouteId2 = stationRouteId2;
  252 + }
  253 +
  254 + public Boolean getUp() {
  255 + return isUp;
  256 + }
  257 +
  258 + public void setUp(Boolean up) {
  259 + isUp = up;
  260 + }
  261 +
  262 + public Double getZlc() {
  263 + return zlc;
  264 + }
  265 +
  266 + public void setZlc(Double zlc) {
  267 + this.zlc = zlc;
  268 + }
  269 +
  270 + public Double getYylc() {
  271 + return yylc;
  272 + }
  273 +
  274 + public void setYylc(Double yylc) {
  275 + this.yylc = yylc;
  276 + }
  277 +
  278 + public Double getKslc() {
  279 + return kslc;
  280 + }
  281 +
  282 + public void setKslc(Double kslc) {
  283 + this.kslc = kslc;
  284 + }
  285 +
  286 + public Double getZgs() {
  287 + return zgs;
  288 + }
  289 +
  290 + public void setZgs(Double zgs) {
  291 + this.zgs = zgs;
  292 + }
  293 +
  294 + public Integer getZbc() {
  295 + return zbc;
  296 + }
  297 +
  298 + public void setZbc(Integer zbc) {
  299 + this.zbc = zbc;
  300 + }
  301 +
  302 + public Double getYygs() {
  303 + return yygs;
  304 + }
  305 +
  306 + public void setYygs(Double yygs) {
  307 + this.yygs = yygs;
  308 + }
  309 +
  310 + public Integer getYybc() {
  311 + return yybc;
  312 + }
  313 +
  314 + public void setYybc(Integer yybc) {
  315 + this.yybc = yybc;
  316 + }
  317 + }
  318 +
  319 + public static class StatInfo { // 统计数据对象
  320 + /** 统计项目 */
  321 + private String statItem;
  322 + /** 统计值 */
  323 + private Double statValue;
  324 +
  325 + public String getStatItem() {
  326 + return statItem;
  327 + }
  328 +
  329 + public void setStatItem(String statItem) {
  330 + this.statItem = statItem;
  331 + }
  332 +
  333 + public Double getStatValue() {
  334 + return statValue;
  335 + }
  336 +
  337 + public void setStatValue(Double statValue) {
  338 + this.statValue = statValue;
  339 + }
  340 + }
  341 +
  342 + public static class DTInfos { // 所有数据信息
  343 + /** 路牌班次数据列表 */
  344 + private List<LpObj> lpObjList;
  345 + /** 统计数据列表 */
  346 + private List<StatInfo> statInfoList;
  347 +
  348 + public List<LpObj> getLpObjList() {
  349 + return lpObjList;
  350 + }
  351 +
  352 + public void setLpObjList(List<LpObj> lpObjList) {
  353 + this.lpObjList = lpObjList;
  354 + }
  355 +
  356 + public List<StatInfo> getStatInfoList() {
  357 + return statInfoList;
  358 + }
  359 +
  360 + public void setStatInfoList(List<StatInfo> statInfoList) {
  361 + this.statInfoList = statInfoList;
  362 + }
  363 + }
  364 +
  365 + //---------------------- 生成时刻表用对象(以上) ---------------------//
  366 +
  367 + /**
  368 + * 导出动态时刻表数据。
  369 + * @param dtInfos
  370 + * @return
  371 + * @throws ScheduleException
  372 + */
  373 + public DataToolsFile exportDynamicTTinfo(DTInfos dtInfos) throws ScheduleException;
  374 +}
317 375 \ No newline at end of file
... ...
src/main/java/com/bsth/service/schedule/impl/PeopleCarPlanServiceImpl.java
... ... @@ -636,8 +636,9 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
636 636  
637 637 if(model.length() != 0){
638 638 // sql = "select * from bsth_c_s_ttinfo_detail where ttinfo = '"+model+"' and bc_type != 'in' and bc_type != 'out'";
639   - sql = "select id from bsth_c_s_sp_info where tt_info = '" + model + "' and bc_type != 'in' and bc_type != 'out' and bc_type != 'ldks'";
640   -
  639 + sql = "select id from bsth_c_s_sp_info where tt_info = '" + model + "' and bc_type != 'in' and bc_type != 'out'" +
  640 + " and bc_type != 'ldks' and schedule_date >= '"+startDate+"' and schedule_date <= '"+endDate+"'";
  641 +
641 642 ttList = jdbcTemplate.query(sql,
642 643 new RowMapper<Long>(){
643 644 @Override
... ... @@ -1208,7 +1209,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
1208 1209 try {
1209 1210 long qyrq = sdf.parse(m.get("qyrq").toString()).getTime();
1210 1211 if(qyrq > date2.getTime())
1211   - break;
  1212 + break DO;
1212 1213 } catch (ParseException e) {
1213 1214 // TODO Auto-generated catch block
1214 1215 e.printStackTrace();
... ... @@ -1344,7 +1345,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
1344 1345 tempMap.put("date", date.substring(5));
1345 1346 tempMap.put("line", xlName);
1346 1347 List<Long> up1 = new ArrayList<Long>();
1347   - List<Long> up2 = new ArrayList<Long>();;
  1348 + List<Long> up2 = new ArrayList<Long>();
1348 1349 List<Long> dn1 = new ArrayList<Long>();
1349 1350 List<Long> dn2 = new ArrayList<Long>();
1350 1351 Map<Long, ScheduleRealInfo> up1Map = new HashMap<Long, ScheduleRealInfo>();
... ... @@ -1484,7 +1485,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
1484 1485 }
1485 1486  
1486 1487 try {
1487   - String sql = "select a.schedule_date_str, a.real_exec_date, a.xl_name, a.fcsj, a.fcsj_actual, a.zdsj, a.zdsj_actual, a.qdz_name, a.zdz_name, a.xl_dir, a.status, a.gs_name, a.fgs_name,"
  1488 + String sql = "select a.schedule_date_str, a.real_exec_date, a.xl_bm, a.xl_name, a.fcsj, a.fcsj_actual, a.zdsj, a.zdsj_actual, a.qdz_name, a.zdz_name, a.xl_dir, a.status, a.gs_name, a.fgs_name,"
1488 1489 + " a.cc_service, a.remarks, a.adjust_exps, b.start_opt from bsth_c_s_sp_info_real a left join (select line, start_opt from bsth_c_line_config order by id desc) b on a.xl_bm = b.line"
1489 1490 + " where schedule_date_str >= '"+startDate+"' and schedule_date_str <= '"+endDate+"'"
1490 1491 + " and bc_type != 'in' and bc_type != 'out' and bc_type != 'ldks' and bc_type != 'region'";
... ... @@ -1501,6 +1502,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
1501 1502 schedule.setScheduleDateStr(rs.getString("schedule_date_str"));
1502 1503 schedule.setRealExecDate(rs.getString("real_exec_date"));
1503 1504 schedule.setXlName(rs.getString("xl_name"));
  1505 + schedule.setXlBm(rs.getString("xl_bm"));
1504 1506 schedule.setFcsj(rs.getString("fcsj"));
1505 1507 schedule.setFcsjActual(rs.getString("fcsj_actual"));
1506 1508 schedule.setZdsj(rs.getString("zdsj"));
... ... @@ -1552,6 +1554,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
1552 1554 }
1553 1555  
1554 1556 Map<String, Map<String, List<ScheduleRealInfo>>> keyMap = new HashMap<String, Map<String,List<ScheduleRealInfo>>>();
  1557 + Map<String, String> xlMap = new HashMap<String, String>();
1555 1558 String companyName = "", subCompanyName = "";
1556 1559  
1557 1560 for(ScheduleRealInfo s : list){
... ... @@ -1569,6 +1572,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
1569 1572 companyName = s.getGsName();
1570 1573 if(subCompanyName.length()==0&&s.getFgsName()!=null&&s.getFgsName().trim().length()!=0)
1571 1574 subCompanyName = s.getFgsName();
  1575 + xlMap.put(xlName, s.getXlBm());
1572 1576 }
1573 1577  
1574 1578 List<Map<String, Object>> mapList = new ArrayList<Map<String, Object>>();
... ... @@ -1589,9 +1593,11 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
1589 1593 String date = dateMap.get(l);
1590 1594 Map<String, Object> temp = new HashMap<String, Object>();
1591 1595 temp.put("date", date.substring(5));
  1596 + temp.put("dates", date);
1592 1597 temp.put("line", xlName);
  1598 + temp.put("xlbm", xlMap.get(xlName));
1593 1599 List<Long> up1 = new ArrayList<Long>();
1594   - List<Long> up2 = new ArrayList<Long>();;
  1600 + List<Long> up2 = new ArrayList<Long>();
1595 1601 List<Long> dn1 = new ArrayList<Long>();
1596 1602 List<Long> dn2 = new ArrayList<Long>();
1597 1603 Map<Long, ScheduleRealInfo> up1Map = new HashMap<Long, ScheduleRealInfo>();
... ... @@ -1638,6 +1644,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
1638 1644 } else {
1639 1645 Map<String, Object> m = new HashMap<String, Object>();
1640 1646 m.put("date", date.substring(5));
  1647 + m.put("dates", date);
1641 1648 m.put("line", xlName);
1642 1649 m.put("firstOrLast", "上行首发");
1643 1650 m.put("qdz", s1.getQdzName());
... ... @@ -1654,6 +1661,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
1654 1661 } else {
1655 1662 Map<String, Object> m = new HashMap<String, Object>();
1656 1663 m.put("date", date.substring(5));
  1664 + m.put("dates", date);
1657 1665 m.put("line", xlName);
1658 1666 m.put("firstOrLast", "上行末发");
1659 1667 m.put("qdz", s3.getQdzName());
... ... @@ -1698,6 +1706,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
1698 1706 } else {
1699 1707 Map<String, Object> m = new HashMap<String, Object>();
1700 1708 m.put("date", date.substring(5));
  1709 + m.put("dates", date);
1701 1710 m.put("line", xlName);
1702 1711 m.put("firstOrLast", "下行首发");
1703 1712 m.put("qdz", s1.getQdzName());
... ... @@ -1715,6 +1724,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
1715 1724 } else {
1716 1725 Map<String, Object> m = new HashMap<String, Object>();
1717 1726 m.put("date", date.substring(5));
  1727 + m.put("dates", date);
1718 1728 m.put("line", xlName);
1719 1729 m.put("firstOrLast", "下行末发");
1720 1730 m.put("qdz", s3.getQdzName());
... ... @@ -1744,8 +1754,9 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
1744 1754 tempMap.put("map", tempList);
1745 1755 tempMap.put("company", companyName);
1746 1756 tempMap.put("subCompany", subCompanyName);
1747   - tempMap.put("date", dates);
  1757 + tempMap.put("xlbm", xlMap.get(xlName));
1748 1758 tempMap.put("line", xlName);
  1759 + tempMap.put("date", dates);
1749 1760 tempMap.put("jhbc", jhbc);
1750 1761 tempMap.put("sjbc", sjbc);
1751 1762 tempMap.put("zdl", (jhbc<1?"0":nf.format((float) sjbc / jhbc *100)) + "%");
... ... @@ -1790,6 +1801,36 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
1790 1801 // TODO: handle exception
1791 1802 e.printStackTrace();
1792 1803 }
  1804 + } else if(type.equals("exportMap")){
  1805 + List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
  1806 + Map<String,Object> m = new HashMap<String, Object>();
  1807 + ReportUtils ee = new ReportUtils();
  1808 + try {
  1809 + if(resList.size() > 0)
  1810 + listI.add(((List<Map<String, Object>>)resList.get(0).get("map")).iterator());
  1811 + listI.add(resList.iterator());
  1812 + String path = this.getClass().getResource("/").getPath()+"static/pages/forms/";
  1813 + ee.excelReplace(listI, new Object[] { tempMap }, path+"mould/firstAndLastBus_map.xls",
  1814 + path+"export/线路首末班明细.xls");
  1815 + } catch (Exception e) {
  1816 + // TODO: handle exception
  1817 + e.printStackTrace();
  1818 + }
  1819 + } else if(type.equals("delay_export")){
  1820 + List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
  1821 + Map<String,Object> m = new HashMap<String, Object>();
  1822 + ReportUtils ee = new ReportUtils();
  1823 + try {
  1824 + if(resList.size() > 0)
  1825 + listI.add(((List<Map<String, Object>>)resList.get(resList.size() - 1).get("map")).iterator());
  1826 + listI.add(resList.iterator());
  1827 + String path = this.getClass().getResource("/").getPath()+"static/pages/forms/";
  1828 + ee.excelReplace(listI, new Object[] { tempMap }, path+"mould/firstAndLastBus_delay.xls",
  1829 + path+"export/首末班误点班次.xls");
  1830 + } catch (Exception e) {
  1831 + // TODO: handle exception
  1832 + e.printStackTrace();
  1833 + }
1793 1834 }
1794 1835  
1795 1836 return resList;
... ...
src/main/java/com/bsth/service/schedule/utils/PoiUtils.java
... ... @@ -82,7 +82,7 @@ public class PoiUtils {
82 82  
83 83 public static XSSFCell createDoubleXSSFCell(
84 84 XSSFWorkbook xssfWorkbook, XSSFRow xssfRow, short column, Double value) {
85   - return createXSSFCell(
  85 + XSSFCell xssfCell = createXSSFCell(
86 86 xssfWorkbook, xssfRow, column,
87 87 value, XSSFCell.CELL_TYPE_NUMERIC,
88 88 HorizontalAlignment.CENTER, VerticalAlignment.CENTER,
... ... @@ -90,6 +90,10 @@ public class PoiUtils {
90 90 (short) 13, new Color(0x2765A7), "宋体",
91 91 new Color(0xffffff), FillPatternType.SOLID_FOREGROUND
92 92 );
  93 +
  94 + DataFormat dataFormat = xssfWorkbook.createDataFormat();
  95 + xssfCell.getCellStyle().setDataFormat(dataFormat.getFormat("0.00"));
  96 + return xssfCell;
93 97 }
94 98  
95 99 public static XSSFCell createIntegerXSSFCell(
... ...
src/main/resources/static/pages/base/carpark/js/carpark-list-table.js
... ... @@ -30,7 +30,7 @@
30 30 var branchMap = new Map();
31 31 initCompanySelect2(function(array) {
32 32 $.each(array, function() {
33   - companyMap[this.businessCode] = this.businessName;
  33 + companyMap[this.businessCode] = this.busi nessName;
34 34 // companyMap.put(this.businessCode.toString(), this.businessName);
35 35 if(this.businessCode != null || this.businessCode !=''){
36 36 /** 查询出所属公司下的分公司名称和相应分公司代码 @param:<upCode_eq:公司代码> */
... ...
src/main/resources/static/pages/base/line/js/line-list-table.js
... ... @@ -357,6 +357,9 @@
357 357 }else if(data.status=='NOTDATA') {
358 358 // 弹出添加成功提示消息
359 359 layer.msg('系统无线路【'+ lineName +'】的站点与路段信息!');
  360 + }else if(data.status=='NOLinePlayType') {
  361 + // 弹出添加成功提示消息
  362 + layer.msg('无法识别【'+ lineName +'】的线路规划类型,请设置为双向/环线!');
360 363 }
361 364 });
362 365 }
... ...
src/main/resources/static/pages/base/lineversions/js/lineversions-list-table.js
... ... @@ -6,8 +6,8 @@
6 6 // 关闭左侧栏
7 7 if (!$('body').hasClass('page-sidebar-closed')) {$('.menu-toggler.sidebar-toggler').click();}
8 8 // 定义 page : 当前页;initPag ; icheckOptions:选择框
9   - var page = 0,
10   - initPag,
  9 + window.page = 0;
  10 + var initPag,
11 11 icheckOptions = {checkboxClass: 'icheckbox_flat-blue',increaseArea: '20%'},
12 12 storage = window.localStorage;
13 13 if(storage.xlName_AgursData!=null && storage.xlName_AgursData !='') {
... ... @@ -301,7 +301,6 @@
301 301 });
302 302 // 线路版本编辑
303 303 $(document).on('click', 'a.update_versions_route_btn', function () {
304   - debugger
305 304 var lineId = $(this).data('lineid');
306 305 swal({
307 306 title: "操作须知",
... ...
src/main/resources/static/pages/base/stationroute/add.html
... ... @@ -360,6 +360,7 @@ $(&#39;#add_station_mobal&#39;).on(&#39;AddStationMobal.show&#39;, function(e, addMap,ajaxd,stao
360 360 ajaxd.getSectionRouteInfo(Line.id,add_direction_v,function(data) {
361 361 fun.linePanlThree(Line.id,data,add_direction_v);
362 362 });
  363 + fun.editMapStatusRemove();
363 364 }
364 365 function hideMoble() {
365 366 // 隐藏mobal
... ...
src/main/resources/static/pages/base/stationroute/add_manual_select.html
... ... @@ -31,8 +31,8 @@
31 31 </form>
32 32 </div>
33 33 <div class="modal-footer">
34   - <button type="button" class="btn default" data-dismiss="modal">取消</button>
35 34 <button type="button" class="btn btn-primary" id="addManualSelectnextButton">下一步</button>
  35 + <button type="button" class="btn default" data-dismiss="modal">取消</button>
36 36 </div>
37 37 </div>
38 38 </div>
... ...
src/main/resources/static/pages/base/stationroute/add_select.html
... ... @@ -38,8 +38,8 @@
38 38 </form>
39 39 </div>
40 40 <div class="modal-footer">
41   - <button type="button" class="btn default" data-dismiss="modal">取消</button>
42 41 <button type="button" class="btn btn-primary" id="addSelectnextButton">下一步</button>
  42 + <button type="button" class="btn default" data-dismiss="modal">取消</button>
43 43 </div>
44 44 </div>
45 45 </div>
... ... @@ -141,7 +141,7 @@ $(&#39;#add_select_mobal&#39;).on(&#39;AddSelectMobal.show&#39;, function(e,map_,drw,ajaxd_,stat
141 141 map_.localSearchFromAdreesToPoint(stationName,function(Points) {
142 142 if(Points) {
143 143 /** 设置新增站点集合对象站点中心点百度坐标属性值 @param:<bJwpoints:中心点百度坐标) */
144   - stationObj.setAddStationBJwpoints(Points);
  144 + stationObj.setAddStationJwpoints(Points);
145 145 /** 设置新增站点集合对象范围图形类型属性值 @param:<shapesType:范围图形类型) */
146 146 stationObj.setAddStationShapesType('r');
147 147 /** 设置新增站点集合对象圆形半径属性值 @param:<radius:圆形半径) */
... ... @@ -164,12 +164,13 @@ $(&#39;#add_select_mobal&#39;).on(&#39;AddSelectMobal.show&#39;, function(e,map_,drw,ajaxd_,stat
164 164 }
165 165 });
166 166 }else if(baseRes==1) {
167   - map_.clearMarkAndOverlays();
  167 + // map_.clearMarkAndOverlays();
168 168 // 以藏站点新增方式mobal
169 169 $('#add_select_mobal').modal('hide');
170 170 // 打开绘制工具
171 171 drw.openDrawingManager();
172   - map_.localtionPoint(stationName);
  172 + // map_.localtionPoint(stationName);
  173 + fun.editMapStatus();
173 174 }
174 175 // 查询是否存在输入的站点名称
175 176 /* ajaxd_.getLikeStationName(stationName,function(data) {
... ...
src/main/resources/static/pages/base/stationroute/css/bmap_base.css
1 1 #bmap_basic{
2 2 min-width: 100%;
3   - /*width: calc(100% + 26px); */
4 3 margin-top: -10px;
5   - border: 2px solid #fdfdfd;
6   - min-height: 1200px;
7 4 height:100%;
8   - overflow: hidden;
  5 +}
  6 +
  7 +.mian-portlet-body{
  8 + height: 100%;
9 9 }
10 10  
11 11 html,body{
12 12 overflow:hidden;
13   - height: 99%;
  13 + height: calc(100% - 10px);
  14 +}
  15 +
  16 +.protlet-box-layer{
  17 + position: absolute;
  18 + z-index: 900;
  19 + height: 100%;
  20 + width: 100%;
  21 + background: #ffffff85;
  22 + display: none;
14 23 }
15 24  
16 25 .rm3_image {
... ... @@ -19,6 +28,52 @@ html,body{
19 28  
20 29 }
21 30  
  31 +.search_panel{
  32 + position: absolute;
  33 + z-index: 99;
  34 + height: 41px;
  35 + top: 30px;
  36 + left: 500px;
  37 + background: #fff1f0;
  38 + padding: 0px;
  39 + box-shadow: 5px 1px 5px rgba(90, 90, 90, 0.48);
  40 +}
  41 +
  42 +.search_input_panel {
  43 + display: inline;
  44 + height: 41px;
  45 +}
  46 +
  47 +.search_input_panel .search_input {
  48 + width: 200px;
  49 + height: 41px;
  50 + padding:0 20px 0 10px;
  51 + float:left;
  52 + border:none;
  53 + outline: 0px;
  54 +}
  55 +
  56 +.search_input_panel .clear {
  57 + right: 40px;
  58 + position: absolute;
  59 + top: 15px;
  60 + width: 20px;
  61 +}
  62 +
  63 +.search_button_panel{
  64 + height: 41px;
  65 + display: inline;
  66 +}
  67 +
  68 +.search_button {
  69 + width: 38px;
  70 + height: 41px;
  71 + background: #fff1f0;
  72 + border:none;
  73 + top: 0;
  74 + outline: 0px;
  75 +}
  76 +
22 77 /* 隐藏百度地图logo */
23 78 .anchorBL,
24 79 .anchorBL,
... ... @@ -36,8 +91,16 @@ html,body{
36 91 height: auto;
37 92 background:transparent;
38 93 border:0px solid;
39   - box-shadow: 0 12px 15px 0 rgba(204, 204, 204, 0.33),0 17px 50px 0 rgba(204, 204, 204, 0.33);
40   - border-radius: 6px !important;box-shadow: 10px 10px 5px #888888;
  94 + /*border-radius: 6px !important;*/
  95 + box-shadow: 5px 5px 5px rgba(90, 90, 90, 0.48);
  96 +
  97 +}
  98 +
  99 +.protlet-box .portlet-title {
  100 + background-color:#fff1f0;
  101 + font-weight: 600;
  102 + color: #000 !important;
  103 + padding: 0 0 0 15px;
41 104 }
42 105  
43 106 .help-block{
... ... @@ -45,47 +108,13 @@ html,body{
45 108 font-size: 15px;
46 109 }
47 110  
48   -/*.BMap_pop div:nth-child(1) ,*/
49   -/*.BMap_pop div:nth-child(2) ,*/
50   -/*.BMap_pop div:nth-child(3) ,*/
51   -/*.BMap_pop div:nth-child(4) ,*/
52   -/*.BMap_pop div:nth-child(5) ,*/
53   -/*.BMap_pop div:nth-child(6) ,*/
54   -/*.BMap_pop div:nth-child(7) {*/
55   - /**/
56   - /*border:0px solid rgb(255, 255, 255) !important;*/
57   - /*background-color:#3B3F51 !important;*/
58   - /**/
59   -/*}*/
60   -
61   -/*.BMap_pop div:nth-child(3){*/
62   - /**/
63   - /*width:23px !important;*/
64   - /**/
65   -/*}*/
66   -
67   -/*.BMap_pop div:nth-child(7) {*/
68   - /**/
69   - /*width:23px !important;*/
70   - /**/
71   - /*height:24px !important;*/
72   - /**/
73   -/*}*/
74   -
75   -/*.BMap_pop div:nth-child(5) {*/
76   - /**/
77   - /*height:24px !important;*/
78   - /**/
79   -/*}*/
80   -
81   -/* 图片以后在弄,先隐藏div */
82   -/*.BMap_pop div:nth-child(8) {*/
83   - /**/
84   - /*height:0px !important;*/
85   - /*!* background:url('/pages/base/stationroute/css/img/iw3-1.png') no-repeat !important; *!*/
86   - /*!* background-image:url('/pages/base/stationroute/css/img/windowinfo_b.jpg') !important; *!*/
87   - /**/
88   -/*}*/
  111 +.info_win_btn {
  112 + background: #ff8355;
  113 + color: #fff;
  114 + font-size: 12px;
  115 + margin: 0 5px 0 0;
  116 + border: 1px solid transparent;
  117 +}
89 118  
90 119 .BMap_pop {
91 120  
... ... @@ -94,36 +123,111 @@ html,body{
94 123 }
95 124  
96 125 .defeat-scroll {
97   -width: 98%;
98   -height:380px;
99   -/* overflow:auto; */
100   -overflow:hidden;
  126 + width: 98%;
  127 + height:380px;
  128 + overflow:hidden;
101 129 }
102 130 .defeat-scroll::-webkit-scrollbar {
103   -width:6px;
104   -height:6px;
  131 + width:6px;
  132 + height:6px;
105 133 }
106 134 .defeat-scroll::-webkit-scrollbar-button {
107   -/* background-color:#FF7677; */
108   -background:rgba(255, 255, 255, 0);
  135 + background:rgba(255, 255, 255, 0);
109 136 }
110 137 .defeat-scroll::-webkit-scrollbar-track {
111   -/* background:#FF66D5; */
112   -background:rgba(255, 255, 255, 0);
  138 + background:rgba(255, 255, 255, 0);
113 139 }
114 140 .defeat-scroll::-webkit-scrollbar-track-piece {
115   -/* background:#ff0000; */
116   -background:rgba(255, 255, 255, 0);
  141 + background:rgba(255, 255, 255, 0);
117 142 }
118 143 .defeat-scroll::-webkit-scrollbar-thumb{
119   -background:rgba(197, 196, 196, 0.81);
120   -border-radius:10px !important;
  144 + background:rgba(197, 196, 196, 0.81);
  145 + border-radius:10px !important;
121 146 }
122 147 .defeat-scroll::-webkit-scrollbar-corner {
123   -/* background:#82AFFF; */
124   -background:rgba(255, 255, 255, 0);
  148 + background:rgba(255, 255, 255, 0);
  149 +}
  150 +/*.defeat-scroll::-webkit-scrollbar-resizer {
  151 + background:rgba(255, 255, 255, 0);
  152 +}*/
  153 +
  154 +.add_road_search_point_wrap{
  155 + width: 280px;
  156 + height: 120px;
  157 + position: absolute;
  158 + top: 40px;
  159 + left: calc(50% - 100px);
  160 + z-index: 999;
  161 + background: #fdfdfd;
  162 + box-shadow: 5px 5px 15px rgba(90, 90, 90, 0.48);
  163 +}
  164 +
  165 +.buffer_edit_body{
  166 + padding: 5px 0 0 15px;
  167 +}
  168 +
  169 +.buffer_edit_body .form-group{
  170 + margin-top: 10px;
  171 + margin-bottom: 0px;
  172 + white: 240px
  173 +}
  174 +
  175 +.add_road_search_point_wrap ._title {
  176 + padding-right: 18px;
  177 + text-align: center;
  178 + font-size: 17px;
  179 + color: #2b2b2b;
  180 + /*padding: 2px 0 0 0;*/
  181 + font-weight: 600;
  182 +}
  183 +
  184 +.buffer_edit_body .btns{
  185 + text-align: right;
125 186 }
126   -.defeat-scroll::-webkit-scrollbar-resizer {
127   -/* background:#FF0BEE; */
128   -background:rgba(255, 255, 255, 0);
129   -}
130 187 \ No newline at end of file
  188 +
  189 +.buffer_edit_body .form-group .inline{
  190 + width: 100px !important;
  191 + height: 30px;
  192 + margin-right: 7px;
  193 + display: inline-block;
  194 + position: relative;
  195 + max-width: 100%;
  196 + vertical-align: middle;
  197 +}
  198 +
  199 +.sbmint-btn {
  200 + padding: 0 15px;
  201 + height: 28px;
  202 + line-height: 28px;
  203 + vertical-align: top;
  204 + margin-top: 2px;
  205 + background-color: #1e87f0;
  206 + color: #fff;
  207 + border: 1px solid transparent;
  208 +}
  209 +.cancel-btn {
  210 + padding: 0 15px;
  211 + height: 28px;
  212 + line-height: 28px;
  213 + vertical-align: top;
  214 + margin-top: 2px;
  215 + background-color: transparent;
  216 + color: #333;
  217 + border: 1px solid #e5e5e5;
  218 +}
  219 +
  220 +.draw_polyline_switch{
  221 + display: inline-block;
  222 + font-size: 12px;
  223 + vertical-align: bottom;
  224 + margin-left: 5px;
  225 +}
  226 +
  227 +.draw_polyline_switch>a{
  228 + color: red;
  229 +}
  230 +
  231 +.buffer_edit_body .form-group input{
  232 + height: 30px;
  233 +}
  234 +
... ...
src/main/resources/static/pages/base/stationroute/delete_select.html
... ... @@ -29,9 +29,9 @@
29 29 </form>
30 30 </div>
31 31 <div class="modal-footer">
32   - <button type="button" class="btn default" data-dismiss="modal">取消</button>
33 32 <button type="button" class="btn btn-primary"
34   - id="deleteSelectnextButton">下一步</button>
  33 + id="deleteSelectnextButton">下一步</button>
  34 + <button type="button" class="btn default" data-dismiss="modal">取消</button>
35 35 </div>
36 36 </div>
37 37 </div>
... ...
src/main/resources/static/pages/base/stationroute/deletesection.html
... ... @@ -139,25 +139,25 @@ $(&#39;#delete_section_mobal&#39;).on(&#39;deleteSectionMobal.show&#39;,function(e, ajaxd, line,
139 139 ids = ids.substr(1, ids.length - 1);
140 140 var params = {};
141 141 params.ids = ids;
142   - $.get('/sectionroute/batchDestroy',params,function(resuntDate) {
143   - if (resuntDate.status == 'SUCCESS') {
144   - // 弹出添加成功提示消息
145   - layer.msg('修改成功...');
146   - /** 通知更新缓存区 */
147   - //$.post('http://192.168.168.171:8800/transport_server/basic/refresh',function(rs) {console.log(rs)})
148   - } else {
149   - // 弹出添加失败提示消息
150   - layer.msg('修改失败...');
151   - }
152   - initSearch();
153   - // 刷新左边树
154   - fun.resjtreeDate(line.id,delBatch.dir);
155   - /** 查询路段信息 @param:<Line.id:线路Id;delBatch.dir:方向> @return:data:路段数据 */
156   - ajaxd.getSectionRouteInfo(line.id,delBatch.dir,function(data) {
157   - /** 在地图上画出线路走向 @param:<Line.id:线路Id;delBatch.dir:方向;data:路段数据> */
158   - fun.linePanlThree(line.id,data,delBatch.dir);
159   - });
160   - });
  142 + $.post('/sectionroute/batchDestroy',params,function(resuntDate) {
  143 + if (resuntDate.status == 'SUCCESS') {
  144 + // 弹出添加成功提示消息
  145 + layer.msg('修改成功...');
  146 + /** 通知更新缓存区 */
  147 + //$.post('http://192.168.168.171:8800/transport_server/basic/refresh',function(rs) {console.log(rs)})
  148 + } else {
  149 + // 弹出添加失败提示消息
  150 + layer.msg('修改失败...');
  151 + }
  152 + initSearch();
  153 + // 刷新左边树
  154 + fun.resjtreeDate(line.id,delBatch.dir);
  155 + /** 查询路段信息 @param:<Line.id:线路Id;delBatch.dir:方向> @return:data:路段数据 */
  156 + ajaxd.getSectionRouteInfo(line.id,delBatch.dir,function(data) {
  157 + /** 在地图上画出线路走向 @param:<Line.id:线路Id;delBatch.dir:方向;data:路段数据> */
  158 + fun.linePanlThree(line.id,data,delBatch.dir);
  159 + });
  160 + });
161 161 } else {
162 162 layer.msg('请选择要删除的路段!!!');
163 163 }
... ...
src/main/resources/static/pages/base/stationroute/deletestation.html
... ... @@ -141,7 +141,7 @@ $(&#39;#delete_station_mobal&#39;).on(&#39;deleteStationMobal.show&#39;,function(e, ajaxd, line,
141 141 ids = ids.substr(1, ids.length - 1);
142 142 var params = {};
143 143 params.ids = ids;
144   - $.get('/stationroute/batchDestroy',params,function(resuntDate) {
  144 + $.post('/stationroute/batchDestroy',params,function(resuntDate) {
145 145 if (resuntDate.status == 'SUCCESS') {
146 146 // 弹出添加成功提示消息
147 147 layer.msg('修改成功...');
... ...
src/main/resources/static/pages/base/stationroute/doublename_road.html
... ... @@ -32,8 +32,8 @@
32 32 </form>
33 33 </div>
34 34 <div class="modal-footer">
35   - <button type="button" class="btn default" data-dismiss="modal">取消</button>
36 35 <button type="button" class="btn btn-primary" id="editSectionButton">提交数据</button>
  36 + <button type="button" class="btn default" data-dismiss="modal">取消</button>
37 37 </div>
38 38 </div>
39 39 </div>
... ... @@ -79,7 +79,7 @@
79 79 });
80 80 function closeMobleSetClean() {
81 81 // 清除地图覆盖物
82   - map_.clearMarkAndOverlays();
  82 + // map_.clearMarkAndOverlays();
83 83 fun.resjtreeDate(lineId,dir);
84 84 fun.editAChangeCssRemoveDisabled();
85 85 ajaxd.getSectionRouteInfo(lineId,dir,function(data) {
... ... @@ -128,12 +128,11 @@
128 128 params.versions = versions;
129 129 // 生成路段
130 130 $.get('/section/doubleName',params,function (resuntDate) {
131   - debugger
132 131 if(resuntDate.status=='SUCCESS') {
133 132 // 弹出添加成功提示消息
134 133 layer.msg('生成成功...');
135 134 } else if (resuntDate.status=='Failure') {
136   - layer.msg('抱歉,选取的路段太短,无法生成双路段!');
  135 + layer.msg('抱歉,您选取的路段基于高德地图的数据无法生成双路段!');
137 136 } else {
138 137 // 弹出添加失败提示消息
139 138 layer.msg('生成失败...');
... ... @@ -141,7 +140,7 @@
141 140 $('#doublename_road_mobal').modal('hide');
142 141 var dir = params.directions;
143 142 // 刷行左边树
144   - fun.resjtreeDate(lineId,dir);
  143 + // fun.resjtreeDate(lineId,dir);
145 144 closeMobleSetClean();
146 145 });
147 146 });
... ...
src/main/resources/static/pages/base/stationroute/edit.html
... ... @@ -21,25 +21,19 @@
21 21 <input type="hidden" name="dbType" id="dbTypeInput" value="b"/>
22 22 <input type="hidden" name="x" id="xInput" value=""/>
23 23 <input type="hidden" name="y" id="yInput" value=""/>
  24 + <input type="hidden" name="zdmc" id="zdmcInput"/>
  25 + <input type="hidden" name="descriptions" id="descriptionsTextarea" />
  26 + <input type="hidden" name="directions" id="stationdirSelect" />
  27 +
  28 + <!-- 站点名称 -->
24 29 <!-- 站点名称 -->
25 30 <div class="form-body">
26 31 <div class="form-group">
27 32 <label class="control-label col-md-3">
28   - <span class="required"> * </span> 站点名称&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:
29   - </label>
30   - <div class="col-md-6">
31   - <input type="text" class="form-control" name="zdmc" id="zdmcInput" placeholder="站点名称" readonly="readonly">
32   - </div>
33   - </div>
34   - </div>
35   - <!-- 站点路由名称 -->
36   - <div class="form-body">
37   - <div class="form-group">
38   - <label class="control-label col-md-3">
39   - <span class="required"> * </span> 站点路由名称:
  33 + <span class="required"> * </span> 站点名称:
40 34 </label>
41 35 <div class="col-md-6">
42   - <input type="text" class="form-control" name="stationName" id="stationNameInput" placeholder="站点路由名称">
  36 + <input type="text" class="form-control" name="stationName" id="stationNameInput" placeholder="站点名称" readonly="readonly">
43 37 </div>
44 38 </div>
45 39 </div>
... ... @@ -54,21 +48,6 @@
54 48 </div>
55 49 </div>
56 50 </div>
57   - <!-- 站点方向 -->
58   - <div class="form-body">
59   - <div class="form-group">
60   - <label class="control-label col-md-3">
61   - <span class="required"> * </span>站点方向&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:
62   - </label>
63   - <div class="col-md-6">
64   - <select name="directions" class="form-control" id="stationdirSelect">
65   - <option value="">-- 请选择站点类型 --</option>
66   - <option value="0">上行</option>
67   - <option value="1">下行</option>
68   - </select>
69   - </div>
70   - </div>
71   - </div>
72 51 <!-- 站点序号 -->
73 52 <div class="form-body">
74 53 <div class="form-group">
... ... @@ -175,13 +154,6 @@
175 154 </div>
176 155 </div>
177 156 </div>
178   - <!-- 描述/说明 -->
179   - <div class="form-group">
180   - <label class="control-label col-md-3"> 描述/说明&nbsp;&nbsp;&nbsp;: </label>
181   - <div class="col-md-6">
182   - <textarea class="form-control" rows="3" name="descriptions" id="descriptionsTextarea" placeholder="描述/说明"></textarea>
183   - </div>
184   - </div>
185 157 </form>
186 158 </div>
187 159 <div class="modal-footer">
... ... @@ -198,7 +170,7 @@ $(&#39;#edit_station_mobal&#39;).on(&#39;editSelectMobal_show&#39;, function(e, map_,ajaxd,stati
198 170 var editStationParmasObj = station_.getEitdStation();
199 171 var addLine = Line_.getLineObj();
200 172 fun.setFormValue(editStationParmasObj);
201   - var initzdlyP = {'lineCode_eq':editStationParmasObj.stationRouteLineCode,'destroy_eq':0,'directions_eq':editStationParmasObj.stationRouteDirections};
  173 + var initzdlyP = {'lineCode_eq':editStationParmasObj.stationRouteLIneCode,'destroy_eq':0,'directions_eq':editStationParmasObj.stationRoutedirections};
202 174 initSelect(initzdlyP);
203 175 // 显示mobal
204 176 $('#edit_station_mobal').modal({show : true,backdrop: 'static',keyboard: false});
... ... @@ -217,6 +189,7 @@ $(&#39;#edit_station_mobal&#39;).on(&#39;editSelectMobal_show&#39;, function(e, map_,ajaxd,stati
217 189 ajaxd.getSectionRouteInfo(addLine.id,add_direction_v,function(data) {
218 190 fun.linePanlThree(addLine.id,data,add_direction_v);
219 191 });
  192 + fun.editMapStatusRemove();
220 193 }
221 194 // 编辑表单元素
222 195 var form = $('#edit_station_form');
... ... @@ -283,7 +256,7 @@ $(&#39;#edit_station_mobal&#39;).on(&#39;editSelectMobal_show&#39;, function(e, map_,ajaxd,stati
283 256 var id = addLine.id;
284 257 var dir = params.directions
285 258 // 刷行左边树
286   - fun.resjtreeDate(id,dir);
  259 + // fun.resjtreeDate(id,dir);
287 260 closeMobleSetClean();
288 261 });
289 262 }
... ... @@ -312,7 +285,7 @@ $(&#39;#edit_station_mobal&#39;).on(&#39;editSelectMobal_show&#39;, function(e, map_,ajaxd,stati
312 285 $.each(array, function(i, g){
313 286 // 判断.
314 287 if(g.name!='' || g.name != null) {
315   - if(g.stationRouteCode != editStationParmasObj.stationRouteStationRouteCode) {
  288 + if(g.stationRouteCode != editStationParmasObj.stationRouteCode) {
316 289 // 添加拼音检索下拉框格式数据数组.
317 290 if(editStationParmasObj.stationRouteStationMark=='E' && i == (len_-2)){
318 291 paramsD.push({'id':g.stationRouteCode + '_' + 'E' + '_' + g.directions,
... ... @@ -333,13 +306,13 @@ $(&#39;#edit_station_mobal&#39;).on(&#39;editSelectMobal_show&#39;, function(e, map_,ajaxd,stati
333 306 });
334 307 }
335 308 function setZdlyValue() {
336   - ajaxd.findUpStationRouteCode(editStationParmasObj.stationRouteLine,editStationParmasObj.stationRouteDirections,editStationParmasObj.stationRouteStationRouteCode,function(str) {
  309 + ajaxd.findUpStationRouteCode(editStationParmasObj.stationRouteLine,editStationParmasObj.stationRoutedirections,editStationParmasObj.stationRouteCode,function(str) {
337 310 if(str.length>0){
338 311 var upStationRouteCode;
339 312 if (editStationParmasObj.stationRouteStationMark == 'E') {
340   - upStationRouteCode = str[0].stationRouteCode + '_' + 'E' + '_' + editStationParmasObj.stationRouteDirections;
  313 + upStationRouteCode = str[0].stationRouteCode + '_' + 'E' + '_' + editStationParmasObj.stationRoutedirections;
341 314 } else{
342   - upStationRouteCode = str[0].stationRouteCode + '_' + str[0].stationRouteMarke + '_' + editStationParmasObj.stationRouteDirections;
  315 + upStationRouteCode = str[0].stationRouteCode + '_' + str[0].stationRouteMarke + '_' + editStationParmasObj.stationRoutedirections;
343 316 }
344 317 $('#stationrouteSelect').select2('val',upStationRouteCode);
345 318 }else {
... ... @@ -374,5 +347,5 @@ $(&#39;#edit_station_mobal&#39;).on(&#39;editSelectMobal_show&#39;, function(e, map_,ajaxd,stati
374 347 }
375 348 return tel;
376 349 }, '方向必须一致!');
377   -});
  350 +});
378 351 </script>
379 352 \ No newline at end of file
... ...
src/main/resources/static/pages/base/stationroute/edit_select.html
... ... @@ -19,7 +19,7 @@
19 19 系统无法生成,请选择其他方式新增
20 20 </div>
21 21 <div class="form-group" id="formRequ">
22   - <label class="col-md-3 control-label"><span class="required"> * </span>原始站点名称:</label>
  22 + <label class="col-md-3 control-label"><span class="required"> * </span>站点名称:</label>
23 23 <div class="col-md-9" id="errorInfo">
24 24 <input type="text" class="form-control input-medium" id="stationNamebootbox" name="stationNamebootbox">
25 25 </div>
... ... @@ -40,17 +40,14 @@
40 40 </form>
41 41 </div>
42 42 <div class="modal-footer">
43   - <button type="button" class="btn default" data-dismiss="modal">取消</button>
44 43 <button type="button" class="btn btn-primary" id="editselectStationNextButton">下一步</button>
  44 + <button type="button" class="btn default" data-dismiss="modal">取消</button>
45 45 </div>
46 46 </div>
47 47 </div>
48 48 </div>
49 49 <script type="text/javascript">
50   -$('#edit_select_mobal').on('editSelectMobal_show', function(e, map_,drw,ajaxd,editStationObj,lineObj,fun,dir_){
51   - var sel = fun.getCurrSelNode(dir_);
52   - debugger
53   - var Station = sel[0].original;
  50 +$('#edit_select_mobal').on('editSelectMobal_show', function(e, map_,drw,ajaxd,editStationObj,lineObj,fun,Station){
54 51 // 显示选择修改方式弹出层
55 52 $('#edit_select_mobal').modal({show : true,backdrop: 'static',keyboard: false});
56 53 setTimeout(function(){
... ... @@ -75,7 +72,7 @@ $(&#39;#edit_select_mobal&#39;).on(&#39;editSelectMobal_show&#39;, function(e, map_,drw,ajaxd,ed
75 72 setTimeout(function(){$('.tipso-animation').tipso('hide');},4000);
76 73 },500);
77 74 // 获取站点名称元素并赋值
78   - $('#stationNamebootbox').val(Station.stationStationName);
  75 + $('#stationNamebootbox').val(Station.stationRouteName);
79 76 // 定义站点图形
80 77 var stationShapesTypeV = Station.stationShapesType;
81 78 // 获取表单元素
... ... @@ -118,28 +115,25 @@ $(&#39;#edit_select_mobal&#39;).on(&#39;editSelectMobal_show&#39;, function(e, map_,drw,ajaxd,ed
118 115 var editStationName = params.stationNamebootbox;
119 116  
120 117 if(params.editselect==0){
121   - $('#downLine').addClass('btn disabled');
122   - $('.btn-circle').addClass('disabled');
123   - $('#upLine').addClass('btn disabled');
124 118 editStationObj.setEitdStation(Station);
125 119 editStationObj.setEitdStationName(editStationName);
126 120  
127   - map_.clearMarkAndOverlays();
  121 + // map_.clearMarkAndOverlays();
128 122 // 打开绘制工具
129 123 drw.openDrawingManager();
130   - map_.localtionPoint(editStationName);
  124 + map_.localtionPoint(editStationName+"公交站点");
  125 + fun.editMapStatus();
131 126 }else if(params.editselect==1){
132   - $('#downLine').addClass('btn disabled');
133   - $('.btn-circle').addClass('disabled');
134   - $('#upLine').addClass('btn disabled');
135 127 editStationObj.setEitdStation(Station);
136 128 editStationObj.setEitdStationName(editStationName);
137   -
  129 + map_.clearMark();
138 130 // 弹出添加失败提示消息,2秒关闭(如果不配置,默认是3秒)
139 131 var mindex = layer.msg('编辑完图形后,请双击图形区域保存',{ offset: '126px',
140 132 shift: 0,time: 3000});
141 133 // 编辑图形
142   - map_.editShapes(editStationName,stationShapesTypeV,mindex);
  134 + // map_.editShapes(editStationName,stationShapesTypeV,mindex);
  135 + map_.editShapes(editStationObj);
  136 + fun.editMapStatus();
143 137 }
144 138 }
145 139 });
... ...
src/main/resources/static/pages/base/stationroute/editsection.html
... ... @@ -14,12 +14,17 @@
14 14 <!-- 线路ID -->
15 15 <input type="hidden" name="sectionId" id="sectionIdInput">
16 16 <input type="hidden" name="sectionRouteId" id="sectionRouteIdInput">
  17 + <input type="hidden" name="sectionCode" id="sectionCodeInput">
17 18 <input type="hidden" name="sectionRouteLine" id="sectionRouteLineInput">
18 19 <input type="hidden" name="lineCode" id="lineCodeInput">
19 20 <input type="hidden" name="bsectionVector" id="bsectionVectorInput" />
20 21 <input type="hidden" name="csectionVector" id="csectionVectorInput" value=""/>
21 22 <input type="hidden" name="dbType" id="dbTypeInput" value="b"/>
22 23 <input type="hidden" name="isRoadeSpeed" id="isRoadeSpeedInput"/>
  24 + <input type="hidden" name="directions" id="directionsSection">
  25 + <input type="hidden" name="speedLimit" id="speedLimitInput" >
  26 + <input type="hidden" name="roadCoding" id="roadCodingCodInput"/>
  27 + <input type="hidden" name="versions" id="versionsInput"/>
23 28 <!-- 路段名称 -->
24 29 <div class="form-body">
25 30 <div class="form-group">
... ... @@ -31,17 +36,6 @@
31 36 </div>
32 37 </div>
33 38 </div>
34   - <!-- 路段编码 -->
35   - <div class="form-body">
36   - <div class="form-group">
37   - <label class="control-label col-md-3">
38   - <span class="required"> * </span> 路段编码:
39   - </label>
40   - <div class="col-md-6">
41   - <input type="text" class="form-control" name="sectionCode" id="sectionCodeInput" placeholder="路段编码" readonly="readonly">
42   - </div>
43   - </div>
44   - </div>
45 39 <!-- 路段序号 -->
46 40 <div class="form-body">
47 41 <div class="form-group">
... ... @@ -54,103 +48,20 @@
54 48 </div>
55 49 </div>
56 50 </div>
57   - <!-- 路段方向 -->
58   - <div class="form-body">
59   - <div class="form-group">
60   - <label class="control-label col-md-3">
61   - <span class="required"> * </span>路段方向:
62   - </label>
63   - <div class="col-md-6">
64   - <select name="directions" class="form-control" id="directionsSection">
65   - <option value="">-- 请选择路段类型 --</option>
66   - <option value="0">上行</option>
67   - <option value="1">下行</option>
68   - </select>
69   - </div>
70   - </div>
71   - </div>
72   - <!-- 路段限速 -->
73   - <div class="form-body">
74   - <div class="form-group">
75   - <label class="control-label col-md-3">
76   - <span class="required"> * </span> 路段限速:
77   - </label>
78   - <div class="col-md-6">
79   - <input type="text" class="form-control" name="speedLimit" id="speedLimitInput" placeholder="路段限速">
80   - </div>
81   - </div>
82   - </div>
83   - <!-- 是否撤销 -->
84   - <div class="form-body">
85   - <div class="form-group">
86   - <label class="col-md-3 control-label"><span class="required"> * </span>是否撤销:</label>
87   - <div class="col-md-6">
88   - <select name="destroy" class="form-control" id="destroySelect">
89   - <option value="">-- 请选择撤销类型 --</option>
90   - <option value="0">否</option>
91   - <option value="1">是</option>
92   - </select>
93   - </div>
94   - </div>
95   - </div>
96   - <!-- 道路编码-->
97   - <div class="form-body">
98   - <div class="form-group">
99   - <label class="control-label col-md-3">道路编码:</label>
100   - <div class="col-md-6">
101   - <input type="text" class="form-control" name="roadCoding" id="roadCodingCodInput" placeholder="道路编码">
102   - </div>
103   - </div>
104   - </div>
105   - <!-- 路段长度 -->
106   - <div class="form-body">
107   - <div class="form-group">
108   - <label class="col-md-3 control-label">路段长度:</label>
109   - <div class="col-md-6">
110   - <input type="text" class="form-control" name="sectionDistance" id="sectionDistanceInput" placeholder="路段长度">
111   - <span class="help-block">单位:公里(km)</span>
112   - </div>
113   - </div>
114   - </div>
115   - <!-- 路段历时 -->
116   - <div class="form-body">
117   - <div class="form-group">
118   - <label class="col-md-3 control-label">路段历时:</label>
119   - <div class="col-md-6">
120   - <input type="text" class="form-control" name="sectionTime" id="sectionTimeInput" placeholder="路段历时">
121   - <span class="help-block">单位:分钟(min)</span>
122   - </div>
123   - </div>
124   - </div>
125   - <!-- 版本号 -->
126   - <div class="form-body">
127   - <div class="form-group">
128   - <label class="col-md-3 control-label">版本号&nbsp;&nbsp;&nbsp;:</label>
129   - <div class="col-md-6">
130   - <input type="text" class="form-control" name="versions" id="versionsInput" Readonly>
131   - </div>
132   - </div>
133   - </div>
134   - <!-- 描述/说明 -->
135   - <div class="form-group">
136   - <label class="control-label col-md-3"> 描述/说明: </label>
137   - <div class="col-md-6">
138   - <textarea class="form-control" rows="3" name="descriptions" id="descriptionsTextarea" placeholder="描述/说明"></textarea>
139   - </div>
140   - </div>
  51 +
141 52 </form>
142 53 </div>
143 54 <div class="modal-footer">
144   - <button type="button" class="btn default" data-dismiss="modal">取消</button>
145 55 <button type="button" class="btn btn-primary" id="editSectionButton">提交数据</button>
  56 + <button type="button" class="btn default" data-dismiss="modal">取消</button>
146 57 </div>
147 58 </div>
148 59 </div>
149 60 </div>
150 61 <script type="text/javascript">
151 62  
152   -$('#edit_section_mobal').on('editSectionMobal_show', function(e, map_,ajaxd,section,fun){
153   - var Section = section.getEitdSection();
  63 +$('#edit_section_mobal').on('editSectionMobal_show', function(e, map_,ajaxd,p,fun){
  64 + var Section = p.data;
154 65 fun.setSectionFormValue(Section);
155 66 // 方向
156 67 var dir = Section.sectionrouteDirections;
... ... @@ -159,15 +70,6 @@ $(&#39;#edit_section_mobal&#39;).on(&#39;editSectionMobal_show&#39;, function(e, map_,ajaxd,sect
159 70 ajaxd.getStation(lineId,dir,function(treeData) {
160 71 var array = treeData[0].children[1].children,paramsD =new Array();
161 72 var eq_scetionRouteCode = Section.sectionrouteCode;
162   - /* for(var i = 0 ; i<dArray.length; i++){
163   - var ptions_v = dArray[i].sectionrouteCode;
164   - if(eq_scetionRouteCode == ptions_v){
165   - continue;
166   - }
167   - options += '<option value="'+ ptions_v +'">'+dArray[i].sectionName + ' (' + ptions_v +')'
168   - + ' --' + fun.dirdmToName(dArray[i].sectionrouteDirections) + '</option>' ;
169   - }
170   - $('#sectionrouteCodeSelect').html(options); */
171 73 paramsD.push({'id':'请选择...','text':'将此路段设置位第一个路段'});
172 74 // 遍历.
173 75 $.each(array, function(i, g){
... ... @@ -195,16 +97,14 @@ $(&#39;#edit_section_mobal&#39;).on(&#39;editSectionMobal_show&#39;, function(e, map_,ajaxd,sect
195 97 });
196 98 });
197 99 // 显示mobal
198   - $('#edit_section_mobal').modal({show : true,backdrop: 'static',keyboard: false});
  100 + $('#edit_section_mobal').modal({show : true,backdrop: 'static',keyboard: false});//
199 101 // 当调用 hide 实例方法时触发
200 102 $('#edit_section_mobal').on('hide.bs.modal', function () {
201 103 closeMobleSetClean();
202 104 });
203 105 function closeMobleSetClean() {
204   - // 清除地图覆盖物
205   - map_.clearMarkAndOverlays();
206   - /** 设置修改路段集合对象为空 */
207   - section.setEitdSection({});
  106 + // 清除地图覆盖物
  107 + map_.clearMarkAndOverlays();
208 108 fun.resjtreeDate(lineId,dir);
209 109 fun.editAChangeCssRemoveDisabled();
210 110 ajaxd.getSectionRouteInfo(lineId,dir,function(data) {
... ... @@ -227,14 +127,14 @@ $(&#39;#edit_section_mobal&#39;).on(&#39;editSectionMobal_show&#39;, function(e, map_,ajaxd,sect
227 127 focusInvalid : false,
228 128 rules : {
229 129 'sectionName' : {required : true,maxlength:50},// 路段名称 必填项
230   - 'sectionCode': {required : true,},// 路段编码 必填项
  130 + /*'sectionCode': {required : true,},// 路段编码 必填项
231 131 'directions' : {required : true,},// 路段方向 必填项
232 132 'speedLimit' : {required : true,number : true},// 路段限速 必须输入合法的数字(负数,小数)。
233 133 'destroy' : {required : true,},// 是否撤销 必填项.
234 134 'roadCoding' : {number : true},// 道路编码 必须输入合法的数字(负数,小数)。
235 135 'sectionTime' : {number : true},// 路段时长 必须输入合法的数字(负数,小数)。
236 136 'sectionDistance' : {number : true},// 路段长度 必须输入合法的数字(负数,小数)。
237   - 'descriptions' : {maxlength: 150}// 描述与说明 最大长度.
  137 + 'descriptions' : {maxlength: 150}// 描述与说明 最大长度.*/
238 138 },
239 139 invalidHandler : function(event, validator) {
240 140 error.show();
... ... @@ -250,7 +150,14 @@ $(&#39;#edit_section_mobal&#39;).on(&#39;editSectionMobal_show&#39;, function(e, map_,ajaxd,sect
250 150 label.closest('.form-group').removeClass('has-error');
251 151 },
252 152 submitHandler : function(f) {
  153 + // 获取折线坐标集合
  154 + var editPloyLineArray = p.getPath();
  155 + // 折线坐标集合
  156 + $('#bsectionVectorInput').val(JSON.stringify(editPloyLineArray));
253 157 var params = form.serializeJSON();
  158 + params.destroy=0;
  159 + params.sectionDistance=0;
  160 + params.sectionTime=0;
254 161 error.hide();
255 162 if(params.sectionrouteCode=='请选择...')
256 163 params.sectionrouteCode='';
... ... @@ -264,8 +171,6 @@ $(&#39;#edit_section_mobal&#39;).on(&#39;editSectionMobal_show&#39;, function(e, map_,ajaxd,sect
264 171 }
265 172 $('#edit_section_mobal').modal('hide');
266 173 var dir = params.directions
267   - // 刷行左边树
268   - fun.resjtreeDate(lineId,dir);
269 174 closeMobleSetClean();
270 175 });
271 176 }
... ...
src/main/resources/static/pages/base/stationroute/js/addstationobj.js
... ... @@ -31,7 +31,7 @@ var AddStationObj = function () {
31 31 },
32 32  
33 33 /** 设置新增站点集合对象站点中心点百度坐标属性值 @param:<bJwpoints:中心点百度坐标) */
34   - setAddStationBJwpoints : function(bJwpoints) {
  34 + setAddStationJwpoints : function(bJwpoints) {
35 35  
36 36 station.bJwpoints = bJwpoints;
37 37 },
... ...
src/main/resources/static/pages/base/stationroute/js/drawingManager.js
... ... @@ -68,7 +68,7 @@ var DrawingManagerObj = function () {
68 68  
69 69 var pointE = e;
70 70  
71   - // 多变行质心点
  71 + // 多边行中心点
72 72 var addSttationPoints_ = pointE.getBounds().getCenter().lng+ ' ' + pointE.getBounds().getCenter().lat;
73 73  
74 74 var addPolyGonLen_ = pointE.getPath().length;
... ... @@ -96,7 +96,7 @@ var DrawingManagerObj = function () {
96 96 if(!$.isEmptyObject(add)){
97 97  
98 98 /** 设置新增站点集合对象站点中心点百度坐标属性值 @param:<bJwpoints:中心点百度坐标) */
99   - AddStationObj.setAddStationBJwpoints(addSttationPoints_);
  99 + AddStationObj.setAddStationJwpoints(addSttationPoints_);
100 100  
101 101 /** 设置新增站点集合对象范围图形类型属性值 @param:<shapesType:范围图形类型) */
102 102 AddStationObj.setAddStationShapesType('d');
... ... @@ -119,7 +119,7 @@ var DrawingManagerObj = function () {
119 119 if(!$.isEmptyObject(edit)){
120 120  
121 121 /** 设置修改站点集合对象站点中心点百度坐标属性值 @param:<bJwpoints:中心点百度坐标) */
122   - EditStationObj.setEitdStationBJwpoints(addSttationPoints_);
  122 + EditStationObj.setEitdStationJwpoints(addSttationPoints_);
123 123  
124 124 /** 设置修改站点集合对象范围图形类型属性值 @param:<shapesType:范围图形类型) */
125 125 EditStationObj.setEitdStationShapesType('d');
... ...
src/main/resources/static/pages/base/stationroute/js/editstationobj.js
... ... @@ -31,9 +31,9 @@ var EditStationObj = function () {
31 31 },
32 32  
33 33 /** 设置修改站点集合对象站点中心点百度坐标属性值 @param:<bJwpoints:中心点百度坐标) */
34   - setEitdStationBJwpoints : function(bJwpoints) {
  34 + setEitdStationJwpoints : function(bJwpoints) {
35 35  
36   - station.stationBJwpoints = bJwpoints;
  36 + station.stationJwpoints = bJwpoints;
37 37 },
38 38  
39 39 /** 设置修改站点集合对象范围图形类型属性值 @param:<shapesType:范围图形类型) */
... ...
src/main/resources/static/pages/base/stationroute/js/stationroute-ajax-getdata.js
... ... @@ -18,7 +18,9 @@
18 18 * - - - - - -》 stationRouteIsDestroy:撤销站点
19 19 *
20 20 * - - - - - -》 sectionUpdate : 编辑线路走向保存
21   - *
  21 + *
  22 + * - - - - - -》 sectionSave : 生成线路走向
  23 + *
22 24 * - - - - - -》 getIdLineName:获取线路名称
23 25 *
24 26 * - - - - - -》 getSectionRouteInfo:查询路段信息
... ... @@ -54,7 +56,7 @@ var GetAjaxData = function(){
54 56 },
55 57 // 查询线路某方向下所有站点的中心百度坐标
56 58 getStationRoutePoint : function(id_,dir_,callback) {
57   - $get('/stationroute/getStationRouteCenterPoints',{lineId:id_,direction:dir_},function(result) {
  59 + $get('/stationroute/getStationRouteList',{lineId:id_,direction:dir_},function(result) {
58 60 callback && callback(result);
59 61 });
60 62 },
... ... @@ -65,7 +67,7 @@ var GetAjaxData = function(){
65 67 callback && callback(array);
66 68 });
67 69 },
68   -
  70 +
69 71 // 查询站点编码
70 72 getStationCode : function(callback) {
71 73 $get('/station/getStationCode',null,function(stationCode) {
... ... @@ -74,6 +76,12 @@ var GetAjaxData = function(){
74 76 }
75 77 });
76 78 },
  79 + // 查询路段编码
  80 + getSectionCode : function(callback) {
  81 + $get('/section/getSectionCode',null,function(sectionCode) {
  82 + callback && callback(sectionCode);
  83 + });
  84 + },
77 85 findUpStationRouteCode : function(lineId,diraction,stationRouteCode,callback) {
78 86 $get('/stationroute/findUpStationRouteCode',{lineId:lineId,direction:diraction,stationRouteCode:stationRouteCode},function(result) {
79 87 callback && callback(result);
... ... @@ -110,15 +118,17 @@ var GetAjaxData = function(){
110 118  
111 119 // 编辑线路走向保存
112 120 sectionUpdate:function(section,callback) {
113   -
114 121 $post('/section/sectionUpdate',section,function(data) {
115   -
116 122 callback && callback(data);
117   -
118 123 })
119   -
120 124 },
121   -
  125 + // 生成线路走向
  126 + sectionSave:function(section,callback){
  127 + $post('/section/sectionSave',section,function(data) {
  128 + callback && callback(data);
  129 + })
  130 + },
  131 +
122 132 // 获取线路名称
123 133 getIdLineName : function (id,callback) {
124 134  
... ... @@ -143,6 +153,12 @@ var GetAjaxData = function(){
143 153 callback && callback(resultdata);
144 154 });
145 155 },
  156 + // 根据ID查询路段信息.
  157 + getSectionRouteInfoById : function(sectionRouteId,callback){
  158 + $get('/sectionroute/findSectionRouteInfoFormId',{id:sectionRouteId},function(r) {
  159 + return callback && callback(r);
  160 + });
  161 + },
146 162  
147 163 // 手动规划线路保存
148 164 manualSave : function(params,callback) {
... ...
src/main/resources/static/pages/base/stationroute/js/stationroute-list-events.js
... ... @@ -97,7 +97,6 @@ $(function(){
97 97 WorldsBMap.clearMarkAndOverlays();
98 98 // 刷新左边树
99 99 PublicFunctions.resjtreeDate(Line.id,0);
100   - PublicFunctions.resjtreeDate(Line.id,1);
101 100 /** 查询上行路段信息 @param:<Line.id:线路Id;0:上行> @return:data:路段数据 */
102 101 GetAjaxData.getSectionRouteInfo(Line.id,0,function(data) {
103 102 /** 在地图上画出线路走向 @param:<Line.id:线路Id;0:上行;data:路段数据> */
... ...
src/main/resources/static/pages/base/stationroute/js/stationroute-list-function.js
... ... @@ -26,548 +26,529 @@
26 26  
27 27 var PublicFunctions = function () {
28 28 var PubFun = {
29   - /** 初始化线路标题与ID */
30   - setTiteText : function(lineId) {
31   - // 根据线路ID获取线路名称
32   - GetAjaxData.getIdLineName(lineId,function(data) {
33   - // 定义线路名称
34   - var lineNameV = data.name;
35   - $('.portlet-title .caption').text(lineNameV);
36   - });
37   - },
38   - /** @param diraction 方向 @return array */
39   - getCurrSelNode : function(diraction){
40   - // 定义Obj
41   - var array = [];
42   - try {
  29 + /** 初始化线路标题与ID */
  30 + setTiteText : function(lineId) {
  31 + // 根据线路ID获取线路名称
  32 + GetAjaxData.getIdLineName(lineId,function(data) {
  33 + // 定义线路名称
  34 + var lineNameV = data.name;
  35 + $('.portlet-title .caption').text(lineNameV);
  36 + });
  37 + },
  38 + /** @param diraction 方向 @return array */
  39 + getCurrSelNode : function(diraction){
  40 + // 定义Obj
  41 + var array = [];
  42 + try {
  43 + // 上行
  44 + if(diraction=='0'){
  45 + // 获取上行选中节点
  46 + array = $.jstree.reference("#station_Up_tree").get_selected(true);
  47 + // 下行
  48 + }else if(diraction=='1'){
  49 + // 获取下行选中节点
  50 + array = $.jstree.reference("#station_Down_tree").get_selected(true);
  51 + }
  52 + } catch (e) {
  53 + console.log(e);
  54 + }
  55 + // 返回Obj
  56 + return array;
  57 + },
  58 + /** @param id:线路ID ;directionData:方向 */
  59 + resjtreeDate : function(id,directionData){
  60 + // 获取树数据
  61 + GetAjaxData.getStation(id,directionData,function(treeDateJson) {
  62 + // 获取数据长度
  63 + var len = treeDateJson[0].children[0].children.length;
  64 + // 上行
  65 + if(directionData==0){
  66 + // 长度大于零
  67 + if(len>0) {
  68 + // 隐藏上行规划
  69 + $('#upToolsMobal').hide();
  70 + // 显示树
  71 + $('#uptreeMobal').show();
  72 + // 刷新树
  73 + StationTreeData.upreloadeTree(treeDateJson);
  74 + }else {
  75 + // 显示上行规划
  76 + $('#upToolsMobal').show();
  77 + // 隐藏上行树
  78 + $('#uptreeMobal').hide();
  79 + }
  80 +
  81 + // 下行
  82 + }else if(directionData==1){
  83 + // 如果长度大于
  84 + if(len>0) {
  85 + // 隐藏下行规划
  86 + $('#downToolsMobal').hide();
  87 + // 显示下行树
  88 + $('#DowntreeMobal').show();
  89 + // 跟新树
  90 + StationTreeData.dwonreloadeTree(treeDateJson);
  91 + }else {
  92 + // 显示下行规划
  93 + $('#downToolsMobal').show();
  94 + // 隐藏下行树
  95 + $('#DowntreeMobal').hide();
  96 + }
  97 + }
  98 + });
  99 + },
  100 +
  101 + /** 修正线路名称 @param:<directionUpValue:方向(0:上行;1:下行)> */
  102 + lineNameIsHaveInterval : function(directionData) {
  103 + // 定义线路名称
  104 + var lineNameV = $('.portlet-title .caption').text();
  105 + // 线路名称是否为区间线路
  106 + if(lineNameV.indexOf('区间')>0){
  107 + // 截去区间
  108 + var lineNameNew = lineNameV.replace('区间','');
  109 + // 是否继续弹出层
  110 + layer.confirm('系统无法生成该线路【'+lineNameV+'】的站点与路段!自动修改为如下线路名称【'+lineNameNew+'】生成', {
  111 + btn : [ '确认提示并提交', '取消' ]
  112 + }, function(index) {
  113 + // 关闭弹出层
  114 + layer.close(index);
  115 + // 线路名称去掉区间
  116 + lineNameV = lineNameNew;
  117 + /** 保存 @param:<lineNameV:线路名称;directionData:方向(0:上行;1:下行)> */
  118 + PublicFunctions.systemLineStation(lineNameV,directionData);
  119 + },function(){
  120 + // 关闭弹出层
  121 + layer.closeAll();
43 122 // 上行
44   - if(diraction=='0'){
45   - // 获取上行选中节点
46   - array = $.jstree.reference("#station_Up_tree").get_selected(true);
  123 + if(directionData==0){
  124 + // 显示上行规划
  125 + $('#upToolsMobal').show();
47 126 // 下行
48   - }else if(diraction=='1'){
49   - // 获取下行选中节点
50   - array = $.jstree.reference("#station_Down_tree").get_selected(true);
  127 + }else if(directionData==1){
  128 + // 显示下行规划
  129 + $('#downToolsMobal').show();
51 130 }
52   - } catch (e) {
53   - console.log(e);
54   - }
55   - // 返回Obj
56   - return array;
57   - },
58   - /** @param id:线路ID ;directionData:方向 */
59   - resjtreeDate : function(id,directionData){
60   - // 获取树数据
61   - GetAjaxData.getStation(id,directionData,function(treeDateJson) {
62   - // 获取数据长度
63   - var len = treeDateJson[0].children[0].children.length;
  131 + });
  132 +
  133 + // 线路名称是否为定班线路
  134 + }else if(lineNameV.indexOf('定班')>0){
  135 + // 截去定班
  136 + var lineNameNew = lineNameV.replace('定班','');
  137 + // 是否继续弹出层
  138 + layer.confirm('系统无法生成该线路【'+lineNameV+'】的站点与路段!自动修改为如下线路名称【'+lineNameNew+'】生成', {
  139 + btn : [ '确认提示并提交', '取消' ]
  140 + }, function(index) {
  141 + // 关闭弹出层
  142 + layer.close(index);
  143 + // 线路名称去掉区间
  144 + lineNameV = lineNameNew;
  145 + /** 保存 @param:<lineNameV:线路名称;directionData:方向(0:上行;1:下行)> */
  146 + PublicFunctions.systemLineStation(lineNameV,directionData);
  147 + },function(){
  148 + // 关闭弹出层
  149 + layer.closeAll();
64 150 // 上行
65 151 if(directionData==0){
66   - // 长度大于零
67   - if(len>0) {
68   - // 隐藏上行规划
69   - $('#upToolsMobal').hide();
70   - // 显示树
71   - $('#uptreeMobal').show();
72   - // 刷新树
73   - StationTreeData.upreloadeTree(treeDateJson);
74   - }else {
75   - // 显示上行规划
76   - $('#upToolsMobal').show();
77   - // 隐藏上行树
78   - $('#uptreeMobal').hide();
79   - }
80   -
  152 + // 显示上行规划
  153 + $('#upToolsMobal').show();
81 154 // 下行
82 155 }else if(directionData==1){
83   - // 如果长度大于
84   - if(len>0) {
85   - // 隐藏下行规划
86   - $('#downToolsMobal').hide();
87   - // 显示下行树
88   - $('#DowntreeMobal').show();
89   - // 跟新树
90   - StationTreeData.dwonreloadeTree(treeDateJson);
91   - }else {
92   - // 显示下行规划
93   - $('#downToolsMobal').show();
94   - // 隐藏下行树
95   - $('#DowntreeMobal').hide();
96   - }
  156 + // 显示下行规划
  157 + $('#downToolsMobal').show();
97 158 }
98 159 });
99   - },
100   -
101   - /** 修正线路名称 @param:<directionUpValue:方向(0:上行;1:下行)> */
102   - lineNameIsHaveInterval : function(directionData) {
103   - // 定义线路名称
104   - var lineNameV = $('.portlet-title .caption').text();
105   - // 线路名称是否为区间线路
106   - if(lineNameV.indexOf('区间')>0){
107   - // 截去区间
108   - var lineNameNew = lineNameV.replace('区间','');
109   - // 是否继续弹出层
110   - layer.confirm('系统无法生成该线路【'+lineNameV+'】的站点与路段!自动修改为如下线路名称【'+lineNameNew+'】生成', {
111   - btn : [ '确认提示并提交', '取消' ]
112   - }, function(index) {
113   - // 关闭弹出层
114   - layer.close(index);
115   - // 线路名称去掉区间
116   - lineNameV = lineNameNew;
117   - /** 保存 @param:<lineNameV:线路名称;directionData:方向(0:上行;1:下行)> */
118   - PublicFunctions.systemLineStation(lineNameV,directionData);
119   - },function(){
120   - // 关闭弹出层
121   - layer.closeAll();
122   - // 上行
123   - if(directionData==0){
124   - // 显示上行规划
125   - $('#upToolsMobal').show();
126   - // 下行
127   - }else if(directionData==1){
128   - // 显示下行规划
129   - $('#downToolsMobal').show();
130   - }
  160 + }else {
  161 + /** 直接保存 @param:<lineNameV:线路名称;directionData:方向(0:上行;1:下行)> */
  162 + PublicFunctions.systemLineStation(lineNameV,directionData);
  163 + }
  164 +
  165 + },
  166 +
  167 + /** 直接保存 @param:<lineNameV:线路名称;directionData:方向(0:上行;1:下行)> */
  168 + systemLineStation : function(lineNameV,directionData) {
  169 + /** 从百度地图获取线路信息 @param:<lineNameV:线路名称;directionData:方向(0:上行;1:下行);callback>*/
  170 + WorldsBMap.lineInfoPanl(lineNameV,directionData,function(BusLine){
  171 + // 如果线路信息不为空
  172 + if(BusLine) {
  173 + // 获取公交线几何对象, 仅当结果自动添加到地图上时有效
  174 + var Polygon = BusLine.getPolyline();
  175 + // 返回多边型的点数组(自1.2新增)
  176 + var polyGonArray = Polygon.getPath();
  177 + // 获取公交站点个数(自 1.2 新增)
  178 + var stationNumber = BusLine.getNumBusStations();
  179 + // 定义线路信息集合
  180 + var stationInfo = [];
  181 + // 遍历
  182 + for(var k = 0 ; k < stationNumber; k++) {
  183 + // 定义线路信息集合
  184 + var tempM = {};
  185 + // 添加站点名称
  186 + tempM.name = BusLine.getBusStation(k).name;
  187 + // 添加站点坐标
  188 + tempM.potion = BusLine.getBusStation(k).position;
  189 + tempM.wgs = {x:'',y:''};
  190 + // 添加
  191 + stationInfo.push(tempM);
  192 + }
  193 + // 获取站点之间的距离与时间
  194 + WorldsBMap.getDistanceAndDuration(stationInfo,function(json) {
  195 + // 设置第一个站的距离
  196 + json[0].distance = '';
  197 + // 设置第一个站的时间
  198 + json[0].duration = '';
  199 + // 定义站点信息JSON字符串
  200 + var stationJSON = JSON.stringify(json);
  201 + // 定义路段信息字符串
  202 + var sectionJSON = JSON.stringify(polyGonArray);
  203 + // 参数集合
  204 + var params = {};
  205 + // 站点信息JSON字符串
  206 + params.stationJSON = stationJSON;
  207 + var addLine = LineObj.getLineObj();
  208 + // 线路ID
  209 + params.lineId = addLine.id;
  210 + // 方向
  211 + params.directions = directionData;
  212 + // 原始坐标类型
  213 + params.dbType = 'b';
  214 + // 圆形半径
  215 + params.radius = '100';
  216 + // 图形类型(r:圆形;p:多边形)
  217 + params.shapesType = 'r';
  218 + // destroy:是否撤销
  219 + params.destroy = '0';
  220 +
  221 + // 路段信息JSON字符串
  222 + params.sectionJSON = sectionJSON;
  223 + // 限速
  224 + params.speedLimit = '60';
  225 + params.baseRes = 'No';
  226 + // 获取版本号后提交添加
  227 + $.get('/lineVersions/findByLineId',{'lineId':addLine.id},function(lineVersions){
  228 + $.each(lineVersions,function(){
  229 + if (this.status == 1) {
  230 + // versions:版本号
  231 + params.versions = this.versions;
  232 + // 保存
  233 + GetAjaxData.collectionSave(params,function(rd) {
  234 + if(rd.status='SUCCESS') {
  235 + // 关闭弹出层
  236 + layer.closeAll();
  237 + layer.msg('保存成功!');
  238 + }else {
  239 + // 保存失败
  240 + layer.msg('保存失败!');
  241 + }
  242 + // 刷新树
  243 + PublicFunctions.resjtreeDate(addLine.id,directionData);
  244 + /** 查询上行路段信息 @param:<Line.id:线路Id;0:上行> @return:data:路段数据 */
  245 + GetAjaxData.getSectionRouteInfo(addLine.id,directionData,function(data) {
  246 + /** 在地图上画出线路走向 @param:<Line.id:线路Id;0:上行;data:路段数据> */
  247 + PublicFunctions.linePanlThree(addLine.id,data,directionData);
  248 + });
  249 + });
  250 + }
  251 + })
  252 + });
131 253 });
132   -
133   - // 线路名称是否为定班线路
134   - }else if(lineNameV.indexOf('定班')>0){
135   - // 截去定班
136   - var lineNameNew = lineNameV.replace('定班','');
137   - // 是否继续弹出层
138   - layer.confirm('系统无法生成该线路【'+lineNameV+'】的站点与路段!自动修改为如下线路名称【'+lineNameNew+'】生成', {
139   - btn : [ '确认提示并提交', '取消' ]
140   - }, function(index) {
141   - // 关闭弹出层
142   - layer.close(index);
143   - // 线路名称去掉区间
144   - lineNameV = lineNameNew;
145   - /** 保存 @param:<lineNameV:线路名称;directionData:方向(0:上行;1:下行)> */
146   - PublicFunctions.systemLineStation(lineNameV,directionData);
147   - },function(){
  254 + // 关闭弹出层
  255 + layer.closeAll();
  256 + // 上行
  257 + if(directionData==0){
  258 + $('#stationDown').removeClass('active');
  259 + $('#stationDown').removeClass('in');
  260 + $('#stationDown').addClass('fade');
  261 + $('#stationUp').addClass('active in');
  262 + $('#downLine').parent().removeClass('active');
  263 + $('#upLine').parent().addClass('active');
  264 + // 下行
  265 + }else if(directionData==1){
  266 + $('#stationUp').removeClass('active');
  267 + $('#stationUp').removeClass('in');
  268 + $('#stationUp').addClass('fade');
  269 + $('#stationDown').addClass('active in');
  270 + $('#upLine').parent().removeClass('active');
  271 + $('#downLine').parent().addClass('active');
  272 + }
  273 + } else {
  274 + layer.msg('百度地图中没有此线路,无法系统规划!');
  275 + setTimeout(function() {
148 276 // 关闭弹出层
149 277 layer.closeAll();
150 278 // 上行
151 279 if(directionData==0){
152 280 // 显示上行规划
153 281 $('#upToolsMobal').show();
154   - // 下行
  282 + // 下行
155 283 }else if(directionData==1){
156 284 // 显示下行规划
157 285 $('#downToolsMobal').show();
158 286 }
159   - });
160   - }else {
161   - /** 直接保存 @param:<lineNameV:线路名称;directionData:方向(0:上行;1:下行)> */
162   - PublicFunctions.systemLineStation(lineNameV,directionData);
  287 + }, 3000);
163 288 }
  289 + });
  290 + },
164 291  
165   - },
166   -
167   - /** 直接保存 @param:<lineNameV:线路名称;directionData:方向(0:上行;1:下行)> */
168   - systemLineStation : function(lineNameV,directionData) {
169   - /** 从百度地图获取线路信息 @param:<lineNameV:线路名称;directionData:方向(0:上行;1:下行);callback>*/
170   - WorldsBMap.lineInfoPanl(lineNameV,directionData,function(BusLine){
171   - // 如果线路信息不为空
172   - if(BusLine) {
173   - // 获取公交线几何对象, 仅当结果自动添加到地图上时有效
174   - var Polygon = BusLine.getPolyline();
175   - // 返回多边型的点数组(自1.2新增)
176   - var polyGonArray = Polygon.getPath();
177   - // 获取公交站点个数(自 1.2 新增)
178   - var stationNumber = BusLine.getNumBusStations();
179   - // 定义线路信息集合
180   - var stationInfo = [];
181   - // 遍历
182   - for(var k = 0 ; k < stationNumber; k++) {
183   - // 定义线路信息集合
184   - var tempM = {};
185   - // 添加站点名称
186   - tempM.name = BusLine.getBusStation(k).name;
187   - // 添加站点坐标
188   - tempM.potion = BusLine.getBusStation(k).position;
189   - tempM.wgs = {x:'',y:''};
190   - // 添加
191   - stationInfo.push(tempM);
192   - }
193   - // 获取站点之间的距离与时间
194   - WorldsBMap.getDistanceAndDuration(stationInfo,function(json) {
195   - // 设置第一个站的距离
196   - json[0].distance = '';
197   - // 设置第一个站的时间
198   - json[0].duration = '';
199   - // 定义站点信息JSON字符串
200   - var stationJSON = JSON.stringify(json);
201   - // 定义路段信息字符串
202   - var sectionJSON = JSON.stringify(polyGonArray);
203   - // 参数集合
204   - var params = {};
205   - // 站点信息JSON字符串
206   - params.stationJSON = stationJSON;
207   - var addLine = LineObj.getLineObj();
208   - // 线路ID
209   - params.lineId = addLine.id;
210   - // 方向
211   - params.directions = directionData;
212   - // 原始坐标类型
213   - params.dbType = 'b';
214   - // 圆形半径
215   - params.radius = '100';
216   - // 图形类型(r:圆形;p:多边形)
217   - params.shapesType = 'r';
218   - // destroy:是否撤销
219   - params.destroy = '0';
220   -
221   - // 路段信息JSON字符串
222   - params.sectionJSON = sectionJSON;
223   - // 限速
224   - params.speedLimit = '60';
225   - params.baseRes = 'No';
226   - // 获取版本号后提交添加
227   - $.get('/lineVersions/findByLineId',{'lineId':addLine.id},function(lineVersions){
228   - $.each(lineVersions,function(){
229   - if (this.status == 1) {
230   - // versions:版本号
231   - params.versions = this.versions;
232   - // 保存
233   - GetAjaxData.collectionSave(params,function(rd) {
234   - if(rd.status='SUCCESS') {
235   - // 关闭弹出层
236   - layer.closeAll();
237   - layer.msg('保存成功!');
238   - }else {
239   - // 保存失败
240   - layer.msg('保存失败!');
241   - }
242   - // 刷新树
243   - PublicFunctions.resjtreeDate(addLine.id,directionData);
244   - /** 查询上行路段信息 @param:<Line.id:线路Id;0:上行> @return:data:路段数据 */
245   - GetAjaxData.getSectionRouteInfo(addLine.id,directionData,function(data) {
246   - /** 在地图上画出线路走向 @param:<Line.id:线路Id;0:上行;data:路段数据> */
247   - PublicFunctions.linePanlThree(addLine.id,data,directionData);
248   - });
249   - });
250   - }
251   - })
252   - });
253   - });
254   - // 关闭弹出层
255   - layer.closeAll();
256   - // 上行
257   - if(directionData==0){
258   - $('#stationDown').removeClass('active');
259   - $('#stationDown').removeClass('in');
260   - $('#stationDown').addClass('fade');
261   - $('#stationUp').addClass('active in');
262   - $('#downLine').parent().removeClass('active');
263   - $('#upLine').parent().addClass('active');
264   - // 下行
265   - }else if(directionData==1){
266   - $('#stationUp').removeClass('active');
267   - $('#stationUp').removeClass('in');
268   - $('#stationUp').addClass('fade');
269   - $('#stationDown').addClass('active in');
270   - $('#upLine').parent().removeClass('active');
271   - $('#downLine').parent().addClass('active');
272   - }
273   - } else {
274   - layer.msg('百度地图中没有此线路,无法系统规划!');
275   - setTimeout(function() {
276   - // 关闭弹出层
277   - layer.closeAll();
278   - // 上行
279   - if(directionData==0){
280   - // 显示上行规划
281   - $('#upToolsMobal').show();
282   - // 下行
283   - }else if(directionData==1){
284   - // 显示下行规划
285   - $('#downToolsMobal').show();
286   - }
287   - }, 3000);
288   - }
289   - });
290   - },
291   -
292   - /** @param directionV_ :方向 */
293   - stationRevoke : function(directionV_) {
294   - // 获取树选中节点对象
295   - var obj = PublicFunctions.getCurrSelNode(directionV_);
296   - // 是否选中,选中节点是否为站点
297   - if(obj.length == 0 || obj[0].original.chaildredType !='station'){
298   - // 弹出提示层
299   - layer.msg('请先选择要删除的站点!');
300   - return;
301   - }
302   - // 弹出是否撤销提示框
303   - layer.confirm('你确定要撤销【'+obj[0].text+'】站点吗?', {btn : [ '确定撤销','返回' ],icon: 3, title:'提示' }, function(index){
304   - // 站点路由ID
305   - var stationRouteId = obj[0].original.stationRouteId;
306   - // 撤销参数集合
307   - var params = {stationRouteId:stationRouteId,destroy:'1'};
308   - // 方向
309   - var stationRouteDirections = obj[0].original.stationRouteDirections;
310   - // 撤销
311   - GetAjaxData.stationRouteIsDestroy(params,function(result) {
312   - // 关闭弹出框
313   - layer.close(index);
314   - if(result.status=='SUCCESS'){
315   - layer.msg('撤销'+(directionV_==0?"上行":"下行")+'站点【'+obj[0].text+'】成功!');
316   - }else{
317   - layer.msg('撤销'+(directionV_==0?"上行":"下行")+'站点【'+obj[0].text+'】失败!');
318   - }
319   - WorldsBMap.clearMarkAndOverlays();
320   - var Line = LineObj.getLineObj();
321   - // 刷行左边树
322   - PublicFunctions.resjtreeDate(Line.id,stationRouteDirections);
323   - /** 查询上行路段信息 @param:<Line.id:线路Id;0:上行> @return:data:路段数据 */
324   - GetAjaxData.getSectionRouteInfo(Line.id,stationRouteDirections,function(data) {
325   - /** 在地图上画出线路走向 @param:<Line.id:线路Id;0:上行;data:路段数据> */
326   - PublicFunctions.linePanlThree(Line.id,data,stationRouteDirections);
327   - });
  292 + /** @param directionV_ :方向 */
  293 + stationRevoke : function(directionV_) {
  294 + // 获取树选中节点对象
  295 + var obj = PublicFunctions.getCurrSelNode(directionV_);
  296 + // 是否选中,选中节点是否为站点
  297 + if(obj.length == 0 || obj[0].original.chaildredType !='station'){
  298 + // 弹出提示层
  299 + layer.msg('请先选择要删除的站点!');
  300 + return;
  301 + }
  302 + // 弹出是否撤销提示框
  303 + layer.confirm('你确定要撤销【'+obj[0].text+'】站点吗?', {btn : [ '确定撤销','返回' ],icon: 3, title:'提示' }, function(index){
  304 + // 站点路由ID
  305 + var stationRouteId = obj[0].original.stationRouteId;
  306 + // 撤销参数集合
  307 + var params = {stationRouteId:stationRouteId,destroy:'1'};
  308 + // 方向
  309 + var stationRouteDirections = obj[0].original.stationRouteDirections;
  310 + // 撤销
  311 + GetAjaxData.stationRouteIsDestroy(params,function(result) {
  312 + // 关闭弹出框
  313 + layer.close(index);
  314 + if(result.status=='SUCCESS'){
  315 + layer.msg('撤销'+(directionV_==0?"上行":"下行")+'站点【'+obj[0].text+'】成功!');
  316 + }else{
  317 + layer.msg('撤销'+(directionV_==0?"上行":"下行")+'站点【'+obj[0].text+'】失败!');
  318 + }
  319 + WorldsBMap.clearMarkAndOverlays();
  320 + var Line = LineObj.getLineObj();
  321 + // 刷行左边树
  322 + PublicFunctions.resjtreeDate(Line.id,stationRouteDirections);
  323 + /** 查询上行路段信息 @param:<Line.id:线路Id;0:上行> @return:data:路段数据 */
  324 + GetAjaxData.getSectionRouteInfo(Line.id,stationRouteDirections,function(data) {
  325 + /** 在地图上画出线路走向 @param:<Line.id:线路Id;0:上行;data:路段数据> */
  326 + PublicFunctions.linePanlThree(Line.id,data,stationRouteDirections);
328 327 });
329   - });
330   - },
  328 + });
  329 + });
  330 + },
331 331  
332   - /** @param direction_ :方向 */
333   - editLinePlan : function(direction_) {
334   - var sel = PublicFunctions.getCurrSelNode(direction_);
335   - if(sel.length==0 || sel[0].original.chaildredType !='section'){
336   - if(direction_=='0') {
337   - layer.msg('请先选中要编辑的上行路段!');
338   - }else if(direction_=='1') {
339   - layer.msg('请先选中要编辑的下行路段!');
340   - }
341   - return;
  332 + /** @param direction_ :方向 */
  333 + editLinePlan : function(direction_) {
  334 + var sel = PublicFunctions.getCurrSelNode(direction_);
  335 + if(sel.length==0 || sel[0].original.chaildredType !='section'){
  336 + if(direction_=='0') {
  337 + layer.msg('请先选中要编辑的上行路段!');
  338 + }else if(direction_=='1') {
  339 + layer.msg('请先选中要编辑的下行路段!');
  340 + }
  341 + return;
  342 + }
  343 + $('#downLine').addClass('btn disabled');
  344 + $('.btn-circle').addClass('disabled');
  345 + $('#upLine').addClass('btn disabled');
  346 + var editSectionV = sel[0].original;
  347 + EditSectionObj.setEitdSection(editSectionV);
  348 + // 弹出添加失败提示消息,2秒关闭(如果不配置,默认是3秒)
  349 + var yindex = layer.msg('编辑完线路走向后,请双击线路走向区域保存',{ offset: '126px',shift: 0,time: 10000});
  350 + WorldsBMap.editPolyUpline();
  351 + },
  352 +
  353 + setFormValue : function(editStationParmas) {
  354 + // 站点ID
  355 + $('#stationIdInput').val(editStationParmas.stationId);
  356 + // 站点路由ID
  357 + $('#stationRouteIdInput').val(editStationParmas.stationRouteId);
  358 + // 站点路由线路Id
  359 + $('#stationRouteLineInput').val(editStationParmas.stationRouteLine);
  360 + // 线路编码
  361 + $('#lineCodeInput').val(editStationParmas.stationRouteLIneCode);
  362 + // 百度坐标点图形集合
  363 + $('#bPolygonGridInput').val(editStationParmas.stationBPolygonGrid);
  364 + // 获取站点名称元素设值
  365 + $('#zdmcInput').val(editStationParmas.stationStationName);
  366 + // 获取站点路由名称元素设值
  367 + $('#stationNameInput').val(editStationParmas.stationStationName);
  368 + // 获取站点编码元素设值
  369 + $('#stationCodInput').val(editStationParmas.stationCode);
  370 + // 获取站点类型元素设值
  371 + // $('#stationMarkSelect').val(editStationParmas.stationRouteStationMark);
  372 + // 获取站点方向元素设值
  373 + $('#stationdirSelect').val(editStationParmas.stationRoutedirections);
  374 + // 获取站点道路编码元素设值
  375 + $('#roadCodingCodInput').val(editStationParmas.stationRoadCoding);
  376 + // 百度地图经纬度坐标中心点
  377 + $('#bJwpointsInput').val(editStationParmas.stationJwpoints);
  378 + if(editStationParmas.stationShapesType=='r') {
  379 + // 获取图形类型元素,并添加值
  380 + $('#shapesTypeSelect').val('圆形');
  381 + }else if(editStationParmas.stationShapesType=='d'){
  382 + $('#radiusGroup').hide();
  383 + $('#shapesTypeSelect').val('多边形');
  384 + }
  385 + // 获取半径元素,并添加值
  386 + $('#radiusInput').val(editStationParmas.stationRadius);
  387 + // 是否撤销
  388 + $('#destroySelect').val(editStationParmas.stationDestroy);
  389 + // 到站时间
  390 + $('#toTimeInput').val(editStationParmas.stationRouteToTime);
  391 + // 到站距离
  392 + $('#distancesInput').val(editStationParmas.stationRouteDistances);
  393 + // 线路版本号
  394 + $('#versionsInput').val(editStationParmas.stationRouteVersions);
  395 + // 描述/说明
  396 + $('#descriptionsTextarea').val(editStationParmas.sttationDescriptions);
  397 + },
  398 +
  399 + setSectionFormValue : function(Section) {
  400 + $('#isRoadeSpeedInput').val(Section.isRoadeSpeed);
  401 + // 路段ID
  402 + $('#sectionIdInput').val(Section.sectionId);
  403 + // 路段路由ID
  404 + $('#sectionRouteIdInput').val(Section.sectionrouteId);
  405 + // 线路ID
  406 + $('#sectionRouteLineInput').val(Section.sectionrouteLine);
  407 + // 线路编码
  408 + $('#lineCodeInput').val(Section.sectionrouteLineCode);
  409 + // 折线坐标集合
  410 + $('#bsectionVectorInput').val(Section.sectionBsectionVector);
  411 + // 路段名称
  412 + $('#sectionNameInput').val(Section.sectionName);
  413 + // 路段编码
  414 + $('#sectionCodeInput').val(Section.sectionCode);
  415 + // 路段序号
  416 + $('#sectionrouteCodeSelect').val(Section.sectionrouteCode);
  417 + // 路段方向
  418 + $('#directionsSection').val(Section.sectionrouteDirections);
  419 + // 道路编码
  420 + $('#roadCodingCodInput').val(Section.sectionRoadCoding);
  421 + // 道路限速
  422 + $('#speedLimitInput').val(Section.sectionSpeedLimet);
  423 + // 路段长度
  424 + $('#sectionDistanceInput').val(Section.sectionDistance);
  425 + // 时长
  426 + $('#sectionTimeInput').val(Section.sectionTime);
  427 + // 版本号
  428 + $('#versionsInput').val(Section.versions);
  429 + },
  430 +
  431 + //lineId,data,direction
  432 + treeSectionClick: function(lineId,data,direction){
  433 + /** 获取站点路由信息 @param:<Line.id:线路Id;0:上行> @return:<resultdata:站点路由数据> */
  434 + WorldsBMap.clearMarkAndOverlays();
  435 + // 编辑路段数据
  436 + for(var d= 0; d<data.length;d++){
  437 + // 地图折线坐标点集合
  438 + var polylineArray = [];
  439 + // 获取路段折线坐标字符串
  440 + var sectionBsectionVectorStr = data[d].sectionBsectionVector;
  441 + if(sectionBsectionVectorStr==null) {
  442 + continue;
342 443 }
343   - $('#downLine').addClass('btn disabled');
344   - $('.btn-circle').addClass('disabled');
345   - $('#upLine').addClass('btn disabled');
346   - var editSectionV = sel[0].original;
347   - EditSectionObj.setEitdSection(editSectionV);
348   - // 弹出添加失败提示消息,2秒关闭(如果不配置,默认是3秒)
349   - var yindex = layer.msg('编辑完线路走向后,请双击线路走向区域保存',{ offset: '126px',shift: 0,time: 10000});
350   - WorldsBMap.editPolyUpline();
351   - },
352   -
353   - setFormValue : function(editStationParmas) {
354   - // 站点ID
355   - $('#stationIdInput').val(editStationParmas.stationId);
356   - // 站点路由ID
357   - $('#stationRouteIdInput').val(editStationParmas.stationRouteId);
358   - // 站点路由线路Id
359   - $('#stationRouteLineInput').val(editStationParmas.stationRouteLine);
360   - // 线路编码
361   - $('#lineCodeInput').val(editStationParmas.stationRouteLineCode);
362   - // 百度坐标点图形集合
363   - $('#bPolygonGridInput').val(editStationParmas.stationBPolygonGrid);
364   - // 获取站点名称元素设值
365   - $('#zdmcInput').val(editStationParmas.stationStationName);
366   - // 获取站点路由名称元素设值
367   - $('#stationNameInput').val(editStationParmas.stationRouteStationName);
368   - // 获取站点编码元素设值
369   - $('#stationCodInput').val(editStationParmas.stationStationCod);
370   - // 获取站点类型元素设值
371   - // $('#stationMarkSelect').val(editStationParmas.stationRouteStationMark);
372   - // 获取站点方向元素设值
373   - $('#stationdirSelect').val(editStationParmas.stationRouteDirections);
374   - // 获取站点道路编码元素设值
375   - $('#roadCodingCodInput').val(editStationParmas.stationRoadCoding);
376   - // 百度地图经纬度坐标中心点
377   - $('#bJwpointsInput').val(editStationParmas.stationBJwpoints);
378   - if(editStationParmas.stationShapesType=='r') {
379   - // 获取图形类型元素,并添加值
380   - $('#shapesTypeSelect').val('圆形');
381   - }else if(editStationParmas.stationShapesType=='d'){
382   - $('#radiusGroup').hide();
383   - $('#shapesTypeSelect').val('多边形');
  444 + // 切割段折线坐标字符串
  445 + var tempStr = sectionBsectionVectorStr.substring(11,sectionBsectionVectorStr.length-1);
  446 + // 分割折线坐标字符串
  447 + var lineArray = tempStr.split(',');
  448 + for(var i = 0;i<lineArray.length;i++) {
  449 + polylineArray.push(new BMap.Point(lineArray[i].split(' ')[0],lineArray[i].split(' ')[1]));
384 450 }
385   - // 获取半径元素,并添加值
386   - $('#radiusInput').val(editStationParmas.stationRadius);
387   - // 是否撤销
388   - $('#destroySelect').val(editStationParmas.stationDestroy);
389   - // 到站时间
390   - $('#toTimeInput').val(editStationParmas.stationRouteToTime);
391   - // 到站距离
392   - $('#distancesInput').val(editStationParmas.stationRouteDistances);
393   - // 线路版本号
394   - $('#versionsInput').val(editStationParmas.stationRouteVersions);
395   - // 描述/说明
396   - $('#descriptionsTextarea').val(editStationParmas.stationRouteDescriptions);
397   - },
398   -
399   - setSectionFormValue : function(Section) {
400   - $('#isRoadeSpeedInput').val(Section.isRoadeSpeed);
401   - // 路段ID
402   - $('#sectionIdInput').val(Section.sectionId);
403   - // 路段路由ID
404   - $('#sectionRouteIdInput').val(Section.sectionrouteId);
405   - // 线路ID
406   - $('#sectionRouteLineInput').val(Section.sectionrouteLine);
407   - // 线路编码
408   - $('#lineCodeInput').val(Section.sectionrouteLineCode);
409   - // 折线坐标集合
410   - $('#bsectionVectorInput').val(Section.sectionBsectionVector);
411   - // 路段名称
412   - $('#sectionNameInput').val(Section.sectionName);
413   - // 路段编码
414   - $('#sectionCodeInput').val(Section.sectionCode);
415   - // 路段序号
416   - $('#sectionrouteCodeSelect').val(Section.sectionrouteCode);
417   - // 路段方向
418   - $('#directionsSection').val(Section.sectionrouteDirections);
419   - // 道路编码
420   - $('#roadCodingCodInput').val(Section.sectionRoadCoding);
421   - // 道路限速
422   - $('#speedLimitInput').val(Section.sectionSpeedLimet);
423   - // 路段长度
424   - $('#sectionDistanceInput').val(Section.sectionDistance);
425   - // 时长
426   - $('#sectionTimeInput').val(Section.sectionTime);
427   - // 版本号
428   - $('#versionsInput').val(Section.versions);
429   - // 是否撤销
430   - $('#destroySelect').val(Section.destroy);
431   - // 描述/说明
432   - $('#descriptionsTextarea').val(Section.descriptions);
433   - },
434   -
435   - //lineId,data,direction
436   - treeSectionClick: function(lineId,data,direction){
437   - /** 获取站点路由信息 @param:<Line.id:线路Id;0:上行> @return:<resultdata:站点路由数据> */
  451 + var index = parseInt(polylineArray.length/2);
  452 + var center = polylineArray[index];
  453 + /** 在地图上画出线路走向 @param:<polylineArray:地图折线坐标点集合;resultdata:站点路由数据> */
  454 + WorldsBMap.drawingUpline(polylineArray,center);
  455 + /** 在地图上画点 @param:<point_center:中心坐标点> */
  456 + WorldsBMap.drawingUpStationPoint(data[d], d+1);
  457 + }
  458 + },
  459 +
  460 + /** 在地图上画出线路走向 @param:<Line.id:线路Id;0:上行;data:路段数据> */
  461 + linePanlThree : function(lineId,data,direction) {
  462 + /** 获取站点路由信息 @param:<Line.id:线路Id;0:上行> @return:<resultdata:站点路由数据> */
  463 + GetAjaxData.getStationRoutePoint(lineId,direction,function(resultdata) {
438 464 WorldsBMap.clearMarkAndOverlays();
439   - // 编辑路段数据
440   - for(var d= 0; d<data.length;d++){
441   - // 地图折线坐标点集合
442   - var polylineArray = [];
443   - // 获取路段折线坐标字符串
444   - var sectionBsectionVectorStr = data[d].sectionBsectionVector;
445   - if(sectionBsectionVectorStr==null) {
446   - continue;
447   - }
448   - // 切割段折线坐标字符串
449   - var tempStr = sectionBsectionVectorStr.substring(11,sectionBsectionVectorStr.length-1);
450   - // 分割折线坐标字符串
451   - var lineArray = tempStr.split(',');
452   - for(var i = 0;i<lineArray.length;i++) {
453   - polylineArray.push(new BMap.Point(lineArray[i].split(' ')[0],lineArray[i].split(' ')[1]));
  465 + var polyline_center;
  466 + // 如果站点路由数据不为空
  467 + if(resultdata.length>0) {
  468 + var ceter_index = Math.round(resultdata.length / 2);
  469 + var ceterPointsStr = resultdata[ceter_index].stationJwpoints;
  470 + var ceterPointsArray = ceterPointsStr.split(' ');
  471 + polyline_center = new BMap.Point(ceterPointsArray[0],ceterPointsArray[1]);
  472 + // 遍历站点路由数据
  473 + for(var s = 0 ; s<resultdata.length;s++) {
  474 + WorldsBMap.drawingUpStationPoint(resultdata[s], s+1);
454 475 }
455   - var index = parseInt(polylineArray.length/2);
456   - var center = polylineArray[index];
457   - /** 在地图上画出线路走向 @param:<polylineArray:地图折线坐标点集合;resultdata:站点路由数据> */
458   - WorldsBMap.drawingUpline(polylineArray,center);
459   - /** 在地图上画点 @param:<point_center:中心坐标点> */
460   - WorldsBMap.drawingUpStationPoint(center,data[d].name,d+1);
  476 +
461 477 }
462   - },
463   -
464   - /** 在地图上画出线路走向 @param:<Line.id:线路Id;0:上行;data:路段数据> */
465   - linePanlThree : function(lineId,data,direction) {
466   - /** 获取站点路由信息 @param:<Line.id:线路Id;0:上行> @return:<resultdata:站点路由数据> */
467   - GetAjaxData.getStationRoutePoint(lineId,direction,function(resultdata) {
468   - WorldsBMap.clearMarkAndOverlays();
469   - var polyline_center;
470   - // 如果站点路由数据不为空
471   - if(resultdata.length>0) {
472   - var ceter_index = Math.round(resultdata.length / 2);
473   - var ceterPointsStr = resultdata[ceter_index].bJwpoints;
474   - var ceterPointsArray = ceterPointsStr.split(' ');
475   - polyline_center = new BMap.Point(ceterPointsArray[0],ceterPointsArray[1]);
476   - // 遍历站点路由数据
477   - for(var s = 0 ; s<resultdata.length;s++) {
478   - // 中心点坐标字符串
479   - var bJwpointsStr = resultdata[s].bJwpoints;
480   - var stationName = resultdata[s].stationName;
481   - // 起个中心点坐标字符串
482   - var bJwpointsArray = bJwpointsStr.split(' ');
483   - // 设置中心点
484   - var point_center = new BMap.Point(bJwpointsArray[0],bJwpointsArray[1]);
485   - /** 在地图上画点 @param:<point_center:中心坐标点> */
486   - WorldsBMap.drawingUpStationPoint(point_center,stationName,s+1);
487   - }
488   -
489   - }
490   - // 路段数据长度
491   - var dataLen = data.length;
492   - // 如果大于零
493   - if(dataLen>0) {
494   - // 编辑路段数据
495   - for(var d= 0; d<dataLen;d++){
496   - // 地图折线坐标点集合
497   - var polylineArray = [];
498   - // 获取路段折线坐标字符串
499   - var sectionBsectionVectorStr = data[d].sectionBsectionVector;
500   - if(sectionBsectionVectorStr==null)
501   - continue;
502   - // 切割段折线坐标字符串
503   - var tempStr = sectionBsectionVectorStr.substring(11,sectionBsectionVectorStr.length-1);
504   - // 分割折线坐标字符串
505   - var lineArray = tempStr.split(',');
506   - for(var i = 0;i<lineArray.length;i++) {
507   - polylineArray.push(new BMap.Point(lineArray[i].split(' ')[0],lineArray[i].split(' ')[1]));
508   - }
509   - /** 在地图上画出线路走向 @param:<polylineArray:地图折线坐标点集合;resultdata:站点路由数据> */
510   - /*WorldsBMap.drawingUpline(polylineArray,polyline_center,data[d]);*/
511   - WorldsBMap.drawingUpline01(polylineArray,polyline_center,data[d]);
512   - }
  478 + // 路段数据长度
  479 + var dataLen = data.length;
  480 + // 如果大于零
  481 + if(dataLen>0) {
  482 + WorldsBMap.drawingUpline01(polyline_center,data);
  483 + }
  484 + });
  485 + },
  486 + /** 加载树 @param:<lineId:线路ID;diraction:方向(0:上行;1:下行)> */
  487 + TreeUpOrDown : function(lineId,diraction) {
  488 + /** 获取树结果数据 @param:<lineId:线路ID;diraction:方向;callback:回调函数> */
  489 + GetAjaxData.getStation(lineId,diraction,function(treeDateJson) {
  490 + // 获取返回数据长度
  491 + var len = treeDateJson[0].children[0].children.length;
  492 + // 上行
  493 + if(diraction == 0) {
  494 + /** 初始化上行树 @param:<treeDateJson:树数据结构> */
  495 + StationTreeData.upInit(treeDateJson);
  496 + if(len>0) {
  497 + $('#upToolsMobal').hide();
  498 + $('#uptreeMobal').show();
  499 + }else {
  500 + $('#upToolsMobal').show();
  501 + $('#uptreeMobal').hide();
513 502 }
514   - });
515   - },
516   - /** 加载树 @param:<lineId:线路ID;diraction:方向(0:上行;1:下行)> */
517   - TreeUpOrDown : function(lineId,diraction) {
518   - /** 获取树结果数据 @param:<lineId:线路ID;diraction:方向;callback:回调函数> */
519   - GetAjaxData.getStation(lineId,diraction,function(treeDateJson) {
520   - // 获取返回数据长度
521   - var len = treeDateJson[0].children[0].children.length;
522   - // 上行
523   - if(diraction == 0) {
524   - /** 初始化上行树 @param:<treeDateJson:树数据结构> */
525   - StationTreeData.upInit(treeDateJson);
526   - if(len>0) {
527   - $('#upToolsMobal').hide();
528   - $('#uptreeMobal').show();
529   - }else {
530   - $('#upToolsMobal').show();
531   - $('#uptreeMobal').hide();
532   - }
533   - // 下行
534   - }else if(diraction ==1) {
535   - /** 出事画下行树 @param:<treeDateJson:树数据结构> */
536   - StationTreeData.downInit(treeDateJson);
537   - if(len>0) {
538   - $('#downToolsMobal').hide();
539   - $('#DowntreeMobal').show();
540   - }else {
541   - $('#downToolsMobal').show();
542   - $('#DowntreeMobal').hide();
543   - }
  503 + // 下行
  504 + }else if(diraction ==1) {
  505 + /** 出事画下行树 @param:<treeDateJson:树数据结构> */
  506 + StationTreeData.downInit(treeDateJson);
  507 + if(len>0) {
  508 + $('#downToolsMobal').hide();
  509 + $('#DowntreeMobal').show();
  510 + }else {
  511 + $('#downToolsMobal').show();
  512 + $('#DowntreeMobal').hide();
544 513 }
545   - });
546   - },
547   - isHaveStationName : function(data) {
548   - if(data.length>0) {
549   - layer.confirm('系统已存在【'+ data[0].stationName +'】该站点位置名称,请选择【系统引用】或者更改站点名称进行新增!', {btn : [ '返回' ],icon: 3, title:'提示' }, function(index){
550   - layer.close(index);
551   - });
552   - return false;
553   - }else {
554   - return true;
555 514 }
556   - },
557   - editAChangeCssRemoveDisabled : function() {
558   - $('#downLine').removeClass('btn disabled');
559   - $('.btn-circle').removeClass('disabled');
560   - $('#upLine').removeClass('btn disabled');
561   - },
562   - // 方向代码转名称.
563   - dirdmToName : function(value){
564   - var srStr = '';
565   - if(value=='0')
566   - srStr = '上行';
567   - else if(value=='1')
568   - srStr = '下行';
569   - return srStr;
570   - },
  515 + });
  516 + },
  517 + isHaveStationName : function(data) {
  518 + if(data.length>0) {
  519 + layer.confirm('系统已存在【'+ data[0].stationName +'】该站点位置名称,请选择【系统引用】或者更改站点名称进行新增!', {btn : [ '返回' ],icon: 3, title:'提示' }, function(index){
  520 + layer.close(index);
  521 + });
  522 + return false;
  523 + }else {
  524 + return true;
  525 + }
  526 + },
  527 + // 地图处于编辑状态
  528 + editMapStatus : function () {
  529 + WorldsBMap.setMap_status(1);
  530 + $('.protlet-box-layer').show();
  531 + },
  532 + // 地图处于编辑状态
  533 + editMapStatusRemove : function () {
  534 + WorldsBMap.setMap_status(0);
  535 + $('.protlet-box-layer').hide();
  536 + },
  537 + // 选项鎖死解除
  538 + editAChangeCssRemoveDisabled : function() {
  539 + $('#downLine').removeClass('btn disabled');
  540 + $('.btn-circle').removeClass('disabled');
  541 + $('#upLine').removeClass('btn disabled');
  542 + },
  543 + // 方向代码转名称.
  544 + dirdmToName : function(value){
  545 + var srStr = '';
  546 + if(value=='0')
  547 + srStr = '上行';
  548 + else if(value=='1')
  549 + srStr = '下行';
  550 + return srStr;
  551 + },
571 552 }
572 553 return PubFun ;
573 554 }();
574 555 \ No newline at end of file
... ...