Commit 798badb33915f8929bd00920cfe91dddcdd342d7

Authored by 潘钊
2 parents 36c5f7da 62493ac8

Merge branch 'minhang' into pudong

Showing 24 changed files with 1489 additions and 472 deletions
src/main/java/com/bsth/entity/excep/Offline.java
... ... @@ -6,6 +6,7 @@ import javax.persistence.Entity;
6 6 import javax.persistence.GeneratedValue;
7 7 import javax.persistence.Id;
8 8 import javax.persistence.Table;
  9 +import javax.persistence.Transient;
9 10  
10 11 /**
11 12 * 掉线
... ... @@ -65,7 +66,12 @@ public class Offline {
65 66 */
66 67 private Date createDate;
67 68  
68   -
  69 + @Transient
  70 + private String nbbm;
  71 + @Transient
  72 + private String jsy;
  73 + @Transient
  74 + private String lpname;
69 75 public Integer getId() {
70 76 return id;
71 77 }
... ... @@ -146,5 +152,29 @@ public class Offline {
146 152 this.timestampDate = timestampDate;
147 153 }
148 154  
  155 + public String getNbbm() {
  156 + return nbbm;
  157 + }
  158 +
  159 + public void setNbbm(String nbbm) {
  160 + this.nbbm = nbbm;
  161 + }
149 162  
  163 + public String getJsy() {
  164 + return jsy;
  165 + }
  166 +
  167 + public void setJsy(String jsy) {
  168 + this.jsy = jsy;
  169 + }
  170 +
  171 + public String getLpname() {
  172 + return lpname;
  173 + }
  174 +
  175 + public void setLpname(String lpname) {
  176 + this.lpname = lpname;
  177 + }
  178 +
  179 +
150 180 }
... ...
src/main/java/com/bsth/entity/excep/Outbound.java
... ... @@ -6,6 +6,7 @@ import javax.persistence.Entity;
6 6 import javax.persistence.GeneratedValue;
7 7 import javax.persistence.Id;
8 8 import javax.persistence.Table;
  9 +import javax.persistence.Transient;
9 10  
10 11 /**
11 12 * 越界
... ... @@ -72,7 +73,12 @@ public class Outbound {
72 73 * 时间
73 74 */
74 75 private Date createDate;
75   -
  76 + @Transient
  77 + private String nbbm;
  78 + @Transient
  79 + private String jsy;
  80 + @Transient
  81 + private String lpname;
76 82  
77 83 public Integer getId() {
78 84 return id;
... ... @@ -162,5 +168,29 @@ public class Outbound {
162 168 this.timestampDate = timestampDate;
163 169 }
164 170  
  171 + public String getNbbm() {
  172 + return nbbm;
  173 + }
  174 +
  175 + public void setNbbm(String nbbm) {
  176 + this.nbbm = nbbm;
  177 + }
  178 +
  179 + public String getJsy() {
  180 + return jsy;
  181 + }
  182 +
  183 + public void setJsy(String jsy) {
  184 + this.jsy = jsy;
  185 + }
  186 +
  187 + public String getLpname() {
  188 + return lpname;
  189 + }
  190 +
  191 + public void setLpname(String lpname) {
  192 + this.lpname = lpname;
  193 + }
  194 +
165 195  
166 196 }
... ...
src/main/java/com/bsth/entity/excep/Speeding.java
... ... @@ -6,6 +6,7 @@ import javax.persistence.Entity;
6 6 import javax.persistence.GeneratedValue;
7 7 import javax.persistence.Id;
8 8 import javax.persistence.Table;
  9 +import javax.persistence.Transient;
9 10  
10 11 /**
11 12 * 超速
... ... @@ -66,6 +67,13 @@ public class Speeding {
66 67 private String timestampDate;
67 68  
68 69  
  70 + @Transient
  71 + private String nbbm;
  72 + @Transient
  73 + private String jsy;
  74 + @Transient
  75 + private String lpname;
  76 +
69 77 /**
70 78 * 创建时间
71 79 */
... ... @@ -161,6 +169,30 @@ public class Speeding {
161 169 this.timestampDate = timestampDate;
162 170 }
163 171  
  172 + public String getNbbm() {
  173 + return nbbm;
  174 + }
  175 +
  176 + public void setNbbm(String nbbm) {
  177 + this.nbbm = nbbm;
  178 + }
  179 +
  180 + public String getJsy() {
  181 + return jsy;
  182 + }
  183 +
  184 + public void setJsy(String jsy) {
  185 + this.jsy = jsy;
  186 + }
  187 +
  188 + public String getLpname() {
  189 + return lpname;
  190 + }
  191 +
  192 + public void setLpname(String lpname) {
  193 + this.lpname = lpname;
  194 + }
  195 +
164 196  
165 197  
166 198 }
... ...
src/main/java/com/bsth/service/excep/impl/OfflineServiceImpl.java
... ... @@ -12,10 +12,15 @@ import java.util.HashMap;
12 12 import java.util.List;
13 13 import java.util.Map;
14 14  
  15 +import org.springframework.beans.factory.annotation.Autowired;
  16 +import org.springframework.jdbc.core.JdbcTemplate;
  17 +import org.springframework.jdbc.core.RowMapper;
15 18 import org.springframework.stereotype.Service;
16 19  
17 20 import com.bsth.data.BasicData;
18 21 import com.bsth.entity.excep.Offline;
  22 +import com.bsth.entity.oil.Ylb;
  23 +import com.bsth.entity.realcontrol.ScheduleRealInfo;
19 24 import com.bsth.service.excep.OfflineService;
20 25 import com.bsth.util.EchartConver;
21 26 import com.bsth.util.PageHelper;
... ... @@ -27,6 +32,8 @@ import com.google.gson.Gson;
27 32 @Service
28 33 public class OfflineServiceImpl implements OfflineService {
29 34  
  35 + @Autowired
  36 + JdbcTemplate jdbcTemplate;
30 37 // @Override
31 38 static List<Offline> findAll(Map<String, Object> map) {
32 39 // TODO Auto-generated method stub
... ... @@ -53,7 +60,9 @@ public class OfflineServiceImpl implements OfflineService {
53 60 }
54 61  
55 62 if(nbbm!=null){
56   - sql +=" and vehicle like '%"+nbbm.toString()+"%'";
  63 + nbbm=BasicData.deviceId2NbbmMap.inverse().get(nbbm);
  64 + if(nbbm!=null)
  65 + sql +=" and vehicle like '%"+nbbm+"%'";
57 66 }
58 67  
59 68 if(updown!=null){
... ... @@ -61,7 +70,7 @@ public class OfflineServiceImpl implements OfflineService {
61 70 }
62 71 if(date!=null){
63 72 if (date.toString().length()>0) {
64   - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:MM:SS");
  73 + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
65 74 try {
66 75 Long t1=sdf.parse(date.toString()+" 00:00:00").getTime();
67 76 Long t2=sdf.parse(date.toString()+" 23:59:59").getTime();
... ... @@ -112,7 +121,7 @@ public class OfflineServiceImpl implements OfflineService {
112 121 offline.setTimestamp(Long.valueOf(rs.getObject("timestamp").toString()));
113 122 offline.setTimestampDate(sdf.format(new Date(offline.getTimestamp())));
114 123 offline.setUpDown(Integer.valueOf(rs.getObject("up_down").toString()));
115   - offline.setVehicle(rs.getObject("vehicle").toString());
  124 + offline.setVehicle(BasicData.deviceId2NbbmMap.get(rs.getObject("vehicle").toString()));
116 125 list.add(offline);
117 126 }
118 127 return list;
... ... @@ -135,7 +144,9 @@ public class OfflineServiceImpl implements OfflineService {
135 144 }
136 145  
137 146 if(nbbm!=null){
138   - sql +=" and vehicle like '%"+nbbm.toString()+"%'";
  147 + nbbm=BasicData.deviceId2NbbmMap.inverse().get(nbbm);
  148 + if(nbbm!=null)
  149 + sql +=" and vehicle like '%"+nbbm+"%'";
139 150 }
140 151  
141 152 if(updown!=null){
... ... @@ -143,7 +154,7 @@ public class OfflineServiceImpl implements OfflineService {
143 154 }
144 155 if(date!=null){
145 156 if (date.toString().length()>0) {
146   - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:MM:SS");
  157 + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
147 158 try {
148 159 Long t1=sdf.parse(date.toString()+" 00:00:00").getTime();
149 160 Long t2=sdf.parse(date.toString()+" 23:59:59").getTime();
... ... @@ -177,8 +188,41 @@ public class OfflineServiceImpl implements OfflineService {
177 188 PageHelper pageHelper = new PageHelper(totalData, map);
178 189 // List<T> list = this.baseDao.queryByObject(pageHelper.getMap());
179 190 List<Offline> list=findAll(pageHelper.getMap());
  191 + for (int i = 0; i < list.size(); i++) {
  192 + String nbbm2=list.get(i).getVehicle() ;
  193 + Long d1=list.get(i).getTimestamp();
  194 + Date datess = new Date(d1);
  195 + String dates=new SimpleDateFormat("yyyy-MM-dd").format(datess);
  196 + String sk=new SimpleDateFormat("HH:mm").format(datess);
  197 + String sqlPbb="select * from bsth_c_s_sp_info_real where cl_zbh='"+nbbm2+"' and"
  198 + + " real_exec_date='"+dates+"' ";
  199 +// + "and fcsj_actual > '"+sk+"' ";
  200 +// + "and '"+sk+"' <dfsj";
  201 + List<ScheduleRealInfo> pbb =jdbcTemplate.query(sqlPbb,
  202 + new RowMapper<ScheduleRealInfo>(){
  203 + @Override
  204 + public ScheduleRealInfo mapRow(ResultSet rs, int rowNum) throws SQLException {
  205 + ScheduleRealInfo s = new ScheduleRealInfo();
  206 + s.setjGh(rs.getString("j_gh"));
  207 + s.setjName(rs.getString("j_name"));
  208 + s.setLpName(rs.getString("lp_name"));
  209 + return s;
  210 + }
  211 + });
  212 + if(pbb.size()>0){
  213 + list.get(i).setJsy(pbb.get(0).getjGh()+"/"+pbb.get(0).getjName());
  214 + list.get(i).setLpname(pbb.get(0).getLpName());
  215 +
  216 + }
  217 +
  218 + }
180 219 PageObject<Offline> pageObject = pageHelper.getPageObject();
181   - pageObject.setDataList(list);
  220 +// for (int i = 0; i < list.size(); i++) {
  221 +// if(list.get(i).getLpname()!=null){
  222 + pageObject.setDataList(list);
  223 +// }
  224 +// }
  225 +
182 226 return pageObject;
183 227 }
184 228 public static void main(String[] args) {
... ...
src/main/java/com/bsth/service/excep/impl/OutboundServiceImpl.java
... ... @@ -12,10 +12,14 @@ import java.util.HashMap;
12 12 import java.util.List;
13 13 import java.util.Map;
14 14  
  15 +import org.springframework.beans.factory.annotation.Autowired;
  16 +import org.springframework.jdbc.core.JdbcTemplate;
  17 +import org.springframework.jdbc.core.RowMapper;
15 18 import org.springframework.stereotype.Service;
16 19  
17 20 import com.bsth.data.BasicData;
18 21 import com.bsth.entity.excep.Outbound;
  22 +import com.bsth.entity.realcontrol.ScheduleRealInfo;
19 23 import com.bsth.service.excep.OutboundService;
20 24 import com.bsth.util.EchartConver;
21 25 import com.bsth.util.PageHelper;
... ... @@ -25,8 +29,9 @@ import com.github.abel533.echarts.Option;
25 29 import com.google.gson.Gson;
26 30 @Service
27 31 public class OutboundServiceImpl implements OutboundService{
28   -
29   - static List<Outbound> findAll(Map<String, Object> map) {
  32 + @Autowired
  33 + JdbcTemplate jdbcTemplate;
  34 + static List<Outbound> findAll(Map<String, Object> map) {
30 35 Connection conn = null;
31 36 PreparedStatement ps = null;
32 37 ResultSet rs = null;
... ... @@ -37,12 +42,13 @@ public class OutboundServiceImpl implements OutboundService{
37 42 Object nbbm=map.get("nbbm");
38 43 Object updown=map.get("updown");
39 44 Object date=map.get("date");
40   -
41 45 if(line!=null){
42 46 sql +=" and line like'%"+line.toString()+"%'";
43 47 }
44 48  
45 49 if(nbbm!=null){
  50 + nbbm=BasicData.deviceId2NbbmMap.inverse().get(nbbm);
  51 + if(nbbm!=null)
46 52 sql +=" and vehicle like '%"+nbbm.toString()+"%'";
47 53 }
48 54  
... ... @@ -51,7 +57,7 @@ public class OutboundServiceImpl implements OutboundService{
51 57 }
52 58 if(date!=null){
53 59 if (date.toString().length()>0) {
54   - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:MM:SS");
  60 + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
55 61 try {
56 62 Long t1=sdf.parse(date.toString()+" 00:00:00").getTime();
57 63 Long t2=sdf.parse(date.toString()+" 23:59:59").getTime();
... ... @@ -98,7 +104,7 @@ public class OutboundServiceImpl implements OutboundService{
98 104 outbound.setTimestamp((Long.valueOf(rs.getObject("timestamp").toString())));
99 105 outbound.setTimestampDate(sdf.format(new Date(outbound.getTimestamp())));
100 106 outbound.setUpDown(Integer.valueOf(rs.getObject("up_down").toString()));
101   - outbound.setVehicle(rs.getObject("vehicle").toString());
  107 + outbound.setVehicle(BasicData.deviceId2NbbmMap.get(rs.getObject("vehicle").toString()));
102 108 outbound.setLocation(rs.getObject("location")==null?"":rs.getObject("location").toString());
103 109 list.add(outbound);
104 110 }
... ... @@ -119,6 +125,8 @@ public class OutboundServiceImpl implements OutboundService{
119 125 }
120 126  
121 127 if(nbbm!=null){
  128 + nbbm=BasicData.deviceId2NbbmMap.inverse().get(nbbm);
  129 + if(nbbm!=null)
122 130 sql +=" and vehicle like '%"+nbbm.toString()+"%'";
123 131 }
124 132  
... ... @@ -160,7 +168,34 @@ public class OutboundServiceImpl implements OutboundService{
160 168  
161 169 PageHelper pageHelper = new PageHelper(totalData, map);
162 170 List<Outbound> list=findAll(pageHelper.getMap());
163   -
  171 + for (int i = 0; i < list.size(); i++) {
  172 + String nbbm2=list.get(i).getVehicle() ;
  173 + Long d1=list.get(i).getTimestamp();
  174 + Date datess = new Date(d1);
  175 + String dates=new SimpleDateFormat("yyyy-MM-dd").format(datess);
  176 + String sk=new SimpleDateFormat("HH:mm").format(datess);
  177 + String sqlPbb="select * from bsth_c_s_sp_info_real where cl_zbh='"+nbbm2+"' and"
  178 + + " real_exec_date='"+dates+"' ";
  179 +// + "and fcsj_actual > '"+sk+"' ";
  180 +// + "and '"+sk+"' <dfsj";
  181 + List<ScheduleRealInfo> pbb =jdbcTemplate.query(sqlPbb,
  182 + new RowMapper<ScheduleRealInfo>(){
  183 + @Override
  184 + public ScheduleRealInfo mapRow(ResultSet rs, int rowNum) throws SQLException {
  185 + ScheduleRealInfo s = new ScheduleRealInfo();
  186 + s.setjGh(rs.getString("j_gh"));
  187 + s.setjName(rs.getString("j_name"));
  188 + s.setLpName(rs.getString("lp_name"));
  189 + return s;
  190 + }
  191 + });
  192 + if(pbb.size()>0){
  193 + list.get(i).setJsy(pbb.get(0).getjGh()+"/"+pbb.get(0).getjName());
  194 + list.get(i).setLpname(pbb.get(0).getLpName());
  195 +
  196 + }
  197 +
  198 + }
164 199 PageObject<Outbound> pageObject = pageHelper.getPageObject();
165 200 pageObject.setDataList(list);
166 201 return pageObject;
... ...
src/main/java/com/bsth/service/excep/impl/SpeedingServiceImpl.java
... ... @@ -12,10 +12,14 @@ import java.util.HashMap;
12 12 import java.util.List;
13 13 import java.util.Map;
14 14  
  15 +import org.springframework.jdbc.core.JdbcTemplate;
  16 +import org.springframework.jdbc.core.RowMapper;
15 17 import org.springframework.stereotype.Service;
  18 +import org.springframework.beans.factory.annotation.Autowired;
16 19  
17 20 import com.bsth.data.BasicData;
18 21 import com.bsth.entity.excep.Speeding;
  22 +import com.bsth.entity.realcontrol.ScheduleRealInfo;
19 23 import com.bsth.service.excep.SpeedingService;
20 24 import com.bsth.util.EchartConver;
21 25 import com.bsth.util.PageHelper;
... ... @@ -27,7 +31,8 @@ import com.google.gson.Gson;
27 31 @Service
28 32 public class SpeedingServiceImpl implements SpeedingService {
29 33  
30   -
  34 + @Autowired
  35 + JdbcTemplate jdbcTemplate;
31 36 static List<Speeding> findAll(Map<String, Object> map) {
32 37 Connection conn = null;
33 38 PreparedStatement ps = null;
... ... @@ -45,6 +50,8 @@ public class SpeedingServiceImpl implements SpeedingService {
45 50 }
46 51  
47 52 if(nbbm!=null){
  53 + nbbm=BasicData.deviceId2NbbmMap.inverse().get(nbbm);
  54 + if(nbbm!=null)
48 55 sql +=" and vehicle like '%"+nbbm.toString()+"%'";
49 56 }
50 57  
... ... @@ -53,7 +60,7 @@ public class SpeedingServiceImpl implements SpeedingService {
53 60 }
54 61 if(date!=null){
55 62 if (date.toString().length()>0) {
56   - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:MM:SS");
  63 + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
57 64 try {
58 65 Long t1=sdf.parse(date.toString()+" 00:00:00").getTime();
59 66 Long t2=sdf.parse(date.toString()+" 23:59:59").getTime();
... ... @@ -102,7 +109,7 @@ public class SpeedingServiceImpl implements SpeedingService {
102 109 speeding.setTimestamp((Long.valueOf(rs.getObject("timestamp").toString())));
103 110 speeding.setTimestampDate(sdf.format(new Date(speeding.getTimestamp())));
104 111 speeding.setUpDown(Integer.valueOf(rs.getObject("up_down").toString()));
105   - speeding.setVehicle(rs.getObject("vehicle").toString());
  112 + speeding.setVehicle(BasicData.deviceId2NbbmMap.get(rs.getObject("vehicle").toString()));
106 113 list.add(speeding);
107 114 }
108 115 return list;
... ... @@ -122,9 +129,10 @@ public class SpeedingServiceImpl implements SpeedingService {
122 129 }
123 130  
124 131 if(nbbm!=null){
  132 + nbbm=BasicData.deviceId2NbbmMap.inverse().get(nbbm);
  133 + if(nbbm!=null)
125 134 sql +=" and vehicle like '%"+nbbm.toString()+"%'";
126 135 }
127   -
128 136 if(updown!=null){
129 137 sql +="and up_down like '%"+updown.toString()+"%'";
130 138 }
... ... @@ -163,7 +171,34 @@ public class SpeedingServiceImpl implements SpeedingService {
163 171  
164 172 PageHelper pageHelper = new PageHelper(totalData, map);
165 173 List<Speeding> list=findAll(pageHelper.getMap());
166   -
  174 + for (int i = 0; i < list.size(); i++) {
  175 + String nbbm2=list.get(i).getVehicle() ;
  176 + Long d1=list.get(i).getTimestamp();
  177 + Date datess = new Date(d1);
  178 + String dates=new SimpleDateFormat("yyyy-MM-dd").format(datess);
  179 + String sk=new SimpleDateFormat("HH:mm").format(datess);
  180 + String sqlPbb="select * from bsth_c_s_sp_info_real where cl_zbh='"+nbbm2+"' and"
  181 + + " real_exec_date='"+dates+"' ";
  182 +// + "and fcsj_actual > '"+sk+"' ";
  183 +// + "and '"+sk+"' <dfsj";
  184 + List<ScheduleRealInfo> pbb =jdbcTemplate.query(sqlPbb,
  185 + new RowMapper<ScheduleRealInfo>(){
  186 + @Override
  187 + public ScheduleRealInfo mapRow(ResultSet rs, int rowNum) throws SQLException {
  188 + ScheduleRealInfo s = new ScheduleRealInfo();
  189 + s.setjGh(rs.getString("j_gh"));
  190 + s.setjName(rs.getString("j_name"));
  191 + s.setLpName(rs.getString("lp_name"));
  192 + return s;
  193 + }
  194 + });
  195 + if(pbb.size()>0){
  196 + list.get(i).setJsy(pbb.get(0).getjGh()+"/"+pbb.get(0).getjName());
  197 + list.get(i).setLpname(pbb.get(0).getLpName());
  198 +
  199 + }
  200 +
  201 + }
167 202 PageObject<Speeding> pageObject = pageHelper.getPageObject();
168 203 pageObject.setDataList(list);
169 204 return pageObject;
... ...
src/main/java/com/bsth/service/gps/GpsService.java
1 1 package com.bsth.service.gps;
2 2  
  3 +import com.bsth.service.gps.entity.GpsOutbound_DTO;
  4 +import com.bsth.service.gps.entity.GpsSpeed_DTO;
  5 +
3 6 import java.util.List;
4 7 import java.util.Map;
5 8  
... ... @@ -20,4 +23,8 @@ public interface GpsService {
20 23 Map<String,Object> gpsCompletion(long schId);
21 24  
22 25 Map<String,Object> history_v2(String nbbm, long st, long et);
  26 +
  27 + List<GpsSpeed_DTO> speeds(String nbbm, long st, long et);
  28 +
  29 + List<GpsOutbound_DTO> outbounds(String nbbm, long st, long et);
23 30 }
... ...
src/main/java/com/bsth/service/gps/GpsServiceImpl.java
... ... @@ -11,8 +11,7 @@ import com.bsth.entity.realcontrol.ScheduleRealInfo;
11 11 import com.bsth.repository.CarParkRepository;
12 12 import com.bsth.repository.StationRepository;
13 13 import com.bsth.repository.realcontrol.ScheduleRealInfoRepository;
14   -import com.bsth.service.gps.entity.HistoryGps_DTO;
15   -import com.bsth.service.gps.entity.Road_DTO;
  14 +import com.bsth.service.gps.entity.*;
16 15 import com.bsth.util.DateUtils;
17 16 import com.bsth.util.TransGPS;
18 17 import com.bsth.util.TransGPS.Location;
... ... @@ -192,7 +191,6 @@ public class GpsServiceImpl implements GpsService {
192 191 return (int) (Long.parseLong(o1.get("ts").toString()) - Long.parseLong(o2.get("ts").toString()));
193 192 }
194 193 });
195   - ;
196 194 return list;
197 195 }
198 196  
... ... @@ -207,10 +205,10 @@ public class GpsServiceImpl implements GpsService {
207 205 inv = inv.substring(0, inv.length() - 1);
208 206  
209 207 // 查询到离站数据
210   - Map<String, ArrivalEntity> arrivalMap = findArrivalByTs(weekOfYear/* 30 */, st, et, inv);
  208 + Map<String, ArrivalEntity> arrivalMap = findArrivalByTs(weekOfYear, st, et, inv);
211 209  
212 210 String sql = "select DEVICE_ID,LON,LAT,TS,INOUT_STOP,SERVICE_STATE ,STOP_NO,DIRECTION,LINE_ID,SPEED_GPS from bsth_c_gps_info where days_year=? and device_id in ("
213   - + inv + ") and ts > ? and ts < ?";
  211 + + inv + ") and ts > ? and ts < ? ORDER BY device_id,ts,stop_no";
214 212 try {
215 213 conn = DBUtils_MS.getConnection();
216 214 ps = conn.prepareStatement(sql);
... ... @@ -296,6 +294,9 @@ public class GpsServiceImpl implements GpsService {
296 294 prefix = lineId + "_" + updown + "_";
297 295 stationName = BasicData.getStationNameByCode(rs.getString("STOP_NO"), prefix);
298 296  
  297 + if (StringUtils.isEmpty(stationName))
  298 + continue;
  299 +
299 300 arr = new ArrivalEntity(rs.getString("DEVICE_ID"), rs.getLong("TS"), lineId,
300 301 updown, rs.getString("STOP_NO"), rs.getInt("IN_OUT"), rs.getLong("CREATE_DATE"),
301 302 rs.getInt("WEEKS_YEAR"), stationName);
... ... @@ -444,7 +445,7 @@ public class GpsServiceImpl implements GpsService {
444 445 return rs;
445 446 }
446 447  
447   - if(sch.isReissue()){
  448 + if (sch.isReissue()) {
448 449 rs.put("status", ResponseCode.ERROR);
449 450 rs.put("msg", "你不能重复这个操作");
450 451 return rs;
... ... @@ -453,7 +454,7 @@ public class GpsServiceImpl implements GpsService {
453 454 String sql = "select * from bsth_gps_template where line_id='" + sch.getXlBm() + "' and up_down=" + sch.getXlDir();
454 455 List<Map<String, Object>> list = jdbcTemplate.queryForList(sql);
455 456  
456   - if(list.size() == 0){
  457 + if (list.size() == 0) {
457 458 rs.put("status", ResponseCode.ERROR);
458 459 rs.put("msg", "缺少模板数据,请联系系统管理员!!");
459 460 return rs;
... ... @@ -470,21 +471,20 @@ public class GpsServiceImpl implements GpsService {
470 471 int diff = (int) (sch.getDfsjT() - Long.parseLong(fs.get("ts").toString()) - 1000 * 70);
471 472  
472 473 String deviceId = BasicData.deviceId2NbbmMap.inverse().get(sch.getClZbh());
473   - for(Map<String, Object> map : list){
  474 + for (Map<String, Object> map : list) {
474 475 map.put("device_id", deviceId);
475 476 map.put("ts", Long.parseLong(map.get("ts").toString()) + diff);
476 477 }
477 478  
478   - String sqlBefore = "insert into bsth_c_template("
479   - ,sqlValues = " values(";
  479 + String sqlBefore = "insert into bsth_c_template(", sqlValues = " values(";
480 480  
481 481 Set<String> ks = fs.keySet();
482   - for(String k : ks){
  482 + for (String k : ks) {
483 483 sqlBefore += (k + ",");
484 484 sqlValues += "?,";
485 485 }
486 486 sqlBefore = sqlBefore.substring(0, sqlBefore.length() - 1) + ", create_ts)";
487   - sqlValues = sqlValues.substring(0, sqlValues.length() - 1) + ", "+System.currentTimeMillis()+")";
  487 + sqlValues = sqlValues.substring(0, sqlValues.length() - 1) + ", " + System.currentTimeMillis() + ")";
488 488 sql = sqlBefore + " " + sqlValues;
489 489  
490 490 Connection conn = DBUtils_MS.getConnection();
... ... @@ -492,9 +492,9 @@ public class GpsServiceImpl implements GpsService {
492 492 ps = conn.prepareStatement(sql);
493 493 int fsize = ks.size();
494 494 List<Object> vs;
495   - for(Map<String, Object> map : list){
  495 + for (Map<String, Object> map : list) {
496 496 vs = new ArrayList<>(map.values());
497   - for(int i = 0; i < fsize; i ++){
  497 + for (int i = 0; i < fsize; i++) {
498 498 ps.setObject(i + 1, vs.get(i));
499 499 }
500 500 ps.addBatch();
... ... @@ -523,30 +523,62 @@ public class GpsServiceImpl implements GpsService {
523 523 try {
524 524 //获取历史gps 数据
525 525 List<HistoryGps_DTO> list = HistoryGps_DTO.craete(history(new String[]{nbbm}, st, et));
526   - if(list!=null && list.size() > 0){
  526 + if (list != null && list.size() > 0) {
527 527 //获取路段信息
528 528 String sql = "select ID, ST_AsText(GROAD_VECTOR) as GROAD_VECTOR,ROAD_CODE,ROAD_NAME,SPEED from bsth_c_road where road_code in(select section_code from bsth_c_sectionroute where line_code=? and destroy=0)";
529 529 List<Road_DTO> roads = Road_DTO.craete(jdbcTemplate.queryForList(sql, list.get(0).getLineId()));
530 530  
531 531 //为GPS数据关联路段信息
532   - for(HistoryGps_DTO gps : list){
  532 + for (HistoryGps_DTO gps : list) {
533 533 matchRoadToGps(gps, roads);
534 534 }
535 535 }
536 536  
  537 + //超速数据
  538 + List<GpsSpeed_DTO> speedList = speeds(nbbm, st, et);
  539 + //越界数据
  540 + List<GpsOutbound_DTO> outboundList = outbounds(nbbm, st, et);
  541 +
537 542 rs.put("status", ResponseCode.SUCCESS);
538   - rs.put("list", list);
539   - }catch (Exception e){
  543 + rs.put("list", removeDuplicate(list));
  544 + rs.put("speedList", speedList);
  545 + rs.put("outboundList", outboundList);
  546 + } catch (Exception e) {
540 547 logger.error("", e);
541 548 rs.put("status", ResponseCode.ERROR);
542 549 }
543 550 return rs;
544 551 }
545 552  
546   - private void matchRoadToGps(HistoryGps_DTO gps, List<Road_DTO> roads){
547   - double min = -1,distance;
  553 + @Override
  554 + public List<GpsSpeed_DTO> speeds(String nbbm, long st, long et) {
  555 + String deviceId = BasicData.deviceId2NbbmMap.inverse().get(nbbm);
  556 + String sql = "select vehicle, line, up_down, lon, lat, speed,timestamp from bsth_c_speeding where vehicle=? and timestamp>? and timestamp<?";
  557 +
  558 + return GpsSpeed_DTO.create(new JdbcTemplate(DBUtils_MS.getDataSource()).queryForList(sql, deviceId, st * 1000, et * 1000));
  559 + }
  560 +
  561 + @Override
  562 + public List<GpsOutbound_DTO> outbounds(String nbbm, long st, long et) {
  563 + /**
  564 + * 如果 st 和 et 跨了周分区,也只查询st 分区的数据。
  565 + */
  566 + st = st * 1000;
  567 + et = et * 1000;
  568 + //按周分区
  569 + Calendar weekCal = Calendar.getInstance();
  570 + weekCal.setTimeInMillis(st);
  571 + int weekYear = weekCal.get(Calendar.WEEK_OF_YEAR);
  572 + //设备号
  573 + String deviceId = BasicData.deviceId2NbbmMap.inverse().get(nbbm);
  574 + String sql = "select vehicle,line,up_down,lon,lat,timestamp from bsth_c_outbound where weeks_year="+weekYear+" and vehicle=? and timestamp>? and timestamp<?";
  575 + return GpsOutbound_DTO.create(new JdbcTemplate(DBUtils_MS.getDataSource()).queryForList(sql, deviceId, st, et));
  576 + }
  577 +
  578 + private void matchRoadToGps(HistoryGps_DTO gps, List<Road_DTO> roads) {
  579 + double min = -1, distance;
548 580 Road_DTO nearRoad = null;
549   - for(Road_DTO road : roads){
  581 + for (Road_DTO road : roads) {
550 582 distance = GeoUtils.getDistanceFromLine(road.getLineStr(), gps.getPoint());
551 583  
552 584 if (min > distance || min == -1) {
... ... @@ -559,6 +591,20 @@ public class GpsServiceImpl implements GpsService {
559 591 gps.setRoadMinDistance(min);
560 592 }
561 593  
  594 + /**
  595 + * 去重复
  596 + *
  597 + * @param list
  598 + * @return
  599 + */
  600 + private Set<HistoryGps_DTO> removeDuplicate(List<HistoryGps_DTO> list) {
  601 + Set<HistoryGps_DTO> set = new HashSet<>();
  602 + for (HistoryGps_DTO gps : list) {
  603 + set.add(gps);
  604 + }
  605 + return set;
  606 + }
  607 +
562 608 private void sortGpsList(final Field f, List<GpsEntity> rs) {
563 609 Collections.sort(rs, new Comparator<GpsEntity>() {
564 610  
... ...
src/main/java/com/bsth/service/gps/entity/GpsOutbound.java 0 → 100644
  1 +package com.bsth.service.gps.entity;
  2 +
  3 +/**
  4 + * 越界异常 --ms数据库格式
  5 + * Created by panzhao on 2017/4/9.
  6 + */
  7 +public class GpsOutbound {
  8 +
  9 + private String vehicle;
  10 +
  11 + private String line;
  12 +
  13 + private int up_down;
  14 +
  15 + private float lon;
  16 +
  17 + private float lat;
  18 +
  19 + private long timestamp;
  20 +
  21 + public String location(){
  22 + return lon + "," + lat;
  23 + }
  24 +
  25 + public String getVehicle() {
  26 + return vehicle;
  27 + }
  28 +
  29 + public void setVehicle(String vehicle) {
  30 + this.vehicle = vehicle;
  31 + }
  32 +
  33 + public String getLine() {
  34 + return line;
  35 + }
  36 +
  37 + public void setLine(String line) {
  38 + this.line = line;
  39 + }
  40 +
  41 + public int getUp_down() {
  42 + return up_down;
  43 + }
  44 +
  45 + public void setUp_down(int up_down) {
  46 + this.up_down = up_down;
  47 + }
  48 +
  49 + public float getLon() {
  50 + return lon;
  51 + }
  52 +
  53 + public void setLon(float lon) {
  54 + this.lon = lon;
  55 + }
  56 +
  57 + public float getLat() {
  58 + return lat;
  59 + }
  60 +
  61 + public void setLat(float lat) {
  62 + this.lat = lat;
  63 + }
  64 +
  65 + public long getTimestamp() {
  66 + return timestamp;
  67 + }
  68 +
  69 + public void setTimestamp(long timestamp) {
  70 + this.timestamp = timestamp;
  71 + }
  72 +}
... ...
src/main/java/com/bsth/service/gps/entity/GpsOutbound_DTO.java 0 → 100644
  1 +package com.bsth.service.gps.entity;
  2 +
  3 +import com.alibaba.fastjson.JSON;
  4 +import com.alibaba.fastjson.JSONObject;
  5 +import com.bsth.data.BasicData;
  6 +
  7 +import java.util.*;
  8 +
  9 +/**
  10 + * 越界异常 dto
  11 + * Created by panzhao on 2017/4/7.
  12 + */
  13 +public class GpsOutbound_DTO {
  14 +
  15 + public static List<GpsOutbound_DTO> create(List<Map<String, Object>> mapList){
  16 + //默认都是一辆车的数据
  17 + List<GpsOutbound> list = JSONObject.parseArray(JSON.toJSONString(mapList), GpsOutbound.class);
  18 + GpsOutbound outbound;
  19 +
  20 + //排序
  21 + Collections.sort(list, new Comparator<GpsOutbound>() {
  22 + @Override
  23 + public int compare(GpsOutbound o1, GpsOutbound o2) {
  24 + return (int) (o1.getTimestamp() - o2.getTimestamp());
  25 + }
  26 + });
  27 +
  28 + int space = 1000 * 60;
  29 + int size = list.size();
  30 + StringBuffer locations = new StringBuffer("");
  31 +
  32 + List<GpsOutbound_DTO> rsList = new ArrayList<>();
  33 + GpsOutbound_DTO dto = null;
  34 +
  35 + for(int i = 0; i < size; i++){
  36 + outbound = list.get(i);
  37 + locations.append(outbound.location() + ";");
  38 + if(dto == null){
  39 + dto = new GpsOutbound_DTO();
  40 + dto.setDeviceId(outbound.getVehicle());
  41 + dto.setNbbm(BasicData.deviceId2NbbmMap.get(outbound.getVehicle()));
  42 + dto.setSt(outbound.getTimestamp());
  43 + }
  44 + else{
  45 + //越界结束
  46 + if((i < size - 1 && list.get(i + 1).getTimestamp() - outbound.getTimestamp() > space)){
  47 + dto.setEt(outbound.getTimestamp());
  48 + dto.setLocations(locations.toString());
  49 +
  50 + rsList.add(dto);
  51 + dto = null;
  52 + locations = new StringBuffer("");
  53 + continue;
  54 + }
  55 +
  56 + if(i == size - 1)
  57 + rsList.add(dto);
  58 + }
  59 + }
  60 +
  61 + return rsList;
  62 + }
  63 +
  64 + /**
  65 + * 设备号
  66 + */
  67 + private String deviceId;
  68 +
  69 + /**
  70 + * 自编号
  71 + */
  72 + private String nbbm;
  73 +
  74 + /**
  75 + * 越界开始时间
  76 + */
  77 + private long st;
  78 +
  79 + /**
  80 + * 越界结束时间
  81 + */
  82 + private long et;
  83 +
  84 + /**
  85 + * 越界点位集合
  86 + */
  87 + private String locations;
  88 +
  89 + private String abnormalType = "outbound";
  90 +
  91 + public String getDeviceId() {
  92 + return deviceId;
  93 + }
  94 +
  95 + public void setDeviceId(String deviceId) {
  96 + this.deviceId = deviceId;
  97 + }
  98 +
  99 + public String getNbbm() {
  100 + return nbbm;
  101 + }
  102 +
  103 + public void setNbbm(String nbbm) {
  104 + this.nbbm = nbbm;
  105 + }
  106 +
  107 + public long getSt() {
  108 + return st;
  109 + }
  110 +
  111 + public void setSt(long st) {
  112 + this.st = st;
  113 + }
  114 +
  115 + public long getEt() {
  116 + return et;
  117 + }
  118 +
  119 + public void setEt(long et) {
  120 + this.et = et;
  121 + }
  122 +
  123 + public String getLocations() {
  124 + return locations;
  125 + }
  126 +
  127 + public void setLocations(String locations) {
  128 + this.locations = locations;
  129 + }
  130 +
  131 + public String getAbnormalType() {
  132 + return abnormalType;
  133 + }
  134 +
  135 + public void setAbnormalType(String abnormalType) {
  136 + this.abnormalType = abnormalType;
  137 + }
  138 +}
... ...
src/main/java/com/bsth/service/gps/entity/GpsSpeed.java 0 → 100644
  1 +package com.bsth.service.gps.entity;
  2 +
  3 +/**
  4 + * 超速异常 -ms数据库格式
  5 + * Created by panzhao on 2017/4/7.
  6 + */
  7 +public class GpsSpeed {
  8 +
  9 + private String vehicle;
  10 +
  11 + private String line;
  12 +
  13 + private int up_down;
  14 +
  15 + private float lon;
  16 +
  17 + private float lat;
  18 +
  19 + private float speed;
  20 +
  21 + private long timestamp;
  22 +
  23 + public String getVehicle() {
  24 + return vehicle;
  25 + }
  26 +
  27 + public void setVehicle(String vehicle) {
  28 + this.vehicle = vehicle;
  29 + }
  30 +
  31 + public String getLine() {
  32 + return line;
  33 + }
  34 +
  35 + public void setLine(String line) {
  36 + this.line = line;
  37 + }
  38 +
  39 + public int getUp_down() {
  40 + return up_down;
  41 + }
  42 +
  43 + public void setUp_down(int up_down) {
  44 + this.up_down = up_down;
  45 + }
  46 +
  47 + public float getLon() {
  48 + return lon;
  49 + }
  50 +
  51 + public void setLon(float lon) {
  52 + this.lon = lon;
  53 + }
  54 +
  55 + public float getLat() {
  56 + return lat;
  57 + }
  58 +
  59 + public void setLat(float lat) {
  60 + this.lat = lat;
  61 + }
  62 +
  63 + public float getSpeed() {
  64 + return speed;
  65 + }
  66 +
  67 + public void setSpeed(float speed) {
  68 + this.speed = speed;
  69 + }
  70 +
  71 + public long getTimestamp() {
  72 + return timestamp;
  73 + }
  74 +
  75 + public void setTimestamp(long timestamp) {
  76 + this.timestamp = timestamp;
  77 + }
  78 +}
... ...
src/main/java/com/bsth/service/gps/entity/GpsSpeed_DTO.java 0 → 100644
  1 +package com.bsth.service.gps.entity;
  2 +
  3 +import com.alibaba.fastjson.JSON;
  4 +import com.alibaba.fastjson.JSONObject;
  5 +import com.bsth.data.BasicData;
  6 +
  7 +import java.util.*;
  8 +
  9 +/**
  10 + * 超速异常 dto
  11 + * Created by panzhao on 2017/4/7.
  12 + */
  13 +public class GpsSpeed_DTO {
  14 +
  15 + public static List<GpsSpeed_DTO> create(List<Map<String, Object>> mapList){
  16 + //默认都是一辆车的数据
  17 + List<GpsSpeed> list = JSONObject.parseArray(JSON.toJSONString(mapList), GpsSpeed.class);
  18 + GpsSpeed gs;
  19 + //排序
  20 + Collections.sort(list, new Comparator<GpsSpeed>() {
  21 + @Override
  22 + public int compare(GpsSpeed o1, GpsSpeed o2) {
  23 + return (int) (o1.getTimestamp() - o2.getTimestamp());
  24 + }
  25 + });
  26 +
  27 + int space = 1000 * 60;
  28 + int size = list.size();
  29 +
  30 + List<GpsSpeed_DTO> rsList = new ArrayList<>();
  31 + GpsSpeed_DTO dto = null;
  32 +
  33 + for(int i = 0; i < size; i++){
  34 + gs = list.get(i);
  35 + if(dto == null){
  36 + dto = new GpsSpeed_DTO();
  37 + dto.setDeviceId(gs.getVehicle());
  38 + dto.setNbbm(BasicData.deviceId2NbbmMap.get(gs.getVehicle()));
  39 + dto.setSt(gs.getTimestamp());
  40 + dto.setSpeed(gs.getSpeed());
  41 + }
  42 + else{
  43 + //超速结束
  44 + if((i < size - 1 && list.get(i + 1).getTimestamp() - gs.getTimestamp() > space)){
  45 + dto.setEt(gs.getTimestamp());
  46 + rsList.add(dto);
  47 + dto = null;
  48 + continue;
  49 + }
  50 +
  51 + //记录最大速度
  52 + if(gs.getSpeed() > dto.getSpeed())
  53 + dto.setSpeed(gs.getSpeed());
  54 +
  55 + if(i == size - 1)
  56 + rsList.add(dto);
  57 + }
  58 + }
  59 + return rsList;
  60 + }
  61 +
  62 + /**
  63 + * 设备号
  64 + */
  65 + private String deviceId;
  66 +
  67 + /**
  68 + * 自编号
  69 + */
  70 + private String nbbm;
  71 +
  72 + /**
  73 + * 超速开始时间
  74 + */
  75 + private long st;
  76 +
  77 + /**
  78 + * 超速结束时间
  79 + */
  80 + private long et;
  81 +
  82 + /**
  83 + * 速度
  84 + */
  85 + private float speed;
  86 +
  87 + private String abnormalType = "speed";
  88 +
  89 + public String getDeviceId() {
  90 + return deviceId;
  91 + }
  92 +
  93 + public void setDeviceId(String deviceId) {
  94 + this.deviceId = deviceId;
  95 + }
  96 +
  97 + public String getNbbm() {
  98 + return nbbm;
  99 + }
  100 +
  101 + public void setNbbm(String nbbm) {
  102 + this.nbbm = nbbm;
  103 + }
  104 +
  105 + public long getSt() {
  106 + return st;
  107 + }
  108 +
  109 + public void setSt(long st) {
  110 + this.st = st;
  111 + }
  112 +
  113 + public long getEt() {
  114 + return et;
  115 + }
  116 +
  117 + public void setEt(long et) {
  118 + this.et = et;
  119 + }
  120 +
  121 + public float getSpeed() {
  122 + return speed;
  123 + }
  124 +
  125 + public void setSpeed(float speed) {
  126 + this.speed = speed;
  127 + }
  128 +
  129 + public String getAbnormalType() {
  130 + return abnormalType;
  131 + }
  132 +
  133 + public void setAbnormalType(String abnormalType) {
  134 + this.abnormalType = abnormalType;
  135 + }
  136 +}
... ...
src/main/java/com/bsth/service/gps/entity/HistoryGps_DTO.java
... ... @@ -17,12 +17,12 @@ import java.util.Map;
17 17 */
18 18 public class HistoryGps_DTO {
19 19  
20   - public static List<HistoryGps_DTO> craete(List<Map<String, Object>> mapList){
  20 + public static List<HistoryGps_DTO> craete(List<Map<String, Object>> mapList) {
21 21 List<HistoryGps_DTO> list = JSONObject.parseArray(JSON.toJSONString(mapList), HistoryGps_DTO.class);
22 22  
23 23 GeometryFactory geometryFactory = new GeometryFactory();
24 24 Point point;
25   - for(HistoryGps_DTO gps : list){
  25 + for (HistoryGps_DTO gps : list) {
26 26 point = geometryFactory.createPoint(new Coordinate(gps.getLat(), gps.getLon()));
27 27 gps.setPoint(point);
28 28 }
... ... @@ -56,11 +56,32 @@ public class HistoryGps_DTO {
56 56 @JsonIgnore
57 57 private Point point;
58 58  
59   - /** 路段 */
  59 + /**
  60 + * 路段
  61 + */
60 62 private Road_DTO road;
61   - /** 和路段的最短距离 */
  63 + /**
  64 + * 和路段的最短距离
  65 + */
62 66 private double roadMinDistance;
63 67  
  68 + @Override
  69 + public int hashCode() {
  70 + return this.toString().hashCode();
  71 + }
  72 +
  73 + @Override
  74 + public boolean equals(Object obj) {
  75 + HistoryGps_DTO g2 = (HistoryGps_DTO) obj;
  76 + return this.toString().equals(g2.toString());
  77 + }
  78 +
  79 +
  80 + @Override
  81 + public String toString() {
  82 + return (this.getDeviceId() + "_" + (inout_stop_info==null?this.getStopNo():inout_stop_info.getStopName()) + "_" + this.getTs() + "_" + this.getLon() + "_" + this.getLat());
  83 + }
  84 +
64 85 public double getGcj_lon() {
65 86 return gcj_lon;
66 87 }
... ...
src/main/resources/static/pages/excep/boundList.html
... ... @@ -55,9 +55,9 @@
55 55 <tr role="row" class="heading">
56 56 <th width="3%">#</th>
57 57 <th width="15%">线路</th>
58   - <th width="13%">内部编码</th>
59   - <th width="100">经度</th>
60   - <th width="11%">纬度</th>
  58 + <th width="13%">车辆自编号</th>
  59 + <th width="100">工号/名字</th>
  60 + <th width="11%">路牌名</th>
61 61 <th width="10%">上下行</th>
62 62 <th width="18%">时间</th>
63 63 <th width="18%">操作</th>
... ... @@ -66,10 +66,11 @@
66 66 <td></td>
67 67 <td>
68 68 <!-- <input type="text" class="form-control form-filter input-sm" name="userName_like"> -->
69   - <select class="form-control" name="line" id="line" style="width: 180px;"></select>
  69 + <select class="form-control" name="line" id="line" style="width: 150px;"></select>
70 70 </td>
71 71 <td>
72   - <input type="text" class="form-control form-filter input-sm" name="nbbm">
  72 +<!-- <input type="text" class="form-control form-filter input-sm" name="nbbm"> -->
  73 + <select class="form-control" name="nbbm" id="nbbm" style="width: 150px;"></select>
73 74 </td>
74 75 <td>
75 76 </td>
... ... @@ -119,10 +120,10 @@
119 120 </td>
120 121  
121 122 <td>
122   - {{obj.lon}}
  123 + {{obj.jsy}}
123 124 </td>
124 125 <td>
125   - {{obj.lat}}
  126 + {{obj.lpname}}
126 127 </td>
127 128 <td>
128 129 {{if obj.upDown==0}}
... ... @@ -271,45 +272,67 @@ $(function(){
271 272 });
272 273  
273 274 //搜索线路
274   - $('#line').select2({
275   - ajax: {
276   - url: '/realSchedule/findLine',
277   - type: 'post',
278   - dataType: 'json',
279   - delay: 150,
280   - data: function(params){
281   - return{line: params.term};
282   - },
283   - processResults: function (data) {
284   - return {
285   - results: data
286   - };
287   - },
288   - cache: true
289   - },
290   - templateResult: function(repo){
291   - if (repo.loading) return repo.text;
292   - var h = '<span>'+repo.text+'</span>';
293   - return h;
294   - },
295   - escapeMarkup: function (markup) { return markup; },
296   - minimumInputLength: 1,
297   - templateSelection: function(repo){
298   - return repo.text;
299   - },
300   - language: {
301   - noResults: function(){
302   - return '<span style="color:red;font-size: 12px;">没有搜索到线路!</span>';
303   - },
304   - inputTooShort : function(e) {
305   - return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入线路搜索线路</span>';
306   - },
307   - searching : function() {
308   - return '<span style="color:gray;font-size: 12px;"> 正在搜索线路...</span>';
309   - }
310   - }
  275 + $.get('/basic/lineCode2Name',function(result){
  276 + var data=[];
  277 + data.push({id: " ", text: "全部线路"});
  278 + for(var code in result){
  279 + data.push({id: code, text: result[code]});
  280 + }
  281 + initPinYinSelect2('#line',data,'');
  282 +
311 283 });
312   -});
  284 +
  285 + $("#line").on("change",initXl);
  286 +
  287 +function initXl(){
  288 +$('#nbbm').select2({
  289 + placeholder: '搜索车辆...',
  290 + ajax: {
  291 + url: '/report/carList',
  292 + dataType: 'json',
  293 + delay: 150,
  294 + data: function (params) {
  295 + return {nbbm: params.term,
  296 + gsbm:" ",
  297 + fgsbm:" ",
  298 + xlbm:$('#line').val()};
  299 + },
  300 + processResults: function (data) {
  301 + return {
  302 + results: data
  303 + };
  304 + },
  305 + cache: true
  306 + },
  307 + templateResult: function (repo) {
  308 + if (repo.loading) return repo.text;
  309 + var h = '<span>' + repo.text + '</span>';
  310 + h += (repo.lineName ? '&nbsp;<span class="select2-desc">' + repo.lineName + '</span>' : '');
  311 + return h;
  312 + },
  313 + escapeMarkup: function (markup) {
  314 + return markup;
  315 + },
  316 + minimumInputLength: 1,
  317 + templateSelection: function (repo) {
  318 + return repo.text;
  319 + },
  320 + language: {
  321 + noResults: function () {
  322 + return '<span style="color:red;font-size: 12px;">没有搜索到车辆!</span>';
  323 + },
  324 + inputTooShort: function (e) {
  325 + return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入自编号搜索车辆</span>';
  326 + },
  327 + searching: function () {
  328 + return '<span style="color:gray;font-size: 12px;"> 正在搜索车辆...</span>';
  329 + }
  330 + }
  331 +})
  332 +};
  333 +
  334 +
  335 +
313 336 //改变状态
314 337 function changeEnabled(id,enabled){
315 338 debugger
... ... @@ -317,4 +340,5 @@ function changeEnabled(id,enabled){
317 340 jsDoQuery(null, true);
318 341 })
319 342 }
  343 +});
320 344 </script>
321 345 \ No newline at end of file
... ...
src/main/resources/static/pages/excep/offlineList.html
... ... @@ -55,9 +55,9 @@
55 55 <tr role="row" class="heading">
56 56 <th width="3%">#</th>
57 57 <th width="15%">线路</th>
58   - <th width="13%">内部编码</th>
59   - <th width="100">经度</th>
60   - <th width="11%">纬度</th>
  58 + <th width="13%">车辆自编号</th>
  59 + <th width="100">工号/名字</th>
  60 + <th width="11%">路牌名</th>
61 61 <th width="10%">上下行</th>
62 62 <th width="18%">时间</th>
63 63 <th width="18%">操作</th>
... ... @@ -66,10 +66,12 @@
66 66 <td></td>
67 67 <td>
68 68 <!-- <input type="text" class="form-control form-filter input-sm" name="userName_like"> -->
69   - <select class="form-control" name="line" id="line" style="width: 180px;"></select>
  69 + <select class="form-control" name="line" id="line" style="width: 150px;"></select>
70 70 </td>
71 71 <td>
72   - <input type="text" class="form-control form-filter input-sm" name="nbbm">
  72 +<!-- <input type="text" class="form-control form-filter input-sm" name="nbbm" id="nbbm"> -->
  73 +
  74 + <select class="form-control" name="nbbm" id="nbbm" style="width: 150px;"></select>
73 75 </td>
74 76 <td>
75 77 </td>
... ... @@ -119,10 +121,10 @@
119 121 </td>
120 122  
121 123 <td>
122   - {{obj.lon}}
  124 + {{obj.jsy}}
123 125 </td>
124 126 <td>
125   - {{obj.lat}}
  127 + {{obj.lpname}}
126 128 </td>
127 129 <td>
128 130 {{if obj.upDown==0}}
... ... @@ -275,43 +277,64 @@ $(function(){
275 277 });
276 278  
277 279 //搜索线路
278   - $('#line').select2({
279   - ajax: {
280   - url: '/realSchedule/findLine',
281   - type: 'post',
282   - dataType: 'json',
283   - delay: 150,
284   - data: function(params){
285   - return{line: params.term};
286   - },
287   - processResults: function (data) {
288   - return {
289   - results: data
290   - };
291   - },
292   - cache: true
293   - },
294   - templateResult: function(repo){
295   - if (repo.loading) return repo.text;
296   - var h = '<span>'+repo.text+'</span>';
297   - return h;
298   - },
299   - escapeMarkup: function (markup) { return markup; },
300   - minimumInputLength: 1,
301   - templateSelection: function(repo){
302   - return repo.text;
303   - },
304   - language: {
305   - noResults: function(){
306   - return '<span style="color:red;font-size: 12px;">没有搜索到线路!</span>';
307   - },
308   - inputTooShort : function(e) {
309   - return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入线路搜索线路</span>';
310   - },
311   - searching : function() {
312   - return '<span style="color:gray;font-size: 12px;"> 正在搜索线路...</span>';
313   - }
314   - }
  280 +
  281 + $.get('/basic/lineCode2Name',function(result){
  282 + var data=[];
  283 + data.push({id: " ", text: "全部线路"});
  284 + for(var code in result){
  285 + data.push({id: code, text: result[code]});
  286 + }
  287 + initPinYinSelect2('#line',data,'');
  288 +
315 289 });
  290 +
  291 + $("#line").on("change",initXl);
  292 +function initXl(){
  293 + $('#nbbm').select2({
  294 + placeholder: '搜索车辆...',
  295 + ajax: {
  296 + url: '/report/carList',
  297 + dataType: 'json',
  298 + delay: 150,
  299 + data: function (params) {
  300 + return {nbbm: params.term,
  301 + gsbm:"",
  302 + fgsbm:"",
  303 + xlbm:$('#line').val()};
  304 + },
  305 + processResults: function (data) {
  306 + return {
  307 + results: data
  308 + };
  309 + },
  310 + cache: true
  311 + },
  312 + templateResult: function (repo) {
  313 + if (repo.loading) return repo.text;
  314 + var h = '<span>' + repo.text + '</span>';
  315 + h += (repo.lineName ? '&nbsp;<span class="select2-desc">' + repo.lineName + '</span>' : '');
  316 + return h;
  317 + },
  318 + escapeMarkup: function (markup) {
  319 + return markup;
  320 + },
  321 + minimumInputLength: 1,
  322 + templateSelection: function (repo) {
  323 + return repo.text;
  324 + },
  325 + language: {
  326 + noResults: function () {
  327 + return '<span style="color:red;font-size: 12px;">没有搜索到车辆!</span>';
  328 + },
  329 + inputTooShort: function (e) {
  330 + return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入自编号搜索车辆</span>';
  331 + },
  332 + searching: function () {
  333 + return '<span style="color:gray;font-size: 12px;"> 正在搜索车辆...</span>';
  334 + }
  335 + }
  336 + });
  337 +}
  338 +
316 339 });
317 340 </script>
318 341 \ No newline at end of file
... ...
src/main/resources/static/pages/excep/speedingList.html
... ... @@ -55,9 +55,9 @@
55 55 <tr role="row" class="heading">
56 56 <th width="3%">#</th>
57 57 <th width="15%">线路</th>
58   - <th width="13%">内部编码</th>
59   - <th width="100">经度</th>
60   - <th width="11%">纬度</th>
  58 + <th width="13%">车辆自编号</th>
  59 + <th width="100">工号/名字</th>
  60 + <th width="11%">路牌名</th>
61 61 <th width="10%">上下行</th>
62 62 <th width="18%">时间</th>
63 63 <th width="18%">操作</th>
... ... @@ -69,10 +69,11 @@
69 69 <select class="form-control" name="line" id="line" style="width: 180px;"></select>
70 70 </td>
71 71 <td>
72   - <input type="text" class="form-control form-filter input-sm" name="nbbm">
  72 +<!-- <input type="text" class="form-control form-filter input-sm" name="nbbm"> -->
  73 + <select class="form-control" name="nbbm" id="nbbm" style="width: 150px;"></select>
73 74 </td>
74 75 <td>
75   - <input class="form-control" type="date" name="date" />
  76 +
76 77 </td>
77 78 <td></td>
78 79 <td>
... ... @@ -83,7 +84,7 @@
83 84 <option value="-1">无效</option>
84 85 </select>
85 86 </td>
86   - <td></td>
  87 + <td> <input class="form-control" type="date" name="date" /></td>
87 88 <td>
88 89 <button class="btn btn-sm green btn-outline filter-submit margin-bottom" >
89 90 <i class="fa fa-search"></i> 搜索</button>
... ... @@ -118,10 +119,10 @@
118 119 </td>
119 120  
120 121 <td>
121   - {{obj.lon}}
  122 + {{obj.jsy}}
122 123 </td>
123 124 <td>
124   - {{obj.lat}}
  125 + {{obj.lpname}}
125 126 </td>
126 127 <td>
127 128 {{if obj.upDown==0}}
... ... @@ -270,45 +271,65 @@ $(function(){
270 271 });
271 272  
272 273 //搜索线路
273   - $('#line').select2({
274   - ajax: {
275   - url: '/realSchedule/findLine',
276   - type: 'post',
277   - dataType: 'json',
278   - delay: 150,
279   - data: function(params){
280   - return{line: params.term};
281   - },
282   - processResults: function (data) {
283   - return {
284   - results: data
285   - };
286   - },
287   - cache: true
288   - },
289   - templateResult: function(repo){
290   - if (repo.loading) return repo.text;
291   - var h = '<span>'+repo.text+'</span>';
292   - return h;
293   - },
294   - escapeMarkup: function (markup) { return markup; },
295   - minimumInputLength: 1,
296   - templateSelection: function(repo){
297   - return repo.text;
298   - },
299   - language: {
300   - noResults: function(){
301   - return '<span style="color:red;font-size: 12px;">没有搜索到线路!</span>';
302   - },
303   - inputTooShort : function(e) {
304   - return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入线路搜索线路</span>';
305   - },
306   - searching : function() {
307   - return '<span style="color:gray;font-size: 12px;"> 正在搜索线路...</span>';
308   - }
  274 + $.get('/basic/lineCode2Name',function(result){
  275 + var data=[];
  276 + data.push({id: " ", text: "全部线路"});
  277 + for(var code in result){
  278 + data.push({id: code, text: result[code]});
309 279 }
310   - });
  280 + initPinYinSelect2('#line',data,'');
  281 +
  282 +});
  283 +
  284 +$("#line").on("change",initXl);
  285 +function initXl(){
  286 +$('#nbbm').select2({
  287 + placeholder: '搜索车辆...',
  288 + ajax: {
  289 + url: '/report/carList',
  290 + dataType: 'json',
  291 + delay: 150,
  292 + data: function (params) {
  293 + return {nbbm: params.term,
  294 + gsbm:"",
  295 + fgsbm:"",
  296 + xlbm:$('#line').val()};
  297 + },
  298 + processResults: function (data) {
  299 + return {
  300 + results: data
  301 + };
  302 + },
  303 + cache: true
  304 + },
  305 + templateResult: function (repo) {
  306 + if (repo.loading) return repo.text;
  307 + var h = '<span>' + repo.text + '</span>';
  308 + h += (repo.lineName ? '&nbsp;<span class="select2-desc">' + repo.lineName + '</span>' : '');
  309 + return h;
  310 + },
  311 + escapeMarkup: function (markup) {
  312 + return markup;
  313 + },
  314 + minimumInputLength: 1,
  315 + templateSelection: function (repo) {
  316 + return repo.text;
  317 + },
  318 + language: {
  319 + noResults: function () {
  320 + return '<span style="color:red;font-size: 12px;">没有搜索到车辆!</span>';
  321 + },
  322 + inputTooShort: function (e) {
  323 + return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入自编号搜索车辆</span>';
  324 + },
  325 + searching: function () {
  326 + return '<span style="color:gray;font-size: 12px;"> 正在搜索车辆...</span>';
  327 + }
  328 + }
311 329 });
  330 +}
  331 +
  332 +
312 333 //改变状态
313 334 function changeEnabled(id,enabled){
314 335 debugger
... ... @@ -316,4 +337,5 @@ function changeEnabled(id,enabled){
316 337 jsDoQuery(null, true);
317 338 })
318 339 }
  340 +});
319 341 </script>
320 342 \ No newline at end of file
... ...
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage/detailedit/edit-detail2.html
... ... @@ -31,76 +31,160 @@
31 31 <div class="portlet-title">
32 32 <div class="caption">
33 33 <i class="icon-equalizer font-red-sunglo"></i> <span
34   - class="caption-subject font-red-sunglo bold uppercase" >批量信息修改</span>
  34 + class="caption-subject font-red-sunglo bold uppercase" ng-bind="ctrl.title1"></span>
35 35 </div>
36 36 </div>
37 37  
38 38 <div class="portlet-body form">
39 39 <form ng-submit="ctrl.submit()" class="form-horizontal" novalidate name="myForm">
40 40 <div class="form-body">
41   -
42   - <div class="form-group">
43   - <label class="col-md-3 control-label">方向:</label>
44   - <div class="col-md-5">
45   - <sa-Radiogroup model="ctrl.tt.xlDir" dicgroup="LineTrend" name="xlDir"></sa-Radiogroup>
  41 + <div class="form-group has-success has-feedback">
  42 + <label class="col-md-2 control-label">线路*:</label>
  43 + <div class="col-md-3">
  44 + <input type="text" class="form-control"
  45 + ng-value="ctrl.xlname"
  46 + readonly/>
46 47 </div>
47 48  
48 49 </div>
49   - <div class="form-group">
50   - <label class="col-md-3 control-label">起点站:</label>
51   - <div class="col-md-5">
52   - <sa-Select5 name="qdz"
53   - model="ctrl.tt"
54   - cmaps="{'qdz.id' : 'stationid'}"
55   - dcname="qdz.id"
56   - icname="stationid"
57   - dsparams="{{ {type: 'ajax', param:{'xlid': ctrl.xlid, 'xldir': ctrl.tt.xlDir}, atype:'zd' } | json }}"
58   - iterobjname="item"
59   - iterobjexp="item.stationname"
60   - searchph="请输拼音..."
61   - searchexp="this.stationname"
62   - >
63   - </sa-Select5>
  50 + <div class="form-group has-success has-feedback">
  51 + <label class="col-md-2 control-label">时刻表名称*:</label>
  52 + <div class="col-md-3">
  53 + <input type="text" class="form-control"
  54 + ng-value="ctrl.ttname"
  55 + readonly/>
64 56 </div>
65 57 </div>
66   - <div class="form-group">
67   - <label class="col-md-3 control-label">终点站:</label>
68   - <div class="col-md-5">
69   - <sa-Select5 name="zdz"
70   - model="ctrl.tt"
71   - cmaps="{'zdz.id' : 'stationid'}"
72   - dcname="zdz.id"
73   - icname="stationid"
74   - dsparams="{{ {type: 'ajax', param:{'xlid': ctrl.xlid, 'xldir': ctrl.tt.xlDir}, atype:'zd' } | json }}"
75   - iterobjname="item"
76   - iterobjexp="item.stationname"
77   - searchph="请输拼音..."
78   - searchexp="this.stationname"
79   - >
80   - </sa-Select5>
  58 +
  59 + <div class="form-group" ng-if="ctrl.isZdModify == true">
  60 + <label class="col-md-2 control-label">方向:</label>
  61 + <div class="col-md-3">
  62 + <sa-Radiogroup model="ctrl.tt.xlDir" dicgroup="LineTrend" name="xlDir"></sa-Radiogroup>
81 63 </div>
  64 +
82 65 </div>
83   - <div class="form-group">
84   - <label class="col-md-3 control-label">停车场:</label>
85   - <div class="col-md-5">
86   - <sa-Select5 name="tcc"
87   - model="ctrl.tt"
88   - cmaps="{'tcc.id': 'id'}"
89   - dcname="tcc.id"
90   - icname="id"
91   - dsparams="{{ {type: 'ajax', param:{type: 'all'}, atype:'tcc' } | json }}"
92   - iterobjname="item"
93   - iterobjexp="item.parkName"
94   - searchph="请输拼音..."
95   - searchexp="this.parkName"
96   - >
97   - </sa-Select5>
  66 +
  67 + <div ng-if="ctrl.isZdModify == true">
  68 +
  69 + <!--- 出场班次判定 -->
  70 + <div class="form-group"
  71 + ng-if="ctrl.tt.bcType == 'out'">
  72 + <label class="col-md-2 control-label">停车场:</label>
  73 + <div class="col-md-3">
  74 + <sa-Select5 name="tcc"
  75 + model="ctrl.tt"
  76 + cmaps="{'tcc.id': 'id'}"
  77 + dcname="tcc.id"
  78 + icname="id"
  79 + dsparams="{{ {type: 'ajax', param:{type: 'all'}, atype:'tcc' } | json }}"
  80 + iterobjname="item"
  81 + iterobjexp="item.parkName"
  82 + searchph="请输拼音..."
  83 + searchexp="this.parkName"
  84 + >
  85 + </sa-Select5>
  86 + </div>
  87 + </div>
  88 + <div class="form-group"
  89 + ng-if="ctrl.tt.bcType == 'out'">
  90 + <label class="col-md-2 control-label">终点站:</label>
  91 + <div class="col-md-3">
  92 + <sa-Select5 name="zdz"
  93 + model="ctrl.tt"
  94 + cmaps="{'zdz.id' : 'stationid'}"
  95 + dcname="zdz.id"
  96 + icname="stationid"
  97 + dsparams="{{ {type: 'ajax', param:{'xlid': ctrl.xlid, 'xldir': ctrl.tt.xlDir}, atype:'zd' } | json }}"
  98 + iterobjname="item"
  99 + iterobjexp="item.stationname"
  100 + searchph="请输拼音..."
  101 + searchexp="this.stationname"
  102 + >
  103 + </sa-Select5>
  104 + </div>
  105 + </div>
  106 +
  107 + <!--- 进场班次判定 -->
  108 + <div class="form-group"
  109 + ng-if="ctrl.tt.bcType == 'in'">
  110 + <label class="col-md-2 control-label">起点站:</label>
  111 + <div class="col-md-3">
  112 + <sa-Select5 name="qdz"
  113 + model="ctrl.tt"
  114 + cmaps="{'qdz.id' : 'stationid'}"
  115 + dcname="qdz.id"
  116 + icname="stationid"
  117 + dsparams="{{ {type: 'ajax', param:{'xlid': ctrl.xlid, 'xldir': ctrl.tt.xlDir}, atype:'zd' } | json }}"
  118 + iterobjname="item"
  119 + iterobjexp="item.stationname"
  120 + searchph="请输拼音..."
  121 + searchexp="this.stationname"
  122 + >
  123 + </sa-Select5>
  124 + </div>
  125 + </div>
  126 + <div class="form-group"
  127 + ng-if="ctrl.tt.bcType == 'in'">
  128 + <label class="col-md-2 control-label">停车场:</label>
  129 + <div class="col-md-3">
  130 + <sa-Select5 name="tcc"
  131 + model="ctrl.tt"
  132 + cmaps="{'tcc.id': 'id'}"
  133 + dcname="tcc.id"
  134 + icname="id"
  135 + dsparams="{{ {type: 'ajax', param:{type: 'all'}, atype:'tcc' } | json }}"
  136 + iterobjname="item"
  137 + iterobjexp="item.parkName"
  138 + searchph="请输拼音..."
  139 + searchexp="this.parkName"
  140 + >
  141 + </sa-Select5>
  142 + </div>
  143 + </div>
  144 +
  145 + <!-- 其他班次类型 -->
  146 + <div class="form-group"
  147 + ng-if="ctrl.tt.bcType != 'in' && ctrl.tt.bcType != 'out'">
  148 + <label class="col-md-2 control-label">起点站:</label>
  149 + <div class="col-md-3">
  150 + <sa-Select5 name="qdz"
  151 + model="ctrl.tt"
  152 + cmaps="{'qdz.id' : 'stationid'}"
  153 + dcname="qdz.id"
  154 + icname="stationid"
  155 + dsparams="{{ {type: 'ajax', param:{'xlid': ctrl.xlid, 'xldir': ctrl.tt.xlDir}, atype:'zd' } | json }}"
  156 + iterobjname="item"
  157 + iterobjexp="item.stationname"
  158 + searchph="请输拼音..."
  159 + searchexp="this.stationname"
  160 + >
  161 + </sa-Select5>
  162 + </div>
  163 + </div>
  164 + <div class="form-group"
  165 + ng-if="ctrl.tt.bcType != 'in' && ctrl.tt.bcType != 'out'">
  166 + <label class="col-md-2 control-label">终点站:</label>
  167 + <div class="col-md-3">
  168 + <sa-Select5 name="zdz"
  169 + model="ctrl.tt"
  170 + cmaps="{'zdz.id' : 'stationid'}"
  171 + dcname="zdz.id"
  172 + icname="stationid"
  173 + dsparams="{{ {type: 'ajax', param:{'xlid': ctrl.xlid, 'xldir': ctrl.tt.xlDir}, atype:'zd' } | json }}"
  174 + iterobjname="item"
  175 + iterobjexp="item.stationname"
  176 + searchph="请输拼音..."
  177 + searchexp="this.stationname"
  178 + >
  179 + </sa-Select5>
  180 + </div>
98 181 </div>
  182 +
99 183 </div>
100 184  
101 185 <div class="form-group">
102   - <label class="col-md-3 control-label">发车时间:</label>
103   - <div class="col-md-5">
  186 + <label class="col-md-2 control-label">发车时间:</label>
  187 + <div class="col-md-3">
104 188 <input type="text" class="form-control" name="fcsj"
105 189 ng-model="ctrl.tt.fcsj"
106 190 ng-pattern="ctrl.time_regex"
... ... @@ -113,8 +197,8 @@
113 197  
114 198 </div>
115 199 <div class="form-group">
116   - <label class="col-md-3 control-label">计划里程:</label>
117   - <div class="col-md-5">
  200 + <label class="col-md-2 control-label">计划里程:</label>
  201 + <div class="col-md-3">
118 202 <input type="text" class="form-control" name="jhlc"
119 203 ng-model="ctrl.tt.jhlc"
120 204 ng-pattern="ctrl.float_regex"
... ... @@ -127,8 +211,8 @@
127 211  
128 212 </div>
129 213 <div class="form-group">
130   - <label class="col-md-3 control-label">班次历时:</label>
131   - <div class="col-md-5">
  214 + <label class="col-md-2 control-label">班次历时:</label>
  215 + <div class="col-md-3">
132 216 <input type="text" class="form-control" name="bcsj"
133 217 ng-model="ctrl.tt.bcsj"
134 218 ng-pattern="ctrl.number_regex"
... ... @@ -140,9 +224,10 @@
140 224 </div>
141 225  
142 226 </div>
143   - <div class="form-group">
144   - <label class="col-md-3 control-label">班次类型:</label>
145   - <div class="col-md-5">
  227 + <div class="form-group"
  228 + ng-if="ctrl.isZdModify == true">
  229 + <label class="col-md-2 control-label">班次类型:</label>
  230 + <div class="col-md-3">
146 231 <sa-Select5 name="bcType"
147 232 model="ctrl.tt"
148 233 cmaps="{'bcType': 'code'}"
... ... @@ -159,6 +244,14 @@
159 244  
160 245 </div>
161 246  
  247 + <div class="form-group has-success has-feedback">
  248 + <label class="col-md-2 control-label">开始分班:</label>
  249 + <div class="col-md-3">
  250 + <sa-Radiogroup model="ctrl.tt.isFB" dicgroup="truefalseType" name="isFB"></sa-Radiogroup>
  251 + </div>
  252 +
  253 + </div>
  254 +
162 255 </div>
163 256  
164 257 <div class="form-actions">
... ...
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage/detailedit/timeTableDetailManage_old.js
... ... @@ -184,6 +184,7 @@ angular.module(&#39;ScheduleApp&#39;).factory(
184 184 ttinfodetailIds[index].qdz = value.qdz || undefined;
185 185 ttinfodetailIds[index].zdz = value.zdz || undefined;
186 186 ttinfodetailIds[index].tcc = value.tcc || undefined;
  187 + ttinfodetailIds[index].isfb = value.isFB || undefined;
187 188  
188 189 ttinfodetailIds[index].validInfo();
189 190  
... ... @@ -585,10 +586,16 @@ angular.module(&#39;ScheduleApp&#39;).controller(
585 586 '$stateParams',
586 587 '$state',
587 588 function(service, $stateParams, $state) {
588   - // TODO:
589   -
590 589 var self = this;
591   - var TTInfoDetail = service.getQueryClass();
  590 + // 获取传过来的id,有的话就是修改,获取一遍数据
  591 + self.xlid = $stateParams.xlid; // 获取传过来的线路id
  592 + self.ttid = $stateParams.ttid; // 获取传过来的时刻表id
  593 + self.xlname = $stateParams.xlname; // 获取传过来的线路名字
  594 + self.ttname = $stateParams.ttname; // 获取传过来的时刻表名字
  595 +
  596 + self.title1 = self.xlname + "(" + self.ttname + ")" + "时刻表明细信息 批量修改班次信息";
  597 +
  598 + //var TTInfoDetail = service.getQueryClass();
592 599  
593 600 // 时间正则表达式(格式hh:mm,如:06:39)
594 601 self.time_regex = /^([01]?[0-9]|2[0-3]):[0-5][0-9]$/;
... ... @@ -599,11 +606,14 @@ angular.module(&#39;ScheduleApp&#39;).controller(
599 606  
600 607 // 欲保存的busInfo信息,绑定
601 608 //self.tt = new TTInfoDetail;
  609 +
602 610 self.tt = {
603 611 xlDir: undefined,
604 612 tcc: {id: undefined},
605 613 qdz: {id: undefined},
606 614 zdz: {id: undefined},
  615 + bcType: undefined,
  616 + isFB: undefined,
607 617 reSetTTinfoDetail: function(value) {
608 618 for (var key in this) {
609 619 if (!angular.isFunction(this[key])) {
... ... @@ -611,7 +621,7 @@ angular.module(&#39;ScheduleApp&#39;).controller(
611 621 if (this[key].id) {
612 622 value[key] = this[key];
613 623 }
614   - } else if (this[key]) {
  624 + } else if (this[key] != undefined) {
615 625 value[key] = this[key];
616 626 }
617 627 }
... ... @@ -619,13 +629,32 @@ angular.module(&#39;ScheduleApp&#39;).controller(
619 629 }
620 630 };
621 631  
622   - // 获取传过来的id,有的话就是修改,获取一遍数据
623   - self.xlid = $stateParams.xlid; // 获取传过来的线路id
624   - self.ttid = $stateParams.ttid; // 获取传过来的时刻表id
625   - self.xlname = $stateParams.xlname; // 获取传过来的线路名字
626   - self.ttname = $stateParams.ttname; // 获取传过来的时刻表名字
  632 + // 修正self.tt
627 633  
628   - self.title1 = self.xlname + "(" + self.ttname + ")" + "时刻表明细信息";
  634 + self.isZdModify = false; // 是否可以修改站点(如果不是同一圈的数据是不能修改站点的)
  635 + var colIndexs_maps = {};
  636 + var detailInfos = service.getEditInfo().detailInfos;
  637 + for (var i = 0; i < detailInfos.length; i++) {
  638 + for (var j = 0; j < detailInfos[i].length; j++) {
  639 + if (detailInfos[i][j].canDelete()) {
  640 + colIndexs_maps[j] = j;
  641 + }
  642 + }
  643 + }
  644 + var colIndexs = [];
  645 + for (var kk in colIndexs_maps) {
  646 + colIndexs.push(kk);
  647 + }
  648 + if (colIndexs.length == 1) {
  649 + self.isZdModify = true;
  650 + var columnBcInfo = service.getEditInfo().columnBcInfo[colIndexs[0]];
  651 +
  652 + self.tt.xlDir = columnBcInfo.xldir;
  653 + self.tt.bcType = columnBcInfo.bc_type;
  654 + self.tt.qdz.id = columnBcInfo.qdz;
  655 + self.tt.zdz.id = columnBcInfo.zdz;
  656 + self.tt.tcc.id = columnBcInfo.tcc;
  657 + }
629 658  
630 659 // 提交方法
631 660 self.submit = function() {
... ... @@ -646,6 +675,8 @@ angular.module(&#39;ScheduleApp&#39;).controller(
646 675 // });
647 676 //});
648 677  
  678 + console.log(self.tt);
  679 +
649 680 service.editInfos(self.tt).then(function() {
650 681 $state.go("ttInfoDetailManage_edit3", {
651 682 xlid: self.xlid,
... ...
src/main/resources/static/real_control_v2/assets/imgs/icon/pause.png 0 → 100644

2.29 KB

src/main/resources/static/real_control_v2/assets/imgs/icon/play.png 0 → 100644

2.36 KB

src/main/resources/static/real_control_v2/js/safe_driv/safeDriv.js
... ... @@ -7,8 +7,10 @@ var gb_safe_driv = (function () {
7 7 'A1': '手部违规',
8 8 'A2': '摄像头偏离',
9 9 'A3': '安全带',
10   - 'A4': '手臂袖章',
11   - 'A5': '脸部检测'
  10 + 'A4': '未戴袖章',
  11 + 'A5': '眨眼/疲劳驾驶',
  12 + 'A6': '打哈欠/打瞌睡',
  13 + 'A7': '与人交谈'
12 14 };
13 15  
14 16 var $wrap = $('.safe_driv_pop_wrap');
... ...
src/main/resources/static/real_control_v2/mapmonitor/css/real.css
... ... @@ -800,4 +800,103 @@ input[type=checkbox].disabled{
800 800 .cc_info_accordion{
801 801 height: calc(100% - 40px);
802 802 overflow: auto;
  803 +}
  804 +
  805 +.map-wrap-tools{
  806 + position: absolute;
  807 + top: 0;
  808 + width: 100%;
  809 + background: #ffffff;
  810 + z-index: 10;
  811 + box-shadow: 3px 1px 8px 0 rgba(0, 0, 0, 0.12), 1px 0px 8px 0 rgba(0, 0, 0, 0.12);
  812 + height: 70px;
  813 + display: none;
  814 +}
  815 +
  816 +.map-container{
  817 + width: 100%;
  818 + height: 100%;
  819 +}
  820 +
  821 +#map-playback2-modal .uk-modal-close{
  822 + z-index: 11;
  823 +}
  824 +
  825 +.map-wrap-tools .ct-progress-bar{
  826 + position: absolute;
  827 + height: 11px;
  828 + width: 100%;
  829 + bottom: 0;
  830 + cursor: pointer;
  831 + /*border-top: 5px solid white;*/
  832 +}
  833 +
  834 +.map-wrap-tools .ct-progress-bar .scale{
  835 + width: 85%;
  836 + height: 6px;
  837 + border-top: 5px solid white;
  838 + background: #2bc2d5;
  839 +}
  840 +
  841 +.map-wrap-tools .btns{
  842 + padding: 5px 10px 0 25px;
  843 +}
  844 +
  845 +.map-wrap-tools .btns>span.ct_btn{
  846 + cursor: pointer;
  847 +}
  848 +
  849 +.map-wrap-tools .btns>.play_btn{
  850 + width: 48px;
  851 + height: 48px;
  852 + display: inline-block;
  853 + background: url("/real_control_v2/assets/imgs/icon/play.png");
  854 + margin-right: 10px;
  855 +}
  856 +
  857 +.map-wrap-tools .btns>.play_btn.play{
  858 + background: url("/real_control_v2/assets/imgs/icon/pause.png");
  859 +}
  860 +
  861 +.map-wrap-tools .btns>.play_btn:hover{
  862 + box-shadow: 0px 0px 8px 0 rgba(220, 35, 35, 0.61), 0px 0px 8px 0 rgba(206, 50, 50, 0.26);
  863 + border-radius: 35px;
  864 +}
  865 +
  866 +.map-wrap-tools .btns>.multi-items{
  867 + display: inline-block;
  868 + vertical-align: top;
  869 + background: #e7e4e4;
  870 + padding: 7px 15px;
  871 + margin: 12px 5px;
  872 + border-radius: 5px;
  873 +}
  874 +
  875 +.map-wrap-tools .btns>.multi-items label{
  876 + margin-right: 10px;
  877 +}
  878 +
  879 +.map-wrap-tools .btns>.multi-items label:last-child{
  880 + margin-right: 0;
  881 +}
  882 +
  883 +.map-wrap-tools .ct_btn.text-panel{
  884 + vertical-align: top;
  885 + display: inline-block;
  886 + margin-top: 8px;
  887 + margin-left: 15px;
  888 + font-size: 13px;
  889 +}
  890 +
  891 +.map-wrap-tools .ct_btn.a.export-excel {
  892 + color: #F44336;
  893 +}
  894 +
  895 +.map-wrap-tools .ct_btn.clock{
  896 + display: inline-block;
  897 + vertical-align: top;
  898 + margin-top: 22px;
  899 + font-size: 22px;
  900 + color: #8b8686;
  901 + margin-right: 10px;
803 902 }
804 903 \ No newline at end of file
... ...
src/main/resources/static/real_control_v2/mapmonitor/fragments/playback_v2/main.html
... ... @@ -78,127 +78,6 @@
78 78 </dl>
79 79 </div>
80 80 <div class="ct_table_body">
81   - <dl>
82   - <dd>超速(80)</dd>
83   - <dd>05:00.20</dd>
84   - <dd>05:00.20</dd>
85   - <dd></dd>
86   - </dl>
87   - <dl>
88   - <dd>越界</dd>
89   - <dd>05:00.20</dd>
90   - <dd>05:00.20</dd>
91   - <dd></dd>
92   - </dl>
93   - <dl>
94   - <dd>超速(80)</dd>
95   - <dd>05:00.20</dd>
96   - <dd>05:00.20</dd>
97   - <dd></dd>
98   - </dl>
99   - <dl>
100   - <dd>越界</dd>
101   - <dd>05:00.20</dd>
102   - <dd>05:00.20</dd>
103   - <dd></dd>
104   - </dl>
105   - <dl>
106   - <dd>超速(180)</dd>
107   - <dd>05:00.20</dd>
108   - <dd>05:00.20</dd>
109   - <dd></dd>
110   - </dl>
111   - <dl>
112   - <dd>越界</dd>
113   - <dd>05:00.20</dd>
114   - <dd>05:00.20</dd>
115   - <dd></dd>
116   - </dl>
117   - <dl>
118   - <dd>超速(80)</dd>
119   - <dd>05:00.20</dd>
120   - <dd>05:00.20</dd>
121   - <dd></dd>
122   - </dl>
123   - <dl>
124   - <dd>越界</dd>
125   - <dd>05:00.20</dd>
126   - <dd>05:00.20</dd>
127   - <dd></dd>
128   - </dl>
129   - <dl>
130   - <dd>超速(80)</dd>
131   - <dd>05:00.20</dd>
132   - <dd>05:00.20</dd>
133   - <dd></dd>
134   - </dl>
135   - <dl>
136   - <dd>越界</dd>
137   - <dd>05:00.20</dd>
138   - <dd>05:00.20</dd>
139   - <dd></dd>
140   - </dl>
141   - <dl>
142   - <dd>超速(80)</dd>
143   - <dd>05:00.20</dd>
144   - <dd>05:00.20</dd>
145   - <dd></dd>
146   - </dl>
147   - <dl>
148   - <dd>越界</dd>
149   - <dd>05:00.20</dd>
150   - <dd>05:00.20</dd>
151   - <dd></dd>
152   - </dl>
153   - <dl>
154   - <dd>超速(80)</dd>
155   - <dd>05:00.20</dd>
156   - <dd>05:00.20</dd>
157   - <dd></dd>
158   - </dl>
159   - <dl>
160   - <dd>越界</dd>
161   - <dd>05:00.20</dd>
162   - <dd>05:00.20</dd>
163   - <dd></dd>
164   - </dl>
165   - <dl>
166   - <dd>超速(80)</dd>
167   - <dd>05:00.20</dd>
168   - <dd>05:00.20</dd>
169   - <dd></dd>
170   - </dl>
171   - <dl>
172   - <dd>越界</dd>
173   - <dd>05:00.20</dd>
174   - <dd>05:00.20</dd>
175   - <dd></dd>
176   - </dl>
177   - <dl>
178   - <dd>超速(80)</dd>
179   - <dd>05:00.20</dd>
180   - <dd>05:00.20</dd>
181   - <dd></dd>
182   - </dl>
183   - <dl>
184   - <dd>越界</dd>
185   - <dd>05:00.20</dd>
186   - <dd>05:00.20</dd>
187   - <dd></dd>
188   - </dl>
189   - <dl>
190   - <dd>超速(80)</dd>
191   - <dd>05:00.20</dd>
192   - <dd>05:00.20</dd>
193   - <dd></dd>
194   - </dl>
195   - <dl>
196   - <dd>越界</dd>
197   - <dd>05:00.20</dd>
198   - <dd>05:00.20</dd>
199   - <dd></dd>
200   - </dl>
201   -
202 81 </div>
203 82 </div>
204 83 </div>
... ... @@ -254,7 +133,55 @@
254 133 </div>
255 134 </div>
256 135 </div>
257   - <div class="uk-width-medium-7-10 uk-height-viewport map-wrap">
  136 + <div class="uk-width-medium-7-10 uk-height-viewport map-wrap" style="padding-left: 0;position: relative;">
  137 + <div class="map-wrap-tools uk-animation-slide-top">
  138 + <div class="btns">
  139 + <span class="ct_btn play_btn"></span>
  140 + <span class="ct_btn clock">
  141 + 08:20.10
  142 + </span>
  143 + <div class="multi-items">
  144 + <form class="uk-form">
  145 + <label>
  146 + <input type="radio" name="playSpeed"> x1
  147 + </label>
  148 + <label>
  149 + <input type="radio" name="playSpeed"> x5
  150 + </label>
  151 + <label>
  152 + <input type="radio" name="playSpeed"> x10
  153 + </label>
  154 + <label>
  155 + <input type="radio" name="playSpeed"> x20
  156 + </label>
  157 + </form>
  158 + </div>
  159 + <div class="multi-items">
  160 + <form class="uk-form">
  161 + <label>
  162 + <input type="checkbox"> 站点
  163 + </label>
  164 + <label>
  165 + <input type="checkbox"> 缓冲区
  166 + </label>
  167 + <label>
  168 + <input type="checkbox"> 站点名称
  169 + </label>
  170 + <label>
  171 + 停车场 <i class="uk-icon-angle-down"></i>
  172 + </label>
  173 + </form>
  174 + </div>
  175 + <span class="ct_btn text-panel">
  176 + <span>约12.58公里,1258个GPS点</span><br>
  177 + <a class="export-excel"><i class="uk-icon-file-excel-o"></i> 导出轨迹</a>
  178 + </span>
  179 + </div>
  180 + <div class="ct-progress-bar" >
  181 + <div class="scale"></div>
  182 + </div>
  183 + </div>
  184 + <div class="map-container"></div>
258 185 </div>
259 186 </div>
260 187 </div>
... ... @@ -293,19 +220,37 @@
293 220 </dl>
294 221 {{/each}}
295 222 </script>
  223 +
  224 + <script id="abnormal_table_cont_temp" type="text/html">
  225 + {{each array as item i}}
  226 + <dl>
  227 + <dd>
  228 + {{if item.abnormalType == 'speed'}}
  229 + 超速({{item.speed}})
  230 + {{else if item.abnormalType == 'outbound'}}
  231 + 越界
  232 + {{/if}}
  233 + </dd>
  234 + <dd>{{item.st_str}}</dd>
  235 + <dd>{{item.et_str}}</dd>
  236 + <dd></dd>
  237 + </dl>
  238 + {{/each}}
  239 + </script>
296 240 <script>
297 241 (function () {
298 242 var modal = '#map-playback2-modal', gpsArray;
299 243  
300 244 $(modal).on('init', function (e, data) {
301   - try{
  245 + try {
302 246 //初始化地图
303   - map = new BMap.Map($('.map-wrap', modal)[0]);
  247 + map = new BMap.Map($('.map-container', modal)[0]);
304 248 //中心点和缩放级别
305 249 map.centerAndZoom(new BMap.Point(gb_map_consts.center_point.lng, gb_map_consts.center_point.lat), 16);
306 250 map.enableScrollWheelZoom();
307   - }catch (e){
308   - console.log(e);}
  251 + } catch (e) {
  252 + console.log(e);
  253 + }
309 254  
310 255 //固定表头
311 256 gb_ct_table.fixedHead($('.road_table_wrap', modal));
... ... @@ -361,79 +306,89 @@
361 306 */
362 307 var searchForm = (function () {
363 308  
364   - var f = $('.playBackForm', modal);
365   -
366   - var init = function (data) {
367   - //设置初始值
368   - if (data.nbbm)
369   - $('[name=nbbm]', f).val(data.nbbm);
370   - var st = moment().subtract(2, 'hour');
371   - if (data.st)
372   - st = moment(data.st, 'YYYY-MM-DD HH:mm');
373   - $('[name=sDate]', f).val(st.format('YYYY-MM-DD'));
374   - $('[name=sTime]', f).val(st.format('HH:mm'));
375   - var et = moment();
376   - if (data.et)
377   - et = moment(data.et, 'YYYY-MM-DD HH:mm');
378   - $('[name=eDate]', f).val(et.format('YYYY-MM-DD'));
379   - $('[name=eTime]', f).val(et.format('HH:mm'));
380   -
381   - //搜索事件
382   - $('button[type=submit]', f).on('click', search);
383   - };
384   -
385   - var setNbbm = function (v) {
386   - $('[name=nbbm]', f).val(v);
387   - };
388   -
389   - var ONE_DAY = 60 * 60 * 24;
390   - var MIN_SPACE = 60;
391   - var search = function (e) {
392   - e.stopPropagation();
393   - var data = f.serializeJSON();
394   -
395   - //校验时间间隔
396   - var fs = 'YYYY-MM-DDHH:mm';
397   - var st = parseInt(moment(data.sDate + data.sTime, fs).format('X'));
398   - var et = parseInt(moment(data.eDate + data.eTime, fs).format('X'));
399   -
400   - if (et < st)
401   - notify_err('结束时间不能小于开始时间');
402   - else if ((et - st) > ONE_DAY)
403   - notify_err('最大间隔24小时!');
404   - else if ((et - st) < MIN_SPACE)
405   - notify_err('最小间隔1分钟!');
406   - else {
407   - $.ajax({
408   - url: '/gps/history_v2/' + data.nbbm,
409   - traditional: true,
410   - data: {st: st, et: et},
411   - success: function (rs) {
412   - gpsArray = rs.list;
413   - if (!rs || rs.length == 0) {
414   - notify_err('没有搜索到轨迹数据!');
415   - return;
416   - }
417   -
418   - //排序
419   - gpsArray.sort(function (a, b) {
420   - return a.ts - b.ts;
  309 + var f = $('.playBackForm', modal);
  310 +
  311 + var init = function (data) {
  312 + //设置初始值
  313 + /*if (data.nbbm)
  314 + $('[name=nbbm]', f).val(data.nbbm);
  315 + var st = moment().subtract(2, 'hour');
  316 + if (data.st)
  317 + st = moment(data.st, 'YYYY-MM-DD HH:mm');
  318 + $('[name=sDate]', f).val(st.format('YYYY-MM-DD'));
  319 + $('[name=sTime]', f).val(st.format('HH:mm'));
  320 + var et = moment();
  321 + if (data.et)
  322 + et = moment(data.et, 'YYYY-MM-DD HH:mm');
  323 + $('[name=eDate]', f).val(et.format('YYYY-MM-DD'));
  324 + $('[name=eTime]', f).val(et.format('HH:mm'));*/
  325 +
  326 +
  327 + $('[name=nbbm]', f).val('W0A-018');
  328 + $('[name=sDate]', f).val('2017-04-06');
  329 + $('[name=sTime]', f).val('04:49');
  330 +
  331 + $('[name=eDate]', f).val('2017-04-06');
  332 + $('[name=eTime]', f).val('09:49');
  333 + //搜索事件
  334 + $('button[type=submit]', f).on('click', search);
  335 + };
  336 +
  337 + var setNbbm = function (v) {
  338 + $('[name=nbbm]', f).val(v);
  339 + };
  340 +
  341 + var ONE_DAY = 60 * 60 * 24;
  342 + var MIN_SPACE = 60;
  343 + var search = function (e) {
  344 + e.stopPropagation();
  345 + var data = f.serializeJSON();
  346 +
  347 + //校验时间间隔
  348 + var fs = 'YYYY-MM-DDHH:mm';
  349 + var st = parseInt(moment(data.sDate + data.sTime, fs).format('X'));
  350 + var et = parseInt(moment(data.eDate + data.eTime, fs).format('X'));
  351 +
  352 + if (et < st)
  353 + notify_err('结束时间不能小于开始时间');
  354 + else if ((et - st) > ONE_DAY)
  355 + notify_err('最大间隔24小时!');
  356 + else if ((et - st) < MIN_SPACE)
  357 + notify_err('最小间隔1分钟!');
  358 + else {
  359 + $.ajax({
  360 + url: '/gps/history_v2/' + data.nbbm,
  361 + traditional: true,
  362 + data: {st: st, et: et},
  363 + success: function (rs) {
  364 + gpsArray = rs.list;
  365 + if (!rs || rs.length == 0) {
  366 + notify_err('没有搜索到轨迹数据!');
  367 + return;
  368 + }
  369 +
  370 + //排序
  371 + gpsArray.sort(function (a, b) {
  372 + return parseInt((a.ts - b.ts) + '' + (a.stop_no - b.stop_no));
  373 + });
  374 + //行车轨迹
  375 + trailTableObj.showInitData(gpsArray);
  376 + //到离站信息
  377 + inOutStationTableObj.showInitData(gpsArray);
  378 + //异常信息
  379 + abnormalTableObj.showInitData(rs['outboundList'], rs['speedList']);
  380 + //show 工具条
  381 + mapTools.show();
  382 + }
421 383 });
422   - console.log('gpsArray', gpsArray);
423   - //行车轨迹
424   - trailTableObj.showInitData(gpsArray);
425   - //到离站信息
426   - inOutStationTableObj.showInitData(gpsArray);
427 384 }
428   - });
429   - }
430   - return false;
431   - };
432   - return {
433   - init: init,
434   - setNbbm: setNbbm
435   - };
436   - })();
  385 + return false;
  386 + };
  387 + return {
  388 + init: init,
  389 + setNbbm: setNbbm
  390 + };
  391 + })();
437 392  
438 393 /**
439 394 * 行车轨迹表格
... ... @@ -449,7 +404,8 @@
449 404 if (i > 0 && array[array.length - 1].road.road_CODE == gps.road.road_CODE)
450 405 array.pop();
451 406 }
452   - catch (e) {}
  407 + catch (e) {
  408 + }
453 409  
454 410 if (gps.road)
455 411 array.push(gps);
... ... @@ -470,43 +426,46 @@
470 426 */
471 427 var inOutStationTableObj = (function () {
472 428  
473   - var data = [];
  429 + var data, f, prev;
474 430 var showInitData = function (list) {
475 431 clear();
476 432 data = [];
477 433  
478 434 $.each(list, function (i, gps) {
479   - if(gps['inout_stop'] == -1)
  435 +
  436 + prev = data[data.length - 1];
  437 + if (gps['inout_stop'] == -1)
480 438 return true;
481 439  
482   - if(gps['inout_stop'] == 1){
  440 + if (gps['inout_stop'] == 0) {
  441 + //连续进站信号,取第一个
  442 + if(prev && prev['out_ts'] == null
  443 + && prev['stopName'] == gps['inout_stop_info'].stopName){
  444 + return true;
  445 + }
483 446 data.push(createIn(gps));
484 447 }
485   - else if(gps['inout_stop'] == 0){
486   - matchOut(data[data.length - 1], gps);
  448 + else if (gps['inout_stop'] == 1) {
  449 + f = matchOut(prev, gps);
  450 + if(f)
  451 + data.push(f);
487 452 }
488 453 });
489 454  
490 455 //格式化时间
491 456 $.each(data, function () {
492   - if(this.in_ts)
  457 + if (this.in_ts)
493 458 this.in_time_str = moment(this.in_ts).format('HH:mm.ss');
494   - if(this.out_ts)
  459 + if (this.out_ts)
495 460 this.out_time_str = moment(this.out_ts).format('HH:mm.ss');
496 461 });
497 462  
498   - console.log('data', data);
499 463 var htmlStr = template('multi_inout_info_cont_temp', {list: data});
500 464 $('.inout_table_wrap .ct_table_body', modal).html(htmlStr);
501 465 };
502 466  
503 467 var add = function (gps) {
504 468  
505   - /*if (gps.inout_stop == -1)
506   - return;
507   -
508   - var htmlStr = template('', {obj: gps['inout_stop_info']});
509   - $('.inout_table_wrap .ct_table .ct_table_body', modal).html(htmlStr);*/
510 469 };
511 470  
512 471 var clear = function () {
... ... @@ -523,12 +482,18 @@
523 482 };
524 483  
525 484  
526   - var matchOut = function (info, gps) {
527   - if(!info)
528   - return;
529   - var outInfo = gps['inout_stop_info'];
530   - if(info.stopName == outInfo.stopName){
531   - info['out_ts'] = outInfo.ts;
  485 + var matchOut = function (prevInfo, gps) {
  486 + var oi = gps['inout_stop_info'];
  487 + if(prevInfo && prevInfo.stopName == oi.stopName){
  488 + prevInfo['out_ts'] = oi.ts;
  489 + return null;
  490 + }
  491 + else {
  492 + return {
  493 + out_ts: oi.ts,
  494 + stopNo: oi.stopNo,
  495 + stopName: oi.stopName
  496 + }
532 497 }
533 498 };
534 499  
... ... @@ -536,6 +501,59 @@
536 501 showInitData: showInitData
537 502 };
538 503 })();
  504 +
  505 + /**
  506 + * 异常信息表格
  507 + * @type {{showInitData}}
  508 + */
  509 + var abnormalTableObj = (function () {
  510 +
  511 + var showInitData = function () {
  512 + var array = [];
  513 + for(var i = 0; i < arguments.length; i ++){
  514 + array = array.concat(arguments[i]);
  515 + }
  516 + //格式化时间
  517 + $.each(array, function () {
  518 + if(this.st)
  519 + this.st_str = moment(this.st).format('HH:mm.ss');
  520 + if(this.et)
  521 + this.et_str = moment(this.et).format('HH:mm.ss');
  522 + });
  523 +
  524 + var htmlStr = template('abnormal_table_cont_temp', {array: array});
  525 + $('.abnormal_table .ct_table_body', modal).html(htmlStr);
  526 + };
  527 +
  528 + return {
  529 + showInitData: showInitData
  530 + }
  531 + })();
  532 +
  533 + /**
  534 + * 工具条相关
  535 + */
  536 + var mapTools = (function () {
  537 +
  538 + $('.map-wrap-tools .play_btn', modal).on('click', function () {
  539 + if($(this).hasClass('play')){
  540 + //暂停
  541 + $(this).removeClass('play');
  542 + }
  543 + else {
  544 + //播放
  545 + $(this).addClass('play');
  546 + }
  547 + });
  548 +
  549 + var show = function () {
  550 + $('.map-wrap-tools').show();
  551 + };
  552 +
  553 + return {
  554 + show: show
  555 + }
  556 + })();
539 557 })();
540 558 </script>
541 559 </div>
542 560 \ No newline at end of file
... ...
src/main/resources/static/real_control_v2/mapmonitor/js/playback.js
... ... @@ -3,7 +3,7 @@
3 3 var gb_map_play_back = (function () {
4 4  
5 5 var dom;
6   - $.get('/real_control_v2/mapmonitor/fragments/playback/main.html', function (rs) {
  6 + $.get('/real_control_v2/mapmonitor/fragments/playback_v2/main.html', function (rs) {
7 7 dom = rs;
8 8 });
9 9  
... ... @@ -13,10 +13,11 @@ var gb_map_play_back = (function () {
13 13 gb_map_imap.call('closeWin', deviceId);
14 14  
15 15 //show modal
16   - var modal = '#map-playback-modal';
17   - $(document.body).append(dom);
18   - UIkit.modal(modal, {bgclose: false}).show();
19   - $(modal).trigger('show_form', {deviceId: deviceId, nbbm: nbbm});
  16 + open_modal_dom(dom, {deviceId: deviceId, nbbm: nbbm});
  17 + //var modal = '#map-playback2-modal';
  18 + //$(document.body).append(dom);
  19 + //UIkit.modal(modal, {bgclose: false}).show();
  20 + //$(modal).trigger('show_form', {deviceId: deviceId, nbbm: nbbm});
20 21 };
21 22  
22 23 //导出excel
... ...