Commit 0623d4ae1f17ab2240b44d7f1cb53ef1cbd35f89

Authored by 潘钊
2 parents d1a11954 75925811

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

Too many changes to show.

To preserve performance only 20 of 28 files are displayed.

src/main/java/com/bsth/controller/excep/SpeedingController.java
... ... @@ -31,10 +31,8 @@ public class SpeedingController extends BaseController<SysUser, Integer>{
31 31 map.put("pageData","10");
32 32 pageObject=speedingService.Pagequery(map);
33 33 return pageObject;
34   -
35 34 }
36 35  
37   -
38 36 @RequestMapping(value = "/getReport", method = RequestMethod.POST)
39 37 public Map<String, Object> getReport(@RequestParam Map<String, Object> map) {
40 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 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 74 @Transient
75 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 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 187 public String getNbbm() {
173 188 return nbbm;
174 189 }
... ... @@ -193,6 +208,12 @@ public class Speeding {
193 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 69 }
70 70  
71 71 }
72   - sql +=" limit ?,?";
73   -
  72 + // sql +=" order by id limit ?,?";
  73 + sql +=" order by timestamp limit ?,?";
74 74  
75 75 try {
76 76 conn = DBUtils_MS.getConnection();
... ... @@ -95,15 +95,15 @@ public class OutboundServiceImpl implements OutboundService{
95 95 Outbound outbound;
96 96 while(rs.next()){
97 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 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 103 //run 时注解
102 104 outbound.setLineName(BasicData.lineCode2NameMap.get(outbound.getLine().toString()));
103   - outbound.setLon(Float.valueOf(rs.getObject("lon").toString()));
104 105 outbound.setTimestamp((Long.valueOf(rs.getObject("timestamp").toString())));
105 106 outbound.setTimestampDate(sdf.format(new Date(outbound.getTimestamp())));
106   - outbound.setUpDown(Integer.valueOf(rs.getObject("up_down").toString()));
107 107 outbound.setVehicle(BasicData.deviceId2NbbmMap.get(rs.getObject("vehicle").toString()));
108 108 // outbound.setLocation(rs.getObject("location")==null?"":rs.getObject("location").toString());
109 109 list.add(outbound);
... ...
src/main/java/com/bsth/service/excep/impl/SpeedingServiceImpl.java
... ... @@ -43,8 +43,10 @@ public class SpeedingServiceImpl implements SpeedingService {
43 43 Object line=map.get("line");
44 44 Object nbbm=map.get("nbbm");
45 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 50 if(line!=null){
49 51 sql +=" and line like'%"+line.toString().trim()+"%'";
50 52 }
... ... @@ -58,15 +60,23 @@ public class SpeedingServiceImpl implements SpeedingService {
58 60 if(updown!=null){
59 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 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 79 } catch (ParseException e) {
69   - // TODO Auto-generated catch block
70 80 e.printStackTrace();
71 81 }
72 82 }
... ... @@ -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 90 try {
81 91 conn = DBUtils_MS.getConnection();
82 92 ps = conn.prepareStatement(sql);
83   - ps.setInt(1, page*10); // O-最大条数 -- M-起始条数
  93 + /* ps.setInt(1, page*10); // O-最大条数 -- M-起始条数
84 94 ps.setInt(2, 10); // O-最小条数 -- M-显示条数
85   - rs = ps.executeQuery();
  95 +*/ rs = ps.executeQuery();
86 96 list = resultSet2Set(rs);
87 97 } catch (SQLException e) {
88   - // TODO Auto-generated catch block
89 98 e.printStackTrace();
90 99 }finally {
91 100 DBUtils_MS.close(rs, ps, conn);
... ... @@ -106,6 +115,7 @@ public class SpeedingServiceImpl implements SpeedingService {
106 115 //run 时注解
107 116 speeding.setLineName(BasicData.lineCode2NameMap.get(speeding.getLine().toString()));
108 117 speeding.setLon(Float.valueOf(rs.getObject("lon").toString()));
  118 + speeding.setSpeed(Float.valueOf(rs.getObject("speed").toString()));
109 119 speeding.setTimestamp((Long.valueOf(rs.getObject("timestamp").toString())));
110 120 speeding.setTimestampDate(sdf.format(new Date(speeding.getTimestamp())));
111 121 speeding.setUpDown(Integer.valueOf(rs.getObject("up_down").toString()));
... ... @@ -114,16 +124,18 @@ public class SpeedingServiceImpl implements SpeedingService {
114 124 }
115 125 return list;
116 126 }
  127 +
117 128 @Override
118 129 public PageObject<Speeding> Pagequery(Map<String, Object> map) {
119   - // TODO Auto-generated method stub
120 130 String sql="select count(*) record from bsth_c_speeding where 1=1 ";
121 131 Object line=map.get("line");
122 132 Object nbbm=map.get("nbbm");
123 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 139 if(line!=null){
128 140 sql +=" and line like'%"+line.toString().trim()+"%'";
129 141 }
... ... @@ -136,15 +148,23 @@ public class SpeedingServiceImpl implements SpeedingService {
136 148 if(updown!=null){
137 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 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 167 } catch (ParseException e) {
147   - // TODO Auto-generated catch block
148 168 e.printStackTrace();
149 169 }
150 170 }
... ... @@ -163,49 +183,68 @@ public class SpeedingServiceImpl implements SpeedingService {
163 183 totalData=rs.getInt("record");
164 184 }
165 185 } catch (SQLException e) {
166   - // TODO Auto-generated catch block
167 186 e.printStackTrace();
168 187 }finally {
169 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 240 PageObject<Speeding> pageObject = pageHelper.getPageObject();
202   - pageObject.setDataList(list);
  241 + pageObject.setDataList(listResult);
203 242 return pageObject;
204 243 }
205   -
  244 +
  245 +
206 246 @Override
207 247 public Map<String, Object> getReport(Map<String, Object> map) {
208   - // TODO Auto-generated method stub
209 248 String chartStr = "";
210 249 Map<String, Object> mapValue = new HashMap<String, Object>();
211 250 try {
... ... @@ -309,10 +348,8 @@ public class SpeedingServiceImpl implements SpeedingService {
309 348 }
310 349  
311 350 } catch (SQLException e) {
312   - // TODO Auto-generated catch block
313 351 e.printStackTrace();
314 352 }catch (ParseException e1) {
315   - // TODO Auto-generated catch block
316 353 e1.printStackTrace();
317 354 }finally {
318 355 DBUtils_MS.close(rs, ps, conn);
... ...
src/main/java/com/bsth/service/report/ReportService.java
... ... @@ -44,4 +44,6 @@ public interface ReportService {
44 44 List<Map<String, String>> userList(Map<String, Object> map);
45 45  
46 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 17 import java.util.Set;
18 18  
19 19 import org.apache.commons.lang.StringUtils;
  20 +import org.dbunit.dataset.DataSetException;
20 21 import org.slf4j.Logger;
21 22 import org.slf4j.LoggerFactory;
22 23 import org.springframework.beans.factory.annotation.Autowired;
23 24 import org.springframework.jdbc.core.JdbcTemplate;
24 25 import org.springframework.jdbc.core.RowMapper;
  26 +import org.springframework.scheduling.commonj.ScheduledTimerListener;
25 27 import org.springframework.stereotype.Service;
26 28  
27 29 import com.bsth.data.BasicData;
... ... @@ -30,6 +32,7 @@ import com.bsth.entity.Personnel;
30 32 import com.bsth.entity.StationRoute;
31 33 import com.bsth.entity.excep.ArrivalInfo;
32 34 import com.bsth.entity.mcy_forms.Operationservice;
  35 +import com.bsth.entity.oil.Dlb;
33 36 import com.bsth.entity.oil.Ylb;
34 37 import com.bsth.entity.realcontrol.ChildTaskPlan;
35 38 import com.bsth.entity.realcontrol.ScheduleRealInfo;
... ... @@ -41,6 +44,7 @@ import com.bsth.service.report.CulateMileageService;
41 44 import com.bsth.service.report.ReportService;
42 45 import com.bsth.util.Arith;
43 46 import com.bsth.util.ComparableJob;
  47 +import com.bsth.util.ReportUtils;
44 48 import com.bsth.util.db.DBUtils_MS;
45 49  
46 50 @Service
... ... @@ -1456,7 +1460,6 @@ public class ReportServiceImpl implements ReportService{
1456 1460 }
1457 1461 //所有班次信息
1458 1462 List<ScheduleRealInfo> list = new ArrayList<ScheduleRealInfo>();
1459   -
1460 1463 line =line.trim();
1461 1464 if(line.equals("")){
1462 1465 //查询所有线路
... ... @@ -1466,7 +1469,6 @@ public class ReportServiceImpl implements ReportService{
1466 1469 list = scheduleRealInfoRepository.scheduleByDateAndLineTj2(line, date,date2);
1467 1470 }
1468 1471  
1469   -
1470 1472 String sql="select r.xl_bm"
1471 1473 + " from bsth_c_s_sp_info_real r where"
1472 1474 + " r.schedule_date_str BETWEEN '"+date+"' and '"+date2+"'";
... ... @@ -1487,7 +1489,6 @@ public class ReportServiceImpl implements ReportService{
1487 1489 return ve;
1488 1490 }
1489 1491 });
1490   -
1491 1492 for (int i = 0; i < listLine.size(); i++) {
1492 1493 List<ScheduleRealInfo> lists = new ArrayList<ScheduleRealInfo>();
1493 1494 String lineStr=listLine.get(i);
... ... @@ -1508,6 +1509,22 @@ public class ReportServiceImpl implements ReportService{
1508 1509 Map<String, Object> newMap=staticTj(list,"f");
1509 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 1528 return lMap;
1512 1529 }
1513 1530  
... ... @@ -1530,10 +1547,16 @@ public class ReportServiceImpl implements ReportService{
1530 1547 if(list.size()>0){
1531 1548 if(status.equals("f")){
1532 1549 map.put("xlName","合计");
  1550 + map.put("gs", "");
  1551 + map.put("fgs", "");
1533 1552 }else{
1534 1553 map.put("xlName", list.get(0).getXlName());
1535 1554 map.put("gs", list.get(0).getGsName());
1536 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 1562 double jhyygl=culateService.culateJhgl(list);//计划营运公里
... ... @@ -1584,6 +1607,8 @@ public class ReportServiceImpl implements ReportService{
1584 1607 double zrwjcclc=culateService.culateZrwJccLc(list, "");
1585 1608  
1586 1609 map.put("zrwjcclc", zrwjcclc);
  1610 + map.put("zrwjcclc1", 0);
  1611 + map.put("zrwjcclc2", 0);
1587 1612  
1588 1613 double kfks=culateService.culateKfksLc(lists);
1589 1614 map.put("kfks", kfks);
... ... @@ -1596,5 +1621,383 @@ public class ReportServiceImpl implements ReportService{
1596 1621 }
1597 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 56 <th width="3%">#</th>
57 57 <th width="15%">线路</th>
58 58 <th width="13%">车辆自编号</th>
59   - <th width="100">工号/名字</th>
  59 + <th width="100">车辆坐标</th>
60 60 <th width="11%">路牌名</th>
61 61 <th width="10%">上下行</th>
62 62 <th width="18%">时间</th>
... ... @@ -118,9 +118,11 @@
118 118 <td>
119 119 {{obj.vehicle}}
120 120 </td>
121   -
122 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 126 </td>
125 127 <td>
126 128 {{obj.lpname}}
... ... @@ -156,11 +158,19 @@ $(function(){
156 158 checkboxClass: 'icheckbox_flat-blue',
157 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 172 $('tr.filter .filter-cancel').on('click', function(){
  173 + debugger;
164 174 $('tr.filter input, select').val('').change();
165 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 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 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 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 49 \ No newline at end of file
... ...
src/main/resources/static/pages/excep/offlineList.html
... ... @@ -161,9 +161,17 @@ $(function(){
161 161 var icheckOptions = {
162 162 checkboxClass: 'icheckbox_flat-blue',
163 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 177 $('tr.filter .filter-cancel').on('click', function(){
... ... @@ -201,9 +209,6 @@ $(function(){
201 209 params['page'] = page;
202 210 var i = layer.load(2);
203 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 212 var bodyHtm = template('offline_list_temp', {list: data.dataList});
208 213  
209 214 $('#datatable_offline tbody').html(bodyHtm)
... ... @@ -247,10 +252,7 @@ $(function(){
247 252 initPagination = false;
248 253 return;
249 254 }
250   -
251   -
252   - page = num - 1;
253   -
  255 + page = num - 1;
254 256 var cells = $('tr.filter')[0].cells
255 257 ,params = {}
256 258 ,name;
... ... @@ -294,52 +296,52 @@ $(function(){
294 296 });
295 297  
296 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 347 </script>
346 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 54 <thead>
55 55 <tr role="row" class="heading">
56 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 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 65 <th width="18%">操作</th>
64 66 </tr>
65 67 <tr role="row" class="filter">
66 68 <td></td>
67 69 <td>
68   -<!-- <input type="text" class="form-control form-filter input-sm" name="userName_like"> -->
69 70 <select class="form-control" name="line" id="line" style="width: 180px;"></select>
70 71 </td>
71 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 74 </td>
75   - <td>
  75 + <!-- <td>
76 76  
77 77 </td>
78   - <td></td>
  78 + <td>
  79 + </td> -->
79 80 <td>
80 81 <select class="form-control form-filter " name="updown">
81 82 <option value="">请选择...</option>
... ... @@ -84,7 +85,16 @@
84 85 <option value="-1">无效</option>
85 86 </select>
86 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 98 <td>
89 99 <button class="btn btn-sm green btn-outline filter-submit margin-bottom" >
90 100 <i class="fa fa-search"></i> 搜索</button>
... ... @@ -117,13 +127,6 @@
117 127 <td>
118 128 {{obj.vehicle}}
119 129 </td>
120   -
121   - <td>
122   - {{obj.jsy}}
123   - </td>
124   - <td>
125   - {{obj.lpname}}
126   - </td>
127 130 <td>
128 131 {{if obj.upDown==0}}
129 132 上行
... ... @@ -137,6 +140,12 @@
137 140 {{obj.timestampDate}}
138 141 </td>
139 142 <td>
  143 + {{obj.durationTime}}秒
  144 + </td>
  145 + <td>
  146 +
  147 + </td>
  148 + <td>
140 149  
141 150 </td>
142 151 </tr>
... ... @@ -156,8 +165,33 @@ $(function(){
156 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 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 196 $('tr.filter .filter-cancel').on('click', function(){
163 197 $('tr.filter input, select').val('').change();
... ... @@ -226,8 +260,8 @@ $(function(){
226 260 function showPagination(data){
227 261 //分页
228 262 $('#pagination').jqPaginator({
229   - totalPages: data.totalPage,
230   - visiblePages: 6,
  263 + totalPages: data.totalPage,//总页数
  264 + visiblePages: 6,// 中间显示页数
231 265 currentPage: page + 1,
232 266 first: '<li class="first"><a href="javascript:void(0);">首页<\/a><\/li>',
233 267 prev: '<li class="prev"><a href="javascript:void(0);">上一页<\/a><\/li>',
... ... @@ -257,7 +291,6 @@ $(function(){
257 291 });
258 292 }
259 293  
260   -
261 294 //删除
262 295 $('#removeButton').on('click', function(){
263 296 if($(this).attr('disabled'))
... ... @@ -279,7 +312,7 @@ $(function(){
279 312 }
280 313 initPinYinSelect2('#line',data,'');
281 314  
282   -});
  315 + });
283 316  
284 317 $("#line").on("change",initXl);
285 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 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 582 </script>
583 583 \ No newline at end of file
... ...