Commit c4e0f3d2b5ba21a145734577190395ec73bd73e9
Merge branch 'pudong' of http://222.66.0.204:8090/panzhaov5/bsth_control into pudong
Showing
51 changed files
with
3089 additions
and
732 deletions
src/main/java/com/bsth/controller/StationController.java
| ... | ... | @@ -8,8 +8,6 @@ import org.springframework.web.bind.annotation.RequestMethod; |
| 8 | 8 | import org.springframework.web.bind.annotation.RequestParam; |
| 9 | 9 | import org.springframework.web.bind.annotation.RestController; |
| 10 | 10 | |
| 11 | -import antlr.collections.List; | |
| 12 | - | |
| 13 | 11 | import com.bsth.entity.Station; |
| 14 | 12 | import com.bsth.service.StationService; |
| 15 | 13 | import com.bsth.util.GetUIDAndCode; |
| ... | ... | @@ -128,6 +126,27 @@ public class StationController extends BaseController<Station, Integer> { |
| 128 | 126 | map.put("updateBy", ""); |
| 129 | 127 | return service.stationUpdate(map); |
| 130 | 128 | } |
| 129 | + | |
| 130 | + /** | |
| 131 | + * @Description :TODO(更新缓存站点保存) | |
| 132 | + * | |
| 133 | + * @param map <bJwpoints:中心点百度坐标;bPolygonGrid:多边形图形百度坐标;dbType:原坐标类型; | |
| 134 | + * | |
| 135 | + * descriptions:说明;destroy:是否撤销;directions:方向;distances:到站距离;gJwpoints:中心点WGS坐标; | |
| 136 | + * | |
| 137 | + * gPolygonGrid:多边形图形WGS坐标;lineId:线路ID;radius:圆半径;roadCoding:道路编码;shapesType:图形类型; | |
| 138 | + * | |
| 139 | + * stationCod:站点编码;stationMark:站点类型;stationName:站点名称;stationRouteCode:站点序号;toTime:到站时间 | |
| 140 | + * | |
| 141 | + * versions:版本号;x:城建坐标x;y:城建坐标y> | |
| 142 | + * | |
| 143 | + * @return Map<String, Object> <SUCCESS ; ERROR> | |
| 144 | + */ | |
| 145 | + @RequestMapping(value="stationCacheUpdate" , method = RequestMethod.POST) | |
| 146 | + public Map<String, Object> stationCacheUpdate(@RequestParam Map<String, Object> map) { | |
| 147 | + map.put("updateBy", ""); | |
| 148 | + return service.stationCacheUpdate(map); | |
| 149 | + } | |
| 131 | 150 | /** |
| 132 | 151 | * @Description :TODO(查询站点编码) |
| 133 | 152 | * | ... | ... |
src/main/java/com/bsth/controller/StationRouteController.java
| 1 | 1 | package com.bsth.controller; |
| 2 | 2 | |
| 3 | 3 | import com.bsth.entity.StationRoute; |
| 4 | +import com.bsth.entity.StationRouteCache; | |
| 5 | +import com.bsth.repository.StationRouteCacheRepository; | |
| 4 | 6 | import com.bsth.repository.StationRouteRepository; |
| 5 | 7 | import com.bsth.service.StationRouteService; |
| 6 | 8 | import org.springframework.beans.factory.annotation.Autowired; |
| ... | ... | @@ -37,6 +39,8 @@ public class StationRouteController extends BaseController<StationRoute, Integer |
| 37 | 39 | StationRouteService service; |
| 38 | 40 | @Autowired |
| 39 | 41 | StationRouteRepository stationRouteRepository; |
| 42 | + @Autowired | |
| 43 | + StationRouteCacheRepository stationRouteCacheRepository; | |
| 40 | 44 | |
| 41 | 45 | /** |
| 42 | 46 | * @param @param map |
| ... | ... | @@ -49,6 +53,11 @@ public class StationRouteController extends BaseController<StationRoute, Integer |
| 49 | 53 | return service.list(map); |
| 50 | 54 | } |
| 51 | 55 | |
| 56 | + @RequestMapping(value = "/cacheList", method = RequestMethod.GET) | |
| 57 | + public List<StationRouteCache> cacheList(@RequestParam Map<String, Object> map) { | |
| 58 | + return service.cacheList(map); | |
| 59 | + } | |
| 60 | + | |
| 52 | 61 | /** |
| 53 | 62 | * @Description :TODO(查询路段信息) |
| 54 | 63 | * |
| ... | ... | @@ -101,6 +110,14 @@ public class StationRouteController extends BaseController<StationRoute, Integer |
| 101 | 110 | } |
| 102 | 111 | |
| 103 | 112 | /** |
| 113 | + * @Description :TODO(查询缓存站点的上一个缓存站点) | |
| 114 | + */ | |
| 115 | + @RequestMapping(value = "/findCacheUpStationRouteCode" , method = RequestMethod.GET) | |
| 116 | + public List<Map<String, Object>> findCacheUpStationRouteCode(@RequestParam Map<String, Object> map) { | |
| 117 | + return service.findCacheUpStationRouteCode(map); | |
| 118 | + } | |
| 119 | + | |
| 120 | + /** | |
| 104 | 121 | * @Description :TODO(查询线路某方向下所有站点的中心百度坐标) |
| 105 | 122 | * |
| 106 | 123 | * @param map <lineId:线路ID; direction:方向> |
| ... | ... | @@ -195,4 +212,31 @@ public class StationRouteController extends BaseController<StationRoute, Integer |
| 195 | 212 | public Map<String, Object> upddis(@RequestParam Map<String, Object> map) { |
| 196 | 213 | return service.upddis(map); |
| 197 | 214 | } |
| 215 | + | |
| 216 | + /** | |
| 217 | + * | |
| 218 | + * @Title: findCacheStationRoute | |
| 219 | + * @Description: TODO(查询缓存路由) | |
| 220 | + */ | |
| 221 | + @RequestMapping(value = "/findCacheStationRoute",method = RequestMethod.GET) | |
| 222 | + public List<StationRouteCache> findCacheStationRoute(@RequestParam Map<String, Object> map) { | |
| 223 | + int lineId = Integer.parseInt(map.get("lineId").toString()); | |
| 224 | + int dir = Integer.parseInt(map.get("dir").toString()); | |
| 225 | + return stationRouteCacheRepository.findstationRoute(lineId, dir); | |
| 226 | + } | |
| 227 | + | |
| 228 | + /** | |
| 229 | + * | |
| 230 | + * @Title: findCachePoint | |
| 231 | + * | |
| 232 | + * @param map <lineId:线路ID; dir:方向> | |
| 233 | + * | |
| 234 | + * @Description: TODO(查询缓存路由) | |
| 235 | + */ | |
| 236 | + @RequestMapping(value = "/findCachePoint",method = RequestMethod.GET) | |
| 237 | + public List<Map<String, Object>> findCachePoint(@RequestParam Map<String, Object> map) { | |
| 238 | + int lineId = Integer.parseInt(map.get("lineId").toString()); | |
| 239 | + int dir = Integer.parseInt(map.get("dir").toString()); | |
| 240 | + return service.findCachePoint(lineId, dir); | |
| 241 | + } | |
| 198 | 242 | } | ... | ... |
src/main/java/com/bsth/controller/oil/YlbController.java
| ... | ... | @@ -288,4 +288,22 @@ public class YlbController extends BaseController<Ylb, Integer>{ |
| 288 | 288 | return resList; |
| 289 | 289 | |
| 290 | 290 | } |
| 291 | + | |
| 292 | + /* | |
| 293 | + * 历史修改行车路单后重新统计油量信息 (传参:line --线路编码 date --日期) | |
| 294 | + */ | |
| 295 | + | |
| 296 | + @RequestMapping(value = "/updateHistory",method = RequestMethod.POST) | |
| 297 | + public Map<String, Object> updateHistory(@RequestParam Map<String, Object> map) throws Exception{ | |
| 298 | + Map<String, Object> list =new HashMap<String, Object>(); | |
| 299 | + try { | |
| 300 | + list = yblService.updateHistory(map); | |
| 301 | + } catch (Exception e) { | |
| 302 | + // TODO Auto-generated catch block | |
| 303 | + throw e; | |
| 304 | + } | |
| 305 | + return list; | |
| 306 | + } | |
| 307 | + | |
| 308 | + | |
| 291 | 309 | } | ... | ... |
src/main/java/com/bsth/entity/Station.java
| ... | ... | @@ -6,6 +6,8 @@ import javax.persistence.Column; |
| 6 | 6 | import javax.persistence.Entity; |
| 7 | 7 | import javax.persistence.Id; |
| 8 | 8 | import javax.persistence.Table; |
| 9 | + | |
| 10 | +import java.util.Arrays; | |
| 9 | 11 | import java.util.Date; |
| 10 | 12 | |
| 11 | 13 | |
| ... | ... | @@ -323,4 +325,17 @@ public class Station { |
| 323 | 325 | public void setUpdateDate(Date updateDate) { |
| 324 | 326 | this.updateDate = updateDate; |
| 325 | 327 | } |
| 328 | + | |
| 329 | + @Override | |
| 330 | + public String toString() { | |
| 331 | + return "Station [id=" + id + ", stationCod=" + stationCod + ", stationName=" + stationName + ", roadCoding=" | |
| 332 | + + roadCoding + ", addr=" + addr + ", dbType=" + dbType + ", bJwpoints=" + bJwpoints + ", gLonx=" + gLonx | |
| 333 | + + ", gLaty=" + gLaty + ", x=" + x + ", y=" + y + ", shapesType=" + shapesType + ", radius=" + radius | |
| 334 | + + ", gPolygonGrid=" + Arrays.toString(gPolygonGrid) + ", bPolygonGrid=" + Arrays.toString(bPolygonGrid) | |
| 335 | + + ", destroy=" + destroy + ", versions=" + versions + ", isHaveLed=" + isHaveLed + ", isHaveShelter=" | |
| 336 | + + isHaveShelter + ", isHarbourStation=" + isHarbourStation + ", descriptions=" + descriptions | |
| 337 | + + ", createBy=" + createBy + ", updateBy=" + updateBy + ", createDate=" + createDate + ", updateDate=" | |
| 338 | + + updateDate + "]"; | |
| 339 | + } | |
| 340 | + | |
| 326 | 341 | } | ... | ... |
src/main/java/com/bsth/entity/oil/YlxxbUpdate.java
| ... | ... | @@ -31,6 +31,7 @@ public class YlxxbUpdate { |
| 31 | 31 | private Date xgrq; |
| 32 | 32 | private String xgr; |
| 33 | 33 | private String tj; |
| 34 | + private Integer zt; | |
| 34 | 35 | public Integer getId() { |
| 35 | 36 | return id; |
| 36 | 37 | } |
| ... | ... | @@ -103,8 +104,11 @@ public class YlxxbUpdate { |
| 103 | 104 | public void setTj(String tj) { |
| 104 | 105 | this.tj = tj; |
| 105 | 106 | } |
| 106 | - | |
| 107 | - | |
| 108 | - | |
| 107 | + public Integer getZt() { | |
| 108 | + return zt; | |
| 109 | + } | |
| 110 | + public void setZt(Integer zt) { | |
| 111 | + this.zt = zt; | |
| 112 | + } | |
| 109 | 113 | |
| 110 | 114 | } | ... | ... |
src/main/java/com/bsth/repository/LineRepository.java
| ... | ... | @@ -39,6 +39,9 @@ public interface LineRepository extends BaseRepository<Line, Integer> { |
| 39 | 39 | |
| 40 | 40 | @Query(value = " SELECT l FROM Line l where l.name like ?1") |
| 41 | 41 | List<Line> findLine(String line); |
| 42 | + | |
| 43 | + @Query(value = " SELECT l FROM Line l where l.lineCode = ?1") | |
| 44 | + List<Line> findLineByCode(String lineCode); | |
| 42 | 45 | |
| 43 | 46 | public Line findByLineCode(String string); |
| 44 | 47 | ... | ... |
src/main/java/com/bsth/repository/SectionRouteCacheRepository.java
| ... | ... | @@ -5,9 +5,7 @@ import java.util.List; |
| 5 | 5 | import org.springframework.data.jpa.repository.Modifying; |
| 6 | 6 | import org.springframework.data.jpa.repository.Query; |
| 7 | 7 | import org.springframework.stereotype.Repository; |
| 8 | -import org.springframework.transaction.annotation.Transactional; | |
| 9 | 8 | |
| 10 | -import com.bsth.entity.SectionRoute; | |
| 11 | 9 | import com.bsth.entity.SectionRouteCache; |
| 12 | 10 | |
| 13 | 11 | /** |
| ... | ... | @@ -139,6 +137,6 @@ public interface SectionRouteCacheRepository extends BaseRepository<SectionRoute |
| 139 | 137 | * @param dir |
| 140 | 138 | */ |
| 141 | 139 | @Modifying |
| 142 | - @Query(value="delete from bsth_c_sectionroute_cache where line = ?1 and directions = ?2", nativeQuery=true) | |
| 143 | - public void sectionRouteCacheDel(Integer line,Integer dir); | |
| 140 | + @Query(value="delete from bsth_c_sectionroute_cache where line_code = ?1 and directions = ?2", nativeQuery=true) | |
| 141 | + public void sectionRouteCacheDel(String lineCode,Integer dir); | |
| 144 | 142 | } | ... | ... |
src/main/java/com/bsth/repository/StationRouteCacheRepository.java
| ... | ... | @@ -3,19 +3,16 @@ package com.bsth.repository; |
| 3 | 3 | import java.util.List; |
| 4 | 4 | import java.util.Map; |
| 5 | 5 | |
| 6 | -import org.springframework.data.domain.Page; | |
| 7 | -import org.springframework.data.domain.Pageable; | |
| 8 | 6 | import org.springframework.data.domain.Sort; |
| 9 | 7 | import org.springframework.data.jpa.domain.Specification; |
| 10 | 8 | import org.springframework.data.jpa.repository.EntityGraph; |
| 11 | 9 | import org.springframework.data.jpa.repository.Modifying; |
| 12 | 10 | import org.springframework.data.jpa.repository.Query; |
| 13 | 11 | import org.springframework.stereotype.Repository; |
| 14 | -import org.springframework.transaction.annotation.Transactional; | |
| 15 | 12 | |
| 16 | -import com.bsth.entity.Line; | |
| 17 | 13 | import com.bsth.entity.StationRoute; |
| 18 | 14 | import com.bsth.entity.StationRouteCache; |
| 15 | +import com.bsth.entity.search.CustomerSpecs; | |
| 19 | 16 | |
| 20 | 17 | /** |
| 21 | 18 | * |
| ... | ... | @@ -54,8 +51,8 @@ public interface StationRouteCacheRepository extends BaseRepository<StationRoute |
| 54 | 51 | /** |
| 55 | 52 | * 查询站点路由 |
| 56 | 53 | */ |
| 57 | - @Query("select r from StationRouteCache r where r.lineCode=?1 and r.directions=?2 and r.destroy=0 order by r.stationRouteCode") | |
| 58 | - public List<StationRouteCache> findstationRoute(String lineCode,Integer dir); | |
| 54 | + @Query("select r from StationRouteCache r where r.line.id=?1 and r.directions=?2 and r.destroy=0 order by r.stationRouteCode") | |
| 55 | + public List<StationRouteCache> findstationRoute(Integer lineId,Integer dir); | |
| 59 | 56 | |
| 60 | 57 | /** |
| 61 | 58 | * 更新路线删除线路缓存站点 |
| ... | ... | @@ -64,7 +61,80 @@ public interface StationRouteCacheRepository extends BaseRepository<StationRoute |
| 64 | 61 | * @param dir |
| 65 | 62 | */ |
| 66 | 63 | @Modifying |
| 67 | - @Query(value="delete from bsth_c_stationroute_cache where line = ?1 and directions = ?2 ", nativeQuery=true) | |
| 68 | - public void stationRouteCacheDel(Integer line,Integer dir); | |
| 64 | + @Query(value="delete from bsth_c_stationroute_cache where line_code = ?1 and directions = ?2 ", nativeQuery=true) | |
| 65 | + public void stationRouteCacheDel(String lineCode,Integer dir); | |
| 66 | + | |
| 67 | + | |
| 68 | + @Query(value = "SELECT a.`stationRoute.id`," + | |
| 69 | + "a.`stationRoute.line`," + | |
| 70 | + "a.`stationRoute.station`," + | |
| 71 | + "a.`stationRoute.stationName`," + | |
| 72 | + "a.`stationRoute.stationRouteCode`," + | |
| 73 | + "a.`stationRoute.lineCode`," + | |
| 74 | + "a.`stationRoute.stationMark`," + | |
| 75 | + "a.`stationRoute.outStationNmber`," + | |
| 76 | + "a.`stationRoute.directions`," + | |
| 77 | + "a.`stationRoute.distances`," + | |
| 78 | + "a.`stationRoute.toTime`," + | |
| 79 | + "a.`stationRoute.firstTime`," + | |
| 80 | + "a.`stationRoute.endTime`," + | |
| 81 | + "a.`stationRoute.descriptions`," + | |
| 82 | + "a.`stationRoute.versions`," + | |
| 83 | + "b.id AS 'station.id'," + | |
| 84 | + "b.station_cod AS 'station.stationCod'," + | |
| 85 | + "b.station_name AS 'station.stationName'," + | |
| 86 | + "b.road_coding AS 'station.roadCoding'," + | |
| 87 | + "b.db_type AS 'station.dbType'," + | |
| 88 | + "b.b_jwpoints AS 'station.bJwpoints'," + | |
| 89 | + "b.g_lonx AS 'station.gLonx'," + | |
| 90 | + "b.g_lonx AS 'station.gLaty'," + | |
| 91 | + "b.x AS 'station.x'," + | |
| 92 | + "b.y AS 'station.y'," + | |
| 93 | + "b.shapes_type AS 'station.shapesType'," + | |
| 94 | + "b.radius AS 'station.radius'," + | |
| 95 | + "ST_AsText(b.g_polygon_grid) AS 'station.gPolygonGrid'," + | |
| 96 | + "ST_AsText(b.b_polygon_grid) AS 'station.bPolygonGrid'," + | |
| 97 | + "b.destroy AS 'station.destroy'," + | |
| 98 | + "b.versions AS 'station.versions'," + | |
| 99 | + "b.descriptions AS 'station.descriptions' FROM (" + | |
| 100 | + "SELECT r.id AS 'stationRoute.id'," + | |
| 101 | + " r.line AS 'stationRoute.line'," + | |
| 102 | + "r.station AS 'stationRoute.station'," + | |
| 103 | + "r.station_name AS 'stationRoute.stationName'," + | |
| 104 | + "r.station_route_code as 'stationRoute.stationRouteCode'," + | |
| 105 | + "r.line_code AS 'stationRoute.lineCode'," + | |
| 106 | + "r.station_mark AS 'stationRoute.stationMark'," + | |
| 107 | + "r.out_station_nmber AS 'stationRoute.outStationNmber'," + | |
| 108 | + "r.directions AS 'stationRoute.directions'," + | |
| 109 | + "r.distances AS 'stationRoute.distances'," + | |
| 110 | + "r.to_time AS 'stationRoute.toTime'," + | |
| 111 | + "r.first_time AS 'stationRoute.firstTime'," + | |
| 112 | + "r.end_time AS 'stationRoute.endTime'," + | |
| 113 | + "r.descriptions AS 'stationRoute.descriptions'," + | |
| 114 | + "r.versions AS 'stationRoute.versions' FROM bsth_c_stationroute_cache r WHERE r.line = ?1 and r.directions = ?2 and r.destroy=0) a " + | |
| 115 | + "LEFT JOIN bsth_c_station b " + | |
| 116 | + "ON a.`stationRoute.station` = b.id ORDER BY a.`stationRoute.stationRouteCode` ASC", nativeQuery=true) | |
| 117 | + List<Object[]> findCachePoint(int lineId, int dir); | |
| 118 | + | |
| 119 | + | |
| 120 | + /** | |
| 121 | + * @Description :TODO(查询线线路方向下的站点路由) | |
| 122 | + */ | |
| 123 | + @EntityGraph(value = "stationRoute_station_cache", type = EntityGraph.EntityGraphType.FETCH) | |
| 124 | + @Query(value="select sr from StationRouteCache sr where sr.line.id = ?1 and sr.directions = ?2 and sr.destroy = ?3 ORDER BY sr.stationRouteCode ASC") | |
| 125 | + List<StationRouteCache> cacheList(Integer lineId, Integer directions, Integer destroy); | |
| 69 | 126 | |
| 127 | + /** | |
| 128 | + * @Description :TODO(查询线路某方向下的站点序号与类型) | |
| 129 | + * | |
| 130 | + * @param map <lineId:线路ID; direction:方向;stationRouteCode:站点编码> | |
| 131 | + * | |
| 132 | + * @return List<Map<String, Object>> | |
| 133 | + */ | |
| 134 | + @Query(value = "select t.station_route_code,t.station_mark from bsth_c_stationroute_cache t where " + | |
| 135 | + " t.station_route_code =(" + | |
| 136 | + "select MAX(station_route_code) as stationRouteCode from bsth_c_stationroute_cache r WHERE " + | |
| 137 | + "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) | |
| 138 | + List<Object[]> findUpStationRouteCode(Integer lineId,Integer direction,Integer stationRouteCode); | |
| 139 | + | |
| 70 | 140 | } | ... | ... |
src/main/java/com/bsth/service/StationRouteService.java
| ... | ... | @@ -6,6 +6,7 @@ import java.util.Map; |
| 6 | 6 | import javax.servlet.http.HttpServletResponse; |
| 7 | 7 | |
| 8 | 8 | import com.bsth.entity.StationRoute; |
| 9 | +import com.bsth.entity.StationRouteCache; | |
| 9 | 10 | |
| 10 | 11 | /** |
| 11 | 12 | * |
| ... | ... | @@ -32,6 +33,8 @@ public interface StationRouteService extends BaseService<StationRoute, Integer> |
| 32 | 33 | */ |
| 33 | 34 | Iterable<StationRoute> list(Map<String, Object> map); |
| 34 | 35 | |
| 36 | + List<StationRouteCache> cacheList(Map<String, Object> map); | |
| 37 | + | |
| 35 | 38 | /** |
| 36 | 39 | * @Description : TODO(根据路段站点Id批量撤销站点) |
| 37 | 40 | * |
| ... | ... | @@ -61,6 +64,8 @@ public interface StationRouteService extends BaseService<StationRoute, Integer> |
| 61 | 64 | */ |
| 62 | 65 | List<Map<String, Object>> findUpStationRouteCode(Map<String, Object> map); |
| 63 | 66 | |
| 67 | + List<Map<String, Object>> findCacheUpStationRouteCode(Map<String, Object> map); | |
| 68 | + | |
| 64 | 69 | /** |
| 65 | 70 | * @Description :TODO(查询线路某方向下所有站点的中心百度坐标) |
| 66 | 71 | * |
| ... | ... | @@ -115,4 +120,14 @@ public interface StationRouteService extends BaseService<StationRoute, Integer> |
| 115 | 120 | |
| 116 | 121 | void batchUpdate(Integer lineId, String lineCode); |
| 117 | 122 | |
| 123 | + /** | |
| 124 | + * @Description :TODO(查询缓存站点信息) | |
| 125 | + * | |
| 126 | + * @param map <line.id_eq:线路ID; directions_eq:方向> | |
| 127 | + * | |
| 128 | + * @return List<Map<String, Object>> | |
| 129 | + */ | |
| 130 | + List<Map<String, Object>> findCachePoint(int lineId, int dir); | |
| 131 | + | |
| 132 | + | |
| 118 | 133 | } | ... | ... |
src/main/java/com/bsth/service/StationService.java
src/main/java/com/bsth/service/impl/SectionServiceImpl.java
| ... | ... | @@ -190,11 +190,11 @@ public class SectionServiceImpl extends BaseServiceImpl<Section, Integer> implem |
| 190 | 190 | routeRepository.save(route); |
| 191 | 191 | } |
| 192 | 192 | // 删除缓存路段 |
| 193 | - routeCacheRepository.sectionRouteCacheDel(sectionRouteLine,directions); | |
| 193 | + routeCacheRepository.sectionRouteCacheDel(lineCode,directions); | |
| 194 | 194 | // 撤销原有站点路由 |
| 195 | 195 | stationRouteRepository.stationRouteUpdDestroy(sectionRouteLine,directions); |
| 196 | 196 | // 站点保存 |
| 197 | - List<StationRouteCache> stationRouteList = stationRouteCacheRepository.findstationRoute(lineCode,directions); | |
| 197 | + List<StationRouteCache> stationRouteList = stationRouteCacheRepository.findstationRoute(sectionRouteLine,directions); | |
| 198 | 198 | for(int i=0; i < stationRouteList.size(); i++) { |
| 199 | 199 | StationRouteCache stationRouteCache = stationRouteList.get(i); |
| 200 | 200 | StationRoute stationRoute = new StationRoute(); |
| ... | ... | @@ -221,7 +221,7 @@ public class SectionServiceImpl extends BaseServiceImpl<Section, Integer> implem |
| 221 | 221 | stationRouteRepository.save(stationRoute); |
| 222 | 222 | } |
| 223 | 223 | // 删除缓存站点 |
| 224 | - stationRouteCacheRepository.stationRouteCacheDel(sectionRouteLine,directions); | |
| 224 | + stationRouteCacheRepository.stationRouteCacheDel(lineCode,directions); | |
| 225 | 225 | |
| 226 | 226 | resultMap.put("status", ResponseCode.SUCCESS); |
| 227 | 227 | } catch (Exception e) { |
| ... | ... | @@ -324,11 +324,11 @@ public class SectionServiceImpl extends BaseServiceImpl<Section, Integer> implem |
| 324 | 324 | lsRouteRepository.save(route); |
| 325 | 325 | } |
| 326 | 326 | // 删除缓存路段 |
| 327 | - routeCacheRepository.sectionRouteCacheDel(sectionRouteLine,directions); | |
| 327 | + routeCacheRepository.sectionRouteCacheDel(lineCode,directions); | |
| 328 | 328 | // 删除原有历史表站点路由 |
| 329 | 329 | lsStationRouteRepository.batchDelete(sectionRouteLine,directions,versions); |
| 330 | 330 | // 站点保存 |
| 331 | - List<StationRouteCache> stationRouteList = stationRouteCacheRepository.findstationRoute(lineCode,directions); | |
| 331 | + List<StationRouteCache> stationRouteList = stationRouteCacheRepository.findstationRoute(sectionRouteLine,directions); | |
| 332 | 332 | for(int i=0; i < stationRouteList.size(); i++) { |
| 333 | 333 | StationRouteCache stationRouteCache = stationRouteList.get(i); |
| 334 | 334 | LsStationRoute stationRoute = new LsStationRoute(); |
| ... | ... | @@ -355,7 +355,7 @@ public class SectionServiceImpl extends BaseServiceImpl<Section, Integer> implem |
| 355 | 355 | lsStationRouteRepository.save(stationRoute); |
| 356 | 356 | } |
| 357 | 357 | // 删除缓存站点 |
| 358 | - stationRouteCacheRepository.stationRouteCacheDel(sectionRouteLine,directions); | |
| 358 | + stationRouteCacheRepository.stationRouteCacheDel(lineCode,directions); | |
| 359 | 359 | resultMap.put("status", ResponseCode.SUCCESS); |
| 360 | 360 | } catch (Exception e) { |
| 361 | 361 | resultMap.put("status", ResponseCode.ERROR); | ... | ... |
src/main/java/com/bsth/service/impl/StationRouteServiceImpl.java
| ... | ... | @@ -4,6 +4,7 @@ import com.bsth.common.ResponseCode; |
| 4 | 4 | import com.bsth.entity.Line; |
| 5 | 5 | import com.bsth.entity.Station; |
| 6 | 6 | import com.bsth.entity.StationRoute; |
| 7 | +import com.bsth.entity.StationRouteCache; | |
| 7 | 8 | import com.bsth.entity.search.CustomerSpecs; |
| 8 | 9 | import com.bsth.repository.LineRepository; |
| 9 | 10 | import com.bsth.repository.SectionRouteRepository; |
| ... | ... | @@ -75,6 +76,17 @@ public class StationRouteServiceImpl extends BaseServiceImpl<StationRoute, Integ |
| 75 | 76 | } |
| 76 | 77 | |
| 77 | 78 | @Override |
| 79 | + public List<StationRouteCache> cacheList(Map<String, Object> map) { | |
| 80 | + List<Sort.Order> orderList = new ArrayList<>(); | |
| 81 | + orderList.add(new Sort.Order(Direction.ASC, "directions")); | |
| 82 | + orderList.add(new Sort.Order(Direction.ASC, "stationRouteCode")); | |
| 83 | + Integer lineId = map.get("lineId").equals("") ? null : Integer.parseInt(map.get("lineId").toString()); | |
| 84 | + Integer direction = map.get("direction").equals("") ? null : Integer.parseInt(map.get("direction").toString()); | |
| 85 | + Integer destroy = map.get("destroy").equals("") ? null : Integer.parseInt(map.get("destroy").toString()); | |
| 86 | + return cacheRepository.cacheList(lineId, direction, destroy); | |
| 87 | + } | |
| 88 | + | |
| 89 | + @Override | |
| 78 | 90 | public Map<String, Object> getSectionRouteExport(Integer id, HttpServletResponse resp) { |
| 79 | 91 | Map<String, Object> resultMap = new HashMap<String, Object>(); |
| 80 | 92 | try { |
| ... | ... | @@ -195,7 +207,7 @@ public class StationRouteServiceImpl extends BaseServiceImpl<StationRoute, Integ |
| 195 | 207 | // 站点路由站点ID |
| 196 | 208 | tempM.put("stationRouteStation", stationList.get(i)[2]); |
| 197 | 209 | |
| 198 | - // 站点路由站点名称 | |
| 210 | + // 站点路由名称 | |
| 199 | 211 | tempM.put("stationRouteStationName", stationList.get(i)[3]); |
| 200 | 212 | |
| 201 | 213 | // 站点路由站点序号 |
| ... | ... | @@ -512,6 +524,24 @@ public class StationRouteServiceImpl extends BaseServiceImpl<StationRoute, Integ |
| 512 | 524 | return list; |
| 513 | 525 | } |
| 514 | 526 | |
| 527 | + @Override | |
| 528 | + public List<Map<String, Object>> findCacheUpStationRouteCode(Map<String, Object> map) { | |
| 529 | + Integer lineId = map.get("lineId").equals("") ? null : Integer.parseInt(map.get("lineId").toString()); | |
| 530 | + Integer direction = map.get("direction").equals("") ? null : Integer.parseInt(map.get("direction").toString()); | |
| 531 | + Integer stationRouteCode = map.get("stationRouteCode").equals("") ? null : Integer.parseInt(map.get("stationRouteCode").toString()); | |
| 532 | + List<Object[]> reslutList = cacheRepository.findUpStationRouteCode(lineId, direction, stationRouteCode); | |
| 533 | + List<Map<String, Object>> list = new ArrayList<Map<String,Object>>(); | |
| 534 | + if(reslutList.size()>0) { | |
| 535 | + for(int i = 0 ; i <reslutList.size() ;i++){ | |
| 536 | + Map<String, Object> tempM = new HashMap<String, Object>(); | |
| 537 | + tempM.put("stationRouteCode", reslutList.get(i)[0]); | |
| 538 | + tempM.put("stationRouteMarke", reslutList.get(i)[1]); | |
| 539 | + list.add(tempM); | |
| 540 | + } | |
| 541 | + } | |
| 542 | + return list; | |
| 543 | + } | |
| 544 | + | |
| 515 | 545 | /** |
| 516 | 546 | * @Description :TODO(查询线路某方向下所有站点的中心百度坐标) |
| 517 | 547 | * |
| ... | ... | @@ -1269,9 +1299,134 @@ public class StationRouteServiceImpl extends BaseServiceImpl<StationRoute, Integ |
| 1269 | 1299 | return rs; |
| 1270 | 1300 | } |
| 1271 | 1301 | |
| 1272 | - // 更具线路批量撤销 | |
| 1302 | + /** | |
| 1303 | + * @Description :TODO(更具线路批量撤销) | |
| 1304 | + */ | |
| 1273 | 1305 | @Override |
| 1274 | 1306 | public void batchUpdate(Integer lineId, String lineCode) { |
| 1275 | 1307 | repository.batchUpdate(lineId,lineCode); |
| 1276 | 1308 | } |
| 1309 | + | |
| 1310 | + /** | |
| 1311 | + * @Description :TODO(查询缓存路由) | |
| 1312 | + * | |
| 1313 | + * @param map <line.id_eq:线路ID; directions_eq:方向> | |
| 1314 | + * | |
| 1315 | + * @return List<Map<String, Object>> | |
| 1316 | + */ | |
| 1317 | + @Override | |
| 1318 | + @Transactional | |
| 1319 | + public List<Map<String, Object>> findCachePoint(int lineId, int dir) { | |
| 1320 | + | |
| 1321 | + List<Object[]> stationList = cacheRepository.findCachePoint(lineId, dir); | |
| 1322 | + | |
| 1323 | + List<Map<String, Object>> staitonRouteList= new ArrayList<Map<String, Object>>(); | |
| 1324 | + | |
| 1325 | + if(stationList.size()>0) { | |
| 1326 | + | |
| 1327 | + for(int i = 0 ; i < stationList.size(); i++) { | |
| 1328 | + | |
| 1329 | + Map<String, Object> tempM = new HashMap<String, Object>(); | |
| 1330 | + | |
| 1331 | + // 站点路由ID | |
| 1332 | + tempM.put("stationRouteId", stationList.get(i)[0]); | |
| 1333 | + | |
| 1334 | + // 站点路由线路ID | |
| 1335 | + tempM.put("stationRouteLine", stationList.get(i)[1]); | |
| 1336 | + | |
| 1337 | + // 站点路由站点ID | |
| 1338 | + tempM.put("stationRouteStation", stationList.get(i)[2]); | |
| 1339 | + | |
| 1340 | + // 站点路由名称 | |
| 1341 | + tempM.put("stationRouteStationName", stationList.get(i)[3]); | |
| 1342 | + | |
| 1343 | + // 站点路由站点序号 | |
| 1344 | + tempM.put("stationRouteStationRouteCode", stationList.get(i)[4]); | |
| 1345 | + | |
| 1346 | + // 站点路由线路编码 | |
| 1347 | + tempM.put("stationRouteLineCode", stationList.get(i)[5]); | |
| 1348 | + | |
| 1349 | + // 站点路由站点类型 | |
| 1350 | + tempM.put("stationRouteStationMark", stationList.get(i)[6]); | |
| 1351 | + | |
| 1352 | + // 站点路由出站的序号 | |
| 1353 | + tempM.put("stationRouteOutStationNmber", stationList.get(i)[7]); | |
| 1354 | + | |
| 1355 | + // 站点路由站点方向 | |
| 1356 | + tempM.put("stationRouteDirections", stationList.get(i)[8]); | |
| 1357 | + | |
| 1358 | + // 站点路由站点到站距离 | |
| 1359 | + tempM.put("stationRouteDistances", stationList.get(i)[9]); | |
| 1360 | + | |
| 1361 | + // 站点路由到站时间 | |
| 1362 | + tempM.put("stationRouteToTime", stationList.get(i)[10]); | |
| 1363 | + | |
| 1364 | + // 站点路由站点首班时间 | |
| 1365 | + tempM.put("stationRouteFirstTime", stationList.get(i)[11]); | |
| 1366 | + | |
| 1367 | + // 站点路由站点末班时间 | |
| 1368 | + tempM.put("stationRouteEndTime", stationList.get(i)[12]); | |
| 1369 | + | |
| 1370 | + // 站点路由站点说明 | |
| 1371 | + tempM.put("stationRouteDescriptions", stationList.get(i)[13]); | |
| 1372 | + | |
| 1373 | + // 站点路由版本 | |
| 1374 | + tempM.put("stationRouteVersions", stationList.get(i)[14]); | |
| 1375 | + | |
| 1376 | + // 站点ID | |
| 1377 | + tempM.put("stationId", stationList.get(i)[15]); | |
| 1378 | + | |
| 1379 | + // 站点编码 | |
| 1380 | + tempM.put("stationStationCod", stationList.get(i)[16]); | |
| 1381 | + | |
| 1382 | + // 站点名称 | |
| 1383 | + tempM.put("stationStationName", stationList.get(i)[17]); | |
| 1384 | + | |
| 1385 | + // 路段编码 | |
| 1386 | + tempM.put("stationRoadCoding", stationList.get(i)[18]); | |
| 1387 | + | |
| 1388 | + // 原坐标类型 | |
| 1389 | + tempM.put("stationDbType", stationList.get(i)[19]); | |
| 1390 | + | |
| 1391 | + // 中心点(百度坐标) | |
| 1392 | + tempM.put("stationBJwpoints", stationList.get(i)[20]); | |
| 1393 | + | |
| 1394 | + // 中心点(WGS经度) | |
| 1395 | + tempM.put("stationGLonx", stationList.get(i)[21]); | |
| 1396 | + | |
| 1397 | + // 中心点(WGS纬度) | |
| 1398 | + tempM.put("stationGLaty", stationList.get(i)[22]); | |
| 1399 | + | |
| 1400 | + // 城建坐标x | |
| 1401 | + tempM.put("stationx", stationList.get(i)[23]); | |
| 1402 | + | |
| 1403 | + // 城建坐标y | |
| 1404 | + tempM.put("stationy", stationList.get(i)[24]); | |
| 1405 | + | |
| 1406 | + // 站点图形类型 | |
| 1407 | + tempM.put("stationShapesType", stationList.get(i)[25]); | |
| 1408 | + | |
| 1409 | + // 站点圆半径 | |
| 1410 | + tempM.put("stationRadius", stationList.get(i)[26]); | |
| 1411 | + | |
| 1412 | + // 站点图形WGS坐标 | |
| 1413 | + tempM.put("stationGPolygonGrid", stationList.get(i)[27]); | |
| 1414 | + | |
| 1415 | + // 站点图形百度坐标 | |
| 1416 | + tempM.put("stationBPolygonGrid", stationList.get(i)[28]); | |
| 1417 | + | |
| 1418 | + // 是否撤销 | |
| 1419 | + tempM.put("stationDestroy", stationList.get(i)[29]); | |
| 1420 | + | |
| 1421 | + // 站点版本 | |
| 1422 | + tempM.put("stationVersions", stationList.get(i)[30]); | |
| 1423 | + | |
| 1424 | + // 站点说明 | |
| 1425 | + tempM.put("stationDescriptions", stationList.get(i)[31]); | |
| 1426 | + | |
| 1427 | + staitonRouteList.add(tempM); | |
| 1428 | + } | |
| 1429 | + } | |
| 1430 | + return staitonRouteList; | |
| 1431 | + } | |
| 1277 | 1432 | } | ... | ... |
src/main/java/com/bsth/service/impl/StationServiceImpl.java
| 1 | 1 | package com.bsth.service.impl; |
| 2 | 2 | |
| 3 | 3 | import java.math.BigDecimal; |
| 4 | +import java.util.ArrayList; | |
| 4 | 5 | import java.util.HashMap; |
| 5 | -import java.util.Iterator; | |
| 6 | 6 | import java.util.List; |
| 7 | 7 | import java.util.Map; |
| 8 | 8 | |
| ... | ... | @@ -12,8 +12,7 @@ import org.springframework.beans.factory.annotation.Autowired; |
| 12 | 12 | import org.springframework.stereotype.Service; |
| 13 | 13 | import org.springframework.transaction.annotation.Transactional; |
| 14 | 14 | |
| 15 | - | |
| 16 | - | |
| 15 | +import com.alibaba.fastjson.JSON; | |
| 17 | 16 | import com.alibaba.fastjson.JSONArray; |
| 18 | 17 | import com.alibaba.fastjson.JSONObject; |
| 19 | 18 | import com.bsth.common.ResponseCode; |
| ... | ... | @@ -261,6 +260,7 @@ public class StationServiceImpl extends BaseServiceImpl<Station, Integer> implem |
| 261 | 260 | Map<String, Object> paramsMeleageAndDistncDura = new HashMap<String,Object>(); |
| 262 | 261 | JSONArray stationsArray = JSONArray.parseArray(stationJSON); |
| 263 | 262 | if(stationsArray.size()>0) { |
| 263 | + Station loopStartStation = new Station(); | |
| 264 | 264 | for(int i = 0;i <stationsArray.size();i++) { |
| 265 | 265 | // 站点名称 |
| 266 | 266 | String stationName = stationsArray.getJSONObject(i).equals("") ? "" : stationsArray.getJSONObject(i).get("name").toString(); |
| ... | ... | @@ -292,6 +292,38 @@ public class StationServiceImpl extends BaseServiceImpl<Station, Integer> implem |
| 292 | 292 | /*Integer stationId = Integer.parseInt(stationNameList.get(0)[1].toString());*/ |
| 293 | 293 | Integer stationId = Integer.parseInt(isHaveMap.get("id").toString()); |
| 294 | 294 | arg0 = repository.findOne(stationId); |
| 295 | + | |
| 296 | + if ((i==0 || i==stationsArray.size()-1) && resultLine.getLinePlayType() != 1) {// (起终点站) | |
| 297 | + List<Station> list = new ArrayList<>(); | |
| 298 | + list.add(arg0); | |
| 299 | + List<Station> stationlist = JSONArray.parseArray(JSON.toJSONString(list), Station.class); | |
| 300 | + Station station = stationlist.get(0); | |
| 301 | + // 站点编码 | |
| 302 | + long stationCode = GetUIDAndCode.getStationId(); | |
| 303 | + station.setStationCod(String.valueOf(stationCode)); | |
| 304 | + station.setId((int)stationCode); | |
| 305 | + station.setCreateDate(null); | |
| 306 | + station.setUpdateDate(null); | |
| 307 | + repository.save(station); | |
| 308 | + arg0 = station; | |
| 309 | + } else if (i==0 && resultLine.getLinePlayType() == 1) {// 环线终点和起点引用同一个站 | |
| 310 | + List<Station> list = new ArrayList<>(); | |
| 311 | + list.add(arg0); | |
| 312 | + List<Station> stationlist = JSONArray.parseArray(JSON.toJSONString(list), Station.class); | |
| 313 | + Station station = stationlist.get(0); | |
| 314 | + // 站点编码 | |
| 315 | + long stationCode = GetUIDAndCode.getStationId(); | |
| 316 | + station.setStationCod(String.valueOf(stationCode)); | |
| 317 | + station.setId((int)stationCode); | |
| 318 | + station.setCreateDate(null); | |
| 319 | + station.setUpdateDate(null); | |
| 320 | + repository.save(station); | |
| 321 | + arg0 = station; | |
| 322 | + loopStartStation = arg0; | |
| 323 | + repository.save(arg0); | |
| 324 | + } else if (i==stationsArray.size()-1 && resultLine.getLinePlayType() == 1) {// 环线终点和起点引用同一个站 | |
| 325 | + arg0 = loopStartStation; | |
| 326 | + } | |
| 295 | 327 | }else { |
| 296 | 328 | // 站点编码 |
| 297 | 329 | long stationCode = GetUIDAndCode.getStationId(); |
| ... | ... | @@ -353,7 +385,14 @@ public class StationServiceImpl extends BaseServiceImpl<Station, Integer> implem |
| 353 | 385 | arg0.setVersions(versions); |
| 354 | 386 | arg0.setbJwpoints(bJwpoints); |
| 355 | 387 | // 插入站点信息 |
| 356 | - repository.save(arg0); | |
| 388 | + if (i==0 && resultLine.getLinePlayType() == 1) {// 环线终点和起点引用同一个站 | |
| 389 | + loopStartStation = arg0; | |
| 390 | + repository.save(arg0); | |
| 391 | + } else if (i==stationsArray.size()-1 && resultLine.getLinePlayType() == 1) {// 环线终点和起点引用同一个站 | |
| 392 | + arg0 = loopStartStation; | |
| 393 | + } else { | |
| 394 | + repository.save(arg0); | |
| 395 | + } | |
| 357 | 396 | |
| 358 | 397 | } |
| 359 | 398 | // 站点路由对象 |
| ... | ... | @@ -1297,8 +1336,10 @@ public class StationServiceImpl extends BaseServiceImpl<Station, Integer> implem |
| 1297 | 1336 | Map<String, Object> paramsMeleageAndDistncDura = new HashMap<String,Object>(); |
| 1298 | 1337 | JSONArray stationsArray = JSONArray.parseArray(stationJSON); |
| 1299 | 1338 | if(stationsArray.size()>0) { |
| 1339 | + // 环线起点站 | |
| 1340 | + Station loopStartStation = new Station(); | |
| 1300 | 1341 | // 更新路线前删除线路缓存站点 |
| 1301 | - routeCacheRepository.stationRouteCacheDel(Integer.parseInt(resultLine.getLineCode()),directions); | |
| 1342 | + routeCacheRepository.stationRouteCacheDel(resultLine.getLineCode(),directions); | |
| 1302 | 1343 | for(int i = 0;i <stationsArray.size();i++) { |
| 1303 | 1344 | // 站点名称 |
| 1304 | 1345 | String stationName = stationsArray.getJSONObject(i).equals("") ? "" : stationsArray.getJSONObject(i).get("name").toString(); |
| ... | ... | @@ -1322,14 +1363,46 @@ public class StationServiceImpl extends BaseServiceImpl<Station, Integer> implem |
| 1322 | 1363 | // 百度坐标纬度 |
| 1323 | 1364 | String bLatx = JSONObject.parseObject(stationsArray.getJSONObject(i).get("potion").toString()).get("lat").toString(); |
| 1324 | 1365 | bLatx = bLatx==null || bLatx.equals("") ? "0" : bLatx; |
| 1325 | - List<Object[]> stationNameList = repository.findStationName(directions,stationName); | |
| 1366 | +// List<Object[]> stationNameList = repository.findStationName(directions,stationName); | |
| 1326 | 1367 | //Map<String, Object> isHaveMap = isHaveStationname(bLonx,bLatx,stationNameList); |
| 1327 | 1368 | // 初始化站点对象 |
| 1328 | 1369 | Station arg0 = new Station(); |
| 1329 | - // 存在的点就不添加到数据库 | |
| 1370 | + // 存在的点就不添加到数据库(起终点站重新添加站点) | |
| 1330 | 1371 | if(Boolean.parseBoolean(stationsArray.getJSONObject(i).get("isHave").toString())) { |
| 1331 | 1372 | Integer stationId = Integer.parseInt(stationsArray.getJSONObject(i).get("id").toString()); |
| 1332 | 1373 | arg0 = repository.findOne(stationId); |
| 1374 | + | |
| 1375 | + if ((i==0 || i==stationsArray.size()-1) && resultLine.getLinePlayType() != 1) {// (起终点站) | |
| 1376 | + List<Station> list = new ArrayList<>(); | |
| 1377 | + list.add(arg0); | |
| 1378 | + List<Station> stationlist = JSONArray.parseArray(JSON.toJSONString(list), Station.class); | |
| 1379 | + Station station = stationlist.get(0); | |
| 1380 | + // 站点编码 | |
| 1381 | + long stationCode = GetUIDAndCode.getStationId(); | |
| 1382 | + station.setStationCod(String.valueOf(stationCode)); | |
| 1383 | + station.setId((int)stationCode); | |
| 1384 | + station.setCreateDate(null); | |
| 1385 | + station.setUpdateDate(null); | |
| 1386 | + repository.save(station); | |
| 1387 | + arg0 = station; | |
| 1388 | + } else if (i==0 && resultLine.getLinePlayType() == 1) {// 环线终点和起点引用同一个站 | |
| 1389 | + List<Station> list = new ArrayList<>(); | |
| 1390 | + list.add(arg0); | |
| 1391 | + List<Station> stationlist = JSONArray.parseArray(JSON.toJSONString(list), Station.class); | |
| 1392 | + Station station = stationlist.get(0); | |
| 1393 | + // 站点编码 | |
| 1394 | + long stationCode = GetUIDAndCode.getStationId(); | |
| 1395 | + station.setStationCod(String.valueOf(stationCode)); | |
| 1396 | + station.setId((int)stationCode); | |
| 1397 | + station.setCreateDate(null); | |
| 1398 | + station.setUpdateDate(null); | |
| 1399 | + repository.save(station); | |
| 1400 | + arg0 = station; | |
| 1401 | + loopStartStation = arg0; | |
| 1402 | + repository.save(arg0); | |
| 1403 | + } else if (i==stationsArray.size()-1 && resultLine.getLinePlayType() == 1) {// 环线终点和起点引用同一个站 | |
| 1404 | + arg0 = loopStartStation; | |
| 1405 | + } | |
| 1333 | 1406 | }else { |
| 1334 | 1407 | // 站点编码 |
| 1335 | 1408 | long stationCode = GetUIDAndCode.getStationId(); |
| ... | ... | @@ -1391,13 +1464,23 @@ public class StationServiceImpl extends BaseServiceImpl<Station, Integer> implem |
| 1391 | 1464 | arg0.setVersions(versions); |
| 1392 | 1465 | arg0.setbJwpoints(bJwpoints); |
| 1393 | 1466 | // 插入站点信息 |
| 1394 | - repository.save(arg0); | |
| 1467 | + if (i==0 && resultLine.getLinePlayType() == 1) {// 环线终点和起点引用同一个站 | |
| 1468 | + loopStartStation = arg0; | |
| 1469 | + repository.save(arg0); | |
| 1470 | + } else if (i==stationsArray.size()-1 && resultLine.getLinePlayType() == 1) {// 环线终点和起点引用同一个站 | |
| 1471 | + arg0 = loopStartStation; | |
| 1472 | + } else { | |
| 1473 | + repository.save(arg0); | |
| 1474 | + } | |
| 1395 | 1475 | |
| 1396 | 1476 | } |
| 1397 | 1477 | // 站点路由对象 |
| 1398 | 1478 | StationRouteCache route = new StationRouteCache(); |
| 1399 | 1479 | // 站点名称 |
| 1400 | - route.setStationName(stationName); | |
| 1480 | + if(i==stationsArray.size()-1 && resultLine.getLinePlayType() == 1) | |
| 1481 | + route.setStationName(loopStartStation.getStationName()); | |
| 1482 | + else | |
| 1483 | + route.setStationName(stationName); | |
| 1401 | 1484 | route.setDistances(distance); |
| 1402 | 1485 | sumUpOrDownMileage = sumUpOrDownMileage + distance; |
| 1403 | 1486 | route.setToTime(duration); |
| ... | ... | @@ -1448,7 +1531,7 @@ public class StationServiceImpl extends BaseServiceImpl<Station, Integer> implem |
| 1448 | 1531 | // 转换成JSON数组 |
| 1449 | 1532 | JSONArray sectionsArray = JSONArray.parseArray(sectionJSON); |
| 1450 | 1533 | // 更新路线前删除线路缓存路段 |
| 1451 | - sectionRouteCacheRepository.sectionRouteCacheDel(Integer.parseInt(resultLine.getLineCode()),directions); | |
| 1534 | + sectionRouteCacheRepository.sectionRouteCacheDel(resultLine.getLineCode(),directions); | |
| 1452 | 1535 | // 遍历 |
| 1453 | 1536 | for(int s = 0 ;s<sectionsArray.size();s++) { |
| 1454 | 1537 | // 站点名称 |
| ... | ... | @@ -1530,4 +1613,126 @@ public class StationServiceImpl extends BaseServiceImpl<Station, Integer> implem |
| 1530 | 1613 | } |
| 1531 | 1614 | |
| 1532 | 1615 | } |
| 1533 | -} | |
| 1616 | + | |
| 1617 | + /** | |
| 1618 | + * @Description :TODO(更新缓存站点路由) | |
| 1619 | + */ | |
| 1620 | + @Override | |
| 1621 | + public Map<String, Object> stationCacheUpdate(Map<String, Object> map) { | |
| 1622 | + Map<String, Object> resultMap = new HashMap<String, Object>(); | |
| 1623 | + try { | |
| 1624 | + // 站点Id | |
| 1625 | + Integer stationId = map.get("stationId").equals("") ? null : Integer.parseInt(map.get("stationId").toString()); | |
| 1626 | + String stationCod = map.get("stationCod").equals("") ? "" : map.get("stationCod").toString(); | |
| 1627 | + String zdmc = map.get("zdmc").equals("") ? "" : map.get("zdmc").toString(); | |
| 1628 | + // 站点路由名称 | |
| 1629 | + String stationName = map.get("stationName").equals("") ? "" : map.get("stationName").toString(); | |
| 1630 | + // 所在道路编码 | |
| 1631 | + String roadCoding = map.get("roadCoding").equals("") ? "" : map.get("roadCoding").toString(); | |
| 1632 | + // 经纬坐标类型 | |
| 1633 | + String dbType = map.get("dbType").equals("") ? "" : map.get("dbType").toString(); | |
| 1634 | + // 百度经纬度坐标 | |
| 1635 | + String bJwpoints = map.get("bJwpoints").equals("") ? "" : map.get("bJwpoints").toString(); | |
| 1636 | + String bJwpointsArray[] =null; | |
| 1637 | + if(bJwpoints!=null) { | |
| 1638 | + bJwpointsArray = bJwpoints.split(" "); | |
| 1639 | + } | |
| 1640 | + // WGS经纬度 | |
| 1641 | + Float gLonx = null; | |
| 1642 | + // WGS纬度 | |
| 1643 | + Float gLaty = null; | |
| 1644 | + if(bJwpointsArray.length>0) { | |
| 1645 | + Location resultPoint = FromBDPointToWGSPoint(bJwpointsArray[0],bJwpointsArray[1]); | |
| 1646 | + gLonx = (float)resultPoint.getLng(); | |
| 1647 | + gLaty = (float)resultPoint.getLat(); | |
| 1648 | + } | |
| 1649 | + // 图形类型 | |
| 1650 | + String shapesType = map.get("shapesType").equals("") ? "" : map.get("shapesType").toString(); | |
| 1651 | + // 圆形半径 | |
| 1652 | + Integer radius = map.get("radius").equals("") ? null : Integer.parseInt(map.get("radius").toString()); | |
| 1653 | + // 多边形空间原坐标坐标点集合 | |
| 1654 | + String bPloygonGrid = map.get("bPolygonGrid").equals("") ? "" : map.get("bPolygonGrid").toString(); | |
| 1655 | + // 多边形WGS坐标点集合 | |
| 1656 | + String gPloygonGrid =""; | |
| 1657 | + if(!bPloygonGrid.equals("")) { | |
| 1658 | + String bPloygonGridArray[] = bPloygonGrid.split(","); | |
| 1659 | + int bLen_ = bPloygonGridArray.length; | |
| 1660 | + for(int b = 0 ;b<bLen_;b++) { | |
| 1661 | + String tempArray[]= bPloygonGridArray[b].split(" "); | |
| 1662 | + Location resultPoint = FromBDPointToWGSPoint(tempArray[0],tempArray[1]); | |
| 1663 | + if(b==0) { | |
| 1664 | + gPloygonGrid = resultPoint.getLng() + " " + resultPoint.getLat(); | |
| 1665 | + }else { | |
| 1666 | + gPloygonGrid = gPloygonGrid + ',' + resultPoint.getLng() + " " + resultPoint.getLat(); | |
| 1667 | + } | |
| 1668 | + } | |
| 1669 | + } | |
| 1670 | + if(bPloygonGrid.equals("")) | |
| 1671 | + bPloygonGrid = null; | |
| 1672 | + else | |
| 1673 | + bPloygonGrid = "POLYGON((" + bPloygonGrid +"))"; | |
| 1674 | + | |
| 1675 | + if(gPloygonGrid.equals("")) | |
| 1676 | + gPloygonGrid = null; | |
| 1677 | + else | |
| 1678 | + gPloygonGrid = "POLYGON((" + gPloygonGrid +"))"; | |
| 1679 | + // 是否撤销 | |
| 1680 | + Integer destroy = map.get("destroy").equals("") ? null : Integer.parseInt(map.get("destroy").toString()); | |
| 1681 | + // 版本号 | |
| 1682 | + Integer versions = map.get("versions").equals("") ? null : Integer.parseInt(map.get("versions").toString()); | |
| 1683 | + // 描述与说明 | |
| 1684 | + String descriptions = map.get("descriptions").equals("") ? "" : map.get("descriptions").toString(); | |
| 1685 | + Float x = map.get("x").equals("") ? null : Float.parseFloat(map.get("x").toString()); | |
| 1686 | + Float y = map.get("y").equals("") ? null : Float.parseFloat(map.get("y").toString()); | |
| 1687 | + // 更新 | |
| 1688 | + repository.stationUpdate(stationCod, zdmc, roadCoding, dbType, bJwpoints, gLonx, gLaty, x, y, bPloygonGrid, gPloygonGrid, destroy, radius, shapesType, versions, descriptions, stationId); | |
| 1689 | + // 站点路由Id | |
| 1690 | + Integer stationRouteId = map.get("stationRouteId").equals("") ? null : Integer.parseInt(map.get("stationRouteId").toString()); | |
| 1691 | + StationRouteCache resultS = routeCacheRepository.findOne(stationRouteId); | |
| 1692 | + // 站点路由序号 | |
| 1693 | + String stationRouteCodeStr = map.get("stationRouteCode").equals("") ? null : map.get("stationRouteCode").toString(); | |
| 1694 | + Integer stationRouteCode = null; | |
| 1695 | + if(stationRouteCodeStr!=null) { | |
| 1696 | + String stationRouteCodeAraay[] = stationRouteCodeStr.split("_"); | |
| 1697 | + int old_code = resultS.getStationRouteCode(); | |
| 1698 | + int new_code = Integer.parseInt(stationRouteCodeAraay[0].toString())+100; | |
| 1699 | + if(new_code==old_code){ | |
| 1700 | + stationRouteCode = new_code; | |
| 1701 | + }else { | |
| 1702 | + stationRouteCode = new_code-100+1; | |
| 1703 | + } | |
| 1704 | + }else { | |
| 1705 | + stationRouteCode = resultS.getStationRouteCode(); | |
| 1706 | + } | |
| 1707 | + stationRouteCode = stationRouteCode == null ? 100 : stationRouteCode; | |
| 1708 | + Integer LineId = map.get("stationRouteLine").equals("") ? null : Integer.parseInt(map.get("stationRouteLine").toString()); | |
| 1709 | + String stationMark = map.get("stationMark").equals("") ? null : map.get("stationMark").toString(); | |
| 1710 | + Double distances = map.get("distances").equals("") ? 0.0d : Double.parseDouble(map.get("distances").toString()); | |
| 1711 | + Double toTime = map.get("toTime").equals("") ? 0.0d : Double.parseDouble(map.get("toTime").toString()); | |
| 1712 | + Integer directions = map.get("directions").equals("") ? null : Integer.parseInt(map.get("directions").toString()); | |
| 1713 | + Station station = repository.findOne(stationId); | |
| 1714 | + Line line = lineRepository.findOne(LineId); | |
| 1715 | + StationRouteCache stationRoute = new StationRouteCache(); | |
| 1716 | + stationRoute.setStationName(stationName); | |
| 1717 | + stationRoute.setId(stationRouteId); | |
| 1718 | + stationRoute.setStationRouteCode(stationRouteCode); | |
| 1719 | + stationRoute.setStation(station); | |
| 1720 | + stationRoute.setStationCode(station.getStationCod()); | |
| 1721 | + stationRoute.setLine(line); | |
| 1722 | + stationRoute.setLineCode(line.getLineCode()); | |
| 1723 | + stationRoute.setStationMark(stationMark); | |
| 1724 | + stationRoute.setDistances(distances); | |
| 1725 | + stationRoute.setToTime(toTime); | |
| 1726 | + stationRoute.setDirections(directions); | |
| 1727 | + stationRoute.setVersions(versions); | |
| 1728 | + stationRoute.setDestroy(destroy); | |
| 1729 | + stationRoute.setDescriptions(descriptions); | |
| 1730 | + routeCacheRepository.save(stationRoute); | |
| 1731 | + resultMap.put("status", ResponseCode.SUCCESS); | |
| 1732 | + } catch (Exception e) { | |
| 1733 | + resultMap.put("status", ResponseCode.ERROR); | |
| 1734 | + logger.error("save erro.", e); | |
| 1735 | + } | |
| 1736 | + return resultMap; | |
| 1737 | + } | |
| 1738 | +} | |
| 1534 | 1739 | \ No newline at end of file | ... | ... |
src/main/java/com/bsth/service/oil/DlbService.java
| ... | ... | @@ -26,6 +26,8 @@ public interface DlbService extends BaseService<Dlb, Integer>{ |
| 26 | 26 | Map<String, Object> saveDlb(Dlb t); |
| 27 | 27 | |
| 28 | 28 | Map<String, Object> deleteIds(Map<String, Object> map) throws Exception; |
| 29 | - | |
| 29 | + | |
| 30 | + Map<String, List<Dlb>> updeteHistory(List<Map<String, Object>> list,String date, | |
| 31 | + String gsdm,String fgsdm,String line) ; | |
| 30 | 32 | |
| 31 | 33 | } | ... | ... |
src/main/java/com/bsth/service/oil/YlbService.java
src/main/java/com/bsth/service/oil/impl/DlbServiceImpl.java
| ... | ... | @@ -214,181 +214,6 @@ public class DlbServiceImpl extends BaseServiceImpl<Dlb,Integer> implements DlbS |
| 214 | 214 | } |
| 215 | 215 | return result; |
| 216 | 216 | } |
| 217 | - /** | |
| 218 | - * 获取进存电信息 | |
| 219 | - * @Transactional 回滚事物 | |
| 220 | - */ | |
| 221 | - /*@Transactional | |
| 222 | - @Override | |
| 223 | - public Map<String, Object> obtain(Map<String, Object> map2) { | |
| 224 | - List<Cars> carsList=carsRepository.findCars(); | |
| 225 | - Map<String, Boolean> carsMap=new HashMap<String, Boolean>(); | |
| 226 | - for (int i = 0; i < carsList.size(); i++) { | |
| 227 | - Cars c=carsList.get(i); | |
| 228 | - carsMap.put(c.getInsideCode(), c.getSfdc()); | |
| 229 | - } | |
| 230 | - String gsbm=""; | |
| 231 | - if(map2.get("ssgsdm_like")!=null){ | |
| 232 | - gsbm=map2.get("ssgsdm_like").toString(); | |
| 233 | - } | |
| 234 | - | |
| 235 | - String nbbm=""; | |
| 236 | - if(map2.get("nbbm_eq")!=null){ | |
| 237 | - nbbm=map2.get("nbbm_eq").toString(); | |
| 238 | - } | |
| 239 | - String fgsbm=""; | |
| 240 | - if(map2.get("fgsdm_like")!=null){ | |
| 241 | - fgsbm=map2.get("fgsdm_like").toString(); | |
| 242 | - } | |
| 243 | - | |
| 244 | - String rq=map2.get("rq").toString(); | |
| 245 | - String line=""; | |
| 246 | - if(map2.get("xlbm_eq")!=null){ | |
| 247 | - line=map2.get("xlbm_eq").toString(); | |
| 248 | - } | |
| 249 | - | |
| 250 | - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd"); | |
| 251 | - //保留两位小数 | |
| 252 | - DecimalFormat df = new DecimalFormat("#.00"); | |
| 253 | - // TODO Auto-generated method stub | |
| 254 | - Map<String, Object> newMap=new HashMap<String,Object>(); | |
| 255 | - //当天DLB信息 | |
| 256 | - List<Dlb> dlList=repository.obtainDl(rq, gsbm, fgsbm, line, nbbm, "nbbm"); | |
| 257 | - //当天YLXXB信息 | |
| 258 | - List<Ylxxb> ylxxList=ylxxbRepository.obtainYlxx(rq,1,gsbm); | |
| 259 | - //当天加电信息表 | |
| 260 | - List<Jdl> jdlList=jdlRepository.JdlList(rq); | |
| 261 | - //前一天所有车辆最后进场班次信息 | |
| 262 | - List<Dlb> dlListBe=repository.obtainYlbefore(rq, gsbm, fgsbm, line, nbbm); | |
| 263 | - List<Cdl> cdyList=cdlRepository.obtainCdl(); | |
| 264 | - //从排班表中计算出行驶的总里程 | |
| 265 | - List<Map<String,Object>> listpb=scheduleRealInfoService.yesterdayDataList(line, rq, gsbm, fgsbm, "", nbbm); | |
| 266 | - List<Dlb> addList=new ArrayList<Dlb>(); | |
| 267 | - List<Dlb> updateList=new ArrayList<Dlb>(); | |
| 268 | - for(int x=0;x<listpb.size();x++){ | |
| 269 | - String type="add"; | |
| 270 | - boolean sfdc=false; | |
| 271 | - Map<String, Object> map=listpb.get(x); | |
| 272 | - if (carsMap.get(map.get("clZbh").toString())!=null) { | |
| 273 | - sfdc= carsMap.get(map.get("clZbh").toString()); | |
| 274 | - }else{ | |
| 275 | - sfdc=false; | |
| 276 | - } | |
| 277 | - if(sfdc){ | |
| 278 | - //判断驾驶员驾驶的该车辆是否已经存入了(查出的结果集中日期是相同的,根据驾驶员、内部编号、线路编码判断) | |
| 279 | - Dlb t=new Dlb(); | |
| 280 | - for(int k=0;k<dlList.size();k++){ | |
| 281 | - Dlb t1=dlList.get(k); | |
| 282 | - if(t1.getNbbm().equals(map.get("clZbh").toString()) | |
| 283 | - &&t1.getJsy().equals(map.get("jGh").toString()) | |
| 284 | - &&t1.getXlbm().equals(map.get("xlBm").toString())) | |
| 285 | - { | |
| 286 | - t=t1; | |
| 287 | - type="update"; | |
| 288 | - } | |
| 289 | - } | |
| 290 | - try { | |
| 291 | - //当日的第一个班次,出场油量等于前一天的最后一个班次的进场油量 | |
| 292 | - Double jzl=0.0; | |
| 293 | - if(map.get("seqNumber").toString().equals("1")){ | |
| 294 | - boolean fage=true; | |
| 295 | - for (int i = 0; i < dlListBe.size(); i++) { | |
| 296 | - Dlb dlb=dlListBe.get(i); | |
| 297 | - if(map.get("clZbh").toString().equals(dlb.getNbbm())){ | |
| 298 | - t.setCzcd(dlb.getJzcd()); | |
| 299 | - fage=false; | |
| 300 | - break; | |
| 301 | - } | |
| 302 | - } | |
| 303 | - if(fage){ | |
| 304 | - for (int y = 0; y < cdyList.size(); y++) { | |
| 305 | - Cdl cdl=cdyList.get(y); | |
| 306 | - if(map.get("clZbh").toString().equals(cdl.getNbbm())){ | |
| 307 | - t.setCzcd(cdl.getClcd()==null?0:cdl.getClcd()); | |
| 308 | - fage=false; | |
| 309 | - break; | |
| 310 | - } | |
| 311 | - } | |
| 312 | - } | |
| 313 | - if(fage){ | |
| 314 | - t.setCzcd(0.0); | |
| 315 | - } | |
| 316 | - | |
| 317 | - // | |
| 318 | - for (int i = 0; i < jdlList.size(); i++) { | |
| 319 | - Jdl jdl=jdlList.get(i); | |
| 320 | - if(map.get("clZbh").toString().equals(jdl.getNbbm()) | |
| 321 | - &&map.get("jGh").toString().equals(jdl.getJsy()) | |
| 322 | - &&map.get("bCompany").toString().equals(jdl.getFgsBm())){ | |
| 323 | - jzl+=jdl.getJdl(); | |
| 324 | - } | |
| 325 | - } | |
| 326 | - } | |
| 327 | - | |
| 328 | - | |
| 329 | - //把当天的YLXXB的加注量设置为当天YLB的加注量(根据车号,驾驶员判断) | |
| 330 | - for(int j=0;j<ylxxList.size();j++){ | |
| 331 | - Ylxxb ylxxb= ylxxList.get(j); | |
| 332 | - if(map.get("clZbh").toString().equals(ylxxb.getNbbm()) &&map.get("jGh").toString().equals(ylxxb.getJsy())){ | |
| 333 | - jzl+=ylxxb.getJzl(); | |
| 334 | - } | |
| 335 | - } | |
| 336 | - | |
| 337 | - t.setCdl(jzl); | |
| 338 | -// if(type.equals("add")){ | |
| 339 | - t.setHd(jzl); | |
| 340 | - t.setJzcd(t.getCzcd()); | |
| 341 | -// } | |
| 342 | - | |
| 343 | - t.setNbbm(map.get("clZbh").toString()); | |
| 344 | - t.setJsy(map.get("jGh")==null?"":map.get("jGh").toString()); | |
| 345 | - t.setZlc(map.get("totalKilometers")==null?0.0:Double.parseDouble(df.format(Double.parseDouble(map.get("totalKilometers").toString())))); | |
| 346 | - t.setXlbm(map.get("xlBm")==null?"":map.get("xlBm").toString()); | |
| 347 | - t.setJcsx(Integer.parseInt(map.get("seqNumber").toString())); | |
| 348 | - t.setSsgsdm(map.get("company")==null?"":map.get("company").toString()); | |
| 349 | - t.setFgsdm(map.get("bCompany")==null?"":map.get("bCompany").toString()); | |
| 350 | - t.setJhsj(map.get("fcsj")==null?"":map.get("fcsj").toString()); | |
| 351 | - t.setRq(sdf.parse(rq)); | |
| 352 | - t.setCreatetime(new Date()); | |
| 353 | - if(type.equals("add")){ | |
| 354 | - addList.add(t); | |
| 355 | - }else{ | |
| 356 | - updateList.add(t); | |
| 357 | - } | |
| 358 | - newMap.put("status", ResponseCode.SUCCESS); | |
| 359 | - } catch (ParseException e) { | |
| 360 | - // TODO Auto-generated catch block | |
| 361 | - newMap.put("status", ResponseCode.ERROR); | |
| 362 | - e.printStackTrace(); | |
| 363 | - } | |
| 364 | - } | |
| 365 | - } | |
| 366 | - try { | |
| 367 | - if(addList.size()>0){ | |
| 368 | - try{ | |
| 369 | - new BatchSaveUtils<Dlb>().saveList(addList, Dlb.class); | |
| 370 | - } catch (Exception e) { | |
| 371 | - // TODO: handle exception | |
| 372 | - if(e.getMessage().indexOf("PK_DLB_UK")>0){ | |
| 373 | - newMap.put("fage", "存在相同数据,数据已经过滤"); | |
| 374 | - logger.info("获取:存在相同数据,数据已经过滤"); | |
| 375 | - } | |
| 376 | - } | |
| 377 | - } | |
| 378 | - | |
| 379 | - if(updateList.size()>0){ | |
| 380 | - for (int i = 0; i < updateList.size(); i++) { | |
| 381 | - repository.save(updateList.get(i)); | |
| 382 | - } | |
| 383 | - } | |
| 384 | - newMap.put("status", ResponseCode.SUCCESS); | |
| 385 | - } | |
| 386 | - catch (Exception e) { | |
| 387 | - // TODO: handle exception | |
| 388 | - newMap.put("status", ResponseCode.ERROR); | |
| 389 | - } | |
| 390 | - return newMap; | |
| 391 | - }*/ | |
| 392 | 217 | |
| 393 | 218 | /** |
| 394 | 219 | * 获取进存油信息 |
| ... | ... | @@ -442,11 +267,24 @@ public class DlbServiceImpl extends BaseServiceImpl<Dlb,Integer> implements DlbS |
| 442 | 267 | if(lcMap.get(cl)==null){ |
| 443 | 268 | lcMap.put(cl, lc); |
| 444 | 269 | }else{ |
| 445 | - Double lc_=lcMap.get(cl); | |
| 270 | + double lc_=lcMap.get(cl); | |
| 446 | 271 | lcMap.remove(cl); |
| 447 | 272 | lcMap.put(cl, Arith.add(lc, lc_)); |
| 448 | 273 | } |
| 449 | 274 | } |
| 275 | + | |
| 276 | + Map<String, Double> shMap=new HashMap<String,Double>(); | |
| 277 | + for (int i = 0; i < dlList.size(); i++) { | |
| 278 | + Dlb dlb=dlList.get(i); | |
| 279 | + String cl=dlb.getNbbm(); | |
| 280 | + if(shMap.get(cl)==null){ | |
| 281 | + shMap.put(cl, dlb.getSh()); | |
| 282 | + }else{ | |
| 283 | + double sh=shMap.get(cl); | |
| 284 | + shMap.remove(cl); | |
| 285 | + shMap.put(cl, Arith.add(sh, dlb.getSh())); | |
| 286 | + } | |
| 287 | + } | |
| 450 | 288 | List<Jdl> jdlList=jdlRepository.JdlList(rq); |
| 451 | 289 | String sxtj=map2.get("sxtj").toString(); |
| 452 | 290 | if(sxtj.equals("0")){ |
| ... | ... | @@ -503,7 +341,7 @@ public class DlbServiceImpl extends BaseServiceImpl<Dlb,Integer> implements DlbS |
| 503 | 341 | //车辆总里程 |
| 504 | 342 | double zlc =lcMap.get(map_.get("clZbh").toString()); |
| 505 | 343 | //车辆总加电量 |
| 506 | - Double zjzl = 0.0; | |
| 344 | + double zjzl = 0.0; | |
| 507 | 345 | for (int j = 0; j < ylxxList.size(); j++) { |
| 508 | 346 | Ylxxb ylxxb = ylxxList.get(j); |
| 509 | 347 | if (map_.get("clZbh").toString().equals(ylxxb.getNbbm()) |
| ... | ... | @@ -519,7 +357,13 @@ public class DlbServiceImpl extends BaseServiceImpl<Dlb,Integer> implements DlbS |
| 519 | 357 | zjzl = Arith.add(zjzl,jdl.getJdl()); |
| 520 | 358 | } |
| 521 | 359 | } |
| 522 | - | |
| 360 | + double clsh=0.0; | |
| 361 | + if(shMap.get(map_.get("clZbh").toString())==null){ | |
| 362 | + clsh=0.0; | |
| 363 | + }else{ | |
| 364 | + clsh=shMap.get(map_.get("clZbh").toString()); | |
| 365 | + } | |
| 366 | + zjzl =Arith.sub(zjzl, clsh); | |
| 523 | 367 | Double nextJzyl = 0.0; |
| 524 | 368 | for (int i = 0; i < listpb.size(); i++) { |
| 525 | 369 | Map<String, Object> map = listpb.get(i); |
| ... | ... | @@ -621,6 +465,7 @@ public class DlbServiceImpl extends BaseServiceImpl<Dlb,Integer> implements DlbS |
| 621 | 465 | t.setJhsj(map.get("fcsj")==null?"":map.get("fcsj").toString()); |
| 622 | 466 | t.setRq(sdf.parse(rq)); |
| 623 | 467 | t.setLp(map.get("lpName").toString()); |
| 468 | + t.setCdl(Arith.add(t.getCdl(), t.getSh())); | |
| 624 | 469 | if(!(t.getSsgsdm().equals("") || t.getFgsdm().equals(""))){ |
| 625 | 470 | if(type.equals("add")){ |
| 626 | 471 | t.setCreatetime(date); |
| ... | ... | @@ -1123,6 +968,208 @@ public class DlbServiceImpl extends BaseServiceImpl<Dlb,Integer> implements DlbS |
| 1123 | 968 | } |
| 1124 | 969 | return maps; |
| 1125 | 970 | } |
| 971 | + | |
| 972 | + @Override | |
| 973 | + public Map<String, List<Dlb>> updeteHistory(List<Map<String, Object>> listpbDc,String date, | |
| 974 | + String gsdm,String fgsdm,String line) { | |
| 975 | + // TODO Auto-generated method stub | |
| 976 | + Map<String, List<Dlb>> mapList=new HashMap<String,List<Dlb>>(); | |
| 977 | + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd"); | |
| 978 | + // 保留两位小数 | |
| 979 | + DecimalFormat df = new DecimalFormat("#.00"); | |
| 980 | + List<Dlb> dlbList=this.listOrderBy(date,gsdm,fgsdm,line,"","nbbm"); | |
| 981 | + List<Dlb> dlbList_upd=new ArrayList<Dlb>(); | |
| 982 | + List<Dlb> dlbList_del=new ArrayList<Dlb>(); | |
| 983 | + try{ | |
| 984 | + for (int j = 0; j < dlbList.size(); j++) { | |
| 985 | + Dlb t=dlbList.get(j); | |
| 986 | + boolean fage=true; | |
| 987 | + for (int i = 0; i < listpbDc.size(); i++) { | |
| 988 | + Map<String, Object> m = listpbDc.get(i); | |
| 989 | + if(t.getNbbm().equals(m.get("clZbh").toString()) | |
| 990 | + &&t.getJsy().equals(m.get("jGh").toString()) | |
| 991 | + &&t.getXlbm().equals(m.get("xlBm").toString()) | |
| 992 | + &&t.getLp().equals(m.get("lpName").toString())){ | |
| 993 | + //该条记录不用删除 | |
| 994 | + fage =false; | |
| 995 | + dlbList_upd.add(t); | |
| 996 | + } | |
| 997 | + } | |
| 998 | + if(fage){ | |
| 999 | + dlbList_del.add(t); | |
| 1000 | + } | |
| 1001 | + } | |
| 1002 | + mapList.put("delList", dlbList_del); | |
| 1003 | + Map<String, Double> lcMap=new HashMap<String,Double>(); | |
| 1004 | + for (int i = 0; i < listpbDc.size(); i++) { | |
| 1005 | + String cl=listpbDc.get(i).get("clZbh").toString(); | |
| 1006 | + Double lc= listpbDc.get(i).get("totalKilometers") == null ? 0.0 | |
| 1007 | + : Double.parseDouble(listpbDc.get(i).get("totalKilometers").toString()); | |
| 1008 | + if(lcMap.get(cl)==null){ | |
| 1009 | + lcMap.put(cl, lc); | |
| 1010 | + }else{ | |
| 1011 | + double lc_=lcMap.get(cl); | |
| 1012 | + lcMap.remove(cl); | |
| 1013 | + lcMap.put(cl, Arith.add(lc, lc_)); | |
| 1014 | + } | |
| 1015 | + } | |
| 1016 | + Map<String, Double> shMap=new HashMap<String,Double>(); | |
| 1017 | + for (int i = 0; i < dlbList_upd.size(); i++) { | |
| 1018 | + Dlb dlb=dlbList_upd.get(i); | |
| 1019 | + String cl=dlb.getNbbm(); | |
| 1020 | + if(shMap.get(cl)==null){ | |
| 1021 | + shMap.put(cl, dlb.getSh()); | |
| 1022 | + }else{ | |
| 1023 | + double sh=shMap.get(cl); | |
| 1024 | + shMap.remove(cl); | |
| 1025 | + shMap.put(cl, Arith.add(sh, dlb.getSh())); | |
| 1026 | + } | |
| 1027 | + } | |
| 1028 | + List<Jdl> jdlList=jdlRepository.JdlList(date); | |
| 1029 | + List<Ylxxb> ylxxList = ylxxbRepository.obtainYlxx(date, 0,gsdm); | |
| 1030 | + Map<String, Object> newMap_=new HashMap<String,Object>(); | |
| 1031 | + Map<String, Object> cMap=new HashMap<String, Object>(); | |
| 1032 | + List<Map<String, Object>> listpb_=listpbDc; | |
| 1033 | + Collections.sort(listpbDc,new NbbmJcsxMap()); | |
| 1034 | + List<Dlb> updateDlb=new ArrayList<Dlb>(); | |
| 1035 | + for (int x = 0; x < listpb_.size(); x++) { | |
| 1036 | + String type = "add"; | |
| 1037 | + Map<String, Object> map_ = listpb_.get(x); | |
| 1038 | + if(newMap_.get(map_.get("clZbh").toString())==null){ | |
| 1039 | + newMap_.put(map_.get("clZbh").toString(), map_.get("clZbh").toString()); | |
| 1040 | + //车辆总里程 | |
| 1041 | + double zlc =lcMap.get(map_.get("clZbh").toString()); | |
| 1042 | + //车辆总加电量 | |
| 1043 | + double zjzl = 0.0; | |
| 1044 | + for (int j = 0; j < ylxxList.size(); j++) { | |
| 1045 | + Ylxxb ylxxb = ylxxList.get(j); | |
| 1046 | + if (map_.get("clZbh").toString().equals(ylxxb.getNbbm()) | |
| 1047 | + && map_.get("company").toString().equals(ylxxb.getGsdm())) { | |
| 1048 | + zjzl = Arith.add(zjzl, ylxxb.getJzl()); | |
| 1049 | + } | |
| 1050 | + } | |
| 1051 | + for (int i = 0; i < jdlList.size(); i++) { | |
| 1052 | + Jdl jdl=jdlList.get(i); | |
| 1053 | + if(map_.get("clZbh").toString().equals(jdl.getNbbm()) | |
| 1054 | + &&map_.get("company").toString().equals(jdl.getGsBm()) | |
| 1055 | + &&map_.get("bCompany").toString().equals(jdl.getFgsBm())){ | |
| 1056 | + zjzl = Arith.add(zjzl,jdl.getJdl()); | |
| 1057 | + } | |
| 1058 | + } | |
| 1059 | + double clsh=0.0; | |
| 1060 | + if(shMap.get(map_.get("clZbh").toString())==null){ | |
| 1061 | + clsh=0.0; | |
| 1062 | + }else{ | |
| 1063 | + clsh=shMap.get(map_.get("clZbh").toString()); | |
| 1064 | + } | |
| 1065 | + zjzl =Arith.sub(zjzl, clsh); | |
| 1066 | + Double nextJzyl = 0.0; | |
| 1067 | + for (int i = 0; i < listpbDc.size(); i++) { | |
| 1068 | + Map<String, Object> map = listpbDc.get(i); | |
| 1069 | + if(map_.get("clZbh").toString().equals(map.get("clZbh").toString())){ | |
| 1070 | + // 判断驾驶员驾驶的该车辆是否已经存入了(查出的结果集中日期是相同的,根据驾驶员、内部编号、线路编码判断) | |
| 1071 | + Dlb t = new Dlb(); | |
| 1072 | + for (int k = 0; k < dlbList_upd.size(); k++) { | |
| 1073 | + Dlb t1 = dlbList_upd.get(k); | |
| 1074 | + if (t1.getNbbm().equals(map.get("clZbh").toString()) | |
| 1075 | + && t1.getJsy().equals(map.get("jGh").toString()) | |
| 1076 | + && t1.getXlbm().equals(map.get("xlBm").toString()) | |
| 1077 | + && t1.getLp().equals(map.get("lpName").toString())) { | |
| 1078 | + t = t1; | |
| 1079 | + type = "update"; | |
| 1080 | + } | |
| 1081 | + | |
| 1082 | + } | |
| 1083 | + Double lc= Double.parseDouble(map.get("totalKilometers").toString()); | |
| 1084 | + if(map.get("seqNumber").toString().equals("1")){ | |
| 1085 | + // 当日的第一个班次,出场油量等于前一天的最后一个班次的进场油量 | |
| 1086 | + Double dh=0.0; | |
| 1087 | + if(zlc>0){ | |
| 1088 | + dh = Double.parseDouble(df.format(zjzl * (lc / zlc))); | |
| 1089 | + } | |
| 1090 | + nextJzyl =Arith.sub(zjzl,dh); | |
| 1091 | + if(zlc>0){ | |
| 1092 | + long l=Math.round(nextJzyl); | |
| 1093 | + double ylxs=l*100/100; | |
| 1094 | + dh=Arith.add(dh, Arith.sub(nextJzyl,ylxs)); | |
| 1095 | + if(dh<0){ | |
| 1096 | + t.setHd(dh); | |
| 1097 | + t.setCdl(dh); | |
| 1098 | + nextJzyl=Arith.add(ylxs, dh); | |
| 1099 | + }else{ | |
| 1100 | + t.setHd(dh); | |
| 1101 | + t.setCdl(dh); | |
| 1102 | + nextJzyl=ylxs; | |
| 1103 | + } | |
| 1104 | + }else{ | |
| 1105 | + t.setHd(0.0); | |
| 1106 | + t.setCdl(0.0); | |
| 1107 | + } | |
| 1108 | + }else{ | |
| 1109 | + Double dh=0.0; | |
| 1110 | + if(zlc>0){ | |
| 1111 | + dh = Double.parseDouble(df.format(zjzl * (lc / zlc))); | |
| 1112 | + } | |
| 1113 | + nextJzyl =Arith.sub( nextJzyl,dh); | |
| 1114 | + if(zlc>0){ | |
| 1115 | + long l=0l; | |
| 1116 | + double ylxs=0.0; | |
| 1117 | + if(i==listpbDc.size()-1){ | |
| 1118 | +// ylxs=czyl; | |
| 1119 | + }else{ | |
| 1120 | + if(listpbDc.get(i+1).get("clZbh").toString().equals(map.get("clZbh").toString())){ | |
| 1121 | + l=Math.round(nextJzyl); | |
| 1122 | + ylxs=l*100/100; | |
| 1123 | + } | |
| 1124 | + | |
| 1125 | + } | |
| 1126 | + dh=Arith.add(dh, Arith.sub(nextJzyl,ylxs)); | |
| 1127 | + if(dh<0){ | |
| 1128 | + t.setHd(dh); | |
| 1129 | + t.setCdl(dh); | |
| 1130 | + nextJzyl=Arith.add(ylxs, dh); | |
| 1131 | + }else{ | |
| 1132 | + t.setHd(dh); | |
| 1133 | + t.setCdl(dh); | |
| 1134 | + nextJzyl=ylxs; | |
| 1135 | + } | |
| 1136 | + }else{ | |
| 1137 | + t.setHd(0.0); | |
| 1138 | + t.setCdl(0.0); | |
| 1139 | + } | |
| 1140 | + } | |
| 1141 | + t.setCzcd(100.0); | |
| 1142 | + t.setJzcd(100.0); | |
| 1143 | + t.setNbbm(map.get("clZbh").toString()); | |
| 1144 | + t.setJsy(map.get("jGh") == null ? "" : map.get("jGh").toString()); | |
| 1145 | + t.setZlc(map.get("totalKilometers") == null ? 0.0 | |
| 1146 | + : Double.parseDouble(map.get("totalKilometers").toString())); | |
| 1147 | + t.setXlbm(map.get("xlBm") == null ? "" : map.get("xlBm").toString()); | |
| 1148 | + t.setJcsx(Integer.parseInt(map.get("seqNumber").toString())); | |
| 1149 | + t.setSsgsdm(map.get("company") == null ? "" : map.get("company").toString()); | |
| 1150 | + t.setFgsdm(map.get("bCompany") == null ? "" : map.get("bCompany").toString()); | |
| 1151 | + t.setJhsj(map.get("fcsj")==null?"":map.get("fcsj").toString()); | |
| 1152 | + t.setRq(sdf.parse(date)); | |
| 1153 | + t.setLp(map.get("lpName").toString()); | |
| 1154 | + t.setCdl(Arith.add(t.getCdl(), t.getSh())); | |
| 1155 | + if(!(t.getSsgsdm().equals("") || t.getFgsdm().equals(""))){ | |
| 1156 | + if(type.equals("add")){ | |
| 1157 | + t.setCreatetime(new Date()); | |
| 1158 | + }else{ | |
| 1159 | + t.setUpdatetime(new Date()); | |
| 1160 | + } | |
| 1161 | + } | |
| 1162 | + updateDlb.add(t); | |
| 1163 | + } | |
| 1164 | + } | |
| 1165 | + } | |
| 1166 | + } | |
| 1167 | + mapList.put("updList", updateDlb); | |
| 1168 | + }catch(Exception e){ | |
| 1169 | + logger.error("save erro.", e); | |
| 1170 | + } | |
| 1171 | + return mapList; | |
| 1172 | + } | |
| 1126 | 1173 | |
| 1127 | 1174 | } |
| 1128 | 1175 | ... | ... |
src/main/java/com/bsth/service/oil/impl/YlbServiceImpl.java
| ... | ... | @@ -33,14 +33,17 @@ import com.bsth.entity.Cars; |
| 33 | 33 | import com.bsth.entity.Line; |
| 34 | 34 | import com.bsth.entity.mcy_forms.Daily; |
| 35 | 35 | import com.bsth.entity.oil.Cyl; |
| 36 | +import com.bsth.entity.oil.Dlb; | |
| 36 | 37 | import com.bsth.entity.oil.Ylb; |
| 37 | 38 | import com.bsth.entity.oil.Ylxxb; |
| 38 | 39 | import com.bsth.entity.search.CustomerSpecs; |
| 39 | 40 | import com.bsth.repository.CarsRepository; |
| 40 | 41 | import com.bsth.repository.oil.CylRepository; |
| 42 | +import com.bsth.repository.oil.DlbRepository; | |
| 41 | 43 | import com.bsth.repository.oil.YlbRepository; |
| 42 | 44 | import com.bsth.repository.oil.YlxxbRepository; |
| 43 | 45 | import com.bsth.service.impl.BaseServiceImpl; |
| 46 | +import com.bsth.service.oil.DlbService; | |
| 44 | 47 | import com.bsth.service.oil.YlbService; |
| 45 | 48 | import com.bsth.service.realcontrol.ScheduleRealInfoService; |
| 46 | 49 | import com.bsth.util.Arith; |
| ... | ... | @@ -48,6 +51,8 @@ import com.bsth.util.BatchSaveUtils; |
| 48 | 51 | import com.bsth.util.ReportUtils; |
| 49 | 52 | import com.github.abel533.echarts.code.Y; |
| 50 | 53 | |
| 54 | +import javassist.bytecode.stackmap.BasicBlock.Catch; | |
| 55 | + | |
| 51 | 56 | @Service |
| 52 | 57 | public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbService{ |
| 53 | 58 | @Autowired |
| ... | ... | @@ -55,6 +60,12 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS |
| 55 | 60 | |
| 56 | 61 | @Autowired |
| 57 | 62 | YlxxbRepository ylxxbRepository; |
| 63 | + | |
| 64 | + @Autowired | |
| 65 | + DlbService dlbService; | |
| 66 | + | |
| 67 | + @Autowired | |
| 68 | + DlbRepository dlbRepository; | |
| 58 | 69 | |
| 59 | 70 | @Autowired |
| 60 | 71 | CylRepository cylRepository; |
| ... | ... | @@ -168,16 +179,6 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS |
| 168 | 179 | t.setCzyl(0.0); |
| 169 | 180 | } |
| 170 | 181 | } |
| 171 | - | |
| 172 | - /*Double jzl=0.0; | |
| 173 | - //把当天的YLXXB的加注量设置为当天YLB的加注量(根据车号,驾驶员判断) | |
| 174 | - for(int j=0;j<ylxxList.size();j++){ | |
| 175 | - Ylxxb ylxxb= ylxxList.get(j); | |
| 176 | - if(map.get("clZbh").toString().equals(ylxxb.getNbbm()) &&map.get("jGh").toString().equals(ylxxb.getJsy())){ | |
| 177 | - jzl+=ylxxb.getJzl(); | |
| 178 | - } | |
| 179 | - } | |
| 180 | - t.setJzl(jzl);*/ | |
| 181 | 182 | t.setNbbm(map.get("clZbh").toString()); |
| 182 | 183 | t.setJsy(map.get("jGh")==null?"":map.get("jGh").toString()); |
| 183 | 184 | t.setZlc(map.get("totalKilometers")==null?0.0:Double.parseDouble(map.get("totalKilometers").toString())); |
| ... | ... | @@ -212,7 +213,6 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS |
| 212 | 213 | logger.info("定时器:存在相同数据,数据已经过滤"); |
| 213 | 214 | } |
| 214 | 215 | } |
| 215 | -// new BatchSaveUtils<Ylb>().saveList(addList, Ylb.class); | |
| 216 | 216 | } |
| 217 | 217 | result = "success"; |
| 218 | 218 | }catch (Exception e) { |
| ... | ... | @@ -404,7 +404,7 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS |
| 404 | 404 | Ylxxb ylxxb = ylxxList.get(i); |
| 405 | 405 | if (map.get("clZbh").toString().equals(ylxxb.getNbbm()) |
| 406 | 406 | && map.get("jGh").toString().equals(ylxxb.getJsy()) |
| 407 | - && ylxxb.getJylx()==1) { | |
| 407 | + && ylxxb.getJylx()>0) { | |
| 408 | 408 | if(ylxxb.getJzl()>0){ |
| 409 | 409 | fage2=true; |
| 410 | 410 | } |
| ... | ... | @@ -418,7 +418,7 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS |
| 418 | 418 | Ylxxb ylxxb = ylxxList.get(j); |
| 419 | 419 | if (map.get("clZbh").toString().equals(ylxxb.getNbbm()) |
| 420 | 420 | && map.get("jGh").toString().equals(ylxxb.getJsy()) |
| 421 | - && ylxxb.getJylx()==1) { | |
| 421 | + && ylxxb.getJylx()>0) { | |
| 422 | 422 | jzl =Arith.add(jzl, ylxxb.getJzl()); |
| 423 | 423 | } |
| 424 | 424 | } |
| ... | ... | @@ -670,15 +670,6 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS |
| 670 | 670 | } |
| 671 | 671 | } |
| 672 | 672 | repository.save(t); |
| 673 | - /*for (int z = 0; z < cylList.size(); z++) { | |
| 674 | - Cyl cyl = cylList.get(z); | |
| 675 | - if (t.getNbbm().equals(cyl.getNbbm())) { | |
| 676 | - cyl.setCyl(t.getJzyl()); | |
| 677 | - cyl.setUpdatetime(t.getRq()); | |
| 678 | - break; | |
| 679 | - } | |
| 680 | - cylRepository.save(cyl); | |
| 681 | - }*/ | |
| 682 | 673 | } |
| 683 | 674 | map2.put("status", ResponseCode.SUCCESS); |
| 684 | 675 | } |
| ... | ... | @@ -770,63 +761,67 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS |
| 770 | 761 | return s; |
| 771 | 762 | } |
| 772 | 763 | }); |
| 764 | + Map<String, Object> m=new HashMap<String,Object>(); | |
| 773 | 765 | for (int i = 0; i < ylxxbList.size(); i++) { |
| 774 | 766 | Boolean fage=false; |
| 775 | 767 | Ylxxb y1=ylxxbList.get(i); |
| 776 | - Line line=BasicData.nbbm2LineMap.get(y1.getNbbm()); | |
| 777 | - if(null !=line){ | |
| 778 | - if(!xlbm.equals("")){ | |
| 779 | - if(line.getLineCode().equals(xlbm)){ | |
| 768 | + if(m.get(y1.getNbbm())!=null){ | |
| 769 | + Line line=BasicData.nbbm2LineMap.get(y1.getNbbm()); | |
| 770 | + if(null !=line){ | |
| 771 | + if(!xlbm.equals("")){ | |
| 772 | + if(line.getLineCode().equals(xlbm)){ | |
| 773 | + fage=true; | |
| 774 | + } | |
| 775 | + }else{ | |
| 780 | 776 | fage=true; |
| 781 | 777 | } |
| 782 | - }else{ | |
| 783 | - fage=true; | |
| 784 | - } | |
| 785 | - } | |
| 786 | - | |
| 787 | - if(fage){ | |
| 788 | - Ylb t=new Ylb(); | |
| 789 | - t.setNbbm(y1.getNbbm()); | |
| 790 | - t.setRq(y1.getYyrq()); | |
| 791 | - t.setJsy(y1.getJsy()); | |
| 792 | - t.setJzl(y1.getJzl()); | |
| 793 | - t.setSsgsdm(y1.getGsdm()); | |
| 794 | - String fgsdm=""; | |
| 795 | - if(null !=carsMap.get(y1.getNbbm())){ | |
| 796 | - fgsdm=carsMap.get(y1.getNbbm()); | |
| 797 | 778 | } |
| 798 | - t.setFgsdm(fgsdm); | |
| 799 | - t.setJcsx(1); | |
| 800 | - if(null !=line){ | |
| 801 | - t.setXlbm(line.getLineCode()); | |
| 802 | - }else{ | |
| 803 | - t.setXlbm(""); | |
| 804 | - } | |
| 805 | - t.setJcsx(1); | |
| 806 | - boolean status=true; | |
| 807 | - for (int j = 0; j < ylListBe.size(); j++) { | |
| 808 | - Ylb b=ylListBe.get(j); | |
| 809 | - if(b.getNbbm().equals(y1.getNbbm())){ | |
| 810 | - t.setCzyl(b.getJzyl()); | |
| 811 | - status=false; | |
| 812 | - break; | |
| 779 | + | |
| 780 | + if(fage){ | |
| 781 | + Ylb t=new Ylb(); | |
| 782 | + t.setNbbm(y1.getNbbm()); | |
| 783 | + t.setRq(y1.getYyrq()); | |
| 784 | + t.setJsy(y1.getJsy()); | |
| 785 | + t.setJzl(y1.getJzl()); | |
| 786 | + t.setSsgsdm(y1.getGsdm()); | |
| 787 | + String fgsdm=""; | |
| 788 | + if(null !=carsMap.get(y1.getNbbm())){ | |
| 789 | + fgsdm=carsMap.get(y1.getNbbm()); | |
| 813 | 790 | } |
| 814 | - } | |
| 815 | - if(status){ | |
| 816 | - t.setCzyl(0.0); | |
| 817 | - } | |
| 818 | -// double jzyl=Arith.add(t.getJzl(), t.getCzyl()); | |
| 819 | - t.setJzyl(Arith.add(t.getJzl(), t.getCzyl())); | |
| 820 | - t.setYh(0.0); | |
| 821 | - if(!(t.getSsgsdm().equals("") || t.getFgsdm().equals(""))){ | |
| 822 | - t.setCreatetime(new Date()); | |
| 823 | - try { | |
| 824 | - repository.save(t); | |
| 825 | - } catch (Exception e) { | |
| 826 | - // TODO: handle exception | |
| 827 | - if(e.getMessage().indexOf("PK_YLB_UK")>0){ | |
| 828 | - newMap.put("fage", "存在相同数据,数据已经过滤"); | |
| 829 | - logger.info("核对有存油没里程:存在相同数据,数据已经过滤"); | |
| 791 | + t.setFgsdm(fgsdm); | |
| 792 | + t.setJcsx(1); | |
| 793 | + if(null !=line){ | |
| 794 | + t.setXlbm(line.getLineCode()); | |
| 795 | + }else{ | |
| 796 | + t.setXlbm(""); | |
| 797 | + } | |
| 798 | + t.setJcsx(1); | |
| 799 | + boolean status=true; | |
| 800 | + for (int j = 0; j < ylListBe.size(); j++) { | |
| 801 | + Ylb b=ylListBe.get(j); | |
| 802 | + if(b.getNbbm().equals(y1.getNbbm())){ | |
| 803 | + t.setCzyl(b.getJzyl()); | |
| 804 | + status=false; | |
| 805 | + break; | |
| 806 | + } | |
| 807 | + } | |
| 808 | + if(status){ | |
| 809 | + t.setCzyl(0.0); | |
| 810 | + } | |
| 811 | +// double jzyl=Arith.add(t.getJzl(), t.getCzyl()); | |
| 812 | + t.setJzyl(Arith.add(t.getJzl(), t.getCzyl())); | |
| 813 | + t.setYh(0.0); | |
| 814 | + if(!(t.getSsgsdm().equals("") || t.getFgsdm().equals(""))){ | |
| 815 | + t.setCreatetime(new Date()); | |
| 816 | + try { | |
| 817 | + repository.save(t); | |
| 818 | + m.put(t.getName(), t.getName()); | |
| 819 | + } catch (Exception e) { | |
| 820 | + // TODO: handle exception | |
| 821 | + if(e.getMessage().indexOf("PK_YLB_UK")>0){ | |
| 822 | + newMap.put("fage", "存在相同数据,数据已经过滤"); | |
| 823 | + logger.info("核对有存油没里程:存在相同数据,数据已经过滤"); | |
| 824 | + } | |
| 830 | 825 | } |
| 831 | 826 | } |
| 832 | 827 | } |
| ... | ... | @@ -1165,7 +1160,7 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS |
| 1165 | 1160 | Integer id =jsonObject.getInteger("id"); |
| 1166 | 1161 | String nbbm =jsonObject.getString("nbbm"); |
| 1167 | 1162 | String rq=jsonObject.getString("rq"); |
| 1168 | - double yh = Arith.sub(Arith.add(czyl, jzl), jzyl); | |
| 1163 | + double yh = Arith.sub(Arith.add(czyl, jzl), Arith.add(jzyl, sh)); | |
| 1169 | 1164 | if(yh<0){ |
| 1170 | 1165 | yh=0.0; |
| 1171 | 1166 | } |
| ... | ... | @@ -1439,4 +1434,228 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS |
| 1439 | 1434 | |
| 1440 | 1435 | return lists; |
| 1441 | 1436 | } |
| 1437 | + | |
| 1438 | + @Override | |
| 1439 | + public Map<String, Object> updateHistory(Map<String, Object> map) throws Exception { | |
| 1440 | + // TODO Auto-generated method stub | |
| 1441 | + Map<String, Object> newMap = new HashMap<String, Object>(); | |
| 1442 | + | |
| 1443 | + List<Cars> carsList = carsRepository.findCars(); | |
| 1444 | + Map<String, Boolean> carsMap = new HashMap<String, Boolean>(); | |
| 1445 | + for (int i = 0; i < carsList.size(); i++) { | |
| 1446 | + Cars c = carsList.get(i); | |
| 1447 | + carsMap.put(c.getInsideCode(), c.getSfdc()); | |
| 1448 | + } | |
| 1449 | + try{ | |
| 1450 | + String date = map.get("date").toString(); | |
| 1451 | + String line = map.get("line").toString(); | |
| 1452 | + String gsdm = map.get("gsdm").toString(); | |
| 1453 | + String fgsdm = map.get("fgsdm").toString(); | |
| 1454 | + | |
| 1455 | + List<Map<String, Object>> listpbYc=new ArrayList<Map<String, Object>>();//油车数据 | |
| 1456 | + List<Map<String, Object>> listpbDc=new ArrayList<Map<String, Object>>();//电车数据 | |
| 1457 | + List<Map<String,Object>> listpb=scheduleRealInfoService.yesterdayDataList(line, date,gsdm, fgsdm, "", ""); | |
| 1458 | + for (int i = 0; i < listpb.size(); i++) { | |
| 1459 | + boolean sfdc=true; | |
| 1460 | + Map<String, Object> m = listpb.get(i); | |
| 1461 | + if (carsMap.get(m.get("clZbh").toString()) != null) { | |
| 1462 | + sfdc = carsMap.get(m.get("clZbh").toString()); | |
| 1463 | + } else { | |
| 1464 | + sfdc = true; | |
| 1465 | + } | |
| 1466 | + if(sfdc){ | |
| 1467 | + listpbDc.add(m); | |
| 1468 | + }else{ | |
| 1469 | + listpbYc.add(m); | |
| 1470 | + } | |
| 1471 | + } | |
| 1472 | + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); | |
| 1473 | + //初始存油量 | |
| 1474 | + List<Cyl> clyList = cylRepository.obtainCyl("",gsdm); | |
| 1475 | + List<Ylxxb> ylxxList = ylxxbRepository.obtainYlxx(date, 0,gsdm); | |
| 1476 | + //重新统计油车数据开始 | |
| 1477 | + List<Ylb> ylListBe =repository.listMaxRqJcsx(date, gsdm, fgsdm, line, ""); | |
| 1478 | + List<Ylb> ylbList=this.listOrderBy(date,gsdm,fgsdm,line,"","nbbm"); | |
| 1479 | + List<Ylb> ylbList_upd=new ArrayList<Ylb>(); | |
| 1480 | + List<Ylb> ylbList_del=new ArrayList<Ylb>(); | |
| 1481 | + | |
| 1482 | + for (int j = 0; j < ylbList.size(); j++) { | |
| 1483 | + Ylb t=ylbList.get(j); | |
| 1484 | + boolean fage=true; | |
| 1485 | + for (int i = 0; i < listpbYc.size(); i++) { | |
| 1486 | + Map<String, Object> m = listpbYc.get(i); | |
| 1487 | + if(t.getNbbm().equals(m.get("clZbh").toString()) | |
| 1488 | + &&t.getJsy().equals(m.get("jGh").toString()) | |
| 1489 | + &&t.getXlbm().equals(m.get("xlBm").toString()) | |
| 1490 | + &&t.getLp().equals(m.get("lpName").toString())){ | |
| 1491 | + //该条记录不用删除 | |
| 1492 | + fage =false; | |
| 1493 | + ylbList_upd.add(t); | |
| 1494 | + } | |
| 1495 | + } | |
| 1496 | + if(fage){ | |
| 1497 | + ylbList_del.add(t); | |
| 1498 | + } | |
| 1499 | + | |
| 1500 | + } | |
| 1501 | + | |
| 1502 | + List<Ylb> list=new ArrayList<Ylb>(); | |
| 1503 | + /* | |
| 1504 | + * 第一步 修改车辆里程 和加注量 | |
| 1505 | + */ | |
| 1506 | + Map<String, Object> ylMap=new HashMap<String, Object>(); | |
| 1507 | + for (int x = 0; x < listpbYc.size(); x++) { | |
| 1508 | + String type = "add"; | |
| 1509 | + Map<String, Object> maps = listpb.get(x); | |
| 1510 | + // 判断驾驶员驾驶的该车辆是否已经存入了(查出的结果集中日期是相同的,根据驾驶员、内部编号、线路编码判断) | |
| 1511 | + Ylb t = new Ylb(); | |
| 1512 | + for (int k = 0; k < ylbList_upd.size(); k++) { | |
| 1513 | + Ylb t1 = ylbList_upd.get(k); | |
| 1514 | + if (t1.getNbbm().equals(maps.get("clZbh").toString()) | |
| 1515 | + && t1.getJsy().equals(maps.get("jGh").toString()) | |
| 1516 | + && t1.getXlbm().equals(maps.get("xlBm").toString()) | |
| 1517 | + && t1.getLp().equals(maps.get("lpName").toString())) { | |
| 1518 | + t = t1; | |
| 1519 | + type = "update"; | |
| 1520 | + } | |
| 1521 | + } | |
| 1522 | + // 当日的第一个班次,出场油量等于前一天的最后一个班次的进场油量 | |
| 1523 | + if (maps.get("seqNumber").toString().equals("1")) { | |
| 1524 | + boolean fage = true; | |
| 1525 | + for (int i = 0; i < ylListBe.size(); i++) { | |
| 1526 | + Ylb ylb = ylListBe.get(i); | |
| 1527 | + if (maps.get("clZbh").toString().equals(ylb.getNbbm())) { | |
| 1528 | + if(ylb.getJzyl()>0){ | |
| 1529 | + t.setCzyl(ylb.getJzyl()); | |
| 1530 | + fage = false; | |
| 1531 | + break; | |
| 1532 | + } | |
| 1533 | + } | |
| 1534 | + } | |
| 1535 | + if (fage) { | |
| 1536 | + for (int y = 0; y < clyList.size(); y++) { | |
| 1537 | + Cyl cyl = clyList.get(y); | |
| 1538 | + if (maps.get("clZbh").toString().equals(cyl.getNbbm())) { | |
| 1539 | + if(cyl!=null){ | |
| 1540 | + if(cyl.getCyl()>=0){ | |
| 1541 | + t.setCzyl(cyl.getCyl()); | |
| 1542 | + fage = false; | |
| 1543 | + break; | |
| 1544 | + }else { | |
| 1545 | + if(cyl.getCxrl()!=null){ | |
| 1546 | + if(cyl.getCxrl()>0){ | |
| 1547 | + t.setCzyl(cyl.getCxrl()); | |
| 1548 | + fage = false; | |
| 1549 | + break; | |
| 1550 | + } | |
| 1551 | + } | |
| 1552 | + } | |
| 1553 | + } | |
| 1554 | + } | |
| 1555 | + } | |
| 1556 | + } | |
| 1557 | + if (fage) { | |
| 1558 | + t.setCzyl(0.0); | |
| 1559 | + } | |
| 1560 | + } | |
| 1561 | + | |
| 1562 | + Double jzl = 0.0; | |
| 1563 | + //一人一车加注量只匹配一次 | |
| 1564 | + if(ylMap.get(maps.get("clZbh").toString()+"_"+ maps.get("jGh").toString())!=null){ | |
| 1565 | + }else{ | |
| 1566 | + boolean fage2=false; | |
| 1567 | + for (int i = 0; i < ylxxList.size(); i++) { | |
| 1568 | + Ylxxb ylxxb = ylxxList.get(i); | |
| 1569 | + if (maps.get("clZbh").toString().equals(ylxxb.getNbbm()) | |
| 1570 | + && maps.get("jGh").toString().equals(ylxxb.getJsy()) | |
| 1571 | + && ylxxb.getJylx()>0) { | |
| 1572 | + if(ylxxb.getJzl()>0){ | |
| 1573 | + fage2=true; | |
| 1574 | + } | |
| 1575 | + } | |
| 1576 | + } | |
| 1577 | + //车辆的加注量如果有任工干预,略接口过来 数据 | |
| 1578 | + if(fage2){ | |
| 1579 | + // 把当天手工输入的的YLXXB的加注量设置为当天YLB的加注量(根据车号,驾驶员判断,加油类型为1) | |
| 1580 | + for (int j = 0; j < ylxxList.size(); j++) { | |
| 1581 | + Ylxxb ylxxb = ylxxList.get(j); | |
| 1582 | + if (maps.get("clZbh").toString().equals(ylxxb.getNbbm()) | |
| 1583 | + && maps.get("jGh").toString().equals(ylxxb.getJsy()) | |
| 1584 | + && ylxxb.getJylx()>0) { | |
| 1585 | + jzl =Arith.add(jzl, ylxxb.getJzl()); | |
| 1586 | + } | |
| 1587 | + } | |
| 1588 | + ylMap.put(maps.get("clZbh").toString()+"_"+ maps.get("jGh").toString(),maps.get("xlBm") == null ? "" : maps.get("xlBm").toString()); | |
| 1589 | + }else{ | |
| 1590 | + // 把当天的YLXXB的加注量设置为当天YLB的加注量(根据车号,驾驶员判断) | |
| 1591 | + for (int j = 0; j < ylxxList.size(); j++) { | |
| 1592 | + Ylxxb ylxxb = ylxxList.get(j); | |
| 1593 | + if (maps.get("clZbh").toString().equals(ylxxb.getNbbm()) | |
| 1594 | + && maps.get("jGh").toString().equals(ylxxb.getJsy())) { | |
| 1595 | + jzl =Arith.add(jzl, ylxxb.getJzl()); | |
| 1596 | + } | |
| 1597 | + } | |
| 1598 | + ylMap.put(maps.get("clZbh").toString()+"_"+ maps.get("jGh").toString(),maps.get("xlBm") == null ? "" : maps.get("xlBm").toString()); | |
| 1599 | + } | |
| 1600 | + } | |
| 1601 | + t.setJzl(jzl); | |
| 1602 | + t.setNbbm(maps.get("clZbh").toString()); | |
| 1603 | + t.setJsy(maps.get("jGh") == null ? "" : maps.get("jGh").toString()); | |
| 1604 | + t.setZlc(maps.get("totalKilometers") == null ? 0.0 | |
| 1605 | + : Double.parseDouble(maps.get("totalKilometers").toString())); | |
| 1606 | + t.setXlbm(maps.get("xlBm") == null ? "" : maps.get("xlBm").toString()); | |
| 1607 | + t.setJcsx(Integer.parseInt(maps.get("seqNumber").toString())); | |
| 1608 | + t.setSsgsdm(maps.get("company") == null ? "" : maps.get("company").toString()); | |
| 1609 | + t.setFgsdm(maps.get("bCompany") == null ? "" : maps.get("bCompany").toString()); | |
| 1610 | + t.setJhsj(maps.get("fcsj")==null?"":maps.get("fcsj").toString()); | |
| 1611 | + t.setRq(sdf.parse(date)); | |
| 1612 | + t.setLp(maps.get("lpName")==null?"":maps.get("lpName").toString()); | |
| 1613 | + if(!(t.getSsgsdm().equals("") || t.getFgsdm().equals(""))){ | |
| 1614 | + if(type.equals("add")){ | |
| 1615 | + t.setCreatetime(new Date()); | |
| 1616 | + }else{ | |
| 1617 | + t.setUpdatetime(new Date()); | |
| 1618 | + } | |
| 1619 | + } | |
| 1620 | + repository.save(t); | |
| 1621 | + | |
| 1622 | + } | |
| 1623 | + | |
| 1624 | + for (int i = 0; i < ylbList_del.size(); i++) { | |
| 1625 | + Ylb y=ylbList_del.get(i); | |
| 1626 | + repository.delete(y.getId()); | |
| 1627 | + } | |
| 1628 | + //重新统计油车数据结束 | |
| 1629 | + | |
| 1630 | + | |
| 1631 | + | |
| 1632 | + //重新获取电耗数据开始 | |
| 1633 | + Map<String, List<Dlb>> mapList=dlbService.updeteHistory(listpbDc, date, gsdm, fgsdm, line); | |
| 1634 | + List<Dlb> delDlb=mapList.get("delList"); | |
| 1635 | + for (int i = 0; i < delDlb.size(); i++) { | |
| 1636 | + Dlb d=delDlb.get(i); | |
| 1637 | + dlbRepository.delete(d.getId()); | |
| 1638 | + } | |
| 1639 | + List<Dlb> updDlb=mapList.get("updList"); | |
| 1640 | + for (int i = 0; i < updDlb.size(); i++) { | |
| 1641 | + Dlb d=updDlb.get(i); | |
| 1642 | + dlbRepository.save(d); | |
| 1643 | + } | |
| 1644 | + //重新获取电耗数据结束 | |
| 1645 | + newMap.put("status", ResponseCode.SUCCESS); | |
| 1646 | + }catch(Exception e){ | |
| 1647 | + // TODO Auto-generated catch block | |
| 1648 | + newMap.put("status", ResponseCode.ERROR); | |
| 1649 | + throw e; | |
| 1650 | + } | |
| 1651 | + | |
| 1652 | + | |
| 1653 | + return newMap; | |
| 1654 | + } | |
| 1655 | + | |
| 1656 | + public List<Ylb> listByRqJcsx(String rq,String gsdm,String fgsdm,String xlbm,String nbbm, | |
| 1657 | + String px) { | |
| 1658 | + | |
| 1659 | + return null; | |
| 1660 | + } | |
| 1442 | 1661 | } | ... | ... |
src/main/java/com/bsth/service/oil/impl/YlxxbServiceImpl.java
| ... | ... | @@ -56,7 +56,7 @@ public class YlxxbServiceImpl extends BaseServiceImpl<Ylxxb,Integer> implements |
| 56 | 56 | String fgsdm=map.get("fgsdm_like").toString(); |
| 57 | 57 | |
| 58 | 58 | String sql=" select * from (" |
| 59 | - + "select *,CONCAT(nbbm,jsy) as nj " | |
| 59 | + + "select *,CONCAT(nbbm,jsy) as nj, CONCAT(nbbm,'_',jsy,'_',jzl) as njj " | |
| 60 | 60 | + " from bsth_c_ylxxb where yyrq='"+rq+"' " |
| 61 | 61 | + " and gsdm ='"+gsdm+"' and jylx !='1') x where x.nj not in (" |
| 62 | 62 | + " select CONCAT(nbbm,jsy) from bsth_c_ylb " |
| ... | ... | @@ -65,35 +65,10 @@ public class YlxxbServiceImpl extends BaseServiceImpl<Ylxxb,Integer> implements |
| 65 | 65 | + " and x.nbbm in (select nbbm from bsth_c_ylb " |
| 66 | 66 | + " where rq='"+rq+"'" |
| 67 | 67 | + " and ssgsdm='"+gsdm+"' and fgsdm ='"+fgsdm+"') " |
| 68 | - + " and x.nbbm not in (select nbbm from bsth_c_ylxxb" | |
| 69 | - + " where yyrq='"+rq+"' and gsdm ='"+gsdm+"' AND jylx !='0')"; | |
| 70 | - | |
| 71 | - | |
| 72 | - /*String sql= "select v.*,u.jsy as ldgh from " | |
| 73 | - + " ( select * from bsth_c_ylxxb x where " | |
| 74 | - + " DATE_FORMAT(x.yyrq,'%Y-%m-%d')='"+rq+"' and x.gsdm='"+gsdm+"'" | |
| 75 | - + " and x.jsy not in (" | |
| 76 | - + " select jsy from bsth_c_ylb " | |
| 77 | - + " where DATE_FORMAT(rq,'%Y-%m-%d')='"+rq+"' " | |
| 78 | - + " and ssgsdm='"+gsdm+"' and fgsdm='"+fgsdm+"')" | |
| 79 | - + " and x.nbbm in (select nbbm from bsth_c_ylb " | |
| 80 | - + " where DATE_FORMAT(rq,'%Y-%m-%d')='"+rq+"' " | |
| 81 | - + " and ssgsdm='"+gsdm+"' and fgsdm='"+fgsdm+"' )) v " | |
| 82 | - + " left join (select * from bsth_c_ylb " | |
| 83 | - + " where DATE_FORMAT(rq,'%Y-%m-%d')='"+rq+"'" | |
| 84 | - + " and ssgsdm='"+gsdm+"' and fgsdm='"+fgsdm+"' ) u " | |
| 85 | - + " on v.nbbm=u.nbbm ";*/ | |
| 86 | - | |
| 87 | - //根具条件查询指定日期Ylxxb的数据 | |
| 88 | -// List<Ylxxb> iterator=repository.checkYlxx(rq,gsdm); | |
| 89 | - /*if(map.get("gsdm_in")!=null){ | |
| 90 | - map.put("ssgsdm_in", map.get("gsdm_in")); | |
| 91 | - map.remove("gsdm_in"); | |
| 92 | - | |
| 93 | - }else{ | |
| 94 | - map.put("ssgsdm_like", map.get("gsdm_like")); | |
| 95 | - map.remove("gsdm_like"); | |
| 96 | - }*/ | |
| 68 | + + " and x.nj not in (select CONCAT(nbbm,jsy) from bsth_c_ylxxb" | |
| 69 | + + " where yyrq='"+rq+"' and gsdm ='"+gsdm+"' AND jylx in (1,3))" | |
| 70 | + + " and x.njj not in (SELECT tj FROM bsth_c_ylxxb_update " | |
| 71 | + + " where yyrq='"+rq+"' and zt='3')"; | |
| 97 | 72 | |
| 98 | 73 | //根具条件查询指定日期Ylb的数据 |
| 99 | 74 | // List<Ylb> ylbIterator=ylbRepository.checkYl(rq,gsdm,fgsdm); |
| ... | ... | @@ -135,25 +110,6 @@ public class YlxxbServiceImpl extends BaseServiceImpl<Ylxxb,Integer> implements |
| 135 | 110 | list.get(i).setLdgh(ldgh); |
| 136 | 111 | |
| 137 | 112 | } |
| 138 | - //正式使用用下面代码 | |
| 139 | -// for (int i = 0; i < iterator.size(); i++) { | |
| 140 | -// Ylxxb y1=iterator.get(i); | |
| 141 | -// boolean fage=true; | |
| 142 | -// String ldgh=""; | |
| 143 | -// for (int j = 0; j < ylbIterator.size(); j++) { | |
| 144 | -// Ylb y2 = ylbIterator.get(j); | |
| 145 | -// if(y1.getNbbm().equals(y2.getNbbm())){ | |
| 146 | -// if(y1.getJsy().equals(y2.getJsy())){ | |
| 147 | -// fage=false; | |
| 148 | -// } | |
| 149 | -// ldgh +=y2.getJsy()+"/"; | |
| 150 | -// } | |
| 151 | -// } | |
| 152 | -// if(fage){ | |
| 153 | -// y1.setLdgh(ldgh); | |
| 154 | -// list.add(y1); | |
| 155 | -// } | |
| 156 | -// } | |
| 157 | 113 | |
| 158 | 114 | |
| 159 | 115 | |
| ... | ... | @@ -181,11 +137,26 @@ public class YlxxbServiceImpl extends BaseServiceImpl<Ylxxb,Integer> implements |
| 181 | 137 | jsonObject=jsonArray.getJSONObject(x); |
| 182 | 138 | Integer id =jsonObject.getInteger("id"); |
| 183 | 139 | String jsy =jsonObject.getString("jsy"); |
| 184 | - Ylxxb ylxxb=repository.findOne(id); | |
| 185 | - if(!ylxxb.getJsy().equals(jsy)){ | |
| 186 | - ylxxb.setJsy(jsy); | |
| 187 | - ylxxb.setJylx(3); | |
| 188 | - repository.save(ylxxb); | |
| 140 | + String lsjsy =jsonObject.getString("lsjsy"); | |
| 141 | + String ldgh =jsonObject.getString("ldgh"); | |
| 142 | + if(!lsjsy.equals(jsy)){ | |
| 143 | + if(ldgh.indexOf(jsy)>-1){ | |
| 144 | + Ylxxb ylxxb=repository.findOne(id); | |
| 145 | + YlxxbUpdate ylxxbUpdate=new YlxxbUpdate(); | |
| 146 | + ylxxbUpdate.setGsdm(ylxxb.getGsdm()); | |
| 147 | + ylxxbUpdate.setJsy(ylxxb.getJsy()); | |
| 148 | + ylxxbUpdate.setJzl(ylxxb.getJzl()); | |
| 149 | + ylxxbUpdate.setJlrq(ylxxb.getJlrq()); | |
| 150 | + ylxxbUpdate.setNbbm(ylxxb.getNbbm()); | |
| 151 | + ylxxbUpdate.setYyrq(ylxxb.getYyrq()); | |
| 152 | + ylxxbUpdate.setCreatetime(new Date()); | |
| 153 | + ylxxbUpdate.setTj(ylxxb.getNbbm()+"_"+ylxxb.getJsy()+"_"+ylxxb.getJzl()); | |
| 154 | + ylxxbUpdate.setZt(3); | |
| 155 | + updateRepository.save(ylxxbUpdate); | |
| 156 | + ylxxb.setJsy(jsy); | |
| 157 | + ylxxb.setJylx(3); | |
| 158 | + repository.save(ylxxb); | |
| 159 | + } | |
| 189 | 160 | } |
| 190 | 161 | } |
| 191 | 162 | newMap.put("status", ResponseCode.SUCCESS); |
| ... | ... | @@ -201,14 +172,26 @@ public class YlxxbServiceImpl extends BaseServiceImpl<Ylxxb,Integer> implements |
| 201 | 172 | // TODO Auto-generated method stub |
| 202 | 173 | String rq=map.get("yyrq").toString(); |
| 203 | 174 | String gsdm=map.get("gsdm_like").toString(); |
| 175 | + String fgsdm=map.get("fgsdm_like").toString(); | |
| 176 | + | |
| 204 | 177 | String nbbm=map.get("nbbm").toString(); |
| 205 | 178 | |
| 206 | - String sql="select * from (select *,CONCAT(t.nbbm,'_',t.jsy,'_',t.jzl) as tj " | |
| 207 | - + " from bsth_c_ylxxb t where t.yyrq='"+rq+"' and t.gsdm='"+gsdm+"' and " | |
| 208 | - + " t.nylx=0 and t.jylx=0 and t.nbbm like '%"+nbbm+"%') y " | |
| 209 | - + " where y.nbbm not in (select c.inside_code from bsth_c_cars c " | |
| 210 | - + " where c.business_code ='05' and c.sfdc=0) and y.tj not in (" | |
| 211 | - + " select x.tj from bsth_c_ylxxb_update x)"; | |
| 179 | + String sql="select * from (" | |
| 180 | + + " select t.*,CONCAT(t.nbbm,'_',t.jsy,'_',t.jzl) as tj from bsth_c_ylxxb t where " | |
| 181 | + + " t.yyrq='"+rq+"' and t.gsdm='"+gsdm+"' and t.nylx=0 and t.jylx in(0,2) " | |
| 182 | + + " and t.nbbm in (select c.inside_code from bsth_c_cars c " | |
| 183 | + + " where c.business_code ='"+gsdm+"' and c.sfdc=0 and c.branche_company_code ='"+fgsdm+"')" | |
| 184 | + + " and t.nbbm not in (select nbbm from bsth_c_ylb y " | |
| 185 | + + " where y.rq= '"+rq+"' and ssgsdm='"+gsdm+"' and fgsdm='"+fgsdm+"') " | |
| 186 | + + " union " | |
| 187 | + + " select t.*,CONCAT(t.nbbm,'_',t.jsy,'_',t.jzl) as tj from bsth_c_ylxxb t where " | |
| 188 | + + " t.yyrq ='"+rq+"' and t.gsdm='"+gsdm+"' and t.nylx=0 and t.jylx in(0,2) " | |
| 189 | + + " and t.nbbm not in ( select c.inside_code from bsth_c_cars c " | |
| 190 | + + " where c.business_code ='"+gsdm+"' and c.sfdc=0 )" | |
| 191 | + + " ) z" | |
| 192 | + + " where z.tj not in (" | |
| 193 | + + " SELECT x.tj FROM bsth_c_ylxxb_update x where x.yyrq='"+rq+"' and zt=2" | |
| 194 | + + " ) and z.nbbm like '%"+nbbm+"%'"; | |
| 212 | 195 | |
| 213 | 196 | //根具条件查询指定日期Ylb的数据 |
| 214 | 197 | // List<Ylb> ylbIterator=ylbRepository.checkYl(rq,gsdm,fgsdm); |
| ... | ... | @@ -264,10 +247,11 @@ public class YlxxbServiceImpl extends BaseServiceImpl<Ylxxb,Integer> implements |
| 264 | 247 | ylxxbUpdate.setJsy(ylxxb.getJsy()); |
| 265 | 248 | ylxxbUpdate.setJzl(ylxxb.getJzl()); |
| 266 | 249 | ylxxbUpdate.setJlrq(ylxxb.getJlrq()); |
| 267 | - ylxxbUpdate.setNbbm(ylxxb.getNbbm()); | |
| 250 | + ylxxbUpdate.setNbbm(nbbm); | |
| 268 | 251 | ylxxbUpdate.setYyrq(ylxxb.getYyrq()); |
| 269 | 252 | ylxxbUpdate.setCreatetime(new Date()); |
| 270 | 253 | ylxxbUpdate.setTj(nbbm+"_"+ylxxb.getJsy()+"_"+ylxxb.getJzl()); |
| 254 | + ylxxbUpdate.setZt(2); | |
| 271 | 255 | updateRepository.save(ylxxbUpdate); |
| 272 | 256 | } |
| 273 | 257 | } | ... | ... |
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
| ... | ... | @@ -783,11 +783,15 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 783 | 783 | state = state + "+1"; |
| 784 | 784 | type = "ASC"; |
| 785 | 785 | } |
| 786 | - String sqlMinYysj="select start_opt from bsth_c_line_config where " | |
| 787 | - + " id = (" | |
| 788 | - + "select max(id) from bsth_c_line_config where line ='"+BasicData.lineId2CodeMap.inverse().get(line) +"'" | |
| 789 | - + ")"; | |
| 790 | - String minfcsj=jdbcTemplate.queryForObject(sqlMinYysj, String.class); | |
| 786 | + String minfcsj="02:00"; | |
| 787 | + List<Line> lineList=lineRepository.findLineByCode(line); | |
| 788 | + if(lineList.size()>0){ | |
| 789 | + String sqlMinYysj="select start_opt from bsth_c_line_config where " | |
| 790 | + + " id = (" | |
| 791 | + + "select max(id) from bsth_c_line_config where line ='"+lineList.get(0).getId() +"'" | |
| 792 | + + ")"; | |
| 793 | + minfcsj=jdbcTemplate.queryForObject(sqlMinYysj, String.class); | |
| 794 | + } | |
| 791 | 795 | String sqlPlan ="select * from (select * from (" |
| 792 | 796 | + " select min(s.id) as id,s.j_Gh as jGh,s.cl_Zbh as clZbh, " |
| 793 | 797 | + " s.lp_Name as lpName,s.j_Name as jName,max(s.schedule_date_str) as dateStr ," |
| ... | ... | @@ -902,11 +906,15 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 902 | 906 | // map=new HashMap<String,Object>(); |
| 903 | 907 | |
| 904 | 908 | SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm"); |
| 905 | - String sqlMinYysj="select start_opt from bsth_c_line_config where " | |
| 906 | - + " id = (" | |
| 907 | - + "select max(id) from bsth_c_line_config where line ='"+BasicData.lineId2CodeMap.inverse().get(line) +"'" | |
| 908 | - + ")"; | |
| 909 | - String minfcsj=jdbcTemplate.queryForObject(sqlMinYysj, String.class); | |
| 909 | + String minfcsj="02:00"; | |
| 910 | + List<Line> lineList=lineRepository.findLineByCode(line); | |
| 911 | + if(lineList.size()>0){ | |
| 912 | + String sqlMinYysj="select start_opt from bsth_c_line_config where " | |
| 913 | + + " id = (" | |
| 914 | + + "select max(id) from bsth_c_line_config where line ='"+lineList.get(0).getId() +"'" | |
| 915 | + + ")"; | |
| 916 | + minfcsj=jdbcTemplate.queryForObject(sqlMinYysj, String.class); | |
| 917 | + } | |
| 910 | 918 | String[] minSjs = minfcsj.split(":"); |
| 911 | 919 | Long minSj=Long.parseLong(minSjs[0])*60+Long.parseLong(minSjs[1]); |
| 912 | 920 | |
| ... | ... | @@ -2076,11 +2084,15 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 2076 | 2084 | List<ScheduleRealInfo> list = null; |
| 2077 | 2085 | list = scheduleRealInfoRepository.queryListWaybill(jName, clZbh, lpName, date, line); |
| 2078 | 2086 | SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm"); |
| 2079 | - String sqlMinYysj="select start_opt from bsth_c_line_config where " | |
| 2080 | - + " id = (" | |
| 2081 | - + "select max(id) from bsth_c_line_config where line ='"+BasicData.lineId2CodeMap.inverse().get(line) +"'" | |
| 2082 | - + ")"; | |
| 2083 | - String minfcsj=jdbcTemplate.queryForObject(sqlMinYysj, String.class); | |
| 2087 | + String minfcsj="02:00"; | |
| 2088 | + List<Line> lineList=lineRepository.findLineByCode(line); | |
| 2089 | + if(lineList.size()>0){ | |
| 2090 | + String sqlMinYysj="select start_opt from bsth_c_line_config where " | |
| 2091 | + + " id = (" | |
| 2092 | + + "select max(id) from bsth_c_line_config where line ='"+lineList.get(0).getId() +"'" | |
| 2093 | + + ")"; | |
| 2094 | + minfcsj= jdbcTemplate.queryForObject(sqlMinYysj, String.class); | |
| 2095 | + } | |
| 2084 | 2096 | String[] minSjs = minfcsj.split(":"); |
| 2085 | 2097 | Long minSj=Long.parseLong(minSjs[0])*60+Long.parseLong(minSjs[1]); |
| 2086 | 2098 | |
| ... | ... | @@ -2177,11 +2189,15 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 2177 | 2189 | List<ScheduleRealInfo> list = null; |
| 2178 | 2190 | list = scheduleRealInfoRepository.queryListWaybill(jName, clZbh, lpName, date, line); |
| 2179 | 2191 | SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm"); |
| 2180 | - String sqlMinYysj="select start_opt from bsth_c_line_config where " | |
| 2181 | - + " id = (" | |
| 2182 | - + "select max(id) from bsth_c_line_config where line ='"+BasicData.lineId2CodeMap.inverse().get(line) +"'" | |
| 2183 | - + ")"; | |
| 2184 | - String minfcsj=jdbcTemplate.queryForObject(sqlMinYysj, String.class); | |
| 2192 | + String minfcsj="02:00"; | |
| 2193 | + List<Line> lineList=lineRepository.findLineByCode(line); | |
| 2194 | + if(lineList.size()>0){ | |
| 2195 | + String sqlMinYysj="select start_opt from bsth_c_line_config where " | |
| 2196 | + + " id = (" | |
| 2197 | + + "select max(id) from bsth_c_line_config where line ='"+lineList.get(0).getId() +"'" | |
| 2198 | + + ")"; | |
| 2199 | + minfcsj= jdbcTemplate.queryForObject(sqlMinYysj, String.class); | |
| 2200 | + } | |
| 2185 | 2201 | String[] minSjs = minfcsj.split(":"); |
| 2186 | 2202 | Long minSj=Long.parseLong(minSjs[0])*60+Long.parseLong(minSjs[1]); |
| 2187 | 2203 | |
| ... | ... | @@ -4352,11 +4368,15 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 4352 | 4368 | // map=new HashMap<String,Object>(); |
| 4353 | 4369 | |
| 4354 | 4370 | SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm"); |
| 4355 | - String sqlMinYysj="select start_opt from bsth_c_line_config where " | |
| 4356 | - + " id = (" | |
| 4357 | - + "select max(id) from bsth_c_line_config where line ='"+BasicData.lineId2CodeMap.inverse().get(listpl.get(0).getXlBm()) +"'" | |
| 4358 | - + ")"; | |
| 4359 | - String minfcsj=jdbcTemplate.queryForObject(sqlMinYysj, String.class); | |
| 4371 | + String minfcsj="02:00"; | |
| 4372 | + List<Line> lineList=lineRepository.findLineByCode(listpl.get(0).getXlBm()); | |
| 4373 | + if(lineList.size()>0){ | |
| 4374 | + String sqlMinYysj="select start_opt from bsth_c_line_config where " | |
| 4375 | + + " id = (" | |
| 4376 | + + "select max(id) from bsth_c_line_config where line ='"+lineList.get(0).getId() +"'" | |
| 4377 | + + ")"; | |
| 4378 | + minfcsj=jdbcTemplate.queryForObject(sqlMinYysj, String.class); | |
| 4379 | + } | |
| 4360 | 4380 | String[] minSjs = minfcsj.split(":"); |
| 4361 | 4381 | Long minSj=Long.parseLong(minSjs[0])*60+Long.parseLong(minSjs[1]); |
| 4362 | 4382 | ... | ... |
src/main/java/com/bsth/service/report/impl/CulateMileageServiceImpl.java
| ... | ... | @@ -945,34 +945,39 @@ public class CulateMileageServiceImpl implements CulateMileageService{ |
| 945 | 945 | ScheduleRealInfo t=lists.get(i); |
| 946 | 946 | if(!isInOut(t)){ |
| 947 | 947 | if(!t.isSflj()){ |
| 948 | - Set<ChildTaskPlan> childTaskPlans = t.getcTasks(); | |
| 949 | - if(childTaskPlans.isEmpty()){ | |
| 950 | - if(!t.isDestroy()){ | |
| 951 | - if( Math.abs(t.getJhlc()-t.getJhlcOrig())>0){ | |
| 952 | - jhwlc =Arith.add(jhwlc, t.getJhlcOrig()); | |
| 953 | - }else{ | |
| 954 | - jhnlc =Arith.add(jhnlc, t.getJhlc()); | |
| 948 | + if(t.isCcService()){ | |
| 949 | + jhwlc =Arith.add(jhwlc, t.getJhlc()); | |
| 950 | + }else{ | |
| 951 | + Set<ChildTaskPlan> childTaskPlans = t.getcTasks(); | |
| 952 | + if(childTaskPlans.isEmpty()){ | |
| 953 | + if(!t.isDestroy()){ | |
| 954 | + if( Math.abs(t.getJhlc()-t.getJhlcOrig())>0){ | |
| 955 | + jhwlc =Arith.add(jhwlc, t.getJhlc()); | |
| 956 | + }else{ | |
| 957 | + jhnlc =Arith.add(jhnlc, t.getJhlc()); | |
| 958 | + } | |
| 955 | 959 | } |
| 960 | + }else{ | |
| 961 | + Iterator<ChildTaskPlan> it = childTaskPlans.iterator(); | |
| 962 | + double zrwlc=0.0; | |
| 963 | + boolean fage=false; | |
| 964 | + while (it.hasNext()) { | |
| 965 | + ChildTaskPlan childTaskPlan = it.next(); | |
| 966 | + if(childTaskPlan.getMileageType().equals("service") | |
| 967 | + && childTaskPlan.getCcId()==null){ | |
| 968 | + if (childTaskPlan.isDestroy()) { | |
| 969 | + fage=true; | |
| 970 | + }else{ | |
| 971 | + zrwlc =Arith.add(zrwlc, childTaskPlan.getMileage()); | |
| 972 | + } | |
| 973 | + } | |
| 974 | + } | |
| 975 | + if(fage){ | |
| 976 | + jhwlc =Arith.add(jhwlc, zrwlc); | |
| 977 | + }else{ | |
| 978 | + jhnlc =Arith.add(jhnlc, zrwlc); | |
| 979 | + } | |
| 956 | 980 | } |
| 957 | - }else{ | |
| 958 | - Iterator<ChildTaskPlan> it = childTaskPlans.iterator(); | |
| 959 | - double zrwlc=0.0; | |
| 960 | - boolean fage=false; | |
| 961 | - while (it.hasNext()) { | |
| 962 | - ChildTaskPlan childTaskPlan = it.next(); | |
| 963 | - if(childTaskPlan.getMileageType().equals("service")){ | |
| 964 | - if (childTaskPlan.isDestroy()) { | |
| 965 | - fage=true; | |
| 966 | - }else{ | |
| 967 | - zrwlc =Arith.add(zrwlc, childTaskPlan.getMileage()); | |
| 968 | - } | |
| 969 | - } | |
| 970 | - } | |
| 971 | - if(fage){ | |
| 972 | - jhwlc =Arith.add(jhwlc, zrwlc); | |
| 973 | - }else{ | |
| 974 | - jhnlc =Arith.add(jhnlc, zrwlc); | |
| 975 | - } | |
| 976 | 981 | } |
| 977 | 982 | } |
| 978 | 983 | } |
| ... | ... | @@ -994,35 +999,41 @@ public class CulateMileageServiceImpl implements CulateMileageService{ |
| 994 | 999 | ScheduleRealInfo t=lists.get(i); |
| 995 | 1000 | if(t.getBcType().equals("in") || t.getBcType().equals("out")){ |
| 996 | 1001 | if(!t.isSflj()){ |
| 997 | - Set<ChildTaskPlan> childTaskPlans = t.getcTasks(); | |
| 998 | - if(childTaskPlans.isEmpty()){ | |
| 999 | - if(!t.isDestroy()){ | |
| 1000 | - if( Math.abs(t.getJhlc()-t.getJhlcOrig())>0){ | |
| 1001 | - jhwlc =Arith.add(jhwlc, t.getJhlcOrig()); | |
| 1002 | - }else{ | |
| 1003 | - jhnlc =Arith.add(jhnlc, t.getJhlc()); | |
| 1004 | - } | |
| 1005 | - } | |
| 1002 | + if(t.isCcService()){ | |
| 1003 | + jhwlc =Arith.add(jhwlc, t.getJhlc()); | |
| 1006 | 1004 | }else{ |
| 1007 | - Iterator<ChildTaskPlan> it = childTaskPlans.iterator(); | |
| 1008 | - double zrwlc=0.0; | |
| 1009 | - boolean fage=false; | |
| 1010 | - while (it.hasNext()) { | |
| 1011 | - ChildTaskPlan childTaskPlan = it.next(); | |
| 1012 | - if(childTaskPlan.getMileageType().equals("empty")){ | |
| 1013 | - if (childTaskPlan.isDestroy()) { | |
| 1014 | - fage=true; | |
| 1015 | - }else{ | |
| 1016 | - zrwlc =Arith.add(zrwlc, childTaskPlan.getMileage()); | |
| 1017 | - } | |
| 1018 | - } | |
| 1019 | - } | |
| 1020 | - if(fage){ | |
| 1021 | - jhwlc =Arith.add(jhwlc, zrwlc); | |
| 1022 | - }else{ | |
| 1023 | - jhnlc =Arith.add(jhnlc, zrwlc); | |
| 1024 | - } | |
| 1025 | - } | |
| 1005 | + Set<ChildTaskPlan> childTaskPlans = t.getcTasks(); | |
| 1006 | + if(childTaskPlans.isEmpty()){ | |
| 1007 | + if(!t.isDestroy()){ | |
| 1008 | + if( Math.abs(t.getJhlc()-t.getJhlcOrig())>0){ | |
| 1009 | + jhwlc =Arith.add(jhwlc, t.getJhlc()); | |
| 1010 | + }else{ | |
| 1011 | + jhnlc =Arith.add(jhnlc, t.getJhlc()); | |
| 1012 | + } | |
| 1013 | + } | |
| 1014 | + }else{ | |
| 1015 | + Iterator<ChildTaskPlan> it = childTaskPlans.iterator(); | |
| 1016 | + double zrwlc=0.0; | |
| 1017 | + boolean fage=false; | |
| 1018 | + while (it.hasNext()) { | |
| 1019 | + ChildTaskPlan childTaskPlan = it.next(); | |
| 1020 | + if(childTaskPlan.getMileageType().equals("empty") | |
| 1021 | + && childTaskPlan.getCcId()==null){ | |
| 1022 | + if (childTaskPlan.isDestroy()) { | |
| 1023 | + fage=true; | |
| 1024 | + }else{ | |
| 1025 | + zrwlc =Arith.add(zrwlc, childTaskPlan.getMileage()); | |
| 1026 | + } | |
| 1027 | + } | |
| 1028 | + } | |
| 1029 | + if(fage){ | |
| 1030 | + jhwlc =Arith.add(jhwlc, zrwlc); | |
| 1031 | + }else{ | |
| 1032 | + jhnlc =Arith.add(jhnlc, zrwlc); | |
| 1033 | + } | |
| 1034 | + } | |
| 1035 | + } | |
| 1036 | + | |
| 1026 | 1037 | } |
| 1027 | 1038 | } |
| 1028 | 1039 | } |
| ... | ... | @@ -1049,15 +1060,6 @@ public class CulateMileageServiceImpl implements CulateMileageService{ |
| 1049 | 1060 | } |
| 1050 | 1061 | |
| 1051 | 1062 | } |
| 1052 | - /*else{ | |
| 1053 | - //临加进出场子任务 待统计 | |
| 1054 | - Iterator<ChildTaskPlan> it = childTaskPlans.iterator(); | |
| 1055 | - double zrwlc=0.0; | |
| 1056 | - boolean fage=false; | |
| 1057 | - while (it.hasNext()) { | |
| 1058 | - ChildTaskPlan childTaskPlan = it.next(); | |
| 1059 | - } | |
| 1060 | - }*/ | |
| 1061 | 1063 | } |
| 1062 | 1064 | |
| 1063 | 1065 | if(t.getBcType().equals("ldks")){ |
| ... | ... | @@ -1068,15 +1070,6 @@ public class CulateMileageServiceImpl implements CulateMileageService{ |
| 1068 | 1070 | } |
| 1069 | 1071 | |
| 1070 | 1072 | } |
| 1071 | - /*else{ | |
| 1072 | - //临加进出场子任务 待统计 | |
| 1073 | - Iterator<ChildTaskPlan> it = childTaskPlans.iterator(); | |
| 1074 | - double zrwlc=0.0; | |
| 1075 | - boolean fage=false; | |
| 1076 | - while (it.hasNext()) { | |
| 1077 | - ChildTaskPlan childTaskPlan = it.next(); | |
| 1078 | - } | |
| 1079 | - }*/ | |
| 1080 | 1073 | } |
| 1081 | 1074 | if(!isInOut(t)){ |
| 1082 | 1075 | Set<ChildTaskPlan> childTaskPlans = t.getcTasks(); |
| ... | ... | @@ -1096,9 +1089,6 @@ public class CulateMileageServiceImpl implements CulateMileageService{ |
| 1096 | 1089 | if(childTaskPlan.getType2().equals("2")||childTaskPlan.getType2().equals("3")){ |
| 1097 | 1090 | ljjcc =Arith.add(ljjcc, childTaskPlan.getMileage()); |
| 1098 | 1091 | } |
| 1099 | - if(childTaskPlan.getType2().equals("1")){ | |
| 1100 | - ljkfks =Arith.add(ljkfks, childTaskPlan.getMileage()); | |
| 1101 | - } | |
| 1102 | 1092 | } |
| 1103 | 1093 | } |
| 1104 | 1094 | } |
| ... | ... | @@ -1116,29 +1106,39 @@ public class CulateMileageServiceImpl implements CulateMileageService{ |
| 1116 | 1106 | |
| 1117 | 1107 | @Override |
| 1118 | 1108 | public double culateSsMile(List<ScheduleRealInfo> lists) { |
| 1119 | - double zlblc =0.0; | |
| 1120 | - for (int i = 0; i < lists.size(); i++) { | |
| 1121 | - ScheduleRealInfo scheduleRealInfo=lists.get(i); | |
| 1122 | - if (!isInOut(scheduleRealInfo)) { | |
| 1123 | - Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks(); | |
| 1124 | - if(childTaskPlans.isEmpty()){ | |
| 1125 | - if(scheduleRealInfo.isDestroy()){ | |
| 1126 | - zlblc=Arith.add(zlblc,scheduleRealInfo.getJhlcOrig()==null?0:scheduleRealInfo.getJhlcOrig()); | |
| 1109 | + // TODO Auto-generated method stub | |
| 1110 | + double zlblc =0.0; | |
| 1111 | + for (int i = 0; i < lists.size(); i++) { | |
| 1112 | + ScheduleRealInfo scheduleRealInfo=lists.get(i); | |
| 1113 | + if (!isInOut(scheduleRealInfo)) { | |
| 1114 | + Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks(); | |
| 1115 | + if(childTaskPlans.isEmpty()){ | |
| 1116 | + if(scheduleRealInfo.isDestroy()){ | |
| 1117 | + zlblc=Arith.add(zlblc,scheduleRealInfo.getJhlcOrig()==null?0:scheduleRealInfo.getJhlcOrig()); | |
| 1118 | + }else{ | |
| 1119 | + double jhlc=scheduleRealInfo.getJhlc()==null?0:scheduleRealInfo.getJhlc(); | |
| 1120 | + double jhlcOrig=scheduleRealInfo.getJhlcOrig()==null?0:scheduleRealInfo.getJhlcOrig(); | |
| 1121 | + double cjlc=Arith.sub(jhlcOrig,jhlc); | |
| 1122 | + if(cjlc>0){ | |
| 1123 | + zlblc=Arith.add(zlblc, cjlc); | |
| 1124 | + } | |
| 1125 | + } | |
| 1126 | + }else{ | |
| 1127 | + Iterator<ChildTaskPlan> it = childTaskPlans.iterator(); | |
| 1128 | + while (it.hasNext()) { | |
| 1129 | + ChildTaskPlan childTaskPlan = it.next(); | |
| 1130 | + if(childTaskPlan.getCcId()==null){ | |
| 1131 | + if(childTaskPlan.getMileageType().equals("service")){ | |
| 1132 | + if (childTaskPlan.isDestroy()) { | |
| 1133 | + zlblc=Arith.add(zlblc,childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage()); | |
| 1134 | + } | |
| 1135 | + } | |
| 1136 | + } | |
| 1137 | + } | |
| 1138 | + } | |
| 1127 | 1139 | } |
| 1128 | - }else{ | |
| 1129 | - Iterator<ChildTaskPlan> it = childTaskPlans.iterator(); | |
| 1130 | - while (it.hasNext()) { | |
| 1131 | - ChildTaskPlan childTaskPlan = it.next(); | |
| 1132 | - if(childTaskPlan.getMileageType().equals("service")){ | |
| 1133 | - if (childTaskPlan.isDestroy()) { | |
| 1134 | - zlblc=Arith.add(zlblc,childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage()); | |
| 1135 | - } | |
| 1136 | - } | |
| 1137 | - } | |
| 1138 | 1140 | } |
| 1139 | - } | |
| 1140 | - } | |
| 1141 | - return zlblc; | |
| 1141 | + return zlblc; | |
| 1142 | 1142 | } |
| 1143 | 1143 | |
| 1144 | 1144 | @Override |
| ... | ... | @@ -1153,28 +1153,34 @@ public class CulateMileageServiceImpl implements CulateMileageService{ |
| 1153 | 1153 | //有子任务 |
| 1154 | 1154 | if (cts != null && cts.size() > 0) { |
| 1155 | 1155 | for(ChildTaskPlan c : cts){ |
| 1156 | - if(item.equals("其他")){ | |
| 1157 | - if(c.isDestroy() && | |
| 1158 | - ((c.getDestroyReason()==null?"": c.getDestroyReason()).equals(item)|| | |
| 1159 | - (c.getDestroyReason()==null?"": c.getDestroyReason()).equals(""))) | |
| 1160 | - sum = Arith.add(sum, c.getMileage()); | |
| 1161 | - }else{ | |
| 1162 | - if(c.isDestroy() && (c.getDestroyReason()==null?"": c.getDestroyReason()).equals(item)) | |
| 1163 | - sum = Arith.add(sum, c.getMileage()); | |
| 1156 | + if(c.getCcId()==null){ | |
| 1157 | + if(item.equals("其他")){ | |
| 1158 | + if(c.isDestroy() && | |
| 1159 | + ((c.getDestroyReason()==null?"": c.getDestroyReason()).equals(item)|| | |
| 1160 | + (c.getDestroyReason()==null?"": c.getDestroyReason()).equals(""))) | |
| 1161 | + sum = Arith.add(sum, c.getMileage()); | |
| 1162 | + }else{ | |
| 1163 | + if(c.isDestroy() && (c.getDestroyReason()==null?"": c.getDestroyReason()).equals(item)) | |
| 1164 | + sum = Arith.add(sum, c.getMileage()); | |
| 1165 | + } | |
| 1164 | 1166 | } |
| 1165 | - | |
| 1166 | 1167 | } |
| 1167 | 1168 | } |
| 1168 | 1169 | else if(isInOut(sch)) |
| 1169 | 1170 | continue; |
| 1170 | 1171 | //主任务烂班 |
| 1171 | - else if(sch.getStatus() == -1){ | |
| 1172 | + else if(sch.getStatus() == -1 && !sch.isCcService()){ | |
| 1172 | 1173 | if(sch.getAdjustExps().equals(item) || |
| 1173 | 1174 | (StringUtils.isEmpty(sch.getAdjustExps()) && item.equals("其他"))){ |
| 1174 | 1175 | sum = Arith.add(sum, sch.getJhlcOrig()); |
| 1175 | 1176 | } |
| 1176 | 1177 | } |
| 1177 | - | |
| 1178 | + else if(item.equals("其他")){ | |
| 1179 | + double diff = Arith.sub(sch.getJhlcOrig(), sch.getJhlc()); | |
| 1180 | + if(diff > 0){ | |
| 1181 | + sum = Arith.add(sum, diff); | |
| 1182 | + } | |
| 1183 | + } | |
| 1178 | 1184 | } |
| 1179 | 1185 | return sum; |
| 1180 | 1186 | } |
| ... | ... | @@ -1223,20 +1229,22 @@ public class CulateMileageServiceImpl implements CulateMileageService{ |
| 1223 | 1229 | double kfks=0.0; |
| 1224 | 1230 | for (int i = 0; i < lists.size(); i++) { |
| 1225 | 1231 | ScheduleRealInfo t=lists.get(i); |
| 1226 | - if(t.getBcType().equals("ldks")){ | |
| 1227 | - Set<ChildTaskPlan> childTaskPlans = t.getcTasks(); | |
| 1228 | - if(childTaskPlans.isEmpty()){ | |
| 1229 | - if(!t.isDestroy()){ | |
| 1230 | - kfks=Arith.add(kfks,t.getJhlcOrig()==null?0:t.getJhlcOrig()); | |
| 1232 | + if(!t.isSflj()){ | |
| 1233 | + if(t.getBcType().equals("ldks")){ | |
| 1234 | + Set<ChildTaskPlan> childTaskPlans = t.getcTasks(); | |
| 1235 | + if(childTaskPlans.isEmpty()){ | |
| 1236 | + if(!t.isDestroy()){ | |
| 1237 | + kfks=Arith.add(kfks,t.getJhlcOrig()==null?0:t.getJhlcOrig()); | |
| 1238 | + } | |
| 1239 | + }else{ | |
| 1240 | + Iterator<ChildTaskPlan> it = childTaskPlans.iterator(); | |
| 1241 | + while (it.hasNext()) { | |
| 1242 | + ChildTaskPlan childTaskPlan = it.next(); | |
| 1243 | + if (!childTaskPlan.isDestroy()) { | |
| 1244 | + kfks=Arith.add(kfks,childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage()); | |
| 1245 | + } | |
| 1246 | + } | |
| 1231 | 1247 | } |
| 1232 | - }else{ | |
| 1233 | - Iterator<ChildTaskPlan> it = childTaskPlans.iterator(); | |
| 1234 | - while (it.hasNext()) { | |
| 1235 | - ChildTaskPlan childTaskPlan = it.next(); | |
| 1236 | - if (!childTaskPlan.isDestroy()) { | |
| 1237 | - kfks=Arith.add(kfks,childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage()); | |
| 1238 | - } | |
| 1239 | - } | |
| 1240 | 1248 | } |
| 1241 | 1249 | } |
| 1242 | 1250 | } | ... | ... |
src/main/java/com/bsth/service/report/impl/ReportServiceImpl.java
| ... | ... | @@ -373,11 +373,15 @@ public class ReportServiceImpl implements ReportService{ |
| 373 | 373 | DecimalFormat df = new DecimalFormat("#0.00"); |
| 374 | 374 | // TODO Auto-generated method stub |
| 375 | 375 | //最早营运时间 区分夜宵线 |
| 376 | - String sqlMinYysj="select start_opt from bsth_c_line_config where " | |
| 377 | - + " id = (" | |
| 378 | - + "select max(id) from bsth_c_line_config where line ='"+BasicData.lineId2CodeMap.inverse().get(line) +"'" | |
| 379 | - + ")"; | |
| 380 | - String minfcsj=jdbcTemplate.queryForObject(sqlMinYysj, String.class); | |
| 376 | + String minfcsj="02:00"; | |
| 377 | + List<Line> lineList=lineRepository.findLineByCode(line); | |
| 378 | + if(lineList.size()>0){ | |
| 379 | + String sqlMinYysj="select start_opt from bsth_c_line_config where " | |
| 380 | + + " id = (" | |
| 381 | + + "select max(id) from bsth_c_line_config where line ='"+lineList.get(0).getId() +"'" | |
| 382 | + + ")"; | |
| 383 | + minfcsj=jdbcTemplate.queryForObject(sqlMinYysj, String.class); | |
| 384 | + } | |
| 381 | 385 | String[] minSjs = minfcsj.split(":"); |
| 382 | 386 | int minSj=Integer.parseInt(minSjs[0])*60+Integer.parseInt(minSjs[1]); |
| 383 | 387 | //查询时间里程 |
| ... | ... | @@ -774,11 +778,15 @@ public class ReportServiceImpl implements ReportService{ |
| 774 | 778 | List<Map<String, Object>> list =new ArrayList<>(); |
| 775 | 779 | // TODO Auto-generated method stub |
| 776 | 780 | //最早营运时间 区分夜宵线 |
| 777 | - String sqlMinYysj="select start_opt from bsth_c_line_config where " | |
| 778 | - + " id = (" | |
| 779 | - + "select max(id) from bsth_c_line_config where line ='"+BasicData.lineId2CodeMap.inverse().get(line) +"'" | |
| 780 | - + ")"; | |
| 781 | - String minfcsj=jdbcTemplate.queryForObject(sqlMinYysj, String.class); | |
| 781 | + String minfcsj="02:00"; | |
| 782 | + List<Line> lineList=lineRepository.findLineByCode(line); | |
| 783 | + if(lineList.size()>0){ | |
| 784 | + String sqlMinYysj="select start_opt from bsth_c_line_config where " | |
| 785 | + + " id = (" | |
| 786 | + + "select max(id) from bsth_c_line_config where line ='"+lineList.get(0).getId() +"'" | |
| 787 | + + ")"; | |
| 788 | + minfcsj=jdbcTemplate.queryForObject(sqlMinYysj, String.class); | |
| 789 | + } | |
| 782 | 790 | |
| 783 | 791 | //查询全程 |
| 784 | 792 | String sqlqc="select t.* from ( " |
| ... | ... | @@ -859,8 +867,15 @@ public class ReportServiceImpl implements ReportService{ |
| 859 | 867 | public List<Map<String, Object>> tbodyTime5(String line, String ttinfo) { |
| 860 | 868 | // TODO Auto-generated method stub |
| 861 | 869 | //最早营运时间 区分夜宵线 |
| 862 | - String sqlMinYysj="select start_opt from bsth_c_line_config where line = '"+BasicData.lineId2CodeMap.inverse().get(line) +"'"; | |
| 863 | - String minfcsj=jdbcTemplate.queryForObject(sqlMinYysj, String.class); | |
| 870 | + String minfcsj="02:00"; | |
| 871 | + List<Line> lineList=lineRepository.findLineByCode(line); | |
| 872 | + if(lineList.size()>0){ | |
| 873 | + String sqlMinYysj="select start_opt from bsth_c_line_config where " | |
| 874 | + + " id = (" | |
| 875 | + + "select max(id) from bsth_c_line_config where line ='"+lineList.get(0).getId() +"'" | |
| 876 | + + ")"; | |
| 877 | + minfcsj= jdbcTemplate.queryForObject(sqlMinYysj, String.class); | |
| 878 | + } | |
| 864 | 879 | String[] minSjs = minfcsj.split(":"); |
| 865 | 880 | int minSj=Integer.parseInt(minSjs[0])*60+Integer.parseInt(minSjs[1]); |
| 866 | 881 | //查询时间里程 |
| ... | ... | @@ -1715,7 +1730,7 @@ public class ReportServiceImpl implements ReportService{ |
| 1715 | 1730 | newMap.put("nr", adjustExps); |
| 1716 | 1731 | newMap.put("lp", scheduleRealInfo.getLpName()); |
| 1717 | 1732 | newMap.put("nbbm", scheduleRealInfo.getClZbh()); |
| 1718 | - newMap.put("jgh", scheduleRealInfo.getjGh()); | |
| 1733 | + newMap.put("jgh", scheduleRealInfo.getjGh()+scheduleRealInfo.getjName()+"/"+scheduleRealInfo.getsGh()+scheduleRealInfo.getsName()); | |
| 1719 | 1734 | newMap.put("dz", scheduleRealInfo.getQdzName()); |
| 1720 | 1735 | newMap.put("sj", scheduleRealInfo.getFcsj()); |
| 1721 | 1736 | newMap.put("lbbc", 1); |
| ... | ... | @@ -1747,12 +1762,12 @@ public class ReportServiceImpl implements ReportService{ |
| 1747 | 1762 | newMap.put("nr", adjustExps); |
| 1748 | 1763 | newMap.put("lp", scheduleRealInfo.getLpName()); |
| 1749 | 1764 | newMap.put("nbbm", scheduleRealInfo.getClZbh()); |
| 1750 | - newMap.put("jgh", scheduleRealInfo.getjGh()); | |
| 1765 | + newMap.put("jgh", scheduleRealInfo.getjGh()+scheduleRealInfo.getjName()+"/"+scheduleRealInfo.getsGh()+scheduleRealInfo.getsName()); | |
| 1751 | 1766 | newMap.put("dz", scheduleRealInfo.getQdzName()); |
| 1752 | 1767 | newMap.put("sj", scheduleRealInfo.getFcsj()); |
| 1753 | 1768 | newMap.put("lbbc", 1); |
| 1754 | 1769 | newMap.put("lblc", zlblc); |
| 1755 | - newMap.put("jyqp", scheduleRealInfo.getRealMileage()); | |
| 1770 | + newMap.put("jyqp", scheduleRealInfo.getRemarks()); | |
| 1756 | 1771 | list.add(newMap); |
| 1757 | 1772 | } else { |
| 1758 | 1773 | while (it.hasNext()) { |
| ... | ... | @@ -1770,7 +1785,7 @@ public class ReportServiceImpl implements ReportService{ |
| 1770 | 1785 | newMap.put("nr", destroyReason); |
| 1771 | 1786 | newMap.put("lp", scheduleRealInfo.getLpName()); |
| 1772 | 1787 | newMap.put("nbbm", scheduleRealInfo.getClZbh()); |
| 1773 | - newMap.put("jgh", scheduleRealInfo.getjGh()); | |
| 1788 | + newMap.put("jgh", scheduleRealInfo.getjGh()+scheduleRealInfo.getjName()+"/"+scheduleRealInfo.getsGh()+scheduleRealInfo.getsName()); | |
| 1774 | 1789 | newMap.put("dz", childTaskPlan.getStartStationName()); |
| 1775 | 1790 | newMap.put("sj", childTaskPlan.getStartDate()); |
| 1776 | 1791 | newMap.put("gzf", " "); |
| ... | ... | @@ -2266,11 +2281,15 @@ public class ReportServiceImpl implements ReportService{ |
| 2266 | 2281 | @Override |
| 2267 | 2282 | public List<Map<String, Object>> queryInOutStrtions(String line, String date, int zd,String lzsj) { |
| 2268 | 2283 | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| 2269 | - String sqlMinYysj="select start_opt from bsth_c_line_config where " | |
| 2270 | - + " id = (" | |
| 2271 | - + "select max(id) from bsth_c_line_config where line ='"+BasicData.lineId2CodeMap.inverse().get(line) +"'" | |
| 2272 | - + ")"; | |
| 2273 | - String minfcsj=jdbcTemplate.queryForObject(sqlMinYysj, String.class); | |
| 2284 | + String minfcsj="02:00"; | |
| 2285 | + List<Line> lineList=lineRepository.findLineByCode(line); | |
| 2286 | + if(lineList.size()>0){ | |
| 2287 | + String sqlMinYysj="select start_opt from bsth_c_line_config where " | |
| 2288 | + + " id = (" | |
| 2289 | + + "select max(id) from bsth_c_line_config where line ='"+lineList.get(0).getId() +"'" | |
| 2290 | + + ")"; | |
| 2291 | + minfcsj= jdbcTemplate.queryForObject(sqlMinYysj, String.class); | |
| 2292 | + } | |
| 2274 | 2293 | List<ArrivalInfo> arrInfoList=this.load4(line, date, zd,minfcsj); |
| 2275 | 2294 | |
| 2276 | 2295 | //查询线路所有的站点 |
| ... | ... | @@ -2620,6 +2639,16 @@ public class ReportServiceImpl implements ReportService{ |
| 2620 | 2639 | double zlc=Arith.add(Arith.add(Arith.add(zrwjcc, ljlc), |
| 2621 | 2640 | Arith.add(zjcclc, zyylc)),kfks); |
| 2622 | 2641 | map.put("zlc", zlc); |
| 2642 | + | |
| 2643 | + //备用 | |
| 2644 | + double ljgl= culateService.culateLjgl(lists); | |
| 2645 | + double sjyygl= culateService.culateSjgl(lists); | |
| 2646 | + double zyygl= Arith.add(sjyygl,ljgl); | |
| 2647 | + | |
| 2648 | + double sjjccgl=culateService.culateJccgl(lists); | |
| 2649 | + double sjksgl=culateService.culateKsgl(lists); | |
| 2650 | + double zksgl=Arith.add(sjjccgl, sjksgl); | |
| 2651 | + map.put("sjzgl", Arith.add(zyygl, zksgl)); | |
| 2623 | 2652 | } |
| 2624 | 2653 | return map; |
| 2625 | 2654 | } | ... | ... |
src/main/java/com/bsth/service/report/impl/SheetServiceImpl.java
| ... | ... | @@ -149,20 +149,15 @@ public class SheetServiceImpl extends BaseServiceImpl<Sheet, Integer> implements |
| 149 | 149 | // String line =map.get("line").toString(); |
| 150 | 150 | // String date =map.get("date").toString(); |
| 151 | 151 | SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm"); |
| 152 | - String sqlMinYysj="select start_opt from bsth_c_line_config where " | |
| 153 | - + " id = (" | |
| 154 | - + "select max(id) from bsth_c_line_config where line ='"+BasicData.lineId2CodeMap.inverse().get(line) +"'" | |
| 155 | - + ")"; | |
| 156 | - List<String> listMin=jdbcTemplate.query(sqlMinYysj, | |
| 157 | - new RowMapper<String>(){ | |
| 158 | - @Override | |
| 159 | - public String mapRow(ResultSet rs, int rowNum) throws SQLException { | |
| 160 | - String s=rs.getString("start_opt"); | |
| 161 | - return s; | |
| 162 | - } | |
| 163 | - }); | |
| 164 | - if(listMin.size()>0){ | |
| 165 | - String minfcsj=listMin.get(0); | |
| 152 | + String minfcsj="02:00"; | |
| 153 | + List<Line> lineList=lineRepository.findLineByCode(line); | |
| 154 | + if(lineList.size()>0){ | |
| 155 | + String sqlMinYysj="select start_opt from bsth_c_line_config where " | |
| 156 | + + " id = (" | |
| 157 | + + "select max(id) from bsth_c_line_config where line ='"+lineList.get(0).getId() +"'" | |
| 158 | + + ")"; | |
| 159 | + minfcsj= jdbcTemplate.queryForObject(sqlMinYysj, String.class); | |
| 160 | + } | |
| 166 | 161 | String[] minSjs = minfcsj.split(":"); |
| 167 | 162 | //车辆最早发车时间 用了过滤超第二天0点的数据 |
| 168 | 163 | Long minSj=Long.parseLong(minSjs[0])*60+Long.parseLong(minSjs[1]); |
| ... | ... | @@ -602,7 +597,6 @@ public class SheetServiceImpl extends BaseServiceImpl<Sheet, Integer> implements |
| 602 | 597 | fage=false; |
| 603 | 598 | } |
| 604 | 599 | } |
| 605 | - } | |
| 606 | 600 | return listAdd; |
| 607 | 601 | } |
| 608 | 602 | ... | ... |
src/main/resources/static/pages/base/line/css/bmap_base.css
| ... | ... | @@ -13,7 +13,7 @@ html,body{ |
| 13 | 13 | } |
| 14 | 14 | |
| 15 | 15 | .caption { |
| 16 | - color: #B7B7B7; | |
| 16 | + color: white; | |
| 17 | 17 | font-size: 18px; |
| 18 | 18 | position: relative; |
| 19 | 19 | margin: 15px; |
| ... | ... | @@ -33,11 +33,16 @@ html,body{ |
| 33 | 33 | box-shadow: 10px 10px 5px #888888; |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | -.rm3_image { | |
| 36 | +.table-toolbar { | |
| 37 | + text-align: center; | |
| 38 | + margin-top: 20px !important; | |
| 39 | +} | |
| 40 | + | |
| 41 | +/* .rm3_image { | |
| 37 | 42 | width: 120px; |
| 38 | 43 | height: 26px; |
| 39 | 44 | |
| 40 | -} | |
| 45 | +} */ | |
| 41 | 46 | |
| 42 | 47 | /* 隐藏百度地图logo */ |
| 43 | 48 | .anchorBL, |
| ... | ... | @@ -47,6 +52,68 @@ html,body{ |
| 47 | 52 | display: none; |
| 48 | 53 | } |
| 49 | 54 | |
| 55 | +.protlet-box{ | |
| 56 | + | |
| 57 | + position: absolute; | |
| 58 | + | |
| 59 | + top: 40px; | |
| 60 | + | |
| 61 | + margin-left: 10px; | |
| 62 | + | |
| 63 | + overflow: hidden; | |
| 64 | + | |
| 65 | + width: 380px; | |
| 66 | + | |
| 67 | + height: auto; | |
| 68 | + | |
| 69 | + background:transparent; | |
| 70 | + | |
| 71 | + border:0px solid; | |
| 72 | + | |
| 73 | + box-shadow: 0 12px 15px 0 rgba(204, 204, 204, 0.33),0 17px 50px 0 rgba(204, 204, 204, 0.33); | |
| 74 | +} | |
| 75 | + | |
| 76 | +.BMap_pop div:nth-child(1) , | |
| 77 | +.BMap_pop div:nth-child(2) , | |
| 78 | +.BMap_pop div:nth-child(3) , | |
| 79 | +.BMap_pop div:nth-child(4) , | |
| 80 | +.BMap_pop div:nth-child(5) , | |
| 81 | +.BMap_pop div:nth-child(6) , | |
| 82 | +.BMap_pop div:nth-child(7) { | |
| 83 | + | |
| 84 | + border:0px solid rgb(255, 255, 255) !important; | |
| 85 | + background-color:#3B3F51 !important; | |
| 86 | + | |
| 87 | +} | |
| 88 | + | |
| 89 | +.BMap_pop div:nth-child(3){ | |
| 90 | + | |
| 91 | + width:23px !important; | |
| 92 | + | |
| 93 | +} | |
| 94 | + | |
| 95 | +.BMap_pop div:nth-child(7) { | |
| 96 | + | |
| 97 | + width:23px !important; | |
| 98 | + | |
| 99 | + height:24px !important; | |
| 100 | + | |
| 101 | +} | |
| 102 | + | |
| 103 | +.BMap_pop div:nth-child(5) { | |
| 104 | + | |
| 105 | + height:24px !important; | |
| 106 | + | |
| 107 | +} | |
| 108 | + | |
| 109 | +/* 图片以后在弄,先隐藏div */ | |
| 110 | +.BMap_pop div:nth-child(8) { | |
| 111 | + | |
| 112 | + height:0px !important; | |
| 113 | + /* background:url('/pages/base/stationroute/css/img/iw3-1.png') no-repeat !important; */ | |
| 114 | + /* background-image:url('/pages/base/stationroute/css/img/windowinfo_b.jpg') !important; */ | |
| 115 | + | |
| 116 | +} | |
| 50 | 117 | |
| 51 | 118 | .BMap_pop { |
| 52 | 119 | |
| ... | ... | @@ -54,6 +121,7 @@ html,body{ |
| 54 | 121 | |
| 55 | 122 | } |
| 56 | 123 | |
| 124 | +/* 滚动条属性 */ | |
| 57 | 125 | .defeat-scroll { |
| 58 | 126 | width: 98%; |
| 59 | 127 | height:380px; |
| ... | ... | @@ -88,3 +156,58 @@ background:rgba(255, 255, 255, 0); |
| 88 | 156 | /* background:#FF0BEE; */ |
| 89 | 157 | background:rgba(255, 255, 255, 0); |
| 90 | 158 | } |
| 159 | +/* 右侧悬浮框属性 */ | |
| 160 | +ul li a { | |
| 161 | + display: block; | |
| 162 | + color: white; | |
| 163 | + padding: 8px 16px; | |
| 164 | + text-decoration: none; | |
| 165 | +} | |
| 166 | + | |
| 167 | +ul li { | |
| 168 | + text-align: center; | |
| 169 | +} | |
| 170 | + | |
| 171 | +ul li:last-child { | |
| 172 | + border-bottom: none; | |
| 173 | +} | |
| 174 | + | |
| 175 | +ul li a.active { | |
| 176 | +/* background-color: #4CAF50; */ | |
| 177 | + color: white; | |
| 178 | +} | |
| 179 | + | |
| 180 | +ul li a:hover:not(.active) { | |
| 181 | + background-color: #36c6d3; | |
| 182 | + color: white; | |
| 183 | +} | |
| 184 | +/* 鼠标徘徊于tr张的状态 */ | |
| 185 | +.table-hover > tbody > tr:hover { | |
| 186 | + color: white; | |
| 187 | + background-color: #36c6d3 !important; | |
| 188 | +} | |
| 189 | +/* 站点单选框 */ | |
| 190 | +.radio_label { | |
| 191 | + display:block; | |
| 192 | + color: white; | |
| 193 | + float: left; | |
| 194 | + cursor: pointer; | |
| 195 | + margin-left: 50px; | |
| 196 | + font-size: 20px; | |
| 197 | + margin-top: 5px; | |
| 198 | + text-align: center; | |
| 199 | +} | |
| 200 | +.radioclass { | |
| 201 | + margin-top: 6px !important; | |
| 202 | + width: 17px; | |
| 203 | + height: 17px; | |
| 204 | + color: #36c6d3; | |
| 205 | +/* background-color: #36c6d3; */ | |
| 206 | +/* background-clip: #36c6d3; */ | |
| 207 | +} | |
| 208 | +.on { | |
| 209 | + background-position: 0 0; | |
| 210 | +} | |
| 211 | + | |
| 212 | + | |
| 213 | + | ... | ... |
src/main/resources/static/pages/base/line/editRoute.html
| ... | ... | @@ -282,9 +282,6 @@ $('#edit_route_mobal').on('editRouteMobal.show', function(e,transGPS,editRoute,m |
| 282 | 282 | fun.linePanlThree(lineid,data,directionData); |
| 283 | 283 | }); |
| 284 | 284 | $('#upload_show').removeClass('hidden'); |
| 285 | - //$('#Undo').removeClass('hidden'); | |
| 286 | - //$('#cut_section').removeClass('hidden'); | |
| 287 | - //$('#uploadRoute').addClass('hidden'); | |
| 288 | 285 | $('#upload').addClass('hidden'); |
| 289 | 286 | layer.msg('请先编辑路段,并保存!!!'); |
| 290 | 287 | }else { | ... | ... |
src/main/resources/static/pages/base/line/editstation.html
0 → 100644
| 1 | +<!-- 编辑站点 --> | |
| 2 | +<div class="modal fade" id="edit_station_mobal" role="basic" aria-hidden="true"> | |
| 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_station_form" action="/module" method="post"> | |
| 11 | + <div class="alert alert-danger display-hide"> <button class="close" data-close="alert"></button> | |
| 12 | + 您的输入有误,请检查下面的输入项 | |
| 13 | + </div> | |
| 14 | + <!-- 线路ID --> | |
| 15 | + <input type="hidden" name="stationId" id="stationIdInput"> | |
| 16 | + <input type="hidden" name="stationRouteId" id="stationRouteIdInput"> | |
| 17 | + <input type="hidden" name="stationRouteLine" id="stationRouteLineInput"> | |
| 18 | + <input type="hidden" name="lineCode" id="lineCodeInput"> | |
| 19 | + <input type="hidden" name="bPolygonGrid" id="bPolygonGridInput" /> | |
| 20 | + <input type="hidden" name="gPolygonGrid" id="gPolygonGridInput" /> | |
| 21 | + <input type="hidden" name="dbType" id="dbTypeInput" value="b"/> | |
| 22 | + <input type="hidden" name="x" id="xInput" value=""/> | |
| 23 | + <input type="hidden" name="y" id="yInput" value=""/> | |
| 24 | + <!-- 站点名称 --> | |
| 25 | + <div class="form-body"> | |
| 26 | + <div class="form-group"> | |
| 27 | + <label class="control-label col-md-3"> | |
| 28 | + <span class="required"> * </span> 站点名称 : | |
| 29 | + </label> | |
| 30 | + <div class="col-md-6"> | |
| 31 | + <input type="text" class="form-control" name="zdmc" id="zdmcInput" placeholder="站点名称" readonly="readonly"> | |
| 32 | + </div> | |
| 33 | + </div> | |
| 34 | + </div> | |
| 35 | + <!-- 站点路由名称 --> | |
| 36 | + <div class="form-body"> | |
| 37 | + <div class="form-group"> | |
| 38 | + <label class="control-label col-md-3"> | |
| 39 | + <span class="required"> * </span> 站点路由名称: | |
| 40 | + </label> | |
| 41 | + <div class="col-md-6"> | |
| 42 | + <input type="text" class="form-control" name="stationName" id="stationNameInput" placeholder="站点路由名称"> | |
| 43 | + </div> | |
| 44 | + </div> | |
| 45 | + </div> | |
| 46 | + <!-- 站点编码 --> | |
| 47 | + <div class="form-body"> | |
| 48 | + <div class="form-group"> | |
| 49 | + <label class="control-label col-md-3"> | |
| 50 | + <span class="required"> * </span> 站点编码 : | |
| 51 | + </label> | |
| 52 | + <div class="col-md-6"> | |
| 53 | + <input type="text" class="form-control" name="stationCod" id="stationCodInput" placeholder="站点编码" readonly="readonly"> | |
| 54 | + </div> | |
| 55 | + </div> | |
| 56 | + </div> | |
| 57 | + <!-- 站点方向 --> | |
| 58 | + <div class="form-body"> | |
| 59 | + <div class="form-group"> | |
| 60 | + <label class="control-label col-md-3"> | |
| 61 | + <span class="required"> * </span>站点方向 : | |
| 62 | + </label> | |
| 63 | + <div class="col-md-6"> | |
| 64 | + <select name="directions" class="form-control" id="stationdirSelect"> | |
| 65 | + <option value="">-- 请选择站点类型 --</option> | |
| 66 | + <option value="0">上行</option> | |
| 67 | + <option value="1">下行</option> | |
| 68 | + </select> | |
| 69 | + </div> | |
| 70 | + </div> | |
| 71 | + </div> | |
| 72 | + <!-- 站点序号 --> | |
| 73 | + <div class="form-body"> | |
| 74 | + <div class="form-group"> | |
| 75 | + <label class="control-label col-md-3"> | |
| 76 | + 上一站点 : | |
| 77 | + </label> | |
| 78 | + <div class="col-md-6"> | |
| 79 | + <select name="stationRouteCode" class="form-control" id="stationrouteSelect" style="width:100%"></select> | |
| 80 | + <span class="help-block"> *说明:选择的站点将作为本站序号的参考,成为选择站点的下一站。 </span> | |
| 81 | + </div> | |
| 82 | + </div> | |
| 83 | + </div> | |
| 84 | + <!-- 站点类型 --> | |
| 85 | + <div class="form-body"> | |
| 86 | + <div class="form-group"> | |
| 87 | + <label class="control-label col-md-3"> | |
| 88 | + <span class="required"> * </span>站点类型 : | |
| 89 | + </label> | |
| 90 | + <div class="col-md-6"> | |
| 91 | + <select name="stationMark" class="form-control" id="stationMarkSelect"> | |
| 92 | + <option value="">-- 请选择站点类型 --</option> | |
| 93 | + <option value="B">起点站</option> | |
| 94 | + <option value="Z">中途站</option> | |
| 95 | + <option value="E">终点站</option> | |
| 96 | + </select> | |
| 97 | + </div> | |
| 98 | + </div> | |
| 99 | + </div> | |
| 100 | + <!-- 经纬度坐标点 --> | |
| 101 | + <div class="form-body"> | |
| 102 | + <div class="form-group"> | |
| 103 | + <label class="col-md-3 control-label"> <span class="required"> * </span>经纬度坐标点:</label> | |
| 104 | + <div class="col-md-6"> | |
| 105 | + <input type="text" class="form-control" name="bJwpoints" id="bJwpointsInput" placeholder="经纬度坐标点"> | |
| 106 | + </div> | |
| 107 | + </div> | |
| 108 | + </div> | |
| 109 | + <!-- 几何图形类型 --> | |
| 110 | + <div class="form-body"> | |
| 111 | + <div class="form-group"> | |
| 112 | + <label class="col-md-3 control-label"><span class="required"> * </span>几何图形类型:</label> | |
| 113 | + <div class="col-md-6"> | |
| 114 | + <input type="text" class="form-control" name="shapesType" id="shapesTypeSelect" placeholder="几何图形类型" readonly="readonly"> | |
| 115 | + </div> | |
| 116 | + </div> | |
| 117 | + </div> | |
| 118 | + <!-- 圆形半径 --> | |
| 119 | + <div class="form-body" id="radiusGroup"> | |
| 120 | + <div class="form-group"> | |
| 121 | + <label class="col-md-3 control-label"><span class="required"> * </span>圆形半径 :</label> | |
| 122 | + <div class="col-md-6"> | |
| 123 | + <input type="text" class="form-control" name="radius" id="radiusInput" placeholder="圆形半径"> | |
| 124 | + </div> | |
| 125 | + </div> | |
| 126 | + </div> | |
| 127 | + <!-- 是否撤销 --> | |
| 128 | + <div class="form-body"> | |
| 129 | + <div class="form-group"> | |
| 130 | + <label class="col-md-3 control-label"><span class="required"> * </span>是否撤销 :</label> | |
| 131 | + <div class="col-md-6"> | |
| 132 | + <select name="destroy" class="form-control" id="destroySelect"> | |
| 133 | + <option value="">-- 请选择撤销类型 --</option> | |
| 134 | + <option value="0">否</option> | |
| 135 | + <option value="1">是</option> | |
| 136 | + </select> | |
| 137 | + </div> | |
| 138 | + </div> | |
| 139 | + </div> | |
| 140 | + <!-- 道路编码--> | |
| 141 | + <div class="form-body"> | |
| 142 | + <div class="form-group"> | |
| 143 | + <label class="control-label col-md-3">道路编码 :</label> | |
| 144 | + <div class="col-md-6"> | |
| 145 | + <input type="text" class="form-control" name="roadCoding" id="roadCodingCodInput" placeholder="道路编码"> | |
| 146 | + </div> | |
| 147 | + </div> | |
| 148 | + </div> | |
| 149 | + <!-- 到站时间 --> | |
| 150 | + <div class="form-body"> | |
| 151 | + <div class="form-group"> | |
| 152 | + <label class="col-md-3 control-label">到站时间 :</label> | |
| 153 | + <div class="col-md-6"> | |
| 154 | + <input type="text" class="form-control" name="toTime" id="toTimeInput" placeholder="到站时间"> | |
| 155 | + <span class="help-block">单位:分钟</span> | |
| 156 | + </div> | |
| 157 | + </div> | |
| 158 | + </div> | |
| 159 | + <!-- 到站距离 --> | |
| 160 | + <div class="form-body"> | |
| 161 | + <div class="form-group"> | |
| 162 | + <label class="col-md-3 control-label">到站距离 :</label> | |
| 163 | + <div class="col-md-6"> | |
| 164 | + <input type="text" class="form-control" name="distances" id="distancesInput" placeholder="到站距离"> | |
| 165 | + <span class="help-block">单位:公里</span> | |
| 166 | + </div> | |
| 167 | + </div> | |
| 168 | + </div> | |
| 169 | + <!-- 版本号 --> | |
| 170 | + <div class="form-body"> | |
| 171 | + <div class="form-group"> | |
| 172 | + <label class="col-md-3 control-label">版本号 :</label> | |
| 173 | + <div class="col-md-6"> | |
| 174 | + <input type="text" class="form-control" name="versions" id='versionsInput' Readonly> | |
| 175 | + </div> | |
| 176 | + </div> | |
| 177 | + </div> | |
| 178 | + <!-- 描述/说明 --> | |
| 179 | + <div class="form-group"> | |
| 180 | + <label class="control-label col-md-3"> 描述/说明 : </label> | |
| 181 | + <div class="col-md-6"> | |
| 182 | + <textarea class="form-control" rows="3" name="descriptions" id="descriptionsTextarea" placeholder="描述/说明"></textarea> | |
| 183 | + </div> | |
| 184 | + </div> | |
| 185 | + </form> | |
| 186 | + </div> | |
| 187 | + <div class="modal-footer"> | |
| 188 | + <button type="button" class="btn default" data-dismiss="modal">取消</button> | |
| 189 | + <button type="button" class="btn btn-primary" id="editStationButton">提交数据</button> | |
| 190 | + </div> | |
| 191 | + </div> | |
| 192 | + </div> | |
| 193 | +</div> | |
| 194 | +<script type="text/javascript"> | |
| 195 | + | |
| 196 | +$('#edit_station_mobal').on('editSelectMobal_show', function(e, map_,station,fun){ | |
| 197 | + layer.closeAll(); | |
| 198 | + fun.setFormValue(station); | |
| 199 | + var initzdlyP = {'lineId':station.stationRouteLine,'destroy':0,'direction':station.stationRouteDirections}; | |
| 200 | + initSelect(initzdlyP); | |
| 201 | + // 显示mobal | |
| 202 | + $('#edit_station_mobal').modal({show : true,backdrop: 'static',keyboard: false}); | |
| 203 | + // 当调用 hide 实例方法时触发 | |
| 204 | + $('#edit_station_mobal').on('hide.bs.modal', function () { | |
| 205 | + closeMobleSetClean(); | |
| 206 | + }); | |
| 207 | + function closeMobleSetClean() { | |
| 208 | + // 清除地图覆盖物 | |
| 209 | + map_.clearMarkAndOverlays(); | |
| 210 | + // 刷新站点列表 | |
| 211 | + $('#station').click(); | |
| 212 | + } | |
| 213 | + // 编辑表单元素 | |
| 214 | + var form = $('#edit_station_form'); | |
| 215 | + // 获取错误提示元素 | |
| 216 | + var error = $('.alert-danger', form); | |
| 217 | + // 提交数据按钮事件 | |
| 218 | + $('#editStationButton').on('click', function() { | |
| 219 | + // 表单提交 | |
| 220 | + form.submit(); | |
| 221 | + }); | |
| 222 | + // 表单验证 | |
| 223 | + form.validate({ | |
| 224 | + errorElement : 'span', | |
| 225 | + errorClass : 'help-block help-block-error', | |
| 226 | + focusInvalid : false, | |
| 227 | + rules : { | |
| 228 | + 'zdmc' : { required : true,maxlength : 50,},// 站点名称 必填项 | |
| 229 | + 'stationName' : { required : true,maxlength : 50,},// 站点名称 必填项 | |
| 230 | + 'stationCod': {required : true,},// 站点编码 必填项 | |
| 231 | + 'directions' : {required : true,dirIs : true},// 站点方向 必填项 必填项 | |
| 232 | + 'stationRouteCode' : {isStart : true},// 站点序号 | |
| 233 | + 'stationMark' : {required : true},// 站点类型 必填项 | |
| 234 | + 'bJwpoints' : {required : true},// 经纬度坐标点 必填项 | |
| 235 | + 'shapesType' : {required : true},// 几何图形类型 必填项 | |
| 236 | + 'radius' : {required : true,number : true},// 圆形半径 必填项 | |
| 237 | + 'destroy' : {required : true},// 是否撤销 必填项 | |
| 238 | + 'toTime' : {number : true},// 到站时间 必须输入合法的数字(负数,小数)。 | |
| 239 | + 'distances' : {number : true},// 到站距离 必须输入合法的数字(负数,小数)。 | |
| 240 | + 'descriptions' : { maxlength: 150}// 描述与说明 最大长度 | |
| 241 | + }, | |
| 242 | + invalidHandler : function(event, validator) { | |
| 243 | + error.show(); | |
| 244 | + App.scrollTo(error, -200); | |
| 245 | + }, | |
| 246 | + highlight : function(element) { | |
| 247 | + $(element).closest('.form-group').addClass('has-error'); | |
| 248 | + }, | |
| 249 | + unhighlight : function(element) { | |
| 250 | + $(element).closest('.form-group').removeClass('has-error'); | |
| 251 | + }, | |
| 252 | + success : function(label) { | |
| 253 | + label.closest('.form-group').removeClass('has-error'); | |
| 254 | + }, | |
| 255 | + submitHandler : function(f) { | |
| 256 | + var params = form.serializeJSON(); | |
| 257 | + error.hide(); | |
| 258 | + if(params.shapesType=='圆形') | |
| 259 | + params.shapesType='r'; | |
| 260 | + else if(params.shapesType=='多边形') | |
| 261 | + params.shapesType='d'; | |
| 262 | + if(params.stationRouteCode=='请选择...') | |
| 263 | + params.stationRouteCode=''; | |
| 264 | + $post('/station/stationCacheUpdate',params,function(resuntDate) { | |
| 265 | + if(resuntDate.status=='SUCCESS') { | |
| 266 | + // 弹出添加成功提示消息 | |
| 267 | + layer.msg('修改成功...'); | |
| 268 | + /** 通知更新缓存区 */ | |
| 269 | + $.post('http://192.168.168.171:8800/transport_server/basic/refresh',function(rs){console.log(rs)}) | |
| 270 | + }else { | |
| 271 | + // 弹出添加失败提示消息 | |
| 272 | + layer.msg('修改失败...'); | |
| 273 | + } | |
| 274 | + $('#edit_station_mobal').modal('hide'); | |
| 275 | + closeMobleSetClean(); | |
| 276 | + }); | |
| 277 | + } | |
| 278 | + }); | |
| 279 | + // 站点序号值改变事件 | |
| 280 | + $('#stationrouteSelect').on('change',function() { | |
| 281 | + var stationRValue = $('#stationrouteSelect').val(); | |
| 282 | + debugger | |
| 283 | + if(stationRValue=='请选择...') { | |
| 284 | + $('#stationMarkSelect').val('B'); | |
| 285 | + }else { | |
| 286 | + var tempStr = stationRValue.split('_'); | |
| 287 | + if(tempStr[1] == 'E') { | |
| 288 | + $('#stationMarkSelect').val('E'); | |
| 289 | + }else { | |
| 290 | + $('#stationMarkSelect').val('Z'); | |
| 291 | + } | |
| 292 | + } | |
| 293 | + }); | |
| 294 | + function initSelect(p){ | |
| 295 | + $get('/stationroute/cacheList',p,function(array) { | |
| 296 | + // 定义路段路由长度、渲染拼音检索下拉框格式数据. | |
| 297 | + var len_ = array.length,paramsD = new Array(); | |
| 298 | + if(len_>0) { | |
| 299 | + paramsD.push({'id':'请选择...','text':'请选择...'}); | |
| 300 | + // 遍历. | |
| 301 | + $.each(array, function(i, g){ | |
| 302 | + // 判断. | |
| 303 | + if(g.name!='' || g.name != null) { | |
| 304 | + if(g.stationRouteCode != station.stationRouteStationRouteCode) { | |
| 305 | + // 添加拼音检索下拉框格式数据数组. | |
| 306 | + if(station.stationRouteStationMark=='E' && i == (len_-2)){ | |
| 307 | + paramsD.push({'id':g.stationRouteCode + '_' + 'E' + '_' + g.directions, | |
| 308 | + 'text':g.stationName + ' (' + g.stationRouteCode + ')' + ' --' + fun.dirdmToName(g.directions)}); | |
| 309 | + }else { | |
| 310 | + paramsD.push({'id':g.stationRouteCode + '_' + g.stationMark + '_' + g.directions, | |
| 311 | + 'text':g.stationName + ' (' + g.stationRouteCode + ')' + ' --' + fun.dirdmToName(g.directions)}); | |
| 312 | + } | |
| 313 | + } | |
| 314 | + } | |
| 315 | + }); | |
| 316 | + $('#stationrouteSelect').empty(); | |
| 317 | + // 初始化上一个路段拼音检索下拉框. | |
| 318 | + initPinYinSelect2($('#stationrouteSelect'),paramsD,function(selector) { | |
| 319 | + setZdlyValue(); | |
| 320 | + }); | |
| 321 | + } | |
| 322 | + }); | |
| 323 | + } | |
| 324 | + function setZdlyValue() { | |
| 325 | + var params = {}; | |
| 326 | + params.lineId = station.stationRouteLine; | |
| 327 | + params.direction = station.stationRouteDirections; | |
| 328 | + params.stationRouteCode = station.stationRouteStationRouteCode; | |
| 329 | + $get('/stationroute/findCacheUpStationRouteCode',params , function(str) { | |
| 330 | + debugger | |
| 331 | + if(str.length>0){ | |
| 332 | + var upStationRouteCode = str[0].stationRouteCode + '_' + str[0].stationRouteMarke + '_' + station.stationRouteDirections; | |
| 333 | + $('#stationrouteSelect').select2('val',upStationRouteCode); | |
| 334 | + }else { | |
| 335 | + $('#stationrouteSelect').select2('val','请选择...'); | |
| 336 | + } | |
| 337 | + $('#stationMarkSelect').val(station.stationRouteStationMark); | |
| 338 | + }); | |
| 339 | + } | |
| 340 | + // 当站点类型为中途站或者终点站时,上一站点为必填项! | |
| 341 | + $.validator.addMethod("isStart", function(value,element) { | |
| 342 | + var tel = false; | |
| 343 | + var stationMarkV = $('#stationMarkSelect').val(); | |
| 344 | + var stationrouteSelectV = $('#stationrouteSelect').val(); | |
| 345 | + if(stationMarkV =='B'){ | |
| 346 | + tel = true; | |
| 347 | + return tel; | |
| 348 | + }else if(stationMarkV =='Z' || stationMarkV =='E'){ | |
| 349 | + if(stationrouteSelectV!=''){ | |
| 350 | + tel = true; | |
| 351 | + return tel; | |
| 352 | + } | |
| 353 | + } | |
| 354 | + return tel; | |
| 355 | + }, '当站点类型为中途站或者终点站时,上一站点为必填项!'); | |
| 356 | + // 方向 | |
| 357 | + $.validator.addMethod("dirIs", function(value,element) { | |
| 358 | + var tel = true; | |
| 359 | + var stationMarkV = $('#stationdirSelect').val(); | |
| 360 | + if(stationMarkV!=station.stationRouteDirections){ | |
| 361 | + tel = false; | |
| 362 | + } | |
| 363 | + return tel; | |
| 364 | + }, '方向必须一致!'); | |
| 365 | +}); | |
| 366 | +</script> | |
| 0 | 367 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/base/line/editstation_select.html
0 → 100644
| 1 | +<!-- 选择编辑站点方式 --> | |
| 2 | +<div class="modal fade" id="editstation_select_mobal" tabindex="-1" role="basic" aria-hidden="true"> | |
| 3 | + <div class="modal-dialog"> | |
| 4 | + <div class="modal-content" style="width: 700px;"> | |
| 5 | + <div class="modal-header"> | |
| 6 | + <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button> | |
| 7 | + <h4 class="modal-title">选择修改站点方式 | |
| 8 | + <i class="fa fa-question-circle tipso-animation" style="color: rgba(158, 158, 158, 0.49);"></i> | |
| 9 | + </h4> | |
| 10 | + </div> | |
| 11 | + <div class="modal-body"> | |
| 12 | + <form class="form-horizontal" action="/" method="post" id="edit_select" role="form"> | |
| 13 | + <div class="alert alert-danger display-hide" id="editSelectrequired"> | |
| 14 | + <button class="close" data-close="alert"></button> | |
| 15 | + 站点名称为必填项 | |
| 16 | + </div> | |
| 17 | + <div class="alert alert-danger display-hide" id="serchrname"> | |
| 18 | + <button class="close" data-close="alert"></button> | |
| 19 | + 系统无法生成,请选择其他方式新增 | |
| 20 | + </div> | |
| 21 | + <div class="form-group" id="formRequ"> | |
| 22 | + <label class="col-md-3 control-label"><span class="required"> * </span>站点名称:</label> | |
| 23 | + <div class="col-md-9" id="errorInfo"> | |
| 24 | + <input type="text" class="form-control input-medium" id="stationNamebootbox" name="stationNamebootbox"> | |
| 25 | + </div> | |
| 26 | + </div> | |
| 27 | + <div class="form-group"> | |
| 28 | + <label class="col-md-3 control-label"><span class="required"> * </span>修改方式:</label> | |
| 29 | + <div class="col-md-9"> | |
| 30 | + <div class="icheck-list"> | |
| 31 | + <label> | |
| 32 | + <input type="radio" class="icheck" name="editselect" value=0> 重新绘制位置 | |
| 33 | + </label> | |
| 34 | + <label> | |
| 35 | + <input type="radio" class="icheck" name="editselect" value=1 checked> 编辑原始位置 | |
| 36 | + </label> | |
| 37 | + </div> | |
| 38 | + </div> | |
| 39 | + </div> | |
| 40 | + </form> | |
| 41 | + </div> | |
| 42 | + <div class="modal-footer"> | |
| 43 | + <button type="button" class="btn default" data-dismiss="modal">取消</button> | |
| 44 | + <button type="button" class="btn btn-primary" id="editselectStationNextButton">下一步</button> | |
| 45 | + </div> | |
| 46 | + </div> | |
| 47 | + </div> | |
| 48 | +</div> | |
| 49 | +<script type="text/javascript"> | |
| 50 | +$('#editstation_select_mobal').on('editStationSelectMobal_show', function(e, map_,drw,stationRoute){ | |
| 51 | +// var sel = fun.getCurrSelNode(dir_); | |
| 52 | +// var Station = sel[0].original; | |
| 53 | + // 显示选择修改方式弹出层 | |
| 54 | + $('#editstation_select_mobal').modal({show : true,backdrop: 'static',keyboard: false}); | |
| 55 | + setTimeout(function(){ | |
| 56 | + var offsetY = $('.modal-dialog').offset().top-3 , | |
| 57 | + offsetX = $('.modal-dialog').offset().left-10 ; | |
| 58 | + $('.tipso-animation').tipso({ | |
| 59 | + speed : 100, | |
| 60 | + background : '#0ed0e8', | |
| 61 | + color : '#ffffff', | |
| 62 | + position :'right', | |
| 63 | + width : 390, | |
| 64 | + delay : 400, | |
| 65 | + animationIn : 'bounceIn', | |
| 66 | + animationOut : 'bounceOut', | |
| 67 | + offsetX : -(offsetX), | |
| 68 | + offsetY : -(offsetY), | |
| 69 | + content :'<span style="display:block; float:left;font-size:x-small;line-height:10px">A)重新绘制位置:手动在地图上画出站点范围,然后双击鼠标右键保存.</span></br>'+ | |
| 70 | + '<span style="display:block; float:left;font-size:x-small">B)编辑原始位置:编辑原始位置与站点信息.</span>', | |
| 71 | + | |
| 72 | + }); | |
| 73 | + $('.tipso-animation').tipso('show'); | |
| 74 | + setTimeout(function(){$('.tipso-animation').tipso('hide');},4000); | |
| 75 | + },500); | |
| 76 | + // 获取站点名称元素并赋值 | |
| 77 | + $('#stationNamebootbox').val(stationRoute.stationStationName); | |
| 78 | + // 获取表单元素 | |
| 79 | + var form = $('#edit_select'); | |
| 80 | + // 获取错误提示元素 | |
| 81 | + var editSelectrequired = $('#editSelectrequired', form); | |
| 82 | + // 下一步操作事件 | |
| 83 | + $('#editselectStationNextButton').on('click', function() { | |
| 84 | + // 表单提交 | |
| 85 | + form.submit(); | |
| 86 | + }); | |
| 87 | + //form 表单验证 | |
| 88 | + form.validate({ | |
| 89 | + errorElement : 'span', | |
| 90 | + errorClass : 'help-block help-block-error', | |
| 91 | + focusInvalid : false, | |
| 92 | + rules : { | |
| 93 | + 'stationNamebootbox' : {required : true,maxlength : 50,} | |
| 94 | + }, | |
| 95 | + invalidHandler : function(event, validator) { | |
| 96 | + editSelectrequired.show(); | |
| 97 | + App.scrollTo(requiredname, -200); | |
| 98 | + }, | |
| 99 | + highlight : function(element) { | |
| 100 | + $(element).closest('.form-group').addClass('has-error'); | |
| 101 | + }, | |
| 102 | + unhighlight : function(element) { | |
| 103 | + $(element).closest('.form-group').removeClass('has-error'); | |
| 104 | + }, | |
| 105 | + success : function(label) { | |
| 106 | + label.closest('.form-group').removeClass('has-error'); | |
| 107 | + }, | |
| 108 | + submitHandler : function(f) { | |
| 109 | + // 隐藏弹出层 | |
| 110 | + $('#editstation_select_mobal').modal('hide'); | |
| 111 | + // 表单序列 | |
| 112 | + var params = form.serializeJSON(); | |
| 113 | + // 站点名称 | |
| 114 | + stationRoute.zdmc = params.stationNamebootbox; | |
| 115 | + | |
| 116 | + if(params.editselect==0){ | |
| 117 | + layer.confirm('重绘站点,会修改站点编码,影响已做好的排班和线路文件。请谨慎使用,谢谢!', { | |
| 118 | + btn: ['绘制','取消'] //按钮 | |
| 119 | + }, function(index){ | |
| 120 | + // 站点形状 | |
| 121 | + stationRoute.stationShapesType = 'd'; | |
| 122 | + | |
| 123 | + map_.clearMarkAndOverlays(); | |
| 124 | + // 打开绘制工具 | |
| 125 | + drw.openPointDrawingManager(stationRoute); | |
| 126 | + map_.localtionPoint(stationRoute.zdmc); | |
| 127 | + layer.close(index); | |
| 128 | + }); | |
| 129 | + }else if(params.editselect==1){ | |
| 130 | + // 弹出添加失败提示消息,2秒关闭(如果不配置,默认是3秒) | |
| 131 | + var mindex = layer.msg('编辑完图形后,请双击图形区域保存',{ offset: '126px', | |
| 132 | + shift: 0,time: 10000}); | |
| 133 | + // 编辑图形 | |
| 134 | + map_.editShapes(stationRoute); | |
| 135 | + } | |
| 136 | + } | |
| 137 | + }); | |
| 138 | +}) | |
| 139 | +</script> | |
| 0 | 140 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/base/line/js/drawingManager.js
0 → 100644
| 1 | +var DrawingManagerObj = function () { | |
| 2 | + | |
| 3 | + // 创建鼠标绘制管理类 | |
| 4 | + var drawingManager = ''; | |
| 5 | + | |
| 6 | + var draMangerObj = { | |
| 7 | + | |
| 8 | + /** 初始化绘制工具类 */ | |
| 9 | + init : function(map,styleOptions) { | |
| 10 | + | |
| 11 | + drawingManager = new BMapLib.DrawingManager(map, { | |
| 12 | + | |
| 13 | + //是否开启绘制模式 | |
| 14 | + isOpen : false, | |
| 15 | + | |
| 16 | + //是否显示工具栏 | |
| 17 | + enableDrawingTool : false, | |
| 18 | + | |
| 19 | + drawingToolOptions : { | |
| 20 | + | |
| 21 | + //位置 | |
| 22 | + anchor : BMAP_ANCHOR_TOP_RIGHT, | |
| 23 | + | |
| 24 | + //偏离值 | |
| 25 | + offset : new BMap.Size(5, 5), | |
| 26 | + | |
| 27 | + //工具栏缩放比例 | |
| 28 | + scale : 0.8 | |
| 29 | + | |
| 30 | + }, | |
| 31 | + | |
| 32 | + //线的样式 | |
| 33 | + polygonOptions : styleOptions | |
| 34 | + | |
| 35 | + }); | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + return drawingManager; | |
| 40 | + | |
| 41 | + }, | |
| 42 | + | |
| 43 | + openPointDrawingManager : function(objStation) { | |
| 44 | + | |
| 45 | + // 打开鼠标绘画工具 | |
| 46 | + drawingManager.open(); | |
| 47 | + | |
| 48 | + // 设置属性 | |
| 49 | + drawingManager.setDrawingMode(BMAP_DRAWING_POLYGON); | |
| 50 | + | |
| 51 | + // 添加绘画完成事件 | |
| 52 | + drawingManager.addEventListener('polygoncomplete', function(e) { | |
| 53 | + | |
| 54 | + drawingManager.close; | |
| 55 | + | |
| 56 | + if (e.getPath().length <= 2) { | |
| 57 | + | |
| 58 | + WorldsBMapLine.clearMarkAndOverlays(); | |
| 59 | + openPointDrawingManager(); | |
| 60 | + | |
| 61 | + // 弹出提示消息 | |
| 62 | + layer.msg('坐标点不能小于等于两个,请重新绘画!'); | |
| 63 | + | |
| 64 | + return; | |
| 65 | + | |
| 66 | + }else { | |
| 67 | + | |
| 68 | + // 获取编辑的多边形对象 | |
| 69 | + var edit_pointE = e; | |
| 70 | + | |
| 71 | + var edit_bPloygonGrid = ""; | |
| 72 | + | |
| 73 | + var editPolyGonLen_ = edit_pointE.getPath().length; | |
| 74 | + | |
| 75 | + for(var k =0;k<editPolyGonLen_;k++) { | |
| 76 | + | |
| 77 | + if(k==0) { | |
| 78 | + | |
| 79 | + edit_bPloygonGrid = edit_pointE.getPath()[k].lng + ' ' + edit_pointE.getPath()[k].lat; | |
| 80 | + | |
| 81 | + }else { | |
| 82 | + | |
| 83 | + edit_bPloygonGrid = edit_bPloygonGrid + ',' + edit_pointE.getPath()[k].lng + ' ' + edit_pointE.getPath()[k].lat; | |
| 84 | + | |
| 85 | + } | |
| 86 | + | |
| 87 | + } | |
| 88 | + | |
| 89 | + edit_bPloygonGrid = edit_bPloygonGrid + ',' + edit_pointE.getPath()[0].lng + ' ' + edit_pointE.getPath()[0].lat; | |
| 90 | + | |
| 91 | + // 多边形中心点 | |
| 92 | + var centre_points = edit_pointE.getBounds().getCenter().lng + ' ' + edit_pointE.getBounds().getCenter().lat; | |
| 93 | + | |
| 94 | + /** 设置修改站点集合对象站点中心点百度坐标属性值 @param:<bJwpoints:中心点百度坐标) */ | |
| 95 | + objStation.stationBJwpoints = centre_points; | |
| 96 | + | |
| 97 | + /** 设置修改站点集合对象范围图形类型属性值 @param:<shapesType:范围图形类型) */ | |
| 98 | + objStation.stationShapesType = 'd';; | |
| 99 | + | |
| 100 | + /** 设置修改站点集合对象圆形半径属性值 @param:<radius:圆形半径) */ | |
| 101 | + objStation.stationRadius = ''; | |
| 102 | + | |
| 103 | + /** 设置修改站点集合对象图形百度坐标集合属性值 @param:<bPolygonGrid:图形百度坐标集合) */ | |
| 104 | + objStation.stationBPolygonGrid = edit_bPloygonGrid; | |
| 105 | + | |
| 106 | + $.get('editstation.html', function(m){ | |
| 107 | + | |
| 108 | + $(pjaxContainer).append(m); | |
| 109 | + | |
| 110 | + $('#edit_station_mobal').trigger('editSelectMobal_show', [WorldsBMapLine,objStation,PublicFunctions]); | |
| 111 | + | |
| 112 | + }); | |
| 113 | + | |
| 114 | + } | |
| 115 | + | |
| 116 | + }); | |
| 117 | + | |
| 118 | + }, | |
| 119 | + | |
| 120 | + closeDrawingManager : function() { | |
| 121 | + | |
| 122 | + drawingManager.close(); | |
| 123 | + } | |
| 124 | + } | |
| 125 | + | |
| 126 | + return draMangerObj; | |
| 127 | + | |
| 128 | +}(); | |
| 0 | 129 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/base/line/js/line-list-table.js
| ... | ... | @@ -96,6 +96,12 @@ |
| 96 | 96 | }); |
| 97 | 97 | }); |
| 98 | 98 | } |
| 99 | + // 选择线路,填充线路编码搜索框 | |
| 100 | + $("#lineSelect").on("change",function(){ | |
| 101 | + var text = $('#lineSelect').val(); | |
| 102 | + var linecode = text.split("_"); | |
| 103 | + $("#lineCodeInput").val(linecode[2]); | |
| 104 | + }); | |
| 99 | 105 | |
| 100 | 106 | function gsdmTogsName(gsD,code) { |
| 101 | 107 | var rsStr = ''; | ... | ... |
src/main/resources/static/pages/base/line/js/line-list-function.js renamed to src/main/resources/static/pages/base/line/js/line-map-function.js
| ... | ... | @@ -43,7 +43,52 @@ var PublicFunctions = function () { |
| 43 | 43 | $('#destroySelect').val(Section.destroy); |
| 44 | 44 | // 描述/说明 |
| 45 | 45 | $('#descriptionsTextarea').val(Section.descriptions); |
| 46 | - }, | |
| 46 | + }, | |
| 47 | + setFormValue : function(editStationParmas) { | |
| 48 | + // 站点ID | |
| 49 | + $('#stationIdInput').val(editStationParmas.stationId); | |
| 50 | + // 站点路由ID | |
| 51 | + $('#stationRouteIdInput').val(editStationParmas.stationRouteId); | |
| 52 | + // 站点路由线路Id | |
| 53 | + $('#stationRouteLineInput').val(editStationParmas.stationRouteLine); | |
| 54 | + // 线路编码 | |
| 55 | + $('#lineCodeInput').val(editStationParmas.stationRouteLineCode); | |
| 56 | + // 百度坐标点图形集合 | |
| 57 | + $('#bPolygonGridInput').val(editStationParmas.stationBPolygonGrid); | |
| 58 | + // 获取站点名称元素设值 | |
| 59 | + $('#zdmcInput').val(editStationParmas.stationStationName); | |
| 60 | + // 获取站点路由名称元素设值 | |
| 61 | + $('#stationNameInput').val(editStationParmas.stationRouteStationName); | |
| 62 | + // 获取站点编码元素设值 | |
| 63 | + $('#stationCodInput').val(editStationParmas.stationStationCod); | |
| 64 | + // 获取站点类型元素设值 | |
| 65 | + // $('#stationMarkSelect').val(editStationParmas.stationRouteStationMark); | |
| 66 | + // 获取站点方向元素设值 | |
| 67 | + $('#stationdirSelect').val(editStationParmas.stationRouteDirections); | |
| 68 | + // 获取站点道路编码元素设值 | |
| 69 | + $('#roadCodingCodInput').val(editStationParmas.stationRoadCoding); | |
| 70 | + // 百度地图经纬度坐标中心点 | |
| 71 | + $('#bJwpointsInput').val(editStationParmas.stationBJwpoints); | |
| 72 | + if(editStationParmas.stationShapesType=='r') { | |
| 73 | + // 获取图形类型元素,并添加值 | |
| 74 | + $('#shapesTypeSelect').val('圆形'); | |
| 75 | + }else if(editStationParmas.stationShapesType=='d'){ | |
| 76 | + $('#radiusGroup').hide(); | |
| 77 | + $('#shapesTypeSelect').val('多边形'); | |
| 78 | + } | |
| 79 | + // 获取半径元素,并添加值 | |
| 80 | + $('#radiusInput').val(editStationParmas.stationRadius); | |
| 81 | + // 是否撤销 | |
| 82 | + $('#destroySelect').val(editStationParmas.stationDestroy); | |
| 83 | + // 到站时间 | |
| 84 | + $('#toTimeInput').val(editStationParmas.stationRouteToTime); | |
| 85 | + // 到站距离 | |
| 86 | + $('#distancesInput').val(editStationParmas.stationRouteDistances); | |
| 87 | + // 线路版本号 | |
| 88 | + $('#versionsInput').val(editStationParmas.stationRouteVersions); | |
| 89 | + // 描述/说明 | |
| 90 | + $('#descriptionsTextarea').val(editStationParmas.stationRouteDescriptions); | |
| 91 | + }, | |
| 47 | 92 | /** 在地图上画出线路走向 @param:<Line.id:线路Id;0:上行;data:路段数据> */ |
| 48 | 93 | linePanlThree : function(lineId,data,direction) { |
| 49 | 94 | /** 获取站点路由信息 @param:<Line.id:线路Id;0:上行> @return:<resultdata:站点路由数据> */ |
| ... | ... | @@ -94,6 +139,8 @@ var PublicFunctions = function () { |
| 94 | 139 | WorldsBMapLine.drawingUpline01(polylineArray,polyline_center,data[d]); |
| 95 | 140 | } |
| 96 | 141 | } |
| 142 | + /** 画出所有切面切点(切路段的点) */ | |
| 143 | + WorldsBMapLine.batchPaintingPoint(); | |
| 97 | 144 | }); |
| 98 | 145 | }, |
| 99 | 146 | // 方向代码转名称. |
| ... | ... | @@ -105,11 +152,22 @@ var PublicFunctions = function () { |
| 105 | 152 | srStr = '下行'; |
| 106 | 153 | return srStr; |
| 107 | 154 | }, |
| 108 | -// editAChangeCssRemoveDisabled : function() { | |
| 109 | -// $('#downLine').removeClass('btn disabled'); | |
| 110 | -// $('.btn-circle').removeClass('disabled'); | |
| 111 | -// $('#upLine').removeClass('btn disabled'); | |
| 112 | -// }, | |
| 155 | + // 图形编辑完成 | |
| 156 | + editAChangeCssRemoveDisabled : function() { | |
| 157 | + $('#section').removeClass('btn disabled'); | |
| 158 | + $('#station').removeClass('btn disabled'); | |
| 159 | + $('.btn-circle').removeClass('disabled'); | |
| 160 | + $('.radio').removeClass('disabled'); | |
| 161 | + $('.radioclass').removeClass('disabled'); | |
| 162 | + }, | |
| 163 | + // 图形编辑中 | |
| 164 | + addAChangeCssAddDisabled : function() { | |
| 165 | + $('#section').addClass('btn disabled'); | |
| 166 | + $('#station').addClass('btn disabled'); | |
| 167 | + $('.btn-circle').addClass('disabled'); | |
| 168 | + $('.radio').addClass('disabled'); | |
| 169 | + $('.radioclass').addClass('disabled'); | |
| 170 | + }, | |
| 113 | 171 | } |
| 114 | 172 | return PubFun ; |
| 115 | 173 | }(); |
| 116 | 174 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/base/line/js/line-list-map.js renamed to src/main/resources/static/pages/base/line/js/map.js
| ... | ... | @@ -223,6 +223,8 @@ var WorldsBMapLine = function () { |
| 223 | 223 | } |
| 224 | 224 | polyUpline01.enableEditing(); |
| 225 | 225 | WorldsBMapLine.setIsEditStatus(true); |
| 226 | + // 关闭按钮事件 | |
| 227 | + PublicFunctions.addAChangeCssAddDisabled(); | |
| 226 | 228 | }); |
| 227 | 229 | |
| 228 | 230 | // 添加路段双击事件 |
| ... | ... | @@ -248,6 +250,8 @@ var WorldsBMapLine = function () { |
| 248 | 250 | $(pjaxContainer).append(m); |
| 249 | 251 | $('#edit_section_mobal_cache').trigger('editSectionMobalCache_show', [WorldsBMapLine,GetAjaxData,EditSectionObj,PublicFunctions]); |
| 250 | 252 | }); |
| 253 | + // 打开按钮事件 | |
| 254 | + PublicFunctions.editAChangeCssRemoveDisabled(); | |
| 251 | 255 | }); |
| 252 | 256 | |
| 253 | 257 | // 路段右击事件 |
| ... | ... | @@ -260,6 +264,9 @@ var WorldsBMapLine = function () { |
| 260 | 264 | var lat = e.lat; |
| 261 | 265 | var sectionName = null; |
| 262 | 266 | var marker = new BMap.Marker(new BMap.Point(lng, lat)); // 创建点 |
| 267 | + var label = new BMap.Label(pointIndex+1,{offset:new BMap.Size(pointIndex>8?0:4,0)}); | |
| 268 | + label.setStyle({border :"0", color : "white",backgroundColor:"rgba(0,0,0,0)"}); | |
| 269 | + marker.setLabel(label); | |
| 263 | 270 | marker.isFlag = true; |
| 264 | 271 | if(pointIndex == 0) { |
| 265 | 272 | sectionPoint[pointIndex] = {lng:lng , lat:lat}; |
| ... | ... | @@ -319,7 +326,29 @@ var WorldsBMapLine = function () { |
| 319 | 326 | } |
| 320 | 327 | } |
| 321 | 328 | } |
| 322 | - }, | |
| 329 | + }, | |
| 330 | + // 批量画点 | |
| 331 | + batchPaintingPoint : function() { | |
| 332 | + $.each(sectionList, function(index, value) { | |
| 333 | + var section = value.section; | |
| 334 | + debugger | |
| 335 | + if(index == 0){ | |
| 336 | + var marker = new BMap.Marker(new BMap.Point(section[0].lng, section[0].lat)); // 创建点 | |
| 337 | + var label = new BMap.Label(index+1,{offset:new BMap.Size(index>8?0:4,0)}); | |
| 338 | + label.setStyle({border :"0", color : "white",backgroundColor:"rgba(0,0,0,0)"}); | |
| 339 | + marker.setLabel(label); | |
| 340 | + marker.isFlag = true; | |
| 341 | + mapBValue.addOverlay(marker);// 添加覆盖物 | |
| 342 | + } | |
| 343 | + var marker = new BMap.Marker(new BMap.Point(section[1].lng, section[1].lat)); // 创建点 | |
| 344 | + var label = new BMap.Label(index+2,{offset:new BMap.Size(index>7?0:4,0)}); | |
| 345 | + label.setStyle({border :"0", color : "white",backgroundColor:"rgba(0,0,0,0)"}); | |
| 346 | + marker.setLabel(label); | |
| 347 | + marker.isFlag = true; | |
| 348 | + mapBValue.addOverlay(marker);// 添加覆盖物 | |
| 349 | + }); | |
| 350 | + | |
| 351 | + }, | |
| 323 | 352 | /** 在地图上画点 @param:<point_center:中心坐标点> */ |
| 324 | 353 | drawingUpStationPoint : function(point_center,stationName,s) { |
| 325 | 354 | |
| ... | ... | @@ -379,6 +408,531 @@ var WorldsBMapLine = function () { |
| 379 | 408 | } |
| 380 | 409 | })() |
| 381 | 410 | }, |
| 411 | + // 地图画多边形 | |
| 412 | + pointsPolygon : function(objStation) { | |
| 413 | + | |
| 414 | + // 将视图切换到指定的缩放等级,中心点坐标不变。注意:当有信息窗口在地图上打开时,地图缩放将保证信息窗口所在的坐标位置不动。(自1.2新增) | |
| 415 | + mapBValue.setZoom(15); | |
| 416 | + | |
| 417 | + // 如果不为空 | |
| 418 | + if(objStation) { | |
| 419 | + | |
| 420 | + // 清除地图覆盖物 | |
| 421 | + mapBValue.clearOverlays(); | |
| 422 | + | |
| 423 | + // 获取中心点坐标字符串 | |
| 424 | + var testpointStr = objStation.stationBJwpoints; | |
| 425 | + | |
| 426 | + // 按空格切割中心点坐标字符串 | |
| 427 | + var BJwpointsPolygon = testpointStr.split(' '); | |
| 428 | + | |
| 429 | + // 中心点坐标 | |
| 430 | + var pointPolygon = new BMap.Point(BJwpointsPolygon[0], BJwpointsPolygon[1]); | |
| 431 | + | |
| 432 | + // 获取多边形坐标字符串 | |
| 433 | + var stationBPolygonGrid = objStation.stationBPolygonGrid; | |
| 434 | + | |
| 435 | + // 截取多边形坐标字符串 | |
| 436 | + var stationBPolygonGridStr = stationBPolygonGrid.substring(9,stationBPolygonGrid.length-2); | |
| 437 | + | |
| 438 | + // 按逗号切割 | |
| 439 | + var pointPolygonArray = stationBPolygonGridStr.split(','); | |
| 440 | + | |
| 441 | + // 多边形坐标集合 | |
| 442 | + var polygonP = []; | |
| 443 | + | |
| 444 | + for(var v = 0;v<pointPolygonArray.length;v++) { | |
| 445 | + | |
| 446 | + polygonP.push(new BMap.Point(pointPolygonArray[v].split(" ")[0],pointPolygonArray[v].split(" ")[1])); | |
| 447 | + | |
| 448 | + } | |
| 449 | + | |
| 450 | + // 画多边形 | |
| 451 | + polygon = new BMap.Polygon(polygonP, { | |
| 452 | + | |
| 453 | + // 线条显色 | |
| 454 | + strokeColor : "blue", | |
| 455 | + | |
| 456 | + // 边线的宽度,以像素为单位。 | |
| 457 | + strokeWeight : 2, | |
| 458 | + | |
| 459 | + // 边线透明度,取值范围0 - 1。 | |
| 460 | + strokeOpacity : 0.5 | |
| 461 | + }); | |
| 462 | + | |
| 463 | + // 增加地图覆盖物多边形 | |
| 464 | + mapBValue.addOverlay(polygon); | |
| 465 | + | |
| 466 | + // 信息窗口属性 | |
| 467 | + var opts_polygon = { | |
| 468 | + | |
| 469 | + // 信息窗口宽度 | |
| 470 | + width : 200, | |
| 471 | + | |
| 472 | + // 信息窗口高度 | |
| 473 | + height : 400, | |
| 474 | + | |
| 475 | + // 信息窗位置偏移值。 | |
| 476 | + offset: new BMap.Size(500,20), | |
| 477 | + | |
| 478 | + //标题 | |
| 479 | + title : '<h4 style="color:#FFFFFF">'+objStation.stationStationName+'站详情</h4>', | |
| 480 | + | |
| 481 | + //设置不允许信窗发送短息 | |
| 482 | + enableMessage : false, | |
| 483 | + | |
| 484 | + //是否开启点击地图关闭信息窗口 | |
| 485 | + enableCloseOnClick : false | |
| 486 | + }; | |
| 487 | + | |
| 488 | + var markTypeStr = ''; | |
| 489 | + | |
| 490 | + if(objStation.stationRouteStationMark=='B') { | |
| 491 | + | |
| 492 | + markTypeStr='起点站'; | |
| 493 | + | |
| 494 | + }else if(objStation.stationRouteStationMark=='Z') { | |
| 495 | + | |
| 496 | + markTypeStr ='中途站'; | |
| 497 | + | |
| 498 | + | |
| 499 | + }else if(objStation.stationRouteStationMark=='E') { | |
| 500 | + | |
| 501 | + markTypeStr='终点站'; | |
| 502 | + | |
| 503 | + } | |
| 504 | + | |
| 505 | + var htm = '<HR style="border:1 dashed #987cb9" width="100%" color=#987cb9 SIZE=1>'+ | |
| 506 | + '<span style="color:#DDD;font-size: 15px;">站点名称:' + objStation.stationStationName + '</span>' + | |
| 507 | + '<span class="help-block" style="color:#DDD;font-size: 15px;">站点编码:' + objStation.stationStationCod + '</span>' + | |
| 508 | + '<span class="help-block" style="color:#DDD;font-size: 15px;">站点序号:' + objStation.stationRouteStationRouteCode + '</span>' + | |
| 509 | + '<span class="help-block" style="color:#DDD;font-size: 15px;">站点类型:' + markTypeStr + '</span>' + | |
| 510 | + '<span class="help-block" style="color:#DDD;font-size: 15px;">纬度坐标:' + objStation.stationBJwpoints + '</span>' + | |
| 511 | + '<span class="help-block" style="color:#DDD;font-size: 15px;">到站时间:' + objStation.stationRouteToTime + ' 分钟</span>' + | |
| 512 | + '<span class="help-block" style="color:#DDD;font-size: 15px;">到站距离:' + objStation.stationRouteDistances + ' 公里</span>' + | |
| 513 | + '<span class="help-block" style="color:#DDD;font-size: 15px;">范围半径:' + objStation.stationRadius + '</span>' + | |
| 514 | + '<span class="help-block" style="color:#DDD;font-size: 15px;">版本号  :' + objStation.stationRouteVersions + '</span>' + | |
| 515 | + '<span class="help-block" style="width: 100%;font-size: 15px;;color:#DDD;'+ | |
| 516 | + 'overflow: hidden; white-space: nowrap; text-overflow: ellipsis; " title="'+ | |
| 517 | + objStation.stationRouteDescriptions +'" >说明/描述:' + objStation.stationRouteDescriptions + '</span>' ; | |
| 518 | + | |
| 519 | + // 创建信息窗口 | |
| 520 | + var infoWindow_target = new BMap.InfoWindow(htm, opts_polygon); | |
| 521 | + // 自定义标注物图片 | |
| 522 | + var icon_target = new BMap.Icon('/pages/base/stationroute/css/img/cz.png',new BMap.Size(20, 20)); | |
| 523 | + | |
| 524 | + // 创建点 | |
| 525 | + marker = new BMap.Marker(pointPolygon,{icon : icon_target}); | |
| 526 | + | |
| 527 | + // 把标注添物加到地图上 | |
| 528 | + mapBValue.addOverlay(marker); | |
| 529 | + | |
| 530 | + // 是否在平移过程中禁止动画。(自1.2新增) | |
| 531 | + var PanOptions_ ={noAnimation :true}; | |
| 532 | + | |
| 533 | + // 将地图的中心点更改为给定的点。 | |
| 534 | + mapBValue.panTo(pointPolygon,PanOptions_); | |
| 535 | + | |
| 536 | + // 将地图在水平位置上移动x像素,垂直位置上移动y像素。 | |
| 537 | + mapBValue.panBy(10,-150,PanOptions_); | |
| 538 | + | |
| 539 | + //开启信息窗口 | |
| 540 | + mapBValue.openInfoWindow(infoWindow_target,pointPolygon); | |
| 541 | + | |
| 542 | + } | |
| 543 | + | |
| 544 | + }, | |
| 545 | + | |
| 546 | + // 画圆 | |
| 547 | + pointsCircle : function(objStation) { | |
| 548 | + | |
| 549 | + // 将视图切换到指定的缩放等级,中心点坐标不变。注意:当有信息窗口在地图上打开时,地图缩放将保证信息窗口所在的坐标位置不动。(自1.2新增) | |
| 550 | + mapBValue.setZoom(16); | |
| 551 | + | |
| 552 | + if(objStation) { | |
| 553 | + | |
| 554 | + // 清除地图覆盖物 | |
| 555 | + mapBValue.clearOverlays(); | |
| 556 | + | |
| 557 | + // 获取中心坐标点字符串分割 | |
| 558 | + var BJwpoints = objStation.stationBJwpoints.split(' '); | |
| 559 | + | |
| 560 | + // 中心坐标点 | |
| 561 | + var point = new BMap.Point(BJwpoints[0], BJwpoints[1]); | |
| 562 | + | |
| 563 | + //创建圆 | |
| 564 | + circle = new BMap.Circle(point,objStation.stationRadius,{strokeColor:"blue", strokeWeight:2, strokeOpacity:0.5}); | |
| 565 | + | |
| 566 | + // 允许覆盖物在map.clearOverlays方法中被清除 | |
| 567 | + circle.enableMassClear(); | |
| 568 | + | |
| 569 | + // 百度地图添加覆盖物圆 | |
| 570 | + mapBValue.addOverlay(circle); | |
| 571 | + | |
| 572 | + // 信息窗口参数属性 | |
| 573 | + var opts = { | |
| 574 | + | |
| 575 | + // 信息窗口宽度 | |
| 576 | + width : 200, | |
| 577 | + | |
| 578 | + // 信息窗口高度 | |
| 579 | + height : 450, | |
| 580 | + | |
| 581 | + // 信息窗位置偏移值。 | |
| 582 | + offset: new BMap.Size(500,120), | |
| 583 | + | |
| 584 | + //标题 | |
| 585 | + title : '<h4 style="color:#FFFFFF">'+objStation.stationStationName+'站详情</h4>', | |
| 586 | + | |
| 587 | + //设置不允许信窗发送短息 | |
| 588 | + enableMessage : false, | |
| 589 | + | |
| 590 | + //是否开启点击地图关闭信息窗口 | |
| 591 | + enableCloseOnClick : false, | |
| 592 | + | |
| 593 | + // 是否开启信息窗口打开时地图自动移动(默认开启)。(自 1.1 新增) | |
| 594 | + enableAutoPan:false | |
| 595 | + }; | |
| 596 | + | |
| 597 | + var markTypeStr = ''; | |
| 598 | + | |
| 599 | + if(objStation.stationRouteStationMark=='B') { | |
| 600 | + | |
| 601 | + markTypeStr='起点站'; | |
| 602 | + | |
| 603 | + }else if(objStation.stationRouteStationMark=='Z') { | |
| 604 | + | |
| 605 | + markTypeStr ='中途站'; | |
| 606 | + | |
| 607 | + | |
| 608 | + }else if(objStation.stationRouteStationMark=='E') { | |
| 609 | + | |
| 610 | + markTypeStr='终点站'; | |
| 611 | + | |
| 612 | + } | |
| 613 | + | |
| 614 | + var htm = '<HR style="border:1 dashed #987cb9" width="100%" color=#987cb9 SIZE=1>'+ | |
| 615 | + '<span style="color:#DDD;font-size: 15px;">站点名称:' + objStation.stationStationName + '</span>' + | |
| 616 | + '<span class="help-block" style="color:#DDD;font-size: 15px;">站点编码:' + objStation.stationStationCod + '</span>' + | |
| 617 | + '<span class="help-block" style="color:#DDD;font-size: 15px;">站点序号:' + objStation.stationRouteStationRouteCode + '</span>' + | |
| 618 | + '<span class="help-block" style="color:#DDD;font-size: 15px;">站点类型:' + markTypeStr + '</span>' + | |
| 619 | + '<span class="help-block" style="color:#DDD;font-size: 15px;">纬度坐标:' + objStation.stationBJwpoints + '</span>' + | |
| 620 | + '<span class="help-block" style="color:#DDD;font-size: 15px;">到站时间:' + objStation.stationRouteToTime + ' 分钟</span>' + | |
| 621 | + '<span class="help-block" style="color:#DDD;font-size: 15px;">到站距离:' + objStation.stationRouteDistances + ' 公里</span>' + | |
| 622 | + '<span class="help-block" style="color:#DDD;font-size: 15px;">范围半径:' + objStation.stationRadius + '</span>' + | |
| 623 | + '<span class="help-block" style="color:#DDD;font-size: 15px;">版本号  :' + objStation.stationRouteVersions + '</span>' + | |
| 624 | + '<span class="help-block" style="width: 100%;font-size: 15px;;color:#DDD;'+ | |
| 625 | + 'overflow: hidden; white-space: nowrap; text-overflow: ellipsis; " title="'+ | |
| 626 | + objStation.stationRouteDescriptions +'" >说明/描述:' + objStation.stationRouteDescriptions + '</span>' ; | |
| 627 | + | |
| 628 | + // 创建信息窗口 | |
| 629 | + var infoWindow_target = new BMap.InfoWindow(htm, opts); | |
| 630 | + // 自定义标注物图片 | |
| 631 | + var icon_target = new BMap.Icon('/pages/base/stationroute/css/img/cz.png',new BMap.Size(20, 20)); | |
| 632 | + | |
| 633 | + // 创建点 | |
| 634 | + marker = new BMap.Marker(point,{icon : icon_target}); | |
| 635 | + | |
| 636 | + // 把标注添物加到地图上 | |
| 637 | + mapBValue.addOverlay(marker); | |
| 638 | + | |
| 639 | + setTimeout(function(){ | |
| 640 | + //开启信息窗口 | |
| 641 | + marker.openInfoWindow(infoWindow_target,point); | |
| 642 | + | |
| 643 | + },100); | |
| 644 | + | |
| 645 | + // 是否在平移过程中禁止动画。(自1.2新增) | |
| 646 | + var PanOptions_ ={noAnimation :true}; | |
| 647 | + | |
| 648 | + // 将地图的中心点更改为给定的点。 | |
| 649 | + mapBValue.panTo(point,PanOptions_); | |
| 650 | + | |
| 651 | + mapBValue.panBy(10,-200,PanOptions_); | |
| 652 | + | |
| 653 | + // 添加标志物监听事件 | |
| 654 | + marker.addEventListener("click",function() { | |
| 655 | + | |
| 656 | + //开启信息窗口 | |
| 657 | + marker.openInfoWindow(infoWindow_target,point); | |
| 658 | + | |
| 659 | + }); | |
| 660 | + | |
| 661 | + } | |
| 662 | + | |
| 663 | + }, | |
| 664 | + // 编辑图形 | |
| 665 | + editShapes : function(objStation) { | |
| 666 | + | |
| 667 | + // 清空地图 | |
| 668 | + WorldsBMapLine.clearMarkAndOverlays(); | |
| 669 | + | |
| 670 | + // 站点对象不为空 | |
| 671 | + if(objStation) { | |
| 672 | + var stationShapesType = objStation.stationShapesType; | |
| 673 | + | |
| 674 | + // 将视图切换到指定的缩放等级,中心点坐标不变。注意:当有信息窗口在地图上打开时,地图缩放将保证信息窗口所在的坐标位置不动。(自1.2新增) | |
| 675 | + mapBValue.setZoom(16); | |
| 676 | + | |
| 677 | + // 编辑圆 | |
| 678 | + if(stationShapesType =='r') { | |
| 679 | + | |
| 680 | + // 获取中心坐标点字符串分割 | |
| 681 | + var BJwpoints = objStation.stationBJwpoints.split(' '); | |
| 682 | + | |
| 683 | + // 中心坐标点 | |
| 684 | + var point = new BMap.Point(BJwpoints[0], BJwpoints[1]); | |
| 685 | + | |
| 686 | + //创建圆 | |
| 687 | + circle = new BMap.Circle(point,objStation.stationRadius,{strokeColor:"blue", strokeWeight:2, strokeOpacity:0.5}); | |
| 688 | + | |
| 689 | + // 允许覆盖物在map.clearOverlays方法中被清除 | |
| 690 | + circle.enableMassClear(); | |
| 691 | + | |
| 692 | + // 百度地图添加覆盖物圆 | |
| 693 | + mapBValue.addOverlay(circle); | |
| 694 | + | |
| 695 | + // 开启编辑功能 | |
| 696 | + circle.enableEditing(); | |
| 697 | + | |
| 698 | + // 是否在平移过程中禁止动画。(自1.2新增) | |
| 699 | + var PanOptions_ ={noAnimation :true}; | |
| 700 | + | |
| 701 | + // 将地图的中心点更改为给定的点。 | |
| 702 | + mapBValue.panTo(point,PanOptions_); | |
| 703 | + | |
| 704 | + mapBValue.panBy(10,-200,PanOptions_); | |
| 705 | + | |
| 706 | + // 关闭按钮事件 | |
| 707 | + debugger | |
| 708 | + PublicFunctions.addAChangeCssAddDisabled(); | |
| 709 | + | |
| 710 | + // 编辑圆监听事件 | |
| 711 | + circle.addEventListener('dblclick',function() { | |
| 712 | + | |
| 713 | + // 返回圆形的半径,单位为米。 | |
| 714 | + var newRadius = circle.getRadius(); | |
| 715 | + | |
| 716 | + // 返回圆形的中心点坐标。 | |
| 717 | + var newCenter = circle.getCenter().lng + ' ' + circle.getCenter().lat; | |
| 718 | + | |
| 719 | + /** 设置修改站点集合对象站点中心点百度坐标属性值 @param:<bJwpoints:中心点百度坐标) */ | |
| 720 | + objStation.stationBJwpoints = newCenter; | |
| 721 | + | |
| 722 | + /** 设置修改站点集合对象范围图形类型属性值 @param:<shapesType:范围图形类型) */ | |
| 723 | +// objStation.stationBJwpoints = 'r'; | |
| 724 | + | |
| 725 | + /** 设置修改站点集合对象圆形半径属性值 @param:<radius:圆形半径) */ | |
| 726 | + objStation.stationRadius = Math.round(newRadius); | |
| 727 | + | |
| 728 | + /** 设置修改站点集合对象图形百度坐标集合属性值 @param:<bPolygonGrid:图形百度坐标集合) */ | |
| 729 | + objStation.stationBPolygonGrid = ''; | |
| 730 | + | |
| 731 | + // 加载编辑页面 | |
| 732 | + $.get('editstation.html', function(m){ | |
| 733 | + | |
| 734 | + $(pjaxContainer).append(m); | |
| 735 | + | |
| 736 | + $('#edit_station_mobal').trigger('editSelectMobal_show', [WorldsBMapLine,objStation,PublicFunctions]); | |
| 737 | + | |
| 738 | + }); | |
| 739 | + | |
| 740 | + // 打开按钮事件 | |
| 741 | + PublicFunctions.editAChangeCssRemoveDisabled(); | |
| 742 | + }); | |
| 743 | + | |
| 744 | + // 编辑多变行 | |
| 745 | + }else if(stationShapesType =='d') { | |
| 746 | + | |
| 747 | + // 清除地图覆盖物 | |
| 748 | + mapBValue.clearOverlays(); | |
| 749 | + | |
| 750 | + // 获取中心点坐标字符串 | |
| 751 | + var testpointStr = objStation.stationBJwpoints; | |
| 752 | + | |
| 753 | + // 按空格切割中心点坐标字符串 | |
| 754 | + var BJwpointsPolygon = testpointStr.split(' '); | |
| 755 | + | |
| 756 | + // 中心点坐标 | |
| 757 | + var pointPolygon = new BMap.Point(BJwpointsPolygon[0], BJwpointsPolygon[1]); | |
| 758 | + | |
| 759 | + // 获取多边形坐标字符串 | |
| 760 | + var stationBPolygonGrid = objStation.stationBPolygonGrid; | |
| 761 | + | |
| 762 | + // 截取多边形坐标字符串 | |
| 763 | + var stationBPolygonGridStr = stationBPolygonGrid.substring(9,stationBPolygonGrid.length-2); | |
| 764 | + | |
| 765 | + // 按逗号切割 | |
| 766 | + var pointPolygonArray = stationBPolygonGridStr.split(','); | |
| 767 | + | |
| 768 | + // 多边形坐标集合 | |
| 769 | + var polygonP = []; | |
| 770 | + | |
| 771 | + for(var v = 0;v<pointPolygonArray.length;v++) { | |
| 772 | + | |
| 773 | + polygonP.push(new BMap.Point(pointPolygonArray[v].split(" ")[0],pointPolygonArray[v].split(" ")[1])); | |
| 774 | + | |
| 775 | + } | |
| 776 | + | |
| 777 | + // 画多边形 | |
| 778 | + polygon = new BMap.Polygon(polygonP, { | |
| 779 | + | |
| 780 | + // 线条显色 | |
| 781 | + strokeColor : "blue", | |
| 782 | + | |
| 783 | + // 边线的宽度,以像素为单位。 | |
| 784 | + strokeWeight : 2, | |
| 785 | + | |
| 786 | + // 边线透明度,取值范围0 - 1。 | |
| 787 | + strokeOpacity : 0.5 | |
| 788 | + }); | |
| 789 | + | |
| 790 | + // 增加地图覆盖物多边形 | |
| 791 | + mapBValue.addOverlay(polygon); | |
| 792 | + | |
| 793 | + // 开启编辑功能(自 1.1 新增) | |
| 794 | + polygon.enableEditing(); | |
| 795 | + | |
| 796 | + // 是否在平移过程中禁止动画。(自1.2新增) | |
| 797 | + var PanOptions_ ={noAnimation :true}; | |
| 798 | + | |
| 799 | + // 将地图的中心点更改为给定的点。 | |
| 800 | + mapBValue.panTo(pointPolygon,PanOptions_); | |
| 801 | + | |
| 802 | + // 将地图在水平位置上移动x像素,垂直位置上移动y像素。 | |
| 803 | + mapBValue.panBy(10,-150,PanOptions_); | |
| 804 | + | |
| 805 | + // 关闭按钮事件(图形编辑中) | |
| 806 | + PublicFunctions.addAChangeCssAddDisabled(); | |
| 807 | + | |
| 808 | + // 添加多变行编辑事件 | |
| 809 | + polygon.addEventListener('dblclick',function(e) { | |
| 810 | + | |
| 811 | + // 获取编辑的多边形对象 | |
| 812 | + var edit_pointE = polygon; | |
| 813 | + | |
| 814 | + var edit_bPloygonGrid = ""; | |
| 815 | + | |
| 816 | + var editPolyGonLen_ = edit_pointE.getPath().length; | |
| 817 | + | |
| 818 | + for(var k =0;k<editPolyGonLen_;k++) { | |
| 819 | + | |
| 820 | + if(k==0) { | |
| 821 | + | |
| 822 | + edit_bPloygonGrid = edit_pointE.getPath()[k].lng + ' ' + edit_pointE.getPath()[k].lat; | |
| 823 | + | |
| 824 | + }else { | |
| 825 | + | |
| 826 | + edit_bPloygonGrid = edit_bPloygonGrid + ',' + edit_pointE.getPath()[k].lng + ' ' + edit_pointE.getPath()[k].lat; | |
| 827 | + | |
| 828 | + } | |
| 829 | + | |
| 830 | + } | |
| 831 | + | |
| 832 | + edit_bPloygonGrid = edit_bPloygonGrid + ',' + edit_pointE.getPath()[0].lng + ' ' + edit_pointE.getPath()[0].lat; | |
| 833 | + | |
| 834 | + // 多边形中心点 | |
| 835 | + var centre_points = edit_pointE.getBounds().getCenter().lng + ' ' + edit_pointE.getBounds().getCenter().lat; | |
| 836 | + | |
| 837 | + /** 设置修改站点集合对象站点中心点百度坐标属性值 @param:<bJwpoints:中心点百度坐标) */ | |
| 838 | + objStation.stationBJwpoints = centre_points; | |
| 839 | + | |
| 840 | + /** 设置修改站点集合对象范围图形类型属性值 @param:<shapesType:范围图形类型) */ | |
| 841 | + objStation.stationShapesType = 'd';; | |
| 842 | + | |
| 843 | + /** 设置修改站点集合对象圆形半径属性值 @param:<radius:圆形半径) */ | |
| 844 | + objStation.stationRadius = ''; | |
| 845 | + | |
| 846 | + /** 设置修改站点集合对象图形百度坐标集合属性值 @param:<bPolygonGrid:图形百度坐标集合) */ | |
| 847 | + objStation.stationBPolygonGrid = edit_bPloygonGrid; | |
| 848 | + | |
| 849 | + $.get('editstation.html', function(m){ | |
| 850 | + | |
| 851 | + $(pjaxContainer).append(m); | |
| 852 | + | |
| 853 | + $('#edit_station_mobal').trigger('editSelectMobal_show', [WorldsBMapLine,objStation,PublicFunctions]); | |
| 854 | + | |
| 855 | + }); | |
| 856 | + | |
| 857 | + }); | |
| 858 | + | |
| 859 | + // 打开按钮事件 | |
| 860 | + PublicFunctions.editAChangeCssRemoveDisabled(); | |
| 861 | + } | |
| 862 | + } | |
| 863 | + }, | |
| 864 | + | |
| 865 | + localtionPoint : function(stationNameV) { | |
| 866 | + | |
| 867 | + WorldsBMapLine.localSearchFromAdreesToPoint(stationNameV,function(Points) { | |
| 868 | + | |
| 869 | + if(Points) { | |
| 870 | + | |
| 871 | + var BJwpointsArray = Points.split(' '); | |
| 872 | + | |
| 873 | + var stationNameChangePoint = new BMap.Point(BJwpointsArray[0], BJwpointsArray[1]); | |
| 874 | + | |
| 875 | + var marker_stargt2 = new BMap.Marker(stationNameChangePoint); | |
| 876 | + | |
| 877 | + var PanOptions ={noAnimation :true}; | |
| 878 | + | |
| 879 | + mapBValue.panTo(stationNameChangePoint,PanOptions); | |
| 880 | + | |
| 881 | + mapBValue.panBy(0,-100); | |
| 882 | + | |
| 883 | + // 将标注添加到地图中 | |
| 884 | + mapBValue.addOverlay(marker_stargt2); | |
| 885 | + | |
| 886 | + //跳动的动画 | |
| 887 | + marker_stargt2.setAnimation(BMAP_ANIMATION_BOUNCE); | |
| 888 | + | |
| 889 | + } | |
| 890 | + | |
| 891 | + }); | |
| 892 | + | |
| 893 | + }, | |
| 894 | + | |
| 895 | + // 根据地理名称获取百度经纬度坐标 | |
| 896 | + localSearchFromAdreesToPoint: function(Address,callback) { | |
| 897 | + | |
| 898 | + // 创建一个搜索类实例 | |
| 899 | + var localSearch = new BMap.LocalSearch(mapBValue); | |
| 900 | + | |
| 901 | + // 检索完成后的回调函数。 | |
| 902 | + localSearch.setSearchCompleteCallback(function (searchResult) { | |
| 903 | + | |
| 904 | + var resultPoints = ''; | |
| 905 | + | |
| 906 | + if(searchResult) { | |
| 907 | + | |
| 908 | + // 返回索引指定的结果。索引0表示第1条结果 | |
| 909 | + var poi = searchResult.getPoi(0); | |
| 910 | + | |
| 911 | + if(poi) { | |
| 912 | + | |
| 913 | + //获取经度和纬度 | |
| 914 | + resultPoints = poi.point.lng + ' ' + poi.point.lat; | |
| 915 | + | |
| 916 | + callback && callback(resultPoints); | |
| 917 | + | |
| 918 | + }else { | |
| 919 | + | |
| 920 | + callback && callback(false); | |
| 921 | + | |
| 922 | + } | |
| 923 | + | |
| 924 | + }else { | |
| 925 | + | |
| 926 | + callback && callback(false); | |
| 927 | + } | |
| 928 | + | |
| 929 | + }); | |
| 930 | + | |
| 931 | + // 根据检索词发起检索。 | |
| 932 | + localSearch.search(Address); | |
| 933 | + | |
| 934 | + }, | |
| 935 | + | |
| 382 | 936 | clearMarkAndOverlays : function() { |
| 383 | 937 | |
| 384 | 938 | // 清楚地图覆盖物 | ... | ... |
src/main/resources/static/pages/base/line/list.html
| ... | ... | @@ -81,7 +81,7 @@ |
| 81 | 81 | <td>#</td> |
| 82 | 82 | <td>#</td> |
| 83 | 83 | <td> |
| 84 | - <input type="text" class="form-control form-filter input-sm" name="lineCode_eq"> | |
| 84 | + <input type="text" class="form-control form-filter input-sm" name="lineCode_eq" id="lineCodeInput"> | |
| 85 | 85 | </td> |
| 86 | 86 | <td> |
| 87 | 87 | <select name="name_like" class="form-control" style="width:100%" id="lineSelect"></select> | ... | ... |
src/main/resources/static/pages/base/line/map.html
| 1 | -< | |
| 2 | 1 | <link href="/pages/base/line/css/bmap_base.css" rel="stylesheet" |
| 3 | 2 | type="text/css" /> |
| 4 | 3 | <div class="portlet-body"> |
| ... | ... | @@ -16,31 +15,53 @@ |
| 16 | 15 | </button> |
| 17 | 16 | </div> |
| 18 | 17 | <div class="portlet-body hidden" id="upload_show"> |
| 19 | - <div class="defeat-scroll" | |
| 20 | - style="height: auto; max-height: 600px; overflow-y: auto; border-left: 10px;"> | |
| 21 | - <table class="table table-bordered table-hover table-checkable " | |
| 22 | - id="section_table" style="color: #B7B7B7;"> | |
| 23 | - <thead> | |
| 24 | - <tr role="row" class="heading"> | |
| 25 | - <th>截取路段</th> | |
| 26 | - </tr> | |
| 27 | - </thead> | |
| 28 | - <tbody></tbody> | |
| 29 | - </table> | |
| 18 | + <div> | |
| 19 | + <ul class="nav nav-pills nav-justified steps"> | |
| 20 | + <li class="active"> | |
| 21 | + <a id="section"><span>路段</span></a> | |
| 22 | + </li> | |
| 23 | + <li> | |
| 24 | + <a id="station"><span>站点</span></a> | |
| 25 | + </li> | |
| 26 | + </ul> | |
| 30 | 27 | </div> |
| 31 | - <div class="table-toolbar" style="text-align: center;"> | |
| 32 | - <button class="btn btn-circle blue" id="cutSection">提交选项</button> | |
| 33 | - <button class="btn btn-circle blue" id="Undo">撤销切点</button> | |
| 28 | + <div id="section_list_div" class="active" style="margin: 5px;"> | |
| 29 | + <div class="defeat-scroll" | |
| 30 | + style="height: 400px; overflow-y: auto; "> | |
| 31 | + <table class="table table-bordered table-hover table-checkable " | |
| 32 | + id="section_table" style="color: white;"> | |
| 33 | + <thead> | |
| 34 | + <tr role="row" class="heading"> | |
| 35 | + <th>截取路段的名称</th> | |
| 36 | + </tr> | |
| 37 | + </thead> | |
| 38 | + <tbody></tbody> | |
| 39 | + </table> | |
| 40 | + </div> | |
| 41 | + <div class="table-toolbar"> | |
| 42 | + <a class="btn btn-circle blue" id="Undo">撤销切点</a> | |
| 43 | + <a class="btn btn-circle blue" id="cutSection">提交选项</a> | |
| 44 | + </div> | |
| 45 | + </div> | |
| 46 | + <div id="station_list_div" class="hidden"> | |
| 47 | + <div class="defeat-scroll" | |
| 48 | + style="height: 400px; overflow-y: auto; "> | |
| 49 | + </div> | |
| 50 | + <div class="table-toolbar"> | |
| 51 | + <a class="btn btn-circle blue" id="findStation">查看站点</a> | |
| 52 | + <a class="btn btn-circle blue" id="updateStation">修改站点</a> | |
| 53 | + </div> | |
| 34 | 54 | </div> |
| 35 | 55 | </div> |
| 36 | 56 | </div> |
| 37 | 57 | </div> |
| 38 | 58 | </div> |
| 59 | +<!-- 右侧悬浮框截取路段List --> | |
| 39 | 60 | <script type="text/html" id="section_list"> |
| 40 | 61 | {{each list as obj i }} |
| 41 | 62 | <tr> |
| 42 | 63 | <td style="vertical-align: middle;"> |
| 43 | - {{obj.name}}:[{{obj.section[0].lng}},{{obj.section[0].lat}}],[{{obj.section[1].lng}},{{obj.section[1].lat}}] | |
| 64 | + {{obj.name}} | |
| 44 | 65 | </td> |
| 45 | 66 | {{/each}} |
| 46 | 67 | {{if list.length == 0}} |
| ... | ... | @@ -50,7 +71,6 @@ |
| 50 | 71 | {{/if}} |
| 51 | 72 | </script> |
| 52 | 73 | <!--上传GPS坐标生成路线监听事件 --> |
| 53 | -< | |
| 54 | 74 | <script type="text/javascript"> |
| 55 | 75 | $(function(){ |
| 56 | 76 | // 关闭左侧栏 |
| ... | ... | @@ -59,6 +79,8 @@ $(function(){ |
| 59 | 79 | var id = $.url().param('no'); |
| 60 | 80 | // 方向 (0:上行;1:下行)默认上行 |
| 61 | 81 | var direction = 0; |
| 82 | + // 站点Map | |
| 83 | + var stationRouteMap = new Map(); | |
| 62 | 84 | // 如果线路ID不为空 |
| 63 | 85 | if(id) { |
| 64 | 86 | var styleOptions = { |
| ... | ... | @@ -80,7 +102,7 @@ $(function(){ |
| 80 | 102 | var map_ = WorldsBMapLine.init(); |
| 81 | 103 | |
| 82 | 104 | /** 初始化绘图工具类 @param:<map_:map对象;styleOptions:绘图样式对象> @return:DrawingManager对象 */ |
| 83 | - DrawingManagerObj.init(map_,styleOptions); | |
| 105 | +// DrawingManagerObj.init(map_,styleOptions); | |
| 84 | 106 | |
| 85 | 107 | layer.msg('请生成路线!!!'); |
| 86 | 108 | |
| ... | ... | @@ -125,27 +147,6 @@ $(function(){ |
| 125 | 147 | $(pjaxContainer).append(m); |
| 126 | 148 | $('#submit_select_mobal').trigger('submitSelectMobal.show',[section,EditRoute]); |
| 127 | 149 | }); |
| 128 | - /* layer.confirm('提交会把原有的站点和路段覆盖,您确定要提交吗?', { | |
| 129 | - btn: ['提交','取消'] //按钮 | |
| 130 | - }, function(){ | |
| 131 | - var sectionList = WorldsBMapLine.getSectionList(); | |
| 132 | - var data = {}; | |
| 133 | - var section = EditSectionObj.getEitdSection(); | |
| 134 | - var josnSectionList = JSON.stringify(sectionList); | |
| 135 | - section.cutSectionList = josnSectionList; | |
| 136 | - $.post('/section/sectionCut', section, function(resuntDate){ | |
| 137 | - if(resuntDate.status=='SUCCESS') { | |
| 138 | - // 弹出添加成功提示消息 | |
| 139 | - layer.msg('提交成功,跳转到线路详情页面!'); | |
| 140 | - window.location.href = "/pages/base/stationroute/list.html?no="+id+","+EditRoute.getLineObj().dir; | |
| 141 | - WorldsBMapLine.initCutSectionPoint(); | |
| 142 | - WorldsBMapLine.setPointIndex(0); | |
| 143 | - }else { | |
| 144 | - // 弹出添加失败提示消息 | |
| 145 | - layer.msg('提交失败...'); | |
| 146 | - } | |
| 147 | - }); | |
| 148 | - }); */ | |
| 149 | 150 | } else { |
| 150 | 151 | layer.msg("请先截取路段!!!"); |
| 151 | 152 | } |
| ... | ... | @@ -178,6 +179,88 @@ $(function(){ |
| 178 | 179 | layer.msg("没有截取路段,不可以撤销!!!"); |
| 179 | 180 | } |
| 180 | 181 | }); |
| 182 | + // 监听右侧悬浮框导航栏事件 | |
| 183 | + $('#station').on('click',function(){ | |
| 184 | + $('#section').parent().removeClass('active'); | |
| 185 | + $('#station').parent().addClass('active'); | |
| 186 | + $('#station_list_div').removeClass('hidden'); | |
| 187 | + $('#station_list_div').addClass('active'); | |
| 188 | + $('#section_list_div').removeClass('active'); | |
| 189 | + $('#section_list_div').addClass('hidden'); | |
| 190 | + // 清除地图覆盖物 | |
| 191 | + WorldsBMapLine.clearMarkAndOverlays(); | |
| 192 | + | |
| 193 | + var params = {}; | |
| 194 | + var line = EditRoute.getLineObj(); | |
| 195 | + params.lineId=line.id; | |
| 196 | + params.dir = line.dir; | |
| 197 | + $.get('/stationroute/findCachePoint',params,function(data){ | |
| 198 | + var station_radio_html = '<div id="station_radio">'; | |
| 199 | + var cont = 1; | |
| 200 | + var check = 'checked="checked"'; | |
| 201 | + $.each(data,function(){ | |
| 202 | + stationRouteMap[this.stationRouteId] = this; | |
| 203 | + station_radio_html += '<div class="radio"><label class="radio_label on"><input name="stationRadio" type="radio" class="radioclass" value="'+this.stationRouteId+'" '+(cont==1?check:"")+' />'+this.stationRouteStationName+"</label></div>"; | |
| 204 | + cont++; | |
| 205 | + }); | |
| 206 | + station_radio_html += '</div>'; | |
| 207 | + $("#station_list_div .defeat-scroll").html(station_radio_html); | |
| 208 | + }); | |
| 209 | + }); | |
| 210 | + | |
| 211 | + $('#findStation').on('click', function(){ | |
| 212 | + var id = $("input[type='radio']:checked").val(); | |
| 213 | + var stationRoute = stationRouteMap[id]; | |
| 214 | + // 站点形状 | |
| 215 | + var shapesType = stationRoute.stationShapesType; | |
| 216 | + // 如果是圆 | |
| 217 | + if(shapesType =='r') { | |
| 218 | + | |
| 219 | + // 百度地图画圆 | |
| 220 | + WorldsBMapLine.pointsCircle(stationRoute); | |
| 221 | + | |
| 222 | + // 如果是多变行 | |
| 223 | + }else if(shapesType == 'd') { | |
| 224 | + | |
| 225 | + // 百度地图画多边形 | |
| 226 | + WorldsBMapLine.pointsPolygon(stationRoute); | |
| 227 | + } | |
| 228 | + | |
| 229 | + }); | |
| 230 | + $('#updateStation').on('click', function(){ | |
| 231 | + var id = $("input[type='radio']:checked").val(); | |
| 232 | + var stationRoute = stationRouteMap[id]; | |
| 233 | + | |
| 234 | + if(id && stationRoute){ | |
| 235 | + $.get('editstation_select.html', function(m){ | |
| 236 | + $(pjaxContainer).append(m); | |
| 237 | + $('#editstation_select_mobal').trigger('editStationSelectMobal_show', [WorldsBMapLine, DrawingManagerObj, stationRoute]); | |
| 238 | + }); | |
| 239 | + } else if(id && !stationRoute){ | |
| 240 | + layer.msg('您选择的站点不存在,请重新选择!'); | |
| 241 | + }else{ | |
| 242 | + layer.msg('请先选择要编辑的站点!'); | |
| 243 | + } | |
| 244 | + }); | |
| 245 | + $('#section').on('click',function(){ | |
| 246 | + $('#station').parent().removeClass('active'); | |
| 247 | + $('#section').parent().addClass('active'); | |
| 248 | + $('#section_list_div').removeClass('hidden'); | |
| 249 | + $('#section_list_div').addClass('active'); | |
| 250 | + $('#station_list_div').removeClass('active'); | |
| 251 | + $('#station_list_div').addClass('hidden'); | |
| 252 | + // 清除地图覆盖物 | |
| 253 | + WorldsBMapLine.clearMarkAndOverlays(); | |
| 254 | + | |
| 255 | + var line = EditRoute.getLineObj(); | |
| 256 | + lineid=line.id; | |
| 257 | + directions = line.dir; | |
| 258 | + // 查询路段信息 | |
| 259 | + $get('/sectionroute/findSectionCache',{'line.id_eq' : lineid , 'directions_eq' : directions},function(data) { | |
| 260 | + // 在地图上画出线路走向 | |
| 261 | + PublicFunctions.linePanlThree(lineid,data,directions); | |
| 262 | + }); | |
| 263 | + }); | |
| 181 | 264 | // 滚动轴监听事件 |
| 182 | 265 | $('#scrllmouseEvent_div').on('mousemove',function() { |
| 183 | 266 | $('.defeat-scroll').css('overflow','auto'); |
| ... | ... | @@ -191,12 +274,12 @@ $(function(){ |
| 191 | 274 | <!--坐标转换类 --> |
| 192 | 275 | <script src="/pages/base/line/js/transGPS.js"></script> |
| 193 | 276 | <!-- 地图类 --> |
| 194 | -<script src="/pages/base/line/js/line-list-map.js"></script> | |
| 277 | +<script src="/pages/base/line/js/map.js"></script> | |
| 195 | 278 | <!-- 函数与方法 --> |
| 196 | -<script src="/pages/base/line/js/line-list-function.js"></script> | |
| 279 | +<script src="/pages/base/line/js/line-map-function.js"></script> | |
| 197 | 280 | <!-- 修改路段对象类 --> |
| 198 | 281 | <script src="/pages/base/stationroute/js/editsection.js"></script> |
| 199 | 282 | <!-- 绘图类 --> |
| 200 | -<script src="/pages/base/stationroute/js/drawingManager.js"></script> | |
| 283 | +<script src="/pages/base/line/js/drawingManager.js"></script> | |
| 201 | 284 | <!-- ajax请求类 --> |
| 202 | 285 | <script src="/pages/base/stationroute/js/stationroute-ajax-getdata.js"></script> |
| 203 | 286 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/base/line/submit_select.html
| ... | ... | @@ -78,7 +78,8 @@ |
| 78 | 78 | $('#submit_select_mobal').modal('hide'); |
| 79 | 79 | layer.confirm('提交马上会把原有的站点和路段覆盖,您确定要提交吗?', { |
| 80 | 80 | btn: ['提交','取消'] //按钮 |
| 81 | - }, function(){ | |
| 81 | + }, function(index){ | |
| 82 | + layer.close(index); | |
| 82 | 83 | $.post('/section/sectionCut', section, function(resuntDate){ |
| 83 | 84 | if(resuntDate.status=='SUCCESS') { |
| 84 | 85 | // 弹出添加成功提示消息 |
| ... | ... | @@ -106,7 +107,6 @@ |
| 106 | 107 | layer.msg('提交成功!'); |
| 107 | 108 | // 返回线路list页面 |
| 108 | 109 | loadPage('/pages/base/line/list.html'); |
| 109 | -// window.location.href = "/pages/base/stationroute/list.html?no="+section.sectionrouteLine+","+section.sectionrouteDirections; | |
| 110 | 110 | }else { |
| 111 | 111 | // 弹出添加失败提示消息 |
| 112 | 112 | layer.msg('提交失败...'); | ... | ... |
src/main/resources/static/pages/base/lineversions/js/lineversions-list-table.js
| ... | ... | @@ -87,6 +87,12 @@ |
| 87 | 87 | }); |
| 88 | 88 | } |
| 89 | 89 | |
| 90 | + $('#lineSelect').on('change',function() { | |
| 91 | + var text = $('#lineSelect').val(); | |
| 92 | + var linecode = text.split("_"); | |
| 93 | + $("#lineCodeInput").val(linecode[2]); | |
| 94 | + }); | |
| 95 | + | |
| 90 | 96 | function gsdmTogsName(gsD,code) { |
| 91 | 97 | var rsStr = ''; |
| 92 | 98 | for(var s = 0 ; s < gsD.length; s++) { | ... | ... |
src/main/resources/static/pages/base/lineversions/list.html
| ... | ... | @@ -50,7 +50,7 @@ |
| 50 | 50 | <tr role="row" class="filter"> |
| 51 | 51 | <td>#</td> |
| 52 | 52 | <td> |
| 53 | - <input type="text" class="form-control form-filter input-sm" name="lineCode_eq"> | |
| 53 | + <input type="text" class="form-control form-filter input-sm" name="lineCode_eq" id="lineCodeInput"> | |
| 54 | 54 | </td> |
| 55 | 55 | <td> |
| 56 | 56 | <select name="line.name_like" class="form-control" style="width:100%" id="lineSelect"></select> | ... | ... |
src/main/resources/static/pages/base/section/js/section-list-table.js
| ... | ... | @@ -161,8 +161,12 @@ |
| 161 | 161 | }); |
| 162 | 162 | }); |
| 163 | 163 | }); |
| 164 | + // 选择线路,填充线路编码搜索框 | |
| 164 | 165 | $('#lineSelect').on('change',function() { |
| 165 | 166 | initldNameSelect(); |
| 167 | + var text = $('#lineSelect').val(); | |
| 168 | + var linecode = text.split("_"); | |
| 169 | + $("#lineCodeInput").val(linecode[2]); | |
| 166 | 170 | }); |
| 167 | 171 | $('#dirSelect').on('change',function() { |
| 168 | 172 | initldNameSelect(); | ... | ... |
src/main/resources/static/pages/base/section/list.html
| ... | ... | @@ -48,7 +48,7 @@ |
| 48 | 48 | <tr role="row" class="filter"> |
| 49 | 49 | <td></td> |
| 50 | 50 | <td> |
| 51 | - <input type="text" class="form-control form-filter input-sm" name="lineCode_eq"> | |
| 51 | + <input type="text" class="form-control form-filter input-sm" name="lineCode_eq" id="lineCodeInput"> | |
| 52 | 52 | </td> |
| 53 | 53 | <td> |
| 54 | 54 | <select name="line.name_like" class="form-control" style="width:100%" id="lineSelect"></select> | ... | ... |
src/main/resources/static/pages/base/station/edit_select.html
| ... | ... | @@ -22,7 +22,7 @@ |
| 22 | 22 | <div class="form-group" id="formRequ"> |
| 23 | 23 | <label class="col-md-3 control-label"><span class="required"> * </span>站点名称:</label> |
| 24 | 24 | <div class="col-md-9" id="errorInfo"> |
| 25 | - <input type="text" class="form-control input-medium" id="stationNamebootboxInput" name="stationNamebootbox"> | |
| 25 | + <input type="text" class="form-control input-medium" id="stationNamebootboxInput" name="stationNamebootbox" readonly="readonly"> | |
| 26 | 26 | </div> |
| 27 | 27 | </div> |
| 28 | 28 | <!-- 修改方式容器 --> | ... | ... |
src/main/resources/static/pages/base/station/js/station-list-table.js
| ... | ... | @@ -112,6 +112,9 @@ |
| 112 | 112 | $('#lineSelect').on('change',function() { |
| 113 | 113 | initzdNameSelect(); |
| 114 | 114 | $('#destroy').val(0); |
| 115 | + var text = $('#lineSelect').val(); | |
| 116 | + var linecode = text.split("_"); | |
| 117 | + $("#lineCodeInput").val(linecode[2]); | |
| 115 | 118 | }); |
| 116 | 119 | |
| 117 | 120 | $('#dirSelect').on('change',function() { | ... | ... |
src/main/resources/static/pages/base/station/list.html
| ... | ... | @@ -48,7 +48,7 @@ |
| 48 | 48 | <tr role="row" class="filter"> |
| 49 | 49 | <td>#</td> |
| 50 | 50 | <td> |
| 51 | - <input type="text" class="form-control form-filter input-sm" name="lineCode_eq"> | |
| 51 | + <input type="text" class="form-control form-filter input-sm" id="lineCodeInput" name="lineCode_eq"> | |
| 52 | 52 | </td> |
| 53 | 53 | <td> |
| 54 | 54 | <select name="line.name_like" class="form-control" style="width:100%" id="lineSelect"></select> | ... | ... |
src/main/resources/static/pages/base/stationroute/edit.html
| ... | ... | @@ -197,6 +197,7 @@ $('#edit_station_mobal').on('editSelectMobal_show', function(e, map_,ajaxd,stati |
| 197 | 197 | layer.closeAll(); |
| 198 | 198 | var editStationParmasObj = station_.getEitdStation(); |
| 199 | 199 | var addLine = Line_.getLineObj(); |
| 200 | + debugger | |
| 200 | 201 | fun.setFormValue(editStationParmasObj); |
| 201 | 202 | var initzdlyP = {'lineCode_eq':editStationParmasObj.stationRouteLineCode,'destroy_eq':0,'directions_eq':editStationParmasObj.stationRouteDirections}; |
| 202 | 203 | initSelect(initzdlyP); | ... | ... |
src/main/resources/static/pages/base/stationroute/edit_select.html
| ... | ... | @@ -19,7 +19,7 @@ |
| 19 | 19 | 系统无法生成,请选择其他方式新增 |
| 20 | 20 | </div> |
| 21 | 21 | <div class="form-group" id="formRequ"> |
| 22 | - <label class="col-md-3 control-label"><span class="required"> * </span>站点名称:</label> | |
| 22 | + <label class="col-md-3 control-label"><span class="required"> * </span>原始站点名称:</label> | |
| 23 | 23 | <div class="col-md-9" id="errorInfo"> |
| 24 | 24 | <input type="text" class="form-control input-medium" id="stationNamebootbox" name="stationNamebootbox"> |
| 25 | 25 | </div> |
| ... | ... | @@ -108,27 +108,37 @@ $('#edit_select_mobal').on('editSelectMobal_show', function(e, map_,drw,ajaxd,ed |
| 108 | 108 | label.closest('.form-group').removeClass('has-error'); |
| 109 | 109 | }, |
| 110 | 110 | submitHandler : function(f) { |
| 111 | - editStationObj.setEitdStation(Station); | |
| 112 | 111 | // 隐藏弹出层 |
| 113 | 112 | $('#edit_select_mobal').modal('hide'); |
| 114 | - $('#downLine').addClass('btn disabled'); | |
| 115 | - $('.btn-circle').addClass('disabled'); | |
| 116 | - $('#upLine').addClass('btn disabled'); | |
| 113 | + | |
| 117 | 114 | // 表单序列 |
| 118 | 115 | var params = form.serializeJSON(); |
| 119 | 116 | // 站点名称 |
| 120 | 117 | var editStationName = params.stationNamebootbox; |
| 121 | - editStationObj.setEitdStationName(editStationName); | |
| 118 | + | |
| 122 | 119 | if(params.editselect==0){ |
| 123 | - map_.clearMarkAndOverlays(); | |
| 124 | - // 打开绘制工具 | |
| 125 | - drw.openDrawingManager(); | |
| 126 | - map_.localtionPoint(editStationName); | |
| 127 | - layer.open({ | |
| 128 | - title: '友情提示' | |
| 129 | - ,content: '重绘站点,会修改站点编码,影响已做好的排班和线路文件。请谨慎使用,谢谢!' | |
| 130 | - }); | |
| 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 | + }); | |
| 131 | 135 | }else if(params.editselect==1){ |
| 136 | + $('#downLine').addClass('btn disabled'); | |
| 137 | + $('.btn-circle').addClass('disabled'); | |
| 138 | + $('#upLine').addClass('btn disabled'); | |
| 139 | + editStationObj.setEitdStation(Station); | |
| 140 | + editStationObj.setEitdStationName(editStationName); | |
| 141 | + | |
| 132 | 142 | // 弹出添加失败提示消息,2秒关闭(如果不配置,默认是3秒) |
| 133 | 143 | var mindex = layer.msg('编辑完图形后,请双击图形区域保存',{ offset: '126px', |
| 134 | 144 | shift: 0,time: 10000}); | ... | ... |
src/main/resources/static/pages/base/stationroute/js/stationroute-list-map.js
| ... | ... | @@ -216,6 +216,7 @@ var WorldsBMap = function () { |
| 216 | 216 | |
| 217 | 217 | // 地图画多边形 |
| 218 | 218 | pointsPolygon : function(objStation) { |
| 219 | + debugger | |
| 219 | 220 | |
| 220 | 221 | // 将视图切换到指定的缩放等级,中心点坐标不变。注意:当有信息窗口在地图上打开时,地图缩放将保证信息窗口所在的坐标位置不动。(自1.2新增) |
| 221 | 222 | mapBValue.setZoom(15); |
| ... | ... | @@ -314,7 +315,7 @@ var WorldsBMap = function () { |
| 314 | 315 | '<span class="help-block" style="color:#DDD;font-size: 15px;">到站时间:' + objStation.stationRouteToTime + ' 分钟</span>' + |
| 315 | 316 | '<span class="help-block" style="color:#DDD;font-size: 15px;">到站距离:' + objStation.stationRouteDistances + ' 公里</span>' + |
| 316 | 317 | '<span class="help-block" style="color:#DDD;font-size: 15px;">范围半径:' + objStation.stationRadius + '</span>' + |
| 317 | - '<span class="help-block" style="color:#DDD;font-size: 15px;">版本 号:' + objStation.stationRouteVersions + '</span>' + | |
| 318 | + '<span class="help-block" style="color:#DDD;font-size: 15px;">版本号  :' + objStation.stationRouteVersions + '</span>' + | |
| 318 | 319 | '<span class="help-block" style="width: 100%;font-size: 15px;;color:#DDD;'+ |
| 319 | 320 | 'overflow: hidden; white-space: nowrap; text-overflow: ellipsis; " title="'+ |
| 320 | 321 | objStation.stationRouteDescriptions +'" >说明/描述:' + objStation.stationRouteDescriptions + '</span>' ; |
| ... | ... | @@ -373,6 +374,7 @@ var WorldsBMap = function () { |
| 373 | 374 | |
| 374 | 375 | // 画圆 |
| 375 | 376 | pointsCircle : function(objStation) { |
| 377 | + debugger | |
| 376 | 378 | |
| 377 | 379 | // 将视图切换到指定的缩放等级,中心点坐标不变。注意:当有信息窗口在地图上打开时,地图缩放将保证信息窗口所在的坐标位置不动。(自1.2新增) |
| 378 | 380 | mapBValue.setZoom(16); |
| ... | ... | @@ -448,7 +450,7 @@ var WorldsBMap = function () { |
| 448 | 450 | '<span class="help-block" style="color:#DDD;font-size: 15px;">到站时间:' + objStation.stationRouteToTime + ' 分钟</span>' + |
| 449 | 451 | '<span class="help-block" style="color:#DDD;font-size: 15px;">到站距离:' + objStation.stationRouteDistances + ' 公里</span>' + |
| 450 | 452 | '<span class="help-block" style="color:#DDD;font-size: 15px;">范围半径:' + objStation.stationRadius + '</span>' + |
| 451 | - '<span class="help-block" style="color:#DDD;font-size: 15px;">版本 号:' + objStation.stationRouteVersions + '</span>' + | |
| 453 | + '<span class="help-block" style="color:#DDD;font-size: 15px;">版本号  :' + objStation.stationRouteVersions + '</span>' + | |
| 452 | 454 | '<span class="help-block" style="width: 100%;font-size: 15px;;color:#DDD;'+ |
| 453 | 455 | 'overflow: hidden; white-space: nowrap; text-overflow: ellipsis; " title="'+ |
| 454 | 456 | objStation.stationRouteDescriptions +'" >说明/描述:' + objStation.stationRouteDescriptions + '</span>' ; |
| ... | ... | @@ -533,7 +535,6 @@ var WorldsBMap = function () { |
| 533 | 535 | |
| 534 | 536 | // 编辑图形 |
| 535 | 537 | editShapes : function(editStationName,stationShapesTypeV,mindex) { |
| 536 | - | |
| 537 | 538 | // 关闭信息窗口 |
| 538 | 539 | marker.closeInfoWindow(); |
| 539 | 540 | ... | ... |
src/main/resources/static/pages/electricity/list/list.html
| ... | ... | @@ -212,7 +212,7 @@ onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').rep |
| 212 | 212 | <lable style="float:left">%<lable> |
| 213 | 213 | </td> |
| 214 | 214 | <td> |
| 215 | -<input data-id="{{obj.id}}" href="javascript:;" class="in_carpark_hd" | |
| 215 | +<input data-id="{{obj.id}}" href="javascript:;" class="in_carpark_hd" readOnly="true" | |
| 216 | 216 | type="text" value=" {{obj.hd}}" style=" width:45px;float:left" |
| 217 | 217 | onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')" |
| 218 | 218 | onafterpaste="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')" /> |
| ... | ... | @@ -393,29 +393,6 @@ onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').rep |
| 393 | 393 | |
| 394 | 394 | } |
| 395 | 395 | |
| 396 | - /* var id = $('input.icheck:checked').data('id'); | |
| 397 | - | |
| 398 | - if (typeof(id) == 'undefined') { | |
| 399 | - layer.msg("请选择一行进行拆分"); | |
| 400 | - } else { | |
| 401 | - //获取输入的进场存油 | |
| 402 | - var jzyl = $('.in_carpark_jzcd[data-id='+id+']', '#dl_oil_list').html(); | |
| 403 | - var sh = $('.in_carpark_shyl[data-id='+id+']', '#dl_oil_list').html(); | |
| 404 | - var shyy = $('.in_carpark_shyy[data-id='+id+']', '#dl_oil_list').val(); | |
| 405 | - // $("#jzyl" + id).html(); | |
| 406 | - var params = {}; | |
| 407 | - params['jzyl'] = jzyl; | |
| 408 | - params['sh'] =sh; | |
| 409 | - params['shyy']=shyy; | |
| 410 | - params['id'] = id; | |
| 411 | - var i = layer.load(2); | |
| 412 | - $get('/ylb/sort', params, function () { | |
| 413 | - layer.close(i); | |
| 414 | - var params1 =getParamsList(); | |
| 415 | - jsDoQuery(params1, true); | |
| 416 | - }); | |
| 417 | - | |
| 418 | - } */ | |
| 419 | 396 | } else { |
| 420 | 397 | layer.msg('请选择日期.'); |
| 421 | 398 | } |
| ... | ... | @@ -512,18 +489,6 @@ onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').rep |
| 512 | 489 | updateCompany(); |
| 513 | 490 | }); |
| 514 | 491 | }) |
| 515 | - /* function setFgsqx(gs){ | |
| 516 | - var company =gs | |
| 517 | - var options = ''; | |
| 518 | - for(var i = 0; i < obj.length; i++){ | |
| 519 | - if(obj[i].companyCode == company){ | |
| 520 | - var children = obj[i].children; | |
| 521 | - for(var j = 0; j < children.length; j++){ | |
| 522 | - gsqxdm +=company+""+children[j].code+","; | |
| 523 | - } | |
| 524 | - } | |
| 525 | - } | |
| 526 | - } */ | |
| 527 | 492 | $("#ylbListGsdmId").on("change",updateCompany); |
| 528 | 493 | function updateCompany(){ |
| 529 | 494 | var company = $('#ylbListGsdmId').val(); |
| ... | ... | @@ -553,24 +518,6 @@ onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').rep |
| 553 | 518 | params['page'] = page; |
| 554 | 519 | params['rq'] = $("#rq").val(); |
| 555 | 520 | |
| 556 | - /* var ylbGsdm=$("#ylbListGsdmId").val(); | |
| 557 | - var ylbFgsdm=$("#ylbListFgsdmId").val(); | |
| 558 | - if(ylbGsdm==''|| ylbGsdm==null){ | |
| 559 | - params['concat(ssgsdm,fgsdm)_in']=gsqxdm; | |
| 560 | - }else{ | |
| 561 | - if(ylbFgsdm==''||ylbFgsdm==null){ | |
| 562 | - var fgsqx1=''; | |
| 563 | - for(var i = 0; i < obj.length; i++){ | |
| 564 | - if(obj[i].companyCode == ylbGsdm){ | |
| 565 | - var children = obj[i].children; | |
| 566 | - for(var j = 0; j < children.length; j++){ | |
| 567 | - fgsqx1 +=children[j].code+","; | |
| 568 | - } | |
| 569 | - } | |
| 570 | - } | |
| 571 | - params['fgsdm_in']=fgsqx1; | |
| 572 | - } | |
| 573 | - } */ | |
| 574 | 521 | |
| 575 | 522 | var l = layer.load(2); |
| 576 | 523 | $get('/dlb/dlbList', params, function (data) { |
| ... | ... | @@ -580,24 +527,80 @@ onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').rep |
| 580 | 527 | }); |
| 581 | 528 | var bodyHtm = template('dlb_list_temp', {list:data}); |
| 582 | 529 | $('#datatable_dlb tbody').html(bodyHtm); |
| 583 | - /* $('#datatable_dlb tbody').html(bodyHtm) | |
| 584 | - .find('.icheck').iCheck(icheckOptions) | |
| 585 | - .on('ifChanged', iCheckChange); | |
| 586 | - if (pagination && data.content.length > 0) { | |
| 587 | - //重新分页 | |
| 588 | - initPagination = true; | |
| 589 | - showPagination(data); | |
| 590 | - } */ | |
| 591 | 530 | layer.close(l); |
| 592 | 531 | $get('/dlb/sumYlb',params,function(returns){ |
| 593 | 532 | $("#sumJzl").html(returns.jzl); |
| 594 | 533 | $("#sumYh").html(returns.yh); |
| 595 | 534 | $("#sumSh").html(returns.sh); |
| 596 | 535 | }); |
| 597 | -// startOptJzylLink($('#dl_oil_list .in_carpark_jzcd')); | |
| 598 | -// startOptShylLink($('#dl_oil_list .in_carpark_shyl')); | |
| 536 | + | |
| 537 | + $('input').on('input propertychange',function(){ | |
| 538 | + var id=$(this).data('id'); | |
| 539 | + var cdl =$('.in_carpark_cdl[data-id='+id+']', '#dl_oil_list').html(); | |
| 540 | + if(cdl=="" || cdl ==null){ | |
| 541 | + cdl=0; | |
| 542 | + } | |
| 543 | + var sh = $('.in_carpark_shyl[data-id='+id+']', '#dl_oil_list').val(); | |
| 544 | + if(sh=="" || sh==null){ | |
| 545 | + sh=0; | |
| 546 | + } | |
| 547 | + | |
| 548 | + var sub=numSubtr(cdl*1000,sh*1000); | |
| 549 | + var subValue=0; | |
| 550 | + if(sub/1000>=0){ | |
| 551 | + subValue=sub/1000; | |
| 552 | + } | |
| 553 | + $('.in_carpark_hd[data-id='+id+']', '#dl_oil_list').val(subValue); | |
| 554 | + | |
| 555 | + }); | |
| 599 | 556 | }); |
| 600 | 557 | } |
| 558 | + | |
| 559 | + //页面计算防止精度丢失 | |
| 560 | + var accAdd = function (a, b) { | |
| 561 | + var c, d, e; | |
| 562 | + try { | |
| 563 | + c = a.toString().split(".")[1].length; | |
| 564 | + } catch (f) { | |
| 565 | + c = 0; | |
| 566 | + } | |
| 567 | + try { | |
| 568 | + d = b.toString().split(".")[1].length; | |
| 569 | + } catch (f) { | |
| 570 | + d = 0; | |
| 571 | + } | |
| 572 | + return e = Math.pow(10, Math.max(c, d)), (mul(a, e) + mul(b, e)) / e; | |
| 573 | + }; | |
| 574 | + | |
| 575 | + var numSubtr = function (a, b) { | |
| 576 | + var c, d, e; | |
| 577 | + try { | |
| 578 | + c = a.toString().split(".")[1].length; | |
| 579 | + } catch (f) { | |
| 580 | + c = 0; | |
| 581 | + } | |
| 582 | + try { | |
| 583 | + d = b.toString().split(".")[1].length; | |
| 584 | + } catch (f) { | |
| 585 | + d = 0; | |
| 586 | + } | |
| 587 | + return e = Math.pow(10, Math.max(c, d)), (a * e - b * e) / e; | |
| 588 | + }; | |
| 589 | + | |
| 590 | + function mul(a, b) { | |
| 591 | + var c = 0, | |
| 592 | + d = a.toString(), | |
| 593 | + e = b.toString(); | |
| 594 | + try { | |
| 595 | + c += d.split(".")[1].length; | |
| 596 | + } catch (f) { | |
| 597 | + } | |
| 598 | + try { | |
| 599 | + c += e.split(".")[1].length; | |
| 600 | + } catch (f) { | |
| 601 | + } | |
| 602 | + return Number(d.replace(".", "")) * Number(e.replace(".", "")) / Math.pow(10, c); | |
| 603 | + } | |
| 601 | 604 | |
| 602 | 605 | //改变状态 |
| 603 | 606 | function startOptJzylLink(es) { |
| ... | ... | @@ -735,13 +738,6 @@ onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').rep |
| 735 | 738 | initPinYinSelect2('#xlbm',data,''); |
| 736 | 739 | fage=true; |
| 737 | 740 | } |
| 738 | -// $("#ylbListGsdmId").on("change",initNbbm); | |
| 739 | -// $("#ylbListFgsdmId").on("change",initNbbm); | |
| 740 | -// $("#xlbm").on("change",initNbbm); | |
| 741 | -// function initNbbm(){ | |
| 742 | -// var gsbm=$('#ylbListGsdmId').val(), | |
| 743 | -// var fgsbm=$('#ylbListFgsdmId').val(), | |
| 744 | -// var xlbm=$('#xlbm').val(); | |
| 745 | 741 | $("#xlbm").on("change",initCl); |
| 746 | 742 | function initCl(){ |
| 747 | 743 | $('#nbbm').select2({ | ... | ... |
src/main/resources/static/pages/forms/mould/lbStatuAnaly.xls
No preview for this file type
src/main/resources/static/pages/oil/checkJyryList.html
| ... | ... | @@ -130,6 +130,7 @@ |
| 130 | 130 | <select class="form-control in_carpark_jsy" name="jsy" id="jsy{{obj.id}}" data-id="{{obj.id}}"> |
| 131 | 131 | <option selected="selected" value="{{obj.jsy}}">{{obj.jsy}}<option> |
| 132 | 132 | </select> |
| 133 | + <lable data-id="{{obj.id}}" style="display: none" class="in_carpark_ls_jsy">{{obj.jsy}}</lable> | |
| 133 | 134 | </td> |
| 134 | 135 | <td> |
| 135 | 136 | {{obj.jzl}} |
| ... | ... | @@ -138,7 +139,9 @@ |
| 138 | 139 | <td>{{obj.nylx}}</td> |
| 139 | 140 | <td>{{obj.jyggh}}</td> |
| 140 | 141 | <td></td> |
| 141 | - <td>{{obj.ldgh}}</td> | |
| 142 | + <td> | |
| 143 | + <lable data-id="{{obj.id}}" class="in_carpark_ldgh">{{obj.ldgh}}</lable> | |
| 144 | + </td> | |
| 142 | 145 | <td> |
| 143 | 146 | {{obj.bz}} |
| 144 | 147 | </td> |
| ... | ... | @@ -162,8 +165,13 @@ $(function(){ |
| 162 | 165 | var map = {}; |
| 163 | 166 | var id=$(this).data('id'); |
| 164 | 167 | var jsy=$('.in_carpark_jsy[data-id='+id+']', '#ll_jyry_list').val(); |
| 168 | + var lsjsy=$('.in_carpark_ls_jsy[data-id='+id+']', '#ll_jyry_list').html(); | |
| 169 | + var ldgh=$('.in_carpark_ldgh[data-id='+id+']', '#ll_jyry_list').html(); | |
| 170 | + | |
| 165 | 171 | map['id']=id; |
| 166 | 172 | map['jsy']=jsy; |
| 173 | + map['lsjsy']=lsjsy; | |
| 174 | + map['ldgh']=ldgh; | |
| 167 | 175 | ylArray.push(map); |
| 168 | 176 | }) |
| 169 | 177 | var params = {}; | ... | ... |
src/main/resources/static/pages/oil/checkNbbmList.html
| ... | ... | @@ -34,6 +34,7 @@ |
| 34 | 34 | <th width="3%">#</th> |
| 35 | 35 | <th width="10%">日期</th> |
| 36 | 36 | <th width="10%">公司</th> |
| 37 | + <th width="10%">分公司</th> | |
| 37 | 38 | <th width="15%">车辆</th> |
| 38 | 39 | <th width="12%">驾驶员</th> |
| 39 | 40 | <th width="4%">加注量</th> |
| ... | ... | @@ -52,6 +53,9 @@ |
| 52 | 53 | <select class="form-control" name="gsdm_like" id="jyryListGsdmId" ></select> |
| 53 | 54 | </td> |
| 54 | 55 | <td> |
| 56 | + <select class="form-control" name="fgsdm_like" id="jyryListFgsdmId" ></select> | |
| 57 | + </td> | |
| 58 | + <td> | |
| 55 | 59 | <input type="text" id="nbbm" class="form-control form-filter input-sm" name="nbbm"> |
| 56 | 60 | </td> |
| 57 | 61 | <td> |
| ... | ... | @@ -92,6 +96,8 @@ |
| 92 | 96 | {{obj.gsname}} |
| 93 | 97 | </td> |
| 94 | 98 | <td> |
| 99 | + </td> | |
| 100 | + <td> | |
| 95 | 101 | <input type="text" class="form-control in_carpark_nbbm" name="nbbm" id="nbbm{{obj.id}}" data-id="{{obj.id}}" value="{{obj.nbbm}}"/> |
| 96 | 102 | </td> |
| 97 | 103 | <td> |
| ... | ... | @@ -173,16 +179,26 @@ $(function(){ |
| 173 | 179 | $.get('/user/companyData', function(result){ |
| 174 | 180 | obj = result; |
| 175 | 181 | var options = ''; |
| 176 | -// '<option value="">请选择</option>'; | |
| 177 | 182 | for(var i = 0; i < obj.length; i++){ |
| 178 | 183 | options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>'; |
| 179 | -// setFgsqx(obj[i].companyCode); | |
| 180 | -// gsqx +=obj[i].companyCode+","; | |
| 181 | 184 | } |
| 182 | 185 | $('#jyryListGsdmId').html(options); |
| 183 | -// updateCompany(); | |
| 186 | + updateCompany(); | |
| 184 | 187 | }); |
| 185 | - | |
| 188 | + $("#jyryListGsdmId").on("change",updateCompany); | |
| 189 | + function updateCompany(){ | |
| 190 | + var company = $('#jyryListGsdmId').val(); | |
| 191 | + var options = ''; | |
| 192 | + for(var i = 0; i < obj.length; i++){ | |
| 193 | + if(obj[i].companyCode == company){ | |
| 194 | + var children = obj[i].children; | |
| 195 | + for(var j = 0; j < children.length; j++){ | |
| 196 | + options += '<option value="'+children[j].code+'">'+children[j].name+'</option>'; | |
| 197 | + } | |
| 198 | + } | |
| 199 | + } | |
| 200 | + $('#jyryListFgsdmId').html(options); | |
| 201 | + } | |
| 186 | 202 | |
| 187 | 203 | //提交 |
| 188 | 204 | $('tr.filter .filter-submit').on('click', function(){ | ... | ... |
src/main/resources/static/pages/oil/list_ph.html
| ... | ... | @@ -327,7 +327,6 @@ onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').rep |
| 327 | 327 | layer.msg('请选择日期.'); |
| 328 | 328 | } |
| 329 | 329 | }) |
| 330 | - | |
| 331 | 330 | //进场等于出场 |
| 332 | 331 | $("#outAndIn").on('click', function () { |
| 333 | 332 | // console.log("进场油量等于出场油量"); |
| ... | ... | @@ -859,6 +858,7 @@ onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').rep |
| 859 | 858 | }) |
| 860 | 859 | var params = {}; |
| 861 | 860 | params['ids']=JSON.stringify(idArray); |
| 861 | + console.log(idArray); | |
| 862 | 862 | if (x==0) { |
| 863 | 863 | layer.msg("请选择要删除的数据"); |
| 864 | 864 | }else{ |
| ... | ... | @@ -970,9 +970,11 @@ onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').rep |
| 970 | 970 | //全选 全不选 |
| 971 | 971 | $("#selectAll").on("click", function () { |
| 972 | 972 | if ($(this).is(":checked")) { |
| 973 | - $("[name=id]:checkbox").prop("checked", true); | |
| 973 | +// $("[name=id]:checkbox").prop("checked", true); | |
| 974 | + $("input[name='id']").attr('checked', true) | |
| 974 | 975 | } else { |
| 975 | - $("[name=id]:checkbox").prop("checked", false); | |
| 976 | +// $("[name=id]:checkbox").prop("checked", false); | |
| 977 | + $("input[name='id']").attr('checked', false); | |
| 976 | 978 | } |
| 977 | 979 | }); |
| 978 | 980 | ... | ... |
src/main/resources/static/pages/report/countMileage/countLine/company/countLineMileage.html
| ... | ... | @@ -112,7 +112,7 @@ |
| 112 | 112 | </tr> |
| 113 | 113 | |
| 114 | 114 | </thead> |
| 115 | - <tbody class="countLine"> | |
| 115 | + <tbody class="countLineNb"> | |
| 116 | 116 | |
| 117 | 117 | </tbody> |
| 118 | 118 | </table> |
| ... | ... | @@ -270,7 +270,7 @@ |
| 270 | 270 | // 把数据填充到模版中 |
| 271 | 271 | var tbodyHtml = template('countLineList',{list:result}); |
| 272 | 272 | // 把渲染好的模版html文本追加到表格中 |
| 273 | - $('#forms .countLine').html(tbodyHtml); | |
| 273 | + $('#forms .countLineNb').html(tbodyHtml); | |
| 274 | 274 | |
| 275 | 275 | if(result.length == 0) |
| 276 | 276 | $("#export").attr('disabled',"true"); | ... | ... |
src/main/resources/static/pages/report/countMileage/countLine/countLineMileage.html
| ... | ... | @@ -111,7 +111,7 @@ |
| 111 | 111 | </tr> |
| 112 | 112 | |
| 113 | 113 | </thead> |
| 114 | - <tbody class="countLine"> | |
| 114 | + <tbody class="countLineSj"> | |
| 115 | 115 | |
| 116 | 116 | </tbody> |
| 117 | 117 | </table> |
| ... | ... | @@ -269,7 +269,7 @@ |
| 269 | 269 | // 把数据填充到模版中 |
| 270 | 270 | var tbodyHtml = template('countLineList',{list:result}); |
| 271 | 271 | // 把渲染好的模版html文本追加到表格中 |
| 272 | - $('#forms .countLine').html(tbodyHtml); | |
| 272 | + $('#forms .countLineSj').html(tbodyHtml); | |
| 273 | 273 | |
| 274 | 274 | if(result.length == 0) |
| 275 | 275 | $("#export").attr('disabled',"true"); | ... | ... |
src/main/resources/static/pages/trafficManage/js/lineStationUploadRecord.js
| ... | ... | @@ -13,7 +13,7 @@ |
| 13 | 13 | */ |
| 14 | 14 | |
| 15 | 15 | (function(){ |
| 16 | - var page = 0, initPag; | |
| 16 | + var page = 0, initPag, storage = window.localStorage; | |
| 17 | 17 | // 关闭左侧栏 |
| 18 | 18 | if (!$('body').hasClass('page-sidebar-closed')) |
| 19 | 19 | $('.menu-toggler.sidebar-toggler').click(); |
| ... | ... | @@ -23,46 +23,48 @@ |
| 23 | 23 | locale : 'zh-cn' |
| 24 | 24 | }); |
| 25 | 25 | |
| 26 | - var lines = new Array(); | |
| 26 | + function getComp(cb) { | |
| 27 | + $.get('/user/companyData',null,function(rs) { | |
| 28 | + return cb && cb(rs); | |
| 29 | + }); | |
| 30 | + } | |
| 31 | + | |
| 32 | + initLineSelect2(); | |
| 27 | 33 | |
| 28 | - $('#line').select2({ | |
| 29 | - ajax: { | |
| 30 | - url: '/realSchedule/findLine', | |
| 31 | - type: 'post', | |
| 32 | - dataType: 'json', | |
| 33 | - delay: 150, | |
| 34 | - data: function(params){ | |
| 35 | - return{line: params.term}; | |
| 36 | - }, | |
| 37 | - processResults: function (data) { | |
| 38 | - return { | |
| 39 | - results: data | |
| 40 | - }; | |
| 41 | - }, | |
| 42 | - cache: true | |
| 43 | - }, | |
| 44 | - templateResult: function(repo){ | |
| 45 | - if (repo.loading) return repo.text; | |
| 46 | - var h = '<span>'+repo.text+'</span>'; | |
| 47 | - return h; | |
| 48 | - }, | |
| 49 | - escapeMarkup: function (markup) { return markup; }, | |
| 50 | - minimumInputLength: 1, | |
| 51 | - templateSelection: function(repo){ | |
| 52 | - return repo.text; | |
| 53 | - }, | |
| 54 | - language: { | |
| 55 | - noResults: function(){ | |
| 56 | - return '<span style="color:red;font-size: 12px;">没有搜索到线路!</span>'; | |
| 57 | - }, | |
| 58 | - inputTooShort : function(e) { | |
| 59 | - return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入线路搜索线路</span>'; | |
| 60 | - }, | |
| 61 | - searching : function() { | |
| 62 | - return '<span style="color:gray;font-size: 12px;"> 正在搜索线路...</span>'; | |
| 34 | + function initLineSelect2(compD) {debugger; | |
| 35 | + getComp(function(rs) { | |
| 36 | + var params = {}; | |
| 37 | + if(rs.length>0) { | |
| 38 | + var compA = new Array(); | |
| 39 | + for(var c = 0 ; c<rs.length;c++) { | |
| 40 | + var comC = rs[c].companyCode; | |
| 41 | + var child = rs[c].children; | |
| 42 | + if(child.length>0) { | |
| 43 | + for(var d = 0 ;d< child.length;d++) { | |
| 44 | + compA.push(comC + '_' + child[d].code); | |
| 45 | + } | |
| 46 | + }else { | |
| 47 | + compA.push(comC); | |
| 48 | + } | |
| 49 | + } | |
| 50 | + params.cgsbm_in = compA.toString(); | |
| 63 | 51 | } |
| 64 | - } | |
| 65 | - }); | |
| 52 | + // 填充线路拉框选择值 | |
| 53 | + $get('/line/all', params, function(array){ | |
| 54 | + var len_ = array.length,paramsD = new Array(); | |
| 55 | + if(len_>0) { | |
| 56 | + $.each(array, function(i, g){ | |
| 57 | + if(g.name!='' || g.name != null) { | |
| 58 | + paramsD.push({'id':g.name + '_' + g.id + '_' + g.lineCode ,'text':g.name}); | |
| 59 | + } | |
| 60 | + }); | |
| 61 | + initPinYinSelect2($('#line'),paramsD,function(selector) { | |
| 62 | + selector.select2("val", storage.xlName_AgursData); | |
| 63 | + }); | |
| 64 | + } | |
| 65 | + }); | |
| 66 | + }); | |
| 67 | + } | |
| 66 | 68 | |
| 67 | 69 | // 日期范围输入框限制,绑定按键和粘贴事件 |
| 68 | 70 | $(".dateRange").keyup(function(){ | ... | ... |