Commit 9647744c3a659103e2a65e0aeb4733009e0a9ba2

Authored by 潘钊
2 parents a6e5b855 e6d30946

Merge branch 'minhang' of http://222.66.0.204:8090/panzhaov5/bsth_control into minhang

# Conflicts:
#	src/main/resources/static/real_control_v2/mapmonitor/fragments/playback_v2/main.html
Showing 29 changed files with 1599 additions and 912 deletions
src/main/java/com/bsth/data/safe_driv/SafeDriv.java
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   -}
  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
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   -}
  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
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   -}
  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/schedule/SchedulePlanInfo.java
... ... @@ -128,6 +128,9 @@ public class SchedulePlanInfo {
128 128 /** 关联的时刻表名字 */
129 129 private String ttInfoName;
130 130  
  131 + /** 时刻表的明细备注 */
  132 + private String remark;
  133 +
131 134  
132 135 /** 创建人 */
133 136 @ManyToOne(cascade = CascadeType.PERSIST, fetch = FetchType.LAZY)
... ... @@ -269,6 +272,9 @@ public class SchedulePlanInfo {
269 272 // 使用的时刻表名字
270 273 this.ttInfoName = ttInfoDetail.getTtinfo().getName();
271 274  
  275 + // 备注信息
  276 + this.remark = ttInfoDetail.getRemark();
  277 +
272 278 // 使用车辆配置的停车场信息
273 279 String pzType = carConfigInfo.getPzType(); // 配置类型
274 280 if (pzType != null && !pzType.equals("BSY")) {
... ... @@ -648,4 +654,12 @@ public class SchedulePlanInfo {
648 654 public void setTtInfoName(String ttInfoName) {
649 655 this.ttInfoName = ttInfoName;
650 656 }
  657 +
  658 + public String getRemark() {
  659 + return remark;
  660 + }
  661 +
  662 + public void setRemark(String remark) {
  663 + this.remark = remark;
  664 + }
651 665 }
... ...
src/main/java/com/bsth/repository/schedule/SchedulePlanInfoRepository.java
... ... @@ -35,21 +35,22 @@ public interface SchedulePlanInfoRepository extends BaseRepository&lt;SchedulePlanI
35 35 "info.cl_zbh as clZbh, " +
36 36 "group_concat(info.fcsj order by info.fcno) ccsj, " +
37 37 "group_concat(info.bc_type order by info.fcno) bctype, " +
38   - "group_concat(distinct info.j) jsyId, " +
39   - "group_concat(distinct info.j_gh) jsyGh, " +
40   - "group_concat(distinct info.j_name) jsyName, " +
41   - "group_concat(distinct info.s) spyId, " +
42   - "group_concat(distinct info.s_gh) spyGh, " +
43   - "group_concat(distinct info.s_name) spyName, " +
  38 + "group_concat(distinct info.j order by info.fcno) jsyId, " +
  39 + "group_concat(distinct info.j_gh order by info.fcno) jsyGh, " +
  40 + "group_concat(distinct info.j_name order by info.fcno) jsyName, " +
  41 + "group_concat(distinct info.s order by info.fcno) spyId, " +
  42 + "group_concat(distinct info.s_gh order by info.fcno) spyGh, " +
  43 + "group_concat(distinct info.s_name order by info.fcno) spyName, " +
44 44 "group_concat(info.fcno order by info.fcno) fcno, " +
45 45 "max(info.update_date) as updateDate, " +
46 46 "max(user.user_name) as updateUserName, " +
47 47 "max(info.tt_info_name) as ttInfoName " +
48 48 "from bsth_c_s_sp_info info left join bsth_c_sys_user user on info.update_by = user.id " +
  49 + "left join bsth_c_s_gbi gbi on info.lp = gbi.id " +
49 50 "where info.xl = ?1 and " +
50 51 "info.schedule_date = ?2 " +
51 52 "group by info.xl_name, info.schedule_date, info.lp, info.lp_name, info.cl, info.cl_zbh " +
52   - "order by info.xl_name, info.schedule_date, info.lp ", nativeQuery = true)
  53 + "order by info.xl_name, info.schedule_date, gbi.lp_no ", nativeQuery = true)
53 54 List<Object[]> findGroupInfo(Integer xlid, Date scheduleDate);
54 55  
55 56 @Modifying
... ...
src/main/java/com/bsth/service/gps/entity/GpsOutbound.java
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   -}
  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
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   -}
  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
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   -}
  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
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   -}
  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/oil/impl/YlbServiceImpl.java
... ... @@ -135,9 +135,11 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
135 135 Ylb ylb=ylListBe.get(i);
136 136 if(map.get("clZbh").toString().equals(ylb.getNbbm())){
137 137 if(ylb.getJzyl()!=null){
138   - t.setCzyl(ylb.getJzyl());
139   - fage=false;
140   - break;
  138 + if(ylb.getJzyl()>0){
  139 + t.setCzyl(ylb.getJzyl());
  140 + fage=false;
  141 + break;
  142 + }
141 143 }
142 144  
143 145 }
... ... @@ -270,7 +272,7 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
270 272 for (int i = 0; i < ylListBe.size(); i++) {
271 273 Ylb ylb = ylListBe.get(i);
272 274 if (map.get("clZbh").toString().equals(ylb.getNbbm())) {
273   - if(ylb.getJzyl()>=0){
  275 + if(ylb.getJzyl()>0){
274 276 t.setCzyl(ylb.getJzyl());
275 277 fage = false;
276 278 break;
... ... @@ -282,16 +284,18 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
282 284 for (int y = 0; y < clyList.size(); y++) {
283 285 Cyl cyl = clyList.get(y);
284 286 if (map.get("clZbh").toString().equals(cyl.getNbbm())) {
285   - if(cyl.getCyl()>=0){
286   - t.setCzyl(cyl.getCyl());
287   - fage = false;
288   - break;
289   - }else {
290   - if(cyl.getCxrl()!=null){
291   - if(cyl.getCxrl()>0){
292   - t.setCzyl(cyl.getCxrl());
293   - fage = false;
294   - break;
  287 + if(cyl!=null){
  288 + if(cyl.getCyl()>=0){
  289 + t.setCzyl(cyl.getCyl());
  290 + fage = false;
  291 + break;
  292 + }else {
  293 + if(cyl.getCxrl()!=null){
  294 + if(cyl.getCxrl()>0){
  295 + t.setCzyl(cyl.getCxrl());
  296 + fage = false;
  297 + break;
  298 + }
295 299 }
296 300 }
297 301 }
... ...
src/main/resources/static/pages/base/timesmodel/countadd.html 0 → 100644
  1 +<!-- 统计数据 -->
  2 +<div class="modal fade" id="countadd_mobal" tabindex="-1" role="basic" aria-hidden="true">
  3 + <div class="modal-dialog" style="margin-left: 400px;">
  4 + <div class="modal-content" style="width: 700px;">
  5 + <div class="modal-header">
  6 + <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
  7 + <h4 class="modal-title">统计数据 </h4>
  8 + </div>
  9 + <div class="modal-body">
  10 + <div class="portlet-body">
  11 + <div class="table-container" style="margin-top: 10px">
  12 + <table class="table table-striped table-bordered table-hover table-checkable" id="datatable_countadd">
  13 + <thead>
  14 + <tr role="row" class="heading">
  15 + <th width="1%">序号</th>
  16 + <th width="45%">统计项目</th>
  17 + <th width="15%">统计数值</th>
  18 + </tr>
  19 + </thead>
  20 + <tbody></tbody>
  21 + </table>
  22 + </div>
  23 + </div>
  24 + </div>
  25 + <div class="modal-footer">
  26 + <button type="button" class="btn default" data-dismiss="modal">关闭</button>
  27 + </div>
  28 + </div>
  29 + </div>
  30 +</div>
  31 +<script type="text/html" id="countAdd_temp">
  32 +{{each list as obj i }}
  33 + <tr role="row" class="filter">
  34 + <td>{{i+1}}</td>
  35 + <td>
  36 + {{obj.name}}
  37 + </td>
  38 + <td style="vertical-align:middle; text-align:center;">
  39 + {{if obj.name == '综合评估'}}
  40 + <div id="star"></div>
  41 + {{else}}
  42 + {{obj.value}}
  43 + {{/if}}
  44 + </td>
  45 + </tr>
  46 +{{/each}}
  47 +{{if list.length == 0}}
  48 + <tr>
  49 + <td colspan=3><h6 class="muted">没有找到相关数据</h6></td>
  50 + </tr>
  51 +{{/if}}
  52 +</script>
  53 +<script type="text/javascript">
  54 +$('#countadd_mobal').on('countAddMobal.show', function(e,countDate){
  55 + // 加载延迟200毫秒显示mobal
  56 + setTimeout(function(){$('#countadd_mobal').modal({show : true,backdrop: 'static', keyboard: false});},200);
  57 + // 当模态框对用户可见时触发(将等待 CSS 过渡效果完成)。
  58 + $('#countadd_mobal').on('show.bs.modal', function () {
  59 + // 把数据填充到模版中
  60 + var tbodyHtml = template('countAdd_temp',{list:countDate});
  61 + // 把渲染好的模版html文本追加到表格中
  62 + $('#datatable_countadd tbody').html(tbodyHtml);
  63 + $('#star').raty({ readOnly: true,score: 4.5 });
  64 + });
  65 +});
  66 +</script>
0 67 \ No newline at end of file
... ...
src/main/resources/static/pages/base/timesmodel/gantt.html
... ... @@ -19,19 +19,15 @@
19 19  
20 20 <!-- row 组件START -->
21 21 <div class="row">
22   -
23 22 <!-- col-md-12 组件START -->
24 23 <div class="col-md-12">
25   -
26 24 <!-- portlet 组件START -->
27 25 <div class="portlet light porttlet-fit bordered">
28   -
29 26 <!-- portlet-title组件START -->
30 27 <div class="portlet-title">
31   -
32 28 <!-- caption 组件START -->
33 29 <div class="caption">
34   - <i class="fa fa-database font-dark"></i>
  30 + <i class="fa fa-bar-chart font-dark"></i>
35 31 <span class="caption-subject font-dark sbold uppercase">时刻表明细模型</span>
36 32 </div>
37 33 <!-- caption 组件END -->
... ... @@ -40,6 +36,9 @@
40 36 </div>
41 37 <!-- actions 组件START -->
42 38 <div class="actions">
  39 + <div class="btn-group btn-group-devided countbtn" data-toggle="buttons">
  40 + <a class="btn btn-circle blue countAdd" href="javascript:;" data-pjax><i class="fa fa-database"></i> 统计数据</a>
  41 + </div>
43 42 <div class="btn-group btn-group-devided checkbtn" data-toggle="buttons">
44 43 <a class="btn btn-circle blue checkAdd" href="javascript:;" data-pjax><i class="fa fa-check"></i> 保存数据</a>
45 44 </div>
... ... @@ -107,6 +106,7 @@
107 106 <!-- col-md-12 组件END -->
108 107 </div>
109 108 <!-- row 组件END -->
  109 +<script src="/pages/base/timesmodel/js/raty/lib/jquery.raty.js"></script>
110 110 <script src="/pages/base/timesmodel/js/ContextJS/js/context.js"></script>
111 111 <script src="/pages/base/timesmodel/js/base-fun.js"></script>
112 112 <script src="/pages/base/timesmodel/js/d3.relationshipgraph.js"></script>
... ...
src/main/resources/static/pages/base/timesmodel/js/d3.relationshipgraph.js
... ... @@ -201,7 +201,7 @@ $(&#39;.reladplus&#39;).on(&#39;click&#39;,function() {
201 201 /************************************************************************************************************************************************/
202 202  
203 203 /**
204   - * @description : (TODO) 均匀发车事件.
  204 + * @description : (TODO) 监听均匀发车事件.
205 205 *
206 206 * @stutas : OK.
207 207 *
... ... @@ -229,8 +229,9 @@ $(&#39;.updownread&#39;).on(&#39;click&#39;,function() {
229 229 /************************************************************************************************************************************************/
230 230  
231 231 /**
232   - * 调整班次点击事件
233   - *
  232 + * @description : (TODO) 调整班次点击事件
  233 + *
  234 + * @status OK.
234 235 ************************************************************************************************************************************************/
235 236 $('.aboutread').on('click',function() {
236 237 // 判断选择框是否存在.
... ... @@ -255,7 +256,7 @@ $(&#39;.aboutread&#39;).on(&#39;click&#39;,function() {
255 256 /************************************************************************************************************************************************/
256 257  
257 258 /**
258   - * @description : (TODO) 保存数据.
  259 + * @description : (TODO) 监听保存数据事件.
259 260 *
260 261 * @status OK.
261 262 ************************************************************************************************************************************************/
... ... @@ -282,6 +283,112 @@ $(&#39;.aboutread&#39;).on(&#39;click&#39;,function() {
282 283 /************************************************************************************************************************************************/
283 284  
284 285 /**
  286 + * @description : (TODO) 监听统计数据事件.
  287 + *
  288 + * @status OK.
  289 + ************************************************************************************************************************************************/
  290 + $('.countAdd').on('click',function() {
  291 + var list = $_GlobalGraph.getDataArray();
  292 + var countBc = 0,// 总班次
  293 + serviceBc = 0,// 营运班次
  294 + jcbc = 0, // 进场总班次.
  295 + ccbc = 0, // 出场总班次.
  296 + cfbc = 0,// 吃饭总班次.
  297 + zwlbbc = 0,// 早晚例保总班次.
  298 + countGs = 0.0,// 总工时
  299 + servicesj = 0,// 营运班次总时间
  300 + jcsj = 0.0,// 进场总时间.
  301 + ccsj = 0.0 // 出场总时间.
  302 + cfsj = 0.0, // 吃饭总时间.
  303 + zwlbsj = 0.0, // 早晚例保总时间.
  304 + ksBc = 0,// 空驶班次
  305 + serviceLc = 0.0 ,// 营运里程
  306 + ksLc = 0.0 ,// 空驶里程
  307 + avgTzjx = 0.0,// 平均停站间隙
  308 + gfServiceBc = 0,// 高峰营运班次
  309 + dgServiceBc = 0,// 低谷营运班次
  310 + gfAvgTzjx = 0.0,// 高峰平均停站间隙
  311 + dgAvgTzjx = 0.0;// 低谷平均停站间隙
  312 + for(var i = 0;i<list.length;i++) {
  313 + if(list[i].bcsj>0) {
  314 + countBc = countBc + 1;
  315 + countGs = countGs + list[i].STOPTIME + list[i].bcsj;
  316 + var nowDate = BaseFun.getDateTime(list[i].fcsj);
  317 + if((BaseFun.isgfsjd($_GlobalGraph.configuration.dataMap.zgfsjd[0].st,$_GlobalGraph.configuration.dataMap.zgfsjd[0].ed,nowDate) ||
  318 + BaseFun.isgfsjd($_GlobalGraph.configuration.dataMap.wgfsjd[0].st,$_GlobalGraph.configuration.dataMap.wgfsjd[0].ed,nowDate)) &&
  319 + (list[i].bcType == $_GlobalGraph.configuration.dataMap.bcTypeArr.normal ||
  320 + list[i].bcType == $_GlobalGraph.configuration.dataMap.bcTypeArr.region ||
  321 + list[i].bcType == $_GlobalGraph.configuration.dataMap.bcTypeArr.major)) {
  322 + gfServiceBc = gfServiceBc + 1;
  323 + gfAvgTzjx = gfAvgTzjx + list[i].STOPTIME;
  324 + } else if((!BaseFun.isgfsjd($_GlobalGraph.configuration.dataMap.zgfsjd[0].st,$_GlobalGraph.configuration.dataMap.zgfsjd[0].ed,nowDate) ||
  325 + !BaseFun.isgfsjd($_GlobalGraph.configuration.dataMap.wgfsjd[0].st,$_GlobalGraph.configuration.dataMap.wgfsjd[0].ed,nowDate)) &&
  326 + (list[i].bcType == $_GlobalGraph.configuration.dataMap.bcTypeArr.normal ||
  327 + list[i].bcType == $_GlobalGraph.configuration.dataMap.bcTypeArr.region ||
  328 + list[i].bcType == $_GlobalGraph.configuration.dataMap.bcTypeArr.major)){
  329 + dgServiceBc = dgServiceBc + 1;
  330 + dgAvgTzjx = dgAvgTzjx + list[i].STOPTIME;
  331 + }
  332 + if(list[i].bcType == $_GlobalGraph.configuration.dataMap.bcTypeArr.normal ||
  333 + list[i].bcType == $_GlobalGraph.configuration.dataMap.bcTypeArr.region ||
  334 + list[i].bcType == $_GlobalGraph.configuration.dataMap.bcTypeArr.major) {
  335 + serviceBc = serviceBc + 1;
  336 + serviceLc = serviceLc + list[i].jhlc;
  337 + servicesj = servicesj + list[i].bcsj;
  338 + avgTzjx = avgTzjx + list[i].STOPTIME;
  339 + }else if(list[i].bcType == $_GlobalGraph.configuration.dataMap.bcTypeArr.venting) {
  340 + ksBc = ksBc +1;
  341 + ksLc = ksLc + list[i].jhlc;
  342 + }else if(list[i].bcType == $_GlobalGraph.configuration.dataMap.bcTypeArr.in_) {
  343 + jcbc = jcbc +1;
  344 + jcsj = jcsj + list[i].bcsj;
  345 + }else if(list[i].bcType == $_GlobalGraph.configuration.dataMap.bcTypeArr.out) {
  346 + ccbc = ccbc +1;
  347 + ccsj = ccsj + list[i].bcsj;
  348 + }else if(list[i].bcType == $_GlobalGraph.configuration.dataMap.bcTypeArr.cf) {
  349 + cfbc = cfbc +1;
  350 + cfsj = cfsj + list[i].bcsj;
  351 + }else if(list[i].bcType == $_GlobalGraph.configuration.dataMap.bcTypeArr.bd ||
  352 + list[i].bcType == $_GlobalGraph.configuration.dataMap.bcTypeArr.lc ) {
  353 + zwlbbc = zwlbbc +1;
  354 + zwlbsj = zwlbsj + list[i].bcsj;
  355 + }
  356 + }
  357 + }
  358 + dgAvgTzjx = dgAvgTzjx/dgServiceBc;
  359 + gfAvgTzjx = gfAvgTzjx/gfServiceBc;
  360 + avgTzjx = avgTzjx/dgServiceBc;
  361 + var countDate = [{'name':'总班次(包括进出场、吃饭时间、早晚例保、营运且班次时间大于零的班次)','value':countBc},
  362 + {'name':'进场总班次(包括进场且班次时间大于零的班次)','value':jcbc},
  363 + {'name':'出场总班次(包括进场且班次时间大于零的班次)','value':ccbc},
  364 + {'name':'吃饭总班次(包括吃饭且班次时间大于零的班次)','value':cfbc},
  365 + {'name':'早晚例保总班次(包括早晚例保且时间大于零的班次)','value':zwlbbc},
  366 + {'name':'营运总班次(包括正常、区间、放大站且班次时间大于零班次)','value':serviceBc},
  367 + {'name':'进场总时间(包括进场班次且班次时间大于零)','value':parseFloat((jcsj/60).toFixed(2)) + ' 小时'},
  368 + {'name':'出场总时间(包括进场班次且班次时间大于零)','value':parseFloat((ccsj/60).toFixed(2)) + ' 小时'},
  369 + {'name':'吃饭总时间(包括吃饭班次且班次时间大于零)','value':parseFloat((cfsj/60).toFixed(2)) + ' 小时'},
  370 + {'name':'早晚例保总时间(包括早晚例保班次且时间大于零的)','value':parseFloat((zwlbsj/60).toFixed(2)) + ' 小时'},
  371 + {'name':'营运班次总时间(包括正常、区间、放大站且班次时间大于零)','value':parseFloat((servicesj/60).toFixed(2)) + ' 小时'},
  372 + {'name':'总工时(包括进出场、吃饭时间、早晚例保、营运班次时间)','value': parseFloat((countGs/60).toFixed(2)) + ' 小时'},
  373 + {'name':'空驶班次(包括直放班次)','value':ksBc},
  374 + {'name':'营运里程(包括正常、区间、放大站里程)','value':serviceLc + ' 公里'},
  375 + {'name':'空驶里程(包括直放里程)','value':ksLc + ' 公里'},
  376 + {'name':'平均停站时间(营运班次停站时间总和/营运总班次)','value':parseInt(avgTzjx) + ' 分钟' },
  377 + {'name':'高峰营运班次(包括早晚高峰时段的正常、区间、放大站班次)','value':gfServiceBc},
  378 + {'name':'低谷营运班次(包括低谷时段的正常、区间、放大站班次)','value':dgServiceBc},
  379 + {'name':'高峰平均停站间隙(高峰营运班次停站时间总和/高峰营运班次总和)','value':parseInt(gfAvgTzjx) + ' 分钟'},
  380 + {'name':'低谷平均停站间隙(低谷营运班次停站时间总和/低谷营运班次总和)','value':parseInt(dgAvgTzjx) + ' 分钟'},
  381 + {'name':'综合评估','value':3}];
  382 + // 弹出层mobal页面
  383 + $.get('/pages/base/timesmodel/countadd.html', function(m){
  384 + $(pjaxContainer).append(m);
  385 + // 规定被选元素要触发的事件。可以使自定义事件(使用 bind() 函数来附加),或者任何标准事件。
  386 + $('#countadd_mobal').trigger('countAddMobal.show',[countDate]);
  387 + });
  388 + });
  389 +/************************************************************************************************************************************************/
  390 +
  391 +/**
285 392 * @description : (TODO)获取路牌对应的班次数(这里的班次不包括早晚例保班次、吃饭时间)
286 393 *
287 394 * @params : [a1--班次数组;a2--路牌数组]
... ...
src/main/resources/static/pages/base/timesmodel/js/raty/lib/img/cancel-off.png 0 → 100644

649 Bytes

src/main/resources/static/pages/base/timesmodel/js/raty/lib/img/cancel-on.png 0 → 100644

715 Bytes

src/main/resources/static/pages/base/timesmodel/js/raty/lib/img/star-half.png 0 → 100644

667 Bytes

src/main/resources/static/pages/base/timesmodel/js/raty/lib/img/star-off.png 0 → 100644

652 Bytes

src/main/resources/static/pages/base/timesmodel/js/raty/lib/img/star-on.png 0 → 100644

631 Bytes

src/main/resources/static/pages/base/timesmodel/js/raty/lib/jquery.raty.js 0 → 100644
  1 +/*!
  2 + * jQuery Raty - A Star Rating Plugin
  3 + * ------------------------------------------------------------------
  4 + *
  5 + * jQuery Raty is a plugin that generates a customizable star rating.
  6 + *
  7 + * Licensed under The MIT License
  8 + *
  9 + * @version 2.5.2
  10 + * @since 2010.06.11
  11 + * @author Washington Botelho
  12 + * @documentation wbotelhos.com/raty
  13 + *
  14 + * ------------------------------------------------------------------
  15 + *
  16 + * <div id="star"></div>
  17 + *
  18 + * $('#star').raty();
  19 + *
  20 + */
  21 +
  22 +;(function($) {
  23 +
  24 + var methods = {
  25 + init: function(settings) {
  26 + return this.each(function() {
  27 + methods.destroy.call(this);
  28 +
  29 + this.opt = $.extend(true, {}, $.fn.raty.defaults, settings);
  30 +
  31 + var that = $(this),
  32 + inits = ['number', 'readOnly', 'score', 'scoreName'];
  33 +
  34 + methods._callback.call(this, inits);
  35 +
  36 + if (this.opt.precision) {
  37 + methods._adjustPrecision.call(this);
  38 + }
  39 +
  40 + this.opt.number = methods._between(this.opt.number, 0, this.opt.numberMax)
  41 +
  42 + this.opt.path = this.opt.path || '';
  43 +
  44 + if (this.opt.path && this.opt.path.slice(this.opt.path.length - 1, this.opt.path.length) !== '/') {
  45 + this.opt.path += '/';
  46 + }
  47 +
  48 + this.stars = methods._createStars.call(this);
  49 + this.score = methods._createScore.call(this);
  50 +
  51 + methods._apply.call(this, this.opt.score);
  52 +
  53 + var space = this.opt.space ? 4 : 0,
  54 + width = this.opt.width || (this.opt.number * this.opt.size + this.opt.number * space);
  55 +
  56 + if (this.opt.cancel) {
  57 + this.cancel = methods._createCancel.call(this);
  58 +
  59 + width += (this.opt.size + space);
  60 + }
  61 +
  62 + if (this.opt.readOnly) {
  63 + methods._lock.call(this);
  64 + } else {
  65 + that.css('cursor', 'pointer');
  66 + methods._binds.call(this);
  67 + }
  68 +
  69 + if (this.opt.width !== false) {
  70 + that.css('width', width);
  71 + }
  72 +
  73 + methods._target.call(this, this.opt.score);
  74 +
  75 + that.data({ 'settings': this.opt, 'raty': true });
  76 + });
  77 + }, _adjustPrecision: function() {
  78 + this.opt.targetType = 'score';
  79 + this.opt.half = true;
  80 + }, _apply: function(score) {
  81 + if (score && score > 0) {
  82 + score = methods._between(score, 0, this.opt.number);
  83 + this.score.val(score);
  84 + }
  85 +
  86 + methods._fill.call(this, score);
  87 +
  88 + if (score) {
  89 + methods._roundStars.call(this, score);
  90 + }
  91 + }, _between: function(value, min, max) {
  92 + return Math.min(Math.max(parseFloat(value), min), max);
  93 + }, _binds: function() {
  94 + if (this.cancel) {
  95 + methods._bindCancel.call(this);
  96 + }
  97 +
  98 + methods._bindClick.call(this);
  99 + methods._bindOut.call(this);
  100 + methods._bindOver.call(this);
  101 + }, _bindCancel: function() {
  102 + methods._bindClickCancel.call(this);
  103 + methods._bindOutCancel.call(this);
  104 + methods._bindOverCancel.call(this);
  105 + }, _bindClick: function() {
  106 + var self = this,
  107 + that = $(self);
  108 +
  109 + self.stars.on('click.raty', function(evt) {
  110 + self.score.val((self.opt.half || self.opt.precision) ? that.data('score') : this.alt);
  111 +
  112 + if (self.opt.click) {
  113 + self.opt.click.call(self, parseFloat(self.score.val()), evt);
  114 + }
  115 + });
  116 + }, _bindClickCancel: function() {
  117 + var self = this;
  118 +
  119 + self.cancel.on('click.raty', function(evt) {
  120 + self.score.removeAttr('value');
  121 +
  122 + if (self.opt.click) {
  123 + self.opt.click.call(self, null, evt);
  124 + }
  125 + });
  126 + }, _bindOut: function() {
  127 + var self = this;
  128 +
  129 + $(this).on('mouseleave.raty', function(evt) {
  130 + var score = parseFloat(self.score.val()) || undefined;
  131 +
  132 + methods._apply.call(self, score);
  133 + methods._target.call(self, score, evt);
  134 +
  135 + if (self.opt.mouseout) {
  136 + self.opt.mouseout.call(self, score, evt);
  137 + }
  138 + });
  139 + }, _bindOutCancel: function() {
  140 + var self = this;
  141 +
  142 + self.cancel.on('mouseleave.raty', function(evt) {
  143 + $(this).attr('src', self.opt.path + self.opt.cancelOff);
  144 +
  145 + if (self.opt.mouseout) {
  146 + self.opt.mouseout.call(self, self.score.val() || null, evt);
  147 + }
  148 + });
  149 + }, _bindOverCancel: function() {
  150 + var self = this;
  151 +
  152 + self.cancel.on('mouseover.raty', function(evt) {
  153 + $(this).attr('src', self.opt.path + self.opt.cancelOn);
  154 +
  155 + self.stars.attr('src', self.opt.path + self.opt.starOff);
  156 +
  157 + methods._target.call(self, null, evt);
  158 +
  159 + if (self.opt.mouseover) {
  160 + self.opt.mouseover.call(self, null);
  161 + }
  162 + });
  163 + }, _bindOver: function() {
  164 + var self = this,
  165 + that = $(self),
  166 + action = self.opt.half ? 'mousemove.raty' : 'mouseover.raty';
  167 +
  168 + self.stars.on(action, function(evt) {
  169 + var score = parseInt(this.alt, 10);
  170 +
  171 + if (self.opt.half) {
  172 + var position = parseFloat((evt.pageX - $(this).offset().left) / self.opt.size),
  173 + plus = (position > .5) ? 1 : .5;
  174 +
  175 + score = score - 1 + plus;
  176 +
  177 + methods._fill.call(self, score);
  178 +
  179 + if (self.opt.precision) {
  180 + score = score - plus + position;
  181 + }
  182 +
  183 + methods._roundStars.call(self, score);
  184 +
  185 + that.data('score', score);
  186 + } else {
  187 + methods._fill.call(self, score);
  188 + }
  189 +
  190 + methods._target.call(self, score, evt);
  191 +
  192 + if (self.opt.mouseover) {
  193 + self.opt.mouseover.call(self, score, evt);
  194 + }
  195 + });
  196 + }, _callback: function(options) {
  197 + for (i in options) {
  198 + if (typeof this.opt[options[i]] === 'function') {
  199 + this.opt[options[i]] = this.opt[options[i]].call(this);
  200 + }
  201 + }
  202 + }, _createCancel: function() {
  203 + var that = $(this),
  204 + icon = this.opt.path + this.opt.cancelOff,
  205 + cancel = $('<img />', { src: icon, alt: 'x', title: this.opt.cancelHint, 'class': 'raty-cancel' });
  206 +
  207 + if (this.opt.cancelPlace == 'left') {
  208 + that.prepend('&#160;').prepend(cancel);
  209 + } else {
  210 + that.append('&#160;').append(cancel);
  211 + }
  212 +
  213 + return cancel;
  214 + }, _createScore: function() {
  215 + return $('<input />', { type: 'hidden', name: this.opt.scoreName }).appendTo(this);
  216 + }, _createStars: function() {
  217 + var that = $(this);
  218 +
  219 + for (var i = 1; i <= this.opt.number; i++) {
  220 + var title = methods._getHint.call(this, i),
  221 + icon = (this.opt.score && this.opt.score >= i) ? 'starOn' : 'starOff';
  222 +
  223 + icon = this.opt.path + this.opt[icon];
  224 +
  225 + $('<img />', { src : icon, alt: i, title: title }).appendTo(this);
  226 +
  227 + if (this.opt.space) {
  228 + that.append((i < this.opt.number) ? '&#160;' : '');
  229 + }
  230 + }
  231 +
  232 + return that.children('img');
  233 + }, _error: function(message) {
  234 + $(this).html(message);
  235 +
  236 + $.error(message);
  237 + }, _fill: function(score) {
  238 + var self = this,
  239 + hash = 0;
  240 +
  241 + for (var i = 1; i <= self.stars.length; i++) {
  242 + var star = self.stars.eq(i - 1),
  243 + select = self.opt.single ? (i == score) : (i <= score);
  244 +
  245 + if (self.opt.iconRange && self.opt.iconRange.length > hash) {
  246 + var irange = self.opt.iconRange[hash],
  247 + on = irange.on || self.opt.starOn,
  248 + off = irange.off || self.opt.starOff,
  249 + icon = select ? on : off;
  250 +
  251 + if (i <= irange.range) {
  252 + star.attr('src', self.opt.path + icon);
  253 + }
  254 +
  255 + if (i == irange.range) {
  256 + hash++;
  257 + }
  258 + } else {
  259 + var icon = select ? 'starOn' : 'starOff';
  260 +
  261 + star.attr('src', this.opt.path + this.opt[icon]);
  262 + }
  263 + }
  264 + }, _getHint: function(score) {
  265 + var hint = this.opt.hints[score - 1];
  266 + return (hint === '') ? '' : (hint || score);
  267 + }, _lock: function() {
  268 + var score = parseInt(this.score.val(), 10), // TODO: 3.1 >> [['1'], ['2'], ['3', '.1', '.2']]
  269 + hint = score ? methods._getHint.call(this, score) : this.opt.noRatedMsg;
  270 +
  271 + $(this).data('readonly', true).css('cursor', '').attr('title', hint);
  272 +
  273 + this.score.attr('readonly', 'readonly');
  274 + this.stars.attr('title', hint);
  275 +
  276 + if (this.cancel) {
  277 + this.cancel.hide();
  278 + }
  279 + }, _roundStars: function(score) {
  280 + var rest = (score - Math.floor(score)).toFixed(2);
  281 +
  282 + if (rest > this.opt.round.down) {
  283 + var icon = 'starOn'; // Up: [x.76 .. x.99]
  284 +
  285 + if (this.opt.halfShow && rest < this.opt.round.up) { // Half: [x.26 .. x.75]
  286 + icon = 'starHalf';
  287 + } else if (rest < this.opt.round.full) { // Down: [x.00 .. x.5]
  288 + icon = 'starOff';
  289 + }
  290 +
  291 + this.stars.eq(Math.ceil(score) - 1).attr('src', this.opt.path + this.opt[icon]);
  292 + } // Full down: [x.00 .. x.25]
  293 + }, _target: function(score, evt) {
  294 + if (this.opt.target) {
  295 + var target = $(this.opt.target);
  296 +
  297 + if (target.length === 0) {
  298 + methods._error.call(this, 'Target selector invalid or missing!');
  299 + }
  300 +
  301 + if (this.opt.targetFormat.indexOf('{score}') < 0) {
  302 + methods._error.call(this, 'Template "{score}" missing!');
  303 + }
  304 +
  305 + var mouseover = evt && evt.type == 'mouseover';
  306 +
  307 + if (score === undefined) {
  308 + score = this.opt.targetText;
  309 + } else if (score === null) {
  310 + score = mouseover ? this.opt.cancelHint : this.opt.targetText;
  311 + } else {
  312 + if (this.opt.targetType == 'hint') {
  313 + score = methods._getHint.call(this, Math.ceil(score));
  314 + } else if (this.opt.precision) {
  315 + score = parseFloat(score).toFixed(1);
  316 + }
  317 +
  318 + if (!mouseover && !this.opt.targetKeep) {
  319 + score = this.opt.targetText;
  320 + }
  321 + }
  322 +
  323 + if (score) {
  324 + score = this.opt.targetFormat.toString().replace('{score}', score);
  325 + }
  326 +
  327 + if (target.is(':input')) {
  328 + target.val(score);
  329 + } else {
  330 + target.html(score);
  331 + }
  332 + }
  333 + }, _unlock: function() {
  334 + $(this).data('readonly', false).css('cursor', 'pointer').removeAttr('title');
  335 +
  336 + this.score.removeAttr('readonly', 'readonly');
  337 +
  338 + for (var i = 0; i < this.opt.number; i++) {
  339 + this.stars.eq(i).attr('title', methods._getHint.call(this, i + 1));
  340 + }
  341 +
  342 + if (this.cancel) {
  343 + this.cancel.css('display', '');
  344 + }
  345 + }, cancel: function(click) {
  346 + return this.each(function() {
  347 + if ($(this).data('readonly') !== true) {
  348 + methods[click ? 'click' : 'score'].call(this, null);
  349 + this.score.removeAttr('value');
  350 + }
  351 + });
  352 + }, click: function(score) {
  353 + return $(this).each(function() {
  354 + if ($(this).data('readonly') !== true) {
  355 + methods._apply.call(this, score);
  356 +
  357 + if (!this.opt.click) {
  358 + methods._error.call(this, 'You must add the "click: function(score, evt) { }" callback.');
  359 + }
  360 +
  361 + this.opt.click.call(this, score, { type: 'click' });
  362 +
  363 + methods._target.call(this, score);
  364 + }
  365 + });
  366 + }, destroy: function() {
  367 + return $(this).each(function() {
  368 + var that = $(this),
  369 + raw = that.data('raw');
  370 +
  371 + if (raw) {
  372 + that.off('.raty').empty().css({ cursor: raw.style.cursor, width: raw.style.width }).removeData('readonly');
  373 + } else {
  374 + that.data('raw', that.clone()[0]);
  375 + }
  376 + });
  377 + }, getScore: function() {
  378 + var score = [],
  379 + value ;
  380 +
  381 + $(this).each(function() {
  382 + value = this.score.val();
  383 +
  384 + score.push(value ? parseFloat(value) : undefined);
  385 + });
  386 +
  387 + return (score.length > 1) ? score : score[0];
  388 + }, readOnly: function(readonly) {
  389 + return this.each(function() {
  390 + var that = $(this);
  391 +
  392 + if (that.data('readonly') !== readonly) {
  393 + if (readonly) {
  394 + that.off('.raty').children('img').off('.raty');
  395 +
  396 + methods._lock.call(this);
  397 + } else {
  398 + methods._binds.call(this);
  399 + methods._unlock.call(this);
  400 + }
  401 +
  402 + that.data('readonly', readonly);
  403 + }
  404 + });
  405 + }, reload: function() {
  406 + return methods.set.call(this, {});
  407 + }, score: function() {
  408 + return arguments.length ? methods.setScore.apply(this, arguments) : methods.getScore.call(this);
  409 + }, set: function(settings) {
  410 + return this.each(function() {
  411 + var that = $(this),
  412 + actual = that.data('settings'),
  413 + news = $.extend({}, actual, settings);
  414 +
  415 + that.raty(news);
  416 + });
  417 + }, setScore: function(score) {
  418 + return $(this).each(function() {
  419 + if ($(this).data('readonly') !== true) {
  420 + methods._apply.call(this, score);
  421 + methods._target.call(this, score);
  422 + }
  423 + });
  424 + }
  425 + };
  426 +
  427 + $.fn.raty = function(method) {
  428 + if (methods[method]) {
  429 + return methods[method].apply(this, Array.prototype.slice.call(arguments, 1));
  430 + } else if (typeof method === 'object' || !method) {
  431 + return methods.init.apply(this, arguments);
  432 + } else {
  433 + $.error('Method ' + method + ' does not exist!');
  434 + }
  435 + };
  436 +
  437 + $.fn.raty.defaults = {
  438 + cancel : false,
  439 + cancelHint : 'Cancel this rating!',
  440 + cancelOff : 'cancel-off.png',
  441 + cancelOn : 'cancel-on.png',
  442 + cancelPlace : 'left',
  443 + click : undefined,
  444 + half : false,
  445 + halfShow : true,
  446 + hints : ['bad', 'poor', 'regular', 'good', 'gorgeous'],
  447 + iconRange : undefined,
  448 + mouseout : undefined,
  449 + mouseover : undefined,
  450 + noRatedMsg : 'Not rated yet!',
  451 + number : 5,
  452 + numberMax : 20,
  453 + path : 'js/raty/lib/img/',
  454 + precision : false,
  455 + readOnly : false,
  456 + round : { down: .25, full: .6, up: .76 },
  457 + score : undefined,
  458 + scoreName : 'score',
  459 + single : false,
  460 + size : 16,
  461 + space : true,
  462 + starHalf : 'star-half.png',
  463 + starOff : 'star-off.png',
  464 + starOn : 'star-on.png',
  465 + target : undefined,
  466 + targetFormat : '{score}',
  467 + targetKeep : false,
  468 + targetText : '',
  469 + targetType : 'hint',
  470 + width : undefined
  471 + };
  472 +
  473 +})(jQuery);
... ...
src/main/resources/static/pages/base/timesmodel/js/raty/lib/jquery.raty.min.js 0 → 100644
  1 +/*!
  2 + * jQuery Raty - A Star Rating Plugin
  3 + *
  4 + * Licensed under The MIT License
  5 + *
  6 + * @version 2.5.2
  7 + * @author Washington Botelho
  8 + * @documentation wbotelhos.com/raty
  9 + *
  10 + */
  11 +
  12 +;(function(b){var a={init:function(c){return this.each(function(){a.destroy.call(this);this.opt=b.extend(true,{},b.fn.raty.defaults,c);var e=b(this),g=["number","readOnly","score","scoreName"];a._callback.call(this,g);if(this.opt.precision){a._adjustPrecision.call(this);}this.opt.number=a._between(this.opt.number,0,this.opt.numberMax);this.opt.path=this.opt.path||"";if(this.opt.path&&this.opt.path.slice(this.opt.path.length-1,this.opt.path.length)!=="/"){this.opt.path+="/";}this.stars=a._createStars.call(this);this.score=a._createScore.call(this);a._apply.call(this,this.opt.score);var f=this.opt.space?4:0,d=this.opt.width||(this.opt.number*this.opt.size+this.opt.number*f);if(this.opt.cancel){this.cancel=a._createCancel.call(this);d+=(this.opt.size+f);}if(this.opt.readOnly){a._lock.call(this);}else{e.css("cursor","pointer");a._binds.call(this);}if(this.opt.width!==false){e.css("width",d);}a._target.call(this,this.opt.score);e.data({settings:this.opt,raty:true});});},_adjustPrecision:function(){this.opt.targetType="score";this.opt.half=true;},_apply:function(c){if(c&&c>0){c=a._between(c,0,this.opt.number);this.score.val(c);}a._fill.call(this,c);if(c){a._roundStars.call(this,c);}},_between:function(e,d,c){return Math.min(Math.max(parseFloat(e),d),c);},_binds:function(){if(this.cancel){a._bindCancel.call(this);}a._bindClick.call(this);a._bindOut.call(this);a._bindOver.call(this);},_bindCancel:function(){a._bindClickCancel.call(this);a._bindOutCancel.call(this);a._bindOverCancel.call(this);},_bindClick:function(){var c=this,d=b(c);c.stars.on("click.raty",function(e){c.score.val((c.opt.half||c.opt.precision)?d.data("score"):this.alt);if(c.opt.click){c.opt.click.call(c,parseFloat(c.score.val()),e);}});},_bindClickCancel:function(){var c=this;c.cancel.on("click.raty",function(d){c.score.removeAttr("value");if(c.opt.click){c.opt.click.call(c,null,d);}});},_bindOut:function(){var c=this;b(this).on("mouseleave.raty",function(d){var e=parseFloat(c.score.val())||undefined;a._apply.call(c,e);a._target.call(c,e,d);if(c.opt.mouseout){c.opt.mouseout.call(c,e,d);}});},_bindOutCancel:function(){var c=this;c.cancel.on("mouseleave.raty",function(d){b(this).attr("src",c.opt.path+c.opt.cancelOff);if(c.opt.mouseout){c.opt.mouseout.call(c,c.score.val()||null,d);}});},_bindOverCancel:function(){var c=this;c.cancel.on("mouseover.raty",function(d){b(this).attr("src",c.opt.path+c.opt.cancelOn);c.stars.attr("src",c.opt.path+c.opt.starOff);a._target.call(c,null,d);if(c.opt.mouseover){c.opt.mouseover.call(c,null);}});},_bindOver:function(){var c=this,d=b(c),e=c.opt.half?"mousemove.raty":"mouseover.raty";c.stars.on(e,function(g){var h=parseInt(this.alt,10);if(c.opt.half){var f=parseFloat((g.pageX-b(this).offset().left)/c.opt.size),j=(f>0.5)?1:0.5;h=h-1+j;a._fill.call(c,h);if(c.opt.precision){h=h-j+f;}a._roundStars.call(c,h);d.data("score",h);}else{a._fill.call(c,h);}a._target.call(c,h,g);if(c.opt.mouseover){c.opt.mouseover.call(c,h,g);}});},_callback:function(c){for(i in c){if(typeof this.opt[c[i]]==="function"){this.opt[c[i]]=this.opt[c[i]].call(this);}}},_createCancel:function(){var e=b(this),c=this.opt.path+this.opt.cancelOff,d=b("<img />",{src:c,alt:"x",title:this.opt.cancelHint,"class":"raty-cancel"});if(this.opt.cancelPlace=="left"){e.prepend("&#160;").prepend(d);}else{e.append("&#160;").append(d);}return d;},_createScore:function(){return b("<input />",{type:"hidden",name:this.opt.scoreName}).appendTo(this);},_createStars:function(){var e=b(this);for(var c=1;c<=this.opt.number;c++){var f=a._getHint.call(this,c),d=(this.opt.score&&this.opt.score>=c)?"starOn":"starOff";d=this.opt.path+this.opt[d];b("<img />",{src:d,alt:c,title:f}).appendTo(this);if(this.opt.space){e.append((c<this.opt.number)?"&#160;":"");}}return e.children("img");},_error:function(c){b(this).html(c);b.error(c);},_fill:function(d){var m=this,e=0;for(var f=1;f<=m.stars.length;f++){var g=m.stars.eq(f-1),l=m.opt.single?(f==d):(f<=d);if(m.opt.iconRange&&m.opt.iconRange.length>e){var j=m.opt.iconRange[e],h=j.on||m.opt.starOn,c=j.off||m.opt.starOff,k=l?h:c;if(f<=j.range){g.attr("src",m.opt.path+k);}if(f==j.range){e++;}}else{var k=l?"starOn":"starOff";g.attr("src",this.opt.path+this.opt[k]);}}},_getHint:function(d){var c=this.opt.hints[d-1];return(c==="")?"":(c||d);},_lock:function(){var d=parseInt(this.score.val(),10),c=d?a._getHint.call(this,d):this.opt.noRatedMsg;b(this).data("readonly",true).css("cursor","").attr("title",c);this.score.attr("readonly","readonly");this.stars.attr("title",c);if(this.cancel){this.cancel.hide();}},_roundStars:function(e){var d=(e-Math.floor(e)).toFixed(2);if(d>this.opt.round.down){var c="starOn";if(this.opt.halfShow&&d<this.opt.round.up){c="starHalf";}else{if(d<this.opt.round.full){c="starOff";}}this.stars.eq(Math.ceil(e)-1).attr("src",this.opt.path+this.opt[c]);}},_target:function(f,d){if(this.opt.target){var e=b(this.opt.target);if(e.length===0){a._error.call(this,"Target selector invalid or missing!");}if(this.opt.targetFormat.indexOf("{score}")<0){a._error.call(this,'Template "{score}" missing!');}var c=d&&d.type=="mouseover";if(f===undefined){f=this.opt.targetText;}else{if(f===null){f=c?this.opt.cancelHint:this.opt.targetText;}else{if(this.opt.targetType=="hint"){f=a._getHint.call(this,Math.ceil(f));}else{if(this.opt.precision){f=parseFloat(f).toFixed(1);}}if(!c&&!this.opt.targetKeep){f=this.opt.targetText;}}}if(f){f=this.opt.targetFormat.toString().replace("{score}",f);}if(e.is(":input")){e.val(f);}else{e.html(f);}}},_unlock:function(){b(this).data("readonly",false).css("cursor","pointer").removeAttr("title");this.score.removeAttr("readonly","readonly");for(var c=0;c<this.opt.number;c++){this.stars.eq(c).attr("title",a._getHint.call(this,c+1));}if(this.cancel){this.cancel.css("display","");}},cancel:function(c){return this.each(function(){if(b(this).data("readonly")!==true){a[c?"click":"score"].call(this,null);this.score.removeAttr("value");}});},click:function(c){return b(this).each(function(){if(b(this).data("readonly")!==true){a._apply.call(this,c);if(!this.opt.click){a._error.call(this,'You must add the "click: function(score, evt) { }" callback.');}this.opt.click.call(this,c,{type:"click"});a._target.call(this,c);}});},destroy:function(){return b(this).each(function(){var d=b(this),c=d.data("raw");if(c){d.off(".raty").empty().css({cursor:c.style.cursor,width:c.style.width}).removeData("readonly");}else{d.data("raw",d.clone()[0]);}});},getScore:function(){var d=[],c;b(this).each(function(){c=this.score.val();d.push(c?parseFloat(c):undefined);});return(d.length>1)?d:d[0];},readOnly:function(c){return this.each(function(){var d=b(this);if(d.data("readonly")!==c){if(c){d.off(".raty").children("img").off(".raty");a._lock.call(this);}else{a._binds.call(this);a._unlock.call(this);}d.data("readonly",c);}});},reload:function(){return a.set.call(this,{});},score:function(){return arguments.length?a.setScore.apply(this,arguments):a.getScore.call(this);},set:function(c){return this.each(function(){var e=b(this),f=e.data("settings"),d=b.extend({},f,c);e.raty(d);});},setScore:function(c){return b(this).each(function(){if(b(this).data("readonly")!==true){a._apply.call(this,c);a._target.call(this,c);}});}};b.fn.raty=function(c){if(a[c]){return a[c].apply(this,Array.prototype.slice.call(arguments,1));}else{if(typeof c==="object"||!c){return a.init.apply(this,arguments);}else{b.error("Method "+c+" does not exist!");}}};b.fn.raty.defaults={cancel:false,cancelHint:"Cancel this rating!",cancelOff:"cancel-off.png",cancelOn:"cancel-on.png",cancelPlace:"left",click:undefined,half:false,halfShow:true,hints:["bad","poor","regular","good","gorgeous"],iconRange:undefined,mouseout:undefined,mouseover:undefined,noRatedMsg:"Not rated yet!",number:5,numberMax:20,path:"",precision:false,readOnly:false,round:{down:0.25,full:0.6,up:0.76},score:undefined,scoreName:"score",single:false,size:16,space:true,starHalf:"star-half.png",starOff:"star-off.png",starOn:"star-on.png",target:undefined,targetFormat:"{score}",targetKeep:false,targetText:"",targetType:"hint",width:undefined};})(jQuery);
... ...
src/main/resources/static/pages/forms/mould/list.xls
No preview for this file type
src/main/resources/static/pages/forms/mould/listDl.xls
No preview for this file type
src/main/resources/static/pages/scheduleApp/module/common/dts2/ttinfotable/saTimeTable.js
... ... @@ -97,8 +97,8 @@ angular.module(&#39;ScheduleApp&#39;).factory(
97 97 }
98 98 }
99 99 } else {
100   - this.isValidInfo = true;
101   - return true;
  100 + this.isValidInfo = false;
  101 + return false;
102 102 }
103 103 };
104 104  
... ...
src/main/resources/static/pages/scheduleApp/module/common/dts2/ttinfotable/saTimeTableTemplate.html
... ... @@ -324,7 +324,7 @@
324 324 ng-dblclick="$saTimeTableCtrl.$$cell_dbclick(rowIndex, colIndex, cell)"
325 325 ng-class="{
326 326 lpName: !cell.ttdid,
327   - error: cell.invalidFlag,
  327 + error: cell.isValidInfo,
328 328 active: cell.sel,
329 329 region: cell.bc_type == 'region',
330 330 isfb: cell.isfb
... ...
src/main/resources/static/pages/scheduleApp/module/common/prj-common-directive.js
... ... @@ -3795,8 +3795,8 @@ angular.module(&#39;ScheduleApp&#39;).factory(
3795 3795 }
3796 3796 }
3797 3797 } else {
3798   - this.isValidInfo = true;
3799   - return true;
  3798 + this.isValidInfo = false;
  3799 + return false;
3800 3800 }
3801 3801 };
3802 3802  
... ...
src/main/resources/static/pages/scheduleApp/module/core/schedulePlanManage/info/list_info.html
... ... @@ -14,8 +14,9 @@
14 14 <th style="width: 80px;">班次类型</th>
15 15 <th style="width: 80px;">上下行</th>
16 16 <th style="width: 80px;">发车时间</th>
17   - <th style="width: 100px;">起点站</th>
18   - <th style="width: 100px;">终点站</th>
  17 + <th style="width: 80px;">起点站</th>
  18 + <th style="width: 80px;">终点站</th>
  19 + <th style="width: 60px">备注</th>
19 20 <th style="width: 100%">时刻表</th>
20 21 <th style="width: 90px;">修改人</th>
21 22 <th style="width: 90px;">修改时间</th>
... ... @@ -110,6 +111,15 @@
110 111 <a href="#"
111 112 tooltip-animation="false"
112 113 tooltip-placement="top"
  114 + uib-tooltip="{{info.remark}}"
  115 + tooltip-class="headClass">
  116 + {{info.remark}}
  117 + </a>
  118 + </td>
  119 + <td>
  120 + <a href="#"
  121 + tooltip-animation="false"
  122 + tooltip-placement="top"
113 123 uib-tooltip="{{info.ttInfoName}}"
114 124 tooltip-class="headClass">
115 125 {{info.ttInfoName}}
... ...
src/main/resources/static/real_control_v2/js/modal_extend.js
1   -//modal hide remove dom
2   -$(document).on('hide.uk.modal', '.uk-modal', function () {
3   - $(this).remove();
4   -});
5   -
6   -$(document).on('show.uk.modal', '.uk-modal.ct_move_modal', function () {
7   - if($('.uk-modal-dialog', this).hasClass('uk-modal-dialog-blank'))
8   - return;
9   -
10   - /* //临时放过轨迹回放
11   - if($(this).attr('id')=='map-playback-modal')
12   - return;*/
13   -
14   - //计算居中位置
15   - var win = $('body');
16   - var Y = (win.width() - $('.uk-modal-dialog', this).width()) / 2 - 10;
17   - $('.uk-modal-dialog', this).css('top', '50px').css('left', Y + 'px');
18   -});
19   -
20   -var show_modal = function (id, dom) {
21   - $(document.body).append(dom);
22   - return UIkit.modal(id, {
23   - bgclose: false, modal: false
24   - }).show();
25   -};
26   -
27   -var open_modal = function (pageUrl, data, opt) {
28   - $.get(pageUrl, function (dom) {
29   - open_modal_dom(dom, data, opt);
30   - });
31   -};
32   -
33   -var open_modal_dom = function (dom, data, opt) {
34   - if (!$(dom).hasClass('uk-modal')) {
35   - alert('无效的dom片段!');
36   - return;
37   - }
38   - var id = '#' + $(dom).attr('id');
39   -
40   - $(document.body).append(dom);
41   - UIkit.modal(id, opt).show();
42   - //move
43   - if($(id).hasClass('ct_move_modal'))
44   - modal_move($('.uk-modal-header',id));
45   -
46   - if (data)
47   - $(id).trigger('init', data);
48   -};
49   -
50   -var modal_move = function (m_header) {
51   - var _moveFlag;
52   - var _moveObj;
53   - var _offset;
54   - var dict= {};
55   - var win = $('body');
56   -
57   - $(m_header).on('mousedown', function (e) {
58   - console.log('mousedown');
59   - e.preventDefault();
60   - _moveFlag = true;
61   - _moveObj = $(this).parent();
62   - _offset = [
63   - e.clientX - parseFloat(_moveObj.css('left')) - 1,
64   - e.clientY - parseFloat(_moveObj.css('top')) - 1
65   - ];
66   - });
67   -
68   - $(m_header).parents('.uk-modal').mousemove(function (e) {
69   - if(!_moveFlag || !_moveObj)
70   - return;
71   -
72   - var X = e.clientX - _offset[0]
73   - ,Y = e.clientY - _offset[1];
74   -
75   - dict.stX = win.scrollLeft();
76   - dict.stY = win.scrollTop();
77   -
78   - //控制元素不被拖出窗口外
79   - var setRig = win.width() - _moveObj.outerWidth() + dict.stX
80   - ,setBot = win.height() - _moveObj.outerHeight() + dict.stY;
81   - X < dict.stX && (X = dict.stX);
82   - X > setRig && (X = setRig);
83   - Y < dict.stY && (Y = dict.stY);
84   - Y > setBot && (Y = setBot);
85   -
86   - _moveObj.css({
87   - left: X
88   - ,top: Y
89   - });
90   - });
91   - $(window).on('mouseup', function () {
92   - _moveFlag = false;
93   - _moveObj = null;
94   - });
  1 +//modal hide remove dom
  2 +$(document).on('hide.uk.modal', '.uk-modal', function () {
  3 + $(this).remove();
  4 +});
  5 +
  6 +$(document).on('show.uk.modal', '.uk-modal.ct_move_modal', function () {
  7 + if($('.uk-modal-dialog', this).hasClass('uk-modal-dialog-blank'))
  8 + return;
  9 +
  10 + /* //临时放过轨迹回放
  11 + if($(this).attr('id')=='map-playback-modal')
  12 + return;*/
  13 +
  14 + //计算居中位置
  15 + var win = $('body');
  16 + var Y = (win.width() - $('.uk-modal-dialog', this).width()) / 2 - 10;
  17 + $('.uk-modal-dialog', this).css('top', '50px').css('left', Y + 'px');
  18 +});
  19 +
  20 +var show_modal = function (id, dom) {
  21 + $(document.body).append(dom);
  22 + return UIkit.modal(id, {
  23 + bgclose: false, modal: false
  24 + }).show();
  25 +};
  26 +
  27 +var open_modal = function (pageUrl, data, opt) {
  28 + $.get(pageUrl, function (dom) {
  29 + open_modal_dom(dom, data, opt);
  30 + });
  31 +};
  32 +
  33 +var open_modal_dom = function (dom, data, opt) {
  34 + if (!$(dom).hasClass('uk-modal')) {
  35 + alert('无效的dom片段!');
  36 + return;
  37 + }
  38 + var id = '#' + $(dom).attr('id');
  39 +
  40 + $(document.body).append(dom);
  41 + UIkit.modal(id, opt).show();
  42 + //move
  43 + if($(id).hasClass('ct_move_modal'))
  44 + modal_move($('.uk-modal-header',id));
  45 +
  46 + if (data)
  47 + $(id).trigger('init', data);
  48 +};
  49 +
  50 +var modal_move = function (m_header) {
  51 + var _moveFlag;
  52 + var _moveObj;
  53 + var _offset;
  54 + var dict= {};
  55 + var win = $('body');
  56 +
  57 + $(m_header).on('mousedown', function (e) {
  58 + console.log('mousedown');
  59 + e.preventDefault();
  60 + _moveFlag = true;
  61 + _moveObj = $(this).parent();
  62 + _offset = [
  63 + e.clientX - parseFloat(_moveObj.css('left')) - 1,
  64 + e.clientY - parseFloat(_moveObj.css('top')) - 1
  65 + ];
  66 + });
  67 +
  68 + $(m_header).parents('.uk-modal').mousemove(function (e) {
  69 + if(!_moveFlag || !_moveObj)
  70 + return;
  71 +
  72 + var X = e.clientX - _offset[0]
  73 + ,Y = e.clientY - _offset[1];
  74 +
  75 + dict.stX = win.scrollLeft();
  76 + dict.stY = win.scrollTop();
  77 +
  78 + //控制元素不被拖出窗口外
  79 + var setRig = win.width() - _moveObj.outerWidth() + dict.stX
  80 + ,setBot = win.height() - _moveObj.outerHeight() + dict.stY;
  81 + X < dict.stX && (X = dict.stX);
  82 + X > setRig && (X = setRig);
  83 + Y < dict.stY && (Y = dict.stY);
  84 + Y > setBot && (Y = setBot);
  85 +
  86 + _moveObj.css({
  87 + left: X
  88 + ,top: Y
  89 + });
  90 + });
  91 + $(window).on('mouseup', function () {
  92 + _moveFlag = false;
  93 + _moveObj = null;
  94 + });
95 95 };
96 96 \ No newline at end of file
... ...
src/main/resources/static/real_control_v2/js/safe_driv/safeDriv.js
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   - }
  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 44 })();
45 45 \ No newline at end of file
... ...
src/main/resources/static/real_control_v2/mapmonitor/fragments/playback_v2/main.html
... ... @@ -235,18 +235,18 @@
235 235  
236 236 <script id="abnormal_table_cont_temp" type="text/html">
237 237 {{each array as item i}}
238   - <dl>
239   - <dd>
240   - {{if item.abnormalType == 'speed'}}
241   - 超速({{item.speed}})
242   - {{else if item.abnormalType == 'outbound'}}
243   - 越界
244   - {{/if}}
245   - </dd>
246   - <dd>{{item.st_str}}</dd>
247   - <dd>{{item.et_str}}</dd>
248   - <dd></dd>
249   - </dl>
  238 + <dl>
  239 + <dd>
  240 + {{if item.abnormalType == 'speed'}}
  241 + 超速({{item.speed}})
  242 + {{else if item.abnormalType == 'outbound'}}
  243 + 越界
  244 + {{/if}}
  245 + </dd>
  246 + <dd>{{item.st_str}}</dd>
  247 + <dd>{{item.et_str}}</dd>
  248 + <dd></dd>
  249 + </dl>
250 250 {{/each}}
251 251 </script>
252 252 <script>
... ... @@ -335,11 +335,11 @@
335 335  
336 336  
337 337 /*$('[name=nbbm]', f).val('W0A-018');
338   - $('[name=sDate]', f).val('2017-04-06');
339   - $('[name=sTime]', f).val('04:49');
  338 + $('[name=sDate]', f).val('2017-04-06');
  339 + $('[name=sTime]', f).val('04:49');
340 340  
341   - $('[name=eDate]', f).val('2017-04-06');
342   - $('[name=eTime]', f).val('09:49');*/
  341 + $('[name=eDate]', f).val('2017-04-06');
  342 + $('[name=eTime]', f).val('09:49');*/
343 343 //搜索事件
344 344 $('button[type=submit]', f).on('click', search);
345 345 };
... ... @@ -506,7 +506,7 @@
506 506 if (gps['inout_stop'] == 0) {
507 507 //连续进站信号,取第一个
508 508 if(prev && prev['out_ts'] == null
509   - && prev['stopName'] == gps['inout_stop_info'].stopName){
  509 + && prev['stopName'] == gps['inout_stop_info'].stopName){
510 510 return true;
511 511 }
512 512 data.push(createIn(gps));
... ... @@ -603,8 +603,8 @@
603 603 }
604 604 //格式化时间
605 605 $.each(array, function () {
606   - if(this.st)
607   - this.st_str = moment(this.st).format('HH:mm.ss');
  606 + if(this.st)
  607 + this.st_str = moment(this.st).format('HH:mm.ss');
608 608 if(this.et)
609 609 this.et_str = moment(this.et).format('HH:mm.ss');
610 610 });
... ...