Commit 0623d4ae1f17ab2240b44d7f1cb53ef1cbd35f89

Authored by 潘钊
2 parents d1a11954 75925811

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

Showing 28 changed files with 5059 additions and 2461 deletions
src/main/java/com/bsth/controller/excep/SpeedingController.java
@@ -31,10 +31,8 @@ public class SpeedingController extends BaseController<SysUser, Integer>{ @@ -31,10 +31,8 @@ public class SpeedingController extends BaseController<SysUser, Integer>{
31 map.put("pageData","10"); 31 map.put("pageData","10");
32 pageObject=speedingService.Pagequery(map); 32 pageObject=speedingService.Pagequery(map);
33 return pageObject; 33 return pageObject;
34 -  
35 } 34 }
36 35
37 -  
38 @RequestMapping(value = "/getReport", method = RequestMethod.POST) 36 @RequestMapping(value = "/getReport", method = RequestMethod.POST)
39 public Map<String, Object> getReport(@RequestParam Map<String, Object> map) { 37 public Map<String, Object> getReport(@RequestParam Map<String, Object> map) {
40 Map<String, Object> modelMap = new HashMap<String, Object>(); 38 Map<String, Object> modelMap = new HashMap<String, Object>();
src/main/java/com/bsth/controller/report/ReportController.java
@@ -267,4 +267,11 @@ public class ReportController { @@ -267,4 +267,11 @@ public class ReportController {
267 return service.countByList(map); 267 return service.countByList(map);
268 } 268 }
269 269
  270 + @RequestMapping(value="/countBusMileage")
  271 + public List<Map<String,Object>> countBusMileage(@RequestParam Map<String, Object> map){
  272 +
  273 + return service.countByBusList(map);
  274 + }
  275 +
  276 +
270 } 277 }
src/main/java/com/bsth/entity/excep/Speeding.java
@@ -74,6 +74,13 @@ public class Speeding { @@ -74,6 +74,13 @@ public class Speeding {
74 @Transient 74 @Transient
75 private String lpname; 75 private String lpname;
76 76
  77 + //结束时间,单位:秒/s
  78 + @Transient
  79 + private Long endtimestamp;
  80 +
  81 + @Transient
  82 + private String endtimestampDate;
  83 +
77 /** 84 /**
78 * 创建时间 85 * 创建时间
79 */ 86 */
@@ -169,6 +176,14 @@ public class Speeding { @@ -169,6 +176,14 @@ public class Speeding {
169 this.timestampDate = timestampDate; 176 this.timestampDate = timestampDate;
170 } 177 }
171 178
  179 + public String getEndtimestampDate() {
  180 + return endtimestampDate;
  181 + }
  182 +
  183 + public void setEndtimestampDate(String endtimestampDate) {
  184 + this.endtimestampDate = endtimestampDate;
  185 + }
  186 +
172 public String getNbbm() { 187 public String getNbbm() {
173 return nbbm; 188 return nbbm;
174 } 189 }
@@ -193,6 +208,12 @@ public class Speeding { @@ -193,6 +208,12 @@ public class Speeding {
193 this.lpname = lpname; 208 this.lpname = lpname;
194 } 209 }
195 210
  211 + public Long getEndtimestamp() {
  212 + return endtimestamp;
  213 + }
196 214
  215 + public void setEndtimestamp(Long endtimestamp) {
  216 + this.endtimestamp = endtimestamp;
  217 + }
197 218
198 } 219 }
src/main/java/com/bsth/repository/directive/DC0A4Repository.java
1 -package com.bsth.repository.directive;  
2 -  
3 -import com.bsth.entity.directive.DC0_A4;  
4 -import com.bsth.repository.BaseRepository;  
5 -import org.springframework.stereotype.Repository;  
6 -  
7 -/**  
8 - * C0_A4 设备回复(设备参数)  
9 - * Created by panzhao on 2017/6/28.  
10 - */  
11 -@Repository  
12 -public interface DC0A4Repository extends BaseRepository<DC0_A4, String>{  
13 -} 1 +package com.bsth.repository.directive;
  2 +
  3 +import com.bsth.entity.directive.DC0_A4;
  4 +import com.bsth.repository.BaseRepository;
  5 +import org.springframework.stereotype.Repository;
  6 +
  7 +/**
  8 + * C0_A4 设备回复(设备参数)
  9 + * Created by panzhao on 2017/6/28.
  10 + */
  11 +@Repository
  12 +public interface DC0A4Repository extends BaseRepository<DC0_A4, String>{
  13 +}
src/main/java/com/bsth/service/directive/dto/DeviceConfigDto.java
1 -package com.bsth.service.directive.dto;  
2 -  
3 -/**  
4 - * Created by panzhao on 2017/6/28.  
5 - */  
6 -public class DeviceConfigDto {  
7 -  
8 - private String xl;  
9 - private String id;  
10 - private String insideCode;  
11 - private String equipmentCode;  
12 - /** 网关IP地址 */  
13 - private String ipAddress;  
14 - /** 网关端口 */  
15 - private Integer port;  
16 - /** 定时定距上报模式 */  
17 - private Short reportMode;  
18 - /** 定时上报时间间隔 */  
19 - private Integer interval;  
20 - /** 定距上报距离间隔 */  
21 - private String distance;  
22 - /** 非线路状态超速阀门 */  
23 - private Short speedingThreshold;  
24 - /** 预警阀门 */  
25 - private Short alarmThreshold;  
26 - /** pos机IP地址 */  
27 - private String posIpAddress;  
28 - /** pos机端口 */  
29 - private String posPort;  
30 - /** 延迟机关时间 */  
31 - private Integer delay;  
32 - /** 中门视频切换到码表界面速度阀门 默认45 */  
33 - private Short speedThreshold1;  
34 - /** 码表界面切换到中门视频速度阀门 默认35 */  
35 - private Short speedThreshold2;  
36 - /** 对比度 */  
37 - private Short contrast;  
38 - /** 亮度 */  
39 - private Short brightness;  
40 - /** 饱和度 */  
41 - private Short saturation;  
42 -  
43 - private Long timestamp;  
44 -  
45 - public String getId() {  
46 - return id;  
47 - }  
48 -  
49 - public void setId(String id) {  
50 - this.id = id;  
51 - }  
52 -  
53 - public String getEquipmentCode() {  
54 - return equipmentCode;  
55 - }  
56 -  
57 - public void setEquipmentCode(String equipmentCode) {  
58 - this.equipmentCode = equipmentCode;  
59 - }  
60 -  
61 - public String getIpAddress() {  
62 - return ipAddress;  
63 - }  
64 -  
65 - public void setIpAddress(String ipAddress) {  
66 - this.ipAddress = ipAddress;  
67 - }  
68 -  
69 - public Integer getPort() {  
70 - return port;  
71 - }  
72 -  
73 - public void setPort(Integer port) {  
74 - this.port = port;  
75 - }  
76 -  
77 - public Short getReportMode() {  
78 - return reportMode;  
79 - }  
80 -  
81 - public void setReportMode(Short reportMode) {  
82 - this.reportMode = reportMode;  
83 - }  
84 -  
85 - public Integer getInterval() {  
86 - return interval;  
87 - }  
88 -  
89 - public void setInterval(Integer interval) {  
90 - this.interval = interval;  
91 - }  
92 -  
93 - public String getDistance() {  
94 - return distance;  
95 - }  
96 -  
97 - public void setDistance(String distance) {  
98 - this.distance = distance;  
99 - }  
100 -  
101 - public Short getSpeedingThreshold() {  
102 - return speedingThreshold;  
103 - }  
104 -  
105 - public void setSpeedingThreshold(Short speedingThreshold) {  
106 - this.speedingThreshold = speedingThreshold;  
107 - }  
108 -  
109 - public Short getAlarmThreshold() {  
110 - return alarmThreshold;  
111 - }  
112 -  
113 - public void setAlarmThreshold(Short alarmThreshold) {  
114 - this.alarmThreshold = alarmThreshold;  
115 - }  
116 -  
117 - public String getPosIpAddress() {  
118 - return posIpAddress;  
119 - }  
120 -  
121 - public void setPosIpAddress(String posIpAddress) {  
122 - this.posIpAddress = posIpAddress;  
123 - }  
124 -  
125 - public String getPosPort() {  
126 - return posPort;  
127 - }  
128 -  
129 - public void setPosPort(String posPort) {  
130 - this.posPort = posPort;  
131 - }  
132 -  
133 - public Integer getDelay() {  
134 - return delay;  
135 - }  
136 -  
137 - public void setDelay(Integer delay) {  
138 - this.delay = delay;  
139 - }  
140 -  
141 - public Short getSpeedThreshold1() {  
142 - return speedThreshold1;  
143 - }  
144 -  
145 - public void setSpeedThreshold1(Short speedThreshold1) {  
146 - this.speedThreshold1 = speedThreshold1;  
147 - }  
148 -  
149 - public Short getSpeedThreshold2() {  
150 - return speedThreshold2;  
151 - }  
152 -  
153 - public void setSpeedThreshold2(Short speedThreshold2) {  
154 - this.speedThreshold2 = speedThreshold2;  
155 - }  
156 -  
157 - public Short getContrast() {  
158 - return contrast;  
159 - }  
160 -  
161 - public void setContrast(Short contrast) {  
162 - this.contrast = contrast;  
163 - }  
164 -  
165 - public Short getBrightness() {  
166 - return brightness;  
167 - }  
168 -  
169 - public void setBrightness(Short brightness) {  
170 - this.brightness = brightness;  
171 - }  
172 -  
173 - public Short getSaturation() {  
174 - return saturation;  
175 - }  
176 -  
177 - public void setSaturation(Short saturation) {  
178 - this.saturation = saturation;  
179 - }  
180 -  
181 - public Long getTimestamp() {  
182 - return timestamp;  
183 - }  
184 -  
185 - public void setTimestamp(Long timestamp) {  
186 - this.timestamp = timestamp;  
187 - }  
188 -  
189 - public String getInsideCode() {  
190 - return insideCode;  
191 - }  
192 -  
193 - public void setInsideCode(String insideCode) {  
194 - this.insideCode = insideCode;  
195 - }  
196 -  
197 - public String getXl() {  
198 - return xl;  
199 - }  
200 -  
201 - public void setXl(String xl) {  
202 - this.xl = xl;  
203 - }  
204 -} 1 +package com.bsth.service.directive.dto;
  2 +
  3 +/**
  4 + * Created by panzhao on 2017/6/28.
  5 + */
  6 +public class DeviceConfigDto {
  7 +
  8 + private String xl;
  9 + private String id;
  10 + private String insideCode;
  11 + private String equipmentCode;
  12 + /** 网关IP地址 */
  13 + private String ipAddress;
  14 + /** 网关端口 */
  15 + private Integer port;
  16 + /** 定时定距上报模式 */
  17 + private Short reportMode;
  18 + /** 定时上报时间间隔 */
  19 + private Integer interval;
  20 + /** 定距上报距离间隔 */
  21 + private String distance;
  22 + /** 非线路状态超速阀门 */
  23 + private Short speedingThreshold;
  24 + /** 预警阀门 */
  25 + private Short alarmThreshold;
  26 + /** pos机IP地址 */
  27 + private String posIpAddress;
  28 + /** pos机端口 */
  29 + private String posPort;
  30 + /** 延迟机关时间 */
  31 + private Integer delay;
  32 + /** 中门视频切换到码表界面速度阀门 默认45 */
  33 + private Short speedThreshold1;
  34 + /** 码表界面切换到中门视频速度阀门 默认35 */
  35 + private Short speedThreshold2;
  36 + /** 对比度 */
  37 + private Short contrast;
  38 + /** 亮度 */
  39 + private Short brightness;
  40 + /** 饱和度 */
  41 + private Short saturation;
  42 +
  43 + private Long timestamp;
  44 +
  45 + public String getId() {
  46 + return id;
  47 + }
  48 +
  49 + public void setId(String id) {
  50 + this.id = id;
  51 + }
  52 +
  53 + public String getEquipmentCode() {
  54 + return equipmentCode;
  55 + }
  56 +
  57 + public void setEquipmentCode(String equipmentCode) {
  58 + this.equipmentCode = equipmentCode;
  59 + }
  60 +
  61 + public String getIpAddress() {
  62 + return ipAddress;
  63 + }
  64 +
  65 + public void setIpAddress(String ipAddress) {
  66 + this.ipAddress = ipAddress;
  67 + }
  68 +
  69 + public Integer getPort() {
  70 + return port;
  71 + }
  72 +
  73 + public void setPort(Integer port) {
  74 + this.port = port;
  75 + }
  76 +
  77 + public Short getReportMode() {
  78 + return reportMode;
  79 + }
  80 +
  81 + public void setReportMode(Short reportMode) {
  82 + this.reportMode = reportMode;
  83 + }
  84 +
  85 + public Integer getInterval() {
  86 + return interval;
  87 + }
  88 +
  89 + public void setInterval(Integer interval) {
  90 + this.interval = interval;
  91 + }
  92 +
  93 + public String getDistance() {
  94 + return distance;
  95 + }
  96 +
  97 + public void setDistance(String distance) {
  98 + this.distance = distance;
  99 + }
  100 +
  101 + public Short getSpeedingThreshold() {
  102 + return speedingThreshold;
  103 + }
  104 +
  105 + public void setSpeedingThreshold(Short speedingThreshold) {
  106 + this.speedingThreshold = speedingThreshold;
  107 + }
  108 +
  109 + public Short getAlarmThreshold() {
  110 + return alarmThreshold;
  111 + }
  112 +
  113 + public void setAlarmThreshold(Short alarmThreshold) {
  114 + this.alarmThreshold = alarmThreshold;
  115 + }
  116 +
  117 + public String getPosIpAddress() {
  118 + return posIpAddress;
  119 + }
  120 +
  121 + public void setPosIpAddress(String posIpAddress) {
  122 + this.posIpAddress = posIpAddress;
  123 + }
  124 +
  125 + public String getPosPort() {
  126 + return posPort;
  127 + }
  128 +
  129 + public void setPosPort(String posPort) {
  130 + this.posPort = posPort;
  131 + }
  132 +
  133 + public Integer getDelay() {
  134 + return delay;
  135 + }
  136 +
  137 + public void setDelay(Integer delay) {
  138 + this.delay = delay;
  139 + }
  140 +
  141 + public Short getSpeedThreshold1() {
  142 + return speedThreshold1;
  143 + }
  144 +
  145 + public void setSpeedThreshold1(Short speedThreshold1) {
  146 + this.speedThreshold1 = speedThreshold1;
  147 + }
  148 +
  149 + public Short getSpeedThreshold2() {
  150 + return speedThreshold2;
  151 + }
  152 +
  153 + public void setSpeedThreshold2(Short speedThreshold2) {
  154 + this.speedThreshold2 = speedThreshold2;
  155 + }
  156 +
  157 + public Short getContrast() {
  158 + return contrast;
  159 + }
  160 +
  161 + public void setContrast(Short contrast) {
  162 + this.contrast = contrast;
  163 + }
  164 +
  165 + public Short getBrightness() {
  166 + return brightness;
  167 + }
  168 +
  169 + public void setBrightness(Short brightness) {
  170 + this.brightness = brightness;
  171 + }
  172 +
  173 + public Short getSaturation() {
  174 + return saturation;
  175 + }
  176 +
  177 + public void setSaturation(Short saturation) {
  178 + this.saturation = saturation;
  179 + }
  180 +
  181 + public Long getTimestamp() {
  182 + return timestamp;
  183 + }
  184 +
  185 + public void setTimestamp(Long timestamp) {
  186 + this.timestamp = timestamp;
  187 + }
  188 +
  189 + public String getInsideCode() {
  190 + return insideCode;
  191 + }
  192 +
  193 + public void setInsideCode(String insideCode) {
  194 + this.insideCode = insideCode;
  195 + }
  196 +
  197 + public String getXl() {
  198 + return xl;
  199 + }
  200 +
  201 + public void setXl(String xl) {
  202 + this.xl = xl;
  203 + }
  204 +}
src/main/java/com/bsth/service/excep/impl/OutboundServiceImpl.java
@@ -69,8 +69,8 @@ public class OutboundServiceImpl implements OutboundService{ @@ -69,8 +69,8 @@ public class OutboundServiceImpl implements OutboundService{
69 } 69 }
70 70
71 } 71 }
72 - sql +=" limit ?,?";  
73 - 72 + // sql +=" order by id limit ?,?";
  73 + sql +=" order by timestamp limit ?,?";
74 74
75 try { 75 try {
76 conn = DBUtils_MS.getConnection(); 76 conn = DBUtils_MS.getConnection();
@@ -95,15 +95,15 @@ public class OutboundServiceImpl implements OutboundService{ @@ -95,15 +95,15 @@ public class OutboundServiceImpl implements OutboundService{
95 Outbound outbound; 95 Outbound outbound;
96 while(rs.next()){ 96 while(rs.next()){
97 outbound=new Outbound(); 97 outbound=new Outbound();
98 - outbound.setId(Integer.valueOf(rs.getObject("id").toString()));  
99 - outbound.setLat(Float.valueOf(rs.getObject("lat").toString())); 98 + // outbound.setId(Integer.valueOf(rs.getObject("id").toString()));
100 outbound.setLine(Integer.valueOf(rs.getObject("line").toString())); 99 outbound.setLine(Integer.valueOf(rs.getObject("line").toString()));
  100 + outbound.setUpDown(Integer.valueOf(rs.getObject("up_down").toString()));
  101 + outbound.setLon(Float.valueOf(rs.getObject("lon").toString()));
  102 + outbound.setLat(Float.valueOf(rs.getObject("lat").toString()));
101 //run 时注解 103 //run 时注解
102 outbound.setLineName(BasicData.lineCode2NameMap.get(outbound.getLine().toString())); 104 outbound.setLineName(BasicData.lineCode2NameMap.get(outbound.getLine().toString()));
103 - outbound.setLon(Float.valueOf(rs.getObject("lon").toString()));  
104 outbound.setTimestamp((Long.valueOf(rs.getObject("timestamp").toString()))); 105 outbound.setTimestamp((Long.valueOf(rs.getObject("timestamp").toString())));
105 outbound.setTimestampDate(sdf.format(new Date(outbound.getTimestamp()))); 106 outbound.setTimestampDate(sdf.format(new Date(outbound.getTimestamp())));
106 - outbound.setUpDown(Integer.valueOf(rs.getObject("up_down").toString()));  
107 outbound.setVehicle(BasicData.deviceId2NbbmMap.get(rs.getObject("vehicle").toString())); 107 outbound.setVehicle(BasicData.deviceId2NbbmMap.get(rs.getObject("vehicle").toString()));
108 // outbound.setLocation(rs.getObject("location")==null?"":rs.getObject("location").toString()); 108 // outbound.setLocation(rs.getObject("location")==null?"":rs.getObject("location").toString());
109 list.add(outbound); 109 list.add(outbound);
src/main/java/com/bsth/service/excep/impl/SpeedingServiceImpl.java
@@ -43,8 +43,10 @@ public class SpeedingServiceImpl implements SpeedingService { @@ -43,8 +43,10 @@ public class SpeedingServiceImpl implements SpeedingService {
43 Object line=map.get("line"); 43 Object line=map.get("line");
44 Object nbbm=map.get("nbbm"); 44 Object nbbm=map.get("nbbm");
45 Object updown=map.get("updown"); 45 Object updown=map.get("updown");
46 - Object date=map.get("date");  
47 - 46 + Object startDate=map.get("startDate");
  47 + Object endDate=map.get("endDate");
  48 +
  49 + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
48 if(line!=null){ 50 if(line!=null){
49 sql +=" and line like'%"+line.toString().trim()+"%'"; 51 sql +=" and line like'%"+line.toString().trim()+"%'";
50 } 52 }
@@ -58,15 +60,23 @@ public class SpeedingServiceImpl implements SpeedingService { @@ -58,15 +60,23 @@ public class SpeedingServiceImpl implements SpeedingService {
58 if(updown!=null){ 60 if(updown!=null){
59 sql +="and up_down like '%"+updown.toString()+"%'"; 61 sql +="and up_down like '%"+updown.toString()+"%'";
60 } 62 }
61 - if(date!=null){  
62 - if (date.toString().length()>0) {  
63 - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); 63 + if(startDate!=null){
  64 + if (startDate.toString().length()>0) {
64 try { 65 try {
65 - Long t1=sdf.parse(date.toString()+" 00:00:00").getTime();  
66 - Long t2=sdf.parse(date.toString()+" 23:59:59").getTime();  
67 - sql += " and timestamp >="+t1 +" and timestamp <="+t2; 66 + Long t1=sdf.parse(startDate.toString()+" 00:00:00").getTime();
  67 + sql += " and timestamp >="+t1;
  68 + } catch (ParseException e) {
  69 + e.printStackTrace();
  70 + }
  71 + }
  72 +
  73 + }
  74 + if(endDate!=null){
  75 + if (endDate.toString().length()>0) {
  76 + try {
  77 + Long t2=sdf.parse(endDate.toString()+" 23:59:59").getTime();
  78 + sql += " and timestamp <="+t2;
68 } catch (ParseException e) { 79 } catch (ParseException e) {
69 - // TODO Auto-generated catch block  
70 e.printStackTrace(); 80 e.printStackTrace();
71 } 81 }
72 } 82 }
@@ -74,18 +84,17 @@ public class SpeedingServiceImpl implements SpeedingService { @@ -74,18 +84,17 @@ public class SpeedingServiceImpl implements SpeedingService {
74 } 84 }
75 85
76 86
77 - sql +=" order by id limit ?,?"; 87 + /*sql +=" order by id limit ?,?";*/
78 88
79 89
80 try { 90 try {
81 conn = DBUtils_MS.getConnection(); 91 conn = DBUtils_MS.getConnection();
82 ps = conn.prepareStatement(sql); 92 ps = conn.prepareStatement(sql);
83 - ps.setInt(1, page*10); // O-最大条数 -- M-起始条数 93 + /* ps.setInt(1, page*10); // O-最大条数 -- M-起始条数
84 ps.setInt(2, 10); // O-最小条数 -- M-显示条数 94 ps.setInt(2, 10); // O-最小条数 -- M-显示条数
85 - rs = ps.executeQuery(); 95 +*/ rs = ps.executeQuery();
86 list = resultSet2Set(rs); 96 list = resultSet2Set(rs);
87 } catch (SQLException e) { 97 } catch (SQLException e) {
88 - // TODO Auto-generated catch block  
89 e.printStackTrace(); 98 e.printStackTrace();
90 }finally { 99 }finally {
91 DBUtils_MS.close(rs, ps, conn); 100 DBUtils_MS.close(rs, ps, conn);
@@ -106,6 +115,7 @@ public class SpeedingServiceImpl implements SpeedingService { @@ -106,6 +115,7 @@ public class SpeedingServiceImpl implements SpeedingService {
106 //run 时注解 115 //run 时注解
107 speeding.setLineName(BasicData.lineCode2NameMap.get(speeding.getLine().toString())); 116 speeding.setLineName(BasicData.lineCode2NameMap.get(speeding.getLine().toString()));
108 speeding.setLon(Float.valueOf(rs.getObject("lon").toString())); 117 speeding.setLon(Float.valueOf(rs.getObject("lon").toString()));
  118 + speeding.setSpeed(Float.valueOf(rs.getObject("speed").toString()));
109 speeding.setTimestamp((Long.valueOf(rs.getObject("timestamp").toString()))); 119 speeding.setTimestamp((Long.valueOf(rs.getObject("timestamp").toString())));
110 speeding.setTimestampDate(sdf.format(new Date(speeding.getTimestamp()))); 120 speeding.setTimestampDate(sdf.format(new Date(speeding.getTimestamp())));
111 speeding.setUpDown(Integer.valueOf(rs.getObject("up_down").toString())); 121 speeding.setUpDown(Integer.valueOf(rs.getObject("up_down").toString()));
@@ -114,16 +124,18 @@ public class SpeedingServiceImpl implements SpeedingService { @@ -114,16 +124,18 @@ public class SpeedingServiceImpl implements SpeedingService {
114 } 124 }
115 return list; 125 return list;
116 } 126 }
  127 +
117 @Override 128 @Override
118 public PageObject<Speeding> Pagequery(Map<String, Object> map) { 129 public PageObject<Speeding> Pagequery(Map<String, Object> map) {
119 - // TODO Auto-generated method stub  
120 String sql="select count(*) record from bsth_c_speeding where 1=1 "; 130 String sql="select count(*) record from bsth_c_speeding where 1=1 ";
121 Object line=map.get("line"); 131 Object line=map.get("line");
122 Object nbbm=map.get("nbbm"); 132 Object nbbm=map.get("nbbm");
123 Object updown=map.get("updown"); 133 Object updown=map.get("updown");
  134 + Object startDate=map.get("startDate");
  135 + Object endDate=map.get("endDate");
  136 + //时间转换
  137 + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
124 138
125 - Object date=map.get("date");  
126 -  
127 if(line!=null){ 139 if(line!=null){
128 sql +=" and line like'%"+line.toString().trim()+"%'"; 140 sql +=" and line like'%"+line.toString().trim()+"%'";
129 } 141 }
@@ -136,15 +148,23 @@ public class SpeedingServiceImpl implements SpeedingService { @@ -136,15 +148,23 @@ public class SpeedingServiceImpl implements SpeedingService {
136 if(updown!=null){ 148 if(updown!=null){
137 sql +="and up_down like '%"+updown.toString()+"%'"; 149 sql +="and up_down like '%"+updown.toString()+"%'";
138 } 150 }
139 - if(date!=null){  
140 - if (date.toString().length()>0) {  
141 - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:MM:SS"); 151 + if(startDate!=null){
  152 + if (startDate.toString().length()>0) {
142 try { 153 try {
143 - Long t1=sdf.parse(date.toString()+" 00:00:00").getTime();  
144 - Long t2=sdf.parse(date.toString()+" 23:59:59").getTime();  
145 - sql += " and timestamp >="+t1 +" and timestamp <="+t2; 154 + Long t1=sdf.parse(startDate.toString()+" 00:00:00").getTime();
  155 + sql += " and timestamp >="+t1;
  156 + } catch (ParseException e) {
  157 + e.printStackTrace();
  158 + }
  159 + }
  160 +
  161 + }
  162 + if(endDate!=null){
  163 + if (endDate.toString().length()>0) {
  164 + try {
  165 + Long t2=sdf.parse(endDate.toString()+" 23:59:59").getTime();
  166 + sql += " and timestamp <="+t2;
146 } catch (ParseException e) { 167 } catch (ParseException e) {
147 - // TODO Auto-generated catch block  
148 e.printStackTrace(); 168 e.printStackTrace();
149 } 169 }
150 } 170 }
@@ -163,49 +183,68 @@ public class SpeedingServiceImpl implements SpeedingService { @@ -163,49 +183,68 @@ public class SpeedingServiceImpl implements SpeedingService {
163 totalData=rs.getInt("record"); 183 totalData=rs.getInt("record");
164 } 184 }
165 } catch (SQLException e) { 185 } catch (SQLException e) {
166 - // TODO Auto-generated catch block  
167 e.printStackTrace(); 186 e.printStackTrace();
168 }finally { 187 }finally {
169 DBUtils_MS.close(rs, ps, conn); 188 DBUtils_MS.close(rs, ps, conn);
170 } 189 }
171 190
172 - PageHelper pageHelper = new PageHelper(totalData, map);  
173 - List<Speeding> list=findAll(pageHelper.getMap());  
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 ( select lp_name,cl_zbh,j_gh,j_name,MIN(fcsj) as fcsj,MAX(zdsj) as ddsj"  
181 - + " from bsth_c_s_sp_info_real where cl_zbh='"+nbbm2+"' and"  
182 - + " real_exec_date='"+dates+"' GROUP BY cl_zbh,lp_name,j_gh,j_name ) t WHERE t.fcsj<='"+sk+"' AND t.ddsj>='"+sk+"' " ;  
183 - List<ScheduleRealInfo> pbb =jdbcTemplate.query(sqlPbb,  
184 - new RowMapper<ScheduleRealInfo>(){  
185 - @Override  
186 - public ScheduleRealInfo mapRow(ResultSet rs, int rowNum) throws SQLException {  
187 - ScheduleRealInfo s = new ScheduleRealInfo();  
188 - s.setjGh(rs.getString("j_gh"));  
189 - s.setjName(rs.getString("j_name"));  
190 - s.setLpName(rs.getString("lp_name"));  
191 - return s;  
192 - }  
193 - });  
194 - if(pbb.size()>0){  
195 - list.get(i).setJsy(pbb.get(0).getjGh()+"/"+pbb.get(0).getjName());  
196 - list.get(i).setLpname(pbb.get(0).getLpName());  
197 - 191 + List<Speeding> list=findAll(map);
  192 + List<Speeding> listResult = new ArrayList<Speeding>();
  193 + int curPage;//页码
  194 + int pageData;//每页的记录条数
  195 + int start;//起始数据下标
  196 + int totalPage;//总页数
  197 + if(list.size()>1){
  198 + Speeding speedingNow;//下标为i的车
  199 + Speeding speedingLast;//下标为i-1的车
  200 + String strNow;
  201 + String strLast;
  202 + for(int i = 1;i<list.size();i++){
  203 + speedingNow = list.get(i);
  204 + speedingLast = list.get(i-1);
  205 + strNow = speedingNow.getVehicle()+speedingNow.getLine()+speedingNow.getUpDown();//同一车辆同一线路同一方向
  206 + strLast = speedingLast.getVehicle()+speedingLast.getLine()+speedingLast.getUpDown();
  207 + //同一车辆同一线路同一方向并且该记录的超速的开始时间减去上一条超速记录的结束时间小于等于10s,证明该车超速。//PS:祛除数据库中的重复发送数据
  208 + if(strNow.equals(strLast) && Math.abs(speedingNow.getTimestamp()-speedingLast.getTimestamp())<=10*1000 && (speedingNow.getTimestamp()-speedingLast.getTimestamp()!=0)){
  209 + speedingLast.setEndtimestamp(speedingNow.getTimestamp());
  210 + speedingLast.setEndtimestampDate(sdf.format(new Date(speedingNow.getTimestamp())));//设置结束时间
  211 + listResult.add(speedingLast);
  212 + }
198 } 213 }
199 214
  215 + totalData = listResult.size();//总记录条数。
  216 + if(map.get("curPage") == null || map.get("curPage").equals("0")){
  217 + curPage = 0;
  218 + }else{
  219 + curPage = Integer.parseInt((String) map.get("curPage"));
  220 + }
  221 + pageData = Integer.parseInt((String) map.get("pageData"));//每页的记录条数
  222 + start = (curPage - 0) * pageData; //起始记录下标。
  223 + totalPage = totalData % pageData == 0 ? totalData / pageData : totalData / pageData +1;//总页数
  224 + if(curPage == totalPage-1){//如果当前页等于总页数。
  225 + listResult = listResult.subList(start, totalData);
  226 + }else{
  227 + listResult = listResult.subList(start, start+pageData);
  228 + }
  229 + }else{
  230 + curPage = 1;
  231 + pageData = Integer.parseInt((String) map.get("pageData"));//每页的记录条数
  232 + totalPage =1;
200 } 233 }
  234 + Map<String,Object> paramMap = new HashMap<String,Object>();
  235 + paramMap.put("totalPage", totalPage);
  236 + paramMap.put("curPage", curPage);
  237 + paramMap.put("pageData", pageData);
  238 + PageHelper pageHelper = new PageHelper(totalData, paramMap);
  239 + pageHelper.getMap();
201 PageObject<Speeding> pageObject = pageHelper.getPageObject(); 240 PageObject<Speeding> pageObject = pageHelper.getPageObject();
202 - pageObject.setDataList(list); 241 + pageObject.setDataList(listResult);
203 return pageObject; 242 return pageObject;
204 } 243 }
205 - 244 +
  245 +
206 @Override 246 @Override
207 public Map<String, Object> getReport(Map<String, Object> map) { 247 public Map<String, Object> getReport(Map<String, Object> map) {
208 - // TODO Auto-generated method stub  
209 String chartStr = ""; 248 String chartStr = "";
210 Map<String, Object> mapValue = new HashMap<String, Object>(); 249 Map<String, Object> mapValue = new HashMap<String, Object>();
211 try { 250 try {
@@ -309,10 +348,8 @@ public class SpeedingServiceImpl implements SpeedingService { @@ -309,10 +348,8 @@ public class SpeedingServiceImpl implements SpeedingService {
309 } 348 }
310 349
311 } catch (SQLException e) { 350 } catch (SQLException e) {
312 - // TODO Auto-generated catch block  
313 e.printStackTrace(); 351 e.printStackTrace();
314 }catch (ParseException e1) { 352 }catch (ParseException e1) {
315 - // TODO Auto-generated catch block  
316 e1.printStackTrace(); 353 e1.printStackTrace();
317 }finally { 354 }finally {
318 DBUtils_MS.close(rs, ps, conn); 355 DBUtils_MS.close(rs, ps, conn);
src/main/java/com/bsth/service/report/ReportService.java
@@ -44,4 +44,6 @@ public interface ReportService { @@ -44,4 +44,6 @@ public interface ReportService {
44 List<Map<String, String>> userList(Map<String, Object> map); 44 List<Map<String, String>> userList(Map<String, Object> map);
45 45
46 List<Map<String, Object>> countByList(Map<String, Object> map); 46 List<Map<String, Object>> countByList(Map<String, Object> map);
  47 +
  48 + List<Map<String, Object>> countByBusList(Map<String, Object> map);
47 } 49 }
src/main/java/com/bsth/service/report/impl/ReportServiceImpl.java
@@ -17,11 +17,13 @@ import java.util.Map; @@ -17,11 +17,13 @@ import java.util.Map;
17 import java.util.Set; 17 import java.util.Set;
18 18
19 import org.apache.commons.lang.StringUtils; 19 import org.apache.commons.lang.StringUtils;
  20 +import org.dbunit.dataset.DataSetException;
20 import org.slf4j.Logger; 21 import org.slf4j.Logger;
21 import org.slf4j.LoggerFactory; 22 import org.slf4j.LoggerFactory;
22 import org.springframework.beans.factory.annotation.Autowired; 23 import org.springframework.beans.factory.annotation.Autowired;
23 import org.springframework.jdbc.core.JdbcTemplate; 24 import org.springframework.jdbc.core.JdbcTemplate;
24 import org.springframework.jdbc.core.RowMapper; 25 import org.springframework.jdbc.core.RowMapper;
  26 +import org.springframework.scheduling.commonj.ScheduledTimerListener;
25 import org.springframework.stereotype.Service; 27 import org.springframework.stereotype.Service;
26 28
27 import com.bsth.data.BasicData; 29 import com.bsth.data.BasicData;
@@ -30,6 +32,7 @@ import com.bsth.entity.Personnel; @@ -30,6 +32,7 @@ import com.bsth.entity.Personnel;
30 import com.bsth.entity.StationRoute; 32 import com.bsth.entity.StationRoute;
31 import com.bsth.entity.excep.ArrivalInfo; 33 import com.bsth.entity.excep.ArrivalInfo;
32 import com.bsth.entity.mcy_forms.Operationservice; 34 import com.bsth.entity.mcy_forms.Operationservice;
  35 +import com.bsth.entity.oil.Dlb;
33 import com.bsth.entity.oil.Ylb; 36 import com.bsth.entity.oil.Ylb;
34 import com.bsth.entity.realcontrol.ChildTaskPlan; 37 import com.bsth.entity.realcontrol.ChildTaskPlan;
35 import com.bsth.entity.realcontrol.ScheduleRealInfo; 38 import com.bsth.entity.realcontrol.ScheduleRealInfo;
@@ -41,6 +44,7 @@ import com.bsth.service.report.CulateMileageService; @@ -41,6 +44,7 @@ import com.bsth.service.report.CulateMileageService;
41 import com.bsth.service.report.ReportService; 44 import com.bsth.service.report.ReportService;
42 import com.bsth.util.Arith; 45 import com.bsth.util.Arith;
43 import com.bsth.util.ComparableJob; 46 import com.bsth.util.ComparableJob;
  47 +import com.bsth.util.ReportUtils;
44 import com.bsth.util.db.DBUtils_MS; 48 import com.bsth.util.db.DBUtils_MS;
45 49
46 @Service 50 @Service
@@ -1456,7 +1460,6 @@ public class ReportServiceImpl implements ReportService{ @@ -1456,7 +1460,6 @@ public class ReportServiceImpl implements ReportService{
1456 } 1460 }
1457 //所有班次信息 1461 //所有班次信息
1458 List<ScheduleRealInfo> list = new ArrayList<ScheduleRealInfo>(); 1462 List<ScheduleRealInfo> list = new ArrayList<ScheduleRealInfo>();
1459 -  
1460 line =line.trim(); 1463 line =line.trim();
1461 if(line.equals("")){ 1464 if(line.equals("")){
1462 //查询所有线路 1465 //查询所有线路
@@ -1466,7 +1469,6 @@ public class ReportServiceImpl implements ReportService{ @@ -1466,7 +1469,6 @@ public class ReportServiceImpl implements ReportService{
1466 list = scheduleRealInfoRepository.scheduleByDateAndLineTj2(line, date,date2); 1469 list = scheduleRealInfoRepository.scheduleByDateAndLineTj2(line, date,date2);
1467 } 1470 }
1468 1471
1469 -  
1470 String sql="select r.xl_bm" 1472 String sql="select r.xl_bm"
1471 + " from bsth_c_s_sp_info_real r where" 1473 + " from bsth_c_s_sp_info_real r where"
1472 + " r.schedule_date_str BETWEEN '"+date+"' and '"+date2+"'"; 1474 + " r.schedule_date_str BETWEEN '"+date+"' and '"+date2+"'";
@@ -1487,7 +1489,6 @@ public class ReportServiceImpl implements ReportService{ @@ -1487,7 +1489,6 @@ public class ReportServiceImpl implements ReportService{
1487 return ve; 1489 return ve;
1488 } 1490 }
1489 }); 1491 });
1490 -  
1491 for (int i = 0; i < listLine.size(); i++) { 1492 for (int i = 0; i < listLine.size(); i++) {
1492 List<ScheduleRealInfo> lists = new ArrayList<ScheduleRealInfo>(); 1493 List<ScheduleRealInfo> lists = new ArrayList<ScheduleRealInfo>();
1493 String lineStr=listLine.get(i); 1494 String lineStr=listLine.get(i);
@@ -1508,6 +1509,22 @@ public class ReportServiceImpl implements ReportService{ @@ -1508,6 +1509,22 @@ public class ReportServiceImpl implements ReportService{
1508 Map<String, Object> newMap=staticTj(list,"f"); 1509 Map<String, Object> newMap=staticTj(list,"f");
1509 lMap.add(newMap); 1510 lMap.add(newMap);
1510 } 1511 }
  1512 + if(type.equals("export")){
  1513 + List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
  1514 + Map<String, Object> m = new HashMap<String, Object>();
  1515 + m.put("date", date);
  1516 + m.put("date1", date2);
  1517 + ReportUtils ee = new ReportUtils();
  1518 + try {
  1519 + listI.add(lMap.iterator());
  1520 + String path = this.getClass().getResource("/").getPath() + "static/pages/forms/";
  1521 + ee.excelReplace(listI, new Object[]{m}, path + "mould/countByLine.xls",
  1522 + path + "export/线路公里统计表.xls");
  1523 + } catch (Exception e) {
  1524 + // TODO: handle exception
  1525 + e.printStackTrace();
  1526 + }
  1527 + }
1511 return lMap; 1528 return lMap;
1512 } 1529 }
1513 1530
@@ -1530,10 +1547,16 @@ public class ReportServiceImpl implements ReportService{ @@ -1530,10 +1547,16 @@ public class ReportServiceImpl implements ReportService{
1530 if(list.size()>0){ 1547 if(list.size()>0){
1531 if(status.equals("f")){ 1548 if(status.equals("f")){
1532 map.put("xlName","合计"); 1549 map.put("xlName","合计");
  1550 + map.put("gs", "");
  1551 + map.put("fgs", "");
1533 }else{ 1552 }else{
1534 map.put("xlName", list.get(0).getXlName()); 1553 map.put("xlName", list.get(0).getXlName());
1535 map.put("gs", list.get(0).getGsName()); 1554 map.put("gs", list.get(0).getGsName());
1536 map.put("fgs", list.get(0).getFgsName()); 1555 map.put("fgs", list.get(0).getFgsName());
  1556 + map.put("jGh", list.get(0).getjGh());
  1557 + map.put("sGh", list.get(0).getsGh()==null?"":list.get(0).getsGh());
  1558 + map.put("nbbm",list.get(0).getClZbh());
  1559 + map.put("line", list.get(0).getXlBm());
1537 } 1560 }
1538 1561
1539 double jhyygl=culateService.culateJhgl(list);//计划营运公里 1562 double jhyygl=culateService.culateJhgl(list);//计划营运公里
@@ -1584,6 +1607,8 @@ public class ReportServiceImpl implements ReportService{ @@ -1584,6 +1607,8 @@ public class ReportServiceImpl implements ReportService{
1584 double zrwjcclc=culateService.culateZrwJccLc(list, ""); 1607 double zrwjcclc=culateService.culateZrwJccLc(list, "");
1585 1608
1586 map.put("zrwjcclc", zrwjcclc); 1609 map.put("zrwjcclc", zrwjcclc);
  1610 + map.put("zrwjcclc1", 0);
  1611 + map.put("zrwjcclc2", 0);
1587 1612
1588 double kfks=culateService.culateKfksLc(lists); 1613 double kfks=culateService.culateKfksLc(lists);
1589 map.put("kfks", kfks); 1614 map.put("kfks", kfks);
@@ -1596,5 +1621,383 @@ public class ReportServiceImpl implements ReportService{ @@ -1596,5 +1621,383 @@ public class ReportServiceImpl implements ReportService{
1596 } 1621 }
1597 return map; 1622 return map;
1598 } 1623 }
  1624 + @Override
  1625 + public List<Map<String, Object>> countByBusList(Map<String, Object> map) {
  1626 + // TODO Auto-generated method stub
  1627 + SimpleDateFormat sdf =new SimpleDateFormat("yyyy-MM-dd");
  1628 + List<Map<String, Object>> lMap = new ArrayList<Map<String, Object>>();
  1629 + List<Map<String, Object>> lMaps = new ArrayList<Map<String, Object>>();
  1630 + String gsdm="";
  1631 + if(map.get("gsdm")!=null){
  1632 + gsdm=map.get("gsdm").toString();
  1633 + }
  1634 + String fgsdm="";
  1635 + if(map.get("fgsdm")!=null){
  1636 + fgsdm=map.get("fgsdm").toString();
  1637 + }
  1638 + String line="";
  1639 + if(map.get("line")!=null){
  1640 + line=map.get("line").toString();
  1641 + }
  1642 + String date="";
  1643 + if(map.get("date")!=null){
  1644 + date=map.get("date").toString();
  1645 + }
  1646 + String date2="";
  1647 + if(map.get("date2")!=null){
  1648 + date2=map.get("date2").toString();
  1649 + }
  1650 + String xlName="";
  1651 + if(map.get("xlName")!=null){
  1652 + xlName=map.get("xlName").toString();
  1653 + }
  1654 + String zt="";
  1655 + if(map.get("zt")!=null){
  1656 + zt=map.get("zt").toString();
  1657 + }
  1658 + String type="";
  1659 + if(map.get("type")!=null){
  1660 + type=map.get("type").toString();
  1661 + }
  1662 + //所有班次信息
  1663 + List<ScheduleRealInfo> list = new ArrayList<ScheduleRealInfo>();
  1664 + line =line.trim();
  1665 + if(line.equals("")){
  1666 + //查询所有线路
  1667 + list = scheduleRealInfoRepository.scheduleByDateAndLineTj(line, date,date2,gsdm,fgsdm);
  1668 + }else{
  1669 + //查询单条线路
  1670 + list = scheduleRealInfoRepository.scheduleByDateAndLineTj2(line, date,date2);
  1671 + }
  1672 + String ylbSql=" select * from bsth_c_ylb where rq BETWEEN '"+date+"' and '"+date2+"'";
  1673 + if(line.equals("")){
  1674 + ylbSql +="and ssgsdm='"+gsdm+"' "
  1675 + + " and fgsdm='"+fgsdm+"'";
  1676 + }else{
  1677 + ylbSql += " and xlbm = '"+line+"'";
  1678 + }
  1679 + List<Ylb> ylbList=ylbList(ylbSql);
  1680 + String dlbSql=" select * from bsth_c_dlb where rq BETWEEN '"+date+"' and '"+date2+"'";
  1681 + if(line.equals("")){
  1682 + dlbSql +="and ssgsdm='"+gsdm+"' "
  1683 + + " and fgsdm='"+fgsdm+"'";
  1684 + }else{
  1685 + dlbSql += " and xlbm = '"+line+"'";
  1686 + }
  1687 + List<Dlb> dlbList=dlbList(dlbSql);
  1688 + String sql="select r.xl_bm,r.schedule_date_str,r.cl_zbh,r.j_gh,r.s_gh"
  1689 + + " from bsth_c_s_sp_info_real r where"
  1690 + + " r.schedule_date_str BETWEEN '"+date+"' and '"+date2+"'";
  1691 + if(line.equals("")){
  1692 + sql +="and r.gs_bm='"+gsdm+"' "
  1693 + + " and r.fgs_bm='"+fgsdm+"'";
  1694 + }else{
  1695 + sql += " and r.xl_bm = '"+line+"'";
  1696 + }
  1697 + sql += " group by r.xl_bm,r.cl_zbh,r.schedule_date_str,r.j_gh,r.s_gh";
  1698 +
  1699 + List<Map<String, Object>> listGroupBy=jdbcTemplate.query(sql, new RowMapper<Map<String, Object>>() {
  1700 + @Override
  1701 + public Map<String, Object> mapRow(ResultSet arg0, int arg1) throws SQLException {
  1702 + Map<String, Object> map=new HashMap<String,Object>();
  1703 + map.put("line",arg0.getString("xl_bm"));
  1704 + map.put("date", arg0.getString("schedule_date_str"));
  1705 + map.put("nbbm", arg0.getString("cl_zbh"));
  1706 + map.put("jGh", arg0.getString("j_gh"));
  1707 + map.put("sGh", arg0.getString("s_gh"));
  1708 + return map;
  1709 + }
  1710 + });
  1711 + for (int i = 0; i < listGroupBy.size(); i++) {
  1712 + Map<String, Object> m=listGroupBy.get(i);
  1713 + String xl_bm=m.get("line")==null?"":m.get("line").toString();
  1714 + String dateStr=m.get("date")==null?"":m.get("date").toString();
  1715 + String nbbm =m.get("nbbm")==null?"":m.get("nbbm").toString();
  1716 + String jGh= m.get("jGh")==null?"":m.get("jGh").toString();
  1717 + String sGh= m.get("sGh")==null?"":m.get("sGh").toString();
  1718 + List<ScheduleRealInfo> lists=new ArrayList<ScheduleRealInfo>();
  1719 + for (int j = 0; j < list.size(); j++) {
  1720 + ScheduleRealInfo s=list.get(j);
  1721 + if(zt.equals("zbh")){
  1722 + if(xl_bm.equals(s.getXlBm()) && nbbm.equals(s.getClZbh())){
  1723 + lists.add(s);
  1724 + }
  1725 + }else{
  1726 + if(xl_bm.equals(s.getXlBm()) && nbbm.equals(s.getClZbh())
  1727 + && dateStr.equals(s.getScheduleDateStr())
  1728 + && jGh.equals(s.getjGh()) && sGh.equals(s.getsGh())){
  1729 + lists.add(s);
  1730 + }
  1731 + }
  1732 + }
  1733 +
  1734 + if(zt.equals("zbh")){
  1735 + Map<String, Object> newMap=staticTj(lists, "");
  1736 + double yhl=0.0;
  1737 + double jzl=0.0;
  1738 + double hyl=0.0;
  1739 + double dhl=0.0;
  1740 + double cdl=0.0;
  1741 + for (int j = 0; j < ylbList.size(); j++) {
  1742 + Ylb y=ylbList.get(j);
  1743 + if(nbbm.equals(y.getNbbm()) && xl_bm.equals(y.getXlbm())){
  1744 + yhl=Arith.add(yhl, y.getYh());
  1745 + jzl=Arith.add(jzl, y.getJzl());
  1746 + hyl=Arith.add(hyl, y.getYh());
  1747 + }
  1748 +
  1749 + }
  1750 + for (int j = 0; j < dlbList.size(); j++) {
  1751 + Dlb d=dlbList.get(j);
  1752 + if(nbbm.equals(d.getNbbm())&&xl_bm.equals(d.getXlbm())){
  1753 + dhl=Arith.add(dhl, d.getHd());
  1754 + cdl=Arith.add(cdl, d.getCdl());
  1755 + }
  1756 + }
  1757 + if(date.equals(date2)){
  1758 + newMap.put("rq",date);
  1759 + }else{
  1760 + newMap.put("rq",date+"至"+date2);
  1761 + }
  1762 + newMap.put("yhl", yhl);
  1763 + newMap.put("jzl", jzl);
  1764 + newMap.put("hyl", hyl);
  1765 + newMap.put("dhl", dhl);
  1766 + newMap.put("cdl", cdl);
  1767 + lMap.add(newMap);
  1768 + }else{
  1769 + Map<String, Object> newMap=staticTj(lists, "");
  1770 + double lc=Double.parseDouble(newMap.get("zlc").toString());
  1771 + double yhl=0.0;
  1772 + double jzl=0.0;
  1773 + double hyl=0.0;
  1774 + double dhl=0.0;
  1775 + double cdl=0.0;
  1776 + double zlc=0.0;
  1777 + for (int j = 0; j < ylbList.size(); j++) {
  1778 + Ylb y=ylbList.get(j);
  1779 + if(nbbm.equals(y.getNbbm()) && xl_bm.equals(y.getXlbm())
  1780 + &&dateStr.equals(sdf.format(y.getRq()))
  1781 + &&jGh.equals(y.getName())){
  1782 + yhl=Arith.add(yhl, y.getYh());
  1783 + jzl=Arith.add(jzl, y.getJzl());
  1784 + hyl=Arith.add(hyl, y.getYh());
  1785 + zlc=Arith.add(zlc, y.getZlc());
  1786 + }
  1787 +
  1788 + }
  1789 +
  1790 + for (int j = 0; j < dlbList.size(); j++) {
  1791 + Dlb d=dlbList.get(j);
  1792 + if(nbbm.equals(d.getNbbm())&&xl_bm.equals(d.getXlbm())
  1793 + &&dateStr.equals(sdf.format(d.getRq()))
  1794 + &&jGh.equals(d.getName())){
  1795 + dhl=Arith.add(dhl, d.getHd());
  1796 + cdl=Arith.add(cdl, d.getCdl());
  1797 + zlc=Arith.add(zlc, d.getZlc());
  1798 + }
  1799 + }
  1800 + double div=0.0;
  1801 + if(lc>0){
  1802 + div=Arith.div(zlc, lc,2);
  1803 + }
  1804 + newMap.put("yhl", yhl*div);
  1805 + newMap.put("jzl", jzl*div);
  1806 + newMap.put("hyl", hyl*div);
  1807 + newMap.put("dhl", dhl*div);
  1808 + newMap.put("cdl", cdl*div);
  1809 + lMaps.add(newMap);
  1810 + }
  1811 +
  1812 + }
  1813 + if(!zt.equals("zbh")){
  1814 + String sqls="select r.xl_bm,r.cl_zbh,r.j_gh,r.s_gh"
  1815 + + " from bsth_c_s_sp_info_real r where"
  1816 + + " r.schedule_date_str BETWEEN '"+date+"' and '"+date2+"'";
  1817 + if(line.equals("")){
  1818 + sqls +="and r.gs_bm='"+gsdm+"' "
  1819 + + " and r.fgs_bm='"+fgsdm+"'";
  1820 + }else{
  1821 + sqls += " and r.xl_bm = '"+line+"'";
  1822 + }
  1823 + sqls += " group by r.xl_bm,r.cl_zbh,r.j_gh,r.s_gh";
  1824 +
  1825 + List<Map<String, Object>> listGroupBys=jdbcTemplate.query(sqls, new RowMapper<Map<String, Object>>() {
  1826 + @Override
  1827 + public Map<String, Object> mapRow(ResultSet arg0, int arg1) throws SQLException {
  1828 + Map<String, Object> map=new HashMap<String,Object>();
  1829 + map.put("line",arg0.getString("xl_bm"));
  1830 + map.put("nbbm", arg0.getString("cl_zbh"));
  1831 + map.put("jGh", arg0.getString("j_gh"));
  1832 + map.put("sGh", arg0.getString("s_gh"));
  1833 + return map;
  1834 + }
  1835 + });
  1836 + lMap=lists(listGroupBys, lMaps, gsdm, fgsdm, date, date2);
  1837 +
  1838 + }
  1839 + if(type.equals("export")){
  1840 + List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
  1841 + Map<String, Object> m = new HashMap<String, Object>();
  1842 + m.put("date", date);
  1843 + m.put("date1", date2);
  1844 + String xls="";
  1845 + if(zt.equals("zbh")){
  1846 + xls="countByBus1.xls";
  1847 + }else{
  1848 + xls="countByBus2.xls";
  1849 + }
  1850 + ReportUtils ee = new ReportUtils();
  1851 + try {
  1852 + listI.add(lMap.iterator());
  1853 + String path = this.getClass().getResource("/").getPath() + "static/pages/forms/";
  1854 + ee.excelReplace(listI, new Object[]{m}, path + "mould/"+xls,
  1855 + path + "export/路单数据统计表.xls");
  1856 + } catch (Exception e) {
  1857 + // TODO: handle exception
  1858 + e.printStackTrace();
  1859 + }
  1860 + }
  1861 +
  1862 + return lMap;
  1863 + }
1599 1864
  1865 + public final List<Ylb> ylbList(String sql){
  1866 + List<Ylb> ylbList= jdbcTemplate.query(sql, new RowMapper<Ylb>() {
  1867 + @Override
  1868 + public Ylb mapRow(ResultSet arg0, int arg1) throws SQLException {
  1869 + Ylb y = new Ylb();
  1870 + y.setRq(arg0.getDate("rq"));
  1871 + y.setXlbm(arg0.getString("xlbm"));
  1872 + y.setNbbm(arg0.getString("nbbm"));
  1873 + y.setJzl(arg0.getDouble("jzl"));
  1874 + y.setYh(arg0.getDouble("yh"));
  1875 + y.setSh(arg0.getDouble("sh"));
  1876 + return y;
  1877 + }
  1878 + });
  1879 + return ylbList;
  1880 + }
  1881 +
  1882 + public final List<Dlb> dlbList(String sql){
  1883 + List<Dlb> dlbList= jdbcTemplate.query(sql, new RowMapper<Dlb>() {
  1884 + @Override
  1885 + public Dlb mapRow(ResultSet arg0, int arg1) throws SQLException {
  1886 + Dlb y = new Dlb();
  1887 + y.setRq(arg0.getDate("rq"));
  1888 + y.setXlbm(arg0.getString("xlbm"));
  1889 + y.setNbbm(arg0.getString("nbbm"));
  1890 + y.setCdl(arg0.getDouble("cdl"));
  1891 + y.setHd(arg0.getDouble("hd"));
  1892 + y.setSh(arg0.getDouble("sh"));
  1893 + return y;
  1894 + }
  1895 + });
  1896 + return dlbList;
  1897 + }
  1898 +
  1899 + public final List<Map<String, Object>> lists(List<Map<String, Object>> listGb,
  1900 + List<Map<String, Object>> listLc,
  1901 + String gsdm,String fgsdm,
  1902 + String date,String date2){
  1903 + List<Map<String, Object>> lMap=new ArrayList<Map<String,Object>>();
  1904 + for (int i = 0; i < listGb.size(); i++) {
  1905 + Map<String, Object> m=listGb.get(i);
  1906 + String xl_bm=m.get("line")==null?"":m.get("line").toString();
  1907 + String nbbm =m.get("nbbm")==null?"":m.get("nbbm").toString();
  1908 + String jGh= m.get("jGh")==null?"":m.get("jGh").toString();
  1909 + String sGh= m.get("sGh")==null?"":m.get("sGh").toString();
  1910 + double jhzlc = 0.0,jhlc= 0.0,jcclc= 0.0,zlc= 0.0,jhnlc= 0.0,jhwlc= 0.0,
  1911 + jhnjcclc= 0.0,jhwjcclc= 0.0,zrwjcclc= 0.0,lbss= 0.0,ssgl_lz= 0.0,
  1912 + ssgl_dm= 0.0,ssgl_gz= 0.0,ssgl_jf= 0.0,ssgl_zs= 0.0,ssgl_qr= 0.0,ssgl_qc= 0.0,
  1913 + ssgl_kx= 0.0,ssgl_qh= 0.0,ssgl_yw= 0.0,ssgl_other= 0.0,ljyy=0.0,ljjcc=0.0,
  1914 + kfks=0.0,yhl=0.0,jzl=0.0,hyl=0.0,dhl=0.0,cdl=0.0;
  1915 +
  1916 + for (int j = 0; j < listLc.size(); j++) {
  1917 + Map<String, Object> map=listLc.get(j);
  1918 + if(xl_bm.equals(map.get("line").toString())
  1919 + && nbbm.equals(map.get("nbbm").toString())
  1920 + && sGh.equals(map.get("sGh")==null?"":map.get("sGh").toString())
  1921 + && jGh.equals(map.get("jGh").toString())){
  1922 + jhzlc=Arith.add(jhzlc, map.get("jhzlc"));
  1923 + jhlc =Arith.add(jhlc, map.get("jhlc"));
  1924 + jcclc=Arith.add(jcclc, map.get("jcclc"));
  1925 + zlc=Arith.add(zlc, map.get("zlc"));
  1926 + jhnlc=Arith.add(jhnlc, map.get("jhnlc"));
  1927 + jhwlc=Arith.add(jhwlc, map.get("jhwlc"));
  1928 + jhnjcclc=Arith.add(jhnjcclc, map.get("jhnjcclc"));
  1929 + jhwjcclc=Arith.add(jhwjcclc, map.get("jhwjcclc"));
  1930 + zrwjcclc=Arith.add(zrwjcclc, map.get("zrwjcclc"));
  1931 + lbss=Arith.add(lbss, map.get("lbss"));
  1932 + ssgl_lz=Arith.add(ssgl_lz, map.get("ssgl_lz"));
  1933 + ssgl_dm=Arith.add(ssgl_dm, map.get("ssgl_dm"));
  1934 + ssgl_gz=Arith.add(ssgl_gz, map.get("ssgl_gz"));
  1935 + ssgl_jf=Arith.add(ssgl_jf, map.get("ssgl_jf"));
  1936 + ssgl_zs=Arith.add(ssgl_zs, map.get("ssgl_zs"));
  1937 + ssgl_qr=Arith.add(ssgl_qr, map.get("ssgl_qr"));
  1938 + ssgl_qc=Arith.add(ssgl_qc, map.get("ssgl_qc"));
  1939 + ssgl_kx=Arith.add(ssgl_kx, map.get("ssgl_kx"));
  1940 + ssgl_qh=Arith.add(ssgl_qh, map.get("ssgl_qh"));
  1941 + ssgl_yw=Arith.add(ssgl_yw, map.get("ssgl_yw"));
  1942 + ssgl_other=Arith.add(ssgl_other, map.get("ssgl_other"));
  1943 + kfks=Arith.add(kfks, map.get("kfks"));
  1944 + ljyy=Arith.add(ljyy, map.get("ljyy"));
  1945 + ljjcc=Arith.add(ljjcc, map.get("ljjcc"));
  1946 + yhl=Arith.add(yhl, map.get("yhl"));
  1947 + jzl=Arith.add(jzl, map.get("jzl"));
  1948 + hyl=Arith.add(hyl, map.get("hyl"));
  1949 + dhl=Arith.add(dhl, map.get("dhl"));
  1950 + cdl=Arith.add(cdl, map.get("cdl"));
  1951 +
  1952 +
  1953 + }
  1954 + }
  1955 +
  1956 + Map<String, Object> newMap=new HashMap<String,Object>();
  1957 + if(date.equals(date2)){
  1958 + newMap.put("rq", date);
  1959 + }else{
  1960 + newMap.put("rq", date+"至"+date2);
  1961 + }
  1962 + newMap.put("fgs", BasicData.businessFgsCodeNameMap.get(fgsdm+"_"+gsdm));
  1963 + newMap.put("xlName", BasicData.lineCode2NameMap.get(xl_bm));
  1964 + newMap.put("jGh", jGh);
  1965 + newMap.put("jName", jGh);
  1966 + newMap.put("sGh",sGh);
  1967 + newMap.put("sName", sGh);
  1968 + newMap.put("nbbm", nbbm);
  1969 + newMap.put("jhzlc", jhzlc);
  1970 + newMap.put("jhlc", jhlc);
  1971 + newMap.put("jcclc", jcclc);
  1972 + newMap.put("zlc", zlc);
  1973 + newMap.put("jhnlc", jhnlc);
  1974 + newMap.put("jhwlc", jhwlc);
  1975 + newMap.put("jhnjcclc", jhnjcclc);
  1976 + newMap.put("jhwjcclc", jhwjcclc);
  1977 + newMap.put("zrwjcclc", zrwjcclc);
  1978 + newMap.put("lbss", lbss);
  1979 + newMap.put("ssgl_lz", ssgl_lz);
  1980 + newMap.put("ssgl_dm",ssgl_dm);
  1981 + newMap.put("ssgl_gz", ssgl_gz);
  1982 + newMap.put("ssgl_jf", ssgl_jf);
  1983 + newMap.put("ssgl_zs", ssgl_zs);
  1984 + newMap.put("ssgl_qr", ssgl_qr);
  1985 + newMap.put("ssgl_qc", ssgl_qc);
  1986 + newMap.put("ssgl_kx", ssgl_kx);
  1987 + newMap.put("ssgl_qh", ssgl_qh);
  1988 + newMap.put("ssgl_yw", ssgl_yw);
  1989 + newMap.put("ssgl_other", ssgl_other);
  1990 + newMap.put("kfks", kfks);
  1991 + newMap.put("ljyy", ljyy);
  1992 + newMap.put("ljjcc", ljjcc);
  1993 + newMap.put("yhl", yhl);
  1994 + newMap.put("jzl", jzl);
  1995 + newMap.put("hyl", hyl);
  1996 + newMap.put("dhl", dhl);
  1997 + newMap.put("cdl", cdl);
  1998 + lMap.add(newMap);
  1999 + }
  2000 + return lMap;
  2001 + }
  2002 +
1600 } 2003 }
src/main/resources/static/pages/excep/boundList.html
@@ -56,7 +56,7 @@ @@ -56,7 +56,7 @@
56 <th width="3%">#</th> 56 <th width="3%">#</th>
57 <th width="15%">线路</th> 57 <th width="15%">线路</th>
58 <th width="13%">车辆自编号</th> 58 <th width="13%">车辆自编号</th>
59 - <th width="100">工号/名字</th> 59 + <th width="100">车辆坐标</th>
60 <th width="11%">路牌名</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>
@@ -118,9 +118,11 @@ @@ -118,9 +118,11 @@
118 <td> 118 <td>
119 {{obj.vehicle}} 119 {{obj.vehicle}}
120 </td> 120 </td>
121 -  
122 <td> 121 <td>
123 - {{obj.jsy}} 122 + <a href="/pages/excep/outBoundMap.html?no={{obj.line}},{{obj.upDown}},{{obj.lon}},{{obj.lat}}"
  123 + class="btn default blue-stripe btn-sm" data-pjax>
  124 + 查看车辆位置
  125 + </a>
124 </td> 126 </td>
125 <td> 127 <td>
126 {{obj.lpname}} 128 {{obj.lpname}}
@@ -156,11 +158,19 @@ $(function(){ @@ -156,11 +158,19 @@ $(function(){
156 checkboxClass: 'icheckbox_flat-blue', 158 checkboxClass: 'icheckbox_flat-blue',
157 increaseArea: '20%' 159 increaseArea: '20%'
158 } 160 }
159 -  
160 -// jsDoQuery(null,true);  
161 - 161 + var toDay = new Date();
  162 + var year = toDay.getFullYear();
  163 + var Month = toDay.getMonth()+1>10?toDay.getMonth()+1:"0"+(toDay.getMonth()+1);
  164 + var Day = toDay.getDate()>10?toDay.getDate():"0"+toDay.getDate();
  165 + var date = year+"-"+Month+"-"+Day;
  166 + //时间表单默认选择当日时间。
  167 + $("input[name='date']")[0].value = date;
  168 + var parameter = new Object();
  169 + parameter.date = $("input[name='date']")[0].value;
  170 + jsDoQuery(parameter,true);
162 //重置 171 //重置
163 $('tr.filter .filter-cancel').on('click', function(){ 172 $('tr.filter .filter-cancel').on('click', function(){
  173 + debugger;
164 $('tr.filter input, select').val('').change(); 174 $('tr.filter input, select').val('').change();
165 jsDoQuery(null, true); 175 jsDoQuery(null, true);
166 }); 176 });
src/main/resources/static/pages/excep/img/bus.png 0 → 100644

1.03 KB

src/main/resources/static/pages/excep/js/outbound-map.js 0 → 100644
  1 +/**
  2 + * 百度地图
  3 + *
  4 + * - - - - - -》init:地图初始化
  5 + *
  6 + * - - - - - -》lineInfoPanl:从百度地图抓去站点与路段数据
  7 + *
  8 + * - - - - - -》getDistanceAndDuration:获取距离与时间
  9 + *
  10 + * - - - - - -》pointsPolygon:地图画多边行
  11 + *
  12 + * - - - - - -》pointsCircle:画圆
  13 + *
  14 + * - - - - - -》localSearchFromAdreesToPoint:根据地理名称获取百度经纬度坐标
  15 + *
  16 + * - - - - - -》drawingUpline:在地图上画出上行线路走向
  17 + *
  18 + * - - - - - -》stationsNameToPoints:站点名称获取百度坐标(手动规划)
  19 + *
  20 + * - - - - - -》getDistanceAndTotime:根据坐标点获取两点之间的时间与距离(手动规划)
  21 + *
  22 + * - - - - - -》getSectionListPlonly:根据坐标点获取两点之间的折线路段(手动规划)
  23 + */
  24 +
  25 +var WorldsBMap = function () {
  26 +
  27 + /** WorldsBMap 全局变量定义 mapBValue:地图对象;polygon:多边形;polyUpline:走向折线;circle:圆 */
  28 + var mapBValue = '';polygon='',polyUpline='',circle='',iseditStatus = false;
  29 +
  30 + var Bmap = {
  31 +
  32 + init : function() {
  33 +
  34 + // 设置中心点,
  35 + var CENTER_POINT = {lng : 121.528733,lat : 31.237425};
  36 +
  37 + // 百度API Key
  38 + var bdKey = 'IGGrr4UjwIYzatoCRFKEL8sT';
  39 +
  40 + // 初始化百度地图
  41 + mapBValue = new BMap.Map("bmap_basic");
  42 +
  43 + //中心点和缩放级别
  44 + mapBValue.centerAndZoom(new BMap.Point(CENTER_POINT.lng,CENTER_POINT.lat), 15);
  45 +
  46 + //启用地图拖拽事件,默认启用(可不写)
  47 + mapBValue.enableDragging();
  48 +
  49 + //启用地图滚轮放大缩小
  50 + mapBValue.enableScrollWheelZoom();
  51 +
  52 + //禁用鼠标双击放大
  53 + mapBValue.disableDoubleClickZoom();
  54 +
  55 + //启用键盘上下左右键移动地图
  56 + mapBValue.enableKeyboard();
  57 +
  58 + return mapBValue;
  59 + },
  60 +
  61 + /** 获取地图对象 @return 地图对象map */
  62 + getmapBValue : function() {
  63 +
  64 + return mapBValue;
  65 +
  66 + },
  67 +
  68 + getPolygon : function(){
  69 +
  70 + return polygon;
  71 + },
  72 +
  73 + getPolyUpline : function() {
  74 +
  75 + return polyUpline;
  76 + },
  77 +
  78 + getCircle : function() {
  79 +
  80 + return circle;
  81 + },
  82 +
  83 + getIsEditStatus : function() {
  84 + return iseditStatus;
  85 + },
  86 +
  87 + setIsEditStatus : function(v) {
  88 + iseditStatus = v ;
  89 + },
  90 +
  91 + initDrawingManager: function(map,styleOptions) {
  92 +
  93 + },
  94 +
  95 + getDrawingManagerObj : function() {
  96 +
  97 + return drawingManagerInitV;
  98 + },
  99 +
  100 + // 从百度地图抓去站点与路段数据
  101 + lineInfoPanl : function(lineNameValue,i,cb) {
  102 +
  103 + /** 根据线路名称与方向从百度地图获取站点与路段 @param lineNameValue:线路名称;i:方向<0:上行;1:下行> */
  104 + WorldsBMap.getBmapStationNames(lineNameValue,i,function(BusLine){
  105 +
  106 + return cb && cb(BusLine);
  107 +
  108 + });
  109 +
  110 + },
  111 +
  112 + /** 获取距离与时间 @param <points:坐标点集合> */
  113 + getDistanceAndDuration : function(points,callback){
  114 +
  115 + // 获取长度
  116 + var len = points.length;
  117 +
  118 + (function(){
  119 +
  120 + if (!arguments.callee.count) {
  121 +
  122 + arguments.callee.count = 0;
  123 +
  124 + }
  125 +
  126 + arguments.callee.count++;
  127 +
  128 + var index = parseInt(arguments.callee.count) - 1;
  129 +
  130 + if (index >= len-1) {
  131 +
  132 + callback && callback(points);
  133 +
  134 + return;
  135 + }
  136 +
  137 + // 当函数被调用时,它的arguments.callee对象就会指向自身,也就是一个对自己的引用。(当前正在执行的函数。)
  138 + var f = arguments.callee;
  139 +
  140 + // 起点坐标 <坐标格式:40.056878,116.30815>
  141 + var origin = points[index].potion.lat + ',' + points[index].potion.lng;
  142 +
  143 + // 终点坐标 <坐标格式:40.056878,116.30815>
  144 + var destination = points[index+1].potion.lat + ',' + points[index+1].potion.lng;
  145 +
  146 + var region = '上海';
  147 +
  148 + var origin_region = '上海';
  149 +
  150 + var destination_region = '上海';
  151 +
  152 + var output = 'json';
  153 +
  154 + var ak_My = 'wjlITmXeCek5MxyU3ZUBkTeU8B0o0npk';
  155 +
  156 + /**
  157 + * origin:起点名称或经纬度;
  158 + *
  159 + * destination:终点名称或经纬度;
  160 + *
  161 + * origin_region:起始点所在城市,驾车导航时必填。
  162 + *
  163 + * destination_region:终点所在城市,驾车导航时必填。
  164 + *
  165 + * output :表示输出类型,可设置为xml或json,默认为xml。
  166 + *
  167 + **/
  168 + var paramsB = {origin:origin,destination:destination,region:region,origin_region:origin_region,destination_region:destination_region,output:output,ak:ak_My};
  169 +
  170 + /** @description :未认证开发者默认配额为:2000次/天。 */
  171 + $.ajax({
  172 +
  173 + // 百度地图根据坐标获取两点之间的时间与距离
  174 + url: 'http://api.map.baidu.com/direction/v1?mode=transit',
  175 +
  176 + data: paramsB,
  177 +
  178 + dataType: 'jsonp',
  179 +
  180 + success: function(r){
  181 +
  182 + if(r) {
  183 +
  184 + if(r.message=='ok') {
  185 +
  186 + if(r.result.taxi==null) {
  187 +
  188 + // 获取距离(单位:米)
  189 + points[index+1].distance = 0;
  190 +
  191 + // 获取时间(单位:秒)
  192 + points[index+1].duration = 0;
  193 +
  194 + }else {
  195 +
  196 + // 获取距离(单位:米)
  197 + points[index+1].distance = r.result.taxi.distance;
  198 +
  199 + // 获取时间(单位:秒)
  200 + points[index+1].duration = r.result.taxi.duration;
  201 +
  202 + }
  203 +
  204 +
  205 + }
  206 +
  207 + }
  208 +
  209 + f();
  210 + }
  211 + });
  212 +
  213 + })();
  214 +
  215 + },
  216 +
  217 + // 地图画多边形
  218 + pointsPolygon : function(objStation) {
  219 +
  220 + // 将视图切换到指定的缩放等级,中心点坐标不变。注意:当有信息窗口在地图上打开时,地图缩放将保证信息窗口所在的坐标位置不动。(自1.2新增)
  221 + mapBValue.setZoom(15);
  222 +
  223 + // 如果不为空
  224 + if(objStation) {
  225 +
  226 + // 获取中心点坐标字符串
  227 + var testpointStr = objStation.stationBJwpoints;
  228 +
  229 + // 按空格切割中心点坐标字符串
  230 + var BJwpointsPolygon = testpointStr.split(' ');
  231 +
  232 + // 中心点坐标
  233 + var pointPolygon = new BMap.Point(BJwpointsPolygon[0], BJwpointsPolygon[1]);
  234 +
  235 + // 获取多边形坐标字符串
  236 + var stationBPolygonGrid = objStation.stationBPolygonGrid;
  237 +
  238 + // 截取多边形坐标字符串
  239 + var stationBPolygonGridStr = stationBPolygonGrid.substring(9,stationBPolygonGrid.length-2);
  240 +
  241 + // 按逗号切割
  242 + var pointPolygonArray = stationBPolygonGridStr.split(',');
  243 +
  244 + // 多边形坐标集合
  245 + var polygonP = [];
  246 +
  247 + for(var v = 0;v<pointPolygonArray.length;v++) {
  248 +
  249 + polygonP.push(new BMap.Point(pointPolygonArray[v].split(" ")[0],pointPolygonArray[v].split(" ")[1]));
  250 +
  251 + }
  252 +
  253 + // 画多边形
  254 + polygon = new BMap.Polygon(polygonP, {
  255 +
  256 + // 线条显色
  257 + strokeColor : "blue",
  258 +
  259 + // 边线的宽度,以像素为单位。
  260 + strokeWeight : 2,
  261 +
  262 + // 边线透明度,取值范围0 - 1。
  263 + strokeOpacity : 0.5
  264 + });
  265 +
  266 + // 增加地图覆盖物多边形
  267 + mapBValue.addOverlay(polygon);
  268 +
  269 + // 信息窗口属性
  270 + var opts_polygon = {
  271 +
  272 + // 信息窗口宽度
  273 + width : 200,
  274 +
  275 + // 信息窗口高度
  276 + height : 400,
  277 +
  278 + // 信息窗位置偏移值。
  279 + offset: new BMap.Size(500,20),
  280 +
  281 + //标题
  282 + title : '<h4 style="color:#FFFFFF">'+objStation.stationStationName+'站详情</h4>',
  283 +
  284 + //设置不允许信窗发送短息
  285 + enableMessage : false,
  286 +
  287 + //是否开启点击地图关闭信息窗口
  288 + enableCloseOnClick : false
  289 + };
  290 +
  291 + var markTypeStr = '';
  292 +
  293 + if(objStation.stationRouteStationMark=='B') {
  294 +
  295 + markTypeStr='起点站';
  296 +
  297 + }else if(objStation.stationRouteStationMark=='Z') {
  298 +
  299 + markTypeStr ='中途站';
  300 +
  301 +
  302 + }else if(objStation.stationRouteStationMark=='E') {
  303 +
  304 + markTypeStr='终点站';
  305 +
  306 + }
  307 +
  308 + var htm = '<HR style="border:1 dashed #987cb9" width="100%" color=#987cb9 SIZE=1>'+
  309 + '<span style="color:#DDD;font-size: 15px;">站点名称:' + objStation.stationStationName + '</span>' +
  310 + '<span class="help-block" style="color:#DDD;font-size: 15px;">站点编码:' + objStation.stationStationCod + '</span>' +
  311 + '<span class="help-block" style="color:#DDD;font-size: 15px;">站点序号:' + objStation.stationRouteStationRouteCode + '</span>' +
  312 + '<span class="help-block" style="color:#DDD;font-size: 15px;">站点类型:' + markTypeStr + '</span>' +
  313 + '<span class="help-block" style="color:#DDD;font-size: 15px;">纬度坐标:' + objStation.stationBJwpoints + '</span>' +
  314 + '<span class="help-block" style="color:#DDD;font-size: 15px;">到站时间:' + objStation.stationRouteToTime + '&nbsp;分钟</span>' +
  315 + '<span class="help-block" style="color:#DDD;font-size: 15px;">到站距离:' + objStation.stationRouteDistances + '&nbsp;公里</span>' +
  316 + '<span class="help-block" style="color:#DDD;font-size: 15px;">范围半径:' + objStation.stationRadius + '</span>' +
  317 + '<span class="help-block" style="color:#DDD;font-size: 15px;">版本 号:' + objStation.stationRouteVersions + '</span>' +
  318 + '<span class="help-block" style="width: 100%;font-size: 15px;;color:#DDD;'+
  319 + 'overflow: hidden; white-space: nowrap; text-overflow: ellipsis; " title="'+
  320 + objStation.stationRouteDescriptions +'" >说明/描述:' + objStation.stationRouteDescriptions + '</span>' ;
  321 +
  322 + // 创建信息窗口
  323 + var infoWindow_target = new BMap.InfoWindow(htm, opts_polygon);
  324 + // 自定义标注物图片
  325 + var icon_target = new BMap.Icon('/pages/base/stationroute/css/img/cz.png',new BMap.Size(20, 20));
  326 +
  327 + // 创建点
  328 + marker = new BMap.Marker(pointPolygon,{icon : icon_target});
  329 +
  330 + // 把标注添物加到地图上
  331 + mapBValue.addOverlay(marker);
  332 +
  333 + // 是否在平移过程中禁止动画。(自1.2新增)
  334 + var PanOptions_ ={noAnimation :true};
  335 +
  336 + // 将地图的中心点更改为给定的点。
  337 + mapBValue.panTo(pointPolygon,PanOptions_);
  338 +
  339 + // 将地图在水平位置上移动x像素,垂直位置上移动y像素。
  340 + mapBValue.panBy(10,-150,PanOptions_);
  341 +
  342 + //开启信息窗口
  343 + mapBValue.openInfoWindow(infoWindow_target,pointPolygon);
  344 +
  345 + }
  346 +
  347 + },
  348 +
  349 + editPolyUpline : function() {
  350 + // 禁止覆盖物在map.clearOverlays方法中被清除。(自 1.1 新增)
  351 + polyUpline.disableMassClear();
  352 + WorldsBMap.clearMarkAndOverlays();
  353 + // 允许覆盖物在map.clearOverlays方法中被清除。(自 1.1 新增)
  354 + polyUpline.enableMassClear();
  355 + // 开启线路编辑
  356 + polyUpline.enableEditing();
  357 + // 添加双击折线保存事件
  358 + polyUpline.addEventListener('dblclick',function(e) {
  359 + // 关闭
  360 + layer.closeAll();
  361 + polyUpline.disableEditing();
  362 + // 获取折线坐标集合
  363 + var editPloyLineArray = polyUpline.getPath();
  364 + EditSectionObj.setEitdBsectionVector(JSON.stringify(editPloyLineArray));
  365 + polyUpline= '';
  366 + // 加载修改路段弹出层mobal页面
  367 + $.get('editsection.html', function(m){
  368 + $(pjaxContainer).append(m);
  369 + $('#edit_section_mobal').trigger('editSectionMobal_show', [WorldsBMap,GetAjaxData,EditSectionObj,PublicFunctions]);
  370 + });
  371 + });
  372 + },
  373 +
  374 + // 画圆
  375 + pointsCircle : function(objStation) {
  376 +
  377 + // 将视图切换到指定的缩放等级,中心点坐标不变。注意:当有信息窗口在地图上打开时,地图缩放将保证信息窗口所在的坐标位置不动。(自1.2新增)
  378 + mapBValue.setZoom(16);
  379 +
  380 + if(objStation) {
  381 +
  382 + // 清除地图覆盖物
  383 + mapBValue.clearOverlays();
  384 +
  385 + // 获取中心坐标点字符串分割
  386 + var BJwpoints = objStation.stationBJwpoints.split(' ');
  387 +
  388 + // 中心坐标点
  389 + var point = new BMap.Point(BJwpoints[0], BJwpoints[1]);
  390 +
  391 + //创建圆
  392 + circle = new BMap.Circle(point,objStation.stationRadius,{strokeColor:"blue", strokeWeight:2, strokeOpacity:0.5});
  393 +
  394 + // 允许覆盖物在map.clearOverlays方法中被清除
  395 + circle.enableMassClear();
  396 +
  397 + // 百度地图添加覆盖物圆
  398 + mapBValue.addOverlay(circle);
  399 +
  400 + // 信息窗口参数属性
  401 + var opts = {
  402 +
  403 + // 信息窗口宽度
  404 + width : 200,
  405 +
  406 + // 信息窗口高度
  407 + height : 450,
  408 +
  409 + // 信息窗位置偏移值。
  410 + offset: new BMap.Size(500,120),
  411 +
  412 + //标题
  413 + title : '<h4 style="color:#FFFFFF">'+objStation.stationStationName+'站详情</h4>',
  414 +
  415 + //设置不允许信窗发送短息
  416 + enableMessage : false,
  417 +
  418 + //是否开启点击地图关闭信息窗口
  419 + enableCloseOnClick : false,
  420 +
  421 + // 是否开启信息窗口打开时地图自动移动(默认开启)。(自 1.1 新增)
  422 + enableAutoPan:false
  423 + };
  424 +
  425 + var markTypeStr = '';
  426 +
  427 + if(objStation.stationRouteStationMark=='B') {
  428 +
  429 + markTypeStr='起点站';
  430 +
  431 + }else if(objStation.stationRouteStationMark=='Z') {
  432 +
  433 + markTypeStr ='中途站';
  434 +
  435 +
  436 + }else if(objStation.stationRouteStationMark=='E') {
  437 +
  438 + markTypeStr='终点站';
  439 +
  440 + }
  441 +
  442 + var htm = '<HR style="border:1 dashed #987cb9" width="100%" color=#987cb9 SIZE=1>'+
  443 + '<span style="color:#DDD;font-size: 15px;">站点名称:' + objStation.stationStationName + '</span>' +
  444 + '<span class="help-block" style="color:#DDD;font-size: 15px;">站点编码:' + objStation.stationStationCod + '</span>' +
  445 + '<span class="help-block" style="color:#DDD;font-size: 15px;">站点序号:' + objStation.stationRouteStationRouteCode + '</span>' +
  446 + '<span class="help-block" style="color:#DDD;font-size: 15px;">站点类型:' + markTypeStr + '</span>' +
  447 + '<span class="help-block" style="color:#DDD;font-size: 15px;">纬度坐标:' + objStation.stationBJwpoints + '</span>' +
  448 + '<span class="help-block" style="color:#DDD;font-size: 15px;">到站时间:' + objStation.stationRouteToTime + '&nbsp;分钟</span>' +
  449 + '<span class="help-block" style="color:#DDD;font-size: 15px;">到站距离:' + objStation.stationRouteDistances + '&nbsp;公里</span>' +
  450 + '<span class="help-block" style="color:#DDD;font-size: 15px;">范围半径:' + objStation.stationRadius + '</span>' +
  451 + '<span class="help-block" style="color:#DDD;font-size: 15px;">版本 号:' + objStation.stationRouteVersions + '</span>' +
  452 + '<span class="help-block" style="width: 100%;font-size: 15px;;color:#DDD;'+
  453 + 'overflow: hidden; white-space: nowrap; text-overflow: ellipsis; " title="'+
  454 + objStation.stationRouteDescriptions +'" >说明/描述:' + objStation.stationRouteDescriptions + '</span>' ;
  455 +
  456 + // 创建信息窗口
  457 + var infoWindow_target = new BMap.InfoWindow(htm, opts);
  458 + // 自定义标注物图片
  459 + var icon_target = new BMap.Icon('/pages/base/stationroute/css/img/cz.png',new BMap.Size(20, 20));
  460 +
  461 + // 创建点
  462 + marker = new BMap.Marker(point,{icon : icon_target});
  463 +
  464 + // 把标注添物加到地图上
  465 + mapBValue.addOverlay(marker);
  466 +
  467 + setTimeout(function(){
  468 + //开启信息窗口
  469 + marker.openInfoWindow(infoWindow_target,point);
  470 +
  471 + },100);
  472 +
  473 + // 是否在平移过程中禁止动画。(自1.2新增)
  474 + var PanOptions_ ={noAnimation :true};
  475 +
  476 + // 将地图的中心点更改为给定的点。
  477 + mapBValue.panTo(point,PanOptions_);
  478 +
  479 + mapBValue.panBy(10,-200,PanOptions_);
  480 +
  481 + // 添加标志物监听事件
  482 + marker.addEventListener("click",function() {
  483 +
  484 + //开启信息窗口
  485 + marker.openInfoWindow(infoWindow_target,point);
  486 +
  487 + });
  488 +
  489 + }
  490 +
  491 + },
  492 +
  493 + // 根据地理名称获取百度经纬度坐标
  494 + localSearchFromAdreesToPoint: function(Address,callback) {
  495 +
  496 + // 创建一个搜索类实例
  497 + var localSearch = new BMap.LocalSearch(mapBValue);
  498 +
  499 + // 检索完成后的回调函数。
  500 + localSearch.setSearchCompleteCallback(function (searchResult) {
  501 +
  502 + var resultPoints = '';
  503 +
  504 + if(searchResult) {
  505 +
  506 + // 返回索引指定的结果。索引0表示第1条结果
  507 + var poi = searchResult.getPoi(0);
  508 +
  509 + if(poi) {
  510 +
  511 + //获取经度和纬度
  512 + resultPoints = poi.point.lng + ' ' + poi.point.lat;
  513 +
  514 + callback && callback(resultPoints);
  515 +
  516 + }else {
  517 +
  518 + callback && callback(false);
  519 +
  520 + }
  521 +
  522 + }else {
  523 +
  524 + callback && callback(false);
  525 + }
  526 +
  527 + });
  528 +
  529 + // 根据检索词发起检索。
  530 + localSearch.search(Address);
  531 +
  532 + },
  533 +
  534 + // 编辑图形
  535 + editShapes : function(editStationName,stationShapesTypeV,mindex) {
  536 +
  537 + // 关闭信息窗口
  538 + marker.closeInfoWindow();
  539 +
  540 + // 清除marker
  541 + mapBValue.removeOverlay(marker);
  542 +
  543 + // 编辑圆
  544 + if(stationShapesTypeV =='r') {
  545 +
  546 + // 开启编辑功能
  547 + circle.enableEditing();
  548 +
  549 + // 编辑圆监听事件
  550 + circle.addEventListener('dblclick',function() {
  551 +
  552 + // 关闭提示弹出层
  553 + layer.close(mindex);
  554 +
  555 + // 返回圆形的半径,单位为米。
  556 + var newRadius = circle.getRadius();
  557 +
  558 + // 返回圆形的中心点坐标。
  559 + var newCenter = circle.getCenter().lng + ' ' + circle.getCenter().lat;
  560 +
  561 + var centre_New = [{potion:{lng:circle.getCenter().lng,lat:circle.getCenter().lat}}];
  562 +
  563 + /** 设置修改站点集合对象站点中心点百度坐标属性值 @param:<bJwpoints:中心点百度坐标) */
  564 + EditStationObj.setEitdStationBJwpoints(newCenter);
  565 +
  566 + /** 设置修改站点集合对象范围图形类型属性值 @param:<shapesType:范围图形类型) */
  567 + EditStationObj.setEitdStationShapesType('r');
  568 +
  569 + /** 设置修改站点集合对象圆形半径属性值 @param:<radius:圆形半径) */
  570 + EditStationObj.setEitdStationRadius(Math.round(newRadius));
  571 +
  572 + /** 设置修改站点集合对象图形百度坐标集合属性值 @param:<bPolygonGrid:图形百度坐标集合) */
  573 + EditStationObj.setEitdBPolygonGrid('');
  574 +
  575 + // 加载编辑页面
  576 + $.get('edit.html', function(m){
  577 +
  578 + $(pjaxContainer).append(m);
  579 +
  580 + $('#edit_station_mobal').trigger('editSelectMobal_show', [WorldsBMap,GetAjaxData,EditStationObj,LineObj,PublicFunctions]);
  581 +
  582 + });
  583 +
  584 + });
  585 +
  586 + // 编辑多变行
  587 + }else if(stationShapesTypeV =='d') {
  588 +
  589 + // 开启编辑功能(自 1.1 新增)
  590 + polygon.enableEditing();
  591 +
  592 + // 添加多变行编辑事件
  593 + polygon.addEventListener('dblclick',function(e) {
  594 +
  595 + // 获取编辑的多边形对象
  596 + var edit_pointE = polygon;
  597 +
  598 + var edit_bPloygonGrid = "";
  599 +
  600 + var editPolyGonLen_ = edit_pointE.getPath().length;
  601 +
  602 + for(var k =0;k<editPolyGonLen_;k++) {
  603 +
  604 + if(k==0) {
  605 +
  606 + edit_bPloygonGrid = edit_pointE.getPath()[k].lng + ' ' + edit_pointE.getPath()[k].lat;
  607 +
  608 + }else {
  609 +
  610 + edit_bPloygonGrid = edit_bPloygonGrid + ',' + edit_pointE.getPath()[k].lng + ' ' + edit_pointE.getPath()[k].lat;
  611 +
  612 + }
  613 +
  614 + }
  615 +
  616 + edit_bPloygonGrid = edit_bPloygonGrid + ',' + edit_pointE.getPath()[0].lng + ' ' + edit_pointE.getPath()[0].lat;
  617 +
  618 + // 多边形中心点
  619 + var centre_points = edit_pointE.getBounds().getCenter().lng + ' ' + edit_pointE.getBounds().getCenter().lat;
  620 +
  621 + /** 设置修改站点集合对象站点中心点百度坐标属性值 @param:<bJwpoints:中心点百度坐标) */
  622 + EditStationObj.setEitdStationBJwpoints(centre_points);
  623 +
  624 + /** 设置修改站点集合对象范围图形类型属性值 @param:<shapesType:范围图形类型) */
  625 + EditStationObj.setEitdStationShapesType('d');
  626 +
  627 + /** 设置修改站点集合对象圆形半径属性值 @param:<radius:圆形半径) */
  628 + EditStationObj.setEitdStationRadius('');
  629 +
  630 + /** 设置修改站点集合对象图形百度坐标集合属性值 @param:<bPolygonGrid:图形百度坐标集合) */
  631 + EditStationObj.setEitdBPolygonGrid(edit_bPloygonGrid);
  632 +
  633 + $.get('edit.html', function(m){
  634 +
  635 + $(pjaxContainer).append(m);
  636 +
  637 + $('#edit_station_mobal').trigger('editSelectMobal_show', [WorldsBMap,GetAjaxData,EditStationObj,LineObj,PublicFunctions]);
  638 +
  639 + });
  640 +
  641 + });
  642 +
  643 + }
  644 +
  645 + },
  646 +
  647 + // 在地图上画出上行线路走向
  648 + drawingUpline : function (polylineArray,polyline_center,data) {
  649 + /*WorldsBMap.clearMarkAndOverlays();*/
  650 + polyUpline = '';
  651 + // 创建线路走向
  652 + polyUpline = new BMap.Polyline(polylineArray, {strokeColor : "blue",strokeWeight : 6,strokeOpacity : 0.5});
  653 + // polyUpline.data = data;
  654 + // 把折线添加到地图上
  655 + mapBValue.addOverlay(polyUpline);
  656 + /*var ceter_index = Math.round(resultdata.length / 2);
  657 +
  658 + var ceterPointsStr = resultdata[ceter_index].bJwpoints;
  659 +
  660 + var ceterPointsArray = ceterPointsStr.split(' ');
  661 +
  662 + var polyline_center = new BMap.Point(ceterPointsArray[0],ceterPointsArray[1]);*/
  663 + var PanOptions_ ={noAnimation :true};
  664 + mapBValue.reset();
  665 + mapBValue.panTo(polyline_center,PanOptions_);
  666 + mapBValue.panBy(500,-510,PanOptions_);
  667 + mapBValue.setZoom(14);
  668 + },
  669 +
  670 + //在地图上画出公交位置。
  671 + drawingBus :function(lon,lat){
  672 + var point = new BMap.Point(lon,lat);
  673 + var myIcon = new BMap.Icon("/pages/excep/img/bus.png", new BMap.Size(300,157));
  674 + var marker = new BMap.Marker(point,{icon:myIcon}); // 创建标注
  675 + mapBValue.addOverlay(marker);
  676 + marker.setAnimation(BMAP_ANIMATION_BOUNCE); //跳动的动画
  677 + },
  678 +
  679 + // 在地图上画出上行线路走向
  680 + drawingUpline01 : function (polylineArray,polyline_center,data) {
  681 + var polyUpline01 = 'polyline' + '_' + data.sectionrouteId;
  682 + // 创建线路走向
  683 + polyUpline01 = new BMap.Polyline(polylineArray, {strokeColor : "blue",strokeWeight : 6,strokeOpacity : 0.5});
  684 + polyUpline01.data = data;
  685 + // 把折线添加到地图上
  686 + mapBValue.addOverlay(polyUpline01);
  687 + polyUpline01.addEventListener('click',function(e) {
  688 + if(WorldsBMap.getIsEditStatus()) {
  689 + layer.msg('请先保存正在编辑的路段信息...');
  690 + return false;
  691 + }
  692 + polyUpline01.enableEditing();
  693 + WorldsBMap.setIsEditStatus(true);
  694 + });
  695 + // 添加双击折线保存事件
  696 + polyUpline01.addEventListener('dblclick',function(e) {
  697 + WorldsBMap.setIsEditStatus(false);
  698 + // 关闭
  699 + layer.closeAll();
  700 + polyUpline01.disableEditing();
  701 + EditSectionObj.setEitdSection(polyUpline01.data);
  702 + // 获取折线坐标集合
  703 + var editPloyLineArray = polyUpline01.getPath();
  704 + EditSectionObj.setEitdBsectionVector(JSON.stringify(editPloyLineArray));
  705 + // polyUpline= '';
  706 + // 加载修改路段弹出层mobal页面
  707 + $.get('editsection.html', function(m){
  708 + $(pjaxContainer).append(m);
  709 + $('#edit_section_mobal').trigger('editSectionMobal_show', [WorldsBMap,GetAjaxData,EditSectionObj,PublicFunctions]);
  710 + });
  711 + });
  712 + var PanOptions_ ={noAnimation :true};
  713 + mapBValue.reset();
  714 + mapBValue.panTo(polyline_center,PanOptions_);
  715 + mapBValue.panBy(500,-510,PanOptions_);
  716 + mapBValue.setZoom(14);
  717 + },
  718 +
  719 + /** 在地图上画点 @param:<point_center:中心坐标点> */
  720 + drawingUpStationPoint : function(point_center,stationName,s) {
  721 +
  722 + // 自定义标注物图片
  723 + var icon_target = new BMap.Icon('/pages/base/stationroute/css/img/gjzd.png',new BMap.Size(10, 10));
  724 +
  725 + var html2 = '<div style="position: absolute; margin: 0pt; padding: 0pt; width: 160px; height: 26px; left: -10px; top: -35px; overflow: hidden;">'
  726 + + '<img class="rm3_image" style="border:none;left:0px; top:0px; position:absolute;" src="/pages/base/stationroute/css/img/back160.png">'
  727 + + '</div>'
  728 + + '<label class=" BMapLabel" unselectable="on" style="position: absolute; -moz-user-select: none; display: inline; cursor: inherit; border: 0px none; padding: 2px 1px 1px; white-space: nowrap; font: 12px arial,simsun; z-index: 80; color: rgb(255, 102, 0); left: 15px; top: -35px;"><span style="float: left; color: #fdfdfd; margin-left: -22px; font-size: 6px;">'+ s+'</span>'+ stationName+'</label>';
  729 +
  730 +
  731 + var myRichMarker1 = new BMapLib.RichMarker(html2, point_center,{
  732 + "anchor" : new BMap.Size(-10,8),
  733 + "enableDragging" : true});
  734 +
  735 +
  736 + myRichMarker1.disableDragging();
  737 + mapBValue.addOverlay(myRichMarker1);
  738 +
  739 +
  740 + // 创建标注物
  741 + marker = new BMap.Marker(point_center,{icon : icon_target});
  742 +
  743 + // 允许覆盖物在map.clearOverlays方法中被清除。
  744 + marker.enableMassClear();
  745 +
  746 + mapBValue.addOverlay(marker);
  747 + },
  748 +
  749 + // 站点名称获取百度坐标(手动规划)
  750 + stationsNameToPoints : function(arra,callback) {
  751 + // 获取长度
  752 + var len = arra.length;
  753 + var stationList = [];
  754 + (function(){
  755 + if (!arguments.callee.count) {
  756 + arguments.callee.count = 0;
  757 + }
  758 + arguments.callee.count++;
  759 + var index = parseInt(arguments.callee.count) - 1;
  760 + if (index >= len) {
  761 + callback && callback(stationList);
  762 + return ;
  763 + }
  764 + var f = arguments.callee;
  765 + if(arra[index].name!=''){
  766 + var localSearch = new BMap.LocalSearch(mapBValue);
  767 + localSearch.search(arra[index].name);
  768 + localSearch.setSearchCompleteCallback(function (searchResult) {
  769 + var poi = searchResult.getPoi(0);
  770 + if(poi) {
  771 + stationList.push({name:arra[index].name.replace('公交车站',''),wgs:arra[index].wgs,potion:{lng:poi.point.lng,lat:poi.point.lat}});
  772 + }else {
  773 + stationList.push({name:arra[index].name.replace('公交车站',''),wgs:arra[index].wgs,potion:{lng:arra[index].wgs.x,lat:arra[index].wgs.y}});
  774 + }
  775 + f();
  776 + });
  777 + }else {
  778 + f();
  779 + }
  780 + })();
  781 + },
  782 +
  783 + // 根据坐标点获取两点之间的时间与距离(手动规划)
  784 + getDistanceAndTotime : function(stationList,cb) {
  785 +
  786 + stationList[0].distance = '';
  787 +
  788 + stationList[0].duration = '';
  789 +
  790 + // var sectionList = [];
  791 +
  792 + // 获取长度
  793 + var len = stationList.length;
  794 +
  795 + (function(){
  796 +
  797 + if (!arguments.callee.count) {
  798 +
  799 + arguments.callee.count = 0;
  800 +
  801 + }
  802 +
  803 + arguments.callee.count++;
  804 +
  805 + var index = parseInt(arguments.callee.count) - 1;
  806 +
  807 + if (index >= len-1) {
  808 +
  809 + // cb && cb(stationList,sectionList);
  810 + cb && cb(stationList);
  811 + return;
  812 + }
  813 +
  814 + var f = arguments.callee;
  815 +
  816 + var poiOne = new BMap.Point(stationList[index].potion.lng,stationList[index].potion.lat);
  817 +
  818 + var poiTwo = new BMap.Point(stationList[index+1].potion.lng,stationList[index+1].potion.lat);
  819 +
  820 + var transit = new BMap.TransitRoute(mapBValue, {renderOptions: {map: mapBValue},onSearchComplete: searchComplete});
  821 +
  822 + transit.search(poiOne,poiTwo);
  823 +
  824 + function searchComplete(results){
  825 +
  826 + var plan = results.getPlan(0);
  827 +
  828 + if (transit.getStatus() != BMAP_STATUS_SUCCESS){
  829 +
  830 + stationList[index+1].distance = '';
  831 +
  832 + stationList[index+1].duration = '';
  833 +
  834 + // sectionList.push({sectionName:stationList[index].name+stationList[index+1].name,points:''});
  835 +
  836 + }else {
  837 +
  838 + stationList[index+1].distance = plan.getDistance(true);
  839 +
  840 + stationList[index+1].duration = plan.getDuration(true);
  841 +
  842 + // var line = plan.getRoute(0);
  843 +
  844 + // sectionList.push({sectionName:stationList[index].name+stationList[index+1].name,points:line.getPath()});
  845 +
  846 + }
  847 +
  848 + f();
  849 + }
  850 +
  851 + })();
  852 +
  853 + },
  854 +
  855 + // 根据坐标点获取两点之间的折线路段(手动规划)
  856 + getSectionListPlonly : function(stationsPoint,cb) {
  857 +
  858 + var len = stationsPoint.length;
  859 +
  860 + var sectionList = [];
  861 +
  862 + (function(){
  863 +
  864 + if (!arguments.callee.count) {
  865 +
  866 + arguments.callee.count = 0;
  867 +
  868 + }
  869 +
  870 + arguments.callee.count++;
  871 +
  872 + var index = parseInt(arguments.callee.count) - 1;
  873 +
  874 + if (index >= len-1 ) {
  875 +
  876 + cb && cb(sectionList);
  877 + return;
  878 + }
  879 +
  880 + var f = arguments.callee;
  881 +
  882 + var poiOne = new BMap.Point(stationsPoint[index].potion.lng,stationsPoint[index].potion.lat);
  883 +
  884 + var poiTwo = new BMap.Point(stationsPoint[index+1].potion.lng,stationsPoint[index+1].potion.lat);
  885 +
  886 + /* var transit = new BMap.TransitRoute(mapB, {renderOptions: {map: mapB},onPolylinesSet: searchPolylinesSet});*/
  887 +
  888 + var transit = new BMap.DrivingRoute(mapBValue, {renderOptions: {map: mapBValue},onPolylinesSet: searchPolylinesSet});
  889 +
  890 + function searchPolylinesSet(results){
  891 +
  892 + if (transit.getStatus() != BMAP_STATUS_SUCCESS){
  893 +
  894 +
  895 + }else {
  896 +
  897 + var sectionArrayList = [];
  898 + for (i = 0; i < results.length; i++){
  899 +
  900 + // console.log(results[i].getPolyline().getPath());
  901 + sectionArrayList = sectionArrayList.concat(results[i].getPolyline().getPath());
  902 +
  903 + }
  904 +
  905 + var sectionName = stationsPoint[index].name + '至' + stationsPoint[index+1].name;
  906 +
  907 + sectionList.push({sectionName:sectionName,points:sectionArrayList});
  908 +
  909 + }
  910 +
  911 + f();
  912 + }
  913 +
  914 + transit.search(poiOne,poiTwo);
  915 +
  916 + })();
  917 +
  918 + },
  919 +
  920 + localtionPoint : function(stationNameV) {
  921 +
  922 + WorldsBMap.localSearchFromAdreesToPoint(stationNameV,function(Points) {
  923 +
  924 + if(Points) {
  925 +
  926 + var BJwpointsArray = Points.split(' ');
  927 +
  928 + var stationNameChangePoint = new BMap.Point(BJwpointsArray[0], BJwpointsArray[1]);
  929 +
  930 + var marker_stargt2 = new BMap.Marker(stationNameChangePoint);
  931 +
  932 + var PanOptions ={noAnimation :true};
  933 +
  934 + mapBValue.panTo(stationNameChangePoint,PanOptions);
  935 +
  936 + mapBValue.panBy(0,-100);
  937 +
  938 + // 将标注添加到地图中
  939 + mapBValue.addOverlay(marker_stargt2);
  940 +
  941 + //跳动的动画
  942 + marker_stargt2.setAnimation(BMAP_ANIMATION_BOUNCE);
  943 +
  944 + }
  945 +
  946 + });
  947 +
  948 + },
  949 +
  950 + /** 系统规划抓去数据 @param lineNameValue:线路名称;i:方向*/
  951 + getBmapStationNames : function(lineNameValue,i,callback) {
  952 +
  953 + var busline = new BMap.BusLineSearch(mapBValue,{
  954 +
  955 + // 设置公交列表查询后的回调函数。参数:rs: BusListResult类型
  956 + onGetBusListComplete:function(BusListResult) {
  957 +
  958 + // 如果不为空
  959 + if(BusListResult){
  960 +
  961 + //获取第一个公交列表显示到map上
  962 + var fstLine = BusListResult.getBusListItem(i);
  963 +
  964 + /*if(fstLine==undefined){
  965 +
  966 + layer.confirm('系统无法生成该线路【'+lineNameValue+'】的站点与路段!请点击返回选择其它方式规划', {btn : [ '返回' ],icon: 3, title:'提示' }, function(index){
  967 +
  968 + layer.closeAll();
  969 +
  970 + if(i==0){
  971 +
  972 + $('#upToolsMobal').show();
  973 +
  974 + }else if(i==1){
  975 +
  976 + $('#downToolsMobal').show();
  977 +
  978 + }
  979 +
  980 + return;
  981 + });
  982 +
  983 + }*/
  984 +
  985 + if(fstLine==undefined){
  986 +
  987 +
  988 + callback && callback(null);
  989 +
  990 + }
  991 +
  992 + busline.getBusLine(fstLine);
  993 +
  994 + }
  995 +
  996 + },
  997 +
  998 + //设置公交线路查询后的回调函数.参数:rs: BusLine类型
  999 + onGetBusLineComplete: function(BusLine){
  1000 +
  1001 + // 如果不为空
  1002 + if(BusLine){
  1003 +
  1004 + callback && callback(BusLine);
  1005 +
  1006 + }
  1007 +
  1008 + }
  1009 +
  1010 + });
  1011 +
  1012 + busline.getBusList(lineNameValue);
  1013 +
  1014 + },
  1015 +
  1016 + clearMarkAndOverlays : function() {
  1017 +
  1018 + // 清楚地图覆盖物
  1019 + mapBValue.clearOverlays();
  1020 +
  1021 + mapBValue.removeOverlay();
  1022 +
  1023 + }
  1024 +
  1025 + }
  1026 +
  1027 + return Bmap;
  1028 +
  1029 +}();
0 \ No newline at end of file 1030 \ No newline at end of file
src/main/resources/static/pages/excep/js/outboundline.js 0 → 100644
  1 +/**
  2 + * 线路类
  3 + *
  4 + */
  5 +
  6 +var LineObj = function () {
  7 +
  8 + /** 定义线路对象 */
  9 +
  10 + var line={};
  11 +
  12 + var lineObj = {
  13 +
  14 + /** 初始化线路对象属性值 */
  15 + init : function(id) {
  16 + // 线路Id
  17 + line.id = id;
  18 + return line;
  19 + },
  20 +
  21 + /** 获取线路对象 @return:<line:线路对象> */
  22 + getLineObj : function() {
  23 +
  24 + return line;
  25 + }
  26 +
  27 + }
  28 +
  29 + return lineObj;
  30 +
  31 +}();
0 \ No newline at end of file 32 \ No newline at end of file
src/main/resources/static/pages/excep/js/outboundmap-function.js 0 → 100644
  1 +/**
  2 + * 函数
  3 + *
  4 + * - - - - - - - 》 getCurrSelNode : 获取选中树节点数据函数
  5 + *
  6 + * - - - - - - - 》 resjtreeDate : 刷新树函数函数
  7 + *
  8 + * - - - - - - - 》 setFormInputValue : 新增站点参数集合赋值函数
  9 + *
  10 + * - - - - - - - 》 editSetStationParmas : 编辑站点参数集合赋值函数
  11 + *
  12 + * - - - - - - - 》 editSeteditStationParmasValue:编辑站点范围图形参数集合赋值函数
  13 + *
  14 + * - - - - - - - 》 lineNameIsHaveInterval : 系统规划时修正线路名称
  15 + *
  16 + * - - - - - - - 》 systemLineStation:系统规划保存函数
  17 + *
  18 + * - - - - - - - 》 stationRevoke :撤销站点
  19 + *
  20 + * - - - - - - - 》 editLinePlan :编辑线路走向
  21 + *
  22 + * - - - - - - - 》 setFormValue :编辑站点设置表单元素值
  23 + *
  24 + * - - - - - - - 》 eachSectionList:路段折线百度坐标转WGS坐标
  25 + */
  26 +
  27 +var lon = longitude;
  28 +var lat = latitude;
  29 +
  30 +var PublicFunctions = function () {
  31 + var PubFun = {
  32 + /** 初始化线路标题与ID */
  33 + setTiteText : function(lineId) {
  34 + // 根据线路ID获取线路名称
  35 + GetAjaxData.getIdLineName(lineId,function(data) {
  36 + // 定义线路名称
  37 + var lineNameV = data.name;
  38 + $('.portlet-title .caption').text(lineNameV);
  39 + });
  40 + },
  41 + /** @param diraction 方向 @return array */
  42 + getCurrSelNode : function(diraction){
  43 + // 定义Obj
  44 + var array = [];
  45 + try {
  46 + // 上行
  47 + if(diraction=='0'){
  48 + // 获取上行选中节点
  49 + array = $.jstree.reference("#station_Up_tree").get_selected(true);
  50 + // 下行
  51 + }else if(diraction=='1'){
  52 + // 获取下行选中节点
  53 + array = $.jstree.reference("#station_Down_tree").get_selected(true);
  54 + }
  55 + } catch (e) {
  56 + console.log(e);
  57 + }
  58 + // 返回Obj
  59 + return array;
  60 + },
  61 + /** @param id:线路ID ;directionData:方向 */
  62 + resjtreeDate : function(id,directionData){
  63 + // 获取树数据
  64 + GetAjaxData.getStation(id,directionData,function(treeDateJson) {
  65 + // 获取数据长度
  66 + var len = treeDateJson[0].children[0].children.length;
  67 + // 上行
  68 + if(directionData==0){
  69 + // 长度大于零
  70 + if(len>0) {
  71 + // 隐藏上行规划
  72 + $('#upToolsMobal').hide();
  73 + // 显示树
  74 + $('#uptreeMobal').show();
  75 + // 刷新树
  76 + StationTreeData.upreloadeTree(treeDateJson);
  77 + }else {
  78 + // 显示上行规划
  79 + $('#upToolsMobal').show();
  80 + // 隐藏上行树
  81 + $('#uptreeMobal').hide();
  82 + }
  83 +
  84 + // 下行
  85 + }else if(directionData==1){
  86 + // 如果长度大于
  87 + if(len>0) {
  88 + // 隐藏下行规划
  89 + $('#downToolsMobal').hide();
  90 + // 显示下行树
  91 + $('#DowntreeMobal').show();
  92 + // 跟新树
  93 + StationTreeData.dwonreloadeTree(treeDateJson);
  94 + }else {
  95 + // 显示下行规划
  96 + $('#downToolsMobal').show();
  97 + // 隐藏下行树
  98 + $('#DowntreeMobal').hide();
  99 + }
  100 + }
  101 + });
  102 + },
  103 +
  104 + /** 修正线路名称 @param:<directionUpValue:方向(0:上行;1:下行)> */
  105 + lineNameIsHaveInterval : function(directionData) {
  106 + // 定义线路名称
  107 + var lineNameV = $('.portlet-title .caption').text();
  108 + // 线路名称是否为区间线路
  109 + if(lineNameV.indexOf('区间')>0){
  110 + // 截去区间
  111 + var lineNameNew = lineNameV.replace('区间','');
  112 + // 是否继续弹出层
  113 + layer.confirm('系统无法生成该线路【'+lineNameV+'】的站点与路段!自动修改为如下线路名称【'+lineNameNew+'】生成', {
  114 + btn : [ '确认提示并提交', '取消' ]
  115 + }, function(index) {
  116 + // 关闭弹出层
  117 + layer.close(index);
  118 + // 线路名称去掉区间
  119 + lineNameV = lineNameNew;
  120 + /** 保存 @param:<lineNameV:线路名称;directionData:方向(0:上行;1:下行)> */
  121 + PublicFunctions.systemLineStation(lineNameV,directionData);
  122 + },function(){
  123 + // 关闭弹出层
  124 + layer.closeAll();
  125 + // 上行
  126 + if(directionData==0){
  127 + // 显示上行规划
  128 + $('#upToolsMobal').show();
  129 + // 下行
  130 + }else if(directionData==1){
  131 + // 显示下行规划
  132 + $('#downToolsMobal').show();
  133 + }
  134 + });
  135 +
  136 + // 线路名称是否为定班线路
  137 + }else if(lineNameV.indexOf('定班')>0){
  138 + // 截去定班
  139 + var lineNameNew = lineNameV.replace('定班','');
  140 + // 是否继续弹出层
  141 + layer.confirm('系统无法生成该线路【'+lineNameV+'】的站点与路段!自动修改为如下线路名称【'+lineNameNew+'】生成', {
  142 + btn : [ '确认提示并提交', '取消' ]
  143 + }, function(index) {
  144 + // 关闭弹出层
  145 + layer.close(index);
  146 + // 线路名称去掉区间
  147 + lineNameV = lineNameNew;
  148 + /** 保存 @param:<lineNameV:线路名称;directionData:方向(0:上行;1:下行)> */
  149 + PublicFunctions.systemLineStation(lineNameV,directionData);
  150 + },function(){
  151 + // 关闭弹出层
  152 + layer.closeAll();
  153 + // 上行
  154 + if(directionData==0){
  155 + // 显示上行规划
  156 + $('#upToolsMobal').show();
  157 + // 下行
  158 + }else if(directionData==1){
  159 + // 显示下行规划
  160 + $('#downToolsMobal').show();
  161 + }
  162 + });
  163 + }else {
  164 + /** 直接保存 @param:<lineNameV:线路名称;directionData:方向(0:上行;1:下行)> */
  165 + PublicFunctions.systemLineStation(lineNameV,directionData);
  166 + }
  167 +
  168 + },
  169 +
  170 + /** 直接保存 @param:<lineNameV:线路名称;directionData:方向(0:上行;1:下行)> */
  171 + systemLineStation : function(lineNameV,directionData) {
  172 + /** 从百度地图获取线路信息 @param:<lineNameV:线路名称;directionData:方向(0:上行;1:下行);callback>*/
  173 + WorldsBMap.lineInfoPanl(lineNameV,directionData,function(BusLine){
  174 + // 如果线路信息不为空
  175 + if(BusLine) {
  176 + /*if(BusLine.zB.length == 0){
  177 +
  178 + layer.confirm('系统生成该线路【'+lineNameV+'】时获取站点与路段异常!请联系管理员或者检查网络连接是否异常!', {
  179 + btn : [ '确认' ]
  180 + }, function(index) {
  181 +
  182 + // 关闭弹出层
  183 + layer.closeAll();
  184 +
  185 + // 上行
  186 + if(directionData==0){
  187 +
  188 + // 显示上行规划
  189 + $('#upToolsMobal').show();
  190 +
  191 + // 下行
  192 + }else if(directionData==1){
  193 +
  194 + // 显示下行规划
  195 + $('#downToolsMobal').show();
  196 +
  197 + }
  198 +
  199 + return ;
  200 + });
  201 +
  202 + }*/
  203 + // 获取公交线几何对象, 仅当结果自动添加到地图上时有效
  204 + var Polygon = BusLine.getPolyline();
  205 + // 返回多边型的点数组(自1.2新增)
  206 + var polyGonArray = Polygon.getPath();
  207 + // 获取公交站点个数(自 1.2 新增)
  208 + var stationNumber = BusLine.getNumBusStations();
  209 + // 定义线路信息集合
  210 + var stationInfo = [];
  211 + // 遍历
  212 + for(var k = 0 ; k < stationNumber; k++) {
  213 + // 定义线路信息集合
  214 + var tempM = {};
  215 + // 添加站点名称
  216 + tempM.name = BusLine.getBusStation(k).name;
  217 + // 添加站点坐标
  218 + tempM.potion = BusLine.getBusStation(k).position;
  219 + tempM.wgs = {x:'',y:''};
  220 + // 添加
  221 + stationInfo.push(tempM);
  222 + }
  223 + // 获取站点之间的距离与时间
  224 + WorldsBMap.getDistanceAndDuration(stationInfo,function(json) {
  225 + // 设置第一个站的距离
  226 + json[0].distance = '';
  227 + // 设置第一个站的时间
  228 + json[0].duration = '';
  229 + // 定义站点信息JSON字符串
  230 + var stationJSON = JSON.stringify(json);
  231 + // 定义路段信息字符串
  232 + var sectionJSON = JSON.stringify(polyGonArray);
  233 + // 参数集合
  234 + var params = {};
  235 + // 站点信息JSON字符串
  236 + params.stationJSON = stationJSON;
  237 + var addLine = LineObj.getLineObj();
  238 + // 线路ID
  239 + params.lineId = addLine.id;
  240 + // 方向
  241 + params.directions = directionData;
  242 + // 原始坐标类型
  243 + params.dbType = 'b';
  244 + // 圆形半径
  245 + params.radius = '100';
  246 + // 图形类型(r:圆形;p:多边形)
  247 + params.shapesType = 'r';
  248 + // destroy:是否撤销
  249 + params.destroy = '0';
  250 + // versions:版本号
  251 + params.versions = '1';
  252 + // 路段信息JSON字符串
  253 + params.sectionJSON = sectionJSON;
  254 + // 限速
  255 + params.speedLimit = '60';
  256 + params.baseRes = 'No';
  257 + // 保存
  258 + GetAjaxData.collectionSave(params,function(rd) {
  259 + if(rd.status='SUCCESS') {
  260 + // 关闭弹出层
  261 + layer.closeAll();
  262 + layer.msg('保存成功!');
  263 + }else {
  264 + // 保存失败
  265 + layer.msg('保存失败!');
  266 + }
  267 + // 刷新树
  268 + PublicFunctions.resjtreeDate(addLine.id,directionData);
  269 + /** 查询上行路段信息 @param:<Line.id:线路Id;0:上行> @return:data:路段数据 */
  270 + GetAjaxData.getSectionRouteInfo(addLine.id,directionData,function(data) {
  271 + /** 在地图上画出线路走向 @param:<Line.id:线路Id;0:上行;data:路段数据> */
  272 + PublicFunctions.linePanlThree(addLine.id,data,directionData);
  273 + });
  274 + });
  275 +
  276 + });
  277 + }
  278 + });
  279 + },
  280 +
  281 + /** @param directionV_ :方向 */
  282 + stationRevoke : function(directionV_) {
  283 + // 获取树选中节点对象
  284 + var obj = PublicFunctions.getCurrSelNode(directionV_);
  285 + // 是否选中,选中节点是否为站点
  286 + if(obj.length == 0 || obj[0].original.chaildredType !='station'){
  287 + // 弹出提示层
  288 + layer.msg('请先选择要删除的站点!');
  289 + return;
  290 + }
  291 + // 弹出是否撤销提示框
  292 + layer.confirm('你确定要撤销【'+obj[0].text+'】站点吗?', {btn : [ '确定撤销','返回' ],icon: 3, title:'提示' }, function(index){
  293 + // 站点路由ID
  294 + var stationRouteId = obj[0].original.stationRouteId;
  295 + // 撤销参数集合
  296 + var params = {stationRouteId:stationRouteId,destroy:'1'};
  297 + // 方向
  298 + var stationRouteDirections = obj[0].original.stationRouteDirections;
  299 + // 撤销
  300 + GetAjaxData.stationRouteIsDestroy(params,function(result) {
  301 + // 关闭弹出框
  302 + layer.close(index);
  303 + if(result.status=='SUCCESS'){
  304 + layer.msg('撤销上行站点【'+obj[0].text+'】成功!');
  305 + }else{
  306 + layer.msg('撤销上行站点【'+obj[0].text+'】失败!');
  307 + }
  308 + WorldsBMap.clearMarkAndOverlays();
  309 + var Line = LineObj.getLineObj();
  310 + // 刷行左边树
  311 + PublicFunctions.resjtreeDate(Line.id,stationRouteDirections);
  312 + /** 查询上行路段信息 @param:<Line.id:线路Id;0:上行> @return:data:路段数据 */
  313 + GetAjaxData.getSectionRouteInfo(Line.id,stationRouteDirections,function(data) {
  314 + /** 在地图上画出线路走向 @param:<Line.id:线路Id;0:上行;data:路段数据> */
  315 + PublicFunctions.linePanlThree(Line.id,data,stationRouteDirections);
  316 + });
  317 + });
  318 + });
  319 + },
  320 +
  321 + /** @param direction_ :方向 */
  322 + editLinePlan : function(direction_) {
  323 + var sel = PublicFunctions.getCurrSelNode(direction_);
  324 + if(sel.length==0 || sel[0].original.chaildredType !='section'){
  325 + if(direction_=='0') {
  326 + layer.msg('请先选中要编辑的上行路段!');
  327 + }else if(direction_=='1') {
  328 + layer.msg('请先选中要编辑的下行路段!');
  329 + }
  330 + return;
  331 + }
  332 + $('#downLine').addClass('btn disabled');
  333 + $('.btn-circle').addClass('disabled');
  334 + $('#upLine').addClass('btn disabled');
  335 + var editSectionV = sel[0].original;
  336 + EditSectionObj.setEitdSection(editSectionV);
  337 + // 弹出添加失败提示消息,2秒关闭(如果不配置,默认是3秒)
  338 + var yindex = layer.msg('编辑完线路走向后,请双击线路走向区域保存',{ offset: '126px',shift: 0,time: 10000});
  339 + WorldsBMap.editPolyUpline();
  340 + },
  341 +
  342 + setFormValue : function(editStationParmas) {
  343 + // 站点ID
  344 + $('#stationIdInput').val(editStationParmas.stationId);
  345 + // 站点路由ID
  346 + $('#stationRouteIdInput').val(editStationParmas.stationRouteId);
  347 + // 站点路由线路Id
  348 + $('#stationRouteLineInput').val(editStationParmas.stationRouteLine);
  349 + // 线路编码
  350 + $('#lineCodeInput').val(editStationParmas.stationRouteLineCode);
  351 + // 百度坐标点图形集合
  352 + $('#bPolygonGridInput').val(editStationParmas.stationBPolygonGrid);
  353 + // 获取站点名称元素设值
  354 + $('#zdmcInput').val(editStationParmas.stationStationName);
  355 + // 获取站点路由名称元素设值
  356 + $('#stationNameInput').val(editStationParmas.stationRouteStationName);
  357 + // 获取站点编码元素设值
  358 + $('#stationCodInput').val(editStationParmas.stationStationCod);
  359 + // 获取站点类型元素设值
  360 + // $('#stationMarkSelect').val(editStationParmas.stationRouteStationMark);
  361 + // 获取站点方向元素设值
  362 + $('#stationdirSelect').val(editStationParmas.stationRouteDirections);
  363 + // 获取站点道路编码元素设值
  364 + $('#roadCodingCodInput').val(editStationParmas.stationRoadCoding);
  365 + // 百度地图经纬度坐标中心点
  366 + $('#bJwpointsInput').val(editStationParmas.stationBJwpoints);
  367 + if(editStationParmas.stationShapesType=='r') {
  368 + // 获取图形类型元素,并添加值
  369 + $('#shapesTypeSelect').val('圆形');
  370 + }else if(editStationParmas.stationShapesType=='d'){
  371 + $('#radiusGroup').hide();
  372 + $('#shapesTypeSelect').val('多边形');
  373 + }
  374 + // 获取半径元素,并添加值
  375 + $('#radiusInput').val(editStationParmas.stationRadius);
  376 + // 是否撤销
  377 + $('#destroySelect').val(editStationParmas.stationDestroy);
  378 + // 到站时间
  379 + $('#toTimeInput').val(editStationParmas.stationRouteToTime);
  380 + // 到站距离
  381 + $('#distancesInput').val(editStationParmas.stationRouteDistances);
  382 + // 描述/说明
  383 + $('#descriptionsTextarea').val(editStationParmas.stationRouteDescriptions);
  384 + },
  385 +
  386 + setSectionFormValue : function(Section) {
  387 + $('#isRoadeSpeedInput').val(Section.isRoadeSpeed);
  388 + // 路段ID
  389 + $('#sectionIdInput').val(Section.sectionId);
  390 + // 路段路由ID
  391 + $('#sectionRouteIdInput').val(Section.sectionrouteId);
  392 + // 线路ID
  393 + $('#sectionRouteLineInput').val(Section.sectionrouteLine);
  394 + // 线路编码
  395 + $('#lineCodeInput').val(Section.sectionrouteLineCode);
  396 + // 折线坐标集合
  397 + $('#bsectionVectorInput').val(Section.sectionBsectionVector);
  398 + // 路段名称
  399 + $('#sectionNameInput').val(Section.sectionName);
  400 + // 路段编码
  401 + $('#sectionCodeInput').val(Section.sectionCode);
  402 + // 路段序号
  403 + $('#sectionrouteCodeSelect').val(Section.sectionrouteCode);
  404 + // 路段方向
  405 + $('#directionsSection').val(Section.sectionrouteDirections);
  406 + // 道路编码
  407 + $('#roadCodingCodInput').val(Section.sectionRoadCoding);
  408 + // 道路限速
  409 + $('#speedLimitInput').val(Section.sectionSpeedLimet);
  410 + // 路段长度
  411 + $('#sectionDistanceInput').val(Section.sectionDistance);
  412 + // 时长
  413 + $('#sectionTimeInput').val(Section.sectionTime);
  414 + // 版本号
  415 + $('#versionsInput').val(Section.versions);
  416 + // 是否撤销
  417 + $('#destroySelect').val(Section.destroy);
  418 + // 描述/说明
  419 + $('#descriptionsTextarea').val(Section.descriptions);
  420 + },
  421 +
  422 + //lineId,data,direction
  423 + treeSectionClick: function(lineId,data,direction){
  424 + /** 获取站点路由信息 @param:<Line.id:线路Id;0:上行> @return:<resultdata:站点路由数据> */
  425 + WorldsBMap.clearMarkAndOverlays();
  426 + // 编辑路段数据
  427 + for(var d= 0; d<data.length;d++){
  428 + // 地图折线坐标点集合
  429 + var polylineArray = [];
  430 + // 获取路段折线坐标字符串
  431 + var sectionBsectionVectorStr = data[d].sectionBsectionVector;
  432 + if(sectionBsectionVectorStr==null) {
  433 + continue;
  434 + }
  435 + // 切割段折线坐标字符串
  436 + var tempStr = sectionBsectionVectorStr.substring(11,sectionBsectionVectorStr.length-1);
  437 + // 分割折线坐标字符串
  438 + var lineArray = tempStr.split(',');
  439 + for(var i = 0;i<lineArray.length;i++) {
  440 + polylineArray.push(new BMap.Point(lineArray[i].split(' ')[0],lineArray[i].split(' ')[1]));
  441 + }
  442 + var index = parseInt(polylineArray.length/2);
  443 + var center = polylineArray[index];
  444 + /** 在地图上画出线路走向 @param:<polylineArray:地图折线坐标点集合;resultdata:站点路由数据> */
  445 + WorldsBMap.drawingUpline(polylineArray,center);
  446 + /** 在地图上画点 @param:<point_center:中心坐标点> */
  447 + WorldsBMap.drawingUpStationPoint(center,data[d].name,d+1);
  448 + }
  449 + },
  450 +
  451 + /** 在地图上画出线路走向 @param:<Line.id:线路Id;0:上行;data:路段数据> */
  452 + linePanlThree : function(lineId,data,direction) {
  453 + /** 获取站点路由信息 @param:<Line.id:线路Id;0:上行> @return:<resultdata:站点路由数据> */
  454 + GetAjaxData.getStationRoutePoint(lineId,direction,function(resultdata) {
  455 + WorldsBMap.clearMarkAndOverlays();
  456 + var polyline_center;
  457 + // 如果站点路由数据不为空
  458 + if(resultdata.length>0) {
  459 + var ceter_index = Math.round(resultdata.length / 2);
  460 + var ceterPointsStr = resultdata[ceter_index].bJwpoints;
  461 + var ceterPointsArray = ceterPointsStr.split(' ');
  462 + polyline_center = new BMap.Point(ceterPointsArray[0],ceterPointsArray[1]);
  463 + // 遍历站点路由数据
  464 + for(var s = 0 ; s<resultdata.length;s++) {
  465 + // 中心点坐标字符串
  466 + var bJwpointsStr = resultdata[s].bJwpoints;
  467 + var stationName = resultdata[s].stationName;
  468 + // 起个中心点坐标字符串
  469 + var bJwpointsArray = bJwpointsStr.split(' ');
  470 + // 设置中心点
  471 + var point_center = new BMap.Point(bJwpointsArray[0],bJwpointsArray[1]);
  472 + /** 在地图上画点 @param:<point_center:中心坐标点> */
  473 + WorldsBMap.drawingUpStationPoint(point_center,stationName,s+1);
  474 + }
  475 +
  476 + }
  477 + // 路段数据长度
  478 + var dataLen = data.length;
  479 + //debugger;
  480 + // 如果大于零
  481 + if(dataLen>0) {
  482 + // 编辑路段数据
  483 + for(var d= 0; d<dataLen;d++){
  484 + // 地图折线坐标点集合
  485 + var polylineArray = [];
  486 + // 获取路段折线坐标字符串
  487 + var sectionBsectionVectorStr = data[d].sectionBsectionVector;
  488 + if(sectionBsectionVectorStr==null)
  489 + continue;
  490 + // 切割段折线坐标字符串
  491 + var tempStr = sectionBsectionVectorStr.substring(11,sectionBsectionVectorStr.length-1);
  492 + // 分割折线坐标字符串
  493 + var lineArray = tempStr.split(',');
  494 + for(var i = 0;i<lineArray.length;i++) {
  495 + polylineArray.push(new BMap.Point(lineArray[i].split(' ')[0],lineArray[i].split(' ')[1]));
  496 + }
  497 + /** 在地图上画出线路走向 @param:<polylineArray:地图折线坐标点集合;resultdata:站点路由数据> */
  498 + /*WorldsBMap.drawingUpline(polylineArray,polyline_center,data[d]);*/
  499 + WorldsBMap.drawingUpline01(polylineArray,polyline_center,data[d]);
  500 + }
  501 + }
  502 + WorldsBMap.drawingBus(lon,lat);
  503 + });
  504 + },
  505 + /** 加载树 @param:<lineId:线路ID;diraction:方向(0:上行;1:下行)> */
  506 + TreeUpOrDown : function(lineId,diraction) {
  507 + /** 获取树结果数据 @param:<lineId:线路ID;diraction:方向;callback:回调函数> */
  508 + GetAjaxData.getStation(lineId,diraction,function(treeDateJson) {
  509 + // 获取返回数据长度
  510 + var len = treeDateJson[0].children[0].children.length;
  511 + // 上行
  512 + if(diraction == 0) {
  513 + /** 初始化上行树 @param:<treeDateJson:树数据结构> */
  514 + StationTreeData.upInit(treeDateJson);
  515 + if(len>0) {
  516 + $('#upToolsMobal').hide();
  517 + $('#uptreeMobal').show();
  518 + }else {
  519 + $('#upToolsMobal').show();
  520 + $('#uptreeMobal').hide();
  521 + }
  522 + // 下行
  523 + }else if(diraction ==1) {
  524 + /** 出事画下行树 @param:<treeDateJson:树数据结构> */
  525 + StationTreeData.downInit(treeDateJson);
  526 + if(len>0) {
  527 + $('#downToolsMobal').hide();
  528 + $('#DowntreeMobal').show();
  529 + }else {
  530 + $('#downToolsMobal').show();
  531 + $('#DowntreeMobal').hide();
  532 + }
  533 + }
  534 + });
  535 + },
  536 + isHaveStationName : function(data) {
  537 + if(data.length>0) {
  538 + layer.confirm('系统已存在【'+ data[0].stationName +'】该站点位置名称,请选择【系统引用】或者更改站点名称进行新增!', {btn : [ '返回' ],icon: 3, title:'提示' }, function(index){
  539 + layer.close(index);
  540 + });
  541 + return false;
  542 + }else {
  543 + return true;
  544 + }
  545 + },
  546 + editAChangeCssRemoveDisabled : function() {
  547 + $('#downLine').removeClass('btn disabled');
  548 + $('.btn-circle').removeClass('disabled');
  549 + $('#upLine').removeClass('btn disabled');
  550 + },
  551 + // 方向代码转名称.
  552 + dirdmToName : function(value){
  553 + var srStr = '';
  554 + if(value=='0')
  555 + srStr = '上行';
  556 + else if(value=='1')
  557 + srStr = '下行';
  558 + return srStr;
  559 + },
  560 + }
  561 + return PubFun ;
  562 +}();
0 \ No newline at end of file 563 \ No newline at end of file
src/main/resources/static/pages/excep/js/outboundmap-load.js 0 → 100644
  1 +/**
  2 + * reload事件
  3 + *
  4 + *
  5 + */
  6 +
  7 +$(function(){
  8 +
  9 + // 获取参数线路ID
  10 + var no = $.url().param('no');
  11 + var up = $.url().param('up');
  12 + var paramArr = new Array();
  13 + paramArr = no.split(",");// 在每个逗号(,)处进行分解。
  14 + /*paramArr[0]:id
  15 + paramArr[1]:上下行;
  16 + paramArr[2]:经度
  17 + paramArr[3]:纬度*/
  18 + uoDown = paramArr[1];
  19 + longitude = paramArr[2];
  20 + latitude = paramArr[3];
  21 + // 如果线路ID不为空
  22 + var styleOptions = {
  23 + strokeColor : "blue",//边线颜色。
  24 + fillColor : "blue",//填充颜色。当参数为空时,圆形将没有填充效果。
  25 + strokeWeight : 3,//边线的宽度,以像素为单位。
  26 + strokeOpacity : 0.8,//边线透明度,取值范围0 - 1。
  27 + fillOpacity : 0.6,//填充的透明度,取值范围0 - 1。
  28 + strokeStyle : 'solid' //边线的样式,solid或dashed。
  29 + };
  30 + // 等候500毫秒执行
  31 + setTimeout(function(){
  32 +
  33 + /** 初始化线路对象,这里只初始化线路Id属性 @param:<id:线路ID> @return:Line */
  34 + var Line = LineObj.init(paramArr[0]);
  35 +
  36 + /** 初始化地图对象map @return:Map对象 */
  37 + var map_ = WorldsBMap.init();
  38 +
  39 + /** 初始化绘图工具类 @param:<map_:map对象;styleOptions:绘图样式对象> @return:DrawingManager对象 */
  40 + var drawingManager_ = DrawingManagerObj.init(map_,styleOptions);
  41 +
  42 + /** 查询路段信息 @param:<Line.id:线路Id;0:上行> @return:data:路段数据 */
  43 + GetAjaxData.getSectionRouteInfo(Line.id,uoDown,function(data) {
  44 + /** 在地图上画出线路走向 @param:<Line.id:线路Id;0:上行;data:路段数据> */
  45 + PublicFunctions.linePanlThree(Line.id,data,uoDown);
  46 + });
  47 + },500);
  48 +});
0 \ No newline at end of file 49 \ No newline at end of file
src/main/resources/static/pages/excep/offlineList.html
@@ -161,9 +161,17 @@ $(function(){ @@ -161,9 +161,17 @@ $(function(){
161 var icheckOptions = { 161 var icheckOptions = {
162 checkboxClass: 'icheckbox_flat-blue', 162 checkboxClass: 'icheckbox_flat-blue',
163 increaseArea: '20%' 163 increaseArea: '20%'
164 - }  
165 -  
166 - jsDoQuery(null,true); 164 + };
  165 + var toDay = new Date();
  166 + var year = toDay.getFullYear();
  167 + var Month = toDay.getMonth()+1>10?toDay.getMonth()+1:"0"+(toDay.getMonth()+1);
  168 + var Day = toDay.getDate()>10?toDay.getDate():"0"+toDay.getDate();
  169 + var date = year+"-"+Month+"-"+Day;
  170 + //时间表单默认选择当日时间。
  171 + $("input[name='date']")[0].value = date;
  172 + var parameter = new Object();
  173 + parameter.date = $("input[name='date']")[0].value;
  174 + jsDoQuery(parameter,true);
167 175
168 //重置 176 //重置
169 $('tr.filter .filter-cancel').on('click', function(){ 177 $('tr.filter .filter-cancel').on('click', function(){
@@ -201,9 +209,6 @@ $(function(){ @@ -201,9 +209,6 @@ $(function(){
201 params['page'] = page; 209 params['page'] = page;
202 var i = layer.load(2); 210 var i = layer.load(2);
203 $get('/offline/pagequery' ,params, function(data){ 211 $get('/offline/pagequery' ,params, function(data){
204 -// $.each(data.content, function(i, obj) {  
205 -// obj.lastLoginDate = moment(obj.lastLoginDate).format("YYYY-MM-DD HH:mm:ss");  
206 -// });  
207 var bodyHtm = template('offline_list_temp', {list: data.dataList}); 212 var bodyHtm = template('offline_list_temp', {list: data.dataList});
208 213
209 $('#datatable_offline tbody').html(bodyHtm) 214 $('#datatable_offline tbody').html(bodyHtm)
@@ -247,10 +252,7 @@ $(function(){ @@ -247,10 +252,7 @@ $(function(){
247 initPagination = false; 252 initPagination = false;
248 return; 253 return;
249 } 254 }
250 -  
251 -  
252 - page = num - 1;  
253 - 255 + page = num - 1;
254 var cells = $('tr.filter')[0].cells 256 var cells = $('tr.filter')[0].cells
255 ,params = {} 257 ,params = {}
256 ,name; 258 ,name;
@@ -294,52 +296,52 @@ $(function(){ @@ -294,52 +296,52 @@ $(function(){
294 }); 296 });
295 297
296 $("#line").on("change",initXl); 298 $("#line").on("change",initXl);
297 -function initXl(){  
298 - $('#nbbm').select2({  
299 - placeholder: '搜索车辆...',  
300 - ajax: {  
301 - url: '/report/carList',  
302 - dataType: 'json',  
303 - delay: 150,  
304 - data: function (params) {  
305 - return {nbbm: params.term,  
306 - gsbm:"",  
307 - fgsbm:"",  
308 - xlbm:$('#line').val()};  
309 - },  
310 - processResults: function (data) {  
311 - return {  
312 - results: data  
313 - };  
314 - },  
315 - cache: true  
316 - },  
317 - templateResult: function (repo) {  
318 - if (repo.loading) return repo.text;  
319 - var h = '<span>' + repo.text + '</span>';  
320 - h += (repo.lineName ? '&nbsp;<span class="select2-desc">' + repo.lineName + '</span>' : '');  
321 - return h;  
322 - },  
323 - escapeMarkup: function (markup) {  
324 - return markup;  
325 - },  
326 - minimumInputLength: 1,  
327 - templateSelection: function (repo) {  
328 - return repo.text;  
329 - },  
330 - language: {  
331 - noResults: function () {  
332 - return '<span style="color:red;font-size: 12px;">没有搜索到车辆!</span>';  
333 - },  
334 - inputTooShort: function (e) {  
335 - return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入自编号搜索车辆</span>';  
336 - },  
337 - searching: function () {  
338 - return '<span style="color:gray;font-size: 12px;"> 正在搜索车辆...</span>';  
339 - }  
340 - }  
341 - });  
342 -} 299 + function initXl(){
  300 + $('#nbbm').select2({
  301 + placeholder: '搜索车辆...',
  302 + ajax: {
  303 + url: '/report/carList',
  304 + dataType: 'json',
  305 + delay: 150,
  306 + data: function (params) {
  307 + return {nbbm: params.term,
  308 + gsbm:"",
  309 + fgsbm:"",
  310 + xlbm:$('#line').val()};
  311 + },
  312 + processResults: function (data) {
  313 + return {
  314 + results: data
  315 + };
  316 + },
  317 + cache: true
  318 + },
  319 + templateResult: function (repo) {
  320 + if (repo.loading) return repo.text;
  321 + var h = '<span>' + repo.text + '</span>';
  322 + h += (repo.lineName ? '&nbsp;<span class="select2-desc">' + repo.lineName + '</span>' : '');
  323 + return h;
  324 + },
  325 + escapeMarkup: function (markup) {
  326 + return markup;
  327 + },
  328 + minimumInputLength: 1,
  329 + templateSelection: function (repo) {
  330 + return repo.text;
  331 + },
  332 + language: {
  333 + noResults: function () {
  334 + return '<span style="color:red;font-size: 12px;">没有搜索到车辆!</span>';
  335 + },
  336 + inputTooShort: function (e) {
  337 + return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入自编号搜索车辆</span>';
  338 + },
  339 + searching: function () {
  340 + return '<span style="color:gray;font-size: 12px;"> 正在搜索车辆...</span>';
  341 + }
  342 + }
  343 + });
  344 + }
343 345
344 }); 346 });
345 </script> 347 </script>
346 \ No newline at end of file 348 \ No newline at end of file
src/main/resources/static/pages/excep/outBoundMap.html 0 → 100644
  1 +<link href="/pages/base/stationroute/css/bmap_base.css" rel="stylesheet" type="text/css" />
  2 +<div class="portlet-body">
  3 + <!-- 地图 -->
  4 + <div id="bmap_basic" class="bmaps"></div>
  5 +</div>
  6 +<!-- load事件 -->
  7 +<script src="/pages/excep/js/outboundmap-load.js"></script>
  8 +<!-- 线路类 -->
  9 +<script src="/pages/excep/js/outboundline.js"></script>
  10 +<!-- 绘图类 -->
  11 +<script src="/pages/base/stationroute/js/drawingManager.js"></script>
  12 +<!-- 地图类 -->
  13 +<script src="/pages/excep/js/outbound-map.js"></script>
  14 +<!-- 函数与方法 -->
  15 +<script src="/pages/excep/js/outboundmap-function.js"></script>
  16 +<!-- ajax请求类 -->
  17 +<script src="/pages/base/stationroute/js/stationroute-ajax-getdata.js"></script>
  18 +
src/main/resources/static/pages/excep/speedingList.html
@@ -54,28 +54,29 @@ @@ -54,28 +54,29 @@
54 <thead> 54 <thead>
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>  
58 - <th width="13%">车辆自编号</th>  
59 - <th width="100">工号/名字</th>  
60 - <th width="11%">路牌名</th> 57 + <th width="8%">线路</th>
  58 + <th width="10%">车辆自编号</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="20%">超速时间</th>
  63 + <th width="6%">持续时间</th>
  64 + <th width="10%">查看轨迹</th>
63 <th width="18%">操作</th> 65 <th width="18%">操作</th>
64 </tr> 66 </tr>
65 <tr role="row" class="filter"> 67 <tr role="row" class="filter">
66 <td></td> 68 <td></td>
67 <td> 69 <td>
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> 70 <select class="form-control" name="line" id="line" style="width: 180px;"></select>
70 </td> 71 </td>
71 <td> 72 <td>
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 + <select class="form-control" name="nbbm" id="nbbm" style="width: 150px;"></select>
74 </td> 74 </td>
75 - <td> 75 + <!-- <td>
76 76
77 </td> 77 </td>
78 - <td></td> 78 + <td>
  79 + </td> -->
79 <td> 80 <td>
80 <select class="form-control form-filter " name="updown"> 81 <select class="form-control form-filter " name="updown">
81 <option value="">请选择...</option> 82 <option value="">请选择...</option>
@@ -84,7 +85,16 @@ @@ -84,7 +85,16 @@
84 <option value="-1">无效</option> 85 <option value="-1">无效</option>
85 </select> 86 </select>
86 </td> 87 </td>
87 - <td> <input class="form-control" type="date" name="date" /></td> 88 + <td nowrap="nowrap">
  89 + <input class="form-control" type="date" name="startDate" style="width: 180px;"/>
  90 + -
  91 + <input class="form-control" type="date" name="endDate" style="width: 180px;"/>
  92 +
  93 + </td>
  94 + <td>
  95 + </td>
  96 + <td>
  97 + </td>
88 <td> 98 <td>
89 <button class="btn btn-sm green btn-outline filter-submit margin-bottom" > 99 <button class="btn btn-sm green btn-outline filter-submit margin-bottom" >
90 <i class="fa fa-search"></i> 搜索</button> 100 <i class="fa fa-search"></i> 搜索</button>
@@ -117,13 +127,6 @@ @@ -117,13 +127,6 @@
117 <td> 127 <td>
118 {{obj.vehicle}} 128 {{obj.vehicle}}
119 </td> 129 </td>
120 -  
121 - <td>  
122 - {{obj.jsy}}  
123 - </td>  
124 - <td>  
125 - {{obj.lpname}}  
126 - </td>  
127 <td> 130 <td>
128 {{if obj.upDown==0}} 131 {{if obj.upDown==0}}
129 上行 132 上行
@@ -137,6 +140,12 @@ @@ -137,6 +140,12 @@
137 {{obj.timestampDate}} 140 {{obj.timestampDate}}
138 </td> 141 </td>
139 <td> 142 <td>
  143 + {{obj.durationTime}}秒
  144 + </td>
  145 + <td>
  146 +
  147 + </td>
  148 + <td>
140 149
141 </td> 150 </td>
142 </tr> 151 </tr>
@@ -156,8 +165,33 @@ $(function(){ @@ -156,8 +165,33 @@ $(function(){
156 increaseArea: '20%' 165 increaseArea: '20%'
157 } 166 }
158 167
  168 + var date = new Date();
  169 + var week = date.getDay();//表明今天是周几。0-6表示周日到周六
  170 + var dateTime = date.getTime();//当前时间的时间戳,单位秒。
  171 +
  172 + var endTime = dateTime-week*24*3600*1000;//上周末、格式为时间戳。
  173 + var startTime = endTime-6*24*3600*1000;//上周一、格式为时间戳。
  174 +
  175 + var endDate = timeToData(endTime);
  176 + var startDate = timeToData(startTime);
  177 + //表单默认选择上周一到上周日的超速信息。
  178 + $("input[name='endDate']")[0].value = endDate;
  179 + $("input[name='startDate']")[0].value = startDate;
  180 + var parameter = new Object();
  181 + parameter.endDate = $("input[name='endDate']")[0].value;
  182 + parameter.startDate = $("input[name='startDate']")[0].value;
  183 + //jsDoQuery(parameter,true);
159 jsDoQuery(null,true); 184 jsDoQuery(null,true);
160 185
  186 + //时间戳转换为年月日
  187 + function timeToData(time){
  188 + var date = new Date(time);
  189 + var year = date.getFullYear();
  190 + var Month = date.getMonth()+1>10?date.getMonth()+1:"0"+(date.getMonth()+1);
  191 + var Day = date.getDate()>10?date.getDate():"0"+date.getDate();
  192 + return year+"-"+Month+"-"+Day;
  193 + }
  194 +
161 //重置 195 //重置
162 $('tr.filter .filter-cancel').on('click', function(){ 196 $('tr.filter .filter-cancel').on('click', function(){
163 $('tr.filter input, select').val('').change(); 197 $('tr.filter input, select').val('').change();
@@ -226,8 +260,8 @@ $(function(){ @@ -226,8 +260,8 @@ $(function(){
226 function showPagination(data){ 260 function showPagination(data){
227 //分页 261 //分页
228 $('#pagination').jqPaginator({ 262 $('#pagination').jqPaginator({
229 - totalPages: data.totalPage,  
230 - visiblePages: 6, 263 + totalPages: data.totalPage,//总页数
  264 + visiblePages: 6,// 中间显示页数
231 currentPage: page + 1, 265 currentPage: page + 1,
232 first: '<li class="first"><a href="javascript:void(0);">首页<\/a><\/li>', 266 first: '<li class="first"><a href="javascript:void(0);">首页<\/a><\/li>',
233 prev: '<li class="prev"><a href="javascript:void(0);">上一页<\/a><\/li>', 267 prev: '<li class="prev"><a href="javascript:void(0);">上一页<\/a><\/li>',
@@ -257,7 +291,6 @@ $(function(){ @@ -257,7 +291,6 @@ $(function(){
257 }); 291 });
258 } 292 }
259 293
260 -  
261 //删除 294 //删除
262 $('#removeButton').on('click', function(){ 295 $('#removeButton').on('click', function(){
263 if($(this).attr('disabled')) 296 if($(this).attr('disabled'))
@@ -279,7 +312,7 @@ $(function(){ @@ -279,7 +312,7 @@ $(function(){
279 } 312 }
280 initPinYinSelect2('#line',data,''); 313 initPinYinSelect2('#line',data,'');
281 314
282 -}); 315 + });
283 316
284 $("#line").on("change",initXl); 317 $("#line").on("change",initXl);
285 function initXl(){ 318 function initXl(){
src/main/resources/static/pages/excep/speedingListmh.html 0 → 100644
  1 +<div class="page-head">
  2 + <div class="page-title">
  3 + <h1>超速异常</h1>
  4 + </div>
  5 +</div>
  6 +
  7 +<ul class="page-breadcrumb breadcrumb">
  8 + <li><a href="/pages/home.html" data-pjax>主页</a> <i class="fa fa-circle"></i></li>
  9 + <li><span class="active">异常查看</span> <i class="fa fa-circle"></i></li>
  10 + <li><span class="active">超速异常</span></li>
  11 +</ul>
  12 +
  13 +<div class="row">
  14 + <div class="col-md-12">
  15 + <!-- Begin: life time stats -->
  16 + <div class="portlet light portlet-fit portlet-datatable bordered">
  17 + <div class="portlet-title">
  18 + <div class="caption">
  19 + <i class="fa fa-times-circle"></i> <span
  20 + class="caption-subject font-dark sbold uppercase">超速异常数据表</span>
  21 + </div>
  22 + <div class="actions">
  23 +<!-- <a class="btn btn-circle blue" href="add.html" data-pjax><i class="fa fa-plus"></i> 添加用户</a> -->
  24 + <!-- <button type="button" class="btn btn-circle red" disabled="disabled" id="removeButton"><i class="fa fa-trash"></i> ɾ���û�</button> -->
  25 + <!-- <div class="btn-group">
  26 + <a class="btn red btn-outline btn-circle" href="javascript:;"
  27 + data-toggle="dropdown"> <i class="fa fa-share"></i> <span
  28 + class="hidden-xs"> 系统工具</span> <i class="fa fa-angle-down"></i>
  29 + </a>
  30 + <ul class="dropdown-menu pull-right" id="datatable_ajax_tools">
  31 + <li><a href="javascript:;" data-action="0"
  32 + class="tool-action"> <i class="fa fa-print"></i>打印
  33 + </a></li>
  34 + <li><a href="javascript:;" data-action="1"
  35 + class="tool-action"> <i class="fa fa-copy"></i> 复制
  36 + </a></li>
  37 + <li><a href="javascript:;" data-action="3"
  38 + class="tool-action"> <i class="fa fa-file-excel-o"></i>
  39 + 导出Excel
  40 + </a></li>
  41 + <li class="divider"></li>
  42 + <li><a href="javascript:;" data-action="5"
  43 + class="tool-action"> <i class="fa fa-refresh"></i> 刷新数据
  44 + </a></li>
  45 + </ul>
  46 + </div> -->
  47 + </div>
  48 + </div>
  49 + <div class="portlet-body">
  50 + <div class="table-container" style="margin-top: 10px">
  51 + <table
  52 + class="table table-striped table-bordered table-hover table-checkable"
  53 + id="datatable_speeding">
  54 + <thead>
  55 + <tr role="row" class="heading">
  56 + <th width="3%">#</th>
  57 + <th width="4%">线路</th>
  58 + <th width="6%">车辆自编号</th>
  59 + <th width="8%">上下行</th>
  60 + <th width="10%">开始时间</th>
  61 + <th width="10%">结束时间</th>
  62 + <th width="8%">持续时间</th>
  63 + <th width="8%">查看轨迹</th>
  64 + <th width="6%">操作</th>
  65 + </tr>
  66 + <tr role="row" class="filter">
  67 + <td></td>
  68 + <td>
  69 + <select class="form-control" name="line" id="line" style="width: 100px;"></select>
  70 + </td>
  71 + <td>
  72 + <select class="form-control" name="nbbm" id="nbbm" style="width: 100px;"></select>
  73 + </td>
  74 + <!-- <td>
  75 +
  76 + </td>
  77 + <td>
  78 + </td> -->
  79 + <td>
  80 + <select class="form-control form-filter " name="updown" style="width: 90px;">
  81 + <option value="">请选择...</option>
  82 + <option value="0">上行</option>
  83 + <option value="1">下行</option>
  84 + <option value="-1">无效</option>
  85 + </select>
  86 + </td>
  87 + <td>
  88 + <input class="form-control" type="date" name="startDate" />
  89 + -
  90 + <input class="form-control" type="date" name="endDate" />
  91 + </td>
  92 + <td>
  93 + </td>
  94 + <td>
  95 + </td>
  96 + <td>
  97 + </td>
  98 + <td>
  99 + <button class="btn btn-sm green btn-outline filter-submit margin-bottom" >
  100 + <i class="fa fa-search"></i> 搜索</button>
  101 +
  102 + <button class="btn btn-sm red btn-outline filter-cancel">
  103 + <i class="fa fa-times"></i> 重置</button>
  104 + </td>
  105 + </tr>
  106 + </thead>
  107 + <tbody></tbody>
  108 + </table>
  109 + <div style="text-align: right;">
  110 + <ul id="pagination" class="pagination"></ul>
  111 + </div>
  112 + </div>
  113 + </div>
  114 + </div>
  115 + </div>
  116 +</div>
  117 +
  118 +<script id="speeding_list_temp" type="text/html">
  119 +{{each list as obj i}}
  120 +<tr>
  121 + <td style="vertical-align: middle;">
  122 + <input type="checkbox" class="group-checkable icheck" data-id="{{obj.id}}">
  123 + </td>
  124 + <td>
  125 + {{obj.lineName}}
  126 + </td>
  127 + <td>
  128 + {{obj.vehicle}}
  129 + </td>
  130 + <td>
  131 + {{if obj.upDown==0}}
  132 + 上行
  133 + {{else if obj.upDown==1}}
  134 + 下行
  135 + {{else}}
  136 + 无效
  137 + {{/if}}
  138 + </td>
  139 + <td>
  140 + {{obj.timestampDate}}
  141 + </td>
  142 + <td>
  143 + {{obj.endtimestampDate}}
  144 + </td>
  145 + <td>
  146 + {{(obj.endtimestamp-obj.timestamp)/1000}}秒
  147 + </td>
  148 + <td>
  149 + <a class="btn default blue-stripe btn-sm lookTrajectory" data-pjax>
  150 + 查看轨迹
  151 + </a>
  152 + </td>
  153 + <td>
  154 +
  155 + </td>
  156 +</tr>
  157 +{{/each}}
  158 +{{if list.length == 0}}
  159 +<tr>
  160 + <td colspan=8><h6 class="muted">没有找到相关数据</h6></td>
  161 +</tr>
  162 +{{/if}}
  163 +</script>
  164 +
  165 +<script>
  166 +$(function(){
  167 + var page = 0, initPagination;
  168 + var icheckOptions = {
  169 + checkboxClass: 'icheckbox_flat-blue',
  170 + increaseArea: '20%'
  171 + }
  172 +
  173 + var date = new Date();
  174 + var week = date.getDay();//表明今天是周几。0-6表示周日到周六
  175 + var dateTime = date.getTime();//当前时间的时间戳,单位秒。
  176 +
  177 + var endTime = dateTime-week*24*3600*1000;//上周末、格式为时间戳。
  178 + var startTime = endTime-6*24*3600*1000;//上周一、格式为时间戳。
  179 +
  180 + var endDate = timeToData(endTime);
  181 + var startDate = timeToData(startTime);
  182 + //表单默认选择上周一到上周日的超速信息。
  183 + $("input[name='endDate']")[0].value = endDate;
  184 + $("input[name='startDate']")[0].value = startDate;
  185 + var parameter = new Object();
  186 + parameter.endDate = $("input[name='endDate']")[0].value;
  187 + parameter.startDate = $("input[name='startDate']")[0].value;
  188 + jsDoQuery(parameter,true);
  189 +
  190 + //时间戳转换为年月日
  191 + function timeToData(time){
  192 + var date = new Date(time);
  193 + var year = date.getFullYear();
  194 + var Month = date.getMonth()+1>10?date.getMonth()+1:"0"+(date.getMonth()+1);
  195 + var Day = date.getDate()>10?date.getDate():"0"+date.getDate();
  196 + return year+"-"+Month+"-"+Day;
  197 + }
  198 +
  199 + //重置
  200 + $('tr.filter .filter-cancel').on('click', function(){
  201 + $('tr.filter input, select').val('').change();
  202 + jsDoQuery(null, true);
  203 + });
  204 +
  205 + //提交
  206 + $('tr.filter .filter-submit').on('click', function(){
  207 + var cells = $('tr.filter')[0].cells
  208 + ,params = {}
  209 + ,name;
  210 + $.each(cells, function(i, cell){
  211 + var items = $('input,select', cell);
  212 + for(var j = 0, item; item = items[j++];){
  213 + name = $(item).attr('name');
  214 + if(name){
  215 + params[name] = $(item).val();
  216 + }
  217 + }
  218 + });
  219 + page = 0;
  220 + jsDoQuery(params, true);
  221 + });
  222 +
  223 + /*
  224 + * 获取数据 p: 要提交的参数, pagination: 是否重新分页
  225 + */
  226 + function jsDoQuery(p, pagination){
  227 + var params = {};
  228 + if(p)
  229 + params = p;
  230 + //更新时间排序
  231 + params['order'] = 'lastLoginDate';
  232 + params['page'] = page;
  233 + var i = layer.load(2);
  234 + $get('/speeding/pagequery' ,params, function(data){
  235 + var bodyHtm = template('speeding_list_temp', {list: data.dataList});
  236 + $('#datatable_speeding tbody').html(bodyHtm)
  237 + .find('.icheck').iCheck(icheckOptions)
  238 + .on('ifChanged', iCheckChange);
  239 + if(pagination && data.dataList.length > 0){
  240 + //重新分页
  241 + initPagination = true;
  242 + showPagination(data);
  243 + }
  244 + layer.close(i);
  245 + $(".lookTrajectory").click(function(){
  246 + layer.alert("暂未开放此功能!");
  247 + })
  248 + });
  249 + }
  250 +
  251 + function iCheckChange(){
  252 + var tr = $(this).parents('tr');
  253 + if(this.checked)
  254 + tr.addClass('row-active');
  255 + else
  256 + tr.removeClass('row-active');
  257 +
  258 + if($('#datatable_resource input.icheck:checked').length == 1)
  259 + $('#removeButton').removeAttr('disabled');
  260 + else
  261 + $('#removeButton').attr('disabled', 'disabled');
  262 + }
  263 +
  264 + function showPagination(data){
  265 + //分页
  266 + $('#pagination').jqPaginator({
  267 + totalPages: data.totalPage,//总页数
  268 + visiblePages: 6,// 中间显示页数
  269 + currentPage: page + 1,
  270 + first: '<li class="first"><a href="javascript:void(0);">首页<\/a><\/li>',
  271 + prev: '<li class="prev"><a href="javascript:void(0);">上一页<\/a><\/li>',
  272 + next: '<li class="next"><a href="javascript:void(0);">下一页<\/a><\/li>',
  273 + last: '<li class="last"><a href="javascript:void(0);">尾页<\/a><\/li>',
  274 + page: '<li class="page"><a href="javascript:void(0);">{{page}}<\/a><\/li>',
  275 + onPageChange: function (num, type) {
  276 + if(initPagination){
  277 + initPagination = false;
  278 + return;
  279 + }
  280 + page = num - 1;
  281 + var cells = $('tr.filter')[0].cells
  282 + ,params = {}
  283 + ,name;
  284 + $.each(cells, function(i, cell){
  285 + var items = $('input,select', cell);
  286 + for(var j = 0, item; item = items[j++];){
  287 + name = $(item).attr('name');
  288 + if(name){
  289 + params[name] = $(item).val();
  290 + }
  291 + }
  292 + });
  293 + jsDoQuery(params, false);
  294 + }
  295 + });
  296 + }
  297 +
  298 +
  299 + //删除
  300 + $('#removeButton').on('click', function(){
  301 + if($(this).attr('disabled'))
  302 + return;
  303 +
  304 + var id = $('#datatable_resource input.icheck:checked').data('id');
  305 +
  306 + removeConfirm('确定要删除选中的数据?', '/resource/' + id ,function(){
  307 + $('tr.filter .filter-submit').click();
  308 + });
  309 + });
  310 +
  311 + //搜索线路
  312 + $.get('/basic/lineCode2Name',function(result){
  313 + var data=[];
  314 + data.push({id: " ", text: "全部线路"});
  315 + for(var code in result){
  316 + data.push({id: code, text: result[code]});
  317 + }
  318 + initPinYinSelect2('#line',data,'');
  319 +
  320 + });
  321 +
  322 +$("#line").on("change",initXl);
  323 +function initXl(){
  324 +$('#nbbm').select2({
  325 + placeholder: '搜索车辆...',
  326 + ajax: {
  327 + url: '/report/carList',
  328 + dataType: 'json',
  329 + delay: 150,
  330 + data: function (params) {
  331 + return {nbbm: params.term,
  332 + gsbm:"",
  333 + fgsbm:"",
  334 + xlbm:$('#line').val()};
  335 + },
  336 + processResults: function (data) {
  337 + return {
  338 + results: data
  339 + };
  340 + },
  341 + cache: true
  342 + },
  343 + templateResult: function (repo) {
  344 + if (repo.loading) return repo.text;
  345 + var h = '<span>' + repo.text + '</span>';
  346 + h += (repo.lineName ? '&nbsp;<span class="select2-desc">' + repo.lineName + '</span>' : '');
  347 + return h;
  348 + },
  349 + escapeMarkup: function (markup) {
  350 + return markup;
  351 + },
  352 + minimumInputLength: 1,
  353 + templateSelection: function (repo) {
  354 + return repo.text;
  355 + },
  356 + language: {
  357 + noResults: function () {
  358 + return '<span style="color:red;font-size: 12px;">没有搜索到车辆!</span>';
  359 + },
  360 + inputTooShort: function (e) {
  361 + return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入自编号搜索车辆</span>';
  362 + },
  363 + searching: function () {
  364 + return '<span style="color:gray;font-size: 12px;"> 正在搜索车辆...</span>';
  365 + }
  366 + }
  367 +});
  368 +}
  369 +
  370 +
  371 +//改变状态
  372 +function changeEnabled(id,enabled){
  373 + debugger
  374 + $get('/user/changeEnabled',{id:id,enabled:enabled},function(result){
  375 + jsDoQuery(null, true);
  376 + })
  377 +}
  378 +});
  379 +</script>
0 \ No newline at end of file 380 \ No newline at end of file
src/main/resources/static/pages/forms/mh_sj/scheduleDaily/scheduleDaily_mh.html
1 -<style type="text/css">  
2 - .table-bordered {  
3 - border: 1px solid; }  
4 - .table-bordered > thead > tr > th,  
5 - .table-bordered > thead > tr > td,  
6 - .table-bordered > tbody > tr > th,  
7 - .table-bordered > tbody > tr > td,  
8 - .table-bordered > tfoot > tr > th,  
9 - .table-bordered > tfoot > tr > td {  
10 - border: 1px solid;  
11 - text-align: center; }  
12 - .table-bordered > thead > tr > th,  
13 - .table-bordered > thead > tr > td {  
14 - border-bottom-width: 2px; }  
15 -  
16 - .table > tbody + tbody {  
17 - border-top: 1px solid; }  
18 -  
19 - #forms > thead > tr> td >span{  
20 -  
21 - width: 5px;  
22 -word-wrap: break-word;  
23 -/* letter-spacing: 20px; */  
24 - }  
25 -  
26 - #forms tr> td >label{  
27 - word-break: keep-all;white-space:nowrap;  
28 - }  
29 -</style>  
30 -  
31 -<div class="page-head">  
32 - <div class="page-title">  
33 - <h1>调度日报</h1>  
34 - </div>  
35 -</div>  
36 -  
37 -<div class="row">  
38 - <div class="col-md-12">  
39 - <div class="portlet light porttlet-fit bordered">  
40 - <div class="portlet-title">  
41 - <form class="form-inline" action="">  
42 - <div style="display: inline-block; margin-left: 33px;" id="gsdmDiv_ddrb">  
43 - <span class="item-label" style="width: 80px;">公司: </span>  
44 - <select class="form-control" name="company" id="gsdmDdrb" style="width: 180px;"></select>  
45 - </div>  
46 - <div style="display: inline-block; margin-left: 24px;" id="fgsdmDiv_ddrb">  
47 - <span class="item-label" style="width: 80px;">分公司: </span>  
48 - <select class="form-control" name="subCompany" id="fgsdmDdrb" style="width: 180px;"></select>  
49 - </div>  
50 - <div style="margin-top: 2px"></div>  
51 - <div style="display: inline-block;">  
52 - <span class="item-label" style="width: 80px;margin-left: 33px;">线路: </span>  
53 - <select class="form-control" name="line" id="line" style="width: 180px;"></select>  
54 - </div>  
55 - <div style="display: inline-block;margin-left: 24px;">  
56 - <span class="item-label" style="width: 80px;">&nbsp;时间: </span>  
57 - <input class="form-control" type="text" id="date" style="width: 180px;"/>  
58 - </div>  
59 - <div class="form-group">  
60 - <input class="btn btn-default" type="button" id="query" value="查询"/>  
61 -<!-- <input class="btn btn-default" type="button" id="month" value="按月查询"/> -->  
62 - <input class="btn btn-default" type="button" id="export" value="导出"/>  
63 - </div>  
64 - </form>  
65 - </div>  
66 - <div class="portlet-body">  
67 - <div class="table-container" id="ddrbBody" style="margin-top: 10px;overflow:auto;min-width: 906px">  
68 - <label>日期:<span id="rqxs"></span>&nbsp;&nbsp;&nbsp;&nbsp;早高峰:6:31~8:30&nbsp;&nbsp;&nbsp;&nbsp;晚高峰:16:01~18:00</label>  
69 - <br/><label>计划+临加-少驶=<span id="jls"></span>&nbsp;&nbsp;计算机实驶:<span id="jsjss"></span></label>  
70 - <table class="table table-bordered table-hover table-checkable" id="forms">  
71 - <thead>  
72 - <tr>  
73 - <th colspan="40">线路调度日报</th>  
74 - </tr>  
75 - <tr>  
76 - <td rowspan="3"><span >路线名</span></td>  
77 - <td colspan="16"><c>全日</c>营运里程(公里)</td>  
78 - <td colspan="15"><c>全日</c>营运班次</td>  
79 - <td colspan="9">大间隔情况</td>  
80 - </tr>  
81 - <tr>  
82 - <td rowspan="2"><span >计划</span></td>  
83 - <td rowspan="2"><span >实驶</span></td>  
84 - <td rowspan="2"><span>少驶公里</span></td>  
85 - <td rowspan="2"><span>少驶班次</span></td>  
86 - <td colspan="11">少驶原因(公里)</td>  
87 - <td rowspan="2"><span >临加公里</span></td>  
88 - <td colspan="3">计划班次</td>  
89 - <td colspan="3">实际班次</td>  
90 - <td colspan="3">临加班次</td>  
91 - <td colspan="3">放站班次</td>  
92 - <td colspan="3">调头班次</td>  
93 - <td colspan="3">发生次数</td>  
94 - <td rowspan="2">最大间隔时间(分)</td>  
95 - <td colspan="5" rowspan="2">原因</td>  
96 - </tr>  
97 - <tr>  
98 - <td><span >路阻</span></td>  
99 - <td><span>吊慢</span></td>  
100 - <td><span >故障</span></td>  
101 - <td><span >纠纷</span></td>  
102 - <td><span >肇事</span></td>  
103 - <td><span>缺人</span></td>  
104 - <td><span>缺车</span></td>  
105 - <td><span >客稀</span></td>  
106 - <td><span>气候</span></td>  
107 - <td><span>援外</span></td>  
108 - <td><span>其他</span></td>  
109 - <td><span ><c>全日</c></span></td>  
110 - <td><span >早高峰</span></td>  
111 - <td><span>晚高峰</span></td>  
112 - <td><span><c>全日</c></span></td>  
113 - <td><span>早高峰</span></td>  
114 - <td><span>晚高峰</span></td>  
115 - <td><span><c>全日</c></span></td>  
116 - <td><span>早高峰</span></td>  
117 - <td><span>晚高峰</span></td>  
118 - <td><span><c>全日</c></span></td>  
119 - <td><span>早高峰</span></td>  
120 - <td><span>晚高峰</span></td>  
121 - <td><span><c>全日</c></span></td>  
122 - <td><span>早高峰</span></td>  
123 - <td><span>晚高峰</span></td>  
124 - <td><span><c>全日</c></span></td>  
125 - <td><span>早高峰</span></td>  
126 - <td><span>晚高峰</span></td>  
127 - </tr>  
128 - </thead>  
129 -  
130 - <tbody class="scheduleDaily_1">  
131 -  
132 - </tbody>  
133 - <tr>  
134 - <td colspan="40">&nbsp;</td>  
135 - </tr>  
136 - <!-- <tr>  
137 - <td colspan="40">合计</td>  
138 - </tr>  
139 - <tr>  
140 - <td>售票</td>  
141 - <td colspan="2">1元</td>  
142 - <td colspan="2">2元</td>  
143 - <td colspan="2">3元</td>  
144 - <td colspan="2">4元</td>  
145 - <td colspan="2">5元</td>  
146 - <td colspan="2">6元</td>  
147 - <td colspan="2">7元</td>  
148 - <td colspan="2">8元</td>  
149 - <td colspan="2">9元</td>  
150 - <td colspan="2">10元</td>  
151 - <td colspan="2">&nbsp;</td>  
152 - <td colspan="2">合计张数</td>  
153 - <td colspan="2">&nbsp;</td>  
154 - <td colspan="2">预售票</td>  
155 - <td colspan="2">1元</td>  
156 - <td colspan="2">1.5元</td>  
157 - <td colspan="2">合计张数</td>  
158 - <td colspan="5">&nbsp;</td>  
159 - </tr>  
160 - <tr>  
161 - <td>张数</td>  
162 - <td colspan="2">&nbsp;</td>  
163 - <td colspan="2">&nbsp;</td>  
164 - <td colspan="2">&nbsp;</td>  
165 - <td colspan="2">&nbsp;</td>  
166 - <td colspan="2">&nbsp;</td>  
167 - <td colspan="2">&nbsp;</td>  
168 - <td colspan="2">&nbsp;</td>  
169 - <td colspan="2">&nbsp;</td>  
170 - <td colspan="2">&nbsp;</td>  
171 - <td colspan="2">&nbsp;</td>  
172 - <td colspan="2">&nbsp;</td>  
173 - <td colspan="2">合计金额</td>  
174 - <td colspan="2">&nbsp;</td>  
175 - <td colspan="2">张数</td>  
176 - <td colspan="2">&nbsp;</td>  
177 - <td colspan="2">&nbsp;</td>  
178 - <td colspan="2">合计金额</td>  
179 - <td colspan="5">&nbsp;</td>  
180 - </tr>  
181 - <tr>  
182 - <td colspan="40">&nbsp;</td>  
183 - </tr> -->  
184 - <tr>  
185 - <td colspan="2"><label>路牌</label></td>  
186 - <td colspan="2"><label>车号</label></td>  
187 - <td> <label>司早</label></td>  
188 - <td><label>售早</label></td>  
189 - <td><label>司晚</label></td>  
190 - <td><label>售晚</label></td>  
191 - <td colspan="2"><label>路牌</label></td>  
192 - <td colspan="2"><label>车号</label></td>  
193 - <td><label>司早</label></td>  
194 - <td><label>售早</label></td>  
195 - <td><label>司晚</label></td>  
196 - <td><label>售晚</label></td>  
197 - <td colspan="2"><label>路牌</label></td>  
198 - <td colspan="2"><label>车号</label></td>  
199 - <td><label>司早</label></td>  
200 - <td><label>售早</label></td>  
201 - <td><label>司晚</label></td>  
202 - <td><label>售晚</label></td>  
203 - <td colspan="2"><label>路牌</label></td>  
204 - <td colspan="2"><label>车号</label></td>  
205 - <td><label>司早</label></td>  
206 - <td><label>售早</label></td>  
207 - <td><label>司晚</label></td>  
208 - <td><label>售晚</label></td>  
209 - <td colspan="2"><label>路牌</label></td>  
210 - <td colspan="2"><label>车号</label></td>  
211 - <td><label>司早</label></td>  
212 - <td><label>售早</label></td>  
213 - <td><label>司晚</label></td>  
214 - <td><label>售晚</label></td>  
215 - </tr>  
216 - <tbody class="scheduleDaily_2">  
217 -  
218 - </tbody>  
219 - <tr>  
220 - <td colspan="40">&nbsp;</td>  
221 - </tr>  
222 - <tr>  
223 - <td rowspan="2">路牌</td>  
224 - <td colspan="2" rowspan="2" style="word-break: keep-all;white-space:nowrap;">起点站</td>  
225 - <td colspan="4">到达时间</td>  
226 - <td colspan="4">发车时间</td>  
227 - <td colspan="2" rowspan="2">备注</td>  
228 - <td rowspan="2">路牌</td>  
229 - <td colspan="2" rowspan="2" style="word-break: keep-all;white-space:nowrap;">起点站</td>  
230 - <td colspan="4">到达时间</td>  
231 - <td colspan="4">发车时间</td>  
232 - <td colspan="2" rowspan="2">备注</td>  
233 - <td rowspan="2">路牌</td>  
234 - <td colspan="2" rowspan="2" style="word-break: keep-all;white-space:nowrap;">起点站</td>  
235 - <td colspan="4">到达时间</td>  
236 - <td colspan="4">发车时间</td>  
237 - <td colspan="2" rowspan="2">备注</td>  
238 - <td>&nbsp;</td>  
239 - </tr>  
240 - <tr>  
241 - <td>应到</td>  
242 - <td>实到</td>  
243 - <td>快</td>  
244 - <td>慢</td>  
245 - <td>应发</td>  
246 - <td>实发</td>  
247 - <td>快</td>  
248 - <td>慢</td>  
249 - <td>应到</td>  
250 - <td>实到</td>  
251 - <td>快</td>  
252 - <td>慢</td>  
253 - <td>应发</td>  
254 - <td>实发</td>  
255 - <td>快</td>  
256 - <td>慢</td>  
257 - <td>应到</td>  
258 - <td>实到</td>  
259 - <td>快</td>  
260 - <td>慢</td>  
261 - <td>应发</td>  
262 - <td>实发</td>  
263 - <td>快</td>  
264 - <td>慢</td>  
265 - <td>&nbsp;</td>  
266 - </tr>  
267 - <tbody class="scheduleDaily_3">  
268 -  
269 - </tbody>  
270 - </table>  
271 - </div>  
272 - </div>  
273 - </div>  
274 - </div>  
275 -</div>  
276 -  
277 -<script>  
278 - $(function(){  
279 - // 关闭左侧栏  
280 - if (!$('body').hasClass('page-sidebar-closed'))  
281 - $('.menu-toggler.sidebar-toggler').click();  
282 -  
283 - $("#date").datetimepicker({  
284 - format : 'YYYY-MM-DD',  
285 - locale : 'zh-cn'  
286 - });  
287 - var d = new Date();  
288 - var year = d.getFullYear();  
289 - var month = d.getMonth() + 1;  
290 - var day = d.getDate();  
291 - if(month < 10)  
292 - month = "0" + month;  
293 - if(day < 10)  
294 - day = "0" + day;  
295 - $("#date").val(year + "-" + month + "-" + day);  
296 -  
297 - $("#ddrbBody").height($(window).height()-100);  
298 - /* $.get('/basic/lineCode2Name',function(result){  
299 - var data=[];  
300 -  
301 - for(var code in result){  
302 - data.push({id: code, text: result[code]});  
303 - }  
304 - initPinYinSelect2('#line',data,'');  
305 -  
306 - }) */  
307 - var fage=false;  
308 - var obj = [];  
309 - var xlList;  
310 - $.get('/report/lineList',function(result){  
311 - xlList=result;  
312 - $.get('/user/companyData', function(result){  
313 - obj = result;  
314 - var options = '';  
315 - for(var i = 0; i < obj.length; i++){  
316 - options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';  
317 - }  
318 -  
319 - if(obj.length ==0){  
320 - $("#gsdmDiv_ddrb").css('display','none');  
321 - }else if(obj.length ==1){  
322 - $("#gsdmDiv_ddrb").css('display','none');  
323 - if(obj[0].children.length == 1 || obj[0].children.length ==0)  
324 - $('#fgsdmDiv_ddrb').css('display','none');  
325 - }  
326 - $('#gsdmDdrb').html(options);  
327 - updateCompany();  
328 - });  
329 - })  
330 - $("#gsdmDdrb").on("change",updateCompany);  
331 - function updateCompany(){  
332 - var company = $('#gsdmDdrb').val();  
333 - var options = '';  
334 - for(var i = 0; i < obj.length; i++){  
335 - if(obj[i].companyCode == company){  
336 - var children = obj[i].children;  
337 - for(var j = 0; j < children.length; j++){  
338 - options += '<option value="'+children[j].code+'">'+children[j].name+'</option>';  
339 - }  
340 - }  
341 - }  
342 - $('#fgsdmDdrb').html(options);  
343 - initXl();  
344 - }  
345 - $("#fgsdmDdrb").on("change",initXl);  
346 - function initXl(){  
347 - var data=[];  
348 - if(fage){  
349 - $("#line").select2("destroy").html('');  
350 - }  
351 - var fgs=$('#fgsdmDdrb').val();  
352 - var gs=$('#gsdmDdrb').val();  
353 - for(var i=0;i<xlList.length;i++){  
354 - if(gs!=""){  
355 - if(fgs!=""){  
356 - if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){  
357 - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});  
358 - }  
359 - }else{  
360 - if(xlList[i]["gsbm"]==gs){  
361 - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});  
362 - }  
363 - }  
364 - }  
365 - }  
366 - initPinYinSelect2('#line',data,'');  
367 - fage=true;  
368 - }  
369 - $('#export').attr('disabled', "true");  
370 -  
371 - var line = $("#line").val();  
372 - var xlName = $("#select2-line-container").html();  
373 - var date = $("#date").val();  
374 -  
375 - function getTime(list){  
376 - $.each(list, function(i, obj) {  
377 - if(obj.zdsj != null && obj.zdsjActual != null ){  
378 - var zdsjActual = (obj.zdsjActual).split(":");  
379 - var zdsj = (obj.zdsj).split(":");  
380 - if(zdsjActual[0]*60+Number(zdsjActual[1]) > zdsj[0]*60+Number(zdsj[1])){  
381 - obj["slow"] = (zdsjActual[0]*60+Number(zdsjActual[1])) - (zdsj[0]*60+Number(zdsj[1]));  
382 - }  
383 - else if(zdsjActual[0]*60+Number(zdsjActual[1]) < zdsj[0]*60+Number(zdsj[1])){  
384 - obj["fast"] = (zdsj[0]*60+Number(zdsj[1])) - (zdsjActual[0]*60+Number(zdsjActual[1]));  
385 - }  
386 - }  
387 -  
388 - if(obj.fcsj != null && obj.fcsjActual != null ){  
389 - var fcsjActual = (obj.fcsjActual).split(":");  
390 - var fcsj = (obj.fcsj).split(":");  
391 - if(fcsjActual[0]*60+Number(fcsjActual[1]) > fcsj[0]*60+Number(fcsj[1])){  
392 - obj["slow0"] = (fcsjActual[0]*60+Number(fcsjActual[1])) - (fcsj[0]*60+Number(fcsj[1]));  
393 - }  
394 - else if(fcsjActual[0]*60+Number(fcsjActual[1]) < fcsj[0]*60+Number(fcsj[1])){  
395 - obj["fast0"] = (fcsj[0]*60+Number(fcsj[1])) - (fcsjActual[0]*60+Number(fcsjActual[1]));  
396 - }  
397 - }  
398 - });  
399 - }  
400 - //查询  
401 - $("#query").on('click',function(){  
402 - line = $("#line").val();  
403 - xlName = $("#select2-line-container").html();  
404 - date = $("#date").val();  
405 - $("#rqxs").html(date);  
406 - if(date == null || date.length == 0){  
407 - layer.msg("请选择时间");  
408 - return;  
409 - }  
410 - $("#ddrbBody").height($(window).height()-100);  
411 - $("c").html("全日");  
412 - $("#export").removeAttr("disabled");  
413 - $get('/realSchedule/statisticsDaily_mh_2',{line:line,date:date,xlName:xlName,type:"query"},function(result){  
414 - var scheduleDaily_1 = template('scheduleDaily_1',{list:result});  
415 - $("#jls").html(result[0].jls);  
416 - $("#jsjss").html(result[0].sjgl);  
417 - $('#forms .scheduleDaily_1').html(scheduleDaily_1);  
418 - });  
419 - $.get('/realSchedule/queryUserInfo',{line:line,date:date,state:2,type:"query"},function(result){  
420 - var scheduleDaily_2 = template('scheduleDaily_2',{list:result});  
421 - $('#forms .scheduleDaily_2').html(scheduleDaily_2);  
422 - });  
423 - $.get('/realSchedule/realScheduleList_mh_2',{line:line,date:date,type:"query"},function(result){  
424 - getTime(result);  
425 - var scheduleDaily_3 = template('scheduleDaily_3',{list:result});  
426 - $('#forms .scheduleDaily_3').html(scheduleDaily_3);  
427 - });  
428 -  
429 - });  
430 -  
431 - //按月查询  
432 - /* $("#month").on('click',function(){  
433 - line = $("#line").val();  
434 - xlName = $("#select2-line-container").html();  
435 - date = $("#date").val();  
436 - if(date == null || date.length == 0){  
437 - layer.msg("请选择时间");  
438 - return;  
439 - }  
440 - date = date.substring(0, 7);  
441 - $("c").html("全月");  
442 - $("#export").removeAttr("disabled");  
443 - $get('/realSchedule/statisticsDaily',{line:line,date:date,xlName:xlName,type:"query"},function(result){  
444 - var scheduleDaily_1 = template('scheduleDaily_1',{list:result});  
445 - $('#forms .scheduleDaily_1').html(scheduleDaily_1);  
446 - });  
447 - $('#forms .scheduleDaily_2').html("");  
448 - $('#forms .scheduleDaily_3').html("");  
449 -  
450 - }); */  
451 -  
452 - $("#export").on("click",function(){  
453 - var params = {};  
454 - if(date == null || date.length == 0){  
455 - layer.msg("请选择时间");  
456 - return;  
457 - }  
458 - params['line'] = line;  
459 - params['date'] = date;  
460 - params['xlName'] = xlName;  
461 - params['type'] = "export";  
462 - params['state'] = '2';  
463 - $get('/realSchedule/scheduleDailyExport', params, function(result){  
464 - if(date.length == 10)  
465 - window.open("/downloadFile/download?fileName=调度日报"+moment(date).format("YYYYMMDD"));  
466 - else  
467 - window.open("/downloadFile/download?fileName=调度日报"+moment(date).format("YYYYMM"));  
468 - });  
469 - });  
470 -  
471 - });  
472 -</script>  
473 -<script type="text/html" id="scheduleDaily_1">  
474 - {{each list as obj i}}  
475 - <tr >  
476 - <td>{{obj.xlName}}</td>  
477 - <td>{{obj.jhlc}}</td>  
478 - <td>{{obj.sjgl}}</td>  
479 - <td>{{obj.ssgl}}</td>  
480 - <td>{{obj.ssbc}}</td>  
481 - <td>{{obj.ssgl_lz}}</td>  
482 - <td>{{obj.ssgl_dm}}</td>  
483 - <td>{{obj.ssgl_gz}}</td>  
484 - <td>{{obj.ssgl_jf}}</td>  
485 - <td>{{obj.ssgl_zs}}</td>  
486 - <td>{{obj.ssgl_qr}}</td>  
487 - <td>{{obj.ssgl_qc}}</td>  
488 - <td>{{obj.ssgl_kx}}</td>  
489 - <td>{{obj.ssgl_qh}}</td>  
490 - <td>{{obj.ssgl_yw}}</td>  
491 - <td>{{obj.ssgl_other}}</td>  
492 - <td>{{obj.ljgl}}</td>  
493 - <td>{{obj.jhbc}}</td>  
494 - <td>{{obj.jhbc_m}}</td>  
495 - <td>{{obj.jhbc_a}}</td>  
496 - <td>{{obj.sjbc}}</td>  
497 - <td>{{obj.sjbc_m}}</td>  
498 - <td>{{obj.sjbc_a}}</td>  
499 - <td>{{obj.ljbc}}</td>  
500 - <td>{{obj.ljbc_m}}</td>  
501 - <td>{{obj.ljbc_a}}</td>  
502 - <td>{{obj.fzbc}}</td>  
503 - <td>{{obj.fzbc_m}}</td>  
504 - <td>{{obj.fzbc_a}}</td>  
505 - <td>{{obj.dtbc}}</td>  
506 - <td>{{obj.dtbc_m}}</td>  
507 - <td>{{obj.dtbc_a}}</td>  
508 - <td>{{obj.djg}}</td>  
509 - <td>{{obj.djg_m}}</td>  
510 - <td>{{obj.djg_a}}</td>  
511 - <td>{{obj.djg_time}}</td>  
512 - <td colspan="5">&nbsp;</td>  
513 - </tr>  
514 - {{/each}}  
515 - {{if list.length == 0}}  
516 - <tr>  
517 - <td colspan="40"><h6 class="muted">没有找到相关数据</h6></td>  
518 - </tr>  
519 - {{/if}}  
520 -</script>  
521 -<script type="text/html" id="scheduleDaily_2">  
522 - {{each list as obj i}}  
523 - {{if i%5 == 0}}  
524 - <tr>  
525 - {{/if}}  
526 - <td colspan="2">{{obj[3]}}</td>  
527 - <td colspan="2">{{obj[2]}}</td>  
528 - <td>{{obj[1]}}/{{obj[4]}}</td>  
529 - <td>{{if obj[5] !=null}}  
530 - {{obj[5]}}/  
531 - {{obj[6]}}  
532 -  
533 - {{/if}}  
534 - </td>  
535 - <td>&nbsp;</td>  
536 - <td>&nbsp;</td>  
537 - {{if (i+1)%5 == 0}}  
538 - </tr>  
539 - {{/if}}  
540 - {{/each}}  
541 - {{if list.length == 0}}  
542 - <tr>  
543 - <td colspan="40"><h6 class="muted">没有找到相关数据</h6></td>  
544 - </tr>  
545 - {{/if}}  
546 -</script>  
547 -<script type="text/html" id="scheduleDaily_3">  
548 - {{each list as obj i}}  
549 - {{if i%3 == 0}}  
550 - <tr>  
551 - {{/if}}  
552 - <td>{{obj.lpName}}</td>  
553 - <td colspan="2" style="word-break: keep-all;white-space:nowrap;">{{obj.qdzName}}</td>  
554 - <td>{{obj.zdsj}}</td>  
555 - <td>{{obj.zdsjActual}}</td>  
556 - <td>{{obj.fast}}</td>  
557 - <td>{{obj.slow}}</td>  
558 - <td>{{obj.fcsj}}</td>  
559 - <td>{{obj.fcsjActual}}  
560 - {{if obj.bcType== "in"}}  
561 - (进)  
562 - {{/if}}  
563 - {{if obj.bcType== "out"}}  
564 - (出)  
565 - {{/if}}  
566 - </td>  
567 - <td>{{obj.fast0}}</td>  
568 - <td>{{obj.slow0}}  
569 -  
570 - </td>  
571 - <td colspan="2">{{obj.remarks}}</td>  
572 - {{if (i+1)%3 == 0}}  
573 - <td>&nbsp;</td>  
574 - </tr>  
575 - {{/if}}  
576 - {{/each}}  
577 - {{if list.length == 0}}  
578 - <tr>  
579 - <td colspan="40"><h6 class="muted">没有找到相关数据</h6></td>  
580 - </tr>  
581 - {{/if}} 1 +<style type="text/css">
  2 + .table-bordered {
  3 + border: 1px solid; }
  4 + .table-bordered > thead > tr > th,
  5 + .table-bordered > thead > tr > td,
  6 + .table-bordered > tbody > tr > th,
  7 + .table-bordered > tbody > tr > td,
  8 + .table-bordered > tfoot > tr > th,
  9 + .table-bordered > tfoot > tr > td {
  10 + border: 1px solid;
  11 + text-align: center; }
  12 + .table-bordered > thead > tr > th,
  13 + .table-bordered > thead > tr > td {
  14 + border-bottom-width: 2px; }
  15 +
  16 + .table > tbody + tbody {
  17 + border-top: 1px solid; }
  18 +
  19 + #forms > thead > tr> td >span{
  20 +
  21 + width: 5px;
  22 +word-wrap: break-word;
  23 +/* letter-spacing: 20px; */
  24 + }
  25 +
  26 + #forms tr> td >label{
  27 + word-break: keep-all;white-space:nowrap;
  28 + }
  29 +</style>
  30 +
  31 +<div class="page-head">
  32 + <div class="page-title">
  33 + <h1>调度日报</h1>
  34 + </div>
  35 +</div>
  36 +
  37 +<div class="row">
  38 + <div class="col-md-12">
  39 + <div class="portlet light porttlet-fit bordered">
  40 + <div class="portlet-title">
  41 + <form class="form-inline" action="">
  42 + <div style="display: inline-block; margin-left: 33px;" id="gsdmDiv_ddrb">
  43 + <span class="item-label" style="width: 80px;">公司: </span>
  44 + <select class="form-control" name="company" id="gsdmDdrb" style="width: 180px;"></select>
  45 + </div>
  46 + <div style="display: inline-block; margin-left: 24px;" id="fgsdmDiv_ddrb">
  47 + <span class="item-label" style="width: 80px;">分公司: </span>
  48 + <select class="form-control" name="subCompany" id="fgsdmDdrb" style="width: 180px;"></select>
  49 + </div>
  50 + <div style="margin-top: 2px"></div>
  51 + <div style="display: inline-block;">
  52 + <span class="item-label" style="width: 80px;margin-left: 33px;">线路: </span>
  53 + <select class="form-control" name="line" id="line" style="width: 180px;"></select>
  54 + </div>
  55 + <div style="display: inline-block;margin-left: 24px;">
  56 + <span class="item-label" style="width: 80px;">&nbsp;时间: </span>
  57 + <input class="form-control" type="text" id="date" style="width: 180px;"/>
  58 + </div>
  59 + <div class="form-group">
  60 + <input class="btn btn-default" type="button" id="query" value="查询"/>
  61 +<!-- <input class="btn btn-default" type="button" id="month" value="按月查询"/> -->
  62 + <input class="btn btn-default" type="button" id="export" value="导出"/>
  63 + </div>
  64 + </form>
  65 + </div>
  66 + <div class="portlet-body">
  67 + <div class="table-container" id="ddrbBody" style="margin-top: 10px;overflow:auto;min-width: 906px">
  68 + <label>日期:<span id="rqxs"></span>&nbsp;&nbsp;&nbsp;&nbsp;早高峰:6:31~8:30&nbsp;&nbsp;&nbsp;&nbsp;晚高峰:16:01~18:00</label>
  69 + <br/><label>计划+临加-少驶=<span id="jls"></span>&nbsp;&nbsp;计算机实驶:<span id="jsjss"></span></label>
  70 + <table class="table table-bordered table-hover table-checkable" id="forms">
  71 + <thead>
  72 + <tr>
  73 + <th colspan="40">线路调度日报</th>
  74 + </tr>
  75 + <tr>
  76 + <td rowspan="3"><span >路线名</span></td>
  77 + <td colspan="16"><c>全日</c>营运里程(公里)</td>
  78 + <td colspan="15"><c>全日</c>营运班次</td>
  79 + <td colspan="9">大间隔情况</td>
  80 + </tr>
  81 + <tr>
  82 + <td rowspan="2"><span >计划</span></td>
  83 + <td rowspan="2"><span >实驶</span></td>
  84 + <td rowspan="2"><span>少驶公里</span></td>
  85 + <td rowspan="2"><span>少驶班次</span></td>
  86 + <td colspan="11">少驶原因(公里)</td>
  87 + <td rowspan="2"><span >临加公里</span></td>
  88 + <td colspan="3">计划班次</td>
  89 + <td colspan="3">实际班次</td>
  90 + <td colspan="3">临加班次</td>
  91 + <td colspan="3">放站班次</td>
  92 + <td colspan="3">调头班次</td>
  93 + <td colspan="3">发生次数</td>
  94 + <td rowspan="2">最大间隔时间(分)</td>
  95 + <td colspan="5" rowspan="2">原因</td>
  96 + </tr>
  97 + <tr>
  98 + <td><span >路阻</span></td>
  99 + <td><span>吊慢</span></td>
  100 + <td><span >故障</span></td>
  101 + <td><span >纠纷</span></td>
  102 + <td><span >肇事</span></td>
  103 + <td><span>缺人</span></td>
  104 + <td><span>缺车</span></td>
  105 + <td><span >客稀</span></td>
  106 + <td><span>气候</span></td>
  107 + <td><span>援外</span></td>
  108 + <td><span>其他</span></td>
  109 + <td><span ><c>全日</c></span></td>
  110 + <td><span >早高峰</span></td>
  111 + <td><span>晚高峰</span></td>
  112 + <td><span><c>全日</c></span></td>
  113 + <td><span>早高峰</span></td>
  114 + <td><span>晚高峰</span></td>
  115 + <td><span><c>全日</c></span></td>
  116 + <td><span>早高峰</span></td>
  117 + <td><span>晚高峰</span></td>
  118 + <td><span><c>全日</c></span></td>
  119 + <td><span>早高峰</span></td>
  120 + <td><span>晚高峰</span></td>
  121 + <td><span><c>全日</c></span></td>
  122 + <td><span>早高峰</span></td>
  123 + <td><span>晚高峰</span></td>
  124 + <td><span><c>全日</c></span></td>
  125 + <td><span>早高峰</span></td>
  126 + <td><span>晚高峰</span></td>
  127 + </tr>
  128 + </thead>
  129 +
  130 + <tbody class="scheduleDaily_1">
  131 +
  132 + </tbody>
  133 + <tr>
  134 + <td colspan="40">&nbsp;</td>
  135 + </tr>
  136 + <!-- <tr>
  137 + <td colspan="40">合计</td>
  138 + </tr>
  139 + <tr>
  140 + <td>售票</td>
  141 + <td colspan="2">1元</td>
  142 + <td colspan="2">2元</td>
  143 + <td colspan="2">3元</td>
  144 + <td colspan="2">4元</td>
  145 + <td colspan="2">5元</td>
  146 + <td colspan="2">6元</td>
  147 + <td colspan="2">7元</td>
  148 + <td colspan="2">8元</td>
  149 + <td colspan="2">9元</td>
  150 + <td colspan="2">10元</td>
  151 + <td colspan="2">&nbsp;</td>
  152 + <td colspan="2">合计张数</td>
  153 + <td colspan="2">&nbsp;</td>
  154 + <td colspan="2">预售票</td>
  155 + <td colspan="2">1元</td>
  156 + <td colspan="2">1.5元</td>
  157 + <td colspan="2">合计张数</td>
  158 + <td colspan="5">&nbsp;</td>
  159 + </tr>
  160 + <tr>
  161 + <td>张数</td>
  162 + <td colspan="2">&nbsp;</td>
  163 + <td colspan="2">&nbsp;</td>
  164 + <td colspan="2">&nbsp;</td>
  165 + <td colspan="2">&nbsp;</td>
  166 + <td colspan="2">&nbsp;</td>
  167 + <td colspan="2">&nbsp;</td>
  168 + <td colspan="2">&nbsp;</td>
  169 + <td colspan="2">&nbsp;</td>
  170 + <td colspan="2">&nbsp;</td>
  171 + <td colspan="2">&nbsp;</td>
  172 + <td colspan="2">&nbsp;</td>
  173 + <td colspan="2">合计金额</td>
  174 + <td colspan="2">&nbsp;</td>
  175 + <td colspan="2">张数</td>
  176 + <td colspan="2">&nbsp;</td>
  177 + <td colspan="2">&nbsp;</td>
  178 + <td colspan="2">合计金额</td>
  179 + <td colspan="5">&nbsp;</td>
  180 + </tr>
  181 + <tr>
  182 + <td colspan="40">&nbsp;</td>
  183 + </tr> -->
  184 + <tr>
  185 + <td colspan="2"><label>路牌</label></td>
  186 + <td colspan="2"><label>车号</label></td>
  187 + <td> <label>司早</label></td>
  188 + <td><label>售早</label></td>
  189 + <td><label>司晚</label></td>
  190 + <td><label>售晚</label></td>
  191 + <td colspan="2"><label>路牌</label></td>
  192 + <td colspan="2"><label>车号</label></td>
  193 + <td><label>司早</label></td>
  194 + <td><label>售早</label></td>
  195 + <td><label>司晚</label></td>
  196 + <td><label>售晚</label></td>
  197 + <td colspan="2"><label>路牌</label></td>
  198 + <td colspan="2"><label>车号</label></td>
  199 + <td><label>司早</label></td>
  200 + <td><label>售早</label></td>
  201 + <td><label>司晚</label></td>
  202 + <td><label>售晚</label></td>
  203 + <td colspan="2"><label>路牌</label></td>
  204 + <td colspan="2"><label>车号</label></td>
  205 + <td><label>司早</label></td>
  206 + <td><label>售早</label></td>
  207 + <td><label>司晚</label></td>
  208 + <td><label>售晚</label></td>
  209 + <td colspan="2"><label>路牌</label></td>
  210 + <td colspan="2"><label>车号</label></td>
  211 + <td><label>司早</label></td>
  212 + <td><label>售早</label></td>
  213 + <td><label>司晚</label></td>
  214 + <td><label>售晚</label></td>
  215 + </tr>
  216 + <tbody class="scheduleDaily_2">
  217 +
  218 + </tbody>
  219 + <tr>
  220 + <td colspan="40">&nbsp;</td>
  221 + </tr>
  222 + <tr>
  223 + <td rowspan="2">路牌</td>
  224 + <td colspan="2" rowspan="2" style="word-break: keep-all;white-space:nowrap;">起点站</td>
  225 + <td colspan="4">到达时间</td>
  226 + <td colspan="4">发车时间</td>
  227 + <td colspan="2" rowspan="2">备注</td>
  228 + <td rowspan="2">路牌</td>
  229 + <td colspan="2" rowspan="2" style="word-break: keep-all;white-space:nowrap;">起点站</td>
  230 + <td colspan="4">到达时间</td>
  231 + <td colspan="4">发车时间</td>
  232 + <td colspan="2" rowspan="2">备注</td>
  233 + <td rowspan="2">路牌</td>
  234 + <td colspan="2" rowspan="2" style="word-break: keep-all;white-space:nowrap;">起点站</td>
  235 + <td colspan="4">到达时间</td>
  236 + <td colspan="4">发车时间</td>
  237 + <td colspan="2" rowspan="2">备注</td>
  238 + <td>&nbsp;</td>
  239 + </tr>
  240 + <tr>
  241 + <td>应到</td>
  242 + <td>实到</td>
  243 + <td>快</td>
  244 + <td>慢</td>
  245 + <td>应发</td>
  246 + <td>实发</td>
  247 + <td>快</td>
  248 + <td>慢</td>
  249 + <td>应到</td>
  250 + <td>实到</td>
  251 + <td>快</td>
  252 + <td>慢</td>
  253 + <td>应发</td>
  254 + <td>实发</td>
  255 + <td>快</td>
  256 + <td>慢</td>
  257 + <td>应到</td>
  258 + <td>实到</td>
  259 + <td>快</td>
  260 + <td>慢</td>
  261 + <td>应发</td>
  262 + <td>实发</td>
  263 + <td>快</td>
  264 + <td>慢</td>
  265 + <td>&nbsp;</td>
  266 + </tr>
  267 + <tbody class="scheduleDaily_3">
  268 +
  269 + </tbody>
  270 + </table>
  271 + </div>
  272 + </div>
  273 + </div>
  274 + </div>
  275 +</div>
  276 +
  277 +<script>
  278 + $(function(){
  279 + // 关闭左侧栏
  280 + if (!$('body').hasClass('page-sidebar-closed'))
  281 + $('.menu-toggler.sidebar-toggler').click();
  282 +
  283 + $("#date").datetimepicker({
  284 + format : 'YYYY-MM-DD',
  285 + locale : 'zh-cn'
  286 + });
  287 + var d = new Date();
  288 + var year = d.getFullYear();
  289 + var month = d.getMonth() + 1;
  290 + var day = d.getDate();
  291 + if(month < 10)
  292 + month = "0" + month;
  293 + if(day < 10)
  294 + day = "0" + day;
  295 + $("#date").val(year + "-" + month + "-" + day);
  296 +
  297 + $("#ddrbBody").height($(window).height()-100);
  298 + /* $.get('/basic/lineCode2Name',function(result){
  299 + var data=[];
  300 +
  301 + for(var code in result){
  302 + data.push({id: code, text: result[code]});
  303 + }
  304 + initPinYinSelect2('#line',data,'');
  305 +
  306 + }) */
  307 + var fage=false;
  308 + var obj = [];
  309 + var xlList;
  310 + $.get('/report/lineList',function(result){
  311 + xlList=result;
  312 + $.get('/user/companyData', function(result){
  313 + obj = result;
  314 + var options = '';
  315 + for(var i = 0; i < obj.length; i++){
  316 + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';
  317 + }
  318 +
  319 + if(obj.length ==0){
  320 + $("#gsdmDiv_ddrb").css('display','none');
  321 + }else if(obj.length ==1){
  322 + $("#gsdmDiv_ddrb").css('display','none');
  323 + if(obj[0].children.length == 1 || obj[0].children.length ==0)
  324 + $('#fgsdmDiv_ddrb').css('display','none');
  325 + }
  326 + $('#gsdmDdrb').html(options);
  327 + updateCompany();
  328 + });
  329 + })
  330 + $("#gsdmDdrb").on("change",updateCompany);
  331 + function updateCompany(){
  332 + var company = $('#gsdmDdrb').val();
  333 + var options = '';
  334 + for(var i = 0; i < obj.length; i++){
  335 + if(obj[i].companyCode == company){
  336 + var children = obj[i].children;
  337 + for(var j = 0; j < children.length; j++){
  338 + options += '<option value="'+children[j].code+'">'+children[j].name+'</option>';
  339 + }
  340 + }
  341 + }
  342 + $('#fgsdmDdrb').html(options);
  343 + initXl();
  344 + }
  345 + $("#fgsdmDdrb").on("change",initXl);
  346 + function initXl(){
  347 + var data=[];
  348 + if(fage){
  349 + $("#line").select2("destroy").html('');
  350 + }
  351 + var fgs=$('#fgsdmDdrb').val();
  352 + var gs=$('#gsdmDdrb').val();
  353 + for(var i=0;i<xlList.length;i++){
  354 + if(gs!=""){
  355 + if(fgs!=""){
  356 + if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){
  357 + data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
  358 + }
  359 + }else{
  360 + if(xlList[i]["gsbm"]==gs){
  361 + data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
  362 + }
  363 + }
  364 + }
  365 + }
  366 + initPinYinSelect2('#line',data,'');
  367 + fage=true;
  368 + }
  369 + $('#export').attr('disabled', "true");
  370 +
  371 + var line = $("#line").val();
  372 + var xlName = $("#select2-line-container").html();
  373 + var date = $("#date").val();
  374 +
  375 + function getTime(list){
  376 + $.each(list, function(i, obj) {
  377 + if(obj.zdsj != null && obj.zdsjActual != null ){
  378 + var zdsjActual = (obj.zdsjActual).split(":");
  379 + var zdsj = (obj.zdsj).split(":");
  380 + if(zdsjActual[0]*60+Number(zdsjActual[1]) > zdsj[0]*60+Number(zdsj[1])){
  381 + obj["slow"] = (zdsjActual[0]*60+Number(zdsjActual[1])) - (zdsj[0]*60+Number(zdsj[1]));
  382 + }
  383 + else if(zdsjActual[0]*60+Number(zdsjActual[1]) < zdsj[0]*60+Number(zdsj[1])){
  384 + obj["fast"] = (zdsj[0]*60+Number(zdsj[1])) - (zdsjActual[0]*60+Number(zdsjActual[1]));
  385 + }
  386 + }
  387 +
  388 + if(obj.fcsj != null && obj.fcsjActual != null ){
  389 + var fcsjActual = (obj.fcsjActual).split(":");
  390 + var fcsj = (obj.fcsj).split(":");
  391 + if(fcsjActual[0]*60+Number(fcsjActual[1]) > fcsj[0]*60+Number(fcsj[1])){
  392 + obj["slow0"] = (fcsjActual[0]*60+Number(fcsjActual[1])) - (fcsj[0]*60+Number(fcsj[1]));
  393 + }
  394 + else if(fcsjActual[0]*60+Number(fcsjActual[1]) < fcsj[0]*60+Number(fcsj[1])){
  395 + obj["fast0"] = (fcsj[0]*60+Number(fcsj[1])) - (fcsjActual[0]*60+Number(fcsjActual[1]));
  396 + }
  397 + }
  398 + });
  399 + }
  400 + //查询
  401 + $("#query").on('click',function(){
  402 + line = $("#line").val();
  403 + xlName = $("#select2-line-container").html();
  404 + date = $("#date").val();
  405 + $("#rqxs").html(date);
  406 + if(date == null || date.length == 0){
  407 + layer.msg("请选择时间");
  408 + return;
  409 + }
  410 + $("#ddrbBody").height($(window).height()-100);
  411 + $("c").html("全日");
  412 + $("#export").removeAttr("disabled");
  413 + $get('/realSchedule/statisticsDaily_mh_2',{line:line,date:date,xlName:xlName,type:"query"},function(result){
  414 + var scheduleDaily_1 = template('scheduleDaily_1',{list:result});
  415 + $("#jls").html(result[0].jls);
  416 + $("#jsjss").html(result[0].sjgl);
  417 + $('#forms .scheduleDaily_1').html(scheduleDaily_1);
  418 + });
  419 + $.get('/realSchedule/queryUserInfo',{line:line,date:date,state:2,type:"query"},function(result){
  420 + var scheduleDaily_2 = template('scheduleDaily_2',{list:result});
  421 + $('#forms .scheduleDaily_2').html(scheduleDaily_2);
  422 + });
  423 + $.get('/realSchedule/realScheduleList_mh_2',{line:line,date:date,type:"query"},function(result){
  424 + getTime(result);
  425 + var scheduleDaily_3 = template('scheduleDaily_3',{list:result});
  426 + $('#forms .scheduleDaily_3').html(scheduleDaily_3);
  427 + });
  428 +
  429 + });
  430 +
  431 + //按月查询
  432 + /* $("#month").on('click',function(){
  433 + line = $("#line").val();
  434 + xlName = $("#select2-line-container").html();
  435 + date = $("#date").val();
  436 + if(date == null || date.length == 0){
  437 + layer.msg("请选择时间");
  438 + return;
  439 + }
  440 + date = date.substring(0, 7);
  441 + $("c").html("全月");
  442 + $("#export").removeAttr("disabled");
  443 + $get('/realSchedule/statisticsDaily',{line:line,date:date,xlName:xlName,type:"query"},function(result){
  444 + var scheduleDaily_1 = template('scheduleDaily_1',{list:result});
  445 + $('#forms .scheduleDaily_1').html(scheduleDaily_1);
  446 + });
  447 + $('#forms .scheduleDaily_2').html("");
  448 + $('#forms .scheduleDaily_3').html("");
  449 +
  450 + }); */
  451 +
  452 + $("#export").on("click",function(){
  453 + var params = {};
  454 + if(date == null || date.length == 0){
  455 + layer.msg("请选择时间");
  456 + return;
  457 + }
  458 + params['line'] = line;
  459 + params['date'] = date;
  460 + params['xlName'] = xlName;
  461 + params['type'] = "export";
  462 + params['state'] = '2';
  463 + $get('/realSchedule/scheduleDailyExport', params, function(result){
  464 + if(date.length == 10)
  465 + window.open("/downloadFile/download?fileName=调度日报"+moment(date).format("YYYYMMDD"));
  466 + else
  467 + window.open("/downloadFile/download?fileName=调度日报"+moment(date).format("YYYYMM"));
  468 + });
  469 + });
  470 +
  471 + });
  472 +</script>
  473 +<script type="text/html" id="scheduleDaily_1">
  474 + {{each list as obj i}}
  475 + <tr >
  476 + <td>{{obj.xlName}}</td>
  477 + <td>{{obj.jhlc}}</td>
  478 + <td>{{obj.sjgl}}</td>
  479 + <td>{{obj.ssgl}}</td>
  480 + <td>{{obj.ssbc}}</td>
  481 + <td>{{obj.ssgl_lz}}</td>
  482 + <td>{{obj.ssgl_dm}}</td>
  483 + <td>{{obj.ssgl_gz}}</td>
  484 + <td>{{obj.ssgl_jf}}</td>
  485 + <td>{{obj.ssgl_zs}}</td>
  486 + <td>{{obj.ssgl_qr}}</td>
  487 + <td>{{obj.ssgl_qc}}</td>
  488 + <td>{{obj.ssgl_kx}}</td>
  489 + <td>{{obj.ssgl_qh}}</td>
  490 + <td>{{obj.ssgl_yw}}</td>
  491 + <td>{{obj.ssgl_other}}</td>
  492 + <td>{{obj.ljgl}}</td>
  493 + <td>{{obj.jhbc}}</td>
  494 + <td>{{obj.jhbc_m}}</td>
  495 + <td>{{obj.jhbc_a}}</td>
  496 + <td>{{obj.sjbc}}</td>
  497 + <td>{{obj.sjbc_m}}</td>
  498 + <td>{{obj.sjbc_a}}</td>
  499 + <td>{{obj.ljbc}}</td>
  500 + <td>{{obj.ljbc_m}}</td>
  501 + <td>{{obj.ljbc_a}}</td>
  502 + <td>{{obj.fzbc}}</td>
  503 + <td>{{obj.fzbc_m}}</td>
  504 + <td>{{obj.fzbc_a}}</td>
  505 + <td>{{obj.dtbc}}</td>
  506 + <td>{{obj.dtbc_m}}</td>
  507 + <td>{{obj.dtbc_a}}</td>
  508 + <td>{{obj.djg}}</td>
  509 + <td>{{obj.djg_m}}</td>
  510 + <td>{{obj.djg_a}}</td>
  511 + <td>{{obj.djg_time}}</td>
  512 + <td colspan="5">&nbsp;</td>
  513 + </tr>
  514 + {{/each}}
  515 + {{if list.length == 0}}
  516 + <tr>
  517 + <td colspan="40"><h6 class="muted">没有找到相关数据</h6></td>
  518 + </tr>
  519 + {{/if}}
  520 +</script>
  521 +<script type="text/html" id="scheduleDaily_2">
  522 + {{each list as obj i}}
  523 + {{if i%5 == 0}}
  524 + <tr>
  525 + {{/if}}
  526 + <td colspan="2">{{obj[3]}}</td>
  527 + <td colspan="2">{{obj[2]}}</td>
  528 + <td>{{obj[1]}}/{{obj[4]}}</td>
  529 + <td>{{if obj[5] !=null}}
  530 + {{obj[5]}}/
  531 + {{obj[6]}}
  532 +
  533 + {{/if}}
  534 + </td>
  535 + <td>&nbsp;</td>
  536 + <td>&nbsp;</td>
  537 + {{if (i+1)%5 == 0}}
  538 + </tr>
  539 + {{/if}}
  540 + {{/each}}
  541 + {{if list.length == 0}}
  542 + <tr>
  543 + <td colspan="40"><h6 class="muted">没有找到相关数据</h6></td>
  544 + </tr>
  545 + {{/if}}
  546 +</script>
  547 +<script type="text/html" id="scheduleDaily_3">
  548 + {{each list as obj i}}
  549 + {{if i%3 == 0}}
  550 + <tr>
  551 + {{/if}}
  552 + <td>{{obj.lpName}}</td>
  553 + <td colspan="2" style="word-break: keep-all;white-space:nowrap;">{{obj.qdzName}}</td>
  554 + <td>{{obj.zdsj}}</td>
  555 + <td>{{obj.zdsjActual}}</td>
  556 + <td>{{obj.fast}}</td>
  557 + <td>{{obj.slow}}</td>
  558 + <td>{{obj.fcsj}}</td>
  559 + <td>{{obj.fcsjActual}}
  560 + {{if obj.bcType== "in"}}
  561 + (进)
  562 + {{/if}}
  563 + {{if obj.bcType== "out"}}
  564 + (出)
  565 + {{/if}}
  566 + </td>
  567 + <td>{{obj.fast0}}</td>
  568 + <td>{{obj.slow0}}
  569 +
  570 + </td>
  571 + <td colspan="2">{{obj.remarks}}</td>
  572 + {{if (i+1)%3 == 0}}
  573 + <td>&nbsp;</td>
  574 + </tr>
  575 + {{/if}}
  576 + {{/each}}
  577 + {{if list.length == 0}}
  578 + <tr>
  579 + <td colspan="40"><h6 class="muted">没有找到相关数据</h6></td>
  580 + </tr>
  581 + {{/if}}
582 </script> 582 </script>
583 \ No newline at end of file 583 \ No newline at end of file
src/main/resources/static/pages/forms/mh_sj/waybill/waybill_mh.html
1 -<style type="text/css">  
2 - .table-bordered {  
3 - border: 1px solid; }  
4 - .table-bordered > thead > tr > th,  
5 - .table-bordered > thead > tr > td,  
6 - .table-bordered > tbody > tr > th,  
7 - .table-bordered > tbody > tr > td,  
8 - .table-bordered > tfoot > tr > th,  
9 - .table-bordered > tfoot > tr > td {  
10 - border: 1px solid; }  
11 - .table-bordered > thead > tr > th,  
12 - .table-bordered > thead > tr > td {  
13 - border-bottom-width: 2px; }  
14 -  
15 - .table > tbody + tbody {  
16 - border-top: 1px solid; }  
17 -</style>  
18 -  
19 -<div class="page-head">  
20 - <div class="page-title">  
21 - <h1>行车路单</h1>  
22 - </div>  
23 -</div>  
24 -  
25 -<div class="row">  
26 - <div class="col-md-12">  
27 - <div class="portlet light porttlet-fit bordered">  
28 - <div class="portlet-title">  
29 - <form class="form-inline" action="">  
30 - <div style="display: inline-block; margin-left: 33px;" id="gsdmDiv_xcld">  
31 - <span class="item-label" style="width: 80px;">公司: </span>  
32 - <select class="form-control" name="company" id="gsdmXcld" style="width: 180px;"></select>  
33 - </div>  
34 - <div style="display: inline-block; margin-left: 24px;" id="fgsdmDiv_xcld">  
35 - <span class="item-label" style="width: 80px;">分公司: </span>  
36 - <select class="form-control" name="subCompany" id="fgsdmXcld" style="width: 180px;"></select>  
37 - </div>  
38 - <div style="margin-top: 2px"></div>  
39 - <div style="display: inline-block; margin-left: 33px;">  
40 - <span class="item-label" style="width: 80px;">线路: </span>  
41 - <select class="form-control" name="line" id="line" style="width: 180px;"></select>  
42 - </div>  
43 - <div style="display: inline-block;margin-left: 24px;">  
44 - <span class="item-label" style="width: 80px;">&nbsp;时间: </span>  
45 - <input class="form-control" type="text" id="date" style="width: 180px;"/>  
46 - </div>  
47 - <div class="form-group" style="display: inline-block;margin-left: 15px;">  
48 - <input class="btn btn-default" type="button" id="query" value="查询"/>  
49 - <input class="btn btn-default" type="button" id="export" value="导出"/>  
50 - <input class="btn btn-default" type="button" id="print" value="打印"/>  
51 - <input class="btn btn-default" type="button" id="exportMore" value="批量导出"/>  
52 - </div>  
53 - </form>  
54 - </div>  
55 - <div class="portlet-body">  
56 - <div class="row">  
57 - <div class="col-md-3">  
58 - <div class="" id="left_height" style="margin-top: 10px;overflow:auto;">  
59 - <table class="table table-bordered table-hover table-checkable pre-scrollable" id="info">  
60 - <thead>  
61 - <tr class="hidden">  
62 - <th class="rypx" style="cursor:pointer ">人员</th>  
63 - <th class="zbhpx" style="cursor:pointer ">自编号</th>  
64 - <th class="lppx" style="cursor:pointer ">路牌</th>  
65 - </tr>  
66 - </thead>  
67 - <tbody>  
68 -  
69 - </tbody>  
70 - </table>  
71 - </div>  
72 - </div>  
73 - <div class="col-md-9" id="printArea">  
74 - <div class="table-container" id="xcld_height" style="margin-top: 10px;overflow:auto;min-width: 906px;">  
75 - <table class="table table-bordered table-checkable" id="forms">  
76 - <tbody class="ludan_1">  
77 -  
78 - </tbody>  
79 - <tbody class="ludan_2">  
80 -  
81 - </tbody>  
82 - <tbody class="ludan_3">  
83 -  
84 - </tbody>  
85 - <tbody class="ludan_4">  
86 -  
87 - </tbody>  
88 - </table>  
89 - </div>  
90 - </div>  
91 - </div>  
92 - </div>  
93 - </div>  
94 - </div>  
95 -</div>  
96 -  
97 -<script>  
98 - $(function(){  
99 - var fage=false;  
100 - // 关闭左侧栏  
101 - if (!$('body').hasClass('page-sidebar-closed'))  
102 - $('.menu-toggler.sidebar-toggler').click();  
103 -  
104 - $("#date").datetimepicker({  
105 - format : 'YYYY-MM-DD',  
106 - locale : 'zh-cn'  
107 - });  
108 -  
109 - $("#left_height").height($(window).height()-100);  
110 - $("#xcld_height").height($(window).height()-100);  
111 -  
112 - var d = new Date();  
113 - var year = d.getFullYear();  
114 - var month = d.getMonth() + 1;  
115 - var day = d.getDate();  
116 - if(month < 10)  
117 - month = "0" + month;  
118 - if(day < 10)  
119 - day = "0" + day;  
120 - $("#date").val(year + "-" + month + "-" + day);  
121 -  
122 - var obj = [];  
123 - var xlList;  
124 - $.get('/report/lineList',function(result){  
125 - xlList=result;  
126 -  
127 - $.get('/user/companyData', function(result){  
128 - obj = result;  
129 - console.log(obj);  
130 - var options = '';  
131 - for(var i = 0; i < obj.length; i++){  
132 - options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';  
133 - }  
134 -  
135 - if(obj.length ==0){  
136 - $("#gsdmDiv_xcld").css('display','none');  
137 - }else if(obj.length ==1){  
138 - $("#gsdmDiv_xcld").css('display','none');  
139 - if(obj[0].children.length == 1 || obj[0].children.length ==0)  
140 - $('#fgsdmDiv_xcld').css('display','none');  
141 - }  
142 - $('#gsdmXcld').html(options);  
143 -  
144 - updateCompany();  
145 - });  
146 - });  
147 -  
148 - $("#gsdmXcld").on("change",updateCompany);  
149 - function updateCompany(){  
150 - var company = $('#gsdmXcld').val();  
151 - var options = '';  
152 - for(var i = 0; i < obj.length; i++){  
153 - if(obj[i].companyCode == company){  
154 - var children = obj[i].children;  
155 - for(var j = 0; j < children.length; j++){  
156 - options += '<option value="'+children[j].code+'">'+children[j].name+'</option>';  
157 - }  
158 - }  
159 - }  
160 - $('#fgsdmXcld').html(options);  
161 - initXl();  
162 - }  
163 -  
164 -  
165 -  
166 -  
167 - $("#fgsdmXcld").on("change",initXl);  
168 - function initXl(){  
169 - var data=[];  
170 - if(fage){  
171 - $("#line").select2("destroy").html('');  
172 - }  
173 - var fgs=$('#fgsdmXcld').val();  
174 - var gs=$('#gsdmXcld').val();  
175 - for(var i=0;i<xlList.length;i++){  
176 - if(gs!=""){  
177 - if(fgs!=""){  
178 - if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){  
179 - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});  
180 - }  
181 - }else{  
182 - if(xlList[i]["gsbm"]==gs){  
183 - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});  
184 - }  
185 - }  
186 - }  
187 - }  
188 - initPinYinSelect2('#line',data,'');  
189 - fage=true;  
190 - }  
191 - var date = '';  
192 - var line = '';  
193 - $("#query").on("click",function(){  
194 - $("#left_height").height($(window).height()-100);  
195 - line = $("#line").val();  
196 - date = $("#date").val();  
197 - $(".hidden").removeClass("hidden");  
198 - $get('/realSchedule/queryUserInfo',{line:line,date:date,state:2},function(result){  
199 - // 把数据填充到模版中  
200 - var tbodyHtml = template('list_info',{list:result});  
201 - // 把渲染好的模版html文本追加到表格中  
202 - $('#info tbody').html(tbodyHtml);  
203 - });  
204 - });  
205 - var type="desc";  
206 - $(".rypx").on("click",function(){  
207 - line = $("#line").val();  
208 - date = $("#date").val();  
209 - $(".hidden").removeClass("hidden");  
210 - $get('/realSchedule/queryUserInfoPx',{line:line,date:date,state:"j_Gh",type:type},function(result){  
211 - if(type=="desc"){  
212 - type ="asc";  
213 - }else{  
214 - type ="desc";  
215 - }  
216 - // 把数据填充到模版中  
217 - var tbodyHtml = template('list_info_px',{list:result});  
218 - // 把渲染好的模版html文本追加到表格中  
219 - $('#info tbody').html(tbodyHtml);  
220 - });  
221 - })  
222 -  
223 - $(".zbhpx").on("click",function(){  
224 - line = $("#line").val();  
225 - date = $("#date").val();  
226 - $(".hidden").removeClass("hidden");  
227 - $get('/realSchedule/queryUserInfoPx',{line:line,date:date,state:"clZbh",type:type},function(result){  
228 - if(type=="desc"){  
229 - type ="asc";  
230 - }else{  
231 - type ="desc";  
232 - }  
233 - // 把数据填充到模版中  
234 - var tbodyHtml = template('list_info_px',{list:result});  
235 - // 把渲染好的模版html文本追加到表格中  
236 - $('#info tbody').html(tbodyHtml);  
237 - });  
238 - })  
239 -  
240 - $(".lppx").on("click",function(){  
241 - line = $("#line").val();  
242 - date = $("#date").val();  
243 - $(".hidden").removeClass("hidden");  
244 - $get('/realSchedule/queryUserInfoPx',{line:line,date:date,state:"lpName",type:type},function(result){  
245 - if(type=="desc"){  
246 - type ="asc";  
247 - }else{  
248 - type ="desc";  
249 - }  
250 - // 把数据填充到模版中  
251 - var tbodyHtml = template('list_info_px',{list:result});  
252 - // 把渲染好的模版html文本追加到表格中  
253 - $('#info tbody').html(tbodyHtml);  
254 - });  
255 - })  
256 -  
257 - var params = new Array();  
258 - var jName = '';  
259 - var jGh = '';  
260 - $("#info tbody").on("click","tr",function(){  
261 - if($(this).children().size() < 2){  
262 - return;  
263 - }  
264 - $("#xcld_height").height($(window).height()-100);  
265 - $(this).children().each(function(index){  
266 - params[index] = $(this).text();  
267 - });  
268 - jName = params[0].split("\\")[0];  
269 - jGh = params[0].split("\\")[1];  
270 - var id = params[3];  
271 - var obj = $(this);  
272 - $get('/realSchedule/MapById',{id:id},function(result){  
273 - result.scheduleDate = moment(result.scheduleDate).format("YYYY/MM/DD");  
274 - var ludan_1 = template('ludan_1',result);  
275 - // 把渲染好的模版html文本追加到表格中  
276 - $('#forms .ludan_1').html(ludan_1);  
277 - });  
278 - $get('/realSchedule/queryListWaybill_mh_2',{jName:jName,clZbh:params[1],lpName:params[2],date:date,line:line},function(result){  
279 - getTime(result);  
280 - var ludan_2 = template('ludan_2',{list:result});  
281 - // 把渲染好的模版html文本追加到表格中  
282 - $('#forms .ludan_2').html(ludan_2);  
283 - });  
284 - $get('/realSchedule/findKMBC_mh_2',{jGh:jGh,clZbh:params[1],lpName:params[2],date:date,line:line},function(result){  
285 - var ludan_3 = template('ludan_3',result);  
286 - $('#forms .ludan_3').html(ludan_3);  
287 - $("#info tbody tr").css('background-color', '');  
288 - obj.css('background-color', '#99CCFF');  
289 - });  
290 -  
291 -  
292 - });  
293 -  
294 - $("#export").on("click",function(){  
295 - if(params.length < 1){  
296 - return;  
297 - }  
298 - $get('/realSchedule/exportWaybill',{jName:jName,clZbh:params[1],lpName:params[2],date:date,line:line},function(result){  
299 - window.open("/downloadFile/download?fileName="+date+"-"+jName+"-"+params[1]+"-"+params[2]+"-行车路单");  
300 - });  
301 - });  
302 -  
303 - $("#print").click(function(){  
304 - $("#printArea").printArea();  
305 - });  
306 -  
307 - $("#exportMore").on("click",function(){  
308 - if($("#info tbody tr td").length <= 1)  
309 - return;  
310 - var param = new Array();  
311 - $("#info tbody tr").each(function(index){  
312 - param[index] = new Array();  
313 - $(this).children().each(function(i){  
314 - if(i<3){  
315 - param[index][i] = $(this).text().split("\\")[0];  
316 - if(i==0){  
317 - param[index][3] = $(this).text().split("\\")[1];  
318 -  
319 - }  
320 - }  
321 - });  
322 - });  
323 - $get('/realSchedule/exportWaybillMore',{date:date,line:line,strs:JSON.stringify(param)},function(result){  
324 - window.open("/downloadFile/downloadList?fileName="+result.fileName);  
325 - });  
326 - });  
327 -  
328 - function getTime(list){  
329 - $.each(list, function(i, obj) {  
330 - if(obj.zdsj != null && obj.zdsjActual != null ){  
331 - var zdsjActual = (obj.zdsjActual).split(":");  
332 - var zdsj = (obj.zdsj).split(":");  
333 - if(zdsjActual[0]*60+Number(zdsjActual[1]) > zdsj[0]*60+Number(zdsj[1])){  
334 - obj["slow"] = (zdsjActual[0]*60+Number(zdsjActual[1])) - (zdsj[0]*60+Number(zdsj[1]));  
335 - }  
336 - else if(zdsjActual[0]*60+Number(zdsjActual[1]) < zdsj[0]*60+Number(zdsj[1])){  
337 - obj["fast"] = (zdsj[0]*60+Number(zdsj[1])) - (zdsjActual[0]*60+Number(zdsjActual[1]));  
338 - }  
339 - }  
340 - });  
341 - }  
342 - });  
343 -</script>  
344 -<script type="text/html" id="list_info">  
345 - {{each list as obj i}}  
346 - <tr>  
347 - <td width="45%">{{obj[4]}}\{{obj[1]}}</td>  
348 - <td width="32%">{{obj[2]}}</td>  
349 - <td width="20%">{{obj[3]}}</td>  
350 - <td width="3%" hidden="true">{{obj[0]}}</td>  
351 - </tr>  
352 - {{/each}}  
353 - {{if list.length == 0}}  
354 - <tr>  
355 - <td colspan="3"><h6 class="muted">没有找到相关数据</h6></td>  
356 - </tr>  
357 - {{/if}}  
358 -</script>  
359 -<script type="text/html" id="list_info_px">  
360 - {{each list as obj i}}  
361 - <tr>  
362 -  
363 - <td width="45%">{{obj.jName}}\{{obj.jGh}}</td>  
364 - <td width="32%">{{obj.clZbh}}</td>  
365 - <td width="23%">{{obj.lpName}}</td>  
366 - <td hidden="true">{{obj.id}}</td>  
367 - </tr>  
368 - {{/each}}  
369 - {{if list.length == 0}}  
370 - <tr>  
371 - <td colspan="3"><h6 class="muted">没有找到相关数据</h6></td>  
372 - </tr>  
373 - {{/if}}  
374 -</script>  
375 -<script type="text/html" id="ludan_1">  
376 - <tr>  
377 - <td colspan="14">行车路单</td>  
378 - </tr>  
379 - <tr>  
380 - <td colspan="14">路别:{{xlName}} 路牌:{{lpName}} 车号:{{clZbh}}({{plate}}) 出场时间:{{fcsjActual}} 到达站名:{{zdzName}} 当班调派:{{dbdp}} 日期:{{scheduleDate}}</td>  
381 - </tr>  
382 - <tr>  
383 - <td colspan="2">出场存油 {{ccyl}}升</td>  
384 - <td colspan="2">加注量 {{jzl}}升</td>  
385 - <td colspan="2">进场存油 {{jcyl}}升</td>  
386 - <td colspan="4">加注机油 &nbsp;升</td>  
387 - <td colspan="4">本日耗油 {{yh}}升</td>  
388 - </tr>  
389 - <tr>  
390 - <td rowspan="2">调度章</td>  
391 - <td colspan="1">&nbsp;</td>  
392 - <td rowspan="2">早班</td>  
393 - <td colspan="1">&nbsp;</td>  
394 - <td rowspan="2">夜班</td>  
395 - <td colspan="1">&nbsp;</td>  
396 - <td rowspan="2" colspan="2">交叉</td>  
397 - <td colspan="2">&nbsp;</td>  
398 - <td rowspan="2">其他</td>  
399 - <td colspan="1">&nbsp;</td>  
400 - <td colspan="1">&nbsp;</td>  
401 - <td colspan="1">&nbsp;</td>  
402 - </tr>  
403 - <tr>  
404 - <td colspan="1">&nbsp;</td>  
405 - <td colspan="1">&nbsp;</td>  
406 - <td colspan="1">&nbsp;</td>  
407 - <td colspan="2">&nbsp;</td>  
408 - <td colspan="1">&nbsp;</td>  
409 - <td colspan="1">&nbsp;</td>  
410 - <td colspan="1">&nbsp;</td>  
411 - </tr>  
412 - <tr>  
413 - <td rowspan="2">车次</td>  
414 - <td colspan="2">工号</td>  
415 - <td rowspan="2">公里耗油</td>  
416 - <td colspan="2">起讫站</td>  
417 - <td colspan="4">时间</td>  
418 - <td colspan="2">误点</td>  
419 - <td rowspan="2" width="66px">里程(公里)计划</td>  
420 - <td rowspan="2">备注</td>  
421 - </tr>  
422 - <tr>  
423 - <td colspan="1" width="60px">司&nbsp;机</td>  
424 - <td colspan="1" width="60px">售&nbsp;票</td>  
425 - <td colspan="1">起点</td>  
426 - <td colspan="1">终点</td>  
427 - <td colspan="1">计发</td>  
428 - <td colspan="1">实发</td>  
429 - <td colspan="1">应到</td>  
430 - <td colspan="1">实到</td>  
431 - <td colspan="1">快</td>  
432 - <td colspan="1">慢</td>  
433 - </tr>  
434 -</script>  
435 -<script type="text/html" id="ludan_2">  
436 - {{each list as obj i}}  
437 - <tr>  
438 - <td>{{obj.adjustExps}}</td>  
439 - <td>{{obj.jGh}}{{obj.jName}}</td>  
440 - <td>{{if obj.sGh !=null}}  
441 - {{obj.sGh}}{{obj.sName}}  
442 - {{/if}}  
443 - </td>  
444 - <td>&nbsp;</td>  
445 - <td>{{obj.qdzName}}</td>  
446 - <td>{{obj.zdzName}}</td>  
447 - <td>{{obj.fcsj}}</td>  
448 - <td>{{obj.fcsjActual}}</td>  
449 - <td>{{obj.zdsj}}</td>  
450 - <td>{{obj.zdsjActual}}</td>  
451 - <td>{{obj.fast}}</td>  
452 - <td>{{obj.slow}}</td>  
453 - <td>  
454 - {{if obj.zdsjActual!=null}}  
455 - {{obj.jhlc}}  
456 - {{/if}}  
457 - </td>  
458 - <td >  
459 - {{obj.remarks}}  
460 - </td>  
461 - </tr>  
462 - {{/each}}  
463 - {{if list.length == 0}}  
464 - <tr>  
465 - <td colspan="14"><h6 class="muted">没有找到相关数据</h6></td>  
466 - </tr>  
467 - {{/if}}  
468 -</script>  
469 -<script type="text/html" id="ludan_3">  
470 - <tr>  
471 - <td colspan="2">计划班次</td>  
472 - <td>{{jhbc}}</td>  
473 - <td colspan="2">计划公里</td>  
474 - <td>{{jhlc}}</td>  
475 - <td colspan="2">烂班班次</td>  
476 - <td>{{cjbc}}</td>  
477 - <td colspan="3"> 烂班公里</td>  
478 - <td colspan="2">{{remMileage}}</td>  
479 - </tr>  
480 - <tr>  
481 - <td colspan="2">临加班次</td>  
482 - <td>{{ljbc}}</td>  
483 - <td colspan="2">临加公里</td>  
484 - <td>{{addMileage}}</td>  
485 - <td colspan="2">实际班次</td>  
486 - <td>{{sjbc}}</td>  
487 - <td colspan="3">营运公里</td>  
488 - <td colspan="2">{{yygl}}</td>  
489 - </tr>  
490 - <tr>  
491 - <td colspan="2">空驶公里</td>  
492 - <td>{{zkslc}}</td>  
493 - <td colspan="2">总公里</td>  
494 - <td>{{realMileage}}</td>  
495 - <td colspan="2"></td>  
496 - <td></td>  
497 - <td colspan="3"></td>  
498 - <td colspan="2"></td>  
499 - </tr>  
500 -</script> 1 +<style type="text/css">
  2 + .table-bordered {
  3 + border: 1px solid; }
  4 + .table-bordered > thead > tr > th,
  5 + .table-bordered > thead > tr > td,
  6 + .table-bordered > tbody > tr > th,
  7 + .table-bordered > tbody > tr > td,
  8 + .table-bordered > tfoot > tr > th,
  9 + .table-bordered > tfoot > tr > td {
  10 + border: 1px solid; }
  11 + .table-bordered > thead > tr > th,
  12 + .table-bordered > thead > tr > td {
  13 + border-bottom-width: 2px; }
  14 +
  15 + .table > tbody + tbody {
  16 + border-top: 1px solid; }
  17 +</style>
  18 +
  19 +<div class="page-head">
  20 + <div class="page-title">
  21 + <h1>行车路单</h1>
  22 + </div>
  23 +</div>
  24 +
  25 +<div class="row">
  26 + <div class="col-md-12">
  27 + <div class="portlet light porttlet-fit bordered">
  28 + <div class="portlet-title">
  29 + <form class="form-inline" action="">
  30 + <div style="display: inline-block; margin-left: 33px;" id="gsdmDiv_xcld">
  31 + <span class="item-label" style="width: 80px;">公司: </span>
  32 + <select class="form-control" name="company" id="gsdmXcld" style="width: 180px;"></select>
  33 + </div>
  34 + <div style="display: inline-block; margin-left: 24px;" id="fgsdmDiv_xcld">
  35 + <span class="item-label" style="width: 80px;">分公司: </span>
  36 + <select class="form-control" name="subCompany" id="fgsdmXcld" style="width: 180px;"></select>
  37 + </div>
  38 + <div style="margin-top: 2px"></div>
  39 + <div style="display: inline-block; margin-left: 33px;">
  40 + <span class="item-label" style="width: 80px;">线路: </span>
  41 + <select class="form-control" name="line" id="line" style="width: 180px;"></select>
  42 + </div>
  43 + <div style="display: inline-block;margin-left: 24px;">
  44 + <span class="item-label" style="width: 80px;">&nbsp;时间: </span>
  45 + <input class="form-control" type="text" id="date" style="width: 180px;"/>
  46 + </div>
  47 + <div class="form-group" style="display: inline-block;margin-left: 15px;">
  48 + <input class="btn btn-default" type="button" id="query" value="查询"/>
  49 + <input class="btn btn-default" type="button" id="export" value="导出"/>
  50 + <input class="btn btn-default" type="button" id="print" value="打印"/>
  51 + <input class="btn btn-default" type="button" id="exportMore" value="批量导出"/>
  52 + </div>
  53 + </form>
  54 + </div>
  55 + <div class="portlet-body">
  56 + <div class="row">
  57 + <div class="col-md-3">
  58 + <div class="" id="left_height" style="margin-top: 10px;overflow:auto;">
  59 + <table class="table table-bordered table-hover table-checkable pre-scrollable" id="info">
  60 + <thead>
  61 + <tr class="hidden">
  62 + <th class="rypx" style="cursor:pointer ">人员</th>
  63 + <th class="zbhpx" style="cursor:pointer ">自编号</th>
  64 + <th class="lppx" style="cursor:pointer ">路牌</th>
  65 + </tr>
  66 + </thead>
  67 + <tbody>
  68 +
  69 + </tbody>
  70 + </table>
  71 + </div>
  72 + </div>
  73 + <div class="col-md-9" id="printArea">
  74 + <div class="table-container" id="xcld_height" style="margin-top: 10px;overflow:auto;min-width: 906px;">
  75 + <table class="table table-bordered table-checkable" id="forms">
  76 + <tbody class="ludan_1">
  77 +
  78 + </tbody>
  79 + <tbody class="ludan_2">
  80 +
  81 + </tbody>
  82 + <tbody class="ludan_3">
  83 +
  84 + </tbody>
  85 + <tbody class="ludan_4">
  86 +
  87 + </tbody>
  88 + </table>
  89 + </div>
  90 + </div>
  91 + </div>
  92 + </div>
  93 + </div>
  94 + </div>
  95 +</div>
  96 +
  97 +<script>
  98 + $(function(){
  99 + var fage=false;
  100 + // 关闭左侧栏
  101 + if (!$('body').hasClass('page-sidebar-closed'))
  102 + $('.menu-toggler.sidebar-toggler').click();
  103 +
  104 + $("#date").datetimepicker({
  105 + format : 'YYYY-MM-DD',
  106 + locale : 'zh-cn'
  107 + });
  108 +
  109 + $("#left_height").height($(window).height()-100);
  110 + $("#xcld_height").height($(window).height()-100);
  111 +
  112 + var d = new Date();
  113 + var year = d.getFullYear();
  114 + var month = d.getMonth() + 1;
  115 + var day = d.getDate();
  116 + if(month < 10)
  117 + month = "0" + month;
  118 + if(day < 10)
  119 + day = "0" + day;
  120 + $("#date").val(year + "-" + month + "-" + day);
  121 +
  122 + var obj = [];
  123 + var xlList;
  124 + $.get('/report/lineList',function(result){
  125 + xlList=result;
  126 +
  127 + $.get('/user/companyData', function(result){
  128 + obj = result;
  129 + console.log(obj);
  130 + var options = '';
  131 + for(var i = 0; i < obj.length; i++){
  132 + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';
  133 + }
  134 +
  135 + if(obj.length ==0){
  136 + $("#gsdmDiv_xcld").css('display','none');
  137 + }else if(obj.length ==1){
  138 + $("#gsdmDiv_xcld").css('display','none');
  139 + if(obj[0].children.length == 1 || obj[0].children.length ==0)
  140 + $('#fgsdmDiv_xcld').css('display','none');
  141 + }
  142 + $('#gsdmXcld').html(options);
  143 +
  144 + updateCompany();
  145 + });
  146 + });
  147 +
  148 + $("#gsdmXcld").on("change",updateCompany);
  149 + function updateCompany(){
  150 + var company = $('#gsdmXcld').val();
  151 + var options = '';
  152 + for(var i = 0; i < obj.length; i++){
  153 + if(obj[i].companyCode == company){
  154 + var children = obj[i].children;
  155 + for(var j = 0; j < children.length; j++){
  156 + options += '<option value="'+children[j].code+'">'+children[j].name+'</option>';
  157 + }
  158 + }
  159 + }
  160 + $('#fgsdmXcld').html(options);
  161 + initXl();
  162 + }
  163 +
  164 +
  165 +
  166 +
  167 + $("#fgsdmXcld").on("change",initXl);
  168 + function initXl(){
  169 + var data=[];
  170 + if(fage){
  171 + $("#line").select2("destroy").html('');
  172 + }
  173 + var fgs=$('#fgsdmXcld').val();
  174 + var gs=$('#gsdmXcld').val();
  175 + for(var i=0;i<xlList.length;i++){
  176 + if(gs!=""){
  177 + if(fgs!=""){
  178 + if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){
  179 + data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
  180 + }
  181 + }else{
  182 + if(xlList[i]["gsbm"]==gs){
  183 + data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
  184 + }
  185 + }
  186 + }
  187 + }
  188 + initPinYinSelect2('#line',data,'');
  189 + fage=true;
  190 + }
  191 + var date = '';
  192 + var line = '';
  193 + $("#query").on("click",function(){
  194 + $("#left_height").height($(window).height()-100);
  195 + line = $("#line").val();
  196 + date = $("#date").val();
  197 + $(".hidden").removeClass("hidden");
  198 + $get('/realSchedule/queryUserInfo',{line:line,date:date,state:2},function(result){
  199 + // 把数据填充到模版中
  200 + var tbodyHtml = template('list_info',{list:result});
  201 + // 把渲染好的模版html文本追加到表格中
  202 + $('#info tbody').html(tbodyHtml);
  203 + });
  204 + });
  205 + var type="desc";
  206 + $(".rypx").on("click",function(){
  207 + line = $("#line").val();
  208 + date = $("#date").val();
  209 + $(".hidden").removeClass("hidden");
  210 + $get('/realSchedule/queryUserInfoPx',{line:line,date:date,state:"j_Gh",type:type},function(result){
  211 + if(type=="desc"){
  212 + type ="asc";
  213 + }else{
  214 + type ="desc";
  215 + }
  216 + // 把数据填充到模版中
  217 + var tbodyHtml = template('list_info_px',{list:result});
  218 + // 把渲染好的模版html文本追加到表格中
  219 + $('#info tbody').html(tbodyHtml);
  220 + });
  221 + })
  222 +
  223 + $(".zbhpx").on("click",function(){
  224 + line = $("#line").val();
  225 + date = $("#date").val();
  226 + $(".hidden").removeClass("hidden");
  227 + $get('/realSchedule/queryUserInfoPx',{line:line,date:date,state:"clZbh",type:type},function(result){
  228 + if(type=="desc"){
  229 + type ="asc";
  230 + }else{
  231 + type ="desc";
  232 + }
  233 + // 把数据填充到模版中
  234 + var tbodyHtml = template('list_info_px',{list:result});
  235 + // 把渲染好的模版html文本追加到表格中
  236 + $('#info tbody').html(tbodyHtml);
  237 + });
  238 + })
  239 +
  240 + $(".lppx").on("click",function(){
  241 + line = $("#line").val();
  242 + date = $("#date").val();
  243 + $(".hidden").removeClass("hidden");
  244 + $get('/realSchedule/queryUserInfoPx',{line:line,date:date,state:"lpName",type:type},function(result){
  245 + if(type=="desc"){
  246 + type ="asc";
  247 + }else{
  248 + type ="desc";
  249 + }
  250 + // 把数据填充到模版中
  251 + var tbodyHtml = template('list_info_px',{list:result});
  252 + // 把渲染好的模版html文本追加到表格中
  253 + $('#info tbody').html(tbodyHtml);
  254 + });
  255 + })
  256 +
  257 + var params = new Array();
  258 + var jName = '';
  259 + var jGh = '';
  260 + $("#info tbody").on("click","tr",function(){
  261 + if($(this).children().size() < 2){
  262 + return;
  263 + }
  264 + $("#xcld_height").height($(window).height()-100);
  265 + $(this).children().each(function(index){
  266 + params[index] = $(this).text();
  267 + });
  268 + jName = params[0].split("\\")[0];
  269 + jGh = params[0].split("\\")[1];
  270 + var id = params[3];
  271 + var obj = $(this);
  272 + $get('/realSchedule/MapById',{id:id},function(result){
  273 + result.scheduleDate = moment(result.scheduleDate).format("YYYY/MM/DD");
  274 + var ludan_1 = template('ludan_1',result);
  275 + // 把渲染好的模版html文本追加到表格中
  276 + $('#forms .ludan_1').html(ludan_1);
  277 + });
  278 + $get('/realSchedule/queryListWaybill_mh_2',{jName:jName,clZbh:params[1],lpName:params[2],date:date,line:line},function(result){
  279 + getTime(result);
  280 + var ludan_2 = template('ludan_2',{list:result});
  281 + // 把渲染好的模版html文本追加到表格中
  282 + $('#forms .ludan_2').html(ludan_2);
  283 + });
  284 + $get('/realSchedule/findKMBC_mh_2',{jGh:jGh,clZbh:params[1],lpName:params[2],date:date,line:line},function(result){
  285 + var ludan_3 = template('ludan_3',result);
  286 + $('#forms .ludan_3').html(ludan_3);
  287 + $("#info tbody tr").css('background-color', '');
  288 + obj.css('background-color', '#99CCFF');
  289 + });
  290 +
  291 +
  292 + });
  293 +
  294 + $("#export").on("click",function(){
  295 + if(params.length < 1){
  296 + return;
  297 + }
  298 + $get('/realSchedule/exportWaybill',{jName:jName,clZbh:params[1],lpName:params[2],date:date,line:line},function(result){
  299 + window.open("/downloadFile/download?fileName="+date+"-"+jName+"-"+params[1]+"-"+params[2]+"-行车路单");
  300 + });
  301 + });
  302 +
  303 + $("#print").click(function(){
  304 + $("#printArea").printArea();
  305 + });
  306 +
  307 + $("#exportMore").on("click",function(){
  308 + if($("#info tbody tr td").length <= 1)
  309 + return;
  310 + var param = new Array();
  311 + $("#info tbody tr").each(function(index){
  312 + param[index] = new Array();
  313 + $(this).children().each(function(i){
  314 + if(i<3){
  315 + param[index][i] = $(this).text().split("\\")[0];
  316 + if(i==0){
  317 + param[index][3] = $(this).text().split("\\")[1];
  318 +
  319 + }
  320 + }
  321 + });
  322 + });
  323 + $get('/realSchedule/exportWaybillMore',{date:date,line:line,strs:JSON.stringify(param)},function(result){
  324 + window.open("/downloadFile/downloadList?fileName="+result.fileName);
  325 + });
  326 + });
  327 +
  328 + function getTime(list){
  329 + $.each(list, function(i, obj) {
  330 + if(obj.zdsj != null && obj.zdsjActual != null ){
  331 + var zdsjActual = (obj.zdsjActual).split(":");
  332 + var zdsj = (obj.zdsj).split(":");
  333 + if(zdsjActual[0]*60+Number(zdsjActual[1]) > zdsj[0]*60+Number(zdsj[1])){
  334 + obj["slow"] = (zdsjActual[0]*60+Number(zdsjActual[1])) - (zdsj[0]*60+Number(zdsj[1]));
  335 + }
  336 + else if(zdsjActual[0]*60+Number(zdsjActual[1]) < zdsj[0]*60+Number(zdsj[1])){
  337 + obj["fast"] = (zdsj[0]*60+Number(zdsj[1])) - (zdsjActual[0]*60+Number(zdsjActual[1]));
  338 + }
  339 + }
  340 + });
  341 + }
  342 + });
  343 +</script>
  344 +<script type="text/html" id="list_info">
  345 + {{each list as obj i}}
  346 + <tr>
  347 + <td width="45%">{{obj[4]}}\{{obj[1]}}</td>
  348 + <td width="32%">{{obj[2]}}</td>
  349 + <td width="20%">{{obj[3]}}</td>
  350 + <td width="3%" hidden="true">{{obj[0]}}</td>
  351 + </tr>
  352 + {{/each}}
  353 + {{if list.length == 0}}
  354 + <tr>
  355 + <td colspan="3"><h6 class="muted">没有找到相关数据</h6></td>
  356 + </tr>
  357 + {{/if}}
  358 +</script>
  359 +<script type="text/html" id="list_info_px">
  360 + {{each list as obj i}}
  361 + <tr>
  362 +
  363 + <td width="45%">{{obj.jName}}\{{obj.jGh}}</td>
  364 + <td width="32%">{{obj.clZbh}}</td>
  365 + <td width="23%">{{obj.lpName}}</td>
  366 + <td hidden="true">{{obj.id}}</td>
  367 + </tr>
  368 + {{/each}}
  369 + {{if list.length == 0}}
  370 + <tr>
  371 + <td colspan="3"><h6 class="muted">没有找到相关数据</h6></td>
  372 + </tr>
  373 + {{/if}}
  374 +</script>
  375 +<script type="text/html" id="ludan_1">
  376 + <tr>
  377 + <td colspan="14">行车路单</td>
  378 + </tr>
  379 + <tr>
  380 + <td colspan="14">路别:{{xlName}} 路牌:{{lpName}} 车号:{{clZbh}}({{plate}}) 出场时间:{{fcsjActual}} 到达站名:{{zdzName}} 当班调派:{{dbdp}} 日期:{{scheduleDate}}</td>
  381 + </tr>
  382 + <tr>
  383 + <td colspan="2">出场存油 {{ccyl}}升</td>
  384 + <td colspan="2">加注量 {{jzl}}升</td>
  385 + <td colspan="2">进场存油 {{jcyl}}升</td>
  386 + <td colspan="4">加注机油 &nbsp;升</td>
  387 + <td colspan="4">本日耗油 {{yh}}升</td>
  388 + </tr>
  389 + <tr>
  390 + <td rowspan="2">调度章</td>
  391 + <td colspan="1">&nbsp;</td>
  392 + <td rowspan="2">早班</td>
  393 + <td colspan="1">&nbsp;</td>
  394 + <td rowspan="2">夜班</td>
  395 + <td colspan="1">&nbsp;</td>
  396 + <td rowspan="2" colspan="2">交叉</td>
  397 + <td colspan="2">&nbsp;</td>
  398 + <td rowspan="2">其他</td>
  399 + <td colspan="1">&nbsp;</td>
  400 + <td colspan="1">&nbsp;</td>
  401 + <td colspan="1">&nbsp;</td>
  402 + </tr>
  403 + <tr>
  404 + <td colspan="1">&nbsp;</td>
  405 + <td colspan="1">&nbsp;</td>
  406 + <td colspan="1">&nbsp;</td>
  407 + <td colspan="2">&nbsp;</td>
  408 + <td colspan="1">&nbsp;</td>
  409 + <td colspan="1">&nbsp;</td>
  410 + <td colspan="1">&nbsp;</td>
  411 + </tr>
  412 + <tr>
  413 + <td rowspan="2">车次</td>
  414 + <td colspan="2">工号</td>
  415 + <td rowspan="2">公里耗油</td>
  416 + <td colspan="2">起讫站</td>
  417 + <td colspan="4">时间</td>
  418 + <td colspan="2">误点</td>
  419 + <td rowspan="2" width="66px">里程(公里)计划</td>
  420 + <td rowspan="2">备注</td>
  421 + </tr>
  422 + <tr>
  423 + <td colspan="1" width="60px">司&nbsp;机</td>
  424 + <td colspan="1" width="60px">售&nbsp;票</td>
  425 + <td colspan="1">起点</td>
  426 + <td colspan="1">终点</td>
  427 + <td colspan="1">计发</td>
  428 + <td colspan="1">实发</td>
  429 + <td colspan="1">应到</td>
  430 + <td colspan="1">实到</td>
  431 + <td colspan="1">快</td>
  432 + <td colspan="1">慢</td>
  433 + </tr>
  434 +</script>
  435 +<script type="text/html" id="ludan_2">
  436 + {{each list as obj i}}
  437 + <tr>
  438 + <td>{{obj.adjustExps}}</td>
  439 + <td>{{obj.jGh}}{{obj.jName}}</td>
  440 + <td>{{if obj.sGh !=null}}
  441 + {{obj.sGh}}{{obj.sName}}
  442 + {{/if}}
  443 + </td>
  444 + <td>&nbsp;</td>
  445 + <td>{{obj.qdzName}}</td>
  446 + <td>{{obj.zdzName}}</td>
  447 + <td>{{obj.fcsj}}</td>
  448 + <td>{{obj.fcsjActual}}</td>
  449 + <td>{{obj.zdsj}}</td>
  450 + <td>{{obj.zdsjActual}}</td>
  451 + <td>{{obj.fast}}</td>
  452 + <td>{{obj.slow}}</td>
  453 + <td>
  454 + {{if obj.zdsjActual!=null}}
  455 + {{obj.jhlc}}
  456 + {{/if}}
  457 + </td>
  458 + <td >
  459 + {{obj.remarks}}
  460 + </td>
  461 + </tr>
  462 + {{/each}}
  463 + {{if list.length == 0}}
  464 + <tr>
  465 + <td colspan="14"><h6 class="muted">没有找到相关数据</h6></td>
  466 + </tr>
  467 + {{/if}}
  468 +</script>
  469 +<script type="text/html" id="ludan_3">
  470 + <tr>
  471 + <td colspan="2">计划班次</td>
  472 + <td>{{jhbc}}</td>
  473 + <td colspan="2">计划公里</td>
  474 + <td>{{jhlc}}</td>
  475 + <td colspan="2">烂班班次</td>
  476 + <td>{{cjbc}}</td>
  477 + <td colspan="3"> 烂班公里</td>
  478 + <td colspan="2">{{remMileage}}</td>
  479 + </tr>
  480 + <tr>
  481 + <td colspan="2">临加班次</td>
  482 + <td>{{ljbc}}</td>
  483 + <td colspan="2">临加公里</td>
  484 + <td>{{addMileage}}</td>
  485 + <td colspan="2">实际班次</td>
  486 + <td>{{sjbc}}</td>
  487 + <td colspan="3">营运公里</td>
  488 + <td colspan="2">{{yygl}}</td>
  489 + </tr>
  490 + <tr>
  491 + <td colspan="2">空驶公里</td>
  492 + <td>{{zkslc}}</td>
  493 + <td colspan="2">总公里</td>
  494 + <td>{{realMileage}}</td>
  495 + <td colspan="2"></td>
  496 + <td></td>
  497 + <td colspan="3"></td>
  498 + <td colspan="2"></td>
  499 + </tr>
  500 +</script>
src/main/resources/static/pages/report/countMileage/countBus/countBusMileage.html
@@ -37,7 +37,7 @@ @@ -37,7 +37,7 @@
37 <div class="portlet light porttlet-fit bordered"> 37 <div class="portlet light porttlet-fit bordered">
38 <div class="portlet-title"> 38 <div class="portlet-title">
39 <form class="form-inline" action=""> 39 <form class="form-inline" action="">
40 - <div style="display: inline-block; " id="gsdmDiv"> 40 + <div style="display: inline-block;margin-left: 28px; " id="gsdmDiv">
41 <span class="item-label" style="width: 80px;">公司: </span> 41 <span class="item-label" style="width: 80px;">公司: </span>
42 <select class="form-control" name="company" id="gsdm" style="width: 180px;"></select> 42 <select class="form-control" name="company" id="gsdm" style="width: 180px;"></select>
43 </div> 43 </div>
@@ -45,12 +45,13 @@ @@ -45,12 +45,13 @@
45 <span class="item-label" style="width: 80px;">分公司: </span> 45 <span class="item-label" style="width: 80px;">分公司: </span>
46 <select class="form-control" name="subCompany" id="fgsdm" style="width: 180px;"></select> 46 <select class="form-control" name="subCompany" id="fgsdm" style="width: 180px;"></select>
47 </div> 47 </div>
48 - <div style="margin-top: 2px"></div>  
49 - <div style="display: inline-block;"> 48 + <div style="display: inline-block;margin-left: 43px;">
50 <span class="item-label" style="width: 80px;">线路: </span> 49 <span class="item-label" style="width: 80px;">线路: </span>
51 <select class="form-control" name="line" id="line" style="width: 180px;"></select> 50 <select class="form-control" name="line" id="line" style="width: 180px;"></select>
52 </div> 51 </div>
53 - <div style="display: inline-block;margin-left: 15px;"> 52 + <div style="margin-top: 2px"></div>
  53 +
  54 + <div style="display: inline-block;">
54 <span class="item-label" style="width: 80px;">开始时间: </span> 55 <span class="item-label" style="width: 80px;">开始时间: </span>
55 <input class="form-control" type="text" id="date" style="width: 180px;"/> 56 <input class="form-control" type="text" id="date" style="width: 180px;"/>
56 </div> 57 </div>
@@ -58,7 +59,14 @@ @@ -58,7 +59,14 @@
58 <span class="item-label" style="width: 80px;">结束时间: </span> 59 <span class="item-label" style="width: 80px;">结束时间: </span>
59 <input class="form-control" type="text" id="date2" style="width: 180px;"/> 60 <input class="form-control" type="text" id="date2" style="width: 180px;"/>
60 </div> 61 </div>
61 - <div class="form-group"> 62 + <div style="display: inline-block;margin-left: 15px;">
  63 + <span class="item-label" style="width: 80px;">显示分类: </span>
  64 + <select class="form-control" style="width: 120px;" id="zt">
  65 + <option value="zbh">车辆</option>
  66 + <option value="js">驾/售</option>
  67 + </select>
  68 + </div>
  69 + <div class="form-group" style="margin-left: 55px;">
62 <input class="btn btn-default" type="button" id="query" value="查询"/> 70 <input class="btn btn-default" type="button" id="query" value="查询"/>
63 <input class="btn btn-default" type="button" id="export" value="导出"/> 71 <input class="btn btn-default" type="button" id="export" value="导出"/>
64 </div> 72 </div>
@@ -67,43 +75,8 @@ @@ -67,43 +75,8 @@
67 <div class="portlet-body"> 75 <div class="portlet-body">
68 <div class="table-container" id="countLine" style="margin-top: 10px;overflow:auto;min-width: 906px"> 76 <div class="table-container" id="countLine" style="margin-top: 10px;overflow:auto;min-width: 906px">
69 <table class="table table-bordered table-hover table-checkable" id="forms"> 77 <table class="table table-bordered table-hover table-checkable" id="forms">
70 - <thead>  
71 - <tr>  
72 - <th colspan="26">路单数据统计表</th>  
73 - </tr>  
74 - <tr>  
75 - <td>序号</td>  
76 - <td>日期</td>  
77 - <td>所属公司</td>  
78 - <td>线路</td>  
79 - <td>车号</td>  
80 - <td>司机职号</td>  
81 - <td>司机姓名</td>  
82 - <td>售票员职号</td>  
83 - <td>售票员姓名</td>  
84 - <td>行驶里程(包括空放)</td>  
85 - <td>计划内营运里程</td>  
86 - <td>临时性多样化调度营运里程</td>  
87 - <td>计划内进出场空驶里程</td>  
88 - <td>计划外进出场空驶里程</td>  
89 - <td>空放空驶</td>  
90 - <td>故障进出场空驶里程</td>  
91 - <td>肇事进出场空驶里程</td>  
92 - <td>纠纷进出场空驶里程</td>  
93 - <td>临加营运公里</td>  
94 - <td>临加进出场空驶</td>  
95 - <td>电耗量</td>  
96 - <td>加电量</td>  
97 - <td>耗油量</td>  
98 - <td>加注量</td>  
99 - <td>非营业用油</td>  
100 - <td>计划总公里</td>  
101 - </tr>  
102 -  
103 - </thead>  
104 - <tbody class="statisticsDaily">  
105 -  
106 - </tbody> 78 +
  79 +
107 </table> 80 </table>
108 </div> 81 </div>
109 </div> 82 </div>
@@ -209,7 +182,10 @@ @@ -209,7 +182,10 @@
209 var date2 =""; 182 var date2 ="";
210 var gsdm=""; 183 var gsdm="";
211 var fgsdm=""; 184 var fgsdm="";
  185 + var zt="";
  186 + $("#countLine").height($(window).height()-280);
212 $("#query").on("click",function(){ 187 $("#query").on("click",function(){
  188 + $("#countLine").height($(window).height()-280);
213 if($("#date").val() == null || $("#date").val().trim().length == 0){ 189 if($("#date").val() == null || $("#date").val().trim().length == 0){
214 layer.msg("请选择时间范围!"); 190 layer.msg("请选择时间范围!");
215 return; 191 return;
@@ -224,6 +200,7 @@ @@ -224,6 +200,7 @@
224 date2 =$("#date2").val(); 200 date2 =$("#date2").val();
225 gsdm =$("#gsdm").val(); 201 gsdm =$("#gsdm").val();
226 fgsdm=$("#fgsdm").val(); 202 fgsdm=$("#fgsdm").val();
  203 + zt=$("#zt").val();
227 if(line=="请选择"){ 204 if(line=="请选择"){
228 line=""; 205 line="";
229 } 206 }
@@ -237,22 +214,25 @@ @@ -237,22 +214,25 @@
237 params['date'] = date; 214 params['date'] = date;
238 params['date2'] = date2; 215 params['date2'] = date2;
239 params['xlName'] = xlName; 216 params['xlName'] = xlName;
  217 + params['zt']=zt;
240 params['type'] = "query"; 218 params['type'] = "query";
241 - $get('/report/countLineMileage',params,function(result){ 219 + var tbodyHtml = template('countBusDaily',{list:""});
  220 + $get('/report/countBusMileage',params,function(result){
  221 + console.log(result);
242 // 把数据填充到模版中 222 // 把数据填充到模版中
243 - var tbodyHtml = template('statisticsDaily',{list:result}); 223 + var tbodyHtml = template('countBusDaily',{list:result,zt:zt});
244 // 把渲染好的模版html文本追加到表格中 224 // 把渲染好的模版html文本追加到表格中
245 - $('#forms .statisticsDaily').html(tbodyHtml); 225 + $('#forms').html(tbodyHtml);
246 226
247 if(result.length == 0) 227 if(result.length == 0)
248 $("#export").attr('disabled',"true"); 228 $("#export").attr('disabled',"true");
249 else 229 else
250 $("#export").removeAttr("disabled"); 230 $("#export").removeAttr("disabled");
251 - }); 231 + });
252 } 232 }
253 233
254 }); 234 });
255 - $("#countLine").height($(window).height()-280); 235 +
256 $("#export").on("click",function(){ 236 $("#export").on("click",function(){
257 var params = {}; 237 var params = {};
258 params['gsdm'] = gsdm; 238 params['gsdm'] = gsdm;
@@ -261,63 +241,88 @@ @@ -261,63 +241,88 @@
261 params['date'] = date; 241 params['date'] = date;
262 params['date2'] = date2; 242 params['date2'] = date2;
263 params['xlName'] = xlName; 243 params['xlName'] = xlName;
  244 + params['zt']=zt;
264 params['type'] = "export"; 245 params['type'] = "export";
265 - $get('/realSchedule/statisticsDailyTj',params,function(result){  
266 - window.open("/downloadFile/download?fileName=统计日报"+moment(date).format("YYYYMMDD")); 246 + $get('/report/countBusMileage',params,function(result){
  247 + window.open("/downloadFile/download?fileName=路单数据统计表");
267 }); 248 });
268 }); 249 });
269 250
270 }); 251 });
271 </script> 252 </script>
272 -<script type="text/html" id="statisticsDaily"> 253 +<script type="text/html" id="countBusDaily">
  254 + <thead>
  255 + <tr>
  256 + <th colspan="26">路单数据统计表</th>
  257 + </tr>
  258 + <tr>
  259 + <td>序号</td>
  260 + <td>日期</td>
  261 + <td>所属公司</td>
  262 + <td>线路</td>
  263 + <td>车号</td>
  264 + {{if zt=='js'}}
  265 + <td>司机职号</td>
  266 + <td>司机姓名</td>
  267 + <td>售票员职号</td>
  268 + <td>售票员姓名</td>
  269 + {{/if}}
  270 + <td>行驶里程(包括空放)</td>
  271 + <td>计划内营运里程</td>
  272 + <td><label>临时性</label><label>多样化</label><label>调度营</label><label>运里程</label></td>
  273 + <td><label>计划内</label><label>进出场</label><label>空驶</label></td>
  274 + <td><label>计划外</label><label>进出场</label><label>空驶</label></td>
  275 + <td>空放空驶</td>
  276 + <td><label>故障</label><label>进出场</label><label>空驶</label></td>
  277 + <td><label>肇事</label><label>进出场</label><label>空驶</label></td>
  278 + <td><label>纠纷</label><label>进出场</label><label>空驶</label></td>
  279 + <td>临加营运公里</td>
  280 + <td>临加进出场空驶</td>
  281 + <td>电耗量</td>
  282 + <td>加电量</td>
  283 + <td>耗油量</td>
  284 + <td>加注量</td>
  285 + <td>非营业用油</td>
  286 + <td>计划总公里</td>
  287 + </tr>
  288 + </thead>
  289 + <tbody >
273 {{each list as obj i}} 290 {{each list as obj i}}
274 <tr> 291 <tr>
  292 + <td>{{i+1}}</td>
  293 + <td>{{obj.rq}}</td>
  294 + <td>{{obj.fgs}}</td>
275 <td>{{obj.xlName}}</td> 295 <td>{{obj.xlName}}</td>
276 - <td>{{obj.jhzlc}}</td>  
277 - <td>{{obj.jhlc}}</td>  
278 - <td>{{obj.jcclc}}</td>  
279 - <td>{{obj.sjzgl}}</td>  
280 - <td>{{obj.sjgl}}</td>  
281 - <td>{{obj.sjksgl}}</td>  
282 - <td>{{obj.ssgl}}</td>  
283 - <td>{{obj.ssbc}}</td>  
284 - <td>{{obj.ssgl_lz}}</td>  
285 - <td>{{obj.ssgl_dm}}</td>  
286 - <td>{{obj.ssgl_gz}}</td>  
287 - <td>{{obj.ssgl_jf}}</td>  
288 - <td>{{obj.ssgl_zs}}</td>  
289 - <td>{{obj.ssgl_qr}}</td>  
290 - <td>{{obj.ssgl_qc}}</td>  
291 - <td>{{obj.ssgl_kx}}</td>  
292 - <td>{{obj.ssgl_qh}}</td>  
293 - <td>{{obj.ssgl_yw}}</td>  
294 - <td>{{obj.ssgl_other}}</td>  
295 - <td>{{obj.ljgl}}</td>  
296 - <td>{{obj.jhbc}}</td>  
297 - <td>{{obj.jhbc_m}}</td>  
298 - <td>{{obj.jhbc_a}}</td>  
299 - <td>{{obj.sjbc}}</td>  
300 - <td>{{obj.sjbc_m}}</td>  
301 - <td>{{obj.sjbc_a}}</td>  
302 - <td>{{obj.ljbc}}</td>  
303 - <td>{{obj.ljbc_m}}</td>  
304 - <td>{{obj.ljbc_a}}</td>  
305 - <td>{{obj.fzbc}}</td>  
306 - <td>{{obj.fzbc_m}}</td>  
307 - <td>{{obj.fzbc_a}}</td>  
308 - <td>{{obj.dtbc}}</td>  
309 - <td>{{obj.dtbc_m}}</td>  
310 - <td>{{obj.dtbc_a}}</td>  
311 - <td>{{obj.djg}}</td>  
312 - <td>{{obj.djg_m}}</td>  
313 - <td>{{obj.djg_a}}</td>  
314 - <td>{{obj.djg_time}}</td>  
315 - <td>&nbsp;</td> 296 + <td>{{obj.nbbm}}</td>
  297 + {{if zt=='js'}}
  298 + <td>{{obj.jGh}}</td>
  299 + <td>{{obj.jName}}</td>
  300 + <td>{{obj.sGh}}</td>
  301 + <td>{{obj.sName}}</td>
  302 + {{/if}}
  303 + <td>{{obj.zlc}}</td>
  304 + <td>{{obj.jhnlc}}</td>
  305 + <td>{{obj.jhwlc}}</td>
  306 + <td>{{obj.jhnjcclc}}</td>
  307 + <td>{{obj.jhwjcclc}}</td>
  308 + <td>{{obj.kfks}}</td>
  309 + <td>{{obj.zrwjcclc}}</td>
  310 + <td>0</td>
  311 + <td>0</td>
  312 + <td>{{obj.ljyy}}</td>
  313 + <td>{{obj.ljjcc}}</td>
  314 + <td>{{obj.yhl}}</td>
  315 + <td>{{obj.jzl}}</td>
  316 + <td>{{obj.hyl}}</td>
  317 + <td>{{obj.dhl}}</td>
  318 + <td>{{obj.cdl}}</td>
  319 + <td>{{obj.jhzlc}}</td>
316 </tr> 320 </tr>
317 {{/each}} 321 {{/each}}
318 {{if list.length == 0}} 322 {{if list.length == 0}}
319 <tr> 323 <tr>
320 - <td colspan="44"><h6 class="muted">没有找到相关数据</h6></td> 324 + <td colspan="26"><h6 class="muted">没有找到相关数据</h6></td>
321 </tr> 325 </tr>
322 {{/if}} 326 {{/if}}
  327 +</tbody>
323 </script> 328 </script>
324 \ No newline at end of file 329 \ No newline at end of file
src/main/resources/static/pages/report/countMileage/countLine/countLineMileage.html
@@ -272,7 +272,7 @@ @@ -272,7 +272,7 @@
272 params['date2'] = date2; 272 params['date2'] = date2;
273 params['xlName'] = xlName; 273 params['xlName'] = xlName;
274 params['type'] = "export"; 274 params['type'] = "export";
275 - $get('/realSchedule/countLineMileage',params,function(result){ 275 + $get('/report/countLineMileage',params,function(result){
276 window.open("/downloadFile/download?fileName=线路公里统计表"); 276 window.open("/downloadFile/download?fileName=线路公里统计表");
277 }); 277 });
278 }); 278 });
src/main/resources/static/pages/scheduleApp/module/common/prj-common-globalservice.js
@@ -520,7 +520,7 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;SchedulePlanInfoManageService_g&#39;, [&#39;$reso @@ -520,7 +520,7 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;SchedulePlanInfoManageService_g&#39;, [&#39;$reso
520 return { 520 return {
521 rest : $resource( 521 rest : $resource(
522 '/spic/:id', 522 '/spic/:id',
523 - {order: 'xl,scheduleDate,lp,xlDir,fcno', direction: 'ASC,ASC,ASC,ASC,ASC', id: '@id'}, 523 + {order: 'xl,scheduleDate,lp,fcno', direction: 'ASC,ASC,ASC,ASC', id: '@id'},
524 { 524 {
525 list: { 525 list: {
526 method: 'GET', 526 method: 'GET',
src/main/resources/static/pages/scheduleApp/module/core/schedulePlanManage/info/list_info.html
@@ -12,8 +12,8 @@ @@ -12,8 +12,8 @@
12 <th style="width: 120px;">驾驶员(工号)</th> 12 <th style="width: 120px;">驾驶员(工号)</th>
13 <!--<th style="width: 120px;">售票员(工号)</th>--> 13 <!--<th style="width: 120px;">售票员(工号)</th>-->
14 <th style="width: 80px;">班次类型</th> 14 <th style="width: 80px;">班次类型</th>
15 - <th style="width: 80px;">上下行</th>  
16 <th style="width: 80px;">发车时间</th> 15 <th style="width: 80px;">发车时间</th>
  16 + <th style="width: 80px;">上下行</th>
17 <th style="width: 80px;">起点站</th> 17 <th style="width: 80px;">起点站</th>
18 <th style="width: 80px;">终点站</th> 18 <th style="width: 80px;">终点站</th>
19 <th style="width: 60px">备注</th> 19 <th style="width: 60px">备注</th>
@@ -84,6 +84,12 @@ @@ -84,6 +84,12 @@
84 <span ng-bind="info.bcType | dict:'ScheduleType':'未知' "></span> 84 <span ng-bind="info.bcType | dict:'ScheduleType':'未知' "></span>
85 </td> 85 </td>
86 <td> 86 <td>
  87 + <a href="#">
  88 + <i class="fa fa-clock-o" aria-hidden="true"></i>
  89 + <span ng-bind="info.fcsj"></span>
  90 + </a>
  91 + </td>
  92 + <td>
87 <a href="#" ng-if="info.xlDir == '0'"> 93 <a href="#" ng-if="info.xlDir == '0'">
88 <i class="fa fa-arrow-up" aria-hidden="true"></i> 94 <i class="fa fa-arrow-up" aria-hidden="true"></i>
89 <span ng-bind="info.xlDir | dict:'LineTrend2':'未知' "></span> 95 <span ng-bind="info.xlDir | dict:'LineTrend2':'未知' "></span>
@@ -94,12 +100,6 @@ @@ -94,12 +100,6 @@
94 </a> 100 </a>
95 </td> 101 </td>
96 <td> 102 <td>
97 - <a href="#">  
98 - <i class="fa fa-clock-o" aria-hidden="true"></i>  
99 - <span ng-bind="info.fcsj"></span>  
100 - </a>  
101 - </td>  
102 - <td>  
103 <a href="#" 103 <a href="#"
104 tooltip-animation="false" 104 tooltip-animation="false"
105 tooltip-placement="top" 105 tooltip-placement="top"
@@ -136,10 +136,23 @@ @@ -136,10 +136,23 @@
136 </a> 136 </a>
137 </td> 137 </td>
138 <td> 138 <td>
139 - <span ng-bind="info.updateBy.userName"></span> 139 + <a href="#"
  140 + tooltip-animation="false"
  141 + tooltip-placement="top"
  142 + uib-tooltip="{{info.updateBy.userName}}"
  143 + tooltip-class="headClass">
  144 + <i class="fa fa-user"></i>
  145 + <span ng-bind="info.updateBy.userName"></span>
  146 + </a>
140 </td> 147 </td>
141 <td> 148 <td>
142 - <span ng-bind="info.updateDate | date: 'yyyy-MM-dd'"></span> 149 + <a href="#"
  150 + tooltip-animation="false"
  151 + tooltip-placement="left"
  152 + uib-tooltip="{{info.updateDate | date: 'yyyy-MM-dd HH:mm:ss'}}"
  153 + tooltip-class="headClass">
  154 + <span ng-bind="info.updateDate | date: 'yyyy-MM-dd HH:mm:ss'"></span>
  155 + </a>
143 </td> 156 </td>
144 157
145 </tr> 158 </tr>
src/main/resources/static/pages/scheduleApp/module/core/schedulePlanManage/service.js
@@ -64,7 +64,7 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;SchedulePlanInfoManageService_g&#39;, [&#39;$reso @@ -64,7 +64,7 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;SchedulePlanInfoManageService_g&#39;, [&#39;$reso
64 return { 64 return {
65 rest : $resource( 65 rest : $resource(
66 '/spic/:id', 66 '/spic/:id',
67 - {order: 'xl,scheduleDate,lp,xlDir,fcno', direction: 'ASC,ASC,ASC,ASC,ASC', id: '@id'}, 67 + {order: 'xl,scheduleDate,lp,fcno', direction: 'ASC,ASC,ASC,ASC', id: '@id'},
68 { 68 {
69 list: { 69 list: {
70 method: 'GET', 70 method: 'GET',
src/main/resources/static/real_control_v2/fragments/device_config/list.html
1 -<div class="ct_layer_modal device_configs_manager">  
2 -  
3 - <div style="height: calc(100% - 20px);">  
4 - <div class="search_form">  
5 - <form class="uk-form search-form">  
6 - <fieldset data-uk-margin>  
7 - <span class="horizontal-field">线路</span>  
8 - <div class="uk-autocomplete uk-form autocomplete-line" >  
9 - <input type="text" name="lineId" placeholder="线路">  
10 - </div>  
11 - <span class="horizontal-field">车辆</span>  
12 - <div class="uk-autocomplete uk-form autocomplete-cars" >  
13 - <input type="text" name="nbbm" placeholder="车辆自编号">  
14 - </div>  
15 - <span class="horizontal-field">设备号</span>  
16 - <div class="uk-autocomplete uk-form autocomplete-device" >  
17 - <input type="text" name="deviceId" placeholder="设备号">  
18 - </div>  
19 - <button class="uk-button" type="submit"><i class="uk-icon-search"></i> 检索</button>  
20 - &nbsp;  
21 - <button class="uk-button param_config_btn" >参数配置</button>  
22 - &nbsp;  
23 - <button class="uk-button up_soft_version_btn" >升级程序版本</button>  
24 - </fieldset>  
25 - </form>  
26 - </div>  
27 -  
28 - <div class="ct_table_wrap ct_table_no_border" style="height: calc(100% - 115px);overflow: hidden;margin-top: 0;">  
29 - <div class="ct_table device_config_table">  
30 - <div class="ct_table_head" style="top: 0px;">  
31 - <dl>  
32 - <dt data-uk-tooltip title="车辆">车辆</dt>  
33 - <dt data-uk-tooltip title="设备号">设备号</dt>  
34 - <dt data-uk-tooltip title="网关IP">网关IP</dt>  
35 - <dt data-uk-tooltip title="网关端口">网关端口</dt>  
36 - <dt data-uk-tooltip title="定时定距上报模式">模式</dt>  
37 - <dt data-uk-tooltip title="定时上报时间间隔">时间</dt>  
38 - <dt data-uk-tooltip title="定距上报距离间隔">距离</dt>  
39 - <dt data-uk-tooltip title="非线路状态超速阀门">超速阀门</dt>  
40 - <dt data-uk-tooltip title="预警阀门">预警阀门</dt>  
41 - <dt data-uk-tooltip title="pos机IP地址">POS机IP</dt>  
42 - <dt data-uk-tooltip title="pos机端口">POS端口</dt>  
43 - <dt data-uk-tooltip title="延迟关机时间">延迟关机</dt>  
44 - <dt data-uk-tooltip title="中门视频切换到码表界面速度阀门">中码</dt>  
45 - <dt data-uk-tooltip title="码表界面切换到中门视频速度阀门">码中</dt>  
46 - <dt data-uk-tooltip title="对比度">对比度</dt>  
47 - <dt data-uk-tooltip title="亮度">亮度</dt>  
48 - <dt data-uk-tooltip title="饱和度">饱和度</dt>  
49 - <dt data-uk-tooltip title="参数上报时间">参数上报时间</dt>  
50 - </dl>  
51 - </div>  
52 - <div class="ct_table_body">  
53 - </div>  
54 - </div>  
55 - </div>  
56 - <div class="uk-modal-footer uk-text-right pagination-wrap" style="margin: 0;">  
57 - </div>  
58 - </div>  
59 -  
60 - <script id="device_configs_table-temp" type="text/html">  
61 - {{each list as c i}}  
62 - <dl>  
63 - <dd>{{c.insideCode}}</dd>  
64 - <dd>{{c.equipmentCode}}</dd>  
65 - <dd title="{{c.ipAddress}}">{{c.ipAddress}}</dd>  
66 - <dd>{{c.port}}</dd>  
67 - <dd>{{c.reportMode}}</dd>  
68 - <dd>{{c.interval}}</dd>  
69 - <dd>{{c.distance}}</dd>  
70 - <dd>{{c.speedingThreshold}}</dd>  
71 - <dd>{{c.alarmThreshold}}</dd>  
72 - <dd title="{{c.posIpAddress}}">{{c.posIpAddress}}</dd>  
73 - <dd>{{c.posPort}}</dd>  
74 - <dd>  
75 - {{if c.delay != null}}  
76 - {{c.delay}}分钟  
77 - {{/if}}  
78 - </dd>  
79 - <dd>{{c.speedThreshold1}}</dd>  
80 - <dd>{{c.speedThreshold2}}</dd>  
81 - <dd>{{c.contrast}}</dd>  
82 - <dd>{{c.brightness}}</dd>  
83 - <dd>{{c.saturation}}</dd>  
84 - <dd>  
85 - {{if c.timestamp != null}}  
86 - {{c.timeStr}}  
87 - {{else}}  
88 - <a class="query_params_link" data-nbbm="{{c.insideCode}}" style="font-size: 12px;" title="指令通知设备,将当前参数上传至平台">查询设备参数</a>  
89 - {{/if}}  
90 - </dd>  
91 - </dl>  
92 - {{/each}}  
93 - </script>  
94 - <script>  
95 - (function () {  
96 - var modal = $('.ct_layer_modal.device_configs_manager');  
97 - var form = $('.search-form', modal);  
98 -  
99 - //车辆 autocomplete  
100 - gb_common.carAutocomplete($('.autocomplete-cars', modal), gb_data_basic.carsArray());  
101 - //线路 autocomplete  
102 - gb_common.lineAutocomplete($('.autocomplete-line', modal));  
103 - //设备号autocomplete  
104 - var deviceArray = gb_common.get_keys(gb_data_basic.device2nbbmMap()),deviceData=[];  
105 - $.each(deviceArray, function(){  
106 - deviceData.push({value: this});  
107 - });  
108 - gb_common.init_autocomplete($('.autocomplete-device', modal), deviceData);  
109 -  
110 - var page=0,size=13;  
111 -  
112 - //sumit event  
113 - form.on('submit', function(e) {  
114 - e.preventDefault();  
115 - resetPagination = true;  
116 - page=0;  
117 - query();  
118 - });  
119 -  
120 - $(modal).on('init', function(e, data) {  
121 - e.stopPropagation();  
122 - if(data){  
123 - if(data.nbbm)  
124 - $('[name=nbbm]', form).val(data.nbbm);  
125 - if(data.deviceId)  
126 - $('[name=deviceId]', form).val(data.deviceId);  
127 - }  
128 - query();  
129 - });  
130 -  
131 - function query() {  
132 - var data = form.serializeJSON();  
133 - data.page = page;  
134 - data.size = size;  
135 -  
136 - //线路转换成编码  
137 - if(data.lineId){  
138 - var lineCode = gb_data_basic.findCodeByLinename(data.lineId);  
139 - if(lineCode)  
140 - data.lineId=lineCode;  
141 - }  
142 - gb_common.$get('/directive/deviceCofigList', data, function (rs) {  
143 - var f = 'YYYY-MM-DD HH:mm';  
144 - $.each(rs.list, function () {  
145 - if(this.timestamp){  
146 - this.timeStr = moment(this.timestamp).format(f);  
147 - }  
148 - });  
149 -  
150 - var htmlStr = template('device_configs_table-temp', {list: rs.list});  
151 - $('.device_config_table .ct_table_body', modal).html(htmlStr);  
152 -  
153 - if (resetPagination)  
154 - pagination(rs.totalPages, rs.page);  
155 - });  
156 - }  
157 -  
158 -  
159 - var resetPagination = true;  
160 - var pagination = function(pages, currentPage) {  
161 - var wrap = $('.pagination-wrap', modal).empty()  
162 - ,e = $('<ul class="uk-pagination"></ul>').appendTo(wrap);  
163 -  
164 - var pagination = UIkit.pagination(e, {  
165 - pages: pages,  
166 - currentPage: currentPage  
167 - });  
168 -  
169 - e.on('select.uk.pagination', function(e, pageIndex){  
170 - page = pageIndex;  
171 - query();  
172 - });  
173 -  
174 - resetPagination = false;  
175 - };  
176 -  
177 - $(modal).on('click', '.query_params_link', function () {  
178 - var nbbm = $(this).data('nbbm');  
179 - gb_common.$post('/directive/c0a4', {nbbm: nbbm}, function (rs) {  
180 - notify_succ('下发指令成功!');  
181 - });  
182 - });  
183 -  
184 - $('.param_config_btn', modal).on('click', function () {  
185 - notify_err('当前账号权限不足!');  
186 - });  
187 -  
188 - $('.up_soft_version_btn', modal).on('click', function () {  
189 - notify_err('当前账号权限不足!');  
190 - });  
191 - })();  
192 - </script> 1 +<div class="ct_layer_modal device_configs_manager">
  2 +
  3 + <div style="height: calc(100% - 20px);">
  4 + <div class="search_form">
  5 + <form class="uk-form search-form">
  6 + <fieldset data-uk-margin>
  7 + <span class="horizontal-field">线路</span>
  8 + <div class="uk-autocomplete uk-form autocomplete-line" >
  9 + <input type="text" name="lineId" placeholder="线路">
  10 + </div>
  11 + <span class="horizontal-field">车辆</span>
  12 + <div class="uk-autocomplete uk-form autocomplete-cars" >
  13 + <input type="text" name="nbbm" placeholder="车辆自编号">
  14 + </div>
  15 + <span class="horizontal-field">设备号</span>
  16 + <div class="uk-autocomplete uk-form autocomplete-device" >
  17 + <input type="text" name="deviceId" placeholder="设备号">
  18 + </div>
  19 + <button class="uk-button" type="submit"><i class="uk-icon-search"></i> 检索</button>
  20 + &nbsp;
  21 + <button class="uk-button param_config_btn" >参数配置</button>
  22 + &nbsp;
  23 + <button class="uk-button up_soft_version_btn" >升级程序版本</button>
  24 + </fieldset>
  25 + </form>
  26 + </div>
  27 +
  28 + <div class="ct_table_wrap ct_table_no_border" style="height: calc(100% - 115px);overflow: hidden;margin-top: 0;">
  29 + <div class="ct_table device_config_table">
  30 + <div class="ct_table_head" style="top: 0px;">
  31 + <dl>
  32 + <dt data-uk-tooltip title="车辆">车辆</dt>
  33 + <dt data-uk-tooltip title="设备号">设备号</dt>
  34 + <dt data-uk-tooltip title="网关IP">网关IP</dt>
  35 + <dt data-uk-tooltip title="网关端口">网关端口</dt>
  36 + <dt data-uk-tooltip title="定时定距上报模式">模式</dt>
  37 + <dt data-uk-tooltip title="定时上报时间间隔">时间</dt>
  38 + <dt data-uk-tooltip title="定距上报距离间隔">距离</dt>
  39 + <dt data-uk-tooltip title="非线路状态超速阀门">超速阀门</dt>
  40 + <dt data-uk-tooltip title="预警阀门">预警阀门</dt>
  41 + <dt data-uk-tooltip title="pos机IP地址">POS机IP</dt>
  42 + <dt data-uk-tooltip title="pos机端口">POS端口</dt>
  43 + <dt data-uk-tooltip title="延迟关机时间">延迟关机</dt>
  44 + <dt data-uk-tooltip title="中门视频切换到码表界面速度阀门">中码</dt>
  45 + <dt data-uk-tooltip title="码表界面切换到中门视频速度阀门">码中</dt>
  46 + <dt data-uk-tooltip title="对比度">对比度</dt>
  47 + <dt data-uk-tooltip title="亮度">亮度</dt>
  48 + <dt data-uk-tooltip title="饱和度">饱和度</dt>
  49 + <dt data-uk-tooltip title="参数上报时间">参数上报时间</dt>
  50 + </dl>
  51 + </div>
  52 + <div class="ct_table_body">
  53 + </div>
  54 + </div>
  55 + </div>
  56 + <div class="uk-modal-footer uk-text-right pagination-wrap" style="margin: 0;">
  57 + </div>
  58 + </div>
  59 +
  60 + <script id="device_configs_table-temp" type="text/html">
  61 + {{each list as c i}}
  62 + <dl>
  63 + <dd>{{c.insideCode}}</dd>
  64 + <dd>{{c.equipmentCode}}</dd>
  65 + <dd title="{{c.ipAddress}}">{{c.ipAddress}}</dd>
  66 + <dd>{{c.port}}</dd>
  67 + <dd>{{c.reportMode}}</dd>
  68 + <dd>{{c.interval}}</dd>
  69 + <dd>{{c.distance}}</dd>
  70 + <dd>{{c.speedingThreshold}}</dd>
  71 + <dd>{{c.alarmThreshold}}</dd>
  72 + <dd title="{{c.posIpAddress}}">{{c.posIpAddress}}</dd>
  73 + <dd>{{c.posPort}}</dd>
  74 + <dd>
  75 + {{if c.delay != null}}
  76 + {{c.delay}}分钟
  77 + {{/if}}
  78 + </dd>
  79 + <dd>{{c.speedThreshold1}}</dd>
  80 + <dd>{{c.speedThreshold2}}</dd>
  81 + <dd>{{c.contrast}}</dd>
  82 + <dd>{{c.brightness}}</dd>
  83 + <dd>{{c.saturation}}</dd>
  84 + <dd>
  85 + {{if c.timestamp != null}}
  86 + {{c.timeStr}}
  87 + {{else}}
  88 + <a class="query_params_link" data-nbbm="{{c.insideCode}}" style="font-size: 12px;" title="指令通知设备,将当前参数上传至平台">查询设备参数</a>
  89 + {{/if}}
  90 + </dd>
  91 + </dl>
  92 + {{/each}}
  93 + </script>
  94 + <script>
  95 + (function () {
  96 + var modal = $('.ct_layer_modal.device_configs_manager');
  97 + var form = $('.search-form', modal);
  98 +
  99 + //车辆 autocomplete
  100 + gb_common.carAutocomplete($('.autocomplete-cars', modal), gb_data_basic.carsArray());
  101 + //线路 autocomplete
  102 + gb_common.lineAutocomplete($('.autocomplete-line', modal));
  103 + //设备号autocomplete
  104 + var deviceArray = gb_common.get_keys(gb_data_basic.device2nbbmMap()),deviceData=[];
  105 + $.each(deviceArray, function(){
  106 + deviceData.push({value: this});
  107 + });
  108 + gb_common.init_autocomplete($('.autocomplete-device', modal), deviceData);
  109 +
  110 + var page=0,size=13;
  111 +
  112 + //sumit event
  113 + form.on('submit', function(e) {
  114 + e.preventDefault();
  115 + resetPagination = true;
  116 + page=0;
  117 + query();
  118 + });
  119 +
  120 + $(modal).on('init', function(e, data) {
  121 + e.stopPropagation();
  122 + if(data){
  123 + if(data.nbbm)
  124 + $('[name=nbbm]', form).val(data.nbbm);
  125 + if(data.deviceId)
  126 + $('[name=deviceId]', form).val(data.deviceId);
  127 + }
  128 + query();
  129 + });
  130 +
  131 + function query() {
  132 + var data = form.serializeJSON();
  133 + data.page = page;
  134 + data.size = size;
  135 +
  136 + //线路转换成编码
  137 + if(data.lineId){
  138 + var lineCode = gb_data_basic.findCodeByLinename(data.lineId);
  139 + if(lineCode)
  140 + data.lineId=lineCode;
  141 + }
  142 + gb_common.$get('/directive/deviceCofigList', data, function (rs) {
  143 + var f = 'YYYY-MM-DD HH:mm';
  144 + $.each(rs.list, function () {
  145 + if(this.timestamp){
  146 + this.timeStr = moment(this.timestamp).format(f);
  147 + }
  148 + });
  149 +
  150 + var htmlStr = template('device_configs_table-temp', {list: rs.list});
  151 + $('.device_config_table .ct_table_body', modal).html(htmlStr);
  152 +
  153 + if (resetPagination)
  154 + pagination(rs.totalPages, rs.page);
  155 + });
  156 + }
  157 +
  158 +
  159 + var resetPagination = true;
  160 + var pagination = function(pages, currentPage) {
  161 + var wrap = $('.pagination-wrap', modal).empty()
  162 + ,e = $('<ul class="uk-pagination"></ul>').appendTo(wrap);
  163 +
  164 + var pagination = UIkit.pagination(e, {
  165 + pages: pages,
  166 + currentPage: currentPage
  167 + });
  168 +
  169 + e.on('select.uk.pagination', function(e, pageIndex){
  170 + page = pageIndex;
  171 + query();
  172 + });
  173 +
  174 + resetPagination = false;
  175 + };
  176 +
  177 + $(modal).on('click', '.query_params_link', function () {
  178 + var nbbm = $(this).data('nbbm');
  179 + gb_common.$post('/directive/c0a4', {nbbm: nbbm}, function (rs) {
  180 + notify_succ('下发指令成功!');
  181 + });
  182 + });
  183 +
  184 + $('.param_config_btn', modal).on('click', function () {
  185 + notify_err('当前账号权限不足!');
  186 + });
  187 +
  188 + $('.up_soft_version_btn', modal).on('click', function () {
  189 + notify_err('当前账号权限不足!');
  190 + });
  191 + })();
  192 + </script>
193 </div> 193 </div>
194 \ No newline at end of file 194 \ No newline at end of file
src/main/resources/static/real_control_v2/mapmonitor/fragments/playback_v3/right.html
1 -<div class="play-back-tools-wrap">  
2 -  
3 - <div class="top-btn-list disabled">  
4 - <a class="play"></a>  
5 - <div class="multi-items">  
6 - <form class="uk-form speed_form">  
7 - <label><input type="radio" name="playSpeed" value="1" disabled> x1</label>  
8 - <label><input type="radio" name="playSpeed" value="5" checked disabled> x5</label>  
9 - <label><input type="radio" name="playSpeed" value="10" disabled> x10</label>  
10 - <label><input type="radio" name="playSpeed" value="20" disabled> x20</label>  
11 - </form>  
12 - </div>  
13 - <div class="multi-items">  
14 - <form class="uk-form buffer_area_form">  
15 - <label>  
16 - <input type="checkbox" name="drawPoint" checked disabled> 站点  
17 - </label>  
18 - <label>  
19 - <input type="checkbox" name="drawBuffArea" checked disabled> 缓冲区  
20 - </label>  
21 - <label>  
22 - <input type="checkbox" name="stationName" disabled> 站点名称  
23 - </label>  
24 - <label>  
25 - <div class="uk-button-dropdown" data-uk-dropdown="">  
26 - <a>停车场 <i class="uk-icon-angle-down"></i></a>  
27 - <div class="uk-dropdown uk-dropdown-scrollable" style="max-height: 300px;">  
28 - <ul class="uk-nav uk-nav-dropdown parks_list">  
29 - </ul>  
30 - </div>  
31 - </div>  
32 - </label>  
33 - <label>  
34 - <div class="uk-button-dropdown" data-uk-dropdown="">  
35 - <a title="默认跟随GPS,选择后将固定底图。每次搜索会重置">线路底图 <i class="uk-icon-angle-down"></i></a>  
36 - <div class="uk-dropdown uk-dropdown-scrollable" style="max-height: 300px;">  
37 - <ul class="uk-nav uk-nav-dropdown base_line_list">  
38 - </ul>  
39 - </div>  
40 - </div>  
41 - </label>  
42 - </form>  
43 - </div>  
44 -  
45 - <div class="uk-button-group export-btn-list">  
46 - <button class="uk-button" disabled>  
47 - <a class="export-excel"><i class="uk-icon-file-excel-o"></i> 导出轨迹</a>  
48 - </button>  
49 - <div data-uk-dropdown="{mode:'click'}">  
50 - <button class="uk-button" disabled><i class="uk-icon-caret-down"></i></button>  
51 - <div class="uk-dropdown uk-dropdown-small">  
52 - <ul class="uk-nav uk-nav-dropdown">  
53 - <li><a class="export-excel-abnormal">导出异常数据</a></li>  
54 - <!--<li><a class="export-excel-arrival">导出到离站数据</a></li>-->  
55 - </ul>  
56 - </div>  
57 - </div>  
58 - </div>  
59 -  
60 - </div>  
61 - <span class="ui-slider-tip"></span>  
62 - <span class="ui-slider-tip-fixed"></span>  
63 - <div class="ct-progress-bar" >  
64 - <div class="scale"></div>  
65 - </div>  
66 -</div>  
67 -  
68 -<div class="play-back-map-wrap"></div>  
69 -<script>  
70 -  
71 - (function () {  
72 - var rightWrap = '.gps-play-back-panel-v3>div.right-panel';  
73 - var leftWrap = '.gps-play-back-panel-v3>div.left-panel';  
74 - var progress = $('.ct-progress-bar', rightWrap);  
75 - var gpsArray;  
76 - var arrivalData;  
77 - var step;  
78 - var timeTip = $('.ui-slider-tip', rightWrap);  
79 - var scale = $('.scale', progress);  
80 -  
81 - $('.play-back-tools-wrap', rightWrap).on('ready-to-play', function (e, data) {  
82 - e.stopPropagation();  
83 - //reset  
84 - reset();  
85 -  
86 - gpsArray = data.list;  
87 - arrivalData = data.arrivalData;  
88 - inoutLen = arrivalData.length;  
89 -  
90 - if(!gpsArray || gpsArray.length==0)  
91 - return;  
92 - step = progress.width() / gpsArray.length;  
93 - //激活工具栏  
94 - $('.top-btn-list', rightWrap).removeClass('disabled').find('[disabled]').removeAttr('disabled');  
95 - //xlPolyline.lineId=gpsArray[0].lineId;  
96 - //xlPolyline.upDown=gpsArray[0].upDown;  
97 - });  
98 -  
99 -  
100 - function reset() {  
101 - pause();  
102 - $('.top-btn-list .play', rightWrap).removeClass('pause');  
103 - index=0;  
104 - inoutIndex=0;  
105 - clearXlPolyline();  
106 - xlPolyline={};  
107 - scale.css('width', 0);  
108 - fixedTime.css('left', 0).css('visibility', 'hidden');  
109 - trailArray=[];  
110 - gpsMarker=null;  
111 - trailPolyline=null;  
112 - map.clearOverlays();  
113 - parkPolygons={};  
114 - autoChange=true;  
115 - }  
116 -  
117 - function replaceSymbol(s){  
118 - return s.replace(new RegExp(/-/g),'').replace(new RegExp(/:/g),'').replace(new RegExp(/ /g),'');  
119 - }  
120 -  
121 - progress.mousemove(function (e) {  
122 - if(!gpsArray || gpsArray.length==0)  
123 - return;  
124 - var x = e.offsetX; //外面板的margin-left:-3px;  
125 - var i = parseInt(x / step);  
126 - var time = moment(gpsArray[i].timestamp).format('HH:mm.ss');  
127 -  
128 - timeTip.text(time).css('left', x - 28).css('visibility', 'visible');  
129 - }).mouseout(function () {  
130 - timeTip.css('visibility', 'hidden')  
131 - }).on('click', function (e) {  
132 - var x = e.offsetX;  
133 - goto(parseInt(x / step));  
134 - });  
135 -  
136 - /***  
137 - * 地图  
138 - */  
139 - var mapWrap = $('.play-back-map-wrap', rightWrap);  
140 - setTimeout(function () {  
141 - initMap();  
142 - }, 700);  
143 -  
144 - var map;  
145 - function initMap() {  
146 - //初始化地图  
147 - map = new BMap.Map(mapWrap[0]);  
148 - //中心点和缩放级别  
149 - map.centerAndZoom(new BMap.Point(gb_map_consts.center_point.lng, gb_map_consts.center_point.lat), 16);  
150 - map.enableScrollWheelZoom();  
151 - //map.setMapStyle({style:'googlelite'});  
152 - }  
153 -  
154 - /**  
155 - * 重置地图  
156 - */  
157 - mapWrap.on('reset-map', function (e) {  
158 - e.stopPropagation();  
159 - map.enableAutoResize();  
160 -  
161 - if(!gpsArray || gpsArray.length==0)  
162 - return;  
163 - //重新计算进度条  
164 - step = progress.width() / gpsArray.length;  
165 - scale.css('width', step * index);  
166 - if(fixedTime.css('visibility')=='visible'){  
167 - fixedTime.text(moment(gpsArray[index].timestamp).format('HH:mm.ss')).css('left', step * index - 27);  
168 - }  
169 - }).on('close', reset);  
170 -  
171 - /**  
172 - * 播放  
173 - */  
174 - $('.top-btn-list .play', rightWrap).on('click', function () {  
175 - if(toolsDisabled())  
176 - return;  
177 -  
178 - if(!$(this).hasClass('pause')){  
179 - $(this).addClass('pause');  
180 - if(index>=gpsArray.length-1){  
181 - goto(0);  
182 - }  
183 - gb_playback_v3_leftpanel.destoryScrollbar();  
184 - play();  
185 - fixedToCenter();  
186 - }  
187 - else{  
188 - gb_playback_v3_leftpanel.createScrollbar();  
189 - $(this).removeClass('pause');  
190 - pause();  
191 - }  
192 - });  
193 -  
194 - function toolsDisabled() {  
195 - return $('.top-btn-list', rightWrap).hasClass('disabled');  
196 - }  
197 -  
198 -  
199 - var pause = function () {  
200 - clearInterval(runTimer);  
201 - runTimer = null;  
202 - clearInterval(toCenterTimer);  
203 - toCenterTimer = null;  
204 - };  
205 - var runTimer  
206 - , playSpeed = parseInt($('.speed_form input[checked]').val());  
207 - var index = 0;  
208 - var play = function () {  
209 - if(!run()){  
210 - runTimer = setTimeout(play, 1000 / playSpeed);  
211 - }  
212 - };  
213 -  
214 - var fixedTime = $('.ui-slider-tip-fixed', rightWrap);  
215 - var run = function () {  
216 - if(index == gpsArray.length){  
217 - index--;  
218 - $('.top-btn-list .play', rightWrap).removeClass('pause');  
219 - pause();  
220 - notify_succ('本次轨迹回放已结束!');  
221 - gb_playback_v3_leftpanel.createScrollbar();  
222 - return true;  
223 - }  
224 -  
225 - gps = gpsArray[index];  
226 - drawCarMarker(gps);//更新GPS点位  
227 - updateTrailLine(gps, index);//行车轨迹线  
228 - updateProgress(gps, index)//进度条  
229 -  
230 - printTrailTable(gps, index);//输出轨迹信息  
231 - printArrivalTable(gps, index);//输出到离站信息  
232 - index ++;  
233 - };  
234 -  
235 - var updateProgress = function (gps, i) {  
236 - scale.css('width', step * i);//进度条  
237 - fixedTime.text(moment(gps.timestamp).format('HH:mm.ss')).css('left', step * i - 27).css('visibility', 'visible');  
238 - }  
239 -  
240 - /**  
241 - * 定时居中  
242 - */  
243 - var toCenterTimer;  
244 - var fixedToCenter = function () {  
245 - toCenterTimer = setInterval(function () {  
246 - var markerIsVisible = BMapLib.GeoUtils.isPointInRect(gpsMarker.getPosition(),map.getBounds());  
247 - if(!markerIsVisible){  
248 - map.panTo(gpsMarker.getPosition());  
249 - }  
250 - }, 500);  
251 - };  
252 -  
253 - /**  
254 - * 绘制gps  
255 - * @param gps  
256 - */  
257 - var gpsMarker;  
258 - var xlPolyline = {};  
259 - var drawCarMarker = function (gps) {  
260 - if(!gpsMarker){  
261 - gpsMarker = new BMap.Marker(new BMap.Point(gps.bd_lon, gps.bd_lat));  
262 - var width = gb_map_imap.calcGpsMarkerWidth(gps.nbbm);  
263 - gpsMarker.setIcon(new BMap.Icon(gb_map_imap.createCarIconRotation(gps, width), new BMap.Size(width, 75)));  
264 - gpsMarker.setTop(true);  
265 - map.addOverlay(gpsMarker);  
266 - //居中  
267 - map.panTo(gpsMarker.getPosition());  
268 - }  
269 - else{  
270 - gpsMarker.setPosition(new BMap.Point(gps.bd_lon, gps.bd_lat));  
271 - var width = gb_map_imap.calcGpsMarkerWidth(gps.nbbm);  
272 - gpsMarker.setIcon(new BMap.Icon(gb_map_imap.createCarIconRotation(gps, width), new BMap.Size(width, 75)));  
273 - }  
274 -  
275 - if(autoChange && (gps.lineId!=xlPolyline.lineId || gps.upDown!=xlPolyline.upDown)){  
276 - drawXlPolyline(gps.lineId, gps.upDown);  
277 - }  
278 - }  
279 -  
280 - var bform = $('.buffer_area_form', rightWrap);  
281 - var autoChange=true;  
282 - function drawXlPolyline(lineCode, upDown) {  
283 - if(upDown!=0 && upDown!=1){  
284 - //upDown = xlPolyline.upDown?xlPolyline.upDown:0;  
285 - return;  
286 - }  
287 -  
288 - clearXlPolyline();  
289 - //绘制路段  
290 - drawRoadPolyline(lineCode, upDown);  
291 - //绘制站点  
292 - if($('input[name=drawPoint]', bform)[0].checked)  
293 - drawStationMarkers(lineCode, upDown);  
294 - //绘制缓冲区  
295 - if($('input[name=drawBuffArea]', bform)[0].checked)  
296 - drawBuffArea(lineCode, upDown);  
297 - //绘制站点名称  
298 - if($('input[name=stationName]', bform)[0].checked)  
299 - drawNameMarkers(lineCode, upDown);  
300 -  
301 - xlPolyline.lineId = lineCode;  
302 - xlPolyline.upDown = upDown;  
303 - }  
304 -  
305 - var storage = window.localStorage;  
306 - var routes;//路段  
307 - var stations;//站点  
308 - var parks;//停车场  
309 -  
310 - function drawRoadPolyline(lineCode, upDown) {  
311 - //从localStorage获取路段  
312 - routes = JSON.parse(storage.getItem(lineCode + '_route'));  
313 - if(!routes){  
314 - var name = gb_data_basic.lineCode2NameAll()[lineCode];  
315 - notify_err("缺少" + name + "的路段信息,请选择" + name + "进入线调");  
316 - return;  
317 - }  
318 - routes = [routes['up_bd'], routes['down_bd']];  
319 - var colour = gb_map_config.getConfig().section.color;  
320 - var plConfig = {strokeWeight: 12, strokeColor: upDown?colour.down:colour.up, strokeOpacity: .4}, pos,polyline,pls=[];  
321 - $.each(routes[upDown], function (i, item) {  
322 - pos = [];  
323 - $.each(item.split(','), function () {  
324 - temps = this.split(' ');  
325 - pos.push(new BMap.Point(temps[0], temps[1]));  
326 - });  
327 - polyline = new BMap.Polyline(pos, plConfig);  
328 - map.addOverlay(polyline);  
329 - pls.push(polyline);  
330 - });  
331 - xlPolyline.polylines = pls;  
332 - }  
333 -  
334 - function drawStationMarkers(lineCode, upDown) {  
335 - if(!lineCode)return;  
336 - //从地图模块获取站点数据  
337 - stations = gb_map_spatial_data.getStationArray(lineCode);  
338 - if(!stations){  
339 - var name = gb_data_basic.lineCode2NameAll()[lineCode];  
340 - notify_err("缺少" + name + "的站点信息,请选择" + name + "进入线调");  
341 - return;  
342 - }  
343 -  
344 - var array = stations[upDown], psm, zdMarkers=[];  
345 - $.each(array, function () {  
346 - //坐标转换  
347 - var coord = TransGPS.wgsToBD(this.lat, this.lon);  
348 - this.bd_lat = coord.lat;  
349 - this.bd_lon = coord.lng;  
350 - psm = new BMap.Marker(new BMap.Point(this.bd_lon, this.bd_lat));  
351 - psm.setTitle(this.stationName);  
352 - map.addOverlay(psm);  
353 - psm.setIcon(new BMap.Icon(gb_map_imap.createStationPointIcon(), new BMap.Size(12, 12)));  
354 - zdMarkers.push(psm);  
355 - });  
356 - xlPolyline.zdMarkers=zdMarkers;  
357 - }  
358 -  
359 - function drawBuffArea(lineCode, upDown) {  
360 - if(!lineCode)return;  
361 - stations = gb_map_spatial_data.getStationArray(lineCode);  
362 - if(!stations){  
363 - var name = gb_data_basic.lineCode2NameAll()[lineCode];  
364 - notify_err("缺少" + name + "的缓冲区信息,请选择" + name + "进入线调");  
365 - return;  
366 - }  
367 -  
368 - var array = stations[upDown], obj, buffs=[];  
369 - $.each(array, function () {  
370 - if(this.shapesType=='r')  
371 - obj = drawCircle(new BMap.Point(this.bd_lon, this.bd_lat), this.radius);  
372 - else if(this.shapesType=='d')  
373 - obj = drawPolygon(this);  
374 -  
375 - if(obj)  
376 - buffs.push(obj);  
377 - });  
378 -  
379 - xlPolyline.buffs = buffs;  
380 - }  
381 -  
382 - function drawNameMarkers(lineCode, upDown) {  
383 - if(!lineCode)return;  
384 - //从地图模块获取站点数据  
385 - stations = gb_map_spatial_data.getStationArray(lineCode);  
386 - if(!stations){  
387 - var name = gb_data_basic.lineCode2NameAll()[lineCode];  
388 - notify_err("缺少" + name + "的站点信息,请选择" + name + "进入线调");  
389 - return;  
390 - }  
391 -  
392 - var style = {backgroundColor: "rgba(255, 255, 255, 0.69)",color : "black", borderColor: "black", fontSize : "12px", height : "16px", lineHeight : "16px", fontFamily:"微软雅黑"}  
393 - var array = stations[upDown], tMarkers=[];  
394 - $.each(array, function () {  
395 - var width = this.stationName.length * 12;  
396 - var label = new BMap.Label(this.stationName, {  
397 - position:new BMap.Point(this.bd_lon, this.bd_lat),  
398 - offset: new BMap.Size(-(width / 2), -27)  
399 - });  
400 - label.setStyle(style);  
401 - map.addOverlay(label);  
402 - tMarkers.push(label);  
403 - });  
404 -  
405 - xlPolyline.tMarkers = tMarkers;  
406 - }  
407 -  
408 - function clearXlPolyline() {  
409 - var rems = [];  
410 - //清除路段  
411 - clearOverlayArray(xlPolyline.polylines);  
412 - xlPolyline.polylines = [];  
413 - //清除站点  
414 - clearOverlayArray(xlPolyline.zdMarkers);  
415 - xlPolyline.zdMarkers = [];  
416 - //清除缓冲区  
417 - clearOverlayArray(xlPolyline.buffs);  
418 - xlPolyline.buffs = [];  
419 - //清除站点名称  
420 - clearOverlayArray(xlPolyline.tMarkers);  
421 - xlPolyline.tMarkers = [];  
422 - }  
423 -  
424 - function clearOverlayArray(array) {  
425 - if(!array || !isArray(array))  
426 - return;  
427 - $.each(array, function () {  
428 - map.removeOverlay(this);  
429 - });  
430 - }  
431 -  
432 - //更新轨迹线条  
433 - var trailArray=[], trailPolyline;  
434 - function updateTrailLine(gps, i) {  
435 - trailArray.push(gpsMarker.getPosition());  
436 - if(!trailPolyline){  
437 - trailPolyline = new BMap.Polyline(trailArray, {strokeWeight: 2, strokeColor: '#000000'});  
438 - map.addOverlay(trailPolyline);  
439 - }  
440 - else{  
441 - trailPolyline.setPath(trailArray);  
442 - }  
443 -  
444 - //最多记录1000个点位轨迹线条  
445 - if(trailArray.length > 1000)  
446 - trailArray = trailArray.slice(trailArray.length - 1000);  
447 - }  
448 -  
449 - var trailTbody = leftWrap + ' .trail-info-table .ct_table_body',  
450 - trailWrap = leftWrap + ' .trail-info-wrap' , trailPrve;  
451 - var printTrailTable = function (gps, i) {  
452 - if(i == 0)  
453 - $(trailTbody).html('');  
454 -  
455 - var code = gps['section_code'];  
456 - if (!trailPrve || code != trailPrve['section_code']) {  
457 - $(trailTbody).append(template('pbv3_trail_tbody-temp', {array: [gps]}));  
458 - }  
459 - else{  
460 - var dds = $(trailTbody).find('dl[data-code=' + code + ']').last().find('dd');  
461 - $(dds[0]).text(gps.timeStr);  
462 - $(dds[1]).text(gps.speed);  
463 - }  
464 - trailPrve = gps;  
465 - $(trailWrap).scrollTop($(trailWrap)[0].scrollHeight);  
466 - };  
467 -  
468 -  
469 - var arrivalWrap = leftWrap + ' .inout_table_wrap',  
470 - arivalTbody = arrivalWrap + ' .ct_table_body';  
471 -  
472 - var inoutIndex=0, inoutLen, _item;  
473 - var printArrivalTable = function (gps, i) {  
474 - if(inoutIndex == 0)  
475 - $(arivalTbody).html('');  
476 -  
477 - var $dl;  
478 - for(var j = inoutIndex; j < inoutLen; j++){  
479 - _item = arrivalData[j];  
480 - $dl = $(arivalTbody).find('dl[data-id='+_item.id+']');  
481 - if(gps.ts >= _item.in_ts && $dl.length==0){  
482 - $(arivalTbody).append(template('pbv3_inout_info_one_temp', _item));  
483 - inoutIndex = j;  
484 - }  
485 -  
486 - if(gps.ts >= _item.out_ts){  
487 - var dds = $dl.find('dd');  
488 - if($dl.length==0)  
489 - $(arivalTbody).append(template('pbv3_inout_info_one_temp', _item));  
490 - else  
491 - $(dds[2]).text(_item.out_time_str);  
492 - inoutIndex = j;  
493 - }  
494 - else if(!_item.out_ts && gps.ts >= _item.in_ts){  
495 - inoutIndex = j;  
496 - }  
497 - else {  
498 - break;  
499 - }  
500 - }  
501 - $(arrivalWrap).scrollTop($(arrivalWrap)[0].scrollHeight);  
502 - };  
503 -  
504 - var drawCircle = function (point, radius) {  
505 - var circle = new BMap.Circle(point, radius);  
506 - circle.setStrokeColor('#000000');  
507 - circle.setStrokeWeight(1);  
508 - map.addOverlay(circle);  
509 - return circle;  
510 - };  
511 -  
512 - var drawPolygon = function (station) {  
513 - transMultiWGSToBd(station);  
514 - var polygon = new BMap.Polygon(station.bdPoints, {strokeColor: '#000000', strokeWeight: 1});  
515 - map.addOverlay(polygon);  
516 - return polygon;  
517 - };  
518 -  
519 - var transMultiWGSToBd = function(obj) {  
520 - if(!obj._gPoints)  
521 - return;  
522 - var bdPoints = [],coord;  
523 - $.each(obj._gPoints, function () {  
524 - coord = TransGPS.wgsToBD(this.lat, this.lng);  
525 - bdPoints.push(new BMap.Point(coord.lng, coord.lat));  
526 - });  
527 -  
528 - obj.bdPoints=bdPoints;  
529 - };  
530 -  
531 - /**  
532 - * 工具栏点击事件  
533 - */  
534 - $('.buffer_area_form input', rightWrap).on('click', function () {  
535 - var name = $(this).attr('name'),  
536 - lineCode = xlPolyline.lineId,  
537 - upDown = xlPolyline.upDown;  
538 - switch (name){  
539 - case 'stationName':  
540 - //清除站点名称  
541 - clearOverlayArray(xlPolyline.tMarkers);  
542 - xlPolyline.tMarkers = [];  
543 - if(this.checked)  
544 - drawNameMarkers(lineCode, upDown);  
545 - break;  
546 - case 'drawBuffArea':  
547 - //清除缓冲区  
548 - clearOverlayArray(xlPolyline.buffs);  
549 - xlPolyline.buffs = [];  
550 - if(this.checked)  
551 - drawBuffArea(lineCode, upDown);  
552 - break;  
553 - case 'drawPoint':  
554 - //清除站点  
555 - clearOverlayArray(xlPolyline.zdMarkers);  
556 - xlPolyline.zdMarkers = [];  
557 - if(this.checked)  
558 - drawStationMarkers(lineCode, upDown);  
559 - break;  
560 - }  
561 - });  
562 -  
563 - $('.speed_form input[name=playSpeed]', rightWrap).on('click', function () {  
564 - playSpeed = parseInt($(this).val());  
565 - });  
566 -  
567 -  
568 - function goto(ei) {  
569 - if (ei < 0 || ei >= gpsArray.length)  
570 - return;  
571 -  
572 - var isrun;  
573 - if(runTimer){  
574 - pause();  
575 - isrun=true;  
576 - }  
577 -  
578 - var gps = gpsArray[ei];  
579 - updateProgress(gps, ei);  
580 - //更新gps marker  
581 - drawCarMarker(gps);  
582 - //更新轨迹线条  
583 - trailArray = [];  
584 - var i = 0;  
585 - if(ei > 1000)  
586 - i = ei - 1000;  
587 - for (; i < ei; i++)  
588 - trailArray.push(new BMap.Point(gpsArray[i].bd_lon, gpsArray[i].bd_lat));  
589 - updateTrailLine(gpsArray[ei], ei);  
590 -  
591 - var subArray = gpsArray.slice(0, ei + 1);  
592 - //更新行车轨迹表格  
593 - gb_playback_v3_leftpanel.fillTrailTable(subArray);  
594 - //更新到离站表格  
595 - //重新定位 inoutIndex  
596 - $.each(arrivalData, function (i, obj) {  
597 - if(gps.ts<this.in_ts || gps.ts<this.out_ts){  
598 - inoutIndex = i;  
599 - return false;  
600 - }  
601 - });  
602 - gb_playback_v3_leftpanel.fillArivalStationTable(subArray);  
603 - //居中  
604 - map.panTo(gpsMarker.getPosition());  
605 -  
606 - index = ei + 1;  
607 - if(isrun){  
608 - play();  
609 - fixedToCenter();  
610 - }  
611 - }  
612 -  
613 - /**  
614 - * 初始化停车场下拉菜单  
615 - */  
616 - var parkPolygons={};  
617 - (function (lineCode) {  
618 - //从地图模块获取停车场数据  
619 - var parks = gb_map_spatial_data.carparkArray();  
620 - //将线路标准停车场排在第一个  
621 - var information = gb_data_basic.getLineInformation(lineCode);  
622 - if(information){  
623 - var index;  
624 - for(var i = 0,p; p=parks[i++];){  
625 - if(p.parkCode == information.carPark){  
626 - index = i - 1;  
627 - break;  
628 - }  
629 - }  
630 - parks[index] = parks.splice(0, 1 , parks[index])[0];  
631 - }  
632 - //渲染  
633 - var htmlStr = template('pbv3_park_dropdown-temp', {list: parks});  
634 - $('.buffer_area_form .parks_list', rightWrap).html(htmlStr);  
635 -  
636 - //停车场点击  
637 - $('.buffer_area_form .parks_list>li', rightWrap).on('click', function () {  
638 - var code = $(this).data('code');  
639 -  
640 - if(!parkPolygons[code]){  
641 - var park;  
642 - $.each(parks, function () {  
643 - if(this.parkCode==code){park = this;return false;}  
644 - });  
645 -  
646 - transMultiWGSToBd(park);  
647 - var polygon = new BMap.Polygon(park.bdPoints, {strokeColor: 'red', strokeWeight: 1});  
648 - map.addOverlay(polygon);  
649 - parkPolygons[code] = polygon;  
650 - //中心点  
651 - var ts = park.gCenterPoint.split(' ')  
652 - ,coord = TransGPS.wgsToBD(parseFloat(ts[1]), parseFloat(ts[0]));  
653 - polygon._centerPoint = new BMap.Point(coord.lng, coord.lat);  
654 - //绘制名称label  
655 - var style = {backgroundColor: "rgba(255, 255, 255, 0.69)",color : "red", borderColor: "red", fontSize : "12px", height : "16px", lineHeight : "16px", fontFamily:"微软雅黑"}  
656 - var width = park.parkName.length * 12;  
657 - var label = new BMap.Label(park.parkName, {  
658 - position:polygon._centerPoint,  
659 - offset: new BMap.Size(-(width / 2), -27)  
660 - });  
661 - label.setStyle(style);  
662 - map.addOverlay(label);  
663 - }  
664 -  
665 - //定位到polygon  
666 - var polygon=parkPolygons[code];  
667 - map.panTo(polygon._centerPoint);  
668 - });  
669 - })();  
670 -  
671 - //初始化线路地图下拉菜单  
672 - (function () {  
673 - var opts='';  
674 - $.each(gb_data_basic.activeLines, function () {  
675 - opts+='<li data-code="'+this.lineCode+'" data-dir="0"><a>'+this.name+'上行</a></li><li data-code="'+this.lineCode+'" data-dir="1"><a>'+this.name+'下行</a></li>';  
676 - });  
677 - $('.base_line_list', rightWrap).html(opts);  
678 -  
679 - //切换线路底图  
680 - $(rightWrap).on('click', '.base_line_list>li', function () {  
681 - var code = $(this).data('code');  
682 - var updown = $(this).data('dir');  
683 - autoChange = false;  
684 - drawXlPolyline(code, updown);  
685 - });  
686 - })();  
687 -  
688 -  
689 - function formData() {  
690 - var fs = 'YYYY-MM-DD HH:mm';  
691 - var f = $('.play-back-form form', leftWrap),  
692 - nbbm = $('[name=nbbm]',f).val(),  
693 - st = parseInt(moment($('[name=startTime]',f).val(), fs).format('X')),  
694 - et = parseInt(moment($('[name=endTime]',f).val(), fs).format('X'));  
695 -  
696 - return {  
697 - nbbm: nbbm,  
698 - st: st,  
699 - et: et  
700 - }  
701 - }  
702 -  
703 - //轨迹  
704 - $('.export-excel', rightWrap).on('click', function () {  
705 - var d = formData();  
706 - window.open('/gps/history_v3/excel/' + d.nbbm + "?st="+d.st+"&et="+d.et);  
707 - });  
708 - //异常信息  
709 - $('.export-excel-abnormal', rightWrap).on('click', function () {  
710 - var d = formData();  
711 - window.open('/gps/history_v3/excel_abnormal/' + d.nbbm + "?st="+d.st+"&et="+d.et);  
712 - });  
713 - //到离站  
714 - $('.export-excel-arrival', rightWrap).on('click', function () {  
715 - var d = formData();  
716 - window.open('/gps/history_v3/excel_arrival/' + d.nbbm + "?st="+d.st+"&et="+d.et);  
717 - });  
718 - })(); 1 +<div class="play-back-tools-wrap">
  2 +
  3 + <div class="top-btn-list disabled">
  4 + <a class="play"></a>
  5 + <div class="multi-items">
  6 + <form class="uk-form speed_form">
  7 + <label><input type="radio" name="playSpeed" value="1" disabled> x1</label>
  8 + <label><input type="radio" name="playSpeed" value="5" checked disabled> x5</label>
  9 + <label><input type="radio" name="playSpeed" value="10" disabled> x10</label>
  10 + <label><input type="radio" name="playSpeed" value="20" disabled> x20</label>
  11 + </form>
  12 + </div>
  13 + <div class="multi-items">
  14 + <form class="uk-form buffer_area_form">
  15 + <label>
  16 + <input type="checkbox" name="drawPoint" checked disabled> 站点
  17 + </label>
  18 + <label>
  19 + <input type="checkbox" name="drawBuffArea" checked disabled> 缓冲区
  20 + </label>
  21 + <label>
  22 + <input type="checkbox" name="stationName" disabled> 站点名称
  23 + </label>
  24 + <label>
  25 + <div class="uk-button-dropdown" data-uk-dropdown="">
  26 + <a>停车场 <i class="uk-icon-angle-down"></i></a>
  27 + <div class="uk-dropdown uk-dropdown-scrollable" style="max-height: 300px;">
  28 + <ul class="uk-nav uk-nav-dropdown parks_list">
  29 + </ul>
  30 + </div>
  31 + </div>
  32 + </label>
  33 + <label>
  34 + <div class="uk-button-dropdown" data-uk-dropdown="">
  35 + <a title="默认跟随GPS,选择后将固定底图。每次搜索会重置">线路底图 <i class="uk-icon-angle-down"></i></a>
  36 + <div class="uk-dropdown uk-dropdown-scrollable" style="max-height: 300px;">
  37 + <ul class="uk-nav uk-nav-dropdown base_line_list">
  38 + </ul>
  39 + </div>
  40 + </div>
  41 + </label>
  42 + </form>
  43 + </div>
  44 +
  45 + <div class="uk-button-group export-btn-list">
  46 + <button class="uk-button" disabled>
  47 + <a class="export-excel"><i class="uk-icon-file-excel-o"></i> 导出轨迹</a>
  48 + </button>
  49 + <div data-uk-dropdown="{mode:'click'}">
  50 + <button class="uk-button" disabled><i class="uk-icon-caret-down"></i></button>
  51 + <div class="uk-dropdown uk-dropdown-small">
  52 + <ul class="uk-nav uk-nav-dropdown">
  53 + <li><a class="export-excel-abnormal">导出异常数据</a></li>
  54 + <!--<li><a class="export-excel-arrival">导出到离站数据</a></li>-->
  55 + </ul>
  56 + </div>
  57 + </div>
  58 + </div>
  59 +
  60 + </div>
  61 + <span class="ui-slider-tip"></span>
  62 + <span class="ui-slider-tip-fixed"></span>
  63 + <div class="ct-progress-bar" >
  64 + <div class="scale"></div>
  65 + </div>
  66 +</div>
  67 +
  68 +<div class="play-back-map-wrap"></div>
  69 +<script>
  70 +
  71 + (function () {
  72 + var rightWrap = '.gps-play-back-panel-v3>div.right-panel';
  73 + var leftWrap = '.gps-play-back-panel-v3>div.left-panel';
  74 + var progress = $('.ct-progress-bar', rightWrap);
  75 + var gpsArray;
  76 + var arrivalData;
  77 + var step;
  78 + var timeTip = $('.ui-slider-tip', rightWrap);
  79 + var scale = $('.scale', progress);
  80 +
  81 + $('.play-back-tools-wrap', rightWrap).on('ready-to-play', function (e, data) {
  82 + e.stopPropagation();
  83 + //reset
  84 + reset();
  85 +
  86 + gpsArray = data.list;
  87 + arrivalData = data.arrivalData;
  88 + inoutLen = arrivalData.length;
  89 +
  90 + if(!gpsArray || gpsArray.length==0)
  91 + return;
  92 + step = progress.width() / gpsArray.length;
  93 + //激活工具栏
  94 + $('.top-btn-list', rightWrap).removeClass('disabled').find('[disabled]').removeAttr('disabled');
  95 + //xlPolyline.lineId=gpsArray[0].lineId;
  96 + //xlPolyline.upDown=gpsArray[0].upDown;
  97 + });
  98 +
  99 +
  100 + function reset() {
  101 + pause();
  102 + $('.top-btn-list .play', rightWrap).removeClass('pause');
  103 + index=0;
  104 + inoutIndex=0;
  105 + clearXlPolyline();
  106 + xlPolyline={};
  107 + scale.css('width', 0);
  108 + fixedTime.css('left', 0).css('visibility', 'hidden');
  109 + trailArray=[];
  110 + gpsMarker=null;
  111 + trailPolyline=null;
  112 + map.clearOverlays();
  113 + parkPolygons={};
  114 + autoChange=true;
  115 + }
  116 +
  117 + function replaceSymbol(s){
  118 + return s.replace(new RegExp(/-/g),'').replace(new RegExp(/:/g),'').replace(new RegExp(/ /g),'');
  119 + }
  120 +
  121 + progress.mousemove(function (e) {
  122 + if(!gpsArray || gpsArray.length==0)
  123 + return;
  124 + var x = e.offsetX; //外面板的margin-left:-3px;
  125 + var i = parseInt(x / step);
  126 + var time = moment(gpsArray[i].timestamp).format('HH:mm.ss');
  127 +
  128 + timeTip.text(time).css('left', x - 28).css('visibility', 'visible');
  129 + }).mouseout(function () {
  130 + timeTip.css('visibility', 'hidden')
  131 + }).on('click', function (e) {
  132 + var x = e.offsetX;
  133 + goto(parseInt(x / step));
  134 + });
  135 +
  136 + /***
  137 + * 地图
  138 + */
  139 + var mapWrap = $('.play-back-map-wrap', rightWrap);
  140 + setTimeout(function () {
  141 + initMap();
  142 + }, 700);
  143 +
  144 + var map;
  145 + function initMap() {
  146 + //初始化地图
  147 + map = new BMap.Map(mapWrap[0]);
  148 + //中心点和缩放级别
  149 + map.centerAndZoom(new BMap.Point(gb_map_consts.center_point.lng, gb_map_consts.center_point.lat), 16);
  150 + map.enableScrollWheelZoom();
  151 + //map.setMapStyle({style:'googlelite'});
  152 + }
  153 +
  154 + /**
  155 + * 重置地图
  156 + */
  157 + mapWrap.on('reset-map', function (e) {
  158 + e.stopPropagation();
  159 + map.enableAutoResize();
  160 +
  161 + if(!gpsArray || gpsArray.length==0)
  162 + return;
  163 + //重新计算进度条
  164 + step = progress.width() / gpsArray.length;
  165 + scale.css('width', step * index);
  166 + if(fixedTime.css('visibility')=='visible'){
  167 + fixedTime.text(moment(gpsArray[index].timestamp).format('HH:mm.ss')).css('left', step * index - 27);
  168 + }
  169 + }).on('close', reset);
  170 +
  171 + /**
  172 + * 播放
  173 + */
  174 + $('.top-btn-list .play', rightWrap).on('click', function () {
  175 + if(toolsDisabled())
  176 + return;
  177 +
  178 + if(!$(this).hasClass('pause')){
  179 + $(this).addClass('pause');
  180 + if(index>=gpsArray.length-1){
  181 + goto(0);
  182 + }
  183 + gb_playback_v3_leftpanel.destoryScrollbar();
  184 + play();
  185 + fixedToCenter();
  186 + }
  187 + else{
  188 + gb_playback_v3_leftpanel.createScrollbar();
  189 + $(this).removeClass('pause');
  190 + pause();
  191 + }
  192 + });
  193 +
  194 + function toolsDisabled() {
  195 + return $('.top-btn-list', rightWrap).hasClass('disabled');
  196 + }
  197 +
  198 +
  199 + var pause = function () {
  200 + clearInterval(runTimer);
  201 + runTimer = null;
  202 + clearInterval(toCenterTimer);
  203 + toCenterTimer = null;
  204 + };
  205 + var runTimer
  206 + , playSpeed = parseInt($('.speed_form input[checked]').val());
  207 + var index = 0;
  208 + var play = function () {
  209 + if(!run()){
  210 + runTimer = setTimeout(play, 1000 / playSpeed);
  211 + }
  212 + };
  213 +
  214 + var fixedTime = $('.ui-slider-tip-fixed', rightWrap);
  215 + var run = function () {
  216 + if(index == gpsArray.length){
  217 + index--;
  218 + $('.top-btn-list .play', rightWrap).removeClass('pause');
  219 + pause();
  220 + notify_succ('本次轨迹回放已结束!');
  221 + gb_playback_v3_leftpanel.createScrollbar();
  222 + return true;
  223 + }
  224 +
  225 + gps = gpsArray[index];
  226 + drawCarMarker(gps);//更新GPS点位
  227 + updateTrailLine(gps, index);//行车轨迹线
  228 + updateProgress(gps, index)//进度条
  229 +
  230 + printTrailTable(gps, index);//输出轨迹信息
  231 + printArrivalTable(gps, index);//输出到离站信息
  232 + index ++;
  233 + };
  234 +
  235 + var updateProgress = function (gps, i) {
  236 + scale.css('width', step * i);//进度条
  237 + fixedTime.text(moment(gps.timestamp).format('HH:mm.ss')).css('left', step * i - 27).css('visibility', 'visible');
  238 + }
  239 +
  240 + /**
  241 + * 定时居中
  242 + */
  243 + var toCenterTimer;
  244 + var fixedToCenter = function () {
  245 + toCenterTimer = setInterval(function () {
  246 + var markerIsVisible = BMapLib.GeoUtils.isPointInRect(gpsMarker.getPosition(),map.getBounds());
  247 + if(!markerIsVisible){
  248 + map.panTo(gpsMarker.getPosition());
  249 + }
  250 + }, 500);
  251 + };
  252 +
  253 + /**
  254 + * 绘制gps
  255 + * @param gps
  256 + */
  257 + var gpsMarker;
  258 + var xlPolyline = {};
  259 + var drawCarMarker = function (gps) {
  260 + if(!gpsMarker){
  261 + gpsMarker = new BMap.Marker(new BMap.Point(gps.bd_lon, gps.bd_lat));
  262 + var width = gb_map_imap.calcGpsMarkerWidth(gps.nbbm);
  263 + gpsMarker.setIcon(new BMap.Icon(gb_map_imap.createCarIconRotation(gps, width), new BMap.Size(width, 75)));
  264 + gpsMarker.setTop(true);
  265 + map.addOverlay(gpsMarker);
  266 + //居中
  267 + map.panTo(gpsMarker.getPosition());
  268 + }
  269 + else{
  270 + gpsMarker.setPosition(new BMap.Point(gps.bd_lon, gps.bd_lat));
  271 + var width = gb_map_imap.calcGpsMarkerWidth(gps.nbbm);
  272 + gpsMarker.setIcon(new BMap.Icon(gb_map_imap.createCarIconRotation(gps, width), new BMap.Size(width, 75)));
  273 + }
  274 +
  275 + if(autoChange && (gps.lineId!=xlPolyline.lineId || gps.upDown!=xlPolyline.upDown)){
  276 + drawXlPolyline(gps.lineId, gps.upDown);
  277 + }
  278 + }
  279 +
  280 + var bform = $('.buffer_area_form', rightWrap);
  281 + var autoChange=true;
  282 + function drawXlPolyline(lineCode, upDown) {
  283 + if(upDown!=0 && upDown!=1){
  284 + //upDown = xlPolyline.upDown?xlPolyline.upDown:0;
  285 + return;
  286 + }
  287 +
  288 + clearXlPolyline();
  289 + //绘制路段
  290 + drawRoadPolyline(lineCode, upDown);
  291 + //绘制站点
  292 + if($('input[name=drawPoint]', bform)[0].checked)
  293 + drawStationMarkers(lineCode, upDown);
  294 + //绘制缓冲区
  295 + if($('input[name=drawBuffArea]', bform)[0].checked)
  296 + drawBuffArea(lineCode, upDown);
  297 + //绘制站点名称
  298 + if($('input[name=stationName]', bform)[0].checked)
  299 + drawNameMarkers(lineCode, upDown);
  300 +
  301 + xlPolyline.lineId = lineCode;
  302 + xlPolyline.upDown = upDown;
  303 + }
  304 +
  305 + var storage = window.localStorage;
  306 + var routes;//路段
  307 + var stations;//站点
  308 + var parks;//停车场
  309 +
  310 + function drawRoadPolyline(lineCode, upDown) {
  311 + //从localStorage获取路段
  312 + routes = JSON.parse(storage.getItem(lineCode + '_route'));
  313 + if(!routes){
  314 + var name = gb_data_basic.lineCode2NameAll()[lineCode];
  315 + notify_err("缺少" + name + "的路段信息,请选择" + name + "进入线调");
  316 + return;
  317 + }
  318 + routes = [routes['up_bd'], routes['down_bd']];
  319 + var colour = gb_map_config.getConfig().section.color;
  320 + var plConfig = {strokeWeight: 12, strokeColor: upDown?colour.down:colour.up, strokeOpacity: .4}, pos,polyline,pls=[];
  321 + $.each(routes[upDown], function (i, item) {
  322 + pos = [];
  323 + $.each(item.split(','), function () {
  324 + temps = this.split(' ');
  325 + pos.push(new BMap.Point(temps[0], temps[1]));
  326 + });
  327 + polyline = new BMap.Polyline(pos, plConfig);
  328 + map.addOverlay(polyline);
  329 + pls.push(polyline);
  330 + });
  331 + xlPolyline.polylines = pls;
  332 + }
  333 +
  334 + function drawStationMarkers(lineCode, upDown) {
  335 + if(!lineCode)return;
  336 + //从地图模块获取站点数据
  337 + stations = gb_map_spatial_data.getStationArray(lineCode);
  338 + if(!stations){
  339 + var name = gb_data_basic.lineCode2NameAll()[lineCode];
  340 + notify_err("缺少" + name + "的站点信息,请选择" + name + "进入线调");
  341 + return;
  342 + }
  343 +
  344 + var array = stations[upDown], psm, zdMarkers=[];
  345 + $.each(array, function () {
  346 + //坐标转换
  347 + var coord = TransGPS.wgsToBD(this.lat, this.lon);
  348 + this.bd_lat = coord.lat;
  349 + this.bd_lon = coord.lng;
  350 + psm = new BMap.Marker(new BMap.Point(this.bd_lon, this.bd_lat));
  351 + psm.setTitle(this.stationName);
  352 + map.addOverlay(psm);
  353 + psm.setIcon(new BMap.Icon(gb_map_imap.createStationPointIcon(), new BMap.Size(12, 12)));
  354 + zdMarkers.push(psm);
  355 + });
  356 + xlPolyline.zdMarkers=zdMarkers;
  357 + }
  358 +
  359 + function drawBuffArea(lineCode, upDown) {
  360 + if(!lineCode)return;
  361 + stations = gb_map_spatial_data.getStationArray(lineCode);
  362 + if(!stations){
  363 + var name = gb_data_basic.lineCode2NameAll()[lineCode];
  364 + notify_err("缺少" + name + "的缓冲区信息,请选择" + name + "进入线调");
  365 + return;
  366 + }
  367 +
  368 + var array = stations[upDown], obj, buffs=[];
  369 + $.each(array, function () {
  370 + if(this.shapesType=='r')
  371 + obj = drawCircle(new BMap.Point(this.bd_lon, this.bd_lat), this.radius);
  372 + else if(this.shapesType=='d')
  373 + obj = drawPolygon(this);
  374 +
  375 + if(obj)
  376 + buffs.push(obj);
  377 + });
  378 +
  379 + xlPolyline.buffs = buffs;
  380 + }
  381 +
  382 + function drawNameMarkers(lineCode, upDown) {
  383 + if(!lineCode)return;
  384 + //从地图模块获取站点数据
  385 + stations = gb_map_spatial_data.getStationArray(lineCode);
  386 + if(!stations){
  387 + var name = gb_data_basic.lineCode2NameAll()[lineCode];
  388 + notify_err("缺少" + name + "的站点信息,请选择" + name + "进入线调");
  389 + return;
  390 + }
  391 +
  392 + var style = {backgroundColor: "rgba(255, 255, 255, 0.69)",color : "black", borderColor: "black", fontSize : "12px", height : "16px", lineHeight : "16px", fontFamily:"微软雅黑"}
  393 + var array = stations[upDown], tMarkers=[];
  394 + $.each(array, function () {
  395 + var width = this.stationName.length * 12;
  396 + var label = new BMap.Label(this.stationName, {
  397 + position:new BMap.Point(this.bd_lon, this.bd_lat),
  398 + offset: new BMap.Size(-(width / 2), -27)
  399 + });
  400 + label.setStyle(style);
  401 + map.addOverlay(label);
  402 + tMarkers.push(label);
  403 + });
  404 +
  405 + xlPolyline.tMarkers = tMarkers;
  406 + }
  407 +
  408 + function clearXlPolyline() {
  409 + var rems = [];
  410 + //清除路段
  411 + clearOverlayArray(xlPolyline.polylines);
  412 + xlPolyline.polylines = [];
  413 + //清除站点
  414 + clearOverlayArray(xlPolyline.zdMarkers);
  415 + xlPolyline.zdMarkers = [];
  416 + //清除缓冲区
  417 + clearOverlayArray(xlPolyline.buffs);
  418 + xlPolyline.buffs = [];
  419 + //清除站点名称
  420 + clearOverlayArray(xlPolyline.tMarkers);
  421 + xlPolyline.tMarkers = [];
  422 + }
  423 +
  424 + function clearOverlayArray(array) {
  425 + if(!array || !isArray(array))
  426 + return;
  427 + $.each(array, function () {
  428 + map.removeOverlay(this);
  429 + });
  430 + }
  431 +
  432 + //更新轨迹线条
  433 + var trailArray=[], trailPolyline;
  434 + function updateTrailLine(gps, i) {
  435 + trailArray.push(gpsMarker.getPosition());
  436 + if(!trailPolyline){
  437 + trailPolyline = new BMap.Polyline(trailArray, {strokeWeight: 2, strokeColor: '#000000'});
  438 + map.addOverlay(trailPolyline);
  439 + }
  440 + else{
  441 + trailPolyline.setPath(trailArray);
  442 + }
  443 +
  444 + //最多记录1000个点位轨迹线条
  445 + if(trailArray.length > 1000)
  446 + trailArray = trailArray.slice(trailArray.length - 1000);
  447 + }
  448 +
  449 + var trailTbody = leftWrap + ' .trail-info-table .ct_table_body',
  450 + trailWrap = leftWrap + ' .trail-info-wrap' , trailPrve;
  451 + var printTrailTable = function (gps, i) {
  452 + if(i == 0)
  453 + $(trailTbody).html('');
  454 +
  455 + var code = gps['section_code'];
  456 + if (!trailPrve || code != trailPrve['section_code']) {
  457 + $(trailTbody).append(template('pbv3_trail_tbody-temp', {array: [gps]}));
  458 + }
  459 + else{
  460 + var dds = $(trailTbody).find('dl[data-code=' + code + ']').last().find('dd');
  461 + $(dds[0]).text(gps.timeStr);
  462 + $(dds[1]).text(gps.speed);
  463 + }
  464 + trailPrve = gps;
  465 + $(trailWrap).scrollTop($(trailWrap)[0].scrollHeight);
  466 + };
  467 +
  468 +
  469 + var arrivalWrap = leftWrap + ' .inout_table_wrap',
  470 + arivalTbody = arrivalWrap + ' .ct_table_body';
  471 +
  472 + var inoutIndex=0, inoutLen, _item;
  473 + var printArrivalTable = function (gps, i) {
  474 + if(inoutIndex == 0)
  475 + $(arivalTbody).html('');
  476 +
  477 + var $dl;
  478 + for(var j = inoutIndex; j < inoutLen; j++){
  479 + _item = arrivalData[j];
  480 + $dl = $(arivalTbody).find('dl[data-id='+_item.id+']');
  481 + if(gps.ts >= _item.in_ts && $dl.length==0){
  482 + $(arivalTbody).append(template('pbv3_inout_info_one_temp', _item));
  483 + inoutIndex = j;
  484 + }
  485 +
  486 + if(gps.ts >= _item.out_ts){
  487 + var dds = $dl.find('dd');
  488 + if($dl.length==0)
  489 + $(arivalTbody).append(template('pbv3_inout_info_one_temp', _item));
  490 + else
  491 + $(dds[2]).text(_item.out_time_str);
  492 + inoutIndex = j;
  493 + }
  494 + else if(!_item.out_ts && gps.ts >= _item.in_ts){
  495 + inoutIndex = j;
  496 + }
  497 + else {
  498 + break;
  499 + }
  500 + }
  501 + $(arrivalWrap).scrollTop($(arrivalWrap)[0].scrollHeight);
  502 + };
  503 +
  504 + var drawCircle = function (point, radius) {
  505 + var circle = new BMap.Circle(point, radius);
  506 + circle.setStrokeColor('#000000');
  507 + circle.setStrokeWeight(1);
  508 + map.addOverlay(circle);
  509 + return circle;
  510 + };
  511 +
  512 + var drawPolygon = function (station) {
  513 + transMultiWGSToBd(station);
  514 + var polygon = new BMap.Polygon(station.bdPoints, {strokeColor: '#000000', strokeWeight: 1});
  515 + map.addOverlay(polygon);
  516 + return polygon;
  517 + };
  518 +
  519 + var transMultiWGSToBd = function(obj) {
  520 + if(!obj._gPoints)
  521 + return;
  522 + var bdPoints = [],coord;
  523 + $.each(obj._gPoints, function () {
  524 + coord = TransGPS.wgsToBD(this.lat, this.lng);
  525 + bdPoints.push(new BMap.Point(coord.lng, coord.lat));
  526 + });
  527 +
  528 + obj.bdPoints=bdPoints;
  529 + };
  530 +
  531 + /**
  532 + * 工具栏点击事件
  533 + */
  534 + $('.buffer_area_form input', rightWrap).on('click', function () {
  535 + var name = $(this).attr('name'),
  536 + lineCode = xlPolyline.lineId,
  537 + upDown = xlPolyline.upDown;
  538 + switch (name){
  539 + case 'stationName':
  540 + //清除站点名称
  541 + clearOverlayArray(xlPolyline.tMarkers);
  542 + xlPolyline.tMarkers = [];
  543 + if(this.checked)
  544 + drawNameMarkers(lineCode, upDown);
  545 + break;
  546 + case 'drawBuffArea':
  547 + //清除缓冲区
  548 + clearOverlayArray(xlPolyline.buffs);
  549 + xlPolyline.buffs = [];
  550 + if(this.checked)
  551 + drawBuffArea(lineCode, upDown);
  552 + break;
  553 + case 'drawPoint':
  554 + //清除站点
  555 + clearOverlayArray(xlPolyline.zdMarkers);
  556 + xlPolyline.zdMarkers = [];
  557 + if(this.checked)
  558 + drawStationMarkers(lineCode, upDown);
  559 + break;
  560 + }
  561 + });
  562 +
  563 + $('.speed_form input[name=playSpeed]', rightWrap).on('click', function () {
  564 + playSpeed = parseInt($(this).val());
  565 + });
  566 +
  567 +
  568 + function goto(ei) {
  569 + if (ei < 0 || ei >= gpsArray.length)
  570 + return;
  571 +
  572 + var isrun;
  573 + if(runTimer){
  574 + pause();
  575 + isrun=true;
  576 + }
  577 +
  578 + var gps = gpsArray[ei];
  579 + updateProgress(gps, ei);
  580 + //更新gps marker
  581 + drawCarMarker(gps);
  582 + //更新轨迹线条
  583 + trailArray = [];
  584 + var i = 0;
  585 + if(ei > 1000)
  586 + i = ei - 1000;
  587 + for (; i < ei; i++)
  588 + trailArray.push(new BMap.Point(gpsArray[i].bd_lon, gpsArray[i].bd_lat));
  589 + updateTrailLine(gpsArray[ei], ei);
  590 +
  591 + var subArray = gpsArray.slice(0, ei + 1);
  592 + //更新行车轨迹表格
  593 + gb_playback_v3_leftpanel.fillTrailTable(subArray);
  594 + //更新到离站表格
  595 + //重新定位 inoutIndex
  596 + $.each(arrivalData, function (i, obj) {
  597 + if(gps.ts<this.in_ts || gps.ts<this.out_ts){
  598 + inoutIndex = i;
  599 + return false;
  600 + }
  601 + });
  602 + gb_playback_v3_leftpanel.fillArivalStationTable(subArray);
  603 + //居中
  604 + map.panTo(gpsMarker.getPosition());
  605 +
  606 + index = ei + 1;
  607 + if(isrun){
  608 + play();
  609 + fixedToCenter();
  610 + }
  611 + }
  612 +
  613 + /**
  614 + * 初始化停车场下拉菜单
  615 + */
  616 + var parkPolygons={};
  617 + (function (lineCode) {
  618 + //从地图模块获取停车场数据
  619 + var parks = gb_map_spatial_data.carparkArray();
  620 + //将线路标准停车场排在第一个
  621 + var information = gb_data_basic.getLineInformation(lineCode);
  622 + if(information){
  623 + var index;
  624 + for(var i = 0,p; p=parks[i++];){
  625 + if(p.parkCode == information.carPark){
  626 + index = i - 1;
  627 + break;
  628 + }
  629 + }
  630 + parks[index] = parks.splice(0, 1 , parks[index])[0];
  631 + }
  632 + //渲染
  633 + var htmlStr = template('pbv3_park_dropdown-temp', {list: parks});
  634 + $('.buffer_area_form .parks_list', rightWrap).html(htmlStr);
  635 +
  636 + //停车场点击
  637 + $('.buffer_area_form .parks_list>li', rightWrap).on('click', function () {
  638 + var code = $(this).data('code');
  639 +
  640 + if(!parkPolygons[code]){
  641 + var park;
  642 + $.each(parks, function () {
  643 + if(this.parkCode==code){park = this;return false;}
  644 + });
  645 +
  646 + transMultiWGSToBd(park);
  647 + var polygon = new BMap.Polygon(park.bdPoints, {strokeColor: 'red', strokeWeight: 1});
  648 + map.addOverlay(polygon);
  649 + parkPolygons[code] = polygon;
  650 + //中心点
  651 + var ts = park.gCenterPoint.split(' ')
  652 + ,coord = TransGPS.wgsToBD(parseFloat(ts[1]), parseFloat(ts[0]));
  653 + polygon._centerPoint = new BMap.Point(coord.lng, coord.lat);
  654 + //绘制名称label
  655 + var style = {backgroundColor: "rgba(255, 255, 255, 0.69)",color : "red", borderColor: "red", fontSize : "12px", height : "16px", lineHeight : "16px", fontFamily:"微软雅黑"}
  656 + var width = park.parkName.length * 12;
  657 + var label = new BMap.Label(park.parkName, {
  658 + position:polygon._centerPoint,
  659 + offset: new BMap.Size(-(width / 2), -27)
  660 + });
  661 + label.setStyle(style);
  662 + map.addOverlay(label);
  663 + }
  664 +
  665 + //定位到polygon
  666 + var polygon=parkPolygons[code];
  667 + map.panTo(polygon._centerPoint);
  668 + });
  669 + })();
  670 +
  671 + //初始化线路地图下拉菜单
  672 + (function () {
  673 + var opts='';
  674 + $.each(gb_data_basic.activeLines, function () {
  675 + opts+='<li data-code="'+this.lineCode+'" data-dir="0"><a>'+this.name+'上行</a></li><li data-code="'+this.lineCode+'" data-dir="1"><a>'+this.name+'下行</a></li>';
  676 + });
  677 + $('.base_line_list', rightWrap).html(opts);
  678 +
  679 + //切换线路底图
  680 + $(rightWrap).on('click', '.base_line_list>li', function () {
  681 + var code = $(this).data('code');
  682 + var updown = $(this).data('dir');
  683 + autoChange = false;
  684 + drawXlPolyline(code, updown);
  685 + });
  686 + })();
  687 +
  688 +
  689 + function formData() {
  690 + var fs = 'YYYY-MM-DD HH:mm';
  691 + var f = $('.play-back-form form', leftWrap),
  692 + nbbm = $('[name=nbbm]',f).val(),
  693 + st = parseInt(moment($('[name=startTime]',f).val(), fs).format('X')),
  694 + et = parseInt(moment($('[name=endTime]',f).val(), fs).format('X'));
  695 +
  696 + return {
  697 + nbbm: nbbm,
  698 + st: st,
  699 + et: et
  700 + }
  701 + }
  702 +
  703 + //轨迹
  704 + $('.export-excel', rightWrap).on('click', function () {
  705 + var d = formData();
  706 + window.open('/gps/history_v3/excel/' + d.nbbm + "?st="+d.st+"&et="+d.et);
  707 + });
  708 + //异常信息
  709 + $('.export-excel-abnormal', rightWrap).on('click', function () {
  710 + var d = formData();
  711 + window.open('/gps/history_v3/excel_abnormal/' + d.nbbm + "?st="+d.st+"&et="+d.et);
  712 + });
  713 + //到离站
  714 + $('.export-excel-arrival', rightWrap).on('click', function () {
  715 + var d = formData();
  716 + window.open('/gps/history_v3/excel_arrival/' + d.nbbm + "?st="+d.st+"&et="+d.et);
  717 + });
  718 + })();
719 </script> 719 </script>
720 \ No newline at end of file 720 \ No newline at end of file