Commit 581417b0e6d6882a6906a066feef708f217e3429
1 parent
3450bf73
闵行超速异常优化、浦东越界异常功能修改!
Showing
10 changed files
with
604 additions
and
65 deletions
src/main/java/com/bsth/controller/excep/NowOutboundController.java
| 1 | package com.bsth.controller.excep; | 1 | package com.bsth.controller.excep; |
| 2 | 2 | ||
| 3 | +import java.text.ParseException; | ||
| 3 | import java.util.HashMap; | 4 | import java.util.HashMap; |
| 5 | +import java.util.List; | ||
| 4 | import java.util.Map; | 6 | import java.util.Map; |
| 5 | 7 | ||
| 6 | import org.springframework.beans.factory.annotation.Autowired; | 8 | import org.springframework.beans.factory.annotation.Autowired; |
| @@ -10,7 +12,9 @@ import org.springframework.web.bind.annotation.RequestParam; | @@ -10,7 +12,9 @@ import org.springframework.web.bind.annotation.RequestParam; | ||
| 10 | import org.springframework.web.bind.annotation.RestController; | 12 | import org.springframework.web.bind.annotation.RestController; |
| 11 | 13 | ||
| 12 | import com.bsth.controller.BaseController; | 14 | import com.bsth.controller.BaseController; |
| 15 | +import com.bsth.data.BasicData; | ||
| 13 | import com.bsth.entity.excep.Outbound; | 16 | import com.bsth.entity.excep.Outbound; |
| 17 | +import com.bsth.entity.excep.Speeding; | ||
| 14 | import com.bsth.entity.sys.SysUser; | 18 | import com.bsth.entity.sys.SysUser; |
| 15 | import com.bsth.service.excep.NowOutboundService; | 19 | import com.bsth.service.excep.NowOutboundService; |
| 16 | import com.bsth.util.PageObject; | 20 | import com.bsth.util.PageObject; |
| @@ -44,5 +48,11 @@ public class NowOutboundController extends BaseController<SysUser, Integer>{ | @@ -44,5 +48,11 @@ public class NowOutboundController extends BaseController<SysUser, Integer>{ | ||
| 44 | return modelMap; | 48 | return modelMap; |
| 45 | } | 49 | } |
| 46 | 50 | ||
| 51 | + @RequestMapping(value = "/findPosition", method = RequestMethod.GET) | ||
| 52 | + public List<Outbound> findPosition(@RequestParam String vehicle,@RequestParam String startdate,@RequestParam String enddate) throws ParseException { | ||
| 53 | + String deviceid = BasicData.deviceId2NbbmMap.inverse().get(vehicle); | ||
| 54 | + List<Outbound> listOutbound = nowOutboundService.findPosition(deviceid,startdate,enddate); | ||
| 55 | + return listOutbound; | ||
| 56 | + } | ||
| 47 | 57 | ||
| 48 | } | 58 | } |
src/main/java/com/bsth/entity/excep/Outbound.java
| @@ -34,9 +34,6 @@ public class Outbound { | @@ -34,9 +34,6 @@ public class Outbound { | ||
| 34 | */ | 34 | */ |
| 35 | private String lineName; | 35 | private String lineName; |
| 36 | 36 | ||
| 37 | - | ||
| 38 | - | ||
| 39 | - | ||
| 40 | /** | 37 | /** |
| 41 | * 上下行(0 上行 , 1 下行 , -1 无效) | 38 | * 上下行(0 上行 , 1 下行 , -1 无效) |
| 42 | */ | 39 | */ |
| @@ -57,18 +54,66 @@ public class Outbound { | @@ -57,18 +54,66 @@ public class Outbound { | ||
| 57 | */ | 54 | */ |
| 58 | private String location; | 55 | private String location; |
| 59 | 56 | ||
| 57 | + /** | ||
| 58 | + * 超速结束时经度 | ||
| 59 | + */ | ||
| 60 | + private Float endlon; | ||
| 61 | + | ||
| 62 | + /** | ||
| 63 | + * 超速结束时纬度 | ||
| 64 | + */ | ||
| 65 | + private Float endlat; | ||
| 60 | 66 | ||
| 61 | /** | 67 | /** |
| 62 | * 时间戳 | 68 | * 时间戳 |
| 63 | */ | 69 | */ |
| 64 | private Long timestamp; | 70 | private Long timestamp; |
| 65 | 71 | ||
| 72 | + public Float getEndlon() { | ||
| 73 | + return endlon; | ||
| 74 | + } | ||
| 75 | + | ||
| 76 | + public void setEndlon(Float endlon) { | ||
| 77 | + this.endlon = endlon; | ||
| 78 | + } | ||
| 79 | + | ||
| 80 | + public Float getEndlat() { | ||
| 81 | + return endlat; | ||
| 82 | + } | ||
| 83 | + | ||
| 84 | + public void setEndlat(Float endlat) { | ||
| 85 | + this.endlat = endlat; | ||
| 86 | + } | ||
| 87 | + | ||
| 88 | + public Long getEndtimestamp() { | ||
| 89 | + return endtimestamp; | ||
| 90 | + } | ||
| 91 | + | ||
| 92 | + public void setEndtimestamp(Long endtimestamp) { | ||
| 93 | + this.endtimestamp = endtimestamp; | ||
| 94 | + } | ||
| 95 | + | ||
| 96 | + public String getEndtimestampDate() { | ||
| 97 | + return endtimestampDate; | ||
| 98 | + } | ||
| 99 | + | ||
| 100 | + public void setEndtimestampDate(String endtimestampDate) { | ||
| 101 | + this.endtimestampDate = endtimestampDate; | ||
| 102 | + } | ||
| 103 | + | ||
| 66 | /** | 104 | /** |
| 67 | * 时间戳转换的时间 | 105 | * 时间戳转换的时间 |
| 68 | */ | 106 | */ |
| 69 | private String timestampDate; | 107 | private String timestampDate; |
| 70 | 108 | ||
| 71 | 109 | ||
| 110 | + //结束时间,单位:秒/s | ||
| 111 | + @Transient | ||
| 112 | + private Long endtimestamp; | ||
| 113 | + | ||
| 114 | + @Transient | ||
| 115 | + private String endtimestampDate; | ||
| 116 | + | ||
| 72 | /** | 117 | /** |
| 73 | * 时间 | 118 | * 时间 |
| 74 | */ | 119 | */ |
src/main/java/com/bsth/service/excep/NowOutboundService.java
| 1 | package com.bsth.service.excep; | 1 | package com.bsth.service.excep; |
| 2 | 2 | ||
| 3 | +import java.util.List; | ||
| 3 | import java.util.Map; | 4 | import java.util.Map; |
| 4 | 5 | ||
| 5 | import com.bsth.entity.excep.Outbound; | 6 | import com.bsth.entity.excep.Outbound; |
| @@ -8,4 +9,6 @@ import com.bsth.util.PageObject; | @@ -8,4 +9,6 @@ import com.bsth.util.PageObject; | ||
| 8 | public interface NowOutboundService { | 9 | public interface NowOutboundService { |
| 9 | PageObject <Outbound> Pagequery(Map<String, Object> map) ; | 10 | PageObject <Outbound> Pagequery(Map<String, Object> map) ; |
| 10 | Map<String, Object> getReport( Map<String, Object> map); | 11 | Map<String, Object> getReport( Map<String, Object> map); |
| 12 | + List<Outbound> findPosition(String deviceid, String startdate, | ||
| 13 | + String enddate); | ||
| 11 | } | 14 | } |
src/main/java/com/bsth/service/excep/impl/NowOutboundServiceImpl.java
| @@ -14,16 +14,16 @@ import java.util.Map; | @@ -14,16 +14,16 @@ import java.util.Map; | ||
| 14 | 14 | ||
| 15 | import org.springframework.beans.factory.annotation.Autowired; | 15 | import org.springframework.beans.factory.annotation.Autowired; |
| 16 | import org.springframework.jdbc.core.JdbcTemplate; | 16 | import org.springframework.jdbc.core.JdbcTemplate; |
| 17 | -import org.springframework.jdbc.core.RowMapper; | ||
| 18 | import org.springframework.stereotype.Service; | 17 | import org.springframework.stereotype.Service; |
| 19 | 18 | ||
| 20 | import com.bsth.data.BasicData; | 19 | import com.bsth.data.BasicData; |
| 21 | import com.bsth.entity.excep.Outbound; | 20 | import com.bsth.entity.excep.Outbound; |
| 22 | -import com.bsth.entity.realcontrol.ScheduleRealInfo; | ||
| 23 | import com.bsth.service.excep.NowOutboundService; | 21 | import com.bsth.service.excep.NowOutboundService; |
| 24 | import com.bsth.util.EchartConver; | 22 | import com.bsth.util.EchartConver; |
| 25 | import com.bsth.util.PageHelper; | 23 | import com.bsth.util.PageHelper; |
| 26 | import com.bsth.util.PageObject; | 24 | import com.bsth.util.PageObject; |
| 25 | +import com.bsth.util.TransGPS; | ||
| 26 | +import com.bsth.util.TransGPS.Location; | ||
| 27 | import com.bsth.util.db.DBUtils_MS; | 27 | import com.bsth.util.db.DBUtils_MS; |
| 28 | import com.github.abel533.echarts.Option; | 28 | import com.github.abel533.echarts.Option; |
| 29 | import com.google.gson.Gson; | 29 | import com.google.gson.Gson; |
| @@ -37,7 +37,7 @@ public class NowOutboundServiceImpl implements NowOutboundService{ | @@ -37,7 +37,7 @@ public class NowOutboundServiceImpl implements NowOutboundService{ | ||
| 37 | ResultSet rs = null; | 37 | ResultSet rs = null; |
| 38 | int page=Integer.parseInt(map.get("page").toString()); | 38 | int page=Integer.parseInt(map.get("page").toString()); |
| 39 | List<Outbound> list=new ArrayList<Outbound>(); | 39 | List<Outbound> list=new ArrayList<Outbound>(); |
| 40 | - String sql="select * from bsth_c_outbound where 1=1 "; | 40 | + String sql="select * from bsth_c_outbound_handle where 1=1 "; |
| 41 | Object line=map.get("line"); | 41 | Object line=map.get("line"); |
| 42 | Object nbbm=map.get("nbbm"); | 42 | Object nbbm=map.get("nbbm"); |
| 43 | Object updown=map.get("updown"); | 43 | Object updown=map.get("updown"); |
| @@ -61,7 +61,7 @@ public class NowOutboundServiceImpl implements NowOutboundService{ | @@ -61,7 +61,7 @@ public class NowOutboundServiceImpl implements NowOutboundService{ | ||
| 61 | try { | 61 | try { |
| 62 | Long t1=sdf.parse(date.toString()+" 00:00:00").getTime(); | 62 | Long t1=sdf.parse(date.toString()+" 00:00:00").getTime(); |
| 63 | Long t2=sdf.parse(date.toString()+" 23:59:59").getTime(); | 63 | Long t2=sdf.parse(date.toString()+" 23:59:59").getTime(); |
| 64 | - sql += " and timestamp >="+t1 +" and timestamp <="+t2; | 64 | + sql += " and starttimestamp >="+t1 +" and endtimestamp <="+t2; |
| 65 | } catch (ParseException e) { | 65 | } catch (ParseException e) { |
| 66 | // TODO Auto-generated catch block | 66 | // TODO Auto-generated catch block |
| 67 | e.printStackTrace(); | 67 | e.printStackTrace(); |
| @@ -69,8 +69,10 @@ public class NowOutboundServiceImpl implements NowOutboundService{ | @@ -69,8 +69,10 @@ public class NowOutboundServiceImpl implements NowOutboundService{ | ||
| 69 | } | 69 | } |
| 70 | 70 | ||
| 71 | } | 71 | } |
| 72 | - // sql +=" order by id limit ?,?"; | ||
| 73 | - sql +=" order by timestamp limit ?,?"; | 72 | + |
| 73 | + sql +=" and endtimestamp - starttimestamp >10000 ";//yue越界超过10秒的才显示,有待探讨。 | ||
| 74 | + | ||
| 75 | + sql +=" order by starttimestamp limit ?,?"; | ||
| 74 | 76 | ||
| 75 | try { | 77 | try { |
| 76 | conn = DBUtils_MS.getConnection(); | 78 | conn = DBUtils_MS.getConnection(); |
| @@ -90,22 +92,29 @@ public class NowOutboundServiceImpl implements NowOutboundService{ | @@ -90,22 +92,29 @@ public class NowOutboundServiceImpl implements NowOutboundService{ | ||
| 90 | } | 92 | } |
| 91 | 93 | ||
| 92 | static List<Outbound> resultSet2Set(ResultSet rs) throws SQLException{ | 94 | static List<Outbound> resultSet2Set(ResultSet rs) throws SQLException{ |
| 93 | - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); | 95 | + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| 94 | List<Outbound> list=new ArrayList<Outbound>(); | 96 | List<Outbound> list=new ArrayList<Outbound>(); |
| 95 | Outbound outbound; | 97 | Outbound outbound; |
| 98 | + Location location; | ||
| 96 | while(rs.next()){ | 99 | while(rs.next()){ |
| 97 | outbound=new Outbound(); | 100 | outbound=new Outbound(); |
| 98 | - // outbound.setId(Integer.valueOf(rs.getObject("id").toString())); | 101 | + outbound.setId(Integer.valueOf(rs.getObject("id").toString())); |
| 99 | outbound.setLine(Integer.valueOf(rs.getObject("line").toString())); | 102 | outbound.setLine(Integer.valueOf(rs.getObject("line").toString())); |
| 100 | outbound.setUpDown(Integer.valueOf(rs.getObject("up_down").toString())); | 103 | outbound.setUpDown(Integer.valueOf(rs.getObject("up_down").toString())); |
| 101 | - outbound.setLon(Float.valueOf(rs.getObject("lon").toString())); | ||
| 102 | - outbound.setLat(Float.valueOf(rs.getObject("lat").toString())); | 104 | + //将gps的经纬度转成百度的经纬度 |
| 105 | + location = TransGPS.bd_encrypt(TransGPS.transformFromWGSToGCJ(TransGPS.LocationMake(rs.getFloat("startLon"), rs.getFloat("startLat")))); | ||
| 106 | + outbound.setLon((float)location.getLng()); | ||
| 107 | + outbound.setLat((float)location.getLat()); | ||
| 108 | + location = TransGPS.bd_encrypt(TransGPS.transformFromWGSToGCJ(TransGPS.LocationMake(rs.getFloat("endLon"), rs.getFloat("endLat")))); | ||
| 109 | + outbound.setEndlon((float)location.getLng()); | ||
| 110 | + outbound.setEndlat((float)location.getLat()); | ||
| 111 | + outbound.setTimestamp((Long.valueOf(rs.getObject("startTimestamp").toString()))); | ||
| 112 | + outbound.setTimestampDate(sdf.format(new Date(outbound.getTimestamp()))); | ||
| 113 | + outbound.setEndtimestamp((Long.valueOf(rs.getObject("endTimestamp").toString()))); | ||
| 114 | + outbound.setEndtimestampDate(sdf.format(new Date(outbound.getEndtimestamp()))); | ||
| 103 | //run 时注解 | 115 | //run 时注解 |
| 104 | outbound.setLineName(BasicData.lineCode2NameMap.get(outbound.getLine().toString())); | 116 | outbound.setLineName(BasicData.lineCode2NameMap.get(outbound.getLine().toString())); |
| 105 | - outbound.setTimestamp((Long.valueOf(rs.getObject("timestamp").toString()))); | ||
| 106 | - outbound.setTimestampDate(sdf.format(new Date(outbound.getTimestamp()))); | ||
| 107 | outbound.setVehicle(BasicData.deviceId2NbbmMap.get(rs.getObject("vehicle").toString())); | 117 | outbound.setVehicle(BasicData.deviceId2NbbmMap.get(rs.getObject("vehicle").toString())); |
| 108 | -// outbound.setLocation(rs.getObject("location")==null?"":rs.getObject("location").toString()); | ||
| 109 | list.add(outbound); | 118 | list.add(outbound); |
| 110 | } | 119 | } |
| 111 | return list; | 120 | return list; |
| @@ -114,7 +123,7 @@ public class NowOutboundServiceImpl implements NowOutboundService{ | @@ -114,7 +123,7 @@ public class NowOutboundServiceImpl implements NowOutboundService{ | ||
| 114 | @Override | 123 | @Override |
| 115 | public PageObject<Outbound> Pagequery(Map<String, Object> map) { | 124 | public PageObject<Outbound> Pagequery(Map<String, Object> map) { |
| 116 | // TODO Auto-generated method stub PageObject<Outbound> Pagequery | 125 | // TODO Auto-generated method stub PageObject<Outbound> Pagequery |
| 117 | - String sql="select count(*) record from bsth_c_outbound where 1=1 "; | 126 | + String sql="select count(*) record from bsth_c_outbound_handle where 1=1 "; |
| 118 | Object line=map.get("line"); | 127 | Object line=map.get("line"); |
| 119 | Object nbbm=map.get("nbbm"); | 128 | Object nbbm=map.get("nbbm"); |
| 120 | Object updown=map.get("updown"); | 129 | Object updown=map.get("updown"); |
| @@ -139,7 +148,7 @@ public class NowOutboundServiceImpl implements NowOutboundService{ | @@ -139,7 +148,7 @@ public class NowOutboundServiceImpl implements NowOutboundService{ | ||
| 139 | try { | 148 | try { |
| 140 | Long t1=sdf.parse(date.toString()+" 00:00:00").getTime(); | 149 | Long t1=sdf.parse(date.toString()+" 00:00:00").getTime(); |
| 141 | Long t2=sdf.parse(date.toString()+" 23:59:59").getTime(); | 150 | Long t2=sdf.parse(date.toString()+" 23:59:59").getTime(); |
| 142 | - sql += " and timestamp >="+t1 +" and timestamp <="+t2; | 151 | + sql += " and starttimestamp >="+t1 +" and endtimestamp <="+t2; |
| 143 | } catch (ParseException e) { | 152 | } catch (ParseException e) { |
| 144 | // TODO Auto-generated catch block | 153 | // TODO Auto-generated catch block |
| 145 | e.printStackTrace(); | 154 | e.printStackTrace(); |
| @@ -147,6 +156,9 @@ public class NowOutboundServiceImpl implements NowOutboundService{ | @@ -147,6 +156,9 @@ public class NowOutboundServiceImpl implements NowOutboundService{ | ||
| 147 | } | 156 | } |
| 148 | 157 | ||
| 149 | } | 158 | } |
| 159 | + | ||
| 160 | + sql +=" and endtimestamp - starttimestamp >10000 ";//yue越界超过10秒的才显示,有待探讨。 | ||
| 161 | + | ||
| 150 | Connection conn = null; | 162 | Connection conn = null; |
| 151 | PreparedStatement ps = null; | 163 | PreparedStatement ps = null; |
| 152 | ResultSet rs = null; | 164 | ResultSet rs = null; |
| @@ -165,10 +177,9 @@ public class NowOutboundServiceImpl implements NowOutboundService{ | @@ -165,10 +177,9 @@ public class NowOutboundServiceImpl implements NowOutboundService{ | ||
| 165 | }finally { | 177 | }finally { |
| 166 | DBUtils_MS.close(rs, ps, conn); | 178 | DBUtils_MS.close(rs, ps, conn); |
| 167 | } | 179 | } |
| 168 | - | ||
| 169 | PageHelper pageHelper = new PageHelper(totalData, map); | 180 | PageHelper pageHelper = new PageHelper(totalData, map); |
| 170 | List<Outbound> list=findAll(pageHelper.getMap()); | 181 | List<Outbound> list=findAll(pageHelper.getMap()); |
| 171 | - for (int i = 0; i < list.size(); i++) { | 182 | +/* for (int i = 0; i < list.size(); i++) { |
| 172 | String nbbm2=list.get(i).getVehicle() ; | 183 | String nbbm2=list.get(i).getVehicle() ; |
| 173 | Long d1=list.get(i).getTimestamp(); | 184 | Long d1=list.get(i).getTimestamp(); |
| 174 | Date datess = new Date(d1); | 185 | Date datess = new Date(d1); |
| @@ -194,7 +205,7 @@ public class NowOutboundServiceImpl implements NowOutboundService{ | @@ -194,7 +205,7 @@ public class NowOutboundServiceImpl implements NowOutboundService{ | ||
| 194 | 205 | ||
| 195 | } | 206 | } |
| 196 | 207 | ||
| 197 | - } | 208 | + }*/ |
| 198 | PageObject<Outbound> pageObject = pageHelper.getPageObject(); | 209 | PageObject<Outbound> pageObject = pageHelper.getPageObject(); |
| 199 | pageObject.setDataList(list); | 210 | pageObject.setDataList(list); |
| 200 | return pageObject; | 211 | return pageObject; |
| @@ -319,4 +330,45 @@ public class NowOutboundServiceImpl implements NowOutboundService{ | @@ -319,4 +330,45 @@ public class NowOutboundServiceImpl implements NowOutboundService{ | ||
| 319 | 330 | ||
| 320 | return dataList; | 331 | return dataList; |
| 321 | } | 332 | } |
| 333 | + | ||
| 334 | + @Override | ||
| 335 | + public List<Outbound> findPosition(String deviceid, String startdate, | ||
| 336 | + String enddate){ | ||
| 337 | + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); | ||
| 338 | + String sql = "select vehicle,line,up_down,lon,lat,timestamp from bsth_c_outbound where vehicle = ? and timestamp >= ? and timestamp <= ? order by timestamp "; | ||
| 339 | + Connection conn = null; | ||
| 340 | + PreparedStatement ps = null; | ||
| 341 | + ResultSet rs = null; | ||
| 342 | + List<Outbound> listResult = new ArrayList<Outbound>(); | ||
| 343 | + Outbound outbound = null; | ||
| 344 | + try { | ||
| 345 | + conn = DBUtils_MS.getConnection(); | ||
| 346 | + ps = conn.prepareStatement(sql); | ||
| 347 | + long startTime = sdf.parse(startdate).getTime(); | ||
| 348 | + long endTime = sdf.parse(enddate).getTime(); | ||
| 349 | + ps.setString(1, deviceid); | ||
| 350 | + ps.setLong(2,startTime); | ||
| 351 | + ps.setLong(3,endTime); | ||
| 352 | + rs = ps.executeQuery(); | ||
| 353 | + Location location; | ||
| 354 | + while (rs.next()) { | ||
| 355 | + outbound = new Outbound(); | ||
| 356 | + outbound.setVehicle(BasicData.deviceId2NbbmMap.get(rs.getObject("vehicle").toString())); | ||
| 357 | + location = TransGPS.LocationMake(rs.getFloat("lon"), rs.getFloat("lat")); | ||
| 358 | + location = TransGPS.bd_encrypt(TransGPS.transformFromWGSToGCJ(location)); | ||
| 359 | + outbound.setLon((float)location.getLng()); | ||
| 360 | + outbound.setLat((float)location.getLat()); | ||
| 361 | + outbound.setTimestamp(rs.getLong("timestamp")); | ||
| 362 | + // 上下行 | ||
| 363 | + listResult.add(outbound); | ||
| 364 | + } | ||
| 365 | + } catch (Exception e) { | ||
| 366 | + e.printStackTrace(); | ||
| 367 | + } finally { | ||
| 368 | + DBUtils_MS.close(rs, ps, conn); | ||
| 369 | + } | ||
| 370 | + return listResult; | ||
| 371 | + | ||
| 372 | + } | ||
| 373 | + | ||
| 322 | } | 374 | } |
src/main/java/com/bsth/service/excep/impl/NowSpeedingServiceImpl.java
| @@ -39,7 +39,7 @@ public class NowSpeedingServiceImpl implements NowSpeedingService { | @@ -39,7 +39,7 @@ public class NowSpeedingServiceImpl implements NowSpeedingService { | ||
| 39 | ResultSet rs = null; | 39 | ResultSet rs = null; |
| 40 | int page=Integer.parseInt(map.get("page").toString()); | 40 | int page=Integer.parseInt(map.get("page").toString()); |
| 41 | List<Speeding> list=new ArrayList<Speeding>(); | 41 | List<Speeding> list=new ArrayList<Speeding>(); |
| 42 | - String sql="select * from bsth_c_speedingmh where 1=1 "; | 42 | + String sql="select * from bsth_c_speeding_handle where 1=1 "; |
| 43 | Object line=map.get("line"); | 43 | Object line=map.get("line"); |
| 44 | Object updown=map.get("updown"); | 44 | Object updown=map.get("updown"); |
| 45 | Object startDate=map.get("startDate"); | 45 | Object startDate=map.get("startDate"); |
| @@ -128,7 +128,7 @@ public class NowSpeedingServiceImpl implements NowSpeedingService { | @@ -128,7 +128,7 @@ public class NowSpeedingServiceImpl implements NowSpeedingService { | ||
| 128 | 128 | ||
| 129 | @Override | 129 | @Override |
| 130 | public PageObject<Speeding> Pagequery(Map<String, Object> map) { | 130 | public PageObject<Speeding> Pagequery(Map<String, Object> map) { |
| 131 | - String sql="select count(*) record from bsth_c_speedingmh where 1=1 "; | 131 | + String sql="select count(*) record from bsth_c_speeding_handle where 1=1 "; |
| 132 | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); | 132 | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| 133 | Object line=map.get("line"); | 133 | Object line=map.get("line"); |
| 134 | Object updown=map.get("updown"); | 134 | Object updown=map.get("updown"); |
src/main/resources/static/pages/excep/js/line-list-function.js
| @@ -48,7 +48,7 @@ var PublicFunctions = function () { | @@ -48,7 +48,7 @@ var PublicFunctions = function () { | ||
| 48 | linePanlThree : function(lineId,data,direction) { | 48 | linePanlThree : function(lineId,data,direction) { |
| 49 | /** 获取站点路由信息 @param:<Line.id:线路Id;0:上行> @return:<resultdata:站点路由数据> */ | 49 | /** 获取站点路由信息 @param:<Line.id:线路Id;0:上行> @return:<resultdata:站点路由数据> */ |
| 50 | $get('/stationroute/getStationRouteCenterPoints',{lineId:lineId,direction:direction},function(resultdata) { | 50 | $get('/stationroute/getStationRouteCenterPoints',{lineId:lineId,direction:direction},function(resultdata) { |
| 51 | - SpeedingMap.clearMarkAndOverlays(); | 51 | + BasicMap.clearMarkAndOverlays(); |
| 52 | var polyline_center; | 52 | var polyline_center; |
| 53 | // 如果站点路由数据不为空 | 53 | // 如果站点路由数据不为空 |
| 54 | if(resultdata.length>0) { | 54 | if(resultdata.length>0) { |
| @@ -66,7 +66,7 @@ var PublicFunctions = function () { | @@ -66,7 +66,7 @@ var PublicFunctions = function () { | ||
| 66 | // 设置中心点 | 66 | // 设置中心点 |
| 67 | var point_center = new BMap.Point(bJwpointsArray[0],bJwpointsArray[1]); | 67 | var point_center = new BMap.Point(bJwpointsArray[0],bJwpointsArray[1]); |
| 68 | /** 在地图上画点 @param:<point_center:中心坐标点> */ | 68 | /** 在地图上画点 @param:<point_center:中心坐标点> */ |
| 69 | - SpeedingMap.drawingUpStationPoint(point_center,stationName,s+1); | 69 | + BasicMap.drawingUpStationPoint(point_center,stationName,s+1); |
| 70 | } | 70 | } |
| 71 | 71 | ||
| 72 | } | 72 | } |
| @@ -91,7 +91,7 @@ var PublicFunctions = function () { | @@ -91,7 +91,7 @@ var PublicFunctions = function () { | ||
| 91 | polylineArray.push(new BMap.Point(lineArray[i].split(' ')[0],lineArray[i].split(' ')[1])); | 91 | polylineArray.push(new BMap.Point(lineArray[i].split(' ')[0],lineArray[i].split(' ')[1])); |
| 92 | } | 92 | } |
| 93 | /** 在地图上画出线路走向 @param:<polylineArray:地图折线坐标点集合;resultdata:站点路由数据> */ | 93 | /** 在地图上画出线路走向 @param:<polylineArray:地图折线坐标点集合;resultdata:站点路由数据> */ |
| 94 | - SpeedingMap.drawingUpline01(polylineArray,polyline_center,data[d]); | 94 | + BasicMap.drawingUpline01(polylineArray,polyline_center,data[d]); |
| 95 | } | 95 | } |
| 96 | } | 96 | } |
| 97 | }); | 97 | }); |
src/main/resources/static/pages/excep/js/map.js
0 → 100644
| 1 | +/** | ||
| 2 | + * 百度地图 | ||
| 3 | + * | ||
| 4 | + * - - - - - -》init:地图初始化 | ||
| 5 | + * | ||
| 6 | + * - - - - - -》getDistanceAndDuration:获取距离与时间 | ||
| 7 | + * | ||
| 8 | + * - - - - - -》drawingUpline:在地图上画出上行线路走向 | ||
| 9 | + * | ||
| 10 | + * - - - - - -》stationsPointsToLibraryPoint:根据站点坐标匹配库中的公交站点(手动规划) | ||
| 11 | + */ | ||
| 12 | + | ||
| 13 | +var BasicMap = function () { | ||
| 14 | + | ||
| 15 | + /** BasicMap 全局变量定义 mapBValue:地图对象;polyUpline:走向折线;sectionList:截取过的路段 ;pointIndex:计算路段被切的次数; | ||
| 16 | + * firstPoint:截取路段的第一个点;iseditStatus:路段是否在编辑状态;isCutSection : 获取路段是否在截取状态*/ | ||
| 17 | + var mapBValue = '', polyUpline='', sectionList = [], pointIndex = 0, iseditStatus = false, firstPoint = {}, isCutSection = false; | ||
| 18 | + | ||
| 19 | + var Bmap = { | ||
| 20 | + | ||
| 21 | + init : function() { | ||
| 22 | + | ||
| 23 | + // 设置中心点, | ||
| 24 | + var CENTER_POINT = {lng : 121.528733,lat : 31.237425}; | ||
| 25 | + | ||
| 26 | + // 百度API Key | ||
| 27 | + var bdKey = 'IGGrr4UjwIYzatoCRFKEL8sT'; | ||
| 28 | + | ||
| 29 | + // 初始化百度地图 | ||
| 30 | + mapBValue = new BMap.Map("BasicMap"); | ||
| 31 | + | ||
| 32 | + //中心点和缩放级别 | ||
| 33 | + mapBValue.centerAndZoom(new BMap.Point(CENTER_POINT.lng,CENTER_POINT.lat),15); | ||
| 34 | + | ||
| 35 | + //启用地图拖拽事件,默认启用(可不写) | ||
| 36 | + mapBValue.enableDragging(); | ||
| 37 | + | ||
| 38 | + //启用地图滚轮放大缩小 | ||
| 39 | + mapBValue.enableScrollWheelZoom(); | ||
| 40 | + | ||
| 41 | + //禁用鼠标双击放大 | ||
| 42 | + mapBValue.disableDoubleClickZoom(); | ||
| 43 | + | ||
| 44 | + //启用键盘上下左右键移动地图 | ||
| 45 | + mapBValue.enableKeyboard(); | ||
| 46 | + | ||
| 47 | + return mapBValue; | ||
| 48 | + }, | ||
| 49 | + /** 获取第一个切路段的点 @return Point*/ | ||
| 50 | + getFirstPoint : function() { | ||
| 51 | + return firstPoint; | ||
| 52 | + }, | ||
| 53 | + /** 获取地图对象 @return 地图对象map */ | ||
| 54 | + getmapBValue : function() { | ||
| 55 | + | ||
| 56 | + return mapBValue; | ||
| 57 | + | ||
| 58 | + }, | ||
| 59 | + | ||
| 60 | + getPolyUpline : function() { | ||
| 61 | + | ||
| 62 | + return polyUpline; | ||
| 63 | + }, | ||
| 64 | + | ||
| 65 | + /** 获取截取过的路段 @return 路段对象List */ | ||
| 66 | + getSectionList : function() { | ||
| 67 | + | ||
| 68 | + return sectionList; | ||
| 69 | + | ||
| 70 | + }, | ||
| 71 | + setSectionList : function(list) { | ||
| 72 | + | ||
| 73 | + sectionList = list; | ||
| 74 | + }, | ||
| 75 | + initCutSectionPoint : function() { | ||
| 76 | + sectionList = []; | ||
| 77 | + var tbodyHtml = template('section_list',{list : sectionList}); | ||
| 78 | + $('#section_table tbody').html(tbodyHtml); | ||
| 79 | + }, | ||
| 80 | + /** 获取切路段的点下标 @return int*/ | ||
| 81 | + setPointIndex : function(index) { | ||
| 82 | + pointIndex = index; | ||
| 83 | + }, | ||
| 84 | + getPointIndex : function() { | ||
| 85 | + | ||
| 86 | + return pointIndex; | ||
| 87 | + | ||
| 88 | + }, | ||
| 89 | + /** 获取路段是否在编辑状态 @return boolean*/ | ||
| 90 | + getIsEditStatus : function() { | ||
| 91 | + return iseditStatus; | ||
| 92 | + }, | ||
| 93 | + setIsEditStatus : function(v) { | ||
| 94 | + iseditStatus = v ; | ||
| 95 | + }, | ||
| 96 | + | ||
| 97 | + /** 获取路段是否在截取状态 @return boolean*/ | ||
| 98 | + getIsCutSection : function() { | ||
| 99 | + return isCutSection; | ||
| 100 | + }, | ||
| 101 | + setIsCutSection : function(v) { | ||
| 102 | + isCutSection = v ; | ||
| 103 | + }, | ||
| 104 | + | ||
| 105 | + /** 获取距离与时间 @param <points:坐标点集合> */ | ||
| 106 | + getDistanceAndDuration : function(points,callback){ | ||
| 107 | + | ||
| 108 | + // 获取长度 | ||
| 109 | + var len = points.length; | ||
| 110 | + (function(){ | ||
| 111 | + | ||
| 112 | + if (!arguments.callee.count) { | ||
| 113 | + | ||
| 114 | + arguments.callee.count = 0; | ||
| 115 | + | ||
| 116 | + } | ||
| 117 | + | ||
| 118 | + arguments.callee.count++; | ||
| 119 | + | ||
| 120 | + var index = parseInt(arguments.callee.count) - 1; | ||
| 121 | + | ||
| 122 | + if (index >= len-1) { | ||
| 123 | + | ||
| 124 | + callback && callback(points); | ||
| 125 | + | ||
| 126 | + return; | ||
| 127 | + } | ||
| 128 | + | ||
| 129 | + // 当函数被调用时,它的arguments.callee对象就会指向自身,也就是一个对自己的引用。(当前正在执行的函数。) | ||
| 130 | + var f = arguments.callee; | ||
| 131 | + // 起点坐标 <坐标格式:40.056878,116.30815> | ||
| 132 | + var origin = points[index].potion.lat + ',' + points[index].potion.lng; | ||
| 133 | + | ||
| 134 | + // 终点坐标 <坐标格式:40.056878,116.30815> | ||
| 135 | + var destination = points[index+1].potion.lat + ',' + points[index+1].potion.lng; | ||
| 136 | + var region = '上海'; | ||
| 137 | + | ||
| 138 | + var origin_region = '上海'; | ||
| 139 | + | ||
| 140 | + var destination_region = '上海'; | ||
| 141 | + | ||
| 142 | + var output = 'json'; | ||
| 143 | + | ||
| 144 | + var ak_My = 'wjlITmXeCek5MxyU3ZUBkTeU8B0o0npk'; | ||
| 145 | + | ||
| 146 | + /** | ||
| 147 | + * origin:起点名称或经纬度; | ||
| 148 | + * | ||
| 149 | + * destination:终点名称或经纬度; | ||
| 150 | + * | ||
| 151 | + * origin_region:起始点所在城市,驾车导航时必填。 | ||
| 152 | + * | ||
| 153 | + * destination_region:终点所在城市,驾车导航时必填。 | ||
| 154 | + * | ||
| 155 | + * output :表示输出类型,可设置为xml或json,默认为xml。 | ||
| 156 | + * | ||
| 157 | + **/ | ||
| 158 | + var paramsB = {origin:origin,destination:destination,region:region,origin_region:origin_region,destination_region:destination_region,output:output,ak:ak_My}; | ||
| 159 | + | ||
| 160 | + /** @description :未认证开发者默认配额为:2000次/天。 */ | ||
| 161 | + $.ajax({ | ||
| 162 | + | ||
| 163 | + // 百度地图根据坐标获取两点之间的时间与距离 | ||
| 164 | + url: 'http://api.map.baidu.com/direction/v1?mode=transit', | ||
| 165 | + | ||
| 166 | + data: paramsB, | ||
| 167 | + | ||
| 168 | + dataType: 'jsonp', | ||
| 169 | + | ||
| 170 | + success: function(r){ | ||
| 171 | + | ||
| 172 | + if(r) { | ||
| 173 | + | ||
| 174 | + if(r.message=='ok') { | ||
| 175 | + | ||
| 176 | + if(r.result.taxi==null) { | ||
| 177 | + | ||
| 178 | + // 获取距离(单位:米) | ||
| 179 | + points[index+1].distance = 0; | ||
| 180 | + | ||
| 181 | + // 获取时间(单位:秒) | ||
| 182 | + points[index+1].duration = 0; | ||
| 183 | + | ||
| 184 | + }else { | ||
| 185 | + | ||
| 186 | + // 获取距离(单位:米) | ||
| 187 | + points[index+1].distance = r.result.taxi.distance; | ||
| 188 | + | ||
| 189 | + // 获取时间(单位:秒) | ||
| 190 | + points[index+1].duration = r.result.taxi.duration; | ||
| 191 | + | ||
| 192 | + } | ||
| 193 | + | ||
| 194 | + | ||
| 195 | + } | ||
| 196 | + | ||
| 197 | + } | ||
| 198 | + | ||
| 199 | + f(); | ||
| 200 | + } | ||
| 201 | + }); | ||
| 202 | + | ||
| 203 | + })(); | ||
| 204 | + | ||
| 205 | + }, | ||
| 206 | + // 在地图上画出上行线路走向 | ||
| 207 | + drawingUpline01 : function (polylineArray,polyline_center,data) { | ||
| 208 | + var polyUpline01 = 'polyline' + '_' + data.sectionrouteId; | ||
| 209 | + // 创建线路走向 | ||
| 210 | + polyUpline01 = new BMap.Polyline(polylineArray, {strokeColor : "blue",strokeWeight : 6,strokeOpacity : 0.5}); | ||
| 211 | + polyUpline01.data = data; | ||
| 212 | + // 把折线添加到地图上 | ||
| 213 | + mapBValue.addOverlay(polyUpline01); | ||
| 214 | + var sectionPoint = []; | ||
| 215 | + // 线路单击事件 | ||
| 216 | + polyUpline01.addEventListener('click',function(e) { | ||
| 217 | + if(BasicMap.getIsEditStatus()) { | ||
| 218 | + layer.msg('请先保存正在编辑的路段信息...'); | ||
| 219 | + return false; | ||
| 220 | + } | ||
| 221 | + if(BasicMap.getIsCutSection()) { | ||
| 222 | + layer.msg('请先撤销所有切路段的点...'); | ||
| 223 | + return false; | ||
| 224 | + } | ||
| 225 | + polyUpline01.enableEditing(); | ||
| 226 | + BasicMap.setIsEditStatus(true); | ||
| 227 | + }); | ||
| 228 | + | ||
| 229 | + // 添加路段双击事件 | ||
| 230 | + polyUpline01.addEventListener("dblclick",function(e){ | ||
| 231 | + if(BasicMap.getIsCutSection()) { | ||
| 232 | + layer.msg('请先撤销所有切路段的点...'); | ||
| 233 | + return false; | ||
| 234 | + } | ||
| 235 | + BasicMap.setIsEditStatus(false); | ||
| 236 | + // 关闭 | ||
| 237 | + layer.closeAll(); | ||
| 238 | + polyUpline01.disableEditing(); | ||
| 239 | + EditSectionObj.setEitdSection(polyUpline01.data); | ||
| 240 | + // 获取折线坐标集合 | ||
| 241 | + var editPloyLineArray = polyUpline01.getPath(); | ||
| 242 | + EditSectionObj.setEitdBsectionVector(JSON.stringify(editPloyLineArray)); | ||
| 243 | + sectionList = []; | ||
| 244 | + var tbodyHtml = template('section_list',{list : sectionList}); | ||
| 245 | + // 截取路段 | ||
| 246 | + $('#section_table tbody').html(tbodyHtml); | ||
| 247 | + // 加载修改路段弹出层mobal页面 | ||
| 248 | + $.get('editsection.html', function(m){ | ||
| 249 | + $(pjaxContainer).append(m); | ||
| 250 | + $('#edit_section_mobal_cache').trigger('editSectionMobalCache_show', [BasicMap,GetAjaxData,EditSectionObj,PublicFunctions]); | ||
| 251 | + }); | ||
| 252 | + }); | ||
| 253 | + | ||
| 254 | + // 路段右击事件 | ||
| 255 | + var editSection = function(e,ee,marker){ | ||
| 256 | + if(BasicMap.getIsEditStatus()) { | ||
| 257 | + layer.msg('请先保存正在编辑的路段信息...'); | ||
| 258 | + return false; | ||
| 259 | + } | ||
| 260 | + var lng = e.lng; | ||
| 261 | + var lat = e.lat; | ||
| 262 | + var sectionName = null; | ||
| 263 | + var marker = new BMap.Marker(new BMap.Point(lng, lat)); // 创建点 | ||
| 264 | + marker.isFlag = true; | ||
| 265 | + if(pointIndex == 0) { | ||
| 266 | + sectionPoint[pointIndex] = {lng:lng , lat:lat}; | ||
| 267 | + layer.msg('进入切路段状态,请选择本路段的终点!'); | ||
| 268 | + mapBValue.addOverlay(marker);// 添加覆盖物 | ||
| 269 | + firstPoint = {lng:lng, lat:lat}; | ||
| 270 | + pointIndex++; | ||
| 271 | + EditSectionObj.setEitdSection(polyUpline01.data); | ||
| 272 | + // 获取折线坐标集合 | ||
| 273 | + var editPloyLineArray = polyUpline01.getPath(); | ||
| 274 | + EditSectionObj.setEitdBsectionVector(JSON.stringify(editPloyLineArray)); | ||
| 275 | + } else if (pointIndex > 0) { | ||
| 276 | + layer.prompt({title: '请输入路段名!'}, function(sectionName, index){ | ||
| 277 | + pointList = []; | ||
| 278 | + sectionPoint[pointIndex] = {lng:lng , lat:lat}; | ||
| 279 | + pointList[0] = sectionPoint[pointIndex-1]; | ||
| 280 | + pointList[1] = sectionPoint[pointIndex]; | ||
| 281 | + sectionList.push({name:sectionName, section:pointList}); | ||
| 282 | + layer.close(index); | ||
| 283 | + layer.msg('路段截取成功,请选择下一个路段的终点'); | ||
| 284 | + mapBValue.addOverlay(marker);// 添加覆盖物 | ||
| 285 | + var tbodyHtml = template('section_list',{list : sectionList}); | ||
| 286 | + // 截取路段 | ||
| 287 | + $('#section_table tbody').html(tbodyHtml); | ||
| 288 | + pointIndex++; | ||
| 289 | + }); | ||
| 290 | + } | ||
| 291 | + BasicMap.setIsCutSection(true); | ||
| 292 | + } | ||
| 293 | + var markerMenu=new BMap.ContextMenu(); | ||
| 294 | + markerMenu.addItem(new BMap.MenuItem('切路段',editSection.bind(polyUpline01))); | ||
| 295 | + polyUpline01.addContextMenu(markerMenu); | ||
| 296 | + | ||
| 297 | + | ||
| 298 | + var PanOptions_ ={noAnimation :true}; | ||
| 299 | + mapBValue.reset(); | ||
| 300 | + mapBValue.panTo(polyline_center,PanOptions_); | ||
| 301 | + mapBValue.panBy(500,-510,PanOptions_); | ||
| 302 | + mapBValue.setZoom(14); | ||
| 303 | + }, | ||
| 304 | + // 删除点刷新cutSectionTable | ||
| 305 | + refreshCutSectionTable : function() { | ||
| 306 | + var tbodyHtml = template('section_list',{list : sectionList}); | ||
| 307 | + $('#section_table tbody').html(tbodyHtml); | ||
| 308 | + }, | ||
| 309 | + // 删除点刷新覆盖物 | ||
| 310 | + deleteCutSectionPoint : function(point) { | ||
| 311 | + var lng = point.lng; | ||
| 312 | + var lat = point.lat; | ||
| 313 | + var allOverlay = mapBValue.getOverlays(); | ||
| 314 | + // 删除最后一个点 | ||
| 315 | + for (var i = 0; i < allOverlay.length -1; i++){ | ||
| 316 | + if(allOverlay[i].isFlag) { | ||
| 317 | + if(allOverlay[i].point.lng == lng && allOverlay[i].point.lat == lat){ | ||
| 318 | + mapBValue.removeOverlay(allOverlay[i]); | ||
| 319 | + break; | ||
| 320 | + } | ||
| 321 | + } | ||
| 322 | + } | ||
| 323 | + }, | ||
| 324 | + /** 在地图上画点 @param:<point_center:中心坐标点> */ | ||
| 325 | + drawingUpStationPoint : function(point_center,stationName,s) { | ||
| 326 | + | ||
| 327 | + // 自定义标注物图片 | ||
| 328 | + var icon_target = new BMap.Icon('/pages/base/stationroute/css/img/gjzd.png',new BMap.Size(10, 10)); | ||
| 329 | + | ||
| 330 | + var html2 = '<div style="position: absolute; margin: 0pt; padding: 0pt; width: 160px; height: 26px; left: -10px; top: -35px; overflow: hidden;">' | ||
| 331 | + + '<img class="rm3_image" style="border:none;left:0px; top:0px; position:absolute;" src="/pages/base/stationroute/css/img/back160.png">' | ||
| 332 | + + '</div>' | ||
| 333 | + + '<label class=" BMapLabel" unselectable="on" style="position: absolute; -moz-user-select: none; display: inline; cursor: inherit; border: 0px none; padding: 2px 1px 1px; white-space: nowrap; font: 12px arial,simsun; z-index: 80; color: rgb(255, 102, 0); left: 15px; top: -35px;"><span style="float: left; color: #fdfdfd; margin-left: -22px; font-size: 6px;">'+ s+'</span>'+ stationName+'</label>'; | ||
| 334 | + | ||
| 335 | + | ||
| 336 | + var myRichMarker1 = new BMapLib.RichMarker(html2, point_center,{ | ||
| 337 | + "anchor" : new BMap.Size(-10,8), | ||
| 338 | + "enableDragging" : true}); | ||
| 339 | + | ||
| 340 | + | ||
| 341 | + myRichMarker1.disableDragging(); | ||
| 342 | + mapBValue.addOverlay(myRichMarker1); | ||
| 343 | + | ||
| 344 | + | ||
| 345 | + // 创建标注物 | ||
| 346 | + marker = new BMap.Marker(point_center,{icon : icon_target}); | ||
| 347 | + | ||
| 348 | + // 允许覆盖物在map.clearOverlays方法中被清除。 | ||
| 349 | + marker.enableMassClear(); | ||
| 350 | + | ||
| 351 | + mapBValue.addOverlay(marker); | ||
| 352 | + }, | ||
| 353 | + | ||
| 354 | + // 根据站点坐标匹配库中的公交站点(手动规划) | ||
| 355 | + stationsPointsToLibraryPoint : function(arra,callback) { | ||
| 356 | + // 获取长度 | ||
| 357 | + var len = arra.length; | ||
| 358 | + var station = {}; | ||
| 359 | + var stationList = []; | ||
| 360 | + (function(){ | ||
| 361 | + if (!arguments.callee.count) { | ||
| 362 | + arguments.callee.count = 0; | ||
| 363 | + } | ||
| 364 | + arguments.callee.count++; | ||
| 365 | + var index = parseInt(arguments.callee.count) - 1; | ||
| 366 | + if (index >= len) { | ||
| 367 | + callback && callback(stationList); | ||
| 368 | + return ; | ||
| 369 | + } | ||
| 370 | + var f = arguments.callee; | ||
| 371 | + station = arra[index]; | ||
| 372 | + if(arra[index].name!=''){ | ||
| 373 | + | ||
| 374 | + $.get('/station/matchStation',station,function(resultStation) { | ||
| 375 | + stationList.push({name:resultStation.name ,wgs:arra[index].wgs,potion:{lng:resultStation.potion_lng, lat:resultStation.potion_lat}, isHave:resultStation.isHave , id:resultStation.id}); | ||
| 376 | + f(); | ||
| 377 | + }); | ||
| 378 | + }else { | ||
| 379 | + f(); | ||
| 380 | + } | ||
| 381 | + })() | ||
| 382 | + }, | ||
| 383 | + clearMarkAndOverlays : function() { | ||
| 384 | + | ||
| 385 | + // 清楚地图覆盖物 | ||
| 386 | + mapBValue.clearOverlays(); | ||
| 387 | + | ||
| 388 | + mapBValue.removeOverlay(); | ||
| 389 | + | ||
| 390 | + } | ||
| 391 | + | ||
| 392 | + } | ||
| 393 | + | ||
| 394 | + return Bmap; | ||
| 395 | + | ||
| 396 | +}(); | ||
| 0 | \ No newline at end of file | 397 | \ No newline at end of file |
src/main/resources/static/pages/excep/mhspeedingList.html
| @@ -128,7 +128,7 @@ | @@ -128,7 +128,7 @@ | ||
| 128 | data-startdate="{{obj.timestampDate}}" data-enddate="{{obj.endtimestampDate}}" | 128 | data-startdate="{{obj.timestampDate}}" data-enddate="{{obj.endtimestampDate}}" |
| 129 | data-lon="{{obj.lon}}" data-lat="{{obj.lat}}" data-endlon="{{obj.endlon}}" | 129 | data-lon="{{obj.lon}}" data-lat="{{obj.lat}}" data-endlon="{{obj.endlon}}" |
| 130 | data-endlat="{{obj.endlat}}" data-lineid="{{obj.lineId}}" data-updown="{{obj.upDown}}"> | 130 | data-endlat="{{obj.endlat}}" data-lineid="{{obj.lineId}}" data-updown="{{obj.upDown}}"> |
| 131 | - 查看轨迹 | 131 | + 轨迹回放 |
| 132 | </a> | 132 | </a> |
| 133 | </td> | 133 | </td> |
| 134 | <td> | 134 | <td> |
| @@ -270,7 +270,6 @@ $(function(){ | @@ -270,7 +270,6 @@ $(function(){ | ||
| 270 | index++; | 270 | index++; |
| 271 | }); | 271 | }); |
| 272 | })(); | 272 | })(); |
| 273 | - console.log(listResult); | ||
| 274 | }); | 273 | }); |
| 275 | } | 274 | } |
| 276 | 275 |
src/main/resources/static/pages/excep/pdboundList.html
| @@ -56,10 +56,10 @@ | @@ -56,10 +56,10 @@ | ||
| 56 | <th width="3%">#</th> | 56 | <th width="3%">#</th> |
| 57 | <th width="15%">线路</th> | 57 | <th width="15%">线路</th> |
| 58 | <th width="13%">车辆自编号</th> | 58 | <th width="13%">车辆自编号</th> |
| 59 | - <th width="100">车辆坐标</th> | ||
| 60 | - <th width="11%">路牌名</th> | ||
| 61 | <th width="10%">上下行</th> | 59 | <th width="10%">上下行</th> |
| 62 | - <th width="18%">时间</th> | 60 | + <th width="10%">越界位置</th> |
| 61 | + <th width="18%">越界开始时间</th> | ||
| 62 | + <th width="100">查看轨迹</th> | ||
| 63 | <th width="18%">操作</th> | 63 | <th width="18%">操作</th> |
| 64 | </tr> | 64 | </tr> |
| 65 | <tr role="row" class="filter"> | 65 | <tr role="row" class="filter"> |
| @@ -73,9 +73,6 @@ | @@ -73,9 +73,6 @@ | ||
| 73 | <select class="form-control" name="nbbm" id="nbbm" style="width: 150px;"></select> | 73 | <select class="form-control" name="nbbm" id="nbbm" style="width: 150px;"></select> |
| 74 | </td> | 74 | </td> |
| 75 | <td> | 75 | <td> |
| 76 | - </td> | ||
| 77 | - <td></td> | ||
| 78 | - <td> | ||
| 79 | <select class="form-control form-filter " name="updown"> | 76 | <select class="form-control form-filter " name="updown"> |
| 80 | <option value="">请选择...</option> | 77 | <option value="">请选择...</option> |
| 81 | <option value="0">上行</option> | 78 | <option value="0">上行</option> |
| @@ -84,8 +81,11 @@ | @@ -84,8 +81,11 @@ | ||
| 84 | </select> | 81 | </select> |
| 85 | </td> | 82 | </td> |
| 86 | <td> | 83 | <td> |
| 84 | + </td> | ||
| 85 | + <td> | ||
| 87 | <input class="form-control" type="date" name="date" /> | 86 | <input class="form-control" type="date" name="date" /> |
| 88 | </td> | 87 | </td> |
| 88 | + <td></td> | ||
| 89 | <td> | 89 | <td> |
| 90 | <button class="btn btn-sm green btn-outline filter-submit margin-bottom" > | 90 | <button class="btn btn-sm green btn-outline filter-submit margin-bottom" > |
| 91 | <i class="fa fa-search"></i> 搜索</button> | 91 | <i class="fa fa-search"></i> 搜索</button> |
| @@ -119,15 +119,6 @@ | @@ -119,15 +119,6 @@ | ||
| 119 | {{obj.vehicle}} | 119 | {{obj.vehicle}} |
| 120 | </td> | 120 | </td> |
| 121 | <td> | 121 | <td> |
| 122 | - <a href="/pages/excep/outBoundMap.html?no={{obj.line}},{{obj.upDown}},{{obj.lon}},{{obj.lat}}" | ||
| 123 | - class="btn default blue-stripe btn-sm" data-pjax> | ||
| 124 | - 查看车辆位置 | ||
| 125 | - </a> | ||
| 126 | - </td> | ||
| 127 | - <td> | ||
| 128 | - {{obj.lpname}} | ||
| 129 | - </td> | ||
| 130 | - <td> | ||
| 131 | {{if obj.upDown==0}} | 122 | {{if obj.upDown==0}} |
| 132 | 上行 | 123 | 上行 |
| 133 | {{else if obj.upDown==1}} | 124 | {{else if obj.upDown==1}} |
| @@ -137,9 +128,20 @@ | @@ -137,9 +128,20 @@ | ||
| 137 | {{/if}} | 128 | {{/if}} |
| 138 | </td> | 129 | </td> |
| 139 | <td> | 130 | <td> |
| 131 | + {{obj.id}} | ||
| 132 | + </td> | ||
| 133 | + <td> | ||
| 140 | {{obj.timestampDate}} | 134 | {{obj.timestampDate}} |
| 141 | </td> | 135 | </td> |
| 142 | <td> | 136 | <td> |
| 137 | + <a class="btn default blue-stripe btn-sm lookTrajectory" data-vehicle ="{{obj.vehicle}}" | ||
| 138 | + data-startdate="{{obj.timestampDate}}" data-enddate="{{obj.endtimestampDate}}" | ||
| 139 | + data-lon="{{obj.lon}}" data-lat="{{obj.lat}}" data-endlon="{{obj.endlon}}" | ||
| 140 | + data-endlat="{{obj.endlat}}" data-lineid="{{obj.lineId}}" data-updown="{{obj.upDown}}"> | ||
| 141 | + 轨迹回放 | ||
| 142 | + </a> | ||
| 143 | + </td> | ||
| 144 | + <td> | ||
| 143 | 145 | ||
| 144 | </td> | 146 | </td> |
| 145 | </tr> | 147 | </tr> |
| @@ -170,7 +172,6 @@ $(function(){ | @@ -170,7 +172,6 @@ $(function(){ | ||
| 170 | jsDoQuery(parameter,true); | 172 | jsDoQuery(parameter,true); |
| 171 | //重置 | 173 | //重置 |
| 172 | $('tr.filter .filter-cancel').on('click', function(){ | 174 | $('tr.filter .filter-cancel').on('click', function(){ |
| 173 | - debugger; | ||
| 174 | $('tr.filter input, select').val('').change(); | 175 | $('tr.filter input, select').val('').change(); |
| 175 | jsDoQuery(null, true); | 176 | jsDoQuery(null, true); |
| 176 | }); | 177 | }); |
| @@ -205,19 +206,55 @@ $(function(){ | @@ -205,19 +206,55 @@ $(function(){ | ||
| 205 | params['page'] = page; | 206 | params['page'] = page; |
| 206 | var i = layer.load(2); | 207 | var i = layer.load(2); |
| 207 | $get('/nowbound/pagequery' ,params, function(data){ | 208 | $get('/nowbound/pagequery' ,params, function(data){ |
| 208 | -// $.each(data.content, function(i, obj) { | ||
| 209 | -// obj.lastLoginDate = moment(obj.lastLoginDate).format("YYYY-MM-DD HH:mm:ss"); | ||
| 210 | -// }); | ||
| 211 | - var bodyHtm = template('bound_list_temp', {list: data.dataList}); | ||
| 212 | - $('#datatable_bound tbody').html(bodyHtm) | ||
| 213 | - .find('.icheck').iCheck(icheckOptions) | ||
| 214 | - .on('ifChanged', iCheckChange); | ||
| 215 | - if(pagination && data.dataList.length > 0){ | ||
| 216 | - //重新分页 | ||
| 217 | - initPagination = true; | ||
| 218 | - showPagination(data); | ||
| 219 | - } | ||
| 220 | - layer.close(i); | 209 | + var listResult = data.dataList; |
| 210 | + var index=0; | ||
| 211 | + (function(){ | ||
| 212 | + var f = arguments.callee; | ||
| 213 | + if(index >= listResult.length){ | ||
| 214 | + var bodyHtm = template('bound_list_temp', {list:listResult}); | ||
| 215 | + $('#datatable_bound tbody').html(bodyHtm).find('.icheck').iCheck(icheckOptions).on('ifChanged', iCheckChange); | ||
| 216 | + if(pagination && data.dataList.length > 0){ | ||
| 217 | + //重新分页 | ||
| 218 | + initPagination = true; | ||
| 219 | + showPagination(data); | ||
| 220 | + } | ||
| 221 | + layer.close(i); | ||
| 222 | + $(".lookTrajectory").click(function(){ | ||
| 223 | + var vehicle = $(this).data('vehicle'); | ||
| 224 | + var startDate = $(this).data('startdate'); | ||
| 225 | + var endDate = $(this).data('enddate'); | ||
| 226 | + var lon = $(this).data('lon'); | ||
| 227 | + var lat = $(this).data('lat'); | ||
| 228 | + var endLon = $(this).data('endlon'); | ||
| 229 | + var endLat = $(this).data('endlat'); | ||
| 230 | + var lineid = $(this).data('lineid'); | ||
| 231 | + var upDown = $(this).data('updown'); | ||
| 232 | + var storage = window.localStorage; | ||
| 233 | + storage.setItem("zbhAndDate",vehicle+","+startDate+","+endDate+","+lon+","+lat+","+endLon+","+endLat+","+lineid+","+upDown); | ||
| 234 | + $.get('/pages/excep/outboundMap.html?',function (result) { | ||
| 235 | + layer.open({ | ||
| 236 | + type: 1, | ||
| 237 | + title:'<i class="uk-icon-play-circle"></i>轨迹回放', | ||
| 238 | + shadeClose: true, | ||
| 239 | + shade: true, | ||
| 240 | + scrollbar: false, | ||
| 241 | + maxmin: false, //开启最大化最小化按钮 | ||
| 242 | + area: ['100%', '100%'], | ||
| 243 | + content:result,//内容 | ||
| 244 | + }); | ||
| 245 | + }); | ||
| 246 | + }) | ||
| 247 | + return; | ||
| 248 | + } | ||
| 249 | + var result = listResult[index]; | ||
| 250 | + new BMap.Geocoder().getLocation(new BMap.Point(result.lon,result.lat), function(rs){ | ||
| 251 | + var addComp = rs.addressComponents; | ||
| 252 | + result.address = addComp.district+addComp.street+addComp.streetNumber; | ||
| 253 | + f(); | ||
| 254 | + index++; | ||
| 255 | + }); | ||
| 256 | + })(); | ||
| 257 | + | ||
| 221 | }); | 258 | }); |
| 222 | } | 259 | } |
| 223 | 260 | ||
| @@ -345,7 +382,6 @@ $('#nbbm').select2({ | @@ -345,7 +382,6 @@ $('#nbbm').select2({ | ||
| 345 | 382 | ||
| 346 | //改变状态 | 383 | //改变状态 |
| 347 | function changeEnabled(id,enabled){ | 384 | function changeEnabled(id,enabled){ |
| 348 | - debugger | ||
| 349 | $get('/user/changeEnabled',{id:id,enabled:enabled},function(result){ | 385 | $get('/user/changeEnabled',{id:id,enabled:enabled},function(result){ |
| 350 | jsDoQuery(null, true); | 386 | jsDoQuery(null, true); |
| 351 | }) | 387 | }) |
src/main/resources/static/pages/excep/speedingMap.html
| @@ -8,18 +8,18 @@ | @@ -8,18 +8,18 @@ | ||
| 8 | <div id="titleMap"> | 8 | <div id="titleMap"> |
| 9 | <button id="run" style="margin-left:10px" class="btn btn-sm green btn-outline filter-submit margin-bottom">运行</button> | 9 | <button id="run" style="margin-left:10px" class="btn btn-sm green btn-outline filter-submit margin-bottom">运行</button> |
| 10 | </div> | 10 | </div> |
| 11 | -<div id="speedingMap"> | 11 | +<div id="BasicMap"> |
| 12 | </div> | 12 | </div> |
| 13 | <style type="text/css"> | 13 | <style type="text/css"> |
| 14 | 14 | ||
| 15 | -#speedingMap{ | 15 | +#BasicMap{ |
| 16 | width: 100%; | 16 | width: 100%; |
| 17 | border: 2px solid #fdfdfd; | 17 | border: 2px solid #fdfdfd; |
| 18 | height: calc(100% - 30px); | 18 | height: calc(100% - 30px); |
| 19 | overflow: hidden; | 19 | overflow: hidden; |
| 20 | } | 20 | } |
| 21 | </style> | 21 | </style> |
| 22 | -<script type="text/javascript" src="/pages/excep/js/speeding-map.js"></script> | 22 | +<script type="text/javascript" src="/pages/excep/js/map.js"></script> |
| 23 | <script type="text/javascript" src="/pages/excep/js/line-list-function.js"></script> | 23 | <script type="text/javascript" src="/pages/excep/js/line-list-function.js"></script> |
| 24 | 24 | ||
| 25 | <script type="text/javascript"> | 25 | <script type="text/javascript"> |
| @@ -55,16 +55,14 @@ $(function(){ | @@ -55,16 +55,14 @@ $(function(){ | ||
| 55 | } | 55 | } |
| 56 | }); | 56 | }); |
| 57 | setTimeout(function(){ | 57 | setTimeout(function(){ |
| 58 | - var map = SpeedingMap.init();//创建地图 | 58 | + var map = BasicMap.init();//创建地图 |
| 59 | + debugger; | ||
| 59 | $get('/sectionroute/findSection',{'line.id_eq' : lineid , 'directions_eq' :directionData},function(data) { | 60 | $get('/sectionroute/findSection',{'line.id_eq' : lineid , 'directions_eq' :directionData},function(data) { |
| 60 | // 在地图上画出线路走向 | 61 | // 在地图上画出线路走向 |
| 61 | PublicFunctions.linePanlThree(lineid,data,directionData); | 62 | PublicFunctions.linePanlThree(lineid,data,directionData); |
| 62 | }); | 63 | }); |
| 63 | var myP1 = new BMap.Point(lon,lat); //起点 | 64 | var myP1 = new BMap.Point(lon,lat); //起点 |
| 64 | var myP2 = new BMap.Point(endLon,endLat); //终点 | 65 | var myP2 = new BMap.Point(endLon,endLat); //终点 |
| 65 | -/* var centerLon = (parseFloat(lon)+parseFloat(endLon))/2; | ||
| 66 | - var centerLat = (parseFloat(lat)+parseFloat(endLat))/2; | ||
| 67 | - map.centerAndZoom(new BMap.Point(centerLon,centerLat),18);//地图中心点坐标 */ | ||
| 68 | for(i in Points){ | 66 | for(i in Points){ |
| 69 | coordinateArr.push(Points[i].coordinate); | 67 | coordinateArr.push(Points[i].coordinate); |
| 70 | } | 68 | } |