Commit dacda227875b7220b2acbde4e00084f60affd922

Authored by 廖磊
2 parents 1b76fec3 20d60a35

Merge branch 'minhang' of

http://222.66.0.204:8090/panzhaov5/bsth_control into minhang
Showing 66 changed files with 2723 additions and 833 deletions
src/main/java/com/bsth/controller/StationRouteController.java
@@ -111,7 +111,6 @@ public class StationRouteController extends BaseController<StationRoute, Integer @@ -111,7 +111,6 @@ public class StationRouteController extends BaseController<StationRoute, Integer
111 */ 111 */
112 @RequestMapping(value = "/findStationRouteInfo",method = RequestMethod.GET) 112 @RequestMapping(value = "/findStationRouteInfo",method = RequestMethod.GET)
113 public List<Map<String, Object>> findStationRouteInfo(@RequestParam Map<String, Object> map) { 113 public List<Map<String, Object>> findStationRouteInfo(@RequestParam Map<String, Object> map) {
114 -  
115 return service.findStationRouteInfo(map); 114 return service.findStationRouteInfo(map);
116 } 115 }
117 116
@@ -140,4 +139,13 @@ public class StationRouteController extends BaseController&lt;StationRoute, Integer @@ -140,4 +139,13 @@ public class StationRouteController extends BaseController&lt;StationRoute, Integer
140 return service.updSwitchDir(lineIds); 139 return service.updSwitchDir(lineIds);
141 } 140 }
142 141
  142 + /**
  143 + *
  144 + * @Title: upddis
  145 + * @Description: TODO(更新站距)
  146 + */
  147 + @RequestMapping(value = "/upddis",method = RequestMethod.POST)
  148 + public Map<String, Object> upddis(@RequestParam Map<String, Object> map) {
  149 + return service.upddis(map);
  150 + }
143 } 151 }
src/main/java/com/bsth/data/gpsdata/arrival/handlers/InOutStationSignalHandle.java
@@ -260,7 +260,7 @@ public class InOutStationSignalHandle extends SignalHandle{ @@ -260,7 +260,7 @@ public class InOutStationSignalHandle extends SignalHandle{
260 //如果当前班次是出场,并且进的是下一个班次的终点 260 //如果当前班次是出场,并且进的是下一个班次的终点
261 if(sch.getBcType().equals("out")){ 261 if(sch.getBcType().equals("out")){
262 ScheduleRealInfo next = dayOfSchedule.next(sch); 262 ScheduleRealInfo next = dayOfSchedule.next(sch);
263 - if(next.getZdzCode().equals(gps.getStopNo())){ 263 + if(next != null && next.getZdzCode().equals(gps.getStopNo())){
264 List<ScheduleRealInfo> halfList = dayOfSchedule.findByNbbm(sch.getClZbh()); 264 List<ScheduleRealInfo> halfList = dayOfSchedule.findByNbbm(sch.getClZbh());
265 //和当前进站信号最匹配的一个班次 265 //和当前进站信号最匹配的一个班次
266 ScheduleRealInfo nearSch = nearScheduleByGpsIn(gps, halfList); 266 ScheduleRealInfo nearSch = nearScheduleByGpsIn(gps, halfList);
src/main/java/com/bsth/data/safe_driv/SafeDriv.java 0 → 100644
  1 +package com.bsth.data.safe_driv;
  2 +
  3 +/**
  4 + * 安全驾驶
  5 + * Created by panzhao on 2017/4/6.
  6 + */
  7 +public class SafeDriv {
  8 +
  9 + /**
  10 + * 时间
  11 + * 2017-04-06 08:00:00.0
  12 + */
  13 + private String Startime;
  14 +
  15 + /**
  16 + * 时间戳
  17 + */
  18 + private Long ts;
  19 +
  20 + /**
  21 + * 设备编号
  22 + */
  23 + private String sbbh;
  24 +
  25 + /**
  26 + * 线路名称
  27 + */
  28 + private String xlmc;
  29 +
  30 + /**
  31 + * 车辆自编号
  32 + */
  33 + private String clzbh;
  34 +
  35 + /**
  36 + * 车牌号
  37 + */
  38 + private String cph;
  39 +
  40 + /**
  41 + * 检查属性
  42 + * 双脱手 0 单脱手 1 其他为0都是异常
  43 + */
  44 + private String jctype;
  45 +
  46 + /**
  47 + * 异常种类
  48 + * 手部检测: 1
  49 + * 脸部检测: 5
  50 + * 摄像头检测: 2
  51 + * 安全带检测: 3
  52 + * 袖章检测: 4
  53 + */
  54 + private String yczltype;
  55 +
  56 + @Override
  57 + public int hashCode() {
  58 + return ("safe_" + (this.getClzbh() + this.getStartime())).hashCode();
  59 + }
  60 +
  61 + @Override
  62 + public boolean equals(Object obj) {
  63 + SafeDriv s2 = (SafeDriv)obj;
  64 + return (this.getClzbh() + this.getStartime()).equals(s2.getClzbh() + s2.getStartime());
  65 + }
  66 +
  67 + public String getStartime() {
  68 + return Startime;
  69 + }
  70 +
  71 + public void setStartime(String startime) {
  72 + Startime = startime;
  73 + }
  74 +
  75 + public String getSbbh() {
  76 + return sbbh;
  77 + }
  78 +
  79 + public void setSbbh(String sbbh) {
  80 + this.sbbh = sbbh;
  81 + }
  82 +
  83 + public String getXlmc() {
  84 + return xlmc;
  85 + }
  86 +
  87 + public void setXlmc(String xlmc) {
  88 + this.xlmc = xlmc;
  89 + }
  90 +
  91 + public String getClzbh() {
  92 + return clzbh;
  93 + }
  94 +
  95 + public void setClzbh(String clzbh) {
  96 + this.clzbh = clzbh;
  97 + }
  98 +
  99 + public String getCph() {
  100 + return cph;
  101 + }
  102 +
  103 + public void setCph(String cph) {
  104 + this.cph = cph;
  105 + }
  106 +
  107 + public String getJctype() {
  108 + return jctype;
  109 + }
  110 +
  111 + public void setJctype(String jctype) {
  112 + this.jctype = jctype;
  113 + }
  114 +
  115 + public String getYczltype() {
  116 + return yczltype;
  117 + }
  118 +
  119 + public void setYczltype(String yczltype) {
  120 + this.yczltype = yczltype;
  121 + }
  122 +
  123 + public Long getTs() {
  124 + return ts;
  125 + }
  126 +
  127 + public void setTs(Long ts) {
  128 + this.ts = ts;
  129 + }
  130 +}
src/main/java/com/bsth/data/safe_driv/SafeDrivCenter.java 0 → 100644
  1 +package com.bsth.data.safe_driv;
  2 +
  3 +import com.bsth.Application;
  4 +import com.bsth.websocket.handler.SendUtils;
  5 +import org.joda.time.format.DateTimeFormat;
  6 +import org.joda.time.format.DateTimeFormatter;
  7 +import org.springframework.beans.BeansException;
  8 +import org.springframework.beans.factory.annotation.Autowired;
  9 +import org.springframework.boot.CommandLineRunner;
  10 +import org.springframework.context.ApplicationContext;
  11 +import org.springframework.context.ApplicationContextAware;
  12 +import org.springframework.stereotype.Component;
  13 +
  14 +import java.util.HashMap;
  15 +import java.util.HashSet;
  16 +import java.util.Map;
  17 +import java.util.Set;
  18 +import java.util.concurrent.TimeUnit;
  19 +
  20 +/**
  21 + * 安全驾驶
  22 + * Created by panzhao on 2017/4/6.
  23 + */
  24 +@Component
  25 +public class SafeDrivCenter implements CommandLineRunner,ApplicationContextAware {
  26 +
  27 + private static Set<SafeDriv> data;
  28 +
  29 + @Autowired
  30 + SafeDrivDataLoadThread safeDrivDataLoadThread;
  31 +
  32 + static SendUtils sendUtils;
  33 +
  34 + /**
  35 + * 车辆自编号 和 最新一条数据对照
  36 + */
  37 + private static Map<String, SafeDriv> safeMap;
  38 +
  39 + static {
  40 + data = new HashSet<>();
  41 + safeMap = new HashMap<>();
  42 + }
  43 +
  44 + private static DateTimeFormatter fmt = DateTimeFormat.forPattern("yyyy-MM-dd HH:mm:ss.SSS");
  45 + public static void put(SafeDriv sd){
  46 + sd.setTs(fmt.parseMillis(sd.getStartime()));
  47 + data.add(sd);
  48 +
  49 + if(sd.getYczltype().indexOf("A") == -1)
  50 + sd.setYczltype("A" + sd.getYczltype());
  51 +
  52 + SafeDriv old = safeMap.get(sd.getClzbh());
  53 + if(old == null || sd.getTs() > old.getTs()){
  54 + //通知客户端
  55 + sendUtils.sendSafeDriv(sd);
  56 + }
  57 +
  58 + safeMap.put(sd.getClzbh(), sd);
  59 + }
  60 +
  61 + @Override
  62 + public void run(String... strings) throws Exception {
  63 + //定时加载安全驾驶数据
  64 + Application.mainServices.scheduleWithFixedDelay(safeDrivDataLoadThread, 60, 5, TimeUnit.SECONDS);
  65 + }
  66 +
  67 + @Override
  68 + public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
  69 + sendUtils = applicationContext.getBean(SendUtils.class);
  70 + }
  71 +}
src/main/java/com/bsth/data/safe_driv/SafeDrivDataLoadThread.java 0 → 100644
  1 +package com.bsth.data.safe_driv;
  2 +
  3 +import com.alibaba.fastjson.JSON;
  4 +import org.apache.http.HttpEntity;
  5 +import org.apache.http.client.methods.CloseableHttpResponse;
  6 +import org.apache.http.client.methods.HttpGet;
  7 +import org.apache.http.impl.client.CloseableHttpClient;
  8 +import org.apache.http.impl.client.HttpClients;
  9 +import org.slf4j.Logger;
  10 +import org.slf4j.LoggerFactory;
  11 +import org.springframework.stereotype.Component;
  12 +
  13 +import java.io.BufferedReader;
  14 +import java.io.InputStreamReader;
  15 +import java.util.List;
  16 +
  17 +/**
  18 + * 安全驾驶数据加载线程
  19 + * Created by panzhao on 2017/4/6.
  20 + */
  21 +@Component
  22 +public class SafeDrivDataLoadThread extends Thread{
  23 +
  24 + private final static String url = "http://180.166.5.82:9988//bsth-safedriving/Crlcxb/realtimeInterface.do";
  25 +
  26 + Logger logger = LoggerFactory.getLogger(this.getClass());
  27 +
  28 + @Override
  29 + public void run() {
  30 + List<SafeDriv> list = null;
  31 + CloseableHttpClient httpClient = null;
  32 + CloseableHttpResponse response = null;
  33 + try {
  34 + httpClient = HttpClients.createDefault();
  35 + HttpGet get = new HttpGet(url);
  36 +
  37 + response = httpClient.execute(get);
  38 +
  39 + HttpEntity entity = response.getEntity();
  40 + if (null != entity) {
  41 + BufferedReader br = new BufferedReader(new InputStreamReader(entity.getContent()));
  42 + StringBuffer stringBuffer = new StringBuffer();
  43 + String str = "";
  44 + while ((str = br.readLine()) != null)
  45 + stringBuffer.append(str);
  46 +
  47 +
  48 + list = JSON.parseArray(stringBuffer.toString(), SafeDriv.class);
  49 + /**
  50 + * 模拟数据
  51 +
  52 + SafeDriv sd1 = new SafeDriv();
  53 + sd1.setYczltype("1");
  54 + sd1.setClzbh("W2B-001");
  55 + sd1.setStartime("2017-04-07 08:00:00.0");
  56 +
  57 + SafeDriv sd2 = new SafeDriv();
  58 + sd2.setYczltype("2");
  59 + sd2.setClzbh("W2B-002");
  60 + sd2.setStartime("2017-04-07 08:02:00.0");
  61 +
  62 + SafeDriv sd3 = new SafeDriv();
  63 + sd3.setYczltype("3");
  64 + sd3.setClzbh("W2B-003");
  65 + sd3.setStartime("2017-04-07 08:03:00.0");
  66 +
  67 + SafeDriv sd4 = new SafeDriv();
  68 + sd4.setYczltype("4");
  69 + sd4.setClzbh("W2B-004");
  70 + sd4.setStartime("2017-04-07 08:04:00.0");
  71 +
  72 + SafeDriv sd5 = new SafeDriv();
  73 + sd5.setYczltype("5");
  74 + sd5.setClzbh("W2B-005");
  75 + sd5.setStartime("2017-04-07 08:05:00.0");
  76 +
  77 + list.add(sd1);
  78 + list.add(sd2);
  79 + list.add(sd3);
  80 + list.add(sd4);
  81 + list.add(sd5);
  82 + */
  83 + for(SafeDriv sd : list){
  84 + SafeDrivCenter.put(sd);
  85 + }
  86 + }
  87 +
  88 + httpClient.close();
  89 + response.close();
  90 + } catch (Exception e) {
  91 + logger.error("", e);
  92 + }
  93 + }
  94 +}
src/main/java/com/bsth/entity/excep/Offline.java
@@ -6,6 +6,7 @@ import javax.persistence.Entity; @@ -6,6 +6,7 @@ import javax.persistence.Entity;
6 import javax.persistence.GeneratedValue; 6 import javax.persistence.GeneratedValue;
7 import javax.persistence.Id; 7 import javax.persistence.Id;
8 import javax.persistence.Table; 8 import javax.persistence.Table;
  9 +import javax.persistence.Transient;
9 10
10 /** 11 /**
11 * 掉线 12 * 掉线
@@ -65,7 +66,12 @@ public class Offline { @@ -65,7 +66,12 @@ public class Offline {
65 */ 66 */
66 private Date createDate; 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 public Integer getId() { 75 public Integer getId() {
70 return id; 76 return id;
71 } 77 }
@@ -146,5 +152,29 @@ public class Offline { @@ -146,5 +152,29 @@ public class Offline {
146 this.timestampDate = timestampDate; 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 +6,7 @@ import javax.persistence.Entity;
6 import javax.persistence.GeneratedValue; 6 import javax.persistence.GeneratedValue;
7 import javax.persistence.Id; 7 import javax.persistence.Id;
8 import javax.persistence.Table; 8 import javax.persistence.Table;
  9 +import javax.persistence.Transient;
9 10
10 /** 11 /**
11 * 越界 12 * 越界
@@ -72,7 +73,12 @@ public class Outbound { @@ -72,7 +73,12 @@ public class Outbound {
72 * 时间 73 * 时间
73 */ 74 */
74 private Date createDate; 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 public Integer getId() { 83 public Integer getId() {
78 return id; 84 return id;
@@ -162,5 +168,29 @@ public class Outbound { @@ -162,5 +168,29 @@ public class Outbound {
162 this.timestampDate = timestampDate; 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 +6,7 @@ import javax.persistence.Entity;
6 import javax.persistence.GeneratedValue; 6 import javax.persistence.GeneratedValue;
7 import javax.persistence.Id; 7 import javax.persistence.Id;
8 import javax.persistence.Table; 8 import javax.persistence.Table;
  9 +import javax.persistence.Transient;
9 10
10 /** 11 /**
11 * 超速 12 * 超速
@@ -66,6 +67,13 @@ public class Speeding { @@ -66,6 +67,13 @@ public class Speeding {
66 private String timestampDate; 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,6 +169,30 @@ public class Speeding {
161 this.timestampDate = timestampDate; 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/repository/StationRouteRepository.java
@@ -272,4 +272,8 @@ public interface StationRouteRepository extends BaseRepository&lt;StationRoute, Int @@ -272,4 +272,8 @@ public interface StationRouteRepository extends BaseRepository&lt;StationRoute, Int
272 @Modifying 272 @Modifying
273 @Query(value="update bsth_c_stationroute set directions = case directions when 1 then 0 when 0 then 1 end where line_code = ?1 ", nativeQuery=true) 273 @Query(value="update bsth_c_stationroute set directions = case directions when 1 then 0 when 0 then 1 end where line_code = ?1 ", nativeQuery=true)
274 public void stationRouteDir(Integer line); 274 public void stationRouteDir(Integer line);
  275 +
  276 + @Modifying
  277 + @Query(value="update bsth_c_stationroute set distances =?2 where id = ?1 ", nativeQuery=true)
  278 + public void upddis(Integer id,Double dis);
275 } 279 }
src/main/java/com/bsth/service/StationRouteService.java
@@ -82,4 +82,6 @@ public interface StationRouteService extends BaseService&lt;StationRoute, Integer&gt; @@ -82,4 +82,6 @@ public interface StationRouteService extends BaseService&lt;StationRoute, Integer&gt;
82 Map<String, Object> findByMultiLine(String lineIds); 82 Map<String, Object> findByMultiLine(String lineIds);
83 83
84 Map<String, Object> updSwitchDir(String lineIds); 84 Map<String, Object> updSwitchDir(String lineIds);
  85 +
  86 + Map<String, Object> upddis(Map<String, Object> map);
85 } 87 }
src/main/java/com/bsth/service/excep/impl/OfflineServiceImpl.java
@@ -12,10 +12,15 @@ import java.util.HashMap; @@ -12,10 +12,15 @@ import java.util.HashMap;
12 import java.util.List; 12 import java.util.List;
13 import java.util.Map; 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 import org.springframework.stereotype.Service; 18 import org.springframework.stereotype.Service;
16 19
17 import com.bsth.data.BasicData; 20 import com.bsth.data.BasicData;
18 import com.bsth.entity.excep.Offline; 21 import com.bsth.entity.excep.Offline;
  22 +import com.bsth.entity.oil.Ylb;
  23 +import com.bsth.entity.realcontrol.ScheduleRealInfo;
19 import com.bsth.service.excep.OfflineService; 24 import com.bsth.service.excep.OfflineService;
20 import com.bsth.util.EchartConver; 25 import com.bsth.util.EchartConver;
21 import com.bsth.util.PageHelper; 26 import com.bsth.util.PageHelper;
@@ -27,6 +32,8 @@ import com.google.gson.Gson; @@ -27,6 +32,8 @@ import com.google.gson.Gson;
27 @Service 32 @Service
28 public class OfflineServiceImpl implements OfflineService { 33 public class OfflineServiceImpl implements OfflineService {
29 34
  35 + @Autowired
  36 + JdbcTemplate jdbcTemplate;
30 // @Override 37 // @Override
31 static List<Offline> findAll(Map<String, Object> map) { 38 static List<Offline> findAll(Map<String, Object> map) {
32 // TODO Auto-generated method stub 39 // TODO Auto-generated method stub
@@ -53,7 +60,9 @@ public class OfflineServiceImpl implements OfflineService { @@ -53,7 +60,9 @@ public class OfflineServiceImpl implements OfflineService {
53 } 60 }
54 61
55 if(nbbm!=null){ 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 if(updown!=null){ 68 if(updown!=null){
@@ -61,7 +70,7 @@ public class OfflineServiceImpl implements OfflineService { @@ -61,7 +70,7 @@ public class OfflineServiceImpl implements OfflineService {
61 } 70 }
62 if(date!=null){ 71 if(date!=null){
63 if (date.toString().length()>0) { 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 try { 74 try {
66 Long t1=sdf.parse(date.toString()+" 00:00:00").getTime(); 75 Long t1=sdf.parse(date.toString()+" 00:00:00").getTime();
67 Long t2=sdf.parse(date.toString()+" 23:59:59").getTime(); 76 Long t2=sdf.parse(date.toString()+" 23:59:59").getTime();
@@ -112,7 +121,7 @@ public class OfflineServiceImpl implements OfflineService { @@ -112,7 +121,7 @@ public class OfflineServiceImpl implements OfflineService {
112 offline.setTimestamp(Long.valueOf(rs.getObject("timestamp").toString())); 121 offline.setTimestamp(Long.valueOf(rs.getObject("timestamp").toString()));
113 offline.setTimestampDate(sdf.format(new Date(offline.getTimestamp()))); 122 offline.setTimestampDate(sdf.format(new Date(offline.getTimestamp())));
114 offline.setUpDown(Integer.valueOf(rs.getObject("up_down").toString())); 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 list.add(offline); 125 list.add(offline);
117 } 126 }
118 return list; 127 return list;
@@ -135,7 +144,9 @@ public class OfflineServiceImpl implements OfflineService { @@ -135,7 +144,9 @@ public class OfflineServiceImpl implements OfflineService {
135 } 144 }
136 145
137 if(nbbm!=null){ 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 if(updown!=null){ 152 if(updown!=null){
@@ -143,7 +154,7 @@ public class OfflineServiceImpl implements OfflineService { @@ -143,7 +154,7 @@ public class OfflineServiceImpl implements OfflineService {
143 } 154 }
144 if(date!=null){ 155 if(date!=null){
145 if (date.toString().length()>0) { 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 try { 158 try {
148 Long t1=sdf.parse(date.toString()+" 00:00:00").getTime(); 159 Long t1=sdf.parse(date.toString()+" 00:00:00").getTime();
149 Long t2=sdf.parse(date.toString()+" 23:59:59").getTime(); 160 Long t2=sdf.parse(date.toString()+" 23:59:59").getTime();
@@ -177,8 +188,41 @@ public class OfflineServiceImpl implements OfflineService { @@ -177,8 +188,41 @@ public class OfflineServiceImpl implements OfflineService {
177 PageHelper pageHelper = new PageHelper(totalData, map); 188 PageHelper pageHelper = new PageHelper(totalData, map);
178 // List<T> list = this.baseDao.queryByObject(pageHelper.getMap()); 189 // List<T> list = this.baseDao.queryByObject(pageHelper.getMap());
179 List<Offline> list=findAll(pageHelper.getMap()); 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 PageObject<Offline> pageObject = pageHelper.getPageObject(); 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 return pageObject; 226 return pageObject;
183 } 227 }
184 public static void main(String[] args) { 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,10 +12,14 @@ import java.util.HashMap;
12 import java.util.List; 12 import java.util.List;
13 import java.util.Map; 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 import org.springframework.stereotype.Service; 18 import org.springframework.stereotype.Service;
16 19
17 import com.bsth.data.BasicData; 20 import com.bsth.data.BasicData;
18 import com.bsth.entity.excep.Outbound; 21 import com.bsth.entity.excep.Outbound;
  22 +import com.bsth.entity.realcontrol.ScheduleRealInfo;
19 import com.bsth.service.excep.OutboundService; 23 import com.bsth.service.excep.OutboundService;
20 import com.bsth.util.EchartConver; 24 import com.bsth.util.EchartConver;
21 import com.bsth.util.PageHelper; 25 import com.bsth.util.PageHelper;
@@ -25,8 +29,9 @@ import com.github.abel533.echarts.Option; @@ -25,8 +29,9 @@ import com.github.abel533.echarts.Option;
25 import com.google.gson.Gson; 29 import com.google.gson.Gson;
26 @Service 30 @Service
27 public class OutboundServiceImpl implements OutboundService{ 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 Connection conn = null; 35 Connection conn = null;
31 PreparedStatement ps = null; 36 PreparedStatement ps = null;
32 ResultSet rs = null; 37 ResultSet rs = null;
@@ -37,12 +42,13 @@ public class OutboundServiceImpl implements OutboundService{ @@ -37,12 +42,13 @@ public class OutboundServiceImpl implements OutboundService{
37 Object nbbm=map.get("nbbm"); 42 Object nbbm=map.get("nbbm");
38 Object updown=map.get("updown"); 43 Object updown=map.get("updown");
39 Object date=map.get("date"); 44 Object date=map.get("date");
40 -  
41 if(line!=null){ 45 if(line!=null){
42 sql +=" and line like'%"+line.toString()+"%'"; 46 sql +=" and line like'%"+line.toString()+"%'";
43 } 47 }
44 48
45 if(nbbm!=null){ 49 if(nbbm!=null){
  50 + nbbm=BasicData.deviceId2NbbmMap.inverse().get(nbbm);
  51 + if(nbbm!=null)
46 sql +=" and vehicle like '%"+nbbm.toString()+"%'"; 52 sql +=" and vehicle like '%"+nbbm.toString()+"%'";
47 } 53 }
48 54
@@ -51,7 +57,7 @@ public class OutboundServiceImpl implements OutboundService{ @@ -51,7 +57,7 @@ public class OutboundServiceImpl implements OutboundService{
51 } 57 }
52 if(date!=null){ 58 if(date!=null){
53 if (date.toString().length()>0) { 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 try { 61 try {
56 Long t1=sdf.parse(date.toString()+" 00:00:00").getTime(); 62 Long t1=sdf.parse(date.toString()+" 00:00:00").getTime();
57 Long t2=sdf.parse(date.toString()+" 23:59:59").getTime(); 63 Long t2=sdf.parse(date.toString()+" 23:59:59").getTime();
@@ -98,7 +104,7 @@ public class OutboundServiceImpl implements OutboundService{ @@ -98,7 +104,7 @@ public class OutboundServiceImpl implements OutboundService{
98 outbound.setTimestamp((Long.valueOf(rs.getObject("timestamp").toString()))); 104 outbound.setTimestamp((Long.valueOf(rs.getObject("timestamp").toString())));
99 outbound.setTimestampDate(sdf.format(new Date(outbound.getTimestamp()))); 105 outbound.setTimestampDate(sdf.format(new Date(outbound.getTimestamp())));
100 outbound.setUpDown(Integer.valueOf(rs.getObject("up_down").toString())); 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 outbound.setLocation(rs.getObject("location")==null?"":rs.getObject("location").toString()); 108 outbound.setLocation(rs.getObject("location")==null?"":rs.getObject("location").toString());
103 list.add(outbound); 109 list.add(outbound);
104 } 110 }
@@ -119,6 +125,8 @@ public class OutboundServiceImpl implements OutboundService{ @@ -119,6 +125,8 @@ public class OutboundServiceImpl implements OutboundService{
119 } 125 }
120 126
121 if(nbbm!=null){ 127 if(nbbm!=null){
  128 + nbbm=BasicData.deviceId2NbbmMap.inverse().get(nbbm);
  129 + if(nbbm!=null)
122 sql +=" and vehicle like '%"+nbbm.toString()+"%'"; 130 sql +=" and vehicle like '%"+nbbm.toString()+"%'";
123 } 131 }
124 132
@@ -160,7 +168,34 @@ public class OutboundServiceImpl implements OutboundService{ @@ -160,7 +168,34 @@ public class OutboundServiceImpl implements OutboundService{
160 168
161 PageHelper pageHelper = new PageHelper(totalData, map); 169 PageHelper pageHelper = new PageHelper(totalData, map);
162 List<Outbound> list=findAll(pageHelper.getMap()); 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 PageObject<Outbound> pageObject = pageHelper.getPageObject(); 199 PageObject<Outbound> pageObject = pageHelper.getPageObject();
165 pageObject.setDataList(list); 200 pageObject.setDataList(list);
166 return pageObject; 201 return pageObject;
src/main/java/com/bsth/service/excep/impl/SpeedingServiceImpl.java
@@ -12,10 +12,14 @@ import java.util.HashMap; @@ -12,10 +12,14 @@ import java.util.HashMap;
12 import java.util.List; 12 import java.util.List;
13 import java.util.Map; 13 import java.util.Map;
14 14
  15 +import org.springframework.jdbc.core.JdbcTemplate;
  16 +import org.springframework.jdbc.core.RowMapper;
15 import org.springframework.stereotype.Service; 17 import org.springframework.stereotype.Service;
  18 +import org.springframework.beans.factory.annotation.Autowired;
16 19
17 import com.bsth.data.BasicData; 20 import com.bsth.data.BasicData;
18 import com.bsth.entity.excep.Speeding; 21 import com.bsth.entity.excep.Speeding;
  22 +import com.bsth.entity.realcontrol.ScheduleRealInfo;
19 import com.bsth.service.excep.SpeedingService; 23 import com.bsth.service.excep.SpeedingService;
20 import com.bsth.util.EchartConver; 24 import com.bsth.util.EchartConver;
21 import com.bsth.util.PageHelper; 25 import com.bsth.util.PageHelper;
@@ -27,7 +31,8 @@ import com.google.gson.Gson; @@ -27,7 +31,8 @@ import com.google.gson.Gson;
27 @Service 31 @Service
28 public class SpeedingServiceImpl implements SpeedingService { 32 public class SpeedingServiceImpl implements SpeedingService {
29 33
30 - 34 + @Autowired
  35 + JdbcTemplate jdbcTemplate;
31 static List<Speeding> findAll(Map<String, Object> map) { 36 static List<Speeding> findAll(Map<String, Object> map) {
32 Connection conn = null; 37 Connection conn = null;
33 PreparedStatement ps = null; 38 PreparedStatement ps = null;
@@ -45,6 +50,8 @@ public class SpeedingServiceImpl implements SpeedingService { @@ -45,6 +50,8 @@ public class SpeedingServiceImpl implements SpeedingService {
45 } 50 }
46 51
47 if(nbbm!=null){ 52 if(nbbm!=null){
  53 + nbbm=BasicData.deviceId2NbbmMap.inverse().get(nbbm);
  54 + if(nbbm!=null)
48 sql +=" and vehicle like '%"+nbbm.toString()+"%'"; 55 sql +=" and vehicle like '%"+nbbm.toString()+"%'";
49 } 56 }
50 57
@@ -53,7 +60,7 @@ public class SpeedingServiceImpl implements SpeedingService { @@ -53,7 +60,7 @@ public class SpeedingServiceImpl implements SpeedingService {
53 } 60 }
54 if(date!=null){ 61 if(date!=null){
55 if (date.toString().length()>0) { 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 try { 64 try {
58 Long t1=sdf.parse(date.toString()+" 00:00:00").getTime(); 65 Long t1=sdf.parse(date.toString()+" 00:00:00").getTime();
59 Long t2=sdf.parse(date.toString()+" 23:59:59").getTime(); 66 Long t2=sdf.parse(date.toString()+" 23:59:59").getTime();
@@ -102,7 +109,7 @@ public class SpeedingServiceImpl implements SpeedingService { @@ -102,7 +109,7 @@ public class SpeedingServiceImpl implements SpeedingService {
102 speeding.setTimestamp((Long.valueOf(rs.getObject("timestamp").toString()))); 109 speeding.setTimestamp((Long.valueOf(rs.getObject("timestamp").toString())));
103 speeding.setTimestampDate(sdf.format(new Date(speeding.getTimestamp()))); 110 speeding.setTimestampDate(sdf.format(new Date(speeding.getTimestamp())));
104 speeding.setUpDown(Integer.valueOf(rs.getObject("up_down").toString())); 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 list.add(speeding); 113 list.add(speeding);
107 } 114 }
108 return list; 115 return list;
@@ -122,9 +129,10 @@ public class SpeedingServiceImpl implements SpeedingService { @@ -122,9 +129,10 @@ public class SpeedingServiceImpl implements SpeedingService {
122 } 129 }
123 130
124 if(nbbm!=null){ 131 if(nbbm!=null){
  132 + nbbm=BasicData.deviceId2NbbmMap.inverse().get(nbbm);
  133 + if(nbbm!=null)
125 sql +=" and vehicle like '%"+nbbm.toString()+"%'"; 134 sql +=" and vehicle like '%"+nbbm.toString()+"%'";
126 } 135 }
127 -  
128 if(updown!=null){ 136 if(updown!=null){
129 sql +="and up_down like '%"+updown.toString()+"%'"; 137 sql +="and up_down like '%"+updown.toString()+"%'";
130 } 138 }
@@ -163,7 +171,34 @@ public class SpeedingServiceImpl implements SpeedingService { @@ -163,7 +171,34 @@ public class SpeedingServiceImpl implements SpeedingService {
163 171
164 PageHelper pageHelper = new PageHelper(totalData, map); 172 PageHelper pageHelper = new PageHelper(totalData, map);
165 List<Speeding> list=findAll(pageHelper.getMap()); 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 PageObject<Speeding> pageObject = pageHelper.getPageObject(); 202 PageObject<Speeding> pageObject = pageHelper.getPageObject();
168 pageObject.setDataList(list); 203 pageObject.setDataList(list);
169 return pageObject; 204 return pageObject;
src/main/java/com/bsth/service/gps/GpsService.java
1 package com.bsth.service.gps; 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 import java.util.List; 6 import java.util.List;
4 import java.util.Map; 7 import java.util.Map;
5 8
@@ -20,4 +23,8 @@ public interface GpsService { @@ -20,4 +23,8 @@ public interface GpsService {
20 Map<String,Object> gpsCompletion(long schId); 23 Map<String,Object> gpsCompletion(long schId);
21 24
22 Map<String,Object> history_v2(String nbbm, long st, long et); 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,8 +11,7 @@ import com.bsth.entity.realcontrol.ScheduleRealInfo;
11 import com.bsth.repository.CarParkRepository; 11 import com.bsth.repository.CarParkRepository;
12 import com.bsth.repository.StationRepository; 12 import com.bsth.repository.StationRepository;
13 import com.bsth.repository.realcontrol.ScheduleRealInfoRepository; 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 import com.bsth.util.DateUtils; 15 import com.bsth.util.DateUtils;
17 import com.bsth.util.TransGPS; 16 import com.bsth.util.TransGPS;
18 import com.bsth.util.TransGPS.Location; 17 import com.bsth.util.TransGPS.Location;
@@ -192,7 +191,6 @@ public class GpsServiceImpl implements GpsService { @@ -192,7 +191,6 @@ public class GpsServiceImpl implements GpsService {
192 return (int) (Long.parseLong(o1.get("ts").toString()) - Long.parseLong(o2.get("ts").toString())); 191 return (int) (Long.parseLong(o1.get("ts").toString()) - Long.parseLong(o2.get("ts").toString()));
193 } 192 }
194 }); 193 });
195 - ;  
196 return list; 194 return list;
197 } 195 }
198 196
@@ -207,10 +205,10 @@ public class GpsServiceImpl implements GpsService { @@ -207,10 +205,10 @@ public class GpsServiceImpl implements GpsService {
207 inv = inv.substring(0, inv.length() - 1); 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 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 (" 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 try { 212 try {
215 conn = DBUtils_MS.getConnection(); 213 conn = DBUtils_MS.getConnection();
216 ps = conn.prepareStatement(sql); 214 ps = conn.prepareStatement(sql);
@@ -296,6 +294,9 @@ public class GpsServiceImpl implements GpsService { @@ -296,6 +294,9 @@ public class GpsServiceImpl implements GpsService {
296 prefix = lineId + "_" + updown + "_"; 294 prefix = lineId + "_" + updown + "_";
297 stationName = BasicData.getStationNameByCode(rs.getString("STOP_NO"), prefix); 295 stationName = BasicData.getStationNameByCode(rs.getString("STOP_NO"), prefix);
298 296
  297 + if (StringUtils.isEmpty(stationName))
  298 + continue;
  299 +
299 arr = new ArrivalEntity(rs.getString("DEVICE_ID"), rs.getLong("TS"), lineId, 300 arr = new ArrivalEntity(rs.getString("DEVICE_ID"), rs.getLong("TS"), lineId,
300 updown, rs.getString("STOP_NO"), rs.getInt("IN_OUT"), rs.getLong("CREATE_DATE"), 301 updown, rs.getString("STOP_NO"), rs.getInt("IN_OUT"), rs.getLong("CREATE_DATE"),
301 rs.getInt("WEEKS_YEAR"), stationName); 302 rs.getInt("WEEKS_YEAR"), stationName);
@@ -444,7 +445,7 @@ public class GpsServiceImpl implements GpsService { @@ -444,7 +445,7 @@ public class GpsServiceImpl implements GpsService {
444 return rs; 445 return rs;
445 } 446 }
446 447
447 - if(sch.isReissue()){ 448 + if (sch.isReissue()) {
448 rs.put("status", ResponseCode.ERROR); 449 rs.put("status", ResponseCode.ERROR);
449 rs.put("msg", "你不能重复这个操作"); 450 rs.put("msg", "你不能重复这个操作");
450 return rs; 451 return rs;
@@ -453,7 +454,7 @@ public class GpsServiceImpl implements GpsService { @@ -453,7 +454,7 @@ public class GpsServiceImpl implements GpsService {
453 String sql = "select * from bsth_gps_template where line_id='" + sch.getXlBm() + "' and up_down=" + sch.getXlDir(); 454 String sql = "select * from bsth_gps_template where line_id='" + sch.getXlBm() + "' and up_down=" + sch.getXlDir();
454 List<Map<String, Object>> list = jdbcTemplate.queryForList(sql); 455 List<Map<String, Object>> list = jdbcTemplate.queryForList(sql);
455 456
456 - if(list.size() == 0){ 457 + if (list.size() == 0) {
457 rs.put("status", ResponseCode.ERROR); 458 rs.put("status", ResponseCode.ERROR);
458 rs.put("msg", "缺少模板数据,请联系系统管理员!!"); 459 rs.put("msg", "缺少模板数据,请联系系统管理员!!");
459 return rs; 460 return rs;
@@ -470,21 +471,20 @@ public class GpsServiceImpl implements GpsService { @@ -470,21 +471,20 @@ public class GpsServiceImpl implements GpsService {
470 int diff = (int) (sch.getDfsjT() - Long.parseLong(fs.get("ts").toString()) - 1000 * 70); 471 int diff = (int) (sch.getDfsjT() - Long.parseLong(fs.get("ts").toString()) - 1000 * 70);
471 472
472 String deviceId = BasicData.deviceId2NbbmMap.inverse().get(sch.getClZbh()); 473 String deviceId = BasicData.deviceId2NbbmMap.inverse().get(sch.getClZbh());
473 - for(Map<String, Object> map : list){ 474 + for (Map<String, Object> map : list) {
474 map.put("device_id", deviceId); 475 map.put("device_id", deviceId);
475 map.put("ts", Long.parseLong(map.get("ts").toString()) + diff); 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 Set<String> ks = fs.keySet(); 481 Set<String> ks = fs.keySet();
482 - for(String k : ks){ 482 + for (String k : ks) {
483 sqlBefore += (k + ","); 483 sqlBefore += (k + ",");
484 sqlValues += "?,"; 484 sqlValues += "?,";
485 } 485 }
486 sqlBefore = sqlBefore.substring(0, sqlBefore.length() - 1) + ", create_ts)"; 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 sql = sqlBefore + " " + sqlValues; 488 sql = sqlBefore + " " + sqlValues;
489 489
490 Connection conn = DBUtils_MS.getConnection(); 490 Connection conn = DBUtils_MS.getConnection();
@@ -492,9 +492,9 @@ public class GpsServiceImpl implements GpsService { @@ -492,9 +492,9 @@ public class GpsServiceImpl implements GpsService {
492 ps = conn.prepareStatement(sql); 492 ps = conn.prepareStatement(sql);
493 int fsize = ks.size(); 493 int fsize = ks.size();
494 List<Object> vs; 494 List<Object> vs;
495 - for(Map<String, Object> map : list){ 495 + for (Map<String, Object> map : list) {
496 vs = new ArrayList<>(map.values()); 496 vs = new ArrayList<>(map.values());
497 - for(int i = 0; i < fsize; i ++){ 497 + for (int i = 0; i < fsize; i++) {
498 ps.setObject(i + 1, vs.get(i)); 498 ps.setObject(i + 1, vs.get(i));
499 } 499 }
500 ps.addBatch(); 500 ps.addBatch();
@@ -523,30 +523,62 @@ public class GpsServiceImpl implements GpsService { @@ -523,30 +523,62 @@ public class GpsServiceImpl implements GpsService {
523 try { 523 try {
524 //获取历史gps 数据 524 //获取历史gps 数据
525 List<HistoryGps_DTO> list = HistoryGps_DTO.craete(history(new String[]{nbbm}, st, et)); 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 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)"; 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 List<Road_DTO> roads = Road_DTO.craete(jdbcTemplate.queryForList(sql, list.get(0).getLineId())); 529 List<Road_DTO> roads = Road_DTO.craete(jdbcTemplate.queryForList(sql, list.get(0).getLineId()));
530 530
531 //为GPS数据关联路段信息 531 //为GPS数据关联路段信息
532 - for(HistoryGps_DTO gps : list){ 532 + for (HistoryGps_DTO gps : list) {
533 matchRoadToGps(gps, roads); 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 rs.put("status", ResponseCode.SUCCESS); 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 logger.error("", e); 547 logger.error("", e);
541 rs.put("status", ResponseCode.ERROR); 548 rs.put("status", ResponseCode.ERROR);
542 } 549 }
543 return rs; 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 Road_DTO nearRoad = null; 580 Road_DTO nearRoad = null;
549 - for(Road_DTO road : roads){ 581 + for (Road_DTO road : roads) {
550 distance = GeoUtils.getDistanceFromLine(road.getLineStr(), gps.getPoint()); 582 distance = GeoUtils.getDistanceFromLine(road.getLineStr(), gps.getPoint());
551 583
552 if (min > distance || min == -1) { 584 if (min > distance || min == -1) {
@@ -559,6 +591,20 @@ public class GpsServiceImpl implements GpsService { @@ -559,6 +591,20 @@ public class GpsServiceImpl implements GpsService {
559 gps.setRoadMinDistance(min); 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 private void sortGpsList(final Field f, List<GpsEntity> rs) { 608 private void sortGpsList(final Field f, List<GpsEntity> rs) {
563 Collections.sort(rs, new Comparator<GpsEntity>() { 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,12 +17,12 @@ import java.util.Map;
17 */ 17 */
18 public class HistoryGps_DTO { 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 List<HistoryGps_DTO> list = JSONObject.parseArray(JSON.toJSONString(mapList), HistoryGps_DTO.class); 21 List<HistoryGps_DTO> list = JSONObject.parseArray(JSON.toJSONString(mapList), HistoryGps_DTO.class);
22 22
23 GeometryFactory geometryFactory = new GeometryFactory(); 23 GeometryFactory geometryFactory = new GeometryFactory();
24 Point point; 24 Point point;
25 - for(HistoryGps_DTO gps : list){ 25 + for (HistoryGps_DTO gps : list) {
26 point = geometryFactory.createPoint(new Coordinate(gps.getLat(), gps.getLon())); 26 point = geometryFactory.createPoint(new Coordinate(gps.getLat(), gps.getLon()));
27 gps.setPoint(point); 27 gps.setPoint(point);
28 } 28 }
@@ -56,11 +56,32 @@ public class HistoryGps_DTO { @@ -56,11 +56,32 @@ public class HistoryGps_DTO {
56 @JsonIgnore 56 @JsonIgnore
57 private Point point; 57 private Point point;
58 58
59 - /** 路段 */ 59 + /**
  60 + * 路段
  61 + */
60 private Road_DTO road; 62 private Road_DTO road;
61 - /** 和路段的最短距离 */ 63 + /**
  64 + * 和路段的最短距离
  65 + */
62 private double roadMinDistance; 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 public double getGcj_lon() { 85 public double getGcj_lon() {
65 return gcj_lon; 86 return gcj_lon;
66 } 87 }
src/main/java/com/bsth/service/impl/StationRouteServiceImpl.java
@@ -1100,4 +1100,24 @@ public class StationRouteServiceImpl extends BaseServiceImpl&lt;StationRoute, Integ @@ -1100,4 +1100,24 @@ public class StationRouteServiceImpl extends BaseServiceImpl&lt;StationRoute, Integ
1100 } 1100 }
1101 return rs; 1101 return rs;
1102 } 1102 }
  1103 +
  1104 + @Override
  1105 + @Transactional
  1106 + public Map<String, Object> upddis(Map<String, Object> map) {
  1107 + Map<String, Object> rs = new HashMap<>();
  1108 + try{
  1109 + Iterator it = map.entrySet().iterator();
  1110 + while(it.hasNext()){
  1111 + java.util.Map.Entry entry = (java.util.Map.Entry)it.next();
  1112 + Integer id = Integer.parseInt(entry.getKey().toString().split("_")[1]); //返回对应的键
  1113 + Double dis = Double.parseDouble(entry.getValue().toString()) / 1000; //返回对应的值
  1114 + repository.upddis(id, dis);
  1115 + }
  1116 + rs.put("status", ResponseCode.SUCCESS);
  1117 + }catch(Exception e){
  1118 + logger.error("", e);
  1119 + rs.put("status", ResponseCode.ERROR);
  1120 + }
  1121 + return rs;
  1122 + }
1103 } 1123 }
src/main/java/com/bsth/websocket/handler/RealControlSocketHandler.java
@@ -94,7 +94,7 @@ public class RealControlSocketHandler implements WebSocketHandler { @@ -94,7 +94,7 @@ public class RealControlSocketHandler implements WebSocketHandler {
94 /** 94 /**
95 * 根据线路推送消息 95 * 根据线路推送消息
96 */ 96 */
97 - public synchronized void sendMessageToLine(String lineCode, String msg) { 97 + public void sendMessageToLine(String lineCode, String msg) {
98 98
99 TextMessage message = new TextMessage(msg.getBytes()); 99 TextMessage message = new TextMessage(msg.getBytes());
100 100
@@ -117,4 +117,28 @@ public class RealControlSocketHandler implements WebSocketHandler { @@ -117,4 +117,28 @@ public class RealControlSocketHandler implements WebSocketHandler {
117 } 117 }
118 } 118 }
119 } 119 }
  120 +
  121 +
  122 +
  123 + /**
  124 + * 全局推送
  125 + */
  126 + public void sendMessage(String msg) {
  127 +
  128 + TextMessage message = new TextMessage(msg.getBytes());
  129 +
  130 + Iterator<WebSocketSession> iterator = users.iterator();
  131 +
  132 + WebSocketSession user;
  133 + while(iterator.hasNext()){
  134 + user = iterator.next();
  135 + try {
  136 + if (user.isOpen()) {
  137 + user.sendMessage(message);
  138 + }
  139 + } catch (Exception e) {
  140 + logger.error("sendMessage error ...."+msg);
  141 + }
  142 + }
  143 + }
120 } 144 }
src/main/java/com/bsth/websocket/handler/SendUtils.java
@@ -5,6 +5,7 @@ import com.bsth.data.BasicData; @@ -5,6 +5,7 @@ import com.bsth.data.BasicData;
5 import com.bsth.data.LineConfigData; 5 import com.bsth.data.LineConfigData;
6 import com.bsth.data.gpsdata.GpsEntity; 6 import com.bsth.data.gpsdata.GpsEntity;
7 import com.bsth.data.gpsdata.arrival.entity.SignalState; 7 import com.bsth.data.gpsdata.arrival.entity.SignalState;
  8 +import com.bsth.data.safe_driv.SafeDriv;
8 import com.bsth.entity.directive.D80; 9 import com.bsth.entity.directive.D80;
9 import com.bsth.entity.realcontrol.ScheduleRealInfo; 10 import com.bsth.entity.realcontrol.ScheduleRealInfo;
10 import com.fasterxml.jackson.core.JsonProcessingException; 11 import com.fasterxml.jackson.core.JsonProcessingException;
@@ -184,4 +185,18 @@ public class SendUtils{ @@ -184,4 +185,18 @@ public class SendUtils{
184 logger.error("", e); 185 logger.error("", e);
185 } 186 }
186 } 187 }
  188 +
  189 + public void sendSafeDriv(SafeDriv sd){
  190 + Map<String, Object> map = new HashMap<>();
  191 + map.put("fn", "safeDriv");
  192 + map.put("t", sd);;
  193 + ObjectMapper mapper = new ObjectMapper();
  194 +
  195 + try {
  196 + socketHandler.sendMessage(mapper.writeValueAsString(map));
  197 +
  198 + } catch (JsonProcessingException e) {
  199 + logger.error("", e);
  200 + }
  201 + }
187 } 202 }
src/main/resources/static/pages/base/stationroute/js/stationroute-ajax-getdata.js
@@ -168,6 +168,13 @@ var GetAjaxData = function(){ @@ -168,6 +168,13 @@ var GetAjaxData = function(){
168 }, 168 },
169 169
170 // 查询路段信息 170 // 查询路段信息
  171 + getStationRouteInfo : function(lineId,direction,callback) {
  172 + $get('/stationroute/all',{'line.id_eq' : lineId , 'directions_eq' : direction},function(resultdata) {
  173 + callback && callback(resultdata);
  174 + });
  175 + },
  176 +
  177 + // 查询路段信息
171 getSectionRouteInfo : function(lineId,direction,callback) { 178 getSectionRouteInfo : function(lineId,direction,callback) {
172 $get('/sectionroute/findSection',{'line.id_eq' : lineId , 'directions_eq' : direction},function(resultdata) { 179 $get('/sectionroute/findSection',{'line.id_eq' : lineId , 'directions_eq' : direction},function(resultdata) {
173 callback && callback(resultdata); 180 callback && callback(resultdata);
src/main/resources/static/pages/base/stationroute/js/stationroute-list-events.js
@@ -122,6 +122,27 @@ $(function(){ @@ -122,6 +122,27 @@ $(function(){
122 });*/ 122 });*/
123 }); 123 });
124 124
  125 + $('#wrenchUpDis').on('click',function() {
  126 + var Line = LineObj.getLineObj();
  127 + GetAjaxData.getStation(Line.id,directionUpValue,function(rd) {
  128 + // 加载其它规划选择弹出层mobal页面
  129 + $.get('tzzj.html', function(m){
  130 + $(pjaxContainer).append(m);
  131 + $('#tzzj_mobal').trigger('tzzjMobal.show', [WorldsBMap,GetAjaxData,directionUpValue,Line.id,PublicFunctions,rd[0].children[0].children]);
  132 + });
  133 + });
  134 + })
  135 +
  136 + $('#wrenchDownDis').on('click',function() {
  137 + var Line = LineObj.getLineObj();
  138 + GetAjaxData.getStation(Line.id,directionDownValue,function(rd) {
  139 + // 加载其它规划选择弹出层mobal页面
  140 + $.get('tzzj.html', function(m){
  141 + $(pjaxContainer).append(m);
  142 + $('#tzzj_mobal').trigger('tzzjMobal.show', [WorldsBMap,GetAjaxData,directionDownValue,Line.id,PublicFunctions,rd[0].children[0].children]);
  143 + });
  144 + });
  145 + })
125 146
126 $('#quoteDown').on('click',function() { 147 $('#quoteDown').on('click',function() {
127 // 弹出提示层. 148 // 弹出提示层.
src/main/resources/static/pages/base/stationroute/list.html
@@ -63,6 +63,10 @@ @@ -63,6 +63,10 @@
63 </li> 63 </li>
64 <li class="divider"> </li> 64 <li class="divider"> </li>
65 <li> 65 <li>
  66 + <a href="javascript:;" id="wrenchUpDis"><i class="fa fa-wrench"></i> 设置上行站距</a>
  67 + </li>
  68 + <li class="divider"> </li>
  69 + <li>
66 <a href="javascript:;" id="quoteDown"><i class="fa fa-long-arrow-down"></i> 引用下行路段</a> 70 <a href="javascript:;" id="quoteDown"><i class="fa fa-long-arrow-down"></i> 引用下行路段</a>
67 </li> 71 </li>
68 <!-- <li> 72 <!-- <li>
@@ -154,6 +158,10 @@ @@ -154,6 +158,10 @@
154 </li> 158 </li>
155 <li class="divider"> </li> 159 <li class="divider"> </li>
156 <li> 160 <li>
  161 + <a href="javascript:;" id="wrenchDownDis"><i class="fa fa-wrench"></i> 设置下行站距</a>
  162 + </li>
  163 + <li class="divider"> </li>
  164 + <li>
157 <a href="javascript:;" id="quoteUp"><i class="fa fa-long-arrow-up"></i> 引用上行路段</a> 165 <a href="javascript:;" id="quoteUp"><i class="fa fa-long-arrow-up"></i> 引用上行路段</a>
158 </li> 166 </li>
159 <!-- <li> 167 <!-- <li>
src/main/resources/static/pages/base/stationroute/tzzj.html 0 → 100644
  1 +<!-- 调整站距 -->
  2 +<div class="modal fade" id="tzzj_mobal" tabindex="-1" role="basic" aria-hidden="true">
  3 + <div class="modal-dialog">
  4 + <div class="modal-content">
  5 + <div class="modal-header">
  6 + <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
  7 + <h4 class="modal-title">调整站距 </h4>
  8 + </div>
  9 + <div class="modal-body">
  10 + <form class="form-horizontal" action="/" method="post" id="tzbcForm" role="form">
  11 + <!-- alert-danger 组件START -->
  12 + <div class="alert alert-danger display-hide" id="tzbcAlert">
  13 + <button class="close" data-close="alert"></button>
  14 + 您的输入有误,请检查下面的输入项
  15 + </div>
  16 + <div class="portlet-body">
  17 + <div class="table-container" style="margin-top: 10px">
  18 + <table class="table table-striped table-bordered table-hover table-checkable" id="datatable_bctz">
  19 + <thead>
  20 + <tr role="row" class="heading">
  21 + <th width="1%"></th>
  22 + <th width="33%">站点序号</th>
  23 + <th width="33%">站点路由</th>
  24 + <th width="33%">站距(米/单位)</th>
  25 + </tr>
  26 + </thead>
  27 + <tbody></tbody>
  28 + </table>
  29 + </div>
  30 + </div>
  31 + </form>
  32 + </div>
  33 + <div class="modal-footer">
  34 + <button type="button" class="btn default" data-dismiss="modal">取消</button>
  35 + <button type="button" class="btn btn-primary" id="tzbcnext">保存</button>
  36 + </div>
  37 + </div>
  38 + </div>
  39 +</div>
  40 +<script type="text/html" id="tzzj_temp">
  41 +{{each list as obj i }}
  42 + <tr role="row" class="filter">
  43 + <td></td>
  44 + <td>
  45 + <!--<input type="text" readonly class="form-control form-filter input-sm" value="{{i+1}}">-->
  46 + {{i+1}}
  47 + </td>
  48 + <td>
  49 + <!-- <input type="text" readonly class="form-control form-filter input-sm" name="station_{{i+1}}" value="{{obj.name}}">-->
  50 + {{obj.name}}
  51 + </td>
  52 + <td>
  53 + <input type="text" class="form-control form-filter input-sm" name="dis_{{obj.stationRouteId}}" value="{{obj.stationRouteDistances * 1000}}">
  54 + </td>
  55 + </tr>
  56 +{{/each}}
  57 +{{if list.length == 0}}
  58 + <tr>
  59 + <td colspan=4><h6 class="muted">没有找到相关数据</h6></td>
  60 + </tr>
  61 + {{/if}}
  62 +</script>
  63 +<script type="text/javascript">
  64 +$('#tzzj_mobal').on('tzzjMobal.show', function(e,map,gd,dir,lineid,pf,rd){
  65 + setTimeout(function(){
  66 + // 加载延迟200毫秒显示mobal
  67 + $('#tzzj_mobal').modal({show : true,backdrop: 'static', keyboard: false});
  68 + },200);
  69 + // 当模态框对用户可见时触发(将等待 CSS 过渡效果完成)。
  70 + $('#tzzj_mobal').on('show.bs.modal', function () {
  71 + console.log(rd);
  72 + // 把数据填充到模版中
  73 + var tbodyHtml = template('tzzj_temp',{list:rd});
  74 + // 把渲染好的模版html文本追加到表格中
  75 + $('#datatable_bctz tbody').html(tbodyHtml);
  76 + });
  77 + // 获取表单元素
  78 + var form = $('#tzbcForm');
  79 + // 错误提示元素
  80 + var tzbcAlert = $('#tzbcAlert', form);
  81 + // 下一步点击事件
  82 + $('#tzbcnext').on('click', function() {
  83 + form.submit();// 表单提交
  84 + });
  85 + // 表单验证
  86 + form.validate({
  87 + errorElement : 'span',
  88 + errorClass : 'help-block help-block-error',
  89 + focusInvalid : false,
  90 + rules : {
  91 + },
  92 + invalidHandler : function(event, validator) {
  93 + tzbcAlert.show();
  94 + App.scrollTo(reladplusname, -200);
  95 + },
  96 + highlight : function(element) {
  97 + $(element).closest('.form-group').addClass('has-error');
  98 + },
  99 + unhighlight : function(element) {
  100 + $(element).closest('.form-group').removeClass('has-error');
  101 + },
  102 + success : function(label) {
  103 + label.closest('.form-group').removeClass('has-error');
  104 + },
  105 + submitHandler : function(f) {
  106 + // 获取表单内容,并序列化
  107 + var params = form.serializeJSON();
  108 + $post('/stationroute/upddis',params,function(data) {
  109 + // 隐藏错误提示
  110 + tzbcAlert.hide();
  111 + // 隐藏 reladplus_mobal 弹出层
  112 + $('#tzzj_mobal').modal('hide');
  113 + if(data.status=='SUCCESS') {
  114 + // 弹出添加成功提示消息
  115 + layer.msg('修改成功...');
  116 + map.clearMarkAndOverlays();
  117 + // 刷新左边树
  118 + pf.resjtreeDate(lineid,dir);
  119 + pf.resjtreeDate(lineid,dir);
  120 + /** 查询上行路段信息 @param:<Line.id:线路Id;0:上行> @return:data:路段数据 */
  121 + gd.getSectionRouteInfo(lineid,dir,function(data) {
  122 + /** 在地图上画出线路走向 @param:<Line.id:线路Id;0:上行;data:路段数据> */
  123 + pf.linePanlThree(lineid,data,dir);
  124 + });
  125 + }else {
  126 + // 弹出添加失败提示消息
  127 + layer.msg('修改失败...');
  128 + }
  129 + });
  130 + }
  131 + });
  132 +});
  133 +</script>
0 \ No newline at end of file 134 \ No newline at end of file
src/main/resources/static/pages/base/timesmodel/add.html
@@ -9,7 +9,6 @@ @@ -9,7 +9,6 @@
9 width: 69%; 9 width: 69%;
10 } 10 }
11 </style> 11 </style>
12 -  
13 <!-- 片段标题 START --> 12 <!-- 片段标题 START -->
14 <div class="page-head"> 13 <div class="page-head">
15 <div class="page-title"> 14 <div class="page-title">
@@ -17,8 +16,6 @@ @@ -17,8 +16,6 @@
17 </div> 16 </div>
18 </div> 17 </div>
19 <!-- 片段标题 END --> 18 <!-- 片段标题 END -->
20 -  
21 -  
22 <!-- 线路信息导航栏组件 START --> 19 <!-- 线路信息导航栏组件 START -->
23 <ul class="page-breadcrumb breadcrumb"> 20 <ul class="page-breadcrumb breadcrumb">
24 <li><a href="/pages/home.html" data-pjax>首页</a> <i class="fa fa-circle"></i></li> 21 <li><a href="/pages/home.html" data-pjax>首页</a> <i class="fa fa-circle"></i></li>
@@ -26,8 +23,6 @@ @@ -26,8 +23,6 @@
26 <li><span class="active">时刻表明细制作建模</span></li> 23 <li><span class="active">时刻表明细制作建模</span></li>
27 </ul> 24 </ul>
28 <!-- 线路信息导航栏组件 END --> 25 <!-- 线路信息导航栏组件 END -->
29 -  
30 -  
31 <div class="portlet light bordered" id="form-wizard-info"> 26 <div class="portlet light bordered" id="form-wizard-info">
32 <div class="portlet-title"> 27 <div class="portlet-title">
33 <div class="caption"> 28 <div class="caption">
@@ -44,7 +39,6 @@ @@ -44,7 +39,6 @@
44 </div> 39 </div>
45 </div> 40 </div>
46 <div class="portlet-body form"> 41 <div class="portlet-body form">
47 -  
48 <!-- START FORM 表单容器 --> 42 <!-- START FORM 表单容器 -->
49 <form class="form-horizontal" id="submit_argus_form" action="/" method="POST" novalidate="novalidate"> 43 <form class="form-horizontal" id="submit_argus_form" action="/" method="POST" novalidate="novalidate">
50 <div class="form-wizard"> 44 <div class="form-wizard">
@@ -94,7 +88,6 @@ @@ -94,7 +88,6 @@
94 <button class="close" data-dismiss="alert"></button> 88 <button class="close" data-dismiss="alert"></button>
95 验证成功! 89 验证成功!
96 </div> 90 </div>
97 -  
98 <!-- 线路名称 --> 91 <!-- 线路名称 -->
99 <div class="tab-pane active" id="tab1"> 92 <div class="tab-pane active" id="tab1">
100 <h3 class="block"> 选择时刻表 </h3> 93 <h3 class="block"> 选择时刻表 </h3>
src/main/resources/static/pages/base/timesmodel/js/add-form-wizard.js
1 1
2 /** 2 /**
3 - * 表单的导航向导、验证、提交  
4 - * 3 + * @description : (TODO) 表单的导航向导、验证、提交
5 */ 4 */
6 5
7 var SKBFormWizard = function() { 6 var SKBFormWizard = function() {
  7 +
  8 + var bxrcGs = [ {'type':'六工一休','hoursV':6.66, 'minueV':'6:40'},
  9 + {'type':'五工一休','hoursV':6.85, 'minueV':'6:51'},
  10 + {'type':'四工一休','hoursV':7.14, 'minueV':'7:08'},
  11 + {'type':'三工一休','hoursV':7.61, 'minueV':'7:37'},
  12 + {'type':'二工一休','hoursV':8.57, 'minueV':'8:34'},
  13 + {'type':'一工一休','hoursV':11.42, 'minueV':'11:25'},
  14 + {'type':'五工二休','hoursV':7.99, 'minueV':'8:00'},
  15 + {'type':'无工休', 'hoursV':5.43, 'minueV':'5:43'}];
  16 +
  17 + /**
  18 + * @description : (TODO) 获取停站时间.
  19 + *
  20 + * @param [o--当前班次对象;d--班次数组对象;sj--当前班次时间]
  21 + *
  22 + * @return 返回相邻班次的停站时间.
  23 + * */
  24 + function gettzsj(o,d,sj) {
  25 + // 定义停站时间.
  26 + var tzsj = 0;
  27 + // 变量班次数组对象.
  28 + for(var i = 0 ;i<d.length;i++) {
  29 + // 判断是否为同一个路牌.
  30 + if(o.lp.lpNo == d[i].lp.lpNo && o.lp.id == d[i].lp.id) {
  31 + // 判断是否为当前班次的下一个班次.
  32 + if(d[i].fcno - o.fcno ==1){
  33 + // 计算停站时间.
  34 + tzsj = (strToTime(d[i].fcsj) -strToTime(sj)) / 60000;
  35 + continue;
  36 + }
  37 + }
  38 + }
  39 + // 返回停站时间.
  40 + return tzsj;
  41 + }
  42 +
  43 + /**
  44 + * @description : (TODO) 是否切换线路值转换.
  45 + *
  46 + * @param [d--是否切换线路原始值].
  47 + *
  48 + * @return 返回一个是否切换线路值的转换.
  49 + * */
  50 + function isSwitchXlTodm(d) {
  51 + var rstr = 0;
  52 + if(d)
  53 + rstr = 1;
  54 + return rstr;
  55 + }
  56 +
  57 + /**
  58 + * @description : (TODO) 是否分班值转换.
  59 + *
  60 + * @param [d--是否分班原始值].
  61 + *
  62 + * @return 返回一个是否分班值的转换.
  63 + * */
  64 + function isfbTodm(b) {
  65 + var rstr = 0;
  66 + if(b)
  67 + rstr = 1;
  68 + return rstr;
  69 + }
  70 +
  71 + /**
  72 + * @description : (TODO) 获取某个班次的到达时间字符串.
  73 + *
  74 + * @param [tStr--发车时间格式字符串;bcsj--班次历时].
  75 + *
  76 + * @return 返回一个某个班次的到达时间字符串.
  77 + * */
  78 + function getddsj(tStr,bcsj) {
  79 + // 定义当前时间对象.
  80 + var date = new Date();
  81 + // 分割字符串.
  82 + var _str = tStr.split(':');
  83 + // 设值小时.
  84 + date.setHours(parseInt(_str[0]));
  85 + // 设值分钟.
  86 + date.setMiutes(parseInt(_str[1]) + bcsj);
  87 + // 返回到达时间字符串.
  88 + return getTimeStr(date);
  89 + }
  90 +
  91 + /**
  92 + * @description : (TODO) 时间点格式字符串转时间对象.
  93 + *
  94 + * @param [t--时间点格式字符串]
  95 + *
  96 + * @return 返回一个时间点格式字符串转时间对象.
  97 + * */
  98 + var strToTime = function(t) {
  99 + // 定义当前时间对象.
  100 + var d = new Date;
  101 + // 判断是否为空.
  102 + if(t) {
  103 + // 分割字符串.
  104 + var _str = t.split(':');
  105 + // 设值小时.
  106 + d.setHours(parseInt(_str[0]));
  107 + // 设值分钟.
  108 + d.setMinutes(parseInt(_str[1]));
  109 + }
  110 + // 返回一个时间点格式字符串转时间对象.
  111 + return d;
  112 + }
  113 +
  114 + /**
  115 + * @description : (TODO) 时间对象转时间点格式字符串.
  116 + *
  117 + * @param [t--时间对象]
  118 + *
  119 + * @return 返回一个时间对象转时间点格式字符串.
  120 + * */
  121 + function getTimeStr(t) {
  122 + // 定义返回值.
  123 + var _str = '';
  124 + // 判断是否为空.
  125 + if(t) {
  126 + // 重新赋值.
  127 + _str = ((t.getHours()<10? '0' + t.getHours() : t.getHours()) == '00' ? '24' :(t.getHours()<10? '0' + t.getHours() : t.getHours()))
  128 + +':'
  129 + +(t.getMinutes()<10? '0' + t.getMinutes() : t.getMinutes());
  130 + }
  131 + // 返回时间对象转时间点格式字符串.
  132 + return _str;
  133 + }
  134 +
  135 + /**
  136 + * @description : (TODO) 方向值转换.
  137 + *
  138 + * @param [d--方向原始值].
  139 + *
  140 + * @return 返回一个方向值转换.
  141 + * */
  142 + function dmToDh(t) {
  143 + // 定义返回值.
  144 + var reslStr = '';
  145 + // 上行.
  146 + if(t=='0')
  147 + reslStr = 'relationshipGraph-up';
  148 + // 下行.
  149 + else if(t=='1')
  150 + reslStr = 'relationshipGraph-down';
  151 + // 返回一个方向值转换.
  152 + return reslStr;
  153 + }
  154 +
  155 + /**
  156 + * @description : (TODO) 获取线路标准详情.
  157 + *
  158 + * @param [lineId--线路ID;cb--回调函数].
  159 + *
  160 + * @return 返回线路标准详情.
  161 + *
  162 + * @status OK.
  163 + * */
8 var getLineInfo = function(lineId,cb) { 164 var getLineInfo = function(lineId,cb) {
9 - // 根据线路标准ID查询详情 165 + // 1、get异步请求.根据线路ID查询详情.
10 $get('/lineInformation',{'line.id_eq':lineId},function(result) { 166 $get('/lineInformation',{'line.id_eq':lineId},function(result) {
  167 + // 2、返回线路标准详情.
11 return cb && cb(result); 168 return cb && cb(result);
12 }); 169 });
13 } 170 }
  171 +
  172 + /**
  173 + * @description : (TODO) 获取所有的停车场详情.
  174 + *
  175 + * @param [cb--回调函数].
  176 + *
  177 + * @return 返回所有的停车场详情.
  178 + *
  179 + * @status OK.
  180 + * */
14 var gettccInfo = function (cb) { 181 var gettccInfo = function (cb) {
  182 + // 1、get异步请求.获取所有的停车场详情.
15 $get('/carpark/all',null, function(cd){ 183 $get('/carpark/all',null, function(cd){
  184 + // 2、返回所有的停车场详情.
16 return cb && cb(cd); 185 return cb && cb(cd);
17 }); 186 });
18 } 187 }
19 188
  189 + /**
  190 + * @description : (TODO) 时间格式字符串转时间对象.
  191 + *
  192 + * @param [time--时间格式字符串].
  193 + *
  194 + * @return 返回一个时间对象.
  195 + *
  196 + * @status OK.
  197 + * */
20 var getDateTime = function(time) { 198 var getDateTime = function(time) {
  199 + // 1、定义一个时间对象.
21 var dateTime = new Date(); 200 var dateTime = new Date();
  201 + // 2、判断参数是否为空或者为undefined.
22 if(time !=null && time !='' && typeof(time) !='undefined') { 202 if(time !=null && time !='' && typeof(time) !='undefined') {
  203 + // 3、给时间对象重新赋值.
23 dateTime = new Date(Date.parse(time.replace(/-/g, "/"))); 204 dateTime = new Date(Date.parse(time.replace(/-/g, "/")));
24 } 205 }
  206 + // 4、返回时间对象.
25 return dateTime; 207 return dateTime;
26 } 208 }
27 209
28 - 210 + /**
  211 + * @description : (TODO) 客流方式填充表单时.根据表单参数封装时间段内的车辆数.
  212 + *
  213 + * @param : [map--表单参数]
  214 + *
  215 + * @returns 返回一个根据表单参数封装时间段内的车辆数数组.
  216 + *
  217 + * @status OK.
  218 + * */
29 function getsjdArr(map) { 219 function getsjdArr(map) {
  220 + // 1、获取营运的开始与结束时间点.
30 var seMap = getStartAndEndDate(map); 221 var seMap = getStartAndEndDate(map);
31 - return [{'num':0,'time':seMap.s + '-' + map.earlyStartTime},  
32 - {'num':0,'time':map.earlyStartTime + '-' + map.earlyEndTime},  
33 - {'num':0,'time':map.earlyEndTime + '-' + map.lateStartTime},  
34 - {'num':0,'time':map.lateStartTime + '-' + map.lateEndTime},  
35 - {'num':0,'time':map.lateEndTime + '-' + seMap.e}]; 222 + // 2、返回一个根据表单参数封装时间段内的车辆数数组.
  223 + return [{'num':0,'time':seMap.s + '-' + map.earlyStartTime},// 早高峰之前时间段内的车辆.
  224 + {'num':0,'time':map.earlyStartTime + '-' + map.earlyEndTime}, // 早高峰时间段内的车辆.
  225 + {'num':0,'time':map.earlyEndTime + '-' + map.lateStartTime},// 高峰之间时间段内的车辆
  226 + {'num':0,'time':map.lateStartTime + '-' + map.lateEndTime},// 晚高峰时间段内的车辆.
  227 + {'num':0,'time':map.lateEndTime + '-' + seMap.e}];// 晚高峰之后时间段内的车辆.
36 } 228 }
37 -  
38 - function getStartAndEndDate(map) {  
39 - return {'s':getMinDate(map.line.startStationFirstTime,map.line.endStationFirstTime),  
40 - 'e':getMaxDate(map.line.startStationEndTime,map.line.endStationEndTime)}  
41 - }  
42 - 229 +
  230 + /**
  231 + * @description : (TODO) 获取最小时间(字符串).
  232 + *
  233 + * @param [d1--时间1;d2--时间2].
  234 + *
  235 + * @return 返回一个最小时间(字符串).
  236 + *
  237 + * @status OK.
  238 + * */
43 function getMinDate(d1,d2) { 239 function getMinDate(d1,d2) {
  240 + // 1、定义返回字符串.
44 var str = ''; 241 var str = '';
  242 + // 2、判断时间大小.
45 if(strToTime(d1)>strToTime(d2)) 243 if(strToTime(d1)>strToTime(d2))
46 str = d2; 244 str = d2;
47 else 245 else
48 str = d1; 246 str = d1;
  247 + // 3、返回最小时间(字符串).
49 return str; 248 return str;
50 } 249 }
51 250
52 - function strToTime(t) {  
53 - var d = new Date();  
54 - if(t) {  
55 - var _str = t.split(':');  
56 - d.setHours(parseInt(_str[0]));  
57 - d.setMinutes(parseInt(_str[1]));  
58 - }  
59 - return d;  
60 - }  
61 - 251 + /**
  252 + * @description : (TODO) 获取最大时间(字符串).
  253 + *
  254 + * @param [d1--时间1;d2--时间2].
  255 + *
  256 + * @return 返回一个最大时间(字符串).
  257 + *
  258 + * @status OK.
  259 + * */
62 function getMaxDate(d1,d2) { 260 function getMaxDate(d1,d2) {
  261 + // 1、定义返回时间字符串.
63 var str = ''; 262 var str = '';
  263 + // 2、判断时间大小.
64 if(strToTime(d1)>strToTime(d2)) 264 if(strToTime(d1)>strToTime(d2))
65 str = d1; 265 str = d1;
66 else 266 else
67 str = d2; 267 str = d2;
  268 + // 3、返回一个最大时间(字符串).
68 return str; 269 return str;
69 } 270 }
70 271
  272 + /**
  273 + * @description : (TODO) 判断是否这时间段内.
  274 + *
  275 + * @param [st--开始时间;ed--结束时间;sj--当前判断的时间]
  276 + *
  277 + * @return 返回一个布尔值.
  278 + *
  279 + * @status OK.
  280 + * */
71 function issjd(st,ed,sj) { 281 function issjd(st,ed,sj) {
  282 + // 1、定义返回值.
72 var tag = false; 283 var tag = false;
  284 + // 2、判断时间大小.
73 if(sj<=ed && sj>=st) 285 if(sj<=ed && sj>=st)
  286 + // 3、重新赋值返回值.
74 tag = true; 287 tag = true;
  288 + // 4、返回判断结果布尔值.
75 return tag; 289 return tag;
76 } 290 }
77 291
  292 + /**
  293 + * @description : (TODO) 获取客流数据.
  294 + *
  295 + * @params [url--请求地址;data--请求参数;cb--回调函数]
  296 + *
  297 + * */
  298 + function getJSONP(url, data, cb) {
  299 + $.ajax({
  300 + url : url,
  301 + type : "GET",
  302 + dataType : 'jsonp',
  303 + jsonp : 'jsoncallback',
  304 + data : data,
  305 + success : cb
  306 + });
  307 + }
  308 +
  309 + /**
  310 + * @description : (TODO) 根据获取参数方式来获取表单参数详情html模版页.
  311 + *
  312 + * @param [n--获取参数方式;map--表单参数;lineId--线路ID;krl--客容量;cb--回调函数]
  313 + *
  314 + * @return 返回表单参数详情html模版页.
  315 + *
  316 + * @status OK.
  317 + * */
78 var getHtmlTemp = function(n,map,lineId,krl,cb) { 318 var getHtmlTemp = function(n,map,lineId,krl,cb) {
79 - var zzsj = parseInt(map.upTravelTime) + 10*2 + parseInt(map.downTravelTime); 319 + // 1、定义模版名称.
80 var tempName = ''; 320 var tempName = '';
81 - var date = new Date(),  
82 - rq = date.getFullYear() + '-' + (date.getMonth()+1) + '-' + (date.getDate()-3);  
83 - var startDateTime = rq + ' ' + '00:00';  
84 - var endDateTime = rq + ' ' + '23:59';  
85 - var params = {'xlid':'10773','startDateTime':startDateTime,'endDateTime':endDateTime,'zzsj':zzsj};  
86 - if(n==0) { 321 + if(n==0)
87 tempName = 'carnum_temp'; 322 tempName = 'carnum_temp';
88 - }else if(n==1) {  
89 - tempName = 'bctype_temp';  
90 - } 323 + else if(n==1)
  324 + tempName = 'bctype_temp';
  325 + // 2、获参数详情模版html内容.
91 $.get('/pages/base/timesmodel/tepms/'+ tempName + '.html', function(html){ 326 $.get('/pages/base/timesmodel/tepms/'+ tempName + '.html', function(html){
92 $('#tab3').append(html); 327 $('#tab3').append(html);
93 - map.lb = 15;  
94 - map.workeLunch = 20;  
95 - map.workeDinner = 20;  
96 - map.mixstopTime = 3;  
97 - map.maxstopTime = 20;  
98 - map.stopTime = 10; 328 + map.lb = 15;// 定义例保时间.
  329 + map.workeLunch = 20;// 定义午餐时间.
  330 + map.workeDinner = 20;// 定义晚餐时间.
  331 + map.mixstopTime = 3;// 定义最小停站间隙
  332 + map.maxstopTime = 22;// 定义最大停站间隙.
  333 + map.stopTime = 10;// 定义停站时间.
99 if(n==0) { 334 if(n==0) {
100 - getJSONP("http://139.196.13.237:8080/bsth-busfareflow-gj/Crlcxb/selectsjbctgl.do",params,function(json){  
101 - console.log(json); 335 + // 定义一个周转时间.
  336 + var zzsj = parseInt(map.upTravelTime) + 10*2 + parseInt(map.downTravelTime);
  337 + // 定义时间对象.
  338 + var date = new Date(),
  339 + rq = date.getFullYear() + '-' + (date.getMonth()+1) + '-' + (date.getDate()-7);
  340 + // 定义开始时间字符串.
  341 + var startDateTime = rq + ' ' + '00:00';
  342 + // 定义结束时间自妇产.
  343 + var endDateTime = rq + ' ' + '23:59';
  344 + // 定义请求参数集合.
  345 + var params = {'xlid':lineId,'startDateTime':startDateTime,'endDateTime':endDateTime,'zzsj':zzsj};
  346 + /**
  347 + * getJSONP请求获取客流数据.
  348 + *
  349 + * 返回的是一个每次以半小时为间隔作为开始时间点, 在加上周转时间作为结束时间点的 时段段内的客流最大通过量.
  350 + * */
  351 + getJSONP("http://139.196.13.237:8080/bsth-busfareflow-gj/Crlcxb/selectsjbctgl.do",params,function(json){
  352 + // 定义时段集合,可容量.
102 var sjdArr = getsjdArr(map),krlInt = parseInt(krl); 353 var sjdArr = getsjdArr(map),krlInt = parseInt(krl);
  354 + // 遍历时段集合.
103 for(var s = 0 ; s<sjdArr.length;s++) { 355 for(var s = 0 ; s<sjdArr.length;s++) {
  356 + // 分割时间段.
104 var strA = sjdArr[s].time.split('-'); 357 var strA = sjdArr[s].time.split('-');
  358 + // 定义开始时间与结束时间,车辆数.
105 var st = getDateTime(rq + ' ' + strA[0]),et = getDateTime(rq + ' ' + strA[1]),num = 0; 359 var st = getDateTime(rq + ' ' + strA[0]),et = getDateTime(rq + ' ' + strA[1]),num = 0;
  360 + // 遍历时间段内的客流数据集合.
106 for(var j = 0 ; j < json.length; j ++) { 361 for(var j = 0 ; j < json.length; j ++) {
  362 + // 定义当前客流班次产生的时间.
107 var dqsj = getDateTime(json[j].sj); 363 var dqsj = getDateTime(json[j].sj);
  364 + // 判断是否这时间段内.
108 if(issjd(st,et,dqsj)) { 365 if(issjd(st,et,dqsj)) {
  366 + // 车辆数相加.
109 num = num + Math.ceil(parseInt(json[j].tgl)/krlInt); 367 num = num + Math.ceil(parseInt(json[j].tgl)/krlInt);
110 } 368 }
111 } 369 }
112 sjdArr[s].num = num; 370 sjdArr[s].num = num;
113 } 371 }
114 - /*map.zgfbeforepcs = sjdArr[0].num;  
115 - map.zgfpcs = sjdArr[1].num;  
116 - map.gfzjpcs = sjdArr[2].num;  
117 - map.wgfpcs = sjdArr[3].num;  
118 - map.wgfafterpcs = sjdArr[4].num;*/  
119 - map.zgfbeforepcs = 3;  
120 - map.zgfpcs = 10;  
121 - map.gfzjpcs = 8;  
122 - map.wgfpcs = 10;  
123 - map.wgfafterpcs = 5;  
124 - 372 + map.zgfbeforepcs = sjdArr[0].num;// 早高峰前配车数
  373 + map.zgfpcs = sjdArr[2].num;// 早高峰配车数
  374 + map.gfzjpcs = sjdArr[4].num;// 高峰之间配车数
  375 + map.wgfpcs = sjdArr[2].num ;// 晚高峰配车数
  376 + map.wgfafterpcs = sjdArr[1].num + sjdArr[3].num;// 晚高峰后配车数
  377 + // 返回参数详情模版.
125 return cb && cb ({'forminput':template(tempName,{map:map}),'datadisplay': template(tempName +'config',{map:null})}); 378 return cb && cb ({'forminput':template(tempName,{map:map}),'datadisplay': template(tempName +'config',{map:null})});
126 }); 379 });
127 }else if(n==1) { 380 }else if(n==1) {
  381 + // 返回参数详情模版.
128 return cb && cb ({'forminput':template(tempName,{map:map}),'datadisplay': template(tempName +'config',{map:null})}); 382 return cb && cb ({'forminput':template(tempName,{map:map}),'datadisplay': template(tempName +'config',{map:null})});
129 } 383 }
130 }); 384 });
131 } 385 }
132 - var getCarNumber = function (param,cb) {  
133 - $post('url',param,function(data) {  
134 - return cb && cb(data);  
135 - }) 386 +
  387 + /**
  388 + * @description (TODO) 格式化成渲染图形数据格式.
  389 + *
  390 + * @param [d--查询出的时刻表明细数据.]
  391 + *
  392 + * @return 返回渲染图形的数据格式.
  393 + * */
  394 + function formatData(d) {
  395 + // 定义返回值.
  396 + var resultD = new Array();
  397 + for(var i =0;i<d.length;i++) {
  398 + var obj = {};
  399 + var ddsj = getddsj(d[i].fcsj,d[i].bcsj);// 到达时间.
  400 + obj.bcType = d[i].bcType;// 班次类型
  401 + obj.bcs = d[i].bcs;// 班次数
  402 + obj.bcsj = d[i].bcsj;// 班次时间
  403 + obj.fcno = d[i].fcno;// 发车序号
  404 + obj.fcsj = d[i].fcsj;// 发车时间
  405 + obj.ARRIVALTIME = ddsj// 到达时间
  406 + obj.jhlc = d[i].jhlc;// 计划里程
  407 + obj.lp = d[i].lp==null ? null : d[i].lp.id;// 路牌id
  408 + obj.lpType = d[i].lp==null ? null : d[i].lp.lpType;// 路牌类型
  409 + obj.parent = d[i].lp.lpName;// 路牌名称
  410 + obj.lpNo = d[i].lp.lpNo;// 路牌编码
  411 + obj.tcc = d[i].tcc==null ? null : d[i].tcc.id;// 停车场id
  412 + obj.ttinfo = d[i].ttinfo==null ? null : d[i].ttinfo.id;// 时刻表id
  413 + obj.xl = d[i].xl==null ? null : d[i].xl.id;// 线路id
  414 + obj.xlDir = dmToDh(d[i].xlDir);// 方向【0:relationshipGraph-up 上行;1:relationshipGraph-down 下行】
  415 + obj.qdz = d[i].qdz==null ? null : d[i].qdz.id;// 起点站id
  416 + obj.zdz = d[i].zdz==null ? null : d[i].zdz.id;//终点站id
  417 + obj.isfb = isfbTodm(d[i].isFB);// 是否分班【0:false;1:true】
  418 + obj.isSwitchXl = isSwitchXlTodm(d[i].isSwitchXl);// 是否切换线路【0:false;1:true】
  419 + obj.STOPTIME = gettzsj(d[i],d,ddsj);// 停站时间.
  420 + resultD.push(obj);
  421 + }
  422 + // 返回渲染图形的数据格式.
  423 + return resultD;
136 } 424 }
  425 +
  426 + /**
  427 + * @description : (TODO) 获取开始与结束时间字符串.
  428 + *
  429 + * @param [map--表单配置参数]
  430 + *
  431 + * @return 返回开始与结束时间字符串集合.
  432 + * */
  433 + function getStartAndEndDate(map) {
  434 + return {'s':getMinDate(map.line.startStationFirstTime,map.line.endStationFirstTime),
  435 + 'e':getMaxDate(map.line.startStationEndTime,map.line.endStationEndTime)}
  436 + }
  437 +
137 return { 438 return {
138 // 启动初始化向导导航 439 // 启动初始化向导导航
139 init : function() { 440 init : function() {
@@ -160,11 +461,11 @@ var SKBFormWizard = function() { @@ -160,11 +461,11 @@ var SKBFormWizard = function() {
160 'earlyEndTime' : {required : true},// 早高峰结束时间,必填项 . 461 'earlyEndTime' : {required : true},// 早高峰结束时间,必填项 .
161 'lateStartTime' : {required : true},// 晚高峰开始时间,必填项 . 462 'lateStartTime' : {required : true},// 晚高峰开始时间,必填项 .
162 'lateEndTime' : {required : true},// 晚高峰结束时间,必填项. 463 'lateEndTime' : {required : true},// 晚高峰结束时间,必填项.
163 - 'zgfbeforepcs' : {required : true,number : true,digits : true},// 早高峰前车辆数,必填项、必须为整数.  
164 - 'zgfpcs' : {required : true,number : true,digits : true},// 早高峰车辆数,必填项、必须为整数.  
165 - 'wgfafterpcs' : {required : true,number : true,digits : true},// 晚高峰后车俩数,必填项、必须为整数.  
166 - 'wgfpcs' : {required : true,number : true,digits : true},// 晚高峰车俩数,必填项、必须为整数.  
167 - 'gfzjpcs' : {required : true,number : true,digits : true},// 高峰中间车辆数,必填项、必须为整数. 464 + 'zgfbeforepcs' : {required : true,number : true,digits : true, isNum0:true},// 早高峰前车辆数,必填项、必须为整数.
  465 + 'zgfpcs' : {required : true,number : true,digits : true, isNum0:true, isMax: true},// 早高峰车辆数,必填项、必须为整数.
  466 + 'wgfafterpcs' : {required : true,number : true,digits : true, isNum0:true},// 晚高峰后车俩数,必填项、必须为整数.
  467 + 'wgfpcs' : {required : true,number : true,digits : true, isNum0:true, isMax: true},// 晚高峰车俩数,必填项、必须为整数.
  468 + 'gfzjpcs' : {required : true,number : true,digits : true, isNum0:true},// 高峰中间车辆数,必填项、必须为整数.
168 'upTravelTime' : {required : true,number : true},// 上行行驶时间,必填项、必须为整数. 469 'upTravelTime' : {required : true,number : true},// 上行行驶时间,必填项、必须为整数.
169 'downTravelTime' : {required : true,number : true},// 下行行驶时间,必填项、必须为整数. 470 'downTravelTime' : {required : true,number : true},// 下行行驶时间,必填项、必须为整数.
170 'upMileage' : {required : true,number : true},// 上行行驶里程,必填项、必须为整数. 471 'upMileage' : {required : true,number : true},// 上行行驶里程,必填项、必须为整数.
@@ -192,7 +493,7 @@ var SKBFormWizard = function() { @@ -192,7 +493,7 @@ var SKBFormWizard = function() {
192 'downInMileage' : {number : true},// 下行进场里程,必须为数字. 493 'downInMileage' : {number : true},// 下行进场里程,必须为数字.
193 'downOutMileage' : {number : true},// 下行出场里程,必须为数字. 494 'downOutMileage' : {number : true},// 下行出场里程,必须为数字.
194 'lb' : {number : true},// 早晚例行保养,必须为数字. 495 'lb' : {number : true},// 早晚例行保养,必须为数字.
195 - 'clzs':{required : true,number : true,digits : true},// 车辆总数,必填项、必须为整数. 496 + 'clzs':{required : true,number : true,digits : true, isBcType : true},// 车辆总数,必填项、必须为整数.
196 'bxrc' : {required : true},// 早晚例行保养,必须为数字. 497 'bxrc' : {required : true},// 早晚例行保养,必须为数字.
197 }, 498 },
198 499
@@ -243,10 +544,15 @@ var SKBFormWizard = function() { @@ -243,10 +544,15 @@ var SKBFormWizard = function() {
243 * 默认:default (native) form submit;当表单通过验证,提交表单。回调函数有个默认参数form 544 * 默认:default (native) form submit;当表单通过验证,提交表单。回调函数有个默认参数form
244 */ 545 */
245 submitHandler : function(f) { 546 submitHandler : function(f) {
  547 + // 定义localStorage对象.
246 var storage = window.localStorage; 548 var storage = window.localStorage;
  549 + // 表单序列化.
247 var argus = form.serializeJSON(); 550 var argus = form.serializeJSON();
  551 + // 获取站点路由.
248 $get('/stationroute/all',{'line.id_eq':argus.lineName.split('_')[0]},function(result) { 552 $get('/stationroute/all',{'line.id_eq':argus.lineName.split('_')[0]},function(result) {
  553 + // 判断.
249 if(result) { 554 if(result) {
  555 + // 定义上行起点站,上行终点站,下行起点站,下行终点站.
250 var upB ='',upE='',downB='',downE=''; 556 var upB ='',upE='',downB='',downE='';
251 for(var r = 0 ; r<result.length;r++) { 557 for(var r = 0 ; r<result.length;r++) {
252 if(result[r].directions==0 && result[r].stationMark =='B') 558 if(result[r].directions==0 && result[r].stationMark =='B')
@@ -260,14 +566,16 @@ var SKBFormWizard = function() { @@ -260,14 +566,16 @@ var SKBFormWizard = function() {
260 } 566 }
261 argus.up_s = upB + '_' + upE; 567 argus.up_s = upB + '_' + upE;
262 argus.down_s = downB + '_' + downE; 568 argus.down_s = downB + '_' + downE;
  569 + // 获取停车车场.
263 $get('/carpark/all',{'parkCode_eq':argus.tcc},function(cp) { 570 $get('/carpark/all',{'parkCode_eq':argus.tcc},function(cp) {
264 var tcc_id = ''; 571 var tcc_id = '';
265 if(cp) { 572 if(cp) {
266 tcc_id = cp[0].id; 573 tcc_id = cp[0].id;
267 } 574 }
268 - argus.tcc_id = tcc_id;  
269 - argus.skbmc = $('#skbNameSelect').select2('data')[0].text;  
270 - argus.xlmc = $('#lineSelect').select2('data')[0].text; 575 + argus.tcc_id = tcc_id; // 停车场ID.
  576 + argus.skbmc = $('#skbNameSelect').select2('data')[0].text;// 时刻名称.
  577 + argus.xlmc = $('#lineSelect').select2('data')[0].text;// 线路名称.
  578 + // 获取时刻表明细.
271 $get('/tidc/all',{'ttinfo.id_eq':parseInt(argus.skbName)},function(data) { 579 $get('/tidc/all',{'ttinfo.id_eq':parseInt(argus.skbName)},function(data) {
272 if(data.status=='SUCCESS' && data.data.length>0) { 580 if(data.status=='SUCCESS' && data.data.length>0) {
273 argus.istidc = 1; 581 argus.istidc = 1;
@@ -277,7 +585,7 @@ var SKBFormWizard = function() { @@ -277,7 +585,7 @@ var SKBFormWizard = function() {
277 btn: ['确定并使用','取消并继续'] //按钮 585 btn: ['确定并使用','取消并继续'] //按钮
278 }, function(){ 586 }, function(){
279 layer.closeAll(); 587 layer.closeAll();
280 - submit(JSON.stringify(gsData(data.data)),argus); 588 + submit(JSON.stringify(formatData(data.data)),argus);
281 }, function(){ 589 }, function(){
282 submit(null,argus); 590 submit(null,argus);
283 }); 591 });
@@ -291,6 +599,8 @@ var SKBFormWizard = function() { @@ -291,6 +599,8 @@ var SKBFormWizard = function() {
291 layer.msg('系统不存在该线路的上、下行起终点站!'); 599 layer.msg('系统不存在该线路的上、下行起终点站!');
292 } 600 }
293 }); 601 });
  602 +
  603 + // 表单提交.
294 function submit(p,argus) { 604 function submit(p,argus) {
295 storage.setItem("Gantt_AgursData",JSON.stringify(argus)); 605 storage.setItem("Gantt_AgursData",JSON.stringify(argus));
296 storage.setItem('isDoDate',p); 606 storage.setItem('isDoDate',p);
@@ -298,110 +608,99 @@ var SKBFormWizard = function() { @@ -298,110 +608,99 @@ var SKBFormWizard = function() {
298 } 608 }
299 } 609 }
300 }); 610 });
301 - function gsData(d) {  
302 - var resultD = new Array();  
303 - for(var i =0;i<d.length;i++) {  
304 - var obj = {};  
305 - var ddsj = getddsj(d[i].fcsj,d[i].bcsj);  
306 - obj.bcType = d[i].bcType;//班次类型  
307 - obj.bcs = d[i].bcs;// 班次数  
308 - obj.bcsj = d[i].bcsj;// 班次时间  
309 - obj.fcno = d[i].fcno;// 发车序号  
310 - obj.fcsj = d[i].fcsj;//发车时间  
311 - obj.ARRIVALTIME = ddsj//到达时间  
312 - obj.jhlc = d[i].jhlc;//计划里程  
313 - obj.lp = d[i].lp==null ? null : d[i].lp.id;//路牌id  
314 - obj.lpType = d[i].lp==null ? null : d[i].lp.lpType;//路牌类型  
315 - obj.parent = d[i].lp.lpName;// 路牌名称  
316 - obj.lpNo = d[i].lp.lpNo;//路牌编码  
317 - obj.tcc = d[i].tcc==null ? null : d[i].tcc.id;//停车场id  
318 - obj.ttinfo = d[i].ttinfo==null ? null : d[i].ttinfo.id;//时刻表id  
319 - obj.xl = d[i].xl==null ? null : d[i].xl.id;//线路id  
320 - obj.xlDir = dmToDh(d[i].xlDir);// 方向【0:relationshipGraph-up 上行;1:relationshipGraph-down 下行】  
321 - obj.qdz = d[i].qdz==null ? null : d[i].qdz.id;// 起点站id  
322 - obj.zdz = d[i].zdz==null ? null : d[i].zdz.id;//终点站id  
323 - obj.isfb = isfbTodm(d[i].isFB);//是否分班【0:false;1:true】  
324 - obj.isSwitchXl = isSwitchXlTodm(d[i].isSwitchXl);// 是否切换线路【0:false;1:true】  
325 - obj.STOPTIME = gettzsj(d[i],d,ddsj);  
326 - resultD.push(obj);  
327 - }  
328 - console.log(resultD);  
329 - return resultD;  
330 - }  
331 - function gettzsj(o,d,sj) {  
332 - var tzsj = 0;  
333 - for(var i = 0 ;i<d.length;i++) {  
334 - if(o.lp.lpNo == d[i].lp.lpNo && o.lp.id == d[i].lp.id) {  
335 - if(d[i].fcno - o.fcno ==1){  
336 - tzsj = (strToTime(d[i].fcsj) -strToTime(sj)) / 60000;  
337 - continue;  
338 - }  
339 -  
340 - }  
341 - }  
342 - return tzsj;  
343 - }  
344 -  
345 - function isSwitchXlTodm(d) {  
346 - var rstr = 0;  
347 - if(d)  
348 - rstr = 1;  
349 - return rstr;  
350 - }  
351 -  
352 - function isfbTodm(b) {  
353 - var rstr = 0;  
354 - if(b)  
355 - rstr = 1;  
356 - return rstr;  
357 - }  
358 -  
359 - function getddsj(tStr,bcsj) {  
360 - var rt = '';  
361 - var date = new Date();  
362 - var _str = tStr.split(':');  
363 - date.setHours(parseInt(_str[0]));  
364 - date.setMinutes(parseInt(_str[1]) + bcsj);  
365 - return getTimeStr(date);  
366 - }  
367 -  
368 - var strToTime = function(t) {  
369 - var d = new Date;  
370 - if(t) {  
371 - var _str = t.split(':');  
372 - d.setHours(parseInt(_str[0]));  
373 - d.setMinutes(parseInt(_str[1]));  
374 - }  
375 - return d;  
376 - }  
377 611
378 - function getTimeStr(t) {  
379 - var _str = '';  
380 - if(t) {  
381 - _str = ((t.getHours()<10? '0' + t.getHours() : t.getHours()) == '00' ? '24' :(t.getHours()<10? '0' + t.getHours() : t.getHours()))  
382 - +':'  
383 - +(t.getMinutes()<10? '0' + t.getMinutes() : t.getMinutes());  
384 - }  
385 - return _str;  
386 - } 612 + // 验证配车数不能为零.
  613 + $.validator.addMethod('isNum0', function(value,element) {
  614 + // 定义返回值.
  615 + var tag = true;
  616 + var zgfbeforepcs = $('#zgfbeforepcsInput').val(),// 早高峰前配车数.
  617 + zgfpcs = $('#zgfpcsInput').val(),// 早高峰配车数.
  618 + gfzjpcs = $('#gfzjpcsInput').val(),// 高峰之间配车数.
  619 + wgfpcs = $('#wgfpcsInput').val(),// 晚高峰配车数.
  620 + wgfafterpcs = $('#wgfafterpcsInput').val();// 晚高峰后配车数.
  621 + // 判断是否为零.
  622 + if(parseInt(zgfbeforepcs) == 0 || parseInt(zgfbeforepcs) ==0 ||
  623 + parseInt(gfzjpcs) ==0 || parseInt(wgfpcs) ==0 || parseInt(wgfafterpcs) ==0)
  624 + tag = false;
  625 + return tag;
  626 + },function(){return '配车数不能为零!'; });
387 627
388 - function dmToDh(t) {  
389 - var reslStr = '';  
390 - if(t=='0')  
391 - reslStr = 'relationshipGraph-up';  
392 - else if(t=='1')  
393 - reslStr = 'relationshipGraph-down';  
394 - return reslStr;  
395 - } 628 + // 验证高峰时段内的配车数是否高于其它时段配车数.
  629 + $.validator.addMethod('isMax', function(value,element) {
  630 + var tag = true;
  631 + var zgfbeforepcs = parseInt($('#zgfbeforepcsInput').val()),// 早高峰前配车数.
  632 + zgfpcs = parseInt($('#zgfpcsInput').val()),// 早高峰配车数.
  633 + gfzjpcs = parseInt($('#gfzjpcsInput').val()),// 高峰之间配车数.
  634 + wgfpcs = parseInt($('#wgfpcsInput').val()),// 晚高峰配车数.
  635 + wgfafterpcs = parseInt($('#wgfafterpcsInput').val());// 晚高峰后配车数.
  636 + // 判断高峰时段内的配车数是否高于其它时段配车数.
  637 + if(zgfpcs<zgfbeforepcs || zgfpcs<gfzjpcs || zgfpcs<wgfafterpcs || wgfpcs<zgfbeforepcs || wgfpcs<gfzjpcs || wgfpcs<wgfafterpcs )
  638 + tag = false;
  639 + return tag;
  640 + },function(){return '高峰时段配车数必须高于其它时段配车数!';});
396 641
  642 + // 验证客流数据分析时客容量为必填项.
397 $.validator.addMethod("isBaseRes", function(value,element) { 643 $.validator.addMethod("isBaseRes", function(value,element) {
  644 + // 定义返回值.
398 var tag = true; 645 var tag = true;
  646 + // 定义选择获取参数方式值
399 var baseChecked = $('#submit_argus_form input[name="baseRes"]:checked').val(); 647 var baseChecked = $('#submit_argus_form input[name="baseRes"]:checked').val();
  648 + // 判断
400 if(baseChecked == '0' && $('#krlInput').val()== '') 649 if(baseChecked == '0' && $('#krlInput').val()== '')
401 tag = false; 650 tag = false;
402 return tag; 651 return tag;
403 }, '客流大数据分析,客流总量为必填项!'); 652 }, '客流大数据分析,客流总量为必填项!');
404 653
  654 + // 验证配车数不能为零.
  655 + $.validator.addMethod('isBcType', function(value,element) {
  656 + // 定义返回值.
  657 + var tag = true;
  658 + // 定义车辆总数,班型人次.
  659 + var clzs = $('#clzsInput').val(),
  660 + bxrc = $('#state_tagsinput').val();
  661 + // 判断.
  662 + if(bxrc=='' || bxrc==null || clzs=='' || clzs==0)
  663 + return false;
  664 + // 定义首末班次开始结束时间集合.
  665 + var map = {'line':{'startStationFirstTime':$('#qdzsbsjInput').val(),
  666 + 'startStationEndTime':$('#qdzmbsjInput').val(),
  667 + 'endStationFirstTime':$('#zdzsbsjInput').val(),
  668 + 'endStationEndTime':$('#zdzmbsjInput').val()}};
  669 + // 定义开始~结束时间.
  670 + var setMap = getStartAndEndDate(map);
  671 + console.log(setMap);
  672 + // 定义最大工时.
  673 + var maxGs = parseInt( ((strToTime(setMap.e) - strToTime(setMap.s)) / 60000) / 60) * parseInt(clzs);
  674 + // 切割班型人次,定义班次人次所用总工时.
  675 + var bxrcAr = bxrc.split(','),countGs = 0;
  676 + // 遍历
  677 + for(var s = 0 ; s< bxrcAr.length;s++) {
  678 + // 切割单个班型人次.
  679 + var s1a = bxrcAr[s].split('/');
  680 + // 定义人次.
  681 + var rs = parseInt(s1a[1]);
  682 + // 定义小时系数.
  683 + var hoursV = 0.0;
  684 + for(var g = 0 ; g < bxrcGs.length; g++) {
  685 + // 判断班型是否一致.
  686 + if(bxrcGs[g].type == s1a[0]) {
  687 + // 重新赋值小时系数.
  688 + hoursV = bxrcGs[g].hoursV;
  689 + }
  690 + }
  691 + // 重新计算班次人次所用总工时.
  692 + countGs = countGs + parseFloat(hoursV.toFixed(2)) * rs;
  693 + }
  694 + // 判断
  695 + if(parseFloat(countGs.toFixed(2))>maxGs)
  696 + tag = false;
  697 + return tag;
  698 + },function(){return '配车总数与班型人次搭配不合理!'; });
  699 +
  700 + /**
  701 + * @description : (TODO) 监听获取参数方式值改变事件.
  702 + *
  703 + * */
405 $('input:radio[name="baseRes"]').on('change',function(v) { 704 $('input:radio[name="baseRes"]').on('change',function(v) {
406 if($(this).val()=='1') 705 if($(this).val()=='1')
407 $('#krlGroup').hide(); 706 $('#krlGroup').hide();
@@ -484,25 +783,29 @@ var SKBFormWizard = function() { @@ -484,25 +783,29 @@ var SKBFormWizard = function() {
484 return false; 783 return false;
485 } 784 }
486 if(index==1) { 785 if(index==1) {
  786 + // 初始化客容量值.
487 if($('#krlInput').val() == '') 787 if($('#krlInput').val() == '')
488 $('#krlInput').val(50); 788 $('#krlInput').val(50);
489 }else if(index == 2) { 789 }else if(index == 2) {
490 - var baseRes = $('#submit_argus_form input[name="baseRes"]:checked').val(),  
491 - lineId = $('#lineSelect').val().split('_')[0],  
492 - krl = $('#krlInput').val(); 790 + var baseRes = $('#submit_argus_form input[name="baseRes"]:checked').val(),// 获取参数方式值.
  791 + lineId = $('#lineSelect').val().split('_')[0],// 线路ID.
  792 + krl = $('#krlInput').val();// 客容量
493 getLineInfo(lineId,function(r) { 793 getLineInfo(lineId,function(r) {
494 getHtmlTemp(baseRes,r.content[0],lineId,krl,function(htlMap) { 794 getHtmlTemp(baseRes,r.content[0],lineId,krl,function(htlMap) {
495 $('#tab3').html(htlMap.forminput); 795 $('#tab3').html(htlMap.forminput);
496 $('#tab4').html(htlMap.datadisplay); 796 $('#tab4').html(htlMap.datadisplay);
497 if(baseRes==1) 797 if(baseRes==1)
498 - ComponentsBootstrapTagsinput.init(); 798 + ComponentsBootstrapTagsinput.init();// 初始化班型人次Input Tag.
499 // 日期控件 799 // 日期控件
500 - $('#qdzsbsjInput').datetimepicker({format : 'HH:mm',locale: 'zh-cn'});  
501 - $('#endServiceTimeInput').datetimepicker({format : 'HH:mm',locale: 'zh-cn'});  
502 - $('#morningPeakStartInput').datetimepicker({format : 'HH:mm',locale: 'zh-cn'});  
503 - $('#morningPeakEndInput').datetimepicker({format : 'HH:mm',locale: 'zh-cn'});  
504 - $('#eveningPeakStartInput').datetimepicker({format : 'HH:mm',locale: 'zh-cn'});  
505 - $('#eveningPeakEndInput').datetimepicker({format : 'HH:mm',locale: 'zh-cn'}); 800 + $('#qdzsbsjInput').datetimepicker({format : 'HH:mm',locale: 'zh-cn'});// 起始站首班时间
  801 + $('#qdzmbsjInput').datetimepicker({format : 'HH:mm',locale: 'zh-cn'});// 起始站末班时间
  802 + $('#zdzsbsjInput').datetimepicker({format : 'HH:mm',locale: 'zh-cn'});// 终点站首班时间
  803 + $('#zdzmbsjInput').datetimepicker({format : 'HH:mm',locale: 'zh-cn'});// 终点站末班时间
  804 + $('#zgfkssjInput').datetimepicker({format : 'HH:mm',locale: 'zh-cn'});// 早高峰开始时间
  805 + $('#zgfjssjInput').datetimepicker({format : 'HH:mm',locale: 'zh-cn'});// 早高峰结束时间
  806 + $('#wgfkssjInput').datetimepicker({format : 'HH:mm',locale: 'zh-cn'});// 晚高峰开始时间
  807 + $('#wgfjssjInput').datetimepicker({format : 'HH:mm',locale: 'zh-cn'});// 晚高峰结束时间
  808 + // 初始化停车场下拉框.
506 gettccInfo(function(cd) { 809 gettccInfo(function(cd) {
507 var options = '<option value="">请选择...</option><optgroup label="停车场">'; 810 var options = '<option value="">请选择...</option><optgroup label="停车场">';
508 var $_len = cd.length; 811 var $_len = cd.length;
@@ -543,15 +846,4 @@ var SKBFormWizard = function() { @@ -543,15 +846,4 @@ var SKBFormWizard = function() {
543 $('#submit_argus_form').find('.button-previous').hide(); 846 $('#submit_argus_form').find('.button-previous').hide();
544 } 847 }
545 } 848 }
546 - function getJSONP(url, data, cb) {  
547 - $.ajax({  
548 - url : url,  
549 - type : "GET",  
550 - dataType : 'jsonp',  
551 - jsonp : 'jsoncallback',  
552 - data : data,  
553 - success : cb  
554 - });  
555 - }  
556 -  
557 -}(); 849 +}();
558 \ No newline at end of file 850 \ No newline at end of file
src/main/resources/static/pages/base/timesmodel/js/base-fun.js
@@ -1217,7 +1217,6 @@ var BaseFun = function() { @@ -1217,7 +1217,6 @@ var BaseFun = function() {
1217 qt.push(arr[a]); 1217 qt.push(arr[a]);
1218 } 1218 }
1219 } 1219 }
1220 - // debugger;  
1221 var tempup = baseF.sortDirArray(upArr); 1220 var tempup = baseF.sortDirArray(upArr);
1222 var tempdown = baseF.sortDirArray(downArr); 1221 var tempdown = baseF.sortDirArray(downArr);
1223 return {'upArr':tempup,'downArr':tempdown,'qt':qt}; 1222 return {'upArr':tempup,'downArr':tempdown,'qt':qt};
@@ -1233,7 +1232,6 @@ var BaseFun = function() { @@ -1233,7 +1232,6 @@ var BaseFun = function() {
1233 * @status OK. 1232 * @status OK.
1234 * */ 1233 * */
1235 sortDirArray : function(arr) { 1234 sortDirArray : function(arr) {
1236 - ///debugger;  
1237 //console.log(arr.length); 1235 //console.log(arr.length);
1238 var list = new Array(),tempArray = new Array(); 1236 var list = new Array(),tempArray = new Array();
1239 for(var a =0;a<arr.length;a++) { 1237 for(var a =0;a<arr.length;a++) {
@@ -1249,7 +1247,6 @@ var BaseFun = function() { @@ -1249,7 +1247,6 @@ var BaseFun = function() {
1249 list.push(arr[d]); 1247 list.push(arr[d]);
1250 } 1248 }
1251 } 1249 }
1252 - //debugger;  
1253 //console.log(list.length); 1250 //console.log(list.length);
1254 return list; 1251 return list;
1255 }, 1252 },
@@ -1261,7 +1258,6 @@ var BaseFun = function() { @@ -1261,7 +1258,6 @@ var BaseFun = function() {
1261 * @return : 返回一个数组.这里返回的是调整过后 发车间距均匀的班次数组 1258 * @return : 返回一个数组.这里返回的是调整过后 发车间距均匀的班次数组
1262 **/ 1259 **/
1263 jhfcjx : function(bcArr,dir,zzsj,dataMap) { 1260 jhfcjx : function(bcArr,dir,zzsj,dataMap) {
1264 - // debugger;  
1265 console.log(bcArr.length); 1261 console.log(bcArr.length);
1266 //console.log('调整' + dir + '发车间隙...'); 1262 //console.log('调整' + dir + '发车间隙...');
1267 // 1、定义某个方向下的首末班次时间结点. 1263 // 1、定义某个方向下的首末班次时间结点.
@@ -1286,7 +1282,6 @@ var BaseFun = function() { @@ -1286,7 +1282,6 @@ var BaseFun = function() {
1286 return; 1282 return;
1287 var fcnosj = new Date(kssj); 1283 var fcnosj = new Date(kssj);
1288 // 2.4、调整班次 1284 // 2.4、调整班次
1289 - //debugger;  
1290 for(var l = 0 ;l<bcArr.length-1;l++) { 1285 for(var l = 0 ;l<bcArr.length-1;l++) {
1291 var _t = baseF.getDateTime(bcArr[l].fcsj); 1286 var _t = baseF.getDateTime(bcArr[l].fcsj);
1292 if(_t>temp ) 1287 if(_t>temp )
src/main/resources/static/pages/base/timesmodel/js/d3.relationshipgraph.js
@@ -325,17 +325,18 @@ var _animation = function(d3Node) {return d3Node.transition().delay(function(d,i @@ -325,17 +325,18 @@ var _animation = function(d3Node) {return d3Node.transition().delay(function(d,i
325 * @returns {Object} table.outerHTML 325 * @returns {Object} table.outerHTML
326 ************************************************************************************************************************************************/ 326 ************************************************************************************************************************************************/
327 var createTooltip = function createTooltip(self) { 327 var createTooltip = function createTooltip(self) {
328 - var hiddenKeys = ['_PRIVATE_','fcno' ,'PARENTCOLOR', 'SETNODECOLOR', 'SETNODESTROKECOLOR', /*'INTERVAL',*/'num'],  
329 - showKeys = self.configuration.showKeys;  
330 return d3.tip().attr('class', 'relationshipGraph-tip').offset([-8, -10]).html(function (obj) { 328 return d3.tip().attr('class', 'relationshipGraph-tip').offset([-8, -10]).html(function (obj) {
331 var keys = Object.keys(obj), 329 var keys = Object.keys(obj),
332 table = document.createElement('table'), 330 table = document.createElement('table'),
333 count = keys.length, 331 count = keys.length,
334 rows = []; 332 rows = [];
  333 + var showKeys = self.configuration.showKeys;
  334 + var hiddenKeys = ['_PRIVATE_' ,'PARENTCOLOR', 'SETNODECOLOR', 'SETNODESTROKECOLOR','lpNo','lpName','lp','lpType',
  335 + 'jhlc','tcc','ttinfo','xl','isfb','qdz','zdz','isSwitchXl','bz','bcs','fcno'];
335 while (count--) { 336 while (count--) {
336 - var element = keys[count],  
337 - upperCaseKey = element.toUpperCase();  
338 - if (!RelationshipGraph.contains(hiddenKeys, upperCaseKey) && !upperCaseKey.startsWith('__') && obj[element] !='tjz') { 337 + var element = keys[count];
  338 + // upperCaseKey = element.toUpperCase();
  339 + if (!RelationshipGraph.contains(hiddenKeys, element) && !element.startsWith('__') && obj[element] !='tjz') {
339 var row = document.createElement('tr'), 340 var row = document.createElement('tr'),
340 key = showKeys ? document.createElement('td') : null, 341 key = showKeys ? document.createElement('td') : null,
341 value = document.createElement('td'); 342 value = document.createElement('td');
@@ -352,7 +353,7 @@ var createTooltip = function createTooltip(self) { @@ -352,7 +353,7 @@ var createTooltip = function createTooltip(self) {
352 else if(element=='xlDir') 353 else if(element=='xlDir')
353 changeKey = '行驶方向:'; 354 changeKey = '行驶方向:';
354 else if(element=='parent') 355 else if(element=='parent')
355 - changeKey = '当前车辆:'; 356 + changeKey = '当前路牌:';
356 else if(element=='bcType') 357 else if(element=='bcType')
357 changeKey = '班次类型:'; 358 changeKey = '班次类型:';
358 else if(element=='tjbx') 359 else if(element=='tjbx')
@@ -363,7 +364,7 @@ var createTooltip = function createTooltip(self) { @@ -363,7 +364,7 @@ var createTooltip = function createTooltip(self) {
363 row.appendChild(key); 364 row.appendChild(key);
364 } 365 }
365 366
366 - if (upperCaseKey == 'VALUE' && !self.configuration.valueKeyName) { 367 + if (element == 'VALUE' && !self.configuration.valueKeyName) {
367 continue; 368 continue;
368 } 369 }
369 370
src/main/resources/static/pages/base/timesmodel/js/gantt.js
@@ -101,7 +101,8 @@ @@ -101,7 +101,8 @@
101 'jclcArr' : BaseFun.formatPairing(gatps.upInMileage,gatps.downInMileage),// 进场里程。[下标0代表上;下标1代表下] 101 'jclcArr' : BaseFun.formatPairing(gatps.upInMileage,gatps.downInMileage),// 进场里程。[下标0代表上;下标1代表下]
102 'cclcArr' : BaseFun.formatPairing(gatps.upOutMileage,gatps.downOutMileage),// 出场里程。[下标0代表上;下标1代表下] 102 'cclcArr' : BaseFun.formatPairing(gatps.upOutMileage,gatps.downOutMileage),// 出场里程。[下标0代表上;下标1代表下]
103 'pcxssjArr' : BaseFun.formatPairing(gatps.upTravelTime,gatps.downTravelTime),// 平常行驶时间。[下标0代表上;下标1代表下] 103 'pcxssjArr' : BaseFun.formatPairing(gatps.upTravelTime,gatps.downTravelTime),// 平常行驶时间。[下标0代表上;下标1代表下]
104 - 'gfxxsjArr' : BaseFun.formatPairing(gatps.lateUpTime,gatps.lateDownTime),// 高峰行驶时间。[下标0代表上;下标1代表下] 104 + 'gfxxsjArr' : BaseFun.formatPairing(gatps.lateUpTime=='' ? gatps.upTravelTime : gatps.lateUpTime,
  105 + gatps.lateDownTime=='' ? gatps.downTravelTime : gatps.lateDownTime),// 高峰行驶时间。[下标0代表上;下标1代表下]
105 'pcxslcArr' : BaseFun.formatPairing(gatps.upMileage,gatps.downMileage),// 行驶里程。[下标0代表上;下标1代表下] 106 'pcxslcArr' : BaseFun.formatPairing(gatps.upMileage,gatps.downMileage),// 行驶里程。[下标0代表上;下标1代表下]
106 'qdzArr' : BaseFun.qzdz(gatps.up_s.split('_')[0],gatps.down_s.split('_')[0]),// 起始站。[下标0代表上;下标1代表下] 107 'qdzArr' : BaseFun.qzdz(gatps.up_s.split('_')[0],gatps.down_s.split('_')[0]),// 起始站。[下标0代表上;下标1代表下]
107 'zdzArr':BaseFun.qzdz(gatps.up_s.split('_')[1],gatps.down_s.split('_')[1]),// 终点站。[下标0代表上;下标1代表下] 108 'zdzArr':BaseFun.qzdz(gatps.up_s.split('_')[1],gatps.down_s.split('_')[1]),// 终点站。[下标0代表上;下标1代表下]
src/main/resources/static/pages/base/timesmodel/js/tagsinput.js
@@ -25,10 +25,30 @@ var ComponentsBootstrapTagsinput = function() { @@ -25,10 +25,30 @@ var ComponentsBootstrapTagsinput = function() {
25 itemValue: 'value', 25 itemValue: 'value',
26 itemText: 'text' 26 itemText: 'text'
27 }); 27 });
  28 +
  29 + $('#state_tagsinput').on('beforeItemAdd', function(event) {
  30 + var bctypeValue = $('#state_tagsinput_bctype').val();
  31 + var rcnum = $('#state_tagsinput_value').val();
  32 + var bxrcAr = $('#state_tagsinput').val().split(',');
  33 + for(var s = 0 ; s< bxrcAr.length;s++) {
  34 + var s1a = bxrcAr[s].split('/');
  35 + if(s1a[0]==bctypeValue) {
  36 + $('#state_tagsinput').tagsinput('remove', bxrcAr[s]);
  37 + }
  38 + }
  39 + });
  40 +
28 $('#state_tagsinput_add').on('click', function(){ 41 $('#state_tagsinput_add').on('click', function(){
29 var bctypeValue = $('#state_tagsinput_bctype').val(); 42 var bctypeValue = $('#state_tagsinput_bctype').val();
30 var rcnum = $('#state_tagsinput_value').val(); 43 var rcnum = $('#state_tagsinput_value').val();
31 if(isNull(bctypeValue,rcnum)) { 44 if(isNull(bctypeValue,rcnum)) {
  45 + var bxrcAr = $('#state_tagsinput').val().split(',');
  46 + for(var s = 0 ; s< bxrcAr.length;s++) {
  47 + var s1a = bxrcAr[s].split('/');
  48 + if(s1a[0]==bctypeValue) {
  49 + rcnum = parseInt(rcnum) + parseInt(s1a[1]);
  50 + }
  51 + }
32 elt.tagsinput('add', { 52 elt.tagsinput('add', {
33 "value": bctypeValue + '/' + rcnum, 53 "value": bctypeValue + '/' + rcnum,
34 "text": bctypeValue + '/' + rcnum, 54 "text": bctypeValue + '/' + rcnum,
src/main/resources/static/pages/excep/boundList.html
@@ -55,9 +55,9 @@ @@ -55,9 +55,9 @@
55 <tr role="row" class="heading"> 55 <tr role="row" class="heading">
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>  
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 <th width="10%">上下行</th> 61 <th width="10%">上下行</th>
62 <th width="18%">时间</th> 62 <th width="18%">时间</th>
63 <th width="18%">操作</th> 63 <th width="18%">操作</th>
@@ -66,10 +66,11 @@ @@ -66,10 +66,11 @@
66 <td></td> 66 <td></td>
67 <td> 67 <td>
68 <!-- <input type="text" class="form-control form-filter input-sm" name="userName_like"> --> 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 </td> 70 </td>
71 <td> 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 </td> 74 </td>
74 <td> 75 <td>
75 </td> 76 </td>
@@ -119,10 +120,10 @@ @@ -119,10 +120,10 @@
119 </td> 120 </td>
120 121
121 <td> 122 <td>
122 - {{obj.lon}} 123 + {{obj.jsy}}
123 </td> 124 </td>
124 <td> 125 <td>
125 - {{obj.lat}} 126 + {{obj.lpname}}
126 </td> 127 </td>
127 <td> 128 <td>
128 {{if obj.upDown==0}} 129 {{if obj.upDown==0}}
@@ -271,45 +272,67 @@ $(function(){ @@ -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 function changeEnabled(id,enabled){ 337 function changeEnabled(id,enabled){
315 debugger 338 debugger
@@ -317,4 +340,5 @@ function changeEnabled(id,enabled){ @@ -317,4 +340,5 @@ function changeEnabled(id,enabled){
317 jsDoQuery(null, true); 340 jsDoQuery(null, true);
318 }) 341 })
319 } 342 }
  343 +});
320 </script> 344 </script>
321 \ No newline at end of file 345 \ No newline at end of file
src/main/resources/static/pages/excep/offlineList.html
@@ -55,9 +55,9 @@ @@ -55,9 +55,9 @@
55 <tr role="row" class="heading"> 55 <tr role="row" class="heading">
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>  
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 <th width="10%">上下行</th> 61 <th width="10%">上下行</th>
62 <th width="18%">时间</th> 62 <th width="18%">时间</th>
63 <th width="18%">操作</th> 63 <th width="18%">操作</th>
@@ -66,10 +66,12 @@ @@ -66,10 +66,12 @@
66 <td></td> 66 <td></td>
67 <td> 67 <td>
68 <!-- <input type="text" class="form-control form-filter input-sm" name="userName_like"> --> 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 </td> 70 </td>
71 <td> 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 </td> 75 </td>
74 <td> 76 <td>
75 </td> 77 </td>
@@ -119,10 +121,10 @@ @@ -119,10 +121,10 @@
119 </td> 121 </td>
120 122
121 <td> 123 <td>
122 - {{obj.lon}} 124 + {{obj.jsy}}
123 </td> 125 </td>
124 <td> 126 <td>
125 - {{obj.lat}} 127 + {{obj.lpname}}
126 </td> 128 </td>
127 <td> 129 <td>
128 {{if obj.upDown==0}} 130 {{if obj.upDown==0}}
@@ -275,43 +277,64 @@ $(function(){ @@ -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 </script> 340 </script>
318 \ No newline at end of file 341 \ No newline at end of file
src/main/resources/static/pages/excep/speedingList.html
@@ -55,9 +55,9 @@ @@ -55,9 +55,9 @@
55 <tr role="row" class="heading"> 55 <tr role="row" class="heading">
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>  
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 <th width="10%">上下行</th> 61 <th width="10%">上下行</th>
62 <th width="18%">时间</th> 62 <th width="18%">时间</th>
63 <th width="18%">操作</th> 63 <th width="18%">操作</th>
@@ -69,10 +69,11 @@ @@ -69,10 +69,11 @@
69 <select class="form-control" name="line" id="line" style="width: 180px;"></select> 69 <select class="form-control" name="line" id="line" style="width: 180px;"></select>
70 </td> 70 </td>
71 <td> 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 </td> 74 </td>
74 <td> 75 <td>
75 - <input class="form-control" type="date" name="date" /> 76 +
76 </td> 77 </td>
77 <td></td> 78 <td></td>
78 <td> 79 <td>
@@ -83,7 +84,7 @@ @@ -83,7 +84,7 @@
83 <option value="-1">无效</option> 84 <option value="-1">无效</option>
84 </select> 85 </select>
85 </td> 86 </td>
86 - <td></td> 87 + <td> <input class="form-control" type="date" name="date" /></td>
87 <td> 88 <td>
88 <button class="btn btn-sm green btn-outline filter-submit margin-bottom" > 89 <button class="btn btn-sm green btn-outline filter-submit margin-bottom" >
89 <i class="fa fa-search"></i> 搜索</button> 90 <i class="fa fa-search"></i> 搜索</button>
@@ -118,10 +119,10 @@ @@ -118,10 +119,10 @@
118 </td> 119 </td>
119 120
120 <td> 121 <td>
121 - {{obj.lon}} 122 + {{obj.jsy}}
122 </td> 123 </td>
123 <td> 124 <td>
124 - {{obj.lat}} 125 + {{obj.lpname}}
125 </td> 126 </td>
126 <td> 127 <td>
127 {{if obj.upDown==0}} 128 {{if obj.upDown==0}}
@@ -270,45 +271,65 @@ $(function(){ @@ -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 function changeEnabled(id,enabled){ 334 function changeEnabled(id,enabled){
314 debugger 335 debugger
@@ -316,4 +337,5 @@ function changeEnabled(id,enabled){ @@ -316,4 +337,5 @@ function changeEnabled(id,enabled){
316 jsDoQuery(null, true); 337 jsDoQuery(null, true);
317 }) 338 })
318 } 339 }
  340 +});
319 </script> 341 </script>
320 \ No newline at end of file 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,76 +31,160 @@
31 <div class="portlet-title"> 31 <div class="portlet-title">
32 <div class="caption"> 32 <div class="caption">
33 <i class="icon-equalizer font-red-sunglo"></i> <span 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 </div> 35 </div>
36 </div> 36 </div>
37 37
38 <div class="portlet-body form"> 38 <div class="portlet-body form">
39 <form ng-submit="ctrl.submit()" class="form-horizontal" novalidate name="myForm"> 39 <form ng-submit="ctrl.submit()" class="form-horizontal" novalidate name="myForm">
40 <div class="form-body"> 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 </div> 47 </div>
47 48
48 </div> 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 </div> 56 </div>
65 </div> 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 </div> 63 </div>
  64 +
82 </div> 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 </div> 181 </div>
  182 +
99 </div> 183 </div>
100 184
101 <div class="form-group"> 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 <input type="text" class="form-control" name="fcsj" 188 <input type="text" class="form-control" name="fcsj"
105 ng-model="ctrl.tt.fcsj" 189 ng-model="ctrl.tt.fcsj"
106 ng-pattern="ctrl.time_regex" 190 ng-pattern="ctrl.time_regex"
@@ -113,8 +197,8 @@ @@ -113,8 +197,8 @@
113 197
114 </div> 198 </div>
115 <div class="form-group"> 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 <input type="text" class="form-control" name="jhlc" 202 <input type="text" class="form-control" name="jhlc"
119 ng-model="ctrl.tt.jhlc" 203 ng-model="ctrl.tt.jhlc"
120 ng-pattern="ctrl.float_regex" 204 ng-pattern="ctrl.float_regex"
@@ -127,8 +211,8 @@ @@ -127,8 +211,8 @@
127 211
128 </div> 212 </div>
129 <div class="form-group"> 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 <input type="text" class="form-control" name="bcsj" 216 <input type="text" class="form-control" name="bcsj"
133 ng-model="ctrl.tt.bcsj" 217 ng-model="ctrl.tt.bcsj"
134 ng-pattern="ctrl.number_regex" 218 ng-pattern="ctrl.number_regex"
@@ -140,9 +224,10 @@ @@ -140,9 +224,10 @@
140 </div> 224 </div>
141 225
142 </div> 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 <sa-Select5 name="bcType" 231 <sa-Select5 name="bcType"
147 model="ctrl.tt" 232 model="ctrl.tt"
148 cmaps="{'bcType': 'code'}" 233 cmaps="{'bcType': 'code'}"
@@ -159,6 +244,14 @@ @@ -159,6 +244,14 @@
159 244
160 </div> 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 </div> 255 </div>
163 256
164 <div class="form-actions"> 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,6 +184,7 @@ angular.module(&#39;ScheduleApp&#39;).factory(
184 ttinfodetailIds[index].qdz = value.qdz || undefined; 184 ttinfodetailIds[index].qdz = value.qdz || undefined;
185 ttinfodetailIds[index].zdz = value.zdz || undefined; 185 ttinfodetailIds[index].zdz = value.zdz || undefined;
186 ttinfodetailIds[index].tcc = value.tcc || undefined; 186 ttinfodetailIds[index].tcc = value.tcc || undefined;
  187 + ttinfodetailIds[index].isfb = value.isFB || undefined;
187 188
188 ttinfodetailIds[index].validInfo(); 189 ttinfodetailIds[index].validInfo();
189 190
@@ -585,10 +586,16 @@ angular.module(&#39;ScheduleApp&#39;).controller( @@ -585,10 +586,16 @@ angular.module(&#39;ScheduleApp&#39;).controller(
585 '$stateParams', 586 '$stateParams',
586 '$state', 587 '$state',
587 function(service, $stateParams, $state) { 588 function(service, $stateParams, $state) {
588 - // TODO:  
589 -  
590 var self = this; 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 // 时间正则表达式(格式hh:mm,如:06:39) 600 // 时间正则表达式(格式hh:mm,如:06:39)
594 self.time_regex = /^([01]?[0-9]|2[0-3]):[0-5][0-9]$/; 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,11 +606,14 @@ angular.module(&#39;ScheduleApp&#39;).controller(
599 606
600 // 欲保存的busInfo信息,绑定 607 // 欲保存的busInfo信息,绑定
601 //self.tt = new TTInfoDetail; 608 //self.tt = new TTInfoDetail;
  609 +
602 self.tt = { 610 self.tt = {
603 xlDir: undefined, 611 xlDir: undefined,
604 tcc: {id: undefined}, 612 tcc: {id: undefined},
605 qdz: {id: undefined}, 613 qdz: {id: undefined},
606 zdz: {id: undefined}, 614 zdz: {id: undefined},
  615 + bcType: undefined,
  616 + isFB: undefined,
607 reSetTTinfoDetail: function(value) { 617 reSetTTinfoDetail: function(value) {
608 for (var key in this) { 618 for (var key in this) {
609 if (!angular.isFunction(this[key])) { 619 if (!angular.isFunction(this[key])) {
@@ -611,7 +621,7 @@ angular.module(&#39;ScheduleApp&#39;).controller( @@ -611,7 +621,7 @@ angular.module(&#39;ScheduleApp&#39;).controller(
611 if (this[key].id) { 621 if (this[key].id) {
612 value[key] = this[key]; 622 value[key] = this[key];
613 } 623 }
614 - } else if (this[key]) { 624 + } else if (this[key] != undefined) {
615 value[key] = this[key]; 625 value[key] = this[key];
616 } 626 }
617 } 627 }
@@ -619,13 +629,32 @@ angular.module(&#39;ScheduleApp&#39;).controller( @@ -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 self.submit = function() { 660 self.submit = function() {
@@ -646,6 +675,8 @@ angular.module(&#39;ScheduleApp&#39;).controller( @@ -646,6 +675,8 @@ angular.module(&#39;ScheduleApp&#39;).controller(
646 // }); 675 // });
647 //}); 676 //});
648 677
  678 + console.log(self.tt);
  679 +
649 service.editInfos(self.tt).then(function() { 680 service.editInfos(self.tt).then(function() {
650 $state.go("ttInfoDetailManage_edit3", { 681 $state.go("ttInfoDetailManage_edit3", {
651 xlid: self.xlid, 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/css/line_schedule.css
@@ -114,15 +114,15 @@ @@ -114,15 +114,15 @@
114 } 114 }
115 115
116 .line-schedule-table dl dt:nth-of-type(7), .line-schedule-table dl dd:nth-of-type(7) { 116 .line-schedule-table dl dt:nth-of-type(7), .line-schedule-table dl dd:nth-of-type(7) {
117 - width: 10%; 117 + width: calc(10% + 10px);
118 } 118 }
119 119
120 .line-schedule-table dl dt:nth-of-type(8), .line-schedule-table dl dd:nth-of-type(8) { 120 .line-schedule-table dl dt:nth-of-type(8), .line-schedule-table dl dd:nth-of-type(8) {
121 - width: calc(51% - 238px); 121 + width: calc(51% - 233px);
122 } 122 }
123 123
124 .line-schedule-table dl dt:nth-of-type(9), .line-schedule-table dl dd:nth-of-type(9) { 124 .line-schedule-table dl dt:nth-of-type(9), .line-schedule-table dl dd:nth-of-type(9) {
125 - width: 70px; 125 + width: 65px;
126 border-right: 0; 126 border-right: 0;
127 } 127 }
128 128
src/main/resources/static/real_control_v2/css/main.css
@@ -923,4 +923,41 @@ option.oil_station_opt{ @@ -923,4 +923,41 @@ option.oil_station_opt{
923 } 923 }
924 .park-and-station-wrap select{ 924 .park-and-station-wrap select{
925 width: auto !important; 925 width: auto !important;
  926 +}
  927 +
  928 +/** 安全驾驶相关css */
  929 +.safe_driv_pop_wrap{
  930 + position: absolute;
  931 + right: 12px;
  932 + bottom: 12px;
  933 +}
  934 +
  935 +.safe_driv_pop{
  936 + height: 45px;
  937 + background: #d44b4b;
  938 + color: #f2f2f2;
  939 + font-size: 15px;
  940 + padding: 9px 10px 0;
  941 + border: 1px solid #f4f0f0;
  942 + border-radius: 5px;
  943 + cursor: pointer;
  944 + box-shadow: 0 8px 17px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
  945 +}
  946 +
  947 +.safe_driv_pop:hover{
  948 + background: #bc2a2a;
  949 +}
  950 +
  951 +.safe_driv_pop .title{
  952 + font-weight: 600;
  953 +}
  954 +
  955 +.safe_driv_pop i.uk-icon-times-circle{
  956 + margin-right: 5px;
  957 +}
  958 +.safe_driv_pop .desc{
  959 + display: block;
  960 + font-size: 12px;
  961 + margin: 2px 0 0 20px;
  962 + color: #e3e3e3;
926 } 963 }
927 \ No newline at end of file 964 \ No newline at end of file
src/main/resources/static/real_control_v2/css/modal_extend.css
1 -.uk-modal{ 1 +.uk-modal.ct_move_modal{
2 background: rgba(0,0,0,.4) !important; 2 background: rgba(0,0,0,.4) !important;
3 } 3 }
4 4
5 -.uk-modal-dialog{ 5 +.uk-modal.ct_move_modal .uk-modal-dialog{
6 border: 1px solid #dd6952; 6 border: 1px solid #dd6952;
7 7
8 position: absolute !important; 8 position: absolute !important;
9 margin: 0 !important; 9 margin: 0 !important;
10 } 10 }
11 11
12 -.uk-modal-dialog.uk-modal-dialog-blank{ 12 +.uk-modal.ct_move_modal .uk-modal-dialog.uk-modal-dialog-blank{
13 border: none !important; 13 border: none !important;
14 } 14 }
15 15
16 -.uk-modal-header{ 16 +.uk-modal.ct_move_modal .uk-modal-header{
17 cursor: move; 17 cursor: move;
18 user-select: none; 18 user-select: none;
19 } 19 }
20 \ No newline at end of file 20 \ No newline at end of file
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/add_temp_sch.html
1 -<div class="uk-modal ct-form-modal" id="schedule-addsch-modal"> 1 +<div class="uk-modal ct-form-modal ct_move_modal" id="schedule-addsch-modal">
2 <div class="uk-modal-dialog"> 2 <div class="uk-modal-dialog">
3 <a href="" class="uk-modal-close uk-close"></a> 3 <a href="" class="uk-modal-close uk-close"></a>
4 <div class="uk-modal-header"> 4 <div class="uk-modal-header">
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/dftz.html
1 -<div class="uk-modal ct-form-modal" id="schedule-dftz-modal"> 1 +<div class="uk-modal ct-form-modal ct_move_modal" id="schedule-dftz-modal">
2 <div class="uk-modal-dialog"> 2 <div class="uk-modal-dialog">
3 <a href="" class="uk-modal-close uk-close"></a> 3 <a href="" class="uk-modal-close uk-close"></a>
4 <div class="uk-modal-header"> 4 <div class="uk-modal-header">
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/fcxxwt.html
1 -<div class="uk-modal ct-form-modal" id="schedule-fcxxwt-modal"> 1 +<div class="uk-modal ct-form-modal ct_move_modal" id="schedule-fcxxwt-modal">
2 <div class="uk-modal-dialog"> 2 <div class="uk-modal-dialog">
3 <a href="" class="uk-modal-close uk-close"></a> 3 <a href="" class="uk-modal-close uk-close"></a>
4 <div class="uk-modal-header"> 4 <div class="uk-modal-header">
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/jhlb.html
1 -<div class="uk-modal ct-form-modal" id="schedule-jhlb-modal"> 1 +<div class="uk-modal ct-form-modal ct_move_modal" id="schedule-jhlb-modal">
2 <div class="uk-modal-dialog" style="width: 370px;"> 2 <div class="uk-modal-dialog" style="width: 370px;">
3 <a href="" class="uk-modal-close uk-close"></a> 3 <a href="" class="uk-modal-close uk-close"></a>
4 <div class="uk-modal-header"> 4 <div class="uk-modal-header">
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/lj_zrw.html
1 -<div class="uk-modal ct-form-modal" id="schedule-lj_zrw-modal"> 1 +<div class="uk-modal ct-form-modal ct_move_modal" id="schedule-lj_zrw-modal">
2 <div class="uk-modal-dialog" style="width: 930px;"> 2 <div class="uk-modal-dialog" style="width: 930px;">
3 <a href="" class="uk-modal-close uk-close"></a> 3 <a href="" class="uk-modal-close uk-close"></a>
4 <div class="uk-modal-header"> 4 <div class="uk-modal-header">
@@ -270,7 +270,7 @@ @@ -270,7 +270,7 @@
270 if (sum != sch.jhlcOrig) { 270 if (sum != sch.jhlcOrig) {
271 if (i > 1) 271 if (i > 1)
272 calcs += ('=' + sum); 272 calcs += ('=' + sum);
273 - calcs += (' ≠ ' + sch.jhlc); 273 + calcs += (' ≠ ' + sch.jhlcOrig);
274 calcs = calcs.substr(3); 274 calcs = calcs.substr(3);
275 var htmlStr = template('sub_task-fail-status-temp', {calcs: calcs}); 275 var htmlStr = template('sub_task-fail-status-temp', {calcs: calcs});
276 $('#childTaskTitle', modal).append(htmlStr); 276 $('#childTaskTitle', modal).append(htmlStr);
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/lp_change.html
1 -<div class="uk-modal" id="schedule-lp_change-modal"> 1 +<div class="uk-modal ct_move_modal" id="schedule-lp_change-modal">
2 <div class="uk-modal-dialog" style="width: 1240px;"> 2 <div class="uk-modal-dialog" style="width: 1240px;">
3 <a href="" class="uk-modal-close uk-close"></a> 3 <a href="" class="uk-modal-close uk-close"></a>
4 <div class="uk-modal-header"> 4 <div class="uk-modal-header">
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/multi_dftz.html
1 -<div class="uk-modal" id="schedule-multi-dftz-modal"> 1 +<div class="uk-modal ct_move_modal" id="schedule-multi-dftz-modal">
2 <div class="uk-modal-dialog" style="width: 710px;"> 2 <div class="uk-modal-dialog" style="width: 710px;">
3 <a href="" class="uk-modal-close uk-close"></a> 3 <a href="" class="uk-modal-close uk-close"></a>
4 <div class="uk-modal-header"> 4 <div class="uk-modal-header">
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/multi_tzrc.html
1 -<div class="uk-modal" id="schedule-multi-tzrc-modal"> 1 +<div class="uk-modal ct_move_modal" id="schedule-multi-tzrc-modal">
2 <div class="drag-container"></div> 2 <div class="drag-container"></div>
3 <div class="uk-modal-dialog" style="width: 860px;"> 3 <div class="uk-modal-dialog" style="width: 860px;">
4 <a href="" class="uk-modal-close uk-close"></a> 4 <a href="" class="uk-modal-close uk-close"></a>
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/sftz.html
1 -<div class="uk-modal ct-form-modal" id="schedule-sftz-modal"> 1 +<div class="uk-modal ct-form-modal ct_move_modal" id="schedule-sftz-modal">
2 <div class="uk-modal-dialog" style="width: 350px;"> 2 <div class="uk-modal-dialog" style="width: 350px;">
3 <a href="" class="uk-modal-close uk-close"></a> 3 <a href="" class="uk-modal-close uk-close"></a>
4 <div class="uk-modal-header"> 4 <div class="uk-modal-header">
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/sub_task/add_sub_task_inpark.html
1 -<div class="uk-modal" id="add-sub-task-inpark-modal"> 1 +<div class="uk-modal ct_move_modal" id="add-sub-task-inpark-modal">
2 <div class="uk-modal-dialog"> 2 <div class="uk-modal-dialog">
3 <a href="" class="uk-modal-close uk-close"></a> 3 <a href="" class="uk-modal-close uk-close"></a>
4 <div class="uk-modal-header"> 4 <div class="uk-modal-header">
@@ -476,7 +476,7 @@ @@ -476,7 +476,7 @@
476 $('input[name=mileage]', serviceForm).val(sMileage); 476 $('input[name=mileage]', serviceForm).val(sMileage);
477 477
478 //营运结束时间 478 //营运结束时间
479 - var et = sch.dfsjT + (parseInt(sMileage / sch.jhlc * sch.bcsj) * 60 * 1000) 479 + var et = sch.dfsjT + (parseInt(sMileage / sch.jhlcOrig * sch.bcsj) * 60 * 1000)
480 ,ets = et > sch.zdsjT?sch.zdsj:moment(et).format('HH:mm'); 480 ,ets = et > sch.zdsjT?sch.zdsj:moment(et).format('HH:mm');
481 $('input[name=endDate]', serviceForm).val(ets); 481 $('input[name=endDate]', serviceForm).val(ets);
482 482
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/sub_task/add_sub_task_oil.html
1 -<div class="uk-modal ct-form-modal" id="schedule-addsch_oil-modal"> 1 +<div class="uk-modal ct-form-modal ct_move_modal" id="schedule-addsch_oil-modal">
2 <div class="uk-modal-dialog" style="width: 1201px;"> 2 <div class="uk-modal-dialog" style="width: 1201px;">
3 <a href="" class="uk-modal-close uk-close"></a> 3 <a href="" class="uk-modal-close uk-close"></a>
4 <div class="uk-modal-header"> 4 <div class="uk-modal-header">
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/sub_task/add_sub_task_other.html
1 -<div class="uk-modal ct-form-modal" id="add-sub-task-other-modal"> 1 +<div class="uk-modal ct-form-modal ct_move_modal" id="add-sub-task-other-modal">
2 <div class="uk-modal-dialog" style="width: 635px;"> 2 <div class="uk-modal-dialog" style="width: 635px;">
3 <a href="" class="uk-modal-close uk-close"></a> 3 <a href="" class="uk-modal-close uk-close"></a>
4 <div class="uk-modal-header"> 4 <div class="uk-modal-header">
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/sub_task/add_sub_task_outpark.html
1 -<div class="uk-modal" id="add-sub-task-inpark-modal"> 1 +<div class="uk-modal ct_move_modal" id="add-sub-task-inpark-modal">
2 <div class="uk-modal-dialog"> 2 <div class="uk-modal-dialog">
3 <a href="" class="uk-modal-close uk-close"></a> 3 <a href="" class="uk-modal-close uk-close"></a>
4 <div class="uk-modal-header"> 4 <div class="uk-modal-header">
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/sub_task/add_sub_task_range_turn.html
1 -<div class="uk-modal ct-form-modal" id="add-sub-task-range_turn-modal"> 1 +<div class="uk-modal ct-form-modal ct_move_modal" id="add-sub-task-range_turn-modal">
2 <div class="uk-modal-dialog" style="width: 1200px;"> 2 <div class="uk-modal-dialog" style="width: 1200px;">
3 <a href="" class="uk-modal-close uk-close"></a> 3 <a href="" class="uk-modal-close uk-close"></a>
4 <div class="uk-modal-header"> 4 <div class="uk-modal-header">
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/sub_task/oil_station.html
1 -<div class="uk-modal ct-form-modal" id="oil_station-modal"> 1 +<div class="uk-modal ct-form-modal ct_move_modal" id="oil_station-modal">
2 <div class="uk-modal-dialog" style="width: 450px;"> 2 <div class="uk-modal-dialog" style="width: 450px;">
3 <a href="" class="uk-modal-close uk-close"></a> 3 <a href="" class="uk-modal-close uk-close"></a>
4 <div class="uk-modal-header"> 4 <div class="uk-modal-header">
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/tzrc.html
1 -<div class="uk-modal ct-form-modal" id="schedule-tzrc-modal"> 1 +<div class="uk-modal ct-form-modal ct_move_modal" id="schedule-tzrc-modal">
2 <div class="uk-modal-dialog" style="width: 680px;"> 2 <div class="uk-modal-dialog" style="width: 680px;">
3 <a href="" class="uk-modal-close uk-close"></a> 3 <a href="" class="uk-modal-close uk-close"></a>
4 <div class="uk-modal-header"> 4 <div class="uk-modal-header">
src/main/resources/static/real_control_v2/js/modal_extend.js
@@ -3,13 +3,14 @@ $(document).on(&#39;hide.uk.modal&#39;, &#39;.uk-modal&#39;, function () { @@ -3,13 +3,14 @@ $(document).on(&#39;hide.uk.modal&#39;, &#39;.uk-modal&#39;, function () {
3 $(this).remove(); 3 $(this).remove();
4 }); 4 });
5 5
6 -$(document).on('show.uk.modal', '.uk-modal', function () { 6 +$(document).on('show.uk.modal', '.uk-modal.ct_move_modal', function () {
7 if($('.uk-modal-dialog', this).hasClass('uk-modal-dialog-blank')) 7 if($('.uk-modal-dialog', this).hasClass('uk-modal-dialog-blank'))
8 return; 8 return;
9 9
10 - //临时放过g'ji轨迹回放  
11 - if($(this).attr('id')=='map-playback-modal')  
12 - return; 10 + /* //临时放过轨迹回放
  11 + if($(this).attr('id')=='map-playback-modal')
  12 + return;*/
  13 +
13 //计算居中位置 14 //计算居中位置
14 var win = $('body'); 15 var win = $('body');
15 var Y = (win.width() - $('.uk-modal-dialog', this).width()) / 2 - 10; 16 var Y = (win.width() - $('.uk-modal-dialog', this).width()) / 2 - 10;
@@ -19,7 +20,7 @@ $(document).on(&#39;show.uk.modal&#39;, &#39;.uk-modal&#39;, function () { @@ -19,7 +20,7 @@ $(document).on(&#39;show.uk.modal&#39;, &#39;.uk-modal&#39;, function () {
19 var show_modal = function (id, dom) { 20 var show_modal = function (id, dom) {
20 $(document.body).append(dom); 21 $(document.body).append(dom);
21 return UIkit.modal(id, { 22 return UIkit.modal(id, {
22 - bgclose: false 23 + bgclose: false, modal: false
23 }).show(); 24 }).show();
24 }; 25 };
25 26
@@ -39,7 +40,8 @@ var open_modal_dom = function (dom, data, opt) { @@ -39,7 +40,8 @@ var open_modal_dom = function (dom, data, opt) {
39 $(document.body).append(dom); 40 $(document.body).append(dom);
40 UIkit.modal(id, opt).show(); 41 UIkit.modal(id, opt).show();
41 //move 42 //move
42 - modal_move($('.uk-modal-header',id)); 43 + if($(id).hasClass('ct_move_modal'))
  44 + modal_move($('.uk-modal-header',id));
43 45
44 if (data) 46 if (data)
45 $(id).trigger('init', data); 47 $(id).trigger('init', data);
@@ -64,7 +66,6 @@ var modal_move = function (m_header) { @@ -64,7 +66,6 @@ var modal_move = function (m_header) {
64 }); 66 });
65 67
66 $(m_header).parents('.uk-modal').mousemove(function (e) { 68 $(m_header).parents('.uk-modal').mousemove(function (e) {
67 - e.preventDefault();  
68 if(!_moveFlag || !_moveObj) 69 if(!_moveFlag || !_moveObj)
69 return; 70 return;
70 71
@@ -91,5 +92,4 @@ var modal_move = function (m_header) { @@ -91,5 +92,4 @@ var modal_move = function (m_header) {
91 _moveFlag = false; 92 _moveFlag = false;
92 _moveObj = null; 93 _moveObj = null;
93 }); 94 });
94 -  
95 }; 95 };
96 \ No newline at end of file 96 \ No newline at end of file
src/main/resources/static/real_control_v2/js/safe_driv/safeDriv.js 0 → 100644
  1 +/**
  2 + * 安全驾驶相关
  3 + */
  4 +var gb_safe_driv = (function () {
  5 +
  6 + var codes = {
  7 + 'A1': '手部违规',
  8 + 'A2': '摄像头偏离',
  9 + 'A3': '安全带',
  10 + 'A4': '未戴袖章',
  11 + 'A5': '眨眼/疲劳驾驶',
  12 + 'A6': '打哈欠/打瞌睡',
  13 + 'A7': '与人交谈'
  14 + };
  15 +
  16 + var $wrap = $('.safe_driv_pop_wrap');
  17 + var max = 5;
  18 +
  19 + var pop = function (sd) {
  20 + //只有admin用户能收到
  21 + var user = gb_northToolbar.user();
  22 + if(!user || user.userName.indexOf('admin') == -1)
  23 + return;
  24 +
  25 + var htmlStr = '<div class="safe_driv_pop uk-animation-slide-bottom">'+
  26 + ' <span class="title"><i class="uk-icon-times-circle"></i>安全驾驶 '+moment(sd.ts).format('HH:mm')+'</span>'+
  27 + ' <span class="text"> '+sd.clzbh+' 违规驾驶('+codes[sd.yczltype]+')</span><span class="desc">请至安全驾驶监管平台查看图像信息</span>'+
  28 + '</div>';
  29 +
  30 + var items = $wrap.find('.safe_driv_pop'), len = items.length;
  31 + if(len >= max)
  32 + $wrap.find('.safe_driv_pop:lt('+(len - max)+')').remove();
  33 +
  34 + $wrap.append(htmlStr);
  35 + };
  36 +
  37 + $wrap.on('click', '.safe_driv_pop', function () {
  38 + $(this).remove();
  39 + });
  40 +
  41 + return {
  42 + pop: pop
  43 + }
  44 +})();
0 \ No newline at end of file 45 \ No newline at end of file
src/main/resources/static/real_control_v2/js/websocket/sch_websocket.js
@@ -70,6 +70,10 @@ var gb_sch_websocket = (function () { @@ -70,6 +70,10 @@ var gb_sch_websocket = (function () {
70 calcUntreated(msg.data.lineId); 70 calcUntreated(msg.data.lineId);
71 }; 71 };
72 72
  73 + var safeDriv = function (msg) {
  74 + gb_safe_driv.pop(msg.t);
  75 + };
  76 +
73 var waitRemoves = []; 77 var waitRemoves = [];
74 //车辆发出 78 //车辆发出
75 var faChe = function (msg) { 79 var faChe = function (msg) {
@@ -150,7 +154,8 @@ var gb_sch_websocket = (function () { @@ -150,7 +154,8 @@ var gb_sch_websocket = (function () {
150 d80Confirm: d80Confirm, 154 d80Confirm: d80Confirm,
151 directive: directiveStatus, 155 directive: directiveStatus,
152 signal_state: signalState, 156 signal_state: signalState,
153 - deviceOffline: deviceOffline 157 + deviceOffline: deviceOffline,
  158 + safeDriv: safeDriv
154 }; 159 };
155 160
156 function currentSecond() { 161 function currentSecond() {
src/main/resources/static/real_control_v2/main.html
@@ -60,6 +60,7 @@ @@ -60,6 +60,7 @@
60 </div> 60 </div>
61 </div> 61 </div>
62 62
  63 +<div class="safe_driv_pop_wrap"></div>
63 <script> 64 <script>
64 delete window.exports; 65 delete window.exports;
65 delete window.module; 66 delete window.module;
@@ -182,8 +183,10 @@ @@ -182,8 +183,10 @@
182 183
183 <!-- 处理表单片段嵌入问题 --> 184 <!-- 处理表单片段嵌入问题 -->
184 <script src="/real_control_v2/js/forms/form_embed.js"></script> 185 <script src="/real_control_v2/js/forms/form_embed.js"></script>
185 - 186 +<!-- 模态框扩展 -->
186 <script src="/real_control_v2/js/modal_extend.js"></script> 187 <script src="/real_control_v2/js/modal_extend.js"></script>
  188 +<!-- 安全驾驶相关 -->
  189 +<script src="/real_control_v2/js/safe_driv/safeDriv.js" ></script>
187 </body> 190 </body>
188 191
189 </html> 192 </html>
src/main/resources/static/real_control_v2/mapmonitor/css/real.css
@@ -800,4 +800,103 @@ input[type=checkbox].disabled{ @@ -800,4 +800,103 @@ input[type=checkbox].disabled{
800 .cc_info_accordion{ 800 .cc_info_accordion{
801 height: calc(100% - 40px); 801 height: calc(100% - 40px);
802 overflow: auto; 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 \ No newline at end of file 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,127 +78,6 @@
78 </dl> 78 </dl>
79 </div> 79 </div>
80 <div class="ct_table_body"> 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 </div> 81 </div>
203 </div> 82 </div>
204 </div> 83 </div>
@@ -245,154 +124,6 @@ @@ -245,154 +124,6 @@
245 </dl> 124 </dl>
246 </div> 125 </div>
247 <div class="ct_table_body"> 126 <div class="ct_table_body">
248 - <dl>  
249 - <dd>金桥路朴珊德拉</dd>  
250 - <dd>05:02.4</dd>  
251 - <dd>05:04.6</dd>  
252 - <dd>5</dd>  
253 - <dd>12</dd>  
254 - </dl>  
255 - <dl>  
256 - <dd>金桥路朴珊德拉</dd>  
257 - <dd>05:02.4</dd>  
258 - <dd>05:04.6</dd>  
259 - <dd>5</dd>  
260 - <dd>12</dd>  
261 - </dl>  
262 - <dl>  
263 - <dd>金桥路朴珊德拉</dd>  
264 - <dd>05:02.4</dd>  
265 - <dd>05:04.6</dd>  
266 - <dd>5</dd>  
267 - <dd>12</dd>  
268 - </dl>  
269 - <dl>  
270 - <dd>金桥路朴珊德拉</dd>  
271 - <dd>05:02.4</dd>  
272 - <dd>05:04.6</dd>  
273 - <dd>5</dd>  
274 - <dd>12</dd>  
275 - </dl>  
276 - <dl>  
277 - <dd>金桥路朴珊德拉</dd>  
278 - <dd>05:02.4</dd>  
279 - <dd>05:04.6</dd>  
280 - <dd>5</dd>  
281 - <dd>12</dd>  
282 - </dl>  
283 - <dl>  
284 - <dd>金桥路朴珊德拉</dd>  
285 - <dd>05:02.4</dd>  
286 - <dd>05:04.6</dd>  
287 - <dd>5</dd>  
288 - <dd>12</dd>  
289 - </dl>  
290 - <dl>  
291 - <dd>金桥路朴珊德拉</dd>  
292 - <dd>05:02.4</dd>  
293 - <dd>05:04.6</dd>  
294 - <dd>5</dd>  
295 - <dd>12</dd>  
296 - </dl>  
297 - <dl>  
298 - <dd>金桥路朴珊德拉</dd>  
299 - <dd>05:02.4</dd>  
300 - <dd>05:04.6</dd>  
301 - <dd>5</dd>  
302 - <dd>12</dd>  
303 - </dl>  
304 - <dl>  
305 - <dd>金桥路朴珊德拉</dd>  
306 - <dd>05:02.4</dd>  
307 - <dd>05:04.6</dd>  
308 - <dd>5</dd>  
309 - <dd>12</dd>  
310 - </dl>  
311 - <dl>  
312 - <dd>金桥路朴珊德拉</dd>  
313 - <dd>05:02.4</dd>  
314 - <dd>05:04.6</dd>  
315 - <dd>5</dd>  
316 - <dd>12</dd>  
317 - </dl>  
318 - <dl>  
319 - <dd>金桥路朴珊德拉</dd>  
320 - <dd>05:02.4</dd>  
321 - <dd>05:04.6</dd>  
322 - <dd>5</dd>  
323 - <dd>12</dd>  
324 - </dl>  
325 - <dl>  
326 - <dd>金桥路朴珊德拉</dd>  
327 - <dd>05:02.4</dd>  
328 - <dd>05:04.6</dd>  
329 - <dd>5</dd>  
330 - <dd>12</dd>  
331 - </dl>  
332 - <dl>  
333 - <dd>金桥路朴珊德拉</dd>  
334 - <dd>05:02.4</dd>  
335 - <dd>05:04.6</dd>  
336 - <dd>5</dd>  
337 - <dd>12</dd>  
338 - </dl>  
339 - <dl>  
340 - <dd>金桥路朴珊德拉</dd>  
341 - <dd>05:02.4</dd>  
342 - <dd>05:04.6</dd>  
343 - <dd>5</dd>  
344 - <dd>12</dd>  
345 - </dl>  
346 - <dl>  
347 - <dd>金桥路朴珊德拉</dd>  
348 - <dd>05:02.4</dd>  
349 - <dd>05:04.6</dd>  
350 - <dd>5</dd>  
351 - <dd>12</dd>  
352 - </dl>  
353 - <dl>  
354 - <dd>金桥路朴珊德拉</dd>  
355 - <dd>05:02.4</dd>  
356 - <dd>05:04.6</dd>  
357 - <dd>5</dd>  
358 - <dd>12</dd>  
359 - </dl>  
360 - <dl>  
361 - <dd>金桥路朴珊德拉</dd>  
362 - <dd>05:02.4</dd>  
363 - <dd>05:04.6</dd>  
364 - <dd>5</dd>  
365 - <dd>12</dd>  
366 - </dl>  
367 - <dl>  
368 - <dd>金桥路朴珊德拉</dd>  
369 - <dd>05:02.4</dd>  
370 - <dd>05:04.6</dd>  
371 - <dd>5</dd>  
372 - <dd>12</dd>  
373 - </dl>  
374 - <dl>  
375 - <dd>金桥路朴珊德拉</dd>  
376 - <dd>05:02.4</dd>  
377 - <dd>05:04.6</dd>  
378 - <dd>5</dd>  
379 - <dd>12</dd>  
380 - </dl>  
381 - <dl>  
382 - <dd>金桥路朴珊德拉</dd>  
383 - <dd>05:02.4</dd>  
384 - <dd>05:04.6</dd>  
385 - <dd>5</dd>  
386 - <dd>12</dd>  
387 - </dl>  
388 - <dl>  
389 - <dd>金桥路朴珊德拉</dd>  
390 - <dd>05:02.4</dd>  
391 - <dd>05:04.6</dd>  
392 - <dd>5</dd>  
393 - <dd>12</dd>  
394 - </dl>  
395 -  
396 </div> 127 </div>
397 </div> 128 </div>
398 </div> 129 </div>
@@ -402,7 +133,55 @@ @@ -402,7 +133,55 @@
402 </div> 133 </div>
403 </div> 134 </div>
404 </div> 135 </div>
405 - <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>
406 </div> 185 </div>
407 </div> 186 </div>
408 </div> 187 </div>
@@ -429,16 +208,49 @@ @@ -429,16 +208,49 @@
429 </dl> 208 </dl>
430 {{/each}} 209 {{/each}}
431 </script> 210 </script>
  211 +
  212 + <script id="multi_inout_info_cont_temp" type="text/html">
  213 + {{each list as item i}}
  214 + <dl>
  215 + <dd>{{item.stopName}}</dd>
  216 + <dd>{{item.in_time_str}}</dd>
  217 + <dd>{{item.out_time_str}}</dd>
  218 + <dd></dd>
  219 + <dd></dd>
  220 + </dl>
  221 + {{/each}}
  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>
432 <script> 240 <script>
433 (function () { 241 (function () {
434 var modal = '#map-playback2-modal', gpsArray; 242 var modal = '#map-playback2-modal', gpsArray;
435 243
436 $(modal).on('init', function (e, data) { 244 $(modal).on('init', function (e, data) {
437 - //初始化地图  
438 - map = new BMap.Map($('.map-wrap', modal)[0]);  
439 - //中心点和缩放级别  
440 - map.centerAndZoom(new BMap.Point(gb_map_consts.center_point.lng, gb_map_consts.center_point.lat), 16);  
441 - map.enableScrollWheelZoom(); 245 + try {
  246 + //初始化地图
  247 + map = new BMap.Map($('.map-container', modal)[0]);
  248 + //中心点和缩放级别
  249 + map.centerAndZoom(new BMap.Point(gb_map_consts.center_point.lng, gb_map_consts.center_point.lat), 16);
  250 + map.enableScrollWheelZoom();
  251 + } catch (e) {
  252 + console.log(e);
  253 + }
442 254
443 //固定表头 255 //固定表头
444 gb_ct_table.fixedHead($('.road_table_wrap', modal)); 256 gb_ct_table.fixedHead($('.road_table_wrap', modal));
@@ -494,72 +306,89 @@ @@ -494,72 +306,89 @@
494 */ 306 */
495 var searchForm = (function () { 307 var searchForm = (function () {
496 308
497 - var f = $('.playBackForm', modal);  
498 -  
499 - var init = function (data) {  
500 - //设置初始值  
501 - if (data.nbbm)  
502 - $('[name=nbbm]', f).val(data.nbbm);  
503 - var st = moment().subtract(2, 'hour');  
504 - if (data.st)  
505 - st = moment(data.st, 'YYYY-MM-DD HH:mm');  
506 - $('[name=sDate]', f).val(st.format('YYYY-MM-DD'));  
507 - $('[name=sTime]', f).val(st.format('HH:mm'));  
508 - var et = moment();  
509 - if (data.et)  
510 - et = moment(data.et, 'YYYY-MM-DD HH:mm');  
511 - $('[name=eDate]', f).val(et.format('YYYY-MM-DD'));  
512 - $('[name=eTime]', f).val(et.format('HH:mm'));  
513 -  
514 - //搜索事件  
515 - $('button[type=submit]', f).on('click', search);  
516 - }; 309 + var f = $('.playBackForm', modal);
517 310
518 - var setNbbm = function (v) {  
519 - $('[name=nbbm]', f).val(v);  
520 - }; 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'));*/
521 325
522 - var ONE_DAY = 60 * 60 * 24;  
523 - var MIN_SPACE = 60;  
524 - var search = function (e) {  
525 - e.stopPropagation();  
526 - var data = f.serializeJSON();  
527 -  
528 - //校验时间间隔  
529 - var fs = 'YYYY-MM-DDHH:mm';  
530 - var st = parseInt(moment(data.sDate + data.sTime, fs).format('X'));  
531 - var et = parseInt(moment(data.eDate + data.eTime, fs).format('X'));  
532 -  
533 - if (et < st)  
534 - notify_err('结束时间不能小于开始时间');  
535 - else if ((et - st) > ONE_DAY)  
536 - notify_err('最大间隔24小时!');  
537 - else if ((et - st) < MIN_SPACE)  
538 - notify_err('最小间隔1分钟!');  
539 - else {  
540 - $.ajax({  
541 - url: '/gps/history_v2/' + data.nbbm,  
542 - traditional: true,  
543 - data: {st: st, et: et},  
544 - success: function (rs) {  
545 - gpsArray = rs.list;  
546 - if (!rs || rs.length == 0) {  
547 - notify_err('没有搜索到轨迹数据!');  
548 - return;  
549 - }  
550 -  
551 - //行车轨迹  
552 - trailTableObj.showInitData(gpsArray); 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 + }
  383 + });
553 } 384 }
554 - });  
555 - }  
556 - return false;  
557 - };  
558 - return {  
559 - init: init,  
560 - setNbbm: setNbbm  
561 - };  
562 - })(); 385 + return false;
  386 + };
  387 + return {
  388 + init: init,
  389 + setNbbm: setNbbm
  390 + };
  391 + })();
563 392
564 /** 393 /**
565 * 行车轨迹表格 394 * 行车轨迹表格
@@ -575,7 +404,8 @@ @@ -575,7 +404,8 @@
575 if (i > 0 && array[array.length - 1].road.road_CODE == gps.road.road_CODE) 404 if (i > 0 && array[array.length - 1].road.road_CODE == gps.road.road_CODE)
576 array.pop(); 405 array.pop();
577 } 406 }
578 - catch (e) {} 407 + catch (e) {
  408 + }
579 409
580 if (gps.road) 410 if (gps.road)
581 array.push(gps); 411 array.push(gps);
@@ -589,6 +419,141 @@ @@ -589,6 +419,141 @@
589 showInitData: showInitData 419 showInitData: showInitData
590 }; 420 };
591 })(); 421 })();
  422 +
  423 + /**
  424 + * 到离站信息表格
  425 + * @type {{}}
  426 + */
  427 + var inOutStationTableObj = (function () {
  428 +
  429 + var data, f, prev;
  430 + var showInitData = function (list) {
  431 + clear();
  432 + data = [];
  433 +
  434 + $.each(list, function (i, gps) {
  435 +
  436 + prev = data[data.length - 1];
  437 + if (gps['inout_stop'] == -1)
  438 + return true;
  439 +
  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 + }
  446 + data.push(createIn(gps));
  447 + }
  448 + else if (gps['inout_stop'] == 1) {
  449 + f = matchOut(prev, gps);
  450 + if(f)
  451 + data.push(f);
  452 + }
  453 + });
  454 +
  455 + //格式化时间
  456 + $.each(data, function () {
  457 + if (this.in_ts)
  458 + this.in_time_str = moment(this.in_ts).format('HH:mm.ss');
  459 + if (this.out_ts)
  460 + this.out_time_str = moment(this.out_ts).format('HH:mm.ss');
  461 + });
  462 +
  463 + var htmlStr = template('multi_inout_info_cont_temp', {list: data});
  464 + $('.inout_table_wrap .ct_table_body', modal).html(htmlStr);
  465 + };
  466 +
  467 + var add = function (gps) {
  468 +
  469 + };
  470 +
  471 + var clear = function () {
  472 +
  473 + };
  474 +
  475 + var createIn = function (gps) {
  476 + var info = gps['inout_stop_info'];
  477 + return {
  478 + in_ts: info.ts,
  479 + stopNo: info.stopNo,
  480 + stopName: info.stopName
  481 + }
  482 + };
  483 +
  484 +
  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 + }
  497 + }
  498 + };
  499 +
  500 + return {
  501 + showInitData: showInitData
  502 + };
  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 + })();
592 })(); 557 })();
593 </script> 558 </script>
594 </div> 559 </div>
595 \ No newline at end of file 560 \ No newline at end of file
src/main/resources/static/real_control_v2/mapmonitor/js/playback.js
@@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
3 var gb_map_play_back = (function () { 3 var gb_map_play_back = (function () {
4 4
5 var dom; 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 dom = rs; 7 dom = rs;
8 }); 8 });
9 9
@@ -13,10 +13,11 @@ var gb_map_play_back = (function () { @@ -13,10 +13,11 @@ var gb_map_play_back = (function () {
13 gb_map_imap.call('closeWin', deviceId); 13 gb_map_imap.call('closeWin', deviceId);
14 14
15 //show modal 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 //导出excel 23 //导出excel