Commit 295229a2fd0690bc47fce7077cf4ae2d542ed149

Authored by 潘钊
2 parents 78a2f1ce 3b5e534a

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

Showing 57 changed files with 7388 additions and 5184 deletions
src/main/java/com/bsth/controller/BusIntervalController.java
@@ -52,5 +52,10 @@ public class BusIntervalController { @@ -52,5 +52,10 @@ public class BusIntervalController {
52 public List<Map<String,Object>> correctStatis(@RequestParam Map<String, Object> map){ 52 public List<Map<String,Object>> correctStatis(@RequestParam Map<String, Object> map){
53 return busIntervalService.correctStatis(map); 53 return busIntervalService.correctStatis(map);
54 } 54 }
55 - 55 +
  56 + @RequestMapping(value = "exportWaybillMore", method = RequestMethod.GET)
  57 + public Map<String, Object> exportWaybillMore(@RequestParam Map<String, Object> map){
  58 + return busIntervalService.exportWaybillMore(map);
  59 + }
  60 +
56 } 61 }
src/main/java/com/bsth/controller/SectionController.java
@@ -135,7 +135,16 @@ public class SectionController extends BaseController&lt;Section, Integer&gt; { @@ -135,7 +135,16 @@ public class SectionController extends BaseController&lt;Section, Integer&gt; {
135 @RequestMapping(value="getSectionCode" , method = RequestMethod.GET) 135 @RequestMapping(value="getSectionCode" , method = RequestMethod.GET)
136 public long getSectionCode() { 136 public long getSectionCode() {
137 return GetUIDAndCode.getSectionId(); 137 return GetUIDAndCode.getSectionId();
138 - 138 + }
  139 +
  140 + /**
  141 + * @Description :TODO(把路段截取位双路名路段)
  142 + *
  143 + * @return int <sectionCode路段编码>
  144 + */
  145 + @RequestMapping(value="doubleName" , method = RequestMethod.GET)
  146 + public Map<String, Object> doubleName(@RequestParam Map<String, Object> map) {
  147 + return service.doubleName(map);
139 } 148 }
140 149
141 } 150 }
src/main/java/com/bsth/controller/StationController.java
@@ -148,14 +148,28 @@ public class StationController extends BaseController&lt;Station, Integer&gt; { @@ -148,14 +148,28 @@ public class StationController extends BaseController&lt;Station, Integer&gt; {
148 return service.stationCacheUpdate(map); 148 return service.stationCacheUpdate(map);
149 } 149 }
150 /** 150 /**
  151 + * @Description :TODO(更新内部编码)
  152 + * @param stationCount,sectionCount 更新数
  153 + */
  154 + @RequestMapping(value="updateStationAndSectionCode" , method = RequestMethod.GET)
  155 + public int updateStationAndSectionCode(@RequestParam Integer stationCount, Integer sectionCount) {
  156 + for(int i = 0; i < stationCount; i++) {
  157 + GetUIDAndCode.getStationId();
  158 + }
  159 + for(int i = 0; i < sectionCount; i++) {
  160 + GetUIDAndCode.getSectionId();
  161 + }
  162 + return 1;
  163 + }
  164 + /**
151 * @Description :TODO(查询站点编码) 165 * @Description :TODO(查询站点编码)
152 - * 166 + *
153 * @return int <stationCode站点编码> 167 * @return int <stationCode站点编码>
154 */ 168 */
155 @RequestMapping(value="getStationCode" , method = RequestMethod.GET) 169 @RequestMapping(value="getStationCode" , method = RequestMethod.GET)
156 public long getStationCode() { 170 public long getStationCode() {
157 return GetUIDAndCode.getStationId(); 171 return GetUIDAndCode.getStationId();
158 - 172 +
159 } 173 }
160 /** 174 /**
161 * @Description :TODO(查询站点编码) 175 * @Description :TODO(查询站点编码)
src/main/java/com/bsth/controller/StationRouteController.java
1 package com.bsth.controller; 1 package com.bsth.controller;
2 2
  3 +import com.bsth.entity.Station;
3 import com.bsth.entity.StationRoute; 4 import com.bsth.entity.StationRoute;
4 import com.bsth.entity.StationRouteCache; 5 import com.bsth.entity.StationRouteCache;
5 import com.bsth.repository.StationRouteCacheRepository; 6 import com.bsth.repository.StationRouteCacheRepository;
@@ -110,12 +111,20 @@ public class StationRouteController extends BaseController&lt;StationRoute, Integer @@ -110,12 +111,20 @@ public class StationRouteController extends BaseController&lt;StationRoute, Integer
110 } 111 }
111 112
112 /** 113 /**
113 - * @Description :TODO(查询缓存站点的上一个缓存站点) 114 + * @Description :TODO(查询线路某方向下的站点序号与类型)
114 */ 115 */
115 @RequestMapping(value = "/findCacheUpStationRouteCode" , method = RequestMethod.GET) 116 @RequestMapping(value = "/findCacheUpStationRouteCode" , method = RequestMethod.GET)
116 public List<Map<String, Object>> findCacheUpStationRouteCode(@RequestParam Map<String, Object> map) { 117 public List<Map<String, Object>> findCacheUpStationRouteCode(@RequestParam Map<String, Object> map) {
117 return service.findCacheUpStationRouteCode(map); 118 return service.findCacheUpStationRouteCode(map);
118 } 119 }
  120 +
  121 + /**
  122 + * @Description :TODO(查询站点的下一个缓存站点)
  123 + */
  124 + @RequestMapping(value = "/findDownStationRoute" , method = RequestMethod.GET)
  125 + public List<Map<String, Object>> findDownStationRoute(@RequestParam Map<String, Object> map) {
  126 + return service.findDownStationRoute(map);
  127 + }
119 128
120 /** 129 /**
121 * @Description :TODO(查询线路某方向下所有站点的中心百度坐标) 130 * @Description :TODO(查询线路某方向下所有站点的中心百度坐标)
src/main/java/com/bsth/entity/LonLatName.java 0 → 100644
  1 +package com.bsth.entity;
  2 +
  3 +public class LonLatName {
  4 + public String first_name;
  5 + public String second_name;
  6 + public String way_name;
  7 + public String location;
  8 +
  9 + public String getFirst_name() {
  10 + return first_name;
  11 + }
  12 +
  13 + public void setFirst_name(String first_name) {
  14 + this.first_name = first_name;
  15 + }
  16 +
  17 + public String getSecond_name() {
  18 + return second_name;
  19 + }
  20 +
  21 + public void setSecond_name(String second_name) {
  22 + this.second_name = second_name;
  23 + }
  24 +
  25 + public String getWay_name() {
  26 + return way_name;
  27 + }
  28 +
  29 + public void setWay_name(String way_name) {
  30 + this.way_name = way_name;
  31 + }
  32 + public String getLocation() {
  33 + return location;
  34 + }
  35 +
  36 + public void setLocation(String location) {
  37 + this.location = location;
  38 + }
  39 +}
src/main/java/com/bsth/entity/oil/Dlb.java
@@ -58,6 +58,8 @@ public class Dlb { @@ -58,6 +58,8 @@ public class Dlb {
58 private int nylx; 58 private int nylx;
59 //进场顺序(根据最先出场和最后进场来关联车辆的存电量) 59 //进场顺序(根据最先出场和最后进场来关联车辆的存电量)
60 private int jcsx; 60 private int jcsx;
  61 +
  62 + private String jname;
61 @Transient 63 @Transient
62 private String name; 64 private String name;
63 @Transient 65 @Transient
@@ -73,6 +75,7 @@ public class Dlb { @@ -73,6 +75,7 @@ public class Dlb {
73 private String fgsname; 75 private String fgsname;
74 76
75 77
  78 +
76 private String lp; 79 private String lp;
77 80
78 public Integer getId() { 81 public Integer getId() {
@@ -391,6 +394,14 @@ public class Dlb { @@ -391,6 +394,14 @@ public class Dlb {
391 public void setLp(String lp) { 394 public void setLp(String lp) {
392 this.lp = lp; 395 this.lp = lp;
393 } 396 }
  397 +
  398 + public String getJname() {
  399 + return jname;
  400 + }
  401 +
  402 + public void setJname(String jname) {
  403 + this.jname = jname;
  404 + }
394 405
395 406
396 407
src/main/java/com/bsth/entity/oil/Ylb.java
@@ -26,6 +26,7 @@ public class Ylb { @@ -26,6 +26,7 @@ public class Ylb {
26 private String fgsdm; 26 private String fgsdm;
27 private String nbbm; 27 private String nbbm;
28 private String jsy; 28 private String jsy;
  29 + private String jname;
29 private Double czlc=0.0; 30 private Double czlc=0.0;
30 private Double jzlc=0.0; 31 private Double jzlc=0.0;
31 private Double czyl=0.0; 32 private Double czyl=0.0;
@@ -339,6 +340,14 @@ public class Ylb { @@ -339,6 +340,14 @@ public class Ylb {
339 public void setLp(String lp) { 340 public void setLp(String lp) {
340 this.lp = lp; 341 this.lp = lp;
341 } 342 }
  343 +
  344 + public String getJname() {
  345 + return jname;
  346 + }
  347 +
  348 + public void setJname(String jname) {
  349 + this.jname = jname;
  350 + }
342 351
343 352
344 } 353 }
src/main/java/com/bsth/repository/CarsRepository.java
@@ -15,4 +15,7 @@ public interface CarsRepository extends BaseRepository&lt;Cars, Integer&gt;{ @@ -15,4 +15,7 @@ public interface CarsRepository extends BaseRepository&lt;Cars, Integer&gt;{
15 15
16 @Query(value="select s from Cars s") 16 @Query(value="select s from Cars s")
17 List<Cars> findCars(); 17 List<Cars> findCars();
  18 +
  19 + @Query(value="select s from Cars s where s.insideCode=?1")
  20 + List<Cars> findCarsByCode(String insideCode);
18 } 21 }
src/main/java/com/bsth/repository/SectionRouteRepository.java
@@ -172,9 +172,13 @@ public interface SectionRouteRepository extends BaseRepository&lt;SectionRoute, Int @@ -172,9 +172,13 @@ public interface SectionRouteRepository extends BaseRepository&lt;SectionRoute, Int
172 void isRoadSpeedUpd(Integer isR,Integer line,Integer directions); 172 void isRoadSpeedUpd(Integer isR,Integer line,Integer directions);
173 173
174 @Modifying 174 @Modifying
175 - @Query(value="UPDATE bsth_c_sectionroute set sectionroute_code = (sectionroute_code+10) where line = ?1 and directions = ?2 and sectionroute_code >=?3 and destroy = 0", nativeQuery=true) 175 + @Query(value="UPDATE bsth_c_sectionroute set sectionroute_code = (sectionroute_code+100) where line = ?1 and directions = ?2 and sectionroute_code >=?3 and destroy = 0", nativeQuery=true)
176 public void sectionUpdSectionRouteCode(Integer line,Integer dir,Integer routeCod); 176 public void sectionUpdSectionRouteCode(Integer line,Integer dir,Integer routeCod);
177 - 177 +
  178 + @Modifying
  179 + @Query(value="UPDATE bsth_c_sectionroute set sectionroute_code = (sectionroute_code+100) where line_code = ?1 and directions = ?2 and sectionroute_code >=?3 and destroy = 0", nativeQuery=true)
  180 + public void sectionUpdSectionRouteCode(String lineCode,Integer dir,int routeCod);
  181 +
178 @Modifying 182 @Modifying
179 @Query(value="UPDATE bsth_c_sectionroute set destroy = 1 where id = ?1", nativeQuery=true) 183 @Query(value="UPDATE bsth_c_sectionroute set destroy = 1 where id = ?1", nativeQuery=true)
180 public void sectionRouteIsDestroyUpdBatch(Integer id); 184 public void sectionRouteIsDestroyUpdBatch(Integer id);
src/main/java/com/bsth/repository/StationRouteRepository.java
@@ -102,8 +102,79 @@ public interface StationRouteRepository extends BaseRepository&lt;StationRoute, Int @@ -102,8 +102,79 @@ public interface StationRouteRepository extends BaseRepository&lt;StationRoute, Int
102 "select MAX(station_route_code) as stationRouteCode from bsth_c_stationroute r WHERE " + 102 "select MAX(station_route_code) as stationRouteCode from bsth_c_stationroute r WHERE " +
103 "r.line=?1 and r.directions =?2 and station_route_code< ?3 and r.destroy = 0 ) and t.line=?1 and t.directions = ?2 AND t.destroy = 0", nativeQuery=true) 103 "r.line=?1 and r.directions =?2 and station_route_code< ?3 and r.destroy = 0 ) and t.line=?1 and t.directions = ?2 AND t.destroy = 0", nativeQuery=true)
104 List<Object[]> findUpStationRouteCode(Integer lineId,Integer direction,Integer stationRouteCode); 104 List<Object[]> findUpStationRouteCode(Integer lineId,Integer direction,Integer stationRouteCode);
105 -  
106 - 105 +
  106 + /**
  107 + * @Description :TODO(查询下个站点)
  108 + *
  109 + * @param map <lineId:线路ID; direction:方向;stationRouteCode:站点编码>
  110 + *
  111 + * @return List<Map<String, Object>>
  112 + */
  113 + @Query(value = "SELECT a.stationRouteLine," +
  114 + " a.stationRouteStation," +
  115 + " a.stationRouteCode," +
  116 + " a.stationRouteLIneCode," +
  117 + " a.stationRouteStationMark," +
  118 + " a.stationOutStationNmber," +
  119 + " a.stationRoutedirections," +
  120 + " a.stationRouteDistances," +
  121 + " a.stationRouteToTime," +
  122 + " a.staitonRouteFirstTime," +
  123 + " a.stationRouteEndTime," +
  124 + " a.stationRouteDescriptions," +
  125 + " a.stationRouteDestroy," +
  126 + " a.stationRouteVersions," +
  127 + " a.stationRouteCreateBy," +
  128 + " a.stationRouteCreateDate," +
  129 + " a.stationRouteUpdateBy," +
  130 + " a.stationRouteUpdateDate," +
  131 + " b.id AS stationId," +
  132 + " b.station_cod AS stationCode," +
  133 + " a.stationRouteName," +
  134 + " b.road_coding AS stationRoadCoding," +
  135 + " b.db_type AS stationDbType," +
  136 + " b.b_jwpoints AS stationJwpoints," +
  137 + " b.g_lonx AS stationGlonx," +
  138 + " b.g_laty AS stationGlaty," +
  139 + " b.x AS stationX," +
  140 + " b.y AS stationY," +
  141 + " ST_AsText(b.b_polygon_grid) as stationBPolyonGrid," +
  142 + " ST_AsText(b.g_polygon_grid) AS stationGPloyonGrid, " +
  143 + " b.destroy AS stationDestroy," +
  144 + " b.radius AS stationRadius," +
  145 + " b.shapes_type AS stationShapesType," +
  146 + " b.versions AS stationVersions," +
  147 + " b.descriptions AS sttationDescriptions," +
  148 + " b.create_by AS stationCreateBy," +
  149 + " b.create_date AS stationCreateDate," +
  150 + " b.update_by AS stationUpdateBy," +
  151 + " b.update_date AS stationUpdateDate," +
  152 + " a.stationRouteId,b.station_name as zdmc "+
  153 + " FROM ( SELECT s.id AS stationRouteId," +
  154 + " s.line AS stationRouteLine," +
  155 + " s.station as stationRouteStation," +
  156 + " s.station_name AS stationRouteName," +
  157 + " s.station_route_code as stationRouteCode," +
  158 + " s.line_code AS stationRouteLIneCode," +
  159 + " s.station_mark AS stationRouteStationMark," +
  160 + " s.out_station_nmber AS stationOutStationNmber," +
  161 + " s.directions AS stationRoutedirections," +
  162 + " s.distances AS stationRouteDistances," +
  163 + " s.to_time AS stationRouteToTime," +
  164 + " s.first_time AS staitonRouteFirstTime," +
  165 + " s.end_time AS stationRouteEndTime," +
  166 + " s.descriptions AS stationRouteDescriptions," +
  167 + " s.destroy AS stationRouteDestroy," +
  168 + " s.versions AS stationRouteVersions," +
  169 + " s.create_by AS stationRouteCreateBy," +
  170 + " s.create_date AS stationRouteCreateDate," +
  171 + " s.update_by AS stationRouteUpdateBy," +
  172 + " s.update_date AS stationRouteUpdateDate FROM bsth_c_stationroute s WHERE s.station_route_code =(" +
  173 + "select MIN(station_route_code) as stationRouteCode from bsth_c_stationroute r WHERE " +
  174 + "r.line=?1 and r.directions =?2 and station_route_code > ?3 and r.destroy = 0 ) and s.line=?1 and s.directions = ?2 AND s.destroy = 0) a " +
  175 + " LEFT JOIN bsth_c_station b ON a.stationRouteStation = b.id", nativeQuery=true)
  176 + List<Object[]> findDownStationRoute(Integer id,Integer direction,Integer stationRouteCode);
  177 +
107 /** 178 /**
108 * @Description :TODO(站点中心点坐标查询) 179 * @Description :TODO(站点中心点坐标查询)
109 * 180 *
src/main/java/com/bsth/repository/oil/DlbRepository.java
@@ -95,4 +95,8 @@ public interface DlbRepository extends BaseRepository&lt;Dlb, Integer&gt;{ @@ -95,4 +95,8 @@ public interface DlbRepository extends BaseRepository&lt;Dlb, Integer&gt;{
95 95
96 @Query(value="SELECT * FROM bsth_c_dlb where to_days(?1)=to_days(rq) and nbbm =?2 and jsy=?3 and xlbm=?4",nativeQuery=true) 96 @Query(value="SELECT * FROM bsth_c_dlb where to_days(?1)=to_days(rq) and nbbm =?2 and jsy=?3 and xlbm=?4",nativeQuery=true)
97 List<Dlb> queryListDlb(String rq,String nbbm,String jgh,String xlbm); 97 List<Dlb> queryListDlb(String rq,String nbbm,String jgh,String xlbm);
  98 +
  99 + @Query(value="SELECT * FROM bsth_c_dlb where to_days(?1)=to_days(rq) and xlbm=?2",nativeQuery=true)
  100 + List<Dlb> queryDlbByRqXlbm(String rq, String xlbm);
  101 +
98 } 102 }
src/main/java/com/bsth/repository/oil/YlbRepository.java
@@ -49,13 +49,13 @@ public interface YlbRepository extends BaseRepository&lt;Ylb, Integer&gt;{ @@ -49,13 +49,13 @@ public interface YlbRepository extends BaseRepository&lt;Ylb, Integer&gt;{
49 @Query(value="select * from bsth_c_ylb where to_days(?1) -to_days(rq) <30 " 49 @Query(value="select * from bsth_c_ylb where to_days(?1) -to_days(rq) <30 "
50 + " and rq< ?1 and ssgsdm like %?2%" 50 + " and rq< ?1 and ssgsdm like %?2%"
51 + " and fgsdm like %?3% and xlbm like %?4% and nbbm like %?5% " 51 + " and fgsdm like %?3% and xlbm like %?4% and nbbm like %?5% "
52 - + " order by nbbm , rq desc,jcsx desc",nativeQuery=true) 52 + + " order by nbbm , rq desc,jcsx desc,lp desc",nativeQuery=true)
53 List<Ylb> listByRqJcsx(String rq,String gsbm,String fgsbm,String xlbm,String nbbm); 53 List<Ylb> listByRqJcsx(String rq,String gsbm,String fgsbm,String xlbm,String nbbm);
54 54
55 @Query(value="select * from bsth_c_ylb where rq>=?1 " 55 @Query(value="select * from bsth_c_ylb where rq>=?1 "
56 + " and rq<= ?2 and ssgsdm =?3" 56 + " and rq<= ?2 and ssgsdm =?3"
57 + " and fgsdm =?4 and xlbm like %?5% " 57 + " and fgsdm =?4 and xlbm like %?5% "
58 - + " order by nbbm , rq desc,jcsx desc",nativeQuery=true) 58 + + " order by nbbm , rq desc,jcsx desc,lp desc",nativeQuery=true)
59 List<Ylb> listByMonthJcsx(String rq,String rq2,String gsbm,String fgsbm,String xlbm); 59 List<Ylb> listByMonthJcsx(String rq,String rq2,String gsbm,String fgsbm,String xlbm);
60 60
61 /** 61 /**
@@ -81,6 +81,9 @@ public interface YlbRepository extends BaseRepository&lt;Ylb, Integer&gt;{ @@ -81,6 +81,9 @@ public interface YlbRepository extends BaseRepository&lt;Ylb, Integer&gt;{
81 81
82 @Query(value="SELECT * FROM bsth_c_ylb where to_days(?1)=to_days(rq) and nbbm =?2 and jsy=?3 and xlbm=?4",nativeQuery=true) 82 @Query(value="SELECT * FROM bsth_c_ylb where to_days(?1)=to_days(rq) and nbbm =?2 and jsy=?3 and xlbm=?4",nativeQuery=true)
83 List<Ylb> queryListYlb(String rq,String nbbm,String jgh,String xlbm); 83 List<Ylb> queryListYlb(String rq,String nbbm,String jgh,String xlbm);
  84 +
  85 + @Query(value="SELECT * FROM bsth_c_ylb where to_days(?1)=to_days(rq) and xlbm=?2",nativeQuery=true)
  86 + List<Ylb> queryYlbByRqXlbm(String rq,String xlbm);
84 87
85 @Query(value="SELECT * FROM bsth_c_ylb where to_days(?1)=to_days(rq) and nbbm =?2 and jsy=?3 and xlbm=?4 order by ?5 asc",nativeQuery=true) 88 @Query(value="SELECT * FROM bsth_c_ylb where to_days(?1)=to_days(rq) and nbbm =?2 and jsy=?3 and xlbm=?4 order by ?5 asc",nativeQuery=true)
86 List<Ylb> checkYlb(String rq,String nbbm,String jgh,String xlbm,String px); 89 List<Ylb> checkYlb(String rq,String nbbm,String jgh,String xlbm,String px);
src/main/java/com/bsth/repository/realcontrol/ScheduleRealInfoRepository.java
@@ -193,10 +193,10 @@ public interface ScheduleRealInfoRepository extends BaseRepository&lt;ScheduleRealI @@ -193,10 +193,10 @@ public interface ScheduleRealInfoRepository extends BaseRepository&lt;ScheduleRealI
193 List<ScheduleRealInfo> scheduleByDateAndLineYbb(String line,String date,String date2); 193 List<ScheduleRealInfo> scheduleByDateAndLineYbb(String line,String date,String date2);
194 194
195 195
196 - @Query(value="select new map(s.scheduleDate as scheduleDate,s.xlBm as xlBm,s.clZbh as clZbh,s.jGh as jGh,s.lpName as lpName,min(s.fcsj) as fcsj,min(s.realExecDate) as realExecDate ) from ScheduleRealInfo s where s.xlBm like %?1% and s.scheduleDateStr = ?2 and s.gsBm like %?3% and s.fgsBm like %?4% and s.clZbh like %?5% GROUP BY xlBm,clZbh,jGh,scheduleDate,lpName ORDER BY clZbh,realExecDate,fcsj") 196 + @Query(value="select new map(s.scheduleDate as scheduleDate,s.xlBm as xlBm,s.clZbh as clZbh,s.jGh as jGh,s.lpName as lpName,min(s.fcsj) as fcsj,min(s.realExecDate) as realExecDate,s.jName as jName ) from ScheduleRealInfo s where s.xlBm like %?1% and s.scheduleDateStr = ?2 and s.gsBm like %?3% and s.fgsBm like %?4% and s.clZbh like %?5% GROUP BY xlBm,clZbh,jGh,scheduleDate,lpName,jName ORDER BY clZbh,realExecDate,fcsj")
197 List<Map<String,Object>> yesterdayDataList(String line,String date,String gsbm,String fgsbm,String nbbm); 197 List<Map<String,Object>> yesterdayDataList(String line,String date,String gsbm,String fgsbm,String nbbm);
198 198
199 - @Query(value="select new map(s.scheduleDate as scheduleDate,s.xlBm as xlBm,s.clZbh as clZbh,s.jGh as jGh,s.lpName as lpName,min(s.fcsj) as fcsj,min(s.realExecDate) as realExecDate ) from ScheduleRealInfo s where s.xlBm =?1 and s.scheduleDateStr = ?2 and s.gsBm like %?3% and s.fgsBm like %?4% and s.clZbh like %?5% GROUP BY xlBm,clZbh,jGh,scheduleDate,lpName ORDER BY clZbh,realExecDate,fcsj") 199 + @Query(value="select new map(s.scheduleDate as scheduleDate,s.xlBm as xlBm,s.clZbh as clZbh,s.jGh as jGh,s.lpName as lpName,min(s.fcsj) as fcsj,min(s.realExecDate) as realExecDate,s.jName as jName ) from ScheduleRealInfo s where s.xlBm =?1 and s.scheduleDateStr = ?2 and s.gsBm like %?3% and s.fgsBm like %?4% and s.clZbh like %?5% GROUP BY xlBm,clZbh,jGh,scheduleDate,lpName,jName ORDER BY clZbh,realExecDate,fcsj")
200 List<Map<String,Object>> yesterdayDataList_eq(String line,String date,String gsbm,String fgsbm,String nbbm); 200 List<Map<String,Object>> yesterdayDataList_eq(String line,String date,String gsbm,String fgsbm,String nbbm);
201 201
202 @Query(value="select s from ScheduleRealInfo s where s.scheduleDateStr = ?1 ORDER BY xlBm,lpName,clZbh,xlDir") 202 @Query(value="select s from ScheduleRealInfo s where s.scheduleDateStr = ?1 ORDER BY xlBm,lpName,clZbh,xlDir")
src/main/java/com/bsth/service/BusIntervalService.java
@@ -19,4 +19,6 @@ public interface BusIntervalService { @@ -19,4 +19,6 @@ public interface BusIntervalService {
19 List<Map<String, Object>> lbStatuAnaly(Map<String, Object> map); 19 List<Map<String, Object>> lbStatuAnaly(Map<String, Object> map);
20 20
21 List<Map<String, Object>> correctStatis(Map<String, Object> map); 21 List<Map<String, Object>> correctStatis(Map<String, Object> map);
  22 +
  23 + Map<String, Object> exportWaybillMore(Map<String, Object> map);
22 } 24 }
src/main/java/com/bsth/service/SectionService.java
@@ -37,4 +37,6 @@ public interface SectionService extends BaseService&lt;Section, Integer&gt; { @@ -37,4 +37,6 @@ public interface SectionService extends BaseService&lt;Section, Integer&gt; {
37 Map<String, Object> sectionCacheUpdate(Map<String, Object> map); 37 Map<String, Object> sectionCacheUpdate(Map<String, Object> map);
38 38
39 Map<String, Object> sectionCutSaveLineLS(Map<String, Object> map); 39 Map<String, Object> sectionCutSaveLineLS(Map<String, Object> map);
  40 +
  41 + Map<String,Object> doubleName(Map<String, Object> map);
40 } 42 }
src/main/java/com/bsth/service/StationRouteService.java
@@ -72,9 +72,18 @@ public interface StationRouteService extends BaseService&lt;StationRoute, Integer&gt; @@ -72,9 +72,18 @@ public interface StationRouteService extends BaseService&lt;StationRoute, Integer&gt;
72 * @return List<Map<String, Object>> 72 * @return List<Map<String, Object>>
73 */ 73 */
74 List<Map<String, Object>> findUpStationRouteCode(Map<String, Object> map); 74 List<Map<String, Object>> findUpStationRouteCode(Map<String, Object> map);
75 - 75 +
76 List<Map<String, Object>> findCacheUpStationRouteCode(Map<String, Object> map); 76 List<Map<String, Object>> findCacheUpStationRouteCode(Map<String, Object> map);
77 - 77 +
  78 + /**
  79 + * @Description :TODO(查询下一个站点)
  80 + *
  81 + * @param map <站点路由id; direction:方向;stationRouteCode:站点编码>
  82 + *
  83 + * @return List<Map<String, Object>>
  84 + */
  85 + List<Map<String, Object>> findDownStationRoute(Map<String, Object> map);
  86 +
78 /** 87 /**
79 * @Description :TODO(查询线路某方向下所有站点的中心百度坐标) 88 * @Description :TODO(查询线路某方向下所有站点的中心百度坐标)
80 * 89 *
src/main/java/com/bsth/service/impl/BusIntervalServiceImpl.java
1 package com.bsth.service.impl; 1 package com.bsth.service.impl;
2 2
  3 +import java.io.File;
3 import java.math.BigDecimal; 4 import java.math.BigDecimal;
4 import java.math.RoundingMode; 5 import java.math.RoundingMode;
5 import java.sql.ResultSet; 6 import java.sql.ResultSet;
6 import java.sql.SQLException; 7 import java.sql.SQLException;
7 import java.text.DecimalFormat; 8 import java.text.DecimalFormat;
  9 +import java.text.ParseException;
8 import java.text.SimpleDateFormat; 10 import java.text.SimpleDateFormat;
9 import java.util.ArrayList; 11 import java.util.ArrayList;
  12 +import java.util.Calendar;
10 import java.util.Collections; 13 import java.util.Collections;
11 import java.util.Comparator; 14 import java.util.Comparator;
12 import java.util.Date; 15 import java.util.Date;
  16 +import java.util.GregorianCalendar;
13 import java.util.HashMap; 17 import java.util.HashMap;
14 import java.util.HashSet; 18 import java.util.HashSet;
15 import java.util.Iterator; 19 import java.util.Iterator;
@@ -23,27 +27,62 @@ import org.springframework.jdbc.core.JdbcTemplate; @@ -23,27 +27,62 @@ import org.springframework.jdbc.core.JdbcTemplate;
23 import org.springframework.jdbc.core.RowMapper; 27 import org.springframework.jdbc.core.RowMapper;
24 import org.springframework.stereotype.Service; 28 import org.springframework.stereotype.Service;
25 29
  30 +import com.alibaba.fastjson.JSON;
26 import com.alibaba.fastjson.JSONArray; 31 import com.alibaba.fastjson.JSONArray;
27 import com.bsth.data.BasicData; 32 import com.bsth.data.BasicData;
28 import com.bsth.data.schedule.edit_logs.service.dto.SchEditInfoDto; 33 import com.bsth.data.schedule.edit_logs.service.dto.SchEditInfoDto;
  34 +import com.bsth.entity.Cars;
  35 +import com.bsth.entity.Line;
  36 +import com.bsth.entity.oil.Dlb;
  37 +import com.bsth.entity.oil.Ylb;
29 import com.bsth.entity.realcontrol.ChildTaskPlan; 38 import com.bsth.entity.realcontrol.ChildTaskPlan;
30 import com.bsth.entity.realcontrol.ScheduleRealInfo; 39 import com.bsth.entity.realcontrol.ScheduleRealInfo;
  40 +import com.bsth.entity.sys.DutyEmployee;
  41 +import com.bsth.repository.CarsRepository;
  42 +import com.bsth.repository.LineRepository;
  43 +import com.bsth.repository.oil.DlbRepository;
  44 +import com.bsth.repository.oil.YlbRepository;
31 import com.bsth.repository.realcontrol.ScheduleRealInfoRepository; 45 import com.bsth.repository.realcontrol.ScheduleRealInfoRepository;
32 import com.bsth.service.BusIntervalService; 46 import com.bsth.service.BusIntervalService;
  47 +import com.bsth.service.report.CulateMileageService;
33 import com.bsth.service.schedule.PeopleCarPlanService; 48 import com.bsth.service.schedule.PeopleCarPlanService;
  49 +import com.bsth.service.sys.DutyEmployeeService;
  50 +import com.bsth.util.Arith;
  51 +import com.bsth.util.ComparableChild;
  52 +import com.bsth.util.ComparableReal;
  53 +import com.bsth.util.ReportRelatedUtils;
34 import com.bsth.util.ReportUtils; 54 import com.bsth.util.ReportUtils;
  55 +import com.bsth.util.TimeUtils;
35 import com.google.gson.Gson; 56 import com.google.gson.Gson;
36 57
37 58
38 @Service 59 @Service
39 public class BusIntervalServiceImpl implements BusIntervalService { 60 public class BusIntervalServiceImpl implements BusIntervalService {
40 61
  62 + @Autowired
  63 + CulateMileageService culateService;
  64 +
41 @Autowired 65 @Autowired
42 private PeopleCarPlanService peopleCarPlanService; 66 private PeopleCarPlanService peopleCarPlanService;
43 67
44 @Autowired 68 @Autowired
45 private ScheduleRealInfoRepository scheduleRealInfoRepository; 69 private ScheduleRealInfoRepository scheduleRealInfoRepository;
46 - 70 +
  71 + @Autowired
  72 + DutyEmployeeService dutyEmployeeService;
  73 +
  74 + @Autowired
  75 + LineRepository lineRepository;
  76 +
  77 + @Autowired
  78 + YlbRepository ylbRepository;
  79 +
  80 + @Autowired
  81 + DlbRepository dlbRepository;
  82 +
  83 + @Autowired
  84 + CarsRepository carsRepository;
  85 +
47 @Autowired 86 @Autowired
48 private JdbcTemplate jdbcTemplate; 87 private JdbcTemplate jdbcTemplate;
49 88
@@ -241,7 +280,55 @@ public class BusIntervalServiceImpl implements BusIntervalService { @@ -241,7 +280,55 @@ public class BusIntervalServiceImpl implements BusIntervalService {
241 280
242 return list; 281 return list;
243 } 282 }
244 - 283 +
  284 + public Map<Long, Set<ChildTaskPlan>> getChildTaskPlans(Long schedule1, Long schedule2){
  285 +
  286 + Map<Long, Set<ChildTaskPlan>> schMap = new HashMap<Long, Set<ChildTaskPlan>>();
  287 + List<ChildTaskPlan> list = new ArrayList<ChildTaskPlan>();
  288 +
  289 + String sql = "select id,cc_id,mileage_type,destroy,destroy_reason," +
  290 + " mileage,type1,type2,schedule from bsth_c_s_child_task" +
  291 + " where 1=1";
  292 + if(schedule1 != null && schedule1 > 0){
  293 + sql += " and schedule >= '"+schedule1+"'";
  294 + }
  295 + if(schedule2 != null && schedule2 > 0){
  296 + sql += " and schedule <= '"+schedule2+"'";
  297 + }
  298 +
  299 + list = jdbcTemplate.query(sql,
  300 + new RowMapper<ChildTaskPlan>(){
  301 + @Override
  302 + public ChildTaskPlan mapRow(ResultSet rs, int rowNum) throws SQLException {
  303 + ChildTaskPlan ct = new ChildTaskPlan();
  304 + ct.setId(rs.getLong("id"));
  305 + ct.setCcId(rs.getLong("cc_id"));
  306 + ct.setMileageType(rs.getString("mileage_type"));
  307 + ct.setDestroy(rs.getBoolean("destroy"));
  308 + ct.setDestroyReason(rs.getString("destroy_reason"));
  309 + ct.setMileage(rs.getFloat("mileage"));
  310 + ct.setType1(rs.getString("type1"));
  311 + ct.setType2(rs.getString("type2"));
  312 + ScheduleRealInfo schedule = new ScheduleRealInfo();
  313 + schedule.setId(rs.getLong("schedule"));
  314 + ct.setSchedule(schedule);
  315 + if(ct.getCcId() == 0l){
  316 + ct.setCcId(null);
  317 + }
  318 + return ct;
  319 + }
  320 + });
  321 +
  322 + for(ChildTaskPlan ct : list){
  323 + Long id = ct.getSchedule().getId();
  324 + if(!schMap.containsKey(id))
  325 + schMap.put(id, new HashSet<ChildTaskPlan>());
  326 + schMap.get(id).add(ct);
  327 + }
  328 +
  329 + return schMap;
  330 + }
  331 +
245 @Override 332 @Override
246 public List<Map<String, Object>> getDir(Map<String, Object> map) { 333 public List<Map<String, Object>> getDir(Map<String, Object> map) {
247 List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); 334 List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>();
@@ -1630,6 +1717,15 @@ public class BusIntervalServiceImpl implements BusIntervalService { @@ -1630,6 +1717,15 @@ public class BusIntervalServiceImpl implements BusIntervalService {
1630 } 1717 }
1631 1718
1632 list = getSchedule(company, subCompany, line, startDate, endDate, model, sfqr==1?times:"", true); 1719 list = getSchedule(company, subCompany, line, startDate, endDate, model, sfqr==1?times:"", true);
  1720 + long schedule1 = 0l, schedule2 = 0l;
  1721 + for(ScheduleRealInfo schedule : list){
  1722 + long id = schedule.getId();
  1723 + if(schedule1 == 0l || schedule1 > id)
  1724 + schedule1 = id;
  1725 + if(schedule2 == 0l || schedule1 < id)
  1726 + schedule2 = id;
  1727 + }
  1728 + Map<Long, Set<ChildTaskPlan>> cts = getChildTaskPlans(schedule1, schedule2);
1633 1729
1634 String[] date1 = startDate.split("-"); 1730 String[] date1 = startDate.split("-");
1635 String[] date2 = endDate.split("-"); 1731 String[] date2 = endDate.split("-");
@@ -1702,46 +1798,67 @@ public class BusIntervalServiceImpl implements BusIntervalService { @@ -1702,46 +1798,67 @@ public class BusIntervalServiceImpl implements BusIntervalService {
1702 jhlc = jhlc.add(lc); 1798 jhlc = jhlc.add(lc);
1703 } 1799 }
1704 if(schedule.getFcsjActual() != null && schedule.getZdsjActual() != null 1800 if(schedule.getFcsjActual() != null && schedule.getZdsjActual() != null
1705 - && schedule.getStatus() != -1 && !schedule.isCcService()){  
1706 - sjbc++;  
1707 - sjlc = sjlc.add(lc);  
1708 - } else if(schedule.getStatus() == -1 && !schedule.isCcService()){ 1801 + && schedule.getStatus() != -1){
  1802 + if(!schedule.isCcService())
  1803 + sjbc++;
  1804 +// sjlc = sjlc.add(lc);
  1805 + } else if(schedule.getStatus() == -1){
1709 if(schedule.getAdjustExps() != null && schedule.getAdjustExps().indexOf("路阻") != -1){ 1806 if(schedule.getAdjustExps() != null && schedule.getAdjustExps().indexOf("路阻") != -1){
1710 lzbc++; 1807 lzbc++;
1711 - lzlc = lzlc.add(lc); 1808 +// lzlc = lzlc.add(lc);
1712 }else if(schedule.getAdjustExps() != null && schedule.getAdjustExps().indexOf("吊慢") != -1){ 1809 }else if(schedule.getAdjustExps() != null && schedule.getAdjustExps().indexOf("吊慢") != -1){
1713 dmbc++; 1810 dmbc++;
1714 - dmlc = dmlc.add(lc); 1811 +// dmlc = dmlc.add(lc);
1715 }else if(schedule.getAdjustExps() != null && schedule.getAdjustExps().indexOf("故障") != -1){ 1812 }else if(schedule.getAdjustExps() != null && schedule.getAdjustExps().indexOf("故障") != -1){
1716 gzbc++; 1813 gzbc++;
1717 - gzlc = gzlc.add(lc); 1814 +// gzlc = gzlc.add(lc);
1718 }else if(schedule.getAdjustExps() != null && schedule.getAdjustExps().indexOf("纠纷") != -1){ 1815 }else if(schedule.getAdjustExps() != null && schedule.getAdjustExps().indexOf("纠纷") != -1){
1719 jfbc++; 1816 jfbc++;
1720 - jflc = jflc.add(lc); 1817 +// jflc = jflc.add(lc);
1721 }else if(schedule.getAdjustExps() != null && schedule.getAdjustExps().indexOf("肇事") != -1){ 1818 }else if(schedule.getAdjustExps() != null && schedule.getAdjustExps().indexOf("肇事") != -1){
1722 zsbc++; 1819 zsbc++;
1723 - zslc = zslc.add(lc); 1820 +// zslc = zslc.add(lc);
1724 }else if(schedule.getAdjustExps() != null && schedule.getAdjustExps().indexOf("缺人") != -1){ 1821 }else if(schedule.getAdjustExps() != null && schedule.getAdjustExps().indexOf("缺人") != -1){
1725 qrbc++; 1822 qrbc++;
1726 - qrlc = qrlc.add(lc); 1823 +// qrlc = qrlc.add(lc);
1727 }else if(schedule.getAdjustExps() != null && schedule.getAdjustExps().indexOf("缺车") != -1){ 1824 }else if(schedule.getAdjustExps() != null && schedule.getAdjustExps().indexOf("缺车") != -1){
1728 qcbc++; 1825 qcbc++;
1729 - qclc = qclc.add(lc); 1826 +// qclc = qclc.add(lc);
1730 }else if(schedule.getAdjustExps() != null && schedule.getAdjustExps().indexOf("客稀") != -1){ 1827 }else if(schedule.getAdjustExps() != null && schedule.getAdjustExps().indexOf("客稀") != -1){
1731 kxbc++; 1828 kxbc++;
1732 - kxlc = kxlc.add(lc); 1829 +// kxlc = kxlc.add(lc);
1733 }else if(schedule.getAdjustExps() != null && schedule.getAdjustExps().indexOf("气候") != -1){ 1830 }else if(schedule.getAdjustExps() != null && schedule.getAdjustExps().indexOf("气候") != -1){
1734 qhbc++; 1831 qhbc++;
1735 - qhlc = qhlc.add(lc); 1832 +// qhlc = qhlc.add(lc);
1736 }else if(schedule.getAdjustExps() != null && schedule.getAdjustExps().indexOf("外援") != -1){ 1833 }else if(schedule.getAdjustExps() != null && schedule.getAdjustExps().indexOf("外援") != -1){
1737 wybc++; 1834 wybc++;
1738 - wylc = wylc.add(lc); 1835 +// wylc = wylc.add(lc);
1739 } else { 1836 } else {
1740 qtbc++; 1837 qtbc++;
1741 - qtlc = qtlc.add(lc); 1838 +// qtlc = qtlc.add(lc);
1742 } 1839 }
1743 } 1840 }
  1841 + if(cts.containsKey(schedule.getId())){
  1842 + schedule.setcTasks(cts.get(schedule.getId()));
  1843 + }
1744 } 1844 }
  1845 +
  1846 + sjlc = new BigDecimal(culateService.culateSjgl(keyMap.get(key)) + culateService.culateLjgl(keyMap.get(key)));
  1847 + lzlc = new BigDecimal(culateService.culateCJLC(keyMap.get(key), "路阻"));
  1848 + dmlc = new BigDecimal(culateService.culateCJLC(keyMap.get(key), "吊慢"));
  1849 + gzlc = new BigDecimal(culateService.culateCJLC(keyMap.get(key), "故障"));
  1850 + jflc = new BigDecimal(culateService.culateCJLC(keyMap.get(key), "纠纷"));
  1851 + zslc = new BigDecimal(culateService.culateCJLC(keyMap.get(key), "肇事"));
  1852 + qrlc = new BigDecimal(culateService.culateCJLC(keyMap.get(key), "缺人"));
  1853 + qclc = new BigDecimal(culateService.culateCJLC(keyMap.get(key), "缺车"));
  1854 + kxlc = new BigDecimal(culateService.culateCJLC(keyMap.get(key), "客稀"));
  1855 + qhlc = new BigDecimal(culateService.culateCJLC(keyMap.get(key), "气候"));
  1856 + wylc = new BigDecimal(culateService.culateCJLC(keyMap.get(key), "援外"));
  1857 + qtlc = new BigDecimal(culateService.culateCJLC(keyMap.get(key), "配车")).add(
  1858 + new BigDecimal(culateService.culateCJLC(keyMap.get(key), "保养"))).add(
  1859 + new BigDecimal(culateService.culateCJLC(keyMap.get(key), "抽减"))).add(
  1860 + new BigDecimal(culateService.culateCJLC(keyMap.get(key), "其他")));
  1861 +
1745 boolean flag = true; 1862 boolean flag = true;
1746 if(jhlc.doubleValue() == 0d){ 1863 if(jhlc.doubleValue() == 0d){
1747 flag = false; 1864 flag = false;
@@ -1754,42 +1871,42 @@ public class BusIntervalServiceImpl implements BusIntervalService { @@ -1754,42 +1871,42 @@ public class BusIntervalServiceImpl implements BusIntervalService {
1754 tempMap.put("jhbc", jhbc); 1871 tempMap.put("jhbc", jhbc);
1755 tempMap.put("sjbc", sjbc); 1872 tempMap.put("sjbc", sjbc);
1756 tempMap.put("bcbfb", df.format(jhbc>0?(double)sjbc/jhbc*100:0)+"%"); 1873 tempMap.put("bcbfb", df.format(jhbc>0?(double)sjbc/jhbc*100:0)+"%");
1757 - tempMap.put("jhlc", jhlc.doubleValue());  
1758 - tempMap.put("sjlc", sjlc.doubleValue()); 1874 + tempMap.put("jhlc", df.format(jhlc.doubleValue()));
  1875 + tempMap.put("sjlc", df.format(sjlc.doubleValue()));
1759 // tempMap.put("lcbfb", df.format(flag?(double)sjlc/jhlc*100:0)+"%"); 1876 // tempMap.put("lcbfb", df.format(flag?(double)sjlc/jhlc*100:0)+"%");
1760 tempMap.put("lcbfb", df.format(flag?sjlc.divide(jhlc, 4, BigDecimal.ROUND_HALF_UP).doubleValue()*100:0)+"%"); 1877 tempMap.put("lcbfb", df.format(flag?sjlc.divide(jhlc, 4, BigDecimal.ROUND_HALF_UP).doubleValue()*100:0)+"%");
1761 tempMap.put("lzbc", lzbc); 1878 tempMap.put("lzbc", lzbc);
1762 - tempMap.put("lzlc", lzlc.doubleValue()); 1879 + tempMap.put("lzlc", df.format(lzlc.doubleValue()));
1763 tempMap.put("lzbfb", df.format(jhbc>0?(double)lzbc/jhbc*100:0)+"%"); 1880 tempMap.put("lzbfb", df.format(jhbc>0?(double)lzbc/jhbc*100:0)+"%");
1764 tempMap.put("dmbc", dmbc); 1881 tempMap.put("dmbc", dmbc);
1765 - tempMap.put("dmlc", dmlc.doubleValue()); 1882 + tempMap.put("dmlc", df.format(dmlc.doubleValue()));
1766 tempMap.put("dmbfb", df.format(jhbc>0?(double)dmbc/jhbc*100:0)+"%"); 1883 tempMap.put("dmbfb", df.format(jhbc>0?(double)dmbc/jhbc*100:0)+"%");
1767 tempMap.put("gzbc", gzbc); 1884 tempMap.put("gzbc", gzbc);
1768 - tempMap.put("gzlc", gzlc.doubleValue()); 1885 + tempMap.put("gzlc", df.format(gzlc.doubleValue()));
1769 tempMap.put("gzbfb", df.format(jhbc>0?(double)gzbc/jhbc*100:0)+"%"); 1886 tempMap.put("gzbfb", df.format(jhbc>0?(double)gzbc/jhbc*100:0)+"%");
1770 tempMap.put("jfbc", jfbc); 1887 tempMap.put("jfbc", jfbc);
1771 - tempMap.put("jflc", jflc.doubleValue()); 1888 + tempMap.put("jflc", df.format(jflc.doubleValue()));
1772 tempMap.put("jfbfb", df.format(jhbc>0?(double)jfbc/jhbc*100:0)+"%"); 1889 tempMap.put("jfbfb", df.format(jhbc>0?(double)jfbc/jhbc*100:0)+"%");
1773 tempMap.put("zsbc", zsbc); 1890 tempMap.put("zsbc", zsbc);
1774 - tempMap.put("zslc", zslc.doubleValue()); 1891 + tempMap.put("zslc", df.format(zslc.doubleValue()));
1775 tempMap.put("zsbfb", df.format(jhbc>0?(double)zsbc/jhbc*100:0)+"%"); 1892 tempMap.put("zsbfb", df.format(jhbc>0?(double)zsbc/jhbc*100:0)+"%");
1776 tempMap.put("qrbc", qrbc); 1893 tempMap.put("qrbc", qrbc);
1777 - tempMap.put("qrlc", qrlc.doubleValue()); 1894 + tempMap.put("qrlc", df.format(qrlc.doubleValue()));
1778 tempMap.put("qrbfb", df.format(jhbc>0?(double)qrbc/jhbc*100:0)+"%"); 1895 tempMap.put("qrbfb", df.format(jhbc>0?(double)qrbc/jhbc*100:0)+"%");
1779 tempMap.put("qcbc", qcbc); 1896 tempMap.put("qcbc", qcbc);
1780 - tempMap.put("qclc", qclc.doubleValue()); 1897 + tempMap.put("qclc", df.format(qclc.doubleValue()));
1781 tempMap.put("qcbfb", df.format(jhbc>0?(double)qcbc/jhbc*100:0)+"%"); 1898 tempMap.put("qcbfb", df.format(jhbc>0?(double)qcbc/jhbc*100:0)+"%");
1782 tempMap.put("kxbc", kxbc); 1899 tempMap.put("kxbc", kxbc);
1783 - tempMap.put("kxlc", kxlc.doubleValue()); 1900 + tempMap.put("kxlc", df.format(kxlc.doubleValue()));
1784 tempMap.put("kxbfb", df.format(jhbc>0?(double)kxbc/jhbc*100:0)+"%"); 1901 tempMap.put("kxbfb", df.format(jhbc>0?(double)kxbc/jhbc*100:0)+"%");
1785 tempMap.put("qhbc", qhbc); 1902 tempMap.put("qhbc", qhbc);
1786 - tempMap.put("qhlc", qhlc.doubleValue()); 1903 + tempMap.put("qhlc", df.format(qhlc.doubleValue()));
1787 tempMap.put("qhbfb", df.format(jhbc>0?(double)qhbc/jhbc*100:0)+"%"); 1904 tempMap.put("qhbfb", df.format(jhbc>0?(double)qhbc/jhbc*100:0)+"%");
1788 tempMap.put("wybc", wybc); 1905 tempMap.put("wybc", wybc);
1789 - tempMap.put("wylc", wylc.doubleValue()); 1906 + tempMap.put("wylc", df.format(wylc.doubleValue()));
1790 tempMap.put("wybfb", df.format(jhbc>0?(double)wybc/jhbc*100:0)+"%"); 1907 tempMap.put("wybfb", df.format(jhbc>0?(double)wybc/jhbc*100:0)+"%");
1791 tempMap.put("qtbc", qtbc); 1908 tempMap.put("qtbc", qtbc);
1792 - tempMap.put("qtlc", qtlc.doubleValue()); 1909 + tempMap.put("qtlc", df.format(qtlc.doubleValue()));
1793 tempMap.put("qtbfb", df.format(jhbc>0?(double)qtbc/jhbc*100:0)+"%"); 1910 tempMap.put("qtbfb", df.format(jhbc>0?(double)qtbc/jhbc*100:0)+"%");
1794 1911
1795 resList.add(tempMap); 1912 resList.add(tempMap);
@@ -1822,41 +1939,41 @@ public class BusIntervalServiceImpl implements BusIntervalService { @@ -1822,41 +1939,41 @@ public class BusIntervalServiceImpl implements BusIntervalService {
1822 temp.put("jhbc", jhbc_); 1939 temp.put("jhbc", jhbc_);
1823 temp.put("sjbc", sjbc_); 1940 temp.put("sjbc", sjbc_);
1824 temp.put("bcbfb", df.format(jhbc_>0?(double)sjbc_/jhbc_*100:0)+"%"); 1941 temp.put("bcbfb", df.format(jhbc_>0?(double)sjbc_/jhbc_*100:0)+"%");
1825 - temp.put("jhlc", jhlc_.doubleValue());  
1826 - temp.put("sjlc", sjlc_.doubleValue()); 1942 + temp.put("jhlc", df.format(jhlc_.doubleValue()));
  1943 + temp.put("sjlc", df.format(sjlc_.doubleValue()));
1827 temp.put("lcbfb", df.format(flag?sjlc_.divide(jhlc_, 4, BigDecimal.ROUND_HALF_UP).doubleValue()*100:0)+"%"); 1944 temp.put("lcbfb", df.format(flag?sjlc_.divide(jhlc_, 4, BigDecimal.ROUND_HALF_UP).doubleValue()*100:0)+"%");
1828 temp.put("lzbc", lzbc_); 1945 temp.put("lzbc", lzbc_);
1829 - temp.put("lzlc", lzlc_.doubleValue()); 1946 + temp.put("lzlc", df.format(lzlc_.doubleValue()));
1830 temp.put("lzbfb", df.format(jhbc_>0?(double)lzbc_/jhbc_*100:0)+"%"); 1947 temp.put("lzbfb", df.format(jhbc_>0?(double)lzbc_/jhbc_*100:0)+"%");
1831 temp.put("dmbc", dmbc_); 1948 temp.put("dmbc", dmbc_);
1832 - temp.put("dmlc", dmlc_.doubleValue()); 1949 + temp.put("dmlc", df.format(dmlc_.doubleValue()));
1833 temp.put("dmbfb", df.format(jhbc_>0?(double)dmbc_/jhbc_*100:0)+"%"); 1950 temp.put("dmbfb", df.format(jhbc_>0?(double)dmbc_/jhbc_*100:0)+"%");
1834 temp.put("gzbc", gzbc_); 1951 temp.put("gzbc", gzbc_);
1835 - temp.put("gzlc", gzlc_.doubleValue()); 1952 + temp.put("gzlc", df.format(gzlc_.doubleValue()));
1836 temp.put("gzbfb", df.format(jhbc_>0?(double)gzbc_/jhbc_*100:0)+"%"); 1953 temp.put("gzbfb", df.format(jhbc_>0?(double)gzbc_/jhbc_*100:0)+"%");
1837 temp.put("jfbc", jfbc_); 1954 temp.put("jfbc", jfbc_);
1838 - temp.put("jflc", jflc_.doubleValue()); 1955 + temp.put("jflc", df.format(jflc_.doubleValue()));
1839 temp.put("jfbfb", df.format(jhbc_>0?(double)jfbc_/jhbc_*100:0)+"%"); 1956 temp.put("jfbfb", df.format(jhbc_>0?(double)jfbc_/jhbc_*100:0)+"%");
1840 temp.put("zsbc", zsbc_); 1957 temp.put("zsbc", zsbc_);
1841 - temp.put("zslc", zslc_.doubleValue()); 1958 + temp.put("zslc", df.format(zslc_.doubleValue()));
1842 temp.put("zsbfb", df.format(jhbc_>0?(double)zsbc_/jhbc_*100:0)+"%"); 1959 temp.put("zsbfb", df.format(jhbc_>0?(double)zsbc_/jhbc_*100:0)+"%");
1843 temp.put("qrbc", qrbc_); 1960 temp.put("qrbc", qrbc_);
1844 - temp.put("qrlc", qrlc_.doubleValue()); 1961 + temp.put("qrlc", df.format(qrlc_.doubleValue()));
1845 temp.put("qrbfb", df.format(jhbc_>0?(double)qrbc_/jhbc_*100:0)+"%"); 1962 temp.put("qrbfb", df.format(jhbc_>0?(double)qrbc_/jhbc_*100:0)+"%");
1846 temp.put("qcbc", qcbc_); 1963 temp.put("qcbc", qcbc_);
1847 - temp.put("qclc", qclc_.doubleValue()); 1964 + temp.put("qclc", df.format(qclc_.doubleValue()));
1848 temp.put("qcbfb", df.format(jhbc_>0?(double)qcbc_/jhbc_*100:0)+"%"); 1965 temp.put("qcbfb", df.format(jhbc_>0?(double)qcbc_/jhbc_*100:0)+"%");
1849 temp.put("kxbc", kxbc_); 1966 temp.put("kxbc", kxbc_);
1850 - temp.put("kxlc", kxlc_.doubleValue()); 1967 + temp.put("kxlc", df.format(kxlc_.doubleValue()));
1851 temp.put("kxbfb", df.format(jhbc_>0?(double)kxbc_/jhbc_*100:0)+"%"); 1968 temp.put("kxbfb", df.format(jhbc_>0?(double)kxbc_/jhbc_*100:0)+"%");
1852 temp.put("qhbc", qhbc_); 1969 temp.put("qhbc", qhbc_);
1853 - temp.put("qhlc", qhlc_.doubleValue()); 1970 + temp.put("qhlc", df.format(qhlc_.doubleValue()));
1854 temp.put("qhbfb", df.format(jhbc_>0?(double)qhbc_/jhbc_*100:0)+"%"); 1971 temp.put("qhbfb", df.format(jhbc_>0?(double)qhbc_/jhbc_*100:0)+"%");
1855 temp.put("wybc", wybc_); 1972 temp.put("wybc", wybc_);
1856 - temp.put("wylc", wylc_.doubleValue()); 1973 + temp.put("wylc", df.format(wylc_.doubleValue()));
1857 temp.put("wybfb", df.format(jhbc_>0?(double)wybc_/jhbc_*100:0)+"%"); 1974 temp.put("wybfb", df.format(jhbc_>0?(double)wybc_/jhbc_*100:0)+"%");
1858 temp.put("qtbc", qtbc_); 1975 temp.put("qtbc", qtbc_);
1859 - temp.put("qtlc", qtlc_.doubleValue()); 1976 + temp.put("qtlc", df.format(qtlc_.doubleValue()));
1860 temp.put("qtbfb", df.format(jhbc_>0?(double)qtbc_/jhbc_*100:0)+"%"); 1977 temp.put("qtbfb", df.format(jhbc_>0?(double)qtbc_/jhbc_*100:0)+"%");
1861 1978
1862 resList.add(temp); 1979 resList.add(temp);
@@ -2257,10 +2374,422 @@ public class BusIntervalServiceImpl implements BusIntervalService { @@ -2257,10 +2374,422 @@ public class BusIntervalServiceImpl implements BusIntervalService {
2257 resMap.put("xlname",BasicData.lineCode2NameMap.get(xlbm)); 2374 resMap.put("xlname",BasicData.lineCode2NameMap.get(xlbm));
2258 } 2375 }
2259 } 2376 }
2260 - 2377 +
2261 return resList; 2378 return resList;
2262 } 2379 }
2263 2380
2264 -  
2265 - 2381 + @Override
  2382 + public Map<String, Object> exportWaybillMore(Map<String, Object> map) {
  2383 + String date = map.get("date").toString();
  2384 + String line = map.get("line").toString();
  2385 + ReportUtils ee = new ReportUtils();
  2386 + List<List> strs = JSON.parseArray(map.get("strs").toString(), List.class);
  2387 + String path = this.getClass().getResource("/").getPath() + "static/pages/forms/export/";
  2388 + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"),
  2389 + sdfSimple = new SimpleDateFormat("yyyyMMdd");
  2390 + int num = 0;
  2391 + File file = null;
  2392 + try {
  2393 + while (true) {
  2394 + String fileUrl = path + "行车路单" + sdfSimple.format(sdfMonth.parse(date));
  2395 +// file = new File(fileUrl + (num == 0 ? "/" : "(" + num + ")/")); //新建文件夹
  2396 + file = new File(fileUrl + (num == 0 ? ".xls" : "(" + num + ").xls")); //新建excel文件
  2397 + if (file.exists()) { //判断是否已存在重名
  2398 + num++;
  2399 + } else {
  2400 + break;
  2401 + }
  2402 + }
  2403 +// file.mkdirs(); //创建
  2404 +
  2405 + Map<String, List<Ylb>> ylbMap = new HashMap<String, List<Ylb>>();
  2406 + Map<String, List<Dlb>> dlbMap = new HashMap<String, List<Dlb>>();
  2407 + Map<String, List<Cars>> carMap = new HashMap<String, List<Cars>>();
  2408 + List<ScheduleRealInfo> lists_line=scheduleRealInfoRepository.scheduleByDateAndLineTjrb(line, date);
  2409 + List<DutyEmployee> list2 = dutyEmployeeService.getDutyEmployee(line, date + "00:01", date + "23:59");
  2410 + List<Ylb> queryYlbByRqXlbm = ylbRepository.queryYlbByRqXlbm(date, line);
  2411 + List<Dlb> queryDlbByRqXlbm = dlbRepository.queryDlbByRqXlbm(date, line);
  2412 + List<Cars> findCars = carsRepository.findCars();
  2413 + String minfcsj="02:00";
  2414 + List<Line> lineList=lineRepository.findLineByCode(line);
  2415 + if(lineList.size()>0){
  2416 + String sqlMinYysj="select start_opt from bsth_c_line_config where "
  2417 + + " id = ("
  2418 + + "select max(id) from bsth_c_line_config where line ='"+lineList.get(0).getId() +"'"
  2419 + + ")";
  2420 + minfcsj=jdbcTemplate.queryForObject(sqlMinYysj, String.class);
  2421 + }
  2422 +
  2423 + for(Ylb ylb : queryYlbByRqXlbm){
  2424 + String key = sdfMonth.format(ylb.getRq()) + ylb.getXlbm();
  2425 + if(!ylbMap.containsKey(key))
  2426 + ylbMap.put(key, new ArrayList<Ylb>());
  2427 + ylbMap.get(key).add(ylb);
  2428 + }
  2429 + for(Dlb dlb : queryDlbByRqXlbm){
  2430 + String key = sdfMonth.format(dlb.getRq()) + dlb.getXlbm();
  2431 + if(!dlbMap.containsKey(key))
  2432 + dlbMap.put(key, new ArrayList<Dlb>());
  2433 + dlbMap.get(key).add(dlb);
  2434 + }
  2435 + for(Cars car : findCars){
  2436 + String key = car.getInsideCode();
  2437 + if(!carMap.containsKey(key))
  2438 + carMap.put(key, new ArrayList<Cars>());
  2439 + carMap.get(key).add(car);
  2440 + }
  2441 +
  2442 + List<File> files = new ArrayList<File>();
  2443 + for (List<String> list : strs){
  2444 + List<ScheduleRealInfo> newList=new ArrayList<ScheduleRealInfo>();
  2445 + String jName = list.get(0);
  2446 + String clZbh = list.get(1);
  2447 + String lpName = list.get(2);
  2448 + String jGh =list.get(3);
  2449 + for (int i = 0; i < lists_line.size(); i++) {
  2450 + ScheduleRealInfo s=lists_line.get(i);
  2451 + if(s.getjGh().equals(jGh) && s.getClZbh().equals(clZbh) && s.getLpName().equals(lpName)){
  2452 + newList.add(s);
  2453 + }
  2454 + }
  2455 + //——————————————————————————————————————————————————————
  2456 +
  2457 + ReportRelatedUtils rru = new ReportRelatedUtils();
  2458 + List<Iterator<?>> list1 = new ArrayList<Iterator<?>>();
  2459 + List<ScheduleRealInfo> scheduleRealInfos = newList;
  2460 + List<Map<String, Object>> listMap = new ArrayList<Map<String, Object>>();
  2461 +// List<ScheduleRealInfo> scheduleRealInfos=scheduleRealInfoRepository.queryListWaybillXcld(jName, clZbh, lpName, date, line);
  2462 + List<ScheduleRealInfo> lists=new ArrayList<ScheduleRealInfo>();
  2463 + for (int i = 0; i < scheduleRealInfos.size(); i++) {
  2464 + ScheduleRealInfo s=scheduleRealInfos.get(i);
  2465 + Set<ChildTaskPlan> cts = s.getcTasks();
  2466 + if(cts != null && cts.size() > 0){
  2467 + lists.add(s);
  2468 + }else{
  2469 + if(s.getZdsjActual()!=null && s.getFcsjActual()!=null){
  2470 + lists.add(s);
  2471 + }
  2472 + }
  2473 + }
  2474 + DecimalFormat format = new DecimalFormat("0.00");
  2475 + //计算里程和班次数,并放入Map里
  2476 +// Map<String, Object> map = this.MapById(scheduleRealInfos.get(0).getId());
  2477 +
  2478 + //-----------------------------------------------------
  2479 + Map<String, Object> Map = new HashMap<String, Object>();
  2480 + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
  2481 +// ScheduleRealInfo s = scheduleRealInfoRepository.scheduleById(scheduleRealInfos.get(0).getId());
  2482 + ScheduleRealInfo s = scheduleRealInfos.get(0);
  2483 + String xlbm = s.getXlBm();
  2484 + String fcrq = s.getScheduleDateStr();
  2485 +
  2486 + int type = 0;
  2487 + Double ccyl = 0.0;
  2488 + Double jcyl = 0.0;
  2489 + Double yh = 0.0;
  2490 + Double jzl = 0.0;
  2491 + Double zlc = 0.0;
  2492 +// List<Ylb> listYlb = ylbRepository.queryListYlb(fcrq, s.getClZbh(), s.getjGh(),xlbm);
  2493 +// List<Dlb> listDlb = dlbRepository.queryListDlb(fcrq, s.getClZbh(), s.getjGh(),xlbm);
  2494 + List<Ylb> listYlb = ylbMap.get(fcrq + xlbm);
  2495 + List<Dlb> listDlb = dlbMap.get(fcrq + xlbm);
  2496 +
  2497 +// List<Cars> listCars = carsRepository.findCarsByCode(s.getClZbh());
  2498 + List<Cars> listCars = carMap.get(s.getClZbh());
  2499 + if (listCars != null && listCars.size() > 0) {
  2500 + if(listCars.get(0).getSfdc()!=null){
  2501 + if (listCars.get(0).getSfdc()) {
  2502 + type = 1;
  2503 + if(listDlb != null)
  2504 + for (int i = 0; i < listDlb.size(); i++) {
  2505 + Dlb d = listDlb.get(i);
  2506 + if (d.getLp() == null) {
  2507 + ccyl = Arith.add(ccyl, d.getCzcd());
  2508 + jcyl = Arith.add(jcyl, d.getJzcd());
  2509 + yh = Arith.add(yh, d.getHd());
  2510 + jzl = Arith.add(jzl, d.getCdl());
  2511 + zlc = Arith.add(zlc, d.getZlc());
  2512 + } else {
  2513 + if (d.getLp().equals(s.getLpName())) {
  2514 + ccyl = Arith.add(ccyl, d.getCzcd());
  2515 + jcyl = Arith.add(jcyl, d.getJzcd());
  2516 + yh = Arith.add(yh, d.getHd());
  2517 + jzl = Arith.add(jzl, d.getCdl());
  2518 + zlc = Arith.add(zlc, d.getZlc());
  2519 + }
  2520 + }
  2521 +
  2522 + }
  2523 + } else {
  2524 + type = 0;
  2525 + if(listYlb != null)
  2526 + for (int i = 0; i < listYlb.size(); i++) {
  2527 + Ylb y = listYlb.get(i);
  2528 + if (y.getLp() == null) {
  2529 + ccyl = Arith.add(ccyl, y.getCzyl());
  2530 + jcyl = Arith.add(jcyl, y.getJzyl());
  2531 + yh = Arith.add(yh, y.getYh());
  2532 + jzl = Arith.add(jzl, y.getJzl());
  2533 + zlc = Arith.add(zlc, y.getZlc());
  2534 + } else {
  2535 + if (y.getLp().equals(s.getLpName())) {
  2536 + ccyl = Arith.add(ccyl, y.getCzyl());
  2537 + jcyl = Arith.add(jcyl, y.getJzyl());
  2538 + yh = Arith.add(yh, y.getYh());
  2539 + jzl = Arith.add(jzl, y.getJzl());
  2540 + zlc = Arith.add(zlc, y.getZlc());
  2541 + }
  2542 + }
  2543 + }
  2544 + }
  2545 + }
  2546 + }
  2547 +
  2548 + Map.put("jzl", jzl);
  2549 + Map.put("yh", yh);
  2550 + Map.put("ccyl", ccyl);
  2551 + Map.put("jcyl", jcyl);
  2552 + Map.put("type", type);
  2553 + Map.put("zlc", zlc);
  2554 + Map.put("xlName", s.getXlName());
  2555 + Map.put("clZbh", s.getClZbh());
  2556 + Map.put("plate", BasicData.nbbmCompanyPlateMap.get(s.getClZbh()));
  2557 + Map.put("fcsjActual", s.getFcsjActual());
  2558 + Map.put("zdzName", s.getZdzName());
  2559 + Map.put("scheduleDate", s.getScheduleDateStr());
  2560 + Map.put("lpName", s.getLpName());
  2561 + String zdp = "", zwdp = "", wdp = "";
  2562 + String zdpT = "", zwdpT = "", wdpT = "";
  2563 + String dbdp="";
  2564 +// List<DutyEmployee> list2 = dutyEmployeeService.getDutyEmployee(xlbm, fcrq + "00:01", fcrq + "23:59");
  2565 + try {
  2566 + Long fcsj1 = sdf.parse(fcrq + " 00:01").getTime();
  2567 + Long fcsj2 = sdf.parse(fcrq + " 11:00").getTime();
  2568 + Long fcsj3 = sdf.parse(fcrq + " 23:59").getTime();
  2569 + for (int i = 0; i < list2.size(); i++) {
  2570 + DutyEmployee t = list2.get(i);
  2571 + if(dbdp.indexOf(t.getuName()) == -1){
  2572 + if(!(dbdp.length()>0)){
  2573 + dbdp =t.getuName();
  2574 + }else{
  2575 + dbdp +=","+t.getuName();
  2576 + }
  2577 + }
  2578 + Long ts = t.getTs();
  2579 + if (ts > fcsj1 && ts < fcsj2) {
  2580 + if (zdp.indexOf(t.getuName()) == -1) {
  2581 + if (!(zdp.length() > 0)) {
  2582 + zdpT = t.getuName() + "...";
  2583 + }
  2584 + zdp += t.getuName() + ",";
  2585 +
  2586 + }
  2587 + } else if (ts > fcsj2 && ts < fcsj3) {
  2588 + if (zwdp.indexOf(t.getuName()) == -1) {
  2589 + if (!(zwdp.length() > 0)) {
  2590 + zwdpT = t.getuName() + "...";
  2591 + }
  2592 + zwdp += t.getuName() + ",";
  2593 + }
  2594 + } else {
  2595 + if (wdp.indexOf(t.getuName()) == -1) {
  2596 + if (!(wdp.length() > 0)) {
  2597 + wdpT = t.getuName() + "...";
  2598 + }
  2599 + wdp += t.getuName() + ",";
  2600 + }
  2601 + }
  2602 + }
  2603 + } catch (ParseException e) {
  2604 + // TODO Auto-generated catch block
  2605 + e.printStackTrace();
  2606 + }
  2607 + Map.put("zdp", zdp);
  2608 + Map.put("zwdp", zwdp);
  2609 + Map.put("wdp", wdp);
  2610 + Map.put("zdpT", zdpT);
  2611 + Map.put("zwdpT", zwdpT);
  2612 + Map.put("wdpT", wdpT);
  2613 + Map.put("dbdp", dbdp);
  2614 + //-----------------------------------------------------
  2615 +
  2616 + Map.put("jhlc",Arith.add(culateService.culateJhgl(scheduleRealInfos),culateService.culateJhJccgl(scheduleRealInfos)));
  2617 + Map.put("remMileage",culateService.culateLbgl(scheduleRealInfos));
  2618 + Map.put("addMileage", culateService.culateLjgl(lists));
  2619 + double yygl=Arith.add(culateService.culateSjgl(lists),culateService.culateLjgl(lists));
  2620 + Map.put("yygl", yygl);
  2621 + double ksgl=Arith.add(culateService.culateKsgl(scheduleRealInfos),culateService.culateJccgl(lists));
  2622 + Map.put("ksgl",ksgl);
  2623 + Map.put("realMileage", Arith.add(yygl ,ksgl));
  2624 + Map.put("jhbc", culateService.culateJhbc(scheduleRealInfos,""));
  2625 + Map.put("cjbc", culateService.culateLbbc(scheduleRealInfos));
  2626 + Map.put("ljbc", culateService.culateLjbc(lists, ""));
  2627 + int sjbc =culateService.culateLjbc(lists, "")+culateService.culateSjbc(lists, "");
  2628 + Map.put("sjbc", sjbc);
  2629 +// map=new HashMap<String,Object>();
  2630 +
  2631 + SimpleDateFormat sdf2=new SimpleDateFormat("yyyy-MM-dd HH:mm");
  2632 +// String minfcsj="02:00";
  2633 +// List<Line> lineList=lineRepository.findLineByCode(newList.get(0).getXlBm());
  2634 +// if(lineList.size()>0){
  2635 +// String sqlMinYysj="select start_opt from bsth_c_line_config where "
  2636 +// + " id = ("
  2637 +// + "select max(id) from bsth_c_line_config where line ='"+lineList.get(0).getId() +"'"
  2638 +// + ")";
  2639 +// minfcsj=jdbcTemplate.queryForObject(sqlMinYysj, String.class);
  2640 +// }
  2641 + String[] minSjs = minfcsj.split(":");
  2642 + Long minSj=Long.parseLong(minSjs[0])*60+Long.parseLong(minSjs[1]);
  2643 +
  2644 +
  2645 + for (int i = 0; i < scheduleRealInfos.size(); i++) {
  2646 + ScheduleRealInfo ss=scheduleRealInfos.get(i);
  2647 + String[] fcsj= ss.getFcsj().split(":");
  2648 + Long fcsjL=Long.parseLong(fcsj[0])*60+Long.parseLong(fcsj[1]);
  2649 +
  2650 + Long fscjT=0L;
  2651 + if(fcsjL<minSj){
  2652 + Calendar calendar = new GregorianCalendar();
  2653 + calendar.setTime(ss.getScheduleDate());
  2654 + calendar.add(calendar.DATE,1);
  2655 + ss.setScheduleDate(calendar.getTime());
  2656 + try {
  2657 + fscjT = sdf2.parse(sdf2.format(ss.getScheduleDate())+" "+ss.getFcsj()).getTime();
  2658 + } catch (ParseException e) {
  2659 + // TODO Auto-generated catch block
  2660 + e.printStackTrace();
  2661 + }
  2662 +
  2663 + }else{
  2664 + try {
  2665 + fscjT =sdf2.parse(ss.getScheduleDateStr()+" "+ss.getFcsj()).getTime();
  2666 + } catch (ParseException e) {
  2667 + // TODO Auto-generated catch block
  2668 + e.printStackTrace();
  2669 + };
  2670 + }
  2671 + ss.setFcsjT(fscjT);
  2672 + }
  2673 + List<ScheduleRealInfo> listSchedule = new ArrayList<ScheduleRealInfo>();
  2674 + Collections.sort(scheduleRealInfos, new ComparableReal());
  2675 + for (int i = 0; i < scheduleRealInfos.size(); i++) {
  2676 + ScheduleRealInfo ss = scheduleRealInfos.get(i);
  2677 + ss.setAdjustExps(i + 1 + "");
  2678 + String remarks = "";
  2679 + if (ss.getRemarks() != null) {
  2680 + remarks += ss.getRemarks();
  2681 + }
  2682 +
  2683 + Set<ChildTaskPlan> childTaskPlans = ss.getcTasks();
  2684 + if (!childTaskPlans.isEmpty()) {
  2685 + ss.setFcsjActual("");
  2686 + ss.setZdsjActual("");
  2687 + ss.setJhlc(0.0);
  2688 + }
  2689 +
  2690 + if (ss.isDestroy()) {
  2691 + ss.setFcsjActual("");
  2692 + ss.setZdsjActual("");
  2693 + ss.setJhlc(0.0);
  2694 + remarks += "(烂班)";
  2695 + ss.setRemarks(remarks);
  2696 + }
  2697 +
  2698 + listSchedule.add(ss);
  2699 + //计算营运里程,空驶里程
  2700 + if (!childTaskPlans.isEmpty()) {
  2701 +// Iterator<ChildTaskPlan> it = childTaskPlans.iterator();
  2702 + List<ChildTaskPlan> listit=new ArrayList<ChildTaskPlan>(childTaskPlans);
  2703 + Collections.sort(listit, new ComparableChild());
  2704 + for (int j = 0; j < listit.size(); j++) {
  2705 + ScheduleRealInfo t = new ScheduleRealInfo();
  2706 + ChildTaskPlan childTaskPlan = listit.get(j);
  2707 + if (childTaskPlan.isDestroy()) {
  2708 + t.setFcsjActual("");
  2709 + t.setZdsjActual("");
  2710 + t.setJhlc(0.0);
  2711 + } else {
  2712 + t.setFcsjActual(childTaskPlan.getStartDate());
  2713 + t.setZdsjActual(childTaskPlan.getEndDate());
  2714 + t.setJhlc(Double.parseDouble(String.valueOf(childTaskPlan.getMileage())));
  2715 + }
  2716 + t.setQdzName(childTaskPlan.getStartStationName());
  2717 + t.setZdzName(childTaskPlan.getEndStationName());
  2718 + t.setRemarks(childTaskPlan.getRemarks());
  2719 + t.setAdjustExps("子");
  2720 + t.setjGh("");
  2721 + t.setjName("");
  2722 + t.setsGh("");
  2723 + t.setsName("");
  2724 + listSchedule.add(t);
  2725 + }
  2726 + }
  2727 + }
  2728 + Map<String, Object> maps;
  2729 + for (ScheduleRealInfo scheduleRealInfo : listSchedule) {
  2730 + maps = new HashMap<String, Object>();
  2731 + try {
  2732 + scheduleRealInfo.setjName(scheduleRealInfo.getjGh() + scheduleRealInfo.getjName());
  2733 + scheduleRealInfo.setsName(scheduleRealInfo.getsGh() + scheduleRealInfo.getsName());
  2734 + maps = rru.getMapValue(scheduleRealInfo);
  2735 + maps.put("bcs", scheduleRealInfo.getAdjustExps());
  2736 + String zdsj = scheduleRealInfo.getZdsj();
  2737 + String zdsjActual = scheduleRealInfo.getZdsjActual();
  2738 + if (zdsj != null && zdsjActual != null &&
  2739 + !zdsj.equals(zdsjActual) &&
  2740 + !zdsj.equals("")&&
  2741 + !zdsjActual.equals("")) {
  2742 + if (zdsj.compareTo(zdsjActual) > 0) {
  2743 + maps.put("fast", TimeUtils.getTimeDifference(zdsj, zdsjActual));
  2744 + maps.put("slow", "");
  2745 + } else {
  2746 + maps.put("fast", "");
  2747 + maps.put("slow", TimeUtils.getTimeDifference(zdsj, zdsjActual));
  2748 + }
  2749 + } else {
  2750 + maps.put("fast", "");
  2751 + maps.put("slow", "");
  2752 + }
  2753 + listMap.add(maps);
  2754 + } catch (Exception e) {
  2755 + e.printStackTrace();
  2756 + }
  2757 + }
  2758 +
  2759 + String path1 = this.getClass().getResource("/").getPath() + "static/pages/forms/";
  2760 + list1.add(listMap.iterator());
  2761 + String xls="";
  2762 + if(Map.get("type").toString().equals("0")){
  2763 + xls="waybill_minhang.xls";
  2764 + }else{
  2765 + xls="waybill_minhang_dl.xls";
  2766 + }
  2767 + Map.put("sheetName", jName + "-" + clZbh + "-" + lpName);
  2768 + ee.excelReplace(list1, new Object[]{Map}, path1 + "mould/"+xls,
  2769 + path1 + "export/" + date + "-" + jName + "-" + clZbh + "-" + lpName + "-行车路单.xls");
  2770 +
  2771 +
  2772 + //————————————————————————————————————————————————
  2773 +
  2774 + File temp = new File(path + date + "-" + jName + "-" + clZbh + "-" + lpName + "-行车路单.xls");
  2775 + String fileName = file.getName();
  2776 + files.add(temp);
  2777 + }
  2778 + for(int i = 1; i < files.size(); i++){
  2779 + File file1 = files.get(0);
  2780 + File file2 = files.get(i);
  2781 + ee.copySheetByFile(file2, file1, 0, 145);
  2782 + }
  2783 + File newFile = files.get(0);
  2784 + newFile.renameTo(file);
  2785 +
  2786 + } catch (Exception e) {
  2787 + // TODO: handle exception
  2788 + e.printStackTrace();
  2789 + }
  2790 +
  2791 + map.put("fileName", file.getName());
  2792 + return map;
  2793 + }
  2794 +
2266 } 2795 }
src/main/java/com/bsth/service/impl/SectionServiceImpl.java
@@ -7,6 +7,7 @@ import java.util.HashMap; @@ -7,6 +7,7 @@ import java.util.HashMap;
7 import java.util.List; 7 import java.util.List;
8 import java.util.Map; 8 import java.util.Map;
9 9
  10 +import com.bsth.util.RoadCutDoubleName;
10 import org.springframework.beans.factory.annotation.Autowired; 11 import org.springframework.beans.factory.annotation.Autowired;
11 import org.springframework.stereotype.Service; 12 import org.springframework.stereotype.Service;
12 import org.springframework.transaction.annotation.Transactional; 13 import org.springframework.transaction.annotation.Transactional;
@@ -360,6 +361,129 @@ public class SectionServiceImpl extends BaseServiceImpl&lt;Section, Integer&gt; implem @@ -360,6 +361,129 @@ public class SectionServiceImpl extends BaseServiceImpl&lt;Section, Integer&gt; implem
360 return resultMap; 361 return resultMap;
361 } 362 }
362 363
  364 + /**
  365 + * @Description :TODO(生成双路名路段)
  366 + * @param map <lineId:线路ID; route:路段信息>
  367 + * @return
  368 + */
  369 + @Override
  370 + @Transactional
  371 + public Map<String, Object> doubleName(Map<String, Object> map) {
  372 + Map<String, Object> resultMap = new HashMap<String, Object>();
  373 + try {
  374 + // 路段点List
  375 + List<Point> bPointsList = new ArrayList<>();
  376 + // 截取后的路段
  377 + List<Map<String, String>> sectionArrayList = new ArrayList<>();
  378 + Integer lineId = Integer.parseInt(map.get("lineId").equals("") ? "" :map.get("lineId").toString());
  379 + String lineCode = map.get("lineCode").equals("") ? "" :map.get("lineCode").toString();
  380 + Integer directions = Integer.parseInt(map.get("directions").equals("") ? "" :map.get("directions").toString());
  381 + String sectionrouteCode = map.get("sectionrouteCode").equals("") ? "" :map.get("sectionrouteCode").toString();
  382 + Integer versions = Integer.parseInt(map.get("versions").equals("") ? "" :map.get("versions").toString());
  383 + String stationRouteBegin = map.get("stationRouteBegin").equals("") ? "" :map.get("stationRouteBegin").toString();
  384 + String stationRouteFinish = map.get("stationRouteFinish").equals("") ? "" :map.get("stationRouteFinish").toString();
  385 + String routes = map.get("route").equals("") ? "" :map.get("route").toString();
  386 + if(!routes.equals("")) {
  387 + String sectionStr = "";
  388 + // 转换成JSON数组
  389 + JSONArray sectionsArray = JSONArray.parseArray(routes);
  390 + // 遍历
  391 + for(int s = 0 ;s<sectionsArray.size();s++) {
  392 + String pointsLngStr = sectionsArray.getJSONObject(s).get("lng").toString();
  393 + String pointsLatStr = sectionsArray.getJSONObject(s).get("lat").toString();
  394 + if(s == sectionsArray.size()-1){
  395 + sectionStr += pointsLngStr+","+pointsLatStr;
  396 + } else {
  397 + sectionStr += pointsLngStr+","+pointsLatStr+";";
  398 + }
  399 + }
  400 + Map<String, Object> roads = RoadCutDoubleName.start(sectionStr);
  401 + if (!roads.isEmpty()) {
  402 + List bSectionList = (List) roads.get("bSections");
  403 + List roadName = (List) roads.get("roadName");
  404 + // 路段序号
  405 + Integer routeCode = 0;
  406 + if(!sectionrouteCode.equals("")){
  407 + String sectionrouteCodeArray[] = sectionrouteCode.split("_");
  408 + routeCode = Integer.valueOf(sectionrouteCodeArray[0])+100;
  409 + }else {
  410 + routeCode = 100;
  411 + }
  412 + // 增加路段序号
  413 +
  414 + for(int i = 0; i < bSectionList.size(); i++){
  415 + List<Location> bSection = new ArrayList<>();
  416 + bSectionList.get(i);
  417 + bSection = (List<Location>) bSectionList.get(i);
  418 +
  419 + String sectionsBpoints = "";
  420 + // WGS线状图形坐标集合
  421 + String sectionsWJPpoints = "";
  422 + for (int j = 0; j < bSection.size(); j++) {
  423 + bSection.get(j);
  424 + Location point = bSection.get(j);
  425 + String pointsLngStr = String.valueOf(point.getLng());
  426 + String pointsLatStr = String.valueOf(point.getLat());
  427 + /** to WGS坐标 */
  428 + Location resultPoint = FromBDPointToWGSPoint(pointsLngStr,pointsLatStr);
  429 + String WGSLngStr = String.valueOf(resultPoint.getLng());
  430 + String WGSLatStr = String.valueOf(resultPoint.getLat());
  431 + if(j == 0) {
  432 + sectionsBpoints = pointsLngStr + " " + pointsLatStr;
  433 + sectionsWJPpoints = WGSLngStr + " " + WGSLatStr;
  434 + }else {
  435 + sectionsBpoints = sectionsBpoints + "," + pointsLngStr + " " + pointsLatStr;
  436 + sectionsWJPpoints = sectionsWJPpoints + "," + WGSLngStr + " " + WGSLatStr;
  437 + }
  438 + }
  439 + // 获取当前最大Id
  440 + long sectionMaxId = GetUIDAndCode.getSectionId();
  441 + // 路段编码
  442 + String sectionCode = String.valueOf(sectionMaxId);
  443 + // 路段ID
  444 + int sectionId = (int)sectionMaxId;
  445 + String sectionName = roadName.get(i).toString();
  446 + // WGS坐标点集合
  447 + String gsectionVector = null;
  448 + if(!sectionsWJPpoints.equals("")) {
  449 + gsectionVector = "LINESTRING(" + sectionsWJPpoints +")";
  450 + }
  451 + // 原坐标点集合
  452 + String bsectionVectorS = null;
  453 + if(!sectionsBpoints.equals("")) {
  454 + bsectionVectorS = "LINESTRING(" + sectionsBpoints + ")";
  455 + }
  456 + repository.systemSave(sectionCode, sectionName, "", "", "", "", gsectionVector, bsectionVectorS, "", "", "", 0, 0, "", 0, "", 1, sectionId);
  457 +
  458 + routeRepository.sectionUpdSectionRouteCode(lineId, directions,routeCode+i*100);
  459 + SectionRoute route = new SectionRoute();
  460 + Line line = lineRepository.findOne(lineId);
  461 + Section section = repository.findOne(sectionId);
  462 + route.setSectionrouteCode(routeCode+i*100);
  463 + route.setLineCode(lineCode);
  464 + route.setSectionCode(sectionCode);
  465 + route.setDirections(directions);
  466 + route.setVersions(versions);
  467 + route.setDestroy(0);
  468 + route.setLine(line);
  469 + route.setSection(section);
  470 + route.setIsRoadeSpeed(0);
  471 + routeRepository.save(route);
  472 + }
  473 + resultMap.put("status", ResponseCode.SUCCESS);
  474 + return resultMap;
  475 + } else {
  476 + resultMap.put("status", "Failure");
  477 + return resultMap;
  478 + }
  479 + }
  480 + resultMap.put("status", ResponseCode.SUCCESS);
  481 + } catch (Exception e) {
  482 + resultMap.put("status", ResponseCode.ERROR);
  483 + }
  484 + return resultMap;
  485 + }
  486 +
363 private void sectionListCut(List<Point> bPointsList, List<Map<String, String>> sectionArrayList, 487 private void sectionListCut(List<Point> bPointsList, List<Map<String, String>> sectionArrayList,
364 String bsectionVector, String bsectionVectorCutList) { 488 String bsectionVector, String bsectionVectorCutList) {
365 if(!bsectionVector.equals("")) { 489 if(!bsectionVector.equals("")) {
@@ -480,6 +604,7 @@ public class SectionServiceImpl extends BaseServiceImpl&lt;Section, Integer&gt; implem @@ -480,6 +604,7 @@ public class SectionServiceImpl extends BaseServiceImpl&lt;Section, Integer&gt; implem
480 * @return Map<String, Object> <SUCCESS ; ERROR> 604 * @return Map<String, Object> <SUCCESS ; ERROR>
481 */ 605 */
482 @Override 606 @Override
  607 + @Transactional
483 public Map<String, Object> sectionUpdate(Map<String, Object> map) { 608 public Map<String, Object> sectionUpdate(Map<String, Object> map) {
484 Map<String, Object> resultMap = new HashMap<String, Object>(); 609 Map<String, Object> resultMap = new HashMap<String, Object>();
485 try { 610 try {
@@ -539,32 +664,30 @@ public class SectionServiceImpl extends BaseServiceImpl&lt;Section, Integer&gt; implem @@ -539,32 +664,30 @@ public class SectionServiceImpl extends BaseServiceImpl&lt;Section, Integer&gt; implem
539 SectionRoute resultS = routeRepository.findOne(sectionRouteId); 664 SectionRoute resultS = routeRepository.findOne(sectionRouteId);
540 int old_code = resultS.getSectionrouteCode(); 665 int old_code = resultS.getSectionrouteCode();
541 if(sectionrouteCode!=null) { 666 if(sectionrouteCode!=null) {
542 - int new_code = sectionrouteCode+100;  
543 - if(new_code==old_code){  
544 - sectionrouteCode = new_code;  
545 - }else {  
546 - sectionrouteCode = new_code-100+1;  
547 - }  
548 - }else {  
549 - sectionrouteCode = old_code;  
550 - } 667 + sectionrouteCode += 100;
  668 + }else {
  669 + sectionrouteCode = old_code;
  670 + }
  671 + routeRepository.sectionUpdSectionRouteCode(lineCode, directions,sectionrouteCode);
551 // 限速 672 // 限速
552 Double speedLimit = map.get("speedLimit").equals("") ? null : Double.valueOf(map.get("speedLimit").toString()); 673 Double speedLimit = map.get("speedLimit").equals("") ? null : Double.valueOf(map.get("speedLimit").toString());
553 // 版本 674 // 版本
554 Integer version = map.get("versions").equals("") ? null : Integer.valueOf(map.get("versions").toString()); 675 Integer version = map.get("versions").equals("") ? null : Integer.valueOf(map.get("versions").toString());
555 // WGS坐标点集合 676 // WGS坐标点集合
556 String gsectionVector = null; 677 String gsectionVector = null;
557 - if(!sectionsWJPpoints.equals("")) 678 + if(!sectionsWJPpoints.equals("")) {
558 gsectionVector = "LINESTRING(" + sectionsWJPpoints +")"; 679 gsectionVector = "LINESTRING(" + sectionsWJPpoints +")";
  680 + }
559 // 原坐标点集合 681 // 原坐标点集合
560 String bsectionVectorS = null; 682 String bsectionVectorS = null;
561 - if(!sectionsBpoints.equals(""))  
562 - bsectionVectorS = "LINESTRING(" + sectionsBpoints + ")"; 683 + if(!sectionsBpoints.equals("")) {
  684 + bsectionVectorS = "LINESTRING(" + sectionsBpoints + ")";
  685 + }
563 Integer createBy = map.get("createBy").equals("") ? null : Integer.valueOf(map.get("createBy").toString()); 686 Integer createBy = map.get("createBy").equals("") ? null : Integer.valueOf(map.get("createBy").toString());
564 String createDate = map.get("createDate").equals("") ? null : map.get("createDate").toString(); 687 String createDate = map.get("createDate").equals("") ? null : map.get("createDate").toString();
565 Integer updateBy = map.get("updateBy").equals("") ?null : Integer.valueOf(map.get("updateBy").toString()); 688 Integer updateBy = map.get("updateBy").equals("") ?null : Integer.valueOf(map.get("updateBy").toString());
566 Integer isRoadeSpeed = map.get("isRoadeSpeed").equals("") ? null : Integer.valueOf(map.get("isRoadeSpeed").toString()); 689 Integer isRoadeSpeed = map.get("isRoadeSpeed").equals("") ? null : Integer.valueOf(map.get("isRoadeSpeed").toString());
567 - SimpleDateFormat formatter = new SimpleDateFormat ("yyyy-MM-dd HH:mm:ss"); 690 + SimpleDateFormat formatter = new SimpleDateFormat ("yyyy-MM-dd HH:mm:ss");
568 Date date = new Date(); 691 Date date = new Date();
569 // 修改日期 692 // 修改日期
570 String updateDate = formatter.format(date); 693 String updateDate = formatter.format(date);
@@ -604,6 +727,7 @@ public class SectionServiceImpl extends BaseServiceImpl&lt;Section, Integer&gt; implem @@ -604,6 +727,7 @@ public class SectionServiceImpl extends BaseServiceImpl&lt;Section, Integer&gt; implem
604 * @Description :TODO(编辑缓存线路走向) 727 * @Description :TODO(编辑缓存线路走向)
605 */ 728 */
606 @Override 729 @Override
  730 + @Transactional
607 public Map<String, Object> sectionCacheUpdate(Map<String, Object> map) { 731 public Map<String, Object> sectionCacheUpdate(Map<String, Object> map) {
608 Map<String, Object> resultMap = new HashMap<String, Object>(); 732 Map<String, Object> resultMap = new HashMap<String, Object>();
609 try { 733 try {
@@ -670,26 +794,29 @@ public class SectionServiceImpl extends BaseServiceImpl&lt;Section, Integer&gt; implem @@ -670,26 +794,29 @@ public class SectionServiceImpl extends BaseServiceImpl&lt;Section, Integer&gt; implem
670 }else { 794 }else {
671 sectionrouteCode = new_code-100+1; 795 sectionrouteCode = new_code-100+1;
672 } 796 }
673 - }else {  
674 - sectionrouteCode = old_code;  
675 - } 797 + }else {
  798 + sectionrouteCode = old_code;
  799 + }
  800 + routeRepository.sectionUpdSectionRouteCode(lineCode, directions,sectionrouteCode);
676 // 限速 801 // 限速
677 Double speedLimit = map.get("speedLimit").equals("") ? null : Double.valueOf(map.get("speedLimit").toString()); 802 Double speedLimit = map.get("speedLimit").equals("") ? null : Double.valueOf(map.get("speedLimit").toString());
678 // 版本 803 // 版本
679 Integer version = map.get("versions").equals("") ? null : Integer.valueOf(map.get("versions").toString()); 804 Integer version = map.get("versions").equals("") ? null : Integer.valueOf(map.get("versions").toString());
680 // WGS坐标点集合 805 // WGS坐标点集合
681 String gsectionVector = null; 806 String gsectionVector = null;
682 - if(!sectionsWJPpoints.equals("")) 807 + if(!sectionsWJPpoints.equals("")) {
683 gsectionVector = "LINESTRING(" + sectionsWJPpoints +")"; 808 gsectionVector = "LINESTRING(" + sectionsWJPpoints +")";
  809 + }
684 // 原坐标点集合 810 // 原坐标点集合
685 String bsectionVectorS = null; 811 String bsectionVectorS = null;
686 - if(!sectionsBpoints.equals(""))  
687 - bsectionVectorS = "LINESTRING(" + sectionsBpoints + ")"; 812 + if(!sectionsBpoints.equals("")) {
  813 + bsectionVectorS = "LINESTRING(" + sectionsBpoints + ")";
  814 + }
688 Integer createBy = map.get("createBy").equals("") ? null : Integer.valueOf(map.get("createBy").toString()); 815 Integer createBy = map.get("createBy").equals("") ? null : Integer.valueOf(map.get("createBy").toString());
689 String createDate = map.get("createDate").equals("") ? null : map.get("createDate").toString(); 816 String createDate = map.get("createDate").equals("") ? null : map.get("createDate").toString();
690 Integer updateBy = map.get("updateBy").equals("") ?null : Integer.valueOf(map.get("updateBy").toString()); 817 Integer updateBy = map.get("updateBy").equals("") ?null : Integer.valueOf(map.get("updateBy").toString());
691 Integer isRoadeSpeed = map.get("isRoadeSpeed").equals("") ? null : Integer.valueOf(map.get("isRoadeSpeed").toString()); 818 Integer isRoadeSpeed = map.get("isRoadeSpeed").equals("") ? null : Integer.valueOf(map.get("isRoadeSpeed").toString());
692 - SimpleDateFormat formatter = new SimpleDateFormat ("yyyy-MM-dd HH:mm:ss"); 819 + SimpleDateFormat formatter = new SimpleDateFormat ("yyyy-MM-dd HH:mm:ss");
693 Date date = new Date(); 820 Date date = new Date();
694 // 修改日期 821 // 修改日期
695 String updateDate = formatter.format(date); 822 String updateDate = formatter.format(date);
@@ -742,7 +869,6 @@ public class SectionServiceImpl extends BaseServiceImpl&lt;Section, Integer&gt; implem @@ -742,7 +869,6 @@ public class SectionServiceImpl extends BaseServiceImpl&lt;Section, Integer&gt; implem
742 869
743 } 870 }
744 871
745 -  
746 /** 872 /**
747 * 新增路段信息 873 * 新增路段信息
748 * 874 *
@@ -833,11 +959,11 @@ public class SectionServiceImpl extends BaseServiceImpl&lt;Section, Integer&gt; implem @@ -833,11 +959,11 @@ public class SectionServiceImpl extends BaseServiceImpl&lt;Section, Integer&gt; implem
833 Integer routeCode = null; 959 Integer routeCode = null;
834 if(!sectionrouteCode.equals("")){ 960 if(!sectionrouteCode.equals("")){
835 String sectionrouteCodeArray[] = sectionrouteCode.split("_"); 961 String sectionrouteCodeArray[] = sectionrouteCode.split("_");
836 - routeCode = Integer.valueOf(sectionrouteCodeArray[0])+1; 962 + routeCode = Integer.valueOf(sectionrouteCodeArray[0])+100;
837 }else { 963 }else {
838 routeCode = 100; 964 routeCode = 100;
839 } 965 }
840 - routeRepository.sectionUpdSectionRouteCode(lineId, directions,routeCode); 966 + routeRepository.sectionUpdSectionRouteCode(lineId, directions, routeCode);
841 sectionRoute.setSectionrouteCode(routeCode); 967 sectionRoute.setSectionrouteCode(routeCode);
842 sectionRoute.setLineCode(lineCode); 968 sectionRoute.setLineCode(lineCode);
843 sectionRoute.setSection(section); 969 sectionRoute.setSection(section);
@@ -856,4 +982,5 @@ public class SectionServiceImpl extends BaseServiceImpl&lt;Section, Integer&gt; implem @@ -856,4 +982,5 @@ public class SectionServiceImpl extends BaseServiceImpl&lt;Section, Integer&gt; implem
856 } 982 }
857 return resultMap; 983 return resultMap;
858 } 984 }
  985 +
859 } 986 }
860 \ No newline at end of file 987 \ No newline at end of file
src/main/java/com/bsth/service/impl/StationRouteServiceImpl.java
@@ -544,7 +544,116 @@ public class StationRouteServiceImpl extends BaseServiceImpl&lt;StationRoute, Integ @@ -544,7 +544,116 @@ public class StationRouteServiceImpl extends BaseServiceImpl&lt;StationRoute, Integ
544 } 544 }
545 return list; 545 return list;
546 } 546 }
547 - 547 +
  548 + /**
  549 + * @Description :TODO(查询下一个站点)
  550 + *
  551 + * @param map <lineId:线路ID; direction:方向;stationRouteCode:站点编码>
  552 + *
  553 + * @return List<Map<String, Object>>
  554 + */
  555 + @Override
  556 + public List<Map<String, Object>> findDownStationRoute(Map<String, Object> map) {
  557 + Integer lineId = map.get("lineId").equals("") ? null : Integer.parseInt(map.get("lineId").toString());
  558 + Integer direction = map.get("direction").equals("") ? null : Integer.parseInt(map.get("direction").toString());
  559 + Integer stationRouteCode = map.get("stationRouteCode").equals("") ? null : Integer.parseInt(map.get("stationRouteCode").toString());
  560 + List<Object[]> objects = repository.findDownStationRoute(lineId, direction, stationRouteCode);
  561 + List<Map<String, Object>> resultList = new ArrayList<Map<String,Object>>();
  562 +
  563 + int len = objects.size();
  564 +
  565 + if(objects.size()>0) {
  566 +
  567 + for(int i = 0 ; i < len; i++) {
  568 + Map<String, Object> tempM = new HashMap<String,Object>();
  569 +
  570 + tempM.put("stationRouteLine", objects.get(i)[0]);
  571 +
  572 + tempM.put("stationRouteStation", objects.get(i)[1]);
  573 +
  574 + tempM.put("stationRouteCode", objects.get(i)[2]);
  575 +
  576 + tempM.put("stationRouteLIneCode", objects.get(i)[3]);
  577 +
  578 + tempM.put("stationRouteStationMark", objects.get(i)[4]);
  579 +
  580 + tempM.put("stationOutStationNmber", objects.get(i)[5]);
  581 +
  582 + tempM.put("stationRoutedirections", objects.get(i)[6]);
  583 +
  584 + tempM.put("stationRouteDistances", objects.get(i)[7]);
  585 +
  586 + tempM.put("stationRouteToTime", objects.get(i)[8]);
  587 +
  588 + tempM.put("staitonRouteFirstTime", objects.get(i)[9]);
  589 +
  590 + tempM.put("stationRouteEndTime", objects.get(i)[10]);
  591 +
  592 + tempM.put("stationRouteDescriptions", objects.get(i)[11]);
  593 +
  594 + tempM.put("stationRouteDestroy", objects.get(i)[12]);
  595 +
  596 + tempM.put("stationRouteVersions", objects.get(i)[13]);
  597 +
  598 + tempM.put("stationRouteCreateBy", objects.get(i)[14]);
  599 +
  600 + tempM.put("stationRouteCreateDate", objects.get(i)[15]);
  601 +
  602 + tempM.put("stationRouteUpdateBy", objects.get(i)[16]);
  603 +
  604 + tempM.put("stationRouteUpdateDate", objects.get(i)[17]);
  605 +
  606 + tempM.put("stationId", objects.get(i)[18]);
  607 +
  608 + tempM.put("stationCode", objects.get(i)[19]);
  609 +
  610 + tempM.put("stationRouteName", objects.get(i)[20]);
  611 +
  612 + tempM.put("stationRoadCoding", objects.get(i)[21]);
  613 +
  614 + tempM.put("stationDbType", objects.get(i)[22]);
  615 +
  616 + tempM.put("stationJwpoints", objects.get(i)[23]);
  617 +
  618 + tempM.put("stationGlonx", objects.get(i)[24]);
  619 +
  620 + tempM.put("stationGlaty", objects.get(i)[25]);
  621 +
  622 + tempM.put("stationX", objects.get(i)[26]);
  623 +
  624 + tempM.put("stationY", objects.get(i)[27]);
  625 +
  626 + tempM.put("stationBPolyonGrid", objects.get(i)[28]);
  627 +
  628 + tempM.put("stationGPloyonGrid", objects.get(i)[29]);
  629 +
  630 + tempM.put("stationDestroy", objects.get(i)[30]);
  631 +
  632 + tempM.put("stationRadius", objects.get(i)[31]);
  633 +
  634 + tempM.put("stationShapesType", objects.get(i)[32]);
  635 +
  636 + tempM.put("stationVersions", objects.get(i)[33]);
  637 +
  638 + tempM.put("sttationDescriptions", objects.get(i)[34]);
  639 +
  640 + tempM.put("stationCreateBy", objects.get(i)[35]);
  641 +
  642 + tempM.put("stationCreateDate", objects.get(i)[36]);
  643 +
  644 + tempM.put("stationUpdateBy", objects.get(i)[37]);
  645 +
  646 + tempM.put("stationUpdateDate", objects.get(i)[38]);
  647 +
  648 + tempM.put("stationRouteId", objects.get(i)[39]);
  649 + tempM.put("zdmc", objects.get(i)[40]);
  650 +
  651 + resultList.add(tempM);
  652 + }
  653 + }
  654 + return resultList;
  655 + }
  656 +
548 /** 657 /**
549 * @Description :TODO(查询线路某方向下所有站点的中心百度坐标) 658 * @Description :TODO(查询线路某方向下所有站点的中心百度坐标)
550 * 659 *
@@ -742,10 +851,14 @@ public class StationRouteServiceImpl extends BaseServiceImpl&lt;StationRoute, Integ @@ -742,10 +851,14 @@ public class StationRouteServiceImpl extends BaseServiceImpl&lt;StationRoute, Integ
742 851
743 // 将txt文件打包 852 // 将txt文件打包
744 File targetFile = PackTarGZUtils.compress(textFile, target); 853 File targetFile = PackTarGZUtils.compress(textFile, target);
745 - 854 +
746 /*clientUtils.testUpLoadFromDisk(targetFile,targetFile.getName());*/ 855 /*clientUtils.testUpLoadFromDisk(targetFile,targetFile.getName());*/
747 - 856 +
748 clientUtils.FTPUpLoadFromDisk(targetFile, targetFile.getName(), url, port, username, password, remotePath); 857 clientUtils.FTPUpLoadFromDisk(targetFile, targetFile.getName(), url, port, username, password, remotePath);
  858 +
  859 + // 删除文件
  860 + textFile.delete();
  861 + targetFile.delete();
749 862
750 resultMap.put("status", ResponseCode.SUCCESS); 863 resultMap.put("status", ResponseCode.SUCCESS);
751 864
@@ -1313,7 +1426,7 @@ public class StationRouteServiceImpl extends BaseServiceImpl&lt;StationRoute, Integ @@ -1313,7 +1426,7 @@ public class StationRouteServiceImpl extends BaseServiceImpl&lt;StationRoute, Integ
1313 /** 1426 /**
1314 * @Description :TODO(查询缓存路由) 1427 * @Description :TODO(查询缓存路由)
1315 * 1428 *
1316 - * @param map <line.id_eq:线路ID; directions_eq:方向> 1429 + * @param map (line.id_eq:线路ID; directions_eq:方向)
1317 * 1430 *
1318 * @return List<Map<String, Object>> 1431 * @return List<Map<String, Object>>
1319 */ 1432 */
src/main/java/com/bsth/service/oil/impl/DlbServiceImpl.java
@@ -203,6 +203,7 @@ public class DlbServiceImpl extends BaseServiceImpl&lt;Dlb,Integer&gt; implements DlbS @@ -203,6 +203,7 @@ public class DlbServiceImpl extends BaseServiceImpl&lt;Dlb,Integer&gt; implements DlbS
203 t.setLp(map.get("lpName").toString()); 203 t.setLp(map.get("lpName").toString());
204 t.setRq(sdf.parse(rq)); 204 t.setRq(sdf.parse(rq));
205 t.setCreatetime(new Date()); 205 t.setCreatetime(new Date());
  206 + t.setJname(map.get("jName").toString());
206 /*if(type.equals("add")){ 207 /*if(type.equals("add")){
207 addList.add(t); 208 addList.add(t);
208 }else{ 209 }else{
@@ -257,13 +258,13 @@ public class DlbServiceImpl extends BaseServiceImpl&lt;Dlb,Integer&gt; implements DlbS @@ -257,13 +258,13 @@ public class DlbServiceImpl extends BaseServiceImpl&lt;Dlb,Integer&gt; implements DlbS
257 // 保留两位小数 258 // 保留两位小数
258 DecimalFormat df = new DecimalFormat("#.00"); 259 DecimalFormat df = new DecimalFormat("#.00");
259 // TODO Auto-generated method stub 260 // TODO Auto-generated method stub
260 - // 当天YLB信息  
261 - List<Dlb> dlList = this.listOrderBy(rq,gsbm,fgsbm,line,nbbm,"nbbm"); 261 + // 当天DLB信息
  262 + List<Dlb> dlList = this.listOrderBy(rq,gsbm,fgsbm,"",nbbm,"nbbm");
262 // 当天YLXXB信息 263 // 当天YLXXB信息
263 List<Ylxxb> ylxxList = ylxxbRepository.obtainYlxx(rq, 0,gsbm); 264 List<Ylxxb> ylxxList = ylxxbRepository.obtainYlxx(rq, 0,gsbm);
264 // 从排班表中计算出行驶的总里程 265 // 从排班表中计算出行驶的总里程
265 List<Map<String, Object>> listpb =new ArrayList<Map<String, Object>>(); 266 List<Map<String, Object>> listpb =new ArrayList<Map<String, Object>>();
266 - List<Map<String, Object>> listpbs=scheduleRealInfoService.yesterdayDataList(line, rq, gsbm, fgsbm, "", nbbm); 267 + List<Map<String, Object>> listpbs=scheduleRealInfoService.yesterdayDataList("", rq, gsbm, fgsbm, "", nbbm);
267 Map<String, Double> lcMap=new HashMap<String,Double>(); 268 Map<String, Double> lcMap=new HashMap<String,Double>();
268 for (int i = 0; i < listpbs.size(); i++) { 269 for (int i = 0; i < listpbs.size(); i++) {
269 String cl=listpbs.get(i).get("clZbh").toString(); 270 String cl=listpbs.get(i).get("clZbh").toString();
@@ -295,7 +296,7 @@ public class DlbServiceImpl extends BaseServiceImpl&lt;Dlb,Integer&gt; implements DlbS @@ -295,7 +296,7 @@ public class DlbServiceImpl extends BaseServiceImpl&lt;Dlb,Integer&gt; implements DlbS
295 if(sxtj.equals("0")){ 296 if(sxtj.equals("0")){
296 listpb=listpbs; 297 listpb=listpbs;
297 }else{ 298 }else{
298 - List<Object[]> objectLists=repository.checkNbmmNum(rq, gsbm, fgsbm, line,nbbm); 299 + List<Object[]> objectLists=repository.checkNbmmNum(rq, gsbm, fgsbm, "",nbbm);
299 List<String> stringList=new ArrayList<String>(); 300 List<String> stringList=new ArrayList<String>();
300 for (int i = 0; i < objectLists.size(); i++) { 301 for (int i = 0; i < objectLists.size(); i++) {
301 String clbm=objectLists.get(i)[0].toString(); 302 String clbm=objectLists.get(i)[0].toString();
@@ -406,12 +407,12 @@ public class DlbServiceImpl extends BaseServiceImpl&lt;Dlb,Integer&gt; implements DlbS @@ -406,12 +407,12 @@ public class DlbServiceImpl extends BaseServiceImpl&lt;Dlb,Integer&gt; implements DlbS
406 } 407 }
407 nextJzyl =Arith.sub(zjzl,dh); 408 nextJzyl =Arith.sub(zjzl,dh);
408 if(zlc>0){ 409 if(zlc>0){
409 - long l=Math.round(nextJzyl);  
410 - double ylxs=l*100/100; 410 +// long l=Math.round(nextJzyl);
  411 + double ylxs=nextJzyl;
411 dh=Arith.add(dh, Arith.sub(nextJzyl,ylxs)); 412 dh=Arith.add(dh, Arith.sub(nextJzyl,ylxs));
412 if(dh<0){ 413 if(dh<0){
413 - t.setHd(dh);  
414 - t.setCdl(dh); 414 + t.setHd(0.0);
  415 + t.setCdl(0.0);
415 nextJzyl=Arith.add(ylxs, dh); 416 nextJzyl=Arith.add(ylxs, dh);
416 }else{ 417 }else{
417 t.setHd(dh); 418 t.setHd(dh);
@@ -429,21 +430,21 @@ public class DlbServiceImpl extends BaseServiceImpl&lt;Dlb,Integer&gt; implements DlbS @@ -429,21 +430,21 @@ public class DlbServiceImpl extends BaseServiceImpl&lt;Dlb,Integer&gt; implements DlbS
429 } 430 }
430 nextJzyl =Arith.sub( nextJzyl,dh); 431 nextJzyl =Arith.sub( nextJzyl,dh);
431 if(zlc>0){ 432 if(zlc>0){
432 - long l=0l; 433 +// long l=0l;
433 double ylxs=0.0; 434 double ylxs=0.0;
434 if(i==listpb.size()-1){ 435 if(i==listpb.size()-1){
435 // ylxs=czyl; 436 // ylxs=czyl;
436 }else{ 437 }else{
437 if(listpb.get(i+1).get("clZbh").toString().equals(map.get("clZbh").toString())){ 438 if(listpb.get(i+1).get("clZbh").toString().equals(map.get("clZbh").toString())){
438 - l=Math.round(nextJzyl);  
439 - ylxs=l*100/100; 439 +// l=Math.round(nextJzyl);
  440 + ylxs=nextJzyl;
440 } 441 }
441 442
442 } 443 }
443 dh=Arith.add(dh, Arith.sub(nextJzyl,ylxs)); 444 dh=Arith.add(dh, Arith.sub(nextJzyl,ylxs));
444 if(dh<0){ 445 if(dh<0){
445 - t.setHd(dh);  
446 - t.setCdl(dh); 446 + t.setHd(0.0);
  447 + t.setCdl(0.0);
447 nextJzyl=Arith.add(ylxs, dh); 448 nextJzyl=Arith.add(ylxs, dh);
448 }else{ 449 }else{
449 t.setHd(dh); 450 t.setHd(dh);
@@ -468,15 +469,22 @@ public class DlbServiceImpl extends BaseServiceImpl&lt;Dlb,Integer&gt; implements DlbS @@ -468,15 +469,22 @@ public class DlbServiceImpl extends BaseServiceImpl&lt;Dlb,Integer&gt; implements DlbS
468 t.setJhsj(map.get("fcsj")==null?"":map.get("fcsj").toString()); 469 t.setJhsj(map.get("fcsj")==null?"":map.get("fcsj").toString());
469 t.setRq(sdf.parse(rq)); 470 t.setRq(sdf.parse(rq));
470 t.setLp(map.get("lpName").toString()); 471 t.setLp(map.get("lpName").toString());
471 - if(!(t.getSsgsdm().equals("") || t.getFgsdm().equals(""))){  
472 - if(type.equals("add")){  
473 - t.setCreatetime(date);  
474 - addList.add(t);  
475 - }else{  
476 - t.setUpdatetime(date);  
477 - updateList.add(t);  
478 - }  
479 - } 472 + t.setJname(map.get("jName").toString());
  473 + if (!(t.getSsgsdm().equals("") || t.getFgsdm().equals(""))) {
  474 + if (t.getHd() < 0) {
  475 + t.setHd(0.0);
  476 + }
  477 + if (t.getCdl() < 0) {
  478 + t.setCdl(0.0);
  479 + }
  480 + if (type.equals("add")) {
  481 + t.setCreatetime(date);
  482 + addList.add(t);
  483 + } else {
  484 + t.setUpdatetime(date);
  485 + updateList.add(t);
  486 + }
  487 + }
480 newMap.put("status", ResponseCode.SUCCESS); 488 newMap.put("status", ResponseCode.SUCCESS);
481 } 489 }
482 } 490 }
@@ -1017,7 +1025,7 @@ public class DlbServiceImpl extends BaseServiceImpl&lt;Dlb,Integer&gt; implements DlbS @@ -1017,7 +1025,7 @@ public class DlbServiceImpl extends BaseServiceImpl&lt;Dlb,Integer&gt; implements DlbS
1017 SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd"); 1025 SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");
1018 // 保留两位小数 1026 // 保留两位小数
1019 DecimalFormat df = new DecimalFormat("#.00"); 1027 DecimalFormat df = new DecimalFormat("#.00");
1020 - List<Dlb> dlbList=this.listOrderBy(date,gsdm,fgsdm,line,"","nbbm"); 1028 + List<Dlb> dlbList=this.listOrderBy(date,gsdm,fgsdm,"","","nbbm");
1021 List<Dlb> dlbList_upd=new ArrayList<Dlb>(); 1029 List<Dlb> dlbList_upd=new ArrayList<Dlb>();
1022 List<Dlb> dlbList_del=new ArrayList<Dlb>(); 1030 List<Dlb> dlbList_del=new ArrayList<Dlb>();
1023 try{ 1031 try{
@@ -1041,7 +1049,9 @@ public class DlbServiceImpl extends BaseServiceImpl&lt;Dlb,Integer&gt; implements DlbS @@ -1041,7 +1049,9 @@ public class DlbServiceImpl extends BaseServiceImpl&lt;Dlb,Integer&gt; implements DlbS
1041 } 1049 }
1042 1050
1043 if(fage){ 1051 if(fage){
1044 - dlbList_del.add(t); 1052 + if(t.getXlbm().equals(line)){
  1053 + dlbList_del.add(t);
  1054 + }
1045 } 1055 }
1046 } 1056 }
1047 mapList.put("delList", dlbList_del); 1057 mapList.put("delList", dlbList_del);
@@ -1134,12 +1144,12 @@ public class DlbServiceImpl extends BaseServiceImpl&lt;Dlb,Integer&gt; implements DlbS @@ -1134,12 +1144,12 @@ public class DlbServiceImpl extends BaseServiceImpl&lt;Dlb,Integer&gt; implements DlbS
1134 } 1144 }
1135 nextJzyl =Arith.sub(zjzl,dh); 1145 nextJzyl =Arith.sub(zjzl,dh);
1136 if(zlc>0){ 1146 if(zlc>0){
1137 - long l=Math.round(nextJzyl);  
1138 - double ylxs=l*100/100; 1147 +// long l=Math.round(nextJzyl);
  1148 + double ylxs=nextJzyl;
1139 dh=Arith.add(dh, Arith.sub(nextJzyl,ylxs)); 1149 dh=Arith.add(dh, Arith.sub(nextJzyl,ylxs));
1140 if(dh<0){ 1150 if(dh<0){
1141 - t.setHd(dh);  
1142 - t.setCdl(dh); 1151 + t.setHd(0.0);
  1152 + t.setCdl(0.0);
1143 nextJzyl=Arith.add(ylxs, dh); 1153 nextJzyl=Arith.add(ylxs, dh);
1144 }else{ 1154 }else{
1145 t.setHd(dh); 1155 t.setHd(dh);
@@ -1157,21 +1167,21 @@ public class DlbServiceImpl extends BaseServiceImpl&lt;Dlb,Integer&gt; implements DlbS @@ -1157,21 +1167,21 @@ public class DlbServiceImpl extends BaseServiceImpl&lt;Dlb,Integer&gt; implements DlbS
1157 } 1167 }
1158 nextJzyl =Arith.sub( nextJzyl,dh); 1168 nextJzyl =Arith.sub( nextJzyl,dh);
1159 if(zlc>0){ 1169 if(zlc>0){
1160 - long l=0l; 1170 +// long l=0l;
1161 double ylxs=0.0; 1171 double ylxs=0.0;
1162 if(i==listpbDc.size()-1){ 1172 if(i==listpbDc.size()-1){
1163 // ylxs=czyl; 1173 // ylxs=czyl;
1164 }else{ 1174 }else{
1165 if(listpbDc.get(i+1).get("clZbh").toString().equals(map.get("clZbh").toString())){ 1175 if(listpbDc.get(i+1).get("clZbh").toString().equals(map.get("clZbh").toString())){
1166 - l=Math.round(nextJzyl);  
1167 - ylxs=l*100/100; 1176 +// l=Math.round(nextJzyl);
  1177 + ylxs=nextJzyl;
1168 } 1178 }
1169 1179
1170 } 1180 }
1171 dh=Arith.add(dh, Arith.sub(nextJzyl,ylxs)); 1181 dh=Arith.add(dh, Arith.sub(nextJzyl,ylxs));
1172 if(dh<0){ 1182 if(dh<0){
1173 - t.setHd(dh);  
1174 - t.setCdl(dh); 1183 + t.setHd(0.0);
  1184 + t.setCdl(0.0);
1175 nextJzyl=Arith.add(ylxs, dh); 1185 nextJzyl=Arith.add(ylxs, dh);
1176 }else{ 1186 }else{
1177 t.setHd(dh); 1187 t.setHd(dh);
@@ -1204,6 +1214,13 @@ public class DlbServiceImpl extends BaseServiceImpl&lt;Dlb,Integer&gt; implements DlbS @@ -1204,6 +1214,13 @@ public class DlbServiceImpl extends BaseServiceImpl&lt;Dlb,Integer&gt; implements DlbS
1204 t.setUpdatetime(new Date()); 1214 t.setUpdatetime(new Date());
1205 } 1215 }
1206 } 1216 }
  1217 +
  1218 + if(t.getHd()<0){
  1219 + t.setHd(0.0);
  1220 + }
  1221 + if(t.getCdl()<0){
  1222 + t.setCdl(0.0);
  1223 + }
1207 updateDlb.add(t); 1224 updateDlb.add(t);
1208 } 1225 }
1209 } 1226 }
src/main/java/com/bsth/service/oil/impl/YlbServiceImpl.java
@@ -198,6 +198,7 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS @@ -198,6 +198,7 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
198 t.setFgsdm(map.get("bCompany")==null?"":map.get("bCompany").toString()); 198 t.setFgsdm(map.get("bCompany")==null?"":map.get("bCompany").toString());
199 t.setLp(map.get("lpName")==null?"":map.get("lpName").toString()); 199 t.setLp(map.get("lpName")==null?"":map.get("lpName").toString());
200 t.setJhsj(map.get("fcsj")==null?"":map.get("fcsj").toString()); 200 t.setJhsj(map.get("fcsj")==null?"":map.get("fcsj").toString());
  201 + t.setJname(map.get("jName").toString());
201 t.setRq(sdf.parse(rq)); 202 t.setRq(sdf.parse(rq));
202 t.setCreatetime(dNow); 203 t.setCreatetime(dNow);
203 if(!(t.getSsgsdm().equals("") || t.getFgsdm().equals(""))){ 204 if(!(t.getSsgsdm().equals("") || t.getFgsdm().equals(""))){
@@ -272,24 +273,24 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS @@ -272,24 +273,24 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
272 DecimalFormat df = new DecimalFormat("#.00"); 273 DecimalFormat df = new DecimalFormat("#.00");
273 // TODO Auto-generated method stub 274 // TODO Auto-generated method stub
274 // 当天YLB信息 275 // 当天YLB信息
275 - List<Ylb> ylList = this.listOrderBy(rq,gsbm,fgsbm,line,nbbm,"nbbm"); 276 + List<Ylb> ylList = this.listOrderBy(rq,gsbm,fgsbm,"",nbbm,"nbbm");
276 277
277 // 当天YLXXB信息 278 // 当天YLXXB信息
278 List<Ylxxb> ylxxList = ylxxbRepository.obtainYlxx(rq, 0,gsbm); 279 List<Ylxxb> ylxxList = ylxxbRepository.obtainYlxx(rq, 0,gsbm);
279 280
280 // 前一天所有车辆最后进场班次信息 281 // 前一天所有车辆最后进场班次信息
281 - List<Ylb> ylListBe = this.listByRqJcsx(rq, gsbm, fgsbm, line, nbbm); 282 + List<Ylb> ylListBe = this.listByRqJcsx(rq, gsbm, fgsbm, "", nbbm);
282 List<Cyl> clyList = cylRepository.obtainCyl(nbbm,gsbm); 283 List<Cyl> clyList = cylRepository.obtainCyl(nbbm,gsbm);
283 284
284 // 从排班表中计算出行驶的总里程 285 // 从排班表中计算出行驶的总里程
285 List<Map<String, Object>> listpb =new ArrayList<Map<String, Object>>(); 286 List<Map<String, Object>> listpb =new ArrayList<Map<String, Object>>();
286 - List<Map<String, Object>> listpbs=scheduleRealInfoService.yesterdayDataList(line, rq, gsbm, fgsbm, "", nbbm); 287 + List<Map<String, Object>> listpbs=scheduleRealInfoService.yesterdayDataList("", rq, gsbm, fgsbm, "", nbbm);
287 288
288 String sxtj=map2.get("sxtj").toString(); 289 String sxtj=map2.get("sxtj").toString();
289 if(sxtj.equals("0")){ 290 if(sxtj.equals("0")){
290 listpb=listpbs; 291 listpb=listpbs;
291 }else{ 292 }else{
292 - List<Object[]> objectLists=repository.checkNbmmNum(rq, gsbm, fgsbm, line,nbbm); 293 + List<Object[]> objectLists=repository.checkNbmmNum(rq, gsbm, fgsbm, "",nbbm);
293 List<String> stringList=new ArrayList<String>(); 294 List<String> stringList=new ArrayList<String>();
294 for (int i = 0; i < objectLists.size(); i++) { 295 for (int i = 0; i < objectLists.size(); i++) {
295 String clbm=objectLists.get(i)[0].toString(); 296 String clbm=objectLists.get(i)[0].toString();
@@ -363,49 +364,90 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS @@ -363,49 +364,90 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
363 // 当日的第一个班次,出场油量等于前一天的最后一个班次的进场油量 364 // 当日的第一个班次,出场油量等于前一天的最后一个班次的进场油量
364 if (map.get("seqNumber").toString().equals("1")) { 365 if (map.get("seqNumber").toString().equals("1")) {
365 boolean fage = true; 366 boolean fage = true;
366 - for (int i = 0; i < ylListBe.size(); i++) {  
367 - Ylb ylb = ylListBe.get(i);  
368 - if (map.get("clZbh").toString().equals(ylb.getNbbm())) {  
369 - if(ylb.getJzyl()>0){  
370 - t.setCzyl(ylb.getJzyl());  
371 - fage = false;  
372 - break; 367 + if(line.equals("")){
  368 + for (int i = 0; i < ylListBe.size(); i++) {
  369 + Ylb ylb = ylListBe.get(i);
  370 + if (map.get("clZbh").toString().equals(ylb.getNbbm())) {
  371 + if(ylb.getJzyl()>0){
  372 + t.setCzyl(ylb.getJzyl());
  373 + fage = false;
  374 + break;
  375 + }
  376 +
373 } 377 }
374 -  
375 } 378 }
376 - }  
377 - if (fage) {  
378 - for (int y = 0; y < clyList.size(); y++) {  
379 - Cyl cyl = clyList.get(y);  
380 - if (map.get("clZbh").toString().equals(cyl.getNbbm())) {  
381 - if(cyl!=null){  
382 - if(cyl.getCyl()>=0){  
383 - t.setCzyl(cyl.getCyl()); 379 + if (fage) {
  380 + for (int y = 0; y < clyList.size(); y++) {
  381 + Cyl cyl = clyList.get(y);
  382 + if (map.get("clZbh").toString().equals(cyl.getNbbm())) {
  383 + if(cyl!=null){
  384 + if(cyl.getCyl()>=0){
  385 + t.setCzyl(cyl.getCyl());
  386 + fage = false;
  387 + break;
  388 + }else {
  389 + if(cyl.getCxrl()!=null){
  390 + if(cyl.getCxrl()>0){
  391 + t.setCzyl(cyl.getCxrl());
  392 + fage = false;
  393 + break;
  394 + }
  395 + }
  396 + }
  397 + }
  398 + }
  399 + }
  400 + }
  401 + if (fage) {
  402 + t.setCzyl(0.0);
  403 + }
  404 + }else{
  405 + if (line.equals(map.get("xlBm").toString())) {
  406 + for (int i = 0; i < ylListBe.size(); i++) {
  407 + Ylb ylb = ylListBe.get(i);
  408 + if (map.get("clZbh").toString().equals(ylb.getNbbm())) {
  409 + if(ylb.getJzyl()>0){
  410 + t.setCzyl(ylb.getJzyl());
384 fage = false; 411 fage = false;
385 break; 412 break;
386 - }else {  
387 - if(cyl.getCxrl()!=null){  
388 - if(cyl.getCxrl()>0){  
389 - t.setCzyl(cyl.getCxrl()); 413 + }
  414 +
  415 + }
  416 + }
  417 + if (fage) {
  418 + for (int y = 0; y < clyList.size(); y++) {
  419 + Cyl cyl = clyList.get(y);
  420 + if (map.get("clZbh").toString().equals(cyl.getNbbm())) {
  421 + if(cyl!=null){
  422 + if(cyl.getCyl()>=0){
  423 + t.setCzyl(cyl.getCyl());
390 fage = false; 424 fage = false;
391 break; 425 break;
  426 + }else {
  427 + if(cyl.getCxrl()!=null){
  428 + if(cyl.getCxrl()>0){
  429 + t.setCzyl(cyl.getCxrl());
  430 + fage = false;
  431 + break;
  432 + }
  433 + }
392 } 434 }
393 } 435 }
394 } 436 }
395 } 437 }
396 } 438 }
  439 + if (fage) {
  440 + t.setCzyl(0.0);
  441 + }
397 } 442 }
398 } 443 }
399 - if (fage) {  
400 - t.setCzyl(0.0);  
401 - } 444 +
402 } 445 }
403 446
404 Double jzl = 0.0; 447 Double jzl = 0.0;
405 //一人一车加注量只匹配一次 448 //一人一车加注量只匹配一次
406 - if(ylMap.get(map.get("clZbh").toString()+"_"+ map.get("jGh").toString())!=null){ 449 + if(ylMap.get(map.get("clZbh").toString()+"_"+ map.get("jGh").toString())==null){
407 450
408 - }else{  
409 boolean fage2=false; 451 boolean fage2=false;
410 for (int i = 0; i < ylxxList.size(); i++) { 452 for (int i = 0; i < ylxxList.size(); i++) {
411 Ylxxb ylxxb = ylxxList.get(i); 453 Ylxxb ylxxb = ylxxList.get(i);
@@ -455,6 +497,7 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS @@ -455,6 +497,7 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
455 t.setJhsj(map.get("fcsj")==null?"":map.get("fcsj").toString()); 497 t.setJhsj(map.get("fcsj")==null?"":map.get("fcsj").toString());
456 t.setRq(sdf.parse(rq)); 498 t.setRq(sdf.parse(rq));
457 t.setLp(map.get("lpName")==null?"":map.get("lpName").toString()); 499 t.setLp(map.get("lpName")==null?"":map.get("lpName").toString());
  500 + t.setJname(map.get("jName").toString());
458 if(!(t.getSsgsdm().equals("") || t.getFgsdm().equals(""))){ 501 if(!(t.getSsgsdm().equals("") || t.getFgsdm().equals(""))){
459 if(type.equals("add")){ 502 if(type.equals("add")){
460 t.setCreatetime(date); 503 t.setCreatetime(date);
@@ -679,6 +722,18 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS @@ -679,6 +722,18 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
679 t.setJzyl(nextJzyl); 722 t.setJzyl(nextJzyl);
680 } 723 }
681 } 724 }
  725 + if(t.getJzyl()<0){
  726 + t.setJzyl(0.0);
  727 + }
  728 + if(t.getCzyl()<0){
  729 + t.setCzyl(0.0);
  730 + }
  731 + if(t.getYh()<0){
  732 + t.setYh(0.0);
  733 + }
  734 + if(t.getSh()<0){
  735 + t.setSh(0.0);
  736 + }
682 repository.save(t); 737 repository.save(t);
683 } 738 }
684 map2.put("status", ResponseCode.SUCCESS); 739 map2.put("status", ResponseCode.SUCCESS);
@@ -748,7 +803,7 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS @@ -748,7 +803,7 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
748 nbbm=map.get("nbbm_eq").toString(); 803 nbbm=map.get("nbbm_eq").toString();
749 } 804 }
750 // List<Ylb> ylListBe=repository.obtainYlbefore(rq, gsbm, "", xlbm, nbbm); 805 // List<Ylb> ylListBe=repository.obtainYlbefore(rq, gsbm, "", xlbm, nbbm);
751 - List<Ylb> ylListBe=this.listByRqJcsx(rq, gsbm, fgsbm, xlbm, nbbm); 806 + List<Ylb> ylListBe=this.listByRqJcsx(rq, gsbm, fgsbm, "", nbbm);
752 List<Ylb> ylbList=this.listOrderBy(rq,gsbm,fgsbm,xlbm,nbbm,"nbbm"); 807 List<Ylb> ylbList=this.listOrderBy(rq,gsbm,fgsbm,xlbm,nbbm,"nbbm");
753 // repository.obtainYl(rq,gsbm,fgsbm,xlbm,nbbm,"nbbm"); 808 // repository.obtainYl(rq,gsbm,fgsbm,xlbm,nbbm,"nbbm");
754 // List<Ylxxb> ylxxbList=ylxxbRepository.obtainYlxx(rq,0,gsbm); 809 // List<Ylxxb> ylxxbList=ylxxbRepository.obtainYlxx(rq,0,gsbm);
@@ -803,6 +858,7 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS @@ -803,6 +858,7 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
803 t.setNbbm(y1.getNbbm()); 858 t.setNbbm(y1.getNbbm());
804 t.setRq(y1.getYyrq()); 859 t.setRq(y1.getYyrq());
805 t.setJsy(y1.getJsy()); 860 t.setJsy(y1.getJsy());
  861 + t.setJname(BasicData.allPerson.get(y1.getGsdm()+"-"+y1.getJsy()));
806 t.setJzl(y1.getJzl()); 862 t.setJzl(y1.getJzl());
807 t.setSsgsdm(y1.getGsdm()); 863 t.setSsgsdm(y1.getGsdm());
808 String fgsdm=""; 864 String fgsdm="";
@@ -1404,6 +1460,18 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS @@ -1404,6 +1460,18 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
1404 t.setJzyl(nextJzyl); 1460 t.setJzyl(nextJzyl);
1405 } 1461 }
1406 } 1462 }
  1463 + if(t.getJzyl()<0){
  1464 + t.setJzyl(0.0);
  1465 + }
  1466 + if(t.getCzyl()<0){
  1467 + t.setCzyl(0.0);
  1468 + }
  1469 + if(t.getYh()<0){
  1470 + t.setYh(0.0);
  1471 + }
  1472 + if(t.getSh()<0){
  1473 + t.setSh(0.0);
  1474 + }
1407 repository.save(t); 1475 repository.save(t);
1408 } 1476 }
1409 newMap.put("status", ResponseCode.SUCCESS); 1477 newMap.put("status", ResponseCode.SUCCESS);
@@ -1611,9 +1679,15 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS @@ -1611,9 +1679,15 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
1611 fgsdm=l.getBrancheCompany(); 1679 fgsdm=l.getBrancheCompany();
1612 } 1680 }
1613 1681
  1682 + String nbbmstr="";
1614 List<Map<String, Object>> listpbYc=new ArrayList<Map<String, Object>>();//油车数据 1683 List<Map<String, Object>> listpbYc=new ArrayList<Map<String, Object>>();//油车数据
1615 List<Map<String, Object>> listpbDc=new ArrayList<Map<String, Object>>();//电车数据 1684 List<Map<String, Object>> listpbDc=new ArrayList<Map<String, Object>>();//电车数据
1616 - List<Map<String,Object>> listpb=scheduleRealInfoService.yesterdayDataList(line, date,gsdm, fgsdm, "", ""); 1685 + List<Map<String,Object>> listpb=scheduleRealInfoService.yesterdayDataList("", date,gsdm, fgsdm, "", "");
  1686 + for (int i = 0; i < listpb.size(); i++) {
  1687 + if(listpb.get(i).get("xlBm").toString().equals(line)){
  1688 + nbbmstr +=listpb.get(i).get("clZbh").toString();
  1689 + }
  1690 + }
1617 for (int i = 0; i < listpb.size(); i++) { 1691 for (int i = 0; i < listpb.size(); i++) {
1618 boolean sfdc=true; 1692 boolean sfdc=true;
1619 Map<String, Object> m = listpb.get(i); 1693 Map<String, Object> m = listpb.get(i);
@@ -1622,10 +1696,12 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS @@ -1622,10 +1696,12 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
1622 } else { 1696 } else {
1623 sfdc = true; 1697 sfdc = true;
1624 } 1698 }
1625 - if(sfdc){  
1626 - listpbDc.add(m);  
1627 - }else{  
1628 - listpbYc.add(m); 1699 + if(nbbmstr.indexOf(m.get("clZbh").toString())>-1){
  1700 + if(sfdc){
  1701 + listpbDc.add(m);
  1702 + }else{
  1703 + listpbYc.add(m);
  1704 + }
1629 } 1705 }
1630 } 1706 }
1631 SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); 1707 SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
@@ -1633,8 +1709,8 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS @@ -1633,8 +1709,8 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
1633 List<Cyl> clyList = cylRepository.obtainCyl("",gsdm); 1709 List<Cyl> clyList = cylRepository.obtainCyl("",gsdm);
1634 List<Ylxxb> ylxxList = ylxxbRepository.obtainYlxx(date, 0,gsdm); 1710 List<Ylxxb> ylxxList = ylxxbRepository.obtainYlxx(date, 0,gsdm);
1635 //重新统计油车数据开始 1711 //重新统计油车数据开始
1636 - List<Ylb> ylListBe =repository.listMaxRqJcsx(date, gsdm, fgsdm, line, "");  
1637 - List<Ylb> ylbList=this.listOrderBy(date,gsdm,fgsdm,line,"","nbbm"); 1712 + List<Ylb> ylListBe =repository.listByRqJcsx(date, gsdm, fgsdm, "", "");
  1713 + List<Ylb> ylbList=this.listOrderBy(date,gsdm,fgsdm,"","","nbbm");
1638 List<Ylb> ylbList_upd=new ArrayList<Ylb>(); 1714 List<Ylb> ylbList_upd=new ArrayList<Ylb>();
1639 List<Ylb> ylbList_del=new ArrayList<Ylb>(); 1715 List<Ylb> ylbList_del=new ArrayList<Ylb>();
1640 1716
@@ -1657,7 +1733,9 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS @@ -1657,7 +1733,9 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
1657 } 1733 }
1658 } 1734 }
1659 if(fage){ 1735 if(fage){
1660 - ylbList_del.add(t); 1736 + if(t.getXlbm().equals(line)){
  1737 + ylbList_del.add(t);
  1738 + }
1661 } 1739 }
1662 1740
1663 } 1741 }
@@ -1766,6 +1844,7 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS @@ -1766,6 +1844,7 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
1766 t.setJzl(jzl); 1844 t.setJzl(jzl);
1767 t.setNbbm(maps.get("clZbh").toString()); 1845 t.setNbbm(maps.get("clZbh").toString());
1768 t.setJsy(maps.get("jGh") == null ? "" : maps.get("jGh").toString()); 1846 t.setJsy(maps.get("jGh") == null ? "" : maps.get("jGh").toString());
  1847 + t.setJname(maps.get("jName").toString());
1769 t.setZlc(maps.get("totalKilometers") == null ? 0.0 1848 t.setZlc(maps.get("totalKilometers") == null ? 0.0
1770 : Double.parseDouble(maps.get("totalKilometers").toString())); 1849 : Double.parseDouble(maps.get("totalKilometers").toString()));
1771 t.setXlbm(maps.get("xlBm") == null ? "" : maps.get("xlBm").toString()); 1850 t.setXlbm(maps.get("xlBm") == null ? "" : maps.get("xlBm").toString());
@@ -1796,7 +1875,6 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS @@ -1796,7 +1875,6 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
1796 } 1875 }
1797 1876
1798 } 1877 }
1799 -  
1800 for (int i = 0; i < ylbList_del.size(); i++) { 1878 for (int i = 0; i < ylbList_del.size(); i++) {
1801 Ylb y=ylbList_del.get(i); 1879 Ylb y=ylbList_del.get(i);
1802 if(nbbmStr.indexOf(y.getNbbm())<0){ 1880 if(nbbmStr.indexOf(y.getNbbm())<0){
@@ -1807,7 +1885,7 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS @@ -1807,7 +1885,7 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
1807 1885
1808 //重新计算删除了的或者新增了的车的车的油耗信息(考虑车辆可能跨线路,从分公司赛选计算) 1886 //重新计算删除了的或者新增了的车的车的油耗信息(考虑车辆可能跨线路,从分公司赛选计算)
1809 double czyl=0.0; 1887 double czyl=0.0;
1810 - List<Ylb> iterator2=this.listOrderBy(date,gsdm,fgsdm,line,"","nbbm,jcsx"); 1888 + List<Ylb> iterator2=this.listOrderBy(date,gsdm,fgsdm,"","","nbbm,jcsx");
1811 String[] nbbms=nbbmStr.split(","); 1889 String[] nbbms=nbbmStr.split(",");
1812 for (int i = 0; i < nbbms.length; i++) { 1890 for (int i = 0; i < nbbms.length; i++) {
1813 String clzbm=nbbms[i]; 1891 String clzbm=nbbms[i];
@@ -1879,6 +1957,18 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS @@ -1879,6 +1957,18 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
1879 t.setJzyl(nextJzyl); 1957 t.setJzyl(nextJzyl);
1880 } 1958 }
1881 } 1959 }
  1960 + if(t.getJzyl()<0){
  1961 + t.setJzyl(0.0);
  1962 + }
  1963 + if(t.getCzyl()<0){
  1964 + t.setCzyl(0.0);
  1965 + }
  1966 + if(t.getYh()<0){
  1967 + t.setYh(0.0);
  1968 + }
  1969 + if(t.getSh()<0){
  1970 + t.setSh(0.0);
  1971 + }
1882 repository.save(t); 1972 repository.save(t);
1883 } 1973 }
1884 } 1974 }
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
@@ -41,6 +41,7 @@ import com.bsth.entity.schedule.SchedulePlanInfo; @@ -41,6 +41,7 @@ import com.bsth.entity.schedule.SchedulePlanInfo;
41 import com.bsth.entity.sys.DutyEmployee; 41 import com.bsth.entity.sys.DutyEmployee;
42 import com.bsth.entity.sys.SysUser; 42 import com.bsth.entity.sys.SysUser;
43 import com.bsth.repository.CarDeviceRepository; 43 import com.bsth.repository.CarDeviceRepository;
  44 +import com.bsth.repository.CarsRepository;
44 import com.bsth.repository.LineRepository; 45 import com.bsth.repository.LineRepository;
45 import com.bsth.repository.oil.DlbRepository; 46 import com.bsth.repository.oil.DlbRepository;
46 import com.bsth.repository.oil.YlbRepository; 47 import com.bsth.repository.oil.YlbRepository;
@@ -159,6 +160,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -159,6 +160,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
159 @Autowired 160 @Autowired
160 CarDeviceRepository carDeviceRepository; 161 CarDeviceRepository carDeviceRepository;
161 162
  163 + @Autowired
  164 + CarsRepository carsRepository;
162 Logger logger = LoggerFactory.getLogger(this.getClass()); 165 Logger logger = LoggerFactory.getLogger(this.getClass());
163 166
164 SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), 167 SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"),
@@ -3879,134 +3882,138 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -3879,134 +3882,138 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3879 } 3882 }
3880 3883
3881 @Override 3884 @Override
3882 - public Map<String, Object> MapById(Long id) {  
3883 - // TODO Auto-generated method stub  
3884 - Map<String, Object> map = new HashMap<String, Object>();  
3885 - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");  
3886 - ScheduleRealInfo s = scheduleRealInfoRepository.scheduleById(id);  
3887 - String xlbm = s.getXlBm();  
3888 - String fcrq = s.getScheduleDateStr();  
3889 -  
3890 - int type=0;  
3891 - Double ccyl = 0.0;  
3892 - Double jcyl = 0.0;  
3893 - Double yh = 0.0;  
3894 - Double jzl = 0.0;  
3895 - Double zlc=0.0;  
3896 - List<Ylb> listYlb = ylbRepository.queryListYlb(fcrq, s.getClZbh(), s.getjGh(),xlbm);  
3897 - List<Dlb> listDlb = dlbRepository.queryListDlb(fcrq, s.getClZbh(), s.getjGh(),xlbm);  
3898 - if(listYlb.size()>0){  
3899 - type=0;  
3900 - for (int i = 0; i < listYlb.size(); i++) {  
3901 - Ylb y = listYlb.get(i);  
3902 - if(y.getLp()==null){  
3903 - ccyl=Arith.add(ccyl, y.getCzyl());  
3904 - jcyl=Arith.add(jcyl, y.getJzyl());  
3905 - yh =Arith.add(yh ,y.getYh());  
3906 - jzl =Arith.add(jzl, y.getJzl());  
3907 - zlc =Arith.add(zlc, y.getZlc());  
3908 - }else{  
3909 - if(y.getLp().equals(s.getLpName())){  
3910 - ccyl=Arith.add(ccyl, y.getCzyl());  
3911 - jcyl=Arith.add(jcyl, y.getJzyl());  
3912 - yh =Arith.add(yh ,y.getYh());  
3913 - jzl =Arith.add(jzl, y.getJzl());  
3914 - zlc =Arith.add(zlc, y.getZlc());  
3915 - }  
3916 - }  
3917 -  
3918 - }  
3919 - }else{  
3920 - type=1;  
3921 - for (int i = 0; i < listDlb.size(); i++) {  
3922 - Dlb d=listDlb.get(i);  
3923 - if(d.getLp()==null){  
3924 - ccyl=Arith.add(ccyl, d.getCzcd());  
3925 - jcyl=Arith.add(jcyl, d.getJzcd());  
3926 - yh =Arith.add(yh ,d.getHd());  
3927 - jzl =Arith.add(jzl, d.getCdl());  
3928 - zlc =Arith.add(zlc, d.getZlc());  
3929 - }else{  
3930 - if(d.getLp().equals(s.getLpName())){  
3931 - ccyl=Arith.add(ccyl, d.getCzcd());  
3932 - jcyl=Arith.add(jcyl, d.getJzcd());  
3933 - yh =Arith.add(yh ,d.getHd());  
3934 - jzl =Arith.add(jzl, d.getCdl());  
3935 - zlc =Arith.add(zlc, d.getZlc()); 3885 + public Map<String, Object> MapById(Long id) {
  3886 + // TODO Auto-generated method stub
  3887 + Map<String, Object> map = new HashMap<String, Object>();
  3888 + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
  3889 + ScheduleRealInfo s = scheduleRealInfoRepository.scheduleById(id);
  3890 + String xlbm = s.getXlBm();
  3891 + String fcrq = s.getScheduleDateStr();
  3892 +
  3893 + int type = 2;
  3894 + Double ccyl = 0.0;
  3895 + Double jcyl = 0.0;
  3896 + Double yh = 0.0;
  3897 + Double jzl = 0.0;
  3898 + Double zlc = 0.0;
  3899 + List<Cars> listCars = carsRepository.findCarsByCode(s.getClZbh());
  3900 + if (listCars.size() > 0) {
  3901 + if(listCars.get(0).getSfdc()!=null){
  3902 + if (listCars.get(0).getSfdc()) {
  3903 + List<Dlb> listDlb = dlbRepository.queryListDlb(fcrq, s.getClZbh(), s.getjGh(), xlbm);
  3904 + type = 1;
  3905 + for (int i = 0; i < listDlb.size(); i++) {
  3906 + Dlb d = listDlb.get(i);
  3907 + if (d.getLp() == null) {
  3908 + ccyl = Arith.add(ccyl, d.getCzcd());
  3909 + jcyl = Arith.add(jcyl, d.getJzcd());
  3910 + yh = Arith.add(yh, d.getHd());
  3911 + jzl = Arith.add(jzl, d.getCdl());
  3912 + zlc = Arith.add(zlc, d.getZlc());
  3913 + } else {
  3914 + if (d.getLp().equals(s.getLpName())) {
  3915 + ccyl = Arith.add(ccyl, d.getCzcd());
  3916 + jcyl = Arith.add(jcyl, d.getJzcd());
  3917 + yh = Arith.add(yh, d.getHd());
  3918 + jzl = Arith.add(jzl, d.getCdl());
  3919 + zlc = Arith.add(zlc, d.getZlc());
  3920 + }
  3921 + }
  3922 +
  3923 + }
  3924 + } else {
  3925 + List<Ylb> listYlb = ylbRepository.queryListYlb(fcrq, s.getClZbh(), s.getjGh(), xlbm);
  3926 + type = 0;
  3927 + for (int i = 0; i < listYlb.size(); i++) {
  3928 + Ylb y = listYlb.get(i);
  3929 + if (y.getLp() == null) {
  3930 + ccyl = Arith.add(ccyl, y.getCzyl());
  3931 + jcyl = Arith.add(jcyl, y.getJzyl());
  3932 + yh = Arith.add(yh, y.getYh());
  3933 + jzl = Arith.add(jzl, y.getJzl());
  3934 + zlc = Arith.add(zlc, y.getZlc());
  3935 + } else {
  3936 + if (y.getLp().equals(s.getLpName())) {
  3937 + ccyl = Arith.add(ccyl, y.getCzyl());
  3938 + jcyl = Arith.add(jcyl, y.getJzyl());
  3939 + yh = Arith.add(yh, y.getYh());
  3940 + jzl = Arith.add(jzl, y.getJzl());
  3941 + zlc = Arith.add(zlc, y.getZlc());
  3942 + }
  3943 + }
3936 } 3944 }
3937 } 3945 }
3938 -  
3939 } 3946 }
3940 - }  
3941 -  
3942 - map.put("jzl", jzl);  
3943 - map.put("yh", yh);  
3944 - map.put("ccyl", ccyl);  
3945 - map.put("jcyl", jcyl);  
3946 - map.put("type", type);  
3947 - map.put("zlc", zlc);  
3948 - map.put("xlName", s.getXlName());  
3949 - map.put("clZbh", s.getClZbh());  
3950 - map.put("plate", BasicData.nbbmCompanyPlateMap.get(s.getClZbh()));  
3951 - map.put("fcsjActual", s.getFcsjActual());  
3952 - map.put("zdzName", s.getZdzName());  
3953 - map.put("scheduleDate", s.getScheduleDateStr());  
3954 - map.put("lpName", s.getLpName());  
3955 - String zdp = "", zwdp = "", wdp = "";  
3956 - String zdpT = "", zwdpT = "", wdpT = "";  
3957 - String dbdp="";  
3958 - List<DutyEmployee> list = dutyEmployeeService.getDutyEmployee(xlbm, fcrq + "00:01", fcrq + "23:59");  
3959 - try {  
3960 - Long fcsj1 = sdf.parse(fcrq + " 00:01").getTime();  
3961 - Long fcsj2 = sdf.parse(fcrq + " 11:00").getTime();  
3962 - Long fcsj3 = sdf.parse(fcrq + " 23:59").getTime();  
3963 - for (int i = 0; i < list.size(); i++) {  
3964 - DutyEmployee t = list.get(i);  
3965 - if(dbdp.indexOf(t.getuName()) == -1){  
3966 - if(!(dbdp.length()>0)){  
3967 - dbdp =t.getuName();  
3968 - }else{  
3969 - dbdp +=","+t.getuName();  
3970 - }  
3971 - }  
3972 - Long ts = t.getTs();  
3973 - if (ts > fcsj1 && ts < fcsj2) {  
3974 - if (zdp.indexOf(t.getuName()) == -1) {  
3975 - if (!(zdp.length() > 0)) {  
3976 - zdpT = t.getuName() + "...";  
3977 - }  
3978 - zdp += t.getuName() + ","; 3947 + }
3979 3948
3980 - }  
3981 - } else if (ts > fcsj2 && ts < fcsj3) {  
3982 - if (zwdp.indexOf(t.getuName()) == -1) {  
3983 - if (!(zwdp.length() > 0)) {  
3984 - zwdpT = t.getuName() + "...";  
3985 - }  
3986 - zwdp += t.getuName() + ",";  
3987 - }  
3988 - } else {  
3989 - if (wdp.indexOf(t.getuName()) == -1) {  
3990 - if (!(wdp.length() > 0)) {  
3991 - wdpT = t.getuName() + "...";  
3992 - }  
3993 - wdp += t.getuName() + ",";  
3994 - }  
3995 - }  
3996 - }  
3997 - } catch (ParseException e) {  
3998 - // TODO Auto-generated catch block  
3999 - e.printStackTrace();  
4000 - }  
4001 - map.put("zdp", zdp);  
4002 - map.put("zwdp", zwdp);  
4003 - map.put("wdp", wdp);  
4004 - map.put("zdpT", zdpT);  
4005 - map.put("zwdpT", zwdpT);  
4006 - map.put("wdpT", wdpT);  
4007 - map.put("dbdp", dbdp);  
4008 - return map;  
4009 - } 3949 + map.put("jzl", jzl);
  3950 + map.put("yh", yh);
  3951 + map.put("ccyl", ccyl);
  3952 + map.put("jcyl", jcyl);
  3953 + map.put("type", type);
  3954 + map.put("zlc", zlc);
  3955 + map.put("xlName", s.getXlName());
  3956 + map.put("clZbh", s.getClZbh());
  3957 + map.put("plate", BasicData.nbbmCompanyPlateMap.get(s.getClZbh()));
  3958 + map.put("fcsjActual", s.getFcsjActual());
  3959 + map.put("zdzName", s.getZdzName());
  3960 + map.put("scheduleDate", s.getScheduleDateStr());
  3961 + map.put("lpName", s.getLpName());
  3962 + String zdp = "", zwdp = "", wdp = "";
  3963 + String zdpT = "", zwdpT = "", wdpT = "";
  3964 + String dbdp = "";
  3965 + List<DutyEmployee> list = dutyEmployeeService.getDutyEmployee(xlbm, fcrq + "00:01", fcrq + "23:59");
  3966 + try {
  3967 + Long fcsj1 = sdf.parse(fcrq + " 00:01").getTime();
  3968 + Long fcsj2 = sdf.parse(fcrq + " 11:00").getTime();
  3969 + Long fcsj3 = sdf.parse(fcrq + " 23:59").getTime();
  3970 + for (int i = 0; i < list.size(); i++) {
  3971 + DutyEmployee t = list.get(i);
  3972 + if (dbdp.indexOf(t.getuName()) == -1) {
  3973 + if (!(dbdp.length() > 0)) {
  3974 + dbdp = t.getuName();
  3975 + } else {
  3976 + dbdp += "," + t.getuName();
  3977 + }
  3978 + }
  3979 + Long ts = t.getTs();
  3980 + if (ts > fcsj1 && ts < fcsj2) {
  3981 + if (zdp.indexOf(t.getuName()) == -1) {
  3982 + if (!(zdp.length() > 0)) {
  3983 + zdpT = t.getuName() + "...";
  3984 + }
  3985 + zdp += t.getuName() + ",";
  3986 +
  3987 + }
  3988 + } else if (ts > fcsj2 && ts < fcsj3) {
  3989 + if (zwdp.indexOf(t.getuName()) == -1) {
  3990 + if (!(zwdp.length() > 0)) {
  3991 + zwdpT = t.getuName() + "...";
  3992 + }
  3993 + zwdp += t.getuName() + ",";
  3994 + }
  3995 + } else {
  3996 + if (wdp.indexOf(t.getuName()) == -1) {
  3997 + if (!(wdp.length() > 0)) {
  3998 + wdpT = t.getuName() + "...";
  3999 + }
  4000 + wdp += t.getuName() + ",";
  4001 + }
  4002 + }
  4003 + }
  4004 + } catch (ParseException e) {
  4005 + // TODO Auto-generated catch block
  4006 + e.printStackTrace();
  4007 + }
  4008 + map.put("zdp", zdp);
  4009 + map.put("zwdp", zwdp);
  4010 + map.put("wdp", wdp);
  4011 + map.put("zdpT", zdpT);
  4012 + map.put("zwdpT", zwdpT);
  4013 + map.put("wdpT", wdpT);
  4014 + map.put("dbdp", dbdp);
  4015 + return map;
  4016 + }
4010 4017
4011 @Override 4018 @Override
4012 public Map<String, Object> MapByIdQp(Long id) { 4019 public Map<String, Object> MapByIdQp(Long id) {
@@ -4744,7 +4751,6 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -4744,7 +4751,6 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
4744 } 4751 }
4745 // file.mkdirs(); //创建 4752 // file.mkdirs(); //创建
4746 List<ScheduleRealInfo> lists_line=scheduleRealInfoRepository.scheduleByDateAndLineTjrb(line, date); 4753 List<ScheduleRealInfo> lists_line=scheduleRealInfoRepository.scheduleByDateAndLineTjrb(line, date);
4747 -  
4748 List<File> files = new ArrayList<File>(); 4754 List<File> files = new ArrayList<File>();
4749 for (List<String> list : lists){ 4755 for (List<String> list : lists){
4750 List<ScheduleRealInfo> newList=new ArrayList<ScheduleRealInfo>(); 4756 List<ScheduleRealInfo> newList=new ArrayList<ScheduleRealInfo>();
@@ -4770,7 +4776,6 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -4770,7 +4776,6 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
4770 } 4776 }
4771 File newFile = files.get(0); 4777 File newFile = files.get(0);
4772 newFile.renameTo(file); 4778 newFile.renameTo(file);
4773 -  
4774 // temp.renameTo(new File(path + fileName + "/" + temp.getName())); 4779 // temp.renameTo(new File(path + fileName + "/" + temp.getName()));
4775 // File[] listFiles = file.listFiles(); 4780 // File[] listFiles = file.listFiles();
4776 // ZipOutputStream zos = new ZipOutputStream(new BufferedOutputStream(new FileOutputStream(path + file.getName() + ".zip"))); 4781 // ZipOutputStream zos = new ZipOutputStream(new BufferedOutputStream(new FileOutputStream(path + file.getName() + ".zip")));
src/main/java/com/bsth/service/schedule/datatools/TTInfoDetailDataToolsImpl.java
@@ -378,119 +378,194 @@ public class TTInfoDetailDataToolsImpl implements DataToolsService, TTInfoDetail @@ -378,119 +378,194 @@ public class TTInfoDetailDataToolsImpl implements DataToolsService, TTInfoDetail
378 } 378 }
379 } 379 }
380 380
381 - @Override  
382 - public DataToolsFile exportDynamicTTinfo(DTInfos dtInfos) throws ScheduleException {  
383 - try {  
384 - // 使用POI,创建xlsx文件  
385 - XSSFWorkbook wb = new XSSFWorkbook();  
386 - XSSFSheet sheet = wb.createSheet(WorkbookUtil.createSafeSheetName("时刻表信息")); 381 + private void createDynamicTTinfoStatSheet(XSSFWorkbook wb, DTInfos dtInfos) {
  382 + XSSFSheet sheet = wb.createSheet(WorkbookUtil.createSafeSheetName("时刻表信息_统计"));
387 383
388 - //-------------------------------- 1、路牌班次数据 -------------------------------//  
389 - List<LpObj> lpObjList = dtInfos.getLpObjList(); 384 + //-------------------------------- 1、路牌班次数据 -------------------------------//
  385 + List<LpObj> lpObjList = dtInfos.getLpObjList();
390 386
391 - // 构建第一行数据  
392 - XSSFRow lpHeadRow = sheet.createRow((short) 0);  
393 - if (lpObjList.size() == 0) {  
394 - throw new RuntimeException("没有班次数据!");  
395 - }  
396 - int groupCount = lpObjList.get(0).getGroupCount(); // 获取总圈数  
397 - if (groupCount == 0) {  
398 - throw new RuntimeException("总圈数为0,有问题!");  
399 - } 387 + // 构建第一行数据
  388 + XSSFRow lpHeadRow = sheet.createRow((short) 0);
  389 + if (lpObjList.size() == 0) {
  390 + throw new RuntimeException("没有班次数据!");
  391 + }
  392 + int groupCount = lpObjList.get(0).getGroupCount(); // 获取总圈数
  393 + if (groupCount == 0) {
  394 + throw new RuntimeException("总圈数为0,有问题!");
  395 + }
400 396
401 - // 构造表头  
402 - PoiUtils.createStringXSSFCell(wb, lpHeadRow, (short)0, "路牌", new Color(0x96b9d7));  
403 - Station station1 = stationService.findById(lpObjList.get(0).getStationRouteId1());  
404 - Station station2 = stationService.findById(lpObjList.get(1).getStationRouteId2());  
405 - for (int i = 0; i < groupCount; i++) {  
406 - PoiUtils.createStringXSSFCell(wb, lpHeadRow, (short) (i * 2 + 1),  
407 - station1.getStationName(), new Color(0x96b9d7));  
408 - PoiUtils.createStringXSSFCell(wb, lpHeadRow, (short) (i * 2 + 2),  
409 - station2.getStationName(), new Color(0x96b9d7)); 397 + // 构造表头
  398 + PoiUtils.createStringXSSFCell(wb, lpHeadRow, (short)0, "路牌", new Color(0x96b9d7));
  399 + Station station1 = stationService.findById(lpObjList.get(0).getStationRouteId1());
  400 + Station station2 = stationService.findById(lpObjList.get(1).getStationRouteId2());
  401 + for (int i = 0; i < groupCount; i++) {
  402 + PoiUtils.createStringXSSFCell(wb, lpHeadRow, (short) (i * 2 + 1),
  403 + station1.getStationName(), new Color(0x96b9d7));
  404 + PoiUtils.createStringXSSFCell(wb, lpHeadRow, (short) (i * 2 + 2),
  405 + station2.getStationName(), new Color(0x96b9d7));
  406 + }
  407 + PoiUtils.createStringXSSFCell(wb, lpHeadRow, (short) (groupCount * 2 + 1),
  408 + "路牌工时", new Color(0x96b9d7));
  409 + PoiUtils.createStringXSSFCell(wb, lpHeadRow, (short) (groupCount * 2 + 2),
  410 + "营运班次数", new Color(0x96b9d7));
  411 +
  412 + // 构建每个路牌的班次数据
  413 + for (int i = 0; i < lpObjList.size(); i++) {
  414 + LpObj lpObj = lpObjList.get(i);
  415 + XSSFRow lpRow = sheet.createRow((short) (i + 1));
  416 + PoiUtils.createStringXSSFCell(wb, lpRow, (short) 0, lpObj.getLpname());
  417 + for (int j = 0; j < groupCount; j++) {
  418 + PoiUtils.createBlankXSSFCell(wb, lpRow, (short) (j * 2 + 1));
  419 + PoiUtils.createBlankXSSFCell(wb, lpRow, (short) (j * 2 + 2));
410 } 420 }
411 - PoiUtils.createStringXSSFCell(wb, lpHeadRow, (short) (groupCount * 2 + 1),  
412 - "路牌工时", new Color(0x96b9d7));  
413 - PoiUtils.createStringXSSFCell(wb, lpHeadRow, (short) (groupCount * 2 + 2),  
414 - "营运班次数", new Color(0x96b9d7));  
415 -  
416 - // 构建每个路牌的班次数据  
417 - for (int i = 0; i < lpObjList.size(); i++) {  
418 - LpObj lpObj = lpObjList.get(i);  
419 - XSSFRow lpRow = sheet.createRow((short) (i + 1));  
420 - PoiUtils.createStringXSSFCell(wb, lpRow, (short) 0, lpObj.getLpname());  
421 - for (int j = 0; j < groupCount; j++) {  
422 - PoiUtils.createBlankXSSFCell(wb, lpRow, (short) (j * 2 + 1));  
423 - PoiUtils.createBlankXSSFCell(wb, lpRow, (short) (j * 2 + 2));  
424 - }  
425 - for (BcObj bcObj : lpObj.getBcObjList()) { 421 + for (BcObj bcObj : lpObj.getBcObjList()) {
  422 + if (bcObj.getBcType() == BcType.NORMAL) {
426 Cell cell = lpRow.getCell((short) (bcObj.getGroupNo() * 2 + bcObj.getGroupBcNo() + 1)); 423 Cell cell = lpRow.getCell((short) (bcObj.getGroupNo() * 2 + bcObj.getGroupBcNo() + 1));
427 - cell.setCellValue(bcObj.getFcsj()); 424 + cell.setCellValue(bcObj.getFcsjDesc());
428 } 425 }
429 - // 路牌工时/班次数  
430 - PoiUtils.createDoubleXSSFCell(wb, lpRow, (short) (groupCount * 2 + 1),  
431 - lpObj.getZgs() / 60);  
432 - // 营运班次数  
433 - PoiUtils.createIntegerXSSFCell(wb, lpRow, (short) (groupCount * 2 + 2),  
434 - lpObj.getZbc());  
435 } 426 }
  427 + // 路牌工时/班次数
  428 + PoiUtils.createDoubleXSSFCell(wb, lpRow, (short) (groupCount * 2 + 1),
  429 + lpObj.getZgs() / 60);
  430 + // 营运班次数
  431 + PoiUtils.createIntegerXSSFCell(wb, lpRow, (short) (groupCount * 2 + 2),
  432 + lpObj.getZbc());
  433 + }
436 434
437 - // 自适应单元格长宽  
438 - sheet.autoSizeColumn(0);  
439 - for (int i = 0; i < groupCount; i++) {  
440 - sheet.autoSizeColumn(i * 2 + 1);  
441 - sheet.autoSizeColumn(i * 2 + 2);  
442 - }  
443 - sheet.autoSizeColumn(groupCount * 2 + 1);  
444 - sheet.autoSizeColumn(groupCount * 2 + 2); 435 + // 自适应单元格长宽
  436 + sheet.autoSizeColumn(0);
  437 + for (int i = 0; i < groupCount; i++) {
  438 + sheet.autoSizeColumn(i * 2 + 1);
  439 + sheet.autoSizeColumn(i * 2 + 2);
  440 + }
  441 + sheet.autoSizeColumn(groupCount * 2 + 1);
  442 + sheet.autoSizeColumn(groupCount * 2 + 2);
445 443
446 - // 锁定行首,列首  
447 - sheet.createFreezePane(1, 1); 444 + // 锁定行首,列首
  445 + sheet.createFreezePane(1, 1);
448 446
449 - //-------------------------------- 2、统计数据 -------------------------------//  
450 - List<StatInfo> statInfos = dtInfos.getStatInfoList(); 447 + //-------------------------------- 2、统计数据 -------------------------------//
  448 + List<StatInfo> statInfos = dtInfos.getStatInfoList();
451 449
452 - // 创建总的统计数据格式  
453 - // 第一行 统计数据  
454 - // 第二行 序号,统计项目(8个单元格合并),统计数值  
455 - // 第三行开始数据,一共20行 450 + // 创建总的统计数据格式
  451 + // 第一行 统计数据
  452 + // 第二行 序号,统计项目(8个单元格合并),统计数值
  453 + // 第三行开始数据,一共20行
456 454
457 - int startrow = lpObjList.size() + 3;  
458 - for (int i = startrow; i <= startrow + 22; i++) {  
459 - XSSFRow xssfRow = sheet.createRow(i);  
460 - for (int j = 0; j < 10; j++) {  
461 - PoiUtils.createStringXSSFCell(wb, xssfRow, (short) j, ""); 455 + int startrow = lpObjList.size() + 3;
  456 + for (int i = startrow; i <= startrow + 22; i++) {
  457 + XSSFRow xssfRow = sheet.createRow(i);
  458 + for (int j = 0; j < 10; j++) {
  459 + PoiUtils.createStringXSSFCell(wb, xssfRow, (short) j, "");
462 460
463 - }  
464 - }  
465 - // 合并第一行  
466 - sheet.addMergedRegion(new CellRangeAddress(startrow, startrow, 0, 9));  
467 - sheet.getRow(startrow).getCell(0).setCellValue("统计数据");  
468 - // 合并第二行  
469 - sheet.getRow(startrow + 1).getCell(0).setCellValue("序号");  
470 - sheet.getRow(startrow + 1).getCell(1).setCellValue("统计项目");  
471 - sheet.getRow(startrow + 1).getCell(9).setCellValue("统计数值");  
472 - sheet.addMergedRegion(new CellRangeAddress(startrow + 1, startrow + 1, 1, 8));  
473 - // 处理后面具体统计行  
474 - for (int row = startrow + 2; row <= startrow + 2 + statInfos.size(); row++) {  
475 - sheet.addMergedRegion(new CellRangeAddress(row, row, 1, 8));  
476 } 461 }
  462 + }
  463 + // 合并第一行
  464 + sheet.addMergedRegion(new CellRangeAddress(startrow, startrow, 0, 9));
  465 + sheet.getRow(startrow).getCell(0).setCellValue("统计数据");
  466 + // 合并第二行
  467 + sheet.getRow(startrow + 1).getCell(0).setCellValue("序号");
  468 + sheet.getRow(startrow + 1).getCell(1).setCellValue("统计项目");
  469 + sheet.getRow(startrow + 1).getCell(9).setCellValue("统计数值");
  470 + sheet.addMergedRegion(new CellRangeAddress(startrow + 1, startrow + 1, 1, 8));
  471 + // 处理后面具体统计行
  472 + for (int row = startrow + 2; row <= startrow + 2 + statInfos.size(); row++) {
  473 + sheet.addMergedRegion(new CellRangeAddress(row, row, 1, 8));
  474 + }
  475 +
  476 + for (int i = 0; i < statInfos.size(); i++) {
  477 + StatInfo statInfo = statInfos.get(i);
  478 +
  479 + // 1、统计序号
  480 + PoiUtils.setIntegerStyleXSSFCellStyle(wb, sheet.getRow(startrow + 2 + i).getCell(0));
  481 + sheet.getRow(startrow + 2 + i).getCell(0).setCellValue(i);
  482 +
  483 + // 2、统计项目
  484 + sheet.getRow(startrow + 2 + i).getCell(1).setCellValue(statInfo.getStatItem());
  485 +
  486 + // 3、统计数值
  487 + PoiUtils.setDoubleStyleXSSFCellStyle(wb, sheet.getRow(startrow + 2 + i).getCell(9));
  488 + sheet.getRow(startrow + 2 + i).getCell(9).setCellValue(statInfo.getStatValue());
  489 + }
  490 +
  491 + }
477 492
478 - for (int i = 0; i < statInfos.size(); i++) {  
479 - StatInfo statInfo = statInfos.get(i); 493 + private void createDynamicTTinfoSheet(XSSFWorkbook wb, DTInfos dtInfos) {
  494 + XSSFSheet sheet = wb.createSheet(WorkbookUtil.createSafeSheetName("时刻表信息"));
480 495
481 - // 1、统计序号  
482 - PoiUtils.setIntegerStyleXSSFCellStyle(wb, sheet.getRow(startrow + 2 + i).getCell(0));  
483 - sheet.getRow(startrow + 2 + i).getCell(0).setCellValue(i); 496 + //-------------------------------- 1、路牌班次数据 -------------------------------//
  497 + List<LpObj> lpObjList = dtInfos.getLpObjList();
  498 +
  499 + // 构建第一行数据
  500 + XSSFRow lpHeadRow = sheet.createRow((short) 0);
  501 + if (lpObjList.size() == 0) {
  502 + throw new RuntimeException("没有班次数据!");
  503 + }
  504 + int groupCount = lpObjList.get(0).getGroupCount(); // 获取总圈数
  505 + if (groupCount == 0) {
  506 + throw new RuntimeException("总圈数为0,有问题!");
  507 + }
484 508
485 - // 2、统计项目  
486 - sheet.getRow(startrow + 2 + i).getCell(1).setCellValue(statInfo.getStatItem()); 509 + // 构造表头,添加一个进场,添加一个出场
  510 + PoiUtils.createStringXSSFCell(wb, lpHeadRow, (short)0, "路牌", new Color(0x96b9d7));
  511 + Station station1 = stationService.findById(lpObjList.get(0).getStationRouteId1());
  512 + Station station2 = stationService.findById(lpObjList.get(1).getStationRouteId2());
  513 + PoiUtils.createStringXSSFCell(wb, lpHeadRow, (short) (1),
  514 + "出场", new Color(0x96b9d7));
  515 + for (int i = 1; i <= groupCount; i++) {
  516 + PoiUtils.createStringXSSFCell(wb, lpHeadRow, (short) (i * 2),
  517 + station1.getStationName(), new Color(0x96b9d7));
  518 + PoiUtils.createStringXSSFCell(wb, lpHeadRow, (short) (i * 2 + 1),
  519 + station2.getStationName(), new Color(0x96b9d7));
  520 + }
  521 + PoiUtils.createStringXSSFCell(wb, lpHeadRow, (short) (groupCount * 2 + 2),
  522 + "进场", new Color(0x96b9d7));
  523 +
  524 + // 构建每个路牌的班次数据
  525 + for (int i = 0; i < lpObjList.size(); i++) {
  526 + LpObj lpObj = lpObjList.get(i);
  527 + XSSFRow lpRow = sheet.createRow((short) (i + 1));
  528 + PoiUtils.createStringXSSFCell(wb, lpRow, (short) 0, lpObj.getLpname());
  529 + PoiUtils.createBlankXSSFCell(wb, lpRow, (short) (1));
  530 + for (int j = 1; j <= groupCount; j++) {
  531 + PoiUtils.createBlankXSSFCell(wb, lpRow, (short) (j * 2));
  532 + PoiUtils.createBlankXSSFCell(wb, lpRow, (short) (j * 2 + 1));
  533 + }
  534 + PoiUtils.createBlankXSSFCell(wb, lpRow, (short) (groupCount * 2 + 2));
487 535
488 - // 3、统计数值  
489 - PoiUtils.setDoubleStyleXSSFCellStyle(wb, sheet.getRow(startrow + 2 + i).getCell(9));  
490 - sheet.getRow(startrow + 2 + i).getCell(9).setCellValue(statInfo.getStatValue()); 536 + for (BcObj bcObj : lpObj.getBcObjList()) {
  537 + if (bcObj.getBcType() == BcType.NORMAL) {
  538 + Cell cell = lpRow.getCell((short) (bcObj.getGroupNo() * 2 + bcObj.getGroupBcNo() + 2));
  539 + cell.setCellValue(bcObj.getFcsj());
  540 + } else if (bcObj.getBcType() == BcType.OUT) {
  541 + Cell cell = lpRow.getCell((short) (1));
  542 + cell.setCellValue(bcObj.getFcsj());
  543 + } else if (bcObj.getBcType() == BcType.IN) {
  544 + Cell cell = lpRow.getCell((short) (groupCount * 2 + 2));
  545 + cell.setCellValue(bcObj.getFcsj());
  546 + }
491 } 547 }
  548 + }
  549 +
  550 + // 自适应单元格长宽
  551 + sheet.autoSizeColumn(0);
  552 + sheet.autoSizeColumn(1);
  553 + for (int i = 1; i <= groupCount; i++) {
  554 + sheet.autoSizeColumn(i * 2);
  555 + sheet.autoSizeColumn(i * 2 + 1);
  556 + }
  557 +
  558 + }
  559 +
  560 + @Override
  561 + public DataToolsFile exportDynamicTTinfo(DTInfos dtInfos) throws ScheduleException {
  562 + try {
  563 + // 使用POI,创建xlsx文件
  564 + XSSFWorkbook wb = new XSSFWorkbook();
  565 + this.createDynamicTTinfoSheet(wb, dtInfos);
  566 + this.createDynamicTTinfoStatSheet(wb, dtInfos);
492 567
493 - // 最后内存写入文件 568 + // wb内存写入文件
494 String filepath = dataToolsProperties.getFileoutputDir() + 569 String filepath = dataToolsProperties.getFileoutputDir() +
495 File.separator + 570 File.separator +
496 "动态时刻表-" + 571 "动态时刻表-" +
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 - /** 第几圈(从1开始) */  
63 - private Integer groupNo;  
64 - /** 圈里第几个班次(1或者2) */  
65 - private Integer groupBcNo;  
66 -  
67 - public Integer getBcsj() {  
68 - return bcsj;  
69 - }  
70 -  
71 - public void setBcsj(Integer bcsj) {  
72 - this.bcsj = bcsj;  
73 - }  
74 -  
75 - public Integer getSsj() {  
76 - return ssj;  
77 - }  
78 -  
79 - public void setSsj(Integer ssj) {  
80 - this.ssj = ssj;  
81 - }  
82 -  
83 - public Integer getEatsj() {  
84 - return eatsj;  
85 - }  
86 -  
87 - public void setEatsj(Integer eatsj) {  
88 - this.eatsj = eatsj;  
89 - }  
90 -  
91 - public Integer getTccid() {  
92 - return tccid;  
93 - }  
94 -  
95 - public void setTccid(Integer tccid) {  
96 - this.tccid = tccid;  
97 - }  
98 -  
99 - public Integer getQdzid() {  
100 - return qdzid;  
101 - }  
102 -  
103 - public void setQdzid(Integer qdzid) {  
104 - this.qdzid = qdzid;  
105 - }  
106 -  
107 - public Integer getZdzid() {  
108 - return zdzid;  
109 - }  
110 -  
111 - public void setZdzid(Integer zdzid) {  
112 - this.zdzid = zdzid;  
113 - }  
114 -  
115 - public BcType getBcType() {  
116 - return bcType;  
117 - }  
118 -  
119 - public void setBcType(BcType bcType) {  
120 - this.bcType = bcType;  
121 - }  
122 -  
123 - public String getFcsj() {  
124 - return fcsj;  
125 - }  
126 -  
127 - public void setFcsj(String fcsj) {  
128 - this.fcsj = fcsj;  
129 - }  
130 -  
131 - public Boolean getIsUp() {  
132 - return isUp;  
133 - }  
134 -  
135 - public void setIsUp(Boolean isUp) {  
136 - this.isUp = isUp;  
137 - }  
138 -  
139 - public Integer getGroupNo() {  
140 - return groupNo;  
141 - }  
142 -  
143 - public void setGroupNo(Integer groupNo) {  
144 - this.groupNo = groupNo;  
145 - }  
146 -  
147 - public Integer getGroupBcNo() {  
148 - return groupBcNo;  
149 - }  
150 -  
151 - public void setGroupBcNo(Integer groupBcNo) {  
152 - this.groupBcNo = groupBcNo;  
153 - }  
154 - }  
155 -  
156 - public static class LpObj { // 路牌对象  
157 - /** 路牌名字 */  
158 - private String lpname;  
159 - /** 每圈的第一个班次是否上行 */  
160 - private Boolean isUp;  
161 -  
162 - /** 第一个班次起点站路由id */  
163 - private Integer stationRouteId1;  
164 - /** 第二个班次起点站路由id */  
165 - private Integer stationRouteId2;  
166 -  
167 - /** 班次列表 */  
168 - private List<BcObj> bcObjList;  
169 - /** 总圈数 */  
170 - private Integer groupCount;  
171 -  
172 - /** 总工时 */  
173 - private Double zgs;  
174 - /** 总班次 */  
175 - private Integer zbc;  
176 -  
177 -  
178 - public String getLpname() {  
179 - return lpname;  
180 - }  
181 -  
182 - public void setLpname(String lpname) {  
183 - this.lpname = lpname;  
184 - }  
185 -  
186 - public Boolean getIsUp() {  
187 - return isUp;  
188 - }  
189 -  
190 - public void setIsUp(Boolean isUp) {  
191 - this.isUp = isUp;  
192 - }  
193 -  
194 - public List<BcObj> getBcObjList() {  
195 - return bcObjList;  
196 - }  
197 -  
198 - public void setBcObjList(List<BcObj> bcObjList) {  
199 - this.bcObjList = bcObjList;  
200 - }  
201 -  
202 - public Integer getGroupCount() {  
203 - return groupCount;  
204 - }  
205 -  
206 - public void setGroupCount(Integer groupCount) {  
207 - this.groupCount = groupCount;  
208 - }  
209 -  
210 - public Double getZgs() {  
211 - return zgs;  
212 - }  
213 -  
214 - public void setZgs(Double zgs) {  
215 - this.zgs = zgs;  
216 - }  
217 -  
218 - public Integer getZbc() {  
219 - return zbc;  
220 - }  
221 -  
222 - public void setZbc(Integer zbc) {  
223 - this.zbc = zbc;  
224 - }  
225 -  
226 - public Integer getStationRouteId1() {  
227 - return stationRouteId1;  
228 - }  
229 -  
230 - public void setStationRouteId1(Integer stationRouteId1) {  
231 - this.stationRouteId1 = stationRouteId1;  
232 - }  
233 -  
234 - public Integer getStationRouteId2() {  
235 - return stationRouteId2;  
236 - }  
237 -  
238 - public void setStationRouteId2(Integer stationRouteId2) {  
239 - this.stationRouteId2 = stationRouteId2;  
240 - }  
241 - }  
242 -  
243 - public static class StatInfo { // 统计数据对象  
244 - /** 统计项目 */  
245 - private String statItem;  
246 - /** 统计值 */  
247 - private Double statValue;  
248 -  
249 - public String getStatItem() {  
250 - return statItem;  
251 - }  
252 -  
253 - public void setStatItem(String statItem) {  
254 - this.statItem = statItem;  
255 - }  
256 -  
257 - public Double getStatValue() {  
258 - return statValue;  
259 - }  
260 -  
261 - public void setStatValue(Double statValue) {  
262 - this.statValue = statValue;  
263 - }  
264 - }  
265 -  
266 - public static class DTInfos { // 所有数据信息  
267 - /** 路牌班次数据列表 */  
268 - private List<LpObj> lpObjList;  
269 - /** 统计数据列表 */  
270 - private List<StatInfo> statInfoList;  
271 -  
272 - public List<LpObj> getLpObjList() {  
273 - return lpObjList;  
274 - }  
275 -  
276 - public void setLpObjList(List<LpObj> lpObjList) {  
277 - this.lpObjList = lpObjList;  
278 - }  
279 -  
280 - public List<StatInfo> getStatInfoList() {  
281 - return statInfoList;  
282 - }  
283 -  
284 - public void setStatInfoList(List<StatInfo> statInfoList) {  
285 - this.statInfoList = statInfoList;  
286 - }  
287 - }  
288 -  
289 - //---------------------- 生成时刻表用对象(以上) ---------------------//  
290 -  
291 - /**  
292 - * 导出动态时刻表数据。  
293 - * @param dtInfos  
294 - * @return  
295 - * @throws ScheduleException  
296 - */  
297 - public DataToolsFile exportDynamicTTinfo(DTInfos dtInfos) throws ScheduleException;  
298 -} 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 +}
src/main/java/com/bsth/service/schedule/impl/PeopleCarPlanServiceImpl.java
@@ -1746,7 +1746,8 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { @@ -1746,7 +1746,8 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
1746 tempMap.put("line", xlName); 1746 tempMap.put("line", xlName);
1747 tempMap.put("jhbc", jhbc); 1747 tempMap.put("jhbc", jhbc);
1748 tempMap.put("sjbc", sjbc); 1748 tempMap.put("sjbc", sjbc);
1749 - tempMap.put("zdl", nf.format((float) sjbc / jhbc *100) + "%"); 1749 + tempMap.put("zdl", (jhbc<1?"0":nf.format((float) sjbc / jhbc *100)) + "%");
  1750 +
1750 resList.add(tempMap); 1751 resList.add(tempMap);
1751 } 1752 }
1752 1753
@@ -1760,7 +1761,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { @@ -1760,7 +1761,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
1760 } 1761 }
1761 tempMap.put("jhbc", jhbc); 1762 tempMap.put("jhbc", jhbc);
1762 tempMap.put("sjbc", sjbc); 1763 tempMap.put("sjbc", sjbc);
1763 - tempMap.put("zdl", nf.format((float) sjbc / jhbc * 100) + "%"); 1764 + tempMap.put("zdl", (jhbc<1?"0":nf.format((float) sjbc / jhbc * 100)) + "%");
1764 for(Map<String, Object> m : mapList){ 1765 for(Map<String, Object> m : mapList){
1765 m.put("no", ++i); 1766 m.put("no", ++i);
1766 m.put("company", companyName); 1767 m.put("company", companyName);
src/main/java/com/bsth/util/ClosestPoint.java 0 → 100644
  1 +package com.bsth.util;
  2 +
  3 +import java.util.ArrayList;
  4 +import java.util.HashMap;
  5 +import java.util.List;
  6 +import java.util.Map;
  7 +import com.bsth.util.TransGPS.Location;
  8 +
  9 +public class ClosestPoint {
  10 +
  11 + public static Location getVerticalPoint(Location loc1, Location loc2, Location loc3) {
  12 + // 第一步:求得直线方程相关参数y=kx+b | kx-y+b=0
  13 + double k = (loc1.getLat() - loc2.getLat()) * 1.0 / (loc1.getLng() - loc2.getLng());// 坐标直线斜率k
  14 + double b = loc1.getLat() - k * loc1.getLng();// 坐标直线b
  15 + // 第一种: 设直线方程为ax+by+c=0,点坐标为(m,n)
  16 + // 则垂足为((b*b*m-a*b*n-a*c)/(a*a+b*b),(a*a*n-a*b*m-b*c)/(a*a+b*b))
  17 + Location loc4 = TransGPS.LocationMake(((-1) * (-1) * loc3.getLng() - k * (-1) * loc3.getLat() - k * b) / (k * k + (-1) * (-1)),
  18 + (k * k * loc3.getLat() - k * (-1) * loc3.getLng() - (-1) * b) / (k * k + (-1) * (-1)));
  19 + return loc4;
  20 + }
  21 +
  22 + // 获取两点间距离
  23 + static double GetPointDistance(Location p1, Location p2) {
  24 + return Math.sqrt((p1.getLng() - p2.getLng()) * (p1.getLng() - p2.getLng()) + (p1.getLat() - p2.getLat()) * (p1.getLat() - p2.getLat()));
  25 + }
  26 +
  27 + // 求点到线段距离的最近点
  28 + static Map<Double, List<Location>> GetNearestDistance(Location PA, Location PB, Location P3) {
  29 + Map<Double, List<Location>> point = new HashMap<>();
  30 + List<Location> locations = new ArrayList<>();
  31 + locations.add(PA);
  32 + locations.add(PB);
  33 + // 点在线段上
  34 + double a, b, c;
  35 + a = GetPointDistance(PB, P3);
  36 + if (a <= 0.000000001) {
  37 + locations.add(P3);
  38 + point.put(a, locations);
  39 + return point;
  40 + }
  41 + b = GetPointDistance(PA, P3);
  42 + if (b <= 0.000000001) {
  43 + locations.add(P3);
  44 + point.put(b, locations);
  45 + return point;
  46 + }
  47 + c = GetPointDistance(PA, PB);
  48 + if (c <= 0.000000001) {
  49 + locations.add(PA);
  50 + point.put(b, locations);// 如果PA和PB坐标相同,则退出函数,并返回距离
  51 + return point;
  52 + }
  53 + // 点和线段组成钝角三角形
  54 + if (a * a >= b * b + c * c) {
  55 + locations.add(PA);
  56 + point.put(b, locations);
  57 + return point;// 如果是钝角返回b
  58 + }
  59 + if (b * b >= a * a + c * c) {
  60 + locations.add(PB);
  61 + point.put(a, locations);// 如果是钝角返回a
  62 + return point;
  63 + }
  64 +
  65 + // 点和线段组成锐角三角形
  66 + double l = (a + b + c) / 2; // 周长的一半
  67 + double s = Math.sqrt(l * (l - a) * (l - b) * (l - c)); // 海伦公式求面积,也可以用矢量求
  68 + Location location = getVerticalPoint(PA, PB, P3);
  69 + locations.add(location);
  70 + point.put(2 * s / c, locations);
  71 + return point;
  72 + }
  73 +}
src/main/java/com/bsth/util/HttpClientUtils.java 0 → 100644
  1 +package com.bsth.util;
  2 +
  3 +import org.apache.http.HttpEntity;
  4 +import org.apache.http.client.config.RequestConfig;
  5 +import org.apache.http.client.methods.CloseableHttpResponse;
  6 +import org.apache.http.client.methods.HttpGet;
  7 +import org.apache.http.client.methods.HttpPost;
  8 +import org.apache.http.entity.StringEntity;
  9 +import org.apache.http.impl.client.CloseableHttpClient;
  10 +import org.apache.http.impl.client.HttpClients;
  11 +import org.slf4j.Logger;
  12 +import org.slf4j.LoggerFactory;
  13 +
  14 +import java.io.BufferedReader;
  15 +import java.io.IOException;
  16 +import java.io.InputStreamReader;
  17 +
  18 +/**
  19 + * Created by panzhao on 2017/8/2.
  20 + */
  21 +public class HttpClientUtils {
  22 +
  23 + static Logger logger = LoggerFactory.getLogger(HttpClientUtils.class);
  24 + public static StringBuilder get(String url) throws Exception {
  25 +
  26 + CloseableHttpClient httpClient = null;
  27 + CloseableHttpResponse response = null;
  28 + StringBuilder stringBuffer = null;
  29 + try {
  30 + httpClient = HttpClients.createDefault();
  31 + HttpGet get = new HttpGet(url);
  32 + //超时时间
  33 + RequestConfig requestConfig = RequestConfig.custom()
  34 + .setConnectTimeout(10500).setConnectionRequestTimeout(7000)
  35 + .setSocketTimeout(10500).build();
  36 + get.setConfig(requestConfig);
  37 + get.addHeader("Content-Encoding", "gzip");
  38 + response = httpClient.execute(get);
  39 + stringBuffer = getResult(response.getEntity());
  40 + } catch (Exception e) {
  41 + logger.error("", e);
  42 + } finally {
  43 + if (null != httpClient)
  44 + httpClient.close();
  45 + if (null != response)
  46 + response.close();
  47 + }
  48 + return stringBuffer;
  49 + }
  50 +
  51 + /**
  52 + * raw post data
  53 + * @param url
  54 + * @param data
  55 + * @return
  56 + */
  57 + public static StringBuilder post(String url, String data) throws Exception {
  58 + CloseableHttpClient httpClient = null;
  59 + CloseableHttpResponse response = null;
  60 + StringBuilder stringBuffer = null;
  61 + try {
  62 + httpClient = HttpClients.createDefault();
  63 + HttpPost post = new HttpPost(url);
  64 +
  65 + post.setHeader("Accept", "application/json");
  66 + post.setHeader("Content-Type", "application/json");
  67 + //超时时间
  68 + RequestConfig requestConfig = RequestConfig.custom()
  69 + .setConnectTimeout(2500).setConnectionRequestTimeout(2000)
  70 + .setSocketTimeout(3500).build();
  71 + post.setConfig(requestConfig);
  72 + post.setEntity((new StringEntity(data, "UTF-8")));
  73 +
  74 + response = httpClient.execute(post);
  75 + stringBuffer = getResult(response.getEntity());
  76 + } catch (Exception e) {
  77 + logger.error("", e);
  78 + } finally {
  79 + if (null != httpClient)
  80 + httpClient.close();
  81 + if (null != response)
  82 + response.close();
  83 + }
  84 + return stringBuffer;
  85 + }
  86 +
  87 + private static StringBuilder getResult(HttpEntity entity) throws IOException {
  88 + StringBuilder stringBuffer = null;
  89 + if (null != entity) {
  90 + BufferedReader br = new BufferedReader(new InputStreamReader(entity.getContent()));
  91 + stringBuffer = new StringBuilder();
  92 + String str = "";
  93 + while ((str = br.readLine()) != null)
  94 + stringBuffer.append(str);
  95 + }
  96 + return stringBuffer;
  97 + }
  98 +}
src/main/java/com/bsth/util/RoadCutDoubleName.java 0 → 100644
  1 +package com.bsth.util;
  2 +
  3 +import com.alibaba.fastjson.JSON;
  4 +import com.alibaba.fastjson.JSONArray;
  5 +import com.alibaba.fastjson.JSONObject;
  6 +import com.bsth.entity.LonLatName;
  7 +import com.bsth.util.TransGPS.Location;
  8 +import com.bsth.util.TransGPS;
  9 +
  10 +import java.net.URLEncoder;
  11 +import java.util.*;
  12 +
  13 +public class RoadCutDoubleName {
  14 +
  15 + // 存放获取交点的经纬度,路段名字
  16 + static ArrayList<LonLatName> al = new ArrayList<LonLatName>();
  17 +
  18 + public static Map<String, Object> start(String sectionStr) throws Exception {
  19 +
  20 + al.clear();
  21 + // 存放过滤后返还会来的list集合
  22 + ArrayList dl = new ArrayList();
  23 +
  24 + String fy = URLEncoder.encode("|", "utf-8");
  25 + String lL = baiduToGoogle(sectionStr);
  26 + String[] lonLat = lL.split(";");
  27 +
  28 + int number = 0;
  29 + if (lonLat.length % 20 == 0) {
  30 + number = lonLat.length / 20;
  31 + } else {
  32 + number = lonLat.length / 20 + 1;
  33 + }
  34 + int middle = 0;
  35 + int max = 20;
  36 + if (lonLat.length >= 20) {
  37 + for (int NOT = 1; NOT <= number; NOT++) {
  38 + String Ol = "";
  39 + if (NOT < number) {
  40 + for (int min = middle; min < max; min++) {
  41 + if (min < max - 1) {
  42 + Ol += lonLat[min] + fy;
  43 + } else {
  44 + Ol += lonLat[min];
  45 + }
  46 + }
  47 + dl = getData(Ol,al);
  48 + middle = max;
  49 + max += 20;
  50 + } else {
  51 + for (int min = middle; min < lonLat.length; min++) {
  52 + if (min < lonLat.length - 1) {
  53 + Ol += lonLat[min] + fy;
  54 + } else {
  55 + Ol += lonLat[min];
  56 + }
  57 + }
  58 + dl = getData(Ol,al);
  59 + }
  60 + }
  61 + } else {
  62 + String Ol = "";
  63 + for (int min = middle; min < lonLat.length; min++) {
  64 + if (min < lonLat.length - 1) {
  65 + Ol += lonLat[min] + fy;
  66 + } else {
  67 + Ol += lonLat[min];
  68 + }
  69 + }
  70 + dl = getData(Ol,al);
  71 + }
  72 + // 将原有的经纬度数组转换为list集合
  73 + ArrayList<Location> el = new ArrayList<>();
  74 + for (int j = 0; j < lonLat.length; j++) {
  75 + String lon[] = lonLat[j].split(",");
  76 + Location point = new Location();
  77 + point.setLng(Double.valueOf(lon[0]));
  78 + point.setLat(Double.valueOf(lon[1]));
  79 + el.add(point);
  80 + }
  81 + ArrayList<Location> gl = new ArrayList<>();
  82 + for (int k = 0; k < dl.size(); k += 4) {
  83 + Location point = new Location();
  84 + String object = (String) dl.get(k);
  85 + String[] split = object.split(",");
  86 + point.setLng(Double.valueOf(split[0]));
  87 + point.setLat(Double.valueOf(split[1]));
  88 + gl.add(point);
  89 + }
  90 + // 将做过处理的百度坐标与过滤后的交点坐标存入,传给垂足获取方法
  91 + ArrayList fl = new ArrayList();
  92 + // 路的坐标点
  93 + fl.add(0, el);
  94 + // 路的交点
  95 + fl.add(1, gl);
  96 + List returnData = returnData(fl);
  97 + ArrayList<Location> pointList = new ArrayList<>();
  98 + for (int x = 0; x < returnData.size(); x++) {
  99 + List<Location> aList = new ArrayList<>();
  100 + aList = (List<Location>) returnData.get(x);
  101 + for (int z = 0; z < aList.size(); z++) {
  102 + Location point = new Location();
  103 + Location location = aList.get(z);
  104 + point.setLng(location.getLng());
  105 + point.setLat(location.getLat());
  106 + pointList.add(point);
  107 + }
  108 + }
  109 + /*
  110 + * 垂足返还的数据中每三条为一个交点,第一经纬度为前,第二为后,第三为原交点的垂足
  111 + * 下面循环会将返还的数据按前经纬度与返还数据的第一经纬度相匹配 将返还数据的第三个经纬度按顺序插入进去
  112 + */
  113 + // lonLat:转换为高德的坐标点数组
  114 + for (int t = 0; t < pointList.size(); t += 3) {
  115 + Location pl = (Location) pointList.get(t);
  116 + Location newPl = (Location) pointList.get(t + 1);
  117 + // 判断切点是否添加成功
  118 + boolean type = false;
  119 + // pointList:包含前后垂足的集合,每三个一个轮回
  120 + for (int o = 0; o < el.size() - 1; o++) {
  121 + Location location1 = el.get(o);
  122 + Location location2 = el.get(o + 1);
  123 + if (location1.getLng() == pl.getLng() && location1.getLat() == pl.getLat()
  124 + && location2.getLng() == newPl.getLng() && location2.getLat() == newPl.getLat()) {
  125 + if (o < el.size() - 1) {
  126 + // el:存放原始坐标Location对象的集合
  127 + el.add(o + 1, (Location) pointList.get(t + 2));
  128 + type = true;
  129 + break;
  130 + } else {
  131 + el.add(o, (Location) pointList.get(t + 2));
  132 + type = true;
  133 + break;
  134 + }
  135 + }
  136 + }
  137 + // 防止在同一线段下的两个切点会只添加一个
  138 + if (!type) {
  139 + for (int o = 0; o < el.size(); o++) {
  140 + Location location = el.get(o);
  141 + if (location.getLng() == newPl.getLng() && location.getLat() == newPl.getLat()) {
  142 + el.add(o, (Location) pointList.get(t + 2));
  143 + type = true;
  144 + break;
  145 + }
  146 + }
  147 + }
  148 + }
  149 + // 通过返还的垂足数据,将原有的中间点给替换掉
  150 + int w = 0;
  151 + for (int q = 2; q < pointList.size(); q += 3) {
  152 + Location pL = (Location) pointList.get(q);
  153 + dl.set(w, pL.getLng() + "," + pL.getLat());
  154 + w += 4;
  155 + }
  156 + // 对替换后的location进行路名拼接,十个点则应拼接出九个路段路名
  157 + // 若location获取的路名不符合规则,则返还“(-)”
  158 + int maxOne = 2;
  159 + int maxTwo = 6;
  160 + int minOne = 1;
  161 + int minTwo = 5;
  162 + String theMainRoad = "";
  163 + String theFirstRoad = "";
  164 + String theSecondRoad = "";
  165 + List<String> roadName = new ArrayList<>();
  166 + for (int d = maxTwo; d < dl.size();) {
  167 + boolean buff = false;
  168 + // 若两段路名中含有相同的路名,则此路名作为主路名
  169 + for (int h = minOne; h <= maxOne; h++) {
  170 + for (int f = minTwo; f <= maxTwo; f++) {
  171 + if (dl.get(h).equals(dl.get(f))) {
  172 + theMainRoad = dl.get(h).toString();
  173 + buff = true;
  174 + break;
  175 + } else {
  176 + theMainRoad = "";
  177 + }
  178 + }
  179 + if (buff) {
  180 + break;
  181 + }
  182 + }
  183 + // 获取主路名后,将主路名不为空的进行拼接
  184 + // 规则为:两段路名的firstName和secondName不与主路名相同
  185 + // 存入roadName列表且按数序包含无法进行拼接的路名返回值为“(-)”
  186 + for (int h = minOne; h <= maxOne; h++) {
  187 + for (int f = minTwo; f <= maxTwo; f++) {
  188 + if (!theMainRoad.equals("")) {
  189 + if (!dl.get(h).equals(theMainRoad)) {
  190 + theFirstRoad = dl.get(h).toString();
  191 + if (!dl.get(f).equals(theMainRoad)) {
  192 + theSecondRoad = dl.get(f).toString();
  193 + }
  194 + }
  195 + } else {
  196 + theFirstRoad = "";
  197 + theSecondRoad = "";
  198 + }
  199 + }
  200 + }
  201 + minOne += 4;
  202 + minTwo += 4;
  203 + maxOne += 4;
  204 + maxTwo += 4;
  205 + d = maxTwo;
  206 + roadName.add(theMainRoad + "(" + theFirstRoad + "-" + theSecondRoad + ")");
  207 + }
  208 + // 将所有经纬度列表进行重复过滤
  209 + for (int i = 0; i < el.size() - 1; i++) {
  210 + Location location = el.get(i);
  211 + for (int j = i + 1; j < el.size(); j++) {
  212 + Location location2 = el.get(j);
  213 + if (location.getLng() == location2.getLng() && location.getLat() == location2.getLat()) {
  214 + el.remove(j);
  215 + break;
  216 + }
  217 + }
  218 + }
  219 + // 用来区分此线路的开始是否等于location的第一个点
  220 + boolean buff = false;
  221 + //将路名roadName与路段roadNumber添加进theFrontDesk返还给前台
  222 + Map<String, Object> theFrontDesk = new HashMap<>();
  223 + // 若坐标组的第一个坐标与交点的第一个不相同,就说明实际规划出的线路条数+1
  224 + // 此方法的作用就是用来避免线路名称与线路不对称
  225 + if(dl.size() != 0) {
  226 + String firstLocation = (String) dl.get(0);
  227 + String[] firstLocationSplit = firstLocation.split(",");
  228 + Location firstOfAll = el.get(0);
  229 + if (firstOfAll.getLng() != Double.valueOf(firstLocationSplit[0])
  230 + && firstOfAll.getLat() != Double.valueOf(firstLocationSplit[1])) {
  231 + roadName.add(0, "(-)");
  232 + buff = true;
  233 + }
  234 + String lastLocation = (String) dl.get(dl.size() - 4);
  235 + String[] lastLocationSplit = lastLocation.split(",");
  236 + Location lastOfAll = el.get(el.size() - 1);
  237 + if (lastOfAll.getLng() != Double.valueOf(lastLocationSplit[0])
  238 + && lastOfAll.getLat() != Double.valueOf(lastLocationSplit[1])) {
  239 + roadName.add(roadName.size(), "(-)");
  240 + }
  241 + //切分路段,有两种情况,路段的第一个经纬度既是切点,则从第二个点开始计算
  242 + //路段的前几个点是多余的点 则将其保留,并且上面的方法就是用来防止第一个路段路名错误
  243 + List roadNumber = new ArrayList();
  244 + if (buff) {
  245 + int logo = 0;
  246 + for (int j = 0; j < dl.size(); j += 4) {
  247 + List wayNumber = new ArrayList();
  248 + String object = (String) dl.get(j);
  249 + String[] split = object.split(",");
  250 + for (int i = logo; i < el.size(); i++) {
  251 + Location location = el.get(i);
  252 + wayNumber.add(el.get(i));
  253 + if (location.getLng() == Double.valueOf(split[0])
  254 + && location.getLat() == Double.valueOf(split[1])) {
  255 + logo = i;
  256 + roadNumber.add(wayNumber);
  257 + break;
  258 + }
  259 + if(i == el.size()-1){
  260 + logo = i;
  261 + roadNumber.add(wayNumber);
  262 + }
  263 + }
  264 + }
  265 + }else{
  266 + int logo = 0;
  267 + for (int j = 4; j < dl.size(); j += 4) {
  268 + List wayNumber = new ArrayList();
  269 + String object = (String) dl.get(j);
  270 + String[] split = object.split(",");
  271 + for (int i = logo; i < el.size(); i++) {
  272 + Location location = el.get(i);
  273 + wayNumber.add(el.get(i));
  274 + if (location.getLng() == Double.valueOf(split[0])
  275 + && location.getLat() == Double.valueOf(split[1])) {
  276 + logo = i;
  277 + roadNumber.add(wayNumber);
  278 + break;
  279 + }
  280 + if(i == el.size()-1){
  281 + logo = i;
  282 + roadNumber.add(wayNumber);
  283 + }
  284 + }
  285 + }
  286 + }
  287 + List bSections = googleToBaidu(roadNumber);
  288 + //将路名roadName与路段roadNumber添加进theFrontDesk返还给前台
  289 +// List theFrontDesk = new ArrayList();
  290 + theFrontDesk.put("roadName",roadName);
  291 + theFrontDesk.put("bSections",bSections);
  292 + for(int i =0;i<bSections.size();i++){
  293 + List<Location> rn = new ArrayList<>();
  294 + rn = (List<Location>) bSections.get(i);
  295 + System.out.println("第"+(i+1)+"条路");
  296 + System.out.println(roadName.get(i));
  297 + for(int j=0;j<rn.size();j++){
  298 + Location object = (Location) rn.get(j);
  299 + System.out.println(object.getLng()+" "+object.getLat()+";");
  300 + }
  301 + }
  302 + }
  303 +
  304 + return theFrontDesk;
  305 + }
  306 +
  307 + public static ArrayList<LonLatName> getData(String Ol,ArrayList<LonLatName> al) throws Exception {
  308 + // 将去重后的list列表添加进来
  309 + ArrayList cl = new ArrayList();
  310 + StringBuilder sb = HttpClientUtils.get("http://restapi.amap.com/v3/geocode/regeo?output=json&location=" + Ol
  311 + + "&key=ae7b43460cab274a8702b55640f9a5a7&radius=0&extensions=all&batch=true&roadlevel=1");
  312 + JSONObject jsonarr = JSON.parseObject(sb.toString());
  313 + JSONArray regeocodes = jsonarr.getJSONArray("regeocodes");
  314 +
  315 + for (int a = 0; a < regeocodes.size(); a++) {
  316 + LonLatName lln = new LonLatName();
  317 + JSONObject json = (JSONObject) regeocodes.get(a);
  318 + JSONArray roadinters = json.getJSONArray("roadinters");
  319 + JSONArray roads = json.getJSONArray("roads");
  320 + JSONObject jsonObject = roadinters.getJSONObject(0);
  321 + JSONObject roadsObject = roads.getJSONObject(0);
  322 + lln.setFirst_name(jsonObject.getString("first_name"));
  323 + lln.setSecond_name(jsonObject.getString("second_name"));
  324 + lln.setLocation(jsonObject.getString("location"));
  325 + lln.setWay_name(roadsObject.getString("name"));
  326 + al.add(lln);
  327 + }
  328 + int a = 0;
  329 + for (int b = 1; b < al.size(); b++) {
  330 + if (al.get(b).getWay_name().equals(al.get(b).getFirst_name())
  331 + || al.get(b).getWay_name().equals(al.get(b).getSecond_name())) {
  332 + if (b == 1) {
  333 + cl.add(al.get(a).getLocation());
  334 + cl.add(al.get(a).getFirst_name());
  335 + cl.add(al.get(a).getSecond_name());
  336 + cl.add(al.get(a).getWay_name());
  337 + }
  338 + if (!al.get(a).getLocation().equals(al.get(b).getLocation())) {
  339 +
  340 + cl.add(al.get(b).getLocation());
  341 + cl.add(al.get(b).getFirst_name());
  342 + cl.add(al.get(b).getSecond_name());
  343 + cl.add(al.get(b).getWay_name());
  344 + a = b;
  345 + }
  346 + }
  347 + }
  348 + return cl;
  349 + }
  350 +
  351 + // 处理所有的切点(用每个切点去匹配到整条路段上最近的点)
  352 + public static List returnData(ArrayList twoList) {
  353 +// List<Location> aList = new ArrayList<>();
  354 +// List<Location> wip = new ArrayList<>();
  355 + // 路的坐标点
  356 + List<Location> aList = (List<Location>) twoList.get(0);
  357 + // 路的交点
  358 + List<Location> wip = (List<Location>) twoList.get(1);
  359 + List<List<Location>> list = new ArrayList<>();
  360 + for (int j = 0; j < wip.size(); j++) {
  361 + Map<Double, List<Location>> points = new HashMap<>();
  362 + for (int i = 1; i < aList.size(); i++) {
  363 + // 获取最近点为切点
  364 + points.putAll(ClosestPoint.GetNearestDistance(aList.get(i - 1), aList.get(i), wip.get(j)));
  365 + }
  366 + // points 为返回的所有切点的集合
  367 + Object[] obj = points.keySet().toArray();
  368 + Arrays.sort(obj);
  369 + list.add(j,points.get(obj[0]));
  370 + }
  371 + return list;
  372 + }
  373 +
  374 + // 百度坐标解密位高德
  375 + public static String baiduToGoogle(String sectionStr) {
  376 + String gdLL="";
  377 +// String lL = "121.531301,31.211823;121.532438,31.213784;121.532438,31.213784;121.535025,31.213764;121.535095,31.213765;121.535702,31.213757;121.536388,31.21375;121.537383,31.213699;121.53802,31.213711;121.538408,31.213709;121.538478,31.21371;121.538955,31.213699;121.540289,31.213714;121.540826,31.213724;121.541543,31.213718;121.542867,31.213552;121.542976,31.213534;121.543245,31.213489;121.544787,31.213256;121.546102,31.213059;121.546221,31.213041;121.546898,31.212892;121.547445,31.212691;121.547724,31.212566;121.54855,31.212099;121.549466,31.211432;121.550113,31.210802;121.550402,31.210576;121.551437,31.20911;121.551486,31.209031;121.551795,31.208585;121.552282,31.207861;121.552641,31.207316;121.5528,31.207088;121.552959,31.20685;121.553009,31.20678;121.553357,31.206235;121.553626,31.205898;121.553696,31.205939;121.553696,31.205936;121.554105,31.206171;121.555941,31.207121;121.555941,31.207121;121.556021,31.207202;121.556719,31.207589;121.557458,31.208006;121.557538,31.208116;121.557538,31.208116;121.558047,31.208401;121.559076,31.208909;121.559625,31.209182;121.559865,31.209304;121.560744,31.209599;121.560904,31.20966;121.562362,31.209967;121.563621,31.210132;121.563951,31.210132;121.56675,31.210135;121.569371,31.210191;121.570593,31.210377;121.573087,31.211114;121.573437,31.211241;121.57461,31.211763;121.577197,31.21297;121.577458,31.213077;121.577458,31.213077;121.57805,31.213351;121.57805,31.213351;121.58085,31.214638;121.58097,31.214686;121.58097,31.214686;121.583581,31.21581;121.584605,31.216194;121.584967,31.216339;121.585961,31.216703;121.586393,31.216806;121.587398,31.217059;121.588342,31.217293;121.588744,31.217386;121.58998,31.217694;121.590814,31.217889;121.590915,31.217918;121.591548,31.218056;121.591648,31.218084;121.593065,31.218388;121.593517,31.21854;121.59393,31.218762;121.594704,31.219287;121.596986,31.220814;121.59766,31.221212;121.598001,31.221375;121.600474,31.222169;121.600544,31.222198;121.600574,31.222207;121.600685,31.222245;121.603348,31.223057;121.605639,31.223607;121.605638,31.223607;121.605648,31.223537;121.605698,31.222176;121.605787,31.221004;121.606055,31.216939;121.606324,31.213734;121.606373,31.212813;121.606522,31.21086;121.606611,31.210048;121.606621,31.209968;121.606772,31.209986;121.606772,31.209985;121.608479,31.210248;121.60864,31.210265;121.60864,31.210265;121.60871,31.210014";
  378 + System.out.println(sectionStr);
  379 + String lonLat[] = sectionStr.split(";");
  380 + for (int a = 0; a < lonLat.length; a++) {
  381 + String[] split = lonLat[a].split(",");
  382 + Location locationMake = TransGPS.LocationMake(Double.valueOf(split[0]), Double.valueOf(split[1]));
  383 + Location gd_decrypt = TransGPS.bd_decrypt(locationMake);
  384 + if (a < lonLat.length - 1) {
  385 + gdLL += gd_decrypt.getLng() + "," + gd_decrypt.getLat() + ";";
  386 + } else {
  387 + gdLL += gd_decrypt.getLng() + "," + gd_decrypt.getLat();
  388 + }
  389 +
  390 + }
  391 +
  392 + return gdLL;
  393 + }
  394 +
  395 + // 高德坐标加密位百度
  396 + public static List googleToBaidu(List list) {
  397 + List roadNumber = new ArrayList();
  398 + for(int i =0;i<list.size();i++){
  399 + String lL = "";
  400 + List wayNumber = new ArrayList();
  401 + List<Location> rn = new ArrayList<>();
  402 + rn = (List<Location>) list.get(i);
  403 + for(int j=0;j<rn.size();j++){
  404 + Location object = (Location) rn.get(j);
  405 + if(j<rn.size()-1){
  406 + lL += object.getLng()+","+object.getLat()+";";
  407 + }else{
  408 + lL += object.getLng()+","+object.getLat();
  409 + }
  410 + }
  411 + String lonLat[] = lL.split(";");
  412 + for (int a = 0; a < lonLat.length; a++) {
  413 + String[] split = lonLat[a].split(",");
  414 + Location locationMake = TransGPS.LocationMake(Double.valueOf(split[0]), Double.valueOf(split[1]));
  415 + Location bd_encrypt = TransGPS.bd_encrypt(locationMake);
  416 + wayNumber.add(bd_encrypt);
  417 + }
  418 + roadNumber.add(wayNumber);
  419 + }
  420 +
  421 + return roadNumber;
  422 + }
  423 +}
0 \ No newline at end of file 424 \ No newline at end of file
src/main/resources/datatools/ktrs/ttinfodetailDataOutputMetaData.ktr
1 -<?xml version="1.0" encoding="UTF-8"?>  
2 -<transformation>  
3 - <info>  
4 - <name>&#x65f6;&#x523b;&#x8868;&#x660e;&#x7ec6;&#x5bfc;&#x51fa;&#x5143;&#x6570;&#x636e;</name>  
5 - <description/>  
6 - <extended_description/>  
7 - <trans_version/>  
8 - <trans_type>Normal</trans_type>  
9 - <trans_status>0</trans_status>  
10 - <directory>&#x2f;</directory>  
11 - <parameters>  
12 - <parameter>  
13 - <name>filepath</name>  
14 - <default_value>&#x2f;Users&#x2f;xu&#x2f;resource&#x2f;project_code&#x2f;runtime_temp&#x2f;bsth_control_u_d_files&#x2f;ttinfodetail_test.xls</default_value>  
15 - <description>&#x65f6;&#x523b;&#x8868;excel&#x5bfc;&#x51fa;&#x6587;&#x4ef6;&#x8def;&#x5f84;&#x540d;</description>  
16 - </parameter>  
17 - <parameter>  
18 - <name>injectktrfile</name>  
19 - <default_value>&#x2f;Users&#x2f;xu&#x2f;resource&#x2f;project_code&#x2f;bsth_project&#x2f;bsth_control_parent&#x2f;bsth_control&#x2f;src&#x2f;main&#x2f;resources&#x2f;datatools&#x2f;ktrs&#x2f;ttinfodetailDataOutput.ktr</default_value>  
20 - <description>&#x6ce8;&#x5165;&#x5143;&#x6570;&#x636e;&#x7684;ktr&#x6587;&#x4ef6;</description>  
21 - </parameter>  
22 - <parameter>  
23 - <name>ttinfoid</name>  
24 - <default_value>56</default_value>  
25 - <description>&#x65f6;&#x523b;&#x8868;id</description>  
26 - </parameter>  
27 - </parameters>  
28 - <log>  
29 -<trans-log-table><connection/>  
30 -<schema/>  
31 -<table/>  
32 -<size_limit_lines/>  
33 -<interval/>  
34 -<timeout_days/>  
35 -<field><id>ID_BATCH</id><enabled>Y</enabled><name>ID_BATCH</name></field><field><id>CHANNEL_ID</id><enabled>Y</enabled><name>CHANNEL_ID</name></field><field><id>TRANSNAME</id><enabled>Y</enabled><name>TRANSNAME</name></field><field><id>STATUS</id><enabled>Y</enabled><name>STATUS</name></field><field><id>LINES_READ</id><enabled>Y</enabled><name>LINES_READ</name><subject/></field><field><id>LINES_WRITTEN</id><enabled>Y</enabled><name>LINES_WRITTEN</name><subject/></field><field><id>LINES_UPDATED</id><enabled>Y</enabled><name>LINES_UPDATED</name><subject/></field><field><id>LINES_INPUT</id><enabled>Y</enabled><name>LINES_INPUT</name><subject/></field><field><id>LINES_OUTPUT</id><enabled>Y</enabled><name>LINES_OUTPUT</name><subject/></field><field><id>LINES_REJECTED</id><enabled>Y</enabled><name>LINES_REJECTED</name><subject/></field><field><id>ERRORS</id><enabled>Y</enabled><name>ERRORS</name></field><field><id>STARTDATE</id><enabled>Y</enabled><name>STARTDATE</name></field><field><id>ENDDATE</id><enabled>Y</enabled><name>ENDDATE</name></field><field><id>LOGDATE</id><enabled>Y</enabled><name>LOGDATE</name></field><field><id>DEPDATE</id><enabled>Y</enabled><name>DEPDATE</name></field><field><id>REPLAYDATE</id><enabled>Y</enabled><name>REPLAYDATE</name></field><field><id>LOG_FIELD</id><enabled>Y</enabled><name>LOG_FIELD</name></field><field><id>EXECUTING_SERVER</id><enabled>N</enabled><name>EXECUTING_SERVER</name></field><field><id>EXECUTING_USER</id><enabled>N</enabled><name>EXECUTING_USER</name></field><field><id>CLIENT</id><enabled>N</enabled><name>CLIENT</name></field></trans-log-table>  
36 -<perf-log-table><connection/>  
37 -<schema/>  
38 -<table/>  
39 -<interval/>  
40 -<timeout_days/>  
41 -<field><id>ID_BATCH</id><enabled>Y</enabled><name>ID_BATCH</name></field><field><id>SEQ_NR</id><enabled>Y</enabled><name>SEQ_NR</name></field><field><id>LOGDATE</id><enabled>Y</enabled><name>LOGDATE</name></field><field><id>TRANSNAME</id><enabled>Y</enabled><name>TRANSNAME</name></field><field><id>STEPNAME</id><enabled>Y</enabled><name>STEPNAME</name></field><field><id>STEP_COPY</id><enabled>Y</enabled><name>STEP_COPY</name></field><field><id>LINES_READ</id><enabled>Y</enabled><name>LINES_READ</name></field><field><id>LINES_WRITTEN</id><enabled>Y</enabled><name>LINES_WRITTEN</name></field><field><id>LINES_UPDATED</id><enabled>Y</enabled><name>LINES_UPDATED</name></field><field><id>LINES_INPUT</id><enabled>Y</enabled><name>LINES_INPUT</name></field><field><id>LINES_OUTPUT</id><enabled>Y</enabled><name>LINES_OUTPUT</name></field><field><id>LINES_REJECTED</id><enabled>Y</enabled><name>LINES_REJECTED</name></field><field><id>ERRORS</id><enabled>Y</enabled><name>ERRORS</name></field><field><id>INPUT_BUFFER_ROWS</id><enabled>Y</enabled><name>INPUT_BUFFER_ROWS</name></field><field><id>OUTPUT_BUFFER_ROWS</id><enabled>Y</enabled><name>OUTPUT_BUFFER_ROWS</name></field></perf-log-table>  
42 -<channel-log-table><connection/>  
43 -<schema/>  
44 -<table/>  
45 -<timeout_days/>  
46 -<field><id>ID_BATCH</id><enabled>Y</enabled><name>ID_BATCH</name></field><field><id>CHANNEL_ID</id><enabled>Y</enabled><name>CHANNEL_ID</name></field><field><id>LOG_DATE</id><enabled>Y</enabled><name>LOG_DATE</name></field><field><id>LOGGING_OBJECT_TYPE</id><enabled>Y</enabled><name>LOGGING_OBJECT_TYPE</name></field><field><id>OBJECT_NAME</id><enabled>Y</enabled><name>OBJECT_NAME</name></field><field><id>OBJECT_COPY</id><enabled>Y</enabled><name>OBJECT_COPY</name></field><field><id>REPOSITORY_DIRECTORY</id><enabled>Y</enabled><name>REPOSITORY_DIRECTORY</name></field><field><id>FILENAME</id><enabled>Y</enabled><name>FILENAME</name></field><field><id>OBJECT_ID</id><enabled>Y</enabled><name>OBJECT_ID</name></field><field><id>OBJECT_REVISION</id><enabled>Y</enabled><name>OBJECT_REVISION</name></field><field><id>PARENT_CHANNEL_ID</id><enabled>Y</enabled><name>PARENT_CHANNEL_ID</name></field><field><id>ROOT_CHANNEL_ID</id><enabled>Y</enabled><name>ROOT_CHANNEL_ID</name></field></channel-log-table>  
47 -<step-log-table><connection/>  
48 -<schema/>  
49 -<table/>  
50 -<timeout_days/>  
51 -<field><id>ID_BATCH</id><enabled>Y</enabled><name>ID_BATCH</name></field><field><id>CHANNEL_ID</id><enabled>Y</enabled><name>CHANNEL_ID</name></field><field><id>LOG_DATE</id><enabled>Y</enabled><name>LOG_DATE</name></field><field><id>TRANSNAME</id><enabled>Y</enabled><name>TRANSNAME</name></field><field><id>STEPNAME</id><enabled>Y</enabled><name>STEPNAME</name></field><field><id>STEP_COPY</id><enabled>Y</enabled><name>STEP_COPY</name></field><field><id>LINES_READ</id><enabled>Y</enabled><name>LINES_READ</name></field><field><id>LINES_WRITTEN</id><enabled>Y</enabled><name>LINES_WRITTEN</name></field><field><id>LINES_UPDATED</id><enabled>Y</enabled><name>LINES_UPDATED</name></field><field><id>LINES_INPUT</id><enabled>Y</enabled><name>LINES_INPUT</name></field><field><id>LINES_OUTPUT</id><enabled>Y</enabled><name>LINES_OUTPUT</name></field><field><id>LINES_REJECTED</id><enabled>Y</enabled><name>LINES_REJECTED</name></field><field><id>ERRORS</id><enabled>Y</enabled><name>ERRORS</name></field><field><id>LOG_FIELD</id><enabled>N</enabled><name>LOG_FIELD</name></field></step-log-table>  
52 -<metrics-log-table><connection/>  
53 -<schema/>  
54 -<table/>  
55 -<timeout_days/>  
56 -<field><id>ID_BATCH</id><enabled>Y</enabled><name>ID_BATCH</name></field><field><id>CHANNEL_ID</id><enabled>Y</enabled><name>CHANNEL_ID</name></field><field><id>LOG_DATE</id><enabled>Y</enabled><name>LOG_DATE</name></field><field><id>METRICS_DATE</id><enabled>Y</enabled><name>METRICS_DATE</name></field><field><id>METRICS_CODE</id><enabled>Y</enabled><name>METRICS_CODE</name></field><field><id>METRICS_DESCRIPTION</id><enabled>Y</enabled><name>METRICS_DESCRIPTION</name></field><field><id>METRICS_SUBJECT</id><enabled>Y</enabled><name>METRICS_SUBJECT</name></field><field><id>METRICS_TYPE</id><enabled>Y</enabled><name>METRICS_TYPE</name></field><field><id>METRICS_VALUE</id><enabled>Y</enabled><name>METRICS_VALUE</name></field></metrics-log-table>  
57 - </log>  
58 - <maxdate>  
59 - <connection/>  
60 - <table/>  
61 - <field/>  
62 - <offset>0.0</offset>  
63 - <maxdiff>0.0</maxdiff>  
64 - </maxdate>  
65 - <size_rowset>10000</size_rowset>  
66 - <sleep_time_empty>50</sleep_time_empty>  
67 - <sleep_time_full>50</sleep_time_full>  
68 - <unique_connections>N</unique_connections>  
69 - <feedback_shown>Y</feedback_shown>  
70 - <feedback_size>50000</feedback_size>  
71 - <using_thread_priorities>Y</using_thread_priorities>  
72 - <shared_objects_file/>  
73 - <capture_step_performance>N</capture_step_performance>  
74 - <step_performance_capturing_delay>1000</step_performance_capturing_delay>  
75 - <step_performance_capturing_size_limit>100</step_performance_capturing_size_limit>  
76 - <dependencies>  
77 - </dependencies>  
78 - <partitionschemas>  
79 - </partitionschemas>  
80 - <slaveservers>  
81 - </slaveservers>  
82 - <clusterschemas>  
83 - </clusterschemas>  
84 - <created_user>-</created_user>  
85 - <created_date>2016&#x2f;11&#x2f;15 15&#x3a;02&#x3a;41.624</created_date>  
86 - <modified_user>-</modified_user>  
87 - <modified_date>2016&#x2f;11&#x2f;15 15&#x3a;02&#x3a;41.624</modified_date>  
88 - <key_for_session_key>H4sIAAAAAAAAAAMAAAAAAAAAAAA&#x3d;</key_for_session_key>  
89 - <is_key_private>N</is_key_private>  
90 - </info>  
91 - <notepads>  
92 - <notepad>  
93 - <note>TODO&#xff1a;&#x5982;&#x679c;groupby &#x52a0;&#x5165;bctype&#xff0c;&#xa;&#x5219;&#x4ee5;&#x53d1;&#x8f66;&#x987a;&#x5e8f;&#x53f7;&#xff0c;&#x73ed;&#x6b21;&#x7c7b;&#x578b;&#x5206;&#x7ec4;&#x7684;&#x6570;&#x636e;&#x53ef;&#x80fd;&#x91cd;&#x590d;&#xff0c;&#xa;&#x5e94;&#x4e3a;&#x73ed;&#x6b21;&#x7c7b;&#x578b;&#x53ef;&#x80fd;&#x4e0d;&#x4e00;&#x6837;&#xff08;&#x5bfc;&#x5165;&#x4e4b;&#x540e;&#x4eba;&#x4e3a;&#x4fee;&#x6539;&#x7684;&#xff0c;&#x5982;&#x6b63;&#x5e38;&#x73ed;&#x6b21;&#x6539;&#x6210;&#x533a;&#x95f4;&#xff09;&#xff0c;&#xa;&#x56e0;&#x4e3a;&#x5bfc;&#x51fa;&#x65f6;&#x5fc5;&#x987b;&#x6570;&#x636e;&#x4e0d;&#x91cd;&#x590d;&#xff0c;&#x8fd9;&#x91cc;&#x7684;&#x89e3;&#x51b3;&#x65b9;&#x6cd5;&#xff0c;&#x53ea;&#x4f7f;&#x7528;&#x53d1;&#x8f66;&#x987a;&#x5e8f;&#x53f7;&#x5206;&#x7ec4;&#xff0c;&#xa;&#x4ee5;&#x540e;&#x5efa;&#x8bae;&#xff0c;&#x8fd8;&#x662f;&#x539f;&#x6765;&#x7684;&#x65b9;&#x5f0f;&#x5206;&#x7ec4;&#xff0c;&#x7136;&#x540e;&#x628a;&#x66f4;&#x65b0;&#x65f6;&#x95f4;&#x665a;&#x7684;&#x53bb;&#x9664;&#xa;&#xa;&#x4ee5;&#x540e;&#x6539;&#x6210;&#x53bb;&#x9664;&#x91cd;&#x590d;&#x7eaa;&#x5f55;</note>  
94 - <xloc>178</xloc>  
95 - <yloc>547</yloc>  
96 - <width>406</width>  
97 - <heigth>122</heigth>  
98 - <fontname>YaHei Consolas Hybrid</fontname>  
99 - <fontsize>12</fontsize>  
100 - <fontbold>N</fontbold>  
101 - <fontitalic>N</fontitalic>  
102 - <fontcolorred>0</fontcolorred>  
103 - <fontcolorgreen>0</fontcolorgreen>  
104 - <fontcolorblue>0</fontcolorblue>  
105 - <backgroundcolorred>255</backgroundcolorred>  
106 - <backgroundcolorgreen>205</backgroundcolorgreen>  
107 - <backgroundcolorblue>112</backgroundcolorblue>  
108 - <bordercolorred>100</bordercolorred>  
109 - <bordercolorgreen>100</bordercolorgreen>  
110 - <bordercolorblue>100</bordercolorblue>  
111 - <drawshadow>Y</drawshadow>  
112 - </notepad>  
113 - </notepads>  
114 - <connection>  
115 - <name>192.168.168.1_jwgl_dw</name>  
116 - <server>192.168.168.1</server>  
117 - <type>ORACLE</type>  
118 - <access>Native</access>  
119 - <database>orcl</database>  
120 - <port>1521</port>  
121 - <username>jwgl_dw</username>  
122 - <password>Encrypted 2be98afc86aa7f2e4cb13b977d2adabcd</password>  
123 - <servername/>  
124 - <data_tablespace/>  
125 - <index_tablespace/>  
126 - <attributes>  
127 - <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>  
128 - <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>  
129 - <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>  
130 - <attribute><code>PORT_NUMBER</code><attribute>1521</attribute></attribute>  
131 - <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute>  
132 - <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>  
133 - <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute>  
134 - <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute>  
135 - <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>  
136 - </attributes>  
137 - </connection>  
138 - <connection>  
139 - <name>bus_control_variable</name>  
140 - <server>&#x24;&#x7b;v_db_ip&#x7d;</server>  
141 - <type>MYSQL</type>  
142 - <access>Native</access>  
143 - <database>&#x24;&#x7b;v_db_dname&#x7d;</database>  
144 - <port>3306</port>  
145 - <username>&#x24;&#x7b;v_db_uname&#x7d;</username>  
146 - <password>&#x24;&#x7b;v_db_pwd&#x7d;</password>  
147 - <servername/>  
148 - <data_tablespace/>  
149 - <index_tablespace/>  
150 - <attributes>  
151 - <attribute><code>EXTRA_OPTION_MYSQL.characterEncoding</code><attribute>utf8</attribute></attribute>  
152 - <attribute><code>EXTRA_OPTION_MYSQL.defaultFetchSize</code><attribute>500</attribute></attribute>  
153 - <attribute><code>EXTRA_OPTION_MYSQL.useCursorFetch</code><attribute>true</attribute></attribute>  
154 - <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>  
155 - <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>  
156 - <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>  
157 - <attribute><code>PORT_NUMBER</code><attribute>3306</attribute></attribute>  
158 - <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute>  
159 - <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>  
160 - <attribute><code>STREAM_RESULTS</code><attribute>N</attribute></attribute>  
161 - <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute>  
162 - <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute>  
163 - <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>  
164 - </attributes>  
165 - </connection>  
166 - <connection>  
167 - <name>bus_control_&#x516c;&#x53f8;_201</name>  
168 - <server>localhost</server>  
169 - <type>MYSQL</type>  
170 - <access>Native</access>  
171 - <database>control</database>  
172 - <port>3306</port>  
173 - <username>root</username>  
174 - <password>Encrypted </password>  
175 - <servername/>  
176 - <data_tablespace/>  
177 - <index_tablespace/>  
178 - <attributes>  
179 - <attribute><code>EXTRA_OPTION_MYSQL.defaultFetchSize</code><attribute>500</attribute></attribute>  
180 - <attribute><code>EXTRA_OPTION_MYSQL.useCursorFetch</code><attribute>true</attribute></attribute>  
181 - <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>  
182 - <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>  
183 - <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>  
184 - <attribute><code>PORT_NUMBER</code><attribute>3306</attribute></attribute>  
185 - <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute>  
186 - <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>  
187 - <attribute><code>STREAM_RESULTS</code><attribute>N</attribute></attribute>  
188 - <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute>  
189 - <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute>  
190 - <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>  
191 - </attributes>  
192 - </connection>  
193 - <connection>  
194 - <name>bus_control_&#x672c;&#x673a;</name>  
195 - <server>localhost</server>  
196 - <type>MYSQL</type>  
197 - <access>Native</access>  
198 - <database>control</database>  
199 - <port>3306</port>  
200 - <username>root</username>  
201 - <password>Encrypted </password>  
202 - <servername/>  
203 - <data_tablespace/>  
204 - <index_tablespace/>  
205 - <attributes>  
206 - <attribute><code>EXTRA_OPTION_MYSQL.defaultFetchSize</code><attribute>500</attribute></attribute>  
207 - <attribute><code>EXTRA_OPTION_MYSQL.useCursorFetch</code><attribute>true</attribute></attribute>  
208 - <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>  
209 - <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>  
210 - <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>  
211 - <attribute><code>PORT_NUMBER</code><attribute>3306</attribute></attribute>  
212 - <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute>  
213 - <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>  
214 - <attribute><code>STREAM_RESULTS</code><attribute>Y</attribute></attribute>  
215 - <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute>  
216 - <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute>  
217 - <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>  
218 - </attributes>  
219 - </connection>  
220 - <connection>  
221 - <name>xlab_mysql_youle</name>  
222 - <server>101.231.124.8</server>  
223 - <type>MYSQL</type>  
224 - <access>Native</access>  
225 - <database>xlab_youle</database>  
226 - <port>45687</port>  
227 - <username>xlab-youle</username>  
228 - <password>Encrypted 2be98afc86aa78a88aa1be369d187a3df</password>  
229 - <servername/>  
230 - <data_tablespace/>  
231 - <index_tablespace/>  
232 - <attributes>  
233 - <attribute><code>EXTRA_OPTION_MYSQL.defaultFetchSize</code><attribute>500</attribute></attribute>  
234 - <attribute><code>EXTRA_OPTION_MYSQL.useCursorFetch</code><attribute>true</attribute></attribute>  
235 - <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>  
236 - <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>  
237 - <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>  
238 - <attribute><code>PORT_NUMBER</code><attribute>45687</attribute></attribute>  
239 - <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute>  
240 - <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>  
241 - <attribute><code>STREAM_RESULTS</code><attribute>Y</attribute></attribute>  
242 - <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>N</attribute></attribute>  
243 - <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>N</attribute></attribute>  
244 - <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>  
245 - </attributes>  
246 - </connection>  
247 - <connection>  
248 - <name>xlab_mysql_youle&#xff08;&#x672c;&#x673a;&#xff09;</name>  
249 - <server>localhost</server>  
250 - <type>MYSQL</type>  
251 - <access>Native</access>  
252 - <database>xlab_youle</database>  
253 - <port>3306</port>  
254 - <username>root</username>  
255 - <password>Encrypted </password>  
256 - <servername/>  
257 - <data_tablespace/>  
258 - <index_tablespace/>  
259 - <attributes>  
260 - <attribute><code>EXTRA_OPTION_MYSQL.defaultFetchSize</code><attribute>500</attribute></attribute>  
261 - <attribute><code>EXTRA_OPTION_MYSQL.useCursorFetch</code><attribute>true</attribute></attribute>  
262 - <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>  
263 - <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>  
264 - <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>  
265 - <attribute><code>PORT_NUMBER</code><attribute>3306</attribute></attribute>  
266 - <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute>  
267 - <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>  
268 - <attribute><code>STREAM_RESULTS</code><attribute>Y</attribute></attribute>  
269 - <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>N</attribute></attribute>  
270 - <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>N</attribute></attribute>  
271 - <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>  
272 - </attributes>  
273 - </connection>  
274 - <connection>  
275 - <name>xlab_youle</name>  
276 - <server/>  
277 - <type>MYSQL</type>  
278 - <access>JNDI</access>  
279 - <database>xlab_youle</database>  
280 - <port>1521</port>  
281 - <username/>  
282 - <password>Encrypted </password>  
283 - <servername/>  
284 - <data_tablespace/>  
285 - <index_tablespace/>  
286 - <attributes>  
287 - <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>  
288 - <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>  
289 - <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>  
290 - <attribute><code>PORT_NUMBER</code><attribute>1521</attribute></attribute>  
291 - <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute>  
292 - <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>  
293 - <attribute><code>STREAM_RESULTS</code><attribute>Y</attribute></attribute>  
294 - <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute>  
295 - <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute>  
296 - <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>  
297 - </attributes>  
298 - </connection>  
299 - <order>  
300 - <hop> <from>&#x65f6;&#x523b;&#x8868;&#x660e;&#x7ec6;&#x5206;&#x7ec4;&#x6570;&#x636e;</from><to>&#x8fc7;&#x6ee4;&#x8bb0;&#x5f55;</to><enabled>Y</enabled> </hop>  
301 - <hop> <from>&#x8fc7;&#x6ee4;&#x8bb0;&#x5f55;</from><to>&#x8ba1;&#x7b97;&#x7ad9;&#x70b9;</to><enabled>Y</enabled> </hop>  
302 - <hop> <from>&#x8ba1;&#x7b97;excel&#x8f93;&#x51fa;&#x5b57;&#x6bb5;</from><to>&#x5b57;&#x6bb5;&#x9009;&#x62e9;</to><enabled>Y</enabled> </hop>  
303 - <hop> <from>&#x5b57;&#x6bb5;&#x9009;&#x62e9;</from><to>&#x6392;&#x5e8f;&#x8bb0;&#x5f55;</to><enabled>Y</enabled> </hop>  
304 - <hop> <from>&#x751f;&#x6210;&#x8def;&#x724c;&#x5b57;&#x6bb5;</from><to>&#x6392;&#x5e8f;&#x8bb0;&#x5f55;</to><enabled>Y</enabled> </hop>  
305 - <hop> <from>&#x8ba1;&#x7b97;&#x53cd;&#x8303;&#x5f0f;&#x5143;&#x6570;&#x636e;</from><to>ETL&#x5143;&#x6570;&#x636e;&#x6ce8;&#x5165;</to><enabled>Y</enabled> </hop>  
306 - <hop> <from>&#x6392;&#x5e8f;&#x8bb0;&#x5f55;</from><to>ETL&#x5143;&#x6570;&#x636e;&#x6ce8;&#x5165;</to><enabled>Y</enabled> </hop>  
307 - <hop> <from>&#x8ba1;&#x7b97;&#x7ad9;&#x70b9;</from><to>&#x67e5;&#x627e;&#x8d77;&#x70b9;&#x7ad9;</to><enabled>Y</enabled> </hop>  
308 - <hop> <from>&#x67e5;&#x627e;&#x8d77;&#x70b9;&#x7ad9;</from><to>&#x8ba1;&#x7b97;&#x53cd;&#x8303;&#x5f0f;&#x5143;&#x6570;&#x636e;</to><enabled>Y</enabled> </hop>  
309 - <hop> <from>&#x67e5;&#x627e;&#x8d77;&#x70b9;&#x7ad9;</from><to>&#x8ba1;&#x7b97;excel&#x8f93;&#x51fa;&#x5b57;&#x6bb5;</to><enabled>Y</enabled> </hop>  
310 - </order>  
311 - <step>  
312 - <name>ETL&#x5143;&#x6570;&#x636e;&#x6ce8;&#x5165;</name>  
313 - <type>MetaInject</type>  
314 - <description/>  
315 - <distribute>Y</distribute>  
316 - <custom_distribution/>  
317 - <copies>1</copies>  
318 - <partitioning>  
319 - <method>none</method>  
320 - <schema_name/>  
321 - </partitioning>  
322 - <specification_method>filename</specification_method>  
323 - <trans_object_id/>  
324 - <trans_name/>  
325 - <filename>&#x24;&#x7b;injectktrfile&#x7d;</filename>  
326 - <directory_path/>  
327 - <source_step/>  
328 - <source_output_fields> </source_output_fields> <target_file/>  
329 - <no_execution>N</no_execution>  
330 - <stream_source_step/>  
331 - <stream_target_step/>  
332 - <mappings> <mapping> <target_step_name>&#x5217;&#x8f6c;&#x884c;</target_step_name>  
333 - <target_attribute_key>TARGET_TYPE</target_attribute_key>  
334 - <target_detail>Y</target_detail>  
335 - <source_step>&#x8ba1;&#x7b97;&#x53cd;&#x8303;&#x5f0f;&#x5143;&#x6570;&#x636e;</source_step>  
336 - <source_field>targettype</source_field>  
337 - </mapping> <mapping> <target_step_name>Excel&#x8f93;&#x51fa;</target_step_name>  
338 - <target_attribute_key>TYPE</target_attribute_key>  
339 - <target_detail>Y</target_detail>  
340 - <source_step>&#x6392;&#x5e8f;&#x8bb0;&#x5f55;</source_step>  
341 - <source_field>fieldtype</source_field>  
342 - </mapping> <mapping> <target_step_name>&#x5217;&#x8f6c;&#x884c;</target_step_name>  
343 - <target_attribute_key>NAME</target_attribute_key>  
344 - <target_detail>Y</target_detail>  
345 - <source_step>&#x8ba1;&#x7b97;&#x53cd;&#x8303;&#x5f0f;&#x5143;&#x6570;&#x636e;</source_step>  
346 - <source_field>valuefieldname</source_field>  
347 - </mapping> <mapping> <target_step_name>Excel&#x8f93;&#x51fa;</target_step_name>  
348 - <target_attribute_key>NAME</target_attribute_key>  
349 - <target_detail>Y</target_detail>  
350 - <source_step>&#x6392;&#x5e8f;&#x8bb0;&#x5f55;</source_step>  
351 - <source_field>fieldname</source_field>  
352 - </mapping> <mapping> <target_step_name>&#x5217;&#x8f6c;&#x884c;</target_step_name>  
353 - <target_attribute_key>TARGET_NAME</target_attribute_key>  
354 - <target_detail>Y</target_detail>  
355 - <source_step>&#x8ba1;&#x7b97;&#x53cd;&#x8303;&#x5f0f;&#x5143;&#x6570;&#x636e;</source_step>  
356 - <source_field>targetfieldname</source_field>  
357 - </mapping> <mapping> <target_step_name>&#x5217;&#x8f6c;&#x884c;</target_step_name>  
358 - <target_attribute_key>KEY_VALUE</target_attribute_key>  
359 - <target_detail>Y</target_detail>  
360 - <source_step>&#x8ba1;&#x7b97;&#x53cd;&#x8303;&#x5f0f;&#x5143;&#x6570;&#x636e;</source_step>  
361 - <source_field>keyvalue</source_field>  
362 - </mapping> </mappings> <cluster_schema/>  
363 - <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>  
364 - <xloc>640</xloc>  
365 - <yloc>64</yloc>  
366 - <draw>Y</draw>  
367 - </GUI>  
368 - </step>  
369 -  
370 - <step>  
371 - <name>&#x5b57;&#x6bb5;&#x9009;&#x62e9;</name>  
372 - <type>SelectValues</type>  
373 - <description/>  
374 - <distribute>Y</distribute>  
375 - <custom_distribution/>  
376 - <copies>1</copies>  
377 - <partitioning>  
378 - <method>none</method>  
379 - <schema_name/>  
380 - </partitioning>  
381 - <fields> <field> <name>fieldname</name>  
382 - <rename/>  
383 - <length>-2</length>  
384 - <precision>-2</precision>  
385 - </field> <field> <name>fieldtype</name>  
386 - <rename/>  
387 - <length>-2</length>  
388 - <precision>-2</precision>  
389 - </field> <field> <name>fcno</name>  
390 - <rename/>  
391 - <length>-2</length>  
392 - <precision>-2</precision>  
393 - </field> <select_unspecified>N</select_unspecified>  
394 - </fields> <cluster_schema/>  
395 - <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>  
396 - <xloc>533</xloc>  
397 - <yloc>325</yloc>  
398 - <draw>Y</draw>  
399 - </GUI>  
400 - </step>  
401 -  
402 - <step>  
403 - <name>&#x6392;&#x5e8f;&#x8bb0;&#x5f55;</name>  
404 - <type>SortRows</type>  
405 - <description/>  
406 - <distribute>Y</distribute>  
407 - <custom_distribution/>  
408 - <copies>1</copies>  
409 - <partitioning>  
410 - <method>none</method>  
411 - <schema_name/>  
412 - </partitioning>  
413 - <directory>&#x25;&#x25;java.io.tmpdir&#x25;&#x25;</directory>  
414 - <prefix>out</prefix>  
415 - <sort_size>1000000</sort_size>  
416 - <free_memory/>  
417 - <compress>N</compress>  
418 - <compress_variable/>  
419 - <unique_rows>N</unique_rows>  
420 - <fields>  
421 - <field>  
422 - <name>fcno</name>  
423 - <ascending>Y</ascending>  
424 - <case_sensitive>N</case_sensitive>  
425 - <presorted>N</presorted>  
426 - </field>  
427 - </fields>  
428 - <cluster_schema/>  
429 - <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>  
430 - <xloc>642</xloc>  
431 - <yloc>325</yloc>  
432 - <draw>Y</draw>  
433 - </GUI>  
434 - </step>  
435 -  
436 - <step>  
437 - <name>&#x65f6;&#x523b;&#x8868;&#x660e;&#x7ec6;&#x5206;&#x7ec4;&#x6570;&#x636e;</name>  
438 - <type>TableInput</type>  
439 - <description/>  
440 - <distribute>Y</distribute>  
441 - <custom_distribution/>  
442 - <copies>1</copies>  
443 - <partitioning>  
444 - <method>none</method>  
445 - <schema_name/>  
446 - </partitioning>  
447 - <connection>bus_control_variable</connection>  
448 - <sql>select &#xa;fcno&#xa;, min&#x28;xl&#x29; xl &#xa;, min&#x28;xl_dir&#x29; xl_dir&#xa;, min&#x28;qdz_code&#x29; qdz&#xa;, min&#x28;zdz_code&#x29; zdz&#xa;, min&#x28;bc_type&#x29; bc_type &#xa;, min&#x28;line_version&#x29; line_version&#xa;from bsth_c_s_ttinfo_detail&#xa;where ttinfo &#x3d; &#x24;&#x7b;ttinfoid&#x7d;&#xa;group by fcno</sql>  
449 - <limit>0</limit>  
450 - <lookup/>  
451 - <execute_each_row>N</execute_each_row>  
452 - <variables_active>Y</variables_active>  
453 - <lazy_conversion_active>N</lazy_conversion_active>  
454 - <cluster_schema/>  
455 - <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>  
456 - <xloc>56</xloc>  
457 - <yloc>192</yloc>  
458 - <draw>Y</draw>  
459 - </GUI>  
460 - </step>  
461 -  
462 - <step>  
463 - <name>&#x751f;&#x6210;&#x8def;&#x724c;&#x5b57;&#x6bb5;</name>  
464 - <type>RowGenerator</type>  
465 - <description/>  
466 - <distribute>Y</distribute>  
467 - <custom_distribution/>  
468 - <copies>1</copies>  
469 - <partitioning>  
470 - <method>none</method>  
471 - <schema_name/>  
472 - </partitioning>  
473 - <fields>  
474 - <field>  
475 - <name>fieldname</name>  
476 - <type>String</type>  
477 - <format/>  
478 - <currency/>  
479 - <decimal/>  
480 - <group/>  
481 - <nullif>&#x8def;&#x724c;</nullif>  
482 - <length>-1</length>  
483 - <precision>-1</precision>  
484 - <set_empty_string>N</set_empty_string>  
485 - </field>  
486 - <field>  
487 - <name>fieldtype</name>  
488 - <type>String</type>  
489 - <format/>  
490 - <currency/>  
491 - <decimal/>  
492 - <group/>  
493 - <nullif>String</nullif>  
494 - <length>-1</length>  
495 - <precision>-1</precision>  
496 - <set_empty_string>N</set_empty_string>  
497 - </field>  
498 - <field>  
499 - <name>fcno</name>  
500 - <type>Integer</type>  
501 - <format/>  
502 - <currency/>  
503 - <decimal/>  
504 - <group/>  
505 - <nullif>0</nullif>  
506 - <length>-1</length>  
507 - <precision>-1</precision>  
508 - <set_empty_string>N</set_empty_string>  
509 - </field>  
510 - </fields>  
511 - <limit>1</limit>  
512 - <never_ending>N</never_ending>  
513 - <interval_in_ms>5000</interval_in_ms>  
514 - <row_time_field>now</row_time_field>  
515 - <last_time_field>FiveSecondsAgo</last_time_field>  
516 - <cluster_schema/>  
517 - <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>  
518 - <xloc>530</xloc>  
519 - <yloc>194</yloc>  
520 - <draw>Y</draw>  
521 - </GUI>  
522 - </step>  
523 -  
524 - <step>  
525 - <name>&#x8ba1;&#x7b97;excel&#x8f93;&#x51fa;&#x5b57;&#x6bb5;</name>  
526 - <type>ScriptValueMod</type>  
527 - <description/>  
528 - <distribute>Y</distribute>  
529 - <custom_distribution/>  
530 - <copies>1</copies>  
531 - <partitioning>  
532 - <method>none</method>  
533 - <schema_name/>  
534 - </partitioning>  
535 - <compatible>N</compatible>  
536 - <optimizationLevel>9</optimizationLevel>  
537 - <jsScripts> <jsScript> <jsScript_type>0</jsScript_type>  
538 - <jsScript_name>Script 1</jsScript_name>  
539 - <jsScript_script>&#x2f;&#x2f;Script here&#xa;&#xa;var fieldname&#x3b; &#x2f;&#x2f; &#x5b57;&#x6bb5;&#x540d;&#xa;var fieldtype&#x3b; &#x2f;&#x2f; &#x5b57;&#x6bb5;&#x7c7b;&#x578b;&#xa;&#xa;if &#x28;bc_type &#x3d;&#x3d; &#x27;in&#x27;&#x29; &#x7b;&#xa; fieldname &#x3d; &#x27;&#x8fdb;&#x573a;&#x27; &#x2b; &#x22;-&#x3e;&#x22; &#x2b; fcno&#x3b;&#xa;&#x7d; else if &#x28;bc_type &#x3d;&#x3d; &#x27;out&#x27;&#x29; &#x7b;&#xa; fieldname &#x3d; &#x27;&#x51fa;&#x573a;&#x27; &#x2b; &#x22;-&#x3e;&#x22; &#x2b; fcno&#x3b;&#xa;&#x7d; else if &#x28;bc_type &#x3d;&#x3d; &#x27;normal&#x27;&#x29; &#x7b;&#xa; fieldname &#x3d; zdname &#x2b; &#x22;-&#x3e;&#x22; &#x2b; fcno&#x3b;&#xa;&#x7d; else &#x7b;&#xa; fieldname &#x3d; zdname &#x2b; &#x22;-&#x3e;&#x22; &#x2b; fcno&#x3b;&#xa;&#x7d; &#xa;&#xa;fieldtype &#x3d; &#x27;String&#x27;&#x3b;&#xa;</jsScript_script>  
540 - </jsScript> </jsScripts> <fields> <field> <name>fieldname</name>  
541 - <rename>fieldname</rename>  
542 - <type>String</type>  
543 - <length>-1</length>  
544 - <precision>-1</precision>  
545 - <replace>N</replace>  
546 - </field> <field> <name>fieldtype</name>  
547 - <rename>fieldtype</rename>  
548 - <type>String</type>  
549 - <length>-1</length>  
550 - <precision>-1</precision>  
551 - <replace>N</replace>  
552 - </field> </fields> <cluster_schema/>  
553 - <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>  
554 - <xloc>410</xloc>  
555 - <yloc>326</yloc>  
556 - <draw>Y</draw>  
557 - </GUI>  
558 - </step>  
559 -  
560 - <step>  
561 - <name>&#x8ba1;&#x7b97;&#x53cd;&#x8303;&#x5f0f;&#x5143;&#x6570;&#x636e;</name>  
562 - <type>ScriptValueMod</type>  
563 - <description/>  
564 - <distribute>Y</distribute>  
565 - <custom_distribution/>  
566 - <copies>1</copies>  
567 - <partitioning>  
568 - <method>none</method>  
569 - <schema_name/>  
570 - </partitioning>  
571 - <compatible>N</compatible>  
572 - <optimizationLevel>9</optimizationLevel>  
573 - <jsScripts> <jsScript> <jsScript_type>0</jsScript_type>  
574 - <jsScript_name>Script 1</jsScript_name>  
575 - <jsScript_script>&#x2f;&#x2f;Script here&#xa;&#xa;var targetfieldname&#x3b; &#x2f;&#x2f; &#x76ee;&#x6807;&#x5b57;&#x6bb5;&#x540d;&#xa;var targettype&#x3b; &#x2f;&#x2f; &#x76ee;&#x6807;&#x7c7b;&#x578b;&#xa;var valuefieldname&#x3b; &#x2f;&#x2f; &#x503c;&#x5b57;&#x6bb5;&#x540d;&#xa;var keyvalue&#x3b; &#x2f;&#x2f; &#x5173;&#x952e;&#x5b57;&#x503c;&#xa;&#xa;if &#x28;bc_type &#x3d;&#x3d; &#x27;in&#x27;&#x29; &#x7b;&#xa; targetfieldname &#x3d; &#x27;&#x8fdb;&#x573a;&#x27; &#x2b; &#x22;-&#x3e;&#x22; &#x2b; fcno&#x3b;&#xa;&#x7d; else if &#x28;bc_type &#x3d;&#x3d; &#x27;out&#x27;&#x29; &#x7b;&#xa; targetfieldname &#x3d; &#x27;&#x51fa;&#x573a;&#x27; &#x2b; &#x22;-&#x3e;&#x22; &#x2b; fcno&#x3b;&#xa;&#x7d; else if &#x28;bc_type &#x3d;&#x3d; &#x27;normal&#x27;&#x29; &#x7b;&#xa; targetfieldname &#x3d; zdname &#x2b; &#x22;-&#x3e;&#x22; &#x2b; fcno&#x3b;&#xa;&#x7d; else &#x7b;&#xa; targetfieldname &#x3d; zdname &#x2b; &#x22;-&#x3e;&#x22; &#x2b; fcno&#x3b;&#xa;&#x7d; &#xa;&#xa;targettype &#x3d; &#x27;String&#x27;&#x3b;&#xa;valuefieldname &#x3d; &#x27;fcsj&#x27;&#x3b;&#xa;keyvalue &#x3d; fcno&#x3b;&#xa;</jsScript_script>  
576 - </jsScript> </jsScripts> <fields> <field> <name>targetfieldname</name>  
577 - <rename>targetfieldname</rename>  
578 - <type>String</type>  
579 - <length>-1</length>  
580 - <precision>-1</precision>  
581 - <replace>N</replace>  
582 - </field> <field> <name>targettype</name>  
583 - <rename>targettype</rename>  
584 - <type>String</type>  
585 - <length>-1</length>  
586 - <precision>-1</precision>  
587 - <replace>N</replace>  
588 - </field> <field> <name>valuefieldname</name>  
589 - <rename>valuefieldname</rename>  
590 - <type>String</type>  
591 - <length>-1</length>  
592 - <precision>-1</precision>  
593 - <replace>N</replace>  
594 - </field> <field> <name>keyvalue</name>  
595 - <rename>keyvalue</rename>  
596 - <type>String</type>  
597 - <length>-1</length>  
598 - <precision>-1</precision>  
599 - <replace>N</replace>  
600 - </field> </fields> <cluster_schema/>  
601 - <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>  
602 - <xloc>410</xloc>  
603 - <yloc>64</yloc>  
604 - <draw>Y</draw>  
605 - </GUI>  
606 - </step>  
607 -  
608 - <step>  
609 - <name>&#x8ba1;&#x7b97;&#x7ad9;&#x70b9;</name>  
610 - <type>ScriptValueMod</type>  
611 - <description/>  
612 - <distribute>Y</distribute>  
613 - <custom_distribution/>  
614 - <copies>1</copies>  
615 - <partitioning>  
616 - <method>none</method>  
617 - <schema_name/>  
618 - </partitioning>  
619 - <compatible>N</compatible>  
620 - <optimizationLevel>9</optimizationLevel>  
621 - <jsScripts> <jsScript> <jsScript_type>0</jsScript_type>  
622 - <jsScript_name>Script 1</jsScript_name>  
623 - <jsScript_script>&#x2f;&#x2f;Script here&#xa;&#xa;&#x2f;&#x2a;&#xa;var zd&#x3b;&#xa;&#xa;if &#x28;bc_type &#x3d;&#x3d; &#x27;in&#x27;&#x29; &#x7b;&#xa; zd &#x3d; qdz&#x3b;&#xa;&#x7d; else if &#x28;bc_type &#x3d;&#x3d; &#x27;out&#x27;&#x29; &#x7b;&#xa; zd &#x3d; zdz&#x3b;&#xa;&#x7d; else if &#x28;bc_type &#x3d;&#x3d; &#x27;normal&#x27;&#x29; &#x7b;&#xa; zd &#x3d; qdz&#x3b;&#xa;&#x7d; else &#x7b;&#xa; zd &#x3d; qdz&#x3b;&#xa;&#x7d;&#xa;&#x2a;&#x2f;&#xa;&#xa;&#x2f;&#x2f; &#x7ad9;&#x70b9;&#x6807;&#x5fd7;&#xa;var smark &#x3d; &#x22;B&#x22;&#x3b;&#xa;var destroy &#x3d; 0&#x3b;</jsScript_script>  
624 - </jsScript> </jsScripts> <fields> <field> <name>smark</name>  
625 - <rename>smark</rename>  
626 - <type>String</type>  
627 - <length>-1</length>  
628 - <precision>-1</precision>  
629 - <replace>N</replace>  
630 - </field> <field> <name>destroy</name>  
631 - <rename>destroy</rename>  
632 - <type>Number</type>  
633 - <length>16</length>  
634 - <precision>2</precision>  
635 - <replace>N</replace>  
636 - </field> </fields> <cluster_schema/>  
637 - <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>  
638 - <xloc>300</xloc>  
639 - <yloc>190</yloc>  
640 - <draw>Y</draw>  
641 - </GUI>  
642 - </step>  
643 -  
644 - <step>  
645 - <name>&#x8fc7;&#x6ee4;&#x8bb0;&#x5f55;</name>  
646 - <type>FilterRows</type>  
647 - <description/>  
648 - <distribute>Y</distribute>  
649 - <custom_distribution/>  
650 - <copies>1</copies>  
651 - <partitioning>  
652 - <method>none</method>  
653 - <schema_name/>  
654 - </partitioning>  
655 -<send_true_to/>  
656 -<send_false_to/>  
657 - <compare>  
658 -<condition>  
659 - <negated>N</negated>  
660 - <conditions>  
661 - <condition>  
662 - <negated>N</negated>  
663 - <leftvalue>bc_type</leftvalue>  
664 - <function>IS NOT NULL</function>  
665 - <rightvalue/>  
666 - </condition>  
667 - </conditions>  
668 - </condition>  
669 - </compare>  
670 - <cluster_schema/>  
671 - <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>  
672 - <xloc>182</xloc>  
673 - <yloc>189</yloc>  
674 - <draw>Y</draw>  
675 - </GUI>  
676 - </step>  
677 -  
678 - <step>  
679 - <name>&#x67e5;&#x627e;&#x8d77;&#x70b9;&#x7ad9;</name>  
680 - <type>DBLookup</type>  
681 - <description/>  
682 - <distribute>N</distribute>  
683 - <custom_distribution/>  
684 - <copies>1</copies>  
685 - <partitioning>  
686 - <method>none</method>  
687 - <schema_name/>  
688 - </partitioning>  
689 - <connection>bus_control_variable</connection>  
690 - <cache>N</cache>  
691 - <cache_load_all>Y</cache_load_all>  
692 - <cache_size>0</cache_size>  
693 - <lookup>  
694 - <schema/>  
695 - <table>bsth_c_ls_stationroute</table>  
696 - <orderby/>  
697 - <fail_on_multiple>N</fail_on_multiple>  
698 - <eat_row_on_failure>N</eat_row_on_failure>  
699 - <key>  
700 - <name>xl</name>  
701 - <field>line</field>  
702 - <condition>&#x3d;</condition>  
703 - <name2/>  
704 - </key>  
705 - <key>  
706 - <name>xl_dir</name>  
707 - <field>directions</field>  
708 - <condition>&#x3d;</condition>  
709 - <name2/>  
710 - </key>  
711 - <key>  
712 - <name>line_version</name>  
713 - <field>versions</field>  
714 - <condition>&#x3d;</condition>  
715 - <name2/>  
716 - </key>  
717 - <key>  
718 - <name>smark</name>  
719 - <field>station_mark</field>  
720 - <condition>&#x3d;</condition>  
721 - <name2/>  
722 - </key>  
723 - <key>  
724 - <name>destroy</name>  
725 - <field>destroy</field>  
726 - <condition>&#x3d;</condition>  
727 - <name2/>  
728 - </key>  
729 - <value>  
730 - <name>station_name</name>  
731 - <rename>zdname</rename>  
732 - <default/>  
733 - <type>String</type>  
734 - </value>  
735 - </lookup>  
736 - <cluster_schema/>  
737 - <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>  
738 - <xloc>412</xloc>  
739 - <yloc>189</yloc>  
740 - <draw>Y</draw>  
741 - </GUI>  
742 - </step>  
743 -  
744 - <step_error_handling>  
745 - </step_error_handling>  
746 - <slave-step-copy-partition-distribution>  
747 -</slave-step-copy-partition-distribution>  
748 - <slave_transformation>N</slave_transformation>  
749 -  
750 -</transformation> 1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<transformation>
  3 + <info>
  4 + <name>&#x65f6;&#x523b;&#x8868;&#x660e;&#x7ec6;&#x5bfc;&#x51fa;&#x5143;&#x6570;&#x636e;</name>
  5 + <description/>
  6 + <extended_description/>
  7 + <trans_version/>
  8 + <trans_type>Normal</trans_type>
  9 + <trans_status>0</trans_status>
  10 + <directory>&#x2f;</directory>
  11 + <parameters>
  12 + <parameter>
  13 + <name>filepath</name>
  14 + <default_value>&#x2f;Users&#x2f;xu&#x2f;resource&#x2f;project_code&#x2f;runtime_temp&#x2f;bsth_control_u_d_files&#x2f;ttinfodetail_test.xls</default_value>
  15 + <description>&#x65f6;&#x523b;&#x8868;excel&#x5bfc;&#x51fa;&#x6587;&#x4ef6;&#x8def;&#x5f84;&#x540d;</description>
  16 + </parameter>
  17 + <parameter>
  18 + <name>injectktrfile</name>
  19 + <default_value>&#x2f;Users&#x2f;xu&#x2f;resource&#x2f;project_code&#x2f;bsth_project&#x2f;bsth_control_parent&#x2f;bsth_control&#x2f;src&#x2f;main&#x2f;resources&#x2f;datatools&#x2f;ktrs&#x2f;ttinfodetailDataOutput.ktr</default_value>
  20 + <description>&#x6ce8;&#x5165;&#x5143;&#x6570;&#x636e;&#x7684;ktr&#x6587;&#x4ef6;</description>
  21 + </parameter>
  22 + <parameter>
  23 + <name>ttinfoid</name>
  24 + <default_value>56</default_value>
  25 + <description>&#x65f6;&#x523b;&#x8868;id</description>
  26 + </parameter>
  27 + </parameters>
  28 + <log>
  29 +<trans-log-table><connection/>
  30 +<schema/>
  31 +<table/>
  32 +<size_limit_lines/>
  33 +<interval/>
  34 +<timeout_days/>
  35 +<field><id>ID_BATCH</id><enabled>Y</enabled><name>ID_BATCH</name></field><field><id>CHANNEL_ID</id><enabled>Y</enabled><name>CHANNEL_ID</name></field><field><id>TRANSNAME</id><enabled>Y</enabled><name>TRANSNAME</name></field><field><id>STATUS</id><enabled>Y</enabled><name>STATUS</name></field><field><id>LINES_READ</id><enabled>Y</enabled><name>LINES_READ</name><subject/></field><field><id>LINES_WRITTEN</id><enabled>Y</enabled><name>LINES_WRITTEN</name><subject/></field><field><id>LINES_UPDATED</id><enabled>Y</enabled><name>LINES_UPDATED</name><subject/></field><field><id>LINES_INPUT</id><enabled>Y</enabled><name>LINES_INPUT</name><subject/></field><field><id>LINES_OUTPUT</id><enabled>Y</enabled><name>LINES_OUTPUT</name><subject/></field><field><id>LINES_REJECTED</id><enabled>Y</enabled><name>LINES_REJECTED</name><subject/></field><field><id>ERRORS</id><enabled>Y</enabled><name>ERRORS</name></field><field><id>STARTDATE</id><enabled>Y</enabled><name>STARTDATE</name></field><field><id>ENDDATE</id><enabled>Y</enabled><name>ENDDATE</name></field><field><id>LOGDATE</id><enabled>Y</enabled><name>LOGDATE</name></field><field><id>DEPDATE</id><enabled>Y</enabled><name>DEPDATE</name></field><field><id>REPLAYDATE</id><enabled>Y</enabled><name>REPLAYDATE</name></field><field><id>LOG_FIELD</id><enabled>Y</enabled><name>LOG_FIELD</name></field><field><id>EXECUTING_SERVER</id><enabled>N</enabled><name>EXECUTING_SERVER</name></field><field><id>EXECUTING_USER</id><enabled>N</enabled><name>EXECUTING_USER</name></field><field><id>CLIENT</id><enabled>N</enabled><name>CLIENT</name></field></trans-log-table>
  36 +<perf-log-table><connection/>
  37 +<schema/>
  38 +<table/>
  39 +<interval/>
  40 +<timeout_days/>
  41 +<field><id>ID_BATCH</id><enabled>Y</enabled><name>ID_BATCH</name></field><field><id>SEQ_NR</id><enabled>Y</enabled><name>SEQ_NR</name></field><field><id>LOGDATE</id><enabled>Y</enabled><name>LOGDATE</name></field><field><id>TRANSNAME</id><enabled>Y</enabled><name>TRANSNAME</name></field><field><id>STEPNAME</id><enabled>Y</enabled><name>STEPNAME</name></field><field><id>STEP_COPY</id><enabled>Y</enabled><name>STEP_COPY</name></field><field><id>LINES_READ</id><enabled>Y</enabled><name>LINES_READ</name></field><field><id>LINES_WRITTEN</id><enabled>Y</enabled><name>LINES_WRITTEN</name></field><field><id>LINES_UPDATED</id><enabled>Y</enabled><name>LINES_UPDATED</name></field><field><id>LINES_INPUT</id><enabled>Y</enabled><name>LINES_INPUT</name></field><field><id>LINES_OUTPUT</id><enabled>Y</enabled><name>LINES_OUTPUT</name></field><field><id>LINES_REJECTED</id><enabled>Y</enabled><name>LINES_REJECTED</name></field><field><id>ERRORS</id><enabled>Y</enabled><name>ERRORS</name></field><field><id>INPUT_BUFFER_ROWS</id><enabled>Y</enabled><name>INPUT_BUFFER_ROWS</name></field><field><id>OUTPUT_BUFFER_ROWS</id><enabled>Y</enabled><name>OUTPUT_BUFFER_ROWS</name></field></perf-log-table>
  42 +<channel-log-table><connection/>
  43 +<schema/>
  44 +<table/>
  45 +<timeout_days/>
  46 +<field><id>ID_BATCH</id><enabled>Y</enabled><name>ID_BATCH</name></field><field><id>CHANNEL_ID</id><enabled>Y</enabled><name>CHANNEL_ID</name></field><field><id>LOG_DATE</id><enabled>Y</enabled><name>LOG_DATE</name></field><field><id>LOGGING_OBJECT_TYPE</id><enabled>Y</enabled><name>LOGGING_OBJECT_TYPE</name></field><field><id>OBJECT_NAME</id><enabled>Y</enabled><name>OBJECT_NAME</name></field><field><id>OBJECT_COPY</id><enabled>Y</enabled><name>OBJECT_COPY</name></field><field><id>REPOSITORY_DIRECTORY</id><enabled>Y</enabled><name>REPOSITORY_DIRECTORY</name></field><field><id>FILENAME</id><enabled>Y</enabled><name>FILENAME</name></field><field><id>OBJECT_ID</id><enabled>Y</enabled><name>OBJECT_ID</name></field><field><id>OBJECT_REVISION</id><enabled>Y</enabled><name>OBJECT_REVISION</name></field><field><id>PARENT_CHANNEL_ID</id><enabled>Y</enabled><name>PARENT_CHANNEL_ID</name></field><field><id>ROOT_CHANNEL_ID</id><enabled>Y</enabled><name>ROOT_CHANNEL_ID</name></field></channel-log-table>
  47 +<step-log-table><connection/>
  48 +<schema/>
  49 +<table/>
  50 +<timeout_days/>
  51 +<field><id>ID_BATCH</id><enabled>Y</enabled><name>ID_BATCH</name></field><field><id>CHANNEL_ID</id><enabled>Y</enabled><name>CHANNEL_ID</name></field><field><id>LOG_DATE</id><enabled>Y</enabled><name>LOG_DATE</name></field><field><id>TRANSNAME</id><enabled>Y</enabled><name>TRANSNAME</name></field><field><id>STEPNAME</id><enabled>Y</enabled><name>STEPNAME</name></field><field><id>STEP_COPY</id><enabled>Y</enabled><name>STEP_COPY</name></field><field><id>LINES_READ</id><enabled>Y</enabled><name>LINES_READ</name></field><field><id>LINES_WRITTEN</id><enabled>Y</enabled><name>LINES_WRITTEN</name></field><field><id>LINES_UPDATED</id><enabled>Y</enabled><name>LINES_UPDATED</name></field><field><id>LINES_INPUT</id><enabled>Y</enabled><name>LINES_INPUT</name></field><field><id>LINES_OUTPUT</id><enabled>Y</enabled><name>LINES_OUTPUT</name></field><field><id>LINES_REJECTED</id><enabled>Y</enabled><name>LINES_REJECTED</name></field><field><id>ERRORS</id><enabled>Y</enabled><name>ERRORS</name></field><field><id>LOG_FIELD</id><enabled>N</enabled><name>LOG_FIELD</name></field></step-log-table>
  52 +<metrics-log-table><connection/>
  53 +<schema/>
  54 +<table/>
  55 +<timeout_days/>
  56 +<field><id>ID_BATCH</id><enabled>Y</enabled><name>ID_BATCH</name></field><field><id>CHANNEL_ID</id><enabled>Y</enabled><name>CHANNEL_ID</name></field><field><id>LOG_DATE</id><enabled>Y</enabled><name>LOG_DATE</name></field><field><id>METRICS_DATE</id><enabled>Y</enabled><name>METRICS_DATE</name></field><field><id>METRICS_CODE</id><enabled>Y</enabled><name>METRICS_CODE</name></field><field><id>METRICS_DESCRIPTION</id><enabled>Y</enabled><name>METRICS_DESCRIPTION</name></field><field><id>METRICS_SUBJECT</id><enabled>Y</enabled><name>METRICS_SUBJECT</name></field><field><id>METRICS_TYPE</id><enabled>Y</enabled><name>METRICS_TYPE</name></field><field><id>METRICS_VALUE</id><enabled>Y</enabled><name>METRICS_VALUE</name></field></metrics-log-table>
  57 + </log>
  58 + <maxdate>
  59 + <connection/>
  60 + <table/>
  61 + <field/>
  62 + <offset>0.0</offset>
  63 + <maxdiff>0.0</maxdiff>
  64 + </maxdate>
  65 + <size_rowset>10000</size_rowset>
  66 + <sleep_time_empty>50</sleep_time_empty>
  67 + <sleep_time_full>50</sleep_time_full>
  68 + <unique_connections>N</unique_connections>
  69 + <feedback_shown>Y</feedback_shown>
  70 + <feedback_size>50000</feedback_size>
  71 + <using_thread_priorities>Y</using_thread_priorities>
  72 + <shared_objects_file/>
  73 + <capture_step_performance>N</capture_step_performance>
  74 + <step_performance_capturing_delay>1000</step_performance_capturing_delay>
  75 + <step_performance_capturing_size_limit>100</step_performance_capturing_size_limit>
  76 + <dependencies>
  77 + </dependencies>
  78 + <partitionschemas>
  79 + </partitionschemas>
  80 + <slaveservers>
  81 + </slaveservers>
  82 + <clusterschemas>
  83 + </clusterschemas>
  84 + <created_user>-</created_user>
  85 + <created_date>2016&#x2f;11&#x2f;15 15&#x3a;02&#x3a;41.624</created_date>
  86 + <modified_user>-</modified_user>
  87 + <modified_date>2016&#x2f;11&#x2f;15 15&#x3a;02&#x3a;41.624</modified_date>
  88 + <key_for_session_key>H4sIAAAAAAAAAAMAAAAAAAAAAAA&#x3d;</key_for_session_key>
  89 + <is_key_private>N</is_key_private>
  90 + </info>
  91 + <notepads>
  92 + <notepad>
  93 + <note>TODO&#xff1a;&#x5982;&#x679c;groupby &#x52a0;&#x5165;bctype&#xff0c;&#xa;&#x5219;&#x4ee5;&#x53d1;&#x8f66;&#x987a;&#x5e8f;&#x53f7;&#xff0c;&#x73ed;&#x6b21;&#x7c7b;&#x578b;&#x5206;&#x7ec4;&#x7684;&#x6570;&#x636e;&#x53ef;&#x80fd;&#x91cd;&#x590d;&#xff0c;&#xa;&#x5e94;&#x4e3a;&#x73ed;&#x6b21;&#x7c7b;&#x578b;&#x53ef;&#x80fd;&#x4e0d;&#x4e00;&#x6837;&#xff08;&#x5bfc;&#x5165;&#x4e4b;&#x540e;&#x4eba;&#x4e3a;&#x4fee;&#x6539;&#x7684;&#xff0c;&#x5982;&#x6b63;&#x5e38;&#x73ed;&#x6b21;&#x6539;&#x6210;&#x533a;&#x95f4;&#xff09;&#xff0c;&#xa;&#x56e0;&#x4e3a;&#x5bfc;&#x51fa;&#x65f6;&#x5fc5;&#x987b;&#x6570;&#x636e;&#x4e0d;&#x91cd;&#x590d;&#xff0c;&#x8fd9;&#x91cc;&#x7684;&#x89e3;&#x51b3;&#x65b9;&#x6cd5;&#xff0c;&#x53ea;&#x4f7f;&#x7528;&#x53d1;&#x8f66;&#x987a;&#x5e8f;&#x53f7;&#x5206;&#x7ec4;&#xff0c;&#xa;&#x4ee5;&#x540e;&#x5efa;&#x8bae;&#xff0c;&#x8fd8;&#x662f;&#x539f;&#x6765;&#x7684;&#x65b9;&#x5f0f;&#x5206;&#x7ec4;&#xff0c;&#x7136;&#x540e;&#x628a;&#x66f4;&#x65b0;&#x65f6;&#x95f4;&#x665a;&#x7684;&#x53bb;&#x9664;&#xa;&#xa;&#x4ee5;&#x540e;&#x6539;&#x6210;&#x53bb;&#x9664;&#x91cd;&#x590d;&#x7eaa;&#x5f55;</note>
  94 + <xloc>178</xloc>
  95 + <yloc>547</yloc>
  96 + <width>406</width>
  97 + <heigth>122</heigth>
  98 + <fontname>YaHei Consolas Hybrid</fontname>
  99 + <fontsize>12</fontsize>
  100 + <fontbold>N</fontbold>
  101 + <fontitalic>N</fontitalic>
  102 + <fontcolorred>0</fontcolorred>
  103 + <fontcolorgreen>0</fontcolorgreen>
  104 + <fontcolorblue>0</fontcolorblue>
  105 + <backgroundcolorred>255</backgroundcolorred>
  106 + <backgroundcolorgreen>205</backgroundcolorgreen>
  107 + <backgroundcolorblue>112</backgroundcolorblue>
  108 + <bordercolorred>100</bordercolorred>
  109 + <bordercolorgreen>100</bordercolorgreen>
  110 + <bordercolorblue>100</bordercolorblue>
  111 + <drawshadow>Y</drawshadow>
  112 + </notepad>
  113 + </notepads>
  114 + <connection>
  115 + <name>192.168.168.1_jwgl_dw</name>
  116 + <server>192.168.168.1</server>
  117 + <type>ORACLE</type>
  118 + <access>Native</access>
  119 + <database>orcl</database>
  120 + <port>1521</port>
  121 + <username>jwgl_dw</username>
  122 + <password>Encrypted 2be98afc86aa7f2e4cb13b977d2adabcd</password>
  123 + <servername/>
  124 + <data_tablespace/>
  125 + <index_tablespace/>
  126 + <attributes>
  127 + <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>
  128 + <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>
  129 + <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>
  130 + <attribute><code>PORT_NUMBER</code><attribute>1521</attribute></attribute>
  131 + <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute>
  132 + <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>
  133 + <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute>
  134 + <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute>
  135 + <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>
  136 + </attributes>
  137 + </connection>
  138 + <connection>
  139 + <name>bus_control_variable</name>
  140 + <server>&#x24;&#x7b;v_db_ip&#x7d;</server>
  141 + <type>MYSQL</type>
  142 + <access>Native</access>
  143 + <database>&#x24;&#x7b;v_db_dname&#x7d;</database>
  144 + <port>3306</port>
  145 + <username>&#x24;&#x7b;v_db_uname&#x7d;</username>
  146 + <password>&#x24;&#x7b;v_db_pwd&#x7d;</password>
  147 + <servername/>
  148 + <data_tablespace/>
  149 + <index_tablespace/>
  150 + <attributes>
  151 + <attribute><code>EXTRA_OPTION_MYSQL.characterEncoding</code><attribute>utf8</attribute></attribute>
  152 + <attribute><code>EXTRA_OPTION_MYSQL.defaultFetchSize</code><attribute>500</attribute></attribute>
  153 + <attribute><code>EXTRA_OPTION_MYSQL.useCursorFetch</code><attribute>true</attribute></attribute>
  154 + <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>
  155 + <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>
  156 + <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>
  157 + <attribute><code>PORT_NUMBER</code><attribute>3306</attribute></attribute>
  158 + <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute>
  159 + <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>
  160 + <attribute><code>STREAM_RESULTS</code><attribute>N</attribute></attribute>
  161 + <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute>
  162 + <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute>
  163 + <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>
  164 + </attributes>
  165 + </connection>
  166 + <connection>
  167 + <name>bus_control_&#x516c;&#x53f8;_201</name>
  168 + <server>localhost</server>
  169 + <type>MYSQL</type>
  170 + <access>Native</access>
  171 + <database>control</database>
  172 + <port>3306</port>
  173 + <username>root</username>
  174 + <password>Encrypted </password>
  175 + <servername/>
  176 + <data_tablespace/>
  177 + <index_tablespace/>
  178 + <attributes>
  179 + <attribute><code>EXTRA_OPTION_MYSQL.defaultFetchSize</code><attribute>500</attribute></attribute>
  180 + <attribute><code>EXTRA_OPTION_MYSQL.useCursorFetch</code><attribute>true</attribute></attribute>
  181 + <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>
  182 + <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>
  183 + <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>
  184 + <attribute><code>PORT_NUMBER</code><attribute>3306</attribute></attribute>
  185 + <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute>
  186 + <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>
  187 + <attribute><code>STREAM_RESULTS</code><attribute>N</attribute></attribute>
  188 + <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute>
  189 + <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute>
  190 + <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>
  191 + </attributes>
  192 + </connection>
  193 + <connection>
  194 + <name>bus_control_&#x672c;&#x673a;</name>
  195 + <server>localhost</server>
  196 + <type>MYSQL</type>
  197 + <access>Native</access>
  198 + <database>control</database>
  199 + <port>3306</port>
  200 + <username>root</username>
  201 + <password>Encrypted </password>
  202 + <servername/>
  203 + <data_tablespace/>
  204 + <index_tablespace/>
  205 + <attributes>
  206 + <attribute><code>EXTRA_OPTION_MYSQL.defaultFetchSize</code><attribute>500</attribute></attribute>
  207 + <attribute><code>EXTRA_OPTION_MYSQL.useCursorFetch</code><attribute>true</attribute></attribute>
  208 + <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>
  209 + <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>
  210 + <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>
  211 + <attribute><code>PORT_NUMBER</code><attribute>3306</attribute></attribute>
  212 + <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute>
  213 + <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>
  214 + <attribute><code>STREAM_RESULTS</code><attribute>Y</attribute></attribute>
  215 + <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute>
  216 + <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute>
  217 + <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>
  218 + </attributes>
  219 + </connection>
  220 + <connection>
  221 + <name>xlab_mysql_youle</name>
  222 + <server>101.231.124.8</server>
  223 + <type>MYSQL</type>
  224 + <access>Native</access>
  225 + <database>xlab_youle</database>
  226 + <port>45687</port>
  227 + <username>xlab-youle</username>
  228 + <password>Encrypted 2be98afc86aa78a88aa1be369d187a3df</password>
  229 + <servername/>
  230 + <data_tablespace/>
  231 + <index_tablespace/>
  232 + <attributes>
  233 + <attribute><code>EXTRA_OPTION_MYSQL.defaultFetchSize</code><attribute>500</attribute></attribute>
  234 + <attribute><code>EXTRA_OPTION_MYSQL.useCursorFetch</code><attribute>true</attribute></attribute>
  235 + <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>
  236 + <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>
  237 + <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>
  238 + <attribute><code>PORT_NUMBER</code><attribute>45687</attribute></attribute>
  239 + <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute>
  240 + <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>
  241 + <attribute><code>STREAM_RESULTS</code><attribute>Y</attribute></attribute>
  242 + <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>N</attribute></attribute>
  243 + <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>N</attribute></attribute>
  244 + <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>
  245 + </attributes>
  246 + </connection>
  247 + <connection>
  248 + <name>xlab_mysql_youle&#xff08;&#x672c;&#x673a;&#xff09;</name>
  249 + <server>localhost</server>
  250 + <type>MYSQL</type>
  251 + <access>Native</access>
  252 + <database>xlab_youle</database>
  253 + <port>3306</port>
  254 + <username>root</username>
  255 + <password>Encrypted </password>
  256 + <servername/>
  257 + <data_tablespace/>
  258 + <index_tablespace/>
  259 + <attributes>
  260 + <attribute><code>EXTRA_OPTION_MYSQL.defaultFetchSize</code><attribute>500</attribute></attribute>
  261 + <attribute><code>EXTRA_OPTION_MYSQL.useCursorFetch</code><attribute>true</attribute></attribute>
  262 + <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>
  263 + <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>
  264 + <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>
  265 + <attribute><code>PORT_NUMBER</code><attribute>3306</attribute></attribute>
  266 + <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute>
  267 + <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>
  268 + <attribute><code>STREAM_RESULTS</code><attribute>Y</attribute></attribute>
  269 + <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>N</attribute></attribute>
  270 + <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>N</attribute></attribute>
  271 + <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>
  272 + </attributes>
  273 + </connection>
  274 + <connection>
  275 + <name>xlab_youle</name>
  276 + <server/>
  277 + <type>MYSQL</type>
  278 + <access>JNDI</access>
  279 + <database>xlab_youle</database>
  280 + <port>1521</port>
  281 + <username/>
  282 + <password>Encrypted </password>
  283 + <servername/>
  284 + <data_tablespace/>
  285 + <index_tablespace/>
  286 + <attributes>
  287 + <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>
  288 + <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>
  289 + <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>
  290 + <attribute><code>PORT_NUMBER</code><attribute>1521</attribute></attribute>
  291 + <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute>
  292 + <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>
  293 + <attribute><code>STREAM_RESULTS</code><attribute>Y</attribute></attribute>
  294 + <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute>
  295 + <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute>
  296 + <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>
  297 + </attributes>
  298 + </connection>
  299 + <order>
  300 + <hop> <from>&#x65f6;&#x523b;&#x8868;&#x660e;&#x7ec6;&#x5206;&#x7ec4;&#x6570;&#x636e;</from><to>&#x8fc7;&#x6ee4;&#x8bb0;&#x5f55;</to><enabled>Y</enabled> </hop>
  301 + <hop> <from>&#x8fc7;&#x6ee4;&#x8bb0;&#x5f55;</from><to>&#x8ba1;&#x7b97;&#x7ad9;&#x70b9;</to><enabled>Y</enabled> </hop>
  302 + <hop> <from>&#x8ba1;&#x7b97;excel&#x8f93;&#x51fa;&#x5b57;&#x6bb5;</from><to>&#x5b57;&#x6bb5;&#x9009;&#x62e9;</to><enabled>Y</enabled> </hop>
  303 + <hop> <from>&#x5b57;&#x6bb5;&#x9009;&#x62e9;</from><to>&#x6392;&#x5e8f;&#x8bb0;&#x5f55;</to><enabled>Y</enabled> </hop>
  304 + <hop> <from>&#x751f;&#x6210;&#x8def;&#x724c;&#x5b57;&#x6bb5;</from><to>&#x6392;&#x5e8f;&#x8bb0;&#x5f55;</to><enabled>Y</enabled> </hop>
  305 + <hop> <from>&#x8ba1;&#x7b97;&#x53cd;&#x8303;&#x5f0f;&#x5143;&#x6570;&#x636e;</from><to>ETL&#x5143;&#x6570;&#x636e;&#x6ce8;&#x5165;</to><enabled>Y</enabled> </hop>
  306 + <hop> <from>&#x6392;&#x5e8f;&#x8bb0;&#x5f55;</from><to>ETL&#x5143;&#x6570;&#x636e;&#x6ce8;&#x5165;</to><enabled>Y</enabled> </hop>
  307 + <hop> <from>&#x8ba1;&#x7b97;&#x7ad9;&#x70b9;</from><to>&#x67e5;&#x627e;&#x8d77;&#x70b9;&#x7ad9;</to><enabled>Y</enabled> </hop>
  308 + <hop> <from>&#x67e5;&#x627e;&#x8d77;&#x70b9;&#x7ad9;</from><to>&#x8ba1;&#x7b97;&#x53cd;&#x8303;&#x5f0f;&#x5143;&#x6570;&#x636e;</to><enabled>Y</enabled> </hop>
  309 + <hop> <from>&#x67e5;&#x627e;&#x8d77;&#x70b9;&#x7ad9;</from><to>&#x8ba1;&#x7b97;excel&#x8f93;&#x51fa;&#x5b57;&#x6bb5;</to><enabled>Y</enabled> </hop>
  310 + </order>
  311 + <step>
  312 + <name>ETL&#x5143;&#x6570;&#x636e;&#x6ce8;&#x5165;</name>
  313 + <type>MetaInject</type>
  314 + <description/>
  315 + <distribute>Y</distribute>
  316 + <custom_distribution/>
  317 + <copies>1</copies>
  318 + <partitioning>
  319 + <method>none</method>
  320 + <schema_name/>
  321 + </partitioning>
  322 + <specification_method>filename</specification_method>
  323 + <trans_object_id/>
  324 + <trans_name/>
  325 + <filename>&#x24;&#x7b;injectktrfile&#x7d;</filename>
  326 + <directory_path/>
  327 + <source_step/>
  328 + <source_output_fields> </source_output_fields> <target_file/>
  329 + <no_execution>N</no_execution>
  330 + <stream_source_step/>
  331 + <stream_target_step/>
  332 + <mappings> <mapping> <target_step_name>&#x5217;&#x8f6c;&#x884c;</target_step_name>
  333 + <target_attribute_key>TARGET_TYPE</target_attribute_key>
  334 + <target_detail>Y</target_detail>
  335 + <source_step>&#x8ba1;&#x7b97;&#x53cd;&#x8303;&#x5f0f;&#x5143;&#x6570;&#x636e;</source_step>
  336 + <source_field>targettype</source_field>
  337 + </mapping> <mapping> <target_step_name>Excel&#x8f93;&#x51fa;</target_step_name>
  338 + <target_attribute_key>TYPE</target_attribute_key>
  339 + <target_detail>Y</target_detail>
  340 + <source_step>&#x6392;&#x5e8f;&#x8bb0;&#x5f55;</source_step>
  341 + <source_field>fieldtype</source_field>
  342 + </mapping> <mapping> <target_step_name>&#x5217;&#x8f6c;&#x884c;</target_step_name>
  343 + <target_attribute_key>NAME</target_attribute_key>
  344 + <target_detail>Y</target_detail>
  345 + <source_step>&#x8ba1;&#x7b97;&#x53cd;&#x8303;&#x5f0f;&#x5143;&#x6570;&#x636e;</source_step>
  346 + <source_field>valuefieldname</source_field>
  347 + </mapping> <mapping> <target_step_name>Excel&#x8f93;&#x51fa;</target_step_name>
  348 + <target_attribute_key>NAME</target_attribute_key>
  349 + <target_detail>Y</target_detail>
  350 + <source_step>&#x6392;&#x5e8f;&#x8bb0;&#x5f55;</source_step>
  351 + <source_field>fieldname</source_field>
  352 + </mapping> <mapping> <target_step_name>&#x5217;&#x8f6c;&#x884c;</target_step_name>
  353 + <target_attribute_key>TARGET_NAME</target_attribute_key>
  354 + <target_detail>Y</target_detail>
  355 + <source_step>&#x8ba1;&#x7b97;&#x53cd;&#x8303;&#x5f0f;&#x5143;&#x6570;&#x636e;</source_step>
  356 + <source_field>targetfieldname</source_field>
  357 + </mapping> <mapping> <target_step_name>&#x5217;&#x8f6c;&#x884c;</target_step_name>
  358 + <target_attribute_key>KEY_VALUE</target_attribute_key>
  359 + <target_detail>Y</target_detail>
  360 + <source_step>&#x8ba1;&#x7b97;&#x53cd;&#x8303;&#x5f0f;&#x5143;&#x6570;&#x636e;</source_step>
  361 + <source_field>keyvalue</source_field>
  362 + </mapping> </mappings> <cluster_schema/>
  363 + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
  364 + <xloc>640</xloc>
  365 + <yloc>64</yloc>
  366 + <draw>Y</draw>
  367 + </GUI>
  368 + </step>
  369 +
  370 + <step>
  371 + <name>&#x5b57;&#x6bb5;&#x9009;&#x62e9;</name>
  372 + <type>SelectValues</type>
  373 + <description/>
  374 + <distribute>Y</distribute>
  375 + <custom_distribution/>
  376 + <copies>1</copies>
  377 + <partitioning>
  378 + <method>none</method>
  379 + <schema_name/>
  380 + </partitioning>
  381 + <fields> <field> <name>fieldname</name>
  382 + <rename/>
  383 + <length>-2</length>
  384 + <precision>-2</precision>
  385 + </field> <field> <name>fieldtype</name>
  386 + <rename/>
  387 + <length>-2</length>
  388 + <precision>-2</precision>
  389 + </field> <field> <name>fcno</name>
  390 + <rename/>
  391 + <length>-2</length>
  392 + <precision>-2</precision>
  393 + </field> <select_unspecified>N</select_unspecified>
  394 + </fields> <cluster_schema/>
  395 + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
  396 + <xloc>533</xloc>
  397 + <yloc>325</yloc>
  398 + <draw>Y</draw>
  399 + </GUI>
  400 + </step>
  401 +
  402 + <step>
  403 + <name>&#x6392;&#x5e8f;&#x8bb0;&#x5f55;</name>
  404 + <type>SortRows</type>
  405 + <description/>
  406 + <distribute>Y</distribute>
  407 + <custom_distribution/>
  408 + <copies>1</copies>
  409 + <partitioning>
  410 + <method>none</method>
  411 + <schema_name/>
  412 + </partitioning>
  413 + <directory>&#x25;&#x25;java.io.tmpdir&#x25;&#x25;</directory>
  414 + <prefix>out</prefix>
  415 + <sort_size>1000000</sort_size>
  416 + <free_memory/>
  417 + <compress>N</compress>
  418 + <compress_variable/>
  419 + <unique_rows>N</unique_rows>
  420 + <fields>
  421 + <field>
  422 + <name>fcno</name>
  423 + <ascending>Y</ascending>
  424 + <case_sensitive>N</case_sensitive>
  425 + <presorted>N</presorted>
  426 + </field>
  427 + </fields>
  428 + <cluster_schema/>
  429 + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
  430 + <xloc>642</xloc>
  431 + <yloc>325</yloc>
  432 + <draw>Y</draw>
  433 + </GUI>
  434 + </step>
  435 +
  436 + <step>
  437 + <name>&#x65f6;&#x523b;&#x8868;&#x660e;&#x7ec6;&#x5206;&#x7ec4;&#x6570;&#x636e;</name>
  438 + <type>TableInput</type>
  439 + <description/>
  440 + <distribute>Y</distribute>
  441 + <custom_distribution/>
  442 + <copies>1</copies>
  443 + <partitioning>
  444 + <method>none</method>
  445 + <schema_name/>
  446 + </partitioning>
  447 + <connection>bus_control_variable</connection>
  448 + <sql>select &#xa;fcno&#xa;, min&#x28;xl&#x29; xl &#xa;, min&#x28;xl_dir&#x29; xl_dir&#xa;, min&#x28;qdz_code&#x29; qdz&#xa;, min&#x28;zdz_code&#x29; zdz&#xa;, min&#x28;bc_type&#x29; bc_type &#xa;, min&#x28;line_version&#x29; line_version&#xa;from bsth_c_s_ttinfo_detail&#xa;where ttinfo &#x3d; &#x24;&#x7b;ttinfoid&#x7d;&#xa;group by fcno</sql>
  449 + <limit>0</limit>
  450 + <lookup/>
  451 + <execute_each_row>N</execute_each_row>
  452 + <variables_active>Y</variables_active>
  453 + <lazy_conversion_active>N</lazy_conversion_active>
  454 + <cluster_schema/>
  455 + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
  456 + <xloc>56</xloc>
  457 + <yloc>192</yloc>
  458 + <draw>Y</draw>
  459 + </GUI>
  460 + </step>
  461 +
  462 + <step>
  463 + <name>&#x751f;&#x6210;&#x8def;&#x724c;&#x5b57;&#x6bb5;</name>
  464 + <type>RowGenerator</type>
  465 + <description/>
  466 + <distribute>Y</distribute>
  467 + <custom_distribution/>
  468 + <copies>1</copies>
  469 + <partitioning>
  470 + <method>none</method>
  471 + <schema_name/>
  472 + </partitioning>
  473 + <fields>
  474 + <field>
  475 + <name>fieldname</name>
  476 + <type>String</type>
  477 + <format/>
  478 + <currency/>
  479 + <decimal/>
  480 + <group/>
  481 + <nullif>&#x8def;&#x724c;</nullif>
  482 + <length>-1</length>
  483 + <precision>-1</precision>
  484 + <set_empty_string>N</set_empty_string>
  485 + </field>
  486 + <field>
  487 + <name>fieldtype</name>
  488 + <type>String</type>
  489 + <format/>
  490 + <currency/>
  491 + <decimal/>
  492 + <group/>
  493 + <nullif>String</nullif>
  494 + <length>-1</length>
  495 + <precision>-1</precision>
  496 + <set_empty_string>N</set_empty_string>
  497 + </field>
  498 + <field>
  499 + <name>fcno</name>
  500 + <type>Integer</type>
  501 + <format/>
  502 + <currency/>
  503 + <decimal/>
  504 + <group/>
  505 + <nullif>0</nullif>
  506 + <length>-1</length>
  507 + <precision>-1</precision>
  508 + <set_empty_string>N</set_empty_string>
  509 + </field>
  510 + </fields>
  511 + <limit>1</limit>
  512 + <never_ending>N</never_ending>
  513 + <interval_in_ms>5000</interval_in_ms>
  514 + <row_time_field>now</row_time_field>
  515 + <last_time_field>FiveSecondsAgo</last_time_field>
  516 + <cluster_schema/>
  517 + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
  518 + <xloc>530</xloc>
  519 + <yloc>194</yloc>
  520 + <draw>Y</draw>
  521 + </GUI>
  522 + </step>
  523 +
  524 + <step>
  525 + <name>&#x8ba1;&#x7b97;excel&#x8f93;&#x51fa;&#x5b57;&#x6bb5;</name>
  526 + <type>ScriptValueMod</type>
  527 + <description/>
  528 + <distribute>Y</distribute>
  529 + <custom_distribution/>
  530 + <copies>1</copies>
  531 + <partitioning>
  532 + <method>none</method>
  533 + <schema_name/>
  534 + </partitioning>
  535 + <compatible>N</compatible>
  536 + <optimizationLevel>9</optimizationLevel>
  537 + <jsScripts> <jsScript> <jsScript_type>0</jsScript_type>
  538 + <jsScript_name>Script 1</jsScript_name>
  539 + <jsScript_script>&#x2f;&#x2f;Script here&#xa;&#xa;var fieldname&#x3b; &#x2f;&#x2f; &#x5b57;&#x6bb5;&#x540d;&#xa;var fieldtype&#x3b; &#x2f;&#x2f; &#x5b57;&#x6bb5;&#x7c7b;&#x578b;&#xa;&#xa;if &#x28;bc_type &#x3d;&#x3d; &#x27;in&#x27;&#x29; &#x7b;&#xa; fieldname &#x3d; &#x27;&#x8fdb;&#x573a;&#x27; &#x2b; &#x22;-&#x3e;&#x22; &#x2b; fcno&#x3b;&#xa;&#x7d; else if &#x28;bc_type &#x3d;&#x3d; &#x27;out&#x27;&#x29; &#x7b;&#xa; fieldname &#x3d; &#x27;&#x51fa;&#x573a;&#x27; &#x2b; &#x22;-&#x3e;&#x22; &#x2b; fcno&#x3b;&#xa;&#x7d; else if &#x28;bc_type &#x3d;&#x3d; &#x27;normal&#x27;&#x29; &#x7b;&#xa; fieldname &#x3d; zdname &#x2b; &#x22;-&#x3e;&#x22; &#x2b; fcno&#x3b;&#xa;&#x7d; else &#x7b;&#xa; fieldname &#x3d; zdname &#x2b; &#x22;-&#x3e;&#x22; &#x2b; fcno&#x3b;&#xa;&#x7d; &#xa;&#xa;fieldtype &#x3d; &#x27;String&#x27;&#x3b;&#xa;</jsScript_script>
  540 + </jsScript> </jsScripts> <fields> <field> <name>fieldname</name>
  541 + <rename>fieldname</rename>
  542 + <type>String</type>
  543 + <length>-1</length>
  544 + <precision>-1</precision>
  545 + <replace>N</replace>
  546 + </field> <field> <name>fieldtype</name>
  547 + <rename>fieldtype</rename>
  548 + <type>String</type>
  549 + <length>-1</length>
  550 + <precision>-1</precision>
  551 + <replace>N</replace>
  552 + </field> </fields> <cluster_schema/>
  553 + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
  554 + <xloc>410</xloc>
  555 + <yloc>326</yloc>
  556 + <draw>Y</draw>
  557 + </GUI>
  558 + </step>
  559 +
  560 + <step>
  561 + <name>&#x8ba1;&#x7b97;&#x53cd;&#x8303;&#x5f0f;&#x5143;&#x6570;&#x636e;</name>
  562 + <type>ScriptValueMod</type>
  563 + <description/>
  564 + <distribute>Y</distribute>
  565 + <custom_distribution/>
  566 + <copies>1</copies>
  567 + <partitioning>
  568 + <method>none</method>
  569 + <schema_name/>
  570 + </partitioning>
  571 + <compatible>N</compatible>
  572 + <optimizationLevel>9</optimizationLevel>
  573 + <jsScripts> <jsScript> <jsScript_type>0</jsScript_type>
  574 + <jsScript_name>Script 1</jsScript_name>
  575 + <jsScript_script>&#x2f;&#x2f;Script here&#xa;&#xa;var targetfieldname&#x3b; &#x2f;&#x2f; &#x76ee;&#x6807;&#x5b57;&#x6bb5;&#x540d;&#xa;var targettype&#x3b; &#x2f;&#x2f; &#x76ee;&#x6807;&#x7c7b;&#x578b;&#xa;var valuefieldname&#x3b; &#x2f;&#x2f; &#x503c;&#x5b57;&#x6bb5;&#x540d;&#xa;var keyvalue&#x3b; &#x2f;&#x2f; &#x5173;&#x952e;&#x5b57;&#x503c;&#xa;&#xa;if &#x28;bc_type &#x3d;&#x3d; &#x27;in&#x27;&#x29; &#x7b;&#xa; targetfieldname &#x3d; &#x27;&#x8fdb;&#x573a;&#x27; &#x2b; &#x22;-&#x3e;&#x22; &#x2b; fcno&#x3b;&#xa;&#x7d; else if &#x28;bc_type &#x3d;&#x3d; &#x27;out&#x27;&#x29; &#x7b;&#xa; targetfieldname &#x3d; &#x27;&#x51fa;&#x573a;&#x27; &#x2b; &#x22;-&#x3e;&#x22; &#x2b; fcno&#x3b;&#xa;&#x7d; else if &#x28;bc_type &#x3d;&#x3d; &#x27;normal&#x27;&#x29; &#x7b;&#xa; targetfieldname &#x3d; zdname &#x2b; &#x22;-&#x3e;&#x22; &#x2b; fcno&#x3b;&#xa;&#x7d; else &#x7b;&#xa; targetfieldname &#x3d; zdname &#x2b; &#x22;-&#x3e;&#x22; &#x2b; fcno&#x3b;&#xa;&#x7d; &#xa;&#xa;targettype &#x3d; &#x27;String&#x27;&#x3b;&#xa;valuefieldname &#x3d; &#x27;fcsj&#x27;&#x3b;&#xa;keyvalue &#x3d; fcno&#x3b;&#xa;</jsScript_script>
  576 + </jsScript> </jsScripts> <fields> <field> <name>targetfieldname</name>
  577 + <rename>targetfieldname</rename>
  578 + <type>String</type>
  579 + <length>-1</length>
  580 + <precision>-1</precision>
  581 + <replace>N</replace>
  582 + </field> <field> <name>targettype</name>
  583 + <rename>targettype</rename>
  584 + <type>String</type>
  585 + <length>-1</length>
  586 + <precision>-1</precision>
  587 + <replace>N</replace>
  588 + </field> <field> <name>valuefieldname</name>
  589 + <rename>valuefieldname</rename>
  590 + <type>String</type>
  591 + <length>-1</length>
  592 + <precision>-1</precision>
  593 + <replace>N</replace>
  594 + </field> <field> <name>keyvalue</name>
  595 + <rename>keyvalue</rename>
  596 + <type>String</type>
  597 + <length>-1</length>
  598 + <precision>-1</precision>
  599 + <replace>N</replace>
  600 + </field> </fields> <cluster_schema/>
  601 + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
  602 + <xloc>410</xloc>
  603 + <yloc>64</yloc>
  604 + <draw>Y</draw>
  605 + </GUI>
  606 + </step>
  607 +
  608 + <step>
  609 + <name>&#x8ba1;&#x7b97;&#x7ad9;&#x70b9;</name>
  610 + <type>ScriptValueMod</type>
  611 + <description/>
  612 + <distribute>Y</distribute>
  613 + <custom_distribution/>
  614 + <copies>1</copies>
  615 + <partitioning>
  616 + <method>none</method>
  617 + <schema_name/>
  618 + </partitioning>
  619 + <compatible>N</compatible>
  620 + <optimizationLevel>9</optimizationLevel>
  621 + <jsScripts> <jsScript> <jsScript_type>0</jsScript_type>
  622 + <jsScript_name>Script 1</jsScript_name>
  623 + <jsScript_script>&#x2f;&#x2f;Script here&#xa;&#xa;&#x2f;&#x2a;&#xa;var zd&#x3b;&#xa;&#xa;if &#x28;bc_type &#x3d;&#x3d; &#x27;in&#x27;&#x29; &#x7b;&#xa; zd &#x3d; qdz&#x3b;&#xa;&#x7d; else if &#x28;bc_type &#x3d;&#x3d; &#x27;out&#x27;&#x29; &#x7b;&#xa; zd &#x3d; zdz&#x3b;&#xa;&#x7d; else if &#x28;bc_type &#x3d;&#x3d; &#x27;normal&#x27;&#x29; &#x7b;&#xa; zd &#x3d; qdz&#x3b;&#xa;&#x7d; else &#x7b;&#xa; zd &#x3d; qdz&#x3b;&#xa;&#x7d;&#xa;&#x2a;&#x2f;&#xa;&#xa;&#x2f;&#x2f; &#x7ad9;&#x70b9;&#x6807;&#x5fd7;&#xa;var smark &#x3d; &#x22;B&#x22;&#x3b;&#xa;var destroy &#x3d; 0&#x3b;</jsScript_script>
  624 + </jsScript> </jsScripts> <fields> <field> <name>smark</name>
  625 + <rename>smark</rename>
  626 + <type>String</type>
  627 + <length>-1</length>
  628 + <precision>-1</precision>
  629 + <replace>N</replace>
  630 + </field> <field> <name>destroy</name>
  631 + <rename>destroy</rename>
  632 + <type>Number</type>
  633 + <length>16</length>
  634 + <precision>2</precision>
  635 + <replace>N</replace>
  636 + </field> </fields> <cluster_schema/>
  637 + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
  638 + <xloc>300</xloc>
  639 + <yloc>190</yloc>
  640 + <draw>Y</draw>
  641 + </GUI>
  642 + </step>
  643 +
  644 + <step>
  645 + <name>&#x8fc7;&#x6ee4;&#x8bb0;&#x5f55;</name>
  646 + <type>FilterRows</type>
  647 + <description/>
  648 + <distribute>Y</distribute>
  649 + <custom_distribution/>
  650 + <copies>1</copies>
  651 + <partitioning>
  652 + <method>none</method>
  653 + <schema_name/>
  654 + </partitioning>
  655 +<send_true_to/>
  656 +<send_false_to/>
  657 + <compare>
  658 +<condition>
  659 + <negated>N</negated>
  660 + <conditions>
  661 + <condition>
  662 + <negated>N</negated>
  663 + <leftvalue>bc_type</leftvalue>
  664 + <function>IS NOT NULL</function>
  665 + <rightvalue/>
  666 + </condition>
  667 + </conditions>
  668 + </condition>
  669 + </compare>
  670 + <cluster_schema/>
  671 + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
  672 + <xloc>182</xloc>
  673 + <yloc>189</yloc>
  674 + <draw>Y</draw>
  675 + </GUI>
  676 + </step>
  677 +
  678 + <step>
  679 + <name>&#x67e5;&#x627e;&#x8d77;&#x70b9;&#x7ad9;</name>
  680 + <type>DBLookup</type>
  681 + <description/>
  682 + <distribute>N</distribute>
  683 + <custom_distribution/>
  684 + <copies>1</copies>
  685 + <partitioning>
  686 + <method>none</method>
  687 + <schema_name/>
  688 + </partitioning>
  689 + <connection>bus_control_variable</connection>
  690 + <cache>N</cache>
  691 + <cache_load_all>Y</cache_load_all>
  692 + <cache_size>0</cache_size>
  693 + <lookup>
  694 + <schema/>
  695 + <table>bsth_c_ls_stationroute</table>
  696 + <orderby/>
  697 + <fail_on_multiple>N</fail_on_multiple>
  698 + <eat_row_on_failure>N</eat_row_on_failure>
  699 + <key>
  700 + <name>xl</name>
  701 + <field>line</field>
  702 + <condition>&#x3d;</condition>
  703 + <name2/>
  704 + </key>
  705 + <key>
  706 + <name>xl_dir</name>
  707 + <field>directions</field>
  708 + <condition>&#x3d;</condition>
  709 + <name2/>
  710 + </key>
  711 + <key>
  712 + <name>line_version</name>
  713 + <field>versions</field>
  714 + <condition>&#x3d;</condition>
  715 + <name2/>
  716 + </key>
  717 + <key>
  718 + <name>smark</name>
  719 + <field>station_mark</field>
  720 + <condition>&#x3d;</condition>
  721 + <name2/>
  722 + </key>
  723 + <key>
  724 + <name>destroy</name>
  725 + <field>destroy</field>
  726 + <condition>&#x3d;</condition>
  727 + <name2/>
  728 + </key>
  729 + <value>
  730 + <name>station_name</name>
  731 + <rename>zdname</rename>
  732 + <default/>
  733 + <type>String</type>
  734 + </value>
  735 + </lookup>
  736 + <cluster_schema/>
  737 + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
  738 + <xloc>412</xloc>
  739 + <yloc>189</yloc>
  740 + <draw>Y</draw>
  741 + </GUI>
  742 + </step>
  743 +
  744 + <step_error_handling>
  745 + </step_error_handling>
  746 + <slave-step-copy-partition-distribution>
  747 +</slave-step-copy-partition-distribution>
  748 + <slave_transformation>N</slave_transformation>
  749 +
  750 +</transformation>
src/main/resources/static/index.html
@@ -61,9 +61,9 @@ @@ -61,9 +61,9 @@
61 href="/metronic_v4.5.4/plugins/bootstrap-datetimepicker-2/css/bootstrap-datetimepicker.min.css" 61 href="/metronic_v4.5.4/plugins/bootstrap-datetimepicker-2/css/bootstrap-datetimepicker.min.css"
62 rel="stylesheet" type="text/css" /> 62 rel="stylesheet" type="text/css" />
63 <!-- table 表格控件 --> 63 <!-- table 表格控件 -->
64 - <link rel="stylesheet"  
65 - href="http://api.map.baidu.com/library/DrawingManager/1.4/src/DrawingManager_min.css"  
66 - type="text/css" /> 64 + <!--<link rel="stylesheet"-->
  65 + <!--href="http://api.map.baidu.com/library/DrawingManager/1.4/src/DrawingManager_min.css"-->
  66 + <!--type="text/css" />-->
67 <link href="/metronic_v4.5.4/plugins/bootstrap-tagsinput/bootstrap-tagsinput.css" rel="stylesheet" type="text/css"/> 67 <link href="/metronic_v4.5.4/plugins/bootstrap-tagsinput/bootstrap-tagsinput.css" rel="stylesheet" type="text/css"/>
68 <!-- handsontable样式 --> 68 <!-- handsontable样式 -->
69 <link rel="stylesheet" 69 <link rel="stylesheet"
@@ -612,24 +612,24 @@ @@ -612,24 +612,24 @@
612 612
613 <!-- 地图相关 --> 613 <!-- 地图相关 -->
614 <!-- 百度 --> 614 <!-- 百度 -->
615 -<script  
616 - src="http://api.map.baidu.com/api?v=2.0&ak=IGGrr4UjwIYzatoCRFKEL8sT"  
617 - data-exclude=1></script>  
618 -<script  
619 - src="http://api.map.baidu.com/library/TrafficControl/1.4/src/TrafficControl_min.js"  
620 - data-exclude=1></script>  
621 -<script type="text/javascript"  
622 - src="http://api.map.baidu.com/library/DrawingManager/1.4/src/DrawingManager_min.js"  
623 - data-exclude=1></script>  
624 -<script type="text/javascript"  
625 - src="http://api.map.baidu.com/library/RichMarker/1.2/src/RichMarker_min.js "  
626 - data-exclude=1></script> 615 +<!--<script-->
  616 + <!--src="http://api.map.baidu.com/api?v=2.0&ak=IGGrr4UjwIYzatoCRFKEL8sT"-->
  617 + <!--data-exclude=1></script>-->
  618 +<!--<script-->
  619 + <!--src="http://api.map.baidu.com/library/TrafficControl/1.4/src/TrafficControl_min.js"-->
  620 + <!--data-exclude=1></script>-->
  621 +<!--<script type="text/javascript"-->
  622 + <!--src="http://api.map.baidu.com/library/DrawingManager/1.4/src/DrawingManager_min.js"-->
  623 + <!--data-exclude=1></script>-->
  624 +<!--<script type="text/javascript"-->
  625 + <!--src="http://api.map.baidu.com/library/RichMarker/1.2/src/RichMarker_min.js "-->
  626 + <!--data-exclude=1></script>-->
627 <script src="/assets/js/baidu/TextIconOverlay.js" data-exclude=1></script> 627 <script src="/assets/js/baidu/TextIconOverlay.js" data-exclude=1></script>
628 <script src="/assets/js/baidu//MarkerClusterer.js" data-exclude=1></script> 628 <script src="/assets/js/baidu//MarkerClusterer.js" data-exclude=1></script>
629 <!-- 高德 --> 629 <!-- 高德 -->
630 -<script  
631 - src="http://webapi.amap.com/maps?v=1.3&key=16cb1c5043847e09ef9edafdd77befda"  
632 - data-exclude=1></script> 630 +<!--<script-->
  631 + <!--src="http://webapi.amap.com/maps?v=1.3&key=16cb1c5043847e09ef9edafdd77befda"-->
  632 + <!--data-exclude=1></script>-->
633 633
634 <script src="/real_control_v2/assets/plugins/perfect-scrollbar/perfect-scrollbar.jquery.js" merge="plugins"></script> 634 <script src="/real_control_v2/assets/plugins/perfect-scrollbar/perfect-scrollbar.jquery.js" merge="plugins"></script>
635 635
src/main/resources/static/pages/base/carpark/js/carpark-list-table.js
@@ -24,7 +24,25 @@ @@ -24,7 +24,25 @@
24 return cb && cb(gs_d); 24 return cb && cb(gs_d);
25 }); 25 });
26 } 26 }
27 - initCompanySelect2(function(array) { 27 + // 营运公司Map[key(businessCode)] = 名字
  28 + var companyMap = new Map();
  29 + // 分公司Map[key(upCode+_+businessCode)] = 名字
  30 + var branchMap = new Map();
  31 + initCompanySelect2(function(array) {
  32 + $.each(array, function() {
  33 + companyMap[this.businessCode] = this.businessName;
  34 + // companyMap.put(this.businessCode.toString(), this.businessName);
  35 + if(this.businessCode != null || this.businessCode !=''){
  36 + /** 查询出所属公司下的分公司名称和相应分公司代码 @param:<upCode_eq:公司代码> */
  37 + $get('/business/all', {upCode_eq: this.businessCode}, function(array){
  38 + // 遍历array
  39 + $.each(array, function(i,d){
  40 + branchMap[this.upCode+"_"+this.businessCode] = this.businessName;
  41 + // branchMap.put(this.upCode+"_"+this.businessCode, this.businessName);
  42 + });
  43 + });
  44 + }
  45 + });
28 // 公司下拉options属性值 46 // 公司下拉options属性值
29 var options = '<option value="">请选择...</option>'; 47 var options = '<option value="">请选择...</option>';
30 // 遍历array 48 // 遍历array
@@ -202,6 +220,10 @@ @@ -202,6 +220,10 @@
202 $.get('/carpark',params,function(result){ 220 $.get('/carpark',params,function(result){
203 // 添加序号 221 // 添加序号
204 result.content.page = page; 222 result.content.page = page;
  223 + $.each(result.content, function(i, data) {
  224 + result.content[i].gsmc = companyMap[data.company];
  225 + result.content[i].fgsmc = branchMap[data.cgsbm];
  226 + });
205 // 把数据填充到模版中 227 // 把数据填充到模版中
206 var tbodyHtml = template('carpark_list_table_temp',{list:result.content}); 228 var tbodyHtml = template('carpark_list_table_temp',{list:result.content});
207 $('#datatable_carpark tbody').html(tbodyHtml); 229 $('#datatable_carpark tbody').html(tbodyHtml);
src/main/resources/static/pages/base/carpark/list.html
@@ -114,7 +114,8 @@ @@ -114,7 +114,8 @@
114 {{obj.area}} 114 {{obj.area}}
115 </td> 115 </td>
116 <td> 116 <td>
117 - {{if obj.company == '55'}} 117 + {{obj.gsmc}}
  118 + <!--{{if obj.company == '55'}}
118 上南公司 119 上南公司
119 {{else if obj.company == '22'}} 120 {{else if obj.company == '22'}}
120 金高公司 121 金高公司
@@ -124,10 +125,11 @@ @@ -124,10 +125,11 @@
124 南汇公司 125 南汇公司
125 {{else if obj.company == '77'}} 126 {{else if obj.company == '77'}}
126 闵行公司 127 闵行公司
127 - {{/if}} 128 + {{/if}}-->
128 </td> 129 </td>
129 <td> 130 <td>
130 - {{if obj.company == '55'}} 131 + {{obj.fgsmc}}
  132 + <!--{{if obj.company == '55'}}
131 133
132 {{if obj.brancheCompany == '1'}} 134 {{if obj.brancheCompany == '1'}}
133 上南二分公司 135 上南二分公司
@@ -179,7 +181,7 @@ @@ -179,7 +181,7 @@
179 南汇公司 181 南汇公司
180 {{/if}} 182 {{/if}}
181 183
182 - {{/if}} 184 + {{/if}}-->
183 </td> 185 </td>
184 <td> 186 <td>
185 {{obj.versions}} 187 {{obj.versions}}
src/main/resources/static/pages/base/line/js/line-list-table.js
@@ -44,7 +44,25 @@ @@ -44,7 +44,25 @@
44 setTimeout(function(){$('.tipso-animation').tipso('hide');},4000); 44 setTimeout(function(){$('.tipso-animation').tipso('hide');},4000);
45 },200); 45 },200);
46 } 46 }
  47 + // 营运公司Map[key(businessCode)] = 名字
  48 + var companyMap = new Map();
  49 + // 分公司Map[key(upCode+_+businessCode)] = 名字
  50 + var branchMap = new Map();
47 initCompanySelect2(function(array) { 51 initCompanySelect2(function(array) {
  52 + $.each(array, function() {
  53 + companyMap[this.businessCode] = this.businessName;
  54 + // companyMap.put(this.businessCode.toString(), this.businessName);
  55 + if(this.businessCode != null || this.businessCode !=''){
  56 + /** 查询出所属公司下的分公司名称和相应分公司代码 @param:<upCode_eq:公司代码> */
  57 + $get('/business/all', {upCode_eq: this.businessCode}, function(array){
  58 + // 遍历array
  59 + $.each(array, function(i,d){
  60 + branchMap[this.upCode+"_"+this.businessCode] = this.businessName;
  61 + // branchMap.put(this.upCode+"_"+this.businessCode, this.businessName);
  62 + });
  63 + });
  64 + }
  65 + });
48 // 公司下拉options属性值 66 // 公司下拉options属性值
49 var options = '<option value="">请选择...</option>'; 67 var options = '<option value="">请选择...</option>';
50 // 遍历array 68 // 遍历array
@@ -184,7 +202,11 @@ @@ -184,7 +202,11 @@
184 $.get('/line',params,function(result){ 202 $.get('/line',params,function(result){
185 // 添加序号 203 // 添加序号
186 result.content.page = page; 204 result.content.page = page;
187 - // 把数据填充到模版中 205 + $.each(result.content, function(i, data) {
  206 + result.content[i].gsmc = companyMap[data.company];
  207 + result.content[i].fgsmc = branchMap[data.cgsbm];
  208 + });
  209 + // 把数据填充到模版中
188 var tbodyHtml = template('line_list_temp',{list:result.content}); 210 var tbodyHtml = template('line_list_temp',{list:result.content});
189 // 把渲染好的模版html文本追加到表格中 211 // 把渲染好的模版html文本追加到表格中
190 $('#datatable_line tbody').html(tbodyHtml); 212 $('#datatable_line tbody').html(tbodyHtml);
src/main/resources/static/pages/base/line/list.html
@@ -232,7 +232,8 @@ @@ -232,7 +232,8 @@
232 {{obj.name}} 232 {{obj.name}}
233 </td> 233 </td>
234 <td> 234 <td>
235 - {{if obj.company == '55'}} 235 + {{obj.gsmc}}
  236 + <!--{{if obj.company == '55'}}
236 上南公司 237 上南公司
237 {{else if obj.company == '22'}} 238 {{else if obj.company == '22'}}
238 金高公司 239 金高公司
@@ -242,10 +243,11 @@ @@ -242,10 +243,11 @@
242 南汇公司 243 南汇公司
243 {{else if obj.company == '77'}} 244 {{else if obj.company == '77'}}
244 闵行公司 245 闵行公司
245 - {{/if}} 246 + {{/if}}-->
246 </td> 247 </td>
247 <td> 248 <td>
248 - {{if obj.company == '55'}} 249 + {{obj.fgsmc}}
  250 + <!--{{if obj.company == '55'}}
249 251
250 {{if obj.brancheCompany == '1'}} 252 {{if obj.brancheCompany == '1'}}
251 上南二分公司 253 上南二分公司
@@ -299,7 +301,7 @@ @@ -299,7 +301,7 @@
299 航头枢纽站 301 航头枢纽站
300 {{/if}} 302 {{/if}}
301 303
302 - {{/if}} 304 + {{/if}}-->
303 </td> 305 </td>
304 <td> 306 <td>
305 {{if obj.nature == 'lj'}} 307 {{if obj.nature == 'lj'}}
@@ -347,6 +349,7 @@ @@ -347,6 +349,7 @@
347 <a href="/pages/base/lineinformation/list.html?no={{obj.id}}" class="btn default blue-stripe btn-sm" data-pjax> 查看 </a> 349 <a href="/pages/base/lineinformation/list.html?no={{obj.id}}" class="btn default blue-stripe btn-sm" data-pjax> 查看 </a>
348 </td> 350 </td>
349 <td> 351 <td>
  352 + <a href="/pages/base/stationroute/list.html?no={{obj.id}}" class="btn default blue-stripe btn-sm" data-pjax> 查看</a>
350 <a href="javascript:window.localStorage.setItem('geo_data_edit_line_code' , '{{obj.lineCode}}');window.localStorage.removeItem('geo_data_edit_line_version');window.location.href='/pages/base/geo_data_edit/uk3_wrap.html';" class="btn default blue-stripe btn-sm" data-pjax> 查看 </a> 353 <a href="javascript:window.localStorage.setItem('geo_data_edit_line_code' , '{{obj.lineCode}}');window.localStorage.removeItem('geo_data_edit_line_version');window.location.href='/pages/base/geo_data_edit/uk3_wrap.html';" class="btn default blue-stripe btn-sm" data-pjax> 查看 </a>
351 </td> 354 </td>
352 <td> 355 <td>
src/main/resources/static/pages/base/lineversions/js/lineversions-list-table.js
@@ -34,7 +34,25 @@ @@ -34,7 +34,25 @@
34 setTimeout(function(){$('.tipso-animation').tipso('hide');},4000); 34 setTimeout(function(){$('.tipso-animation').tipso('hide');},4000);
35 },200); 35 },200);
36 } 36 }
  37 + // 营运公司Map[key(businessCode)] = 名字
  38 + var companyMap = new Map();
  39 + // 分公司Map[key(upCode+_+businessCode)] = 名字
  40 + var branchMap = new Map();
37 initCompanySelect2(function(array) { 41 initCompanySelect2(function(array) {
  42 + $.each(array, function() {
  43 + companyMap[this.businessCode] = this.businessName;
  44 + // companyMap.put(this.businessCode.toString(), this.businessName);
  45 + if(this.businessCode != null || this.businessCode !=''){
  46 + /** 查询出所属公司下的分公司名称和相应分公司代码 @param:<upCode_eq:公司代码> */
  47 + $get('/business/all', {upCode_eq: this.businessCode}, function(array){
  48 + // 遍历array
  49 + $.each(array, function(i,d){
  50 + branchMap[this.upCode+"_"+this.businessCode] = this.businessName;
  51 + // branchMap.put(this.upCode+"_"+this.businessCode, this.businessName);
  52 + });
  53 + });
  54 + }
  55 + });
38 // 公司下拉options属性值 56 // 公司下拉options属性值
39 var options = '<option value="">请选择...</option>'; 57 var options = '<option value="">请选择...</option>';
40 // 遍历array 58 // 遍历array
@@ -161,10 +179,12 @@ @@ -161,10 +179,12 @@
161 // 添加序号 179 // 添加序号
162 result.content.page = page; 180 result.content.page = page;
163 // 把数据填充到模版中 181 // 把数据填充到模版中
164 - $.each(result.content, function(){  
165 - this.startDateStr=moment(this.startDate).format('YYYY-MM-DD HH:mm:ss');  
166 - this.endDateStr=moment(this.endDate).format('YYYY-MM-DD HH:mm:ss');  
167 - }) 182 + $.each(result.content, function(i, data) {
  183 + result.content[i].gsmc = companyMap[data.line.company];
  184 + result.content[i].fgsmc = branchMap[data.line.cgsbm];
  185 + data.startDateStr=moment(data.startDate).format('YYYY-MM-DD HH:mm:ss');
  186 + data.endDateStr=moment(data.endDate).format('YYYY-MM-DD HH:mm:ss');
  187 + });
168 188
169 var tbodyHtml = template('lineversions_list_temp',{list:result.content}); 189 var tbodyHtml = template('lineversions_list_temp',{list:result.content});
170 $('#datatable_lineversions tbody').html(tbodyHtml); 190 $('#datatable_lineversions tbody').html(tbodyHtml);
src/main/resources/static/pages/base/lineversions/list.html
@@ -118,7 +118,8 @@ @@ -118,7 +118,8 @@
118 {{obj.line.name}} 118 {{obj.line.name}}
119 </td> 119 </td>
120 <td> 120 <td>
121 - {{if obj.line.company == '55'}} 121 + {{obj.gsmc}}
  122 + <!--{{if obj.line.company == '55'}}
122 上南公司 123 上南公司
123 {{else if obj.line.company == '22'}} 124 {{else if obj.line.company == '22'}}
124 金高公司 125 金高公司
@@ -128,10 +129,11 @@ @@ -128,10 +129,11 @@
128 南汇公司 129 南汇公司
129 {{else if obj.line.company == '77'}} 130 {{else if obj.line.company == '77'}}
130 闵行公司 131 闵行公司
131 - {{/if}} 132 + {{/if}}-->
132 </td> 133 </td>
133 <td> 134 <td>
134 - {{if obj.line.company == '55'}} 135 + {{obj.fgsmc}}
  136 + <!--{{if obj.line.company == '55'}}
135 137
136 {{if obj.line.brancheCompany == '1'}} 138 {{if obj.line.brancheCompany == '1'}}
137 上南二分公司 139 上南二分公司
@@ -185,7 +187,7 @@ @@ -185,7 +187,7 @@
185 航头枢纽站 187 航头枢纽站
186 {{/if}} 188 {{/if}}
187 189
188 - {{/if}} 190 + {{/if}}-->
189 </td> 191 </td>
190 <td> 192 <td>
191 {{obj.startDateStr}} 193 {{obj.startDateStr}}
src/main/resources/static/pages/base/stationroute/css/bmap_base.css
1 #bmap_basic{ 1 #bmap_basic{
2 min-width: 100%; 2 min-width: 100%;
3 - width: calc(100% + 26px);  
4 - margin-top: -28px; 3 + /*width: calc(100% + 26px); */
  4 + margin-top: -10px;
5 border: 2px solid #fdfdfd; 5 border: 2px solid #fdfdfd;
6 min-height: 1200px; 6 min-height: 1200px;
7 height:100%; 7 height:100%;
@@ -10,6 +10,7 @@ @@ -10,6 +10,7 @@
10 10
11 html,body{ 11 html,body{
12 overflow:hidden; 12 overflow:hidden;
  13 + height: 99%;
13 } 14 }
14 15
15 .rm3_image { 16 .rm3_image {
@@ -27,67 +28,64 @@ html,body{ @@ -27,67 +28,64 @@ html,body{
27 } 28 }
28 29
29 .protlet-box{ 30 .protlet-box{
30 -  
31 - position: absolute;  
32 -  
33 - top: 40px;  
34 - 31 + position: absolute;
  32 + top: 30px;
35 margin-left: 10px; 33 margin-left: 10px;
36 -  
37 overflow: hidden; 34 overflow: hidden;
38 -  
39 width: 380px; 35 width: 380px;
40 -  
41 height: auto; 36 height: auto;
42 -  
43 background:transparent; 37 background:transparent;
44 -  
45 border:0px solid; 38 border:0px solid;
46 -  
47 box-shadow: 0 12px 15px 0 rgba(204, 204, 204, 0.33),0 17px 50px 0 rgba(204, 204, 204, 0.33); 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;
48 } 41 }
49 42
50 -.BMap_pop div:nth-child(1) ,  
51 -.BMap_pop div:nth-child(2) ,  
52 -.BMap_pop div:nth-child(3) ,  
53 -.BMap_pop div:nth-child(4) ,  
54 -.BMap_pop div:nth-child(5) ,  
55 -.BMap_pop div:nth-child(6) ,  
56 -.BMap_pop div:nth-child(7) {  
57 -  
58 - border:0px solid rgb(255, 255, 255) !important;  
59 - background-color:#3B3F51 !important;  
60 - 43 +.help-block{
  44 + color:#000;
  45 + font-size: 15px;
61 } 46 }
62 47
63 -.BMap_pop div:nth-child(3){  
64 -  
65 - width:23px !important;  
66 -  
67 -} 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 +/*}*/
68 60
69 -.BMap_pop div:nth-child(7) {  
70 -  
71 - width:23px !important;  
72 -  
73 - height:24px !important;  
74 -  
75 -} 61 +/*.BMap_pop div:nth-child(3){*/
  62 + /**/
  63 + /*width:23px !important;*/
  64 + /**/
  65 +/*}*/
76 66
77 -.BMap_pop div:nth-child(5) {  
78 -  
79 - height:24px !important;  
80 -  
81 -} 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 +/*}*/
82 80
83 /* 图片以后在弄,先隐藏div */ 81 /* 图片以后在弄,先隐藏div */
84 -.BMap_pop div:nth-child(8) {  
85 -  
86 - height:0px !important;  
87 - /* background:url('/pages/base/stationroute/css/img/iw3-1.png') no-repeat !important; */  
88 - /* background-image:url('/pages/base/stationroute/css/img/windowinfo_b.jpg') !important; */  
89 -  
90 -} 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 +/*}*/
91 89
92 .BMap_pop { 90 .BMap_pop {
93 91
src/main/resources/static/pages/base/stationroute/css/img/bg.png 0 → 100644

2.95 KB

src/main/resources/static/pages/base/stationroute/doublename_road.html 0 → 100644
  1 +<!-- 生成双路名路段路段 -->
  2 +<div class="modal fade" id="doublename_road_mobal" role="basic" aria-hidden="true" style="margin-top:10%">
  3 + <div class="modal-dialog">
  4 + <div class="modal-content">
  5 + <div class="modal-header">
  6 + <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
  7 + <h4 class="modal-title">选择生成路段的位置</h4>
  8 + </div>
  9 + <div class="modal-body">
  10 + <form class="form-horizontal" role="form" id="edit_section__form" action="/module" method="post">
  11 + <div class="alert alert-danger display-hide"> <button class="close" data-close="alert"></button>
  12 + 请选择上一路段!
  13 + </div>
  14 + <input type="hidden" name="versions" id="versionsInput">
  15 + <input type="hidden" name="directions" id="directionsSection">
  16 + <input type="hidden" name="lineId" id="lineId">
  17 + <input type="hidden" name="lineCode" id="lineCodeInput">
  18 + <input type="hidden" name="bsectionVector" id="bsectionVectorInput" />
  19 + <input type="hidden" name="dbType" id="dbTypeInput" value="b"/>
  20 + <!-- 路段序号 -->
  21 + <div class="form-body">
  22 + <div class="form-group">
  23 + <label class="control-label col-md-3">
  24 + 上一路段:
  25 + </label>
  26 + <div class="col-md-8">
  27 + <select name="sectionrouteCode" id="sectionrouteCodeSelect"></select>
  28 + <span class="help-block">说明:选择的路段将作为本站序号的参考,成为选择路段的下一个路段。 </span>
  29 + </div>
  30 + </div>
  31 + </div>
  32 + </form>
  33 + </div>
  34 + <div class="modal-footer">
  35 + <button type="button" class="btn default" data-dismiss="modal">取消</button>
  36 + <button type="button" class="btn btn-primary" id="editSectionButton">提交数据</button>
  37 + </div>
  38 + </div>
  39 + </div>
  40 +</div>
  41 +<script type="text/javascript">
  42 +
  43 + $('#doublename_road_mobal').on('doubleNameRoadMobal_show', function(e,params,map_,ajaxd,fun){
  44 + // 方向
  45 + var dir = params.directions;
  46 + var lineId = params.lineId;
  47 +
  48 + // 获取路段号元素,并添加下拉属性值
  49 + ajaxd.getStation(lineId,dir,function(treeData) {
  50 + var array = treeData[0].children[1].children,paramsD =new Array();
  51 + paramsD.push({'id':'启始路段(默认在所有路段的前面)','text':'启始路段(默认在所有路段的前面)'});
  52 + // 记录最后一个路段
  53 + var endRoad = 0;
  54 + // 遍历.
  55 + $.each(array, function(i, g){
  56 + // 判断.
  57 + if(g.sectionName!='' || g.sectionName != null) {
  58 + var ptions_v = g.sectionrouteCode;
  59 + if(endRoad < ptions_v)
  60 + endRoad = ptions_v;
  61 + // 添加拼音检索下拉框格式数据数组.
  62 + paramsD.push({'id':ptions_v,
  63 + 'text':g.sectionName + '(' + ptions_v + ')' + ' --' + fun.dirdmToName(g.sectionrouteDirections)});
  64 + }
  65 + });
  66 + // 初始化上一个路段拼音检索下拉框.
  67 + initPinYinSelect2($('#sectionrouteCodeSelect'),paramsD,function(selector) {
  68 + if(endRoad != 0)
  69 + $('#sectionrouteCodeSelect').select2('val',endRoad);
  70 + else
  71 + $('#sectionrouteCodeSelect').select2('val','启始路段(默认在所有路段的前面)');
  72 + });
  73 + });
  74 + // 显示mobal
  75 + $('#doublename_road_mobal').modal({show : true,backdrop: 'static',keyboard: false});
  76 + // 当调用 hide 实例方法时触发
  77 + $('#doublename_road_mobal').on('hide.bs.modal', function () {
  78 + closeMobleSetClean();
  79 + });
  80 + function closeMobleSetClean() {
  81 + // 清除地图覆盖物
  82 + map_.clearMarkAndOverlays();
  83 + fun.resjtreeDate(lineId,dir);
  84 + fun.editAChangeCssRemoveDisabled();
  85 + ajaxd.getSectionRouteInfo(lineId,dir,function(data) {
  86 + fun.linePanlThree(lineId,data,dir);
  87 + });
  88 + }
  89 + // 编辑表单元素
  90 + var form = $('#edit_section__form');
  91 + // 获取错误提示元素
  92 + var error = $('.alert-danger', form);
  93 + // 提交数据按钮事件
  94 + $('#editSectionButton').on('click', function() {
  95 + // 表单提交
  96 + form.submit();
  97 + });
  98 + // 表单验证
  99 + form.validate({
  100 + errorElement : 'span',
  101 + errorClass : 'help-block help-block-error',
  102 + focusInvalid : false,
  103 + /* rules : {
  104 + 'sectionrouteCode': {required : true}// 路由序号 必填项
  105 + },*/
  106 + invalidHandler : function(event, validator) {
  107 + error.show();
  108 + App.scrollTo(error, -200);
  109 + },
  110 + highlight : function(element) {
  111 + $(element).closest('.form-group').addClass('has-error');
  112 + },
  113 + unhighlight : function(element) {
  114 + $(element).closest('.form-group').removeClass('has-error');
  115 + },
  116 + success : function(label) {
  117 + label.closest('.form-group').removeClass('has-error');
  118 + },
  119 + submitHandler : function(f) {
  120 + var data = form.serializeJSON();
  121 + if(data.sectionrouteCode=='启始路段(默认在所有路段的前面)') {
  122 + params.sectionrouteCode = '';
  123 + } else {
  124 + params.sectionrouteCode = data.sectionrouteCode;
  125 + }
  126 + // 获取版本
  127 + $.get("/lineVersions/findCurrentVersion", {"lineId" : lineId}, function (versions) {
  128 + params.versions = versions;
  129 + // 生成路段
  130 + $.get('/section/doubleName',params,function (resuntDate) {
  131 + debugger
  132 + if(resuntDate.status=='SUCCESS') {
  133 + // 弹出添加成功提示消息
  134 + layer.msg('生成成功...');
  135 + } else if (resuntDate.status=='Failure') {
  136 + layer.msg('抱歉,选取的路段太短,无法生成双路段!');
  137 + } else {
  138 + // 弹出添加失败提示消息
  139 + layer.msg('生成失败...');
  140 + }
  141 + $('#doublename_road_mobal').modal('hide');
  142 + var dir = params.directions;
  143 + // 刷行左边树
  144 + fun.resjtreeDate(lineId,dir);
  145 + closeMobleSetClean();
  146 + });
  147 + });
  148 +
  149 + }
  150 + });
  151 + });
  152 +</script>
0 \ No newline at end of file 153 \ No newline at end of file
src/main/resources/static/pages/base/stationroute/edit_select.html
@@ -49,6 +49,7 @@ @@ -49,6 +49,7 @@
49 <script type="text/javascript"> 49 <script type="text/javascript">
50 $('#edit_select_mobal').on('editSelectMobal_show', function(e, map_,drw,ajaxd,editStationObj,lineObj,fun,dir_){ 50 $('#edit_select_mobal').on('editSelectMobal_show', function(e, map_,drw,ajaxd,editStationObj,lineObj,fun,dir_){
51 var sel = fun.getCurrSelNode(dir_); 51 var sel = fun.getCurrSelNode(dir_);
  52 + debugger
52 var Station = sel[0].original; 53 var Station = sel[0].original;
53 // 显示选择修改方式弹出层 54 // 显示选择修改方式弹出层
54 $('#edit_select_mobal').modal({show : true,backdrop: 'static',keyboard: false}); 55 $('#edit_select_mobal').modal({show : true,backdrop: 'static',keyboard: false});
@@ -117,21 +118,16 @@ $(&#39;#edit_select_mobal&#39;).on(&#39;editSelectMobal_show&#39;, function(e, map_,drw,ajaxd,ed @@ -117,21 +118,16 @@ $(&#39;#edit_select_mobal&#39;).on(&#39;editSelectMobal_show&#39;, function(e, map_,drw,ajaxd,ed
117 var editStationName = params.stationNamebootbox; 118 var editStationName = params.stationNamebootbox;
118 119
119 if(params.editselect==0){ 120 if(params.editselect==0){
120 - layer.confirm('重绘站点,会修改站点编码,影响已做好的排班和线路文件。请谨慎使用,谢谢!', {  
121 - btn: ['绘制','取消'] //按钮  
122 - }, function(index){  
123 - $('#downLine').addClass('btn disabled');  
124 - $('.btn-circle').addClass('disabled');  
125 - $('#upLine').addClass('btn disabled');  
126 - editStationObj.setEitdStation(Station);  
127 - editStationObj.setEitdStationName(editStationName);  
128 -  
129 - map_.clearMarkAndOverlays();  
130 - // 打开绘制工具  
131 - drw.openDrawingManager();  
132 - map_.localtionPoint(editStationName);  
133 - layer.close(index)  
134 - }); 121 + $('#downLine').addClass('btn disabled');
  122 + $('.btn-circle').addClass('disabled');
  123 + $('#upLine').addClass('btn disabled');
  124 + editStationObj.setEitdStation(Station);
  125 + editStationObj.setEitdStationName(editStationName);
  126 +
  127 + map_.clearMarkAndOverlays();
  128 + // 打开绘制工具
  129 + drw.openDrawingManager();
  130 + map_.localtionPoint(editStationName);
135 }else if(params.editselect==1){ 131 }else if(params.editselect==1){
136 $('#downLine').addClass('btn disabled'); 132 $('#downLine').addClass('btn disabled');
137 $('.btn-circle').addClass('disabled'); 133 $('.btn-circle').addClass('disabled');
@@ -141,7 +137,7 @@ $(&#39;#edit_select_mobal&#39;).on(&#39;editSelectMobal_show&#39;, function(e, map_,drw,ajaxd,ed @@ -141,7 +137,7 @@ $(&#39;#edit_select_mobal&#39;).on(&#39;editSelectMobal_show&#39;, function(e, map_,drw,ajaxd,ed
141 137
142 // 弹出添加失败提示消息,2秒关闭(如果不配置,默认是3秒) 138 // 弹出添加失败提示消息,2秒关闭(如果不配置,默认是3秒)
143 var mindex = layer.msg('编辑完图形后,请双击图形区域保存',{ offset: '126px', 139 var mindex = layer.msg('编辑完图形后,请双击图形区域保存',{ offset: '126px',
144 - shift: 0,time: 10000}); 140 + shift: 0,time: 3000});
145 // 编辑图形 141 // 编辑图形
146 map_.editShapes(editStationName,stationShapesTypeV,mindex); 142 map_.editShapes(editStationName,stationShapesTypeV,mindex);
147 } 143 }
src/main/resources/static/pages/base/stationroute/js/stationroute-list-events.js
@@ -19,11 +19,16 @@ $(function(){ @@ -19,11 +19,16 @@ $(function(){
19 19
20 // 上行站点其它规划点击事件 20 // 上行站点其它规划点击事件
21 $('.upManual').on('click',function() { 21 $('.upManual').on('click',function() {
22 - // 加载其它规划选择弹出层mobal页面 22 + // 加载模板手动添加站点页面
  23 + $.get('addstationstemplate.html', function(m){
  24 + $(pjaxContainer).append(m);
  25 + $('#add_station_template_mobal').trigger('AddStationTempMobal.show', [WorldsBMap,GetAjaxData,directionUpValue,LineObj,PublicFunctions]);
  26 + });
  27 + /*// 加载其它规划选择弹出层mobal页面
23 $.get('add_manual_select.html', function(m){ 28 $.get('add_manual_select.html', function(m){
24 $(pjaxContainer).append(m); 29 $(pjaxContainer).append(m);
25 $('#add_manual_mobal').trigger('AddManualMobal.show', [WorldsBMap,GetAjaxData,directionUpValue,LineObj,PublicFunctions]); 30 $('#add_manual_mobal').trigger('AddManualMobal.show', [WorldsBMap,GetAjaxData,directionUpValue,LineObj,PublicFunctions]);
26 - }); 31 + });*/
27 32
28 }); 33 });
29 34
@@ -187,11 +192,16 @@ $(function(){ @@ -187,11 +192,16 @@ $(function(){
187 192
188 // 下行站点其它规划点击事件 193 // 下行站点其它规划点击事件
189 $('.downManual').on('click',function() { 194 $('.downManual').on('click',function() {
190 - // 加载其它规划选择弹出层mobal页面 195 + // 加载模板手动添加站点页面
  196 + $.get('addstationstemplate.html', function(m){
  197 + $(pjaxContainer).append(m);
  198 + $('#add_station_template_mobal').trigger('AddStationTempMobal.show', [WorldsBMap,GetAjaxData,directionDownValue,LineObj,PublicFunctions]);
  199 + });
  200 + /*// 加载其它规划选择弹出层mobal页面
191 $.get('add_manual_select.html', function(m){ 201 $.get('add_manual_select.html', function(m){
192 $(pjaxContainer).append(m); 202 $(pjaxContainer).append(m);
193 $('#add_manual_mobal').trigger('AddManualMobal.show', [WorldsBMap,GetAjaxData,directionDownValue,LineObj,PublicFunctions]); 203 $('#add_manual_mobal').trigger('AddManualMobal.show', [WorldsBMap,GetAjaxData,directionDownValue,LineObj,PublicFunctions]);
194 - }); 204 + });*/
195 }); 205 });
196 206
197 // 下行站点新增事件 207 // 下行站点新增事件
src/main/resources/static/pages/base/stationroute/js/stationroute-list-function.js
@@ -161,7 +161,7 @@ var PublicFunctions = function () { @@ -161,7 +161,7 @@ var PublicFunctions = function () {
161 /** 直接保存 @param:<lineNameV:线路名称;directionData:方向(0:上行;1:下行)> */ 161 /** 直接保存 @param:<lineNameV:线路名称;directionData:方向(0:上行;1:下行)> */
162 PublicFunctions.systemLineStation(lineNameV,directionData); 162 PublicFunctions.systemLineStation(lineNameV,directionData);
163 } 163 }
164 - 164 +
165 }, 165 },
166 166
167 /** 直接保存 @param:<lineNameV:线路名称;directionData:方向(0:上行;1:下行)> */ 167 /** 直接保存 @param:<lineNameV:线路名称;directionData:方向(0:上行;1:下行)> */
@@ -170,33 +170,6 @@ var PublicFunctions = function () { @@ -170,33 +170,6 @@ var PublicFunctions = function () {
170 WorldsBMap.lineInfoPanl(lineNameV,directionData,function(BusLine){ 170 WorldsBMap.lineInfoPanl(lineNameV,directionData,function(BusLine){
171 // 如果线路信息不为空 171 // 如果线路信息不为空
172 if(BusLine) { 172 if(BusLine) {
173 - /*if(BusLine.zB.length == 0){  
174 -  
175 - layer.confirm('系统生成该线路【'+lineNameV+'】时获取站点与路段异常!请联系管理员或者检查网络连接是否异常!', {  
176 - btn : [ '确认' ]  
177 - }, function(index) {  
178 -  
179 - // 关闭弹出层  
180 - layer.closeAll();  
181 -  
182 - // 上行  
183 - if(directionData==0){  
184 -  
185 - // 显示上行规划  
186 - $('#upToolsMobal').show();  
187 -  
188 - // 下行  
189 - }else if(directionData==1){  
190 -  
191 - // 显示下行规划  
192 - $('#downToolsMobal').show();  
193 -  
194 - }  
195 -  
196 - return ;  
197 - });  
198 -  
199 - }*/  
200 // 获取公交线几何对象, 仅当结果自动添加到地图上时有效 173 // 获取公交线几何对象, 仅当结果自动添加到地图上时有效
201 var Polygon = BusLine.getPolyline(); 174 var Polygon = BusLine.getPolyline();
202 // 返回多边型的点数组(自1.2新增) 175 // 返回多边型的点数组(自1.2新增)
@@ -277,10 +250,42 @@ var PublicFunctions = function () { @@ -277,10 +250,42 @@ var PublicFunctions = function () {
277 } 250 }
278 }) 251 })
279 }); 252 });
280 -  
281 -  
282 }); 253 });
283 - } 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 + }
284 }); 289 });
285 }, 290 },
286 291
@@ -484,7 +489,6 @@ var PublicFunctions = function () { @@ -484,7 +489,6 @@ var PublicFunctions = function () {
484 } 489 }
485 // 路段数据长度 490 // 路段数据长度
486 var dataLen = data.length; 491 var dataLen = data.length;
487 - //debugger;  
488 // 如果大于零 492 // 如果大于零
489 if(dataLen>0) { 493 if(dataLen>0) {
490 // 编辑路段数据 494 // 编辑路段数据
src/main/resources/static/pages/base/stationroute/js/stationroute-list-map.js
@@ -222,43 +222,30 @@ var WorldsBMap = function () { @@ -222,43 +222,30 @@ var WorldsBMap = function () {
222 222
223 // 如果不为空 223 // 如果不为空
224 if(objStation) { 224 if(objStation) {
225 -  
226 // 获取中心点坐标字符串 225 // 获取中心点坐标字符串
227 var testpointStr = objStation.stationBJwpoints; 226 var testpointStr = objStation.stationBJwpoints;
228 -  
229 // 按空格切割中心点坐标字符串 227 // 按空格切割中心点坐标字符串
230 var BJwpointsPolygon = testpointStr.split(' '); 228 var BJwpointsPolygon = testpointStr.split(' ');
231 -  
232 // 中心点坐标 229 // 中心点坐标
233 var pointPolygon = new BMap.Point(BJwpointsPolygon[0], BJwpointsPolygon[1]); 230 var pointPolygon = new BMap.Point(BJwpointsPolygon[0], BJwpointsPolygon[1]);
234 -  
235 // 获取多边形坐标字符串 231 // 获取多边形坐标字符串
236 var stationBPolygonGrid = objStation.stationBPolygonGrid; 232 var stationBPolygonGrid = objStation.stationBPolygonGrid;
237 -  
238 // 截取多边形坐标字符串 233 // 截取多边形坐标字符串
239 var stationBPolygonGridStr = stationBPolygonGrid.substring(9,stationBPolygonGrid.length-2); 234 var stationBPolygonGridStr = stationBPolygonGrid.substring(9,stationBPolygonGrid.length-2);
240 -  
241 // 按逗号切割 235 // 按逗号切割
242 var pointPolygonArray = stationBPolygonGridStr.split(','); 236 var pointPolygonArray = stationBPolygonGridStr.split(',');
243 -  
244 // 多边形坐标集合 237 // 多边形坐标集合
245 var polygonP = []; 238 var polygonP = [];
246 -  
247 for(var v = 0;v<pointPolygonArray.length;v++) { 239 for(var v = 0;v<pointPolygonArray.length;v++) {
248 -  
249 polygonP.push(new BMap.Point(pointPolygonArray[v].split(" ")[0],pointPolygonArray[v].split(" ")[1])); 240 polygonP.push(new BMap.Point(pointPolygonArray[v].split(" ")[0],pointPolygonArray[v].split(" ")[1]));
250 -  
251 } 241 }
252 242
253 // 画多边形 243 // 画多边形
254 polygon = new BMap.Polygon(polygonP, { 244 polygon = new BMap.Polygon(polygonP, {
255 -  
256 // 线条显色 245 // 线条显色
257 strokeColor : "blue", 246 strokeColor : "blue",
258 -  
259 // 边线的宽度,以像素为单位。 247 // 边线的宽度,以像素为单位。
260 strokeWeight : 2, 248 strokeWeight : 2,
261 -  
262 // 边线透明度,取值范围0 - 1。 249 // 边线透明度,取值范围0 - 1。
263 strokeOpacity : 0.5 250 strokeOpacity : 0.5
264 }); 251 });
@@ -268,80 +255,62 @@ var WorldsBMap = function () { @@ -268,80 +255,62 @@ var WorldsBMap = function () {
268 255
269 // 信息窗口属性 256 // 信息窗口属性
270 var opts_polygon = { 257 var opts_polygon = {
271 -  
272 // 信息窗口宽度 258 // 信息窗口宽度
273 width : 200, 259 width : 200,
274 -  
275 // 信息窗口高度 260 // 信息窗口高度
276 - height : 400,  
277 -  
278 - // 信息窗位置偏移值。  
279 - offset: new BMap.Size(500,20),  
280 - 261 + height : 300,
  262 + // 信息窗位置偏移值。
  263 + // offset: new BMap.Size(500,20),
281 //标题 264 //标题
282 - title : '<h4 style="color:#FFFFFF">'+objStation.stationStationName+'站详情</h4>',  
283 - 265 + // title : '<h4 style="color:#FFFFFF">'+objStation.stationStationName+'站详情</h4>',
284 //设置不允许信窗发送短息 266 //设置不允许信窗发送短息
285 enableMessage : false, 267 enableMessage : false,
286 -  
287 //是否开启点击地图关闭信息窗口 268 //是否开启点击地图关闭信息窗口
288 enableCloseOnClick : false 269 enableCloseOnClick : false
289 }; 270 };
290 - 271 +
291 var markTypeStr = ''; 272 var markTypeStr = '';
292 -  
293 if(objStation.stationRouteStationMark=='B') { 273 if(objStation.stationRouteStationMark=='B') {
294 -  
295 markTypeStr='起点站'; 274 markTypeStr='起点站';
296 -  
297 }else if(objStation.stationRouteStationMark=='Z') { 275 }else if(objStation.stationRouteStationMark=='Z') {
298 -  
299 markTypeStr ='中途站'; 276 markTypeStr ='中途站';
300 -  
301 -  
302 }else if(objStation.stationRouteStationMark=='E') { 277 }else if(objStation.stationRouteStationMark=='E') {
303 -  
304 markTypeStr='终点站'; 278 markTypeStr='终点站';
305 -  
306 } 279 }
307 -  
308 - var htm = '<HR style="border:1 dashed #987cb9" width="100%" color=#987cb9 SIZE=1>'+  
309 - '<span style="color:#DDD;font-size: 15px;">站点名称:' + objStation.stationStationName + '</span>' +  
310 - '<span class="help-block" style="color:#DDD;font-size: 15px;">站点编码:' + objStation.stationStationCod + '</span>' +  
311 - '<span class="help-block" style="color:#DDD;font-size: 15px;">站点序号:' + objStation.stationRouteStationRouteCode + '</span>' +  
312 - '<span class="help-block" style="color:#DDD;font-size: 15px;">站点类型:' + markTypeStr + '</span>' +  
313 - '<span class="help-block" style="color:#DDD;font-size: 15px;">纬度坐标:' + objStation.stationBJwpoints + '</span>' +  
314 - '<span class="help-block" style="color:#DDD;font-size: 15px;">到站时间:' + objStation.stationRouteToTime + '&nbsp;分钟</span>' +  
315 - '<span class="help-block" style="color:#DDD;font-size: 15px;">到站距离:' + objStation.stationRouteDistances + '&nbsp;公里</span>' +  
316 - '<span class="help-block" style="color:#DDD;font-size: 15px;">范围半径:' + objStation.stationRadius + '</span>' +  
317 - '<span class="help-block" style="color:#DDD;font-size: 15px;">版本号&nbsp&nbsp:' + objStation.stationRouteVersions + '</span>' +  
318 - '<span class="help-block" style="width: 100%;font-size: 15px;;color:#DDD;'+  
319 - 'overflow: hidden; white-space: nowrap; text-overflow: ellipsis; " title="'+  
320 - objStation.stationRouteDescriptions +'" >说明/描述:' + objStation.stationRouteDescriptions + '</span>' ;  
321 -  
322 - // 创建信息窗口 280 + var point = objStation.stationBJwpoints.split(" ")
  281 + var htm = '<span style="color: #ff8355;font-size: 20px;">' + objStation.stationStationName + '</span>' +
  282 + '<span class="help-block" >站点编码:' + objStation.stationStationCod + '</span>' +
  283 + '<span class="help-block" >站点序号:' + objStation.stationRouteStationRouteCode + '</span>' +
  284 + '<span class="help-block" >站点类型:' + markTypeStr + '</span>' +
  285 + '<span class="help-block" >经度:&nbsp&nbsp' + point[0] + '</span>' +
  286 + '<span class="help-block" >纬度:&nbsp&nbsp' + point[1] + '</span>' +
  287 + '<span class="help-block" >到站时间:' + objStation.stationRouteToTime + '&nbsp;分钟</span>' +
  288 + '<span class="help-block" >到站距离:' + objStation.stationRouteDistances + '&nbsp;公里</span>' +
  289 + '<span class="help-block" >缓冲区形状:' + (objStation.stationShapesType == "r"?"圆形":"多边形") + '</span>' +
  290 + '<span class="help-block" >版本号:&nbsp&nbsp' + objStation.stationRouteVersions + '</span>' +
  291 + '<div style="">' +
  292 + '<button style="float:left; background: #ff8355; color: #fff; padding-bottom:5px; font-size: 9px;" class="btn " ' +
  293 + 'id="editStation" onclick="WorldsBMap.editStation('+objStation.stationRouteDirections+')">修改站点</button>' +
  294 + '<button style="float:right; background: #ff8355; color: #fff; padding-bottom:5px; font-size: 9px;" class="btn " ' +
  295 + 'id="addBetweenStationRoad" onclick="WorldsBMap.addBetweenStationRoad('+objStation.stationRouteId+')">添加站点间路段</button>' +
  296 + '</div>';
  297 +
  298 + // 创建信息窗口
323 var infoWindow_target = new BMap.InfoWindow(htm, opts_polygon); 299 var infoWindow_target = new BMap.InfoWindow(htm, opts_polygon);
324 // 自定义标注物图片 300 // 自定义标注物图片
325 var icon_target = new BMap.Icon('/pages/base/stationroute/css/img/cz.png',new BMap.Size(20, 20)); 301 var icon_target = new BMap.Icon('/pages/base/stationroute/css/img/cz.png',new BMap.Size(20, 20));
326 -  
327 // 创建点 302 // 创建点
328 marker = new BMap.Marker(pointPolygon,{icon : icon_target}); 303 marker = new BMap.Marker(pointPolygon,{icon : icon_target});
329 -  
330 // 把标注添物加到地图上 304 // 把标注添物加到地图上
331 mapBValue.addOverlay(marker); 305 mapBValue.addOverlay(marker);
332 -  
333 // 是否在平移过程中禁止动画。(自1.2新增) 306 // 是否在平移过程中禁止动画。(自1.2新增)
334 var PanOptions_ ={noAnimation :true}; 307 var PanOptions_ ={noAnimation :true};
335 -  
336 // 将地图的中心点更改为给定的点。 308 // 将地图的中心点更改为给定的点。
337 mapBValue.panTo(pointPolygon,PanOptions_); 309 mapBValue.panTo(pointPolygon,PanOptions_);
338 -  
339 // 将地图在水平位置上移动x像素,垂直位置上移动y像素。 310 // 将地图在水平位置上移动x像素,垂直位置上移动y像素。
340 mapBValue.panBy(10,-150,PanOptions_); 311 mapBValue.panBy(10,-150,PanOptions_);
341 -  
342 //开启信息窗口 312 //开启信息窗口
343 mapBValue.openInfoWindow(infoWindow_target,pointPolygon); 313 mapBValue.openInfoWindow(infoWindow_target,pointPolygon);
344 -  
345 } 314 }
346 315
347 }, 316 },
@@ -399,61 +368,50 @@ var WorldsBMap = function () { @@ -399,61 +368,50 @@ var WorldsBMap = function () {
399 368
400 // 信息窗口参数属性 369 // 信息窗口参数属性
401 var opts = { 370 var opts = {
402 -  
403 // 信息窗口宽度 371 // 信息窗口宽度
404 width : 200, 372 width : 200,
405 -  
406 // 信息窗口高度 373 // 信息窗口高度
407 - height : 450,  
408 - 374 + height : 330,
409 // 信息窗位置偏移值。 375 // 信息窗位置偏移值。
410 - offset: new BMap.Size(500,120),  
411 - 376 + // offset: new BMap.Size(500,120),
412 //标题 377 //标题
413 - title : '<h4 style="color:#FFFFFF">'+objStation.stationStationName+'站详情</h4>',  
414 - 378 + // title : '<h4 style="color:#ff8355">'+objStation.stationStationName+'站详情</h4>',
415 //设置不允许信窗发送短息 379 //设置不允许信窗发送短息
416 enableMessage : false, 380 enableMessage : false,
417 -  
418 //是否开启点击地图关闭信息窗口 381 //是否开启点击地图关闭信息窗口
419 enableCloseOnClick : false, 382 enableCloseOnClick : false,
420 -  
421 // 是否开启信息窗口打开时地图自动移动(默认开启)。(自 1.1 新增) 383 // 是否开启信息窗口打开时地图自动移动(默认开启)。(自 1.1 新增)
422 enableAutoPan:false 384 enableAutoPan:false
423 }; 385 };
424 386
425 var markTypeStr = ''; 387 var markTypeStr = '';
426 -  
427 if(objStation.stationRouteStationMark=='B') { 388 if(objStation.stationRouteStationMark=='B') {
428 -  
429 markTypeStr='起点站'; 389 markTypeStr='起点站';
430 -  
431 }else if(objStation.stationRouteStationMark=='Z') { 390 }else if(objStation.stationRouteStationMark=='Z') {
432 -  
433 markTypeStr ='中途站'; 391 markTypeStr ='中途站';
434 -  
435 -  
436 }else if(objStation.stationRouteStationMark=='E') { 392 }else if(objStation.stationRouteStationMark=='E') {
437 -  
438 markTypeStr='终点站'; 393 markTypeStr='终点站';
439 -  
440 } 394 }
441 -  
442 - var htm = '<HR style="border:1 dashed #987cb9" width="100%" color=#987cb9 SIZE=1>'+  
443 - '<span style="color:#DDD;font-size: 15px;">站点名称:' + objStation.stationStationName + '</span>' +  
444 - '<span class="help-block" style="color:#DDD;font-size: 15px;">站点编码:' + objStation.stationStationCod + '</span>' +  
445 - '<span class="help-block" style="color:#DDD;font-size: 15px;">站点序号:' + objStation.stationRouteStationRouteCode + '</span>' +  
446 - '<span class="help-block" style="color:#DDD;font-size: 15px;">站点类型:' + markTypeStr + '</span>' +  
447 - '<span class="help-block" style="color:#DDD;font-size: 15px;">纬度坐标:' + objStation.stationBJwpoints + '</span>' +  
448 - '<span class="help-block" style="color:#DDD;font-size: 15px;">到站时间:' + objStation.stationRouteToTime + '&nbsp;分钟</span>' +  
449 - '<span class="help-block" style="color:#DDD;font-size: 15px;">到站距离:' + objStation.stationRouteDistances + '&nbsp;公里</span>' +  
450 - '<span class="help-block" style="color:#DDD;font-size: 15px;">范围半径:' + objStation.stationRadius + '</span>' +  
451 - '<span class="help-block" style="color:#DDD;font-size: 15px;">版本号&nbsp&nbsp:' + objStation.stationRouteVersions + '</span>' +  
452 - '<span class="help-block" style="width: 100%;font-size: 15px;;color:#DDD;'+  
453 - 'overflow: hidden; white-space: nowrap; text-overflow: ellipsis; " title="'+  
454 - objStation.stationRouteDescriptions +'" >说明/描述:' + objStation.stationRouteDescriptions + '</span>' ;  
455 -  
456 - // 创建信息窗口 395 + var point1 = objStation.stationBJwpoints.split(" ");
  396 + var htm = '<span style="color: #ff8355;font-size: 20px;">' + objStation.stationStationName + '</span>' +
  397 + '<span class="help-block" >站点编码:' + objStation.stationStationCod + '</span>' +
  398 + '<span class="help-block" >站点序号:' + objStation.stationRouteStationRouteCode + '</span>' +
  399 + '<span class="help-block" >站点类型:' + markTypeStr + '</span>' +
  400 + '<span class="help-block" >经度:&nbsp&nbsp' + point1[0] + '</span>' +
  401 + '<span class="help-block" >纬度:&nbsp&nbsp' + point1[1] + '</span>' +
  402 + '<span class="help-block" >到站时间:' + objStation.stationRouteToTime + '&nbsp;分钟</span>' +
  403 + '<span class="help-block" >到站距离:' + objStation.stationRouteDistances + '&nbsp;公里</span>' +
  404 + '<span class="help-block" >缓冲区形状:' + (objStation.stationShapesType == "r"?"圆形":"多边形") + '</span>' +
  405 + '<span class="help-block" >半径&nbsp&nbsp:' + objStation.stationRadius + '</span>' +
  406 + '<span class="help-block" >版本号&nbsp&nbsp:' + objStation.stationRouteVersions + '</span>' +
  407 + '<div style="">' +
  408 + '<button style="float:left; background: #ff8355; color: #fff; padding-bottom:5px; font-size: 9px;" class="btn " ' +
  409 + 'id="editStation" onclick="WorldsBMap.editStation('+objStation.stationRouteDirections+')">修改站点</button>' +
  410 + '<button style="float:right; background: #ff8355; color: #fff; padding-bottom:5px; font-size: 9px;" class="btn " ' +
  411 + 'id="addBetweenStationRoad" onclick="WorldsBMap.addBetweenStationRoad('+objStation.stationRouteId+')">添加站点间路段</button>' +
  412 + '</div>';
  413 +
  414 + // 创建信息窗口
457 var infoWindow_target = new BMap.InfoWindow(htm, opts); 415 var infoWindow_target = new BMap.InfoWindow(htm, opts);
458 // 自定义标注物图片 416 // 自定义标注物图片
459 var icon_target = new BMap.Icon('/pages/base/stationroute/css/img/cz.png',new BMap.Size(20, 20)); 417 var icon_target = new BMap.Icon('/pages/base/stationroute/css/img/cz.png',new BMap.Size(20, 20));
@@ -664,6 +622,65 @@ var WorldsBMap = function () { @@ -664,6 +622,65 @@ var WorldsBMap = function () {
664 mapBValue.panTo(polyline_center,PanOptions_); 622 mapBValue.panTo(polyline_center,PanOptions_);
665 mapBValue.panBy(500,-510,PanOptions_); 623 mapBValue.panBy(500,-510,PanOptions_);
666 mapBValue.setZoom(14); 624 mapBValue.setZoom(14);
  625 +
  626 + // 信息窗口属性
  627 + var opts_polygon = {
  628 + // 信息窗口宽度
  629 + width : 200,
  630 + // 信息窗口高度
  631 + height : 300,
  632 + // 信息窗位置偏移值。
  633 + // offset: new BMap.Size(500,20),
  634 + //标题
  635 + // title : '<h4 style="color:#FFFFFF">'+objStation.stationStationName+'站详情</h4>',
  636 + //设置不允许信窗发送短息
  637 + enableMessage : false,
  638 + //是否开启点击地图关闭信息窗口
  639 + enableCloseOnClick : false
  640 + };
  641 +
  642 + // var markTypeStr = '';
  643 + // if(objStation.stationRouteStationMark=='B') {
  644 + // markTypeStr='起点站';
  645 + // }else if(objStation.stationRouteStationMark=='Z') {
  646 + // markTypeStr ='中途站';
  647 + // }else if(objStation.stationRouteStationMark=='E') {
  648 + // markTypeStr='终点站';
  649 + // }
  650 + // var point = objStation.stationBJwpoints.split(" ")
  651 + // var htm = '<span style="color: #ff8355;font-size: 20px;">' + objStation.stationStationName + '</span>' +
  652 + // '<span class="help-block" >站点编码:' + objStation.stationStationCod + '</span>' +
  653 + // '<span class="help-block" >站点序号:' + objStation.stationRouteStationRouteCode + '</span>' +
  654 + // '<span class="help-block" >站点类型:' + markTypeStr + '</span>' +
  655 + // '<span class="help-block" >经度:&nbsp&nbsp' + point[0] + '</span>' +
  656 + // '<span class="help-block" >纬度:&nbsp&nbsp' + point[1] + '</span>' +
  657 + // '<span class="help-block" >到站时间:' + objStation.stationRouteToTime + '&nbsp;分钟</span>' +
  658 + // '<span class="help-block" >到站距离:' + objStation.stationRouteDistances + '&nbsp;公里</span>' +
  659 + // '<span class="help-block" >缓冲区形状:' + (objStation.stationShapesType == "r"?"圆形":"多边形") + '</span>' +
  660 + // '<span class="help-block" >版本号:&nbsp&nbsp' + objStation.stationRouteVersions + '</span>' +
  661 + // '<div style="display: flex">' +
  662 + // '<span><button style="background: #ff8355; color: #fff; padding-bottom:5px; font-size: 9px;" class="btn btn-circle" ' +
  663 + // 'id="editStation" onclick="WorldsBMap.editStation('+objStation.stationRouteDirections+')">修改站点</button></span>' +
  664 + // '<span><button style="background: #ff8355; color: #fff; padding-bottom:5px; font-size: 9px;" class="btn btn-circle" ' +
  665 + // 'id="addBetweenStationRoad" onclick="WorldsBMap.addBetweenStationRoad('+objStation.stationRouteId+')">添加站点间路段</button></span>' +
  666 + // '</div>';
  667 + //
  668 + // // 创建信息窗口
  669 + // var infoWindow_target = new BMap.InfoWindow(htm, opts_polygon);
  670 + // // 自定义标注物图片
  671 + // var icon_target = new BMap.Icon('/pages/base/stationroute/css/img/cz.png',new BMap.Size(20, 20));
  672 + // // 创建点
  673 + // marker = new BMap.Marker(pointPolygon,{icon : icon_target});
  674 + // // 把标注添物加到地图上
  675 + // mapBValue.addOverlay(marker);
  676 + // // 是否在平移过程中禁止动画。(自1.2新增)
  677 + // var PanOptions_ ={noAnimation :true};
  678 + // // 将地图的中心点更改为给定的点。
  679 + // mapBValue.panTo(pointPolygon,PanOptions_);
  680 + // // 将地图在水平位置上移动x像素,垂直位置上移动y像素。
  681 + // mapBValue.panBy(10,-150,PanOptions_);
  682 + // //开启信息窗口
  683 + // mapBValue.openInfoWindow(infoWindow_target,pointPolygon);
667 }, 684 },
668 685
669 686
@@ -1003,6 +1020,84 @@ var WorldsBMap = function () { @@ -1003,6 +1020,84 @@ var WorldsBMap = function () {
1003 busline.getBusList(lineNameValue); 1020 busline.getBusList(lineNameValue);
1004 1021
1005 }, 1022 },
  1023 + editStation : function(dir) {
  1024 + // $.get("/stationroute/findStationRouteInfo",{"id":stationRouteId},function (route) {
  1025 + $.get('edit_select.html', function(m){
  1026 + $(pjaxContainer).append(m);
  1027 + $('#edit_select_mobal').trigger('editSelectMobal_show', [WorldsBMap,DrawingManagerObj,GetAjaxData,EditStationObj,LineObj,PublicFunctions,dir]);
  1028 + });
  1029 + // });
  1030 + },
  1031 + addBetweenStationRoad : function (stationRouteId) {
  1032 + $.get("/stationroute/findStationRouteInfo",{"id":stationRouteId},function (route) {
  1033 + var stationRouteBegin = route[0];
  1034 + // 查询下一个站点
  1035 + $.get("/stationroute/findDownStationRoute",{"lineId":stationRouteBegin.stationRouteLine, "direction":stationRouteBegin.stationRoutedirections, "stationRouteCode":stationRouteBegin.stationRouteCode},function (stationRoute) {
  1036 + var stationRouteFinish = stationRoute[0];
  1037 +
  1038 + if(stationRouteFinish){
  1039 + var pointBegin = stationRouteBegin.stationJwpoints.split(" ");
  1040 + var pointFinish = stationRouteFinish.stationJwpoints.split(" ")
  1041 + console.log(pointFinish);
  1042 + var sectionList = [];
  1043 + // 两个站点的坐标
  1044 + var poiOne = new BMap.Point(pointBegin[0],pointBegin[1]);
  1045 + var poiTwo = new BMap.Point(pointFinish[0],pointFinish[1]);
  1046 + // 路径规划保存按钮
  1047 + var label = new BMap.Label("保存路段", {
  1048 + offset: new BMap.Size(13, -53)
  1049 + });
  1050 + label.setStyle({
  1051 + color: '#fff',
  1052 + background:"url(/pages/base/stationroute/css/img/bg.png)",
  1053 + border: '0px solid',
  1054 + textAlign: "center",
  1055 + height: "28px",
  1056 + lineHeight: "26px",
  1057 + width: "80px",
  1058 + maxWidth: "none"
  1059 + });
  1060 + label.addEventListener('click', function () {
  1061 + var params = {};
  1062 + params.lineId = stationRouteBegin.stationRouteLine;
  1063 + params.lineCode = stationRouteBegin.stationRouteLIneCode;
  1064 + params.directions = stationRouteBegin.stationRoutedirections;
  1065 + params.stationRouteBegin = stationRouteBegin.stationRouteName;
  1066 + params.stationRouteFinish = stationRouteFinish.stationRouteName;
  1067 + params.route = $("#routePlanning").val();
  1068 + $.get('doublename_road.html', function(m){
  1069 + $(pjaxContainer).append(m);
  1070 + $('#doublename_road_mobal').trigger('doubleNameRoadMobal_show', [params,WorldsBMap,GetAjaxData,PublicFunctions]);
  1071 + });
  1072 + });
  1073 + // 路径规划
  1074 + var transit = new BMap.DrivingRoute(mapBValue, {renderOptions: {map: mapBValue,enableDragging : true},onPolylinesSet: searchPolylinesSet});
  1075 + function searchPolylinesSet(results){
  1076 + if (transit.getStatus() == BMAP_STATUS_SUCCESS){
  1077 + var sectionArrayList = [];
  1078 + for (i = 0; i < results.length; i++){
  1079 + sectionArrayList = sectionArrayList.concat(results[i].getPolyline().getPath());
  1080 + }
  1081 + sectionList = sectionArrayList;//JSON.stringify()
  1082 + $("#routePlanning").val(JSON.stringify(sectionArrayList));
  1083 + var pointMap = new Map();
  1084 + pointMap = sectionArrayList[sectionArrayList.length-1];
  1085 + var pointLabel = new BMap.Point(pointMap.lng,pointMap.lat);
  1086 + label.enableMassClear();
  1087 + label.setPosition(pointLabel);
  1088 + mapBValue.addOverlay(label);
  1089 + }
  1090 + }
  1091 + transit.search(poiOne,poiTwo);
  1092 + transit.disableAutoViewport();
  1093 + } else {
  1094 + layer.msg("您选择的站点后没有站点了,不能生成站点间路段!")
  1095 + }
  1096 +
  1097 + });
  1098 + });
  1099 +
  1100 + },
1006 1101
1007 clearMarkAndOverlays : function() { 1102 clearMarkAndOverlays : function() {
1008 1103
src/main/resources/static/pages/base/stationroute/js/stationroute-list-treedata.js
@@ -37,7 +37,7 @@ var StationTreeData = function(){ @@ -37,7 +37,7 @@ var StationTreeData = function(){
37 // 百度地图画圆 37 // 百度地图画圆
38 WorldsBMap.pointsCircle(data); 38 WorldsBMap.pointsCircle(data);
39 39
40 - // 如果是多变行 40 + // 如果是多边形
41 }else if(shapesTypeT == 'd') { 41 }else if(shapesTypeT == 'd') {
42 42
43 // 百度地图画多边形 43 // 百度地图画多边形
src/main/resources/static/pages/base/stationroute/list.html
@@ -2,7 +2,9 @@ @@ -2,7 +2,9 @@
2 <div class="portlet-body"> 2 <div class="portlet-body">
3 <!-- 地图 --> 3 <!-- 地图 -->
4 <div id="bmap_basic" class="bmaps"></div> 4 <div id="bmap_basic" class="bmaps"></div>
5 - <div class="portlet box protlet-box" style="top:20px;border-radius: 6px !important;box-shadow: 10px 10px 5px #888888;"> 5 + <!-- 路径规划路段 -->
  6 + <input class="hand" id="routePlanning" />
  7 + <div class="portlet box protlet-box">
6 <!-- 左边标题栏 --> 8 <!-- 左边标题栏 -->
7 <div class="portlet-title" style="background-color:#12527f;"> 9 <div class="portlet-title" style="background-color:#12527f;">
8 <div class="caption"> 10 <div class="caption">
@@ -13,7 +15,7 @@ @@ -13,7 +15,7 @@
13 </div> 15 </div>
14 </div> 16 </div>
15 <!-- 左边栏 --> 17 <!-- 左边栏 -->
16 - <div class="portlet-body" id="scrllmouseEvent" style="border: 1px solid rgb(255, 255, 255); display: block;min-height: 420px;"> 18 + <div class="portlet-body" id="scrllmouseEvent" style="border: 1px solid rgb(255, 255, 255); display: block;min-height: 520px;">
17 <div class="row"> 19 <div class="row">
18 <!-- 上下行栏 --> 20 <!-- 上下行栏 -->
19 <div class="col-md-3 col-sm-3 col-xs-3"> 21 <div class="col-md-3 col-sm-3 col-xs-3">
@@ -50,9 +52,9 @@ @@ -50,9 +52,9 @@
50 <a href="javascript:;" id="addUpStation"><i class="fa fa-plus"></i> 添加站点</a> 52 <a href="javascript:;" id="addUpStation"><i class="fa fa-plus"></i> 添加站点</a>
51 </li> 53 </li>
52 <li class="divider"> </li> 54 <li class="divider"> </li>
53 - <li> 55 + <!--<li>
54 <a href="javascript:;" id="editUpStation"><i class="fa fa-pencil"></i> 修改站点</a> 56 <a href="javascript:;" id="editUpStation"><i class="fa fa-pencil"></i> 修改站点</a>
55 - </li> 57 + </li>-->
56 <li class="divider"> </li> 58 <li class="divider"> </li>
57 <li> 59 <li>
58 <a href="javascript:;" id="deleteUpStation"><i class="fa fa-close"></i> 撤销站点</a> 60 <a href="javascript:;" id="deleteUpStation"><i class="fa fa-close"></i> 撤销站点</a>
@@ -105,11 +107,11 @@ @@ -105,11 +107,11 @@
105 </a> 107 </a>
106 <ul class="dropdown-menu pull-right" style="min-width:100px"> 108 <ul class="dropdown-menu pull-right" style="min-width:100px">
107 <li> 109 <li>
108 - <a class="upSystem" href="javascript:;" data-direction="0" data-pjax><i class="fa fa-wrench"></i> 系统规划</a> 110 + <a class="upManual" href="javascript:;" data-direction="0" data-pjax><i class="fa fa-pencil"></i> 手动添加站点</a>
109 </li> 111 </li>
110 <li class="divider"> </li> 112 <li class="divider"> </li>
111 <li> 113 <li>
112 - <a class="upManual" href="javascript:;" data-direction="0" data-pjax><i class="fa fa-pencil"></i> 其它方式</a> 114 + <a class="upSystem" href="javascript:;" data-direction="0" data-pjax><i class="fa fa-wrench"></i> 系统规划</a>
113 </li> 115 </li>
114 </ul> 116 </ul>
115 </div> 117 </div>
@@ -150,9 +152,9 @@ @@ -150,9 +152,9 @@
150 <a href="javascript:;" id="addDownStation"><i class="fa fa-plus"></i> 添加站点</a> 152 <a href="javascript:;" id="addDownStation"><i class="fa fa-plus"></i> 添加站点</a>
151 </li> 153 </li>
152 <li class="divider"> </li> 154 <li class="divider"> </li>
153 - <li> 155 + <!--<li>
154 <a href="javascript:;" id="editDownStation"><i class="fa fa-pencil"></i> 修改站点</a> 156 <a href="javascript:;" id="editDownStation"><i class="fa fa-pencil"></i> 修改站点</a>
155 - </li> 157 + </li>-->
156 <li class="divider"> </li> 158 <li class="divider"> </li>
157 <li> 159 <li>
158 <a href="javascript:;" id="deleteDownStation"><i class="fa fa-close"></i> 撤销站点</a> 160 <a href="javascript:;" id="deleteDownStation"><i class="fa fa-close"></i> 撤销站点</a>
@@ -201,11 +203,11 @@ @@ -201,11 +203,11 @@
201 </a> 203 </a>
202 <ul class="dropdown-menu pull-right" style="min-width:100px"> 204 <ul class="dropdown-menu pull-right" style="min-width:100px">
203 <li> 205 <li>
204 - <a class="downSystem" href="javascript:;" data-direction="1" data-pjax><i class="fa fa-wrench"></i> 系统规划</a> 206 + <a class="downManual" href="javascript:;" data-direction="1" data-pjax><i class="fa fa-pencil"></i> 手动添加站点</a>
205 </li> 207 </li>
206 <li class="divider"> </li> 208 <li class="divider"> </li>
207 <li> 209 <li>
208 - <a class="downManual" href="javascript:;" data-direction="1" data-pjax><i class="fa fa-pencil"></i> 其它方式</a> 210 + <a class="downSystem" href="javascript:;" data-direction="1" data-pjax><i class="fa fa-wrench"></i> 系统规划</a>
209 </li> 211 </li>
210 </ul> 212 </ul>
211 </div> 213 </div>
src/main/resources/static/pages/base/timesmodel/js/v2/core/InternalLpObj.js
1 -/**  
2 - * 内部路牌对象。  
3 - * @constructor  
4 - */  
5 -var InternalLpObj = function(  
6 - orilpObj, // 原始路牌对象  
7 - qCount, // 总共多少圈  
8 - isUp // 圈是以上行开始还是下行开始  
9 -) {  
10 - // TODO:原始路牌对象(这个路牌是对接外部gantt图像,以后有机会改了)  
11 - this._$$_orign_lp_obj = orilpObj;  
12 -  
13 - this._$_isUp = isUp;  
14 -  
15 - // 路牌的圈数,注意每个路牌的圈数都是一致的,  
16 - // 但并不是每一圈都有值  
17 - // 第1圈从上标线开始  
18 - // 第0圈表示中标线的第一个班次组成的半圈  
19 - // 有多少圈根据最终迭代的结果来看  
20 - this._$_qCount = qCount;  
21 - // 保存的是 InternalGroupBcObj 对象  
22 - this._$_groupBcArray = new Array(qCount);  
23 -  
24 - var i;  
25 - for (i = 0; i < this._$_qCount; i++) {  
26 - this._$_groupBcArray[i] = new InternalGroupObj(  
27 - this, this._$_isUp, undefined, undefined);  
28 - }  
29 -  
30 - // 距离上一个路牌的最小发车间隔时间  
31 - // 用于纵向添加班次的时候使用  
32 - // 默认第一个路牌为0  
33 - this._$_minVerticalIntervalTime = 0;  
34 -  
35 - // 详细记录每圈每个方向上的发车间隔时间  
36 - // 第一维度表示圈数,第二维度表示第一个方向,第二个方向  
37 - // 第一个方向是否上行由 _$_isUp 决定  
38 - // 这里的间隔表示下一个路牌上的班次距离本路牌的班次发车时间间隔  
39 - // 如果当前是最后一个路牌,表示第一个路牌的下一圈同方向班次距离本班次的间隔  
40 - this._$_aVerticalIntervalTime = new Array(this._$_qCount);  
41 - for (i = 0; i < this._$_aVerticalIntervalTime.length; i++) {  
42 - this._$_aVerticalIntervalTime[i] = new Array(2);  
43 - }  
44 -  
45 - // 班型的相关变量  
46 - this._$_bx_isLb = false; // 是否连班  
47 - this._$_bx_isfb = false; // 是否分班  
48 - this._$_bx_isfb_5_2 = false; // 是否5休2分班  
49 - this._$_bx_desc; // 班型描述(默认为路牌编号)  
50 -  
51 - // 其他班次(进出场,例包,吃饭等),TODO:以后再拆  
52 - this._$_other_bc_array = [];  
53 -  
54 - // TODO:  
55 -  
56 -};  
57 -  
58 -//------------------- get/set 方法 -------------------//  
59 -  
60 -InternalLpObj.prototype.getOtherBcArray = function() {  
61 - return this._$_other_bc_array;  
62 -};  
63 -InternalLpObj.prototype.addOtherBcArray = function(ba) {  
64 - this._$_other_bc_array = this._$_other_bc_array.concat(ba);  
65 -};  
66 -  
67 -/**  
68 - * 获取圈  
69 - * @param qIndex 圈index  
70 - */  
71 -InternalLpObj.prototype.getGroup = function(qIndex) {  
72 - return this._$_groupBcArray[qIndex];  
73 -};  
74 -  
75 -/**  
76 - * 获取路牌圈数。  
77 - * @returns {*}  
78 - */  
79 -InternalLpObj.prototype.fnGetGroupCount = function() {  
80 - return this._$_qCount;  
81 -};  
82 -  
83 -/**  
84 - * 是否上行。  
85 - * @returns boolean  
86 - */  
87 -InternalLpObj.prototype.isUp = function() {  
88 - return this._$_isUp;  
89 -};  
90 -  
91 -/**  
92 - * 获取班次。  
93 - * @param qIndex 第几圈  
94 - * @param bcIndex 第几个班次  
95 - */  
96 -InternalLpObj.prototype.getBc = function(qIndex, bcIndex) {  
97 - var group = this._$_groupBcArray[qIndex];  
98 - var bc;  
99 - if (bcIndex == 0) {  
100 - bc = group.getBc1();  
101 - } else if (bcIndex == 1) {  
102 - bc = group.getBc2();  
103 - }  
104 - return bc;  
105 -};  
106 -  
107 -/**  
108 - * 在具体位置设置班次。  
109 - * @param qIndex 第几圈  
110 - * @param bcIndex 第几个班次  
111 - * @param bc 班次对象  
112 - */  
113 -InternalLpObj.prototype.setBc = function(qIndex, bcIndex, bc) {  
114 - var group = this._$_groupBcArray[qIndex];  
115 - if (bcIndex == 0) {  
116 - group.setBc1(bc);  
117 - bc.setGroup(group);  
118 - } else if (bcIndex == 1) {  
119 - group.setBc2(bc);  
120 - bc.setGroup(group);  
121 - }  
122 -};  
123 -  
124 -/**  
125 - * 设置原始路牌对象。  
126 - * @param lpObj 原始路牌对象  
127 - */  
128 -InternalLpObj.prototype.setLp = function(lpObj) {  
129 - this._$$_orign_lp_obj = lpObj;  
130 - var i;  
131 - var group;  
132 - for (i = 0; i < this._$_groupBcArray.length; i++) {  
133 - group = this._$_groupBcArray[i];  
134 - if (group) {  
135 - group.setLp(this); // 圈和班次保存都是 InternalLpObj 对象  
136 - }  
137 - }  
138 -};  
139 -  
140 -InternalLpObj.prototype.getLpNo = function() {  
141 - return this._$$_orign_lp_obj.lpNo;  
142 -};  
143 -InternalLpObj.prototype.getLpName = function() {  
144 - return this._$$_orign_lp_obj.lpName;  
145 -};  
146 -InternalLpObj.prototype.setBxFb5_2 = function(fb) {  
147 - this._$_bx_isfb_5_2 = fb;  
148 -};  
149 -InternalLpObj.prototype.isBxFb5_2 = function() {  
150 - return this._$_bx_isfb_5_2;  
151 -};  
152 -InternalLpObj.prototype.setBxLb = function(lb) {  
153 - this._$_bx_isLb = lb;  
154 -};  
155 -InternalLpObj.prototype.isBxLb = function() {  
156 - return this._$_bx_isLb;  
157 -};  
158 -  
159 -InternalLpObj.prototype.setBxFb = function(fb) {  
160 - this._$_bx_isfb = fb;  
161 -};  
162 -InternalLpObj.prototype.isBxFb = function() {  
163 - return this._$_bx_isfb;  
164 -};  
165 -  
166 -/**  
167 - * 设置路牌的班型描述(最终是设置班次的路牌名字)。  
168 - * @param desc 描述  
169 - */  
170 -InternalLpObj.prototype.setBxDesc = function(desc) {  
171 - // 最终原始路牌的名字  
172 - this._$$_orign_lp_obj.lpName = desc + "_" + this._$$_orign_lp_obj.lpNo;  
173 - // 内部对象的班型描述  
174 - this._$_bx_desc = desc;  
175 -};  
176 -/**  
177 - * 获取版型描述  
178 - * @returns string  
179 - */  
180 -InternalLpObj.prototype.getBxDesc = function() {  
181 - return this._$_bx_desc;  
182 -};  
183 -  
184 -/**  
185 - * 设置纵向最小发车间隔时间。  
186 - * @param v  
187 - */  
188 -InternalLpObj.prototype.setVerticalMinIntervalTime = function(v) {  
189 - // 第一个路牌,都为0  
190 - this._$_minVerticalIntervalTime = v;  
191 -};  
192 -/**  
193 - * 获取纵向最小发车间隔时间。  
194 - * @returns {number|*}  
195 - */  
196 -InternalLpObj.prototype.getVerticalMinIntervalTime = function() {  
197 - return this._$_minVerticalIntervalTime;  
198 -};  
199 -  
200 -/**  
201 - * 设置纵向发车间隔。  
202 - * @param iQindex 圈index  
203 - * @param iBindex 班次index  
204 - * @param iTime 间隔时间  
205 - */  
206 -InternalLpObj.prototype.fnSetVerticalIntervalTime = function(iQindex, iBindex, iTime) {  
207 - this._$_aVerticalIntervalTime[iQindex][iBindex] = iTime;  
208 -};  
209 -  
210 -/**  
211 - * 返回纵向发车间隔。  
212 - * @param iQindex 圈index  
213 - * @param iBindex 班次index  
214 - */  
215 -InternalLpObj.prototype.fnGetVerticalIntervalTime = function(iQindex, iBindex) {  
216 - return this._$_aVerticalIntervalTime[iQindex][iBindex];  
217 -};  
218 -  
219 -//-------------------- 班次操作方法(查询,统计,删除) -----------------------//  
220 -  
221 -/**  
222 - * 返回总共班次数。  
223 - */  
224 -InternalLpObj.prototype.getBcCount = function() {  
225 - var i;  
226 - var group;  
227 - var bccount = 0;  
228 - for (i = 0; i < this._$_groupBcArray.length; i++) {  
229 - group = this._$_groupBcArray[i];  
230 - if (group) {  
231 - if (group.getBc1()) {  
232 - bccount += 1;  
233 - }  
234 - if (group.getBc2()) {  
235 - bccount += 1;  
236 - }  
237 - }  
238 - }  
239 -  
240 - return bccount;  
241 -};  
242 -  
243 -/**  
244 - * 返回班次列表,过滤空的班次,将所有存在的班次连成连续的对象数组返回。  
245 - * @returns arrays (InternalBcObj)  
246 - */  
247 -InternalLpObj.prototype.getBcArray = function() {  
248 - var bcArray = [];  
249 - var i;  
250 - var group;  
251 - for (i = 0; i < this._$_groupBcArray.length; i++) {  
252 - group = this._$_groupBcArray[i];  
253 - if (group) {  
254 - group.getBc1() ? bcArray.push(group.getBc1()) : "";  
255 - group.getBc2() ? bcArray.push(group.getBc2()) : "";  
256 - }  
257 - }  
258 -  
259 - return bcArray;  
260 -};  
261 -  
262 -/**  
263 - * 获取最小(最早)班次对象。  
264 - * @returns [{圈index},{班次index}]  
265 - */  
266 -InternalLpObj.prototype.getMinBcObjPosition = function() {  
267 - var i;  
268 - var bIndex = [];  
269 - for (i = 0; i < this._$_groupBcArray.length; i++) {  
270 - if (this._$_groupBcArray[i].getBc1()) {  
271 - bIndex.push(i);  
272 - bIndex.push(0);  
273 - break;  
274 - }  
275 - if (this._$_groupBcArray[i].getBc2()) {  
276 - bIndex.push(i);  
277 - bIndex.push(1);  
278 - break;  
279 - }  
280 - }  
281 - return bIndex;  
282 -};  
283 -  
284 -/**  
285 - * 获取最大(最晚)班次对象。  
286 - * @returns [{圈index},{班次index}]  
287 - */  
288 -InternalLpObj.prototype.getMaxBcObjPosition = function() {  
289 - var i;  
290 - var bIndex = [];  
291 - for (i = this._$_groupBcArray.length - 1; i >= 0; i--) {  
292 - if (this._$_groupBcArray[i].getBc2()) {  
293 - bIndex.push(i);  
294 - bIndex.push(1);  
295 - break;  
296 - }  
297 - if (this._$_groupBcArray[i].getBc1()) {  
298 - bIndex.push(i);  
299 - bIndex.push(0);  
300 - break;  
301 - }  
302 - }  
303 - return bIndex;  
304 -};  
305 -  
306 -InternalLpObj.prototype.getMinBcObj = function() {  
307 - var i;  
308 - var bcObj;  
309 - for (i = 0; i < this._$_groupBcArray.length; i++) {  
310 - bcObj = this._$_groupBcArray[i].getBc1();  
311 - if (bcObj) {  
312 - break;  
313 - }  
314 - bcObj = this._$_groupBcArray[i].getBc2();  
315 - if (bcObj) {  
316 - break;  
317 - }  
318 - }  
319 - return bcObj;  
320 -};  
321 -InternalLpObj.prototype.getMaxBcObj = function() {  
322 - var i;  
323 - var bcObj;  
324 - for (i = this._$_groupBcArray.length - 1; i >= 0; i--) {  
325 - bcObj = this._$_groupBcArray[i].getBc2();  
326 - if (bcObj) {  
327 - break;  
328 - }  
329 - bcObj = this._$_groupBcArray[i].getBc1();  
330 - if (bcObj) {  
331 - break;  
332 - }  
333 - }  
334 - return bcObj;  
335 -};  
336 -  
337 -/**  
338 - * 获取车次链信息。  
339 - * @param num 第几个车次链  
340 - * @returns object {s_q: {开始圈索引},s_b : {开始班次索引},e_q : {结束圈索引},e_b : {结束班次索引}, bcount : {班次数}}  
341 - */  
342 -InternalLpObj.prototype.fnGetBcChainInfo = function(num) {  
343 - // 计算总的车次链信息  
344 - var aChainInfo = [];  
345 - var oChainInfo;  
346 - var aBcIndex = this.getMinBcObjPosition();  
347 - var oBc;  
348 - var iQIndex;  
349 - var iBcIndex;  
350 - var i;  
351 - var bFlag;  
352 -  
353 - var iBcount = 0;  
354 -  
355 - if (aBcIndex.length == 2) {  
356 - iBcount = 1;  
357 - oChainInfo = {s_q : aBcIndex[0], s_b : aBcIndex[1], e_q : aBcIndex[0], e_b : aBcIndex[1], bcount: 1};  
358 - aChainInfo.push(oChainInfo);  
359 - bFlag = true;  
360 -  
361 - // 下一个班次的索引  
362 - iQIndex = aBcIndex[1] == 0 ? aBcIndex[0] : aBcIndex[0] + 1;  
363 - iBcIndex = aBcIndex[1] == 0 ? 1 : 0;  
364 -  
365 - for (i = iQIndex; i < this._$_qCount; i++) {  
366 - while (iBcIndex <= 1) {  
367 - oBc = this.getBc(i, iBcIndex);  
368 - if (!oBc) {  
369 - if (bFlag) {  
370 - // 车次链结尾是这个班次的前一个班次  
371 - oChainInfo.e_q = iBcIndex == 0 ? i - 1 : i;  
372 - oChainInfo.e_b = iBcIndex == 0 ? 1 : 0;  
373 - oChainInfo.bcount = iBcount;  
374 - }  
375 -  
376 - bFlag = false;  
377 - } else {  
378 - if (bFlag) {  
379 - iBcount ++;  
380 - oChainInfo.bcount = iBcount;  
381 - } else {  
382 - // 下一个车次链开始  
383 - iBcount = 1;  
384 - oChainInfo = {s_q : i, s_b : iBcIndex, e_q : i, e_b : iBcIndex, bcount: 1};  
385 - aChainInfo.push(oChainInfo);  
386 - bFlag = true;  
387 - }  
388 - }  
389 -  
390 -  
391 - iBcIndex ++;  
392 - }  
393 - iBcIndex = 0;  
394 - }  
395 -  
396 - }  
397 -  
398 - return aChainInfo[num];  
399 -};  
400 -  
401 -/**  
402 - * 获取车次链的个数。  
403 - * @returns int  
404 - */  
405 -InternalLpObj.prototype.fnGetBcChainCount = function() {  
406 - var iChainCount = 0;  
407 - var aBcIndex = this.getMinBcObjPosition();  
408 -  
409 - var oBc;  
410 - var iQIndex;  
411 - var iBcIndex;  
412 - var i;  
413 - var bFlag;  
414 -  
415 - if (aBcIndex.length == 2) {  
416 - iChainCount = 1;  
417 - bFlag = true;  
418 -  
419 - // 下一个班次的索引  
420 - iQIndex = aBcIndex[1] == 0 ? aBcIndex[0] : aBcIndex[0] + 1;  
421 - iBcIndex = aBcIndex[1] == 0 ? 1 : 0;  
422 -  
423 - for (i = iQIndex; i < this._$_qCount; i++) {  
424 - while (iBcIndex <= 1) {  
425 - oBc = this.getBc(i, iBcIndex);  
426 - if (!oBc) {  
427 - bFlag = false;  
428 - } else {  
429 - if (bFlag) {  
430 -  
431 - } else {  
432 - iChainCount ++;  
433 - bFlag = true;  
434 - }  
435 - }  
436 -  
437 -  
438 - iBcIndex ++;  
439 - }  
440 - iBcIndex = 0;  
441 - }  
442 -  
443 - }  
444 -  
445 -  
446 - return iChainCount;  
447 -};  
448 -  
449 -/**  
450 - * 在具体位置移除班次。  
451 - * @param qIndex 第几圈  
452 - * @param bcIndex 第几个班次  
453 - */  
454 -InternalLpObj.prototype.removeBc = function(qIndex, bcIndex) {  
455 - var group = this._$_groupBcArray[qIndex];  
456 - if (bcIndex == 0) {  
457 - group.removeBc1();  
458 - } else if (bcIndex == 1) {  
459 - group.removeBc2();  
460 - }  
461 -};  
462 -  
463 -/**  
464 - * 使用指定时间匹配返回离之最近的第几圈第几个班次,  
465 - * 使用时间差的绝度值,比较,取最小的  
466 - * 如果有两个一样的时间差,取比fctime大的时间  
467 - * @param fctime moment 比较用时间  
468 - * @param groupArray 圈数组  
469 - * @param hasUp boolean 计算上行班次  
470 - * @param hasDown boolean 计算下行班次  
471 - * @returns [{第几圈},{第几个班次}]  
472 - */  
473 -InternalLpObj.prototype.fnGetQBcIndexWithFcTimeFromGroupArray = function(  
474 - fctime, groupArray, hasUp, hasDown  
475 -) {  
476 - var i;  
477 - var timediff; // 时间差取绝对值  
478 - var qIndex;  
479 - var bcIndex;  
480 -  
481 - var group;  
482 - var bc1time;  
483 - var bc2time;  
484 -  
485 - var tempdiff;  
486 -  
487 - console.log("比较时间=" + fctime.format("HH:mm"));  
488 -  
489 - for (i = 0; i < this._$_qCount; i++) {  
490 - group = groupArray[i];  
491 - if (group) {  
492 - if (group.getBc1() && hasUp) {  
493 - bc1time = group.getBc1().getFcTimeObj();  
494 - console.log("bc1time=" + bc1time.format("HH:mm") + " tempdiff=" + tempdiff);  
495 - tempdiff = Math.abs(bc1time.diff(fctime));  
496 -  
497 - if (!timediff) {  
498 - timediff = Math.abs(tempdiff);  
499 - qIndex = i;  
500 - bcIndex = 0;  
501 - } else {  
502 - if (tempdiff < timediff) {  
503 - timediff = tempdiff;  
504 - qIndex = i;  
505 - bcIndex = 0;  
506 - } if (Math.abs(tempdiff) == timediff) {  
507 - if (bc1time.isAfter(fctime)) {  
508 - timediff = tempdiff;  
509 - qIndex = i;  
510 - bcIndex = 0;  
511 - }  
512 -  
513 - }  
514 - }  
515 - }  
516 -  
517 - if (group.getBc2() && hasDown) {  
518 - bc2time = group.getBc2().getFcTimeObj();  
519 - console.log("bc2time=" + bc2time.format("HH:mm") + " tempdiff=" + tempdiff);  
520 - tempdiff = Math.abs(bc2time.diff(fctime));  
521 -  
522 - if (!timediff) {  
523 - timediff = Math.abs(tempdiff);  
524 - qIndex = i;  
525 - bcIndex = 1;  
526 - } else {  
527 - if (tempdiff < timediff) {  
528 - timediff = tempdiff;  
529 - qIndex = i;  
530 - bcIndex = 1;  
531 - } if (Math.abs(tempdiff) == timediff) {  
532 - if (bc2time.isBefore(fctime)) {  
533 - timediff = tempdiff;  
534 - qIndex = i;  
535 - bcIndex = 1;  
536 - }  
537 -  
538 - }  
539 - }  
540 - }  
541 - }  
542 - }  
543 -  
544 - console.log("中标线对应数组索引=" + qIndex);  
545 -  
546 - var rst = [];  
547 - rst.push(qIndex);  
548 - rst.push(bcIndex);  
549 -  
550 - return rst;  
551 -};  
552 -  
553 -/**  
554 - * 使用指定时间匹配返回离之最近的第几圈第几个班次,  
555 - * 使用时间差的绝度值,比较,取最小的  
556 - * 如果有两个一样的时间差,取比fctime大的时间  
557 - * @param fctime moment 比较用时间  
558 - * @param hasUp boolean 计算上行班次  
559 - * @param hasDown boolean 计算下行班次  
560 - * @returns [{第几圈},{第几个班次}]  
561 - */  
562 -InternalLpObj.prototype.getQBcIndexWithFcTime = function(  
563 - fctime, hasUp, hasDown  
564 -) {  
565 - return this.fnGetQBcIndexWithFcTimeFromGroupArray(fctime, this._$_groupBcArray, hasUp, hasDown);  
566 -};  
567 -  
568 -//---------------------- 内部数据初始化方法(不同于构造函数)---------------------//  
569 -  
570 -/**  
571 - * 从指定开始时间到结束时间创建不间断班次(连班),并初始化路牌  
572 - * 注意,之前有班次会删除后再创建。  
573 - * @param startTime 开始时间  
574 - * @param endTime 结束时间  
575 - * @param isUp 第一个班次是上行还是下行  
576 - * @param fromQ 从第几圈开始加入  
577 - * @param paramObj 参数对象  
578 - * @param factory 工厂对象  
579 - */  
580 -InternalLpObj.prototype.initDataFromTimeToTime = function(  
581 - startTime,  
582 - endTime,  
583 - isUp,  
584 - fromQ,  
585 - paramObj,  
586 - factory) {  
587 -  
588 - var bcData = []; // 班次数组  
589 - var bcObj;  
590 - var kssj = startTime;  
591 - var fcno = 1; // 发车顺序号  
592 - var bcCount = 1; // 班次数  
593 - do {  
594 - bcObj = factory.createBcObj(  
595 - this, "normal", isUp, fcno, kssj, paramObj); // this就是所属路牌对象  
596 - bcData.push(bcObj);  
597 -  
598 - kssj = paramObj.addMinute(kssj, bcObj.getBcTime() + bcObj.getStopTime());  
599 - fcno ++;  
600 - bcCount ++;  
601 - isUp = !isUp;  
602 - } while(kssj.isBefore(endTime));  
603 - bcCount--;  
604 -  
605 - //console.log("last -1;" + bcData[bcCount -2].getFcTimeObj().format("HH:mm"));  
606 - //console.log("last;" + bcData[bcCount -1].getFcTimeObj().format("HH:mm"));  
607 - //console.log("endtime: " + endTime.format("HH:mm"));  
608 -  
609 - //if (bcCount > 0 && bcData[bcCount - 1].getArrTimeObj().isAfter(endTime)) {  
610 - // // 如果最后一个班次的到达时间超过结束时间,也要去除  
611 - // bcData.splice(bcCount - 1, 1);  
612 - //}  
613 -  
614 - this._initDataFromLbBcArray(bcData, fromQ);  
615 -  
616 -};  
617 -  
618 -/**  
619 - * 使用连班的班次数组初始化路牌(相应的圈会被覆盖)。  
620 - * @param bcArray 连班班次数组  
621 - * @param fromQ 从第几圈开始加入  
622 - */  
623 -InternalLpObj.prototype._initDataFromLbBcArray = function(  
624 - bcArray,  
625 - fromQ  
626 -) {  
627 - var _bc1Obj;  
628 - var _bc2Obj;  
629 - var _qObj;  
630 -  
631 - // 第一班次是上行还是下行  
632 - var isUp = bcArray[0].isUp();  
633 -  
634 - if (bcArray.length > 0 && fromQ < this._$_qCount) {  
635 - // 构造圈数  
636 - if (isUp != this._$_isUp) {  
637 - // 如果方向不一致,意味着第一个班次是半圈  
638 - // 加半圈,并加在bc2上  
639 - _bc2Obj = bcArray.slice(0, 1)[0];  
640 - _qObj = new InternalGroupObj(  
641 - this,  
642 - this._$_isUp,  
643 - undefined,  
644 - _bc2Obj  
645 - );  
646 - _bc2Obj.setGroup(_qObj);  
647 - this._$_groupBcArray[fromQ] = _qObj;  
648 -  
649 - bcArray.splice(0, 1);  
650 - fromQ ++;  
651 - }  
652 -  
653 - var qCount1 = Math.floor(bcArray.length / 2); // 需要添加多少圈  
654 - var qCount2 = bcArray.length % 2; // 最后是否有半圈  
655 -  
656 - while (fromQ < this._$_qCount) {  
657 - if (qCount1 > 0) {  
658 - _bc1Obj = bcArray.slice(0, 1)[0];  
659 - _bc2Obj = bcArray.slice(1, 2)[0];  
660 - _qObj = new InternalGroupObj(  
661 - this,  
662 - this._$_isUp,  
663 - _bc1Obj,  
664 - _bc2Obj  
665 - );  
666 - _bc1Obj.setGroup(_qObj);  
667 - _bc2Obj.setGroup(_qObj);  
668 - this._$_groupBcArray[fromQ] = _qObj;  
669 -  
670 - bcArray.splice(0, 2);  
671 - qCount1 --;  
672 - } else if (qCount2 > 0) {  
673 - // 加半圈,并加在bc1上  
674 - _bc1Obj = bcArray.slice(0, 1)[0];  
675 - _qObj = new InternalGroupObj(  
676 - this,  
677 - this._$_isUp,  
678 - _bc1Obj,  
679 - undefined  
680 - );  
681 - _bc1Obj.setGroup(_qObj);  
682 - this._$_groupBcArray[fromQ] = _qObj;  
683 -  
684 - bcArray.splice(0, 1);  
685 - qCount2 --;  
686 - } else {  
687 - break;  
688 - }  
689 -  
690 - fromQ ++;  
691 - }  
692 - }  
693 -};  
694 -  
695 -//-------------------------- 其他方法 ----------------------------//  
696 -  
697 -/**  
698 - * 从指定位置的班次开始,往后所有的班次修正发车时间  
699 - * @param groupIndex  
700 - * @param bcIndex  
701 - * @param time  
702 - */  
703 -InternalLpObj.prototype.fnAddMinuteToBcFcsj = function(groupIndex, bcIndex, time) {  
704 - var i;  
705 - var oCurBc;  
706 -  
707 - // 修正之前班次的停站时间  
708 - //oCurBc = this.getBc(  
709 - // bcIndex == 0 ? groupIndex - 1 : groupIndex,  
710 - // bcIndex == 1 ? 0 : 1  
711 - //);  
712 - //if (oCurBc) {  
713 - // oCurBc.setStopTime(oCurBc.getStopTime() + time);  
714 - //}  
715 -  
716 -  
717 - for (i = groupIndex; i < this._$_qCount; i++) {  
718 - if (bcIndex == 0) {  
719 - oCurBc = this.getBc(i, 0);  
720 - if (oCurBc) {  
721 - oCurBc.addMinuteToFcsj(time);  
722 - }  
723 - oCurBc = this.getBc(i, 1);  
724 - if (oCurBc) {  
725 - oCurBc.addMinuteToFcsj(time);  
726 - }  
727 -  
728 - } else {  
729 - oCurBc = this.getBc(i, 1);  
730 - if (oCurBc) {  
731 - oCurBc.addMinuteToFcsj(time);  
732 - }  
733 -  
734 - }  
735 -  
736 - bcIndex = 0;  
737 - }  
738 -};  
739 -  
740 -/**  
741 - * 在指定位置添加一个吃饭班次。  
742 - * 注1:吃饭班次不是普通班次,不记录进圈,记录进_$_other_bc_array  
743 - * 注2:添加吃饭班次时,会修改之前班次的停战时间,所以导致之后的班次的停战都会发生变化  
744 - * @param groupIndex  
745 - * @param bcIndex  
746 - * @param factory  
747 - * @param paramObj  
748 - * @returns int 相差时间(吃饭时间距离和停站时间相差值)  
749 - */  
750 -InternalLpObj.prototype.fnAddEatBc = function(groupIndex, bcIndex, factory, paramObj) {  
751 - var oPreBc;  
752 - var oEatBc;  
753 - var iBcModifyTime;  
754 - oPreBc = this.getBc( // 前一个邻接班次  
755 - bcIndex == 0 ? groupIndex - 1 : groupIndex,  
756 - bcIndex == 1 ? 0 : 1);  
757 - if (oPreBc) { // 存在前一个班次  
758 - oEatBc = factory.createBcObj(  
759 - this,  
760 - "cf",  
761 - !oPreBc.isUp(), // 和上一个班次方向相反  
762 - 1,  
763 - paramObj.addMinute(oPreBc.getArrTimeObj(), oPreBc.getStopTime()), // 使用上一个班次的到达时间作为开始时间  
764 - paramObj  
765 - );  
766 -  
767 - //iBcModifyTime = oEatBc.getBcTime() - oPreBc.getStopTime(); // 后续班次要调整的时间  
768 -  
769 - // 修正之后的班次发车时间  
770 - // 注意:之后那个班次发车时间就是吃饭班次的到达时间  
771 - iBcModifyTime = oEatBc.getArrTimeObj().diff(this.getBc(groupIndex, bcIndex).getFcTimeObj(), "m");  
772 - this.fnAddMinuteToBcFcsj(groupIndex, bcIndex, iBcModifyTime);  
773 -  
774 - oPreBc.setStopTime(0); // 不重置停站时间  
775 - oPreBc.fnSetEatTime(oEatBc.getBcTime());  
776 -  
777 - //this._$_other_bc_array.push(oEatBc);  
778 -  
779 - return iBcModifyTime;  
780 - } else {  
781 - return false;  
782 - }  
783 -  
784 -};  
785 -  
786 -/**  
787 - * 调整路牌的班次,通过调整停站时间,或者班次发车时间,不能让班次的到达时间和下一个班次的发车时间重叠。  
788 - * @param iPeakAverStopTime 高峰平均停站时间  
789 - * @param iTroughAverStopTime 低谷平均停站时间  
790 - * @param oParam 参数对象  
791 - */  
792 -InternalLpObj.prototype.fnAdjustBcInterval = function(iPeakAverStopTime, iTroughAverStopTime, oParam) {  
793 - // 获取车次链个数  
794 - var iBcChainCount = this.fnGetBcChainCount();  
795 -  
796 - var i;  
797 - var j;  
798 - var oBcIndex;  
799 - var iQIndex;  
800 - var iBcIndex;  
801 - var iBcCount;  
802 - var oBc;  
803 - var oNextBc;  
804 -  
805 - var iBcStopTime;  
806 -  
807 - for (i = 0; i < iBcChainCount; i++) {  
808 - oBcIndex = this.fnGetBcChainInfo(i);  
809 - iQIndex = oBcIndex["s_q"];  
810 - iBcIndex = oBcIndex["s_b"];  
811 - iBcCount = oBcIndex["bcount"];  
812 -  
813 - for (j = 0; j < iBcCount - 1; j++) {  
814 - oBc = this.getBc(iQIndex, iBcIndex);  
815 - oNextBc = this.getBc(  
816 - iBcIndex == 0 ? iQIndex : iQIndex + 1,  
817 - iBcIndex == 0 ? 1 : 0);  
818 -  
819 - if (oNextBc.fnIsFirstBc()) { // 如果同一路牌连续2个方向首站班次,都不做处理  
820 - continue;  
821 - }  
822 -  
823 - // 不改变当前班次的行驶时间,修正停站时间和下一个班次的发车时间  
824 - iBcStopTime = oNextBc.getFcTimeObj().diff(oBc.getArrTimeObj(), "m");  
825 - if (iBcStopTime < 0) {  
826 - // 当前班次使用最小停站时间  
827 - oBc.setStopTime(oParam.fnCalcuFixedMinStopNumber(oBc.getArrTimeObj(), oBc.isUp()));  
828 - oNextBc.addMinuteToFcsj(oBc.getStopTime() + oBc.fnGetEatTime() - iBcStopTime);  
829 -  
830 - } else {  
831 - if (iBcStopTime == oBc.getStopTime() + oBc.fnGetEatTime()) {  
832 - // 停站时间一致,没有问题  
833 -  
834 -  
835 - } else {  
836 - // TODO:当前班次使用最小停站时间  
837 - oBc.setStopTime(oParam.fnCalcuFixedMinStopNumber(oBc.getArrTimeObj(), oBc.isUp()));  
838 - oNextBc.addMinuteToFcsj(oBc.getStopTime() + oBc.fnGetEatTime() - iBcStopTime);  
839 -  
840 - }  
841 - }  
842 -  
843 - iBcIndex = iBcIndex == 0 ? 1 : 0;  
844 - iQIndex = iBcIndex == 0 ? iQIndex + 1 : iQIndex;  
845 - }  
846 -  
847 - this.getBc(iQIndex, iBcIndex).setStopTime(0);  
848 - }  
849 -  
850 -  
851 -};  
852 -  
853 -  
854 -// TODO  
855 -  
856 -/**  
857 - *  
858 - *  
859 - */  
860 -InternalLpObj.prototype.calcuLpBx = function() {  
861 -  
862 -};  
863 -  
864 - 1 +/**
  2 + * 内部路牌对象。
  3 + * @constructor
  4 + */
  5 +var InternalLpObj = function(
  6 + orilpObj, // 原始路牌对象
  7 + qCount, // 总共多少圈
  8 + isUp // 圈是以上行开始还是下行开始
  9 +) {
  10 + // TODO:原始路牌对象(这个路牌是对接外部gantt图像,以后有机会改了)
  11 + this._$$_orign_lp_obj = orilpObj;
  12 +
  13 + this._$_isUp = isUp;
  14 +
  15 + // 路牌的圈数,注意每个路牌的圈数都是一致的,
  16 + // 但并不是每一圈都有值
  17 + // 第1圈从上标线开始
  18 + // 第0圈表示中标线的第一个班次组成的半圈
  19 + // 有多少圈根据最终迭代的结果来看
  20 + this._$_qCount = qCount;
  21 + // 保存的是 InternalGroupBcObj 对象
  22 + this._$_groupBcArray = new Array(qCount);
  23 +
  24 + var i;
  25 + for (i = 0; i < this._$_qCount; i++) {
  26 + this._$_groupBcArray[i] = new InternalGroupObj(
  27 + this, this._$_isUp, undefined, undefined);
  28 + }
  29 +
  30 + // 距离上一个路牌的最小发车间隔时间
  31 + // 用于纵向添加班次的时候使用
  32 + // 默认第一个路牌为0
  33 + this._$_minVerticalIntervalTime = 0;
  34 +
  35 + // 详细记录每圈每个方向上的发车间隔时间
  36 + // 第一维度表示圈数,第二维度表示第一个方向,第二个方向
  37 + // 第一个方向是否上行由 _$_isUp 决定
  38 + // 这里的间隔表示下一个路牌上的班次距离本路牌的班次发车时间间隔
  39 + // 如果当前是最后一个路牌,表示第一个路牌的下一圈同方向班次距离本班次的间隔
  40 + this._$_aVerticalIntervalTime = new Array(this._$_qCount);
  41 + for (i = 0; i < this._$_aVerticalIntervalTime.length; i++) {
  42 + this._$_aVerticalIntervalTime[i] = new Array(2);
  43 + }
  44 +
  45 + // 班型的相关变量
  46 + this._$_bx_isLb = false; // 是否连班
  47 + this._$_bx_isfb = false; // 是否分班
  48 + this._$_bx_isfb_5_2 = false; // 是否5休2分班
  49 + this._$_bx_desc; // 班型描述(默认为路牌编号)
  50 +
  51 + // 其他班次(进出场,例包,吃饭等),TODO:以后再拆
  52 + this._$_other_bc_array = [];
  53 +
  54 + // TODO:
  55 +
  56 +};
  57 +
  58 +//------------------- get/set 方法 -------------------//
  59 +
  60 +InternalLpObj.prototype.getOtherBcArray = function() {
  61 + return this._$_other_bc_array;
  62 +};
  63 +InternalLpObj.prototype.addOtherBcArray = function(ba) {
  64 + this._$_other_bc_array = this._$_other_bc_array.concat(ba);
  65 +};
  66 +
  67 +/**
  68 + * 获取圈
  69 + * @param qIndex 圈index
  70 + */
  71 +InternalLpObj.prototype.getGroup = function(qIndex) {
  72 + return this._$_groupBcArray[qIndex];
  73 +};
  74 +
  75 +/**
  76 + * 获取路牌圈数。
  77 + * @returns {*}
  78 + */
  79 +InternalLpObj.prototype.fnGetGroupCount = function() {
  80 + return this._$_qCount;
  81 +};
  82 +
  83 +/**
  84 + * 是否上行。
  85 + * @returns boolean
  86 + */
  87 +InternalLpObj.prototype.isUp = function() {
  88 + return this._$_isUp;
  89 +};
  90 +
  91 +/**
  92 + * 获取班次。
  93 + * @param qIndex 第几圈
  94 + * @param bcIndex 第几个班次
  95 + */
  96 +InternalLpObj.prototype.getBc = function(qIndex, bcIndex) {
  97 + var group = this._$_groupBcArray[qIndex];
  98 + var bc;
  99 + if (bcIndex == 0) {
  100 + bc = group.getBc1();
  101 + } else if (bcIndex == 1) {
  102 + bc = group.getBc2();
  103 + }
  104 + return bc;
  105 +};
  106 +
  107 +/**
  108 + * 在具体位置设置班次。
  109 + * @param qIndex 第几圈
  110 + * @param bcIndex 第几个班次
  111 + * @param bc 班次对象
  112 + */
  113 +InternalLpObj.prototype.setBc = function(qIndex, bcIndex, bc) {
  114 + var group = this._$_groupBcArray[qIndex];
  115 + if (bcIndex == 0) {
  116 + group.setBc1(bc);
  117 + bc.setGroup(group);
  118 + } else if (bcIndex == 1) {
  119 + group.setBc2(bc);
  120 + bc.setGroup(group);
  121 + }
  122 +};
  123 +
  124 +/**
  125 + * 设置原始路牌对象。
  126 + * @param lpObj 原始路牌对象
  127 + */
  128 +InternalLpObj.prototype.setLp = function(lpObj) {
  129 + this._$$_orign_lp_obj = lpObj;
  130 + var i;
  131 + var group;
  132 + for (i = 0; i < this._$_groupBcArray.length; i++) {
  133 + group = this._$_groupBcArray[i];
  134 + if (group) {
  135 + group.setLp(this); // 圈和班次保存都是 InternalLpObj 对象
  136 + }
  137 + }
  138 +};
  139 +
  140 +InternalLpObj.prototype.getLpNo = function() {
  141 + return this._$$_orign_lp_obj.lpNo;
  142 +};
  143 +InternalLpObj.prototype.getLpName = function() {
  144 + return this._$$_orign_lp_obj.lpName;
  145 +};
  146 +InternalLpObj.prototype.setBxFb5_2 = function(fb) {
  147 + this._$_bx_isfb_5_2 = fb;
  148 +};
  149 +InternalLpObj.prototype.isBxFb5_2 = function() {
  150 + return this._$_bx_isfb_5_2;
  151 +};
  152 +InternalLpObj.prototype.setBxLb = function(lb) {
  153 + this._$_bx_isLb = lb;
  154 +};
  155 +InternalLpObj.prototype.isBxLb = function() {
  156 + return this._$_bx_isLb;
  157 +};
  158 +
  159 +InternalLpObj.prototype.setBxFb = function(fb) {
  160 + this._$_bx_isfb = fb;
  161 +};
  162 +InternalLpObj.prototype.isBxFb = function() {
  163 + return this._$_bx_isfb;
  164 +};
  165 +
  166 +/**
  167 + * 设置路牌的班型描述(最终是设置班次的路牌名字)。
  168 + * @param desc 描述
  169 + */
  170 +InternalLpObj.prototype.setBxDesc = function(desc) {
  171 + // 最终原始路牌的名字
  172 + this._$$_orign_lp_obj.lpName = desc + "_" + this._$$_orign_lp_obj.lpNo;
  173 + // 内部对象的班型描述
  174 + this._$_bx_desc = desc;
  175 +};
  176 +/**
  177 + * 获取版型描述
  178 + * @returns string
  179 + */
  180 +InternalLpObj.prototype.getBxDesc = function() {
  181 + return this._$_bx_desc;
  182 +};
  183 +
  184 +/**
  185 + * 设置纵向最小发车间隔时间。
  186 + * @param v
  187 + */
  188 +InternalLpObj.prototype.setVerticalMinIntervalTime = function(v) {
  189 + // 第一个路牌,都为0
  190 + this._$_minVerticalIntervalTime = v;
  191 +};
  192 +/**
  193 + * 获取纵向最小发车间隔时间。
  194 + * @returns {number|*}
  195 + */
  196 +InternalLpObj.prototype.getVerticalMinIntervalTime = function() {
  197 + return this._$_minVerticalIntervalTime;
  198 +};
  199 +
  200 +/**
  201 + * 设置纵向发车间隔。
  202 + * @param iQindex 圈index
  203 + * @param iBindex 班次index
  204 + * @param iTime 间隔时间
  205 + */
  206 +InternalLpObj.prototype.fnSetVerticalIntervalTime = function(iQindex, iBindex, iTime) {
  207 + this._$_aVerticalIntervalTime[iQindex][iBindex] = iTime;
  208 +};
  209 +
  210 +/**
  211 + * 返回纵向发车间隔。
  212 + * @param iQindex 圈index
  213 + * @param iBindex 班次index
  214 + */
  215 +InternalLpObj.prototype.fnGetVerticalIntervalTime = function(iQindex, iBindex) {
  216 + return this._$_aVerticalIntervalTime[iQindex][iBindex];
  217 +};
  218 +
  219 +//-------------------- 班次操作方法(查询,统计,删除) -----------------------//
  220 +
  221 +/**
  222 + * 返回总共班次数。
  223 + */
  224 +InternalLpObj.prototype.getBcCount = function() {
  225 + var i;
  226 + var group;
  227 + var bccount = 0;
  228 + for (i = 0; i < this._$_groupBcArray.length; i++) {
  229 + group = this._$_groupBcArray[i];
  230 + if (group) {
  231 + if (group.getBc1()) {
  232 + bccount += 1;
  233 + }
  234 + if (group.getBc2()) {
  235 + bccount += 1;
  236 + }
  237 + }
  238 + }
  239 +
  240 + return bccount;
  241 +};
  242 +
  243 +/**
  244 + * 返回班次列表,过滤空的班次,将所有存在的班次连成连续的对象数组返回。
  245 + * @returns arrays (InternalBcObj)
  246 + */
  247 +InternalLpObj.prototype.getBcArray = function() {
  248 + var bcArray = [];
  249 + var i;
  250 + var group;
  251 + for (i = 0; i < this._$_groupBcArray.length; i++) {
  252 + group = this._$_groupBcArray[i];
  253 + if (group) {
  254 + group.getBc1() ? bcArray.push(group.getBc1()) : "";
  255 + group.getBc2() ? bcArray.push(group.getBc2()) : "";
  256 + }
  257 + }
  258 +
  259 + return bcArray;
  260 +};
  261 +
  262 +/**
  263 + * 获取最小(最早)班次对象。
  264 + * @returns [{圈index},{班次index}]
  265 + */
  266 +InternalLpObj.prototype.getMinBcObjPosition = function() {
  267 + var i;
  268 + var bIndex = [];
  269 + for (i = 0; i < this._$_groupBcArray.length; i++) {
  270 + if (this._$_groupBcArray[i].getBc1()) {
  271 + bIndex.push(i);
  272 + bIndex.push(0);
  273 + break;
  274 + }
  275 + if (this._$_groupBcArray[i].getBc2()) {
  276 + bIndex.push(i);
  277 + bIndex.push(1);
  278 + break;
  279 + }
  280 + }
  281 + return bIndex;
  282 +};
  283 +
  284 +/**
  285 + * 获取最大(最晚)班次对象。
  286 + * @returns [{圈index},{班次index}]
  287 + */
  288 +InternalLpObj.prototype.getMaxBcObjPosition = function() {
  289 + var i;
  290 + var bIndex = [];
  291 + for (i = this._$_groupBcArray.length - 1; i >= 0; i--) {
  292 + if (this._$_groupBcArray[i].getBc2()) {
  293 + bIndex.push(i);
  294 + bIndex.push(1);
  295 + break;
  296 + }
  297 + if (this._$_groupBcArray[i].getBc1()) {
  298 + bIndex.push(i);
  299 + bIndex.push(0);
  300 + break;
  301 + }
  302 + }
  303 + return bIndex;
  304 +};
  305 +
  306 +InternalLpObj.prototype.getMinBcObj = function() {
  307 + var i;
  308 + var bcObj;
  309 + for (i = 0; i < this._$_groupBcArray.length; i++) {
  310 + bcObj = this._$_groupBcArray[i].getBc1();
  311 + if (bcObj) {
  312 + break;
  313 + }
  314 + bcObj = this._$_groupBcArray[i].getBc2();
  315 + if (bcObj) {
  316 + break;
  317 + }
  318 + }
  319 + return bcObj;
  320 +};
  321 +InternalLpObj.prototype.getMaxBcObj = function() {
  322 + var i;
  323 + var bcObj;
  324 + for (i = this._$_groupBcArray.length - 1; i >= 0; i--) {
  325 + bcObj = this._$_groupBcArray[i].getBc2();
  326 + if (bcObj) {
  327 + break;
  328 + }
  329 + bcObj = this._$_groupBcArray[i].getBc1();
  330 + if (bcObj) {
  331 + break;
  332 + }
  333 + }
  334 + return bcObj;
  335 +};
  336 +
  337 +/**
  338 + * 获取车次链信息。
  339 + * @param num 第几个车次链
  340 + * @returns object {s_q: {开始圈索引},s_b : {开始班次索引},e_q : {结束圈索引},e_b : {结束班次索引}, bcount : {班次数}}
  341 + */
  342 +InternalLpObj.prototype.fnGetBcChainInfo = function(num) {
  343 + // 计算总的车次链信息
  344 + var aChainInfo = [];
  345 + var oChainInfo;
  346 + var aBcIndex = this.getMinBcObjPosition();
  347 + var oBc;
  348 + var iQIndex;
  349 + var iBcIndex;
  350 + var i;
  351 + var bFlag;
  352 +
  353 + var iBcount = 0;
  354 +
  355 + if (aBcIndex.length == 2) {
  356 + iBcount = 1;
  357 + oChainInfo = {s_q : aBcIndex[0], s_b : aBcIndex[1], e_q : aBcIndex[0], e_b : aBcIndex[1], bcount: 1};
  358 + aChainInfo.push(oChainInfo);
  359 + bFlag = true;
  360 +
  361 + // 下一个班次的索引
  362 + iQIndex = aBcIndex[1] == 0 ? aBcIndex[0] : aBcIndex[0] + 1;
  363 + iBcIndex = aBcIndex[1] == 0 ? 1 : 0;
  364 +
  365 + for (i = iQIndex; i < this._$_qCount; i++) {
  366 + while (iBcIndex <= 1) {
  367 + oBc = this.getBc(i, iBcIndex);
  368 + if (!oBc) {
  369 + if (bFlag) {
  370 + // 车次链结尾是这个班次的前一个班次
  371 + oChainInfo.e_q = iBcIndex == 0 ? i - 1 : i;
  372 + oChainInfo.e_b = iBcIndex == 0 ? 1 : 0;
  373 + oChainInfo.bcount = iBcount;
  374 + }
  375 +
  376 + bFlag = false;
  377 + } else {
  378 + if (bFlag) {
  379 + iBcount ++;
  380 + oChainInfo.bcount = iBcount;
  381 + } else {
  382 + // 下一个车次链开始
  383 + iBcount = 1;
  384 + oChainInfo = {s_q : i, s_b : iBcIndex, e_q : i, e_b : iBcIndex, bcount: 1};
  385 + aChainInfo.push(oChainInfo);
  386 + bFlag = true;
  387 + }
  388 + }
  389 +
  390 +
  391 + iBcIndex ++;
  392 + }
  393 + iBcIndex = 0;
  394 + }
  395 +
  396 + }
  397 +
  398 + return aChainInfo[num];
  399 +};
  400 +
  401 +/**
  402 + * 获取车次链的个数。
  403 + * @returns int
  404 + */
  405 +InternalLpObj.prototype.fnGetBcChainCount = function() {
  406 + var iChainCount = 0;
  407 + var aBcIndex = this.getMinBcObjPosition();
  408 +
  409 + var oBc;
  410 + var iQIndex;
  411 + var iBcIndex;
  412 + var i;
  413 + var bFlag;
  414 +
  415 + if (aBcIndex.length == 2) {
  416 + iChainCount = 1;
  417 + bFlag = true;
  418 +
  419 + // 下一个班次的索引
  420 + iQIndex = aBcIndex[1] == 0 ? aBcIndex[0] : aBcIndex[0] + 1;
  421 + iBcIndex = aBcIndex[1] == 0 ? 1 : 0;
  422 +
  423 + for (i = iQIndex; i < this._$_qCount; i++) {
  424 + while (iBcIndex <= 1) {
  425 + oBc = this.getBc(i, iBcIndex);
  426 + if (!oBc) {
  427 + bFlag = false;
  428 + } else {
  429 + if (bFlag) {
  430 +
  431 + } else {
  432 + iChainCount ++;
  433 + bFlag = true;
  434 + }
  435 + }
  436 +
  437 +
  438 + iBcIndex ++;
  439 + }
  440 + iBcIndex = 0;
  441 + }
  442 +
  443 + }
  444 +
  445 +
  446 + return iChainCount;
  447 +};
  448 +
  449 +/**
  450 + * 在具体位置移除班次。
  451 + * @param qIndex 第几圈
  452 + * @param bcIndex 第几个班次
  453 + */
  454 +InternalLpObj.prototype.removeBc = function(qIndex, bcIndex) {
  455 + var group = this._$_groupBcArray[qIndex];
  456 + if (bcIndex == 0) {
  457 + group.removeBc1();
  458 + } else if (bcIndex == 1) {
  459 + group.removeBc2();
  460 + }
  461 +};
  462 +
  463 +/**
  464 + * 使用指定时间匹配返回离之最近的第几圈第几个班次,
  465 + * 使用时间差的绝度值,比较,取最小的
  466 + * 如果有两个一样的时间差,取比fctime大的时间
  467 + * @param fctime moment 比较用时间
  468 + * @param groupArray 圈数组
  469 + * @param hasUp boolean 计算上行班次
  470 + * @param hasDown boolean 计算下行班次
  471 + * @returns [{第几圈},{第几个班次}]
  472 + */
  473 +InternalLpObj.prototype.fnGetQBcIndexWithFcTimeFromGroupArray = function(
  474 + fctime, groupArray, hasUp, hasDown
  475 +) {
  476 + var i;
  477 + var timediff; // 时间差取绝对值
  478 + var qIndex;
  479 + var bcIndex;
  480 +
  481 + var group;
  482 + var bc1time;
  483 + var bc2time;
  484 +
  485 + var tempdiff;
  486 +
  487 + console.log("比较时间=" + fctime.format("HH:mm"));
  488 +
  489 + for (i = 0; i < this._$_qCount; i++) {
  490 + group = groupArray[i];
  491 + if (group) {
  492 + if (group.getBc1() && hasUp) {
  493 + bc1time = group.getBc1().getFcTimeObj();
  494 + console.log("bc1time=" + bc1time.format("HH:mm") + " tempdiff=" + tempdiff);
  495 + tempdiff = Math.abs(bc1time.diff(fctime));
  496 +
  497 + if (!timediff) {
  498 + timediff = Math.abs(tempdiff);
  499 + qIndex = i;
  500 + bcIndex = 0;
  501 + } else {
  502 + if (tempdiff < timediff) {
  503 + timediff = tempdiff;
  504 + qIndex = i;
  505 + bcIndex = 0;
  506 + } if (Math.abs(tempdiff) == timediff) {
  507 + if (bc1time.isAfter(fctime)) {
  508 + timediff = tempdiff;
  509 + qIndex = i;
  510 + bcIndex = 0;
  511 + }
  512 +
  513 + }
  514 + }
  515 + }
  516 +
  517 + if (group.getBc2() && hasDown) {
  518 + bc2time = group.getBc2().getFcTimeObj();
  519 + console.log("bc2time=" + bc2time.format("HH:mm") + " tempdiff=" + tempdiff);
  520 + tempdiff = Math.abs(bc2time.diff(fctime));
  521 +
  522 + if (!timediff) {
  523 + timediff = Math.abs(tempdiff);
  524 + qIndex = i;
  525 + bcIndex = 1;
  526 + } else {
  527 + if (tempdiff < timediff) {
  528 + timediff = tempdiff;
  529 + qIndex = i;
  530 + bcIndex = 1;
  531 + } if (Math.abs(tempdiff) == timediff) {
  532 + if (bc2time.isBefore(fctime)) {
  533 + timediff = tempdiff;
  534 + qIndex = i;
  535 + bcIndex = 1;
  536 + }
  537 +
  538 + }
  539 + }
  540 + }
  541 + }
  542 + }
  543 +
  544 + console.log("中标线对应数组索引=" + qIndex);
  545 +
  546 + var rst = [];
  547 + rst.push(qIndex);
  548 + rst.push(bcIndex);
  549 +
  550 + return rst;
  551 +};
  552 +
  553 +/**
  554 + * 使用指定时间匹配返回离之最近的第几圈第几个班次,
  555 + * 使用时间差的绝度值,比较,取最小的
  556 + * 如果有两个一样的时间差,取比fctime大的时间
  557 + * @param fctime moment 比较用时间
  558 + * @param hasUp boolean 计算上行班次
  559 + * @param hasDown boolean 计算下行班次
  560 + * @returns [{第几圈},{第几个班次}]
  561 + */
  562 +InternalLpObj.prototype.getQBcIndexWithFcTime = function(
  563 + fctime, hasUp, hasDown
  564 +) {
  565 + return this.fnGetQBcIndexWithFcTimeFromGroupArray(fctime, this._$_groupBcArray, hasUp, hasDown);
  566 +};
  567 +
  568 +//---------------------- 内部数据初始化方法(不同于构造函数)---------------------//
  569 +
  570 +/**
  571 + * 从指定开始时间到结束时间创建不间断班次(连班),并初始化路牌
  572 + * 注意,之前有班次会删除后再创建。
  573 + * @param startTime 开始时间
  574 + * @param endTime 结束时间
  575 + * @param isUp 第一个班次是上行还是下行
  576 + * @param fromQ 从第几圈开始加入
  577 + * @param paramObj 参数对象
  578 + * @param factory 工厂对象
  579 + */
  580 +InternalLpObj.prototype.initDataFromTimeToTime = function(
  581 + startTime,
  582 + endTime,
  583 + isUp,
  584 + fromQ,
  585 + paramObj,
  586 + factory) {
  587 +
  588 + var bcData = []; // 班次数组
  589 + var bcObj;
  590 + var kssj = startTime;
  591 + var fcno = 1; // 发车顺序号
  592 + var bcCount = 1; // 班次数
  593 + do {
  594 + bcObj = factory.createBcObj(
  595 + this, "normal", isUp, fcno, kssj, paramObj); // this就是所属路牌对象
  596 + bcData.push(bcObj);
  597 +
  598 + kssj = paramObj.addMinute(kssj, bcObj.getBcTime() + bcObj.getStopTime());
  599 + fcno ++;
  600 + bcCount ++;
  601 + isUp = !isUp;
  602 + } while(kssj.isBefore(endTime));
  603 + bcCount--;
  604 +
  605 + //console.log("last -1;" + bcData[bcCount -2].getFcTimeObj().format("HH:mm"));
  606 + //console.log("last;" + bcData[bcCount -1].getFcTimeObj().format("HH:mm"));
  607 + //console.log("endtime: " + endTime.format("HH:mm"));
  608 +
  609 + //if (bcCount > 0 && bcData[bcCount - 1].getArrTimeObj().isAfter(endTime)) {
  610 + // // 如果最后一个班次的到达时间超过结束时间,也要去除
  611 + // bcData.splice(bcCount - 1, 1);
  612 + //}
  613 +
  614 + this._initDataFromLbBcArray(bcData, fromQ);
  615 +
  616 +};
  617 +
  618 +/**
  619 + * 使用连班的班次数组初始化路牌(相应的圈会被覆盖)。
  620 + * @param bcArray 连班班次数组
  621 + * @param fromQ 从第几圈开始加入
  622 + */
  623 +InternalLpObj.prototype._initDataFromLbBcArray = function(
  624 + bcArray,
  625 + fromQ
  626 +) {
  627 + var _bc1Obj;
  628 + var _bc2Obj;
  629 + var _qObj;
  630 +
  631 + // 第一班次是上行还是下行
  632 + var isUp = bcArray[0].isUp();
  633 +
  634 + if (bcArray.length > 0 && fromQ < this._$_qCount) {
  635 + // 构造圈数
  636 + if (isUp != this._$_isUp) {
  637 + // 如果方向不一致,意味着第一个班次是半圈
  638 + // 加半圈,并加在bc2上
  639 + _bc2Obj = bcArray.slice(0, 1)[0];
  640 + _qObj = new InternalGroupObj(
  641 + this,
  642 + this._$_isUp,
  643 + undefined,
  644 + _bc2Obj
  645 + );
  646 + _bc2Obj.setGroup(_qObj);
  647 + this._$_groupBcArray[fromQ] = _qObj;
  648 +
  649 + bcArray.splice(0, 1);
  650 + fromQ ++;
  651 + }
  652 +
  653 + var qCount1 = Math.floor(bcArray.length / 2); // 需要添加多少圈
  654 + var qCount2 = bcArray.length % 2; // 最后是否有半圈
  655 +
  656 + while (fromQ < this._$_qCount) {
  657 + if (qCount1 > 0) {
  658 + _bc1Obj = bcArray.slice(0, 1)[0];
  659 + _bc2Obj = bcArray.slice(1, 2)[0];
  660 + _qObj = new InternalGroupObj(
  661 + this,
  662 + this._$_isUp,
  663 + _bc1Obj,
  664 + _bc2Obj
  665 + );
  666 + _bc1Obj.setGroup(_qObj);
  667 + _bc2Obj.setGroup(_qObj);
  668 + this._$_groupBcArray[fromQ] = _qObj;
  669 +
  670 + bcArray.splice(0, 2);
  671 + qCount1 --;
  672 + } else if (qCount2 > 0) {
  673 + // 加半圈,并加在bc1上
  674 + _bc1Obj = bcArray.slice(0, 1)[0];
  675 + _qObj = new InternalGroupObj(
  676 + this,
  677 + this._$_isUp,
  678 + _bc1Obj,
  679 + undefined
  680 + );
  681 + _bc1Obj.setGroup(_qObj);
  682 + this._$_groupBcArray[fromQ] = _qObj;
  683 +
  684 + bcArray.splice(0, 1);
  685 + qCount2 --;
  686 + } else {
  687 + break;
  688 + }
  689 +
  690 + fromQ ++;
  691 + }
  692 + }
  693 +};
  694 +
  695 +//-------------------------- 其他方法 ----------------------------//
  696 +
  697 +/**
  698 + * 从指定位置的班次开始,往后所有的班次修正发车时间
  699 + * @param groupIndex
  700 + * @param bcIndex
  701 + * @param time
  702 + */
  703 +InternalLpObj.prototype.fnAddMinuteToBcFcsj = function(groupIndex, bcIndex, time) {
  704 + var i;
  705 + var oCurBc;
  706 +
  707 + // 修正之前班次的停站时间
  708 + //oCurBc = this.getBc(
  709 + // bcIndex == 0 ? groupIndex - 1 : groupIndex,
  710 + // bcIndex == 1 ? 0 : 1
  711 + //);
  712 + //if (oCurBc) {
  713 + // oCurBc.setStopTime(oCurBc.getStopTime() + time);
  714 + //}
  715 +
  716 +
  717 + for (i = groupIndex; i < this._$_qCount; i++) {
  718 + if (bcIndex == 0) {
  719 + oCurBc = this.getBc(i, 0);
  720 + if (oCurBc) {
  721 + oCurBc.addMinuteToFcsj(time);
  722 + }
  723 + oCurBc = this.getBc(i, 1);
  724 + if (oCurBc) {
  725 + oCurBc.addMinuteToFcsj(time);
  726 + }
  727 +
  728 + } else {
  729 + oCurBc = this.getBc(i, 1);
  730 + if (oCurBc) {
  731 + oCurBc.addMinuteToFcsj(time);
  732 + }
  733 +
  734 + }
  735 +
  736 + bcIndex = 0;
  737 + }
  738 +};
  739 +
  740 +/**
  741 + * 在指定位置添加一个吃饭班次。
  742 + * 注1:吃饭班次不是普通班次,不记录进圈,记录进_$_other_bc_array
  743 + * 注2:添加吃饭班次时,会修改之前班次的停战时间,所以导致之后的班次的停战都会发生变化
  744 + * @param groupIndex
  745 + * @param bcIndex
  746 + * @param factory
  747 + * @param paramObj
  748 + * @returns int 相差时间(吃饭时间距离和停站时间相差值)
  749 + */
  750 +InternalLpObj.prototype.fnAddEatBc = function(groupIndex, bcIndex, factory, paramObj) {
  751 + var oPreBc;
  752 + var oEatBc;
  753 + var iBcModifyTime;
  754 + oPreBc = this.getBc( // 前一个邻接班次
  755 + bcIndex == 0 ? groupIndex - 1 : groupIndex,
  756 + bcIndex == 1 ? 0 : 1);
  757 + if (oPreBc) { // 存在前一个班次
  758 + oEatBc = factory.createBcObj(
  759 + this,
  760 + "cf",
  761 + !oPreBc.isUp(), // 和上一个班次方向相反
  762 + 1,
  763 + paramObj.addMinute(oPreBc.getArrTimeObj(), oPreBc.getStopTime()), // 使用上一个班次的到达时间作为开始时间
  764 + paramObj
  765 + );
  766 +
  767 + //iBcModifyTime = oEatBc.getBcTime() - oPreBc.getStopTime(); // 后续班次要调整的时间
  768 +
  769 + // 修正之后的班次发车时间
  770 + // 注意:之后那个班次发车时间就是吃饭班次的到达时间
  771 + iBcModifyTime = oEatBc.getArrTimeObj().diff(this.getBc(groupIndex, bcIndex).getFcTimeObj(), "m");
  772 + this.fnAddMinuteToBcFcsj(groupIndex, bcIndex, iBcModifyTime);
  773 +
  774 + oPreBc.setStopTime(0); // 不重置停站时间
  775 + oPreBc.fnSetEatTime(oEatBc.getBcTime());
  776 +
  777 + //this._$_other_bc_array.push(oEatBc);
  778 +
  779 + return iBcModifyTime;
  780 + } else {
  781 + return false;
  782 + }
  783 +
  784 +};
  785 +
  786 +/**
  787 + * 调整路牌的班次,通过调整停站时间,或者班次发车时间,不能让班次的到达时间和下一个班次的发车时间重叠。
  788 + * @param iPeakAverStopTime 高峰平均停站时间
  789 + * @param iTroughAverStopTime 低谷平均停站时间
  790 + * @param oParam 参数对象
  791 + */
  792 +InternalLpObj.prototype.fnAdjustBcInterval = function(iPeakAverStopTime, iTroughAverStopTime, oParam) {
  793 + // 获取车次链个数
  794 + var iBcChainCount = this.fnGetBcChainCount();
  795 +
  796 + var i;
  797 + var j;
  798 + var oBcIndex;
  799 + var iQIndex;
  800 + var iBcIndex;
  801 + var iBcCount;
  802 + var oBc;
  803 + var oNextBc;
  804 +
  805 + var iBcStopTime;
  806 +
  807 + for (i = 0; i < iBcChainCount; i++) {
  808 + oBcIndex = this.fnGetBcChainInfo(i);
  809 + iQIndex = oBcIndex["s_q"];
  810 + iBcIndex = oBcIndex["s_b"];
  811 + iBcCount = oBcIndex["bcount"];
  812 +
  813 + for (j = 0; j < iBcCount - 1; j++) {
  814 + oBc = this.getBc(iQIndex, iBcIndex);
  815 + oNextBc = this.getBc(
  816 + iBcIndex == 0 ? iQIndex : iQIndex + 1,
  817 + iBcIndex == 0 ? 1 : 0);
  818 +
  819 + if (oNextBc.fnIsFirstBc()) { // 如果同一路牌连续2个方向首站班次,都不做处理
  820 + continue;
  821 + }
  822 +
  823 + // 不改变当前班次的行驶时间,修正停站时间和下一个班次的发车时间
  824 + iBcStopTime = oNextBc.getFcTimeObj().diff(oBc.getArrTimeObj(), "m");
  825 + if (iBcStopTime < 0) {
  826 + // 当前班次使用最小停站时间
  827 + oBc.setStopTime(oParam.fnCalcuFixedMinStopNumber(oBc.getArrTimeObj(), oBc.isUp()));
  828 + oNextBc.addMinuteToFcsj(oBc.getStopTime() + oBc.fnGetEatTime() - iBcStopTime);
  829 +
  830 + } else {
  831 + if (iBcStopTime == oBc.getStopTime() + oBc.fnGetEatTime()) {
  832 + // 停站时间一致,没有问题
  833 +
  834 +
  835 + } else {
  836 + // TODO:当前班次使用最小停站时间
  837 + oBc.setStopTime(oParam.fnCalcuFixedMinStopNumber(oBc.getArrTimeObj(), oBc.isUp()));
  838 + oNextBc.addMinuteToFcsj(oBc.getStopTime() + oBc.fnGetEatTime() - iBcStopTime);
  839 +
  840 + }
  841 + }
  842 +
  843 + iBcIndex = iBcIndex == 0 ? 1 : 0;
  844 + iQIndex = iBcIndex == 0 ? iQIndex + 1 : iQIndex;
  845 + }
  846 +
  847 + this.getBc(iQIndex, iBcIndex).setStopTime(0);
  848 + }
  849 +
  850 +
  851 +};
  852 +
  853 +
  854 +// TODO
  855 +
  856 +/**
  857 + *
  858 + *
  859 + */
  860 +InternalLpObj.prototype.calcuLpBx = function() {
  861 +
  862 +};
  863 +
  864 +
src/main/resources/static/pages/base/timesmodel/js/v2/core/InternalScheduleObj.js
1 -/**  
2 - * 内部行车计划对象。  
3 - * @constructor  
4 - */  
5 -var InternalScheduleObj = function(paramObj, lpArray, factory) {  
6 - // 参数对象  
7 - var _paramObj = paramObj;  
8 - // 外部的路牌数组  
9 - var _lpArray = lpArray;  
10 - // 工厂对象  
11 - var _factory = factory;  
12 -  
13 - //------------------ 初始化方法1,以及计算关联的内部变量 -----------------//  
14 - var _qIsUp; // 每一圈是上行开始还是下行开始  
15 - var _qCount = 0; // 总的圈数  
16 - var _internalLpArray = []; // 内部对象数组  
17 - var _aBxDesc = [ // 各种班型描述(班型名称,平均工时,平均需要的班次数,平均工时)  
18 - {'sType':'六工一休', 'fHoursV':6.66, 'fBcCount': 0, 'fAverTime': 0},  
19 - {'sType':'五工一休', 'fHoursV':6.85, 'fBcCount': 0, 'fAverTime': 0},  
20 - {'sType':'四工一休', 'fHoursV':7.14, 'fBcCount': 0, 'fAverTime': 0},  
21 - {'sType':'三工一休', 'fHoursV':7.61, 'fBcCount': 0, 'fAverTime': 0},  
22 - {'sType':'二工一休', 'fHoursV':8.57, 'fBcCount': 0, 'fAverTime': 0},  
23 - {'sType':'一工一休', 'fHoursV':11.42, 'fBcCount': 0, 'fAverTime': 0},  
24 - {'sType':'五工二休', 'fHoursV':7.99, 'fBcCount': 0, 'fAverTime': 0},  
25 - {'sType':'无工休', 'fHoursV':5.43, 'fBcCount': 0, 'fAverTime': 0}  
26 - ];  
27 -  
28 - var _fnInitFun1 = function() { // 初始化方法1  
29 - console.log("//---------------- 行车计划,初始化方法1 start ----------------//");  
30 -  
31 - //----------------------- 1、确定上标线的方向,圈的方向 -------------------//  
32 -  
33 - // 确定_qIsUp,哪个方向的首班车晚就用哪个  
34 - _qIsUp = _paramObj.getUpFirstDTimeObj().isBefore(  
35 - _paramObj.getDownFirstDTimeObj()) ? false : true;  
36 - // 上标线开始时间,就是方向的首班车时间  
37 - var st = _qIsUp ? _paramObj.getUpFirstDTimeObj() : _paramObj.getDownFirstDTimeObj();  
38 - // 上标线结束时间,使用最晚的末班车时间,结束时间的班次方向  
39 - var et;  
40 - var et_IsUp;  
41 - if (_paramObj.getUpLastDtimeObj().isBefore(  
42 - _paramObj.getDownLastDTimeObj())) {  
43 - et = _paramObj.getDownLastDTimeObj();  
44 - et_IsUp = false;  
45 - } else {  
46 - et = _paramObj.getUpLastDtimeObj();  
47 - et_IsUp = true;  
48 - }  
49 -  
50 - //------------------------ 2、计算总共有多少圈 ------------------------//  
51 -  
52 - // 以开始时间,结束时间,构造上标线用连班班次发车时间  
53 - var bcFcsjArrays = []; // 班次发车时间对象数组  
54 - var bcArsjArrays = []; // 班次到达时间对象数组  
55 - var isUp = _qIsUp; // 方向  
56 - var bcCount = 1; // 班次数  
57 -  
58 - var _kssj = st; // 开始时间  
59 - var _bcsj = paramObj.calcuTravelTime(_kssj, isUp); // 班次历时  
60 - var _arrsj = paramObj.addMinute(_kssj, _bcsj); // 到达时间  
61 - var _stoptime = paramObj.fnCalcuFixedStopNumber(_arrsj, !isUp, _bcsj); // 停站时间  
62 -  
63 - do {  
64 - bcFcsjArrays.push(_kssj);  
65 - bcArsjArrays.push(_arrsj);  
66 -  
67 - _kssj = paramObj.addMinute(_kssj, _bcsj + _stoptime);  
68 - _bcsj = paramObj.calcuTravelTime(_kssj, isUp);  
69 - _arrsj = paramObj.addMinute(_kssj, _bcsj);  
70 - _stoptime = paramObj.fnCalcuFixedStopNumber(_arrsj, !isUp, _bcsj);  
71 -  
72 - bcCount ++;  
73 - isUp = !isUp;  
74 - } while(_kssj.isBefore(et));  
75 - bcCount--; // 因为先做do,所以总的班次要减1  
76 - //if (bcCount > 0 && bcArsjArrays[bcCount - 1].isAfter(et)) {  
77 - // // 如果最后一个班次的到达时间超过结束时间,也要去除  
78 - // bcFcsjArrays.splice(bcCount - 1, 1);  
79 - // bcArsjArrays.splice(bcCount - 1, 1);  
80 - // bcCount--;  
81 - //}  
82 - var _qCount_p1 = Math.floor(bcCount / 2); // 2个班次一圈  
83 - var _qCount_p2 = bcCount % 2; // 余下的1个班次也算一圈  
84 -  
85 - // 利用连班数组计算圈数  
86 - _qCount = 1; // 前面加1圈,补中标线的班次  
87 - _qCount += _qCount_p1;  
88 - _qCount += _qCount_p2;  
89 -  
90 - // 计算最后是不是还要补一圈  
91 - if (_qCount > 1) { // 总的圈数就1圈,没必要加了(其实是不可能的,除非参数里问题)  
92 - if (_qCount_p2 == 0) { // 没有余下班次,整数圈数  
93 - // 最后一个班次的方向一定和开始的方向相反,如:上-下,上-下,上-下,一共三圈,最后一个班次为下行  
94 - // 判定最后一个班次的方向和上标线判定结束时间的班次方向是否一致  
95 - if (!_qIsUp == et_IsUp) {  
96 - // 一致不用加圈数  
97 - } else {  
98 - // 不一致需要加圈补最后一个结束时间班次  
99 - _qCount ++;  
100 - }  
101 - } else {  
102 - // 有余下的圈数,最后要不补的班次不管上行,下行都在这一圈里  
103 - // 不需要在补圈数了  
104 - }  
105 - }  
106 -  
107 - //------------------------ 3、根据路牌数,圈数创建路牌对象 ----------------------//  
108 -  
109 - // 创建内部的路牌数组,并把之前的连班路牌添加进上标线路牌中  
110 - var i;  
111 - for (i = 0; i < _lpArray.length; i++) {  
112 - _internalLpArray.push(new InternalLpObj(_lpArray[i], _qCount, _qIsUp));  
113 - }  
114 - // 初始化上标线,从第1圈开始  
115 - _internalLpArray[0].initDataFromTimeToTime(bcFcsjArrays[0], et, _qIsUp, 1, _paramObj, _factory);  
116 -  
117 - // 以上标线为基础,计算各种班型工时对应的圈数、班次数  
118 - var aBcArray = _internalLpArray[0].getBcArray();  
119 - aBcArray[0].fnSetIsFirstBc(true); // 设置首班班次标识  
120 -  
121 - if (aBcArray.length % 2 != 0) { // 不能整除2,去除一个班次计算  
122 - aBcArray.splice(aBcArray.length - 1, 1);  
123 - }  
124 -  
125 - // 午饭吃饭时间  
126 - var iLTime = _paramObj.fnGetLunchTime();  
127 - // 晚饭吃饭时间  
128 - var iDTime = _paramObj.fnGetDinnerTime();  
129 - // 出场时间  
130 - var iOutTime = _qIsUp ? _paramObj.getUpOutTime() : _paramObj.getDownOutTime();  
131 - // 进场时间  
132 - var iInTime = _qIsUp ? _paramObj.getDownInTime() : _paramObj.getUpInTime();  
133 - // 例保时间  
134 - var iBTime = _paramObj.getLbTime();  
135 -  
136 - var sum = 0; // 总班次时间  
137 - for (i = 0; i < aBcArray.length; i++) {  
138 - sum += aBcArray[i].getBcTime() + aBcArray[i].getStopTime();  
139 - }  
140 - sum += iLTime; // 加午饭时间  
141 - sum += iDTime; // 加晚饭时间  
142 - for (i = 0; i < _aBxDesc.length; i++) {  
143 - _aBxDesc[i].fAverTime = sum / (aBcArray.length / 2); // 平均周转时间不算进出场,例保时间  
144 -  
145 - // 计算5休2的班次数(双进出场,4个例保)  
146 - if (i == 6) {  
147 - _aBxDesc[i].fQCount =  
148 - (_aBxDesc[i].fHoursV * 60 - iOutTime * 2 - iInTime * 2 - iBTime * 4) /  
149 - _aBxDesc[i].fAverTime;  
150 - _aBxDesc[i].fBcCount = _aBxDesc[i].fQCount * 2;  
151 - } else { // 进出场,2个例保  
152 - _aBxDesc[i].fQCount =  
153 - (_aBxDesc[i].fHoursV * 60 - iOutTime - iInTime - iBTime * 2) /  
154 - _aBxDesc[i].fAverTime;  
155 - _aBxDesc[i].fBcCount = _aBxDesc[i].fQCount * 2;  
156 - }  
157 - }  
158 -  
159 -  
160 - // 在第一个班次之前再添加一个模拟班次,用于中标线的作用  
161 - // 那一圈必定是低谷,而且圈索引0,班次索引1,暂时标记,最后删除  
162 - var iFirstStopTime =  
163 - _paramObj.fnCalcuFixedStopNumber(  
164 - _paramObj.addMinute(aBcArray[0].getFcTimeObj(), -10),  
165 - _qIsUp  
166 - );  
167 - var iXXTime = _qIsUp ? _paramObj.getDownTroughTime() : _paramObj.getUpTroughTime();  
168 - var oFlagBc = _factory.createBcObj( // 标记班次  
169 - _internalLpArray[0],  
170 - "normal",  
171 - !_qIsUp,  
172 - 1,  
173 - _paramObj.addMinute(aBcArray[0].getFcTimeObj(), -(iFirstStopTime + iXXTime)),  
174 - _paramObj  
175 - );  
176 - oFlagBc.fnSetDelFlag(true); // 标记了删除记号  
177 -  
178 - _internalLpArray[0].setBc(0, 1, oFlagBc);  
179 -  
180 - // 在最后一圈也补上一个或者2个模拟班次,暂时标记,最后需要删除  
181 - var aMaxBcIndex = _internalLpArray[0].getMaxBcObjPosition();  
182 - if (aMaxBcIndex[0] == _qCount - 1) { // 可能加半圈  
183 - oFlagBc = _factory.createBcObj( // 标记班次  
184 - _internalLpArray[0],  
185 - "normal",  
186 - !_qIsUp,  
187 - 1,  
188 - _paramObj.addMinute(  
189 - _internalLpArray[0].getBc(_qCount - 1, 0).getArrTimeObj(),  
190 - _internalLpArray[0].getBc(_qCount - 1, 0).getStopTime()),  
191 - _paramObj  
192 - );  
193 - oFlagBc.fnSetDelFlag(true); // 标记了删除记号  
194 - _internalLpArray[0].setBc(_qCount - 1, 1, oFlagBc);  
195 -  
196 - } else { // 加完整的一圈  
197 - oFlagBc = _factory.createBcObj( // 标记班次  
198 - _internalLpArray[0],  
199 - "normal",  
200 - _qIsUp,  
201 - 1,  
202 - _paramObj.addMinute(  
203 - _internalLpArray[0].getBc(_qCount - 2, 1).getArrTimeObj(),  
204 - _internalLpArray[0].getBc(_qCount - 2, 1).getStopTime()),  
205 - _paramObj  
206 - );  
207 - oFlagBc.fnSetDelFlag(true); // 标记了删除记号  
208 - _internalLpArray[0].setBc(_qCount - 1, 0, oFlagBc);  
209 -  
210 - oFlagBc = _factory.createBcObj( // 标记班次  
211 - _internalLpArray[0],  
212 - "normal",  
213 - !_qIsUp,  
214 - 1,  
215 - _paramObj.addMinute(  
216 - _internalLpArray[0].getBc(_qCount - 1, 0).getArrTimeObj(),  
217 - _internalLpArray[0].getBc(_qCount - 1, 0).getStopTime()),  
218 - _paramObj  
219 - );  
220 - oFlagBc.fnSetDelFlag(true); // 标记了删除记号  
221 - _internalLpArray[0].setBc(_qCount - 1, 1, oFlagBc);  
222 -  
223 - }  
224 -  
225 - console.log("上行首班车时间:" + _paramObj.getUpFirstDTimeObj().format("HH:mm") +  
226 - "上行末班车时间:" + _paramObj.getUpLastDtimeObj().format("HH:mm"));  
227 - console.log("下行首班车时间:" + _paramObj.getDownFirstDTimeObj().format("HH:mm") +  
228 - "下行末班车时间:" + _paramObj.getDownLastDTimeObj().format("HH:mm"));  
229 - console.log("总共计算的圈数:" + _qCount);  
230 - console.log("圈的方向isUP:" + _qIsUp);  
231 - console.log("班型描述(以下):");  
232 - console.log(_aBxDesc);  
233 - console.log("所有路牌间隔描述(以下):");  
234 - for (i = 0; i < _internalLpArray.length; i++) {  
235 - console.log(_internalLpArray[i]._$_aVerticalIntervalTime);  
236 - }  
237 - console.log("//---------------- 行车计划,初始化方法1 end ----------------//");  
238 -  
239 - };  
240 -  
241 - //------------------ 初始化方法2,以及计算关联的内部变量 ----------------//  
242 - var _approximate_zgfQIndex; // 预估早高峰车辆从第几圈开始全部发出  
243 - var _approximate_zgfBIndex; // 预估早高峰车辆从第几圈第几个班次开始全部发出(上行或下行)  
244 - var _approximate_wgfQIndex; // 预估晚高峰车辆从第几圈开始全部发出  
245 - var _approximate_wgfBIndex; // 预估晚高峰车辆从第几圈第几个班次开始全部发出(上行或下行)  
246 -  
247 - var _fnInitFun2 = function() { // 初始化方法2  
248 - console.log("//---------------- 行车计划,初始化方法2 start ----------------//");  
249 -  
250 - //------------------------ 1、计算车辆总数 ------------------------//  
251 - // 是用高峰上行周转时间除以高峰平均间隔得到的  
252 - // 这样算还算合理,车辆不多不少,待以后有新的算法再修正  
253 - var iClCount = _paramObj.calcuClzx();  
254 -  
255 - //------------------------ 2、计算所有路牌的发车在各个圈中的间隔 --------------------//  
256 - var i;  
257 - var j;  
258 - var iBindex = 1;  
259 - var iZzsj;  
260 - var oLp;  
261 - var iC1;  
262 - var iC2;  
263 -  
264 - for (i = 0; i < _qCount - 1; i++) {  
265 - while (iBindex <= 1) {  
266 - // 每圈每个方向的周转时间不一致,以上标线为主  
267 - oLp = _internalLpArray[0];  
268 - iZzsj = oLp.getBc(i + 1, iBindex).getFcTimeObj().diff(  
269 - oLp.getBc(i, iBindex).getFcTimeObj(), "m"  
270 - );  
271 -  
272 - iC1 = Math.floor(iZzsj / iClCount);  
273 - iC2 = iZzsj % iClCount;  
274 -  
275 - for (j = 0; j < iClCount - iC2; j++) {  
276 - oLp = _internalLpArray[j];  
277 - oLp.fnSetVerticalIntervalTime(i, iBindex, iC1);  
278 - }  
279 -  
280 - for (j = 0; j < iC2; j++) {  
281 - oLp = _internalLpArray[iClCount - iC2 + j];  
282 - oLp.fnSetVerticalIntervalTime(i, iBindex, iC1 + 1);  
283 - }  
284 -  
285 - iBindex ++;  
286 -  
287 - }  
288 - iBindex = 0;  
289 - }  
290 - // 最后一圈没有下一圈的参照,周转时间没发获取,由于都是低谷,所以使用倒数第二圈的间隔最为最后一圈的间隔  
291 - for (i = 0; i < _internalLpArray.length; i++) {  
292 - oLp = _internalLpArray[i];  
293 - oLp.fnSetVerticalIntervalTime(_qCount - 1, 0, oLp.fnGetVerticalIntervalTime(_qCount - 2, 0));  
294 - oLp.fnSetVerticalIntervalTime(_qCount - 1, 1, oLp.fnGetVerticalIntervalTime(_qCount - 2, 1));  
295 - }  
296 -  
297 - //------------------------ 3、预估早高峰全部出车第几圈第几个班次全部出车,计算路牌之间的发车间隔 ------------------//  
298 -  
299 - // 以上标线为标准,查找离早高峰开始时间最近的班次作为早高峰开始班次  
300 - // 以这个班次为早高峰起点,全部出车策略  
301 - var qbcIndexArray = _internalLpArray[0].getQBcIndexWithFcTime(  
302 - _paramObj.getMPeakStartTimeObj(), true, true);  
303 - var qIndex = qbcIndexArray[0]; // 第几圈  
304 - var bIndex = qbcIndexArray[1]; // 第几个班次  
305 -  
306 - for (i = 1; i < _internalLpArray.length; i++) {  
307 - _fnGenerateBcAndSetBc(i, qIndex, bIndex);  
308 - }  
309 -  
310 - _approximate_zgfQIndex = qIndex;  
311 - _approximate_zgfBIndex = bIndex;  
312 -  
313 - //------------------------ 4、预估晚高峰全部出车第几圈第几个班次全部出车,计算路牌之间的发车间隔 ------------------//  
314 -  
315 - // 以上标线为标准,查找离晚高峰开始时间最近的班次作为晚高峰开始班次  
316 - // 以这个班次为早高峰起点,全部出车策略  
317 - qbcIndexArray = _internalLpArray[0].getQBcIndexWithFcTime(  
318 - _paramObj.getEPeakStartTimeObj(), true, true);  
319 - qIndex = qbcIndexArray[0]; // 第几圈  
320 - bIndex = qbcIndexArray[1]; // 第几个班次  
321 -  
322 - for (i = 1; i < _internalLpArray.length; i++) {  
323 - _fnGenerateBcAndSetBc(i, qIndex, bIndex);  
324 - }  
325 -  
326 - _approximate_wgfQIndex = qIndex;  
327 - _approximate_wgfBIndex = bIndex;  
328 -  
329 - console.log("早高峰周转时间(固定最大停战时间):" + _paramObj.calcuPeakZzsj() + "分钟");  
330 - console.log("早高峰发车时间范围:" + _paramObj.getMPeakMinFcjx() + "分钟 --- " + _paramObj.getMPeakMaxFcjx() + "分钟");  
331 - console.log("预估早高峰第" + _approximate_zgfQIndex + "(index)圈,第" + _approximate_zgfBIndex + "(index)班次车辆全部发出");  
332 - console.log("预估晚高峰第" + _approximate_wgfQIndex + "(index)圈,第" + _approximate_wgfBIndex + "(index)班次车辆全部发出");  
333 - console.log("//---------------- 行车计划,初始化方法2 end ----------------//");  
334 - };  
335 -  
336 - //----------------------- 初始化方法3,计算连班分班的路牌分布 ----------------//  
337 - var _iBx_lb_lpcount; // 连班路牌数  
338 - var _iBx_5_2_fb_lpcount; // 5休2分班路牌数  
339 - var _iBx_other_fb_lpcount; // 其他分班路牌数  
340 -  
341 - var _fnInitFun3 = function() { // 初始化方法3  
342 - console.log("//---------------- 行车计划,初始化方法3 start ----------------//");  
343 -  
344 - //--------------------- 1、计算分班连班班型车辆分布数 --------------------//  
345 - // 总共车辆数(高峰最大车辆数)  
346 - var iCls = _paramObj.calcuClzx();  
347 - // 低谷最少配车(连班车数量)  
348 - var iDgminpc = Math.round(_paramObj.calcuTroughZzsj() / _paramObj.getTroughMaxFcjx());  
349 - // 加班车路牌数(做5休2的路牌数)  
350 - var i_5_2_lpes = _paramObj.getJBLpes();  
351 -  
352 - // 做些简单的验证  
353 - if (iCls < iDgminpc) {  
354 - alert("总配车数小于低谷最小配车");  
355 - throw "总配车数小于低谷最小配车";  
356 - }  
357 - if (iDgminpc < 2) {  
358 - alert("连班路牌小于2,办不到啊");  
359 - throw "连班路牌小于2,办不到啊";  
360 - }  
361 - if (iCls - iDgminpc < i_5_2_lpes) {  
362 - alert("总分班路牌数小于加班路牌数");  
363 - throw "总分班路牌数小于加班路牌数";  
364 - }  
365 -  
366 - //// 修正连班路牌数,班次间隔大于20的,加1,直至班次间隔小于20  
367 - //while(_paramObj.calcuPeakZzsj() / iDgminpc > 20) {  
368 - // iDgminpc ++;  
369 - //}  
370 - _iBx_lb_lpcount = iDgminpc;  
371 -  
372 - _iBx_5_2_fb_lpcount = i_5_2_lpes;  
373 - _iBx_other_fb_lpcount = iCls - _iBx_lb_lpcount - i_5_2_lpes;  
374 -  
375 - //------------------------ 2、利用间隔法计算连班路牌分布 --------------------//  
376 - var i;  
377 - var j;  
378 - var iC1 = Math.floor(_internalLpArray.length / _iBx_lb_lpcount);  
379 - var iC2 = _internalLpArray.length % _iBx_lb_lpcount;  
380 - var iLpIndex;  
381 -  
382 - for (i = 0; i < _iBx_lb_lpcount - iC2; i++) {  
383 - iLpIndex = i * iC1;  
384 - _internalLpArray[iLpIndex].setBxLb(true);  
385 - _internalLpArray[iLpIndex].setBxDesc("连班");  
386 - }  
387 - for (j = 0; j < iC2; j++) {  
388 - iLpIndex = i * iC1 + j * (iC1 + 1);  
389 - _internalLpArray[iLpIndex].setBxLb(true);  
390 - _internalLpArray[iLpIndex].setBxDesc("连班");  
391 - }  
392 -  
393 - //------------------------ 3、利用间隔法计算分班班型路牌分布 --------------------//  
394 - // 获取分班路牌索引  
395 - var aNotLbIndexes = [];  
396 - for (i = 0; i < _internalLpArray.length; i++) {  
397 - if (!_internalLpArray[i].isBxLb()) {  
398 - aNotLbIndexes.push(i);  
399 - }  
400 - }  
401 - // 先5休2分班  
402 - iC1 = Math.floor(aNotLbIndexes.length / _iBx_5_2_fb_lpcount);  
403 - iC2 = aNotLbIndexes.length % _iBx_5_2_fb_lpcount;  
404 -  
405 - for (i = 0; i < _iBx_5_2_fb_lpcount - iC2; i++) {  
406 - iLpIndex = aNotLbIndexes[i * iC1];  
407 - _internalLpArray[iLpIndex].setBxLb(false);  
408 - _internalLpArray[iLpIndex].setBxFb(true);  
409 - _internalLpArray[iLpIndex].setBxFb5_2(true);  
410 - _internalLpArray[iLpIndex].setBxDesc("5休2分班");  
411 - }  
412 - for (i = 0; i < iC2; i++) {  
413 - iLpIndex = aNotLbIndexes[_iBx_5_2_fb_lpcount - iC2 + i * (iC1 + 1)];  
414 - _internalLpArray[iLpIndex].setBxLb(false);  
415 - _internalLpArray[iLpIndex].setBxFb(true);  
416 - _internalLpArray[iLpIndex].setBxFb5_2(true);  
417 - _internalLpArray[iLpIndex].setBxDesc("5休2分班");  
418 - }  
419 - // 其他分班  
420 - for (i = 0; i < aNotLbIndexes.length; i++) {  
421 - iLpIndex = aNotLbIndexes[i];  
422 - if (!_internalLpArray[iLpIndex].isBxFb5_2()) {  
423 - _internalLpArray[iLpIndex].setBxLb(false);  
424 - _internalLpArray[iLpIndex].setBxFb(true);  
425 - _internalLpArray[iLpIndex].setBxFb5_2(false);  
426 - _internalLpArray[iLpIndex].setBxDesc("其他分班");  
427 - }  
428 - }  
429 -  
430 - console.log("高峰周转时间:" + _paramObj.calcuPeakZzsj());  
431 - console.log("连班路牌数:" + _iBx_lb_lpcount);  
432 - console.log("5休2分班路牌数:" + _iBx_5_2_fb_lpcount);  
433 - console.log("其他分班路牌数:" + _iBx_other_fb_lpcount);  
434 - var aLbIndexes = [];  
435 - for (i = 0; i < _internalLpArray.length; i++) {  
436 - if (_internalLpArray[i].isBxLb()) {  
437 - aLbIndexes.push(i);  
438 - }  
439 - }  
440 - console.log("连班路牌indexes=" + aLbIndexes);  
441 - var a_5_2_fbIndexes = [];  
442 - for (i = 0; i < _internalLpArray.length; i++) {  
443 - if (_internalLpArray[i].isBxFb() && _internalLpArray[i].isBxFb5_2()) {  
444 - a_5_2_fbIndexes.push(i);  
445 - }  
446 - }  
447 - console.log("5休2分班路牌indexes=" + a_5_2_fbIndexes);  
448 - var a_other_fbIndexes = [];  
449 - for (i = 0; i < _internalLpArray.length; i++) {  
450 - if (_internalLpArray[i].isBxFb() && !_internalLpArray[i].isBxFb5_2()) {  
451 - a_other_fbIndexes.push(i);  
452 - }  
453 - }  
454 - console.log("其他分班路牌indexes=" + a_other_fbIndexes);  
455 -  
456 - console.log("//---------------- 行车计划,初始化方法3 end ----------------//");  
457 - };  
458 -  
459 - //----------------------- 初始化方法4,计算中标线位置 -------------------------//  
460 - var _iZbx_lpIndex; // 中标线对应第几个路牌  
461 -  
462 - var _fnInitFun4 = function() { // 初始化方法4  
463 - console.log("//---------------- 行车计划,初始化方法4 start ----------------//");  
464 -  
465 - //---------------------------- 1、模拟一个中标线,使用临时路牌 ----------------------//  
466 - // 构造中标线  
467 - // 中标线开始时间,就是方向的首班车时间  
468 - var oSt = !_qIsUp ? _paramObj.getUpFirstDTimeObj() : _paramObj.getDownFirstDTimeObj();  
469 - // 上标线结束时间,使用最晚的末班车时间,结束时间的班次方向  
470 - // 上标线结束时间,使用最晚的末班车时间,结束时间的班次方向  
471 - var oEt;  
472 - if (_paramObj.getUpLastDtimeObj().isBefore(  
473 - _paramObj.getDownLastDTimeObj())) {  
474 - oEt = _paramObj.getDownLastDTimeObj();  
475 - } else {  
476 - oEt = _paramObj.getUpLastDtimeObj();  
477 - }  
478 -  
479 - var oTempLp = new InternalLpObj({lpNo: -999, lpName: "-999"}, _qCount, _qIsUp);  
480 - oTempLp.initDataFromTimeToTime(  
481 - oSt,  
482 - oEt,  
483 - !_qIsUp,  
484 - 0,  
485 - _paramObj,  
486 - _factory  
487 - );  
488 -  
489 - //------------------------ 2、找出中标线的早高峰班次,计算应该插在当前路牌数组的那个位置 ----------------//  
490 - // 找出中标线对应的早高峰的班次对象  
491 - var oZb_gf_bc = oTempLp.getBc(_approximate_zgfQIndex, _approximate_zgfBIndex);  
492 - //alert(oZb_gf_bc.getFcTimeObj().format("HH:mm"));  
493 -  
494 - // 把所有连班路牌高峰班次重新构造成一个一个的圈数组,计算对应中标线最近的是第几个路牌  
495 - // 中标线和上标线一样在连班路牌上  
496 - var aTempq = [];  
497 - var oTempq;  
498 - var oTempb;  
499 - var i;  
500 - var oLp;  
501 -  
502 - var aLbIndexes = []; // 连班的路牌索引  
503 - for (i = 0; i < _internalLpArray.length; i++) {  
504 - if (_internalLpArray[i].isBxLb()) {  
505 - aLbIndexes.push(i);  
506 - }  
507 - }  
508 -  
509 - for (i = 0; i < aLbIndexes.length; i++) {  
510 - oLp = _internalLpArray[aLbIndexes[i]];  
511 -  
512 - oTempb = oLp.getBc(_approximate_zgfQIndex, _approximate_zgfBIndex);  
513 - if (oTempb.isUp() == _qIsUp) {  
514 - oTempq = new InternalGroupObj(oLp, _qIsUp, oTempb, undefined);  
515 - } else {  
516 - oTempq = new InternalGroupObj(oLp, _qIsUp, undefined, oTempb);  
517 - }  
518 - aTempq.push(oTempq);  
519 -  
520 - }  
521 -  
522 - var aTtindex = oTempLp.fnGetQBcIndexWithFcTimeFromGroupArray( // 找出最接近中标线的路牌索引  
523 - oZb_gf_bc.getFcTimeObj(),  
524 - aTempq,  
525 - true,  
526 - true  
527 - );  
528 -  
529 - _iZbx_lpIndex = aLbIndexes[aTtindex[0]]; // 中标线放在第几个路牌  
530 -  
531 - oTempLp.getMinBcObj().fnSetIsFirstBc(true); // 设置首班班次标识  
532 -  
533 - if (_iZbx_lpIndex == 0) { // 如果中标线和上标线一致  
534 - var oFirstBcIndexes = oTempLp.getMinBcObjPosition();  
535 - var oFirstBc = oTempLp.getMinBcObj();  
536 - oFirstBc.setLp(_internalLpArray[_iZbx_lpIndex]);  
537 - oFirstBc.fnSetDelFlag(false);  
538 - _internalLpArray[_iZbx_lpIndex].setBc(oFirstBcIndexes[0], oFirstBcIndexes[1], oFirstBc);  
539 - } else {  
540 - oTempLp.setLp(_lpArray[_iZbx_lpIndex]); // 设置原始路牌对象  
541 - oTempLp._$_aVerticalIntervalTime = _internalLpArray[_iZbx_lpIndex]._$_aVerticalIntervalTime; // 设置纵向最小发车间隔  
542 - oTempLp.setBxLb(_internalLpArray[_iZbx_lpIndex].isBxLb());  
543 - oTempLp.setBxFb(_internalLpArray[_iZbx_lpIndex].isBxFb());  
544 - oTempLp.setBxFb5_2(_internalLpArray[_iZbx_lpIndex].isBxFb5_2());  
545 -  
546 - // 修正除了第一个班次外,其余其他班次  
547 - var iBcindex = 0;  
548 - for (i = 1; i < _qCount; i++) {  
549 - while (iBcindex <= 1) {  
550 - if (oTempLp.getBc(i, iBcindex)) { // 替换存在的班次  
551 - oTempLp.setBc(i, iBcindex, _fnGenerateBc(_iZbx_lpIndex, i, iBcindex));  
552 - }  
553 - iBcindex ++;  
554 - }  
555 - iBcindex = 0;  
556 - }  
557 -  
558 - _internalLpArray[_iZbx_lpIndex] = oTempLp;  
559 - }  
560 -  
561 - console.log("中标线对应第" + (_iZbx_lpIndex + 1) + "个路牌");  
562 -  
563 - console.log("//---------------- 行车计划,初始化方法4 end ----------------//");  
564 - };  
565 -  
566 - //-------------------- 重要的内部方法 -----------------------//  
567 - /**  
568 - * 核心方法,利用路牌间隔纵向生成班次。  
569 - * @param iLpindex 路牌索引  
570 - * @param iQindex 圈索引  
571 - * @param iBcindex 班次索引  
572 - * @returns object InternalBcObj,失败 false  
573 - */  
574 - var _fnGenerateBc = function(iLpindex, iQindex, iBcindex) {  
575 - // 以上标线为起始点,使用路牌在不同圈,班次索引的发车间隔,计算班次  
576 - // 注意,发车间隔是指下一个班次应该距离当前班次间隔,是从下往上的  
577 -  
578 - // 1、参数验证  
579 - if (iLpindex == 0) { // 上标线的班次不需要生成  
580 - return false;  
581 - }  
582 -  
583 - // 2、计算间隔  
584 - var i;  
585 - var oLp;  
586 - var iTime = 0;  
587 - for (i = 0; i < iLpindex; i++) {  
588 - oLp = _internalLpArray[i];  
589 - iTime += oLp.fnGetVerticalIntervalTime(iQindex, iBcindex);  
590 - }  
591 -  
592 - // 3、生成班次  
593 - var _oKsbc = _internalLpArray[0].getBc(iQindex, iBcindex);  
594 - if (!_oKsbc) {  
595 - return false;  
596 - }  
597 - var _oKssj = _paramObj.addMinute(_oKsbc.getFcTimeObj(), iTime);  
598 - var _oBc = _factory.createBcObj(  
599 - _internalLpArray[iLpindex],  
600 - "normal", _oKsbc.isUp(),  
601 - 1, _oKssj, _paramObj);  
602 -  
603 - return _oBc;  
604 -  
605 - };  
606 -  
607 - /**  
608 - * 核心方法,在指定位置生成班次并添加到路牌指定位置中。  
609 - * @param lpIndex 第几个路牌  
610 - * @param qIndex 第几圈  
611 - * @param bcIndex 第几个班次  
612 - */  
613 - var _fnGenerateBcAndSetBc = function(lpIndex, qIndex, bcIndex) {  
614 - var _bcObj = _fnGenerateBc(lpIndex, qIndex, bcIndex);  
615 - if (_bcObj) {  
616 - _internalLpArray[lpIndex].setBc(qIndex, bcIndex, _bcObj);  
617 - }  
618 - };  
619 -  
620 - /**  
621 - * 获取班次列表。  
622 - * @param oIsUp 是否上行  
623 - * @param oStartTime 开始时间对象  
624 - * @returns [(InternalBcObj)]  
625 - */  
626 - var _fnGetBcList2 = function(oIsUp, oStartTime) {  
627 - var i;  
628 - var j;  
629 - var oLp;  
630 - var oBc;  
631 - var aBc = [];  
632 -  
633 - for (j = 0; j < _qCount; j++) {  
634 - for (i = 0; i < _internalLpArray.length; i++) {  
635 - oLp = _internalLpArray[i];  
636 - oBc = oLp.getBc(  
637 - j,  
638 - _qIsUp == oIsUp ? 0 : 1  
639 - );  
640 - if (oBc && oBc.getFcTimeObj().isAfter(oStartTime)) {  
641 - aBc.push(oBc);  
642 - }  
643 - }  
644 - }  
645 -  
646 - var aBcFcTime = [];  
647 - for (i = 0; i < aBc.length; i++) {  
648 - oBc = aBc[i];  
649 - aBcFcTime.push(oBc.getFcTimeObj().format("HH:mm"));  
650 - }  
651 - console.log((oIsUp ? "上行班次列表:" : "下行班次列表:") + aBcFcTime.join(","));  
652 -  
653 - return aBc;  
654 - };  
655 -  
656 - /**  
657 - * 获取班次列表。  
658 - * @param isUp boolean 是否上行  
659 - * @returns [(InternalBcObj)]  
660 - */  
661 - var _fnGetBcList = function(isUp) {  
662 - var i;  
663 - var j;  
664 - var oLp;  
665 - var oBc;  
666 - var aBc = [];  
667 -  
668 - for (j = 0; j < _qCount; j++) {  
669 - for (i = 0; i < _internalLpArray.length; i++) {  
670 - oLp = _internalLpArray[i];  
671 - oBc = oLp.getBc(  
672 - j,  
673 - _qIsUp == isUp ? 0 : 1  
674 - );  
675 - if (oBc) {  
676 - aBc.push(oBc);  
677 - }  
678 - }  
679 - }  
680 -  
681 - var aBcFcTime = [];  
682 - for (i = 0; i < aBc.length; i++) {  
683 - oBc = aBc[i];  
684 - aBcFcTime.push(oBc.getFcTimeObj().format("HH:mm"));  
685 - }  
686 - console.log((isUp ? "上行班次列表:" : "下行班次列表:") + aBcFcTime.join(","));  
687 -  
688 - return aBc;  
689 - };  
690 -  
691 - /**  
692 - * 查找离指定时间最近的前面的班次索引信息  
693 - * @param timeObj 查找时间  
694 - * @param isUp 是否上行  
695 - * @returns [{路牌index},{圈index},{班次index}]  
696 - */  
697 - var _fnFindUpClosedBcIndexWithTime = function(timeObj, isUp) {  
698 -  
699 - var _lpObj;  
700 - var _groupObj;  
701 - var _bcObj;  
702 - var _i;  
703 - var _j;  
704 - var timediff; // 时间差取绝对值  
705 -  
706 - var _lpIndex;  
707 - var _up_qIndex;  
708 - var _up_bIndex;  
709 -  
710 - for (_i = 0; _i < _qCount; _i++) {  
711 - for (_j = 0; _j < _internalLpArray.length; _j++) {  
712 - _lpObj = _internalLpArray[_j];  
713 - _groupObj = _lpObj.getGroup(_i);  
714 - _bcObj = isUp == _qIsUp ? _groupObj.getBc1() : _groupObj.getBc2();  
715 - if (!_bcObj) { // 没有班次动态生成一个,可能生成不出的  
716 - _bcObj = _fnGenerateBc(_j, _i, isUp == _qIsUp ? 0 : 1);  
717 - }  
718 - if (_bcObj) {  
719 - if (timeObj.diff(_bcObj.getFcTimeObj()) >= 0) {  
720 - if (!timediff) {  
721 - timediff = timeObj.diff(_bcObj.getFcTimeObj());  
722 - _lpIndex = _j;  
723 - _up_qIndex = _i;  
724 - _up_bIndex = isUp == _qIsUp ? 0 : 1;  
725 - } else {  
726 - if (timeObj.diff(_bcObj.getFcTimeObj()) < timediff) {  
727 - timediff = timeObj.diff(_bcObj.getFcTimeObj());  
728 - _lpIndex = _j;  
729 - _up_qIndex = _i;  
730 - _up_bIndex = isUp == _qIsUp ? 0 : 1;  
731 - }  
732 - }  
733 - }  
734 - }  
735 - }  
736 - }  
737 -  
738 - if (_lpIndex == undefined) {  
739 - return false;  
740 - }  
741 -  
742 - var bcindex = [];  
743 - bcindex.push(_lpIndex);  
744 - bcindex.push(_up_qIndex);  
745 - bcindex.push(_up_bIndex);  
746 -  
747 - return bcindex;  
748 - };  
749 -  
750 - /**  
751 - * 查找离指定时间最近的后面的班次索引信息  
752 - * @param timeObj 查找时间  
753 - * @param isUp 是否上行  
754 - * @returns [{路牌index},{圈index},{班次index}]  
755 - */  
756 - var _fnFindDownClosedBcIndexWithTime = function(timeObj, isUp) {  
757 - var _lpObj;  
758 - var _groupObj;  
759 - var _bcObj;  
760 - var _i;  
761 - var _j;  
762 - var timediff; // 时间差取绝对值  
763 -  
764 - var _lpIndex;  
765 - var _down_qIndex;  
766 - var _down_bIndex;  
767 -  
768 - var flag;  
769 -  
770 - for (_i = 0; _i < _qCount; _i++) {  
771 - for (_j = 0; _j < _internalLpArray.length; _j++) {  
772 - _lpObj = _internalLpArray[_j];  
773 - _groupObj = _lpObj.getGroup(_i);  
774 - // TODO:bug  
775 - _bcObj = isUp == _qIsUp ? _groupObj.getBc1() : _groupObj.getBc2();  
776 - if (!_bcObj) { // 没有班次动态生成一个,可能生成不出的  
777 - _bcObj = _fnGenerateBc(_j, _i, isUp == _qIsUp ? 0 : 1);  
778 - }  
779 - if (_bcObj) {  
780 - //console.log("timeobj -> bcobj diff flag " +  
781 - // timeObj.format("HH:mm") + "->" +  
782 - // _bcObj.getFcTimeObj().format("HH:mm") +  
783 - // timeObj.diff(_bcObj.getFcTimeObj()) +  
784 - // (timeObj.diff(_bcObj.getFcTimeObj()) <= 0)  
785 - //);  
786 -  
787 - flag = (timeObj.diff(_bcObj.getFcTimeObj())) <= 0;  
788 -  
789 - if (flag) {  
790 - if (!timediff) {  
791 - timediff = timeObj.diff(_bcObj.getFcTimeObj());  
792 - _lpIndex = _j;  
793 - _down_qIndex = _i;  
794 - _down_bIndex = isUp == _qIsUp ? 0 : 1;  
795 - } else {  
796 - if ((timeObj.diff(_bcObj.getFcTimeObj())) > timediff) {  
797 - timediff = timeObj.diff(_bcObj.getFcTimeObj());  
798 - _lpIndex = _j;  
799 - _down_qIndex = _i;  
800 - _down_bIndex = isUp == _qIsUp ? 0 : 1;  
801 - }  
802 - }  
803 - }  
804 - }  
805 - }  
806 - }  
807 -  
808 - if (_lpIndex == undefined) {  
809 - return false;  
810 - }  
811 -  
812 - var bcindex = [];  
813 - bcindex.push(_lpIndex);  
814 - bcindex.push(_down_qIndex);  
815 - bcindex.push(_down_bIndex);  
816 -  
817 - return bcindex;  
818 - };  
819 -  
820 - /**  
821 - * 获取班次索引。  
822 - * @param oBc 班次对象  
823 - * @returns [{路牌索引},{圈索引},{班次索引}]  
824 - */  
825 - var _fnGetBcIndex = function(oBc) {  
826 - // 路牌索引  
827 - var i;  
828 - var iLpIndex;  
829 - for (i = 0; i < _internalLpArray.length; i++) {  
830 - if (_internalLpArray[i]._$$_orign_lp_obj == oBc._$$_internal_lp_obj._$$_orign_lp_obj) {  
831 - iLpIndex = i;  
832 - break;  
833 - }  
834 - }  
835 - // 圈索引  
836 - var j;  
837 - var iGroupIndex;  
838 - var bFlag = false;  
839 - for (i = 0; i < _internalLpArray.length; i++) {  
840 - if (bFlag) {  
841 - break;  
842 - }  
843 - for (j = 0; j < _qCount; j++) {  
844 - if (_internalLpArray[i]._$_groupBcArray[j] == oBc._$$_internal_group_obj) {  
845 - iGroupIndex = j;  
846 - bFlag = true;  
847 - break;  
848 - }  
849 - }  
850 - }  
851 - // 班次索引  
852 - var iBcIndex = _qIsUp == oBc.isUp() ? 0 : 1;  
853 -  
854 - if (iLpIndex == undefined) {  
855 - return null;  
856 - } else {  
857 - return [].concat(iLpIndex, iGroupIndex, iBcIndex);  
858 - }  
859 -  
860 - };  
861 -  
862 - return {  
863 - //------------- 布局初始化方法 ------------//  
864 - /**  
865 - * 初始化数据,使用标线初始化  
866 - */  
867 - fnInitDataWithBxLayout: function() {  
868 - // 初始化布局1,构造上标线,计算圈数,把上标线数据放入第一个路牌中  
869 - _fnInitFun1();  
870 - // 初始化布局2,从上标线的某个班次开始,构造所有路牌的早高峰班次,晚高峰班次,计算路牌在各个圈中的间隔  
871 - _fnInitFun2();  
872 - // 初始化布局3,计算连班分班路牌分布  
873 - _fnInitFun3();  
874 - // 初始化布局4,计算中标线位置  
875 - _fnInitFun4();  
876 -  
877 - },  
878 -  
879 - /**  
880 - * 调整高峰班次,  
881 - * 初始化生成早高峰,晚高峰班次并不准确,因为根据高峰时间段,并不在一个完整圈内,应该是在两个或多个圈之间  
882 - * 当初始化定好布局后(上标线,中标线),然后确定每个路牌的班型(连班,分班,5休2分班)后  
883 - * 然后重新计算框在高峰时间段内的班次索引,不足的添加,之前多加的删除(只删除分班路牌上的)  
884 - * @param isZgf 是否早高峰  
885 - * @param isUp 是否上行  
886 - */  
887 - fnAdjustGfbc : function(isZgf, isUp) {  
888 - var oStartTime; // 开始时间  
889 - var oEndTime; // 结束时间  
890 - var aStartBcIndex; // 开始班次索引  
891 - var aEndBcIndex; // 结束班次索引  
892 -  
893 - oStartTime = isZgf ? _paramObj.getMPeakStartTimeObj() : _paramObj.getEPeakStartTimeObj();  
894 - oEndTime = isZgf ? _paramObj.getMPeakEndTimeObj() : _paramObj.getEPeakEndTimeObj();  
895 -  
896 - aStartBcIndex = _fnFindUpClosedBcIndexWithTime(oStartTime, isUp);  
897 - aEndBcIndex = _fnFindDownClosedBcIndexWithTime(oEndTime, isUp);  
898 -  
899 - var iLpIndex;  
900 - var iQIndex;  
901 - var iBcIndex;  
902 - var iQInternelCount; // 高峰时间段中间包含的圈数  
903 - var i;  
904 - var j;  
905 -  
906 - var oLp;  
907 -  
908 - if (aStartBcIndex && aEndBcIndex) {  
909 - iLpIndex = aStartBcIndex[0];  
910 - iQIndex = aStartBcIndex[1];  
911 - iBcIndex = aStartBcIndex[2];  
912 -  
913 - // 处理头  
914 - // 删除头部多余班次  
915 - for (j = 0; j < iLpIndex; j++) {  
916 - oLp = _internalLpArray[j];  
917 - if (oLp.isBxFb() && oLp.getBc(iQIndex, iBcIndex)) {  
918 - oLp.removeBc(iQIndex, iBcIndex);  
919 - }  
920 - }  
921 -  
922 - for (j = iLpIndex; j < _internalLpArray.length; j++) {  
923 - oLp = _internalLpArray[j];  
924 - if (!oLp.getBc(iQIndex, iBcIndex)) {  
925 - _fnGenerateBcAndSetBc(j, iQIndex, iBcIndex);  
926 - }  
927 - }  
928 -  
929 - // 处理中间  
930 - iQInternelCount = aEndBcIndex[1] - aStartBcIndex[1] - 1;  
931 - for (i = 1; i <= iQInternelCount; i++) {  
932 - oLp = _internalLpArray[iQIndex + i];  
933 -  
934 - if (!oLp.getBc(iQIndex + i, iBcIndex)) {  
935 - _fnGenerateBcAndSetBc(i, iQIndex + i, iBcIndex);  
936 - }  
937 - }  
938 -  
939 - // 处理尾部  
940 - iLpIndex = aEndBcIndex[0];  
941 - iQIndex = aEndBcIndex[1];  
942 - iBcIndex = aEndBcIndex[2];  
943 -  
944 - // 删除尾部多余的班次  
945 - for (j = iLpIndex; j < _internalLpArray.length; j++) {  
946 - oLp = _internalLpArray[j];  
947 - if (oLp.isBxFb() && oLp.getBc(iQIndex, iBcIndex)) {  
948 - oLp.removeBc(iQIndex, iBcIndex);  
949 - }  
950 - }  
951 -  
952 - if (aStartBcIndex[1] != aEndBcIndex[1]) { // 指定时间范围跨圈  
953 - for (j = 0; j < iLpIndex; j++) {  
954 - oLp = _internalLpArray[j];  
955 - if (!oLp.getBc(iQIndex, iBcIndex)) {  
956 - _fnGenerateBcAndSetBc(j, iQIndex, iBcIndex);  
957 - }  
958 - }  
959 - } else {  
960 - // 不跨圈,不用处理,处理头的时候已经加了  
961 - }  
962 -  
963 - }  
964 -  
965 - },  
966 -  
967 - /**  
968 - * 按照营运时间要求补充班次,  
969 - * 早高峰7:45分以前出场运营,  
970 - * 晚高峰16:10分以前出场运营  
971 - */  
972 - fnCalcuLpBc_yy: function() {  
973 - // 补班次的时候,针对的是分班班型  
974 - var i;  
975 - var _oLp;  
976 - var _oBc;  
977 - var _aMinBcIndex;  
978 - var _aMaxBcIndex;  
979 -  
980 - var _qIndex;  
981 - var _bIndex;  
982 -  
983 - var _zgfCDate = _paramObj.toTimeObj("7:45");  
984 - var _wgfCDate = _paramObj.toTimeObj("16:10");  
985 - var _ccsj;  
986 -  
987 - for (i = 0; i < _internalLpArray.length; i++) {  
988 - _oLp = _internalLpArray[i];  
989 - if (_oLp.isBxFb()) { // 分班路牌  
990 - // 早高峰部分  
991 - _aMinBcIndex = _oLp.getMinBcObjPosition();  
992 - _qIndex = _aMinBcIndex[0];  
993 - _bIndex = _aMinBcIndex[1];  
994 - _oBc = _oLp.getBc(_qIndex, _bIndex);  
995 - if (_qIsUp) {  
996 - _ccsj = _bIndex == 0 ?  
997 - _paramObj.getUpOutTime() :  
998 - _paramObj.getDownOutTime();  
999 - } else {  
1000 - _ccsj = _bIndex == 0 ?  
1001 - _paramObj.getDownOutTime() :  
1002 - _paramObj.getUpOutTime();  
1003 - }  
1004 - if (_zgfCDate.isBefore(_paramObj.addMinute(_oBc.getFcTimeObj(), -_ccsj))) {  
1005 - _fnGenerateBcAndSetBc(  
1006 - i,  
1007 - _bIndex == 0 ? _qIndex - 1 : _qIndex,  
1008 - _bIndex == 0 ? 1 : 0  
1009 - )  
1010 - }  
1011 -  
1012 - // 晚高峰部分  
1013 - _aMaxBcIndex = _oLp.getMaxBcObjPosition();  
1014 - _qIndex = _aMaxBcIndex[0];  
1015 - _bIndex = _aMaxBcIndex[1];  
1016 - _oBc = _oLp.getBc(  
1017 - _bIndex == 0 ? _qIndex - 1 : _qIndex,  
1018 - _bIndex == 0 ? 1 : 0  
1019 - );  
1020 - if (!_oBc) { // 前一个班次不存在,再判定加不加  
1021 - _oBc = _oLp.getBc(_qIndex, _bIndex);  
1022 - if (_qIsUp) {  
1023 - _ccsj = _bIndex == 0 ?  
1024 - _paramObj.getUpOutTime() :  
1025 - _paramObj.getDownOutTime();  
1026 - } else {  
1027 - _ccsj = _bIndex == 0 ?  
1028 - _paramObj.getDownOutTime() :  
1029 - _paramObj.getUpOutTime();  
1030 - }  
1031 - if (_wgfCDate.isBefore(_paramObj.addMinute(_oBc.getFcTimeObj(), -_ccsj))) {  
1032 - _fnGenerateBcAndSetBc(  
1033 - i,  
1034 - _bIndex == 0 ? _qIndex - 1 : _qIndex,  
1035 - _bIndex == 0 ? 1 : 0  
1036 - )  
1037 - }  
1038 - }  
1039 - }  
1040 - }  
1041 - },  
1042 -  
1043 - /**  
1044 - * 补充做5休2的班型班次。  
1045 - * 1、确认5_2班型大致多少圈(小数点过.7进位)  
1046 - * 2、获取当前5_2两端车次链的信息,每段的班次数目,还差几个班次没加  
1047 - * 3、如果前面的车次链班次少,则从前面的车次链开始加  
1048 - * 4、如果车次链班次数一样,从从后面的车次链开始加  
1049 - * 5、加班次时都是往车次链前方加  
1050 - * 6、如果前面车次链不能再加班次了,从后面车次链加  
1051 - */  
1052 - fnCalcuLpBx_5_2: function() {  
1053 - // 计算做5休2班型所需的班次数  
1054 - var iBxBcount = _aBxDesc[6].fBcCount;  
1055 - if (iBxBcount - Math.floor(iBxBcount) > 0.7) {  
1056 - iBxBcount = Math.floor(iBxBcount) + 1;  
1057 - } else {  
1058 - iBxBcount = Math.floor(iBxBcount);  
1059 - }  
1060 -  
1061 - var i;  
1062 - var j;  
1063 - var oLp;  
1064 - var iAddBcCount;  
1065 - var oBcChain1;  
1066 - var oBcChain2;  
1067 - var iQindex;  
1068 - var iBindex;  
1069 -  
1070 - for (i = 0; i < _internalLpArray.length; i++) {  
1071 - oLp = _internalLpArray[i];  
1072 - if (oLp.isBxFb5_2()) {  
1073 - iAddBcCount = iBxBcount - oLp.getBcArray().length; // 需要添加的班次数  
1074 - for (j = 1; j <= iAddBcCount; j++) {  
1075 - oBcChain1 = oLp.fnGetBcChainInfo(0);  
1076 - oBcChain2 = oLp.fnGetBcChainInfo(1);  
1077 -  
1078 - if (oBcChain1.bcount < oBcChain2.bcount) {  
1079 - iQindex = oBcChain1.s_b == 0 ? oBcChain1.s_q - 1 : oBcChain1.s_q;  
1080 - iBindex = oBcChain1.s_b == 0 ? 1 : 0;  
1081 - // 往车次链往前不能加,就往后加  
1082 - if (_fnGenerateBc(i, iQindex, iBindex)) {  
1083 - _fnGenerateBcAndSetBc(i, iQindex, iBindex);  
1084 - } else {  
1085 - iQindex = oBcChain1.e_b == 0 ? oBcChain1.e_q : oBcChain1.e_q + 1;  
1086 - iBindex = oBcChain1.e_b == 0 ? 1 : 0;  
1087 - _fnGenerateBcAndSetBc(i, iQindex, iBindex);  
1088 - }  
1089 -  
1090 - } else if (oBcChain1.bcount > oBcChain2.bcount) {  
1091 - iQindex = oBcChain2.s_b == 0 ? oBcChain2.s_q - 1 : oBcChain2.s_q;  
1092 - iBindex = oBcChain2.s_b == 0 ? 1 : 0;  
1093 - _fnGenerateBcAndSetBc(i, iQindex, iBindex);  
1094 - } else {  
1095 - iQindex = oBcChain2.s_b == 0 ? oBcChain2.s_q - 1 : oBcChain2.s_q;  
1096 - iBindex = oBcChain2.s_b == 0 ? 1 : 0;  
1097 - _fnGenerateBcAndSetBc(i, iQindex, iBindex);  
1098 - }  
1099 - }  
1100 - }  
1101 - }  
1102 -  
1103 - },  
1104 -  
1105 - /**  
1106 - * 补其他分班班型班次。  
1107 - * 从车次链的后面开始加  
1108 - */  
1109 - fnCalcuLpBx_other: function() {  
1110 - // TODO:根据上标线的首班时间确定班型,小于05:59的做一休一,否则做二休一  
1111 - var oSt = _qIsUp ? _paramObj.getUpFirstDTimeObj() : _paramObj.getDownFirstDTimeObj();  
1112 - var iBxIndex = 4;  
1113 - if (oSt.isBefore(_paramObj.toTimeObj("05:59"))) {  
1114 - iBxIndex = 5;  
1115 - }  
1116 - // 计算做5休2班型所需的班次数  
1117 - var iQBcount = _aBxDesc[iBxIndex].fQCount;  
1118 - var iBxBcount = Math.round(iQBcount) * 2;  
1119 -  
1120 - var i;  
1121 - var j;  
1122 - var oLp;  
1123 - var iAddBcCount;  
1124 - var oBcChain1;  
1125 - var oBcChain2;  
1126 - var iQindex;  
1127 - var iBindex;  
1128 -  
1129 - for (i = 0; i < _internalLpArray.length; i++) {  
1130 - oLp = _internalLpArray[i];  
1131 - if (oLp.isBxFb() && !oLp.isBxFb5_2()) {  
1132 - iAddBcCount = iBxBcount - oLp.getBcArray().length; // 需要添加的班次数  
1133 - for (j = 1; j <= iAddBcCount; j++) {  
1134 - oBcChain1 = oLp.fnGetBcChainInfo(0);  
1135 - oBcChain2 = oLp.fnGetBcChainInfo(1);  
1136 -  
1137 - if (oBcChain1.bcount < oBcChain2.bcount) {  
1138 - iQindex = oBcChain1.e_b == 0 ? oBcChain1.e_q : oBcChain1.e_q + 1;  
1139 - iBindex = oBcChain1.e_b == 0 ? 1 : 0;  
1140 - _fnGenerateBcAndSetBc(i, iQindex, iBindex);  
1141 - } else if (oBcChain1.bcount > oBcChain2.bcount) {  
1142 - iQindex = oBcChain2.e_b == 0 ? oBcChain2.e_q : oBcChain2.e_q + 1;  
1143 - iBindex = oBcChain2.e_b == 0 ? 1 : 0;  
1144 - _fnGenerateBcAndSetBc(i, iQindex, iBindex);  
1145 - } else {  
1146 - iQindex = oBcChain2.e_b == 0 ? oBcChain2.e_q : oBcChain2.e_q + 1;  
1147 - iBindex = oBcChain2.e_b == 0 ? 1 : 0;  
1148 - _fnGenerateBcAndSetBc(i, iQindex, iBindex);  
1149 - }  
1150 - }  
1151 - }  
1152 - }  
1153 -  
1154 - },  
1155 -  
1156 - /**  
1157 - * 补充连班路牌班次。  
1158 - * 1、上标线,中标线中间的连班路牌班次从早高峰班次一直拉到底,从早高峰班次向上标线起始班次靠拢  
1159 - * 2、中标线以下的连班路牌班次从早高峰班次一直拉到底,从早高峰班次向中标线起始班次靠拢  
1160 - */  
1161 - fnCalcuLpBx_lb: function() {  
1162 - // 补充连班的班次,参照上标线,中标线补充不足的班次  
1163 -  
1164 - var aLbLpindexes = []; // 除上标线,中标线的连班路牌索引  
1165 - var i;  
1166 - for (i = 0; i < _internalLpArray.length; i++) {  
1167 - if (_internalLpArray[i].isBxLb() && i != 0 && i != _iZbx_lpIndex) {  
1168 - aLbLpindexes.push(i);  
1169 - }  
1170 - }  
1171 -  
1172 - var oEndsj = // 结束时间  
1173 - _paramObj.getUpLastDtimeObj().isBefore(_paramObj.getDownLastDTimeObj()) ?  
1174 - _paramObj.getDownLastDTimeObj() :  
1175 - _paramObj.getUpLastDtimeObj();  
1176 -  
1177 - var oLp;  
1178 - var aMinbcPos;  
1179 - var oBc;  
1180 - var j;  
1181 - var iTempBcIndex;  
1182 -  
1183 - // 1、从最小班次开始,往后补充班次  
1184 - for (i = 0; i < aLbLpindexes.length; i++) {  
1185 - oLp = _internalLpArray[aLbLpindexes[i]];  
1186 -  
1187 - // 最小班次索引  
1188 - aMinbcPos = oLp.getMinBcObjPosition();  
1189 - // 使用纵向分隔补充班次,从最小班次向后补  
1190 - iTempBcIndex = aMinbcPos[1] == 0 ? 1 : 0;  
1191 - j = iTempBcIndex == 0 ? aMinbcPos[0] + 1 : aMinbcPos[0];  
1192 -  
1193 - while (j < _qCount) {  
1194 - while (iTempBcIndex <= 1) {  
1195 - oBc = _fnGenerateBc(aLbLpindexes[i], j, iTempBcIndex);  
1196 - if (oBc &&  
1197 - oBc.getFcTimeObj().isBefore(oEndsj) ) {  
1198 - oLp.setBc(j, iTempBcIndex, oBc);  
1199 - }  
1200 - iTempBcIndex++;  
1201 - }  
1202 - iTempBcIndex = 0;  
1203 - j++;  
1204 - }  
1205 -  
1206 - }  
1207 -  
1208 - // 2、上标线中标线之间的路牌,从最小的班次往前补充班次  
1209 -  
1210 - // 还要补充缺失的班次,差上标线几个班次要往前补上  
1211 - var iBccount;  
1212 - var iQindex;  
1213 - var iBindex;  
1214 - // 补上标线到中标线之间的连班路牌的班次  
1215 - for (i = 0; i < aLbLpindexes.length; i++) {  
1216 - if (aLbLpindexes[i] > 0 && aLbLpindexes[i] < _iZbx_lpIndex) {  
1217 - oLp = _internalLpArray[aLbLpindexes[i]];  
1218 - aMinbcPos = oLp.getMinBcObjPosition();  
1219 - iQindex = aMinbcPos[0];  
1220 - iBindex = aMinbcPos[1];  
1221 - iBccount = (iQindex - 1) * 2 + iBindex; // 距离上标线起始站点差几个班次  
1222 - for (j = 0; j < iBccount; j++) {  
1223 - if (iBindex == 0) {  
1224 - iQindex --;  
1225 - iBindex = 1;  
1226 - _fnGenerateBcAndSetBc(aLbLpindexes[i], iQindex, iBindex);  
1227 - } else if (iBindex == 1) {  
1228 - iBindex --;  
1229 - _fnGenerateBcAndSetBc(aLbLpindexes[i], iQindex, iBindex);  
1230 - }  
1231 - }  
1232 -  
1233 - }  
1234 -  
1235 - }  
1236 -  
1237 - // 3、中标线之后的路牌,从最小的班次往前补充班次  
1238 -  
1239 - // 补中标线以下的连班路牌的班次  
1240 - for (i = 0; i < aLbLpindexes.length; i++) {  
1241 - if (aLbLpindexes[i] > _iZbx_lpIndex) {  
1242 - oLp = _internalLpArray[aLbLpindexes[i]];  
1243 - aMinbcPos = oLp.getMinBcObjPosition();  
1244 - iQindex = aMinbcPos[0];  
1245 - iBindex = aMinbcPos[1];  
1246 - iBccount = (iQindex - 0) * 2 + iBindex - 1; // 距离上标线起始站点差几个班次  
1247 - for (j = 0; j < iBccount; j++) {  
1248 - if (iBindex == 0) {  
1249 - iQindex --;  
1250 - iBindex = 1;  
1251 - _fnGenerateBcAndSetBc(aLbLpindexes[i], iQindex, iBindex);  
1252 - } else if (iBindex == 1) {  
1253 - iBindex --;  
1254 - _fnGenerateBcAndSetBc(aLbLpindexes[i], iQindex, iBindex);  
1255 - }  
1256 - }  
1257 - }  
1258 - }  
1259 -  
1260 - },  
1261 -  
1262 - /**  
1263 - * 计算末班车。  
1264 - * 1、将上下行拉成上下行两个班次列表(包括标记班次)  
1265 - * 2、分别找出离末班车发车时间最近的班次,并替换时间  
1266 - * 3、删除之后的班次  
1267 - */  
1268 - fnCalcuLastBc: function() {  
1269 - var i;  
1270 - var iTimeDiff;  
1271 - var iTempTime;  
1272 - var aBc;  
1273 - var oLastBcTime;  
1274 - var oLastBcIsUp;  
1275 - var iModifyIndex;  
1276 -  
1277 - // 查找末班车早的末班车时间和方向  
1278 - if (_paramObj.getUpLastDtimeObj().isBefore(_paramObj.getDownLastDTimeObj())) {  
1279 - oLastBcTime = _paramObj.getUpLastDtimeObj();  
1280 - oLastBcIsUp = true;  
1281 - } else {  
1282 - oLastBcTime = _paramObj.getDownLastDTimeObj();  
1283 - oLastBcIsUp = false;  
1284 - }  
1285 -  
1286 - // 确定早的末班车时间  
1287 - aBc = _fnGetBcList(oLastBcIsUp);  
1288 - for (i = 0; i < aBc.length; i++) {  
1289 - iTempTime = oLastBcTime.diff(aBc[i].getFcTimeObj(), "m");  
1290 - if (iTimeDiff == undefined) {  
1291 - iTimeDiff = iTempTime;  
1292 - iModifyIndex = i;  
1293 - } else if (Math.abs(iTempTime) <= Math.abs(iTimeDiff)) {  
1294 - iTimeDiff = iTempTime;  
1295 - iModifyIndex = i;  
1296 - }  
1297 - }  
1298 - aBc[iModifyIndex].addMinuteToFcsj(iTimeDiff); // 替换成末班车时间  
1299 - aBc[iModifyIndex].fnSetDelFlag(false);  
1300 - aBc[iModifyIndex].fnSetIsLastBc(true);  
1301 - for (i = iModifyIndex + 1; i < aBc.length; i++) { // 删除多余班次  
1302 - _qIsUp == oLastBcIsUp ?  
1303 - aBc[i]._$$_internal_group_obj.setBc1(undefined) :  
1304 - aBc[i]._$$_internal_group_obj.setBc2(undefined);  
1305 - }  
1306 -  
1307 - // 查找末班车晚的末班车时间和方向  
1308 - if (_paramObj.getUpLastDtimeObj().isBefore(_paramObj.getDownLastDTimeObj())) {  
1309 - oLastBcTime = _paramObj.getDownLastDTimeObj();  
1310 - oLastBcIsUp = false;  
1311 - } else {  
1312 - oLastBcTime = _paramObj.getUpLastDtimeObj();  
1313 - oLastBcIsUp = true;  
1314 - }  
1315 - // 确定晚的末班车时间  
1316 - aBc = _fnGetBcList(oLastBcIsUp);  
1317 - var oBc;  
1318 - var aBcIndex;  
1319 - var iLpIndex;  
1320 - var iQIndex;  
1321 - var iBcIndex;  
1322 -  
1323 - iTimeDiff = undefined;  
1324 - for (i = 0; i < aBc.length; i++) {  
1325 - oBc = aBc[i];  
1326 - aBcIndex = _fnGetBcIndex(oBc);  
1327 -  
1328 - iLpIndex = aBcIndex[0];  
1329 - iQIndex = aBcIndex[2] == 0 ? aBcIndex[1] -1 : aBcIndex[1];  
1330 - iBcIndex = aBcIndex[2] == 0 ? 1 : 0;  
1331 -  
1332 - if (!_internalLpArray[iLpIndex].getBc(iQIndex, iBcIndex)) {  
1333 - continue;  
1334 - }  
1335 -  
1336 - iTempTime = oLastBcTime.diff(aBc[i].getFcTimeObj(), "m");  
1337 - if (iTimeDiff == undefined) {  
1338 - iTimeDiff = iTempTime;  
1339 - iModifyIndex = i;  
1340 - } else if (Math.abs(iTempTime) <= Math.abs(iTimeDiff)) {  
1341 - iTimeDiff = iTempTime;  
1342 - iModifyIndex = i;  
1343 - }  
1344 - }  
1345 - aBc[iModifyIndex].addMinuteToFcsj(iTimeDiff); // 替换成末班车时间  
1346 - aBc[iModifyIndex].fnSetDelFlag(false);  
1347 - aBc[iModifyIndex].fnSetIsLastBc(true);  
1348 - for (i = iModifyIndex + 1; i < aBc.length; i++) { // 删除多余班次  
1349 - _qIsUp == oLastBcIsUp ?  
1350 - aBc[i]._$$_internal_group_obj.setBc1(undefined) :  
1351 - aBc[i]._$$_internal_group_obj.setBc2(undefined);  
1352 - }  
1353 -  
1354 - },  
1355 -  
1356 - /**  
1357 - * 添加吃饭班次。  
1358 - */  
1359 - fnCalcuEatBc: function() {  
1360 - // 吃午饭时间范围,10:15 到 12:15  
1361 - // 吃晚饭时间范围,18:00 到 19:00  
1362 -  
1363 - if (!_paramObj.fnIsEat()) {  
1364 - return;  
1365 - }  
1366 -  
1367 - // 午饭index  
1368 - var aLEIndex;  
1369 - // 晚饭index  
1370 - var aDEIndex;  
1371 -  
1372 - // 所有吃饭都默认在一个方向,两个方向暂时不考虑  
1373 - if (_paramObj.fnIsUpEat()) {  
1374 - aLEIndex = _internalLpArray[0].getQBcIndexWithFcTime(_paramObj.toTimeObj("10:15"), true, false);  
1375 - aDEIndex = _internalLpArray[0].getQBcIndexWithFcTime(_paramObj.toTimeObj("18:00"), true, false);  
1376 - } else {  
1377 - aLEIndex = _internalLpArray[0].getQBcIndexWithFcTime(_paramObj.toTimeObj("10:15"), false, true);  
1378 - aDEIndex = _internalLpArray[0].getQBcIndexWithFcTime(_paramObj.toTimeObj("18:00"), false, true);  
1379 - }  
1380 -  
1381 - // 午饭第几圈,第几个班次  
1382 - var iLEQIndex = aLEIndex[0];  
1383 - var iLEBIndex = aLEIndex[1];  
1384 - // 晚饭第几圈,第几个班次  
1385 - var iDEQIndex = aDEIndex[0];  
1386 - var iDEBIndex = aDEIndex[1];  
1387 -  
1388 - // 注意,本模型只有连班才有吃饭  
1389 -  
1390 - var i;  
1391 - var oLp;  
1392 - var aLbIndex = []; // 连班班型的路牌索引  
1393 - for (i = 0; i < _internalLpArray.length; i++) {  
1394 - oLp = _internalLpArray[i];  
1395 - if (oLp.isBxLb()) {  
1396 - aLbIndex.push(i);  
1397 - }  
1398 - }  
1399 -  
1400 - var iLTime;  
1401 - var iDtime;  
1402 - var j;  
1403 - for (i = 0; i < aLbIndex.length; i++) {  
1404 - oLp = _internalLpArray[aLbIndex[i]];  
1405 -  
1406 - // 午饭  
1407 - iLTime = oLp.fnAddEatBc(iLEQIndex, iLEBIndex, _factory, _paramObj);  
1408 - // 晚饭  
1409 - iDtime = oLp.fnAddEatBc(iDEQIndex, iDEBIndex, _factory, _paramObj);  
1410 -  
1411 - if (i == aLbIndex.length - 1) {  
1412 - for (j = aLbIndex[i]; j < _internalLpArray.length; j++) {  
1413 - oLp = _internalLpArray[j];  
1414 - if (oLp.isBxFb()) { // 5休2班型不调整  
1415 - // 修正午饭之后路牌班次的发车时间  
1416 - oLp.fnAddMinuteToBcFcsj(iLEQIndex, iLEBIndex, iLTime);  
1417 - oLp.fnAddMinuteToBcFcsj(iDEQIndex, iDEBIndex, iDtime);  
1418 - }  
1419 - }  
1420 - } else {  
1421 - for (j = aLbIndex[i]; j < aLbIndex[i + 1]; j++) {  
1422 - oLp = _internalLpArray[j];  
1423 - if (oLp.isBxFb()) {  
1424 - // 修正午饭之后路牌班次的发车时间  
1425 - oLp.fnAddMinuteToBcFcsj(iLEQIndex, iLEBIndex, iLTime);  
1426 - oLp.fnAddMinuteToBcFcsj(iDEQIndex, iDEBIndex, iDtime);  
1427 - }  
1428 - }  
1429 - }  
1430 - }  
1431 -  
1432 - },  
1433 -  
1434 - /**  
1435 - * 补每个路牌的其他班次(进出场,例保班次)。  
1436 - */  
1437 - fnCalcuOtherBc_: function() {  
1438 - var i;  
1439 - var _lpObj;  
1440 - var _minBcIndex;  
1441 - var _maxBcIndex;  
1442 - var _minBc;  
1443 - var _maxBc;  
1444 - var _otherbc = [];  
1445 - var _oFbbc;  
1446 -  
1447 - for (i = 0; i < _internalLpArray.length; i++) {  
1448 - _lpObj = _internalLpArray[i];  
1449 - _minBcIndex = _lpObj.getMinBcObjPosition();  
1450 - _maxBcIndex = _lpObj.getMaxBcObjPosition();  
1451 - _minBc = _lpObj.getBc(_minBcIndex[0], _minBcIndex[1]);  
1452 - _maxBc = _lpObj.getBc(_maxBcIndex[0], _maxBcIndex[1]);  
1453 -  
1454 - _otherbc = [];  
1455 - _otherbc.push(_factory.createBcObj(  
1456 - _lpObj, "bd", true, 1,  
1457 - _minBc.getFcTimeObj(),  
1458 - _paramObj  
1459 - ));  
1460 - _otherbc.push(_factory.createBcObj(  
1461 - _lpObj, "out", true, 1,  
1462 - _minBc.getFcTimeObj(),  
1463 - _paramObj  
1464 - ));  
1465 -  
1466 - _maxBc.setArrTimeObj(_paramObj.addMinute(_maxBc.getFcTimeObj(), _maxBc.getBcTime()));  
1467 - _maxBc.setStopTime(0);  
1468 - _otherbc.push(_factory.createBcObj(  
1469 - _lpObj, "in", true, 1,  
1470 - _maxBc.getArrTimeObj(),  
1471 - _paramObj  
1472 - ));  
1473 - _otherbc.push(_factory.createBcObj(  
1474 - _lpObj, "lc", true, 1,  
1475 - _maxBc.getArrTimeObj(),  
1476 - _paramObj  
1477 - ));  
1478 -  
1479 - // 5休2分班出场例保班次  
1480 - if (_lpObj.isBxFb5_2()) {  
1481 - _oFbbc = _lpObj.getBc(  
1482 - _lpObj.fnGetBcChainInfo(1)["s_q"],  
1483 - _lpObj.fnGetBcChainInfo(1)["s_b"]  
1484 - );  
1485 -  
1486 - _otherbc.push(_factory.createBcObj(  
1487 - _lpObj, "bd", true, 1,  
1488 - _oFbbc.getFcTimeObj(),  
1489 - _paramObj  
1490 - ));  
1491 - _otherbc.push(_factory.createBcObj(  
1492 - _lpObj, "out", true, 1,  
1493 - _oFbbc.getFcTimeObj(),  
1494 - _paramObj  
1495 - ));  
1496 - }  
1497 -  
1498 - _lpObj.addOtherBcArray(_otherbc);  
1499 - }  
1500 -  
1501 - },  
1502 -  
1503 - /**  
1504 - * 补每个路牌的其他班次(进出场,例保班次)  
1505 - * 所有的车次链前后都加进出场、报道班次  
1506 - */  
1507 - fnCalcuOtherBc: function() {  
1508 - var i;  
1509 - var j;  
1510 - var iBcChainCount;  
1511 - var oLp;  
1512 - var aOtherBc;  
1513 - var oStartBc;  
1514 - var oEndBc;  
1515 -  
1516 - for (i = 0; i < _internalLpArray.length; i++) {  
1517 - aOtherBc = [];  
1518 - oLp = _internalLpArray[i];  
1519 - iBcChainCount = oLp.fnGetBcChainCount();  
1520 -  
1521 - if (iBcChainCount == 1) { // 只有一个车次链,是连班班型  
1522 - // 头部要添加出场,例保班次  
1523 - oStartBc = oLp.getBc(  
1524 - oLp.fnGetBcChainInfo(0)["s_q"],  
1525 - oLp.fnGetBcChainInfo(0)["s_b"]  
1526 - );  
1527 - aOtherBc.push(_factory.createBcObj(  
1528 - oLp, "bd", true, 1,  
1529 - oStartBc.getFcTimeObj(),  
1530 - _paramObj  
1531 - ));  
1532 - aOtherBc.push(_factory.createBcObj(  
1533 - oLp, "out", true, 1,  
1534 - oStartBc.getFcTimeObj(),  
1535 - _paramObj  
1536 - ));  
1537 -  
1538 - // 尾部需添加进场,例保班次  
1539 - oEndBc = oLp.getBc(  
1540 - oLp.fnGetBcChainInfo(0)["e_q"],  
1541 - oLp.fnGetBcChainInfo(0)["e_b"]  
1542 - );  
1543 - aOtherBc.push(_factory.createBcObj(  
1544 - oLp, "in", true, 1,  
1545 - oEndBc.getArrTimeObj(),  
1546 - _paramObj  
1547 - ));  
1548 - aOtherBc.push(_factory.createBcObj(  
1549 - oLp, "lc", true, 1,  
1550 - oEndBc.getArrTimeObj(),  
1551 - _paramObj  
1552 - ));  
1553 - } else if (iBcChainCount == 2) { // 两个车次链,是分班班型  
1554 - // 第一个车次链开头有出场,报到班次,车次链结尾只有进场班次  
1555 - oStartBc = oLp.getBc(  
1556 - oLp.fnGetBcChainInfo(0)["s_q"],  
1557 - oLp.fnGetBcChainInfo(0)["s_b"]  
1558 - );  
1559 - aOtherBc.push(_factory.createBcObj(  
1560 - oLp, "bd", true, 1,  
1561 - oStartBc.getFcTimeObj(),  
1562 - _paramObj  
1563 - ));  
1564 - aOtherBc.push(_factory.createBcObj(  
1565 - oLp, "out", true, 1,  
1566 - oStartBc.getFcTimeObj(),  
1567 - _paramObj  
1568 - ));  
1569 -  
1570 - oEndBc = oLp.getBc(  
1571 - oLp.fnGetBcChainInfo(0)["e_q"],  
1572 - oLp.fnGetBcChainInfo(0)["e_b"]  
1573 - );  
1574 - aOtherBc.push(_factory.createBcObj(  
1575 - oLp, "in", true, 1,  
1576 - oEndBc.getArrTimeObj(),  
1577 - _paramObj  
1578 - ));  
1579 -  
1580 - // 第二个车次链开头只有出场班次,车次链结尾有进场,报到班次  
1581 - oStartBc = oLp.getBc(  
1582 - oLp.fnGetBcChainInfo(1)["s_q"],  
1583 - oLp.fnGetBcChainInfo(1)["s_b"]  
1584 - );  
1585 - aOtherBc.push(_factory.createBcObj(  
1586 - oLp, "out", true, 1,  
1587 - oStartBc.getFcTimeObj(),  
1588 - _paramObj  
1589 - ));  
1590 -  
1591 - oEndBc = oLp.getBc(  
1592 - oLp.fnGetBcChainInfo(1)["e_q"],  
1593 - oLp.fnGetBcChainInfo(1)["e_b"]  
1594 - );  
1595 - aOtherBc.push(_factory.createBcObj(  
1596 - oLp, "in", true, 1,  
1597 - oEndBc.getArrTimeObj(),  
1598 - _paramObj  
1599 - ));  
1600 - aOtherBc.push(_factory.createBcObj(  
1601 - oLp, "lc", true, 1,  
1602 - oEndBc.getArrTimeObj(),  
1603 - _paramObj  
1604 - ));  
1605 -  
1606 -  
1607 - } else {  
1608 - // 2个车次链以上,暂时没有此班型  
1609 - }  
1610 -  
1611 - oLp.addOtherBcArray(aOtherBc);  
1612 - }  
1613 - },  
1614 -  
1615 - /**  
1616 - * 祛除上标线开头的删除标记的班次。  
1617 - */  
1618 - fnRemoveDelFirstFlagBc: function() {  
1619 - var oLp = _internalLpArray[0];  
1620 - var aMinBcIndex = oLp.getMinBcObjPosition();  
1621 - if (oLp.getBc(aMinBcIndex[0], aMinBcIndex[1]).fnIsDelFlag()) {  
1622 - oLp.removeBc(aMinBcIndex[0], aMinBcIndex[1]);  
1623 - }  
1624 - },  
1625 - /**  
1626 - * 祛除上标线结尾的删除标记的班次。  
1627 - */  
1628 - fnRemoveDelLastFlagBc: function() {  
1629 - var oLp = _internalLpArray[0];  
1630 - var aMaxBcIndex = oLp.getMaxBcObjPosition();  
1631 - if (oLp.getBc(aMaxBcIndex[0], aMaxBcIndex[1]).fnIsDelFlag()) {  
1632 - oLp.removeBc(aMaxBcIndex[0], aMaxBcIndex[1]);  
1633 - }  
1634 - },  
1635 -  
1636 - /**  
1637 - * 调整路牌班次间隔(核准周转时间,停站时间)。  
1638 - * @param iFre int 迭代次数  
1639 - */  
1640 - fnAdjustLpBcInterval: function(iFre) {  
1641 - if (iFre > 0) {  
1642 - for (var i = 0; i < _internalLpArray.length; i++) {  
1643 - _internalLpArray[i].fnAdjustBcInterval(  
1644 - this.fnCalcuAverPeakStopTime(),  
1645 - this.fnCalcuAverTroughStopTime(),  
1646 - _paramObj);  
1647 - }  
1648 -  
1649 - this.fnAdjustLpBcInterval(iFre - 1);  
1650 - }  
1651 - },  
1652 -  
1653 - /**  
1654 - * 调整班次间隔。  
1655 - * @param bIsUp 是否上行  
1656 - * @param oStartTime 开始时间对象  
1657 - * @param iFre 迭代次数  
1658 - */  
1659 - fnAdjustBcInterval2_: function(bIsUp, oStartTime, iFre) {  
1660 - if (iFre > 0) {  
1661 - var aBc = _fnGetBcList2(bIsUp, oStartTime); // 指定方向的班次列表  
1662 - aBc.sort(function(o1, o2) {  
1663 - if (o1.getFcTimeObj().isBefore(o2.getFcTimeObj())) {  
1664 - return -1;  
1665 - } else {  
1666 - return 1;  
1667 - }  
1668 - });  
1669 - var i;  
1670 - var j;  
1671 -  
1672 - var iBcCountOfGroup = 3; // 3个班次取一次计算  
1673 - var aBcOfGroup; // 3个班次列表  
1674 - var aBcIntervalOfGroup; // 班次间隔列表,如:3个班次,2个间隔  
1675 -  
1676 - for (i = 0; i <= aBc.length - iBcCountOfGroup; i++) {  
1677 - aBcOfGroup = [];  
1678 - aBcIntervalOfGroup = [];  
1679 - for (j = i; j < i + iBcCountOfGroup; j++) {  
1680 - aBcOfGroup.push(aBc[j]);  
1681 - }  
1682 -  
1683 - for (j = 0; j < aBcOfGroup.length; j++) {  
1684 - if (j < aBcOfGroup.length - 1) {  
1685 - aBcIntervalOfGroup.push(aBcOfGroup[j + 1].getFcTimeObj().diff(  
1686 - aBcOfGroup[j].getFcTimeObj(), "m"));  
1687 - }  
1688 - }  
1689 -  
1690 - if (aBcIntervalOfGroup[0] < 19) {  
1691 - aBcOfGroup[1].addMinuteToFcsj(1);  
1692 - } else if (aBcIntervalOfGroup[0] > 20) {  
1693 - aBcOfGroup[1].addMinuteToFcsj(-1);  
1694 - } else {  
1695 - if (Math.abs(aBcIntervalOfGroup[0] - aBcIntervalOfGroup[1]) <= 1) {  
1696 - //continue;  
1697 - } else if (aBcIntervalOfGroup[0] > aBcIntervalOfGroup[1]) {  
1698 - aBcOfGroup[1].addMinuteToFcsj(-1);  
1699 - } else {  
1700 - aBcOfGroup[1].addMinuteToFcsj(1);  
1701 - }  
1702 - }  
1703 -  
1704 - }  
1705 -  
1706 - this.fnAdjustBcInterval2(bIsUp, oStartTime, iFre - 1);  
1707 - }  
1708 - },  
1709 -  
1710 - /**  
1711 - * 调整班次间隔。  
1712 - * @param boolean isUp 是否上行  
1713 - * @param oStartTime 开始时间对象  
1714 - * @param fre int 迭代次数  
1715 - */  
1716 - fnAdjustBcInterval: function(isUp, oStartTime, fre) {  
1717 - if (fre > 0) {  
1718 - var aBc = !oStartTime ? _fnGetBcList(isUp) : _fnGetBcList2(isUp, oStartTime); // 指定方向的班次列表  
1719 -  
1720 - aBc.sort(function(o1, o2) {  
1721 - if (o1.getFcTimeObj().isBefore(o2.getFcTimeObj())) {  
1722 - return -1;  
1723 - } else {  
1724 - return 1;  
1725 - }  
1726 - });  
1727 -  
1728 - var i;  
1729 - var j;  
1730 -  
1731 - var iBcCountOfGroup = 3; // 3个班次取一次计算  
1732 - var aBcOfGroup; // 3个班次列表  
1733 - var aBcIntervalOfGroup; // 班次间隔列表,如:3个班次,2个间隔  
1734 - var oBcFcTime; // 班次发车时间  
1735 -  
1736 - for (i = 0; i <= aBc.length - iBcCountOfGroup; i++) {  
1737 - aBcOfGroup = [];  
1738 - aBcIntervalOfGroup = [];  
1739 - for (j = i; j < i + iBcCountOfGroup; j++) {  
1740 - aBcOfGroup.push(aBc[j]);  
1741 - }  
1742 -  
1743 - for (j = 0; j < aBcOfGroup.length; j++) {  
1744 - if (j < aBcOfGroup.length - 1) {  
1745 - aBcIntervalOfGroup.push(aBcOfGroup[j + 1].getFcTimeObj().diff(  
1746 - aBcOfGroup[j].getFcTimeObj(), "m"));  
1747 - }  
1748 - }  
1749 -  
1750 - // 判定规则  
1751 - oBcFcTime = aBcOfGroup[1].getFcTimeObj();  
1752 -  
1753 - // 第一个班次发车时间不动,根据间隔,调整中间一个班次  
1754 - // 如果3个班次2个间隔时间差1分钟,不调整  
1755 - // 如果第一个间隔大,调整第二个班次往前1分钟  
1756 - // 如果第二个间隔大,调整第二个班次往后1分钟  
1757 -  
1758 - if (_paramObj.isTroughBc(oBcFcTime) &&  
1759 - aBcIntervalOfGroup[0] > _paramObj.getTroughMaxFcjx()) {  
1760 - aBcOfGroup[1].addMinuteToFcsj(-1);  
1761 - }  
1762 -  
1763 - //else if (_paramObj.isMPeakBc(oBcFcTime) &&  
1764 - // aBcIntervalOfGroup[0] < _paramObj.getMPeakMinFcjx()) {  
1765 - // aBcOfGroup[1].addMinuteToFcsj(1);  
1766 - //} else if (_paramObj.isMPeakBc(oBcFcTime) &&  
1767 - // aBcIntervalOfGroup[0] > _paramObj.getMPeakMaxFcjx()) {  
1768 - // aBcOfGroup[1].addMinuteToFcsj(-1);  
1769 - //} else if (_paramObj.isEPeakBc(oBcFcTime) &&  
1770 - // aBcIntervalOfGroup[0] < _paramObj.getEPeakMinFcjx()) {  
1771 - // aBcOfGroup[1].addMinuteToFcsj(1);  
1772 - //} else if (_paramObj.isEPeakBc(oBcFcTime) &&  
1773 - // aBcIntervalOfGroup[0] > _paramObj.getEPeakMaxFcjx()) {  
1774 - // aBcOfGroup[1].addMinuteToFcsj(-1);  
1775 - //}  
1776 -  
1777 -  
1778 - else {  
1779 - if (Math.abs(aBcIntervalOfGroup[0] - aBcIntervalOfGroup[1]) <= 1) {  
1780 - //continue;  
1781 - } else if (aBcIntervalOfGroup[0] > aBcIntervalOfGroup[1]) {  
1782 - aBcOfGroup[1].addMinuteToFcsj(-1);  
1783 - } else {  
1784 - aBcOfGroup[1].addMinuteToFcsj(1);  
1785 - }  
1786 - }  
1787 -  
1788 - //if (Math.abs(aBcIntervalOfGroup[0] - aBcIntervalOfGroup[1]) <= 1) {  
1789 - // //continue;  
1790 - //} else if (aBcIntervalOfGroup[0] > aBcIntervalOfGroup[1]) {  
1791 - // aBcOfGroup[1].addMinuteToFcsj(-1);  
1792 - //} else {  
1793 - // aBcOfGroup[1].addMinuteToFcsj(1);  
1794 - //}  
1795 -  
1796 -  
1797 - }  
1798 -  
1799 - this.fnAdjustBcInterval(isUp, oStartTime, fre - 1);  
1800 - }  
1801 -  
1802 - },  
1803 -  
1804 - /**  
1805 - * 调整班次间隔(平均间隔)。  
1806 - * @param bIsUp 是否上行  
1807 - * @param oStartTime 开始时间对象  
1808 - */  
1809 - fnAdjustBcInterval2_avg: function(bIsUp, oStartTime) {  
1810 - var aBc = !oStartTime ? _fnGetBcList(bIsUp) : _fnGetBcList2(bIsUp, oStartTime); // 指定方向的班次列表  
1811 - aBc.sort(function(o1, o2) {  
1812 - if (o1.getFcTimeObj().isBefore(o2.getFcTimeObj())) {  
1813 - return -1;  
1814 - } else {  
1815 - return 1;  
1816 - }  
1817 - });  
1818 -  
1819 - var j;  
1820 - var iCount = aBc.length - 1;  
1821 - var iC1 = Math.floor(aBc[aBc.length - 1].getFcTimeObj().diff(aBc[0].getFcTimeObj(), "m") / iCount);  
1822 - var iC2 = aBc[aBc.length - 1].getFcTimeObj().diff(aBc[0].getFcTimeObj(), "m") % iCount;  
1823 - var iTempTime;  
1824 -  
1825 - for (j = 0; j < iCount - iC2; j++) {  
1826 - iTempTime = aBc[j + 1].getFcTimeObj().diff(aBc[j].getFcTimeObj(), "m");  
1827 - aBc[j + 1].addMinuteToFcsj(iC1 - iTempTime);  
1828 - }  
1829 - for (j = 0; j < iC2; j++) {  
1830 - iTempTime = aBc[iCount - iC2 + j + 1].getFcTimeObj().diff(aBc[iCount - iC2 + j].getFcTimeObj(), "m");  
1831 - aBc[iCount - iC2 + j + 1].addMinuteToFcsj(iC1 + 1 - iTempTime);  
1832 - }  
1833 -  
1834 - },  
1835 -  
1836 - /**  
1837 - * 计算高峰平均停站时间。  
1838 - */  
1839 - fnCalcuAverPeakStopTime: function() {  
1840 - var i;  
1841 - var j;  
1842 - var aBc;  
1843 - var iBcCount = 0;  
1844 - var iSum = 0;  
1845 - for (i = 0; i < _internalLpArray.length; i++) {  
1846 - aBc = _internalLpArray[i].getBcArray();  
1847 -  
1848 - for (j = 0; j < aBc.length; j++) {  
1849 - if (!_paramObj.isTroughBc(aBc[j].getArrTimeObj())) {  
1850 - iBcCount ++;  
1851 - iSum += aBc[j].getStopTime();  
1852 - }  
1853 - }  
1854 - }  
1855 -  
1856 - return Math.floor(iSum / iBcCount);  
1857 - },  
1858 -  
1859 - /**  
1860 - * 计算低谷平均停站时间。  
1861 - */  
1862 - fnCalcuAverTroughStopTime: function() {  
1863 - var i;  
1864 - var j;  
1865 - var aBc;  
1866 - var iBcCount = 0;  
1867 - var iSum = 0;  
1868 - for (i = 0; i < _internalLpArray.length; i++) {  
1869 - aBc = _internalLpArray[i].getBcArray();  
1870 - for (j = 0; j < aBc.length; j++) {  
1871 - if (_paramObj.isTroughBc(aBc[j].getArrTimeObj())) {  
1872 - iBcCount ++;  
1873 - iSum += aBc[j].getStopTime();  
1874 - }  
1875 - }  
1876 - }  
1877 -  
1878 - return Math.floor(iSum / iBcCount);  
1879 - },  
1880 -  
1881 - //------------- 其他方法 -------------//  
1882 - /**  
1883 - * 返回内部路牌数据列表。  
1884 - * @returns {Array}  
1885 - */  
1886 - fnGetLpArray: function() {  
1887 - return _internalLpArray;  
1888 - },  
1889 -  
1890 - /**  
1891 - * 内部数据转化成显示用的班次数组。  
1892 - */  
1893 - fnToGanttBcArray: function() {  
1894 - var aAllBc = [];  
1895 - var aLpBc = [];  
1896 - var aEatBc = [];  
1897 - var oLp;  
1898 - var i;  
1899 - var j;  
1900 -  
1901 - for (i = 0; i < _internalLpArray.length; i++) {  
1902 - oLp = _internalLpArray[i];  
1903 - aLpBc = [];  
1904 - aLpBc = aLpBc.concat(oLp.getOtherBcArray(), oLp.getBcArray());  
1905 -  
1906 - aEatBc = [];  
1907 - // 根据班次的吃饭时间添加吃饭班次  
1908 - for (j = 0; j < aLpBc.length; j++) {  
1909 - if (aLpBc[j].fnGetEatTime() > 0) {  
1910 - aEatBc.push(_factory.createBcObj(  
1911 - oLp,  
1912 - "cf",  
1913 - !aLpBc[j].isUp(), // 和上一个班次方向相反  
1914 - 1,  
1915 - _paramObj.addMinute(aLpBc[j].getArrTimeObj(), aLpBc[j].getStopTime()), // 使用上一个班次的到达时间作为开始时间  
1916 - _paramObj  
1917 - ));  
1918 - }  
1919 - }  
1920 - aLpBc = aLpBc.concat(aEatBc);  
1921 -  
1922 - // 按照发车时间排序  
1923 - aLpBc.sort(function(o1, o2) {  
1924 - if (o1.getFcTimeObj().isBefore(o2.getFcTimeObj())) {  
1925 - return -1;  
1926 - } else {  
1927 - return 1;  
1928 - }  
1929 - });  
1930 -  
1931 - // 重新赋值fcno  
1932 - for (j = 0; j < aLpBc.length; j++) {  
1933 - aLpBc[j].fnSetFcno(j + 1);  
1934 - }  
1935 -  
1936 - aAllBc = aAllBc.concat(aLpBc);  
1937 - }  
1938 -  
1939 - var aGanttBc = [];  
1940 - for (i = 0; i < aAllBc.length; i++) {  
1941 - aGanttBc.push(aAllBc[i].toGanttBcObj());  
1942 - }  
1943 -  
1944 - return aGanttBc;  
1945 - }  
1946 -  
1947 - };  
1948 - 1 +/**
  2 + * 内部行车计划对象。
  3 + * @constructor
  4 + */
  5 +var InternalScheduleObj = function(paramObj, lpArray, factory) {
  6 + // 参数对象
  7 + var _paramObj = paramObj;
  8 + // 外部的路牌数组
  9 + var _lpArray = lpArray;
  10 + // 工厂对象
  11 + var _factory = factory;
  12 +
  13 + //------------------ 初始化方法1,以及计算关联的内部变量 -----------------//
  14 + var _qIsUp; // 每一圈是上行开始还是下行开始
  15 + var _qCount = 0; // 总的圈数
  16 + var _internalLpArray = []; // 内部对象数组
  17 + var _aBxDesc = [ // 各种班型描述(班型名称,平均工时,平均需要的班次数,平均工时)
  18 + {'sType':'六工一休', 'fHoursV':6.66, 'fBcCount': 0, 'fAverTime': 0},
  19 + {'sType':'五工一休', 'fHoursV':6.85, 'fBcCount': 0, 'fAverTime': 0},
  20 + {'sType':'四工一休', 'fHoursV':7.14, 'fBcCount': 0, 'fAverTime': 0},
  21 + {'sType':'三工一休', 'fHoursV':7.61, 'fBcCount': 0, 'fAverTime': 0},
  22 + {'sType':'二工一休', 'fHoursV':8.57, 'fBcCount': 0, 'fAverTime': 0},
  23 + {'sType':'一工一休', 'fHoursV':11.42, 'fBcCount': 0, 'fAverTime': 0},
  24 + {'sType':'五工二休', 'fHoursV':7.99, 'fBcCount': 0, 'fAverTime': 0},
  25 + {'sType':'无工休', 'fHoursV':5.43, 'fBcCount': 0, 'fAverTime': 0}
  26 + ];
  27 +
  28 + var _fnInitFun1 = function() { // 初始化方法1
  29 + console.log("//---------------- 行车计划,初始化方法1 start ----------------//");
  30 +
  31 + //----------------------- 1、确定上标线的方向,圈的方向 -------------------//
  32 +
  33 + // 确定_qIsUp,哪个方向的首班车晚就用哪个
  34 + _qIsUp = _paramObj.getUpFirstDTimeObj().isBefore(
  35 + _paramObj.getDownFirstDTimeObj()) ? false : true;
  36 + // 上标线开始时间,就是方向的首班车时间
  37 + var st = _qIsUp ? _paramObj.getUpFirstDTimeObj() : _paramObj.getDownFirstDTimeObj();
  38 + // 上标线结束时间,使用最晚的末班车时间,结束时间的班次方向
  39 + var et;
  40 + var et_IsUp;
  41 + if (_paramObj.getUpLastDtimeObj().isBefore(
  42 + _paramObj.getDownLastDTimeObj())) {
  43 + et = _paramObj.getDownLastDTimeObj();
  44 + et_IsUp = false;
  45 + } else {
  46 + et = _paramObj.getUpLastDtimeObj();
  47 + et_IsUp = true;
  48 + }
  49 +
  50 + //------------------------ 2、计算总共有多少圈 ------------------------//
  51 +
  52 + // 以开始时间,结束时间,构造上标线用连班班次发车时间
  53 + var bcFcsjArrays = []; // 班次发车时间对象数组
  54 + var bcArsjArrays = []; // 班次到达时间对象数组
  55 + var isUp = _qIsUp; // 方向
  56 + var bcCount = 1; // 班次数
  57 +
  58 + var _kssj = st; // 开始时间
  59 + var _bcsj = paramObj.calcuTravelTime(_kssj, isUp); // 班次历时
  60 + var _arrsj = paramObj.addMinute(_kssj, _bcsj); // 到达时间
  61 + var _stoptime = paramObj.fnCalcuFixedStopNumber(_arrsj, !isUp, _bcsj); // 停站时间
  62 +
  63 + do {
  64 + bcFcsjArrays.push(_kssj);
  65 + bcArsjArrays.push(_arrsj);
  66 +
  67 + _kssj = paramObj.addMinute(_kssj, _bcsj + _stoptime);
  68 + _bcsj = paramObj.calcuTravelTime(_kssj, isUp);
  69 + _arrsj = paramObj.addMinute(_kssj, _bcsj);
  70 + _stoptime = paramObj.fnCalcuFixedStopNumber(_arrsj, !isUp, _bcsj);
  71 +
  72 + bcCount ++;
  73 + isUp = !isUp;
  74 + } while(_kssj.isBefore(et));
  75 + bcCount--; // 因为先做do,所以总的班次要减1
  76 + //if (bcCount > 0 && bcArsjArrays[bcCount - 1].isAfter(et)) {
  77 + // // 如果最后一个班次的到达时间超过结束时间,也要去除
  78 + // bcFcsjArrays.splice(bcCount - 1, 1);
  79 + // bcArsjArrays.splice(bcCount - 1, 1);
  80 + // bcCount--;
  81 + //}
  82 + var _qCount_p1 = Math.floor(bcCount / 2); // 2个班次一圈
  83 + var _qCount_p2 = bcCount % 2; // 余下的1个班次也算一圈
  84 +
  85 + // 利用连班数组计算圈数
  86 + _qCount = 1; // 前面加1圈,补中标线的班次
  87 + _qCount += _qCount_p1;
  88 + _qCount += _qCount_p2;
  89 +
  90 + // 计算最后是不是还要补一圈
  91 + if (_qCount > 1) { // 总的圈数就1圈,没必要加了(其实是不可能的,除非参数里问题)
  92 + if (_qCount_p2 == 0) { // 没有余下班次,整数圈数
  93 + // 最后一个班次的方向一定和开始的方向相反,如:上-下,上-下,上-下,一共三圈,最后一个班次为下行
  94 + // 判定最后一个班次的方向和上标线判定结束时间的班次方向是否一致
  95 + if (!_qIsUp == et_IsUp) {
  96 + // 一致不用加圈数
  97 + } else {
  98 + // 不一致需要加圈补最后一个结束时间班次
  99 + _qCount ++;
  100 + }
  101 + } else {
  102 + // 有余下的圈数,最后要不补的班次不管上行,下行都在这一圈里
  103 + // 不需要在补圈数了
  104 + }
  105 + }
  106 +
  107 + //------------------------ 3、根据路牌数,圈数创建路牌对象 ----------------------//
  108 +
  109 + // 创建内部的路牌数组,并把之前的连班路牌添加进上标线路牌中
  110 + var i;
  111 + for (i = 0; i < _lpArray.length; i++) {
  112 + _internalLpArray.push(new InternalLpObj(_lpArray[i], _qCount, _qIsUp));
  113 + }
  114 + // 初始化上标线,从第1圈开始
  115 + _internalLpArray[0].initDataFromTimeToTime(bcFcsjArrays[0], et, _qIsUp, 1, _paramObj, _factory);
  116 +
  117 + // 以上标线为基础,计算各种班型工时对应的圈数、班次数
  118 + var aBcArray = _internalLpArray[0].getBcArray();
  119 + aBcArray[0].fnSetIsFirstBc(true); // 设置首班班次标识
  120 +
  121 + if (aBcArray.length % 2 != 0) { // 不能整除2,去除一个班次计算
  122 + aBcArray.splice(aBcArray.length - 1, 1);
  123 + }
  124 +
  125 + // 午饭吃饭时间
  126 + var iLTime = _paramObj.fnGetLunchTime();
  127 + // 晚饭吃饭时间
  128 + var iDTime = _paramObj.fnGetDinnerTime();
  129 + // 出场时间
  130 + var iOutTime = _qIsUp ? _paramObj.getUpOutTime() : _paramObj.getDownOutTime();
  131 + // 进场时间
  132 + var iInTime = _qIsUp ? _paramObj.getDownInTime() : _paramObj.getUpInTime();
  133 + // 例保时间
  134 + var iBTime = _paramObj.getLbTime();
  135 +
  136 + var sum = 0; // 总班次时间
  137 + for (i = 0; i < aBcArray.length; i++) {
  138 + sum += aBcArray[i].getBcTime() + aBcArray[i].getStopTime();
  139 + }
  140 + sum += iLTime; // 加午饭时间
  141 + sum += iDTime; // 加晚饭时间
  142 + for (i = 0; i < _aBxDesc.length; i++) {
  143 + _aBxDesc[i].fAverTime = sum / (aBcArray.length / 2); // 平均周转时间不算进出场,例保时间
  144 +
  145 + // 计算5休2的班次数(双进出场,4个例保)
  146 + if (i == 6) {
  147 + _aBxDesc[i].fQCount =
  148 + (_aBxDesc[i].fHoursV * 60 - iOutTime * 2 - iInTime * 2 - iBTime * 4) /
  149 + _aBxDesc[i].fAverTime;
  150 + _aBxDesc[i].fBcCount = _aBxDesc[i].fQCount * 2;
  151 + } else { // 进出场,2个例保
  152 + _aBxDesc[i].fQCount =
  153 + (_aBxDesc[i].fHoursV * 60 - iOutTime - iInTime - iBTime * 2) /
  154 + _aBxDesc[i].fAverTime;
  155 + _aBxDesc[i].fBcCount = _aBxDesc[i].fQCount * 2;
  156 + }
  157 + }
  158 +
  159 +
  160 + // 在第一个班次之前再添加一个模拟班次,用于中标线的作用
  161 + // 那一圈必定是低谷,而且圈索引0,班次索引1,暂时标记,最后删除
  162 + var iFirstStopTime =
  163 + _paramObj.fnCalcuFixedStopNumber(
  164 + _paramObj.addMinute(aBcArray[0].getFcTimeObj(), -10),
  165 + _qIsUp
  166 + );
  167 + var iXXTime = _qIsUp ? _paramObj.getDownTroughTime() : _paramObj.getUpTroughTime();
  168 + var oFlagBc = _factory.createBcObj( // 标记班次
  169 + _internalLpArray[0],
  170 + "normal",
  171 + !_qIsUp,
  172 + 1,
  173 + _paramObj.addMinute(aBcArray[0].getFcTimeObj(), -(iFirstStopTime + iXXTime)),
  174 + _paramObj
  175 + );
  176 + oFlagBc.fnSetDelFlag(true); // 标记了删除记号
  177 +
  178 + _internalLpArray[0].setBc(0, 1, oFlagBc);
  179 +
  180 + // 在最后一圈也补上一个或者2个模拟班次,暂时标记,最后需要删除
  181 + var aMaxBcIndex = _internalLpArray[0].getMaxBcObjPosition();
  182 + if (aMaxBcIndex[0] == _qCount - 1) { // 可能加半圈
  183 + oFlagBc = _factory.createBcObj( // 标记班次
  184 + _internalLpArray[0],
  185 + "normal",
  186 + !_qIsUp,
  187 + 1,
  188 + _paramObj.addMinute(
  189 + _internalLpArray[0].getBc(_qCount - 1, 0).getArrTimeObj(),
  190 + _internalLpArray[0].getBc(_qCount - 1, 0).getStopTime()),
  191 + _paramObj
  192 + );
  193 + oFlagBc.fnSetDelFlag(true); // 标记了删除记号
  194 + _internalLpArray[0].setBc(_qCount - 1, 1, oFlagBc);
  195 +
  196 + } else { // 加完整的一圈
  197 + oFlagBc = _factory.createBcObj( // 标记班次
  198 + _internalLpArray[0],
  199 + "normal",
  200 + _qIsUp,
  201 + 1,
  202 + _paramObj.addMinute(
  203 + _internalLpArray[0].getBc(_qCount - 2, 1).getArrTimeObj(),
  204 + _internalLpArray[0].getBc(_qCount - 2, 1).getStopTime()),
  205 + _paramObj
  206 + );
  207 + oFlagBc.fnSetDelFlag(true); // 标记了删除记号
  208 + _internalLpArray[0].setBc(_qCount - 1, 0, oFlagBc);
  209 +
  210 + oFlagBc = _factory.createBcObj( // 标记班次
  211 + _internalLpArray[0],
  212 + "normal",
  213 + !_qIsUp,
  214 + 1,
  215 + _paramObj.addMinute(
  216 + _internalLpArray[0].getBc(_qCount - 1, 0).getArrTimeObj(),
  217 + _internalLpArray[0].getBc(_qCount - 1, 0).getStopTime()),
  218 + _paramObj
  219 + );
  220 + oFlagBc.fnSetDelFlag(true); // 标记了删除记号
  221 + _internalLpArray[0].setBc(_qCount - 1, 1, oFlagBc);
  222 +
  223 + }
  224 +
  225 + console.log("上行首班车时间:" + _paramObj.getUpFirstDTimeObj().format("HH:mm") +
  226 + "上行末班车时间:" + _paramObj.getUpLastDtimeObj().format("HH:mm"));
  227 + console.log("下行首班车时间:" + _paramObj.getDownFirstDTimeObj().format("HH:mm") +
  228 + "下行末班车时间:" + _paramObj.getDownLastDTimeObj().format("HH:mm"));
  229 + console.log("总共计算的圈数:" + _qCount);
  230 + console.log("圈的方向isUP:" + _qIsUp);
  231 + console.log("班型描述(以下):");
  232 + console.log(_aBxDesc);
  233 + console.log("所有路牌间隔描述(以下):");
  234 + for (i = 0; i < _internalLpArray.length; i++) {
  235 + console.log(_internalLpArray[i]._$_aVerticalIntervalTime);
  236 + }
  237 + console.log("//---------------- 行车计划,初始化方法1 end ----------------//");
  238 +
  239 + };
  240 +
  241 + //------------------ 初始化方法2,以及计算关联的内部变量 ----------------//
  242 + var _approximate_zgfQIndex; // 预估早高峰车辆从第几圈开始全部发出
  243 + var _approximate_zgfBIndex; // 预估早高峰车辆从第几圈第几个班次开始全部发出(上行或下行)
  244 + var _approximate_wgfQIndex; // 预估晚高峰车辆从第几圈开始全部发出
  245 + var _approximate_wgfBIndex; // 预估晚高峰车辆从第几圈第几个班次开始全部发出(上行或下行)
  246 +
  247 + var _fnInitFun2 = function() { // 初始化方法2
  248 + console.log("//---------------- 行车计划,初始化方法2 start ----------------//");
  249 +
  250 + //------------------------ 1、计算车辆总数 ------------------------//
  251 + // 是用高峰上行周转时间除以高峰平均间隔得到的
  252 + // 这样算还算合理,车辆不多不少,待以后有新的算法再修正
  253 + var iClCount = _paramObj.calcuClzx();
  254 +
  255 + //------------------------ 2、计算所有路牌的发车在各个圈中的间隔 --------------------//
  256 + var i;
  257 + var j;
  258 + var iBindex = 1;
  259 + var iZzsj;
  260 + var oLp;
  261 + var iC1;
  262 + var iC2;
  263 +
  264 + for (i = 0; i < _qCount - 1; i++) {
  265 + while (iBindex <= 1) {
  266 + // 每圈每个方向的周转时间不一致,以上标线为主
  267 + oLp = _internalLpArray[0];
  268 + iZzsj = oLp.getBc(i + 1, iBindex).getFcTimeObj().diff(
  269 + oLp.getBc(i, iBindex).getFcTimeObj(), "m"
  270 + );
  271 +
  272 + iC1 = Math.floor(iZzsj / iClCount);
  273 + iC2 = iZzsj % iClCount;
  274 +
  275 + for (j = 0; j < iClCount - iC2; j++) {
  276 + oLp = _internalLpArray[j];
  277 + oLp.fnSetVerticalIntervalTime(i, iBindex, iC1);
  278 + }
  279 +
  280 + for (j = 0; j < iC2; j++) {
  281 + oLp = _internalLpArray[iClCount - iC2 + j];
  282 + oLp.fnSetVerticalIntervalTime(i, iBindex, iC1 + 1);
  283 + }
  284 +
  285 + iBindex ++;
  286 +
  287 + }
  288 + iBindex = 0;
  289 + }
  290 + // 最后一圈没有下一圈的参照,周转时间没发获取,由于都是低谷,所以使用倒数第二圈的间隔最为最后一圈的间隔
  291 + for (i = 0; i < _internalLpArray.length; i++) {
  292 + oLp = _internalLpArray[i];
  293 + oLp.fnSetVerticalIntervalTime(_qCount - 1, 0, oLp.fnGetVerticalIntervalTime(_qCount - 2, 0));
  294 + oLp.fnSetVerticalIntervalTime(_qCount - 1, 1, oLp.fnGetVerticalIntervalTime(_qCount - 2, 1));
  295 + }
  296 +
  297 + //------------------------ 3、预估早高峰全部出车第几圈第几个班次全部出车,计算路牌之间的发车间隔 ------------------//
  298 +
  299 + // 以上标线为标准,查找离早高峰开始时间最近的班次作为早高峰开始班次
  300 + // 以这个班次为早高峰起点,全部出车策略
  301 + var qbcIndexArray = _internalLpArray[0].getQBcIndexWithFcTime(
  302 + _paramObj.getMPeakStartTimeObj(), true, true);
  303 + var qIndex = qbcIndexArray[0]; // 第几圈
  304 + var bIndex = qbcIndexArray[1]; // 第几个班次
  305 +
  306 + for (i = 1; i < _internalLpArray.length; i++) {
  307 + _fnGenerateBcAndSetBc(i, qIndex, bIndex);
  308 + }
  309 +
  310 + _approximate_zgfQIndex = qIndex;
  311 + _approximate_zgfBIndex = bIndex;
  312 +
  313 + //------------------------ 4、预估晚高峰全部出车第几圈第几个班次全部出车,计算路牌之间的发车间隔 ------------------//
  314 +
  315 + // 以上标线为标准,查找离晚高峰开始时间最近的班次作为晚高峰开始班次
  316 + // 以这个班次为早高峰起点,全部出车策略
  317 + qbcIndexArray = _internalLpArray[0].getQBcIndexWithFcTime(
  318 + _paramObj.getEPeakStartTimeObj(), true, true);
  319 + qIndex = qbcIndexArray[0]; // 第几圈
  320 + bIndex = qbcIndexArray[1]; // 第几个班次
  321 +
  322 + for (i = 1; i < _internalLpArray.length; i++) {
  323 + _fnGenerateBcAndSetBc(i, qIndex, bIndex);
  324 + }
  325 +
  326 + _approximate_wgfQIndex = qIndex;
  327 + _approximate_wgfBIndex = bIndex;
  328 +
  329 + console.log("早高峰周转时间(固定最大停战时间):" + _paramObj.calcuPeakZzsj() + "分钟");
  330 + console.log("早高峰发车时间范围:" + _paramObj.getMPeakMinFcjx() + "分钟 --- " + _paramObj.getMPeakMaxFcjx() + "分钟");
  331 + console.log("预估早高峰第" + _approximate_zgfQIndex + "(index)圈,第" + _approximate_zgfBIndex + "(index)班次车辆全部发出");
  332 + console.log("预估晚高峰第" + _approximate_wgfQIndex + "(index)圈,第" + _approximate_wgfBIndex + "(index)班次车辆全部发出");
  333 + console.log("//---------------- 行车计划,初始化方法2 end ----------------//");
  334 + };
  335 +
  336 + //----------------------- 初始化方法3,计算连班分班的路牌分布 ----------------//
  337 + var _iBx_lb_lpcount; // 连班路牌数
  338 + var _iBx_5_2_fb_lpcount; // 5休2分班路牌数
  339 + var _iBx_other_fb_lpcount; // 其他分班路牌数
  340 +
  341 + var _fnInitFun3 = function() { // 初始化方法3
  342 + console.log("//---------------- 行车计划,初始化方法3 start ----------------//");
  343 +
  344 + //--------------------- 1、计算分班连班班型车辆分布数 --------------------//
  345 + // 总共车辆数(高峰最大车辆数)
  346 + var iCls = _paramObj.calcuClzx();
  347 + // 低谷最少配车(连班车数量)
  348 + var iDgminpc = Math.round(_paramObj.calcuTroughZzsj() / _paramObj.getTroughMaxFcjx());
  349 + // 加班车路牌数(做5休2的路牌数)
  350 + var i_5_2_lpes = _paramObj.getJBLpes();
  351 +
  352 + // 做些简单的验证
  353 + if (iCls < iDgminpc) {
  354 + alert("总配车数小于低谷最小配车");
  355 + throw "总配车数小于低谷最小配车";
  356 + }
  357 + if (iDgminpc < 2) {
  358 + alert("连班路牌小于2,办不到啊");
  359 + throw "连班路牌小于2,办不到啊";
  360 + }
  361 + if (iCls - iDgminpc < i_5_2_lpes) {
  362 + alert("总分班路牌数小于加班路牌数");
  363 + throw "总分班路牌数小于加班路牌数";
  364 + }
  365 +
  366 + //// 修正连班路牌数,班次间隔大于20的,加1,直至班次间隔小于20
  367 + //while(_paramObj.calcuPeakZzsj() / iDgminpc > 20) {
  368 + // iDgminpc ++;
  369 + //}
  370 + _iBx_lb_lpcount = iDgminpc;
  371 +
  372 + _iBx_5_2_fb_lpcount = i_5_2_lpes;
  373 + _iBx_other_fb_lpcount = iCls - _iBx_lb_lpcount - i_5_2_lpes;
  374 +
  375 + //------------------------ 2、利用间隔法计算连班路牌分布 --------------------//
  376 + var i;
  377 + var j;
  378 + var iC1 = Math.floor(_internalLpArray.length / _iBx_lb_lpcount);
  379 + var iC2 = _internalLpArray.length % _iBx_lb_lpcount;
  380 + var iLpIndex;
  381 +
  382 + for (i = 0; i < _iBx_lb_lpcount - iC2; i++) {
  383 + iLpIndex = i * iC1;
  384 + _internalLpArray[iLpIndex].setBxLb(true);
  385 + _internalLpArray[iLpIndex].setBxDesc("连班");
  386 + }
  387 + for (j = 0; j < iC2; j++) {
  388 + iLpIndex = i * iC1 + j * (iC1 + 1);
  389 + _internalLpArray[iLpIndex].setBxLb(true);
  390 + _internalLpArray[iLpIndex].setBxDesc("连班");
  391 + }
  392 +
  393 + //------------------------ 3、利用间隔法计算分班班型路牌分布 --------------------//
  394 + // 获取分班路牌索引
  395 + var aNotLbIndexes = [];
  396 + for (i = 0; i < _internalLpArray.length; i++) {
  397 + if (!_internalLpArray[i].isBxLb()) {
  398 + aNotLbIndexes.push(i);
  399 + }
  400 + }
  401 + // 先5休2分班
  402 + iC1 = Math.floor(aNotLbIndexes.length / _iBx_5_2_fb_lpcount);
  403 + iC2 = aNotLbIndexes.length % _iBx_5_2_fb_lpcount;
  404 +
  405 + for (i = 0; i < _iBx_5_2_fb_lpcount - iC2; i++) {
  406 + iLpIndex = aNotLbIndexes[i * iC1];
  407 + _internalLpArray[iLpIndex].setBxLb(false);
  408 + _internalLpArray[iLpIndex].setBxFb(true);
  409 + _internalLpArray[iLpIndex].setBxFb5_2(true);
  410 + _internalLpArray[iLpIndex].setBxDesc("5休2分班");
  411 + }
  412 + for (i = 0; i < iC2; i++) {
  413 + iLpIndex = aNotLbIndexes[_iBx_5_2_fb_lpcount - iC2 + i * (iC1 + 1)];
  414 + _internalLpArray[iLpIndex].setBxLb(false);
  415 + _internalLpArray[iLpIndex].setBxFb(true);
  416 + _internalLpArray[iLpIndex].setBxFb5_2(true);
  417 + _internalLpArray[iLpIndex].setBxDesc("5休2分班");
  418 + }
  419 + // 其他分班
  420 + for (i = 0; i < aNotLbIndexes.length; i++) {
  421 + iLpIndex = aNotLbIndexes[i];
  422 + if (!_internalLpArray[iLpIndex].isBxFb5_2()) {
  423 + _internalLpArray[iLpIndex].setBxLb(false);
  424 + _internalLpArray[iLpIndex].setBxFb(true);
  425 + _internalLpArray[iLpIndex].setBxFb5_2(false);
  426 + _internalLpArray[iLpIndex].setBxDesc("其他分班");
  427 + }
  428 + }
  429 +
  430 + console.log("高峰周转时间:" + _paramObj.calcuPeakZzsj());
  431 + console.log("连班路牌数:" + _iBx_lb_lpcount);
  432 + console.log("5休2分班路牌数:" + _iBx_5_2_fb_lpcount);
  433 + console.log("其他分班路牌数:" + _iBx_other_fb_lpcount);
  434 + var aLbIndexes = [];
  435 + for (i = 0; i < _internalLpArray.length; i++) {
  436 + if (_internalLpArray[i].isBxLb()) {
  437 + aLbIndexes.push(i);
  438 + }
  439 + }
  440 + console.log("连班路牌indexes=" + aLbIndexes);
  441 + var a_5_2_fbIndexes = [];
  442 + for (i = 0; i < _internalLpArray.length; i++) {
  443 + if (_internalLpArray[i].isBxFb() && _internalLpArray[i].isBxFb5_2()) {
  444 + a_5_2_fbIndexes.push(i);
  445 + }
  446 + }
  447 + console.log("5休2分班路牌indexes=" + a_5_2_fbIndexes);
  448 + var a_other_fbIndexes = [];
  449 + for (i = 0; i < _internalLpArray.length; i++) {
  450 + if (_internalLpArray[i].isBxFb() && !_internalLpArray[i].isBxFb5_2()) {
  451 + a_other_fbIndexes.push(i);
  452 + }
  453 + }
  454 + console.log("其他分班路牌indexes=" + a_other_fbIndexes);
  455 +
  456 + console.log("//---------------- 行车计划,初始化方法3 end ----------------//");
  457 + };
  458 +
  459 + //----------------------- 初始化方法4,计算中标线位置 -------------------------//
  460 + var _iZbx_lpIndex; // 中标线对应第几个路牌
  461 +
  462 + var _fnInitFun4 = function() { // 初始化方法4
  463 + console.log("//---------------- 行车计划,初始化方法4 start ----------------//");
  464 +
  465 + //---------------------------- 1、模拟一个中标线,使用临时路牌 ----------------------//
  466 + // 构造中标线
  467 + // 中标线开始时间,就是方向的首班车时间
  468 + var oSt = !_qIsUp ? _paramObj.getUpFirstDTimeObj() : _paramObj.getDownFirstDTimeObj();
  469 + // 上标线结束时间,使用最晚的末班车时间,结束时间的班次方向
  470 + // 上标线结束时间,使用最晚的末班车时间,结束时间的班次方向
  471 + var oEt;
  472 + if (_paramObj.getUpLastDtimeObj().isBefore(
  473 + _paramObj.getDownLastDTimeObj())) {
  474 + oEt = _paramObj.getDownLastDTimeObj();
  475 + } else {
  476 + oEt = _paramObj.getUpLastDtimeObj();
  477 + }
  478 +
  479 + var oTempLp = new InternalLpObj({lpNo: -999, lpName: "-999"}, _qCount, _qIsUp);
  480 + oTempLp.initDataFromTimeToTime(
  481 + oSt,
  482 + oEt,
  483 + !_qIsUp,
  484 + 0,
  485 + _paramObj,
  486 + _factory
  487 + );
  488 +
  489 + //------------------------ 2、找出中标线的早高峰班次,计算应该插在当前路牌数组的那个位置 ----------------//
  490 + // 找出中标线对应的早高峰的班次对象
  491 + var oZb_gf_bc = oTempLp.getBc(_approximate_zgfQIndex, _approximate_zgfBIndex);
  492 + //alert(oZb_gf_bc.getFcTimeObj().format("HH:mm"));
  493 +
  494 + // 把所有连班路牌高峰班次重新构造成一个一个的圈数组,计算对应中标线最近的是第几个路牌
  495 + // 中标线和上标线一样在连班路牌上
  496 + var aTempq = [];
  497 + var oTempq;
  498 + var oTempb;
  499 + var i;
  500 + var oLp;
  501 +
  502 + var aLbIndexes = []; // 连班的路牌索引
  503 + for (i = 0; i < _internalLpArray.length; i++) {
  504 + if (_internalLpArray[i].isBxLb()) {
  505 + aLbIndexes.push(i);
  506 + }
  507 + }
  508 +
  509 + for (i = 0; i < aLbIndexes.length; i++) {
  510 + oLp = _internalLpArray[aLbIndexes[i]];
  511 +
  512 + oTempb = oLp.getBc(_approximate_zgfQIndex, _approximate_zgfBIndex);
  513 + if (oTempb.isUp() == _qIsUp) {
  514 + oTempq = new InternalGroupObj(oLp, _qIsUp, oTempb, undefined);
  515 + } else {
  516 + oTempq = new InternalGroupObj(oLp, _qIsUp, undefined, oTempb);
  517 + }
  518 + aTempq.push(oTempq);
  519 +
  520 + }
  521 +
  522 + var aTtindex = oTempLp.fnGetQBcIndexWithFcTimeFromGroupArray( // 找出最接近中标线的路牌索引
  523 + oZb_gf_bc.getFcTimeObj(),
  524 + aTempq,
  525 + true,
  526 + true
  527 + );
  528 +
  529 + _iZbx_lpIndex = aLbIndexes[aTtindex[0]]; // 中标线放在第几个路牌
  530 +
  531 + oTempLp.getMinBcObj().fnSetIsFirstBc(true); // 设置首班班次标识
  532 +
  533 + if (_iZbx_lpIndex == 0) { // 如果中标线和上标线一致
  534 + var oFirstBcIndexes = oTempLp.getMinBcObjPosition();
  535 + var oFirstBc = oTempLp.getMinBcObj();
  536 + oFirstBc.setLp(_internalLpArray[_iZbx_lpIndex]);
  537 + oFirstBc.fnSetDelFlag(false);
  538 + _internalLpArray[_iZbx_lpIndex].setBc(oFirstBcIndexes[0], oFirstBcIndexes[1], oFirstBc);
  539 + } else {
  540 + oTempLp.setLp(_lpArray[_iZbx_lpIndex]); // 设置原始路牌对象
  541 + oTempLp._$_aVerticalIntervalTime = _internalLpArray[_iZbx_lpIndex]._$_aVerticalIntervalTime; // 设置纵向最小发车间隔
  542 + oTempLp.setBxLb(_internalLpArray[_iZbx_lpIndex].isBxLb());
  543 + oTempLp.setBxFb(_internalLpArray[_iZbx_lpIndex].isBxFb());
  544 + oTempLp.setBxFb5_2(_internalLpArray[_iZbx_lpIndex].isBxFb5_2());
  545 +
  546 + // 修正除了第一个班次外,其余其他班次
  547 + var iBcindex = 0;
  548 + for (i = 1; i < _qCount; i++) {
  549 + while (iBcindex <= 1) {
  550 + if (oTempLp.getBc(i, iBcindex)) { // 替换存在的班次
  551 + oTempLp.setBc(i, iBcindex, _fnGenerateBc(_iZbx_lpIndex, i, iBcindex));
  552 + }
  553 + iBcindex ++;
  554 + }
  555 + iBcindex = 0;
  556 + }
  557 +
  558 + _internalLpArray[_iZbx_lpIndex] = oTempLp;
  559 + }
  560 +
  561 + console.log("中标线对应第" + (_iZbx_lpIndex + 1) + "个路牌");
  562 +
  563 + console.log("//---------------- 行车计划,初始化方法4 end ----------------//");
  564 + };
  565 +
  566 + //-------------------- 重要的内部方法 -----------------------//
  567 + /**
  568 + * 核心方法,利用路牌间隔纵向生成班次。
  569 + * @param iLpindex 路牌索引
  570 + * @param iQindex 圈索引
  571 + * @param iBcindex 班次索引
  572 + * @returns object InternalBcObj,失败 false
  573 + */
  574 + var _fnGenerateBc = function(iLpindex, iQindex, iBcindex) {
  575 + // 以上标线为起始点,使用路牌在不同圈,班次索引的发车间隔,计算班次
  576 + // 注意,发车间隔是指下一个班次应该距离当前班次间隔,是从下往上的
  577 +
  578 + // 1、参数验证
  579 + if (iLpindex == 0) { // 上标线的班次不需要生成
  580 + return false;
  581 + }
  582 +
  583 + // 2、计算间隔
  584 + var i;
  585 + var oLp;
  586 + var iTime = 0;
  587 + for (i = 0; i < iLpindex; i++) {
  588 + oLp = _internalLpArray[i];
  589 + iTime += oLp.fnGetVerticalIntervalTime(iQindex, iBcindex);
  590 + }
  591 +
  592 + // 3、生成班次
  593 + var _oKsbc = _internalLpArray[0].getBc(iQindex, iBcindex);
  594 + if (!_oKsbc) {
  595 + return false;
  596 + }
  597 + var _oKssj = _paramObj.addMinute(_oKsbc.getFcTimeObj(), iTime);
  598 + var _oBc = _factory.createBcObj(
  599 + _internalLpArray[iLpindex],
  600 + "normal", _oKsbc.isUp(),
  601 + 1, _oKssj, _paramObj);
  602 +
  603 + return _oBc;
  604 +
  605 + };
  606 +
  607 + /**
  608 + * 核心方法,在指定位置生成班次并添加到路牌指定位置中。
  609 + * @param lpIndex 第几个路牌
  610 + * @param qIndex 第几圈
  611 + * @param bcIndex 第几个班次
  612 + */
  613 + var _fnGenerateBcAndSetBc = function(lpIndex, qIndex, bcIndex) {
  614 + var _bcObj = _fnGenerateBc(lpIndex, qIndex, bcIndex);
  615 + if (_bcObj) {
  616 + _internalLpArray[lpIndex].setBc(qIndex, bcIndex, _bcObj);
  617 + }
  618 + };
  619 +
  620 + /**
  621 + * 获取班次列表。
  622 + * @param oIsUp 是否上行
  623 + * @param oStartTime 开始时间对象
  624 + * @returns [(InternalBcObj)]
  625 + */
  626 + var _fnGetBcList2 = function(oIsUp, oStartTime) {
  627 + var i;
  628 + var j;
  629 + var oLp;
  630 + var oBc;
  631 + var aBc = [];
  632 +
  633 + for (j = 0; j < _qCount; j++) {
  634 + for (i = 0; i < _internalLpArray.length; i++) {
  635 + oLp = _internalLpArray[i];
  636 + oBc = oLp.getBc(
  637 + j,
  638 + _qIsUp == oIsUp ? 0 : 1
  639 + );
  640 + if (oBc && oBc.getFcTimeObj().isAfter(oStartTime)) {
  641 + aBc.push(oBc);
  642 + }
  643 + }
  644 + }
  645 +
  646 + var aBcFcTime = [];
  647 + for (i = 0; i < aBc.length; i++) {
  648 + oBc = aBc[i];
  649 + aBcFcTime.push(oBc.getFcTimeObj().format("HH:mm"));
  650 + }
  651 + console.log((oIsUp ? "上行班次列表:" : "下行班次列表:") + aBcFcTime.join(","));
  652 +
  653 + return aBc;
  654 + };
  655 +
  656 + /**
  657 + * 获取班次列表。
  658 + * @param isUp boolean 是否上行
  659 + * @returns [(InternalBcObj)]
  660 + */
  661 + var _fnGetBcList = function(isUp) {
  662 + var i;
  663 + var j;
  664 + var oLp;
  665 + var oBc;
  666 + var aBc = [];
  667 +
  668 + for (j = 0; j < _qCount; j++) {
  669 + for (i = 0; i < _internalLpArray.length; i++) {
  670 + oLp = _internalLpArray[i];
  671 + oBc = oLp.getBc(
  672 + j,
  673 + _qIsUp == isUp ? 0 : 1
  674 + );
  675 + if (oBc) {
  676 + aBc.push(oBc);
  677 + }
  678 + }
  679 + }
  680 +
  681 + var aBcFcTime = [];
  682 + for (i = 0; i < aBc.length; i++) {
  683 + oBc = aBc[i];
  684 + aBcFcTime.push(oBc.getFcTimeObj().format("HH:mm"));
  685 + }
  686 + console.log((isUp ? "上行班次列表:" : "下行班次列表:") + aBcFcTime.join(","));
  687 +
  688 + return aBc;
  689 + };
  690 +
  691 + /**
  692 + * 查找离指定时间最近的前面的班次索引信息
  693 + * @param timeObj 查找时间
  694 + * @param isUp 是否上行
  695 + * @returns [{路牌index},{圈index},{班次index}]
  696 + */
  697 + var _fnFindUpClosedBcIndexWithTime = function(timeObj, isUp) {
  698 +
  699 + var _lpObj;
  700 + var _groupObj;
  701 + var _bcObj;
  702 + var _i;
  703 + var _j;
  704 + var timediff; // 时间差取绝对值
  705 +
  706 + var _lpIndex;
  707 + var _up_qIndex;
  708 + var _up_bIndex;
  709 +
  710 + for (_i = 0; _i < _qCount; _i++) {
  711 + for (_j = 0; _j < _internalLpArray.length; _j++) {
  712 + _lpObj = _internalLpArray[_j];
  713 + _groupObj = _lpObj.getGroup(_i);
  714 + _bcObj = isUp == _qIsUp ? _groupObj.getBc1() : _groupObj.getBc2();
  715 + if (!_bcObj) { // 没有班次动态生成一个,可能生成不出的
  716 + _bcObj = _fnGenerateBc(_j, _i, isUp == _qIsUp ? 0 : 1);
  717 + }
  718 + if (_bcObj) {
  719 + if (timeObj.diff(_bcObj.getFcTimeObj()) >= 0) {
  720 + if (!timediff) {
  721 + timediff = timeObj.diff(_bcObj.getFcTimeObj());
  722 + _lpIndex = _j;
  723 + _up_qIndex = _i;
  724 + _up_bIndex = isUp == _qIsUp ? 0 : 1;
  725 + } else {
  726 + if (timeObj.diff(_bcObj.getFcTimeObj()) < timediff) {
  727 + timediff = timeObj.diff(_bcObj.getFcTimeObj());
  728 + _lpIndex = _j;
  729 + _up_qIndex = _i;
  730 + _up_bIndex = isUp == _qIsUp ? 0 : 1;
  731 + }
  732 + }
  733 + }
  734 + }
  735 + }
  736 + }
  737 +
  738 + if (_lpIndex == undefined) {
  739 + return false;
  740 + }
  741 +
  742 + var bcindex = [];
  743 + bcindex.push(_lpIndex);
  744 + bcindex.push(_up_qIndex);
  745 + bcindex.push(_up_bIndex);
  746 +
  747 + return bcindex;
  748 + };
  749 +
  750 + /**
  751 + * 查找离指定时间最近的后面的班次索引信息
  752 + * @param timeObj 查找时间
  753 + * @param isUp 是否上行
  754 + * @returns [{路牌index},{圈index},{班次index}]
  755 + */
  756 + var _fnFindDownClosedBcIndexWithTime = function(timeObj, isUp) {
  757 + var _lpObj;
  758 + var _groupObj;
  759 + var _bcObj;
  760 + var _i;
  761 + var _j;
  762 + var timediff; // 时间差取绝对值
  763 +
  764 + var _lpIndex;
  765 + var _down_qIndex;
  766 + var _down_bIndex;
  767 +
  768 + var flag;
  769 +
  770 + for (_i = 0; _i < _qCount; _i++) {
  771 + for (_j = 0; _j < _internalLpArray.length; _j++) {
  772 + _lpObj = _internalLpArray[_j];
  773 + _groupObj = _lpObj.getGroup(_i);
  774 + // TODO:bug
  775 + _bcObj = isUp == _qIsUp ? _groupObj.getBc1() : _groupObj.getBc2();
  776 + if (!_bcObj) { // 没有班次动态生成一个,可能生成不出的
  777 + _bcObj = _fnGenerateBc(_j, _i, isUp == _qIsUp ? 0 : 1);
  778 + }
  779 + if (_bcObj) {
  780 + //console.log("timeobj -> bcobj diff flag " +
  781 + // timeObj.format("HH:mm") + "->" +
  782 + // _bcObj.getFcTimeObj().format("HH:mm") +
  783 + // timeObj.diff(_bcObj.getFcTimeObj()) +
  784 + // (timeObj.diff(_bcObj.getFcTimeObj()) <= 0)
  785 + //);
  786 +
  787 + flag = (timeObj.diff(_bcObj.getFcTimeObj())) <= 0;
  788 +
  789 + if (flag) {
  790 + if (!timediff) {
  791 + timediff = timeObj.diff(_bcObj.getFcTimeObj());
  792 + _lpIndex = _j;
  793 + _down_qIndex = _i;
  794 + _down_bIndex = isUp == _qIsUp ? 0 : 1;
  795 + } else {
  796 + if ((timeObj.diff(_bcObj.getFcTimeObj())) > timediff) {
  797 + timediff = timeObj.diff(_bcObj.getFcTimeObj());
  798 + _lpIndex = _j;
  799 + _down_qIndex = _i;
  800 + _down_bIndex = isUp == _qIsUp ? 0 : 1;
  801 + }
  802 + }
  803 + }
  804 + }
  805 + }
  806 + }
  807 +
  808 + if (_lpIndex == undefined) {
  809 + return false;
  810 + }
  811 +
  812 + var bcindex = [];
  813 + bcindex.push(_lpIndex);
  814 + bcindex.push(_down_qIndex);
  815 + bcindex.push(_down_bIndex);
  816 +
  817 + return bcindex;
  818 + };
  819 +
  820 + /**
  821 + * 获取班次索引。
  822 + * @param oBc 班次对象
  823 + * @returns [{路牌索引},{圈索引},{班次索引}]
  824 + */
  825 + var _fnGetBcIndex = function(oBc) {
  826 + // 路牌索引
  827 + var i;
  828 + var iLpIndex;
  829 + for (i = 0; i < _internalLpArray.length; i++) {
  830 + if (_internalLpArray[i]._$$_orign_lp_obj == oBc._$$_internal_lp_obj._$$_orign_lp_obj) {
  831 + iLpIndex = i;
  832 + break;
  833 + }
  834 + }
  835 + // 圈索引
  836 + var j;
  837 + var iGroupIndex;
  838 + var bFlag = false;
  839 + for (i = 0; i < _internalLpArray.length; i++) {
  840 + if (bFlag) {
  841 + break;
  842 + }
  843 + for (j = 0; j < _qCount; j++) {
  844 + if (_internalLpArray[i]._$_groupBcArray[j] == oBc._$$_internal_group_obj) {
  845 + iGroupIndex = j;
  846 + bFlag = true;
  847 + break;
  848 + }
  849 + }
  850 + }
  851 + // 班次索引
  852 + var iBcIndex = _qIsUp == oBc.isUp() ? 0 : 1;
  853 +
  854 + if (iLpIndex == undefined) {
  855 + return null;
  856 + } else {
  857 + return [].concat(iLpIndex, iGroupIndex, iBcIndex);
  858 + }
  859 +
  860 + };
  861 +
  862 + return {
  863 + //------------- 布局初始化方法 ------------//
  864 + /**
  865 + * 初始化数据,使用标线初始化
  866 + */
  867 + fnInitDataWithBxLayout: function() {
  868 + // 初始化布局1,构造上标线,计算圈数,把上标线数据放入第一个路牌中
  869 + _fnInitFun1();
  870 + // 初始化布局2,从上标线的某个班次开始,构造所有路牌的早高峰班次,晚高峰班次,计算路牌在各个圈中的间隔
  871 + _fnInitFun2();
  872 + // 初始化布局3,计算连班分班路牌分布
  873 + _fnInitFun3();
  874 + // 初始化布局4,计算中标线位置
  875 + _fnInitFun4();
  876 +
  877 + },
  878 +
  879 + /**
  880 + * 调整高峰班次,
  881 + * 初始化生成早高峰,晚高峰班次并不准确,因为根据高峰时间段,并不在一个完整圈内,应该是在两个或多个圈之间
  882 + * 当初始化定好布局后(上标线,中标线),然后确定每个路牌的班型(连班,分班,5休2分班)后
  883 + * 然后重新计算框在高峰时间段内的班次索引,不足的添加,之前多加的删除(只删除分班路牌上的)
  884 + * @param isZgf 是否早高峰
  885 + * @param isUp 是否上行
  886 + */
  887 + fnAdjustGfbc : function(isZgf, isUp) {
  888 + var oStartTime; // 开始时间
  889 + var oEndTime; // 结束时间
  890 + var aStartBcIndex; // 开始班次索引
  891 + var aEndBcIndex; // 结束班次索引
  892 +
  893 + oStartTime = isZgf ? _paramObj.getMPeakStartTimeObj() : _paramObj.getEPeakStartTimeObj();
  894 + oEndTime = isZgf ? _paramObj.getMPeakEndTimeObj() : _paramObj.getEPeakEndTimeObj();
  895 +
  896 + aStartBcIndex = _fnFindUpClosedBcIndexWithTime(oStartTime, isUp);
  897 + aEndBcIndex = _fnFindDownClosedBcIndexWithTime(oEndTime, isUp);
  898 +
  899 + var iLpIndex;
  900 + var iQIndex;
  901 + var iBcIndex;
  902 + var iQInternelCount; // 高峰时间段中间包含的圈数
  903 + var i;
  904 + var j;
  905 +
  906 + var oLp;
  907 +
  908 + if (aStartBcIndex && aEndBcIndex) {
  909 + iLpIndex = aStartBcIndex[0];
  910 + iQIndex = aStartBcIndex[1];
  911 + iBcIndex = aStartBcIndex[2];
  912 +
  913 + // 处理头
  914 + // 删除头部多余班次
  915 + for (j = 0; j < iLpIndex; j++) {
  916 + oLp = _internalLpArray[j];
  917 + if (oLp.isBxFb() && oLp.getBc(iQIndex, iBcIndex)) {
  918 + oLp.removeBc(iQIndex, iBcIndex);
  919 + }
  920 + }
  921 +
  922 + for (j = iLpIndex; j < _internalLpArray.length; j++) {
  923 + oLp = _internalLpArray[j];
  924 + if (!oLp.getBc(iQIndex, iBcIndex)) {
  925 + _fnGenerateBcAndSetBc(j, iQIndex, iBcIndex);
  926 + }
  927 + }
  928 +
  929 + // 处理中间
  930 + iQInternelCount = aEndBcIndex[1] - aStartBcIndex[1] - 1;
  931 + for (i = 1; i <= iQInternelCount; i++) {
  932 + oLp = _internalLpArray[iQIndex + i];
  933 +
  934 + if (!oLp.getBc(iQIndex + i, iBcIndex)) {
  935 + _fnGenerateBcAndSetBc(i, iQIndex + i, iBcIndex);
  936 + }
  937 + }
  938 +
  939 + // 处理尾部
  940 + iLpIndex = aEndBcIndex[0];
  941 + iQIndex = aEndBcIndex[1];
  942 + iBcIndex = aEndBcIndex[2];
  943 +
  944 + // 删除尾部多余的班次
  945 + for (j = iLpIndex; j < _internalLpArray.length; j++) {
  946 + oLp = _internalLpArray[j];
  947 + if (oLp.isBxFb() && oLp.getBc(iQIndex, iBcIndex)) {
  948 + oLp.removeBc(iQIndex, iBcIndex);
  949 + }
  950 + }
  951 +
  952 + if (aStartBcIndex[1] != aEndBcIndex[1]) { // 指定时间范围跨圈
  953 + for (j = 0; j < iLpIndex; j++) {
  954 + oLp = _internalLpArray[j];
  955 + if (!oLp.getBc(iQIndex, iBcIndex)) {
  956 + _fnGenerateBcAndSetBc(j, iQIndex, iBcIndex);
  957 + }
  958 + }
  959 + } else {
  960 + // 不跨圈,不用处理,处理头的时候已经加了
  961 + }
  962 +
  963 + }
  964 +
  965 + },
  966 +
  967 + /**
  968 + * 按照营运时间要求补充班次,
  969 + * 早高峰7:45分以前出场运营,
  970 + * 晚高峰16:10分以前出场运营
  971 + */
  972 + fnCalcuLpBc_yy: function() {
  973 + // 补班次的时候,针对的是分班班型
  974 + var i;
  975 + var _oLp;
  976 + var _oBc;
  977 + var _aMinBcIndex;
  978 + var _aMaxBcIndex;
  979 +
  980 + var _qIndex;
  981 + var _bIndex;
  982 +
  983 + var _zgfCDate = _paramObj.toTimeObj("7:45");
  984 + var _wgfCDate = _paramObj.toTimeObj("16:10");
  985 + var _ccsj;
  986 +
  987 + for (i = 0; i < _internalLpArray.length; i++) {
  988 + _oLp = _internalLpArray[i];
  989 + if (_oLp.isBxFb()) { // 分班路牌
  990 + // 早高峰部分
  991 + _aMinBcIndex = _oLp.getMinBcObjPosition();
  992 + _qIndex = _aMinBcIndex[0];
  993 + _bIndex = _aMinBcIndex[1];
  994 + _oBc = _oLp.getBc(_qIndex, _bIndex);
  995 + if (_qIsUp) {
  996 + _ccsj = _bIndex == 0 ?
  997 + _paramObj.getUpOutTime() :
  998 + _paramObj.getDownOutTime();
  999 + } else {
  1000 + _ccsj = _bIndex == 0 ?
  1001 + _paramObj.getDownOutTime() :
  1002 + _paramObj.getUpOutTime();
  1003 + }
  1004 + if (_zgfCDate.isBefore(_paramObj.addMinute(_oBc.getFcTimeObj(), -_ccsj))) {
  1005 + _fnGenerateBcAndSetBc(
  1006 + i,
  1007 + _bIndex == 0 ? _qIndex - 1 : _qIndex,
  1008 + _bIndex == 0 ? 1 : 0
  1009 + )
  1010 + }
  1011 +
  1012 + // 晚高峰部分
  1013 + _aMaxBcIndex = _oLp.getMaxBcObjPosition();
  1014 + _qIndex = _aMaxBcIndex[0];
  1015 + _bIndex = _aMaxBcIndex[1];
  1016 + _oBc = _oLp.getBc(
  1017 + _bIndex == 0 ? _qIndex - 1 : _qIndex,
  1018 + _bIndex == 0 ? 1 : 0
  1019 + );
  1020 + if (!_oBc) { // 前一个班次不存在,再判定加不加
  1021 + _oBc = _oLp.getBc(_qIndex, _bIndex);
  1022 + if (_qIsUp) {
  1023 + _ccsj = _bIndex == 0 ?
  1024 + _paramObj.getUpOutTime() :
  1025 + _paramObj.getDownOutTime();
  1026 + } else {
  1027 + _ccsj = _bIndex == 0 ?
  1028 + _paramObj.getDownOutTime() :
  1029 + _paramObj.getUpOutTime();
  1030 + }
  1031 + if (_wgfCDate.isBefore(_paramObj.addMinute(_oBc.getFcTimeObj(), -_ccsj))) {
  1032 + _fnGenerateBcAndSetBc(
  1033 + i,
  1034 + _bIndex == 0 ? _qIndex - 1 : _qIndex,
  1035 + _bIndex == 0 ? 1 : 0
  1036 + )
  1037 + }
  1038 + }
  1039 + }
  1040 + }
  1041 + },
  1042 +
  1043 + /**
  1044 + * 补充做5休2的班型班次。
  1045 + * 1、确认5_2班型大致多少圈(小数点过.7进位)
  1046 + * 2、获取当前5_2两端车次链的信息,每段的班次数目,还差几个班次没加
  1047 + * 3、如果前面的车次链班次少,则从前面的车次链开始加
  1048 + * 4、如果车次链班次数一样,从从后面的车次链开始加
  1049 + * 5、加班次时都是往车次链前方加
  1050 + * 6、如果前面车次链不能再加班次了,从后面车次链加
  1051 + */
  1052 + fnCalcuLpBx_5_2: function() {
  1053 + // 计算做5休2班型所需的班次数
  1054 + var iBxBcount = _aBxDesc[6].fBcCount;
  1055 + if (iBxBcount - Math.floor(iBxBcount) > 0.7) {
  1056 + iBxBcount = Math.floor(iBxBcount) + 1;
  1057 + } else {
  1058 + iBxBcount = Math.floor(iBxBcount);
  1059 + }
  1060 +
  1061 + var i;
  1062 + var j;
  1063 + var oLp;
  1064 + var iAddBcCount;
  1065 + var oBcChain1;
  1066 + var oBcChain2;
  1067 + var iQindex;
  1068 + var iBindex;
  1069 +
  1070 + for (i = 0; i < _internalLpArray.length; i++) {
  1071 + oLp = _internalLpArray[i];
  1072 + if (oLp.isBxFb5_2()) {
  1073 + iAddBcCount = iBxBcount - oLp.getBcArray().length; // 需要添加的班次数
  1074 + for (j = 1; j <= iAddBcCount; j++) {
  1075 + oBcChain1 = oLp.fnGetBcChainInfo(0);
  1076 + oBcChain2 = oLp.fnGetBcChainInfo(1);
  1077 +
  1078 + if (oBcChain1.bcount < oBcChain2.bcount) {
  1079 + iQindex = oBcChain1.s_b == 0 ? oBcChain1.s_q - 1 : oBcChain1.s_q;
  1080 + iBindex = oBcChain1.s_b == 0 ? 1 : 0;
  1081 + // 往车次链往前不能加,就往后加
  1082 + if (_fnGenerateBc(i, iQindex, iBindex)) {
  1083 + _fnGenerateBcAndSetBc(i, iQindex, iBindex);
  1084 + } else {
  1085 + iQindex = oBcChain1.e_b == 0 ? oBcChain1.e_q : oBcChain1.e_q + 1;
  1086 + iBindex = oBcChain1.e_b == 0 ? 1 : 0;
  1087 + _fnGenerateBcAndSetBc(i, iQindex, iBindex);
  1088 + }
  1089 +
  1090 + } else if (oBcChain1.bcount > oBcChain2.bcount) {
  1091 + iQindex = oBcChain2.s_b == 0 ? oBcChain2.s_q - 1 : oBcChain2.s_q;
  1092 + iBindex = oBcChain2.s_b == 0 ? 1 : 0;
  1093 + _fnGenerateBcAndSetBc(i, iQindex, iBindex);
  1094 + } else {
  1095 + iQindex = oBcChain2.s_b == 0 ? oBcChain2.s_q - 1 : oBcChain2.s_q;
  1096 + iBindex = oBcChain2.s_b == 0 ? 1 : 0;
  1097 + _fnGenerateBcAndSetBc(i, iQindex, iBindex);
  1098 + }
  1099 + }
  1100 + }
  1101 + }
  1102 +
  1103 + },
  1104 +
  1105 + /**
  1106 + * 补其他分班班型班次。
  1107 + * 从车次链的后面开始加
  1108 + */
  1109 + fnCalcuLpBx_other: function() {
  1110 + // TODO:根据上标线的首班时间确定班型,小于05:59的做一休一,否则做二休一
  1111 + var oSt = _qIsUp ? _paramObj.getUpFirstDTimeObj() : _paramObj.getDownFirstDTimeObj();
  1112 + var iBxIndex = 4;
  1113 + if (oSt.isBefore(_paramObj.toTimeObj("05:59"))) {
  1114 + iBxIndex = 5;
  1115 + }
  1116 + // 计算做5休2班型所需的班次数
  1117 + var iQBcount = _aBxDesc[iBxIndex].fQCount;
  1118 + var iBxBcount = Math.round(iQBcount) * 2;
  1119 +
  1120 + var i;
  1121 + var j;
  1122 + var oLp;
  1123 + var iAddBcCount;
  1124 + var oBcChain1;
  1125 + var oBcChain2;
  1126 + var iQindex;
  1127 + var iBindex;
  1128 +
  1129 + for (i = 0; i < _internalLpArray.length; i++) {
  1130 + oLp = _internalLpArray[i];
  1131 + if (oLp.isBxFb() && !oLp.isBxFb5_2()) {
  1132 + iAddBcCount = iBxBcount - oLp.getBcArray().length; // 需要添加的班次数
  1133 + for (j = 1; j <= iAddBcCount; j++) {
  1134 + oBcChain1 = oLp.fnGetBcChainInfo(0);
  1135 + oBcChain2 = oLp.fnGetBcChainInfo(1);
  1136 +
  1137 + if (oBcChain1.bcount < oBcChain2.bcount) {
  1138 + iQindex = oBcChain1.e_b == 0 ? oBcChain1.e_q : oBcChain1.e_q + 1;
  1139 + iBindex = oBcChain1.e_b == 0 ? 1 : 0;
  1140 + _fnGenerateBcAndSetBc(i, iQindex, iBindex);
  1141 + } else if (oBcChain1.bcount > oBcChain2.bcount) {
  1142 + iQindex = oBcChain2.e_b == 0 ? oBcChain2.e_q : oBcChain2.e_q + 1;
  1143 + iBindex = oBcChain2.e_b == 0 ? 1 : 0;
  1144 + _fnGenerateBcAndSetBc(i, iQindex, iBindex);
  1145 + } else {
  1146 + iQindex = oBcChain2.e_b == 0 ? oBcChain2.e_q : oBcChain2.e_q + 1;
  1147 + iBindex = oBcChain2.e_b == 0 ? 1 : 0;
  1148 + _fnGenerateBcAndSetBc(i, iQindex, iBindex);
  1149 + }
  1150 + }
  1151 + }
  1152 + }
  1153 +
  1154 + },
  1155 +
  1156 + /**
  1157 + * 补充连班路牌班次。
  1158 + * 1、上标线,中标线中间的连班路牌班次从早高峰班次一直拉到底,从早高峰班次向上标线起始班次靠拢
  1159 + * 2、中标线以下的连班路牌班次从早高峰班次一直拉到底,从早高峰班次向中标线起始班次靠拢
  1160 + */
  1161 + fnCalcuLpBx_lb: function() {
  1162 + // 补充连班的班次,参照上标线,中标线补充不足的班次
  1163 +
  1164 + var aLbLpindexes = []; // 除上标线,中标线的连班路牌索引
  1165 + var i;
  1166 + for (i = 0; i < _internalLpArray.length; i++) {
  1167 + if (_internalLpArray[i].isBxLb() && i != 0 && i != _iZbx_lpIndex) {
  1168 + aLbLpindexes.push(i);
  1169 + }
  1170 + }
  1171 +
  1172 + var oEndsj = // 结束时间
  1173 + _paramObj.getUpLastDtimeObj().isBefore(_paramObj.getDownLastDTimeObj()) ?
  1174 + _paramObj.getDownLastDTimeObj() :
  1175 + _paramObj.getUpLastDtimeObj();
  1176 +
  1177 + var oLp;
  1178 + var aMinbcPos;
  1179 + var oBc;
  1180 + var j;
  1181 + var iTempBcIndex;
  1182 +
  1183 + // 1、从最小班次开始,往后补充班次
  1184 + for (i = 0; i < aLbLpindexes.length; i++) {
  1185 + oLp = _internalLpArray[aLbLpindexes[i]];
  1186 +
  1187 + // 最小班次索引
  1188 + aMinbcPos = oLp.getMinBcObjPosition();
  1189 + // 使用纵向分隔补充班次,从最小班次向后补
  1190 + iTempBcIndex = aMinbcPos[1] == 0 ? 1 : 0;
  1191 + j = iTempBcIndex == 0 ? aMinbcPos[0] + 1 : aMinbcPos[0];
  1192 +
  1193 + while (j < _qCount) {
  1194 + while (iTempBcIndex <= 1) {
  1195 + oBc = _fnGenerateBc(aLbLpindexes[i], j, iTempBcIndex);
  1196 + if (oBc &&
  1197 + oBc.getFcTimeObj().isBefore(oEndsj) ) {
  1198 + oLp.setBc(j, iTempBcIndex, oBc);
  1199 + }
  1200 + iTempBcIndex++;
  1201 + }
  1202 + iTempBcIndex = 0;
  1203 + j++;
  1204 + }
  1205 +
  1206 + }
  1207 +
  1208 + // 2、上标线中标线之间的路牌,从最小的班次往前补充班次
  1209 +
  1210 + // 还要补充缺失的班次,差上标线几个班次要往前补上
  1211 + var iBccount;
  1212 + var iQindex;
  1213 + var iBindex;
  1214 + // 补上标线到中标线之间的连班路牌的班次
  1215 + for (i = 0; i < aLbLpindexes.length; i++) {
  1216 + if (aLbLpindexes[i] > 0 && aLbLpindexes[i] < _iZbx_lpIndex) {
  1217 + oLp = _internalLpArray[aLbLpindexes[i]];
  1218 + aMinbcPos = oLp.getMinBcObjPosition();
  1219 + iQindex = aMinbcPos[0];
  1220 + iBindex = aMinbcPos[1];
  1221 + iBccount = (iQindex - 1) * 2 + iBindex; // 距离上标线起始站点差几个班次
  1222 + for (j = 0; j < iBccount; j++) {
  1223 + if (iBindex == 0) {
  1224 + iQindex --;
  1225 + iBindex = 1;
  1226 + _fnGenerateBcAndSetBc(aLbLpindexes[i], iQindex, iBindex);
  1227 + } else if (iBindex == 1) {
  1228 + iBindex --;
  1229 + _fnGenerateBcAndSetBc(aLbLpindexes[i], iQindex, iBindex);
  1230 + }
  1231 + }
  1232 +
  1233 + }
  1234 +
  1235 + }
  1236 +
  1237 + // 3、中标线之后的路牌,从最小的班次往前补充班次
  1238 +
  1239 + // 补中标线以下的连班路牌的班次
  1240 + for (i = 0; i < aLbLpindexes.length; i++) {
  1241 + if (aLbLpindexes[i] > _iZbx_lpIndex) {
  1242 + oLp = _internalLpArray[aLbLpindexes[i]];
  1243 + aMinbcPos = oLp.getMinBcObjPosition();
  1244 + iQindex = aMinbcPos[0];
  1245 + iBindex = aMinbcPos[1];
  1246 + iBccount = (iQindex - 0) * 2 + iBindex - 1; // 距离上标线起始站点差几个班次
  1247 + for (j = 0; j < iBccount; j++) {
  1248 + if (iBindex == 0) {
  1249 + iQindex --;
  1250 + iBindex = 1;
  1251 + _fnGenerateBcAndSetBc(aLbLpindexes[i], iQindex, iBindex);
  1252 + } else if (iBindex == 1) {
  1253 + iBindex --;
  1254 + _fnGenerateBcAndSetBc(aLbLpindexes[i], iQindex, iBindex);
  1255 + }
  1256 + }
  1257 + }
  1258 + }
  1259 +
  1260 + },
  1261 +
  1262 + /**
  1263 + * 计算末班车。
  1264 + * 1、将上下行拉成上下行两个班次列表(包括标记班次)
  1265 + * 2、分别找出离末班车发车时间最近的班次,并替换时间
  1266 + * 3、删除之后的班次
  1267 + */
  1268 + fnCalcuLastBc: function() {
  1269 + var i;
  1270 + var iTimeDiff;
  1271 + var iTempTime;
  1272 + var aBc;
  1273 + var oLastBcTime;
  1274 + var oLastBcIsUp;
  1275 + var iModifyIndex;
  1276 +
  1277 + // 查找末班车早的末班车时间和方向
  1278 + if (_paramObj.getUpLastDtimeObj().isBefore(_paramObj.getDownLastDTimeObj())) {
  1279 + oLastBcTime = _paramObj.getUpLastDtimeObj();
  1280 + oLastBcIsUp = true;
  1281 + } else {
  1282 + oLastBcTime = _paramObj.getDownLastDTimeObj();
  1283 + oLastBcIsUp = false;
  1284 + }
  1285 +
  1286 + // 确定早的末班车时间
  1287 + aBc = _fnGetBcList(oLastBcIsUp);
  1288 + for (i = 0; i < aBc.length; i++) {
  1289 + iTempTime = oLastBcTime.diff(aBc[i].getFcTimeObj(), "m");
  1290 + if (iTimeDiff == undefined) {
  1291 + iTimeDiff = iTempTime;
  1292 + iModifyIndex = i;
  1293 + } else if (Math.abs(iTempTime) <= Math.abs(iTimeDiff)) {
  1294 + iTimeDiff = iTempTime;
  1295 + iModifyIndex = i;
  1296 + }
  1297 + }
  1298 + aBc[iModifyIndex].addMinuteToFcsj(iTimeDiff); // 替换成末班车时间
  1299 + aBc[iModifyIndex].fnSetDelFlag(false);
  1300 + aBc[iModifyIndex].fnSetIsLastBc(true);
  1301 + for (i = iModifyIndex + 1; i < aBc.length; i++) { // 删除多余班次
  1302 + _qIsUp == oLastBcIsUp ?
  1303 + aBc[i]._$$_internal_group_obj.setBc1(undefined) :
  1304 + aBc[i]._$$_internal_group_obj.setBc2(undefined);
  1305 + }
  1306 +
  1307 + // 查找末班车晚的末班车时间和方向
  1308 + if (_paramObj.getUpLastDtimeObj().isBefore(_paramObj.getDownLastDTimeObj())) {
  1309 + oLastBcTime = _paramObj.getDownLastDTimeObj();
  1310 + oLastBcIsUp = false;
  1311 + } else {
  1312 + oLastBcTime = _paramObj.getUpLastDtimeObj();
  1313 + oLastBcIsUp = true;
  1314 + }
  1315 + // 确定晚的末班车时间
  1316 + aBc = _fnGetBcList(oLastBcIsUp);
  1317 + var oBc;
  1318 + var aBcIndex;
  1319 + var iLpIndex;
  1320 + var iQIndex;
  1321 + var iBcIndex;
  1322 +
  1323 + iTimeDiff = undefined;
  1324 + for (i = 0; i < aBc.length; i++) {
  1325 + oBc = aBc[i];
  1326 + aBcIndex = _fnGetBcIndex(oBc);
  1327 +
  1328 + iLpIndex = aBcIndex[0];
  1329 + iQIndex = aBcIndex[2] == 0 ? aBcIndex[1] -1 : aBcIndex[1];
  1330 + iBcIndex = aBcIndex[2] == 0 ? 1 : 0;
  1331 +
  1332 + if (!_internalLpArray[iLpIndex].getBc(iQIndex, iBcIndex)) {
  1333 + continue;
  1334 + }
  1335 +
  1336 + iTempTime = oLastBcTime.diff(aBc[i].getFcTimeObj(), "m");
  1337 + if (iTimeDiff == undefined) {
  1338 + iTimeDiff = iTempTime;
  1339 + iModifyIndex = i;
  1340 + } else if (Math.abs(iTempTime) <= Math.abs(iTimeDiff)) {
  1341 + iTimeDiff = iTempTime;
  1342 + iModifyIndex = i;
  1343 + }
  1344 + }
  1345 + aBc[iModifyIndex].addMinuteToFcsj(iTimeDiff); // 替换成末班车时间
  1346 + aBc[iModifyIndex].fnSetDelFlag(false);
  1347 + aBc[iModifyIndex].fnSetIsLastBc(true);
  1348 + for (i = iModifyIndex + 1; i < aBc.length; i++) { // 删除多余班次
  1349 + _qIsUp == oLastBcIsUp ?
  1350 + aBc[i]._$$_internal_group_obj.setBc1(undefined) :
  1351 + aBc[i]._$$_internal_group_obj.setBc2(undefined);
  1352 + }
  1353 +
  1354 + },
  1355 +
  1356 + /**
  1357 + * 添加吃饭班次。
  1358 + */
  1359 + fnCalcuEatBc: function() {
  1360 + // 吃午饭时间范围,10:15 到 12:15
  1361 + // 吃晚饭时间范围,18:00 到 19:00
  1362 +
  1363 + if (!_paramObj.fnIsEat()) {
  1364 + return;
  1365 + }
  1366 +
  1367 + // 午饭index
  1368 + var aLEIndex;
  1369 + // 晚饭index
  1370 + var aDEIndex;
  1371 +
  1372 + // 所有吃饭都默认在一个方向,两个方向暂时不考虑
  1373 + if (_paramObj.fnIsUpEat()) {
  1374 + aLEIndex = _internalLpArray[0].getQBcIndexWithFcTime(_paramObj.toTimeObj("10:15"), true, false);
  1375 + aDEIndex = _internalLpArray[0].getQBcIndexWithFcTime(_paramObj.toTimeObj("18:00"), true, false);
  1376 + } else {
  1377 + aLEIndex = _internalLpArray[0].getQBcIndexWithFcTime(_paramObj.toTimeObj("10:15"), false, true);
  1378 + aDEIndex = _internalLpArray[0].getQBcIndexWithFcTime(_paramObj.toTimeObj("18:00"), false, true);
  1379 + }
  1380 +
  1381 + // 午饭第几圈,第几个班次
  1382 + var iLEQIndex = aLEIndex[0];
  1383 + var iLEBIndex = aLEIndex[1];
  1384 + // 晚饭第几圈,第几个班次
  1385 + var iDEQIndex = aDEIndex[0];
  1386 + var iDEBIndex = aDEIndex[1];
  1387 +
  1388 + // 注意,本模型只有连班才有吃饭
  1389 +
  1390 + var i;
  1391 + var oLp;
  1392 + var aLbIndex = []; // 连班班型的路牌索引
  1393 + for (i = 0; i < _internalLpArray.length; i++) {
  1394 + oLp = _internalLpArray[i];
  1395 + if (oLp.isBxLb()) {
  1396 + aLbIndex.push(i);
  1397 + }
  1398 + }
  1399 +
  1400 + var iLTime;
  1401 + var iDtime;
  1402 + var j;
  1403 + for (i = 0; i < aLbIndex.length; i++) {
  1404 + oLp = _internalLpArray[aLbIndex[i]];
  1405 +
  1406 + // 午饭
  1407 + iLTime = oLp.fnAddEatBc(iLEQIndex, iLEBIndex, _factory, _paramObj);
  1408 + // 晚饭
  1409 + iDtime = oLp.fnAddEatBc(iDEQIndex, iDEBIndex, _factory, _paramObj);
  1410 +
  1411 + if (i == aLbIndex.length - 1) {
  1412 + for (j = aLbIndex[i]; j < _internalLpArray.length; j++) {
  1413 + oLp = _internalLpArray[j];
  1414 + if (oLp.isBxFb()) { // 5休2班型不调整
  1415 + // 修正午饭之后路牌班次的发车时间
  1416 + oLp.fnAddMinuteToBcFcsj(iLEQIndex, iLEBIndex, iLTime);
  1417 + oLp.fnAddMinuteToBcFcsj(iDEQIndex, iDEBIndex, iDtime);
  1418 + }
  1419 + }
  1420 + } else {
  1421 + for (j = aLbIndex[i]; j < aLbIndex[i + 1]; j++) {
  1422 + oLp = _internalLpArray[j];
  1423 + if (oLp.isBxFb()) {
  1424 + // 修正午饭之后路牌班次的发车时间
  1425 + oLp.fnAddMinuteToBcFcsj(iLEQIndex, iLEBIndex, iLTime);
  1426 + oLp.fnAddMinuteToBcFcsj(iDEQIndex, iDEBIndex, iDtime);
  1427 + }
  1428 + }
  1429 + }
  1430 + }
  1431 +
  1432 + },
  1433 +
  1434 + /**
  1435 + * 补每个路牌的其他班次(进出场,例保班次)。
  1436 + */
  1437 + fnCalcuOtherBc_: function() {
  1438 + var i;
  1439 + var _lpObj;
  1440 + var _minBcIndex;
  1441 + var _maxBcIndex;
  1442 + var _minBc;
  1443 + var _maxBc;
  1444 + var _otherbc = [];
  1445 + var _oFbbc;
  1446 +
  1447 + for (i = 0; i < _internalLpArray.length; i++) {
  1448 + _lpObj = _internalLpArray[i];
  1449 + _minBcIndex = _lpObj.getMinBcObjPosition();
  1450 + _maxBcIndex = _lpObj.getMaxBcObjPosition();
  1451 + _minBc = _lpObj.getBc(_minBcIndex[0], _minBcIndex[1]);
  1452 + _maxBc = _lpObj.getBc(_maxBcIndex[0], _maxBcIndex[1]);
  1453 +
  1454 + _otherbc = [];
  1455 + _otherbc.push(_factory.createBcObj(
  1456 + _lpObj, "bd", true, 1,
  1457 + _minBc.getFcTimeObj(),
  1458 + _paramObj
  1459 + ));
  1460 + _otherbc.push(_factory.createBcObj(
  1461 + _lpObj, "out", true, 1,
  1462 + _minBc.getFcTimeObj(),
  1463 + _paramObj
  1464 + ));
  1465 +
  1466 + _maxBc.setArrTimeObj(_paramObj.addMinute(_maxBc.getFcTimeObj(), _maxBc.getBcTime()));
  1467 + _maxBc.setStopTime(0);
  1468 + _otherbc.push(_factory.createBcObj(
  1469 + _lpObj, "in", true, 1,
  1470 + _maxBc.getArrTimeObj(),
  1471 + _paramObj
  1472 + ));
  1473 + _otherbc.push(_factory.createBcObj(
  1474 + _lpObj, "lc", true, 1,
  1475 + _maxBc.getArrTimeObj(),
  1476 + _paramObj
  1477 + ));
  1478 +
  1479 + // 5休2分班出场例保班次
  1480 + if (_lpObj.isBxFb5_2()) {
  1481 + _oFbbc = _lpObj.getBc(
  1482 + _lpObj.fnGetBcChainInfo(1)["s_q"],
  1483 + _lpObj.fnGetBcChainInfo(1)["s_b"]
  1484 + );
  1485 +
  1486 + _otherbc.push(_factory.createBcObj(
  1487 + _lpObj, "bd", true, 1,
  1488 + _oFbbc.getFcTimeObj(),
  1489 + _paramObj
  1490 + ));
  1491 + _otherbc.push(_factory.createBcObj(
  1492 + _lpObj, "out", true, 1,
  1493 + _oFbbc.getFcTimeObj(),
  1494 + _paramObj
  1495 + ));
  1496 + }
  1497 +
  1498 + _lpObj.addOtherBcArray(_otherbc);
  1499 + }
  1500 +
  1501 + },
  1502 +
  1503 + /**
  1504 + * 补每个路牌的其他班次(进出场,例保班次)
  1505 + * 所有的车次链前后都加进出场、报道班次
  1506 + */
  1507 + fnCalcuOtherBc: function() {
  1508 + var i;
  1509 + var j;
  1510 + var iBcChainCount;
  1511 + var oLp;
  1512 + var aOtherBc;
  1513 + var oStartBc;
  1514 + var oEndBc;
  1515 +
  1516 + for (i = 0; i < _internalLpArray.length; i++) {
  1517 + aOtherBc = [];
  1518 + oLp = _internalLpArray[i];
  1519 + iBcChainCount = oLp.fnGetBcChainCount();
  1520 +
  1521 + if (iBcChainCount == 1) { // 只有一个车次链,是连班班型
  1522 + // 头部要添加出场,例保班次
  1523 + oStartBc = oLp.getBc(
  1524 + oLp.fnGetBcChainInfo(0)["s_q"],
  1525 + oLp.fnGetBcChainInfo(0)["s_b"]
  1526 + );
  1527 + aOtherBc.push(_factory.createBcObj(
  1528 + oLp, "bd", true, 1,
  1529 + oStartBc.getFcTimeObj(),
  1530 + _paramObj
  1531 + ));
  1532 + aOtherBc.push(_factory.createBcObj(
  1533 + oLp, "out", true, 1,
  1534 + oStartBc.getFcTimeObj(),
  1535 + _paramObj
  1536 + ));
  1537 +
  1538 + // 尾部需添加进场,例保班次
  1539 + oEndBc = oLp.getBc(
  1540 + oLp.fnGetBcChainInfo(0)["e_q"],
  1541 + oLp.fnGetBcChainInfo(0)["e_b"]
  1542 + );
  1543 + aOtherBc.push(_factory.createBcObj(
  1544 + oLp, "in", true, 1,
  1545 + oEndBc.getArrTimeObj(),
  1546 + _paramObj
  1547 + ));
  1548 + aOtherBc.push(_factory.createBcObj(
  1549 + oLp, "lc", true, 1,
  1550 + oEndBc.getArrTimeObj(),
  1551 + _paramObj
  1552 + ));
  1553 + } else if (iBcChainCount == 2) { // 两个车次链,是分班班型
  1554 + // 第一个车次链开头有出场,报到班次,车次链结尾只有进场班次
  1555 + oStartBc = oLp.getBc(
  1556 + oLp.fnGetBcChainInfo(0)["s_q"],
  1557 + oLp.fnGetBcChainInfo(0)["s_b"]
  1558 + );
  1559 + aOtherBc.push(_factory.createBcObj(
  1560 + oLp, "bd", true, 1,
  1561 + oStartBc.getFcTimeObj(),
  1562 + _paramObj
  1563 + ));
  1564 + aOtherBc.push(_factory.createBcObj(
  1565 + oLp, "out", true, 1,
  1566 + oStartBc.getFcTimeObj(),
  1567 + _paramObj
  1568 + ));
  1569 +
  1570 + oEndBc = oLp.getBc(
  1571 + oLp.fnGetBcChainInfo(0)["e_q"],
  1572 + oLp.fnGetBcChainInfo(0)["e_b"]
  1573 + );
  1574 + aOtherBc.push(_factory.createBcObj(
  1575 + oLp, "in", true, 1,
  1576 + oEndBc.getArrTimeObj(),
  1577 + _paramObj
  1578 + ));
  1579 +
  1580 + // 第二个车次链开头只有出场班次,车次链结尾有进场,报到班次
  1581 + oStartBc = oLp.getBc(
  1582 + oLp.fnGetBcChainInfo(1)["s_q"],
  1583 + oLp.fnGetBcChainInfo(1)["s_b"]
  1584 + );
  1585 + aOtherBc.push(_factory.createBcObj(
  1586 + oLp, "out", true, 1,
  1587 + oStartBc.getFcTimeObj(),
  1588 + _paramObj
  1589 + ));
  1590 +
  1591 + oEndBc = oLp.getBc(
  1592 + oLp.fnGetBcChainInfo(1)["e_q"],
  1593 + oLp.fnGetBcChainInfo(1)["e_b"]
  1594 + );
  1595 + aOtherBc.push(_factory.createBcObj(
  1596 + oLp, "in", true, 1,
  1597 + oEndBc.getArrTimeObj(),
  1598 + _paramObj
  1599 + ));
  1600 + aOtherBc.push(_factory.createBcObj(
  1601 + oLp, "lc", true, 1,
  1602 + oEndBc.getArrTimeObj(),
  1603 + _paramObj
  1604 + ));
  1605 +
  1606 +
  1607 + } else {
  1608 + // 2个车次链以上,暂时没有此班型
  1609 + }
  1610 +
  1611 + oLp.addOtherBcArray(aOtherBc);
  1612 + }
  1613 + },
  1614 +
  1615 + /**
  1616 + * 祛除上标线开头的删除标记的班次。
  1617 + */
  1618 + fnRemoveDelFirstFlagBc: function() {
  1619 + var oLp = _internalLpArray[0];
  1620 + var aMinBcIndex = oLp.getMinBcObjPosition();
  1621 + if (oLp.getBc(aMinBcIndex[0], aMinBcIndex[1]).fnIsDelFlag()) {
  1622 + oLp.removeBc(aMinBcIndex[0], aMinBcIndex[1]);
  1623 + }
  1624 + },
  1625 + /**
  1626 + * 祛除上标线结尾的删除标记的班次。
  1627 + */
  1628 + fnRemoveDelLastFlagBc: function() {
  1629 + var oLp = _internalLpArray[0];
  1630 + var aMaxBcIndex = oLp.getMaxBcObjPosition();
  1631 + if (oLp.getBc(aMaxBcIndex[0], aMaxBcIndex[1]).fnIsDelFlag()) {
  1632 + oLp.removeBc(aMaxBcIndex[0], aMaxBcIndex[1]);
  1633 + }
  1634 + },
  1635 +
  1636 + /**
  1637 + * 调整路牌班次间隔(核准周转时间,停站时间)。
  1638 + * @param iFre int 迭代次数
  1639 + */
  1640 + fnAdjustLpBcInterval: function(iFre) {
  1641 + if (iFre > 0) {
  1642 + for (var i = 0; i < _internalLpArray.length; i++) {
  1643 + _internalLpArray[i].fnAdjustBcInterval(
  1644 + this.fnCalcuAverPeakStopTime(),
  1645 + this.fnCalcuAverTroughStopTime(),
  1646 + _paramObj);
  1647 + }
  1648 +
  1649 + this.fnAdjustLpBcInterval(iFre - 1);
  1650 + }
  1651 + },
  1652 +
  1653 + /**
  1654 + * 调整班次间隔。
  1655 + * @param bIsUp 是否上行
  1656 + * @param oStartTime 开始时间对象
  1657 + * @param iFre 迭代次数
  1658 + */
  1659 + fnAdjustBcInterval2_: function(bIsUp, oStartTime, iFre) {
  1660 + if (iFre > 0) {
  1661 + var aBc = _fnGetBcList2(bIsUp, oStartTime); // 指定方向的班次列表
  1662 + aBc.sort(function(o1, o2) {
  1663 + if (o1.getFcTimeObj().isBefore(o2.getFcTimeObj())) {
  1664 + return -1;
  1665 + } else {
  1666 + return 1;
  1667 + }
  1668 + });
  1669 + var i;
  1670 + var j;
  1671 +
  1672 + var iBcCountOfGroup = 3; // 3个班次取一次计算
  1673 + var aBcOfGroup; // 3个班次列表
  1674 + var aBcIntervalOfGroup; // 班次间隔列表,如:3个班次,2个间隔
  1675 +
  1676 + for (i = 0; i <= aBc.length - iBcCountOfGroup; i++) {
  1677 + aBcOfGroup = [];
  1678 + aBcIntervalOfGroup = [];
  1679 + for (j = i; j < i + iBcCountOfGroup; j++) {
  1680 + aBcOfGroup.push(aBc[j]);
  1681 + }
  1682 +
  1683 + for (j = 0; j < aBcOfGroup.length; j++) {
  1684 + if (j < aBcOfGroup.length - 1) {
  1685 + aBcIntervalOfGroup.push(aBcOfGroup[j + 1].getFcTimeObj().diff(
  1686 + aBcOfGroup[j].getFcTimeObj(), "m"));
  1687 + }
  1688 + }
  1689 +
  1690 + if (aBcIntervalOfGroup[0] < 19) {
  1691 + aBcOfGroup[1].addMinuteToFcsj(1);
  1692 + } else if (aBcIntervalOfGroup[0] > 20) {
  1693 + aBcOfGroup[1].addMinuteToFcsj(-1);
  1694 + } else {
  1695 + if (Math.abs(aBcIntervalOfGroup[0] - aBcIntervalOfGroup[1]) <= 1) {
  1696 + //continue;
  1697 + } else if (aBcIntervalOfGroup[0] > aBcIntervalOfGroup[1]) {
  1698 + aBcOfGroup[1].addMinuteToFcsj(-1);
  1699 + } else {
  1700 + aBcOfGroup[1].addMinuteToFcsj(1);
  1701 + }
  1702 + }
  1703 +
  1704 + }
  1705 +
  1706 + this.fnAdjustBcInterval2(bIsUp, oStartTime, iFre - 1);
  1707 + }
  1708 + },
  1709 +
  1710 + /**
  1711 + * 调整班次间隔。
  1712 + * @param boolean isUp 是否上行
  1713 + * @param oStartTime 开始时间对象
  1714 + * @param fre int 迭代次数
  1715 + */
  1716 + fnAdjustBcInterval: function(isUp, oStartTime, fre) {
  1717 + if (fre > 0) {
  1718 + var aBc = !oStartTime ? _fnGetBcList(isUp) : _fnGetBcList2(isUp, oStartTime); // 指定方向的班次列表
  1719 +
  1720 + aBc.sort(function(o1, o2) {
  1721 + if (o1.getFcTimeObj().isBefore(o2.getFcTimeObj())) {
  1722 + return -1;
  1723 + } else {
  1724 + return 1;
  1725 + }
  1726 + });
  1727 +
  1728 + var i;
  1729 + var j;
  1730 +
  1731 + var iBcCountOfGroup = 3; // 3个班次取一次计算
  1732 + var aBcOfGroup; // 3个班次列表
  1733 + var aBcIntervalOfGroup; // 班次间隔列表,如:3个班次,2个间隔
  1734 + var oBcFcTime; // 班次发车时间
  1735 +
  1736 + for (i = 0; i <= aBc.length - iBcCountOfGroup; i++) {
  1737 + aBcOfGroup = [];
  1738 + aBcIntervalOfGroup = [];
  1739 + for (j = i; j < i + iBcCountOfGroup; j++) {
  1740 + aBcOfGroup.push(aBc[j]);
  1741 + }
  1742 +
  1743 + for (j = 0; j < aBcOfGroup.length; j++) {
  1744 + if (j < aBcOfGroup.length - 1) {
  1745 + aBcIntervalOfGroup.push(aBcOfGroup[j + 1].getFcTimeObj().diff(
  1746 + aBcOfGroup[j].getFcTimeObj(), "m"));
  1747 + }
  1748 + }
  1749 +
  1750 + // 判定规则
  1751 + oBcFcTime = aBcOfGroup[1].getFcTimeObj();
  1752 +
  1753 + // 第一个班次发车时间不动,根据间隔,调整中间一个班次
  1754 + // 如果3个班次2个间隔时间差1分钟,不调整
  1755 + // 如果第一个间隔大,调整第二个班次往前1分钟
  1756 + // 如果第二个间隔大,调整第二个班次往后1分钟
  1757 +
  1758 + if (_paramObj.isTroughBc(oBcFcTime) &&
  1759 + aBcIntervalOfGroup[0] > _paramObj.getTroughMaxFcjx()) {
  1760 + aBcOfGroup[1].addMinuteToFcsj(-1);
  1761 + }
  1762 +
  1763 + //else if (_paramObj.isMPeakBc(oBcFcTime) &&
  1764 + // aBcIntervalOfGroup[0] < _paramObj.getMPeakMinFcjx()) {
  1765 + // aBcOfGroup[1].addMinuteToFcsj(1);
  1766 + //} else if (_paramObj.isMPeakBc(oBcFcTime) &&
  1767 + // aBcIntervalOfGroup[0] > _paramObj.getMPeakMaxFcjx()) {
  1768 + // aBcOfGroup[1].addMinuteToFcsj(-1);
  1769 + //} else if (_paramObj.isEPeakBc(oBcFcTime) &&
  1770 + // aBcIntervalOfGroup[0] < _paramObj.getEPeakMinFcjx()) {
  1771 + // aBcOfGroup[1].addMinuteToFcsj(1);
  1772 + //} else if (_paramObj.isEPeakBc(oBcFcTime) &&
  1773 + // aBcIntervalOfGroup[0] > _paramObj.getEPeakMaxFcjx()) {
  1774 + // aBcOfGroup[1].addMinuteToFcsj(-1);
  1775 + //}
  1776 +
  1777 +
  1778 + else {
  1779 + if (Math.abs(aBcIntervalOfGroup[0] - aBcIntervalOfGroup[1]) <= 1) {
  1780 + //continue;
  1781 + } else if (aBcIntervalOfGroup[0] > aBcIntervalOfGroup[1]) {
  1782 + aBcOfGroup[1].addMinuteToFcsj(-1);
  1783 + } else {
  1784 + aBcOfGroup[1].addMinuteToFcsj(1);
  1785 + }
  1786 + }
  1787 +
  1788 + //if (Math.abs(aBcIntervalOfGroup[0] - aBcIntervalOfGroup[1]) <= 1) {
  1789 + // //continue;
  1790 + //} else if (aBcIntervalOfGroup[0] > aBcIntervalOfGroup[1]) {
  1791 + // aBcOfGroup[1].addMinuteToFcsj(-1);
  1792 + //} else {
  1793 + // aBcOfGroup[1].addMinuteToFcsj(1);
  1794 + //}
  1795 +
  1796 +
  1797 + }
  1798 +
  1799 + this.fnAdjustBcInterval(isUp, oStartTime, fre - 1);
  1800 + }
  1801 +
  1802 + },
  1803 +
  1804 + /**
  1805 + * 调整班次间隔(平均间隔)。
  1806 + * @param bIsUp 是否上行
  1807 + * @param oStartTime 开始时间对象
  1808 + */
  1809 + fnAdjustBcInterval2_avg: function(bIsUp, oStartTime) {
  1810 + var aBc = !oStartTime ? _fnGetBcList(bIsUp) : _fnGetBcList2(bIsUp, oStartTime); // 指定方向的班次列表
  1811 + aBc.sort(function(o1, o2) {
  1812 + if (o1.getFcTimeObj().isBefore(o2.getFcTimeObj())) {
  1813 + return -1;
  1814 + } else {
  1815 + return 1;
  1816 + }
  1817 + });
  1818 +
  1819 + var j;
  1820 + var iCount = aBc.length - 1;
  1821 + var iC1 = Math.floor(aBc[aBc.length - 1].getFcTimeObj().diff(aBc[0].getFcTimeObj(), "m") / iCount);
  1822 + var iC2 = aBc[aBc.length - 1].getFcTimeObj().diff(aBc[0].getFcTimeObj(), "m") % iCount;
  1823 + var iTempTime;
  1824 +
  1825 + for (j = 0; j < iCount - iC2; j++) {
  1826 + iTempTime = aBc[j + 1].getFcTimeObj().diff(aBc[j].getFcTimeObj(), "m");
  1827 + aBc[j + 1].addMinuteToFcsj(iC1 - iTempTime);
  1828 + }
  1829 + for (j = 0; j < iC2; j++) {
  1830 + iTempTime = aBc[iCount - iC2 + j + 1].getFcTimeObj().diff(aBc[iCount - iC2 + j].getFcTimeObj(), "m");
  1831 + aBc[iCount - iC2 + j + 1].addMinuteToFcsj(iC1 + 1 - iTempTime);
  1832 + }
  1833 +
  1834 + },
  1835 +
  1836 + /**
  1837 + * 计算高峰平均停站时间。
  1838 + */
  1839 + fnCalcuAverPeakStopTime: function() {
  1840 + var i;
  1841 + var j;
  1842 + var aBc;
  1843 + var iBcCount = 0;
  1844 + var iSum = 0;
  1845 + for (i = 0; i < _internalLpArray.length; i++) {
  1846 + aBc = _internalLpArray[i].getBcArray();
  1847 +
  1848 + for (j = 0; j < aBc.length; j++) {
  1849 + if (!_paramObj.isTroughBc(aBc[j].getArrTimeObj())) {
  1850 + iBcCount ++;
  1851 + iSum += aBc[j].getStopTime();
  1852 + }
  1853 + }
  1854 + }
  1855 +
  1856 + return Math.floor(iSum / iBcCount);
  1857 + },
  1858 +
  1859 + /**
  1860 + * 计算低谷平均停站时间。
  1861 + */
  1862 + fnCalcuAverTroughStopTime: function() {
  1863 + var i;
  1864 + var j;
  1865 + var aBc;
  1866 + var iBcCount = 0;
  1867 + var iSum = 0;
  1868 + for (i = 0; i < _internalLpArray.length; i++) {
  1869 + aBc = _internalLpArray[i].getBcArray();
  1870 + for (j = 0; j < aBc.length; j++) {
  1871 + if (_paramObj.isTroughBc(aBc[j].getArrTimeObj())) {
  1872 + iBcCount ++;
  1873 + iSum += aBc[j].getStopTime();
  1874 + }
  1875 + }
  1876 + }
  1877 +
  1878 + return Math.floor(iSum / iBcCount);
  1879 + },
  1880 +
  1881 + //------------- 其他方法 -------------//
  1882 + /**
  1883 + * 返回内部路牌数据列表。
  1884 + * @returns {Array}
  1885 + */
  1886 + fnGetLpArray: function() {
  1887 + return _internalLpArray;
  1888 + },
  1889 +
  1890 + /**
  1891 + * 内部数据转化成显示用的班次数组。
  1892 + */
  1893 + fnToGanttBcArray: function() {
  1894 + var aAllBc = [];
  1895 + var aLpBc = [];
  1896 + var aEatBc = [];
  1897 + var oLp;
  1898 + var i;
  1899 + var j;
  1900 +
  1901 + for (i = 0; i < _internalLpArray.length; i++) {
  1902 + oLp = _internalLpArray[i];
  1903 + aLpBc = [];
  1904 + aLpBc = aLpBc.concat(oLp.getOtherBcArray(), oLp.getBcArray());
  1905 +
  1906 + aEatBc = [];
  1907 + // 根据班次的吃饭时间添加吃饭班次
  1908 + for (j = 0; j < aLpBc.length; j++) {
  1909 + if (aLpBc[j].fnGetEatTime() > 0) {
  1910 + aEatBc.push(_factory.createBcObj(
  1911 + oLp,
  1912 + "cf",
  1913 + !aLpBc[j].isUp(), // 和上一个班次方向相反
  1914 + 1,
  1915 + _paramObj.addMinute(aLpBc[j].getArrTimeObj(), aLpBc[j].getStopTime()), // 使用上一个班次的到达时间作为开始时间
  1916 + _paramObj
  1917 + ));
  1918 + }
  1919 + }
  1920 + aLpBc = aLpBc.concat(aEatBc);
  1921 +
  1922 + // 按照发车时间排序
  1923 + aLpBc.sort(function(o1, o2) {
  1924 + if (o1.getFcTimeObj().isBefore(o2.getFcTimeObj())) {
  1925 + return -1;
  1926 + } else {
  1927 + return 1;
  1928 + }
  1929 + });
  1930 +
  1931 + // 重新赋值fcno
  1932 + for (j = 0; j < aLpBc.length; j++) {
  1933 + aLpBc[j].fnSetFcno(j + 1);
  1934 + }
  1935 +
  1936 + aAllBc = aAllBc.concat(aLpBc);
  1937 + }
  1938 +
  1939 + var aGanttBc = [];
  1940 + for (i = 0; i < aAllBc.length; i++) {
  1941 + aGanttBc.push(aAllBc[i].toGanttBcObj());
  1942 + }
  1943 +
  1944 + return aGanttBc;
  1945 + }
  1946 +
  1947 + };
  1948 +
1949 }; 1949 };
1950 \ No newline at end of file 1950 \ No newline at end of file
src/main/resources/static/pages/base/timesmodel/js/v2/main_v2.js
1 -/**  
2 - * 主类。  
3 - */  
4 -var Main_v2 = function() {  
5 -  
6 - // 内部工厂类  
7 - var _factoryFun = function() {  
8 - return {  
9 - // 创建参数  
10 - createParameterObj: function(formMap, dataMap) {  
11 - var paramObj = ParameterObj();  
12 - paramObj.wrap(formMap, dataMap);  
13 - return paramObj;  
14 - },  
15 - // 创建班次对象  
16 - createBcObj: function(lpObj, bcType, isUp, fcno, fcTimeObj, paramObj) {  
17 - var _bclc = paramObj.calcuTravelLcNumber(isUp, bcType);  
18 - var _fcsj = fcTimeObj;  
19 - var _bcsj = paramObj.calcuTravelTime(_fcsj, isUp);  
20 - var _arrsj = paramObj.addMinute(_fcsj, _bcsj);  
21 - //var _stoptime = paramObj.fnCalcuFixedStopNumber(_arrsj, !isUp, _bcsj);  
22 - var _stoptime = paramObj.fnCalcuFixedStopNumber(_arrsj, !isUp, undefined);  
23 - var _tccid = paramObj.getTTinfoId();  
24 - var _ttinfoid = paramObj.getTTinfoId();  
25 - var _xl = paramObj.getXlId();  
26 - var _qdz = isUp ? paramObj.getUpQdzObj().id : paramObj.getDownQdzObj().id;  
27 - var _zdz = isUp ? paramObj.getUpZdzObj().id : paramObj.getDownZdzObj().id;  
28 -  
29 - if (bcType == "bd") { // 早例保,传过来的发车时间是第一个班次的发车时间  
30 - if (isUp) { // 上行  
31 - _fcsj = paramObj.addMinute(  
32 - _fcsj,  
33 - -(paramObj.getUpOutTime() + paramObj.getLbTime()));  
34 - _bcsj = paramObj.getLbTime();  
35 - _arrsj = paramObj.addMinute(_fcsj, _bcsj);  
36 - _stoptime = 0;  
37 - } else { // 下行  
38 - _fcsj = paramObj.addMinute(  
39 - _fcsj,  
40 - -(paramObj.getDownOutTime() + paramObj.getLbTime()));  
41 - _bcsj = paramObj.getLbTime();  
42 - _arrsj = paramObj.addMinute(_fcsj, _bcsj);  
43 - _stoptime = 0;  
44 - }  
45 - } else if (bcType == "lc") { // 晚例保,传过来的发车时间是最后一个班次的到达时间  
46 - if (isUp) { // 上行  
47 - _fcsj = paramObj.addMinute(  
48 - _fcsj,  
49 - paramObj.getUpInTime());  
50 - _bcsj = paramObj.getLbTime();  
51 - _arrsj = paramObj.addMinute(_fcsj, _bcsj);  
52 - _stoptime = 0;  
53 - } else { // 下行  
54 - _fcsj = paramObj.addMinute(  
55 - _fcsj,  
56 - paramObj.getDownInTime());  
57 - _bcsj = paramObj.getLbTime();  
58 - _arrsj = paramObj.addMinute(_fcsj, _bcsj);  
59 - _stoptime = 0;  
60 - }  
61 - } else if (bcType == "out") { // 出场,传过来的发车时间是第一个班次的发车时间  
62 - if (isUp) { // 上行  
63 - _fcsj = paramObj.addMinute(  
64 - _fcsj,  
65 - -paramObj.getUpOutTime());  
66 - _bcsj = paramObj.getUpOutTime();  
67 - _arrsj = paramObj.addMinute(_fcsj, _bcsj);  
68 - _stoptime = 0;  
69 - } else { // 下行  
70 - _fcsj = paramObj.addMinute(  
71 - _fcsj,  
72 - -paramObj.getDownOutTime());  
73 - _bcsj = paramObj.getDownOutTime();  
74 - _arrsj = paramObj.addMinute(_fcsj, _bcsj);  
75 - _stoptime = 0;  
76 - }  
77 - } else if (bcType == "in") { // 进场,传过来的发车时间是最后一个班次的到达时间  
78 - if (isUp) { // 上行  
79 - _bcsj = paramObj.getUpInTime();  
80 - _arrsj = paramObj.addMinute(_fcsj, _bcsj);  
81 - _stoptime = 0;  
82 - } else { // 下行  
83 - _bcsj = paramObj.getDownInTime();  
84 - _arrsj = paramObj.addMinute(_fcsj, _bcsj);  
85 - _stoptime = 0;  
86 - }  
87 - } else if (bcType == "cf") { // 吃饭班次  
88 - // 以13:00为分界,之前的为午饭,之后的为晚饭  
89 - if (fcTimeObj.isBefore(paramObj.toTimeObj("13:00"))) {  
90 - _bcsj = paramObj.fnGetLunchTime();  
91 - } else {  
92 - _bcsj = paramObj.fnGetDinnerTime();  
93 - }  
94 - _arrsj = paramObj.addMinute(_fcsj, _bcsj);  
95 - _stoptime = 0;  
96 - }  
97 -  
98 - var bcParamObj = {};  
99 - bcParamObj.bcType = bcType; // 班次类型(normal,in_,out, bd, lc, cf等)  
100 - bcParamObj.isUp = isUp; // boolean是否上下行  
101 - bcParamObj.fcno = fcno; // 发车顺序号  
102 - bcParamObj.fcTimeObj = _fcsj; // 发车时间对象  
103 - bcParamObj.bclc = _bclc; // 班次里程  
104 - bcParamObj.bcsj = _bcsj; // 班次历时  
105 - bcParamObj.arrtime = _arrsj; // 到达时间对象  
106 - bcParamObj.stoptime = _stoptime; // 停站时间  
107 - bcParamObj.tccid = _tccid; // 停车场id  
108 - bcParamObj.ttinfoid = _ttinfoid; // 时刻表id  
109 - bcParamObj.xl = _xl; // 线路id  
110 - bcParamObj.qdzid = _qdz; // 起点站id  
111 - bcParamObj.zdzid = _zdz; // 终点站id  
112 -  
113 - return new InternalBcObj(lpObj, bcParamObj);  
114 - }  
115 - };  
116 - };  
117 - var _factory = _factoryFun();  
118 -  
119 - // 所有的时间使用moment.js计算  
120 -  
121 - var _paramObj; // 参数对象  
122 -  
123 - var _bxDesc = [ // 班型描述  
124 - {'type':'六工一休','hoursV':6.66, 'minueV':'6:40', 'qcount': 0, 'avertime': 0},  
125 - {'type':'五工一休','hoursV':6.85, 'minueV':'6:51', 'qcount': 0, 'avertime': 0},  
126 - {'type':'四工一休','hoursV':7.14, 'minueV':'7:08', 'qcount': 0, 'avertime': 0},  
127 - {'type':'三工一休','hoursV':7.61, 'minueV':'7:37', 'qcount': 0, 'avertime': 0},  
128 - {'type':'二工一休','hoursV':8.57, 'minueV':'8:34', 'qcount': 0, 'avertime': 0},  
129 - {'type':'一工一休','hoursV':11.42, 'minueV':'11:25', 'qcount': 0, 'avertime': 0},  
130 - {'type':'五工二休','hoursV':7.99, 'minueV':'8:00', 'qcount': 0, 'avertime': 0},  
131 - {'type':'无工休', 'hoursV':5.43, 'minueV':'5:43', 'qcount': 0, 'avertime': 0}  
132 - ];  
133 -  
134 - var _funCalcuExportData_lpObjList = function(aInternalLpObj) {  
135 - // 构造路牌对象  
136 - var aLpObj = [];  
137 - var i;  
138 - var j;  
139 - var z;  
140 - var oInternalLp;  
141 - var oInternalBc;  
142 - var oLp;  
143 - var iZbc;  
144 - var iZgs;  
145 - for (i = 0; i < aInternalLpObj.length; i++) {  
146 - oInternalLp = aInternalLpObj[i];  
147 - iZbc = 0;  
148 - iZgs = 0;  
149 - oLp = {  
150 - "lpname": oInternalLp.getLpName(), // 路牌名字  
151 - "isUp": oInternalLp.isUp(), // 每圈的第一个班次是否上行  
152 - "bcObjList": [], // 班次列表  
153 - "groupCount": oInternalLp.fnGetGroupCount(), // 总圈数  
154 - "zgs": 0, // 总工时  
155 - "zbc": 0, // 总班次  
156 - "stationRouteId1": 0, // 第一个班次起点站路由id  
157 - "stationRouteId2": 0 // 第二个班次起点站路由id  
158 - };  
159 -  
160 - // 将报到班次,进出场班次加到班次的时间上  
161 - var iBcChainCount;  
162 - var oStartBc;  
163 - var oEndBc;  
164 - var oTempBc;  
165 - var aFcsj = [];  
166 -  
167 - iBcChainCount = oInternalLp.fnGetBcChainCount();  
168 - if (iBcChainCount == 1) { // 单一车次链,连班班型  
169 - oStartBc = oInternalLp.getBc(  
170 - oInternalLp.fnGetBcChainInfo(0)["s_q"],  
171 - oInternalLp.fnGetBcChainInfo(0)["s_b"]  
172 - );  
173 - oTempBc = _factory.createBcObj(  
174 - oLp, "bd", true, 1,  
175 - oStartBc.getFcTimeObj(),  
176 - _paramObj  
177 - );  
178 - aFcsj.push("(到" + oTempBc.getFcTimeObj().format("HH:mm") + ")");  
179 - oTempBc = _factory.createBcObj(  
180 - oLp, "out", true, 1,  
181 - oStartBc.getFcTimeObj(),  
182 - _paramObj  
183 - );  
184 - aFcsj.push("(出" + oTempBc.getFcTimeObj().format("HH:mm") + ")");  
185 - aFcsj.push("(" + oStartBc.getFcTimeObj().format("HH:mm") + ")");  
186 - oStartBc._$_fcsj_desc = aFcsj.join("");  
187 -  
188 - aFcsj = [];  
189 -  
190 - oEndBc = oInternalLp.getBc(  
191 - oInternalLp.fnGetBcChainInfo(0)["e_q"],  
192 - oInternalLp.fnGetBcChainInfo(0)["e_b"]  
193 - );  
194 - aFcsj.push("(" + oStartBc.getFcTimeObj().format("HH:mm") + ")");  
195 - oTempBc = _factory.createBcObj(  
196 - oLp, "in", true, 1,  
197 - oEndBc.getArrTimeObj(),  
198 - _paramObj  
199 - );  
200 - aFcsj.push("(进" + oTempBc.getFcTimeObj().format("HH:mm") + ")");  
201 - oTempBc = _factory.createBcObj(  
202 - oLp, "lc", true, 1,  
203 - oEndBc.getArrTimeObj(),  
204 - _paramObj  
205 - );  
206 - aFcsj.push("(离" + oTempBc.getFcTimeObj().format("HH:mm") + ")");  
207 - oEndBc._$_fcsj_desc = aFcsj.join("");  
208 -  
209 - } else if (iBcChainCount == 2) { // 两个车次链,分班班型  
210 - oStartBc = oInternalLp.getBc(  
211 - oInternalLp.fnGetBcChainInfo(0)["s_q"],  
212 - oInternalLp.fnGetBcChainInfo(0)["s_b"]  
213 - );  
214 - oTempBc = _factory.createBcObj(  
215 - oLp, "bd", true, 1,  
216 - oStartBc.getFcTimeObj(),  
217 - _paramObj  
218 - );  
219 - aFcsj.push("(到" + oTempBc.getFcTimeObj().format("HH:mm") + ")");  
220 - oTempBc = _factory.createBcObj(  
221 - oLp, "out", true, 1,  
222 - oStartBc.getFcTimeObj(),  
223 - _paramObj  
224 - );  
225 - aFcsj.push("(出" + oTempBc.getFcTimeObj().format("HH:mm") + ")");  
226 - aFcsj.push("(" + oStartBc.getFcTimeObj().format("HH:mm") + ")");  
227 - oStartBc._$_fcsj_desc = aFcsj.join("");  
228 -  
229 - aFcsj = [];  
230 -  
231 - oEndBc = oInternalLp.getBc(  
232 - oInternalLp.fnGetBcChainInfo(0)["e_q"],  
233 - oInternalLp.fnGetBcChainInfo(0)["e_b"]  
234 - );  
235 - aFcsj.push("(" + oStartBc.getFcTimeObj().format("HH:mm") + ")");  
236 - oTempBc = _factory.createBcObj(  
237 - oLp, "in", true, 1,  
238 - oEndBc.getArrTimeObj(),  
239 - _paramObj  
240 - );  
241 - aFcsj.push("(进" + oTempBc.getFcTimeObj().format("HH:mm") + ")");  
242 - oTempBc = _factory.createBcObj(  
243 - oLp, "lc", true, 1,  
244 - oEndBc.getArrTimeObj(),  
245 - _paramObj  
246 - );  
247 - oEndBc._$_fcsj_desc = aFcsj.join("");  
248 -  
249 - aFcsj = [];  
250 -  
251 - oStartBc = oInternalLp.getBc(  
252 - oInternalLp.fnGetBcChainInfo(1)["s_q"],  
253 - oInternalLp.fnGetBcChainInfo(1)["s_b"]  
254 - );  
255 - oTempBc = _factory.createBcObj(  
256 - oLp, "out", true, 1,  
257 - oStartBc.getFcTimeObj(),  
258 - _paramObj  
259 - );  
260 - aFcsj.push("(出" + oTempBc.getFcTimeObj().format("HH:mm") + ")");  
261 - aFcsj.push("(" + oStartBc.getFcTimeObj().format("HH:mm") + ")");  
262 - oStartBc._$_fcsj_desc = aFcsj.join("");  
263 -  
264 - aFcsj = [];  
265 -  
266 - oEndBc = oInternalLp.getBc(  
267 - oInternalLp.fnGetBcChainInfo(1)["e_q"],  
268 - oInternalLp.fnGetBcChainInfo(1)["e_b"]  
269 - );  
270 - aFcsj.push("(" + oStartBc.getFcTimeObj().format("HH:mm") + ")");  
271 - oTempBc = _factory.createBcObj(  
272 - oLp, "in", true, 1,  
273 - oEndBc.getArrTimeObj(),  
274 - _paramObj  
275 - );  
276 - aFcsj.push("(进" + oTempBc.getFcTimeObj().format("HH:mm") + ")");  
277 - oTempBc = _factory.createBcObj(  
278 - oLp, "lc", true, 1,  
279 - oEndBc.getArrTimeObj(),  
280 - _paramObj  
281 - );  
282 - aFcsj.push("(离" + oTempBc.getFcTimeObj().format("HH:mm") + ")");  
283 - oEndBc._$_fcsj_desc = aFcsj.join("");  
284 -  
285 - }  
286 -  
287 - for (j = 0; j < oInternalLp.fnGetGroupCount(); j++) {  
288 - for (z = 0; z < 2; z++) {  
289 - oInternalBc = oInternalLp.getBc(j, z);  
290 - if (oInternalBc) {  
291 - if (oInternalBc.fnGetEatTime() > 0) {  
292 - oInternalBc._$_fcsj_desc = "(吃" + oInternalBc.getFcTimeObj().format("HH:mm") + ")";  
293 - }  
294 -  
295 - oLp.bcObjList.push({  
296 - "bcsj": oInternalBc.getBcTime(), // 班次时间  
297 - "ssj": oInternalBc.getStopTime(), // 停站时间  
298 - "eatsj": oInternalBc.fnGetEatTime(), // 吃饭时间  
299 -  
300 - "tccid": oInternalBc._$_tccid, // 停车场id  
301 - "qdzid": oInternalBc._$_qdzid, // 起点站id  
302 - "zdzid": oInternalBc._$_zdzid, // 终点站id  
303 -  
304 - "isUp": oInternalBc._$_isUp, // 是否上行  
305 -  
306 - "bcType": oInternalBc._$_bcType, // 班次类型  
307 - "fcsj": oInternalBc._$_fcsj_desc || oInternalBc._$_fcsjObj.format("HH:mm"), // 发车时间描述  
308 -  
309 - "groupNo": j, // 第几圈  
310 - "groupBcNo": z // 圈里第几个班次  
311 -  
312 - });  
313 -  
314 - iZgs = iZgs +  
315 - oInternalBc.getBcTime() + // 班次时间  
316 - oInternalBc.getStopTime() + // 停站时间  
317 - oInternalBc.fnGetEatTime(); // 吃饭时间  
318 - iZbc = iZbc + 1;  
319 -  
320 - // 设置圈站点路由id  
321 - if (oInternalBc.isUp() == oInternalLp.isUp()) { // 第一个班次  
322 - if (oLp.stationRouteId1 == 0) {  
323 - oLp.stationRouteId1 = oInternalBc._$_qdzid;  
324 - }  
325 - } else { // 第二个班次  
326 - if (oLp.stationRouteId2 == 0) {  
327 - oLp.stationRouteId2 = oInternalBc._$_qdzid;  
328 - }  
329 - }  
330 -  
331 - }  
332 - }  
333 -  
334 - }  
335 -  
336 - for (z = 0; z < oInternalLp.getOtherBcArray().length; z++) {  
337 - oInternalBc = oInternalLp.getOtherBcArray()[z];  
338 - iZgs = iZgs +  
339 - oInternalBc.getBcTime() + // 班次时间  
340 - oInternalBc.getStopTime(); // 停站时间  
341 - if (oInternalBc._$_bcType != "bd" &&  
342 - oInternalBc._$_bcType != "lc" &&  
343 - oInternalBc._$_bcType != "cf") {  
344 - iZbc = iZbc + 1;  
345 - }  
346 - }  
347 -  
348 - oLp.zgs = iZgs;  
349 - oLp.zbc = iZbc;  
350 - aLpObj.push(oLp);  
351 - }  
352 -  
353 - return aLpObj;  
354 - };  
355 -  
356 - var _funCalcuExportData_statInfoList = function(aInternalLpObj) {  
357 - var countBc = 0, // 总班次  
358 - serviceBc = 0, // 营运班次  
359 - jcbc = 0, // 进场总班次.  
360 - ccbc = 0, // 出场总班次.  
361 - cfbc = 0, // 吃饭总班次.  
362 - zwlbbc = 0, // 早晚例保总班次.  
363 - countGs = 0.0, // 总工时  
364 - servicesj = 0, // 营运班次总时间  
365 - jcsj = 0.0, // 进场总时间.  
366 - ccsj = 0.0, // 出场总时间.  
367 - cfsj = 0.0, // 吃饭总时间.  
368 - zwlbsj = 0.0, // 早晚例保总时间.  
369 - ksBc = 0, // 空驶班次  
370 - serviceLc = 0.0, // 营运里程  
371 - ksLc = 0.0, // 空驶里程  
372 - avgTzjx = 0.0, // 平均停站间隙  
373 - gfServiceBc = 0, // 高峰营运班次  
374 - dgServiceBc = 0, // 低谷营运班次  
375 - gfAvgTzjx = 0.0, // 高峰平均停站间隙  
376 - dgAvgTzjx = 0.0; // 低谷平均停站间隙  
377 -  
378 - var aAllBc = [];  
379 - var oLp;  
380 - var oBc;  
381 - var i;  
382 - var j;  
383 -  
384 - for (i = 0; i < aInternalLpObj.length; i++) {  
385 - oLp = aInternalLpObj[i];  
386 - for (j = 0; j < oLp.getBcArray().length; j++) {  
387 - aAllBc.push(oLp.getBcArray()[j]);  
388 - }  
389 - for (j = 0; j < oLp.getOtherBcArray().length; j++) {  
390 - aAllBc.push(oLp.getOtherBcArray()[j]);  
391 - }  
392 - }  
393 -  
394 - for (i = 0; i < aAllBc.length; i++) {  
395 - oBc = aAllBc[i];  
396 -  
397 - if (oBc.getBcTime() > 0) {  
398 - countBc = countBc + 1;  
399 - countGs = countGs + oBc.getStopTime() + oBc.getBcTime();  
400 - if (_paramObj.isTroughBc(oBc.getFcTimeObj())) {  
401 - if (oBc._$_bcType == "normal") {  
402 - dgServiceBc = dgServiceBc + 1;  
403 - dgAvgTzjx = dgAvgTzjx + oBc.getStopTime();  
404 - }  
405 - } else {  
406 - if (oBc._$_bcType == "normal") {  
407 - gfServiceBc = gfServiceBc + 1;  
408 - gfAvgTzjx = gfAvgTzjx + oBc.getStopTime();  
409 - }  
410 - }  
411 -  
412 - if (oBc._$_bcType == "normal") {  
413 - serviceBc = serviceBc + 1;  
414 - serviceLc = serviceLc + oBc._$_bclc;  
415 - servicesj = servicesj + oBc.getBcTime();  
416 - avgTzjx = avgTzjx + oBc.getStopTime();  
417 -  
418 - if (oBc.fnGetEatTime() > 0) {  
419 - cfbc = cfbc + 1;  
420 - cfsj = cfsj + oBc.fnGetEatTime();  
421 - }  
422 - } else if (oBc._$_bcType == "in") {  
423 - jcbc = jcbc + 1;  
424 - jcsj = jcsj + oBc.getBcTime();  
425 - } else if (oBc._$_bcType == "out") {  
426 - ccbc = ccbc + 1;  
427 - ccsj = ccsj + oBc.getBcTime();  
428 - } else if (oBc._$_bcType == "bd") {  
429 - zwlbbc = zwlbbc + 1;  
430 - zwlbsj = zwlbsj + oBc.getBcTime();  
431 - } else if (oBc._$_bcType == "lc") {  
432 - zwlbbc = zwlbbc + 1;  
433 - zwlbsj = zwlbsj + oBc.getBcTime();  
434 - }  
435 - }  
436 - }  
437 -  
438 - dgAvgTzjx = dgAvgTzjx / dgServiceBc;  
439 - gfAvgTzjx = gfAvgTzjx / gfServiceBc;  
440 - avgTzjx = avgTzjx / dgServiceBc;  
441 -  
442 - return [  
443 - {'statItem': '总班次(包括进出场、吃饭时间、早晚例保、营运且班次时间大于零的班次)', 'statValue': countBc},  
444 - {'statItem': '进场总班次(包括进场且班次时间大于零的班次)', 'statValue': jcbc},  
445 - {'statItem': '出场总班次(包括进场且班次时间大于零的班次)', 'statValue': ccbc},  
446 - {'statItem': '吃饭总班次(包括吃饭且班次时间大于零的班次)', 'statValue': cfbc},  
447 - {'statItem': '早晚例保总班次(包括早晚例保且时间大于零的班次)', 'statValue': zwlbbc},  
448 - {'statItem': '营运总班次(包括正常、区间、放大站且班次时间大于零班次)','statValue': serviceBc},  
449 - {'statItem': '进场总时间(包括进场班次且班次时间大于零)', 'statValue': jcsj/60},  
450 - {'statItem': '出场总时间(包括进场班次且班次时间大于零)', 'statValue': ccsj/60},  
451 - {'statItem': '吃饭总时间(包括吃饭班次且班次时间大于零)', 'statValue': cfsj/60},  
452 - {'statItem': '早晚例保总时间(包括早晚例保班次且时间大于零的)', 'statValue': zwlbsj/60},  
453 - {'statItem': '营运班次总时间(包括正常、区间、放大站且班次时间大于零)', 'statValue': servicesj/60},  
454 - {'statItem': '总工时(包括进出场、吃饭时间、早晚例保、营运班次时间)', 'statValue': countGs/60},  
455 - {'statItem': '空驶班次(包括直放班次)', 'statValue': ksBc},  
456 - {'statItem': '营运里程(包括正常、区间、放大站里程)', 'statValue': serviceLc},  
457 - {'statItem': '空驶里程(包括直放里程)', 'statValue': ksLc},  
458 - {'statItem': '平均停站时间(营运班次停站时间总和/营运总班次)', 'statValue': avgTzjx},  
459 - {'statItem': '高峰营运班次(包括早晚高峰时段的正常、区间、放大站班次)', 'statValue': gfServiceBc},  
460 - {'statItem': '低谷营运班次(包括低谷时段的正常、区间、放大站班次)', 'statValue': dgServiceBc},  
461 - {'statItem': '高峰平均停站间隙(高峰营运班次停站时间总和/高峰营运班次总和)', 'statValue': gfAvgTzjx},  
462 - {'statItem': '低谷平均停站间隙(低谷营运班次停站时间总和/低谷营运班次总和)', 'statValue': dgAvgTzjx},  
463 - {'statItem': '综合评估', 'statValue': 3}  
464 - ];  
465 -  
466 - };  
467 -  
468 - return {  
469 - /**  
470 - * 工厂对象,创建不同的对象。  
471 - * @returns {{createParameterObj, createBcObj}}  
472 - */  
473 - getFactory: function() {  
474 - return _factory;  
475 - },  
476 -  
477 - /**  
478 - * 使用发车间隔策略生成时刻表。  
479 - * @param paramObj 参数对象  
480 - * @param lpArray 路牌数组  
481 - * @constructor  
482 - */  
483 - BXPplaceClassesTime03 : function(paramObj, lpArray) {  
484 - // 参数对象  
485 - _paramObj = paramObj;  
486 -  
487 - // 1、初始化行车计划  
488 - var schedule = new InternalScheduleObj(_paramObj, lpArray, _factory);  
489 - schedule.fnInitDataWithBxLayout();  
490 - // 2、将连班路牌的班次补足  
491 - schedule.fnCalcuLpBx_lb();  
492 -  
493 - // 3、修正针对初始化时生成的高峰班次,之前不足的补上,多余的删除  
494 - schedule.fnAdjustGfbc(true, true); // 修正上行早高峰  
495 - schedule.fnAdjustGfbc(true, false); // 修正下行早高峰  
496 - schedule.fnAdjustGfbc(false, true); // 修正上行晚高峰  
497 - schedule.fnAdjustGfbc(false, false); // 修正下行晚高峰  
498 -  
499 - // 6、补吃饭班次  
500 - schedule.fnCalcuEatBc();  
501 -  
502 - // 4、按照车辆投入运营要求补充班次  
503 - schedule.fnCalcuLpBc_yy();  
504 -  
505 - // 5、根据班型补充所有的不足班次  
506 - schedule.fnCalcuLpBx_5_2();  
507 - schedule.fnCalcuLpBx_other();  
508 -  
509 - // 7、祛除上标线开头有删除标记的班次  
510 - schedule.fnRemoveDelFirstFlagBc();  
511 -  
512 - // TODO:8、调整路牌班次间隔  
513 - schedule.fnAdjustLpBcInterval(1);  
514 -  
515 - // TODO:9、调整纵向班次间隔  
516 - schedule.fnAdjustBcInterval(true, false, 10);  
517 - schedule.fnAdjustBcInterval(false, false, 10);  
518 -  
519 - // 10、确定末班车  
520 - schedule.fnCalcuLastBc();  
521 -  
522 - // 11、祛除上标线结尾有删除标记的班次  
523 - schedule.fnRemoveDelLastFlagBc();  
524 -  
525 - // TODO:12、平均化指定时间后的班次列表间隔  
526 - schedule.fnAdjustBcInterval2_avg(true, _paramObj.toTimeObj("19:50"));  
527 - schedule.fnAdjustBcInterval2_avg(false, _paramObj.toTimeObj("19:50"));  
528 -  
529 - // 10、补进出场例保班次  
530 - schedule.fnCalcuOtherBc();  
531 -  
532 - //-------------------- 输出ganut图上的班次,班型描述 ----------------------//  
533 - // TODO:班型再议  
534 - return {  
535 - 'json':schedule.fnToGanttBcArray(),'bxrcgs':null,  
536 - 'aInternalLpObj': schedule.fnGetLpArray()  
537 - };  
538 -  
539 - },  
540 - /**  
541 - * 导出时刻表配置。  
542 - * @param aInternalLpObj 内部路牌对象列表  
543 - */  
544 - exportDataConfig: function(aInternalLpObj) {  
545 - $('.exportAdd').on('click',function() {  
546 - var aInfos = {  
547 - "lpObjList": _funCalcuExportData_lpObjList(aInternalLpObj), // 路牌班次信息列表  
548 - "statInfoList": _funCalcuExportData_statInfoList(aInternalLpObj) // 统计项目列表  
549 - };  
550 -  
551 - console.log(aInfos);  
552 -  
553 - $(".exportAdd").addClass("disabled");  
554 - $(".exportAdd").html("<i class=\"fa fa-spinner\" aria-hidden=\"true\"></i>" + " 正在导出...");  
555 -  
556 - // 提交  
557 - $.ajax({  
558 - type: 'POST',  
559 - url: "/tidc/exportDTDFile",  
560 - dataType: 'binary',  
561 - contentType: "application/json",  
562 - data: JSON.stringify(aInfos),  
563 - success: function(data){  
564 - Main_v2.downloadFile(data, "application/octet-stream", "时刻表信息.xls");  
565 -  
566 - $(".exportAdd").removeClass("disabled");  
567 - $(".exportAdd").html("<i class=\"fa fa-file-excel-o\"></i>" + " 导出数据");  
568 - },  
569 - error: function(xhr, type){  
570 - alert('错误:TODO');  
571 -  
572 - $(".exportAdd").removeClass("disabled");  
573 - $(".exportAdd").html("<i class=\"fa fa-file-excel-o\"></i>" + " 导出数据");  
574 - }  
575 - });  
576 -  
577 - });  
578 - },  
579 -  
580 - downloadFile: function (data, mimeType, fileName) {  
581 - var success = false;  
582 - var blob = new Blob([data], { type: mimeType });  
583 - try {  
584 - if (navigator.msSaveBlob)  
585 - navigator.msSaveBlob(blob, fileName);  
586 - else {  
587 - // Try using other saveBlob implementations, if available  
588 - var saveBlob = navigator.webkitSaveBlob || navigator.mozSaveBlob || navigator.saveBlob;  
589 - if (saveBlob === undefined) throw "Not supported";  
590 - saveBlob(blob, fileName);  
591 - }  
592 - success = true;  
593 - } catch (ex) {  
594 - console.log("saveBlob method failed with the following exception:");  
595 - console.log(ex);  
596 - }  
597 -  
598 - if (!success) {  
599 - // Get the blob url creator  
600 - var urlCreator = window.URL || window.webkitURL || window.mozURL || window.msURL;  
601 - if (urlCreator) {  
602 - // Try to use a download link  
603 - var link = document.createElement('a');  
604 - if ('download' in link) {  
605 - // Try to simulate a click  
606 - try {  
607 - // Prepare a blob URL  
608 - var url = urlCreator.createObjectURL(blob);  
609 - link.setAttribute('href', url);  
610 -  
611 - // Set the download attribute (Supported in Chrome 14+ / Firefox 20+)  
612 - link.setAttribute("download", fileName);  
613 -  
614 - // Simulate clicking the download link  
615 - var event = document.createEvent('MouseEvents');  
616 - event.initMouseEvent('click', true, true, window, 1, 0, 0, 0, 0, false, false, false, false, 0, null);  
617 - link.dispatchEvent(event);  
618 - success = true;  
619 -  
620 - } catch (ex) {  
621 - console.log("Download link method with simulated click failed with the following exception:");  
622 - console.log(ex);  
623 - }  
624 - }  
625 -  
626 - if (!success) {  
627 - // Fallback to window.location method  
628 - try {  
629 - // Prepare a blob URL  
630 - // Use application/octet-stream when using window.location to force download  
631 - var url = urlCreator.createObjectURL(blob);  
632 - window.location = url;  
633 - console.log("Download link method with window.location succeeded");  
634 - success = true;  
635 - } catch (ex) {  
636 - console.log("Download link method with window.location failed with the following exception:");  
637 - console.log(ex);  
638 - }  
639 - }  
640 - }  
641 - }  
642 -  
643 - if (!success) {  
644 - // Fallback to window.open method  
645 - console.log("No methods worked for saving the arraybuffer, using last resort window.open");  
646 - window.open("", '_blank', '');  
647 - }  
648 - }  
649 -  
650 - };  
651 -  
652 -}(); 1 +/**
  2 + * 主类。
  3 + */
  4 +var Main_v2 = function() {
  5 +
  6 + // 内部工厂类
  7 + var _factoryFun = function() {
  8 + return {
  9 + // 创建参数
  10 + createParameterObj: function(formMap, dataMap) {
  11 + var paramObj = ParameterObj();
  12 + paramObj.wrap(formMap, dataMap);
  13 + return paramObj;
  14 + },
  15 + // 创建班次对象
  16 + createBcObj: function(lpObj, bcType, isUp, fcno, fcTimeObj, paramObj) {
  17 + var _bclc = paramObj.calcuTravelLcNumber(isUp, bcType);
  18 + var _fcsj = fcTimeObj;
  19 + var _bcsj = paramObj.calcuTravelTime(_fcsj, isUp);
  20 + var _arrsj = paramObj.addMinute(_fcsj, _bcsj);
  21 + //var _stoptime = paramObj.fnCalcuFixedStopNumber(_arrsj, !isUp, _bcsj);
  22 + var _stoptime = paramObj.fnCalcuFixedStopNumber(_arrsj, !isUp, undefined);
  23 + var _tccid = paramObj.getTTinfoId();
  24 + var _ttinfoid = paramObj.getTTinfoId();
  25 + var _xl = paramObj.getXlId();
  26 + var _qdz = isUp ? paramObj.getUpQdzObj().id : paramObj.getDownQdzObj().id;
  27 + var _zdz = isUp ? paramObj.getUpZdzObj().id : paramObj.getDownZdzObj().id;
  28 +
  29 + if (bcType == "bd") { // 早例保,传过来的发车时间是第一个班次的发车时间
  30 + if (isUp) { // 上行
  31 + _fcsj = paramObj.addMinute(
  32 + _fcsj,
  33 + -(paramObj.getUpOutTime() + paramObj.getLbTime()));
  34 + _bcsj = paramObj.getLbTime();
  35 + _arrsj = paramObj.addMinute(_fcsj, _bcsj);
  36 + _stoptime = 0;
  37 + } else { // 下行
  38 + _fcsj = paramObj.addMinute(
  39 + _fcsj,
  40 + -(paramObj.getDownOutTime() + paramObj.getLbTime()));
  41 + _bcsj = paramObj.getLbTime();
  42 + _arrsj = paramObj.addMinute(_fcsj, _bcsj);
  43 + _stoptime = 0;
  44 + }
  45 + } else if (bcType == "lc") { // 晚例保,传过来的发车时间是最后一个班次的到达时间
  46 + if (isUp) { // 上行
  47 + _fcsj = paramObj.addMinute(
  48 + _fcsj,
  49 + paramObj.getUpInTime());
  50 + _bcsj = paramObj.getLbTime();
  51 + _arrsj = paramObj.addMinute(_fcsj, _bcsj);
  52 + _stoptime = 0;
  53 + } else { // 下行
  54 + _fcsj = paramObj.addMinute(
  55 + _fcsj,
  56 + paramObj.getDownInTime());
  57 + _bcsj = paramObj.getLbTime();
  58 + _arrsj = paramObj.addMinute(_fcsj, _bcsj);
  59 + _stoptime = 0;
  60 + }
  61 + } else if (bcType == "out") { // 出场,传过来的发车时间是第一个班次的发车时间
  62 + if (isUp) { // 上行
  63 + _fcsj = paramObj.addMinute(
  64 + _fcsj,
  65 + -paramObj.getUpOutTime());
  66 + _bcsj = paramObj.getUpOutTime();
  67 + _arrsj = paramObj.addMinute(_fcsj, _bcsj);
  68 + _stoptime = 0;
  69 + } else { // 下行
  70 + _fcsj = paramObj.addMinute(
  71 + _fcsj,
  72 + -paramObj.getDownOutTime());
  73 + _bcsj = paramObj.getDownOutTime();
  74 + _arrsj = paramObj.addMinute(_fcsj, _bcsj);
  75 + _stoptime = 0;
  76 + }
  77 + } else if (bcType == "in") { // 进场,传过来的发车时间是最后一个班次的到达时间
  78 + if (isUp) { // 上行
  79 + _bcsj = paramObj.getUpInTime();
  80 + _arrsj = paramObj.addMinute(_fcsj, _bcsj);
  81 + _stoptime = 0;
  82 + } else { // 下行
  83 + _bcsj = paramObj.getDownInTime();
  84 + _arrsj = paramObj.addMinute(_fcsj, _bcsj);
  85 + _stoptime = 0;
  86 + }
  87 + } else if (bcType == "cf") { // 吃饭班次
  88 + // 以13:00为分界,之前的为午饭,之后的为晚饭
  89 + if (fcTimeObj.isBefore(paramObj.toTimeObj("13:00"))) {
  90 + _bcsj = paramObj.fnGetLunchTime();
  91 + } else {
  92 + _bcsj = paramObj.fnGetDinnerTime();
  93 + }
  94 + _arrsj = paramObj.addMinute(_fcsj, _bcsj);
  95 + _stoptime = 0;
  96 + }
  97 +
  98 + var bcParamObj = {};
  99 + bcParamObj.bcType = bcType; // 班次类型(normal,in_,out, bd, lc, cf等)
  100 + bcParamObj.isUp = isUp; // boolean是否上下行
  101 + bcParamObj.fcno = fcno; // 发车顺序号
  102 + bcParamObj.fcTimeObj = _fcsj; // 发车时间对象
  103 + bcParamObj.bclc = _bclc; // 班次里程
  104 + bcParamObj.bcsj = _bcsj; // 班次历时
  105 + bcParamObj.arrtime = _arrsj; // 到达时间对象
  106 + bcParamObj.stoptime = _stoptime; // 停站时间
  107 + bcParamObj.tccid = _tccid; // 停车场id
  108 + bcParamObj.ttinfoid = _ttinfoid; // 时刻表id
  109 + bcParamObj.xl = _xl; // 线路id
  110 + bcParamObj.qdzid = _qdz; // 起点站id
  111 + bcParamObj.zdzid = _zdz; // 终点站id
  112 +
  113 + return new InternalBcObj(lpObj, bcParamObj);
  114 + }
  115 + };
  116 + };
  117 + var _factory = _factoryFun();
  118 +
  119 + // 所有的时间使用moment.js计算
  120 +
  121 + var _paramObj; // 参数对象
  122 +
  123 + var _bxDesc = [ // 班型描述
  124 + {'type':'六工一休','hoursV':6.66, 'minueV':'6:40', 'qcount': 0, 'avertime': 0},
  125 + {'type':'五工一休','hoursV':6.85, 'minueV':'6:51', 'qcount': 0, 'avertime': 0},
  126 + {'type':'四工一休','hoursV':7.14, 'minueV':'7:08', 'qcount': 0, 'avertime': 0},
  127 + {'type':'三工一休','hoursV':7.61, 'minueV':'7:37', 'qcount': 0, 'avertime': 0},
  128 + {'type':'二工一休','hoursV':8.57, 'minueV':'8:34', 'qcount': 0, 'avertime': 0},
  129 + {'type':'一工一休','hoursV':11.42, 'minueV':'11:25', 'qcount': 0, 'avertime': 0},
  130 + {'type':'五工二休','hoursV':7.99, 'minueV':'8:00', 'qcount': 0, 'avertime': 0},
  131 + {'type':'无工休', 'hoursV':5.43, 'minueV':'5:43', 'qcount': 0, 'avertime': 0}
  132 + ];
  133 +
  134 + var _funCalcuExportData_lpObjList = function(aInternalLpObj) {
  135 + // 构造路牌对象
  136 + var aLpObj = [];
  137 + var i;
  138 + var j;
  139 + var z;
  140 + var oInternalLp;
  141 + var oInternalBc;
  142 + var oInternalBc_temp;
  143 + var oLp;
  144 + var iZbc;
  145 + var iZgs;
  146 + for (i = 0; i < aInternalLpObj.length; i++) {
  147 + oInternalLp = aInternalLpObj[i];
  148 + iZbc = 0;
  149 + iZgs = 0;
  150 + oLp = {
  151 + "lpname": oInternalLp.getLpName(), // 路牌名字
  152 + "isUp": oInternalLp.isUp(), // 每圈的第一个班次是否上行
  153 + "bcObjList": [], // 班次列表
  154 + "groupCount": oInternalLp.fnGetGroupCount(), // 总圈数
  155 + "zgs": 0, // 总工时
  156 + "zbc": 0, // 总班次
  157 + "stationRouteId1": 0, // 第一个班次起点站路由id
  158 + "stationRouteId2": 0 // 第二个班次起点站路由id
  159 + };
  160 +
  161 + // 将报到班次,进出场班次加到班次的时间上
  162 + var iBcChainCount;
  163 + var oStartBc;
  164 + var oEndBc;
  165 + var oTempBc;
  166 + var aFcsj = [];
  167 +
  168 + iBcChainCount = oInternalLp.fnGetBcChainCount();
  169 + if (iBcChainCount == 1) { // 单一车次链,连班班型
  170 + oStartBc = oInternalLp.getBc(
  171 + oInternalLp.fnGetBcChainInfo(0)["s_q"],
  172 + oInternalLp.fnGetBcChainInfo(0)["s_b"]
  173 + );
  174 + oTempBc = _factory.createBcObj(
  175 + oLp, "bd", true, 1,
  176 + oStartBc.getFcTimeObj(),
  177 + _paramObj
  178 + );
  179 + aFcsj.push("(到" + oTempBc.getFcTimeObj().format("HH:mm") + ")");
  180 + oTempBc = _factory.createBcObj(
  181 + oLp, "out", true, 1,
  182 + oStartBc.getFcTimeObj(),
  183 + _paramObj
  184 + );
  185 + aFcsj.push("(出" + oTempBc.getFcTimeObj().format("HH:mm") + ")");
  186 + aFcsj.push("(" + oStartBc.getFcTimeObj().format("HH:mm") + ")");
  187 + oStartBc._$_fcsj_desc = aFcsj.join("");
  188 +
  189 + oLp.bcObjList.push({ // 出场班次
  190 + "bcsj": oTempBc.getBcTime(), // 班次时间
  191 + "ssj": oTempBc.getStopTime(), // 停站时间
  192 + "eatsj": oTempBc.fnGetEatTime(), // 吃饭时间
  193 +
  194 + "tccid": oTempBc._$_tccid, // 停车场id
  195 + "qdzid": oTempBc._$_qdzid, // 起点站id
  196 + "zdzid": oTempBc._$_zdzid, // 终点站id
  197 +
  198 + "isUp": oTempBc._$_isUp, // 是否上行
  199 +
  200 + "bcType": oTempBc._$_bcType, // 班次类型
  201 + "fcsj": oTempBc._$_fcsjObj.format("HH:mm"), // 发车时间描述
  202 +
  203 + "groupNo": -1, // 第几圈
  204 + "groupBcNo": -1 // 圈里第几个班次
  205 +
  206 + });
  207 +
  208 + aFcsj = [];
  209 +
  210 + oEndBc = oInternalLp.getBc(
  211 + oInternalLp.fnGetBcChainInfo(0)["e_q"],
  212 + oInternalLp.fnGetBcChainInfo(0)["e_b"]
  213 + );
  214 + aFcsj.push("(" + oEndBc.getFcTimeObj().format("HH:mm") + ")");
  215 + oTempBc = _factory.createBcObj(
  216 + oLp, "in", true, 1,
  217 + oEndBc.getArrTimeObj(),
  218 + _paramObj
  219 + );
  220 + aFcsj.push("(进" + oTempBc.getFcTimeObj().format("HH:mm") + ")");
  221 +
  222 + oLp.bcObjList.push({ // 进场班次
  223 + "bcsj": oTempBc.getBcTime(), // 班次时间
  224 + "ssj": oTempBc.getStopTime(), // 停站时间
  225 + "eatsj": oTempBc.fnGetEatTime(), // 吃饭时间
  226 +
  227 + "tccid": oTempBc._$_tccid, // 停车场id
  228 + "qdzid": oTempBc._$_qdzid, // 起点站id
  229 + "zdzid": oTempBc._$_zdzid, // 终点站id
  230 +
  231 + "isUp": oTempBc._$_isUp, // 是否上行
  232 +
  233 + "bcType": oTempBc._$_bcType, // 班次类型
  234 + "fcsj": oTempBc._$_fcsjObj.format("HH:mm"), // 发车时间描述
  235 +
  236 + "groupNo": -2, // 第几圈
  237 + "groupBcNo": -2 // 圈里第几个班次
  238 +
  239 + });
  240 +
  241 + oTempBc = _factory.createBcObj(
  242 + oLp, "lc", true, 1,
  243 + oEndBc.getArrTimeObj(),
  244 + _paramObj
  245 + );
  246 + aFcsj.push("(离" + oTempBc.getFcTimeObj().format("HH:mm") + ")");
  247 + oEndBc._$_fcsj_desc = aFcsj.join("");
  248 +
  249 + } else if (iBcChainCount == 2) { // 两个车次链,分班班型
  250 + oStartBc = oInternalLp.getBc(
  251 + oInternalLp.fnGetBcChainInfo(0)["s_q"],
  252 + oInternalLp.fnGetBcChainInfo(0)["s_b"]
  253 + );
  254 + oTempBc = _factory.createBcObj(
  255 + oLp, "bd", true, 1,
  256 + oStartBc.getFcTimeObj(),
  257 + _paramObj
  258 + );
  259 + aFcsj.push("(到" + oTempBc.getFcTimeObj().format("HH:mm") + ")");
  260 + oTempBc = _factory.createBcObj(
  261 + oLp, "out", true, 1,
  262 + oStartBc.getFcTimeObj(),
  263 + _paramObj
  264 + );
  265 + aFcsj.push("(出" + oTempBc.getFcTimeObj().format("HH:mm") + ")");
  266 + aFcsj.push("(" + oStartBc.getFcTimeObj().format("HH:mm") + ")");
  267 + oStartBc._$_fcsj_desc = aFcsj.join("");
  268 +
  269 + oLp.bcObjList.push({ // 出场班次
  270 + "bcsj": oTempBc.getBcTime(), // 班次时间
  271 + "ssj": oTempBc.getStopTime(), // 停站时间
  272 + "eatsj": oTempBc.fnGetEatTime(), // 吃饭时间
  273 +
  274 + "tccid": oTempBc._$_tccid, // 停车场id
  275 + "qdzid": oTempBc._$_qdzid, // 起点站id
  276 + "zdzid": oTempBc._$_zdzid, // 终点站id
  277 +
  278 + "isUp": oTempBc._$_isUp, // 是否上行
  279 +
  280 + "bcType": oTempBc._$_bcType, // 班次类型
  281 + "fcsj": oTempBc._$_fcsjObj.format("HH:mm"), // 发车时间描述
  282 +
  283 + "groupNo": -1, // 第几圈
  284 + "groupBcNo": -1 // 圈里第几个班次
  285 +
  286 + });
  287 +
  288 + aFcsj = [];
  289 +
  290 + oEndBc = oInternalLp.getBc(
  291 + oInternalLp.fnGetBcChainInfo(0)["e_q"],
  292 + oInternalLp.fnGetBcChainInfo(0)["e_b"]
  293 + );
  294 + aFcsj.push("(" + oEndBc.getFcTimeObj().format("HH:mm") + ")");
  295 + oTempBc = _factory.createBcObj(
  296 + oLp, "in", true, 1,
  297 + oEndBc.getArrTimeObj(),
  298 + _paramObj
  299 + );
  300 + aFcsj.push("(进" + oTempBc.getFcTimeObj().format("HH:mm") + ")");
  301 + oTempBc = _factory.createBcObj(
  302 + oLp, "lc", true, 1,
  303 + oEndBc.getArrTimeObj(),
  304 + _paramObj
  305 + );
  306 + oEndBc._$_fcsj_desc = aFcsj.join("");
  307 +
  308 + aFcsj = [];
  309 +
  310 + oStartBc = oInternalLp.getBc(
  311 + oInternalLp.fnGetBcChainInfo(1)["s_q"],
  312 + oInternalLp.fnGetBcChainInfo(1)["s_b"]
  313 + );
  314 + oTempBc = _factory.createBcObj(
  315 + oLp, "out", true, 1,
  316 + oStartBc.getFcTimeObj(),
  317 + _paramObj
  318 + );
  319 + aFcsj.push("(出" + oTempBc.getFcTimeObj().format("HH:mm") + ")");
  320 + aFcsj.push("(" + oStartBc.getFcTimeObj().format("HH:mm") + ")");
  321 + oStartBc._$_fcsj_desc = aFcsj.join("");
  322 +
  323 + aFcsj = [];
  324 +
  325 + oEndBc = oInternalLp.getBc(
  326 + oInternalLp.fnGetBcChainInfo(1)["e_q"],
  327 + oInternalLp.fnGetBcChainInfo(1)["e_b"]
  328 + );
  329 + aFcsj.push("(" + oEndBc.getFcTimeObj().format("HH:mm") + ")");
  330 + oTempBc = _factory.createBcObj(
  331 + oLp, "in", true, 1,
  332 + oEndBc.getArrTimeObj(),
  333 + _paramObj
  334 + );
  335 + aFcsj.push("(进" + oTempBc.getFcTimeObj().format("HH:mm") + ")");
  336 +
  337 + oLp.bcObjList.push({ // 进场班次
  338 + "bcsj": oTempBc.getBcTime(), // 班次时间
  339 + "ssj": oTempBc.getStopTime(), // 停站时间
  340 + "eatsj": oTempBc.fnGetEatTime(), // 吃饭时间
  341 +
  342 + "tccid": oTempBc._$_tccid, // 停车场id
  343 + "qdzid": oTempBc._$_qdzid, // 起点站id
  344 + "zdzid": oTempBc._$_zdzid, // 终点站id
  345 +
  346 + "isUp": oTempBc._$_isUp, // 是否上行
  347 +
  348 + "bcType": oTempBc._$_bcType, // 班次类型
  349 + "fcsj": oTempBc._$_fcsjObj.format("HH:mm"), // 发车时间描述
  350 +
  351 + "groupNo": -2, // 第几圈
  352 + "groupBcNo": -2 // 圈里第几个班次
  353 +
  354 + });
  355 +
  356 + oTempBc = _factory.createBcObj(
  357 + oLp, "lc", true, 1,
  358 + oEndBc.getArrTimeObj(),
  359 + _paramObj
  360 + );
  361 + aFcsj.push("(离" + oTempBc.getFcTimeObj().format("HH:mm") + ")");
  362 + oEndBc._$_fcsj_desc = aFcsj.join("");
  363 +
  364 + }
  365 +
  366 + for (j = 0; j < oInternalLp.fnGetGroupCount(); j++) {
  367 + for (z = 0; z < 2; z++) {
  368 + oInternalBc = oInternalLp.getBc(j, z);
  369 + if (oInternalBc) {
  370 + if (oInternalBc.fnGetEatTime() > 0) {
  371 + // 吃饭班次是下一个班次开始吃,和本班次方向相反
  372 + oInternalBc_temp = oInternalLp.getBc(
  373 + z == 1 ? j + 1 : j,
  374 + z == 1 ? 0 : 1);
  375 +
  376 + oInternalBc_temp._$_fcsj_desc = "(吃" + oInternalBc_temp.getFcTimeObj().format("HH:mm") + ")";
  377 + }
  378 +
  379 + oLp.bcObjList.push({
  380 + "bcsj": oInternalBc.getBcTime(), // 班次时间
  381 + "ssj": oInternalBc.getStopTime(), // 停站时间
  382 + "eatsj": oInternalBc.fnGetEatTime(), // 吃饭时间
  383 +
  384 + "tccid": oInternalBc._$_tccid, // 停车场id
  385 + "qdzid": oInternalBc._$_qdzid, // 起点站id
  386 + "zdzid": oInternalBc._$_zdzid, // 终点站id
  387 +
  388 + "isUp": oInternalBc._$_isUp, // 是否上行
  389 +
  390 + "bcType": oInternalBc._$_bcType, // 班次类型
  391 + "fcsj": oInternalBc._$_fcsjObj.format("HH:mm"), // 发车时间描述
  392 + "fcsjDesc" : oInternalBc._$_fcsj_desc || oInternalBc._$_fcsjObj.format("HH:mm"),
  393 +
  394 + "groupNo": j, // 第几圈
  395 + "groupBcNo": z // 圈里第几个班次
  396 +
  397 + });
  398 +
  399 + iZgs = iZgs +
  400 + oInternalBc.getBcTime() + // 班次时间
  401 + oInternalBc.getStopTime() + // 停站时间
  402 + oInternalBc.fnGetEatTime(); // 吃饭时间
  403 + iZbc = iZbc + 1;
  404 +
  405 + // 设置圈站点路由id
  406 + if (oInternalBc.isUp() == oInternalLp.isUp()) { // 第一个班次
  407 + if (oLp.stationRouteId1 == 0) {
  408 + oLp.stationRouteId1 = oInternalBc._$_qdzid;
  409 + }
  410 + } else { // 第二个班次
  411 + if (oLp.stationRouteId2 == 0) {
  412 + oLp.stationRouteId2 = oInternalBc._$_qdzid;
  413 + }
  414 + }
  415 +
  416 + }
  417 + }
  418 +
  419 + }
  420 +
  421 + for (z = 0; z < oInternalLp.getOtherBcArray().length; z++) {
  422 + oInternalBc = oInternalLp.getOtherBcArray()[z];
  423 + iZgs = iZgs +
  424 + oInternalBc.getBcTime() + // 班次时间
  425 + oInternalBc.getStopTime(); // 停站时间
  426 + if (oInternalBc._$_bcType != "bd" &&
  427 + oInternalBc._$_bcType != "lc" &&
  428 + oInternalBc._$_bcType != "cf") {
  429 + iZbc = iZbc + 1;
  430 + }
  431 + }
  432 +
  433 + oLp.zgs = iZgs;
  434 + oLp.zbc = iZbc;
  435 + aLpObj.push(oLp);
  436 + }
  437 +
  438 + return aLpObj;
  439 + };
  440 +
  441 + var _funCalcuExportData_statInfoList = function(aInternalLpObj) {
  442 + var countBc = 0, // 总班次
  443 + serviceBc = 0, // 营运班次
  444 + jcbc = 0, // 进场总班次.
  445 + ccbc = 0, // 出场总班次.
  446 + cfbc = 0, // 吃饭总班次.
  447 + zwlbbc = 0, // 早晚例保总班次.
  448 + countGs = 0.0, // 总工时
  449 + servicesj = 0, // 营运班次总时间
  450 + jcsj = 0.0, // 进场总时间.
  451 + ccsj = 0.0, // 出场总时间.
  452 + cfsj = 0.0, // 吃饭总时间.
  453 + zwlbsj = 0.0, // 早晚例保总时间.
  454 + ksBc = 0, // 空驶班次
  455 + serviceLc = 0.0, // 营运里程
  456 + ksLc = 0.0, // 空驶里程
  457 + avgTzjx = 0.0, // 平均停站间隙
  458 + gfServiceBc = 0, // 高峰营运班次
  459 + dgServiceBc = 0, // 低谷营运班次
  460 + gfAvgTzjx = 0.0, // 高峰平均停站间隙
  461 + dgAvgTzjx = 0.0; // 低谷平均停站间隙
  462 +
  463 + var aAllBc = [];
  464 + var oLp;
  465 + var oBc;
  466 + var i;
  467 + var j;
  468 +
  469 + for (i = 0; i < aInternalLpObj.length; i++) {
  470 + oLp = aInternalLpObj[i];
  471 + for (j = 0; j < oLp.getBcArray().length; j++) {
  472 + aAllBc.push(oLp.getBcArray()[j]);
  473 + }
  474 + for (j = 0; j < oLp.getOtherBcArray().length; j++) {
  475 + aAllBc.push(oLp.getOtherBcArray()[j]);
  476 + }
  477 + }
  478 +
  479 + for (i = 0; i < aAllBc.length; i++) {
  480 + oBc = aAllBc[i];
  481 +
  482 + if (oBc.getBcTime() > 0) {
  483 + countBc = countBc + 1;
  484 + countGs = countGs + oBc.getStopTime() + oBc.getBcTime();
  485 + if (_paramObj.isTroughBc(oBc.getFcTimeObj())) {
  486 + if (oBc._$_bcType == "normal") {
  487 + dgServiceBc = dgServiceBc + 1;
  488 + dgAvgTzjx = dgAvgTzjx + oBc.getStopTime();
  489 + }
  490 + } else {
  491 + if (oBc._$_bcType == "normal") {
  492 + gfServiceBc = gfServiceBc + 1;
  493 + gfAvgTzjx = gfAvgTzjx + oBc.getStopTime();
  494 + }
  495 + }
  496 +
  497 + if (oBc._$_bcType == "normal") {
  498 + serviceBc = serviceBc + 1;
  499 + serviceLc = serviceLc + oBc._$_bclc;
  500 + servicesj = servicesj + oBc.getBcTime();
  501 + avgTzjx = avgTzjx + oBc.getStopTime();
  502 +
  503 + if (oBc.fnGetEatTime() > 0) {
  504 + cfbc = cfbc + 1;
  505 + cfsj = cfsj + oBc.fnGetEatTime();
  506 + }
  507 + } else if (oBc._$_bcType == "in") {
  508 + jcbc = jcbc + 1;
  509 + jcsj = jcsj + oBc.getBcTime();
  510 + } else if (oBc._$_bcType == "out") {
  511 + ccbc = ccbc + 1;
  512 + ccsj = ccsj + oBc.getBcTime();
  513 + } else if (oBc._$_bcType == "bd") {
  514 + zwlbbc = zwlbbc + 1;
  515 + zwlbsj = zwlbsj + oBc.getBcTime();
  516 + } else if (oBc._$_bcType == "lc") {
  517 + zwlbbc = zwlbbc + 1;
  518 + zwlbsj = zwlbsj + oBc.getBcTime();
  519 + }
  520 + }
  521 + }
  522 +
  523 + dgAvgTzjx = dgAvgTzjx / dgServiceBc;
  524 + gfAvgTzjx = gfAvgTzjx / gfServiceBc;
  525 + avgTzjx = avgTzjx / dgServiceBc;
  526 +
  527 + return [
  528 + {'statItem': '总班次(包括进出场、吃饭时间、早晚例保、营运且班次时间大于零的班次)', 'statValue': countBc},
  529 + {'statItem': '进场总班次(包括进场且班次时间大于零的班次)', 'statValue': jcbc},
  530 + {'statItem': '出场总班次(包括进场且班次时间大于零的班次)', 'statValue': ccbc},
  531 + {'statItem': '吃饭总班次(包括吃饭且班次时间大于零的班次)', 'statValue': cfbc},
  532 + {'statItem': '早晚例保总班次(包括早晚例保且时间大于零的班次)', 'statValue': zwlbbc},
  533 + {'statItem': '营运总班次(包括正常、区间、放大站且班次时间大于零班次)','statValue': serviceBc},
  534 + {'statItem': '进场总时间(包括进场班次且班次时间大于零)', 'statValue': jcsj/60},
  535 + {'statItem': '出场总时间(包括进场班次且班次时间大于零)', 'statValue': ccsj/60},
  536 + {'statItem': '吃饭总时间(包括吃饭班次且班次时间大于零)', 'statValue': cfsj/60},
  537 + {'statItem': '早晚例保总时间(包括早晚例保班次且时间大于零的)', 'statValue': zwlbsj/60},
  538 + {'statItem': '营运班次总时间(包括正常、区间、放大站且班次时间大于零)', 'statValue': servicesj/60},
  539 + {'statItem': '总工时(包括进出场、吃饭时间、早晚例保、营运班次时间)', 'statValue': countGs/60},
  540 + {'statItem': '空驶班次(包括直放班次)', 'statValue': ksBc},
  541 + {'statItem': '营运里程(包括正常、区间、放大站里程)', 'statValue': serviceLc},
  542 + {'statItem': '空驶里程(包括直放里程)', 'statValue': ksLc},
  543 + {'statItem': '平均停站时间(营运班次停站时间总和/营运总班次)', 'statValue': avgTzjx},
  544 + {'statItem': '高峰营运班次(包括早晚高峰时段的正常、区间、放大站班次)', 'statValue': gfServiceBc},
  545 + {'statItem': '低谷营运班次(包括低谷时段的正常、区间、放大站班次)', 'statValue': dgServiceBc},
  546 + {'statItem': '高峰平均停站间隙(高峰营运班次停站时间总和/高峰营运班次总和)', 'statValue': gfAvgTzjx},
  547 + {'statItem': '低谷平均停站间隙(低谷营运班次停站时间总和/低谷营运班次总和)', 'statValue': dgAvgTzjx},
  548 + {'statItem': '综合评估', 'statValue': 3}
  549 + ];
  550 +
  551 + };
  552 +
  553 + return {
  554 + /**
  555 + * 工厂对象,创建不同的对象。
  556 + * @returns {{createParameterObj, createBcObj}}
  557 + */
  558 + getFactory: function() {
  559 + return _factory;
  560 + },
  561 +
  562 + /**
  563 + * 使用发车间隔策略生成时刻表。
  564 + * @param paramObj 参数对象
  565 + * @param lpArray 路牌数组
  566 + * @constructor
  567 + */
  568 + BXPplaceClassesTime03 : function(paramObj, lpArray) {
  569 + // 参数对象
  570 + _paramObj = paramObj;
  571 +
  572 + // 1、初始化行车计划
  573 + var schedule = new InternalScheduleObj(_paramObj, lpArray, _factory);
  574 + schedule.fnInitDataWithBxLayout();
  575 + // 2、将连班路牌的班次补足
  576 + schedule.fnCalcuLpBx_lb();
  577 +
  578 + // 3、修正针对初始化时生成的高峰班次,之前不足的补上,多余的删除
  579 + schedule.fnAdjustGfbc(true, true); // 修正上行早高峰
  580 + schedule.fnAdjustGfbc(true, false); // 修正下行早高峰
  581 + schedule.fnAdjustGfbc(false, true); // 修正上行晚高峰
  582 + schedule.fnAdjustGfbc(false, false); // 修正下行晚高峰
  583 +
  584 + // 6、补吃饭班次
  585 + schedule.fnCalcuEatBc();
  586 +
  587 + // 4、按照车辆投入运营要求补充班次
  588 + schedule.fnCalcuLpBc_yy();
  589 +
  590 + // 5、根据班型补充所有的不足班次
  591 + schedule.fnCalcuLpBx_5_2();
  592 + schedule.fnCalcuLpBx_other();
  593 +
  594 + // 7、祛除上标线开头有删除标记的班次
  595 + schedule.fnRemoveDelFirstFlagBc();
  596 +
  597 + // TODO:8、调整路牌班次间隔
  598 + schedule.fnAdjustLpBcInterval(1);
  599 +
  600 + // TODO:9、调整纵向班次间隔
  601 + schedule.fnAdjustBcInterval(true, false, 10);
  602 + schedule.fnAdjustBcInterval(false, false, 10);
  603 +
  604 + // 10、确定末班车
  605 + schedule.fnCalcuLastBc();
  606 +
  607 + // 11、祛除上标线结尾有删除标记的班次
  608 + schedule.fnRemoveDelLastFlagBc();
  609 +
  610 + // TODO:12、平均化指定时间后的班次列表间隔
  611 + schedule.fnAdjustBcInterval2_avg(true, _paramObj.toTimeObj("19:50"));
  612 + schedule.fnAdjustBcInterval2_avg(false, _paramObj.toTimeObj("19:50"));
  613 +
  614 + // 10、补进出场例保班次
  615 + schedule.fnCalcuOtherBc();
  616 +
  617 + //-------------------- 输出ganut图上的班次,班型描述 ----------------------//
  618 + // TODO:班型再议
  619 + return {
  620 + 'json':schedule.fnToGanttBcArray(),'bxrcgs':null,
  621 + 'aInternalLpObj': schedule.fnGetLpArray()
  622 + };
  623 +
  624 + },
  625 + /**
  626 + * 导出时刻表配置。
  627 + * @param aInternalLpObj 内部路牌对象列表
  628 + */
  629 + exportDataConfig: function(aInternalLpObj) {
  630 + $('.exportAdd').on('click',function() {
  631 + var aInfos = {
  632 + "lpObjList": _funCalcuExportData_lpObjList(aInternalLpObj), // 路牌班次信息列表
  633 + "statInfoList": _funCalcuExportData_statInfoList(aInternalLpObj) // 统计项目列表
  634 + };
  635 +
  636 + console.log(aInfos);
  637 +
  638 + $(".exportAdd").addClass("disabled");
  639 + $(".exportAdd").html("<i class=\"fa fa-spinner\" aria-hidden=\"true\"></i>" + " 正在导出...");
  640 +
  641 + // 提交
  642 + $.ajax({
  643 + type: 'POST',
  644 + url: "/tidc/exportDTDFile",
  645 + dataType: 'binary',
  646 + contentType: "application/json",
  647 + data: JSON.stringify(aInfos),
  648 + success: function(data){
  649 + Main_v2.downloadFile(data, "application/octet-stream", "时刻表信息.xls");
  650 +
  651 + $(".exportAdd").removeClass("disabled");
  652 + $(".exportAdd").html("<i class=\"fa fa-file-excel-o\"></i>" + " 导出数据");
  653 + },
  654 + error: function(xhr, type){
  655 + alert('错误:TODO');
  656 +
  657 + $(".exportAdd").removeClass("disabled");
  658 + $(".exportAdd").html("<i class=\"fa fa-file-excel-o\"></i>" + " 导出数据");
  659 + }
  660 + });
  661 +
  662 + });
  663 + },
  664 +
  665 + downloadFile: function (data, mimeType, fileName) {
  666 + var success = false;
  667 + var blob = new Blob([data], { type: mimeType });
  668 + try {
  669 + if (navigator.msSaveBlob)
  670 + navigator.msSaveBlob(blob, fileName);
  671 + else {
  672 + // Try using other saveBlob implementations, if available
  673 + var saveBlob = navigator.webkitSaveBlob || navigator.mozSaveBlob || navigator.saveBlob;
  674 + if (saveBlob === undefined) throw "Not supported";
  675 + saveBlob(blob, fileName);
  676 + }
  677 + success = true;
  678 + } catch (ex) {
  679 + console.log("saveBlob method failed with the following exception:");
  680 + console.log(ex);
  681 + }
  682 +
  683 + if (!success) {
  684 + // Get the blob url creator
  685 + var urlCreator = window.URL || window.webkitURL || window.mozURL || window.msURL;
  686 + if (urlCreator) {
  687 + // Try to use a download link
  688 + var link = document.createElement('a');
  689 + if ('download' in link) {
  690 + // Try to simulate a click
  691 + try {
  692 + // Prepare a blob URL
  693 + var url = urlCreator.createObjectURL(blob);
  694 + link.setAttribute('href', url);
  695 +
  696 + // Set the download attribute (Supported in Chrome 14+ / Firefox 20+)
  697 + link.setAttribute("download", fileName);
  698 +
  699 + // Simulate clicking the download link
  700 + var event = document.createEvent('MouseEvents');
  701 + event.initMouseEvent('click', true, true, window, 1, 0, 0, 0, 0, false, false, false, false, 0, null);
  702 + link.dispatchEvent(event);
  703 + success = true;
  704 +
  705 + } catch (ex) {
  706 + console.log("Download link method with simulated click failed with the following exception:");
  707 + console.log(ex);
  708 + }
  709 + }
  710 +
  711 + if (!success) {
  712 + // Fallback to window.location method
  713 + try {
  714 + // Prepare a blob URL
  715 + // Use application/octet-stream when using window.location to force download
  716 + var url = urlCreator.createObjectURL(blob);
  717 + window.location = url;
  718 + console.log("Download link method with window.location succeeded");
  719 + success = true;
  720 + } catch (ex) {
  721 + console.log("Download link method with window.location failed with the following exception:");
  722 + console.log(ex);
  723 + }
  724 + }
  725 + }
  726 + }
  727 +
  728 + if (!success) {
  729 + // Fallback to window.open method
  730 + console.log("No methods worked for saving the arraybuffer, using last resort window.open");
  731 + window.open("", '_blank', '');
  732 + }
  733 + }
  734 +
  735 + };
  736 +
  737 +}();
src/main/resources/static/pages/forms/mould/waybill_minhang.xls
No preview for this file type
src/main/resources/static/pages/forms/mould/waybill_minhang_dl.xls
No preview for this file type
src/main/resources/static/pages/forms/statement/scheduleDailyQp.html
@@ -37,7 +37,7 @@ @@ -37,7 +37,7 @@
37 </div> 37 </div>
38 <div class="form-group"> 38 <div class="form-group">
39 <input class="btn btn-default" type="button" id="query" value="查询"/> 39 <input class="btn btn-default" type="button" id="query" value="查询"/>
40 - <input class="btn btn-default" type="button" id="month" value="按月查询"/> 40 +<!-- <input class="btn btn-default" type="button" id="month" value="按月查询"/> -->
41 <input class="btn btn-default" type="button" id="export" value="导出"/> 41 <input class="btn btn-default" type="button" id="export" value="导出"/>
42 </div> 42 </div>
43 </form> 43 </form>
src/main/resources/static/pages/forms/statement/waybill.html
@@ -361,8 +361,9 @@ @@ -361,8 +361,9 @@
361 } 361 }
362 }); 362 });
363 }); 363 });
364 - $get('/realSchedule/exportWaybillMore',{date:date,line:line,strs:JSON.stringify(param)},function(result){ 364 +// $get('/realSchedule/exportWaybillMore',{date:date,line:line,strs:JSON.stringify(param)},function(result){
365 // window.open("/downloadFile/downloadList?fileName="+result.fileName); //下载压缩包 365 // window.open("/downloadFile/downloadList?fileName="+result.fileName); //下载压缩包
  366 + $get('/busInterval/exportWaybillMore',{date:date,line:line,strs:JSON.stringify(param)},function(result){
366 window.open("/downloadFile/download?fileName="+result.fileName); 367 window.open("/downloadFile/download?fileName="+result.fileName);
367 layer.close(i); 368 layer.close(i);
368 }); 369 });
@@ -437,6 +438,13 @@ @@ -437,6 +438,13 @@
437 <td colspan="4">加注机油 &nbsp;升</td> 438 <td colspan="4">加注机油 &nbsp;升</td>
438 <td colspan="4">本日耗电 {{yh}}度</td> 439 <td colspan="4">本日耗电 {{yh}}度</td>
439 {{/if}} 440 {{/if}}
  441 + {{if type==2}}
  442 + <td colspan="2">出场存电 {{ccyl}}%</td>
  443 + <td colspan="2">充电量 {{jzl}}度</td>
  444 + <td colspan="2">进场存电 {{jcyl}}%</td>
  445 + <td colspan="4">加注机油 &nbsp;升</td>
  446 + <td colspan="4">本日耗电 {{yh}}度</td>
  447 + {{/if}}
440 </tr> 448 </tr>
441 <tr> 449 <tr>
442 <td rowspan="2">调度章</td> 450 <td rowspan="2">调度章</td>
src/main/resources/static/pages/oil/history/history.html
@@ -43,7 +43,7 @@ @@ -43,7 +43,7 @@
43 <div style="display: inline-block;margin-left: 24px;"> 43 <div style="display: inline-block;margin-left: 24px;">
44 <span class="item-label" style="width: 80px;">&nbsp;时间: </span> 44 <span class="item-label" style="width: 80px;">&nbsp;时间: </span>
45 <select class="form-control" id="date" style="width: 180px;"> 45 <select class="form-control" id="date" style="width: 180px;">
46 - <option value="2017-11-07">2017-11-07</option> 46 + <option value="2017-12-05">2017-12-05</option>
47 </select> 47 </select>
48 </div> 48 </div>
49 <div class="form-group"> 49 <div class="form-group">
src/main/resources/static/pages/scheduleApp/module/basicInfo/deviceInfoManage/detail.html
@@ -98,7 +98,7 @@ @@ -98,7 +98,7 @@
98 <label class="col-md-2 control-label">启用日期*:</label> 98 <label class="col-md-2 control-label">启用日期*:</label>
99 <div class="col-md-3"> 99 <div class="col-md-3">
100 <input type="text" class="form-control" 100 <input type="text" class="form-control"
101 - name="qyrq" uib-datepicker-popup="yyyy年MM月dd日" 101 + name="qyrq" uib-datepicker-popup="yyyy年MM月dd日 HH:mm"
102 ng-model="ctrl.deviceInfoForDetail.qyrq" readonly/> 102 ng-model="ctrl.deviceInfoForDetail.qyrq" readonly/>
103 </div> 103 </div>
104 </div> 104 </div>
src/main/resources/static/pages/scheduleApp/module/basicInfo/deviceInfoManage/edit.html
@@ -82,13 +82,8 @@ @@ -82,13 +82,8 @@
82 <div class="form-group has-success has-feedback"> 82 <div class="form-group has-success has-feedback">
83 <label class="col-md-2 control-label">旧终端号*:</label> 83 <label class="col-md-2 control-label">旧终端号*:</label>
84 <div class="col-md-3"> 84 <div class="col-md-3">
85 - <input type="text" class="form-control"  
86 - name="oldDeviceNo" ng-model="ctrl.deviceInfoForSave.oldDeviceNo"  
87 - required placeholder="请输入旧终端号"/>  
88 - </div>  
89 - <!-- 隐藏块,显示验证信息 -->  
90 - <div class="alert alert-danger well-sm" ng-show="myForm.oldDeviceNo.$error.required">  
91 - 旧终端号必须填写 85 + <input type="text" class="form-control" name="oldDeviceNo"
  86 + ng-model="ctrl.deviceInfoForSave.oldDeviceNo" readonly/>
92 </div> 87 </div>
93 </div> 88 </div>
94 89
@@ -143,31 +138,40 @@ @@ -143,31 +138,40 @@
143 </div> 138 </div>
144 </div> 139 </div>
145 140
  141 + <!--<div class="form-group has-success has-feedback">-->
  142 + <!--<label class="col-md-2 control-label">启用日期*:</label>-->
  143 + <!--<div class="col-md-3">-->
  144 + <!--<div class="input-group">-->
  145 + <!--<input type="text" class="form-control"-->
  146 + <!--name="qyrq" placeholder="请选择启用日期..."-->
  147 + <!--uib-datepicker-popup="yyyy年MM月dd日"-->
  148 + <!--is-open="ctrl.qyrqOpen" required-->
  149 + <!--ng-model="ctrl.deviceInfoForSave.qyrq" readonly-->
  150 + <!--remote-Validation-->
  151 + <!--remotevtype="cde1"-->
  152 + <!--remotevparam="{{ {'id_eq': ctrl.deviceInfoForSave.id, 'qyrq_eq': ctrl.deviceInfoForSave.qyrq, 'xl_eq': ctrl.deviceInfoForSave.xl, 'cl_eq': ctrl.deviceInfoForSave.cl} | json}}"/>-->
  153 + <!--<span class="input-group-btn">-->
  154 + <!--<button type="button" class="btn btn-default" ng-click="ctrl.qyrq_open()">-->
  155 + <!--<i class="glyphicon glyphicon-calendar"></i>-->
  156 + <!--</button>-->
  157 + <!--</span>-->
  158 + <!--</div>-->
  159 + <!--</div>-->
  160 + <!--&lt;!&ndash; 隐藏块,显示验证信息 &ndash;&gt;-->
  161 + <!--<div class="alert alert-danger well-sm" ng-show="myForm.qyrq.$error.required">-->
  162 + <!--启用日期必须选择-->
  163 + <!--</div>-->
  164 + <!--<div class="alert alert-danger well-sm" ng-show="myForm.qyrq.$error.remote">-->
  165 + <!--{{$remote_msg}}-->
  166 + <!--</div>-->
  167 + <!--</div>-->
  168 +
146 <div class="form-group has-success has-feedback"> 169 <div class="form-group has-success has-feedback">
147 <label class="col-md-2 control-label">启用日期*:</label> 170 <label class="col-md-2 control-label">启用日期*:</label>
148 <div class="col-md-3"> 171 <div class="col-md-3">
149 - <div class="input-group">  
150 - <input type="text" class="form-control"  
151 - name="qyrq" placeholder="请选择启用日期..."  
152 - uib-datepicker-popup="yyyy年MM月dd日"  
153 - is-open="ctrl.qyrqOpen" required  
154 - ng-model="ctrl.deviceInfoForSave.qyrq" readonly  
155 - remote-Validation  
156 - remotevtype="cde1"  
157 - remotevparam="{{ {'id_eq': ctrl.deviceInfoForSave.id, 'qyrq_eq': ctrl.deviceInfoForSave.qyrq, 'xl_eq': ctrl.deviceInfoForSave.xl, 'cl_eq': ctrl.deviceInfoForSave.cl} | json}}"/>  
158 - <span class="input-group-btn">  
159 - <button type="button" class="btn btn-default" ng-click="ctrl.qyrq_open()">  
160 - <i class="glyphicon glyphicon-calendar"></i>  
161 - </button>  
162 - </span>  
163 - </div>  
164 - </div>  
165 - <!-- 隐藏块,显示验证信息 -->  
166 - <div class="alert alert-danger well-sm" ng-show="myForm.qyrq.$error.required">  
167 - 启用日期必须选择  
168 - </div>  
169 - <div class="alert alert-danger well-sm" ng-show="myForm.qyrq.$error.remote">  
170 - {{$remote_msg}} 172 + <input type="text" class="form-control"
  173 + name="qyrq" uib-datepicker-popup="yyyy年MM月dd日 HH:mm"
  174 + ng-model="ctrl.deviceInfoForSave.qyrq" readonly/>
171 </div> 175 </div>
172 </div> 176 </div>
173 177
src/main/resources/static/pages/scheduleApp/module/basicInfo/deviceInfoManage/form.html
@@ -82,13 +82,8 @@ @@ -82,13 +82,8 @@
82 <div class="form-group has-success has-feedback"> 82 <div class="form-group has-success has-feedback">
83 <label class="col-md-2 control-label">旧终端号*:</label> 83 <label class="col-md-2 control-label">旧终端号*:</label>
84 <div class="col-md-3"> 84 <div class="col-md-3">
85 - <input type="text" class="form-control"  
86 - name="oldDeviceNo" ng-model="ctrl.deviceInfoForSave.oldDeviceNo"  
87 - required placeholder="请输入旧终端号"/>  
88 - </div>  
89 - <!-- 隐藏块,显示验证信息 -->  
90 - <div class="alert alert-danger well-sm" ng-show="myForm.oldDeviceNo.$error.required">  
91 - 旧终端号必须填写 85 + <input type="text" class="form-control" name="oldDeviceNo"
  86 + ng-model="ctrl.deviceInfoForSave.oldDeviceNo" readonly/>
92 </div> 87 </div>
93 </div> 88 </div>
94 89
@@ -143,23 +138,44 @@ @@ -143,23 +138,44 @@
143 </div> 138 </div>
144 </div> 139 </div>
145 140
  141 + <!--<div class="form-group has-success has-feedback">-->
  142 + <!--<label class="col-md-2 control-label">启用日期*:</label>-->
  143 + <!--<div class="col-md-3">-->
  144 + <!--<div class="input-group">-->
  145 + <!--<input type="text" class="form-control"-->
  146 + <!--name="qyrq" placeholder="请选择启用日期..."-->
  147 + <!--uib-datepicker-popup="yyyy年MM月dd日 hh:mm:ss"-->
  148 + <!--is-open="ctrl.qyrqOpen" required-->
  149 + <!--ng-model="ctrl.deviceInfoForSave.qyrq" readonly-->
  150 + <!--remote-Validation-->
  151 + <!--remotevtype="cde1"-->
  152 + <!--remotevparam="{{ {'qyrq_eq': ctrl.deviceInfoForSave.qyrq, 'xl_eq': ctrl.deviceInfoForSave.xl, 'cl_eq': ctrl.deviceInfoForSave.cl} | json}}"/>-->
  153 + <!--<span class="input-group-btn">-->
  154 + <!--<button type="button" class="btn btn-default" ng-click="ctrl.qyrq_open()">-->
  155 + <!--<i class="glyphicon glyphicon-calendar"></i>-->
  156 + <!--</button>-->
  157 + <!--</span>-->
  158 + <!--</div>-->
  159 + <!--</div>-->
  160 + <!--&lt;!&ndash; 隐藏块,显示验证信息 &ndash;&gt;-->
  161 + <!--<div class="alert alert-danger well-sm" ng-show="myForm.qyrq.$error.required">-->
  162 + <!--启用日期必须选择-->
  163 + <!--</div>-->
  164 + <!--<div class="alert alert-danger well-sm" ng-show="myForm.qyrq.$error.remote">-->
  165 + <!--{{$remote_msg}}-->
  166 + <!--</div>-->
  167 + <!--</div>-->
  168 +
146 <div class="form-group has-success has-feedback"> 169 <div class="form-group has-success has-feedback">
147 - <label class="col-md-2 control-label">启用日期*:</label> 170 + <label class="col-md-2 control-label">启用日期:</label>
148 <div class="col-md-3"> 171 <div class="col-md-3">
149 <div class="input-group"> 172 <div class="input-group">
150 - <input type="text" class="form-control"  
151 - name="qyrq" placeholder="请选择启用日期..."  
152 - uib-datepicker-popup="yyyy年MM月dd日"  
153 - is-open="ctrl.qyrqOpen" required  
154 - ng-model="ctrl.deviceInfoForSave.qyrq" readonly 173 + <input type="datetime-local" class="form-control" name="qyrq"
  174 + ng-model="ctrl.deviceInfoForSave.qyrq"
155 remote-Validation 175 remote-Validation
156 remotevtype="cde1" 176 remotevtype="cde1"
157 - remotevparam="{{ {'qyrq_eq': ctrl.deviceInfoForSave.qyrq, 'xl_eq': ctrl.deviceInfoForSave.xl, 'cl_eq': ctrl.deviceInfoForSave.cl} | json}}"/>  
158 - <span class="input-group-btn">  
159 - <button type="button" class="btn btn-default" ng-click="ctrl.qyrq_open()">  
160 - <i class="glyphicon glyphicon-calendar"></i>  
161 - </button>  
162 - </span> 177 + remotevparam="{{ {'qyrq_eq': ctrl.deviceInfoForSave.qyrq, 'xl_eq': ctrl.deviceInfoForSave.xl, 'cl_eq': ctrl.deviceInfoForSave.cl} | json}}" />
  178 +
163 </div> 179 </div>
164 </div> 180 </div>
165 <!-- 隐藏块,显示验证信息 --> 181 <!-- 隐藏块,显示验证信息 -->
src/main/resources/static/pages/scheduleApp/module/basicInfo/deviceInfoManage/list.html
@@ -7,7 +7,7 @@ @@ -7,7 +7,7 @@
7 <th style="width: 70px;">序号</th> 7 <th style="width: 70px;">序号</th>
8 <th style="width: 15%;">线路名称</th> 8 <th style="width: 15%;">线路名称</th>
9 <th style="width: 10%;">内部编号</th> 9 <th style="width: 10%;">内部编号</th>
10 - <th style="width: 100px;">启用日期</th> 10 + <th style="width: 160px;">启用日期</th>
11 <th>旧设备编号</th> 11 <th>旧设备编号</th>
12 <th>新设备编号</th> 12 <th>新设备编号</th>
13 <th style="width: 180px;">操作人/操作时间</th> 13 <th style="width: 180px;">操作人/操作时间</th>
@@ -71,7 +71,7 @@ @@ -71,7 +71,7 @@
71 <span ng-bind="info.clZbh"></span> 71 <span ng-bind="info.clZbh"></span>
72 </td> 72 </td>
73 <td> 73 <td>
74 - <span ng-bind="info.qyrq | date:'yyyy-MM-dd'"></span> 74 + <span ng-bind="info.qyrq | date:'yyyy-MM-dd HH:mm'"></span>
75 </td> 75 </td>
76 <td> 76 <td>
77 <span ng-bind="info.oldDeviceNo"></span> 77 <span ng-bind="info.oldDeviceNo"></span>