Commit 1e836b925854ec853f90252a9f4dab4956f3e51f

Authored by 廖磊
2 parents 3296963a b648109b

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

into pudong
Showing 38 changed files with 2445 additions and 403 deletions
src/main/java/com/bsth/controller/BusIntervalController.java
... ... @@ -52,5 +52,10 @@ public class BusIntervalController {
52 52 public List<Map<String,Object>> correctStatis(@RequestParam Map<String, Object> map){
53 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 135 @RequestMapping(value="getSectionCode" , method = RequestMethod.GET)
136 136 public long getSectionCode() {
137 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 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 165 * @Description :TODO(查询站点编码)
152   - *
  166 + *
153 167 * @return int <stationCode站点编码>
154 168 */
155 169 @RequestMapping(value="getStationCode" , method = RequestMethod.GET)
156 170 public long getStationCode() {
157 171 return GetUIDAndCode.getStationId();
158   -
  172 +
159 173 }
160 174 /**
161 175 * @Description :TODO(查询站点编码)
... ...
src/main/java/com/bsth/controller/StationRouteController.java
1 1 package com.bsth.controller;
2 2  
  3 +import com.bsth.entity.Station;
3 4 import com.bsth.entity.StationRoute;
4 5 import com.bsth.entity.StationRouteCache;
5 6 import com.bsth.repository.StationRouteCacheRepository;
... ... @@ -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 116 @RequestMapping(value = "/findCacheUpStationRouteCode" , method = RequestMethod.GET)
116 117 public List<Map<String, Object>> findCacheUpStationRouteCode(@RequestParam Map<String, Object> map) {
117 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 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/repository/SectionRouteRepository.java
... ... @@ -172,9 +172,13 @@ public interface SectionRouteRepository extends BaseRepository&lt;SectionRoute, Int
172 172 void isRoadSpeedUpd(Integer isR,Integer line,Integer directions);
173 173  
174 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 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 182 @Modifying
179 183 @Query(value="UPDATE bsth_c_sectionroute set destroy = 1 where id = ?1", nativeQuery=true)
180 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 102 "select MAX(station_route_code) as stationRouteCode from bsth_c_stationroute r WHERE " +
103 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 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 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 95  
96 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 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
... ... @@ -81,6 +81,9 @@ public interface YlbRepository extends BaseRepository&lt;Ylb, Integer&gt;{
81 81  
82 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 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 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 89 List<Ylb> checkYlb(String rq,String nbbm,String jgh,String xlbm,String px);
... ...
src/main/java/com/bsth/service/BusIntervalService.java
... ... @@ -19,4 +19,6 @@ public interface BusIntervalService {
19 19 List<Map<String, Object>> lbStatuAnaly(Map<String, Object> map);
20 20  
21 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 37 Map<String, Object> sectionCacheUpdate(Map<String, Object> map);
38 38  
39 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 72 * @return List<Map<String, Object>>
73 73 */
74 74 List<Map<String, Object>> findUpStationRouteCode(Map<String, Object> map);
75   -
  75 +
76 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 88 * @Description :TODO(查询线路某方向下所有站点的中心百度坐标)
80 89 *
... ...
src/main/java/com/bsth/service/impl/BusIntervalServiceImpl.java
1 1 package com.bsth.service.impl;
2 2  
  3 +import java.io.File;
3 4 import java.math.BigDecimal;
4 5 import java.math.RoundingMode;
5 6 import java.sql.ResultSet;
6 7 import java.sql.SQLException;
7 8 import java.text.DecimalFormat;
  9 +import java.text.ParseException;
8 10 import java.text.SimpleDateFormat;
9 11 import java.util.ArrayList;
  12 +import java.util.Calendar;
10 13 import java.util.Collections;
11 14 import java.util.Comparator;
12 15 import java.util.Date;
  16 +import java.util.GregorianCalendar;
13 17 import java.util.HashMap;
14 18 import java.util.HashSet;
15 19 import java.util.Iterator;
... ... @@ -23,27 +27,62 @@ import org.springframework.jdbc.core.JdbcTemplate;
23 27 import org.springframework.jdbc.core.RowMapper;
24 28 import org.springframework.stereotype.Service;
25 29  
  30 +import com.alibaba.fastjson.JSON;
26 31 import com.alibaba.fastjson.JSONArray;
27 32 import com.bsth.data.BasicData;
28 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 38 import com.bsth.entity.realcontrol.ChildTaskPlan;
30 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 45 import com.bsth.repository.realcontrol.ScheduleRealInfoRepository;
32 46 import com.bsth.service.BusIntervalService;
  47 +import com.bsth.service.report.CulateMileageService;
33 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 54 import com.bsth.util.ReportUtils;
  55 +import com.bsth.util.TimeUtils;
35 56 import com.google.gson.Gson;
36 57  
37 58  
38 59 @Service
39 60 public class BusIntervalServiceImpl implements BusIntervalService {
40 61  
  62 + @Autowired
  63 + CulateMileageService culateService;
  64 +
41 65 @Autowired
42 66 private PeopleCarPlanService peopleCarPlanService;
43 67  
44 68 @Autowired
45 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 86 @Autowired
48 87 private JdbcTemplate jdbcTemplate;
49 88  
... ... @@ -241,7 +280,55 @@ public class BusIntervalServiceImpl implements BusIntervalService {
241 280  
242 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 332 @Override
246 333 public List<Map<String, Object>> getDir(Map<String, Object> map) {
247 334 List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>();
... ... @@ -1630,6 +1717,15 @@ public class BusIntervalServiceImpl implements BusIntervalService {
1630 1717 }
1631 1718  
1632 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 1730 String[] date1 = startDate.split("-");
1635 1731 String[] date2 = endDate.split("-");
... ... @@ -1702,46 +1798,67 @@ public class BusIntervalServiceImpl implements BusIntervalService {
1702 1798 jhlc = jhlc.add(lc);
1703 1799 }
1704 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 1806 if(schedule.getAdjustExps() != null && schedule.getAdjustExps().indexOf("路阻") != -1){
1710 1807 lzbc++;
1711   - lzlc = lzlc.add(lc);
  1808 +// lzlc = lzlc.add(lc);
1712 1809 }else if(schedule.getAdjustExps() != null && schedule.getAdjustExps().indexOf("吊慢") != -1){
1713 1810 dmbc++;
1714   - dmlc = dmlc.add(lc);
  1811 +// dmlc = dmlc.add(lc);
1715 1812 }else if(schedule.getAdjustExps() != null && schedule.getAdjustExps().indexOf("故障") != -1){
1716 1813 gzbc++;
1717   - gzlc = gzlc.add(lc);
  1814 +// gzlc = gzlc.add(lc);
1718 1815 }else if(schedule.getAdjustExps() != null && schedule.getAdjustExps().indexOf("纠纷") != -1){
1719 1816 jfbc++;
1720   - jflc = jflc.add(lc);
  1817 +// jflc = jflc.add(lc);
1721 1818 }else if(schedule.getAdjustExps() != null && schedule.getAdjustExps().indexOf("肇事") != -1){
1722 1819 zsbc++;
1723   - zslc = zslc.add(lc);
  1820 +// zslc = zslc.add(lc);
1724 1821 }else if(schedule.getAdjustExps() != null && schedule.getAdjustExps().indexOf("缺人") != -1){
1725 1822 qrbc++;
1726   - qrlc = qrlc.add(lc);
  1823 +// qrlc = qrlc.add(lc);
1727 1824 }else if(schedule.getAdjustExps() != null && schedule.getAdjustExps().indexOf("缺车") != -1){
1728 1825 qcbc++;
1729   - qclc = qclc.add(lc);
  1826 +// qclc = qclc.add(lc);
1730 1827 }else if(schedule.getAdjustExps() != null && schedule.getAdjustExps().indexOf("客稀") != -1){
1731 1828 kxbc++;
1732   - kxlc = kxlc.add(lc);
  1829 +// kxlc = kxlc.add(lc);
1733 1830 }else if(schedule.getAdjustExps() != null && schedule.getAdjustExps().indexOf("气候") != -1){
1734 1831 qhbc++;
1735   - qhlc = qhlc.add(lc);
  1832 +// qhlc = qhlc.add(lc);
1736 1833 }else if(schedule.getAdjustExps() != null && schedule.getAdjustExps().indexOf("外援") != -1){
1737 1834 wybc++;
1738   - wylc = wylc.add(lc);
  1835 +// wylc = wylc.add(lc);
1739 1836 } else {
1740 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 1862 boolean flag = true;
1746 1863 if(jhlc.doubleValue() == 0d){
1747 1864 flag = false;
... ... @@ -1754,42 +1871,42 @@ public class BusIntervalServiceImpl implements BusIntervalService {
1754 1871 tempMap.put("jhbc", jhbc);
1755 1872 tempMap.put("sjbc", sjbc);
1756 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 1876 // tempMap.put("lcbfb", df.format(flag?(double)sjlc/jhlc*100:0)+"%");
1760 1877 tempMap.put("lcbfb", df.format(flag?sjlc.divide(jhlc, 4, BigDecimal.ROUND_HALF_UP).doubleValue()*100:0)+"%");
1761 1878 tempMap.put("lzbc", lzbc);
1762   - tempMap.put("lzlc", lzlc.doubleValue());
  1879 + tempMap.put("lzlc", df.format(lzlc.doubleValue()));
1763 1880 tempMap.put("lzbfb", df.format(jhbc>0?(double)lzbc/jhbc*100:0)+"%");
1764 1881 tempMap.put("dmbc", dmbc);
1765   - tempMap.put("dmlc", dmlc.doubleValue());
  1882 + tempMap.put("dmlc", df.format(dmlc.doubleValue()));
1766 1883 tempMap.put("dmbfb", df.format(jhbc>0?(double)dmbc/jhbc*100:0)+"%");
1767 1884 tempMap.put("gzbc", gzbc);
1768   - tempMap.put("gzlc", gzlc.doubleValue());
  1885 + tempMap.put("gzlc", df.format(gzlc.doubleValue()));
1769 1886 tempMap.put("gzbfb", df.format(jhbc>0?(double)gzbc/jhbc*100:0)+"%");
1770 1887 tempMap.put("jfbc", jfbc);
1771   - tempMap.put("jflc", jflc.doubleValue());
  1888 + tempMap.put("jflc", df.format(jflc.doubleValue()));
1772 1889 tempMap.put("jfbfb", df.format(jhbc>0?(double)jfbc/jhbc*100:0)+"%");
1773 1890 tempMap.put("zsbc", zsbc);
1774   - tempMap.put("zslc", zslc.doubleValue());
  1891 + tempMap.put("zslc", df.format(zslc.doubleValue()));
1775 1892 tempMap.put("zsbfb", df.format(jhbc>0?(double)zsbc/jhbc*100:0)+"%");
1776 1893 tempMap.put("qrbc", qrbc);
1777   - tempMap.put("qrlc", qrlc.doubleValue());
  1894 + tempMap.put("qrlc", df.format(qrlc.doubleValue()));
1778 1895 tempMap.put("qrbfb", df.format(jhbc>0?(double)qrbc/jhbc*100:0)+"%");
1779 1896 tempMap.put("qcbc", qcbc);
1780   - tempMap.put("qclc", qclc.doubleValue());
  1897 + tempMap.put("qclc", df.format(qclc.doubleValue()));
1781 1898 tempMap.put("qcbfb", df.format(jhbc>0?(double)qcbc/jhbc*100:0)+"%");
1782 1899 tempMap.put("kxbc", kxbc);
1783   - tempMap.put("kxlc", kxlc.doubleValue());
  1900 + tempMap.put("kxlc", df.format(kxlc.doubleValue()));
1784 1901 tempMap.put("kxbfb", df.format(jhbc>0?(double)kxbc/jhbc*100:0)+"%");
1785 1902 tempMap.put("qhbc", qhbc);
1786   - tempMap.put("qhlc", qhlc.doubleValue());
  1903 + tempMap.put("qhlc", df.format(qhlc.doubleValue()));
1787 1904 tempMap.put("qhbfb", df.format(jhbc>0?(double)qhbc/jhbc*100:0)+"%");
1788 1905 tempMap.put("wybc", wybc);
1789   - tempMap.put("wylc", wylc.doubleValue());
  1906 + tempMap.put("wylc", df.format(wylc.doubleValue()));
1790 1907 tempMap.put("wybfb", df.format(jhbc>0?(double)wybc/jhbc*100:0)+"%");
1791 1908 tempMap.put("qtbc", qtbc);
1792   - tempMap.put("qtlc", qtlc.doubleValue());
  1909 + tempMap.put("qtlc", df.format(qtlc.doubleValue()));
1793 1910 tempMap.put("qtbfb", df.format(jhbc>0?(double)qtbc/jhbc*100:0)+"%");
1794 1911  
1795 1912 resList.add(tempMap);
... ... @@ -1822,41 +1939,41 @@ public class BusIntervalServiceImpl implements BusIntervalService {
1822 1939 temp.put("jhbc", jhbc_);
1823 1940 temp.put("sjbc", sjbc_);
1824 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 1944 temp.put("lcbfb", df.format(flag?sjlc_.divide(jhlc_, 4, BigDecimal.ROUND_HALF_UP).doubleValue()*100:0)+"%");
1828 1945 temp.put("lzbc", lzbc_);
1829   - temp.put("lzlc", lzlc_.doubleValue());
  1946 + temp.put("lzlc", df.format(lzlc_.doubleValue()));
1830 1947 temp.put("lzbfb", df.format(jhbc_>0?(double)lzbc_/jhbc_*100:0)+"%");
1831 1948 temp.put("dmbc", dmbc_);
1832   - temp.put("dmlc", dmlc_.doubleValue());
  1949 + temp.put("dmlc", df.format(dmlc_.doubleValue()));
1833 1950 temp.put("dmbfb", df.format(jhbc_>0?(double)dmbc_/jhbc_*100:0)+"%");
1834 1951 temp.put("gzbc", gzbc_);
1835   - temp.put("gzlc", gzlc_.doubleValue());
  1952 + temp.put("gzlc", df.format(gzlc_.doubleValue()));
1836 1953 temp.put("gzbfb", df.format(jhbc_>0?(double)gzbc_/jhbc_*100:0)+"%");
1837 1954 temp.put("jfbc", jfbc_);
1838   - temp.put("jflc", jflc_.doubleValue());
  1955 + temp.put("jflc", df.format(jflc_.doubleValue()));
1839 1956 temp.put("jfbfb", df.format(jhbc_>0?(double)jfbc_/jhbc_*100:0)+"%");
1840 1957 temp.put("zsbc", zsbc_);
1841   - temp.put("zslc", zslc_.doubleValue());
  1958 + temp.put("zslc", df.format(zslc_.doubleValue()));
1842 1959 temp.put("zsbfb", df.format(jhbc_>0?(double)zsbc_/jhbc_*100:0)+"%");
1843 1960 temp.put("qrbc", qrbc_);
1844   - temp.put("qrlc", qrlc_.doubleValue());
  1961 + temp.put("qrlc", df.format(qrlc_.doubleValue()));
1845 1962 temp.put("qrbfb", df.format(jhbc_>0?(double)qrbc_/jhbc_*100:0)+"%");
1846 1963 temp.put("qcbc", qcbc_);
1847   - temp.put("qclc", qclc_.doubleValue());
  1964 + temp.put("qclc", df.format(qclc_.doubleValue()));
1848 1965 temp.put("qcbfb", df.format(jhbc_>0?(double)qcbc_/jhbc_*100:0)+"%");
1849 1966 temp.put("kxbc", kxbc_);
1850   - temp.put("kxlc", kxlc_.doubleValue());
  1967 + temp.put("kxlc", df.format(kxlc_.doubleValue()));
1851 1968 temp.put("kxbfb", df.format(jhbc_>0?(double)kxbc_/jhbc_*100:0)+"%");
1852 1969 temp.put("qhbc", qhbc_);
1853   - temp.put("qhlc", qhlc_.doubleValue());
  1970 + temp.put("qhlc", df.format(qhlc_.doubleValue()));
1854 1971 temp.put("qhbfb", df.format(jhbc_>0?(double)qhbc_/jhbc_*100:0)+"%");
1855 1972 temp.put("wybc", wybc_);
1856   - temp.put("wylc", wylc_.doubleValue());
  1973 + temp.put("wylc", df.format(wylc_.doubleValue()));
1857 1974 temp.put("wybfb", df.format(jhbc_>0?(double)wybc_/jhbc_*100:0)+"%");
1858 1975 temp.put("qtbc", qtbc_);
1859   - temp.put("qtlc", qtlc_.doubleValue());
  1976 + temp.put("qtlc", df.format(qtlc_.doubleValue()));
1860 1977 temp.put("qtbfb", df.format(jhbc_>0?(double)qtbc_/jhbc_*100:0)+"%");
1861 1978  
1862 1979 resList.add(temp);
... ... @@ -2257,10 +2374,422 @@ public class BusIntervalServiceImpl implements BusIntervalService {
2257 2374 resMap.put("xlname",BasicData.lineCode2NameMap.get(xlbm));
2258 2375 }
2259 2376 }
2260   -
  2377 +
2261 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 7 import java.util.List;
8 8 import java.util.Map;
9 9  
  10 +import com.bsth.util.RoadCutDoubleName;
10 11 import org.springframework.beans.factory.annotation.Autowired;
11 12 import org.springframework.stereotype.Service;
12 13 import org.springframework.transaction.annotation.Transactional;
... ... @@ -360,6 +361,129 @@ public class SectionServiceImpl extends BaseServiceImpl&lt;Section, Integer&gt; implem
360 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 487 private void sectionListCut(List<Point> bPointsList, List<Map<String, String>> sectionArrayList,
364 488 String bsectionVector, String bsectionVectorCutList) {
365 489 if(!bsectionVector.equals("")) {
... ... @@ -480,6 +604,7 @@ public class SectionServiceImpl extends BaseServiceImpl&lt;Section, Integer&gt; implem
480 604 * @return Map<String, Object> <SUCCESS ; ERROR>
481 605 */
482 606 @Override
  607 + @Transactional
483 608 public Map<String, Object> sectionUpdate(Map<String, Object> map) {
484 609 Map<String, Object> resultMap = new HashMap<String, Object>();
485 610 try {
... ... @@ -539,32 +664,30 @@ public class SectionServiceImpl extends BaseServiceImpl&lt;Section, Integer&gt; implem
539 664 SectionRoute resultS = routeRepository.findOne(sectionRouteId);
540 665 int old_code = resultS.getSectionrouteCode();
541 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 673 Double speedLimit = map.get("speedLimit").equals("") ? null : Double.valueOf(map.get("speedLimit").toString());
553 674 // 版本
554 675 Integer version = map.get("versions").equals("") ? null : Integer.valueOf(map.get("versions").toString());
555 676 // WGS坐标点集合
556 677 String gsectionVector = null;
557   - if(!sectionsWJPpoints.equals(""))
  678 + if(!sectionsWJPpoints.equals("")) {
558 679 gsectionVector = "LINESTRING(" + sectionsWJPpoints +")";
  680 + }
559 681 // 原坐标点集合
560 682 String bsectionVectorS = null;
561   - if(!sectionsBpoints.equals(""))
562   - bsectionVectorS = "LINESTRING(" + sectionsBpoints + ")";
  683 + if(!sectionsBpoints.equals("")) {
  684 + bsectionVectorS = "LINESTRING(" + sectionsBpoints + ")";
  685 + }
563 686 Integer createBy = map.get("createBy").equals("") ? null : Integer.valueOf(map.get("createBy").toString());
564 687 String createDate = map.get("createDate").equals("") ? null : map.get("createDate").toString();
565 688 Integer updateBy = map.get("updateBy").equals("") ?null : Integer.valueOf(map.get("updateBy").toString());
566 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 691 Date date = new Date();
569 692 // 修改日期
570 693 String updateDate = formatter.format(date);
... ... @@ -604,6 +727,7 @@ public class SectionServiceImpl extends BaseServiceImpl&lt;Section, Integer&gt; implem
604 727 * @Description :TODO(编辑缓存线路走向)
605 728 */
606 729 @Override
  730 + @Transactional
607 731 public Map<String, Object> sectionCacheUpdate(Map<String, Object> map) {
608 732 Map<String, Object> resultMap = new HashMap<String, Object>();
609 733 try {
... ... @@ -670,26 +794,29 @@ public class SectionServiceImpl extends BaseServiceImpl&lt;Section, Integer&gt; implem
670 794 }else {
671 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 802 Double speedLimit = map.get("speedLimit").equals("") ? null : Double.valueOf(map.get("speedLimit").toString());
678 803 // 版本
679 804 Integer version = map.get("versions").equals("") ? null : Integer.valueOf(map.get("versions").toString());
680 805 // WGS坐标点集合
681 806 String gsectionVector = null;
682   - if(!sectionsWJPpoints.equals(""))
  807 + if(!sectionsWJPpoints.equals("")) {
683 808 gsectionVector = "LINESTRING(" + sectionsWJPpoints +")";
  809 + }
684 810 // 原坐标点集合
685 811 String bsectionVectorS = null;
686   - if(!sectionsBpoints.equals(""))
687   - bsectionVectorS = "LINESTRING(" + sectionsBpoints + ")";
  812 + if(!sectionsBpoints.equals("")) {
  813 + bsectionVectorS = "LINESTRING(" + sectionsBpoints + ")";
  814 + }
688 815 Integer createBy = map.get("createBy").equals("") ? null : Integer.valueOf(map.get("createBy").toString());
689 816 String createDate = map.get("createDate").equals("") ? null : map.get("createDate").toString();
690 817 Integer updateBy = map.get("updateBy").equals("") ?null : Integer.valueOf(map.get("updateBy").toString());
691 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 820 Date date = new Date();
694 821 // 修改日期
695 822 String updateDate = formatter.format(date);
... ... @@ -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 959 Integer routeCode = null;
834 960 if(!sectionrouteCode.equals("")){
835 961 String sectionrouteCodeArray[] = sectionrouteCode.split("_");
836   - routeCode = Integer.valueOf(sectionrouteCodeArray[0])+1;
  962 + routeCode = Integer.valueOf(sectionrouteCodeArray[0])+100;
837 963 }else {
838 964 routeCode = 100;
839 965 }
840   - routeRepository.sectionUpdSectionRouteCode(lineId, directions,routeCode);
  966 + routeRepository.sectionUpdSectionRouteCode(lineId, directions, routeCode);
841 967 sectionRoute.setSectionrouteCode(routeCode);
842 968 sectionRoute.setLineCode(lineCode);
843 969 sectionRoute.setSection(section);
... ... @@ -856,4 +982,5 @@ public class SectionServiceImpl extends BaseServiceImpl&lt;Section, Integer&gt; implem
856 982 }
857 983 return resultMap;
858 984 }
  985 +
859 986 }
860 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 544 }
545 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 658 * @Description :TODO(查询线路某方向下所有站点的中心百度坐标)
550 659 *
... ... @@ -742,10 +851,14 @@ public class StationRouteServiceImpl extends BaseServiceImpl&lt;StationRoute, Integ
742 851  
743 852 // 将txt文件打包
744 853 File targetFile = PackTarGZUtils.compress(textFile, target);
745   -
  854 +
746 855 /*clientUtils.testUpLoadFromDisk(targetFile,targetFile.getName());*/
747   -
  856 +
748 857 clientUtils.FTPUpLoadFromDisk(targetFile, targetFile.getName(), url, port, username, password, remotePath);
  858 +
  859 + // 删除文件
  860 + textFile.delete();
  861 + targetFile.delete();
749 862  
750 863 resultMap.put("status", ResponseCode.SUCCESS);
751 864  
... ... @@ -1313,7 +1426,7 @@ public class StationRouteServiceImpl extends BaseServiceImpl&lt;StationRoute, Integ
1313 1426 /**
1314 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 1431 * @return List<Map<String, Object>>
1319 1432 */
... ...
src/main/java/com/bsth/service/schedule/datatools/TTInfoDetailDataToolsImpl.java
... ... @@ -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 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 569 String filepath = dataToolsProperties.getFileoutputDir() +
495 570 File.separator +
496 571 "动态时刻表-" +
... ...
src/main/java/com/bsth/service/schedule/datatools/TTinfoDetailDynamicData.java
... ... @@ -58,6 +58,8 @@ public interface TTinfoDetailDynamicData {
58 58 private BcType bcType;
59 59 /** 发车时刻 */
60 60 private String fcsj;
  61 + /** 用于统计的发车时间描述(把进出场,保养,吃饭时间写在一起) */
  62 + private String fcsjDesc;
61 63  
62 64 /** 第几圈(从1开始) */
63 65 private Integer groupNo;
... ... @@ -151,6 +153,22 @@ public interface TTinfoDetailDynamicData {
151 153 public void setGroupBcNo(Integer groupBcNo) {
152 154 this.groupBcNo = groupBcNo;
153 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 + }
154 172 }
155 173  
156 174 public static class LpObj { // 路牌对象
... ...
src/main/java/com/bsth/service/schedule/impl/PeopleCarPlanServiceImpl.java
... ... @@ -1746,7 +1746,8 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
1746 1746 tempMap.put("line", xlName);
1747 1747 tempMap.put("jhbc", jhbc);
1748 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 1751 resList.add(tempMap);
1751 1752 }
1752 1753  
... ... @@ -1760,7 +1761,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
1760 1761 }
1761 1762 tempMap.put("jhbc", jhbc);
1762 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 1765 for(Map<String, Object> m : mapList){
1765 1766 m.put("no", ++i);
1766 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 424 \ No newline at end of file
... ...
src/main/resources/static/pages/base/carpark/js/carpark-list-table.js
... ... @@ -24,7 +24,25 @@
24 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 46 // 公司下拉options属性值
29 47 var options = '<option value="">请选择...</option>';
30 48 // 遍历array
... ... @@ -202,6 +220,10 @@
202 220 $.get('/carpark',params,function(result){
203 221 // 添加序号
204 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 228 var tbodyHtml = template('carpark_list_table_temp',{list:result.content});
207 229 $('#datatable_carpark tbody').html(tbodyHtml);
... ...
src/main/resources/static/pages/base/carpark/list.html
... ... @@ -114,7 +114,8 @@
114 114 {{obj.area}}
115 115 </td>
116 116 <td>
117   - {{if obj.company == '55'}}
  117 + {{obj.gsmc}}
  118 + <!--{{if obj.company == '55'}}
118 119 上南公司
119 120 {{else if obj.company == '22'}}
120 121 金高公司
... ... @@ -124,10 +125,11 @@
124 125 南汇公司
125 126 {{else if obj.company == '77'}}
126 127 闵行公司
127   - {{/if}}
  128 + {{/if}}-->
128 129 </td>
129 130 <td>
130   - {{if obj.company == '55'}}
  131 + {{obj.fgsmc}}
  132 + <!--{{if obj.company == '55'}}
131 133  
132 134 {{if obj.brancheCompany == '1'}}
133 135 上南二分公司
... ... @@ -179,7 +181,7 @@
179 181 南汇公司
180 182 {{/if}}
181 183  
182   - {{/if}}
  184 + {{/if}}-->
183 185 </td>
184 186 <td>
185 187 {{obj.versions}}
... ...
src/main/resources/static/pages/base/line/js/line-list-table.js
... ... @@ -44,7 +44,25 @@
44 44 setTimeout(function(){$('.tipso-animation').tipso('hide');},4000);
45 45 },200);
46 46 }
  47 + // 营运公司Map[key(businessCode)] = 名字
  48 + var companyMap = new Map();
  49 + // 分公司Map[key(upCode+_+businessCode)] = 名字
  50 + var branchMap = new Map();
47 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 66 // 公司下拉options属性值
49 67 var options = '<option value="">请选择...</option>';
50 68 // 遍历array
... ... @@ -184,7 +202,11 @@
184 202 $.get('/line',params,function(result){
185 203 // 添加序号
186 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 210 var tbodyHtml = template('line_list_temp',{list:result.content});
189 211 // 把渲染好的模版html文本追加到表格中
190 212 $('#datatable_line tbody').html(tbodyHtml);
... ...
src/main/resources/static/pages/base/line/list.html
... ... @@ -232,7 +232,8 @@
232 232 {{obj.name}}
233 233 </td>
234 234 <td>
235   - {{if obj.company == '55'}}
  235 + {{obj.gsmc}}
  236 + <!--{{if obj.company == '55'}}
236 237 上南公司
237 238 {{else if obj.company == '22'}}
238 239 金高公司
... ... @@ -242,10 +243,11 @@
242 243 南汇公司
243 244 {{else if obj.company == '77'}}
244 245 闵行公司
245   - {{/if}}
  246 + {{/if}}-->
246 247 </td>
247 248 <td>
248   - {{if obj.company == '55'}}
  249 + {{obj.fgsmc}}
  250 + <!--{{if obj.company == '55'}}
249 251  
250 252 {{if obj.brancheCompany == '1'}}
251 253 上南二分公司
... ... @@ -299,7 +301,7 @@
299 301 航头枢纽站
300 302 {{/if}}
301 303  
302   - {{/if}}
  304 + {{/if}}-->
303 305 </td>
304 306 <td>
305 307 {{if obj.nature == 'lj'}}
... ... @@ -347,6 +349,7 @@
347 349 <a href="/pages/base/lineinformation/list.html?no={{obj.id}}" class="btn default blue-stripe btn-sm" data-pjax> 查看 </a>
348 350 </td>
349 351 <td>
  352 + <a href="/pages/base/stationroute/list.html?no={{obj.id}}" class="btn default blue-stripe btn-sm" data-pjax> 查看</a>
350 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 354 </td>
352 355 <td>
... ...
src/main/resources/static/pages/base/lineversions/js/lineversions-list-table.js
... ... @@ -34,7 +34,25 @@
34 34 setTimeout(function(){$('.tipso-animation').tipso('hide');},4000);
35 35 },200);
36 36 }
  37 + // 营运公司Map[key(businessCode)] = 名字
  38 + var companyMap = new Map();
  39 + // 分公司Map[key(upCode+_+businessCode)] = 名字
  40 + var branchMap = new Map();
37 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 56 // 公司下拉options属性值
39 57 var options = '<option value="">请选择...</option>';
40 58 // 遍历array
... ... @@ -161,10 +179,12 @@
161 179 // 添加序号
162 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 189 var tbodyHtml = template('lineversions_list_temp',{list:result.content});
170 190 $('#datatable_lineversions tbody').html(tbodyHtml);
... ...
src/main/resources/static/pages/base/lineversions/list.html
... ... @@ -118,7 +118,8 @@
118 118 {{obj.line.name}}
119 119 </td>
120 120 <td>
121   - {{if obj.line.company == '55'}}
  121 + {{obj.gsmc}}
  122 + <!--{{if obj.line.company == '55'}}
122 123 上南公司
123 124 {{else if obj.line.company == '22'}}
124 125 金高公司
... ... @@ -128,10 +129,11 @@
128 129 南汇公司
129 130 {{else if obj.line.company == '77'}}
130 131 闵行公司
131   - {{/if}}
  132 + {{/if}}-->
132 133 </td>
133 134 <td>
134   - {{if obj.line.company == '55'}}
  135 + {{obj.fgsmc}}
  136 + <!--{{if obj.line.company == '55'}}
135 137  
136 138 {{if obj.line.brancheCompany == '1'}}
137 139 上南二分公司
... ... @@ -185,7 +187,7 @@
185 187 航头枢纽站
186 188 {{/if}}
187 189  
188   - {{/if}}
  190 + {{/if}}-->
189 191 </td>
190 192 <td>
191 193 {{obj.startDateStr}}
... ...
src/main/resources/static/pages/base/stationroute/css/bmap_base.css
1 1 #bmap_basic{
2 2 min-width: 100%;
3   - width: calc(100% + 26px);
4   - margin-top: -28px;
  3 + /*width: calc(100% + 26px); */
  4 + margin-top: -10px;
5 5 border: 2px solid #fdfdfd;
6 6 min-height: 1200px;
7 7 height:100%;
... ... @@ -10,6 +10,7 @@
10 10  
11 11 html,body{
12 12 overflow:hidden;
  13 + height: 99%;
13 14 }
14 15  
15 16 .rm3_image {
... ... @@ -27,67 +28,64 @@ html,body{
27 28 }
28 29  
29 30 .protlet-box{
30   -
31   - position: absolute;
32   -
33   - top: 40px;
34   -
  31 + position: absolute;
  32 + top: 30px;
35 33 margin-left: 10px;
36   -
37 34 overflow: hidden;
38   -
39 35 width: 380px;
40   -
41 36 height: auto;
42   -
43 37 background:transparent;
44   -
45 38 border:0px solid;
46   -
47 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 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 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 153 \ No newline at end of file
... ...
src/main/resources/static/pages/base/stationroute/edit_select.html
... ... @@ -49,6 +49,7 @@
49 49 <script type="text/javascript">
50 50 $('#edit_select_mobal').on('editSelectMobal_show', function(e, map_,drw,ajaxd,editStationObj,lineObj,fun,dir_){
51 51 var sel = fun.getCurrSelNode(dir_);
  52 + debugger
52 53 var Station = sel[0].original;
53 54 // 显示选择修改方式弹出层
54 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 118 var editStationName = params.stationNamebootbox;
118 119  
119 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 131 }else if(params.editselect==1){
136 132 $('#downLine').addClass('btn disabled');
137 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 137  
142 138 // 弹出添加失败提示消息,2秒关闭(如果不配置,默认是3秒)
143 139 var mindex = layer.msg('编辑完图形后,请双击图形区域保存',{ offset: '126px',
144   - shift: 0,time: 10000});
  140 + shift: 0,time: 3000});
145 141 // 编辑图形
146 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 19  
20 20 // 上行站点其它规划点击事件
21 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 28 $.get('add_manual_select.html', function(m){
24 29 $(pjaxContainer).append(m);
25 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 192  
188 193 // 下行站点其它规划点击事件
189 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 201 $.get('add_manual_select.html', function(m){
192 202 $(pjaxContainer).append(m);
193 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 161 /** 直接保存 @param:<lineNameV:线路名称;directionData:方向(0:上行;1:下行)> */
162 162 PublicFunctions.systemLineStation(lineNameV,directionData);
163 163 }
164   -
  164 +
165 165 },
166 166  
167 167 /** 直接保存 @param:<lineNameV:线路名称;directionData:方向(0:上行;1:下行)> */
... ... @@ -170,33 +170,6 @@ var PublicFunctions = function () {
170 170 WorldsBMap.lineInfoPanl(lineNameV,directionData,function(BusLine){
171 171 // 如果线路信息不为空
172 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 174 var Polygon = BusLine.getPolyline();
202 175 // 返回多边型的点数组(自1.2新增)
... ... @@ -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 489 }
485 490 // 路段数据长度
486 491 var dataLen = data.length;
487   - //debugger;
488 492 // 如果大于零
489 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 222  
223 223 // 如果不为空
224 224 if(objStation) {
225   -
226 225 // 获取中心点坐标字符串
227 226 var testpointStr = objStation.stationBJwpoints;
228   -
229 227 // 按空格切割中心点坐标字符串
230 228 var BJwpointsPolygon = testpointStr.split(' ');
231   -
232 229 // 中心点坐标
233 230 var pointPolygon = new BMap.Point(BJwpointsPolygon[0], BJwpointsPolygon[1]);
234   -
235 231 // 获取多边形坐标字符串
236 232 var stationBPolygonGrid = objStation.stationBPolygonGrid;
237   -
238 233 // 截取多边形坐标字符串
239 234 var stationBPolygonGridStr = stationBPolygonGrid.substring(9,stationBPolygonGrid.length-2);
240   -
241 235 // 按逗号切割
242 236 var pointPolygonArray = stationBPolygonGridStr.split(',');
243   -
244 237 // 多边形坐标集合
245 238 var polygonP = [];
246   -
247 239 for(var v = 0;v<pointPolygonArray.length;v++) {
248   -
249 240 polygonP.push(new BMap.Point(pointPolygonArray[v].split(" ")[0],pointPolygonArray[v].split(" ")[1]));
250   -
251 241 }
252 242  
253 243 // 画多边形
254 244 polygon = new BMap.Polygon(polygonP, {
255   -
256 245 // 线条显色
257 246 strokeColor : "blue",
258   -
259 247 // 边线的宽度,以像素为单位。
260 248 strokeWeight : 2,
261   -
262 249 // 边线透明度,取值范围0 - 1。
263 250 strokeOpacity : 0.5
264 251 });
... ... @@ -268,80 +255,62 @@ var WorldsBMap = function () {
268 255  
269 256 // 信息窗口属性
270 257 var opts_polygon = {
271   -
272 258 // 信息窗口宽度
273 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 267 enableMessage : false,
286   -
287 268 //是否开启点击地图关闭信息窗口
288 269 enableCloseOnClick : false
289 270 };
290   -
  271 +
291 272 var markTypeStr = '';
292   -
293 273 if(objStation.stationRouteStationMark=='B') {
294   -
295 274 markTypeStr='起点站';
296   -
297 275 }else if(objStation.stationRouteStationMark=='Z') {
298   -
299 276 markTypeStr ='中途站';
300   -
301   -
302 277 }else if(objStation.stationRouteStationMark=='E') {
303   -
304 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 299 var infoWindow_target = new BMap.InfoWindow(htm, opts_polygon);
324 300 // 自定义标注物图片
325 301 var icon_target = new BMap.Icon('/pages/base/stationroute/css/img/cz.png',new BMap.Size(20, 20));
326   -
327 302 // 创建点
328 303 marker = new BMap.Marker(pointPolygon,{icon : icon_target});
329   -
330 304 // 把标注添物加到地图上
331 305 mapBValue.addOverlay(marker);
332   -
333 306 // 是否在平移过程中禁止动画。(自1.2新增)
334 307 var PanOptions_ ={noAnimation :true};
335   -
336 308 // 将地图的中心点更改为给定的点。
337 309 mapBValue.panTo(pointPolygon,PanOptions_);
338   -
339 310 // 将地图在水平位置上移动x像素,垂直位置上移动y像素。
340 311 mapBValue.panBy(10,-150,PanOptions_);
341   -
342 312 //开启信息窗口
343 313 mapBValue.openInfoWindow(infoWindow_target,pointPolygon);
344   -
345 314 }
346 315  
347 316 },
... ... @@ -399,61 +368,50 @@ var WorldsBMap = function () {
399 368  
400 369 // 信息窗口参数属性
401 370 var opts = {
402   -
403 371 // 信息窗口宽度
404 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 380 enableMessage : false,
417   -
418 381 //是否开启点击地图关闭信息窗口
419 382 enableCloseOnClick : false,
420   -
421 383 // 是否开启信息窗口打开时地图自动移动(默认开启)。(自 1.1 新增)
422 384 enableAutoPan:false
423 385 };
424 386  
425 387 var markTypeStr = '';
426   -
427 388 if(objStation.stationRouteStationMark=='B') {
428   -
429 389 markTypeStr='起点站';
430   -
431 390 }else if(objStation.stationRouteStationMark=='Z') {
432   -
433 391 markTypeStr ='中途站';
434   -
435   -
436 392 }else if(objStation.stationRouteStationMark=='E') {
437   -
438 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 415 var infoWindow_target = new BMap.InfoWindow(htm, opts);
458 416 // 自定义标注物图片
459 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 622 mapBValue.panTo(polyline_center,PanOptions_);
665 623 mapBValue.panBy(500,-510,PanOptions_);
666 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 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 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 37 // 百度地图画圆
38 38 WorldsBMap.pointsCircle(data);
39 39  
40   - // 如果是多变行
  40 + // 如果是多边形
41 41 }else if(shapesTypeT == 'd') {
42 42  
43 43 // 百度地图画多边形
... ...
src/main/resources/static/pages/base/stationroute/list.html
... ... @@ -2,7 +2,9 @@
2 2 <div class="portlet-body">
3 3 <!-- 地图 -->
4 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 9 <div class="portlet-title" style="background-color:#12527f;">
8 10 <div class="caption">
... ... @@ -13,7 +15,7 @@
13 15 </div>
14 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 19 <div class="row">
18 20 <!-- 上下行栏 -->
19 21 <div class="col-md-3 col-sm-3 col-xs-3">
... ... @@ -50,9 +52,9 @@
50 52 <a href="javascript:;" id="addUpStation"><i class="fa fa-plus"></i> 添加站点</a>
51 53 </li>
52 54 <li class="divider"> </li>
53   - <li>
  55 + <!--<li>
54 56 <a href="javascript:;" id="editUpStation"><i class="fa fa-pencil"></i> 修改站点</a>
55   - </li>
  57 + </li>-->
56 58 <li class="divider"> </li>
57 59 <li>
58 60 <a href="javascript:;" id="deleteUpStation"><i class="fa fa-close"></i> 撤销站点</a>
... ... @@ -105,11 +107,11 @@
105 107 </a>
106 108 <ul class="dropdown-menu pull-right" style="min-width:100px">
107 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 111 </li>
110 112 <li class="divider"> </li>
111 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 115 </li>
114 116 </ul>
115 117 </div>
... ... @@ -150,9 +152,9 @@
150 152 <a href="javascript:;" id="addDownStation"><i class="fa fa-plus"></i> 添加站点</a>
151 153 </li>
152 154 <li class="divider"> </li>
153   - <li>
  155 + <!--<li>
154 156 <a href="javascript:;" id="editDownStation"><i class="fa fa-pencil"></i> 修改站点</a>
155   - </li>
  157 + </li>-->
156 158 <li class="divider"> </li>
157 159 <li>
158 160 <a href="javascript:;" id="deleteDownStation"><i class="fa fa-close"></i> 撤销站点</a>
... ... @@ -201,11 +203,11 @@
201 203 </a>
202 204 <ul class="dropdown-menu pull-right" style="min-width:100px">
203 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 207 </li>
206 208 <li class="divider"> </li>
207 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 211 </li>
210 212 </ul>
211 213 </div>
... ...
src/main/resources/static/pages/base/timesmodel/js/v2/main_v2.js
... ... @@ -139,6 +139,7 @@ var Main_v2 = function() {
139 139 var z;
140 140 var oInternalLp;
141 141 var oInternalBc;
  142 + var oInternalBc_temp;
142 143 var oLp;
143 144 var iZbc;
144 145 var iZgs;
... ... @@ -185,19 +186,58 @@ var Main_v2 = function() {
185 186 aFcsj.push("(" + oStartBc.getFcTimeObj().format("HH:mm") + ")");
186 187 oStartBc._$_fcsj_desc = aFcsj.join("");
187 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 +
188 208 aFcsj = [];
189 209  
190 210 oEndBc = oInternalLp.getBc(
191 211 oInternalLp.fnGetBcChainInfo(0)["e_q"],
192 212 oInternalLp.fnGetBcChainInfo(0)["e_b"]
193 213 );
194   - aFcsj.push("(" + oStartBc.getFcTimeObj().format("HH:mm") + ")");
  214 + aFcsj.push("(" + oEndBc.getFcTimeObj().format("HH:mm") + ")");
195 215 oTempBc = _factory.createBcObj(
196 216 oLp, "in", true, 1,
197 217 oEndBc.getArrTimeObj(),
198 218 _paramObj
199 219 );
200 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 +
201 241 oTempBc = _factory.createBcObj(
202 242 oLp, "lc", true, 1,
203 243 oEndBc.getArrTimeObj(),
... ... @@ -226,13 +266,32 @@ var Main_v2 = function() {
226 266 aFcsj.push("(" + oStartBc.getFcTimeObj().format("HH:mm") + ")");
227 267 oStartBc._$_fcsj_desc = aFcsj.join("");
228 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 +
229 288 aFcsj = [];
230 289  
231 290 oEndBc = oInternalLp.getBc(
232 291 oInternalLp.fnGetBcChainInfo(0)["e_q"],
233 292 oInternalLp.fnGetBcChainInfo(0)["e_b"]
234 293 );
235   - aFcsj.push("(" + oStartBc.getFcTimeObj().format("HH:mm") + ")");
  294 + aFcsj.push("(" + oEndBc.getFcTimeObj().format("HH:mm") + ")");
236 295 oTempBc = _factory.createBcObj(
237 296 oLp, "in", true, 1,
238 297 oEndBc.getArrTimeObj(),
... ... @@ -267,13 +326,33 @@ var Main_v2 = function() {
267 326 oInternalLp.fnGetBcChainInfo(1)["e_q"],
268 327 oInternalLp.fnGetBcChainInfo(1)["e_b"]
269 328 );
270   - aFcsj.push("(" + oStartBc.getFcTimeObj().format("HH:mm") + ")");
  329 + aFcsj.push("(" + oEndBc.getFcTimeObj().format("HH:mm") + ")");
271 330 oTempBc = _factory.createBcObj(
272 331 oLp, "in", true, 1,
273 332 oEndBc.getArrTimeObj(),
274 333 _paramObj
275 334 );
276 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 +
277 356 oTempBc = _factory.createBcObj(
278 357 oLp, "lc", true, 1,
279 358 oEndBc.getArrTimeObj(),
... ... @@ -289,7 +368,12 @@ var Main_v2 = function() {
289 368 oInternalBc = oInternalLp.getBc(j, z);
290 369 if (oInternalBc) {
291 370 if (oInternalBc.fnGetEatTime() > 0) {
292   - oInternalBc._$_fcsj_desc = "(吃" + oInternalBc.getFcTimeObj().format("HH:mm") + ")";
  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") + ")";
293 377 }
294 378  
295 379 oLp.bcObjList.push({
... ... @@ -304,7 +388,8 @@ var Main_v2 = function() {
304 388 "isUp": oInternalBc._$_isUp, // 是否上行
305 389  
306 390 "bcType": oInternalBc._$_bcType, // 班次类型
307   - "fcsj": oInternalBc._$_fcsj_desc || oInternalBc._$_fcsjObj.format("HH:mm"), // 发车时间描述
  391 + "fcsj": oInternalBc._$_fcsjObj.format("HH:mm"), // 发车时间描述
  392 + "fcsjDesc" : oInternalBc._$_fcsj_desc || oInternalBc._$_fcsjObj.format("HH:mm"),
308 393  
309 394 "groupNo": j, // 第几圈
310 395 "groupBcNo": z // 圈里第几个班次
... ...
src/main/resources/static/pages/forms/statement/waybill.html
... ... @@ -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 365 // window.open("/downloadFile/downloadList?fileName="+result.fileName); //下载压缩包
  366 + $get('/busInterval/exportWaybillMore',{date:date,line:line,strs:JSON.stringify(param)},function(result){
366 367 window.open("/downloadFile/download?fileName="+result.fileName);
367 368 layer.close(i);
368 369 });
... ...