Commit c8b9828c1310f5262a8e2ecec9050840962b0a29

Authored by 潘钊
2 parents 93905332 feba253d

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

# Conflicts:
#	src/main/java/com/bsth/data/gpsdata/analyse/CircleQueue.java
#	src/main/java/com/bsth/data/gpsdata/analyse/GeoCacheData.java
#	src/main/java/com/bsth/data/gpsdata/analyse/GpsAnalyse.java
#	src/main/java/com/bsth/data/gpsdata/analyse/StationRoute.java
Showing 33 changed files with 1285 additions and 1096 deletions
src/main/java/com/bsth/controller/forms/ExportController.java
@@ -65,10 +65,12 @@ public class ExportController { @@ -65,10 +65,12 @@ public class ExportController {
65 i++; 65 i++;
66 } 66 }
67 67
  68 +
  69 +
68 try { 70 try {
69 listI.add(resList.iterator()); 71 listI.add(resList.iterator());
70 String path = this.getClass().getResource("/").getPath() + "static\\pages\\forms\\"; 72 String path = this.getClass().getResource("/").getPath() + "static\\pages\\forms\\";
71 - ee.excelReplace(listI, new Object[] { map }, path + "mould\\linepassengerflow.xls", 73 + ee.excelReplace(listI, new Object[] { map }, path + "mould\\linepasswengerflow.xls",
72 path + "export\\线路客流量报表" + sdfSimple.format(sdfMonth.parse(map.get("date").toString())) + ".xls"); 74 path + "export\\线路客流量报表" + sdfSimple.format(sdfMonth.parse(map.get("date").toString())) + ".xls");
73 } catch (Exception e) { 75 } catch (Exception e) {
74 e.printStackTrace(); 76 e.printStackTrace();
@@ -189,7 +191,7 @@ public class ExportController { @@ -189,7 +191,7 @@ public class ExportController {
189 listI.add(resList.iterator()); 191 listI.add(resList.iterator());
190 String path = this.getClass().getResource("/").getPath() + "static\\pages\\forms\\"; 192 String path = this.getClass().getResource("/").getPath() + "static\\pages\\forms\\";
191 ee.excelReplace(listI, new Object[] { map }, path + "mould\\singledata.xls", 193 ee.excelReplace(listI, new Object[] { map }, path + "mould\\singledata.xls",
192 - path + "export\\路单报表" + sdfSimple.format(sdfMonth.parse(map.get("startDate").toString())) + ".xls"); 194 + path + "export\\路单数据" + sdfSimple.format(sdfMonth.parse(map.get("startDate").toString())) + ".xls");
193 } catch (Exception e) { 195 } catch (Exception e) {
194 e.printStackTrace(); 196 e.printStackTrace();
195 } 197 }
@@ -203,8 +205,8 @@ public class ExportController { @@ -203,8 +205,8 @@ public class ExportController {
203 SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), sdfSimple = new SimpleDateFormat("yyyyMMdd"); 205 SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), sdfSimple = new SimpleDateFormat("yyyyMMdd");
204 List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); 206 List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
205 ReportUtils ee = new ReportUtils(); 207 ReportUtils ee = new ReportUtils();
206 - List<Vehicleloading> vehicleloading = formsService.vehicleloading(/*map.get("gsdmVehic").toString(),map.get("fgsdmVehic").toString(),*/map.get("line").toString(),  
207 - map.get("date").toString()); 208 + List<Vehicleloading> vehicleloading = formsService.vehicleloading(map.get("gsdmVehic").toString(),map.get("fgsdmVehic").toString(),map.get("line").toString(),
  209 + map.get("data").toString());
208 List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); 210 List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>();
209 int i = 1; 211 int i = 1;
210 for (Vehicleloading l : vehicleloading) { 212 for (Vehicleloading l : vehicleloading) {
@@ -214,8 +216,8 @@ public class ExportController { @@ -214,8 +216,8 @@ public class ExportController {
214 m.put("gS", l.getgS()); 216 m.put("gS", l.getgS());
215 m.put("xL", l.getxL()); 217 m.put("xL", l.getxL());
216 m.put("clzbh", l.getClzbh()); 218 m.put("clzbh", l.getClzbh());
217 - m.put("hyl", l.getHyl());  
218 m.put("jzl", l.getJzl()); 219 m.put("jzl", l.getJzl());
  220 + m.put("hyl", l.getHyl());
219 m.put("ls", l.getLs()); 221 m.put("ls", l.getLs());
220 m.put("jhlc", l.getJhlc()); 222 m.put("jhlc", l.getJhlc());
221 m.put("unyyyl", l.getUnyyyl()); 223 m.put("unyyyl", l.getUnyyyl());
@@ -229,7 +231,7 @@ public class ExportController { @@ -229,7 +231,7 @@ public class ExportController {
229 listI.add(resList.iterator()); 231 listI.add(resList.iterator());
230 String path = this.getClass().getResource("/").getPath() + "static\\pages\\forms\\"; 232 String path = this.getClass().getResource("/").getPath() + "static\\pages\\forms\\";
231 ee.excelReplace(listI, new Object[] { map }, path + "mould\\vehicleloading.xls", 233 ee.excelReplace(listI, new Object[] { map }, path + "mould\\vehicleloading.xls",
232 - path + "export\\车辆加注" + sdfSimple.format(sdfMonth.parse(map.get("date").toString())) + ".xls"); 234 + path + "export\\车辆加注" + sdfSimple.format(sdfMonth.parse(map.get("dat").toString())) + ".xls");
233 } catch (Exception e) { 235 } catch (Exception e) {
234 e.printStackTrace(); 236 e.printStackTrace();
235 } 237 }
@@ -417,5 +419,9 @@ public class ExportController { @@ -417,5 +419,9 @@ public class ExportController {
417 } 419 }
418 return resList; 420 return resList;
419 } 421 }
  422 +
  423 +
  424 +
  425 +
420 426
421 } 427 }
src/main/java/com/bsth/controller/forms/MCY_FormsController.java
@@ -80,9 +80,9 @@ public class MCY_FormsController { @@ -80,9 +80,9 @@ public class MCY_FormsController {
80 80
81 // 车辆加注 81 // 车辆加注
82 @RequestMapping(value = "/vehicleloading", method = RequestMethod.POST) 82 @RequestMapping(value = "/vehicleloading", method = RequestMethod.POST)
83 - public List<Vehicleloading> vehicleloading(/*@RequestParam String gsdmVehic, @RequestParam String fgsdmVehic,*/ 83 + public List<Vehicleloading> vehicleloading(@RequestParam String gsdmVehic, @RequestParam String fgsdmVehic,
84 @RequestParam String line, @RequestParam String data) { 84 @RequestParam String line, @RequestParam String data) {
85 - return formsService.vehicleloading(/*gsdmVehic, fgsdmVehic, */line, data); 85 + return formsService.vehicleloading(gsdmVehic, fgsdmVehic, line, data);
86 } 86 }
87 87
88 // 运营服务阶段报表 88 // 运营服务阶段报表
src/main/java/com/bsth/data/gpsdata/analyse/CircleQueue.java
@@ -113,4 +113,4 @@ public class CircleQueue&lt;T&gt; { @@ -113,4 +113,4 @@ public class CircleQueue&lt;T&gt; {
113 public T getTail(){ 113 public T getTail(){
114 return elementData[tail] == null?null:(T)elementData[tail]; 114 return elementData[tail] == null?null:(T)elementData[tail];
115 } 115 }
116 -} 116 -}
  117 +}
117 \ No newline at end of file 118 \ No newline at end of file
src/main/java/com/bsth/data/gpsdata/analyse/GeoCacheData.java
@@ -167,4 +167,4 @@ public class GeoCacheData { @@ -167,4 +167,4 @@ public class GeoCacheData {
167 return cds; 167 return cds;
168 } 168 }
169 169
170 -} 170 -}
  171 +}
171 \ No newline at end of file 172 \ No newline at end of file
src/main/java/com/bsth/data/gpsdata/analyse/GpsAnalyse.java
@@ -36,4 +36,4 @@ public class GpsAnalyse { @@ -36,4 +36,4 @@ public class GpsAnalyse {
36 GpsArrival.arrival(gps); 36 GpsArrival.arrival(gps);
37 } 37 }
38 } 38 }
39 -} 39 -}
  40 +}
40 \ No newline at end of file 41 \ No newline at end of file
src/main/java/com/bsth/data/gpsdata/analyse/StationRoute.java
@@ -4,39 +4,58 @@ import com.vividsolutions.jts.geom.Point; @@ -4,39 +4,58 @@ import com.vividsolutions.jts.geom.Point;
4 import com.vividsolutions.jts.geom.Polygon; 4 import com.vividsolutions.jts.geom.Polygon;
5 5
6 /** 6 /**
7 - *  
8 * Created by panzhao on 2016/12/23. 7 * Created by panzhao on 2016/12/23.
9 */ 8 */
10 public class StationRoute { 9 public class StationRoute {
11 10
12 - /** 线路编码 */ 11 + /**
  12 + * 线路编码
  13 + */
13 private String lineCode; 14 private String lineCode;
14 15
15 - /** 上下行 */ 16 + /**
  17 + * 上下行
  18 + */
16 private int directions; 19 private int directions;
17 20
18 - /** 站点编码 */ 21 + /**
  22 + * 站点编码
  23 + */
19 private String code; 24 private String code;
20 25
21 - /** 路由顺序 */ 26 + /**
  27 + * 路由顺序
  28 + */
22 private int routeSort; 29 private int routeSort;
23 30
24 - /** 站点位置 */ 31 + /**
  32 + * 站点位置
  33 + */
25 private Point point; 34 private Point point;
26 35
27 - /** 圆形半径 */ 36 + /**
  37 + * 圆形半径
  38 + */
28 private Float radius; 39 private Float radius;
29 40
30 - /** 多边形电子围栏 */ 41 + /**
  42 + * 多边形电子围栏
  43 + */
31 private Polygon polygon; 44 private Polygon polygon;
32 45
33 - /** 站点标记 */ 46 + /**
  47 + * 站点标记
  48 + */
34 private String mark; 49 private String mark;
35 50
36 - /** 下一站 */ 51 + /**
  52 + * 下一站
  53 + */
37 private StationRoute next; 54 private StationRoute next;
38 55
39 - /** 上一站 */ 56 + /**
  57 + * 上一站
  58 + */
40 private StationRoute prve; 59 private StationRoute prve;
41 60
42 public String getCode() { 61 public String getCode() {
@@ -119,3 +138,4 @@ public class StationRoute { @@ -119,3 +138,4 @@ public class StationRoute {
119 this.mark = mark; 138 this.mark = mark;
120 } 139 }
121 } 140 }
  141 +
src/main/java/com/bsth/entity/mcy_forms/Changetochange.java
1 package com.bsth.entity.mcy_forms; 1 package com.bsth.entity.mcy_forms;
2 2
3 -import java.util.Date;  
4 -  
5 import javax.persistence.Entity; 3 import javax.persistence.Entity;
6 import javax.persistence.GeneratedValue; 4 import javax.persistence.GeneratedValue;
7 import javax.persistence.Id; 5 import javax.persistence.Id;
src/main/java/com/bsth/service/forms/FormsService.java
@@ -30,7 +30,7 @@ public interface FormsService { @@ -30,7 +30,7 @@ public interface FormsService {
30 30
31 public List<Singledata> singledata(Map<String, Object> map); 31 public List<Singledata> singledata(Map<String, Object> map);
32 32
33 - public List<Vehicleloading> vehicleloading(/*String gsdmVehic,String fgsdmVehic,*/String line,String data); 33 + public List<Vehicleloading> vehicleloading(String gsdmVehic,String fgsdmVehic,String line,String data);
34 34
35 public List<Operationservice> operationservice(Map<String, Object> map); 35 public List<Operationservice> operationservice(Map<String, Object> map);
36 36
src/main/java/com/bsth/service/forms/impl/FormsServiceImpl.java
@@ -26,6 +26,7 @@ import com.bsth.entity.mcy_forms.Waybillday; @@ -26,6 +26,7 @@ import com.bsth.entity.mcy_forms.Waybillday;
26 import com.bsth.entity.mcy_forms.Allline; 26 import com.bsth.entity.mcy_forms.Allline;
27 import com.bsth.entity.mcy_forms.Changetochange; 27 import com.bsth.entity.mcy_forms.Changetochange;
28 import com.bsth.entity.mcy_forms.Executionrate; 28 import com.bsth.entity.mcy_forms.Executionrate;
  29 +import com.bsth.service.forms.CommonService;
29 import com.bsth.service.forms.FormsService; 30 import com.bsth.service.forms.FormsService;
30 import com.bsth.service.realcontrol.ScheduleRealInfoService; 31 import com.bsth.service.realcontrol.ScheduleRealInfoService;
31 32
@@ -38,20 +39,32 @@ public class FormsServiceImpl implements FormsService { @@ -38,20 +39,32 @@ public class FormsServiceImpl implements FormsService {
38 @Autowired 39 @Autowired
39 ScheduleRealInfoService scheduleRealInfoService; 40 ScheduleRealInfoService scheduleRealInfoService;
40 41
  42 + @Autowired
  43 + CommonService commonService;
  44 +
41 // 行车路单日报表 45 // 行车路单日报表
42 @Override 46 @Override
43 public List<Waybillday> waybillday(Map<String, Object> map) { 47 public List<Waybillday> waybillday(Map<String, Object> map) {
  48 +
44 String sql ="select x.j_gh,x.cl_zbh,z.JZL,z.YH,z.personnel_name,x.schedule_date,x.gs_bm,x.gs_name,x.fgs_bm,x.fgs_name " 49 String sql ="select x.j_gh,x.cl_zbh,z.JZL,z.YH,z.personnel_name,x.schedule_date,x.gs_bm,x.gs_name,x.fgs_bm,x.fgs_name "
45 + " from bsth_c_s_sp_info_real x INNER join " 50 + " from bsth_c_s_sp_info_real x INNER join "
46 + " ( select y.RQ,y.XLBM,y.NBBM,y.JSY,y.JZL,y.YH,c.personnel_name from" 51 + " ( select y.RQ,y.XLBM,y.NBBM,y.JSY,y.JZL,y.YH,c.personnel_name from"
47 + " bsth_c_ylb y LEFT JOIN bsth_c_personnel c ON c.job_code=y.JSY " 52 + " bsth_c_ylb y LEFT JOIN bsth_c_personnel c ON c.job_code=y.JSY "
48 - + " where to_days(y.RQ)=to_days('"+map.get("date").toString() + "') and y.XLBM= '"+ map.get("line").toString()+"' GROUP BY y.NBBM) "  
49 - + " z on x.cl_zbh=z.nbbm where to_days( x.schedule_date)=to_days('"+map.get("date").toString()+"') "  
50 - + " and x.xl_bm='"+map.get("line").toString()+"'"  
51 - /*+ " and x.gs_bm='"+map.get("gsdmWaybillday").toString()+"'"  
52 - + " and x.fgs_bm='"+map.get("fgsdmWaybillday").toString()+"'"*/  
53 - + " GROUP BY x.j_gh,x.cl_zbh,z.JZL,z.YH,z.personnel_name,x.schedule_date,x.gs_bm,x.gs_name,x.fgs_bm,x.fgs_name";  
54 - //x.cl_zbh,j_gh 53 + + " where 1=1 ";
  54 + if(map.get("date").toString()!=""){
  55 + sql+=" and to_days(y.RQ)=to_days('"+map.get("date").toString() + "') ";
  56 + }
  57 + if( map.get("line").toString()!=""){
  58 + sql+=" and y.XLBM= '"+ map.get("line").toString()+"' GROUP BY y.NBBM) ";
  59 + }
  60 + sql+= " z on x.cl_zbh=z.nbbm where to_days( x.schedule_date)=to_days('"+map.get("date").toString()+"') ";
  61 + if(map.get("gsdmWaybillday").toString()!=""){
  62 + sql+=" and x.gs_bm='"+map.get("gsdmWaybillday").toString()+"'";
  63 + }
  64 + if(map.get("fgsdmWaybillday").toString()!=""){
  65 + sql+=" and x.fgs_bm='"+map.get("fgsdmWaybillday").toString()+"'";
  66 + }
  67 + sql += " GROUP BY x.j_gh,x.cl_zbh,z.JZL,z.YH,z.personnel_name,x.schedule_date,x.gs_bm,x.gs_name,x.fgs_bm,x.fgs_name ";
55 List<Waybillday> list = jdbcTemplate.query(sql, new RowMapper<Waybillday>() { 68 List<Waybillday> list = jdbcTemplate.query(sql, new RowMapper<Waybillday>() {
56 @Override 69 @Override
57 public Waybillday mapRow(ResultSet arg0, int arg1) throws SQLException { 70 public Waybillday mapRow(ResultSet arg0, int arg1) throws SQLException {
@@ -60,21 +73,16 @@ public class FormsServiceImpl implements FormsService { @@ -60,21 +73,16 @@ public class FormsServiceImpl implements FormsService {
60 wbd.setJzl(arg0.getString("JZL")); 73 wbd.setJzl(arg0.getString("JZL"));
61 wbd.setYh(arg0.getString("YH")); 74 wbd.setYh(arg0.getString("YH"));
62 wbd.setjName(arg0.getString("personnel_name")); 75 wbd.setjName(arg0.getString("personnel_name"));
63 - // wbd.setZlc(arg0.getInt("zlc"));  
64 - // System.out.println(arg0.getObject("yl"));  
65 - // wbd.setYl(arg0.getString("yl"));  
66 - // wbd.setNbbm(arg0.getString("nbbm"));  
67 wbd.setRq(arg0.getString("schedule_date")); 76 wbd.setRq(arg0.getString("schedule_date"));
68 wbd.setJgh(arg0.getString("j_gh")); 77 wbd.setJgh(arg0.getString("j_gh"));
69 return wbd; 78 return wbd;
70 -  
71 } 79 }
72 }); 80 });
73 81
74 for(int i=0;i<list.size();i++){ 82 for(int i=0;i<list.size();i++){
75 Waybillday w=list.get(i); 83 Waybillday w=list.get(i);
76 Map<String, Object> maps = new HashMap<>(); 84 Map<String, Object> maps = new HashMap<>();
77 - maps = scheduleRealInfoService.findKMBC2(w.getJgh(), w.getCarPlate(), 85 + maps = commonService.findKMBC2(w.getJgh(), w.getCarPlate(),
78 w.getRq()); 86 w.getRq());
79 w.setJzl1(maps.get("ksgl").toString()); 87 w.setJzl1(maps.get("ksgl").toString());
80 w.setZlc(maps.get("realMileage").toString()); 88 w.setZlc(maps.get("realMileage").toString());
@@ -86,18 +94,25 @@ public class FormsServiceImpl implements FormsService { @@ -86,18 +94,25 @@ public class FormsServiceImpl implements FormsService {
86 // 线路客流量报表 94 // 线路客流量报表
87 @Override 95 @Override
88 public List<Linepasswengerflow> linepasswengerflow(Map<String, Object> map) { 96 public List<Linepasswengerflow> linepasswengerflow(Map<String, Object> map) {
89 - String sql = " SELECT s.station_name,l.name,r.gs_bm,r.gs_name,r.fgs_bm,r.fgs_name" 97 + String sql = " SELECT r.schedule_date,s.station_name,l.name,r.gs_bm,r.gs_name,r.fgs_bm,r.fgs_name"
90 + " from bsth_c_stationroute s " 98 + " from bsth_c_stationroute s "
91 + " LEFT JOIN bsth_c_line l on s.line_code=l.line_code " 99 + " LEFT JOIN bsth_c_line l on s.line_code=l.line_code "
92 + " LEFT JOIN bsth_c_s_sp_info_real r on r.xl_bm=l.line_code" 100 + " LEFT JOIN bsth_c_s_sp_info_real r on r.xl_bm=l.line_code"
93 - + " where to_days(l.create_date)=to_days('"+map.get("date").toString() + "') "  
94 - + " and l.line_code=" + map.get("line").toString()  
95 - + " AND r.gs_bm is not null"  
96 - /*+ " and r.gs_bm='"+map.get("gsdmLine").toString()+"'"  
97 - + " and r.fgs_bm='"+map.get("fgsdmLine").toString()+"'"*/  
98 - + " GROUP BY s.station_name,l.name,r.gs_bm,r.gs_name,r.fgs_bm,r.fgs_name ";  
99 -  
100 - //s.station_name 101 + + " where 1=1 ";
  102 + if(map.get("date").toString()!=""){
  103 + sql+="and to_days(r.schedule_date)=to_days('"+map.get("date").toString() + "') ";
  104 + }
  105 + if( map.get("line").toString()!=""){
  106 + sql+=" and l.line_code=" + map.get("line").toString();
  107 + }
  108 + sql+= " AND r.gs_bm is not null";
  109 + if(map.get("gsdmLine").toString()!=""){
  110 + sql+=" and r.gs_bm='"+map.get("gsdmLine").toString()+"' ";
  111 + }
  112 + if(map.get("fgsdmLine").toString()!=""){
  113 + sql+=" and r.fgs_bm='"+map.get("fgsdmLine").toString()+"'";
  114 + }
  115 + sql += " GROUP BY s.station_name,l.name,r.gs_bm,r.gs_name,r.fgs_bm,r.fgs_name ";
101 List<Linepasswengerflow> list = jdbcTemplate.query(sql, new RowMapper<Linepasswengerflow>() { 116 List<Linepasswengerflow> list = jdbcTemplate.query(sql, new RowMapper<Linepasswengerflow>() {
102 117
103 @Override 118 @Override
@@ -109,8 +124,6 @@ public class FormsServiceImpl implements FormsService { @@ -109,8 +124,6 @@ public class FormsServiceImpl implements FormsService {
109 } 124 }
110 }); 125 });
111 126
112 -  
113 -  
114 return list; 127 return list;
115 } 128 }
116 129
@@ -122,16 +135,26 @@ public class FormsServiceImpl implements FormsService { @@ -122,16 +135,26 @@ public class FormsServiceImpl implements FormsService {
122 public List<Shiftuehiclemanth> shiftuehiclemanth(Map<String, Object> map) { 135 public List<Shiftuehiclemanth> shiftuehiclemanth(Map<String, Object> map) {
123 String sql = "select r.j_name,r.cl_zbh,r.j_gh,r.gs_bm,r.gs_name,r.fgs_bm,r.fgs_name,r.bc_type " 136 String sql = "select r.j_name,r.cl_zbh,r.j_gh,r.gs_bm,r.gs_name,r.fgs_bm,r.fgs_name,r.bc_type "
124 + " from bsth_c_s_sp_info_real r " 137 + " from bsth_c_s_sp_info_real r "
125 - + " where to_days(r.schedule_date_str) BETWEEN to_days('" + map.get("startDate").toString() + "') "  
126 - + " and to_days('" + map.get("endDate").toString() + "') "  
127 - + " and r.xl_bm='"+ map.get("line").toString() + "'"  
128 - + " AND r.gs_bm is not null"  
129 - + " and r.bc_type not in('in','out')"  
130 - /* + " and r.gs_bm='"+map.get("gsdmManth").toString()+"'"  
131 - + " and r.fgs_bm='"+map.get("fgsdmManth").toString()+"'"*/  
132 - + " GROUP BY r.j_name,r.cl_zbh,r.j_gh,r.gs_bm,r.gs_name,r.fgs_bm,r.fgs_name"  
133 - + " ORDER BY r.j_name";  
134 - //r.j_name 138 + + " where 1=1 ";
  139 + if(map.get("startDate").toString()!=""){
  140 + sql+=" and to_days(r.schedule_date_str) BETWEEN to_days('" + map.get("startDate").toString() + "') ";
  141 + }
  142 +
  143 + if(map.get("endDate").toString()!=""){
  144 + sql+=" and to_days('" + map.get("endDate").toString() + "') ";
  145 + }
  146 + if( map.get("line").toString()!=""){
  147 + sql+=" and r.xl_bm='"+ map.get("line").toString() + "' ";
  148 + }
  149 + sql+= " AND r.gs_bm is not null and r.bc_type not in('in','out')";
  150 + if(map.get("gsdmManth").toString()!=""){
  151 + sql+=" and r.gs_bm='"+map.get("gsdmManth").toString()+"' ";
  152 + }
  153 + if(map.get("fgsdmManth").toString()!=""){
  154 + sql+=" and r.fgs_bm='"+map.get("fgsdmManth").toString()+"' ";
  155 + }
  156 + sql += " GROUP BY r.j_name,r.cl_zbh,r.j_gh,r.gs_bm,r.gs_name,r.fgs_bm,r.fgs_name,r.bc_type ";
  157 +
135 startDate = map.get("startDate").toString(); 158 startDate = map.get("startDate").toString();
136 endDate = map.get("endDate").toString(); 159 endDate = map.get("endDate").toString();
137 List<Shiftuehiclemanth> list = jdbcTemplate.query(sql, new RowMapper<Shiftuehiclemanth>() { 160 List<Shiftuehiclemanth> list = jdbcTemplate.query(sql, new RowMapper<Shiftuehiclemanth>() {
@@ -150,7 +173,7 @@ public class FormsServiceImpl implements FormsService { @@ -150,7 +173,7 @@ public class FormsServiceImpl implements FormsService {
150 Shiftuehiclemanth s=list.get(i); 173 Shiftuehiclemanth s=list.get(i);
151 Map<String, Object> maps = new HashMap<>(); 174 Map<String, Object> maps = new HashMap<>();
152 175
153 - maps = scheduleRealInfoService.findKMBC1(s.getjName(),s.getZbh(), startDate, 176 + maps = commonService.findKMBC1(s.getjName(),s.getZbh(), startDate,
154 endDate); 177 endDate);
155 178
156 s.setJhlc(maps.get("jhlc").toString()); 179 s.setJhlc(maps.get("jhlc").toString());
@@ -172,13 +195,22 @@ public class FormsServiceImpl implements FormsService { @@ -172,13 +195,22 @@ public class FormsServiceImpl implements FormsService {
172 String sql = " select r.schedule_date,r.lp_name,r.xl_name,r.j_name,r.s_name, r.cl_zbh,r.xl_bm," 195 String sql = " select r.schedule_date,r.lp_name,r.xl_name,r.j_name,r.s_name, r.cl_zbh,r.xl_bm,"
173 + " r.cl_zbh,r.j_gh,r.j_gh,r.gs_bm,r.gs_name,r.fgs_bm,r.fgs_name,r.bc_type " 196 + " r.cl_zbh,r.j_gh,r.j_gh,r.gs_bm,r.gs_name,r.fgs_bm,r.fgs_name,r.bc_type "
174 + " FROM bsth_c_s_sp_info_real r " 197 + " FROM bsth_c_s_sp_info_real r "
175 - + " where to_days(r.schedule_date)=to_days('"  
176 - + map.get("date").toString() + "') and r.xl_bm=" + map.get("line").toString()  
177 - + " and r.bc_type not in('in','out')"  
178 - /*+ " and r.gs_bm='"+map.get("gsdmShif").toString()+"'"  
179 - + " and r.fgs_bm='"+map.get("fgsdmShif").toString()+"'"*/  
180 - + " GROUP BY r.schedule_date,r.lp_name,r.xl_name,r.j_name,r.s_name, r.cl_zbh,r.xl_bm,r.cl_zbh,r.j_gh,r.j_gh,r.gs_bm,r.gs_name,r.fgs_bm,r.fgs_name "  
181 - + " ORDER BY r.lp_name asc"; 198 + + " where 1=1 ";
  199 + if(map.get("date").toString()!=""){
  200 + sql+=" and to_days(r.schedule_date)=to_days('"+ map.get("date").toString() + "') ";
  201 + }
  202 + if( map.get("line").toString()!=""){
  203 + sql+=" and r.xl_bm=" + map.get("line").toString();
  204 + }
  205 + sql+= " and r.bc_type not in('in','out')";
  206 + if(map.get("gsdmShif").toString()!=""){
  207 + sql+=" and r.gs_bm='"+map.get("gsdmShif").toString()+"'";
  208 + }
  209 + if(map.get("fgsdmShif").toString()!=""){
  210 + sql+=" and r.fgs_bm='"+map.get("fgsdmShif").toString()+"'";
  211 + }
  212 + sql += " GROUP BY r.schedule_date,r.lp_name,r.xl_name,r.j_name,r.s_name, r.cl_zbh,r.xl_bm,r.cl_zbh,r.j_gh,r.j_gh,r.gs_bm,r.gs_name,r.fgs_bm,r.fgs_name "
  213 + + " ORDER BY r.lp_name asc";
182 214
183 List<Shifday> list = jdbcTemplate.query(sql, new RowMapper<Shifday>() { 215 List<Shifday> list = jdbcTemplate.query(sql, new RowMapper<Shifday>() {
184 216
@@ -200,7 +232,7 @@ public class FormsServiceImpl implements FormsService { @@ -200,7 +232,7 @@ public class FormsServiceImpl implements FormsService {
200 for(int i=0;i<list.size();i++){ 232 for(int i=0;i<list.size();i++){
201 Shifday shi=list.get(i); 233 Shifday shi=list.get(i);
202 Map<String, Object> maps = new HashMap<>(); 234 Map<String, Object> maps = new HashMap<>();
203 - maps = scheduleRealInfoService.findKMBC2(shi.getJgh(), shi.getCarPlate(), 235 + maps = commonService.findKMBC2(shi.getJgh(), shi.getCarPlate(),
204 shi.getRq()); 236 shi.getRq());
205 shi.setJhlc(maps.get("jhlc").toString());// 计划里程 237 shi.setJhlc(maps.get("jhlc").toString());// 计划里程
206 //shifday.setSjjhlc(map.get("remMileage").toString());//实际计划里程 238 //shifday.setSjjhlc(map.get("remMileage").toString());//实际计划里程
@@ -261,7 +293,6 @@ public class FormsServiceImpl implements FormsService { @@ -261,7 +293,6 @@ public class FormsServiceImpl implements FormsService {
261 @Override 293 @Override
262 public Changetochange mapRow(ResultSet arg0, int arg1) throws SQLException { 294 public Changetochange mapRow(ResultSet arg0, int arg1) throws SQLException {
263 Changetochange chan = new Changetochange(); 295 Changetochange chan = new Changetochange();
264 -  
265 chan.setRq(rq); 296 chan.setRq(rq);
266 chan.setGs(arg0.getString("gs")); 297 chan.setGs(arg0.getString("gs"));
267 chan.setFgs(arg0.getString("fgs")); 298 chan.setFgs(arg0.getString("fgs"));
@@ -302,18 +333,22 @@ public class FormsServiceImpl implements FormsService { @@ -302,18 +333,22 @@ public class FormsServiceImpl implements FormsService {
302 333
303 rq = rq2 + "-" + rq3; 334 rq = rq2 + "-" + rq3;
304 335
305 - String sql = " SELECT r.xl_bm,r.cl_zbh,r.j_gh,r.j_name,y.YH,y.JZL,r.gs_bm,r.gs_name,r.fgs_bm,r.fgs_name " 336 + String sql = " SELECT r.xl_bm,r.xl_name,r.cl_zbh,r.j_gh,r.j_name,y.YH,y.JZL,r.gs_bm,r.gs_name,r.fgs_bm,r.fgs_name "
306 + " FROM bsth_c_s_sp_info_real r " 337 + " FROM bsth_c_s_sp_info_real r "
307 - + " INNER join ( select y.RQ,y.XLBM,y.NBBM,y.JSY,y.JZL,y.YH from bsth_c_ylb y "  
308 - + " where y.RQ BETWEEN '" + map.get("startDate").toString() + "' and '"+ map.get("endDate").toString() + "'"  
309 - + " and y.XLBM= '" + map.get("line").toString() + "' GROUP BY y.RQ,y.XLBM,y.NBBM,y.JSY,y.JZL,y.YH) y on r.cl_zbh=y.nbbm " 338 + + " left join bsth_c_ylb y"
  339 + + " ON r.cl_zbh = y.nbbm "
310 + " where r.schedule_date_str BETWEEN '" + map.get("startDate").toString() + "'" 340 + " where r.schedule_date_str BETWEEN '" + map.get("startDate").toString() + "'"
311 + " and '"+ map.get("endDate").toString() + "'" 341 + " and '"+ map.get("endDate").toString() + "'"
312 + " and r.xl_bm='" + map.get("line").toString() + "'" 342 + " and r.xl_bm='" + map.get("line").toString() + "'"
313 - + " AND r.gs_bm is not null"  
314 - /* + " and r.gs_bm='"+map.get("gsdmSing").toString()+"'"  
315 - + " and r.fgs_bm='"+map.get("fgsdmSing").toString()+"'"*/  
316 - + " GROUP BY r.xl_bm,r.cl_zbh,r.j_gh,r.j_name,y.YH,y.JZL,r.gs_bm,r.gs_name,r.fgs_bm,r.fgs_name "; 343 + + " AND r.gs_bm is not null";
  344 +
  345 + if(map.get("gsdmSing").toString()!=""){
  346 + sql+=" and r.gs_bm='"+map.get("gsdmSing").toString()+"'";
  347 + }
  348 + if(map.get("fgsdmSing").toString()!=""){
  349 + sql+=" and r.fgs_bm='"+map.get("fgsdmSing").toString()+"'";
  350 + }
  351 + sql += " GROUP BY r.xl_bm,r.cl_zbh,r.j_gh,r.j_name,y.YH,y.JZL,r.gs_bm,r.gs_name,r.fgs_bm,r.fgs_name ";
317 352
318 startDate = map.get("startDate").toString(); 353 startDate = map.get("startDate").toString();
319 endDate = map.get("endDate").toString(); 354 endDate = map.get("endDate").toString();
@@ -324,7 +359,7 @@ public class FormsServiceImpl implements FormsService { @@ -324,7 +359,7 @@ public class FormsServiceImpl implements FormsService {
324 Singledata sin = new Singledata(); 359 Singledata sin = new Singledata();
325 sin.setrQ(rq); 360 sin.setrQ(rq);
326 sin.setgS(arg0.getString("gs_name")); 361 sin.setgS(arg0.getString("gs_name"));
327 - sin.setxL(arg0.getString("xl_bm")); 362 + sin.setxL(arg0.getString("xl_name"));
328 sin.setClzbh(arg0.getString("cl_zbh")); 363 sin.setClzbh(arg0.getString("cl_zbh"));
329 sin.setJsy(arg0.getString("j_gh")); 364 sin.setJsy(arg0.getString("j_gh"));
330 sin.setjName(arg0.getString("j_name")); 365 sin.setjName(arg0.getString("j_name"));
@@ -339,7 +374,7 @@ public class FormsServiceImpl implements FormsService { @@ -339,7 +374,7 @@ public class FormsServiceImpl implements FormsService {
339 for(int i=0;i<list.size();i++){ 374 for(int i=0;i<list.size();i++){
340 Singledata si=list.get(i); 375 Singledata si=list.get(i);
341 Map<String, Object> maps = new HashMap<>(); 376 Map<String, Object> maps = new HashMap<>();
342 - maps = scheduleRealInfoService.findKMBC1(si.getjName(),si.getClzbh(), startDate, 377 + maps = commonService.findKMBC1(si.getjName(),si.getClzbh(), startDate,
343 endDate); 378 endDate);
344 //sin.setjName(maps.get("j_name") == null ? "" : maps.get("j_name").toString()); 379 //sin.setjName(maps.get("j_name") == null ? "" : maps.get("j_name").toString());
345 si.setSgh(maps.get("s_gh") == null ? "" : maps.get("s_gh").toString()); 380 si.setSgh(maps.get("s_gh") == null ? "" : maps.get("s_gh").toString());
@@ -356,24 +391,30 @@ public class FormsServiceImpl implements FormsService { @@ -356,24 +391,30 @@ public class FormsServiceImpl implements FormsService {
356 @Override 391 @Override
357 public List<Operationservice> operationservice(Map<String, Object> map) { 392 public List<Operationservice> operationservice(Map<String, Object> map) {
358 393
359 - String sql = " SELECT r.xl_bm,r.xl_name,r.cl_zbh,r.j_gh,r.j_name,y.YH,y.JZL,r.gs_bm,r.gs_name,r.fgs_bm,r.fgs_name,r.bc_type " 394 + String sql = " SELECT r.schedule_date_str,r.xl_bm,r.xl_name,r.cl_zbh,r.j_gh,r.j_name,y.YH,y.JZL,r.gs_bm,r.gs_name,r.fgs_bm,r.fgs_name,r.bc_type "
360 + " FROM bsth_c_s_sp_info_real r " 395 + " FROM bsth_c_s_sp_info_real r "
361 // + "LEFT JOIN bsth_c_s_sp_info_real r on r.cl_zbh=y.NBBM" 396 // + "LEFT JOIN bsth_c_s_sp_info_real r on r.cl_zbh=y.NBBM"
362 - + " INNER join ( select y.RQ,y.XLBM,y.NBBM,y.JSY,y.JZL,y.YH from bsth_c_ylb y "  
363 - + " where y.RQ BETWEEN '" + map.get("startDate").toString() + "' and '"+ map.get("endDate").toString() + "'"  
364 - + " and y.XLBM= '" + map.get("line").toString() + "' GROUP BY y.RQ,y.XLBM,y.NBBM,y.JSY,y.JZL,y.YH) y on r.cl_zbh=y.nbbm "  
365 - + " where r.schedule_date_str BETWEEN '"+ map.get("startDate").toString()  
366 - + "'" + " and '" + map.get("endDate").toString() + "'"  
367 - + " and r.xl_bm='" + map.get("line").toString() + "'"  
368 - + " and r.bc_type not in('in','out')"  
369 - /* + " and r.gs_bm='"+map.get("gsdmOperat").toString()+"'"  
370 - + " and r.fgs_bm='"+map.get("fgsdmOperat").toString()+"'"*/  
371 - + " AND r.gs_bm is not null"  
372 - + " GROUP BY r.xl_bm,r.xl_name,r.cl_zbh,r.j_gh,r.j_name,y.YH,y.JZL,r.gs_bm,r.gs_name,r.fgs_bm,r.fgs_name"; 397 + + " left join bsth_c_ylb y ON r.cl_zbh = y.nbbm "
  398 + + " where 1=1 ";
  399 + if(map.get("startDate").toString()!=""){
  400 + sql+=" and to_days(r.schedule_date_str) BETWEEN to_days('" + map.get("startDate").toString() + "') ";
  401 + }
373 402
374 - //r.j_name  
375 - startDate = map.get("startDate").toString();  
376 - endDate = map.get("endDate").toString(); 403 + if(map.get("endDate").toString()!=""){
  404 + sql+=" and to_days('" + map.get("endDate").toString() + "') ";
  405 + }
  406 + sql+=" and r.xl_bm='" + map.get("line").toString() + "'" ;
  407 + sql+=" and r.bc_type not in('in','out')";
  408 + if(map.get("gsdmOperat").toString()!=""){
  409 + sql+=" and r.gs_bm='"+map.get("gsdmOperat").toString()+"'";
  410 + }
  411 + if(map.get("fgsdmOperat").toString()!=""){
  412 + sql+=" and r.fgs_bm='"+map.get("fgsdmOperat").toString()+"'";
  413 + }
  414 + sql += " AND r.gs_bm is not null";
  415 + sql += " GROUP BY r.xl_bm,r.xl_name,r.cl_zbh,r.j_gh,r.j_name,y.YH,y.JZL,r.gs_bm,r.gs_name,r.fgs_bm,r.fgs_name";
  416 + startDate = map.get("startDate").toString();
  417 + endDate = map.get("endDate").toString();
377 List<Operationservice> list = jdbcTemplate.query(sql, new RowMapper<Operationservice>() { 418 List<Operationservice> list = jdbcTemplate.query(sql, new RowMapper<Operationservice>() {
378 419
379 @Override 420 @Override
@@ -392,9 +433,9 @@ public class FormsServiceImpl implements FormsService { @@ -392,9 +433,9 @@ public class FormsServiceImpl implements FormsService {
392 for(int i=0;i<list.size();i++){ 433 for(int i=0;i<list.size();i++){
393 Operationservice o=list.get(i); 434 Operationservice o=list.get(i);
394 Map<String, Object> maps = new HashMap<>(); 435 Map<String, Object> maps = new HashMap<>();
395 - maps = scheduleRealInfoService.findKMBC1(o.getJname(), o.getClzbh(), startDate, 436 + maps = commonService.findKMBC1(o.getJname(), o.getClzbh(), startDate,
396 endDate); 437 endDate);
397 - o.setXsgl(maps.get("yygl").toString() == null ? "" : maps.get("yygl").toString()); 438 + o.setXsgl(maps.get("jhlc").toString() == null ? "" : maps.get("jhlc").toString());
398 o.setEmptMileage(maps.get("ksgl").toString() == null ? "" : maps.get("ksgl").toString()); 439 o.setEmptMileage(maps.get("ksgl").toString() == null ? "" : maps.get("ksgl").toString());
399 o.setSjbc(maps.get("sjbc").toString() == null ? "" : maps.get("sjbc").toString()); 440 o.setSjbc(maps.get("sjbc").toString() == null ? "" : maps.get("sjbc").toString());
400 } 441 }
@@ -404,7 +445,7 @@ public class FormsServiceImpl implements FormsService { @@ -404,7 +445,7 @@ public class FormsServiceImpl implements FormsService {
404 445
405 // 车辆加注 446 // 车辆加注
406 @Override 447 @Override
407 - public List<Vehicleloading> vehicleloading(/*String gsdmVehic,String fgsdmVehic,*/String line, String date) { 448 + public List<Vehicleloading> vehicleloading(String gsdmVehic,String fgsdmVehic,String line, String date) {
408 449
409 String sql = " SELECT r.schedule_date_str,r.xl_bm,r.xl_name,r.cl_zbh,r.j_name,y.YH,y.JZL,r.j_gh,r.gs_bm,r.gs_name,r.fgs_bm,r.fgs_name,r.bc_type " 450 String sql = " SELECT r.schedule_date_str,r.xl_bm,r.xl_name,r.cl_zbh,r.j_name,y.YH,y.JZL,r.j_gh,r.gs_bm,r.gs_name,r.fgs_bm,r.fgs_name,r.bc_type "
410 + " FROM bsth_c_s_sp_info_real r " 451 + " FROM bsth_c_s_sp_info_real r "
@@ -414,13 +455,14 @@ public class FormsServiceImpl implements FormsService { @@ -414,13 +455,14 @@ public class FormsServiceImpl implements FormsService {
414 + " where to_days(r.schedule_date_str)=to_days('" + date + "')" 455 + " where to_days(r.schedule_date_str)=to_days('" + date + "')"
415 + " and r.xl_bm='" + line + "' " 456 + " and r.xl_bm='" + line + "' "
416 + " AND r.gs_bm is not null" 457 + " AND r.gs_bm is not null"
417 - + " and r.bc_type not in('in','out')"  
418 - /* + " and r.gs_bm='"+gsdmVehic +"'"  
419 - + " and r.fgs_bm='"+fgsdmVehic +"'"*/  
420 - + " GROUP BY r.schedule_date_str,r.xl_bm,r.xl_name,r.cl_zbh,r.j_name,y.YH,y.JZL,r.j_gh,r.gs_bm,r.gs_name,r.fgs_bm,r.fgs_name ";  
421 -  
422 -  
423 - //r.cl_zbh 458 + + " and r.bc_type not in('in','out')";
  459 + if(gsdmVehic.toString()!=""){
  460 + sql+=" and r.gs_bm='"+gsdmVehic+"'";
  461 + }
  462 + if(fgsdmVehic.toString()!=""){
  463 + sql+=" and r.fgs_bm='"+fgsdmVehic +"'";
  464 + }
  465 + sql += " GROUP BY r.schedule_date_str,r.xl_bm,r.xl_name,r.cl_zbh,r.j_name,y.YH,y.JZL,r.j_gh,r.gs_bm,r.gs_name,r.fgs_bm,r.fgs_name ";
424 List<Vehicleloading> list = jdbcTemplate.query(sql, new RowMapper<Vehicleloading>() { 466 List<Vehicleloading> list = jdbcTemplate.query(sql, new RowMapper<Vehicleloading>() {
425 @Override 467 @Override
426 public Vehicleloading mapRow(ResultSet arg0, int arg1) throws SQLException { 468 public Vehicleloading mapRow(ResultSet arg0, int arg1) throws SQLException {
@@ -429,8 +471,8 @@ public class FormsServiceImpl implements FormsService { @@ -429,8 +471,8 @@ public class FormsServiceImpl implements FormsService {
429 ve.setgS(arg0.getString("gs_name")); 471 ve.setgS(arg0.getString("gs_name"));
430 ve.setxL(arg0.getString("xl_name")); 472 ve.setxL(arg0.getString("xl_name"));
431 ve.setClzbh(arg0.getString("cl_zbh")); 473 ve.setClzbh(arg0.getString("cl_zbh"));
432 - ve.setHyl(arg0.getString("YH"));  
433 ve.setJzl(arg0.getString("JZL")); 474 ve.setJzl(arg0.getString("JZL"));
  475 + ve.setHyl(arg0.getString("YH"));
434 // ve.setLs(arg0.getString("").toString());//尿素 476 // ve.setLs(arg0.getString("").toString());//尿素
435 ve.setJgh(arg0.getString("j_gh").toString()); 477 ve.setJgh(arg0.getString("j_gh").toString());
436 return ve; 478 return ve;
@@ -440,9 +482,9 @@ public class FormsServiceImpl implements FormsService { @@ -440,9 +482,9 @@ public class FormsServiceImpl implements FormsService {
440 for(int i=0;i<list.size();i++){ 482 for(int i=0;i<list.size();i++){
441 Vehicleloading v=list.get(i); 483 Vehicleloading v=list.get(i);
442 Map<String, Object> maps = new HashMap<>(); 484 Map<String, Object> maps = new HashMap<>();
443 - maps = scheduleRealInfoService.findKMBC2(v.getJgh(), line,  
444 - date);  
445 - v.setJhlc(maps.get("yygl") == null ? "" : maps.get("yygl").toString()); 485 + maps = commonService.findKMBC2(v.getJgh(), v.getClzbh(),
  486 + v.getrQ());
  487 + v.setJhlc(maps.get("jhlc") == null ? "" : maps.get("jhlc").toString());
446 v.setJhbc(maps.get("jhbc").toString() == null ? "" : maps.get("jhbc").toString());// 计划班次 488 v.setJhbc(maps.get("jhbc").toString() == null ? "" : maps.get("jhbc").toString());// 计划班次
447 v.setSjbc(maps.get("sjbc").toString() == null ? "" : maps.get("sjbc").toString());// 实际班次 489 v.setSjbc(maps.get("sjbc").toString() == null ? "" : maps.get("sjbc").toString());// 实际班次
448 } 490 }
@@ -476,8 +518,8 @@ public class FormsServiceImpl implements FormsService { @@ -476,8 +518,8 @@ public class FormsServiceImpl implements FormsService {
476 + " and '" + map.get("endDate").toString() + "' and xl_bm='"+ map.get("line").toString() + "' " 518 + " and '" + map.get("endDate").toString() + "' and xl_bm='"+ map.get("line").toString() + "' "
477 + " AND gs_bm is not null " 519 + " AND gs_bm is not null "
478 + " AND bc_type NOT IN ('in', 'out')" 520 + " AND bc_type NOT IN ('in', 'out')"
479 - /*+ " and gs_bm='"+ map.get("gsdmTurn").toString() + "'"  
480 - + " and fgs_bm='"+ map.get("fgsdmTurn").toString() + "'"*/ 521 + + " and gs_bm='"+ map.get("gsdmTurn").toString() + "'"
  522 + + " and fgs_bm='"+ map.get("fgsdmTurn").toString() + "'"
481 + " GROUP BY gs_bm,fgs_bm,xl_bm,gs_name,fgs_name,bc_type ) a left JOIN (" 523 + " GROUP BY gs_bm,fgs_bm,xl_bm,gs_name,fgs_name,bc_type ) a left JOIN ("
482 + " SELECT COUNT(*) as xlgs,b.gs_bm,b.fgs_bm,b.xl_bm,b.gs_name,b.fgs_name, b.sbc,b.sxl ,b.scl,t.warrant_car " 524 + " SELECT COUNT(*) as xlgs,b.gs_bm,b.fgs_bm,b.xl_bm,b.gs_name,b.fgs_name, b.sbc,b.sxl ,b.scl,t.warrant_car "
483 + " from bsth_c_line t RIGHT JOIN (select gs_bm,fgs_bm,xl_bm,gs_name,fgs_name, count(*) as sbc,COUNT(DISTINCT xl_bm) as sxl ,COUNT(DISTINCT cl_zbh) as scl,bc_type from bsth_c_s_sp_info_real " 525 + " from bsth_c_line t RIGHT JOIN (select gs_bm,fgs_bm,xl_bm,gs_name,fgs_name, count(*) as sbc,COUNT(DISTINCT xl_bm) as sxl ,COUNT(DISTINCT cl_zbh) as scl,bc_type from bsth_c_s_sp_info_real "
@@ -510,7 +552,7 @@ public class FormsServiceImpl implements FormsService { @@ -510,7 +552,7 @@ public class FormsServiceImpl implements FormsService {
510 tu.setBcjh(arg0.getString("jbc").toString()); 552 tu.setBcjh(arg0.getString("jbc").toString());
511 tu.setBcsj(arg0.getString("sbc").toString()); 553 tu.setBcsj(arg0.getString("sbc").toString());
512 tu.setBbzxl(result2 + "%");// 班次执行率 554 tu.setBbzxl(result2 + "%");// 班次执行率
513 - // tu.setSm(arg0.getString("gs_name").toString()); 555 + tu.setSm(arg0.getString("gs_name").toString());
514 tu.setGsgs(arg0.getString("gslsbm").toString()); 556 tu.setGsgs(arg0.getString("gslsbm").toString());
515 tu.setFgsgs(arg0.getString("fgsbm").toString()); 557 tu.setFgsgs(arg0.getString("fgsbm").toString());
516 return tu; 558 return tu;
@@ -547,8 +589,8 @@ public class FormsServiceImpl implements FormsService { @@ -547,8 +589,8 @@ public class FormsServiceImpl implements FormsService {
547 + " from bsth_c_s_sp_info" + " where DATE_FORMAT(schedule_date,'%Y-%m-%d') BETWEEN '" 589 + " from bsth_c_s_sp_info" + " where DATE_FORMAT(schedule_date,'%Y-%m-%d') BETWEEN '"
548 + map.get("startDate").toString() + "' and '" + map.get("endDate").toString() + "' and xl_bm='" 590 + map.get("startDate").toString() + "' and '" + map.get("endDate").toString() + "' and xl_bm='"
549 + map.get("line").toString() + "' AND gs_bm is not null AND bc_type NOT IN ('in', 'out')" 591 + map.get("line").toString() + "' AND gs_bm is not null AND bc_type NOT IN ('in', 'out')"
550 - /*+ " and gs_bm='"+ map.get("gsdmEcecut").toString() + "'"  
551 - + " and fgs_bm='"+ map.get("fgsdmEcecut").toString() + "'"*/ 592 + + " and gs_bm='"+ map.get("gsdmEcecut").toString() + "'"
  593 + + " and fgs_bm='"+ map.get("fgsdmEcecut").toString() + "'"
552 + " GROUP BY gs_bm,fgs_bm,xl_bm,gs_name,fgs_name,bc_type ) a left JOIN (" 594 + " GROUP BY gs_bm,fgs_bm,xl_bm,gs_name,fgs_name,bc_type ) a left JOIN ("
553 + "SELECT COUNT(*) as xlgs,b.gs_bm,b.fgs_bm,b.xl_bm,b.xl_name,b.gs_name,b.fgs_name, b.sbc,b.sxl ,b.scl " 595 + "SELECT COUNT(*) as xlgs,b.gs_bm,b.fgs_bm,b.xl_bm,b.xl_name,b.gs_name,b.fgs_name, b.sbc,b.sxl ,b.scl "
554 + "from bsth_c_line t RIGHT JOIN (select gs_bm,fgs_bm,xl_bm,xl_name,gs_name,fgs_name, count(*) as sbc,COUNT(DISTINCT xl_bm) as sxl ,COUNT(DISTINCT cl_zbh) as scl,bc_type from bsth_c_s_sp_info_real " 596 + "from bsth_c_line t RIGHT JOIN (select gs_bm,fgs_bm,xl_bm,xl_name,gs_name,fgs_name, count(*) as sbc,COUNT(DISTINCT xl_bm) as sxl ,COUNT(DISTINCT cl_zbh) as scl,bc_type from bsth_c_s_sp_info_real "
@@ -618,8 +660,8 @@ public class FormsServiceImpl implements FormsService { @@ -618,8 +660,8 @@ public class FormsServiceImpl implements FormsService {
618 + " from bsth_c_s_sp_info" + " where DATE_FORMAT(schedule_date,'%Y-%m-%d') BETWEEN '" 660 + " from bsth_c_s_sp_info" + " where DATE_FORMAT(schedule_date,'%Y-%m-%d') BETWEEN '"
619 + map.get("startDate").toString() + "' and '" + map.get("endDate").toString() + "' and xl_bm='" 661 + map.get("startDate").toString() + "' and '" + map.get("endDate").toString() + "' and xl_bm='"
620 + map.get("line").toString() + "' AND gs_bm is not null AND bc_type NOT IN ('in', 'out') " 662 + map.get("line").toString() + "' AND gs_bm is not null AND bc_type NOT IN ('in', 'out') "
621 - /*+ " and gs_bm='"+ map.get("gsdmAllline").toString() + "'"  
622 - + " and fgs_bm='"+ map.get("fgsdmAllline").toString() + "'"*/ 663 + + " and gs_bm='"+ map.get("gsdmAllline").toString() + "'"
  664 + + " and fgs_bm='"+ map.get("fgsdmAllline").toString() + "'"
623 + " GROUP BY gs_bm,fgs_bm,xl_bm,gs_name,fgs_name,bc_type ) a left JOIN (" 665 + " GROUP BY gs_bm,fgs_bm,xl_bm,gs_name,fgs_name,bc_type ) a left JOIN ("
624 + "SELECT COUNT(*" 666 + "SELECT COUNT(*"
625 + ") as xlgs,b.gs_bm,b.fgs_bm,b.xl_bm,b." 667 + ") as xlgs,b.gs_bm,b.fgs_bm,b.xl_bm,b."
@@ -655,18 +697,13 @@ public class FormsServiceImpl implements FormsService { @@ -655,18 +697,13 @@ public class FormsServiceImpl implements FormsService {
655 tu.setBcsj(arg0.getString("sbc").toString()); 697 tu.setBcsj(arg0.getString("sbc").toString());
656 tu.setBbzxl(result2 + "%");// 班次执行率 698 tu.setBbzxl(result2 + "%");// 班次执行率
657 699
658 - // tu.setSm(arg0.getString("xl_name").toString()); 700 + tu.setSm(arg0.getString("xl_name").toString());
659 tu.setGsgs(arg0.getString("gslsbm").toString()); 701 tu.setGsgs(arg0.getString("gslsbm").toString());
660 tu.setFgsgs(arg0.getString("fgsbm").toString()); 702 tu.setFgsgs(arg0.getString("fgsbm").toString());
661 return tu; 703 return tu;
662 - }  
663 -  
664 - 704 + }
665 }); 705 });
666 706
667 -  
668 -  
669 -  
670 return list; 707 return list;
671 } 708 }
672 } 709 }
src/main/resources/ms-jdbc.properties
@@ -3,7 +3,13 @@ @@ -3,7 +3,13 @@
3 #ms.mysql.username= root 3 #ms.mysql.username= root
4 #ms.mysql.password= 123456 4 #ms.mysql.password= 123456
5 5
  6 +#ms.mysql.driver= com.mysql.jdbc.Driver
  7 +#ms.mysql.url= jdbc:mysql://192.168.168.171:3306/ms?useUnicode=true&characterEncoding=utf-8
  8 +#ms.mysql.username= root
  9 +#ms.mysql.password= root2jsp
  10 +
  11 +
6 ms.mysql.driver= com.mysql.jdbc.Driver 12 ms.mysql.driver= com.mysql.jdbc.Driver
7 -ms.mysql.url= jdbc:mysql://192.168.168.171:3306/ms?useUnicode=true&characterEncoding=utf-8 13 +ms.mysql.url= jdbc:mysql://192.168.168.117:3306/ms?useUnicode=true&characterEncoding=utf-8&useSSL=false
8 ms.mysql.username= root 14 ms.mysql.username= root
9 -ms.mysql.password= root2jsp  
10 \ No newline at end of file 15 \ No newline at end of file
  16 +ms.mysql.password= root
src/main/resources/static/pages/forms/mould/linepasswengerflow.xls 0 → 100644
No preview for this file type
src/main/resources/static/pages/forms/mould/operationservice.xls 0 → 100644
No preview for this file type
src/main/resources/static/pages/forms/mould/shifday.xls 0 → 100644
No preview for this file type
src/main/resources/static/pages/forms/mould/shiftuehiclemanth.xls 0 → 100644
No preview for this file type
src/main/resources/static/pages/forms/mould/singledata.xls 0 → 100644
No preview for this file type
src/main/resources/static/pages/forms/mould/vehicleloading.xls 0 → 100644
No preview for this file type
src/main/resources/static/pages/forms/statement/allline.html
@@ -43,14 +43,18 @@ @@ -43,14 +43,18 @@
43 <div class="portlet light porttlet-fit bordered"> 43 <div class="portlet light porttlet-fit bordered">
44 <div class="portlet-title"> 44 <div class="portlet-title">
45 <form class="form-inline" action="" method="post"> 45 <form class="form-inline" action="" method="post">
46 - <!-- <div style="display: inline-block; margin-left: 33px;" id="gsdmDiv_allline">  
47 - <span class="item-label" style="width: 80px;">公司: </span>  
48 - <select class="form-control" name="company" id="gsdmAllline" style="width: 140px;"></select>  
49 - </div>  
50 - <div style="display: inline-block; margin-left: 24px;" id="fgsdmDiv_allline">  
51 - <span class="item-label" style="width: 80px;">分公司: </span>  
52 - <select class="form-control" name="subCompany" id="fgsdmAllline" style="width: 140px;"></select>  
53 - </div> --> 46 + <div style="display: inline-block; margin-left: 33px;"
  47 + id="gsdmDiv_allline">
  48 + <span class="item-label" style="width: 80px;">公司: </span> <select
  49 + class="form-control" name="company" id="gsdmAllline"
  50 + style="width: 140px;"></select>
  51 + </div>
  52 + <div style="display: inline-block; margin-left: 24px;"
  53 + id="fgsdmDiv_allline">
  54 + <span class="item-label" style="width: 80px;">分公司: </span> <select
  55 + class="form-control" name="subCompany" id="fgsdmAllline"
  56 + style="width: 140px;"></select>
  57 + </div>
54 <div style="display: inline-block;"> 58 <div style="display: inline-block;">
55 <span class="item-label" style="width: 80px;">线路: </span> <select 59 <span class="item-label" style="width: 80px;">线路: </span> <select
56 class="form-control" name="line" id="line" style="width: 120px;"></select> 60 class="form-control" name="line" id="line" style="width: 120px;"></select>
@@ -188,15 +192,20 @@ @@ -188,15 +192,20 @@
188 var endDate; 192 var endDate;
189 var gsdmAllline; 193 var gsdmAllline;
190 var fgsdmAllline; 194 var fgsdmAllline;
191 - $("#query").on("click",function() { 195 + $("#query")
  196 + .on(
  197 + "click",
  198 + function() {
192 line = $("#line").val(); 199 line = $("#line").val();
193 startDate1 = $("#startDate").val(); 200 startDate1 = $("#startDate").val();
194 endDate1 = $("#endDate").val(); 201 endDate1 = $("#endDate").val();
195 gsdmAllline = $("#gsdmAllline").val(); 202 gsdmAllline = $("#gsdmAllline").val();
196 fgsdmAllline = $("#fgsdmAllline").val(); 203 fgsdmAllline = $("#fgsdmAllline").val();
197 if (startDate1 != '' && endDate1 != '') { 204 if (startDate1 != '' && endDate1 != '') {
198 - $post('/mcy_forms/allline',{  
199 - /* gsdmAllline:gsdmAllline,fgsdmAllline:fgsdmAllline, */ 205 + $post(
  206 + '/mcy_forms/allline',
  207 + {
  208 + gsdmAllline:gsdmAllline,fgsdmAllline:fgsdmAllline,
200 line : line, 209 line : line,
201 startDate : $("#startDate").val(), 210 startDate : $("#startDate").val(),
202 endDate : $("#endDate").val(), 211 endDate : $("#endDate").val(),
@@ -285,7 +294,14 @@ @@ -285,7 +294,14 @@
285 $("#export").on( 294 $("#export").on(
286 "click", 295 "click",
287 function() { 296 function() {
  297 + line = $("#line").val();
  298 + startDate1 = $("#startDate").val();
  299 + endDate1 = $("#endDate").val();
  300 + gsdmAllline = $("#gsdmAllline").val();
  301 + fgsdmAllline = $("#fgsdmAllline").val();
288 $post('/mcy_export/alllineExport', { 302 $post('/mcy_export/alllineExport', {
  303 + gsdmAllline : gsdmAllline,
  304 + fgsdmAllline : fgsdmAllline,
289 line : line, 305 line : line,
290 startDate : startDate, 306 startDate : startDate,
291 endDate : endDate, 307 endDate : endDate,
src/main/resources/static/pages/forms/statement/changetochange.html
@@ -43,18 +43,22 @@ @@ -43,18 +43,22 @@
43 <div class="portlet light porttlet-fit bordered"> 43 <div class="portlet light porttlet-fit bordered">
44 <div class="portlet-title"> 44 <div class="portlet-title">
45 <form class="form-inline" action="" method="post"> 45 <form class="form-inline" action="" method="post">
46 - <div style="display: inline-block; margin-left: 33px;" id="gsdmDiv_change">  
47 - <span class="item-label" style="width: 80px;">公司: </span>  
48 - <select class="form-control" name="company" id="gsdmChange" style="width: 140px;"></select>  
49 - </div>  
50 - <div style="display: inline-block; margin-left: 24px;" id="fgsdmDiv_change">  
51 - <span class="item-label" style="width: 80px;">分公司: </span>  
52 - <select class="form-control" name="subCompany" id="fgsdmChange" style="width: 140px;"></select>  
53 - </div> 46 + <div style="display: inline-block; margin-left: 33px;"
  47 + id="gsdmDiv_change">
  48 + <span class="item-label" style="width: 80px;">公司: </span> <select
  49 + class="form-control" name="company" id="gsdmChange"
  50 + style="width: 140px;"></select>
  51 + </div>
  52 + <div style="display: inline-block; margin-left: 24px;"
  53 + id="fgsdmDiv_change">
  54 + <span class="item-label" style="width: 80px;">分公司: </span> <select
  55 + class="form-control" name="subCompany" id="fgsdmChange"
  56 + style="width: 140px;"></select>
  57 + </div>
54 <div style="display: inline-block;"> 58 <div style="display: inline-block;">
55 - <span class="item-label" style="width: 80px;">线路: </span>  
56 - <select class="form-control" name="line" id="line" style="width: 180px;"></select>  
57 - </div> 59 + <span class="item-label" style="width: 80px;">线路: </span> <select
  60 + class="form-control" name="line" id="line" style="width: 180px;"></select>
  61 + </div>
58 <div style="display: inline-block; margin-left: 15px;"> 62 <div style="display: inline-block; margin-left: 15px;">
59 <span class="item-label" style="width: 80px;">开始时间: </span> <input 63 <span class="item-label" style="width: 80px;">开始时间: </span> <input
60 class="form-control" type="text" id="startDate" 64 class="form-control" type="text" id="startDate"
@@ -139,51 +143,55 @@ @@ -139,51 +143,55 @@
139 locale : 'zh-cn' 143 locale : 'zh-cn'
140 }); 144 });
141 145
142 -  
143 var obj = []; 146 var obj = [];
144 - $.get('/user/companyData', function(result){ 147 + $.get('/user/companyData', function(result) {
145 obj = result; 148 obj = result;
146 var options = ''; 149 var options = '';
147 - for(var i = 0; i < obj.length; i++){  
148 - options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>'; 150 + for (var i = 0; i < obj.length; i++) {
  151 + options += '<option value="'+obj[i].companyCode+'">'
  152 + + obj[i].companyName + '</option>';
149 } 153 }
150 - if(obj.length ==0){  
151 - $("#gsdmDiv_change").css('display','none');  
152 - $('#fgsdmDiv_change').css('display','none');  
153 - }else if(obj.length ==1){  
154 - $("#gsdmDiv_change").css('display','none');  
155 - if(obj[0].children.length == 1 || obj[0].children.length ==0)  
156 - $('#fgsdmDiv_change').css('display','none'); 154 + if (obj.length == 0) {
  155 + $("#gsdmDiv_change").css('display', 'none');
  156 + $('#fgsdmDiv_change').css('display', 'none');
  157 + } else if (obj.length == 1) {
  158 + $("#gsdmDiv_change").css('display', 'none');
  159 + if (obj[0].children.length == 1 || obj[0].children.length == 0)
  160 + $('#fgsdmDiv_change').css('display', 'none');
157 } 161 }
158 $('#gsdmChange').html(options); 162 $('#gsdmChange').html(options);
159 updateCompany(); 163 updateCompany();
160 }); 164 });
161 165
162 - $("#gsdmChange").on("change",updateCompany);  
163 - function updateCompany(){ 166 + $("#gsdmChange").on("change", updateCompany);
  167 + function updateCompany() {
164 var company = $('#gsdmChange').val(); 168 var company = $('#gsdmChange').val();
165 var options = ''; 169 var options = '';
166 - for(var i = 0; i < obj.length; i++){  
167 - if(obj[i].companyCode == company){ 170 + for (var i = 0; i < obj.length; i++) {
  171 + if (obj[i].companyCode == company) {
168 var children = obj[i].children; 172 var children = obj[i].children;
169 - for(var j = 0; j < children.length; j++){  
170 - options += '<option value="'+children[j].code+'">'+children[j].name+'</option>'; 173 + for (var j = 0; j < children.length; j++) {
  174 + options += '<option value="'+children[j].code+'">'
  175 + + children[j].name + '</option>';
171 } 176 }
172 } 177 }
173 } 178 }
174 $('#fgsdmChange').html(options); 179 $('#fgsdmChange').html(options);
175 - } 180 + }
  181 +
  182 + $.get('/basic/lineCode2Name', function(result) {
  183 + var data = [];
176 184
177 - $.get('/basic/lineCode2Name',function(result){  
178 - var data=[];  
179 -  
180 - for(var code in result){  
181 - data.push({id: code, text: result[code]}); 185 + for ( var code in result) {
  186 + data.push({
  187 + id : code,
  188 + text : result[code]
  189 + });
182 } 190 }
183 - initPinYinSelect2('#line',data,'');  
184 - 191 + initPinYinSelect2('#line', data, '');
  192 +
185 }) 193 })
186 - 194 +
187 var line; 195 var line;
188 var startDate; 196 var startDate;
189 var endDate; 197 var endDate;
@@ -194,7 +202,8 @@ @@ -194,7 +202,8 @@
194 sel = $("#sel").val(); 202 sel = $("#sel").val();
195 var startDate1 = $("#startDate").val(); 203 var startDate1 = $("#startDate").val();
196 var endDate1 = $("#endDate").val(); 204 var endDate1 = $("#endDate").val();
197 - 205 + var gsdmChange= $("#gsdmChange").val();
  206 + var fgsdmChange= $("#fgsdmChange").val();
198 if (startDate1 != '' && endDate1 != '') { 207 if (startDate1 != '' && endDate1 != '') {
199 $post('/mcy_forms/changetochange', { 208 $post('/mcy_forms/changetochange', {
200 sel : sel, 209 sel : sel,
@@ -235,7 +244,17 @@ @@ -235,7 +244,17 @@
235 $("#export").on( 244 $("#export").on(
236 "click", 245 "click",
237 function() { 246 function() {
  247 + var sel = $("#sel").val();
  248 + var startDate = $("#startDate").val();
  249 + var endDate = $("#endDate").val();
  250 + var lpName = $("#lpName").val();
  251 + var gsdmChange= $("#gsdmChange").val();
  252 + var fgsdmChange= $("#fgsdmChange").val();
238 $post('/mcy_export/changetochangeExport', { 253 $post('/mcy_export/changetochangeExport', {
  254 + sel:sel,
  255 + line:line,
  256 + gsdmChange:gsdmChange,
  257 + fgsdmChange:fgsdmChange,
239 startDate : startDate, 258 startDate : startDate,
240 endDate : endDate, 259 endDate : endDate,
241 type : 'export' 260 type : 'export'
src/main/resources/static/pages/forms/statement/executionrate.html
@@ -37,14 +37,14 @@ @@ -37,14 +37,14 @@
37 <div class="portlet light porttlet-fit bordered"> 37 <div class="portlet light porttlet-fit bordered">
38 <div class="portlet-title"> 38 <div class="portlet-title">
39 <form class="form-inline" action="" method="post"> 39 <form class="form-inline" action="" method="post">
40 - <!-- <div style="display: inline-block; margin-left: 33px;" id="gsdmDiv_ececut"> 40 + <div style="display: inline-block; margin-left: 33px;" id="gsdmDiv_ececut">
41 <span class="item-label" style="width: 80px;">公司: </span> 41 <span class="item-label" style="width: 80px;">公司: </span>
42 <select class="form-control" name="company" id="gsdmEcecut" style="width: 140px;"></select> 42 <select class="form-control" name="company" id="gsdmEcecut" style="width: 140px;"></select>
43 </div> 43 </div>
44 <div style="display: inline-block; margin-left: 24px;" id="fgsdmDiv_ececut"> 44 <div style="display: inline-block; margin-left: 24px;" id="fgsdmDiv_ececut">
45 <span class="item-label" style="width: 80px;">分公司: </span> 45 <span class="item-label" style="width: 80px;">分公司: </span>
46 <select class="form-control" name="subCompany" id="fgsdmEcecut" style="width: 140px;"></select> 46 <select class="form-control" name="subCompany" id="fgsdmEcecut" style="width: 140px;"></select>
47 - </div> --> 47 + </div>
48 <div style="display: inline-block;"> 48 <div style="display: inline-block;">
49 <span class="item-label" style="width: 80px;">线路: </span> 49 <span class="item-label" style="width: 80px;">线路: </span>
50 <select class="form-control" name="line" id="line" style="width: 120px;"></select> 50 <select class="form-control" name="line" id="line" style="width: 120px;"></select>
@@ -71,7 +71,7 @@ @@ -71,7 +71,7 @@
71 <th colspan="11">班次执行率统计表</th> 71 <th colspan="11">班次执行率统计表</th>
72 </tr> 72 </tr>
73 <tr> 73 <tr>
74 - <td rowspan="2" style=" padding-top: 20px;">日期</td> 74 + <td rowspan="2" style=" padding-top: 20px;">日期</td>
75 <td rowspan="2" style=" padding-top: 20px;">公司</td> 75 <td rowspan="2" style=" padding-top: 20px;">公司</td>
76 <td rowspan="2" style=" padding-top: 20px;">直属公司</td> 76 <td rowspan="2" style=" padding-top: 20px;">直属公司</td>
77 <td rowspan="2" style=" padding-top: 20px;">线路条数</td> 77 <td rowspan="2" style=" padding-top: 20px;">线路条数</td>
@@ -181,15 +181,15 @@ @@ -181,15 +181,15 @@
181 gsdmEcecut=$("#gsdmEcecut").val(); 181 gsdmEcecut=$("#gsdmEcecut").val();
182 fgsdmEcecut=$("#fgsdmEcecut").val(); 182 fgsdmEcecut=$("#fgsdmEcecut").val();
183 if(startDate1!=''&&endDate1!=''){ 183 if(startDate1!=''&&endDate1!=''){
184 - $post('/mcy_forms/executionrate',{/* gsdmEcecut:gsdmEcecut,fgsdmEcecut:fgsdmEcecut, */line:line,startDate:$("#startDate").val(),endDate:$("#endDate").val(),type:'query'},function(result){ 184 + $post('/mcy_forms/executionrate',{ gsdmEcecut:gsdmEcecut,fgsdmEcecut:fgsdmEcecut, line:line,startDate:$("#startDate").val(),endDate:$("#endDate").val(),type:'query'},function(result){
185 // 把数据填充到模版中 185 // 把数据填充到模版中
186 var tbodyHtml = template('executionrate',{list:result}); 186 var tbodyHtml = template('executionrate',{list:result});
187 // 把渲染好的模版html文本追加到表格中 187 // 把渲染好的模版html文本追加到表格中
188 $('#tbody').html(tbodyHtml); 188 $('#tbody').html(tbodyHtml);
189 - line = $("#line").val(); 189 + line = $("#line").val();
190 190
191 - startDate = $("#startDate").val();  
192 - endDate = $("#endDate").val(); 191 + startDate = $("#startDate").val();
  192 + endDate = $("#endDate").val();
193 $("#sDate").text(startDate); 193 $("#sDate").text(startDate);
194 $("#eDate").text(endDate); 194 $("#eDate").text(endDate);
195 195
@@ -240,7 +240,12 @@ @@ -240,7 +240,12 @@
240 }); 240 });
241 241
242 $("#export").on("click",function(){ 242 $("#export").on("click",function(){
243 - $post('/mcy_export/executionrateExport',{line:line,startDate:startDate,endDate:endDate,type:'export'},function(result){ 243 + line = $("#line").val();
  244 + startDate=$("#startDate").val();
  245 + endDate=$("#endDate").val();
  246 + gsdmEcecut=$("#gsdmEcecut").val();
  247 + fgsdmEcecut=$("#fgsdmEcecut").val();
  248 + $post('/mcy_export/executionrateExport',{gsdmEcecut:gsdmEcecut,fgsdmEcecut:fgsdmEcecut,line:line,startDate:startDate,endDate:endDate,type:'export'},function(result){
244 window.open("/downloadFile/download?fileName=班次执行率统计表"+moment(startDate).format("YYYYMMDD")); 249 window.open("/downloadFile/download?fileName=班次执行率统计表"+moment(startDate).format("YYYYMMDD"));
245 }); 250 });
246 }); 251 });
src/main/resources/static/pages/forms/statement/linepassengerflow.html
@@ -27,14 +27,14 @@ @@ -27,14 +27,14 @@
27 <div class="portlet light porttlet-fit bordered"> 27 <div class="portlet light porttlet-fit bordered">
28 <div class="portlet-title"> 28 <div class="portlet-title">
29 <form class="form-inline" action=""> 29 <form class="form-inline" action="">
30 - <!-- <div style="display: inline-block; margin-left: 33px;" id="gsdmDiv_line"> 30 + <div style="display: inline-block; margin-left: 33px;" id="gsdmDiv_line">
31 <span class="item-label" style="width: 80px;">公司: </span> 31 <span class="item-label" style="width: 80px;">公司: </span>
32 <select class="form-control" name="company" id="gsdmLine" style="width: 140px;"></select> 32 <select class="form-control" name="company" id="gsdmLine" style="width: 140px;"></select>
33 </div> 33 </div>
34 <div style="display: inline-block; margin-left: 24px;" id="fgsdmDiv_line"> 34 <div style="display: inline-block; margin-left: 24px;" id="fgsdmDiv_line">
35 <span class="item-label" style="width: 80px;">分公司: </span> 35 <span class="item-label" style="width: 80px;">分公司: </span>
36 <select class="form-control" name="subCompany" id="fgsdmLine" style="width: 140px;"></select> 36 <select class="form-control" name="subCompany" id="fgsdmLine" style="width: 140px;"></select>
37 - </div> --> 37 + </div>
38 <div style="display: inline-block;"> 38 <div style="display: inline-block;">
39 <span class="item-label" style="width: 80px;">线路: </span> 39 <span class="item-label" style="width: 80px;">线路: </span>
40 <select class="form-control" name="line" id="line" style="width: 180px;"></select> 40 <select class="form-control" name="line" id="line" style="width: 180px;"></select>
@@ -140,7 +140,7 @@ @@ -140,7 +140,7 @@
140 var date = $("#date").val(); 140 var date = $("#date").val();
141 var gsdmLine = $("#gsdmLine").val(); 141 var gsdmLine = $("#gsdmLine").val();
142 var fgsdmLine = $("#fgsdmLine").val(); 142 var fgsdmLine = $("#fgsdmLine").val();
143 - $post('/mcy_forms/linepasswengerflow',{/* gsdmLine:gsdmLine,fgsdmLine:fgsdmLine, */line:line,date:date,type:'query'},function(result){ 143 + $post('/mcy_forms/linepasswengerflow',{ gsdmLine:gsdmLine,fgsdmLine:fgsdmLine,line:line,date:date,type:'query'},function(result){
144 $.each(result, function(i, obj) { 144 $.each(result, function(i, obj) {
145 obj.requestType = reqCodeMap[obj.requestType]; 145 obj.requestType = reqCodeMap[obj.requestType];
146 }); 146 });
@@ -150,6 +150,16 @@ @@ -150,6 +150,16 @@
150 $('#forms tbody').html(tbodyHtml); 150 $('#forms tbody').html(tbodyHtml);
151 }); 151 });
152 }); 152 });
  153 +
  154 + $("#export").on("click",function(){
  155 + var line = $("#line").val();
  156 + var date = $("#date").val();
  157 + var gsdmLine = $("#gsdmLine").val();
  158 + var fgsdmLine = $("#fgsdmLine").val();
  159 + $post('/mcy_export/linepasswengerflowExport',{gsdmLine:gsdmLine,fgsdmLine:fgsdmLine,line:line,date:date,type:'export'},function(result){
  160 + window.open("/downloadFile/download?fileName=线路客流量报表"+moment(date).format("YYYYMMDD"));
  161 + });
  162 + });
153 }); 163 });
154 </script> 164 </script>
155 <script type="text/html" id="list_linepasswengerflow"> 165 <script type="text/html" id="list_linepasswengerflow">
src/main/resources/static/pages/forms/statement/operationservice.html
@@ -30,7 +30,7 @@ @@ -30,7 +30,7 @@
30 <div class="portlet light porttlet-fit bordered"> 30 <div class="portlet light porttlet-fit bordered">
31 <div class="portlet-title"> 31 <div class="portlet-title">
32 <form class="form-inline" action="" method="post"> 32 <form class="form-inline" action="" method="post">
33 - <!--<div style="display: inline-block; margin-left: 33px;" 33 + <div style="display: inline-block; margin-left: 33px;"
34 id="gsdmDiv_operat"> 34 id="gsdmDiv_operat">
35 <span class="item-label" style="width: 80px;">公司: </span> <select 35 <span class="item-label" style="width: 80px;">公司: </span> <select
36 class="form-control" name="company" id="gsdmOperat" 36 class="form-control" name="company" id="gsdmOperat"
@@ -41,7 +41,7 @@ @@ -41,7 +41,7 @@
41 <span class="item-label" style="width: 80px;">分公司: </span> <select 41 <span class="item-label" style="width: 80px;">分公司: </span> <select
42 class="form-control" name="subCompany" id="fgsdmOperat" 42 class="form-control" name="subCompany" id="fgsdmOperat"
43 style="width: 140px;"></select> 43 style="width: 140px;"></select>
44 - </div> --> 44 + </div>
45 <div style="display: inline-block;"> 45 <div style="display: inline-block;">
46 <span class="item-label" style="width: 80px;">线路: </span> <select 46 <span class="item-label" style="width: 80px;">线路: </span> <select
47 class="form-control" name="line" id="line" style="width: 180px;"></select> 47 class="form-control" name="line" id="line" style="width: 180px;"></select>
@@ -173,11 +173,11 @@ @@ -173,11 +173,11 @@
173 var startDate = $("#startDate").val(); 173 var startDate = $("#startDate").val();
174 var endDate = $("#endDate").val(); 174 var endDate = $("#endDate").val();
175 var lpName = $("#lpName").val(); 175 var lpName = $("#lpName").val();
176 - /* var gsdmOperat = $("#gsdmOperat").val();  
177 - var fgsdmOperat = $("#fgsdmOperat").val(); */ 176 + var gsdmOperat = $("#gsdmOperat").val();
  177 + var fgsdmOperat = $("#fgsdmOperat").val();
178 $post("/mcy_forms/operationservice", { 178 $post("/mcy_forms/operationservice", {
179 - /* gsdmOperat : gsdmOperat,  
180 - fgsdmOperat : fgsdmOperat, */ 179 + gsdmOperat : gsdmOperat,
  180 + fgsdmOperat : fgsdmOperat,
181 line : line, 181 line : line,
182 startDate : startDate, 182 startDate : startDate,
183 endDate : endDate, 183 endDate : endDate,
@@ -206,6 +206,18 @@ @@ -206,6 +206,18 @@
206 206
207 }); 207 });
208 }); 208 });
  209 + $("#export").on("click",function(){
  210 + line = $("#line").val();
  211 + startDate=$("#startDate").val();
  212 + endDate=$("#endDate").val();
  213 + gsdmOperat=$("#gsdmOperat").val();
  214 + fgsdmOperat=$("#fgsdmOperat").val();
  215 + $post('/mcy_export/operationserviceExport',{gsdmOperat:gsdmOperat,fgsdmOperat:fgsdmOperat,line:line,startDate:startDate,endDate:endDate,type:'export'},function(result){
  216 + window.open("/downloadFile/download?fileName=运营服务阶段报表"+moment(startDate).format("YYYYMMDD"));
  217 + });
  218 + });
  219 +
  220 +
209 }); 221 });
210 </script> 222 </script>
211 <script type="text/html" id="operationservice"> 223 <script type="text/html" id="operationservice">
src/main/resources/static/pages/forms/statement/shifday.html
@@ -28,14 +28,14 @@ @@ -28,14 +28,14 @@
28 <div class="portlet light porttlet-fit bordered"> 28 <div class="portlet light porttlet-fit bordered">
29 <div class="portlet-title"> 29 <div class="portlet-title">
30 <form class="form-inline" action="" method="post"> 30 <form class="form-inline" action="" method="post">
31 - <!-- <div style="display: inline-block; margin-left: 33px;" id="gsdmDiv_shif"> 31 + <div style="display: inline-block; margin-left: 33px;" id="gsdmDiv_shif">
32 <span class="item-label" style="width: 80px;">公司: </span> 32 <span class="item-label" style="width: 80px;">公司: </span>
33 <select class="form-control" name="company" id="gsdmShif" style="width: 140px;"></select> 33 <select class="form-control" name="company" id="gsdmShif" style="width: 140px;"></select>
34 </div> 34 </div>
35 <div style="display: inline-block; margin-left: 24px;" id="fgsdmDiv_shif"> 35 <div style="display: inline-block; margin-left: 24px;" id="fgsdmDiv_shif">
36 <span class="item-label" style="width: 80px;">分公司: </span> 36 <span class="item-label" style="width: 80px;">分公司: </span>
37 <select class="form-control" name="subCompany" id="fgsdmShif" style="width: 140px;"></select> 37 <select class="form-control" name="subCompany" id="fgsdmShif" style="width: 140px;"></select>
38 - </div> --> 38 + </div>
39 <div style="display: inline-block;"> 39 <div style="display: inline-block;">
40 <span class="item-label" style="width: 80px;">线路: </span> 40 <span class="item-label" style="width: 80px;">线路: </span>
41 <select class="form-control" name="line" id="line" style="width: 180px;"></select> 41 <select class="form-control" name="line" id="line" style="width: 180px;"></select>
@@ -154,9 +154,9 @@ $(function(){ @@ -154,9 +154,9 @@ $(function(){
154 $("#query").on("click",function(){ 154 $("#query").on("click",function(){
155 var line = $("#line").val(); 155 var line = $("#line").val();
156 var date = $("#date").val(); 156 var date = $("#date").val();
157 - /* var gsdmShif = $("#gsdmShif").val();  
158 - var fgsdmShif = $("#fgsdmShif").val(); */  
159 - $post('/mcy_forms/shifday',{/* gsdmShif:gsdmShif,fgsdmShif:fgsdmShif, */line:line,date:date},function(result){ 157 + var gsdmShif = $("#gsdmShif").val();
  158 + var fgsdmShif = $("#fgsdmShif").val();
  159 + $post('/mcy_forms/shifday',{gsdmShif:gsdmShif,fgsdmShif:fgsdmShif, line:line,date:date},function(result){
160 $.each(result, function(i, obj) { 160 $.each(result, function(i, obj) {
161 obj.requestType = reqCodeMap[obj.requestType]; 161 obj.requestType = reqCodeMap[obj.requestType];
162 }); 162 });
@@ -166,6 +166,16 @@ $(function(){ @@ -166,6 +166,16 @@ $(function(){
166 $('#forms tbody').html(tbodyHtml); 166 $('#forms tbody').html(tbodyHtml);
167 }); 167 });
168 }); 168 });
  169 +
  170 + $("#export").on("click",function(){
  171 + var line = $("#line").val();
  172 + var date = $("#date").val();
  173 + var gsdmShif = $("#gsdmShif").val();
  174 + var fgsdmShif = $("#fgsdmShif").val();
  175 + $post('/mcy_export/shifdayExport',{gsdmShif:gsdmShif,fgsdmShif:fgsdmShif,line:line,date:date,type:'export'},function(result){
  176 + window.open("/downloadFile/download?fileName=班次车辆人员日报表"+moment(date).format("YYYYMMDD"));
  177 + });
  178 + });
169 }); 179 });
170 </script> 180 </script>
171 <script type="text/html" id="shifday"> 181 <script type="text/html" id="shifday">
@@ -175,7 +185,6 @@ $(function(){ @@ -175,7 +185,6 @@ $(function(){
175 <td>{{obj.sName}}</td> 185 <td>{{obj.sName}}</td>
176 <td>{{obj.lpName}}</td> 186 <td>{{obj.lpName}}</td>
177 <td>{{obj.carPlate}}</td> 187 <td>{{obj.carPlate}}</td>
178 -  
179 <td>{{obj.jhlc}}</td> 188 <td>{{obj.jhlc}}</td>
180 <td>{{obj.sjjhlc}}</td> 189 <td>{{obj.sjjhlc}}</td>
181 <td>{{obj.yygl}}</td> 190 <td>{{obj.yygl}}</td>
src/main/resources/static/pages/forms/statement/shiftuehiclemanth.html
@@ -28,14 +28,14 @@ @@ -28,14 +28,14 @@
28 <div class="portlet light porttlet-fit bordered"> 28 <div class="portlet light porttlet-fit bordered">
29 <div class="portlet-title"> 29 <div class="portlet-title">
30 <form class="form-inline" action=""> 30 <form class="form-inline" action="">
31 - <!-- <div style="display: inline-block; margin-left: 33px;" id="gsdmDiv_manth"> 31 + <div style="display: inline-block; margin-left: 33px;" id="gsdmDiv_manth">
32 <span class="item-label" style="width: 80px;">公司: </span> 32 <span class="item-label" style="width: 80px;">公司: </span>
33 <select class="form-control" name="company" id="gsdmManth" style="width: 140px;"></select> 33 <select class="form-control" name="company" id="gsdmManth" style="width: 140px;"></select>
34 </div> 34 </div>
35 <div style="display: inline-block; margin-left: 24px;" id="fgsdmDiv_manth"> 35 <div style="display: inline-block; margin-left: 24px;" id="fgsdmDiv_manth">
36 <span class="item-label" style="width: 80px;">分公司: </span> 36 <span class="item-label" style="width: 80px;">分公司: </span>
37 <select class="form-control" name="subCompany" id="fgsdmManth" style="width: 140px;"></select> 37 <select class="form-control" name="subCompany" id="fgsdmManth" style="width: 140px;"></select>
38 - </div> --> 38 + </div>
39 <div style="display: inline-block;"> 39 <div style="display: inline-block;">
40 <span class="item-label" style="width: 80px;">线路: </span> 40 <span class="item-label" style="width: 80px;">线路: </span>
41 <select class="form-control" name="line" id="line" style="width: 136px;"></select> 41 <select class="form-control" name="line" id="line" style="width: 136px;"></select>
@@ -183,9 +183,9 @@ @@ -183,9 +183,9 @@
183 var startDate = $("#startDate").val(); 183 var startDate = $("#startDate").val();
184 var endDate = $("#endDate").val(); 184 var endDate = $("#endDate").val();
185 var lpName = $("#lpName").val(); 185 var lpName = $("#lpName").val();
186 - /* var gsdmManth= $("#gsdmManth").val();  
187 - var fgsdmManth= $("#fgsdmManth").val(); */  
188 - $post("/mcy_forms/shiftuehiclemanth",{/* gsdmManth:gsdmManth,fgsdmManth:fgsdmManth, */line:line,startDate:startDate,endDate:endDate ,lpName:lpName},function(result){ 186 + var gsdmManth= $("#gsdmManth").val();
  187 + var fgsdmManth= $("#fgsdmManth").val();
  188 + $post("/mcy_forms/shiftuehiclemanth",{gsdmManth:gsdmManth,fgsdmManth:fgsdmManth, line:line,startDate:startDate,endDate:endDate ,lpName:lpName},function(result){
189 $("#sDate").text(startDate); 189 $("#sDate").text(startDate);
190 $("#eDate").text(endDate); 190 $("#eDate").text(endDate);
191 var temp = {}; 191 var temp = {};
@@ -203,7 +203,20 @@ @@ -203,7 +203,20 @@
203 $('#forms tbody').html(list_shiftuehiclemanth); 203 $('#forms tbody').html(list_shiftuehiclemanth);
204 204
205 }); 205 });
206 - }); 206 + });
  207 +
  208 + $("#export").on("click",function(){
  209 + var line = $("#line").val();
  210 + var startDate = $("#startDate").val();
  211 + var endDate = $("#endDate").val();
  212 + var lpName = $("#lpName").val();
  213 + var gsdmManth= $("#gsdmManth").val();
  214 + var fgsdmManth= $("#fgsdmManth").val();
  215 + $post('/mcy_export/shiftuehiclemanthExport',{gsdmManth:gsdmManth,fgsdmManth:fgsdmManth,line:line,startDate:startDate,endDate:endDate,type:'export'},function(result){
  216 + window.open("/downloadFile/download?fileName=班次车辆人员月报表"+moment(startDate).format("YYYYMMDD"));
  217 + });
  218 + });
  219 +
207 }); 220 });
208 </script> 221 </script>
209 <script type="text/html" id="list_shiftuehiclemanth"> 222 <script type="text/html" id="list_shiftuehiclemanth">
src/main/resources/static/pages/forms/statement/singledata.html
@@ -28,14 +28,14 @@ @@ -28,14 +28,14 @@
28 <div class="portlet light porttlet-fit bordered"> 28 <div class="portlet light porttlet-fit bordered">
29 <div class="portlet-title"> 29 <div class="portlet-title">
30 <form class="form-inline" action=""> 30 <form class="form-inline" action="">
31 - <!-- <div style="display: inline-block; margin-left: 33px;" id="gsdmDiv_sing"> 31 + <div style="display: inline-block; margin-left: 33px;" id="gsdmDiv_sing">
32 <span class="item-label" style="width: 80px;">公司: </span> 32 <span class="item-label" style="width: 80px;">公司: </span>
33 <select class="form-control" name="company" id="gsdmSing" style="width: 140px;"></select> 33 <select class="form-control" name="company" id="gsdmSing" style="width: 140px;"></select>
34 </div> 34 </div>
35 <div style="display: inline-block; margin-left: 24px;" id="fgsdmDiv_sing"> 35 <div style="display: inline-block; margin-left: 24px;" id="fgsdmDiv_sing">
36 <span class="item-label" style="width: 80px;">分公司: </span> 36 <span class="item-label" style="width: 80px;">分公司: </span>
37 <select class="form-control" name="subCompany" id="fgsdmSing" style="width: 140px;"></select> 37 <select class="form-control" name="subCompany" id="fgsdmSing" style="width: 140px;"></select>
38 - </div> --> 38 + </div>
39 <div style="display: inline-block;"> 39 <div style="display: inline-block;">
40 <span class="item-label" style="width: 80px;">线路: </span> 40 <span class="item-label" style="width: 80px;">线路: </span>
41 <select class="form-control" name="line" id="line" style="width: 136px;"></select> 41 <select class="form-control" name="line" id="line" style="width: 136px;"></select>
@@ -152,9 +152,9 @@ @@ -152,9 +152,9 @@
152 var startDate = $("#startDate").val(); 152 var startDate = $("#startDate").val();
153 var endDate = $("#endDate").val(); 153 var endDate = $("#endDate").val();
154 var lpName = $("#lpName").val(); 154 var lpName = $("#lpName").val();
155 - /* var gsdmSing = $("#gsdmSing").val();  
156 - var fgsdmSing = $("#fgsdmSing").val(); */  
157 - $post("/mcy_forms/singledata",{/* gsdmSing:gsdmSing,fgsdmSing:fgsdmSing, */line:line,startDate:startDate,endDate:endDate ,lpName:lpName},function(result){ 155 + var gsdmSing = $("#gsdmSing").val();
  156 + var fgsdmSing = $("#fgsdmSing").val();
  157 + $post("/mcy_forms/singledata",{ gsdmSing:gsdmSing,fgsdmSing:fgsdmSing, line:line,startDate:startDate,endDate:endDate ,lpName:lpName},function(result){
158 $("#sDate").text(startDate); 158 $("#sDate").text(startDate);
159 $("#eDate").text(endDate); 159 $("#eDate").text(endDate);
160 var temp = {}; 160 var temp = {};
@@ -172,6 +172,18 @@ @@ -172,6 +172,18 @@
172 172
173 }); 173 });
174 }); 174 });
  175 +
  176 + $("#export").on("click",function(){
  177 + var line = $("#line").val();
  178 + var startDate = $("#startDate").val();
  179 + var endDate = $("#endDate").val();
  180 + var lpName = $("#lpName").val();
  181 + var gsdmSing = $("#gsdmSing").val();
  182 + var fgsdmSing = $("#fgsdmSing").val();
  183 + $post('/mcy_export/singledataExport',{gsdmSing:gsdmSing,fgsdmSing:fgsdmSing,line:line,startDate:startDate,endDate:endDate,type:'export'},function(result){
  184 + window.open("/downloadFile/download?fileName=路单数据"+moment(startDate).format("YYYYMMDD"));
  185 + });
  186 + });
175 }); 187 });
176 </script> 188 </script>
177 <script type="text/html" id="singledata"> 189 <script type="text/html" id="singledata">
src/main/resources/static/pages/forms/statement/turnoutrate.html
@@ -37,14 +37,14 @@ @@ -37,14 +37,14 @@
37 <div class="portlet light porttlet-fit bordered"> 37 <div class="portlet light porttlet-fit bordered">
38 <div class="portlet-title"> 38 <div class="portlet-title">
39 <form class="form-inline" action="" method="post"> 39 <form class="form-inline" action="" method="post">
40 - <!-- <div style="display: inline-block; margin-left: 33px;" id="gsdmDiv_turn"> 40 + <div style="display: inline-block; margin-left: 33px;" id="gsdmDiv_turn">
41 <span class="item-label" style="width: 80px;">公司: </span> 41 <span class="item-label" style="width: 80px;">公司: </span>
42 <select class="form-control" name="company" id="gsdmTurn" style="width: 140px;"></select> 42 <select class="form-control" name="company" id="gsdmTurn" style="width: 140px;"></select>
43 </div> 43 </div>
44 <div style="display: inline-block; margin-left: 24px;" id="fgsdmDiv_turn"> 44 <div style="display: inline-block; margin-left: 24px;" id="fgsdmDiv_turn">
45 <span class="item-label" style="width: 80px;">分公司: </span> 45 <span class="item-label" style="width: 80px;">分公司: </span>
46 <select class="form-control" name="subCompany" id="fgsdmTurn" style="width: 140px;"></select> 46 <select class="form-control" name="subCompany" id="fgsdmTurn" style="width: 140px;"></select>
47 - </div> --> 47 + </div>
48 <div style="display: inline-block;"> 48 <div style="display: inline-block;">
49 <span class="item-label" style="width: 80px;">线路: </span> 49 <span class="item-label" style="width: 80px;">线路: </span>
50 <select class="form-control" name="line" id="line" style="width: 120px;"></select> 50 <select class="form-control" name="line" id="line" style="width: 120px;"></select>
@@ -183,7 +183,7 @@ @@ -183,7 +183,7 @@
183 gsdmTurn=$("#gsdmTurn").val(); 183 gsdmTurn=$("#gsdmTurn").val();
184 fgsdmTurn=$("#fgsdmTurn").val(); 184 fgsdmTurn=$("#fgsdmTurn").val();
185 if(startDate1!=''&&endDate1!=''){ 185 if(startDate1!=''&&endDate1!=''){
186 - $post('/mcy_forms/turnoutrate',{/* gsdmTurn:gsdmTurn,fgsdmTurn:fgsdmTurn, */line:line,startDate:$("#startDate").val(),endDate:$("#endDate").val(),type:'query'},function(result){ 186 + $post('/mcy_forms/turnoutrate',{ gsdmTurn:gsdmTurn,fgsdmTurn:fgsdmTurn, line:line,startDate:$("#startDate").val(),endDate:$("#endDate").val(),type:'query'},function(result){
187 // 把数据填充到模版中 187 // 把数据填充到模版中
188 var tbodyHtml = template('turnoutrate',{list:result}); 188 var tbodyHtml = template('turnoutrate',{list:result});
189 // 把渲染好的模版html文本追加到表格中 189 // 把渲染好的模版html文本追加到表格中
@@ -243,7 +243,12 @@ @@ -243,7 +243,12 @@
243 }); 243 });
244 244
245 $("#export").on("click",function(){ 245 $("#export").on("click",function(){
246 - $post('/mcy_export/turnoutrateExport',{line:line,startDate:startDate,endDate:endDate,type:'export'},function(result){ 246 + line = $("#line").val();
  247 + startDate=$("#startDate").val();
  248 + endDate=$("#endDate").val();
  249 + gsdmTurn=$("#gsdmTurn").val();
  250 + fgsdmTurn=$("#fgsdmTurn").val();
  251 + $post('/mcy_export/turnoutrateExport',{gsdmTurn:gsdmTurn,fgsdmTurn:fgsdmTurn,line:line,startDate:startDate,endDate:endDate,type:'export'},function(result){
247 window.open("/downloadFile/download?fileName=营运线路出车率统计表"+moment(startDate).format("YYYYMMDD")); 252 window.open("/downloadFile/download?fileName=营运线路出车率统计表"+moment(startDate).format("YYYYMMDD"));
248 }); 253 });
249 }); 254 });
src/main/resources/static/pages/forms/statement/vehicleloading.html
@@ -19,7 +19,7 @@ @@ -19,7 +19,7 @@
19 19
20 <div class="page-head"> 20 <div class="page-head">
21 <div class="page-title"> 21 <div class="page-title">
22 - <h1>车辆加注/消耗量</h1> 22 + <h1>车辆加注</h1>
23 </div> 23 </div>
24 </div> 24 </div>
25 25
@@ -28,14 +28,14 @@ @@ -28,14 +28,14 @@
28 <div class="portlet light porttlet-fit bordered"> 28 <div class="portlet light porttlet-fit bordered">
29 <div class="portlet-title"> 29 <div class="portlet-title">
30 <form class="form-inline" action="" method="post"> 30 <form class="form-inline" action="" method="post">
31 - <!-- <div style="display: inline-block; margin-left: 33px;" id="gsdmDiv_vehic"> 31 + <div style="display: inline-block; margin-left: 33px;" id="gsdmDiv_vehic">
32 <span class="item-label" style="width: 80px;">公司: </span> 32 <span class="item-label" style="width: 80px;">公司: </span>
33 <select class="form-control" name="company" id="gsdmVehic" style="width: 140px;"></select> 33 <select class="form-control" name="company" id="gsdmVehic" style="width: 140px;"></select>
34 </div> 34 </div>
35 <div style="display: inline-block; margin-left: 24px;" id="fgsdmDiv_vehic"> 35 <div style="display: inline-block; margin-left: 24px;" id="fgsdmDiv_vehic">
36 <span class="item-label" style="width: 80px;">分公司: </span> 36 <span class="item-label" style="width: 80px;">分公司: </span>
37 <select class="form-control" name="subCompany" id="fgsdmVehic" style="width: 140px;"></select> 37 <select class="form-control" name="subCompany" id="fgsdmVehic" style="width: 140px;"></select>
38 - </div> --> 38 + </div>
39 <div style="display: inline-block;"> 39 <div style="display: inline-block;">
40 <span class="item-label" style="width: 80px;">线路: </span> 40 <span class="item-label" style="width: 80px;">线路: </span>
41 <select class="form-control" name="line" id="line" style="width: 180px;"></select> 41 <select class="form-control" name="line" id="line" style="width: 180px;"></select>
@@ -135,18 +135,32 @@ @@ -135,18 +135,32 @@
135 }) 135 })
136 136
137 137
  138 + var line ;
  139 + var date ;
  140 + var gsdmVehic ;
  141 + var fgsdmVehic ;
138 $("#query").on("click",function(){ 142 $("#query").on("click",function(){
139 - var line = $("#line").val();  
140 - var date = $("#date").val();  
141 - /* var gsdmVehic = $("#gsdmVehic").val();  
142 - var fgsdmVehic = $("#fgsdmVehic").val(); */  
143 - $post('/mcy_forms/vehicleloading',{line:line,data:date},function(result){ 143 + line = $("#line").val();
  144 + date = $("#date").val();
  145 + gsdmVehic = $("#gsdmVehic").val();
  146 + fgsdmVehic = $("#fgsdmVehic").val();
  147 + $post('/mcy_forms/vehicleloading',{line:line,data:date, gsdmVehic: gsdmVehic,fgsdmVehic:fgsdmVehic},function(result){
144 // 把数据填充到模版中 148 // 把数据填充到模版中
145 var tbodyHtml = template('vehicleloading',{list:result}); 149 var tbodyHtml = template('vehicleloading',{list:result});
146 // 把渲染好的模版html文本追加到表格中 150 // 把渲染好的模版html文本追加到表格中
147 $('#forms tbody').html(tbodyHtml); 151 $('#forms tbody').html(tbodyHtml);
148 }); 152 });
149 - }); 153 + });
  154 +
  155 + $("#export").on("click",function(){
  156 + line = $("#line").val();
  157 + date = $("#date").val();
  158 + gsdmVehic = $("#gsdmVehic").val();
  159 + fgsdmVehic = $("#fgsdmVehic").val();
  160 + $post('/mcy_export/vehicleloadingExport',{line:line,data:date,gsdmVehic: gsdmVehic,fgsdmVehic:fgsdmVehic,type:'export'},function(result){
  161 + window.open("/downloadFile/download?fileName=车辆加注"+moment(date).format("YYYYMMDD"));
  162 + });
  163 + });
150 }); 164 });
151 </script> 165 </script>
152 <script type="text/html" id="vehicleloading"> 166 <script type="text/html" id="vehicleloading">
@@ -157,8 +171,8 @@ @@ -157,8 +171,8 @@
157 <td>{{obj.gS}}</td> 171 <td>{{obj.gS}}</td>
158 <td>{{obj.xL}}</td> 172 <td>{{obj.xL}}</td>
159 <td>{{obj.clzbh}}</td> 173 <td>{{obj.clzbh}}</td>
  174 + <td>{{obj.jzl}}</td>
160 <td>{{obj.hyl}}</td> 175 <td>{{obj.hyl}}</td>
161 - <td>{{obj.jzl}}</td>  
162 <td> </td> 176 <td> </td>
163 <td>{{obj.jhlc}}</td> 177 <td>{{obj.jhlc}}</td>
164 <td> </td> 178 <td> </td>
src/main/resources/static/pages/forms/statement/waybillday.html
@@ -28,14 +28,14 @@ @@ -28,14 +28,14 @@
28 <div class="portlet light porttlet-fit bordered"> 28 <div class="portlet light porttlet-fit bordered">
29 <div class="portlet-title"> 29 <div class="portlet-title">
30 <form class="form-inline" action="" method="post"> 30 <form class="form-inline" action="" method="post">
31 - <!-- <div style="display: inline-block; margin-left: 33px;" id="gsdmDiv_waybillday"> 31 + <div style="display: inline-block; margin-left: 33px;" id="gsdmDiv_waybillday">
32 <span class="item-label" style="width: 80px;">公司: </span> 32 <span class="item-label" style="width: 80px;">公司: </span>
33 <select class="form-control" name="company" id="gsdmWaybillday" style="width: 140px;"></select> 33 <select class="form-control" name="company" id="gsdmWaybillday" style="width: 140px;"></select>
34 </div> 34 </div>
35 <div style="display: inline-block; margin-left: 24px;" id="fgsdmDiv_waybillday"> 35 <div style="display: inline-block; margin-left: 24px;" id="fgsdmDiv_waybillday">
36 <span class="item-label" style="width: 80px;">分公司: </span> 36 <span class="item-label" style="width: 80px;">分公司: </span>
37 <select class="form-control" name="subCompany" id="fgsdmWaybillday" style="width: 140px;"></select> 37 <select class="form-control" name="subCompany" id="fgsdmWaybillday" style="width: 140px;"></select>
38 - </div> --> 38 + </div>
39 <div style="display: inline-block;"> 39 <div style="display: inline-block;">
40 <span class="item-label" style="width: 80px;">线路: </span> 40 <span class="item-label" style="width: 80px;">线路: </span>
41 <select class="form-control" name="line" id="line" style="width: 180px;"></select> 41 <select class="form-control" name="line" id="line" style="width: 180px;"></select>
@@ -142,7 +142,7 @@ @@ -142,7 +142,7 @@
142 gsdmWaybillday=$("#gsdmWaybillday").val(); 142 gsdmWaybillday=$("#gsdmWaybillday").val();
143 fgsdmWaybillday = $("#fgsdmWaybillday").val(); 143 fgsdmWaybillday = $("#fgsdmWaybillday").val();
144 144
145 - $post('/mcy_forms/waybillday',{/* gsdmWaybillday:gsdmWaybillday,fgsdmWaybillday:fgsdmWaybillday, */line:line,date:$("#date").val(),type:'query'},function(result){ 145 + $post('/mcy_forms/waybillday',{gsdmWaybillday:gsdmWaybillday,fgsdmWaybillday:fgsdmWaybillday, line:line,date:$("#date").val(),type:'query'},function(result){
146 $.each(result, function(i, obj) { 146 $.each(result, function(i, obj) {
147 obj.requestType = reqCodeMap[obj.requestType]; 147 obj.requestType = reqCodeMap[obj.requestType];
148 }); 148 });
@@ -154,7 +154,11 @@ @@ -154,7 +154,11 @@
154 }); 154 });
155 155
156 $("#export").on("click",function(){ 156 $("#export").on("click",function(){
157 - $post('/mcy_export/waybilldayExport',{line:line,date:date,type:'export'},function(result){ 157 + line = $("#line").val();
  158 + date = $("#date").val();
  159 + gsdmWaybillday=$("#gsdmWaybillday").val();
  160 + fgsdmWaybillday = $("#fgsdmWaybillday").val();
  161 + $post('/mcy_export/waybilldayExport',{gsdmWaybillday:gsdmWaybillday,fgsdmWaybillday:fgsdmWaybillday,line:line,date:date,type:'export'},function(result){
158 window.open("/downloadFile/download?fileName=行车路单日报表"+moment(date).format("YYYYMMDD")); 162 window.open("/downloadFile/download?fileName=行车路单日报表"+moment(date).format("YYYYMMDD"));
159 }); 163 });
160 }); 164 });
src/main/resources/static/real_control_v2/assets/plugins/uikit-2.27.1/components/progress.gradient.min.css
1 -/*! UIkit 2.27.1 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ 1 +/*! UIkit 2.27.1 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
2 .uk-progress{box-sizing:border-box;height:20px;margin-bottom:15px;background:#f7f7f7;overflow:hidden;line-height:20px;box-shadow:inset 0 0 0 1px rgba(0,0,0,.07),inset 0 2px 2px rgba(0,0,0,.07);border-radius:4px}*+.uk-progress{margin-top:15px}.uk-progress-bar{width:0;height:100%;background:#009dd8;float:left;-webkit-transition:width .6s ease;transition:width .6s ease;font-size:12px;color:#fff;text-align:center;background-image:-webkit-linear-gradient(top,#00b4f5,#008dc5);background-image:linear-gradient(to bottom,#00b4f5,#008dc5);box-shadow:inset 0 -1px 0 rgba(0,0,0,.2),inset 0 0 0 1px rgba(0,0,0,.1);text-shadow:0 -1px 0 rgba(0,0,0,.2)}.uk-progress-mini{height:6px}.uk-progress-small{height:12px}.uk-progress-success .uk-progress-bar{background-color:#82bb42;background-image:-webkit-linear-gradient(top,#9fd256,#6fac34);background-image:linear-gradient(to bottom,#9fd256,#6fac34)}.uk-progress-warning .uk-progress-bar{background-color:#f9a124;background-image:-webkit-linear-gradient(top,#fbb450,#f89406);background-image:linear-gradient(to bottom,#fbb450,#f89406)}.uk-progress-danger .uk-progress-bar{background-color:#d32c46;background-image:-webkit-linear-gradient(top,#ee465a,#c11a39);background-image:linear-gradient(to bottom,#ee465a,#c11a39)}.uk-progress-striped .uk-progress-bar{background-image:-webkit-linear-gradient(-45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(-45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-size:30px 30px}.uk-progress-striped.uk-active .uk-progress-bar{-webkit-animation:uk-progress-bar-stripes 2s linear infinite;animation:uk-progress-bar-stripes 2s linear infinite}@-webkit-keyframes uk-progress-bar-stripes{0%{background-position:0 0}100%{background-position:30px 0}}@keyframes uk-progress-bar-stripes{0%{background-position:0 0}100%{background-position:30px 0}}.uk-progress-mini,.uk-progress-small{border-radius:500px} 2 .uk-progress{box-sizing:border-box;height:20px;margin-bottom:15px;background:#f7f7f7;overflow:hidden;line-height:20px;box-shadow:inset 0 0 0 1px rgba(0,0,0,.07),inset 0 2px 2px rgba(0,0,0,.07);border-radius:4px}*+.uk-progress{margin-top:15px}.uk-progress-bar{width:0;height:100%;background:#009dd8;float:left;-webkit-transition:width .6s ease;transition:width .6s ease;font-size:12px;color:#fff;text-align:center;background-image:-webkit-linear-gradient(top,#00b4f5,#008dc5);background-image:linear-gradient(to bottom,#00b4f5,#008dc5);box-shadow:inset 0 -1px 0 rgba(0,0,0,.2),inset 0 0 0 1px rgba(0,0,0,.1);text-shadow:0 -1px 0 rgba(0,0,0,.2)}.uk-progress-mini{height:6px}.uk-progress-small{height:12px}.uk-progress-success .uk-progress-bar{background-color:#82bb42;background-image:-webkit-linear-gradient(top,#9fd256,#6fac34);background-image:linear-gradient(to bottom,#9fd256,#6fac34)}.uk-progress-warning .uk-progress-bar{background-color:#f9a124;background-image:-webkit-linear-gradient(top,#fbb450,#f89406);background-image:linear-gradient(to bottom,#fbb450,#f89406)}.uk-progress-danger .uk-progress-bar{background-color:#d32c46;background-image:-webkit-linear-gradient(top,#ee465a,#c11a39);background-image:linear-gradient(to bottom,#ee465a,#c11a39)}.uk-progress-striped .uk-progress-bar{background-image:-webkit-linear-gradient(-45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(-45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-size:30px 30px}.uk-progress-striped.uk-active .uk-progress-bar{-webkit-animation:uk-progress-bar-stripes 2s linear infinite;animation:uk-progress-bar-stripes 2s linear infinite}@-webkit-keyframes uk-progress-bar-stripes{0%{background-position:0 0}100%{background-position:30px 0}}@keyframes uk-progress-bar-stripes{0%{background-position:0 0}100%{background-position:30px 0}}.uk-progress-mini,.uk-progress-small{border-radius:500px}
3 \ No newline at end of file 3 \ No newline at end of file
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/sub_task/station_route_spacing_chart.html
1 -<!-- 站点路由间距图 -->  
2 -<a class="ct-bottom-drawer-close" style="right: calc(20% + 10px);"></a>  
3 -<div id="station_route_spacing_chart_drawer" style="width: 100%;height: 100%;font-size: 0;">  
4 - <div class="tl_desc_text" style="z-index: 999;">  
5 - (鼠标滚轮滚动)单位:米 | <a class="delete_route_spacing_link" style="color: red;">删除</a>  
6 - </div>  
7 - <div class="svg_wrap"></div>  
8 -  
9 - <div class="drawer_right_map" >  
10 -  
11 - </div>  
12 -  
13 - <script>  
14 -  
15 - (function () {  
16 - var drawer = '#station_route_spacing_chart_drawer'  
17 - , sch, locData, stationArr, len;  
18 - var cy = 120;  
19 - var tCy = cy - 15;  
20 - //站点marker对照  
21 - var map, markers = {};  
22 -  
23 - $('.delete_route_spacing_link', drawer).on('click', function () {  
24 - alt_confirm('确定要删除【'+sch.xlName+'】基于空间坐标计算的站间距数据?', function () {  
25 - window.localStorage.removeItem('control_route_distance_' + sch.xlBm);  
26 - $(drawer).parents('.uk-modal').trigger('refresh_station_space');  
27 - toGeoCalcPage();  
28 - }, '确定删除');  
29 - });  
30 -  
31 - $(drawer).on('drawer-init', function (e, data) {  
32 - sch = data.sch;  
33 - locData = window.localStorage.getItem('control_route_distance_' + sch.xlBm);  
34 -  
35 - if(locData)  
36 - drawCharts();  
37 - else{  
38 - toGeoCalcPage();  
39 - return;  
40 - }  
41 -  
42 - setTimeout(initMap, 800);  
43 - });  
44 -  
45 - function initMap() {  
46 - //初始化地图  
47 - map = new BMap.Map($('.drawer_right_map', drawer)[0]);  
48 - //中心点和缩放级别  
49 - map.centerAndZoom(new BMap.Point(121.544336, 31.221315), 15);  
50 - map.enableScrollWheelZoom();  
51 -  
52 - //绘制线路  
53 - var routes = JSON.parse(locData).sections[sch.xlDir==0?'up':'down'];  
54 -  
55 - var pos = [], bdCoord;  
56 - $.each(routes, function () {  
57 - bdCoord = TransGPS.wgsToBD(this.latitude, this.longitude);  
58 - pos.push(new BMap.Point(bdCoord.lng, bdCoord.lat));  
59 - });  
60 -  
61 - var polyline = new BMap.Polyline(pos, {strokeWeight:6, strokeColor: 'blue'});  
62 - map.addOverlay(polyline);  
63 -  
64 - //绘制站点  
65 - var station;  
66 - $.each(stationArr, function () {  
67 - station=this.station;  
68 - bdCoord = TransGPS.wgsToBD(station.G_LATY, station.G_LONX);  
69 -  
70 - var point = new BMap.Point(bdCoord.lng, bdCoord.lat);  
71 - var marker = new BMap.Marker(point);  
72 -  
73 - //根据站点名称 计算marker 宽度  
74 - var w = station.STATION_NAME.length * 12 + 4;  
75 - station.stationName = station.STATION_NAME;  
76 - station.directions = station.DIRECTIONS;  
77 - var icon = new BMap.Icon(gb_map_imap.createStationIcon(station, w), new BMap.Size(w-2,24), {anchor: new BMap.Size((w-2)/2,24)})  
78 - marker.setIcon(icon);  
79 -  
80 - map.addOverlay(marker);  
81 - markers[station.STATION_CODE] = marker;  
82 - });  
83 -  
84 - autoPosition();  
85 - }  
86 -  
87 - function drawCharts() {  
88 - try {  
89 - stationArr = JSON.parse(locData).stations[sch.xlDir == 0 ? 'up' : 'down'];  
90 - }catch (e){  
91 - alert('数据异常!!');  
92 - return;  
93 - }  
94 -  
95 - //console.log('locData...', JSON.parse(locData));  
96 - len = stationArr.length;  
97 - var width = cx(len - 1) + 20;  
98 - var svgCont = $('<div style="width: '+width+'px;" class="svg_cont_body"></div>');  
99 - var svg = d3.select(svgCont[0]).append('svg').classed({down: sch.xlDir==0?false:true});  
100 -  
101 - //初始化 X 比例尺  
102 - var sum=0;  
103 - $.each(stationArr, function () {  
104 - sum += this.toDistance;  
105 - });  
106 -  
107 - var items = svg.selectAll('g._item').data(stationArr)  
108 - .enter()  
109 - .append('g')  
110 - .attr('data-code', function (d) {  
111 - return d.station.STATION_CODE;  
112 - })  
113 - .classed({_item: true});  
114 -  
115 - //rect  
116 - items.append('rect').attr('x', xScale).attr('y', cy);  
117 - //text  
118 - items.append('text').attr('x', xScale).attr('y', cy)  
119 - .text(stationText).attr('title', stationText);  
120 -  
121 - //path  
122 - items.append('path').attr('d', function (d, i) {  
123 - return i>=len-1?'':line([i , i + 1]);  
124 - });  
125 -  
126 - //上弧线  
127 - items.append('path').classed({arc_path: true}).attr('d', route_arc_path);  
128 -  
129 - //path circle  
130 - items.append('circle').attr('cx', function (d, i) {  
131 - return cx(i);  
132 - }).attr('cy', tCy);  
133 -  
134 - //站距  
135 - items.filter(secFilter).append('rect')  
136 - .attr('x', function (d, i) {  
137 - return cx(i) - 6;  
138 - })  
139 - .attr('y', tCy - 42)  
140 - .classed({distance_rect: true})  
141 - .style('transform', distTranslate);  
142 -  
143 - items.filter(secFilter).append('text')  
144 - .attr('x', xScale)  
145 - .attr('y', tCy - 26)  
146 - .text(function (d, i) {  
147 - return d.toDistance;  
148 - })  
149 - .classed({distance_text: true})  
150 - .style('transform', distTranslate);  
151 -  
152 - $('.svg_wrap', drawer).append(svgCont);  
153 - }  
154 -  
155 - var xpdd = 20;  
156 - //var halfWidth = 15;  
157 - var xScale = function (d, i) {  
158 - return cx(i);  
159 - };  
160 -  
161 - var cx = function (i) {  
162 - var sum=0;  
163 - for(var j = 0; j <= i; j++){  
164 - sum+=stationArr[j].toDistance;  
165 - }  
166 - return sum / 2.5 + xpdd;  
167 - };  
168 -  
169 - var stationText = function (d) {  
170 - return d.station['STATION_NAME'];  
171 - };  
172 -  
173 - var line = d3.svg.line().x(cx).y(tCy);  
174 -  
175 - var route_arc_path = function (d, i) {  
176 - if(i >= len - 1) return;  
177 - var x1 = cx(i);  
178 - var x2 = cx(i + 1);  
179 -  
180 - var c1 = (x1 + (x2 - x1) / 3) + ' ' + (tCy - 40);  
181 - var c2 = (x2 - (x2 - x1) / 3) +' '+ (tCy - 40);  
182 -  
183 - return 'M'+x1+' '+tCy+' C '+ c1 +', '+ c2 +', '+ x2 +' '+tCy;  
184 - };  
185 -  
186 - var secFilter = function (d, i) {  
187 - return i > 0;  
188 - };  
189 -  
190 - //地图定位  
191 - var posMarker, posing=false;  
192 - function autoPosition() {  
193 - var left = Math.abs(parseInt($('.svg_cont_body', drawer).css('left').replace('px', '')));  
194 -  
195 - var g;  
196 - $('svg g._item text', drawer).each(function () {  
197 - if($(this).attr('x') > left){  
198 - g = $(this).parent();  
199 - return false;  
200 - }  
201 - });  
202 - posMarker = markers[g.data('code')];  
203 -  
204 - if(posing) return;  
205 - posing = true;  
206 - setTimeout(function () {  
207 - map.panTo(posMarker.point/*, {noAnimation: true}*/);  
208 - posing = false;  
209 - }, 500);  
210 - }  
211 -  
212 - var distTranslate = function (d, i) {  
213 - return 'translate('+(d.toDistance / 2.5 / 2 - 16)+'px, 0px)';  
214 - };  
215 -  
216 - function toGeoCalcPage() {  
217 - drawerLoadPage('/real_control_v2/fragments/geo/calc_station_space.html','cal_station_space_drawer');  
218 - }  
219 -  
220 - //页面切换  
221 - function drawerLoadPage(url, id) {  
222 - $(drawer).parent('.ct-bottom-drawer-body').load(url, function () {  
223 - $('#' + id).trigger('drawer-init', {sch: sch});  
224 - });  
225 - }  
226 -  
227 - var threshold = 30;  
228 - $(drawer).on('mousewheel', '.svg_cont_body', function (e) {  
229 - var event = e.originalEvent;  
230 - var code = delta = (event.wheelDelta) ? event.wheelDelta / 120 : -(event.detail || 0) / 3;  
231 -  
232 - var left = parseInt($(this).css('left').replace('px',''))  
233 - ,width = $(this).width()  
234 - ,max = width - $(this).parent().width();  
235 - if(code > 0){  
236 - left += threshold;  
237 - if(left >= 0)  
238 - left = 0;  
239 - $(this).css('left', left + 'px');  
240 - }  
241 - else{  
242 - left -= threshold;  
243 - if(Math.abs(left) >= max)  
244 - left = -max;  
245 - $(this).css('left', left + 'px');  
246 - }  
247 -  
248 - autoPosition();  
249 - });  
250 - })();  
251 - </script>  
252 - 1 +<!-- 站点路由间距图 -->
  2 +<a class="ct-bottom-drawer-close" style="right: calc(20% + 10px);"></a>
  3 +<div id="station_route_spacing_chart_drawer" style="width: 100%;height: 100%;font-size: 0;">
  4 + <div class="tl_desc_text" style="z-index: 999;">
  5 + (鼠标滚轮滚动)单位:米 | <a class="delete_route_spacing_link" style="color: red;">删除</a>
  6 + </div>
  7 + <div class="svg_wrap"></div>
  8 +
  9 + <div class="drawer_right_map" >
  10 +
  11 + </div>
  12 +
  13 + <script>
  14 +
  15 + (function () {
  16 + var drawer = '#station_route_spacing_chart_drawer'
  17 + , sch, locData, stationArr, len;
  18 + var cy = 120;
  19 + var tCy = cy - 15;
  20 + //站点marker对照
  21 + var map, markers = {};
  22 +
  23 + $('.delete_route_spacing_link', drawer).on('click', function () {
  24 + alt_confirm('确定要删除【'+sch.xlName+'】基于空间坐标计算的站间距数据?', function () {
  25 + window.localStorage.removeItem('control_route_distance_' + sch.xlBm);
  26 + $(drawer).parents('.uk-modal').trigger('refresh_station_space');
  27 + toGeoCalcPage();
  28 + }, '确定删除');
  29 + });
  30 +
  31 + $(drawer).on('drawer-init', function (e, data) {
  32 + sch = data.sch;
  33 + locData = window.localStorage.getItem('control_route_distance_' + sch.xlBm);
  34 +
  35 + if(locData)
  36 + drawCharts();
  37 + else{
  38 + toGeoCalcPage();
  39 + return;
  40 + }
  41 +
  42 + setTimeout(initMap, 800);
  43 + });
  44 +
  45 + function initMap() {
  46 + //初始化地图
  47 + map = new BMap.Map($('.drawer_right_map', drawer)[0]);
  48 + //中心点和缩放级别
  49 + map.centerAndZoom(new BMap.Point(121.544336, 31.221315), 15);
  50 + map.enableScrollWheelZoom();
  51 +
  52 + //绘制线路
  53 + var routes = JSON.parse(locData).sections[sch.xlDir==0?'up':'down'];
  54 +
  55 + var pos = [], bdCoord;
  56 + $.each(routes, function () {
  57 + bdCoord = TransGPS.wgsToBD(this.latitude, this.longitude);
  58 + pos.push(new BMap.Point(bdCoord.lng, bdCoord.lat));
  59 + });
  60 +
  61 + var polyline = new BMap.Polyline(pos, {strokeWeight:6, strokeColor: 'blue'});
  62 + map.addOverlay(polyline);
  63 +
  64 + //绘制站点
  65 + var station;
  66 + $.each(stationArr, function () {
  67 + station=this.station;
  68 + bdCoord = TransGPS.wgsToBD(station.G_LATY, station.G_LONX);
  69 +
  70 + var point = new BMap.Point(bdCoord.lng, bdCoord.lat);
  71 + var marker = new BMap.Marker(point);
  72 +
  73 + //根据站点名称 计算marker 宽度
  74 + var w = station.STATION_NAME.length * 12 + 4;
  75 + station.stationName = station.STATION_NAME;
  76 + station.directions = station.DIRECTIONS;
  77 + var icon = new BMap.Icon(gb_map_imap.createStationIcon(station, w), new BMap.Size(w-2,24), {anchor: new BMap.Size((w-2)/2,24)})
  78 + marker.setIcon(icon);
  79 +
  80 + map.addOverlay(marker);
  81 + markers[station.STATION_CODE] = marker;
  82 + });
  83 +
  84 + autoPosition();
  85 + }
  86 +
  87 + function drawCharts() {
  88 + try {
  89 + stationArr = JSON.parse(locData).stations[sch.xlDir == 0 ? 'up' : 'down'];
  90 + }catch (e){
  91 + alert('数据异常!!');
  92 + return;
  93 + }
  94 +
  95 + //console.log('locData...', JSON.parse(locData));
  96 + len = stationArr.length;
  97 + var width = cx(len - 1) + 20;
  98 + var svgCont = $('<div style="width: '+width+'px;" class="svg_cont_body"></div>');
  99 + var svg = d3.select(svgCont[0]).append('svg').classed({down: sch.xlDir==0?false:true});
  100 +
  101 + //初始化 X 比例尺
  102 + var sum=0;
  103 + $.each(stationArr, function () {
  104 + sum += this.toDistance;
  105 + });
  106 +
  107 + var items = svg.selectAll('g._item').data(stationArr)
  108 + .enter()
  109 + .append('g')
  110 + .attr('data-code', function (d) {
  111 + return d.station.STATION_CODE;
  112 + })
  113 + .classed({_item: true});
  114 +
  115 + //rect
  116 + items.append('rect').attr('x', xScale).attr('y', cy);
  117 + //text
  118 + items.append('text').attr('x', xScale).attr('y', cy)
  119 + .text(stationText).attr('title', stationText);
  120 +
  121 + //path
  122 + items.append('path').attr('d', function (d, i) {
  123 + return i>=len-1?'':line([i , i + 1]);
  124 + });
  125 +
  126 + //上弧线
  127 + items.append('path').classed({arc_path: true}).attr('d', route_arc_path);
  128 +
  129 + //path circle
  130 + items.append('circle').attr('cx', function (d, i) {
  131 + return cx(i);
  132 + }).attr('cy', tCy);
  133 +
  134 + //站距
  135 + items.filter(secFilter).append('rect')
  136 + .attr('x', function (d, i) {
  137 + return cx(i) - 6;
  138 + })
  139 + .attr('y', tCy - 42)
  140 + .classed({distance_rect: true})
  141 + .style('transform', distTranslate);
  142 +
  143 + items.filter(secFilter).append('text')
  144 + .attr('x', xScale)
  145 + .attr('y', tCy - 26)
  146 + .text(function (d, i) {
  147 + return d.toDistance;
  148 + })
  149 + .classed({distance_text: true})
  150 + .style('transform', distTranslate);
  151 +
  152 + $('.svg_wrap', drawer).append(svgCont);
  153 + }
  154 +
  155 + var xpdd = 20;
  156 + //var halfWidth = 15;
  157 + var xScale = function (d, i) {
  158 + return cx(i);
  159 + };
  160 +
  161 + var cx = function (i) {
  162 + var sum=0;
  163 + for(var j = 0; j <= i; j++){
  164 + sum+=stationArr[j].toDistance;
  165 + }
  166 + return sum / 2.5 + xpdd;
  167 + };
  168 +
  169 + var stationText = function (d) {
  170 + return d.station['STATION_NAME'];
  171 + };
  172 +
  173 + var line = d3.svg.line().x(cx).y(tCy);
  174 +
  175 + var route_arc_path = function (d, i) {
  176 + if(i >= len - 1) return;
  177 + var x1 = cx(i);
  178 + var x2 = cx(i + 1);
  179 +
  180 + var c1 = (x1 + (x2 - x1) / 3) + ' ' + (tCy - 40);
  181 + var c2 = (x2 - (x2 - x1) / 3) +' '+ (tCy - 40);
  182 +
  183 + return 'M'+x1+' '+tCy+' C '+ c1 +', '+ c2 +', '+ x2 +' '+tCy;
  184 + };
  185 +
  186 + var secFilter = function (d, i) {
  187 + return i > 0;
  188 + };
  189 +
  190 + //地图定位
  191 + var posMarker, posing=false;
  192 + function autoPosition() {
  193 + var left = Math.abs(parseInt($('.svg_cont_body', drawer).css('left').replace('px', '')));
  194 +
  195 + var g;
  196 + $('svg g._item text', drawer).each(function () {
  197 + if($(this).attr('x') > left){
  198 + g = $(this).parent();
  199 + return false;
  200 + }
  201 + });
  202 + posMarker = markers[g.data('code')];
  203 +
  204 + if(posing) return;
  205 + posing = true;
  206 + setTimeout(function () {
  207 + map.panTo(posMarker.point/*, {noAnimation: true}*/);
  208 + posing = false;
  209 + }, 500);
  210 + }
  211 +
  212 + var distTranslate = function (d, i) {
  213 + return 'translate('+(d.toDistance / 2.5 / 2 - 16)+'px, 0px)';
  214 + };
  215 +
  216 + function toGeoCalcPage() {
  217 + drawerLoadPage('/real_control_v2/fragments/geo/calc_station_space.html','cal_station_space_drawer');
  218 + }
  219 +
  220 + //页面切换
  221 + function drawerLoadPage(url, id) {
  222 + $(drawer).parent('.ct-bottom-drawer-body').load(url, function () {
  223 + $('#' + id).trigger('drawer-init', {sch: sch});
  224 + });
  225 + }
  226 +
  227 + var threshold = 30;
  228 + $(drawer).on('mousewheel', '.svg_cont_body', function (e) {
  229 + var event = e.originalEvent;
  230 + var code = delta = (event.wheelDelta) ? event.wheelDelta / 120 : -(event.detail || 0) / 3;
  231 +
  232 + var left = parseInt($(this).css('left').replace('px',''))
  233 + ,width = $(this).width()
  234 + ,max = width - $(this).parent().width();
  235 + if(code > 0){
  236 + left += threshold;
  237 + if(left >= 0)
  238 + left = 0;
  239 + $(this).css('left', left + 'px');
  240 + }
  241 + else{
  242 + left -= threshold;
  243 + if(Math.abs(left) >= max)
  244 + left = -max;
  245 + $(this).css('left', left + 'px');
  246 + }
  247 +
  248 + autoPosition();
  249 + });
  250 + })();
  251 + </script>
  252 +
253 </div> 253 </div>
254 \ No newline at end of file 254 \ No newline at end of file
src/main/resources/static/real_control_v2/mapmonitor/fragments/playback/before_form.html
1 -<div class="uk-alert uk-alert-success">开始~结束时间最大间隔24小时</div>  
2 -<div style="width: 68%;margin: auto;" id="playback_before_form">  
3 - <form class="uk-form uk-form-horizontal" style="margin-bottom: 0 !important;">  
4 - <div class="uk-grid">  
5 - <div class="uk-width-1-1">  
6 - <div class="uk-form-row">  
7 - <label class="uk-form-label">车辆编码</label>  
8 - <div class="uk-form-controls">  
9 - <div class="uk-autocomplete uk-form autocomplete-nbbm">  
10 - <input name="nbbm" required/>  
11 - </div>  
12 - </div>  
13 - </div>  
14 - </div>  
15 - </div>  
16 - <div class="uk-grid">  
17 - <div class="uk-width-2-3">  
18 - <div class="uk-form-row">  
19 - <label class="uk-form-label">开始时间</label>  
20 - <div class="uk-form-controls">  
21 - <input name="sDate" type="date" required/>  
22 - </div>  
23 - </div>  
24 - </div>  
25 - <div class="uk-width-1-3" style="padding-left: 15px;">  
26 - <div class="uk-form-row">  
27 - <div class="uk-form-controls" style="margin-left: 0;">  
28 - <input name="sTime" type="time" required/>  
29 - </div>  
30 - </div>  
31 - </div>  
32 - </div>  
33 - <div class="uk-grid">  
34 - <div class="uk-width-2-3">  
35 - <div class="uk-form-row">  
36 - <label class="uk-form-label">结束时间</label>  
37 - <div class="uk-form-controls">  
38 - <input name="eDate" type="date" required/>  
39 - </div>  
40 - </div>  
41 - </div>  
42 - <div class="uk-width-1-3" style="padding-left: 15px;">  
43 - <div class="uk-form-row">  
44 - <div class="uk-form-controls" style="margin-left: 0;">  
45 - <input name="eTime" type="time" required/>  
46 - </div>  
47 - </div>  
48 - </div>  
49 - </div>  
50 -  
51 - <div style="text-align: center;margin-top: 25px;">  
52 - <button class="uk-button uk-button-large uk-button-primary" type="submit"><i  
53 - class="uk-icon-play-circle"> </i> 开始回放  
54 - </button>  
55 - </div>  
56 - <i class="uk-icon-spinner uk-icon-spin"  
57 - style="font-size: 18px;color: rgb(213, 31, 31);position: absolute;bottom: 25px;left: calc(50% + 70px);display: none;"></i>  
58 - </form>  
59 -  
60 - <script>  
61 - (function () {  
62 - $('#playback_before_form').on('init_form', function (e, data) {  
63 - //车辆 autocomplete  
64 - $.get('/basic/cars', function (rs) {  
65 - gb_common.carAutocomplete($('#playback_before_form .autocomplete-nbbm'), rs);  
66 - });  
67 -  
68 - if (data.nbbm)  
69 - $('[name=nbbm]', this).val(data.nbbm);  
70 - //默认时间  
71 - var m = moment()  
72 - , rq = 'YYYY-MM-DD', sj = 'HH:mm';  
73 - $('[name=eDate]', this).val(m.format(rq));  
74 - $('[name=eTime]', this).val(m.format('HH:mm'));  
75 - $('[name=sDate]', this).val(m.subtract(2, 'hour').format(rq));  
76 - $('[name=sTime]', this).val(m.format(sj));  
77 -  
78 - //test  
79 - $('[name=nbbm]', this).val('W9H-003');  
80 - $('[name=eDate]', this).val('2016-12-10');  
81 - $('[name=eTime]', this).val('09:00');  
82 - $('[name=sDate]', this).val('2016-12-10');  
83 - $('[name=sTime]', this).val('07:00');  
84 - });  
85 -  
86 - var ONE_DAY = 1000 * 60 * 60 * 24;  
87 - var f = $('form', '#playback_before_form').formValidation({  
88 - framework: 'uikit',  
89 - locale: 'zh_CN'  
90 - });  
91 - f.on('success.form.fv', function (e) {  
92 - e.preventDefault();  
93 - disabledBtn();  
94 - var data = $(this).serializeJSON();  
95 -  
96 - //校验时间间隔  
97 - var fs = 'YYYY-MM-DDHH:mm';  
98 - var st = moment(data.sDate + data.sTime, fs).format('X');  
99 - var et = moment(data.eDate + data.eTime, fs).format('X');  
100 -  
101 - if (et < st)  
102 - return abortSubmit('结束时间小于开始时间???');  
103 - else if ((et - st) > ONE_DAY)  
104 - return abortSubmit('时间间隔不能超过24小时!');  
105 - else if (et == st)  
106 - return abortSubmit('一点时间间隔都不给???');  
107 -  
108 - $('#playback_before_form i.uk-icon-spinner').show();  
109 - $.ajax({  
110 - url: '/gps/gpsHistory/multiple',  
111 - traditional: true,  
112 - data: {nbbmArray: [data.nbbm], st: st, et: et},  
113 - success: function (rs) {  
114 - if (!rs || rs.length == 0)  
115 - return abortSubmit('失败,服务器没有返回轨迹数据!');  
116 -  
117 - //排序  
118 - rs.sort(function (a, b) {  
119 - return a.timestamp - b.timestamp;  
120 - });  
121 - //格式化时间  
122 - $.each(rs, function () {  
123 - var mom = moment(this.timestamp);  
124 - this.timeStr = mom.format('HH:mm.ss');  
125 - this.timeStr2 = mom.format('YYYY-MM-DD HH:mm.ss');  
126 - });  
127 -  
128 - //获取路段信息  
129 - if (!rs[0] || !rs[0].lineId)  
130 - return notify_err('首个点位无效....');  
131 -  
132 - jsQueryRoads(rs[0].lineId, function (roads) {  
133 - //gps关联到路段  
134 - matchRoad(rs, roads);  
135 -  
136 - var f = $('#playback_before_form');  
137 - var fileName = $('[name=nbbm]', f).val() + '轨迹数据'  
138 - + $('[name=sDate]', f).val() + $('[name=sTime]', f).val() + '至'  
139 - + $('[name=eDate]', f).val() + $('[name=eTime]', f).val() + '.xls';  
140 -  
141 - $('#playback_before_form').parents('.uk-modal').trigger('show_play_body', {  
142 - gpsList: rs,  
143 - roads: roads,  
144 - lineCode: rs[0].lineId,  
145 - fileName: fileName.replace(new RegExp(/-/g),'').replace(new RegExp(/:/g),'')  
146 - });  
147 - });  
148 - }  
149 - });  
150 - });  
151 -  
152 - function abortSubmit(t) {  
153 - $('#playback_before_form i.uk-icon-spinner').hide();  
154 - notify_err(t);  
155 - $('form button[type=submit]', '#playback_before_form').removeClass('disabled').removeAttr('disabled');  
156 - }  
157 -  
158 - function disabledBtn() {  
159 - $('form button[type=submit]', '#playback_before_form').addClass('disabled').attr('disabled', 'disabled');  
160 - }  
161 -  
162 - function jsQueryRoads(lineCode, cb) {  
163 - gb_common.$get('/gps/findRoadSpeed', {lineCode: lineCode}, function (rs) {  
164 - //处理路段坐标集合  
165 - var roads = rs.roads;  
166 - var cds, coordArray, array;  
167 -  
168 - for (var i = 0, road; road = roads[i++];) {  
169 - cds = road['GROAD_VECTOR'];  
170 - cds = cds.substring(11, cds.length - 1);  
171 - coordArray = cds.split(',');  
172 -  
173 - array = [];  
174 -  
175 - for (var j = 0, cd; cd = coordArray[j++];) {  
176 - var cdArray = cd.split(' ');  
177 -  
178 - //wgs84 to baidu  
179 - var bdCd = TransGPS.wgsToBD(parseFloat(cdArray[1]), parseFloat(cdArray[0]));  
180 - array.push({  
181 - longitude: bdCd.lng,  
182 - latitude: bdCd.lat  
183 - });  
184 - }  
185 - road.coords = array;  
186 - }  
187 - cb && cb(roads);  
188 - });  
189 - }  
190 -  
191 -  
192 - function matchRoad(gpsArray, roads) {  
193 - var rs;  
194 - $.each(gpsArray, function () {  
195 - rs = gpsMatchRoad(this, roads);  
196 - this.road = rs.road;  
197 - this.minDistance = rs.min;  
198 - });  
199 - }  
200 -  
201 - function gpsMatchRoad(gps, roads) {  
202 - var point = {latitude: gps.bd_lat, longitude: gps.bd_lon};  
203 -  
204 - var min, road;  
205 - $.each(roads, function () {  
206 -  
207 - var len = this.coords.length;  
208 - for (var i = 0; i < len - 1; i++) {  
209 - //点到线的距离  
210 - var distance = geolib.getDistanceFromLine(point, this.coords[i], this.coords[i + 1]);  
211 - if (min > distance || min == null) {  
212 - min = distance;  
213 - road = this;  
214 - }  
215 - }  
216 - });  
217 -  
218 - return {road: road, min: min};  
219 - }  
220 - })();  
221 - </script> 1 +<div class="uk-alert uk-alert-success">开始~结束时间最大间隔24小时</div>
  2 +<div style="width: 68%;margin: auto;" id="playback_before_form">
  3 + <form class="uk-form uk-form-horizontal" style="margin-bottom: 0 !important;">
  4 + <div class="uk-grid">
  5 + <div class="uk-width-1-1">
  6 + <div class="uk-form-row">
  7 + <label class="uk-form-label">车辆编码</label>
  8 + <div class="uk-form-controls">
  9 + <div class="uk-autocomplete uk-form autocomplete-nbbm">
  10 + <input name="nbbm" required/>
  11 + </div>
  12 + </div>
  13 + </div>
  14 + </div>
  15 + </div>
  16 + <div class="uk-grid">
  17 + <div class="uk-width-2-3">
  18 + <div class="uk-form-row">
  19 + <label class="uk-form-label">开始时间</label>
  20 + <div class="uk-form-controls">
  21 + <input name="sDate" type="date" required/>
  22 + </div>
  23 + </div>
  24 + </div>
  25 + <div class="uk-width-1-3" style="padding-left: 15px;">
  26 + <div class="uk-form-row">
  27 + <div class="uk-form-controls" style="margin-left: 0;">
  28 + <input name="sTime" type="time" required/>
  29 + </div>
  30 + </div>
  31 + </div>
  32 + </div>
  33 + <div class="uk-grid">
  34 + <div class="uk-width-2-3">
  35 + <div class="uk-form-row">
  36 + <label class="uk-form-label">结束时间</label>
  37 + <div class="uk-form-controls">
  38 + <input name="eDate" type="date" required/>
  39 + </div>
  40 + </div>
  41 + </div>
  42 + <div class="uk-width-1-3" style="padding-left: 15px;">
  43 + <div class="uk-form-row">
  44 + <div class="uk-form-controls" style="margin-left: 0;">
  45 + <input name="eTime" type="time" required/>
  46 + </div>
  47 + </div>
  48 + </div>
  49 + </div>
  50 +
  51 + <div style="text-align: center;margin-top: 25px;">
  52 + <button class="uk-button uk-button-large uk-button-primary" type="submit"><i
  53 + class="uk-icon-play-circle"> </i> 开始回放
  54 + </button>
  55 + </div>
  56 + <i class="uk-icon-spinner uk-icon-spin"
  57 + style="font-size: 18px;color: rgb(213, 31, 31);position: absolute;bottom: 25px;left: calc(50% + 70px);display: none;"></i>
  58 + </form>
  59 +
  60 + <script>
  61 + (function () {
  62 + $('#playback_before_form').on('init_form', function (e, data) {
  63 + //车辆 autocomplete
  64 + $.get('/basic/cars', function (rs) {
  65 + gb_common.carAutocomplete($('#playback_before_form .autocomplete-nbbm'), rs);
  66 + });
  67 +
  68 + if (data.nbbm)
  69 + $('[name=nbbm]', this).val(data.nbbm);
  70 + //默认时间
  71 + var m = moment()
  72 + , rq = 'YYYY-MM-DD', sj = 'HH:mm';
  73 + $('[name=eDate]', this).val(m.format(rq));
  74 + $('[name=eTime]', this).val(m.format('HH:mm'));
  75 + $('[name=sDate]', this).val(m.subtract(2, 'hour').format(rq));
  76 + $('[name=sTime]', this).val(m.format(sj));
  77 +
  78 + //test
  79 + $('[name=nbbm]', this).val('W9H-003');
  80 + $('[name=eDate]', this).val('2016-12-10');
  81 + $('[name=eTime]', this).val('09:00');
  82 + $('[name=sDate]', this).val('2016-12-10');
  83 + $('[name=sTime]', this).val('07:00');
  84 + });
  85 +
  86 + var ONE_DAY = 1000 * 60 * 60 * 24;
  87 + var f = $('form', '#playback_before_form').formValidation({
  88 + framework: 'uikit',
  89 + locale: 'zh_CN'
  90 + });
  91 + f.on('success.form.fv', function (e) {
  92 + e.preventDefault();
  93 + disabledBtn();
  94 + var data = $(this).serializeJSON();
  95 +
  96 + //校验时间间隔
  97 + var fs = 'YYYY-MM-DDHH:mm';
  98 + var st = moment(data.sDate + data.sTime, fs).format('X');
  99 + var et = moment(data.eDate + data.eTime, fs).format('X');
  100 +
  101 + if (et < st)
  102 + return abortSubmit('结束时间小于开始时间???');
  103 + else if ((et - st) > ONE_DAY)
  104 + return abortSubmit('时间间隔不能超过24小时!');
  105 + else if (et == st)
  106 + return abortSubmit('一点时间间隔都不给???');
  107 +
  108 + $('#playback_before_form i.uk-icon-spinner').show();
  109 + $.ajax({
  110 + url: '/gps/gpsHistory/multiple',
  111 + traditional: true,
  112 + data: {nbbmArray: [data.nbbm], st: st, et: et},
  113 + success: function (rs) {
  114 + if (!rs || rs.length == 0)
  115 + return abortSubmit('失败,服务器没有返回轨迹数据!');
  116 +
  117 + //排序
  118 + rs.sort(function (a, b) {
  119 + return a.timestamp - b.timestamp;
  120 + });
  121 + //格式化时间
  122 + $.each(rs, function () {
  123 + var mom = moment(this.timestamp);
  124 + this.timeStr = mom.format('HH:mm.ss');
  125 + this.timeStr2 = mom.format('YYYY-MM-DD HH:mm.ss');
  126 + });
  127 +
  128 + //获取路段信息
  129 + if (!rs[0] || !rs[0].lineId)
  130 + return notify_err('首个点位无效....');
  131 +
  132 + jsQueryRoads(rs[0].lineId, function (roads) {
  133 + //gps关联到路段
  134 + matchRoad(rs, roads);
  135 +
  136 + var f = $('#playback_before_form');
  137 + var fileName = $('[name=nbbm]', f).val() + '轨迹数据'
  138 + + $('[name=sDate]', f).val() + $('[name=sTime]', f).val() + '至'
  139 + + $('[name=eDate]', f).val() + $('[name=eTime]', f).val() + '.xls';
  140 +
  141 + $('#playback_before_form').parents('.uk-modal').trigger('show_play_body', {
  142 + gpsList: rs,
  143 + roads: roads,
  144 + lineCode: rs[0].lineId,
  145 + fileName: fileName.replace(new RegExp(/-/g),'').replace(new RegExp(/:/g),'')
  146 + });
  147 + });
  148 + }
  149 + });
  150 + });
  151 +
  152 + function abortSubmit(t) {
  153 + $('#playback_before_form i.uk-icon-spinner').hide();
  154 + notify_err(t);
  155 + $('form button[type=submit]', '#playback_before_form').removeClass('disabled').removeAttr('disabled');
  156 + }
  157 +
  158 + function disabledBtn() {
  159 + $('form button[type=submit]', '#playback_before_form').addClass('disabled').attr('disabled', 'disabled');
  160 + }
  161 +
  162 + function jsQueryRoads(lineCode, cb) {
  163 + gb_common.$get('/gps/findRoadSpeed', {lineCode: lineCode}, function (rs) {
  164 + //处理路段坐标集合
  165 + var roads = rs.roads;
  166 + var cds, coordArray, array;
  167 +
  168 + for (var i = 0, road; road = roads[i++];) {
  169 + cds = road['GROAD_VECTOR'];
  170 + cds = cds.substring(11, cds.length - 1);
  171 + coordArray = cds.split(',');
  172 +
  173 + array = [];
  174 +
  175 + for (var j = 0, cd; cd = coordArray[j++];) {
  176 + var cdArray = cd.split(' ');
  177 +
  178 + //wgs84 to baidu
  179 + var bdCd = TransGPS.wgsToBD(parseFloat(cdArray[1]), parseFloat(cdArray[0]));
  180 + array.push({
  181 + longitude: bdCd.lng,
  182 + latitude: bdCd.lat
  183 + });
  184 + }
  185 + road.coords = array;
  186 + }
  187 + cb && cb(roads);
  188 + });
  189 + }
  190 +
  191 +
  192 + function matchRoad(gpsArray, roads) {
  193 + var rs;
  194 + $.each(gpsArray, function () {
  195 + rs = gpsMatchRoad(this, roads);
  196 + this.road = rs.road;
  197 + this.minDistance = rs.min;
  198 + });
  199 + }
  200 +
  201 + function gpsMatchRoad(gps, roads) {
  202 + var point = {latitude: gps.bd_lat, longitude: gps.bd_lon};
  203 +
  204 + var min, road;
  205 + $.each(roads, function () {
  206 +
  207 + var len = this.coords.length;
  208 + for (var i = 0; i < len - 1; i++) {
  209 + //点到线的距离
  210 + var distance = geolib.getDistanceFromLine(point, this.coords[i], this.coords[i + 1]);
  211 + if (min > distance || min == null) {
  212 + min = distance;
  213 + road = this;
  214 + }
  215 + }
  216 + });
  217 +
  218 + return {road: road, min: min};
  219 + }
  220 + })();
  221 + </script>
222 </div> 222 </div>
223 \ No newline at end of file 223 \ No newline at end of file
src/main/resources/static/real_control_v2/mapmonitor/fragments/playback/main.html
1 -<div class="uk-modal ct-form-modal" id="map-playback-modal">  
2 - <div class="uk-modal-dialog" >  
3 - <a href="" class="uk-modal-close uk-close"></a>  
4 - <h1>轨迹回放</h1>  
5 - <div class="pb_modal_body"></div>  
6 - </div>  
7 - <script>  
8 - (function () {  
9 - var modal = '#map-playback-modal';  
10 -  
11 - $(modal).on('show_form', function (e, data) {  
12 - $('.pb_modal_body', modal).load('/real_control_v2/mapmonitor/fragments/playback/before_form.html', function () {  
13 - $('#playback_before_form', modal).trigger('init_form', data);  
14 - });  
15 - });  
16 -  
17 - //show播放界面  
18 - $(modal).on('show_play_body', function (e, data) {  
19 - $('.pb_modal_body', modal).empty();  
20 - $('.uk-modal-dialog', modal).addClass('play-back-run-modal').one('transitionend', function () {  
21 - //最小宽度  
22 - $(this).css('min-width', '1280px');  
23 - });  
24 - $('.pb_modal_body', modal).load('/real_control_v2/mapmonitor/fragments/playback/run.html', function () {  
25 - $('#playback_run_body', modal).trigger('init', data);  
26 - });  
27 - });  
28 - })();  
29 - </script>  
30 -</div> 1 +<div class="uk-modal ct-form-modal" id="map-playback-modal">
  2 + <div class="uk-modal-dialog" >
  3 + <a href="" class="uk-modal-close uk-close"></a>
  4 + <h1>轨迹回放</h1>
  5 + <div class="pb_modal_body"></div>
  6 + </div>
  7 + <script>
  8 + (function () {
  9 + var modal = '#map-playback-modal';
  10 +
  11 + $(modal).on('show_form', function (e, data) {
  12 + $('.pb_modal_body', modal).load('/real_control_v2/mapmonitor/fragments/playback/before_form.html', function () {
  13 + $('#playback_before_form', modal).trigger('init_form', data);
  14 + });
  15 + });
  16 +
  17 + //show播放界面
  18 + $(modal).on('show_play_body', function (e, data) {
  19 + $('.pb_modal_body', modal).empty();
  20 + $('.uk-modal-dialog', modal).addClass('play-back-run-modal').one('transitionend', function () {
  21 + //最小宽度
  22 + $(this).css('min-width', '1280px');
  23 + });
  24 + $('.pb_modal_body', modal).load('/real_control_v2/mapmonitor/fragments/playback/run.html', function () {
  25 + $('#playback_run_body', modal).trigger('init', data);
  26 + });
  27 + });
  28 + })();
  29 + </script>
  30 +</div>
src/main/resources/static/real_control_v2/mapmonitor/fragments/playback/run.html
1 -<div id="playback_run_body">  
2 - <div class="map_wrap"></div>  
3 - <!-- 日志输出 -->  
4 - <div class="pb_log_panel uk-animation-slide-right" style="overflow: auto;">  
5 - <div class="ct_table" style="height: calc(100% - 30px);">  
6 - <div class="ct_table_head">  
7 - <dl>  
8 - <dt>时间</dt>  
9 - <dt>速度</dt>  
10 - <dt>路段</dt>  
11 - <dt>状态</dt>  
12 - </dl>  
13 - </div>  
14 - <div class="ct_table_body">  
15 - </div>  
16 - </div>  
17 - </div>  
18 - <div class="pb_footer_tools uk-animation-slide-bottom" onselectstart="return false;" style="-moz-user-select:none;">  
19 - <span class="ui-slider-tip">08:30.50</span>  
20 - <div class="uk-progress uk-progress-small uk-progress-success uk-progress-striped">  
21 - <div class="uk-progress-bar" style="width: 0;"></div>  
22 - </div>  
23 -  
24 - <div class="pb_tools_icon">  
25 - <div class="uk-button-group">  
26 - <a class="uk-button" data-uk-tooltip title="快退" data-type="rewind"><i class="uk-icon-fast-backward"></i></a>  
27 - <a class="uk-button" data-uk-tooltip title="停止" data-type="stop"><i class="uk-icon-stop"></i></a>  
28 - <a class="uk-button play-btn" data-type="play"><i class="uk-icon-play"></i></a>  
29 - <a class="uk-button" data-uk-tooltip title="快进" data-type="fast_forward"><i class="uk-icon-fast-forward"></i></a>  
30 - </div>  
31 - </div>  
32 -  
33 - <div class="pb_tools_icon">  
34 - <div class="uk-button-dropdown" data-uk-dropdown="{mode:'hover', pos:'top-left'}">  
35 - <button class="uk-button"><i class="uk-icon-cog"> </i> 工具 <i class="uk-icon-caret-down"></i></button>  
36 - <div class="uk-dropdown uk-dropdown-bottom uk-dropdown-small" style="top: 30px; left: 0px;">  
37 - <ul class="uk-nav uk-nav-dropdown pb_dropdown_tool">  
38 - <!--<li><a>显示站点</a></li>  
39 - <li><a>显示电子围栏</a></li>  
40 - <li class="uk-nav-divider"></li>  
41 - <li><a>关闭日志输出</a></li>  
42 - <li class="uk-nav-divider"></li>-->  
43 - <li><a data-name="exportExcel" href="javascript:;" >导出轨迹</a></li>  
44 - </ul>  
45 - </div>  
46 - </div>  
47 - </div>  
48 - </div>  
49 -  
50 - <script>  
51 - (function () {  
52 -  
53 - var logTemp = template.compile('{{each list as gps i}}<dl data-code="{{gps.road.ROAD_CODE}}">' +  
54 - '<dd>{{gps.timeStr}}</dd>' +  
55 - '<dd>{{gps.speed}}</dd>' +  
56 - '<dd>{{gps.road.ROAD_NAME}}</dd><dd>正常</dd></dl>{{/each}}');  
57 -  
58 -  
59 -  
60 - var _body = '#playback_run_body'  
61 - , map, gpsArray, roads, marker, width, trailArray = [], trailPolyline;  
62 -  
63 - var upRoutePos = [], downRoutePos = [];  
64 - var storage = window.localStorage;  
65 - var lineCode;  
66 -  
67 - //进度条  
68 - var progress = $('.pb_footer_tools .uk-progress', _body);  
69 - var bar = $('.uk-progress-bar', progress);  
70 - var step;  
71 - var prsTip = $('.ui-slider-tip', _body);  
72 - progress.mousemove(function (e) {  
73 - var x = e.offsetX;  
74 - var i = parseInt(x / step);  
75 - var time = moment(gpsArray[i].timestamp).format('HH:mm.ss');  
76 -  
77 - prsTip.text(time).css('left', x - 11).css('visibility', 'visible');  
78 - }).mouseout(function () {  
79 - prsTip.css('visibility', 'hidden')  
80 - }).on('click', function (e) {  
81 - var x = e.offsetX;  
82 - goto(parseInt(x / step));  
83 - });  
84 -  
85 - $(_body).on('init', function (e, data) {  
86 - roads = data.roads;  
87 - lineCode = data.lineCode;  
88 -  
89 - setTimeout(function () {  
90 - initMap(data.gpsList);  
91 - len = gpsArray.length;  
92 - step = progress.width() / gpsArray.length;  
93 - }, 600);  
94 -  
95 - //导出的文件名  
96 - $('a[data-name=exportExcel]').attr('download', data.fileName);  
97 - });  
98 -  
99 - $('.pb_tools_icon a.uk-button', _body).on('click', function () {  
100 - var type = $(this).data('type');  
101 - switch (type) {  
102 - case 'play':  
103 - play();  
104 - break;  
105 - case 'pause':  
106 - pause();  
107 - break;  
108 - case 'fast_forward':  
109 - goto(index + 10);  
110 - break;  
111 - case 'rewind':  
112 - goto(index - 10);  
113 - break;  
114 - case 'stop':  
115 - pause();  
116 - break;  
117 - }  
118 - });  
119 -  
120 - $('.pb_dropdown_tool li a', _body).on('click', function () {  
121 - var name = $(this).data('name');  
122 - switch (name) {  
123 - case 'exportExcel':  
124 - var base64Str = gb_map_play_back.listToExcel(gpsArray);  
125 - $(this).attr('href', base64Str);  
126 - break;  
127 - }  
128 - });  
129 -  
130 - function goto(ei) {  
131 - if(ei < 0 || ei >= len)  
132 - return;  
133 -  
134 - bar.css('width', ei * step);  
135 - var gps = gpsArray[ei];  
136 - //重新定位marker  
137 - try {  
138 - drawLine(gps.direction);  
139 - } catch (e) {  
140 - console.log(e);  
141 - }  
142 - var point = new BMap.Point(gps.bd_lon, gps.bd_lat);  
143 - marker.setPosition(point);  
144 - marker.setIcon(new BMap.Icon(gb_map_imap.createCarIconRotation(gps, width), new BMap.Size(width, 75)));  
145 -  
146 - //重新填充轨迹线,更新日志面板  
147 - trailArray = [];  
148 - var logs = [];  
149 - for (var i = 0; i <= ei; i++) {  
150 - trailArray.push(new BMap.Point(gpsArray[i].bd_lon, gpsArray[i].bd_lat));  
151 - if(i > 0 && logs[logs.length - 1].road.ROAD_CODE == gpsArray[i].road.ROAD_CODE)  
152 - logs.pop();  
153 -  
154 - logs.push(gpsArray[i]);  
155 - }  
156 - trailPolyline.setPath(trailArray);  
157 -  
158 - index = ei;  
159 - map.panTo(marker.getPosition());  
160 - //更新日志面板  
161 - logPanel.empty().html(logTemp({list: logs}));  
162 - logWrap.scrollTop(logWrap[0].scrollHeight);  
163 - }  
164 -  
165 - //播放  
166 - function play() {  
167 - $('.play-btn', _body)  
168 - .data('type', 'pause')  
169 - .find('i')  
170 - .removeClass('uk-icon-play')  
171 - .addClass('uk-icon-pause');  
172 - pauseFlag = false;  
173 - progress.addClass('uk-active');  
174 - run();  
175 -  
176 - //定时居中  
177 - fixedToCenter();  
178 - }  
179 -  
180 - var toCenterTimer;  
181 -  
182 - function fixedToCenter() {  
183 - toCenterTimer = setInterval(function () {  
184 - map.panTo(marker.getPosition());  
185 - }, 5000);  
186 - }  
187 -  
188 - //暂停  
189 - var pauseFlag;  
190 -  
191 - function pause() {  
192 - $('.play-btn', _body)  
193 - .data('type', 'play')  
194 - .find('i')  
195 - .removeClass('uk-icon-pause')  
196 - .addClass('uk-icon-play');  
197 - pauseFlag = true;  
198 - progress.removeClass('uk-active');  
199 - clearInterval(toCenterTimer);  
200 - }  
201 -  
202 - var index = 1;  
203 - var len;  
204 -  
205 - function run() {  
206 - //暂停  
207 - if (pauseFlag) {  
208 - pauseFlag = false;  
209 - return  
210 - }  
211 - //结束  
212 - if (index >= len) {  
213 - bar.css('width', '100%')  
214 - pause();  
215 - return;  
216 - }  
217 -  
218 - //marker 移动  
219 - var gps = gpsArray[index];  
220 -  
221 - //线路走向  
222 - if (gps.direction != gpsArray[index - 1].direction || index == 1)  
223 - drawLine(gps.direction);  
224 -  
225 - var point = new BMap.Point(gps.bd_lon, gps.bd_lat);  
226 - marker.setPosition(point);  
227 - marker.setIcon(new BMap.Icon(gb_map_imap.createCarIconRotation(gps, width), new BMap.Size(width, 75)));  
228 -  
229 - //轨迹线  
230 - trailArray.push(point);  
231 - trailPolyline.setPath(trailArray);  
232 -  
233 - //进度条  
234 - bar.css('width', step * index);  
235 -  
236 - //日志输出  
237 - logWrite(gps, gpsArray[index - 1]);  
238 -  
239 - index++;  
240 - setTimeout(run, 1000);  
241 - }  
242 -  
243 - //初始化地图  
244 - function initMap(data) {  
245 - gpsArray = data;  
246 - var firstPoint = new BMap.Point(data[0].bd_lon, data[0].bd_lat);  
247 - map = new BMap.Map($('.map_wrap', _body)[0]);  
248 - map.centerAndZoom(firstPoint, 17);  
249 - map.enableScrollWheelZoom();  
250 -  
251 - //创建车辆marker  
252 - marker = new BMap.Marker(firstPoint);  
253 - width = gb_map_imap.calcGpsMarkerWidth(data[0].nbbm);  
254 - //渲染icon  
255 - marker.setIcon(new BMap.Icon(gb_map_imap.createCarIconRotation(data[0], width), new BMap.Size(width, 75)));  
256 - marker.disableMassClear();  
257 - map.addOverlay(marker);  
258 -  
259 - //线路图层 数据  
260 - var routeCache = JSON.parse(storage.getItem(lineCode + '_route'));  
261 - upRoutePos = initRoutePosData(routeCache.up_bd);  
262 - downRoutePos = initRoutePosData(routeCache.down_bd);  
263 -  
264 - trailArray.push(firstPoint);  
265 - drawTrailLine();  
266 - //输出第一个点  
267 - logWrite(data[0], null);  
268 - }  
269 -  
270 - function drawTrailLine() {  
271 - trailPolyline = new BMap.Polyline(trailArray, {strokeWeight: 3, strokeColor: 'black'});  
272 - map.addOverlay(trailPolyline);  
273 - }  
274 -  
275 - function initRoutePosData(routeStr) {  
276 - var array = [], temps;  
277 - $.each(routeStr, function (i, item) {  
278 - var pos = [];  
279 - $.each(item.split(','), function () {  
280 - temps = this.split(' ');  
281 - pos.push(new BMap.Point(temps[0], temps[1]));  
282 - });  
283 - array.push(pos);  
284 - });  
285 - return array;  
286 - }  
287 -  
288 - function drawLine(updown) {  
289 - map.clearOverlays();  
290 -  
291 - var pos = updown == 0 ? upRoutePos : downRoutePos;  
292 - $.each(pos, function () {  
293 - map.addOverlay(new BMap.Polyline(this, {strokeWeight: 12, strokeColor: 'rgba(0, 0, 255, 0.6)'}));  
294 - });  
295 -  
296 - drawTrailLine();  
297 - }  
298 -  
299 - //日志输出  
300 - var logWrap = $('.pb_log_panel', _body);  
301 - var logPanel = $('.pb_log_panel .ct_table_body', _body);  
302 - gb_ct_table.fixedHead(logWrap);  
303 -  
304 - function logWrite(gps, prve) {  
305 - var code = gps.road.ROAD_CODE;  
306 - if (!prve || code != prve.road.ROAD_CODE) {  
307 - logPanel.append('<dl data-code="' + code + '" ><dd>' + gps.timeStr + '</dd><dd>' + gps.speed + '</dd><dd>' + gps.road.ROAD_NAME + '</dd><dd>正常</dd></dl>');  
308 - }  
309 - else {  
310 - var dds = logPanel.find('dl[data-code=' + code + ']').last().find('dd');  
311 - $(dds[0]).text(gps.timeStr);  
312 - $(dds[1]).text(gps.speed);  
313 - }  
314 -  
315 - logWrap.scrollTop(logWrap[0].scrollHeight);  
316 - }  
317 - })();  
318 - </script> 1 +<div id="playback_run_body">
  2 + <div class="map_wrap"></div>
  3 + <!-- 日志输出 -->
  4 + <div class="pb_log_panel uk-animation-slide-right" style="overflow: auto;">
  5 + <div class="ct_table" style="height: calc(100% - 30px);">
  6 + <div class="ct_table_head">
  7 + <dl>
  8 + <dt>时间</dt>
  9 + <dt>速度</dt>
  10 + <dt>路段</dt>
  11 + <dt>状态</dt>
  12 + </dl>
  13 + </div>
  14 + <div class="ct_table_body">
  15 + </div>
  16 + </div>
  17 + </div>
  18 + <div class="pb_footer_tools uk-animation-slide-bottom" onselectstart="return false;" style="-moz-user-select:none;">
  19 + <span class="ui-slider-tip">08:30.50</span>
  20 + <div class="uk-progress uk-progress-small uk-progress-success uk-progress-striped">
  21 + <div class="uk-progress-bar" style="width: 0;"></div>
  22 + </div>
  23 +
  24 + <div class="pb_tools_icon">
  25 + <div class="uk-button-group">
  26 + <a class="uk-button" data-uk-tooltip title="快退" data-type="rewind"><i class="uk-icon-fast-backward"></i></a>
  27 + <a class="uk-button" data-uk-tooltip title="停止" data-type="stop"><i class="uk-icon-stop"></i></a>
  28 + <a class="uk-button play-btn" data-type="play"><i class="uk-icon-play"></i></a>
  29 + <a class="uk-button" data-uk-tooltip title="快进" data-type="fast_forward"><i class="uk-icon-fast-forward"></i></a>
  30 + </div>
  31 + </div>
  32 +
  33 + <div class="pb_tools_icon">
  34 + <div class="uk-button-dropdown" data-uk-dropdown="{mode:'hover', pos:'top-left'}">
  35 + <button class="uk-button"><i class="uk-icon-cog"> </i> 工具 <i class="uk-icon-caret-down"></i></button>
  36 + <div class="uk-dropdown uk-dropdown-bottom uk-dropdown-small" style="top: 30px; left: 0px;">
  37 + <ul class="uk-nav uk-nav-dropdown pb_dropdown_tool">
  38 + <!--<li><a>显示站点</a></li>
  39 + <li><a>显示电子围栏</a></li>
  40 + <li class="uk-nav-divider"></li>
  41 + <li><a>关闭日志输出</a></li>
  42 + <li class="uk-nav-divider"></li>-->
  43 + <li><a data-name="exportExcel" href="javascript:;" >导出轨迹</a></li>
  44 + </ul>
  45 + </div>
  46 + </div>
  47 + </div>
  48 + </div>
  49 +
  50 + <script>
  51 + (function () {
  52 +
  53 + var logTemp = template.compile('{{each list as gps i}}<dl data-code="{{gps.road.ROAD_CODE}}">' +
  54 + '<dd>{{gps.timeStr}}</dd>' +
  55 + '<dd>{{gps.speed}}</dd>' +
  56 + '<dd>{{gps.road.ROAD_NAME}}</dd><dd>正常</dd></dl>{{/each}}');
  57 +
  58 +
  59 +
  60 + var _body = '#playback_run_body'
  61 + , map, gpsArray, roads, marker, width, trailArray = [], trailPolyline;
  62 +
  63 + var upRoutePos = [], downRoutePos = [];
  64 + var storage = window.localStorage;
  65 + var lineCode;
  66 +
  67 + //进度条
  68 + var progress = $('.pb_footer_tools .uk-progress', _body);
  69 + var bar = $('.uk-progress-bar', progress);
  70 + var step;
  71 + var prsTip = $('.ui-slider-tip', _body);
  72 + progress.mousemove(function (e) {
  73 + var x = e.offsetX;
  74 + var i = parseInt(x / step);
  75 + var time = moment(gpsArray[i].timestamp).format('HH:mm.ss');
  76 +
  77 + prsTip.text(time).css('left', x - 11).css('visibility', 'visible');
  78 + }).mouseout(function () {
  79 + prsTip.css('visibility', 'hidden')
  80 + }).on('click', function (e) {
  81 + var x = e.offsetX;
  82 + goto(parseInt(x / step));
  83 + });
  84 +
  85 + $(_body).on('init', function (e, data) {
  86 + roads = data.roads;
  87 + lineCode = data.lineCode;
  88 +
  89 + setTimeout(function () {
  90 + initMap(data.gpsList);
  91 + len = gpsArray.length;
  92 + step = progress.width() / gpsArray.length;
  93 + }, 600);
  94 +
  95 + //导出的文件名
  96 + $('a[data-name=exportExcel]').attr('download', data.fileName);
  97 + });
  98 +
  99 + $('.pb_tools_icon a.uk-button', _body).on('click', function () {
  100 + var type = $(this).data('type');
  101 + switch (type) {
  102 + case 'play':
  103 + play();
  104 + break;
  105 + case 'pause':
  106 + pause();
  107 + break;
  108 + case 'fast_forward':
  109 + goto(index + 10);
  110 + break;
  111 + case 'rewind':
  112 + goto(index - 10);
  113 + break;
  114 + case 'stop':
  115 + pause();
  116 + break;
  117 + }
  118 + });
  119 +
  120 + $('.pb_dropdown_tool li a', _body).on('click', function () {
  121 + var name = $(this).data('name');
  122 + switch (name) {
  123 + case 'exportExcel':
  124 + var base64Str = gb_map_play_back.listToExcel(gpsArray);
  125 + $(this).attr('href', base64Str);
  126 + break;
  127 + }
  128 + });
  129 +
  130 + function goto(ei) {
  131 + if(ei < 0 || ei >= len)
  132 + return;
  133 +
  134 + bar.css('width', ei * step);
  135 + var gps = gpsArray[ei];
  136 + //重新定位marker
  137 + try {
  138 + drawLine(gps.direction);
  139 + } catch (e) {
  140 + console.log(e);
  141 + }
  142 + var point = new BMap.Point(gps.bd_lon, gps.bd_lat);
  143 + marker.setPosition(point);
  144 + marker.setIcon(new BMap.Icon(gb_map_imap.createCarIconRotation(gps, width), new BMap.Size(width, 75)));
  145 +
  146 + //重新填充轨迹线,更新日志面板
  147 + trailArray = [];
  148 + var logs = [];
  149 + for (var i = 0; i <= ei; i++) {
  150 + trailArray.push(new BMap.Point(gpsArray[i].bd_lon, gpsArray[i].bd_lat));
  151 + if(i > 0 && logs[logs.length - 1].road.ROAD_CODE == gpsArray[i].road.ROAD_CODE)
  152 + logs.pop();
  153 +
  154 + logs.push(gpsArray[i]);
  155 + }
  156 + trailPolyline.setPath(trailArray);
  157 +
  158 + index = ei;
  159 + map.panTo(marker.getPosition());
  160 + //更新日志面板
  161 + logPanel.empty().html(logTemp({list: logs}));
  162 + logWrap.scrollTop(logWrap[0].scrollHeight);
  163 + }
  164 +
  165 + //播放
  166 + function play() {
  167 + $('.play-btn', _body)
  168 + .data('type', 'pause')
  169 + .find('i')
  170 + .removeClass('uk-icon-play')
  171 + .addClass('uk-icon-pause');
  172 + pauseFlag = false;
  173 + progress.addClass('uk-active');
  174 + run();
  175 +
  176 + //定时居中
  177 + fixedToCenter();
  178 + }
  179 +
  180 + var toCenterTimer;
  181 +
  182 + function fixedToCenter() {
  183 + toCenterTimer = setInterval(function () {
  184 + map.panTo(marker.getPosition());
  185 + }, 5000);
  186 + }
  187 +
  188 + //暂停
  189 + var pauseFlag;
  190 +
  191 + function pause() {
  192 + $('.play-btn', _body)
  193 + .data('type', 'play')
  194 + .find('i')
  195 + .removeClass('uk-icon-pause')
  196 + .addClass('uk-icon-play');
  197 + pauseFlag = true;
  198 + progress.removeClass('uk-active');
  199 + clearInterval(toCenterTimer);
  200 + }
  201 +
  202 + var index = 1;
  203 + var len;
  204 +
  205 + function run() {
  206 + //暂停
  207 + if (pauseFlag) {
  208 + pauseFlag = false;
  209 + return
  210 + }
  211 + //结束
  212 + if (index >= len) {
  213 + bar.css('width', '100%')
  214 + pause();
  215 + return;
  216 + }
  217 +
  218 + //marker 移动
  219 + var gps = gpsArray[index];
  220 +
  221 + //线路走向
  222 + if (gps.direction != gpsArray[index - 1].direction || index == 1)
  223 + drawLine(gps.direction);
  224 +
  225 + var point = new BMap.Point(gps.bd_lon, gps.bd_lat);
  226 + marker.setPosition(point);
  227 + marker.setIcon(new BMap.Icon(gb_map_imap.createCarIconRotation(gps, width), new BMap.Size(width, 75)));
  228 +
  229 + //轨迹线
  230 + trailArray.push(point);
  231 + trailPolyline.setPath(trailArray);
  232 +
  233 + //进度条
  234 + bar.css('width', step * index);
  235 +
  236 + //日志输出
  237 + logWrite(gps, gpsArray[index - 1]);
  238 +
  239 + index++;
  240 + setTimeout(run, 1000);
  241 + }
  242 +
  243 + //初始化地图
  244 + function initMap(data) {
  245 + gpsArray = data;
  246 + var firstPoint = new BMap.Point(data[0].bd_lon, data[0].bd_lat);
  247 + map = new BMap.Map($('.map_wrap', _body)[0]);
  248 + map.centerAndZoom(firstPoint, 17);
  249 + map.enableScrollWheelZoom();
  250 +
  251 + //创建车辆marker
  252 + marker = new BMap.Marker(firstPoint);
  253 + width = gb_map_imap.calcGpsMarkerWidth(data[0].nbbm);
  254 + //渲染icon
  255 + marker.setIcon(new BMap.Icon(gb_map_imap.createCarIconRotation(data[0], width), new BMap.Size(width, 75)));
  256 + marker.disableMassClear();
  257 + map.addOverlay(marker);
  258 +
  259 + //线路图层 数据
  260 + var routeCache = JSON.parse(storage.getItem(lineCode + '_route'));
  261 + upRoutePos = initRoutePosData(routeCache.up_bd);
  262 + downRoutePos = initRoutePosData(routeCache.down_bd);
  263 +
  264 + trailArray.push(firstPoint);
  265 + drawTrailLine();
  266 + //输出第一个点
  267 + logWrite(data[0], null);
  268 + }
  269 +
  270 + function drawTrailLine() {
  271 + trailPolyline = new BMap.Polyline(trailArray, {strokeWeight: 3, strokeColor: 'black'});
  272 + map.addOverlay(trailPolyline);
  273 + }
  274 +
  275 + function initRoutePosData(routeStr) {
  276 + var array = [], temps;
  277 + $.each(routeStr, function (i, item) {
  278 + var pos = [];
  279 + $.each(item.split(','), function () {
  280 + temps = this.split(' ');
  281 + pos.push(new BMap.Point(temps[0], temps[1]));
  282 + });
  283 + array.push(pos);
  284 + });
  285 + return array;
  286 + }
  287 +
  288 + function drawLine(updown) {
  289 + map.clearOverlays();
  290 +
  291 + var pos = updown == 0 ? upRoutePos : downRoutePos;
  292 + $.each(pos, function () {
  293 + map.addOverlay(new BMap.Polyline(this, {strokeWeight: 12, strokeColor: 'rgba(0, 0, 255, 0.6)'}));
  294 + });
  295 +
  296 + drawTrailLine();
  297 + }
  298 +
  299 + //日志输出
  300 + var logWrap = $('.pb_log_panel', _body);
  301 + var logPanel = $('.pb_log_panel .ct_table_body', _body);
  302 + gb_ct_table.fixedHead(logWrap);
  303 +
  304 + function logWrite(gps, prve) {
  305 + var code = gps.road.ROAD_CODE;
  306 + if (!prve || code != prve.road.ROAD_CODE) {
  307 + logPanel.append('<dl data-code="' + code + '" ><dd>' + gps.timeStr + '</dd><dd>' + gps.speed + '</dd><dd>' + gps.road.ROAD_NAME + '</dd><dd>正常</dd></dl>');
  308 + }
  309 + else {
  310 + var dds = logPanel.find('dl[data-code=' + code + ']').last().find('dd');
  311 + $(dds[0]).text(gps.timeStr);
  312 + $(dds[1]).text(gps.speed);
  313 + }
  314 +
  315 + logWrap.scrollTop(logWrap[0].scrollHeight);
  316 + }
  317 + })();
  318 + </script>
319 </div> 319 </div>
320 \ No newline at end of file 320 \ No newline at end of file
src/main/resources/static/real_control_v2/mapmonitor/js/playback.js
1 -/* 地图模块 轨迹回放 */  
2 -  
3 -var gb_map_play_back = (function () {  
4 -  
5 - var dom;  
6 - $.get('/real_control_v2/mapmonitor/fragments/playback/main.html', function (rs) {  
7 - dom = rs;  
8 - });  
9 -  
10 - var initParams = function (deviceId, nbbm) {  
11 - //关闭infowindow  
12 - if (deviceId)  
13 - gb_map_imap.call('closeWin', deviceId);  
14 -  
15 - //show modal  
16 - var modal = '#map-playback-modal';  
17 - $(document.body).append(dom);  
18 - UIkit.modal(modal, {bgclose: false}).show();  
19 - $(modal).trigger('show_form', {deviceId: deviceId, nbbm: nbbm});  
20 - };  
21 -  
22 - //导出excel  
23 - var listToExcel = function (list) {  
24 - var temp = '<html>' +  
25 - ' <head> '+  
26 - ' </head>' +  
27 - ' <body>' +  
28 - ' <table border="1">' +  
29 - ' <tr><th>序号</th><th>车辆</th><th>所在道路</th><th>经度</th><th>纬度</th><th>时间</th><th>速度</th></tr>' +  
30 - ' {{each list as gps i}}' +  
31 - ' <tr><td>{{i+1}}</td><td>{{gps.nbbm}}</td><td>{{gps.road.ROAD_NAME}}</td><td>{{gps.bd_lon}}</td><td>{{gps.bd_lat}}</td><td>{{gps.timeStr2}}</td><td>{{gps.speed}}</td></tr>' +  
32 - ' {{/each}}' +  
33 - ' </table>' +  
34 - ' </body>' +  
35 - ' </html>';  
36 -  
37 - var rs = template.compile(temp)({list: list});  
38 -  
39 - var uri = 'data:application/vnd.ms-excel;base64,';  
40 - return uri + base64(rs);  
41 - //location.href = uri + base64(rs);  
42 - };  
43 -  
44 -  
45 - function base64(string) {  
46 - return window.btoa(unescape(encodeURIComponent(string)));  
47 - }  
48 -  
49 - return {  
50 - initParams: initParams,  
51 - listToExcel: listToExcel  
52 - } 1 +/* 地图模块 轨迹回放 */
  2 +
  3 +var gb_map_play_back = (function () {
  4 +
  5 + var dom;
  6 + $.get('/real_control_v2/mapmonitor/fragments/playback/main.html', function (rs) {
  7 + dom = rs;
  8 + });
  9 +
  10 + var initParams = function (deviceId, nbbm) {
  11 + //关闭infowindow
  12 + if (deviceId)
  13 + gb_map_imap.call('closeWin', deviceId);
  14 +
  15 + //show modal
  16 + var modal = '#map-playback-modal';
  17 + $(document.body).append(dom);
  18 + UIkit.modal(modal, {bgclose: false}).show();
  19 + $(modal).trigger('show_form', {deviceId: deviceId, nbbm: nbbm});
  20 + };
  21 +
  22 + //导出excel
  23 + var listToExcel = function (list) {
  24 + var temp = '<html>' +
  25 + ' <head> '+
  26 + ' </head>' +
  27 + ' <body>' +
  28 + ' <table border="1">' +
  29 + ' <tr><th>序号</th><th>车辆</th><th>所在道路</th><th>经度</th><th>纬度</th><th>时间</th><th>速度</th></tr>' +
  30 + ' {{each list as gps i}}' +
  31 + ' <tr><td>{{i+1}}</td><td>{{gps.nbbm}}</td><td>{{gps.road.ROAD_NAME}}</td><td>{{gps.bd_lon}}</td><td>{{gps.bd_lat}}</td><td>{{gps.timeStr2}}</td><td>{{gps.speed}}</td></tr>' +
  32 + ' {{/each}}' +
  33 + ' </table>' +
  34 + ' </body>' +
  35 + ' </html>';
  36 +
  37 + var rs = template.compile(temp)({list: list});
  38 +
  39 + var uri = 'data:application/vnd.ms-excel;base64,';
  40 + return uri + base64(rs);
  41 + //location.href = uri + base64(rs);
  42 + };
  43 +
  44 +
  45 + function base64(string) {
  46 + return window.btoa(unescape(encodeURIComponent(string)));
  47 + }
  48 +
  49 + return {
  50 + initParams: initParams,
  51 + listToExcel: listToExcel
  52 + }
53 })(); 53 })();
54 \ No newline at end of file 54 \ No newline at end of file