Commit 5acbb9c83336b90911063fc503873145a79102bc

Authored by 娄高锋
2 parents 68257dd4 609c1137

Merge branch 'minhang' of 192.168.168.201:panzhaov5/bsth_control into minhang

Showing 65 changed files with 3034 additions and 460 deletions

Too many changes to show.

To preserve performance only 65 of 104 files are displayed.

... ... @@ -225,6 +225,12 @@
225 225 <artifactId>spring-boot-devtools</artifactId>
226 226 <optional>true</optional>
227 227 </dependency>-->
  228 + <dependency>
  229 + <groupId>com.vividsolutions</groupId>
  230 + <artifactId>jts</artifactId>
  231 + <version>1.13</version>
  232 + </dependency>
  233 +
228 234 </dependencies>
229 235  
230 236 <dependencyManagement>
... ...
src/main/java/com/bsth/controller/forms/ExportController.java
... ... @@ -65,10 +65,12 @@ public class ExportController {
65 65 i++;
66 66 }
67 67  
  68 +
  69 +
68 70 try {
69 71 listI.add(resList.iterator());
70 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 74 path + "export\\线路客流量报表" + sdfSimple.format(sdfMonth.parse(map.get("date").toString())) + ".xls");
73 75 } catch (Exception e) {
74 76 e.printStackTrace();
... ... @@ -189,7 +191,7 @@ public class ExportController {
189 191 listI.add(resList.iterator());
190 192 String path = this.getClass().getResource("/").getPath() + "static\\pages\\forms\\";
191 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 195 } catch (Exception e) {
194 196 e.printStackTrace();
195 197 }
... ... @@ -203,8 +205,8 @@ public class ExportController {
203 205 SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), sdfSimple = new SimpleDateFormat("yyyyMMdd");
204 206 List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
205 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 210 List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>();
209 211 int i = 1;
210 212 for (Vehicleloading l : vehicleloading) {
... ... @@ -214,8 +216,8 @@ public class ExportController {
214 216 m.put("gS", l.getgS());
215 217 m.put("xL", l.getxL());
216 218 m.put("clzbh", l.getClzbh());
217   - m.put("hyl", l.getHyl());
218 219 m.put("jzl", l.getJzl());
  220 + m.put("hyl", l.getHyl());
219 221 m.put("ls", l.getLs());
220 222 m.put("jhlc", l.getJhlc());
221 223 m.put("unyyyl", l.getUnyyyl());
... ... @@ -229,7 +231,7 @@ public class ExportController {
229 231 listI.add(resList.iterator());
230 232 String path = this.getClass().getResource("/").getPath() + "static\\pages\\forms\\";
231 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 235 } catch (Exception e) {
234 236 e.printStackTrace();
235 237 }
... ... @@ -417,5 +419,9 @@ public class ExportController {
417 419 }
418 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 80  
81 81 // 车辆加注
82 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 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/controller/gps/GpsController.java
1 1 package com.bsth.controller.gps;
2 2  
3   -import java.util.List;
4   -import java.util.Map;
5   -
6   -import org.springframework.beans.factory.annotation.Autowired;
7   -import org.springframework.web.bind.annotation.*;
8   -
9 3 import com.bsth.data.BasicData;
10 4 import com.bsth.data.gpsdata.GpsEntity;
11 5 import com.bsth.data.gpsdata.GpsRealData;
12 6 import com.bsth.service.gps.GpsService;
13 7 import com.google.common.base.Splitter;
  8 +import org.springframework.beans.factory.annotation.Autowired;
  9 +import org.springframework.web.bind.annotation.*;
  10 +
  11 +import java.util.List;
  12 +import java.util.Map;
14 13  
15 14 @RestController
16 15 @RequestMapping("gps")
... ... @@ -70,7 +69,7 @@ public class GpsController {
70 69 return gpsService.history(nbbmArray, st, et);
71 70 }
72 71  
73   - /*@RequestMapping(value = "/arrival/ram")
  72 + /*@RequestMapping(value = "/analyse/ram")
74 73 public List<ArrivalInfo> ramData(@RequestParam String nbbm) {
75 74 return ArrivalDataBuffer.allMap.get(nbbm);
76 75 }*/
... ... @@ -84,4 +83,9 @@ public class GpsController {
84 83 public Map<String, Object> findBuffAeraByCode(@RequestParam String code,@RequestParam String type){
85 84 return gpsService.findBuffAeraByCode(code, type);
86 85 }
  86 +
  87 + @RequestMapping(value = "/findRoadSpeed")
  88 + public Map<String, Object> findRoadSpeed(@RequestParam String lineCode){
  89 + return gpsService.findRoadSpeed(lineCode);
  90 + }
87 91 }
... ...
src/main/java/com/bsth/controller/oil/YlbController.java
... ... @@ -3,7 +3,9 @@ package com.bsth.controller.oil;
3 3 import java.text.ParseException;
4 4 import java.text.SimpleDateFormat;
5 5 import java.util.ArrayList;
  6 +import java.util.Calendar;
6 7 import java.util.Date;
  8 +import java.util.GregorianCalendar;
7 9 import java.util.HashMap;
8 10 import java.util.Iterator;
9 11 import java.util.List;
... ... @@ -107,8 +109,16 @@ public class YlbController extends BaseController&lt;Ylb, Integer&gt;{
107 109 try {
108 110 String rq=map.get("rq").toString();
109 111 if(!(rq=="")){
  112 +
110 113 SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");
111   - map.put("rq_eq", sdf.parse(rq));
  114 + Calendar calendar = new GregorianCalendar();
  115 + calendar.setTime(sdf.parse(rq));
  116 + calendar.add(calendar.DATE,1);
  117 + Date date=calendar.getTime();
  118 + map.put("rq_ge", rq);
  119 + map.put("rq_le", sdf.format(date));
  120 + System.out.println(rq);
  121 + System.out.println(sdf.format(date));
112 122 }
113 123 } catch (ParseException e) {
114 124 // TODO Auto-generated catch block
... ...
src/main/java/com/bsth/controller/realcontrol/ScheduleRealInfoController.java
... ... @@ -292,8 +292,9 @@ public class ScheduleRealInfoController extends BaseController&lt;ScheduleRealInfo,
292 292 }
293 293  
294 294 @RequestMapping(value = "/queryUserInfo")
295   - public List<ScheduleRealInfo> queryUserInfo(@RequestParam String line, @RequestParam String date) {
296   - return scheduleRealInfoService.queryUserInfo(line, date);
  295 + public List<ScheduleRealInfo> queryUserInfo(@RequestParam String line,
  296 + @RequestParam String date,@RequestParam String state) {
  297 + return scheduleRealInfoService.queryUserInfo(line, date,state);
297 298 }
298 299  
299 300 @RequestMapping(value = "/exportWaybill")
... ...
src/main/java/com/bsth/controller/report/ReportController.java
... ... @@ -50,23 +50,28 @@ public class ReportController {
50 50 }
51 51  
52 52 @RequestMapping(value = "/tbodyTime1", method = RequestMethod.GET)
53   - public Map<String, Object> tbodyTime1(@RequestParam String line,@RequestParam String date) {
54   - return service.tbodyTime1(line, date);
  53 + public Map<String, Object> tbodyTime1(@RequestParam String line,@RequestParam String ttinfo) {
  54 + return service.tbodyTime1(line, ttinfo);
55 55 }
56 56  
57 57 @RequestMapping(value = "/tbodyTime2", method = RequestMethod.GET)
58   - public Map<String, Object> tbodyTime2(@RequestParam String line,@RequestParam String date) {
59   - return service.tbodyTime2(line, date);
  58 + public Map<String, Object> tbodyTime2(@RequestParam String line,@RequestParam String ttinfo) {
  59 + return service.tbodyTime2(line, ttinfo);
60 60 }
61 61  
62 62 @RequestMapping(value = "/tbodyTime3", method = RequestMethod.GET)
63   - public List<Map<String, Object>> tbodyTime3(@RequestParam String line,@RequestParam String date) {
64   - return service.tbodyTime3(line, date);
  63 + public List<Map<String, Object>> tbodyTime3(@RequestParam String line,@RequestParam String ttinfo) {
  64 + return service.tbodyTime3(line, ttinfo);
65 65 }
66 66  
67 67 @RequestMapping(value = "/tbodyTime5", method = RequestMethod.GET)
68   - public List<Map<String, Object>> tbodyTime5(@RequestParam String line,@RequestParam String date) {
69   - return service.tbodyTime5(line, date);
  68 + public List<Map<String, Object>> tbodyTime5(@RequestParam String line,@RequestParam String ttinfo) {
  69 + return service.tbodyTime5(line, ttinfo);
  70 + }
  71 +
  72 + @RequestMapping(value="/getTtinfo", method = RequestMethod.GET)
  73 + public List<Map<String,Object>> getTtinfo(@RequestParam Map<String, Object> map){
  74 + return service.getTtinfo(map);
70 75 }
71 76  
72 77 }
... ...
src/main/java/com/bsth/data/BasicData.java
1 1 package com.bsth.data;
2 2  
3 3 import com.bsth.Application;
  4 +import com.bsth.data.gpsdata.analyse.GeoCacheData;
4 5 import com.bsth.entity.*;
5 6 import com.bsth.entity.schedule.CarConfigInfo;
6 7 import com.bsth.repository.*;
... ... @@ -57,7 +58,7 @@ public class BasicData implements CommandLineRunner {
57 58 public static Map<String, String> lineCode2NameMap;
58 59  
59 60 //线路编码_站点编码 == 0|1 上下行
60   - public static Map<String, Integer> lineStationUpDownMap;
  61 + //public static Map<String, Integer> lineStationUpDownMap;
61 62  
62 63 //停车场
63 64 public static List<String> parkCodeList;
... ... @@ -86,7 +87,7 @@ public class BasicData implements CommandLineRunner {
86 87  
87 88 @Override
88 89 public void run(String... arg0) throws Exception {
89   - Application.mainServices.scheduleWithFixedDelay(dataLoader, 0, 1, TimeUnit.HOURS);
  90 + Application.mainServices.scheduleWithFixedDelay(dataLoader, 2, 2, TimeUnit.HOURS);
90 91 }
91 92  
92 93  
... ... @@ -117,6 +118,9 @@ public class BasicData implements CommandLineRunner {
117 118 @Autowired
118 119 BusinessRepository businessRepository;
119 120  
  121 + @Autowired
  122 + GeoCacheData geoCacheData;
  123 +
120 124  
121 125 @Override
122 126 public void run() {
... ... @@ -138,11 +142,13 @@ public class BasicData implements CommandLineRunner {
138 142 //车辆和线路映射信息
139 143 loadNbbm2LineInfo();
140 144 //站点路由信息
141   - loadStationRouteInfo();
  145 + //loadStationRouteInfo();
142 146 //人员信息
143 147 loadPersonnelInfo();
144 148 //公司信息
145 149 loadBusinessInfo();
  150 +
  151 + geoCacheData.loadData();
146 152 logger.info("加载基础数据成功!,");
147 153 } catch (Exception e) {
148 154 logger.error("加载基础数据时出现异常,", e);
... ... @@ -151,7 +157,7 @@ public class BasicData implements CommandLineRunner {
151 157 }
152 158  
153 159  
154   - private void loadStationRouteInfo() {
  160 +/* private void loadStationRouteInfo() {
155 161 Iterator<StationRoute> iterator = stationRouteRepository.findAllEffective().iterator();
156 162  
157 163 Map<String, String> sePointMap = new HashMap<>();
... ... @@ -172,7 +178,7 @@ public class BasicData implements CommandLineRunner {
172 178 }
173 179 lineStationUpDownMap = map;
174 180 lineSEPointMap = sePointMap;
175   - }
  181 + }*/
176 182  
177 183 /**
178 184 * loadBusinessInfo
... ... @@ -280,7 +286,7 @@ public class BasicData implements CommandLineRunner {
280 286 /**
281 287 * 加载运管处的站点及序号
282 288 * 上行从1开始,下行顺序续编
283   - */
  289 +
284 290 List<Object[]> ygcLines = stationRouteRepository.findAllLineWithYgc();
285 291 if(ygcLines != null && ygcLines.size() > 0){
286 292 int size = ygcLines.size();
... ... @@ -299,7 +305,7 @@ public class BasicData implements CommandLineRunner {
299 305 key = tempArray[0] + "_"+tempArray[1] + "_"+tempArray[2];
300 306 tempStationName2YgcNumber.put(key,num++);
301 307 }
302   - }
  308 + }*/
303 309 }
304 310  
305 311 lineId2CodeMap = biMap;
... ...
src/main/java/com/bsth/data/arrival/AnalyseData.java
1 1 package com.bsth.data.arrival;
2 2  
3   -import java.util.ArrayList;
4   -import java.util.Collections;
5   -import java.util.List;
6   -import java.util.Set;
7   -
8 3 import org.slf4j.Logger;
9 4 import org.slf4j.LoggerFactory;
10 5 import org.springframework.stereotype.Component;
11 6  
12   -import com.bsth.data.BasicData;
  7 +import java.util.ArrayList;
  8 +import java.util.Collections;
  9 +import java.util.List;
  10 +import java.util.Set;
13 11  
14 12 /**
15 13 *
... ... @@ -98,14 +96,15 @@ public class AnalyseData {
98 96 }
99 97  
100 98 private boolean effective(ArrivalEntity arr){
101   - //停车场
  99 + /*//停车场
102 100 if(BasicData.parkCodeList.contains(arr.getStopNo())){
103 101 arr.setTcc(true);
104 102 return true;
105 103 }
106   -
  104 +
107 105 Integer upDown = BasicData.lineStationUpDownMap.get(arr.getLineCode() + "_" + arr.getStopNo());
108   -
109   - return arr.getUpDown() == upDown || BasicData.parkCodeList.contains(arr.getStopNo());
  106 +
  107 + return arr.getUpDown() == upDown || BasicData.parkCodeList.contains(arr.getStopNo());*/
  108 + return false;
110 109 }
111 110 }
... ...
src/main/java/com/bsth/data/forecast/ForecastRealServer.java
... ... @@ -70,7 +70,7 @@ public class ForecastRealServer implements CommandLineRunner {
70 70 /* public void forecast(String nbbm){
71 71 logger.info("预测," + nbbm);
72 72 //当前执行班次
73   - ScheduleRealInfo sch = dayOfSchedule.execPlamMap().get(nbbm);
  73 + ScheduleRealInfo sch = dayOfSchedule.execPlanMap().get(nbbm);
74 74 if(null == sch)
75 75 return;
76 76  
... ... @@ -86,7 +86,7 @@ public class ForecastRealServer implements CommandLineRunner {
86 86 //终点站
87 87 String eStation = null;
88 88 //当前执行班次
89   - ScheduleRealInfo sch = dayOfSchedule.execPlamMap().get(nbbm);
  89 + ScheduleRealInfo sch = dayOfSchedule.execPlanMap().get(nbbm);
90 90 if(null != sch)
91 91 eStation = sch.getZdzCode();
92 92  
... ...
src/main/java/com/bsth/data/gpsdata/GpsEntity.java
1 1 package com.bsth.data.gpsdata;
2 2  
  3 +import com.bsth.data.gpsdata.analyse.StationRoute;
  4 +import com.fasterxml.jackson.annotation.JsonIgnore;
  5 +
3 6 /**
4 7 *
5 8 * @ClassName: GpsRealData
... ... @@ -58,21 +61,32 @@ public class GpsEntity {
58 61 /** 预计到达终点时间 */
59 62 private Float expectStopTime;
60 63  
61   - /** 设备是否在线 */
  64 + /** 设备是否在线
62 65 private boolean online;
63   -
  66 + */
64 67 /** 当前执行班次ID */
65 68 private Long schId;
66 69  
67 70 /** 是否异常数据 */
68 71 private boolean abnormal;
69   -
70   - private int valid;
  72 +/*
  73 + private int valid;*/
71 74  
72 75 private int version;
73 76  
74   - /** 是否起终点站 */
  77 + /** 是否起终点站
75 78 private boolean sEPoint;
  79 + */
  80 +
  81 + /** 站内 */
  82 + private boolean instation;
  83 +
  84 + /** 站点信息,站内时有值 */
  85 + @JsonIgnore
  86 + private StationRoute station;
  87 +
  88 + /** 状态 */
  89 + private String state2;
76 90  
77 91 public Integer getCompanyCode() {
78 92 return companyCode;
... ... @@ -178,14 +192,6 @@ public class GpsEntity {
178 192 this.stationName = stationName;
179 193 }
180 194  
181   - public boolean isOnline() {
182   - return online;
183   - }
184   -
185   - public void setOnline(boolean online) {
186   - this.online = online;
187   - }
188   -
189 195 public long getArrTime() {
190 196 return arrTime;
191 197 }
... ... @@ -218,35 +224,44 @@ public class GpsEntity {
218 224 this.schId = schId;
219 225 }
220 226  
221   - public boolean isAbnormal() {
222   - return abnormal;
  227 +
  228 + public int getVersion() {
  229 + return version;
223 230 }
224 231  
225   - public void setAbnormal(boolean abnormal) {
226   - this.abnormal = abnormal;
  232 + public void setVersion(int version) {
  233 + this.version = version;
227 234 }
228 235  
229   - public int getValid() {
230   - return valid;
  236 + public boolean isInstation() {
  237 + return instation;
231 238 }
232 239  
233   - public void setValid(int valid) {
234   - this.valid = valid;
  240 + public void setInstation(boolean instation) {
  241 + this.instation = instation;
235 242 }
236 243  
237   - public int getVersion() {
238   - return version;
  244 + public StationRoute getStation() {
  245 + return station;
239 246 }
240 247  
241   - public void setVersion(int version) {
242   - this.version = version;
  248 + public void setStation(StationRoute station) {
  249 + this.station = station;
  250 + }
  251 +
  252 + public boolean isAbnormal() {
  253 + return abnormal;
  254 + }
  255 +
  256 + public void setAbnormal(boolean abnormal) {
  257 + this.abnormal = abnormal;
243 258 }
244 259  
245   - public boolean issEPoint() {
246   - return sEPoint;
  260 + public String getState2() {
  261 + return state2;
247 262 }
248 263  
249   - public void setsEPoint(boolean sEPoint) {
250   - this.sEPoint = sEPoint;
  264 + public void setState2(String state2) {
  265 + this.state2 = state2;
251 266 }
252 267 }
... ...
src/main/java/com/bsth/data/gpsdata/GpsRealData.java
... ... @@ -5,6 +5,8 @@ import com.alibaba.fastjson.JSONObject;
5 5 import com.bsth.Application;
6 6 import com.bsth.data.BasicData;
7 7 import com.bsth.data.forecast.ForecastRealServer;
  8 +import com.bsth.data.gpsdata.analyse.GpsAnalyse;
  9 +import com.bsth.data.gpsdata.recovery.GpsDataRecovery;
8 10 import com.bsth.data.schedule.DayOfSchedule;
9 11 import com.bsth.entity.realcontrol.ScheduleRealInfo;
10 12 import com.bsth.util.ConfigUtil;
... ... @@ -55,6 +57,9 @@ public class GpsRealData implements CommandLineRunner{
55 57  
56 58 @Autowired
57 59 ForecastRealServer forecastRealServer;
  60 +
  61 +
  62 +
58 63 /**
59 64 * 构造函数
60 65 */
... ... @@ -67,13 +72,17 @@ public class GpsRealData implements CommandLineRunner{
67 72 @Override
68 73 public void run(String... arg0) throws Exception {
69 74 logger.info("gpsDataLoader,20,6");
70   - Application.mainServices.scheduleWithFixedDelay(gpsDataLoader, 20, 5, TimeUnit.SECONDS);
  75 + Application.mainServices.scheduleWithFixedDelay(gpsDataLoader, 40, 20, TimeUnit.SECONDS);
71 76 }
72 77  
73 78 public GpsEntity add(GpsEntity gps) {
74 79 String device = gps.getDeviceId();
75 80 GpsEntity old = gpsMap.get(device);
76 81  
  82 + //分析gps
  83 + if(isAvailable(gps) && (old == null || old.getTimestamp() != gps.getTimestamp()))
  84 + GpsAnalyse.start(gps);
  85 +
77 86 if(!StringUtils.isEmpty(gps.getStopNo())){
78 87 //定时定距数据附带站点编码改变
79 88 if(null == old || !gps.getStopNo().equals(old.getStopNo())){
... ... @@ -94,6 +103,11 @@ public class GpsRealData implements CommandLineRunner{
94 103 return gps;
95 104 }
96 105  
  106 + public boolean isAvailable(GpsEntity gps){
  107 + return StringUtils.isNotEmpty(gps.getLineId()) &&
  108 + dayOfSchedule.getCurrSchDate().containsKey(gps.getLineId());
  109 + }
  110 +
97 111 /**
98 112 *
99 113 * @Title: get @Description: TODO(设备号获取GPS)
... ... @@ -118,7 +132,7 @@ public class GpsRealData implements CommandLineRunner{
118 132 if(gps.isAbnormal())
119 133 continue;
120 134  
121   - sch = dayOfSchedule.execPlamMap().get(gps.getNbbm());
  135 + sch = dayOfSchedule.execPlanMap().get(gps.getNbbm());
122 136 if(null != sch)
123 137 gps.setSchId(sch.getId());
124 138 rs.add(gps);
... ... @@ -161,6 +175,11 @@ public class GpsRealData implements CommandLineRunner{
161 175 @Override
162 176 public void run() {
163 177 try{
  178 + //如果正在恢复数据
  179 + if(GpsDataRecovery.run){
  180 + return;
  181 + }
  182 +
164 183 load();
165 184 }catch(Exception e){
166 185 logger.error("", e);
... ... @@ -207,21 +226,7 @@ public class GpsRealData implements CommandLineRunner{
207 226 gpsRealData.add(gps);
208 227  
209 228 //纠正走向
210   - correctUpdown(gps);
211   - /*if(issEPoint(gps))
212   - continue;
213   -
214   - //如果走向未知,尝试根据站点纠正走向
215   - if(gps.getUpDown() == -1){
216   - updown=stationUpDownMap.get(gps.getLineId()+"_"+gps.getStopNo());
217   - if(updown != null)
218   - gps.setUpDown(updown);
219   - }
220   - //如果站点编码和走向相反(即上行站点ID,走向为下行),尝试根据站点纠正走向
221   - updown=stationUpDownMap.get(gps.getLineId()+"_"+gps.getStopNo());
222   - if(updown != null && !gps.getUpDown().equals(updown)){
223   - gps.setUpDown(updown);
224   - }*/
  229 + //correctUpdown(gps);
225 230 }
226 231 } else
227 232 logger.error("result is null");
... ... @@ -240,7 +245,7 @@ public class GpsRealData implements CommandLineRunner{
240 245 * 是否是起终点
241 246 * @param gps
242 247 * @return
243   - */
  248 +
244 249 public boolean isSEPoint(GpsEntity gps){
245 250 String key = gps.getLineId()+"_"+gps.getUpDown()+"_"
246 251 ,stationCode;
... ... @@ -261,29 +266,19 @@ public class GpsRealData implements CommandLineRunner{
261 266 }
262 267 }
263 268 return false;
264   - }
  269 + }*/
265 270  
266 271 /**
267 272 * 纠正上下行
268 273 * @param gps
269   - */
  274 +
270 275 public void correctUpdown(GpsEntity gps){
271 276 Integer updown=BasicData.lineStationUpDownMap.get(gps.getLineId()+"_"+gps.getStopNo());
272 277 if(updown != null && !updown.equals(gps.getUpDown()))
273 278 gps.setUpDown(updown);
274   - /*//如果走向未知,尝试根据站点纠正走向
275   - if(gps.getUpDown() == -1){
276   -
277   - }*/
278 279  
279 280 if(isSEPoint(gps))
280 281 return;
281   -
282   - /*//如果站点编码和走向相反(即上行站点ID,走向为下行),尝试根据站点纠正走向
283   - updown=BasicData.lineStationUpDownMap.get(gps.getLineId()+"_"+gps.getStopNo());
284   - if(updown != null && !gps.getUpDown().equals(updown)){
285   - gps.setUpDown(updown);
286   - }*/
287   - }
  282 + }*/
288 283 }
289   -}
  284 +}
290 285 \ No newline at end of file
... ...
src/main/java/com/bsth/data/gpsdata/analyse/CircleQueue.java 0 → 100644
  1 +package com.bsth.data.gpsdata.analyse;
  2 +
  3 +import java.util.Arrays;
  4 +
  5 +/**
  6 + * 循环队列
  7 + * Created by panzhao on 2016/12/23.
  8 + */
  9 +public class CircleQueue<T> {
  10 +
  11 + /**
  12 + * (循环队列)数组的容量
  13 + */
  14 + public int capacity;
  15 +
  16 + /**
  17 + * 数组:保存循环队列的元素
  18 + */
  19 + public Object[] elementData;
  20 +
  21 + /**
  22 + * 队头(先进先出)
  23 + */
  24 + public int head = 0;
  25 +
  26 + /**
  27 + * 队尾
  28 + */
  29 + public int tail = 0;
  30 +
  31 + /**
  32 + * 以指定长度的数组来创建循环队列
  33 + *
  34 + * @param initSize
  35 + */
  36 + public CircleQueue(final int initSize) {
  37 + capacity = initSize;
  38 + elementData = new Object[capacity];
  39 + }
  40 +
  41 + /**
  42 + * 获取循环队列的大小(包含元素的个数)
  43 + */
  44 + public int size() {
  45 + if (isEmpty()) {
  46 + return 0;
  47 + } else if (isFull()) {
  48 + return capacity;
  49 + } else {
  50 + return tail + 1;
  51 + }
  52 + }
  53 +
  54 + /**
  55 + * 插入队尾一个元素
  56 + */
  57 + public void add(final T element) {
  58 + if (isEmpty()) {
  59 + elementData[0] = element;
  60 + } else if (isFull()) {
  61 + elementData[head] = element;
  62 + head++;
  63 + tail++;
  64 + head = head == capacity ? 0 : head;
  65 + tail = tail == capacity ? 0 : tail;
  66 + } else {
  67 + elementData[tail + 1] = element;
  68 + tail++;
  69 + }
  70 + }
  71 +
  72 + public boolean isEmpty() {
  73 + return tail == head && tail == 0 && elementData[tail] == null;
  74 + }
  75 +
  76 + public boolean isFull() {
  77 + return head != 0 && head - tail == 1 || head == 0 && tail == capacity - 1;
  78 + }
  79 +
  80 + public void clear() {
  81 + Arrays.fill(elementData, null);
  82 + head = 0;
  83 + tail = 0;
  84 + }
  85 +
  86 + /**
  87 + * @return 取 循环队列里的值(先进的index=0)
  88 + */
  89 + public Object[] getQueue() {
  90 + final Object[] elementDataSort = new Object[capacity];
  91 + final Object[] elementDataCopy = elementData.clone();
  92 + if (isEmpty()) {
  93 + } else if (isFull()) {
  94 + int indexMax = capacity;
  95 + int indexSort = 0;
  96 + for (int i = head; i < indexMax;) {
  97 + elementDataSort[indexSort] = elementDataCopy[i];
  98 + indexSort++;
  99 + i++;
  100 + if (i == capacity) {
  101 + i = 0;
  102 + indexMax = head;
  103 + }
  104 + }
  105 + } else {
  106 + for (int i = 0; i < tail; i++) {
  107 + elementDataSort[i] = elementDataCopy[i];
  108 + }
  109 + }
  110 + return elementDataSort;
  111 + }
  112 +
  113 + public T getTail(){
  114 + return elementData[tail] == null?null:(T)elementData[tail];
  115 + }
  116 +}
0 117 \ No newline at end of file
... ...
src/main/java/com/bsth/data/gpsdata/analyse/GeoCacheData.java 0 → 100644
  1 +package com.bsth.data.gpsdata.analyse;
  2 +
  3 +import com.bsth.data.gpsdata.GpsEntity;
  4 +import com.google.common.collect.ArrayListMultimap;
  5 +import com.vividsolutions.jts.geom.Coordinate;
  6 +import com.vividsolutions.jts.geom.GeometryFactory;
  7 +import com.vividsolutions.jts.geom.LineString;
  8 +import com.vividsolutions.jts.geom.Polygon;
  9 +import org.apache.commons.lang3.StringUtils;
  10 +import org.slf4j.Logger;
  11 +import org.slf4j.LoggerFactory;
  12 +import org.springframework.beans.factory.annotation.Autowired;
  13 +import org.springframework.jdbc.core.JdbcTemplate;
  14 +import org.springframework.jdbc.core.RowMapper;
  15 +import org.springframework.stereotype.Component;
  16 +
  17 +import java.sql.ResultSet;
  18 +import java.sql.SQLException;
  19 +import java.util.*;
  20 +
  21 +/**
  22 + * Created by panzhao on 2016/12/23.
  23 + */
  24 +@Component
  25 +public class GeoCacheData {
  26 +
  27 + static Logger logger = LoggerFactory.getLogger(GeoCacheData.class);
  28 +
  29 + //每辆车缓存最后200条gps
  30 + private static final int CACHE_SIZE = 200;
  31 + private static Map<String, CircleQueue<GpsEntity>> gpsCacheMap = new HashMap<>();
  32 +
  33 + //线路路段走向
  34 + private static ArrayListMultimap<String, LineString> sectionCacheMap;
  35 +
  36 + //线路站点路由
  37 + private static ArrayListMultimap<String, StationRoute> stationCacheMap;
  38 +
  39 + //停车场
  40 + public static Map<String, Polygon> tccMap;
  41 +
  42 + @Autowired
  43 + JdbcTemplate jdbcTemplate;
  44 +
  45 + public static CircleQueue<GpsEntity> getGps(String nbbm) {
  46 + return gpsCacheMap.get(nbbm);
  47 + }
  48 +
  49 + public static void putGps(GpsEntity gps) {
  50 + CircleQueue<GpsEntity> queue = gpsCacheMap.get(gps.getNbbm());
  51 + if (queue == null) {
  52 + //第一个点从站内开始
  53 + if(!gps.isInstation())
  54 + return;
  55 +
  56 + queue = new CircleQueue<>(CACHE_SIZE);
  57 + gpsCacheMap.put(gps.getNbbm(), queue);
  58 + }
  59 + queue.add(gps);
  60 + }
  61 +
  62 + public static List<StationRoute> getStationRoute(String lineCode, int directions) {
  63 + return stationCacheMap.get(lineCode + "_" + directions);
  64 + }
  65 +
  66 + public static StationRoute getStation(String lineCode, int directions, String code) {
  67 + List<StationRoute> list = getStationRoute(lineCode, directions);
  68 +
  69 + for (StationRoute sr : list) {
  70 + if (sr.getCode().equals(code)) {
  71 + return sr;
  72 + }
  73 + }
  74 + return null;
  75 + }
  76 +
  77 + public static Polygon getTccPolygon(String code){
  78 + return tccMap.get(code);
  79 + }
  80 +
  81 + public void loadData() {
  82 + final GeometryFactory geometryFactory = new GeometryFactory();
  83 + //加载站点路由
  84 + String sql = "select r.LINE_CODE,r.DIRECTIONS,r.STATION_CODE,r.STATION_MARK,s.SHAPES_TYPE,s.G_LONX,s.G_LATY,ST_AsText(s.G_POLYGON_GRID) as G_POLYGON_GRID,s.RADIUS, r.STATION_ROUTE_CODE from bsth_c_stationroute r left join bsth_c_station s on r.station=s.id where r.destroy=0 order by r.station_route_code";
  85 + List<StationRoute> routeList = jdbcTemplate.query(sql, new RowMapper<StationRoute>() {
  86 + @Override
  87 + public StationRoute mapRow(ResultSet rs, int rowNum) throws SQLException {
  88 + StationRoute sRoute = new StationRoute();
  89 + sRoute.setCode(rs.getString("STATION_CODE"));
  90 + sRoute.setLineCode(rs.getString("LINE_CODE"));
  91 + sRoute.setDirections(rs.getInt("DIRECTIONS"));
  92 + sRoute.setPoint(geometryFactory.createPoint(new Coordinate(rs.getFloat("G_LATY"), rs.getFloat("G_LONX"))));
  93 + sRoute.setRadius(rs.getFloat("RADIUS"));
  94 + sRoute.setRouteSort(rs.getInt("STATION_ROUTE_CODE"));
  95 + sRoute.setMark(rs.getString("STATION_MARK"));
  96 +
  97 + String shapesType = rs.getString("SHAPES_TYPE");
  98 + //多边形电子围栏
  99 + if (StringUtils.isNotEmpty(shapesType) && shapesType.equals("d")) {
  100 + geometryFactory.createPolygon(parsePolygon(rs.getString("G_POLYGON_GRID")));
  101 + }
  102 + return sRoute;
  103 + }
  104 + });
  105 + //按线路和走向分组
  106 + if (routeList.size() > 0) {
  107 + ArrayListMultimap<String, StationRoute> tempMap = ArrayListMultimap.create();
  108 + for (StationRoute sr : routeList) {
  109 + tempMap.put(sr.getLineCode() + "_" + sr.getDirections(), sr);
  110 + }
  111 +
  112 + StationRouteComp srCom = new StationRouteComp();
  113 + //连接路由
  114 + Set<String> set = tempMap.keySet();
  115 + for (String key : set) {
  116 + Collections.sort(tempMap.get(key), srCom);
  117 + connectStationRoute(tempMap.get(key));
  118 + }
  119 +
  120 + stationCacheMap = tempMap;
  121 + }
  122 +
  123 + //加载停车场数据
  124 + sql = "select PARK_CODE, ST_AsText(G_PARK_POINT) as G_PARK_POINT from bsth_c_car_park where park_code is not null and b_park_point is not null";
  125 + List<Map<String, Object>> tccList = jdbcTemplate.queryForList(sql);
  126 + Map<String, Polygon> tccTempMap = new HashMap<>();
  127 +
  128 + Polygon polygon;
  129 + for (Map<String, Object> tMap : tccList) {
  130 +
  131 + try {
  132 + polygon = geometryFactory.createPolygon(parsePolygon(tMap.get("G_PARK_POINT").toString()));
  133 + tccTempMap.put(tMap.get("PARK_CODE").toString()
  134 + , polygon);
  135 + } catch (Exception e) {
  136 + logger.error("停车场:" + tMap.get("PARK_CODE") , e);
  137 + }
  138 + }
  139 +
  140 + if(tccTempMap.size() > 0)
  141 + tccMap = tccTempMap;
  142 + }
  143 +
  144 + private void connectStationRoute(List<StationRoute> list) {
  145 + int size = list.size();
  146 + StationRoute sr = null;
  147 + for (int i = 0; i < size; i++) {
  148 + sr = list.get(i);
  149 + //上一个
  150 + if (i > 0)
  151 + sr.setPrve(list.get(i - 1));
  152 + //下一个
  153 + if (i < size - 1)
  154 + sr.setNext(list.get(i + 1));
  155 + }
  156 + }
  157 +
  158 + public Coordinate[] parsePolygon(String polygonStr) {
  159 + String[] coords = polygonStr.substring(9, polygonStr.length() - 2).split(","), temps;
  160 +
  161 + Coordinate[] cds = new Coordinate[coords.length];
  162 + int len = coords.length;
  163 + for (int i = 0; i < len; i++) {
  164 + temps = coords[i].split(" ");
  165 + cds[i] = new Coordinate(Float.parseFloat(temps[1]), Float.parseFloat(temps[0]));
  166 + }
  167 + return cds;
  168 + }
  169 +
  170 +}
0 171 \ No newline at end of file
... ...
src/main/java/com/bsth/data/gpsdata/analyse/GpsAnalyse.java 0 → 100644
  1 +package com.bsth.data.gpsdata.analyse;
  2 +
  3 +import com.bsth.data.gpsdata.GpsEntity;
  4 +import com.bsth.data.gpsdata.analyse.components.GpsArrival;
  5 +import org.slf4j.Logger;
  6 +import org.slf4j.LoggerFactory;
  7 +
  8 +import java.util.concurrent.ExecutorService;
  9 +import java.util.concurrent.Executors;
  10 +
  11 +/**
  12 + * 分析gps状态信息
  13 + * Created by panzhao on 2016/12/23.
  14 + */
  15 +public class GpsAnalyse {
  16 +
  17 + static Logger logger = LoggerFactory.getLogger(GpsAnalyse.class);
  18 +
  19 + //线程池
  20 + static ExecutorService threadPool = Executors.newFixedThreadPool(50);
  21 +
  22 + public static void start(GpsEntity gps) {
  23 + threadPool.execute(new ArrivalMatchThread(gps));
  24 + }
  25 +
  26 + public static class ArrivalMatchThread implements Runnable {
  27 +
  28 + private GpsEntity gps;
  29 +
  30 + public ArrivalMatchThread(GpsEntity gps) {
  31 + this.gps = gps;
  32 + }
  33 +
  34 + @Override
  35 + public void run() {
  36 + GpsArrival.arrival(gps);
  37 + }
  38 + }
  39 +}
0 40 \ No newline at end of file
... ...
src/main/java/com/bsth/data/gpsdata/analyse/StationRoute.java 0 → 100644
  1 +package com.bsth.data.gpsdata.analyse;
  2 +
  3 +import com.vividsolutions.jts.geom.Point;
  4 +import com.vividsolutions.jts.geom.Polygon;
  5 +
  6 +/**
  7 + * Created by panzhao on 2016/12/23.
  8 + */
  9 +public class StationRoute {
  10 +
  11 + /**
  12 + * 线路编码
  13 + */
  14 + private String lineCode;
  15 +
  16 + /**
  17 + * 上下行
  18 + */
  19 + private int directions;
  20 +
  21 + /**
  22 + * 站点编码
  23 + */
  24 + private String code;
  25 +
  26 + /**
  27 + * 路由顺序
  28 + */
  29 + private int routeSort;
  30 +
  31 + /**
  32 + * 站点位置
  33 + */
  34 + private Point point;
  35 +
  36 + /**
  37 + * 圆形半径
  38 + */
  39 + private Float radius;
  40 +
  41 + /**
  42 + * 多边形电子围栏
  43 + */
  44 + private Polygon polygon;
  45 +
  46 + /**
  47 + * 站点标记
  48 + */
  49 + private String mark;
  50 +
  51 + /**
  52 + * 下一站
  53 + */
  54 + private StationRoute next;
  55 +
  56 + /**
  57 + * 上一站
  58 + */
  59 + private StationRoute prve;
  60 +
  61 + public String getCode() {
  62 + return code;
  63 + }
  64 +
  65 + public void setCode(String code) {
  66 + this.code = code;
  67 + }
  68 +
  69 + public int getRouteSort() {
  70 + return routeSort;
  71 + }
  72 +
  73 + public void setRouteSort(int routeSort) {
  74 + this.routeSort = routeSort;
  75 + }
  76 +
  77 + public Point getPoint() {
  78 + return point;
  79 + }
  80 +
  81 + public void setPoint(Point point) {
  82 + this.point = point;
  83 + }
  84 +
  85 + public Float getRadius() {
  86 + return radius;
  87 + }
  88 +
  89 + public void setRadius(Float radius) {
  90 + this.radius = radius;
  91 + }
  92 +
  93 + public Polygon getPolygon() {
  94 + return polygon;
  95 + }
  96 +
  97 + public void setPolygon(Polygon polygon) {
  98 + this.polygon = polygon;
  99 + }
  100 +
  101 + public String getLineCode() {
  102 + return lineCode;
  103 + }
  104 +
  105 + public void setLineCode(String lineCode) {
  106 + this.lineCode = lineCode;
  107 + }
  108 +
  109 + public int getDirections() {
  110 + return directions;
  111 + }
  112 +
  113 + public void setDirections(int directions) {
  114 + this.directions = directions;
  115 + }
  116 +
  117 + public StationRoute getNext() {
  118 + return next;
  119 + }
  120 +
  121 + public void setNext(StationRoute next) {
  122 + this.next = next;
  123 + }
  124 +
  125 + public StationRoute getPrve() {
  126 + return prve;
  127 + }
  128 +
  129 + public void setPrve(StationRoute prve) {
  130 + this.prve = prve;
  131 + }
  132 +
  133 + public String getMark() {
  134 + return mark;
  135 + }
  136 +
  137 + public void setMark(String mark) {
  138 + this.mark = mark;
  139 + }
  140 +}
  141 +
... ...
src/main/java/com/bsth/data/gpsdata/analyse/StationRouteComp.java 0 → 100644
  1 +package com.bsth.data.gpsdata.analyse;
  2 +
  3 +import java.util.Comparator;
  4 +
  5 +/**
  6 + * Created by panzhao on 2016/12/24.
  7 + */
  8 +public class StationRouteComp implements Comparator<StationRoute>{
  9 + @Override
  10 + public int compare(StationRoute s1, StationRoute s2) {
  11 + return s1.getRouteSort() - s2.getRouteSort();
  12 + }
  13 +}
... ...
src/main/java/com/bsth/data/gpsdata/analyse/components/GpsArrival.java 0 → 100644
  1 +package com.bsth.data.gpsdata.analyse.components;
  2 +
  3 +import com.bsth.data.LineConfigData;
  4 +import com.bsth.data.gpsdata.GpsEntity;
  5 +import com.bsth.data.gpsdata.analyse.CircleQueue;
  6 +import com.bsth.data.gpsdata.analyse.GeoCacheData;
  7 +import com.bsth.data.gpsdata.analyse.StationRoute;
  8 +import com.bsth.data.gpsdata.analyse.util.GeoUtils;
  9 +import com.bsth.data.schedule.DayOfSchedule;
  10 +import com.bsth.entity.realcontrol.LineConfig;
  11 +import com.bsth.entity.realcontrol.ScheduleRealInfo;
  12 +import org.slf4j.Logger;
  13 +import org.slf4j.LoggerFactory;
  14 +import org.springframework.beans.BeansException;
  15 +import org.springframework.context.ApplicationContext;
  16 +import org.springframework.context.ApplicationContextAware;
  17 +import org.springframework.stereotype.Component;
  18 +
  19 +import java.util.List;
  20 +
  21 +/**
  22 + * gps 到离站判断
  23 + * Created by panzhao on 2016/12/24.
  24 + */
  25 +@Component
  26 +public class GpsArrival implements ApplicationContextAware {
  27 +
  28 + static Logger logger = LoggerFactory.getLogger(GpsArrival.class);
  29 +
  30 + static DayOfSchedule dayOfSchedule;
  31 +
  32 + static LineConfigData lineConfigData;
  33 +
  34 + public static void arrival(GpsEntity gps) {
  35 +
  36 + if (gps.getLat() == 0 || gps.getLon() == 0) {
  37 + //logger.error("无效的gps");
  38 + return;
  39 + }
  40 +
  41 + Object task = DayOfSchedule.executeCurr(gps.getNbbm());
  42 + if (task == null)
  43 + return;
  44 + if (task.getClass().isAssignableFrom(ScheduleRealInfo.class)) {
  45 + ScheduleRealInfo sch = (ScheduleRealInfo) task;
  46 + //和班次同步走向
  47 + gps.setUpDown(Integer.parseInt(sch.getXlDir()));
  48 +
  49 + //出场
  50 + if (sch.getBcType().equals("out")) {
  51 + outCarpark(gps, sch);
  52 + }
  53 + else if (sch.getBcType().equals("normal"))
  54 + normalInOut(gps, sch);
  55 + else if(sch.getBcType().equals("in")){
  56 + inCarpark(gps, sch);
  57 + }
  58 + }
  59 +
  60 + GeoCacheData.putGps(gps);
  61 + }
  62 +
  63 + /**
  64 + * 正常班次
  65 + *
  66 + * @param gps
  67 + * @param sch
  68 + */
  69 + private static void normalInOut(GpsEntity gps, ScheduleRealInfo sch) {
  70 + CircleQueue<GpsEntity> queue = GeoCacheData.getGps(gps.getNbbm());
  71 + GpsEntity prev = null;
  72 + if (queue != null)
  73 + prev = queue.getTail();
  74 +
  75 + List<StationRoute> srs = GeoCacheData.getStationRoute(sch.getXlBm(), gps.getUpDown());
  76 + StationRoute station = GeoUtils.gpsInStation(gps, srs);
  77 +
  78 + if (station != null) {
  79 + //站内
  80 + gps.setStopNo(station.getCode());
  81 + gps.setInstation(true);
  82 + stationInside(gps, prev, sch);
  83 + } else {
  84 + //站外
  85 + stationOutside(gps, prev, sch);
  86 + }
  87 + }
  88 +
  89 + /**
  90 + * GPS在站点内
  91 + *
  92 + * @param gps
  93 + * @param prev
  94 + * @param sch
  95 + */
  96 + private static void stationInside(GpsEntity gps, GpsEntity prev, ScheduleRealInfo sch) {
  97 + if(prev == null)
  98 + return;
  99 +
  100 + if (gps.getStopNo().equals(sch.getZdzCode()) && sch.getZdsjActual() == null) {
  101 + //到终点站
  102 + arriveEnd(sch, gps);
  103 + return;
  104 + }
  105 +
  106 + //上一个点在站外
  107 + if(!prev.isInstation())
  108 + return;
  109 + //超过 (待发时间 + 90%的单程运送时间),还在起点站。默认烂一圈
  110 + if (prev.getStopNo().equals(gps.getStopNo())){
  111 + if(gps.getStopNo().equals(sch.getQdzCode())
  112 + && gps.getTimestamp() > sch.getDfsjT() + (sch.getBcsj() * 60 * 1000 * 0.9)){
  113 +
  114 + ScheduleRealInfo next = dayOfSchedule.next(dayOfSchedule.next(sch));
  115 + dayOfSchedule.addExecPlan(next);
  116 + }
  117 + return;
  118 + }
  119 +
  120 + //发车
  121 + if (prev.getStopNo().equals(sch.getQdzCode())) {
  122 + busWillDepart(sch, gps);
  123 + return;
  124 + }
  125 +
  126 + //中途站
  127 + StationRoute prevStation = GeoCacheData.getStation(prev.getLineId(), prev.getUpDown(), prev.getStopNo());
  128 + StationRoute currStation = GeoCacheData.getStation(gps.getLineId(), gps.getUpDown(), gps.getStopNo());
  129 + if (currStation.getRouteSort() < prevStation.getRouteSort()) {
  130 + //开始下一个班次
  131 + finishPlan(sch);
  132 +
  133 + logger.info("路由反向。。。。。。:" + gps.getTimestamp());
  134 + //为班次补上实际时间
  135 +
  136 + }
  137 + }
  138 +
  139 + /**
  140 + * GPS在站点外
  141 + *
  142 + * @param gps
  143 + * @param prev
  144 + * @param sch
  145 + */
  146 + private static void stationOutside(GpsEntity gps, GpsEntity prev, ScheduleRealInfo sch) {
  147 + if(prev == null)
  148 + return;
  149 +
  150 + gps.setStopNo(prev.getStopNo());
  151 + if (prev.isInstation() && prev.getStopNo().equals(sch.getQdzCode())) {
  152 + //发车
  153 + busWillDepart(sch, gps);
  154 + return;
  155 + }
  156 + }
  157 +
  158 + /**
  159 + * 公交车起点发出
  160 + */
  161 + final static long DRIFT_VAL_TIME = 1000 * 60 * 10;
  162 + //班次最大差值1小时
  163 + final static long MAX_DIFF = 1000 * 60 * 60;
  164 + private static void busWillDepart(ScheduleRealInfo sch, GpsEntity gps) {
  165 + //实发时间不覆盖
  166 + if (sch.getFcsjActual() == null && Math.abs(gps.getTimestamp() - sch.getDfsjT()) < MAX_DIFF) {
  167 +
  168 + //提前10分钟以上发出,判断一下是否是漂移
  169 + if(sch.getDfsjT() - gps.getTimestamp() > DRIFT_VAL_TIME){
  170 + ScheduleRealInfo schPrev = dayOfSchedule.prev(sch);
  171 + if(schPrev != null && schPrev.getZdsjActual() != null){
  172 + //计划停站时间
  173 + long stopTimeJH = sch.getDfsjT() - schPrev.getZdsjT();
  174 + //实际停站时间
  175 + long actualStopTime = gps.getTimestamp() - schPrev.getZdsjActualTime();
  176 + /*
  177 + 没停够计划百分之60的,算漂移
  178 + (这里出现的误判,由程序在车辆到中途站的时候进行补偿)
  179 + */
  180 + if(stopTimeJH * 0.6 < actualStopTime){
  181 + logger.info("漂移.... 车辆:" + gps.getNbbm() + " ts: " + gps.getTimestamp());
  182 + return;
  183 + }
  184 + }
  185 + }
  186 +
  187 + LineConfig config = lineConfigData.get(sch.getXlBm());
  188 + if(config != null && config.getOutConfig() == 2){
  189 + //出站既出场
  190 + ScheduleRealInfo schPrev = dayOfSchedule.prev(sch);
  191 + if(schPrev.getBcType().equals("out")){
  192 + schPrev.setFcsjActualAll(schPrev.getDfsjT());
  193 + schPrev.setZdsjActualAll(schPrev.getZdsjT());
  194 + }
  195 + }
  196 +
  197 + sch.setFcsjActualAll(gps.getTimestamp());
  198 + logger.info("(站外)班次:" + sch.getDfsj() + "发车, 时间:" + sch.getFcsjActual());
  199 + }
  200 + }
  201 +
  202 + /**
  203 + * 公交车到达终点
  204 + *
  205 + * @param sch
  206 + * @param gps
  207 + */
  208 + private static void arriveEnd(ScheduleRealInfo sch, GpsEntity gps) {
  209 + sch.setZdsjActualAll(gps.getTimestamp());
  210 + ScheduleRealInfo next = finishPlan(sch);
  211 + logger.info("班次:" + sch.getDfsj() + "到达终点, 时间:" + sch.getZdsjActual());
  212 +
  213 + if (next == null)
  214 + return;
  215 +
  216 + //将gps转换为下一个班次走向的站内信号
  217 + int updown = Integer.parseInt(next.getXlDir());
  218 + List<StationRoute> srs = GeoCacheData.getStationRoute(next.getXlBm(), updown);
  219 + StationRoute station = GeoUtils.gpsInStation(gps, srs);
  220 + if (station != null) {
  221 + gps.setUpDown(updown);
  222 + gps.setStopNo(station.getCode());
  223 + }
  224 + }
  225 +
  226 + /**
  227 + * 出场班次
  228 + *
  229 + * @param gps
  230 + * @param sch
  231 + */
  232 + private static void outCarpark(GpsEntity gps, ScheduleRealInfo sch) {
  233 + String carpark = GeoUtils.gpsInCarpark(gps);
  234 + if (carpark != null) {
  235 + gps.setInstation(true);
  236 + gps.setStopNo(carpark);
  237 + return; // 还在场内
  238 + }
  239 +
  240 + CircleQueue<GpsEntity> queue = GeoCacheData.getGps(gps.getNbbm());
  241 + if (queue == null)
  242 + return;
  243 + //上一个gps
  244 + GpsEntity prev = queue.getTail();
  245 +
  246 + if (carpark == null && prev.isInstation() && prev.getStopNo().equals(sch.getQdzCode())) {
  247 + gps.setStopNo(prev.getStopNo());
  248 + //停车场发出
  249 + busWillDepart(sch, gps);
  250 + return;
  251 + }
  252 +
  253 + List<StationRoute> srs = GeoCacheData.getStationRoute(sch.getXlBm(), gps.getUpDown());
  254 + StationRoute station = GeoUtils.gpsInStation(gps, srs);
  255 +
  256 + if (station != null && station.getCode().equals(sch.getZdzCode())) {
  257 + gps.setStopNo(station.getCode());
  258 + //到达终点
  259 + arriveEnd(sch, gps);
  260 + }
  261 + }
  262 +
  263 +
  264 + /**
  265 + * 进场班次
  266 + * @param gps
  267 + * @param sch
  268 + */
  269 + private static void inCarpark(GpsEntity gps, ScheduleRealInfo sch) {
  270 + String carpark = GeoUtils.gpsInCarpark(gps);
  271 + if (carpark != null && carpark.equals(sch.getZdzCode())) {
  272 + //进场班次取第一个实际进场时间
  273 + if(sch.getZdsjActual() != null)
  274 + return;
  275 +
  276 + //进场
  277 + arriveEnd(sch, gps);
  278 + return;
  279 + }
  280 +
  281 + CircleQueue<GpsEntity> queue = GeoCacheData.getGps(gps.getNbbm());
  282 + if (queue == null)
  283 + return;
  284 + //上一个gps
  285 + GpsEntity prev = queue.getTail();
  286 +
  287 + if (carpark == null && prev.isInstation() && prev.getStopNo().equals(sch.getQdzCode())) {
  288 + gps.setStopNo(prev.getStopNo());
  289 + //进场班次发出
  290 + busWillDepart(sch, gps);
  291 + return;
  292 + }
  293 + }
  294 +
  295 + /**
  296 + * 完成班次 -返回下一个班次
  297 + *
  298 + * @param sch
  299 + */
  300 + private static ScheduleRealInfo finishPlan(ScheduleRealInfo sch) {
  301 + ScheduleRealInfo next = dayOfSchedule.next(sch);
  302 + if (next != null) {
  303 + next.setQdzArrDatesj(sch.getZdsjActual());
  304 + dayOfSchedule.addExecPlan(next);
  305 + }
  306 + return next;
  307 + }
  308 +
  309 + @Override
  310 + public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
  311 + dayOfSchedule = applicationContext.getBean(DayOfSchedule.class);
  312 + lineConfigData = applicationContext.getBean(LineConfigData.class);
  313 + }
  314 +}
... ...
src/main/java/com/bsth/data/gpsdata/analyse/components/GpsStateCorrective.java 0 → 100644
  1 +package com.bsth.data.gpsdata.analyse.components;
  2 +
  3 +import com.bsth.data.gpsdata.GpsEntity;
  4 +import com.bsth.data.schedule.DayOfSchedule;
  5 +import com.bsth.entity.realcontrol.ScheduleRealInfo;
  6 +import com.vividsolutions.jts.geom.GeometryFactory;
  7 +import org.joda.time.format.DateTimeFormat;
  8 +import org.joda.time.format.DateTimeFormatter;
  9 +import org.slf4j.Logger;
  10 +import org.slf4j.LoggerFactory;
  11 +import org.springframework.beans.BeansException;
  12 +import org.springframework.context.ApplicationContext;
  13 +import org.springframework.context.ApplicationContextAware;
  14 +import org.springframework.stereotype.Component;
  15 +
  16 +/**
  17 + * GPS状态纠正
  18 + * Created by panzhao on 2016/12/23.
  19 + */
  20 +@Component
  21 +public class GpsStateCorrective implements ApplicationContextAware {
  22 +
  23 + static Logger logger = LoggerFactory.getLogger(GpsStateCorrective.class);
  24 +
  25 + static DayOfSchedule dayOfSchedule;
  26 +
  27 + private static GeometryFactory geometryFactory = new GeometryFactory();
  28 +
  29 + public static void correct(GpsEntity gps, ScheduleRealInfo sch){
  30 +/* int upDown = Integer.parseInt(sch.getXlDir());
  31 + gps.setUpDown(upDown);
  32 + List<StationRoute> srs = GeoCacheData.getStationRoute(sch.getXlBm(), upDown);
  33 +
  34 + Point point = geometryFactory.createPoint(new Coordinate(gps.getLat(), gps.getLon()));
  35 +
  36 + //之前的点位
  37 + CircleQueue<GpsEntity> queue = GeoCacheData.getGps(gps.getNbbm());
  38 + GpsEntity prev = null;
  39 + if(queue != null)
  40 + prev = queue.getTail();
  41 +
  42 + //线路上,站点间
  43 + StationRoute station = GeoUtils.pointInStation(point, srs);
  44 + //在站内
  45 + if(station != null){
  46 + gps.setStopNo(station.getCode());
  47 + gps.setInstation(true);
  48 + gps.setStation(station);
  49 +
  50 + if(prev != null && prev.getUpDown() == upDown){
  51 + StationRoute prevStation = GeoCacheData.getStation(prev.getLineId(), upDown, prev.getStopNo());
  52 +
  53 + //倒着开??
  54 + if(prevStation.getRouteSort() > station.getRouteSort()){
  55 + reversalHandle(gps, prev, sch);
  56 + }
  57 + }
  58 + }
  59 + else{
  60 + if(prev != null)
  61 + gps.setStopNo(prev.getStopNo());
  62 + }
  63 +
  64 + //是否在停车场内
  65 + Map<String, Polygon> carparkMap = GeoCacheData.tccMap;
  66 + Set<String> codes = carparkMap.keySet();
  67 + Polygon p;
  68 + for(String code : codes){
  69 + p = carparkMap.get(code);
  70 + //场内
  71 + if(p.contains(point)){
  72 + gps.setCarparkNo(code);
  73 + if(sch.getBcType().equals("out")){
  74 + gps.setInstation(true);
  75 + gps.setStopNo(code);
  76 + }
  77 + }
  78 + }*/
  79 + }
  80 +
  81 + private static DateTimeFormatter fmt = DateTimeFormat.forPattern("HH:mm");
  82 +
  83 + private static void reversalHandle(GpsEntity gps, GpsEntity prev, ScheduleRealInfo sch){
  84 + /*if(sch.getBcType().equals("out") && gps.getTimestamp() < sch.getZdsjT())
  85 + return;
  86 +
  87 + //先假设没到终点,直接开始了下一个班次
  88 + ScheduleRealInfo next = dayOfSchedule.next(sch);
  89 + String log = "倒着开??? nbbm: " + gps.getNbbm() + " 当前:" + gps.getStopNo() + " 上一站:" + prev.getStopNo() + " 当前班次:" + sch.getDfsj();
  90 + if(next != null){
  91 + dayOfSchedule.addExecPlan(next);
  92 +
  93 + log += (" 下一个班次:" + next.getDfsj());
  94 + }
  95 +
  96 + log += (" GPS时间:" + fmt.print(gps.getTimestamp()));
  97 +
  98 + logger.info(log);*/
  99 + }
  100 +
  101 + @Override
  102 + public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
  103 + dayOfSchedule = applicationContext.getBean(DayOfSchedule.class);
  104 + }
  105 +}
... ...
src/main/java/com/bsth/data/gpsdata/analyse/util/GeoUtils.java 0 → 100644
  1 +package com.bsth.data.gpsdata.analyse.util;
  2 +
  3 +import com.bsth.data.gpsdata.GpsEntity;
  4 +import com.bsth.data.gpsdata.analyse.GeoCacheData;
  5 +import com.bsth.data.gpsdata.analyse.StationRoute;
  6 +import com.vividsolutions.jts.geom.Coordinate;
  7 +import com.vividsolutions.jts.geom.GeometryFactory;
  8 +import com.vividsolutions.jts.geom.Point;
  9 +import com.vividsolutions.jts.geom.Polygon;
  10 +
  11 +import java.util.List;
  12 +import java.util.Map;
  13 +import java.util.Set;
  14 +
  15 +/**
  16 + * Created by panzhao on 2016/12/23.
  17 + */
  18 +public class GeoUtils {
  19 +
  20 + private final static double EARTHRADIUS = 6378137;
  21 +
  22 + private static GeometryFactory geometryFactory = new GeometryFactory();
  23 + /**
  24 + * gps是否在路由上的某个站内
  25 + *
  26 + * @param gps
  27 + * @param srs
  28 + * @return
  29 + */
  30 + public static StationRoute gpsInStation(GpsEntity gps, List<StationRoute> srs) {
  31 + Point point = geometryFactory.createPoint(new Coordinate(gps.getLat(), gps.getLon()));
  32 + double min = -1, distance, distance2;
  33 + StationRoute stationRoute = null;
  34 +
  35 + for (StationRoute sr : srs) {
  36 + if (sr.getPolygon() == null) {
  37 + //圆形
  38 + distance = getDistance(sr.getPoint(), point);//sr.getPoint().distance(point);
  39 +
  40 + if (distance > sr.getRadius())
  41 + continue;
  42 +
  43 + if (min > distance || min == -1) {
  44 + min = distance;
  45 + stationRoute = sr;
  46 + }
  47 + } else {
  48 + //多边形
  49 + if (sr.getPolygon().contains(point)) {
  50 + stationRoute = sr;
  51 + break;
  52 + }
  53 + }
  54 + }
  55 + return stationRoute;
  56 + }
  57 +
  58 + public static double getDistance(Point p1, Point p2) {
  59 + double lng1 = getLoop(p1.getY(), -180, 180), lat1 = getRange(
  60 + p1.getX(), -74, 74);
  61 + double lng2 = getLoop(p2.getY(), -180, 180), lat2 = getRange(
  62 + p2.getX(), -74, 74);
  63 +
  64 + double x1, x2, y1, y2;
  65 + x1 = degreeToRad(lng1);
  66 + y1 = degreeToRad(lat1);
  67 + x2 = degreeToRad(lng2);
  68 + y2 = degreeToRad(lat2);
  69 + return EARTHRADIUS
  70 + * Math.acos((Math.sin(y1) * Math.sin(y2) + Math.cos(y1)
  71 + * Math.cos(y2) * Math.cos(x2 - x1)));
  72 + }
  73 +
  74 + private static double getLoop(double v, double a, double b) {
  75 + while (v > b) {
  76 + v -= b - a;
  77 + }
  78 + while (v < a) {
  79 + v += b - a;
  80 + }
  81 + return v;
  82 + }
  83 +
  84 + private static double getRange(double v, double a, double b) {
  85 + v = Math.min(Math.max(v, a), b);
  86 + return v;
  87 + }
  88 +
  89 + private static double degreeToRad(double degree) {
  90 + return Math.PI * degree / 180;
  91 + }
  92 +
  93 +
  94 + /**
  95 + * gps 是否在某个停车场内
  96 + * @param gps
  97 + * @return
  98 + */
  99 + public static String gpsInCarpark(GpsEntity gps){
  100 + Point point = geometryFactory.createPoint(new Coordinate(gps.getLat(), gps.getLon()));
  101 +
  102 + Map<String, Polygon> carparkMap = GeoCacheData.tccMap;
  103 + Set<String> codes = carparkMap.keySet();
  104 + Polygon polygon;
  105 + for(String code : codes){
  106 + polygon = carparkMap.get(code);
  107 + if(point.within(polygon)){
  108 + return code;
  109 + }
  110 + }
  111 + return null;
  112 + }
  113 +
  114 + /**
  115 + * 是否是有效的连续点
  116 + * @param prevGps
  117 + * @param gps
  118 + * @return
  119 + */
  120 + public static boolean overdue(GpsEntity prevGps, GpsEntity gps) {
  121 + return gps.getTimestamp() - prevGps.getTimestamp() < 120000;
  122 + }
  123 +}
... ...
src/main/java/com/bsth/data/gpsdata/recovery/GpsDataRecovery.java 0 → 100644
  1 +package com.bsth.data.gpsdata.recovery;
  2 +
  3 +import com.bsth.data.BasicData;
  4 +import com.bsth.data.gpsdata.GpsEntity;
  5 +import com.bsth.data.gpsdata.analyse.components.GpsArrival;
  6 +import com.bsth.util.db.DBUtils_MS;
  7 +import com.google.common.collect.ArrayListMultimap;
  8 +import org.slf4j.Logger;
  9 +import org.slf4j.LoggerFactory;
  10 +import org.springframework.jdbc.core.JdbcTemplate;
  11 +import org.springframework.jdbc.core.RowMapper;
  12 +
  13 +import java.sql.ResultSet;
  14 +import java.sql.SQLException;
  15 +import java.util.*;
  16 +import java.util.concurrent.CountDownLatch;
  17 +import java.util.concurrent.ExecutorService;
  18 +import java.util.concurrent.Executors;
  19 +
  20 +/**
  21 + * 数据恢复
  22 + * Created by panzhao on 2016/12/24.
  23 + */
  24 +public class GpsDataRecovery {
  25 +
  26 + static Logger logger = LoggerFactory.getLogger(GpsDataRecovery.class);
  27 +
  28 + public static boolean run;
  29 +
  30 + static ExecutorService threadPool = Executors.newFixedThreadPool(50);
  31 +
  32 + private static CountDownLatch count;
  33 +
  34 + public static void recovery() {
  35 + List<GpsEntity> list = loadData();
  36 +
  37 + //按车辆分组数据
  38 + ArrayListMultimap<String, GpsEntity> listMap = ArrayListMultimap.create();
  39 + for (GpsEntity gps : list) {
  40 + if(gps.getNbbm() != null)
  41 + listMap.put(gps.getNbbm(), gps);
  42 + }
  43 +
  44 + count = new CountDownLatch(listMap.keySet().size());
  45 +
  46 + Set<String> keys = listMap.keySet();
  47 + for (String nbbm : keys) {
  48 + threadPool.execute(new RecoveryDataThread(listMap.get(nbbm), count));
  49 + /*if(nbbm.equals("W9A-250"))
  50 + new RecoveryDataThread(listMap.get(nbbm), count).run();*/
  51 + }
  52 + try {
  53 + //等待子线程结束
  54 + count.await();
  55 + logger.info("GPS 数据恢复完成....");
  56 + } catch (InterruptedException e) {
  57 + logger.error("", e);
  58 + }
  59 + }
  60 +
  61 + /**
  62 + * 加载当天的gps数据
  63 + *
  64 + * @return
  65 + */
  66 + public static List<GpsEntity> loadData() {
  67 + Calendar calendar = Calendar.getInstance();
  68 + int dayOfYear = calendar.get(Calendar.DAY_OF_YEAR);
  69 +
  70 + String sql = "select DEVICE_ID,LAT,LON,TS,SPEED_GPS,LINE_ID,SERVICE_STATE from BSTH_C_GPS_INFO where days_year=" + dayOfYear;
  71 + JdbcTemplate jdbcTemplate = new JdbcTemplate(DBUtils_MS.getDataSource());
  72 +
  73 + List<GpsEntity> list =
  74 + jdbcTemplate.query(sql, new RowMapper<GpsEntity>() {
  75 + @Override
  76 + public GpsEntity mapRow(ResultSet rs, int rowNum) throws SQLException {
  77 + GpsEntity gps = new GpsEntity();
  78 +
  79 + gps.setDeviceId(rs.getString("DEVICE_ID"));
  80 + gps.setNbbm(BasicData.deviceId2NbbmMap.get(gps.getDeviceId()));
  81 + gps.setSpeed(rs.getFloat("SPEED_GPS"));
  82 + gps.setLat(rs.getFloat("LAT"));
  83 + gps.setLon(rs.getFloat("LON"));
  84 + gps.setLineId(rs.getString("LINE_ID"));
  85 + gps.setTimestamp(rs.getLong("TS"));
  86 + gps.setUpDown(getUpOrDown(rs.getLong("SERVICE_STATE")));
  87 + return gps;
  88 + }
  89 + });
  90 + return list;
  91 + }
  92 +
  93 + /**
  94 + * 王通 2016/6/29 9:23:24 获取车辆线路上下行
  95 + *
  96 + * @return -1无效 0上行 1下行
  97 + */
  98 + public static int getUpOrDown(long serviceState) {
  99 + if ((serviceState & 0x00020000) == 0x00020000 || (serviceState & 0x80000000) == 0x80000000
  100 + || (serviceState & 0x01000000) == 0x01000000 || (serviceState & 0x08000000) == 0x08000000)
  101 + return -1;
  102 + return (((serviceState & 0x10000000) == 0x10000000) ? 1 : 0);
  103 + }
  104 +
  105 + public static class RecoveryDataThread implements Runnable {
  106 +
  107 + List<GpsEntity> list;
  108 + CountDownLatch count;
  109 +
  110 + public RecoveryDataThread(List<GpsEntity> list, CountDownLatch count) {
  111 + this.list = list;
  112 + this.count = count;
  113 + }
  114 +
  115 + @Override
  116 + public void run() {
  117 + try {
  118 + //排序
  119 + Collections.sort(list, new GpsComp());
  120 + //依次跑完gps
  121 + //int i = 0;
  122 + for(GpsEntity gps : list){
  123 + /* i++;
  124 + if(i == 383){
  125 + System.out.println("aaa");
  126 + }*/
  127 + GpsArrival.arrival(gps);
  128 + }
  129 + } catch (Exception e) {
  130 + logger.error("", e);
  131 + } finally {
  132 + count.countDown();
  133 + }
  134 + }
  135 + }
  136 +
  137 + public static class GpsComp implements Comparator<GpsEntity>{
  138 +
  139 + @Override
  140 + public int compare(GpsEntity g1, GpsEntity g2) {
  141 + return (int) (g1.getTimestamp() - g2.getTimestamp());
  142 + }
  143 + }
  144 +}
... ...
src/main/java/com/bsth/data/schedule/DayOfSchedule.java
... ... @@ -3,9 +3,11 @@ package com.bsth.data.schedule;
3 3 import com.alibaba.fastjson.JSON;
4 4 import com.alibaba.fastjson.JSONArray;
5 5 import com.bsth.Application;
  6 +import com.bsth.data.BasicData;
6 7 import com.bsth.data.LineConfigData;
7 8 import com.bsth.data.directive.FirstScheduleCheckThread;
8 9 import com.bsth.data.gpsdata.GpsRealData;
  10 +import com.bsth.data.gpsdata.recovery.GpsDataRecovery;
9 11 import com.bsth.data.schedule.thread.ScheduleLateThread;
10 12 import com.bsth.data.schedule.thread.SchedulePstThread;
11 13 import com.bsth.data.schedule.thread.ScheduleRefreshThread;
... ... @@ -111,19 +113,30 @@ public class DayOfSchedule implements CommandLineRunner {
111 113 @Autowired
112 114 SubmitToTrafficManage submitToTrafficManage;
113 115  
  116 + @Autowired
  117 + LineConfigData lineConfigs;
  118 +
  119 + @Autowired
  120 + BasicData.BasicDataLoader dataLoader;
  121 +
114 122 private static DateTimeFormatter fmtyyyyMMdd = DateTimeFormat.forPattern("yyyy-MM-dd")
115 123 ,fmtHHmm = DateTimeFormat.forPattern("HH:mm");
116 124  
117 125 @Override
118 126 public void run(String... arg0) throws Exception {
  127 + //加载基础数据
  128 + dataLoader.loadAllData();
  129 + //从数据库恢复排班
  130 + //dataRecovery();
  131 +
119 132 //翻班线程
120 133 Application.mainServices.scheduleWithFixedDelay(scheduleRefreshThread, 15, 240, TimeUnit.SECONDS);
121 134 //入库
122   -// Application.mainServices.scheduleWithFixedDelay(schedulePstThread, 60, 60, TimeUnit.SECONDS);
  135 + Application.mainServices.scheduleWithFixedDelay(schedulePstThread, 60, 60, TimeUnit.SECONDS);
123 136 //首班出场指令补发器
124 137 // Application.mainServices.scheduleWithFixedDelay(firstScheduleCheckThread, 30, 240, TimeUnit.SECONDS);
125 138 //班次误点扫描
126   -// Application.mainServices.scheduleWithFixedDelay(scheduleLateThread, 60, 60, TimeUnit.SECONDS);
  139 + Application.mainServices.scheduleWithFixedDelay(scheduleLateThread, 60, 60, TimeUnit.SECONDS);
127 140  
128 141 //每天凌晨2点20提交数据到运管处
129 142 long diff = (DateUtils.getTimestamp() + 1000*60*140) - System.currentTimeMillis();
... ... @@ -134,6 +147,23 @@ public class DayOfSchedule implements CommandLineRunner {
134 147 //Application.mainServices.scheduleWithFixedDelay(submitToTrafficManage, diff / 1000, 60 * 60 * 24, TimeUnit.SECONDS);
135 148 }
136 149  
  150 + //数据恢复
  151 + private void dataRecovery() {
  152 + GpsDataRecovery.run = true;
  153 +
  154 + Collection<LineConfig> confs = lineConfigs.getAll();
  155 + String lineCode, currSchDate;
  156 + for(LineConfig conf : confs){
  157 + lineCode = conf.getLine().getLineCode();
  158 + currSchDate = calcSchDate(lineCode);
  159 + //加载班次数据
  160 + reloadSch(lineCode, currSchDate, false);
  161 + }
  162 +
  163 + //恢复gps数据
  164 + GpsDataRecovery.recovery();
  165 + }
  166 +
137 167 public Map<String, String> getCurrSchDate() {
138 168 return currSchDateMap;
139 169 }
... ... @@ -189,17 +219,20 @@ public class DayOfSchedule implements CommandLineRunner {
189 219 putAll(list);
190 220  
191 221 Set<String> cars = searchAllCars(list);
192   - //计算“起点站应到”时间
193   - for(String nbbm : cars)
  222 + for(String nbbm : cars){
  223 + //计算“起点站应到”时间
194 224 schAttrCalculator.calcQdzTimePlan(nbbmScheduleMap.get(nbbm));
195   -
  225 + //车辆 ——> 要执行的班次对照
  226 + carExecutePlanMap.put(nbbm, schAttrCalculator.calcCurrentExecSch(nbbmScheduleMap.get(nbbm)));
  227 + }
  228 +
196 229 //是否是出站即出场
197 230 LineConfig conf = lineConfigData.get(lineCode);
198 231 if(conf.getOutConfig() == 2){
199 232 for(String nbbm : cars)
200 233 schAttrCalculator.connectOutSchedule(nbbmScheduleMap.get(nbbm));
201 234 }
202   -
  235 +
203 236 // 页面 翻班通知
204 237 sendUtils.shiftSchedule(lineCode);
205 238 } catch (Exception e) {
... ... @@ -451,6 +484,10 @@ public class DayOfSchedule implements CommandLineRunner {
451 484 public ScheduleRealInfo next(ScheduleRealInfo sch) {
452 485  
453 486 List<ScheduleRealInfo> list = nbbmScheduleMap.get(sch.getClZbh());
  487 + int outConfig = -1;
  488 + LineConfig config = lineConfigData.get(sch.getXlBm());
  489 + if(config != null)
  490 + outConfig = config.getOutConfig();
454 491  
455 492 boolean flag = false;
456 493 ScheduleRealInfo next = null;
... ... @@ -462,6 +499,10 @@ public class DayOfSchedule implements CommandLineRunner {
462 499 //忽略烂班
463 500 if(temp.isDestroy())
464 501 continue;
  502 +
  503 + //出站既出场,忽略出场班次
  504 + if(outConfig == 2 && temp.getBcType().equals("out"))
  505 + continue;
465 506  
466 507 if(flag){
467 508 next = temp;
... ... @@ -471,6 +512,30 @@ public class DayOfSchedule implements CommandLineRunner {
471 512 return next;
472 513 }
473 514  
  515 + /**
  516 + * 上一个班次
  517 + * @param sch
  518 + * @return
  519 + */
  520 + public ScheduleRealInfo prev(ScheduleRealInfo sch){
  521 + List<ScheduleRealInfo> list = nbbmScheduleMap.get(sch.getClZbh());
  522 +
  523 + //boolean flag = false;
  524 + ScheduleRealInfo prev = null;
  525 + int size = list.size();
  526 +
  527 + for(int i = 0; i < size; i ++){
  528 + if(list.get(i).isDestroy())
  529 + continue;
  530 +
  531 + if(list.get(i).getId().equals(sch.getId())){
  532 + return prev;
  533 + }
  534 + prev = list.get(i);
  535 + }
  536 + return prev;
  537 + }
  538 +
474 539 public void put(ScheduleRealInfo sch) {
475 540 schAttrCalculator
476 541 .calcRealDate(sch)
... ... @@ -666,9 +731,18 @@ public class DayOfSchedule implements CommandLineRunner {
666 731 carExecutePlanMap.remove(clzbh);
667 732 }
668 733  
669   - public Map<String, ScheduleRealInfo> execPlamMap(){
  734 + public Map<String, ScheduleRealInfo> execPlanMap(){
670 735 return carExecutePlanMap;
671 736 }
  737 +
  738 + /**
  739 + * 车辆当前执行的班次
  740 + * @param nbbm
  741 + * @return
  742 + */
  743 + public static ScheduleRealInfo executeCurr(String nbbm){
  744 + return carExecutePlanMap.get(nbbm);
  745 + }
672 746  
673 747 /**
674 748 * @Title: changeCar
... ...
src/main/java/com/bsth/data/schedule/SchAttrCalculator.java
... ... @@ -215,4 +215,30 @@ public class SchAttrCalculator {
215 215 if(sch.getZdsjActualTime() == null && sch.getZdsjActual() != null)
216 216 sch.setZdsjActualAll(sch.getZdsjActual());
217 217 }
  218 +
  219 + /**
  220 + * 计算当前要执行的班次
  221 + * @param list
  222 + * @return
  223 + */
  224 + public ScheduleRealInfo calcCurrentExecSch(List<ScheduleRealInfo> list){
  225 + String lineCode = list.get(0).getXlBm();
  226 + LineConfig conf = lineConfigData.get(lineCode);
  227 + int outConfig = -1;
  228 + if(conf != null)
  229 + outConfig = conf.getOutConfig();
  230 +
  231 + for(ScheduleRealInfo sch : list){
  232 + //如果是出站既出场,忽略出场班次
  233 + if(outConfig == 2 && sch.getBcType().equals("out"))
  234 + continue;
  235 +
  236 + //已执行
  237 + if(StringUtils.isNotEmpty(sch.getZdsjActual()))
  238 + continue;
  239 +
  240 + return sch;
  241 + }
  242 + return null;
  243 + }
218 244 }
... ...
src/main/java/com/bsth/data/schedule/thread/ScheduleRefreshThread.java
1 1 package com.bsth.data.schedule.thread;
2 2  
3   -import java.util.Collection;
4   -import java.util.Set;
5   -
6   -import org.slf4j.Logger;
7   -import org.slf4j.LoggerFactory;
8   -import org.springframework.beans.factory.annotation.Autowired;
9   -import org.springframework.stereotype.Component;
10   -
11 3 import com.bsth.data.BasicData;
12 4 import com.bsth.data.LineConfigData;
13 5 import com.bsth.data.arrival.ArrivalData_GPS;
... ... @@ -15,6 +7,13 @@ import com.bsth.data.directive.DayOfDirectives;
15 7 import com.bsth.data.pilot80.PilotReport;
16 8 import com.bsth.data.schedule.DayOfSchedule;
17 9 import com.bsth.entity.realcontrol.LineConfig;
  10 +import org.slf4j.Logger;
  11 +import org.slf4j.LoggerFactory;
  12 +import org.springframework.beans.factory.annotation.Autowired;
  13 +import org.springframework.stereotype.Component;
  14 +
  15 +import java.util.Collection;
  16 +import java.util.Set;
18 17  
19 18 /**
20 19 *
... ... @@ -57,6 +56,7 @@ public class ScheduleRefreshThread extends Thread{
57 56 currSchDate = dayOfSchedule.calcSchDate(lineCode);
58 57  
59 58 if(oldSchDate == null || !oldSchDate.equals(currSchDate)){
  59 +
60 60 logger.info(lineCode + "开始翻班, " + currSchDate);
61 61 //清除进出站数据
62 62 arrivalData.clearRAMData(lineCode);
... ...
src/main/java/com/bsth/entity/mcy_forms/Changetochange.java
1 1 package com.bsth.entity.mcy_forms;
2 2  
3   -import java.util.Date;
4   -
5 3 import javax.persistence.Entity;
6 4 import javax.persistence.GeneratedValue;
7 5 import javax.persistence.Id;
... ...
src/main/java/com/bsth/entity/realcontrol/ScheduleType.java 0 → 100644
  1 +package com.bsth.entity.realcontrol;
  2 +
  3 +/**
  4 + * 班次类型
  5 + * Created by panzhao on 2016/12/23.
  6 + */
  7 +public enum ScheduleType {
  8 +
  9 + normal, //正常班次
  10 + out, //出场
  11 + in, //进场
  12 + region, //区间
  13 + venting,//直放
  14 + major //放站
  15 +}
... ...
src/main/java/com/bsth/repository/realcontrol/ScheduleRealInfoRepository.java
... ... @@ -24,6 +24,9 @@ public interface ScheduleRealInfoRepository extends BaseRepository&lt;ScheduleRealI
24 24 @Query(value="select min(s.id), s.jGh,s.clZbh,s.lpName,s.jName from ScheduleRealInfo s where s.xlBm = ?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 GROUP BY s.jGh,s.clZbh,s.lpName ,s.jName order by (lpName+1)")
25 25 List<ScheduleRealInfo> queryUserInfo2(String line,String date);
26 26  
  27 + @Query(value="select min(s.id), s.jGh,s.clZbh,s.lpName,s.jName from ScheduleRealInfo s where s.xlBm = ?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 GROUP BY s.jGh,s.clZbh,s.lpName ,s.jName order by (lpName+1)")
  28 + List<ScheduleRealInfo> queryUserInfo3(String line,String date);
  29 +
27 30 @Query(value="select s from ScheduleRealInfo s where s.jName = ?1 and s.clZbh = ?2 and s.lpName = ?3 order by bcs")
28 31 List<ScheduleRealInfo> exportWaybill(String jName,String clZbh,String lpName);
29 32  
... ...
src/main/java/com/bsth/service/forms/FormsService.java
... ... @@ -30,7 +30,7 @@ public interface FormsService {
30 30  
31 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 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 26 import com.bsth.entity.mcy_forms.Allline;
27 27 import com.bsth.entity.mcy_forms.Changetochange;
28 28 import com.bsth.entity.mcy_forms.Executionrate;
  29 +import com.bsth.service.forms.CommonService;
29 30 import com.bsth.service.forms.FormsService;
30 31 import com.bsth.service.realcontrol.ScheduleRealInfoService;
31 32  
... ... @@ -38,20 +39,32 @@ public class FormsServiceImpl implements FormsService {
38 39 @Autowired
39 40 ScheduleRealInfoService scheduleRealInfoService;
40 41  
  42 + @Autowired
  43 + CommonService commonService;
  44 +
41 45 // 行车路单日报表
42 46 @Override
43 47 public List<Waybillday> waybillday(Map<String, Object> map) {
  48 +
44 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 50 + " from bsth_c_s_sp_info_real x INNER join "
46 51 + " ( select y.RQ,y.XLBM,y.NBBM,y.JSY,y.JZL,y.YH,c.personnel_name from"
47 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 68 List<Waybillday> list = jdbcTemplate.query(sql, new RowMapper<Waybillday>() {
56 69 @Override
57 70 public Waybillday mapRow(ResultSet arg0, int arg1) throws SQLException {
... ... @@ -60,21 +73,16 @@ public class FormsServiceImpl implements FormsService {
60 73 wbd.setJzl(arg0.getString("JZL"));
61 74 wbd.setYh(arg0.getString("YH"));
62 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 76 wbd.setRq(arg0.getString("schedule_date"));
68 77 wbd.setJgh(arg0.getString("j_gh"));
69 78 return wbd;
70   -
71 79 }
72 80 });
73 81  
74 82 for(int i=0;i<list.size();i++){
75 83 Waybillday w=list.get(i);
76 84 Map<String, Object> maps = new HashMap<>();
77   - maps = scheduleRealInfoService.findKMBC2(w.getJgh(), w.getCarPlate(),
  85 + maps = commonService.findKMBC2(w.getJgh(), w.getCarPlate(),
78 86 w.getRq());
79 87 w.setJzl1(maps.get("ksgl").toString());
80 88 w.setZlc(maps.get("realMileage").toString());
... ... @@ -86,18 +94,25 @@ public class FormsServiceImpl implements FormsService {
86 94 // 线路客流量报表
87 95 @Override
88 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 98 + " from bsth_c_stationroute s "
91 99 + " LEFT JOIN bsth_c_line l on s.line_code=l.line_code "
92 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 116 List<Linepasswengerflow> list = jdbcTemplate.query(sql, new RowMapper<Linepasswengerflow>() {
102 117  
103 118 @Override
... ... @@ -109,8 +124,6 @@ public class FormsServiceImpl implements FormsService {
109 124 }
110 125 });
111 126  
112   -
113   -
114 127 return list;
115 128 }
116 129  
... ... @@ -122,16 +135,26 @@ public class FormsServiceImpl implements FormsService {
122 135 public List<Shiftuehiclemanth> shiftuehiclemanth(Map<String, Object> map) {
123 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 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 158 startDate = map.get("startDate").toString();
136 159 endDate = map.get("endDate").toString();
137 160 List<Shiftuehiclemanth> list = jdbcTemplate.query(sql, new RowMapper<Shiftuehiclemanth>() {
... ... @@ -150,7 +173,7 @@ public class FormsServiceImpl implements FormsService {
150 173 Shiftuehiclemanth s=list.get(i);
151 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 177 endDate);
155 178  
156 179 s.setJhlc(maps.get("jhlc").toString());
... ... @@ -172,13 +195,22 @@ public class FormsServiceImpl implements FormsService {
172 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 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 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 215 List<Shifday> list = jdbcTemplate.query(sql, new RowMapper<Shifday>() {
184 216  
... ... @@ -200,7 +232,7 @@ public class FormsServiceImpl implements FormsService {
200 232 for(int i=0;i<list.size();i++){
201 233 Shifday shi=list.get(i);
202 234 Map<String, Object> maps = new HashMap<>();
203   - maps = scheduleRealInfoService.findKMBC2(shi.getJgh(), shi.getCarPlate(),
  235 + maps = commonService.findKMBC2(shi.getJgh(), shi.getCarPlate(),
204 236 shi.getRq());
205 237 shi.setJhlc(maps.get("jhlc").toString());// 计划里程
206 238 //shifday.setSjjhlc(map.get("remMileage").toString());//实际计划里程
... ... @@ -261,7 +293,6 @@ public class FormsServiceImpl implements FormsService {
261 293 @Override
262 294 public Changetochange mapRow(ResultSet arg0, int arg1) throws SQLException {
263 295 Changetochange chan = new Changetochange();
264   -
265 296 chan.setRq(rq);
266 297 chan.setGs(arg0.getString("gs"));
267 298 chan.setFgs(arg0.getString("fgs"));
... ... @@ -302,18 +333,22 @@ public class FormsServiceImpl implements FormsService {
302 333  
303 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 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 340 + " where r.schedule_date_str BETWEEN '" + map.get("startDate").toString() + "'"
311 341 + " and '"+ map.get("endDate").toString() + "'"
312 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 353 startDate = map.get("startDate").toString();
319 354 endDate = map.get("endDate").toString();
... ... @@ -324,7 +359,7 @@ public class FormsServiceImpl implements FormsService {
324 359 Singledata sin = new Singledata();
325 360 sin.setrQ(rq);
326 361 sin.setgS(arg0.getString("gs_name"));
327   - sin.setxL(arg0.getString("xl_bm"));
  362 + sin.setxL(arg0.getString("xl_name"));
328 363 sin.setClzbh(arg0.getString("cl_zbh"));
329 364 sin.setJsy(arg0.getString("j_gh"));
330 365 sin.setjName(arg0.getString("j_name"));
... ... @@ -339,7 +374,7 @@ public class FormsServiceImpl implements FormsService {
339 374 for(int i=0;i<list.size();i++){
340 375 Singledata si=list.get(i);
341 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 378 endDate);
344 379 //sin.setjName(maps.get("j_name") == null ? "" : maps.get("j_name").toString());
345 380 si.setSgh(maps.get("s_gh") == null ? "" : maps.get("s_gh").toString());
... ... @@ -356,24 +391,30 @@ public class FormsServiceImpl implements FormsService {
356 391 @Override
357 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 395 + " FROM bsth_c_s_sp_info_real r "
361 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 418 List<Operationservice> list = jdbcTemplate.query(sql, new RowMapper<Operationservice>() {
378 419  
379 420 @Override
... ... @@ -392,9 +433,9 @@ public class FormsServiceImpl implements FormsService {
392 433 for(int i=0;i<list.size();i++){
393 434 Operationservice o=list.get(i);
394 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 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 439 o.setEmptMileage(maps.get("ksgl").toString() == null ? "" : maps.get("ksgl").toString());
399 440 o.setSjbc(maps.get("sjbc").toString() == null ? "" : maps.get("sjbc").toString());
400 441 }
... ... @@ -404,7 +445,7 @@ public class FormsServiceImpl implements FormsService {
404 445  
405 446 // 车辆加注
406 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 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 451 + " FROM bsth_c_s_sp_info_real r "
... ... @@ -414,13 +455,14 @@ public class FormsServiceImpl implements FormsService {
414 455 + " where to_days(r.schedule_date_str)=to_days('" + date + "')"
415 456 + " and r.xl_bm='" + line + "' "
416 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 466 List<Vehicleloading> list = jdbcTemplate.query(sql, new RowMapper<Vehicleloading>() {
425 467 @Override
426 468 public Vehicleloading mapRow(ResultSet arg0, int arg1) throws SQLException {
... ... @@ -429,8 +471,8 @@ public class FormsServiceImpl implements FormsService {
429 471 ve.setgS(arg0.getString("gs_name"));
430 472 ve.setxL(arg0.getString("xl_name"));
431 473 ve.setClzbh(arg0.getString("cl_zbh"));
432   - ve.setHyl(arg0.getString("YH"));
433 474 ve.setJzl(arg0.getString("JZL"));
  475 + ve.setHyl(arg0.getString("YH"));
434 476 // ve.setLs(arg0.getString("").toString());//尿素
435 477 ve.setJgh(arg0.getString("j_gh").toString());
436 478 return ve;
... ... @@ -440,9 +482,9 @@ public class FormsServiceImpl implements FormsService {
440 482 for(int i=0;i<list.size();i++){
441 483 Vehicleloading v=list.get(i);
442 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 488 v.setJhbc(maps.get("jhbc").toString() == null ? "" : maps.get("jhbc").toString());// 计划班次
447 489 v.setSjbc(maps.get("sjbc").toString() == null ? "" : maps.get("sjbc").toString());// 实际班次
448 490 }
... ... @@ -476,8 +518,8 @@ public class FormsServiceImpl implements FormsService {
476 518 + " and '" + map.get("endDate").toString() + "' and xl_bm='"+ map.get("line").toString() + "' "
477 519 + " AND gs_bm is not null "
478 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 523 + " GROUP BY gs_bm,fgs_bm,xl_bm,gs_name,fgs_name,bc_type ) a left JOIN ("
482 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 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 552 tu.setBcjh(arg0.getString("jbc").toString());
511 553 tu.setBcsj(arg0.getString("sbc").toString());
512 554 tu.setBbzxl(result2 + "%");// 班次执行率
513   - // tu.setSm(arg0.getString("gs_name").toString());
  555 + tu.setSm(arg0.getString("gs_name").toString());
514 556 tu.setGsgs(arg0.getString("gslsbm").toString());
515 557 tu.setFgsgs(arg0.getString("fgsbm").toString());
516 558 return tu;
... ... @@ -547,8 +589,8 @@ public class FormsServiceImpl implements FormsService {
547 589 + " from bsth_c_s_sp_info" + " where DATE_FORMAT(schedule_date,'%Y-%m-%d') BETWEEN '"
548 590 + map.get("startDate").toString() + "' and '" + map.get("endDate").toString() + "' and xl_bm='"
549 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 594 + " GROUP BY gs_bm,fgs_bm,xl_bm,gs_name,fgs_name,bc_type ) a left JOIN ("
553 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 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 660 + " from bsth_c_s_sp_info" + " where DATE_FORMAT(schedule_date,'%Y-%m-%d') BETWEEN '"
619 661 + map.get("startDate").toString() + "' and '" + map.get("endDate").toString() + "' and xl_bm='"
620 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 665 + " GROUP BY gs_bm,fgs_bm,xl_bm,gs_name,fgs_name,bc_type ) a left JOIN ("
624 666 + "SELECT COUNT(*"
625 667 + ") as xlgs,b.gs_bm,b.fgs_bm,b.xl_bm,b."
... ... @@ -655,18 +697,13 @@ public class FormsServiceImpl implements FormsService {
655 697 tu.setBcsj(arg0.getString("sbc").toString());
656 698 tu.setBbzxl(result2 + "%");// 班次执行率
657 699  
658   - // tu.setSm(arg0.getString("xl_name").toString());
  700 + tu.setSm(arg0.getString("xl_name").toString());
659 701 tu.setGsgs(arg0.getString("gslsbm").toString());
660 702 tu.setFgsgs(arg0.getString("fgsbm").toString());
661 703 return tu;
662   - }
663   -
664   -
  704 + }
665 705 });
666 706  
667   -
668   -
669   -
670 707 return list;
671 708 }
672 709 }
... ...
src/main/java/com/bsth/service/gps/GpsService.java
... ... @@ -14,4 +14,6 @@ public interface GpsService {
14 14 Map<String, Object> search(Map<String, Object> map, int page, int size, String order, String direction);
15 15  
16 16 Map<String,Object> removeRealGps(String device);
  17 +
  18 + Map<String,Object> findRoadSpeed(String lineCode);
17 19 }
... ...
src/main/java/com/bsth/service/gps/GpsServiceImpl.java
1 1 package com.bsth.service.gps;
2 2  
3   -import java.lang.reflect.Field;
4   -import java.sql.Connection;
5   -import java.sql.PreparedStatement;
6   -import java.sql.ResultSet;
7   -import java.util.ArrayList;
8   -import java.util.Calendar;
9   -import java.util.Collection;
10   -import java.util.Collections;
11   -import java.util.Comparator;
12   -import java.util.Date;
13   -import java.util.HashMap;
14   -import java.util.List;
15   -import java.util.Map;
16   -
17   -import org.apache.commons.lang3.StringUtils;
18   -import org.slf4j.Logger;
19   -import org.slf4j.LoggerFactory;
20   -import org.springframework.beans.factory.annotation.Autowired;
21   -import org.springframework.stereotype.Service;
22   -
23 3 import com.bsth.common.ResponseCode;
24 4 import com.bsth.data.BasicData;
25 5 import com.bsth.data.arrival.ArrivalEntity;
... ... @@ -31,6 +11,19 @@ import com.bsth.util.DateUtils;
31 11 import com.bsth.util.TransGPS;
32 12 import com.bsth.util.TransGPS.Location;
33 13 import com.bsth.util.db.DBUtils_MS;
  14 +import org.apache.commons.lang3.StringUtils;
  15 +import org.slf4j.Logger;
  16 +import org.slf4j.LoggerFactory;
  17 +import org.springframework.beans.factory.annotation.Autowired;
  18 +import org.springframework.dao.DataAccessException;
  19 +import org.springframework.jdbc.core.JdbcTemplate;
  20 +import org.springframework.stereotype.Service;
  21 +
  22 +import java.lang.reflect.Field;
  23 +import java.sql.Connection;
  24 +import java.sql.PreparedStatement;
  25 +import java.sql.ResultSet;
  26 +import java.util.*;
34 27  
35 28 @Service
36 29 public class GpsServiceImpl implements GpsService {
... ... @@ -51,6 +44,9 @@ public class GpsServiceImpl implements GpsService {
51 44 @Autowired
52 45 GpsRealData gpsRealData;
53 46  
  47 + @Autowired
  48 + JdbcTemplate jdbcTemplate;
  49 +
54 50 // 历史gps查询
55 51 @Override
56 52 public List<Map<String, Object>> history(String device, Long startTime, Long endTime, int directions) {
... ... @@ -199,9 +195,9 @@ public class GpsServiceImpl implements GpsService {
199 195 inv = inv.substring(0, inv.length() - 1);
200 196  
201 197 // 查询到离站数据
202   - Map<String, ArrivalEntity> arrivalMap = findArrivalByTs(weekOfYear/* 30 */, st, et, inv);
  198 + //Map<String, ArrivalEntity> arrivalMap = findArrivalByTs(weekOfYear/* 30 */, st, et, inv);
203 199  
204   - String sql = "select DEVICE_ID,LON,LAT,TS,INOUT_STOP,SERVICE_STATE ,STOP_NO from bsth_c_gps_info where days_year=? and device_id in ("
  200 + String sql = "select DEVICE_ID,LON,LAT,TS,INOUT_STOP,SERVICE_STATE ,STOP_NO,DIRECTION,LINE_ID,SPEED_GPS from bsth_c_gps_info where days_year=? and device_id in ("
205 201 + inv + ") and ts > ? and ts < ?";
206 202 try {
207 203 conn = DBUtils_MS.getConnection();
... ... @@ -235,15 +231,19 @@ public class GpsServiceImpl implements GpsService {
235 231 map.put("ts", rs.getLong("TS"));
236 232 map.put("timestamp", rs.getLong("TS"));
237 233 map.put("stopNo", rs.getString("STOP_NO"));
  234 + map.put("direction", rs.getFloat("DIRECTION"));
  235 +
  236 + map.put("lineId", rs.getString("LINE_ID"));
  237 + map.put("speed", rs.getFloat("SPEED_GPS"));
238 238  
239 239 inOutStop = rs.getInt("INOUT_STOP");
240 240 map.put("inout_stop", inOutStop);
241 241  
242   - arrival = arrivalMap.get(rs.getString("DEVICE_ID") + "_" + rs.getLong("TS"));
243   - if (arrival != null) {
244   - map.put("inout_stop_info", arrival);
245   - map.put("inout_stop", arrival.getInOut());
246   - }
  242 + /*analyse = arrivalMap.get(rs.getString("DEVICE_ID") + "_" + rs.getLong("TS"));
  243 + if (analyse != null) {
  244 + map.put("inout_stop_info", analyse);
  245 + map.put("inout_stop", analyse.getInOut());
  246 + }*/
247 247 map.put("nbbm", BasicData.deviceId2NbbmMap.get(rs.getString("DEVICE_ID")));
248 248 map.put("state", 0);
249 249 // 上下行
... ... @@ -388,6 +388,22 @@ public class GpsServiceImpl implements GpsService {
388 388 return rs;
389 389 }
390 390  
  391 + @Override
  392 + public Map<String, Object> findRoadSpeed(String lineCode) {
  393 + Map<String, Object> rs = new HashMap<>();
  394 +
  395 + try {
  396 + String sql = "select ID, ST_AsText(GROAD_VECTOR) as GROAD_VECTOR,ROAD_CODE,ROAD_NAME,SPEED from bsth_c_road where road_code in(select section_code from bsth_c_sectionroute where line_code=? and destroy=0)";
  397 + List<Map<String, Object>> list = jdbcTemplate.queryForList(sql, lineCode);
  398 + rs.put("status", ResponseCode.SUCCESS);
  399 + rs.put("roads", list);
  400 + } catch (DataAccessException e) {
  401 + logger.error("", e);
  402 + rs.put("status", ResponseCode.ERROR);
  403 + }
  404 + return rs;
  405 + }
  406 +
391 407 private void sortGpsList(final Field f, List<GpsEntity> rs) {
392 408 Collections.sort(rs, new Comparator<GpsEntity>() {
393 409  
... ...
src/main/java/com/bsth/service/oil/impl/YlbServiceImpl.java
... ... @@ -131,6 +131,7 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
131 131 t.setXlbm(map.get("xlBm")==null?"":map.get("xlBm").toString());
132 132 t.setJcsx(Integer.parseInt(map.get("seqNumber").toString()));
133 133 t.setSsgsdm(map.get("company")==null?"":map.get("company").toString());
  134 + t.setFgsdm(map.get("bCompany")==null?"":map.get("bCompany").toString());
134 135 t.setRq(dBefore);
135 136 repository.save(t);
136 137 result = "success";
... ... @@ -216,6 +217,7 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
216 217 t.setXlbm(map.get("xlBm")==null?"":map.get("xlBm").toString());
217 218 t.setJcsx(Integer.parseInt(map.get("seqNumber").toString()));
218 219 t.setSsgsdm(map.get("company")==null?"":map.get("company").toString());
  220 + t.setFgsdm(map.get("bCompany")==null?"":map.get("bCompany").toString());
219 221 t.setRq(sdf.parse(rq));
220 222 repository.save(t);
221 223 newMap.put("status", ResponseCode.SUCCESS);
... ...
src/main/java/com/bsth/service/realcontrol/ScheduleRealInfoService.java
... ... @@ -59,7 +59,7 @@ public interface ScheduleRealInfoService extends BaseService&lt;ScheduleRealInfo, L
59 59 */
60 60 void adjustConductor(ScheduleRealInfo schedule, String conductor, String conductorName);
61 61  
62   - List<ScheduleRealInfo> queryUserInfo(String line,String date);
  62 + List<ScheduleRealInfo> queryUserInfo(String line,String date,String state);
63 63  
64 64 List<ScheduleRealInfo> exportWaybill(String jName,String clZbh,String lpName,String date);
65 65  
... ...
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
... ... @@ -459,8 +459,13 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
459 459 }
460 460  
461 461 @Override
462   - public List<ScheduleRealInfo> queryUserInfo(String line, String date) {
463   - return scheduleRealInfoRepository.queryUserInfo2(line, date);
  462 + public List<ScheduleRealInfo> queryUserInfo(String line, String date,String state) {
  463 + if(state.equals("2")){
  464 + return scheduleRealInfoRepository.queryUserInfo2(line, date);
  465 + }else{
  466 + return scheduleRealInfoRepository.queryUserInfo3(line, date);
  467 + }
  468 +
464 469 }
465 470 /**
466 471 *
... ... @@ -613,13 +618,6 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
613 618  
614 619 @Override
615 620 public List<Object[]> historyMessage(String line, String date, String code) {
616   -
617   - String sql="select t.car_code,d.sender,d.txt_content,d.timestamp from ("
618   - + " select equipment_code,car_code from bsth_c_cars where id in("
619   - + " select cl from bsth_c_s_ccinfo where xl in ( "
620   - + " select id from bsth_c_line where line_code=?1 ))) t"
621   - + " left join bsth_v_directive_60 d on t.equipment_code=d.device_id "
622   - + " where d.timestamp >=?2 and d.timestamp <=?3 and t.car_code like '%?4%'";
623 621 SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
624 622 long d= 0;
625 623 long t=0;
... ... @@ -1182,7 +1180,11 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1182 1180 while(it.hasNext()){
1183 1181 ChildTaskPlan childTaskPlan = it.next();
1184 1182 if(childTaskPlan.getMileageType().equals("empty")){
1185   - ksgl += childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage();
  1183 + if(childTaskPlan.isDestroy()){
  1184 + remMileage += childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage();
  1185 + }else{
  1186 + ksgl += childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage();
  1187 + }
1186 1188 }else{
1187 1189 if(childTaskPlan.isDestroy()){
1188 1190 remMileage += childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage();
... ... @@ -1240,11 +1242,33 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1240 1242 @Override
1241 1243 public List<ScheduleRealInfo> queryListWaybill(String jName, String clZbh,
1242 1244 String lpName,String date,String type) {
  1245 + List <ScheduleRealInfo> list=null;
1243 1246 if(type.equals("qp")){
1244   - return scheduleRealInfoRepository.queryListWaybill2(jName,clZbh,lpName,date);
  1247 + list= scheduleRealInfoRepository.queryListWaybill2(jName,clZbh,lpName,date);
1245 1248 }else{
1246   - return scheduleRealInfoRepository.queryListWaybill(jName,clZbh,lpName,date);
  1249 + list= scheduleRealInfoRepository.queryListWaybill(jName,clZbh,lpName,date);
1247 1250 }
  1251 + for (int i = 0; i < list.size(); i++) {
  1252 + ScheduleRealInfo s=list.get(i);
  1253 + String remarks="";
  1254 + if(s.getRemarks()!=null){
  1255 + remarks +=s.getRemarks();
  1256 + }
  1257 + Set<ChildTaskPlan> childTaskPlans = s.getcTasks();
  1258 + if(!childTaskPlans.isEmpty()){
  1259 + Iterator<ChildTaskPlan> it = childTaskPlans.iterator();
  1260 + while(it.hasNext()){
  1261 + ChildTaskPlan c = it.next();
  1262 + if(c.getRemarks()!=null && c.getRemarks().length()>0){
  1263 + remarks += c.getRemarks();
  1264 + }
  1265 +
  1266 + }
  1267 + }
  1268 + s.setRemarks(remarks);
  1269 + }
  1270 +
  1271 + return list;
1248 1272 }
1249 1273  
1250 1274 @Override
... ... @@ -1325,11 +1349,6 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1325 1349 }else{
1326 1350 ssgl_other += tempJhlc;
1327 1351 }
1328   -
1329   -
1330   - }else{
1331   - ssgl += tempJhlc;
1332   - ssgl_other += tempJhlc;
1333 1352 }
1334 1353 }else{
1335 1354 Iterator<ChildTaskPlan> it = childTaskPlans.iterator();
... ... @@ -1570,6 +1589,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1570 1589 //根据线路代码获取公司
1571 1590 Line li = lineRepository.findByLineCode(scheduleRealInfo.getXlBm());
1572 1591 yesterdayDataList.get(i).put("company", li.getCompany());
  1592 + yesterdayDataList.get(i).put("bCompany", li.getBrancheCompany());
1573 1593 //计算总公里
1574 1594 Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks();
1575 1595 //如果没有子任务,里程就是已执行(Status=2);有子任务的,忽略主任务,子任务的烂班
... ...
src/main/java/com/bsth/service/report/ReportService.java
... ... @@ -19,11 +19,13 @@ public interface ReportService {
19 19  
20 20 List<Object[]> historyMessageCount(String line, String date, String code);
21 21  
22   - Map<String, Object> tbodyTime1(String line ,String date);
  22 + Map<String, Object> tbodyTime1(String line ,String ttinfo);
23 23  
24   - Map<String, Object> tbodyTime2(String line ,String date);
  24 + Map<String, Object> tbodyTime2(String line ,String ttinfo);
25 25  
26   - List<Map<String, Object>> tbodyTime3(String line ,String date);
27   - List<Map<String, Object>> tbodyTime5(String line ,String date);
  26 + List<Map<String, Object>> tbodyTime3(String line ,String ttinfo);
  27 + List<Map<String, Object>> tbodyTime5(String line ,String ttinfo);
  28 +
  29 + List<Map<String, Object>> getTtinfo(Map<String, Object> map);
28 30  
29 31 }
... ...
src/main/java/com/bsth/service/report/impl/ReportServiceImpl.java
... ... @@ -257,16 +257,18 @@ public class ReportServiceImpl implements ReportService{
257 257 return list;
258 258 }
259 259 @Override
260   - public Map<String, Object> tbodyTime1(String line, String date) {
  260 + public Map<String, Object> tbodyTime1(String line, String ttinfo) {
261 261 DecimalFormat df = new DecimalFormat("#0.00");
262 262 // TODO Auto-generated method stub
263 263 //查询配车
264   - String sqlPc=" SELECT cl_zbh FROM bsth_c_s_sp_info "
265   - +" where DATE_FORMAT(schedule_date,'%Y-%m-%d') ='"+date+"' "
266   - + " and xl_bm='"+line+"' and bc_type='normal' "
267   - + " group by cl_zbh ";
  264 + String sqlPc=" select count(*) from bsth_c_cars where id in("
  265 + + " select cl from bsth_c_s_ccinfo where xl in ( "
  266 + + " select id from bsth_c_line where line_code='"+line+"' )"
  267 + + " group by equipment_code ) ";
  268 +
268 269 Map<String, Object> map=new HashMap<String,Object>();
269   - List<Map<String, Object>> listPc= jdbcTemplate.query(sqlPc,
  270 +
  271 + /*List<Map<String, Object>> listPc= jdbcTemplate.query(sqlPc,
270 272 new RowMapper<Map<String, Object>>(){
271 273 @Override
272 274 public Map<String, Object> mapRow(ResultSet rs, int rowNum) throws SQLException {
... ... @@ -274,13 +276,12 @@ public class ReportServiceImpl implements ReportService{
274 276 m.put("zbh", rs.getString("cl_zbh"));
275 277 return m;
276 278 }
277   - });
  279 + });*/
278 280 //配车
279   - int pcs=listPc.size();
280   -
281   -
282   - String sqlPlan="select jhlc, bc_type ,fcsj from bsth_c_s_sp_info "
283   - + "where DATE_FORMAT(schedule_date,'%Y-%m-%d') ='"+date+"' and xl_bm='"+line+"'";
  281 + int pcs=jdbcTemplate.queryForObject(sqlPc, Integer.class);
  282 +
  283 + String sqlPlan=" SELECT jhlc,bc_type,fcsj FROM bsth_c_s_ttinfo_detail "
  284 + +" where ttinfo ='"+ttinfo+"' ";
284 285  
285 286 //班次
286 287 int zgf_0 = 6*60+31,zgf_1 = 8*60+30,wgf_0 = 16*60+1,wgf_1 = 18*60;
... ... @@ -306,17 +307,10 @@ public class ReportServiceImpl implements ReportService{
306 307 String fcsjs[]=m.get("fcsj").toString().split(":");
307 308  
308 309 zlc +=jhlc;
309   - if(bcType.equals("normal")){
310   - qcBc ++;
311   - if((Integer.parseInt(fcsjs[0])*60+Integer.parseInt(fcsjs[1])) > zgf_0
312   - && (Integer.parseInt(fcsjs[0])*60+Integer.parseInt(fcsjs[1])) < zgf_1){
313   - zqcBc++;
314   - }else if((Integer.parseInt(fcsjs[0])*60+Integer.parseInt(fcsjs[1])) > wgf_0
315   - && (Integer.parseInt(fcsjs[0])*60+Integer.parseInt(fcsjs[1])) < wgf_1){
316   - wqcBc++;
317   - }
318   - yylc +=jhlc;
319   - }else if(bcType.equals("region")){
  310 + if(bcType.equals("in") || bcType.equals("out")){
  311 + kslc+=jhlc;
  312 + }
  313 + else if(bcType.equals("region")){
320 314 qjBc++;
321 315 if((Integer.parseInt(fcsjs[0])*60+Integer.parseInt(fcsjs[1])) > zgf_0
322 316 && (Integer.parseInt(fcsjs[0])*60+Integer.parseInt(fcsjs[1])) < zgf_1){
... ... @@ -328,7 +322,15 @@ public class ReportServiceImpl implements ReportService{
328 322  
329 323 yylc+=jhlc;
330 324 }else{
331   - kslc+=jhlc;
  325 + qcBc ++;
  326 + if((Integer.parseInt(fcsjs[0])*60+Integer.parseInt(fcsjs[1])) > zgf_0
  327 + && (Integer.parseInt(fcsjs[0])*60+Integer.parseInt(fcsjs[1])) < zgf_1){
  328 + zqcBc++;
  329 + }else if((Integer.parseInt(fcsjs[0])*60+Integer.parseInt(fcsjs[1])) > wgf_0
  330 + && (Integer.parseInt(fcsjs[0])*60+Integer.parseInt(fcsjs[1])) < wgf_1){
  331 + wqcBc++;
  332 + }
  333 + yylc +=jhlc;
332 334 }
333 335 }
334 336  
... ... @@ -346,30 +348,91 @@ public class ReportServiceImpl implements ReportService{
346 348 return map;
347 349 }
348 350 @Override
349   - public Map<String, Object> tbodyTime2(String line, String date) {
  351 + public Map<String, Object> tbodyTime2(String line, String ttinfo) {
350 352 DecimalFormat df = new DecimalFormat("#0.00");
351 353 // TODO Auto-generated method stub
352   - //查询配车
353   - String sqlPc=" SELECT sum(bcsj) as yysj ,sum(jhlc) as yygl FROM bsth_c_s_sp_info "
354   - +" where DATE_FORMAT(schedule_date,'%Y-%m-%d') ='"+date+"' "
355   - + " and xl_bm='"+line+"' and bc_type in ('normal' ,'region' )";
  354 + //最早营运时间 区分夜宵线
  355 + String sqlMinYysj="select start_opt from bsth_c_line_config where line = '"+BasicData.lineId2CodeMap.inverse().get(line) +"'";
  356 + String minfcsj=jdbcTemplate.queryForObject(sqlMinYysj, String.class);
  357 + String[] minSjs = minfcsj.split(":");
  358 + int minSj=Integer.parseInt(minSjs[0])*60+Integer.parseInt(minSjs[1]);
  359 + //查询时间里程
  360 + String sqlPc=" (SELECT jhlc,fcsj,bc_type,lp,2 as xh FROM bsth_c_s_ttinfo_detail "
  361 + + " where ttinfo ='"+ttinfo+"' and fcsj <='"+minfcsj+"' ) "
  362 + + " union "
  363 + + " (SELECT jhlc,fcsj,bc_type,lp,1 as xh FROM bsth_c_s_ttinfo_detail "
  364 + + " where ttinfo ='"+ttinfo+"' and fcsj > '"+minfcsj+"') order by lp,xh,fcsj";
  365 +
356 366 Map<String, Object> map=new HashMap<String,Object>();
357 367 List<Map<String, Object>> list= jdbcTemplate.query(sqlPc,
358 368 new RowMapper<Map<String, Object>>(){
359 369 @Override
360 370 public Map<String, Object> mapRow(ResultSet rs, int rowNum) throws SQLException {
361 371 Map<String, Object> m=new HashMap<String,Object>();
362   - m.put("yysj", rs.getInt("yysj"));
363   - m.put("yygl", rs.getString("yygl")==null?"0":rs.getString("yygl"));
  372 + m.put("fcsj", rs.getString("fcsj"));
  373 + m.put("yygl", rs.getString("jhlc")==null?"0":rs.getString("jhlc"));
  374 + m.put("bcType", rs.getString("bc_type"));
  375 + m.put("lp", rs.getString("lp"));
364 376 return m;
365 377 }
366 378 });
367 379 int yysj=0 ;
368 380 double yycs=0 ,yygl=0;
369   - if(list.size()>0){
370   - Map<String, Object> m=list.get(0);
371   - yysj=Integer.parseInt((m.get("yysj").toString()));
372   - yygl=Double.parseDouble(m.get("yygl").toString());
  381 + String lp ="0";
  382 + int sj=0;
  383 +
  384 + for(int i=0;i<list.size();i++){
  385 + Map<String, Object> m=list.get(i);
  386 + String time=m.get("fcsj").toString();
  387 + String[] times = time.split(":");
  388 + if(lp.equals(m.get("lp").toString())){
  389 + if(Integer.parseInt(times[0])*60+Integer.parseInt(times[1]) <=minSj){
  390 + if(m.get("bcType").equals("in") || m.get("bcType").equals("out")){
  391 + if(m.get("bcType").equals("in")){
  392 + if(sj!=0){
  393 + yysj +=(Integer.parseInt(times[0])+24)*60+Integer.parseInt(times[1])-sj;
  394 + }
  395 + sj=0;
  396 + }
  397 + }else{
  398 + yygl += Double.parseDouble(m.get("yygl").toString());
  399 +
  400 + if(sj==0){
  401 + sj=(Integer.parseInt(times[0])+24)*60+Integer.parseInt(times[1]);
  402 + }else{
  403 + yysj +=(Integer.parseInt(times[0])+24)*60+Integer.parseInt(times[1])-sj;
  404 + sj=(Integer.parseInt(times[0])+24)*60+Integer.parseInt(times[1]);
  405 + }
  406 + }
  407 + }else{
  408 + if(m.get("bcType").equals("in") || m.get("bcType").equals("out")){
  409 + if(m.get("bcType").equals("in")){
  410 + if(sj!=0){
  411 + yysj +=Integer.parseInt(times[0])*60+Integer.parseInt(times[1])-sj;
  412 + }
  413 + sj=0;
  414 + }
  415 + }else{
  416 + yygl += Double.parseDouble(m.get("yygl").toString());
  417 +
  418 + if(sj==0){
  419 + sj=Integer.parseInt(times[0])*60+Integer.parseInt(times[1]);
  420 + }else{
  421 + yysj +=Integer.parseInt(times[0])*60+Integer.parseInt(times[1])-sj;
  422 + sj=Integer.parseInt(times[0])*60+Integer.parseInt(times[1]);
  423 + }
  424 + }
  425 + }
  426 + }else{
  427 + if( !(m.get("bcType").equals("in") || m.get("bcType").equals("out"))){
  428 + yygl += Double.parseDouble(m.get("yygl").toString());
  429 + sj =Integer.parseInt(times[0])*60+Integer.parseInt(times[1]);
  430 + }else{
  431 + sj=0;
  432 + }
  433 + lp=m.get("lp").toString();
  434 +
  435 + }
373 436 }
374 437 if(yysj>0){
375 438 yycs =yygl/(yysj*1.0/60);
... ... @@ -767,4 +830,34 @@ public class ReportServiceImpl implements ReportService{
767 830 newList.add(newmap5);
768 831 return newList;
769 832 }
  833 + @Override
  834 + public List<Map<String, Object>> getTtinfo(Map<String, Object> map) {
  835 + // TODO Auto-generated method stub
  836 + List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
  837 + String line = map.get("line").toString();
  838 + try {
  839 + String sql = "select tt.id, tt.name from bsth_c_s_ttinfo tt "
  840 + + "left join bsth_c_line cl on cl.id = tt.xl "
  841 + + " where tt.is_cancel = 0 and tt.is_enable_dis_template = 1";
  842 + if(line.length() != 0){
  843 + sql += " and cl.line_code = '"+line+"'";
  844 + }
  845 + sql += " order by tt.create_date desc";
  846 +
  847 + list = jdbcTemplate.query(sql,
  848 + new RowMapper<Map<String, Object>>(){
  849 + @Override
  850 + public Map<String, Object> mapRow(ResultSet rs, int rowNum) throws SQLException {
  851 + Map<String, Object> map = new HashMap<String, Object>();
  852 + map.put("id", rs.getString("id"));
  853 + map.put("name", rs.getString("name"));
  854 + return map;
  855 + }
  856 + });
  857 + }catch (Exception e) {
  858 + // TODO Auto-generated catch block
  859 + e.printStackTrace();
  860 + }
  861 + return list;
  862 + }
770 863 }
... ...
src/main/resources/static/pages/control/lineallot/allot.html
... ... @@ -404,8 +404,8 @@ $(function(){
404 404 var f = arguments.callee
405 405 ,item = lsData[i];
406 406  
407   - //$.get('/realMap/findRouteByLine', {lineCode: item.lineCode}, function(rs){
408   - $.get('/realSchedule/findRouteByLine', {lineCode: item.lineCode}, function(rs){
  407 + $.get('/realMap/findRouteByLine', {lineCode: item.lineCode}, function(rs){
  408 + //$.get('/realSchedule/findRouteByLine', {lineCode: item.lineCode}, function(rs){
409 409 if(rs && rs.lineId){
410 410 cacheData[item.lineCode] = rs;
411 411 i ++;
... ...
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 43 <div class="portlet light porttlet-fit bordered">
44 44 <div class="portlet-title">
45 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 58 <div style="display: inline-block;">
55 59 <span class="item-label" style="width: 80px;">线路: </span> <select
56 60 class="form-control" name="line" id="line" style="width: 120px;"></select>
... ... @@ -188,15 +192,20 @@
188 192 var endDate;
189 193 var gsdmAllline;
190 194 var fgsdmAllline;
191   - $("#query").on("click",function() {
  195 + $("#query")
  196 + .on(
  197 + "click",
  198 + function() {
192 199 line = $("#line").val();
193 200 startDate1 = $("#startDate").val();
194 201 endDate1 = $("#endDate").val();
195 202 gsdmAllline = $("#gsdmAllline").val();
196 203 fgsdmAllline = $("#fgsdmAllline").val();
197 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 209 line : line,
201 210 startDate : $("#startDate").val(),
202 211 endDate : $("#endDate").val(),
... ... @@ -285,7 +294,14 @@
285 294 $("#export").on(
286 295 "click",
287 296 function() {
  297 + line = $("#line").val();
  298 + startDate1 = $("#startDate").val();
  299 + endDate1 = $("#endDate").val();
  300 + gsdmAllline = $("#gsdmAllline").val();
  301 + fgsdmAllline = $("#fgsdmAllline").val();
288 302 $post('/mcy_export/alllineExport', {
  303 + gsdmAllline : gsdmAllline,
  304 + fgsdmAllline : fgsdmAllline,
289 305 line : line,
290 306 startDate : startDate,
291 307 endDate : endDate,
... ...
src/main/resources/static/pages/forms/statement/changetochange.html
... ... @@ -43,18 +43,22 @@
43 43 <div class="portlet light porttlet-fit bordered">
44 44 <div class="portlet-title">
45 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 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 62 <div style="display: inline-block; margin-left: 15px;">
59 63 <span class="item-label" style="width: 80px;">开始时间: </span> <input
60 64 class="form-control" type="text" id="startDate"
... ... @@ -139,51 +143,55 @@
139 143 locale : 'zh-cn'
140 144 });
141 145  
142   -
143 146 var obj = [];
144   - $.get('/user/companyData', function(result){
  147 + $.get('/user/companyData', function(result) {
145 148 obj = result;
146 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 162 $('#gsdmChange').html(options);
159 163 updateCompany();
160 164 });
161 165  
162   - $("#gsdmChange").on("change",updateCompany);
163   - function updateCompany(){
  166 + $("#gsdmChange").on("change", updateCompany);
  167 + function updateCompany() {
164 168 var company = $('#gsdmChange').val();
165 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 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 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 195 var line;
188 196 var startDate;
189 197 var endDate;
... ... @@ -194,7 +202,8 @@
194 202 sel = $("#sel").val();
195 203 var startDate1 = $("#startDate").val();
196 204 var endDate1 = $("#endDate").val();
197   -
  205 + var gsdmChange= $("#gsdmChange").val();
  206 + var fgsdmChange= $("#fgsdmChange").val();
198 207 if (startDate1 != '' && endDate1 != '') {
199 208 $post('/mcy_forms/changetochange', {
200 209 sel : sel,
... ... @@ -235,7 +244,17 @@
235 244 $("#export").on(
236 245 "click",
237 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 253 $post('/mcy_export/changetochangeExport', {
  254 + sel:sel,
  255 + line:line,
  256 + gsdmChange:gsdmChange,
  257 + fgsdmChange:fgsdmChange,
239 258 startDate : startDate,
240 259 endDate : endDate,
241 260 type : 'export'
... ...
src/main/resources/static/pages/forms/statement/correctForm.html
... ... @@ -226,8 +226,8 @@
226 226 // 把渲染好的模版html文本追加到表格中
227 227 $('#forms .list_correctForm').html(list_correctForm);
228 228  
229   - var list_correctForm_statistics = template('list_correctForm_statistics',temp);
230   - $('#forms .list_correctForm_statistics').html(list_correctForm_statistics);
  229 + /* var list_correctForm_statistics = template('list_correctForm_statistics',temp);
  230 + $('#forms .list_correctForm_statistics').html(list_correctForm_statistics); */
231 231 });
232 232 });
233 233 });
... ...
src/main/resources/static/pages/forms/statement/executionrate.html
... ... @@ -37,14 +37,14 @@
37 37 <div class="portlet light porttlet-fit bordered">
38 38 <div class="portlet-title">
39 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 41 <span class="item-label" style="width: 80px;">公司: </span>
42 42 <select class="form-control" name="company" id="gsdmEcecut" style="width: 140px;"></select>
43 43 </div>
44 44 <div style="display: inline-block; margin-left: 24px;" id="fgsdmDiv_ececut">
45 45 <span class="item-label" style="width: 80px;">分公司: </span>
46 46 <select class="form-control" name="subCompany" id="fgsdmEcecut" style="width: 140px;"></select>
47   - </div> -->
  47 + </div>
48 48 <div style="display: inline-block;">
49 49 <span class="item-label" style="width: 80px;">线路: </span>
50 50 <select class="form-control" name="line" id="line" style="width: 120px;"></select>
... ... @@ -71,7 +71,7 @@
71 71 <th colspan="11">班次执行率统计表</th>
72 72 </tr>
73 73 <tr>
74   - <td rowspan="2" style=" padding-top: 20px;">日期</td>
  74 + <td rowspan="2" style=" padding-top: 20px;">日期</td>
75 75 <td rowspan="2" style=" padding-top: 20px;">公司</td>
76 76 <td rowspan="2" style=" padding-top: 20px;">直属公司</td>
77 77 <td rowspan="2" style=" padding-top: 20px;">线路条数</td>
... ... @@ -181,15 +181,15 @@
181 181 gsdmEcecut=$("#gsdmEcecut").val();
182 182 fgsdmEcecut=$("#fgsdmEcecut").val();
183 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 186 var tbodyHtml = template('executionrate',{list:result});
187 187 // 把渲染好的模版html文本追加到表格中
188 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 193 $("#sDate").text(startDate);
194 194 $("#eDate").text(endDate);
195 195  
... ... @@ -240,7 +240,12 @@
240 240 });
241 241  
242 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 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 27 <div class="portlet light porttlet-fit bordered">
28 28 <div class="portlet-title">
29 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 31 <span class="item-label" style="width: 80px;">公司: </span>
32 32 <select class="form-control" name="company" id="gsdmLine" style="width: 140px;"></select>
33 33 </div>
34 34 <div style="display: inline-block; margin-left: 24px;" id="fgsdmDiv_line">
35 35 <span class="item-label" style="width: 80px;">分公司: </span>
36 36 <select class="form-control" name="subCompany" id="fgsdmLine" style="width: 140px;"></select>
37   - </div> -->
  37 + </div>
38 38 <div style="display: inline-block;">
39 39 <span class="item-label" style="width: 80px;">线路: </span>
40 40 <select class="form-control" name="line" id="line" style="width: 180px;"></select>
... ... @@ -140,7 +140,7 @@
140 140 var date = $("#date").val();
141 141 var gsdmLine = $("#gsdmLine").val();
142 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 144 $.each(result, function(i, obj) {
145 145 obj.requestType = reqCodeMap[obj.requestType];
146 146 });
... ... @@ -150,6 +150,16 @@
150 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 164 </script>
155 165 <script type="text/html" id="list_linepasswengerflow">
... ...
src/main/resources/static/pages/forms/statement/operationservice.html
... ... @@ -30,7 +30,7 @@
30 30 <div class="portlet light porttlet-fit bordered">
31 31 <div class="portlet-title">
32 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 34 id="gsdmDiv_operat">
35 35 <span class="item-label" style="width: 80px;">公司: </span> <select
36 36 class="form-control" name="company" id="gsdmOperat"
... ... @@ -41,7 +41,7 @@
41 41 <span class="item-label" style="width: 80px;">分公司: </span> <select
42 42 class="form-control" name="subCompany" id="fgsdmOperat"
43 43 style="width: 140px;"></select>
44   - </div> -->
  44 + </div>
45 45 <div style="display: inline-block;">
46 46 <span class="item-label" style="width: 80px;">线路: </span> <select
47 47 class="form-control" name="line" id="line" style="width: 180px;"></select>
... ... @@ -173,11 +173,11 @@
173 173 var startDate = $("#startDate").val();
174 174 var endDate = $("#endDate").val();
175 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 178 $post("/mcy_forms/operationservice", {
179   - /* gsdmOperat : gsdmOperat,
180   - fgsdmOperat : fgsdmOperat, */
  179 + gsdmOperat : gsdmOperat,
  180 + fgsdmOperat : fgsdmOperat,
181 181 line : line,
182 182 startDate : startDate,
183 183 endDate : endDate,
... ... @@ -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 222 </script>
211 223 <script type="text/html" id="operationservice">
... ...
src/main/resources/static/pages/forms/statement/scheduleDaily.html
... ... @@ -42,7 +42,7 @@
42 42 </form>
43 43 </div>
44 44 <div class="portlet-body">
45   - <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px">
  45 + <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px;height: 400px">
46 46 <label>早高峰:6:31~8:30&nbsp;&nbsp;&nbsp;&nbsp;晚高峰:16:01~18:00</label>
47 47 <table class="table table-bordered table-hover table-checkable" id="forms">
48 48 <thead>
... ...
src/main/resources/static/pages/forms/statement/scheduleDailyQp.html 0 → 100644
  1 +<style type="text/css">
  2 + .table-bordered {
  3 + border: 1px solid; }
  4 + .table-bordered > thead > tr > th,
  5 + .table-bordered > thead > tr > td,
  6 + .table-bordered > tbody > tr > th,
  7 + .table-bordered > tbody > tr > td,
  8 + .table-bordered > tfoot > tr > th,
  9 + .table-bordered > tfoot > tr > td {
  10 + border: 1px solid; }
  11 + .table-bordered > thead > tr > th,
  12 + .table-bordered > thead > tr > td {
  13 + border-bottom-width: 2px; }
  14 +
  15 + .table > tbody + tbody {
  16 + border-top: 1px solid; }
  17 +</style>
  18 +
  19 +<div class="page-head">
  20 + <div class="page-title">
  21 + <h1>调度工作日报表</h1>
  22 + </div>
  23 +</div>
  24 +
  25 +<div class="row">
  26 + <div class="col-md-12">
  27 + <div class="portlet light porttlet-fit bordered">
  28 + <div class="portlet-title">
  29 + <form id="history" class="form-inline" action="">
  30 + <div style="display: inline-block; margin-left: 10px;" id="company1">
  31 + <span class="item-label" style="width: 80px;">公司: </span>
  32 + <select class="form-control" name="company" id="company" style="width: 160px;"></select>
  33 + </div>
  34 + <div style="display: inline-block; margin-left: 10px;" id="subCompany1">
  35 + <span class="item-label" style="width: 80px;">分公司: </span>
  36 + <select class="form-control" name="subCompany" id="subCompany" style="width: 160px;"></select>
  37 + </div>
  38 + <div style="display: inline-block; margin-left: 10px;">
  39 + <span class="item-label" style="width: 80px;">线路: </span>
  40 + <select class="form-control" name="line" id="line" style="width: 180px;"></select>
  41 + </div>
  42 + <div style="display: inline-block;margin-left: 10px;">
  43 + <span class="item-label" style="width: 80px;">时间: </span>
  44 + <input class="form-control" type="text" id="date" style="width: 180px;"/>
  45 + </div>
  46 + <div class="form-group">
  47 + <input class="btn btn-default" type="button" id="query" value="筛选"/>
  48 + <input class="btn btn-default" type="button" id="export" value="导出"/>
  49 + </div>
  50 + </form>
  51 + </div>
  52 + <div class="portlet-body" >
  53 + <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 506px;height: 400px">
  54 + <table class="table table-bordered table-hover table-checkable" id="forms">
  55 + <thead>
  56 + <tr >
  57 + <th style="text-align:center;vertical-align:middle;" rowspan="3">路牌</th>
  58 + <th style="text-align:center;vertical-align:middle;"
  59 + rowspan="2" colspan="2">车号</th>
  60 + <th rowspan="3">班别</th>
  61 + <th colspan="3" style="text-align:center;vertical-align:middle;">驾驶员</th>
  62 + <th colspan="3" style="text-align:center;vertical-align:middle;">售票员</th>
  63 + <th rowspan="3" style="text-align:center;vertical-align:middle;">路牌</th>
  64 + <th rowspan="3" style="text-align:center;vertical-align:middle;">记录项目</th>
  65 + <th colspan="3" style="text-align:center;vertical-align:middle;">1</th>
  66 + <th colspan="3" style="text-align:center;vertical-align:middle;">2</th>
  67 + <th colspan="3" style="text-align:center;vertical-align:middle;">3</th>
  68 + <th colspan="3" style="text-align:center;vertical-align:middle;">4</th>
  69 + <th colspan="3" style="text-align:center;vertical-align:middle;">5</th>
  70 + <th colspan="3" style="text-align:center;vertical-align:middle;">6</th>
  71 + <th colspan="3" style="text-align:center;vertical-align:middle;">7</th>
  72 + <th colspan="3" style="text-align:center;vertical-align:middle;">8</th>
  73 + <th colspan="3" style="text-align:center;vertical-align:middle;">9</th>
  74 + <th colspan="3" style="text-align:center;vertical-align:middle;">10</th>
  75 + <th colspan="3" style="text-align:center;vertical-align:middle;">11</th>
  76 + <th colspan="3" style="text-align:center;vertical-align:middle;">12</th>
  77 + <th colspan="3" style="text-align:center;vertical-align:middle;">13</th>
  78 +
  79 + </tr>
  80 + <tr>
  81 +
  82 + <th rowspan="2">职号</th>
  83 + <th colspan="2">接班时间</th>
  84 + <th rowspan="2">职号</th>
  85 + <th colspan="2">接班时间</th>
  86 + <th rowspan="2">到达</th>
  87 + <th rowspan="2">早/迟</th>
  88 + <th rowspan="2">开出</th>
  89 + <th rowspan="2">到达</th>
  90 + <th rowspan="2">早/迟</th>
  91 + <th rowspan="2">开出</th>
  92 + <th rowspan="2">到达</th>
  93 + <th rowspan="2">早/迟</th>
  94 + <th rowspan="2">开出</th>
  95 + <th rowspan="2">到达</th>
  96 + <th rowspan="2">早/迟</th>
  97 + <th rowspan="2">开出</th>
  98 + <th rowspan="2">到达</th>
  99 + <th rowspan="2">早/迟</th>
  100 + <th rowspan="2">开出</th>
  101 + <th rowspan="2">到达</th>
  102 + <th rowspan="2">早/迟</th>
  103 + <th rowspan="2">开出</th>
  104 + <th rowspan="2">到达</th>
  105 + <th rowspan="2">早/迟</th>
  106 + <th rowspan="2">开出</th>
  107 + <th rowspan="2">到达</th>
  108 + <th rowspan="2">早/迟</th>
  109 + <th rowspan="2">开出</th>
  110 + <th rowspan="2">到达</th>
  111 + <th rowspan="2">早/迟</th>
  112 + <th rowspan="2">开出</th>
  113 + <th rowspan="2">到达</th>
  114 + <th rowspan="2">早/迟</th>
  115 + <th rowspan="2">开出</th>
  116 + <th rowspan="2">到达</th>
  117 + <th rowspan="2">早/迟</th>
  118 + <th rowspan="2">开出</th>
  119 + <th rowspan="2">到达</th>
  120 + <th rowspan="2">早/迟</th>
  121 + <th rowspan="2">开出</th>
  122 + <th rowspan="2">到达</th>
  123 + <th rowspan="2">早/迟</th>
  124 + <th rowspan="2">开出</th>
  125 + </tr>
  126 + <tr>
  127 + <th>出场</th>
  128 + <th>调换</th>
  129 + <th>1</th>
  130 + <th>2</th>
  131 + <th>1</th>
  132 + <th>2</th>
  133 + </tr>
  134 + </thead>
  135 + <tbody>
  136 + <tr >
  137 + <td></td>
  138 + <td>
  139 + </td>
  140 + <td></td>
  141 + <td></td>
  142 + <td></td>
  143 + <td colspan="46">
  144 + <div>
  145 +
  146 + </div>
  147 + </td>
  148 + </tr>
  149 +
  150 + </tbody>
  151 + </table>
  152 + <div style="text-align: right;">
  153 + <ul id="pagination" class="pagination"></ul>
  154 + </div>
  155 + </div>
  156 + </div>
  157 + </div>
  158 + </div>
  159 +</div>
  160 +
  161 +<script>
  162 + $(function(){
  163 +
  164 + // 关闭左侧栏
  165 + if (!$('body').hasClass('page-sidebar-closed'))
  166 + $('.menu-toggler.sidebar-toggler').click();
  167 +
  168 + $("#date").datetimepicker({
  169 + format : 'YYYY-MM-DD',
  170 + locale : 'zh-cn'
  171 + });
  172 +
  173 + var d = new Date();
  174 + var year = d.getFullYear();
  175 + var month = d.getMonth() + 1;
  176 + var day = d.getDate();
  177 + if(month < 10)
  178 + month = "0" + month;
  179 + if(day < 10)
  180 + day = "0" + day;
  181 + $("#date").val(year + "-" + month + "-" + day);
  182 +
  183 + $.get('/basic/lineCode2Name',function(result){
  184 + var data=[];
  185 +
  186 + data.push({id: " ", text: "全部线路"});
  187 + for(var code in result){
  188 + data.push({id: code, text: result[code]});
  189 + }
  190 + initPinYinSelect2('#line',data,'');
  191 + })
  192 +
  193 + var obj = [];
  194 + $.get('/user/companyData', function(result){
  195 + obj = result;
  196 + var options = '';
  197 + for(var i = 0; i < obj.length; i++){
  198 + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';
  199 + }
  200 + if(obj.length == 1){
  201 + $('#company1').hide();
  202 + if(obj[0].children.length == 1)
  203 + $('#subCompany1').hide();
  204 + }
  205 + $('#company').html(options);
  206 + updateCompany();
  207 + });
  208 + $("#company").on("change",updateCompany);
  209 + function updateCompany(){
  210 + var company = $('#company').val();
  211 + var options = '';
  212 + for(var i = 0; i < obj.length; i++){
  213 + if(obj[i].companyCode == company){
  214 + var children = obj[i].children;
  215 + for(var j = 0; j < children.length; j++){
  216 + options += '<option value="'+children[j].code+'">'+children[j].name+'</option>';
  217 + }
  218 + }
  219 + }
  220 + $('#subCompany').html(options);
  221 + }
  222 +
  223 +
  224 + $("#query").on("click",jsDoQuery);
  225 +
  226 + var line = $("#line").val();
  227 + var date = $("#date").val();
  228 + var company = $("#company").val();
  229 + var subCompany = $("#subCompany").val();
  230 + function jsDoQuery(pagination){
  231 + var params = {};
  232 + line = $("#line").val();
  233 + date = $("#date").val();
  234 + company = $("#company").val();
  235 + subCompany = $("#subCompany").val();
  236 + if(line == " ")
  237 + line = "";
  238 + params['line'] = line;
  239 + params['date'] = date;
  240 + params['type'] = "query";
  241 + params['company'] = company;
  242 + params['subCompany'] = subCompany;
  243 + $(".hidden").removeClass("hidden");
  244 + /* $get('/pcpc/workDaily', params, function(result){
  245 + // 把数据填充到模版中
  246 + var tbodyHtml = template('list_workDaily',{list:result});
  247 + // 把渲染好的模版html文本追加到表格中
  248 + $('#forms tbody').html(tbodyHtml);
  249 +
  250 + }); */
  251 + }
  252 +
  253 + $("#export").on("click",function(){
  254 + $get('/pcpc/workDaily',{line:line,date:date,type:'export'},function(result){
  255 + window.open("/downloadFile/download?fileName=营运服务日报表"+moment(date).format("YYYYMMDD"));
  256 + });
  257 + });
  258 +
  259 +
  260 + });
  261 +
  262 +</script>
  263 +<script type="text/html" id="list_workDaily">
  264 + {{each list as obj i}}
  265 + <tr>
  266 + <td>{{obj.date}}</td>
  267 + <td>{{obj.line}}</td>
  268 + <td>{{obj.jhbc}}</td>
  269 + <td>{{obj.dftz}}</td>
  270 + <td>{{obj.dftzl}}</td>
  271 + <td>{{obj.ccl}}</td>
  272 + <td>{{obj.upfk}}</td>
  273 + <td>{{obj.updk}}</td>
  274 + <td>{{obj.dnfk}}</td>
  275 + <td>{{obj.dndk}}</td>
  276 + <td>{{obj.upfm}}</td>
  277 + <td>{{obj.updm}}</td>
  278 + <td>{{obj.dnfm}}</td>
  279 + <td>{{obj.dndm}}</td>
  280 + <td>{{obj.wdzs}}</td>
  281 + <td>{{obj.smbzdl}}</td>
  282 + <td>{{obj.gfbczxl}}</td>
  283 + </tr>
  284 + {{/each}}
  285 + {{if list.length == 0}}
  286 + <tr>
  287 + <td colspan="17"><h6 class="muted">没有找到相关数据</h6></td>
  288 + </tr>
  289 + {{/if}}
  290 +</script>
... ...
src/main/resources/static/pages/forms/statement/shifday.html
... ... @@ -28,14 +28,14 @@
28 28 <div class="portlet light porttlet-fit bordered">
29 29 <div class="portlet-title">
30 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 32 <span class="item-label" style="width: 80px;">公司: </span>
33 33 <select class="form-control" name="company" id="gsdmShif" style="width: 140px;"></select>
34 34 </div>
35 35 <div style="display: inline-block; margin-left: 24px;" id="fgsdmDiv_shif">
36 36 <span class="item-label" style="width: 80px;">分公司: </span>
37 37 <select class="form-control" name="subCompany" id="fgsdmShif" style="width: 140px;"></select>
38   - </div> -->
  38 + </div>
39 39 <div style="display: inline-block;">
40 40 <span class="item-label" style="width: 80px;">线路: </span>
41 41 <select class="form-control" name="line" id="line" style="width: 180px;"></select>
... ... @@ -154,9 +154,9 @@ $(function(){
154 154 $("#query").on("click",function(){
155 155 var line = $("#line").val();
156 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 160 $.each(result, function(i, obj) {
161 161 obj.requestType = reqCodeMap[obj.requestType];
162 162 });
... ... @@ -166,6 +166,16 @@ $(function(){
166 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 180 </script>
171 181 <script type="text/html" id="shifday">
... ... @@ -175,7 +185,6 @@ $(function(){
175 185 <td>{{obj.sName}}</td>
176 186 <td>{{obj.lpName}}</td>
177 187 <td>{{obj.carPlate}}</td>
178   -
179 188 <td>{{obj.jhlc}}</td>
180 189 <td>{{obj.sjjhlc}}</td>
181 190 <td>{{obj.yygl}}</td>
... ...
src/main/resources/static/pages/forms/statement/shiftuehiclemanth.html
... ... @@ -28,14 +28,14 @@
28 28 <div class="portlet light porttlet-fit bordered">
29 29 <div class="portlet-title">
30 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 32 <span class="item-label" style="width: 80px;">公司: </span>
33 33 <select class="form-control" name="company" id="gsdmManth" style="width: 140px;"></select>
34 34 </div>
35 35 <div style="display: inline-block; margin-left: 24px;" id="fgsdmDiv_manth">
36 36 <span class="item-label" style="width: 80px;">分公司: </span>
37 37 <select class="form-control" name="subCompany" id="fgsdmManth" style="width: 140px;"></select>
38   - </div> -->
  38 + </div>
39 39 <div style="display: inline-block;">
40 40 <span class="item-label" style="width: 80px;">线路: </span>
41 41 <select class="form-control" name="line" id="line" style="width: 136px;"></select>
... ... @@ -183,9 +183,9 @@
183 183 var startDate = $("#startDate").val();
184 184 var endDate = $("#endDate").val();
185 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 189 $("#sDate").text(startDate);
190 190 $("#eDate").text(endDate);
191 191 var temp = {};
... ... @@ -203,7 +203,20 @@
203 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 221 </script>
209 222 <script type="text/html" id="list_shiftuehiclemanth">
... ...
src/main/resources/static/pages/forms/statement/singledata.html
... ... @@ -28,14 +28,14 @@
28 28 <div class="portlet light porttlet-fit bordered">
29 29 <div class="portlet-title">
30 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 32 <span class="item-label" style="width: 80px;">公司: </span>
33 33 <select class="form-control" name="company" id="gsdmSing" style="width: 140px;"></select>
34 34 </div>
35 35 <div style="display: inline-block; margin-left: 24px;" id="fgsdmDiv_sing">
36 36 <span class="item-label" style="width: 80px;">分公司: </span>
37 37 <select class="form-control" name="subCompany" id="fgsdmSing" style="width: 140px;"></select>
38   - </div> -->
  38 + </div>
39 39 <div style="display: inline-block;">
40 40 <span class="item-label" style="width: 80px;">线路: </span>
41 41 <select class="form-control" name="line" id="line" style="width: 136px;"></select>
... ... @@ -152,9 +152,9 @@
152 152 var startDate = $("#startDate").val();
153 153 var endDate = $("#endDate").val();
154 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 158 $("#sDate").text(startDate);
159 159 $("#eDate").text(endDate);
160 160 var temp = {};
... ... @@ -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 188 </script>
177 189 <script type="text/html" id="singledata">
... ...
src/main/resources/static/pages/forms/statement/turnoutrate.html
... ... @@ -37,14 +37,14 @@
37 37 <div class="portlet light porttlet-fit bordered">
38 38 <div class="portlet-title">
39 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 41 <span class="item-label" style="width: 80px;">公司: </span>
42 42 <select class="form-control" name="company" id="gsdmTurn" style="width: 140px;"></select>
43 43 </div>
44 44 <div style="display: inline-block; margin-left: 24px;" id="fgsdmDiv_turn">
45 45 <span class="item-label" style="width: 80px;">分公司: </span>
46 46 <select class="form-control" name="subCompany" id="fgsdmTurn" style="width: 140px;"></select>
47   - </div> -->
  47 + </div>
48 48 <div style="display: inline-block;">
49 49 <span class="item-label" style="width: 80px;">线路: </span>
50 50 <select class="form-control" name="line" id="line" style="width: 120px;"></select>
... ... @@ -183,7 +183,7 @@
183 183 gsdmTurn=$("#gsdmTurn").val();
184 184 fgsdmTurn=$("#fgsdmTurn").val();
185 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 188 var tbodyHtml = template('turnoutrate',{list:result});
189 189 // 把渲染好的模版html文本追加到表格中
... ... @@ -243,7 +243,12 @@
243 243 });
244 244  
245 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 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 19  
20 20 <div class="page-head">
21 21 <div class="page-title">
22   - <h1>车辆加注/消耗量</h1>
  22 + <h1>车辆加注</h1>
23 23 </div>
24 24 </div>
25 25  
... ... @@ -28,14 +28,14 @@
28 28 <div class="portlet light porttlet-fit bordered">
29 29 <div class="portlet-title">
30 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 32 <span class="item-label" style="width: 80px;">公司: </span>
33 33 <select class="form-control" name="company" id="gsdmVehic" style="width: 140px;"></select>
34 34 </div>
35 35 <div style="display: inline-block; margin-left: 24px;" id="fgsdmDiv_vehic">
36 36 <span class="item-label" style="width: 80px;">分公司: </span>
37 37 <select class="form-control" name="subCompany" id="fgsdmVehic" style="width: 140px;"></select>
38   - </div> -->
  38 + </div>
39 39 <div style="display: inline-block;">
40 40 <span class="item-label" style="width: 80px;">线路: </span>
41 41 <select class="form-control" name="line" id="line" style="width: 180px;"></select>
... ... @@ -135,18 +135,32 @@
135 135 })
136 136  
137 137  
  138 + var line ;
  139 + var date ;
  140 + var gsdmVehic ;
  141 + var fgsdmVehic ;
138 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 149 var tbodyHtml = template('vehicleloading',{list:result});
146 150 // 把渲染好的模版html文本追加到表格中
147 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 165 </script>
152 166 <script type="text/html" id="vehicleloading">
... ... @@ -157,8 +171,8 @@
157 171 <td>{{obj.gS}}</td>
158 172 <td>{{obj.xL}}</td>
159 173 <td>{{obj.clzbh}}</td>
  174 + <td>{{obj.jzl}}</td>
160 175 <td>{{obj.hyl}}</td>
161   - <td>{{obj.jzl}}</td>
162 176 <td> </td>
163 177 <td>{{obj.jhlc}}</td>
164 178 <td> </td>
... ...
src/main/resources/static/pages/forms/statement/waybill.html
... ... @@ -152,7 +152,7 @@
152 152 var line = $("#line").val();
153 153 date = $("#date").val();
154 154 $(".hidden").removeClass("hidden");
155   - $get('/realSchedule/queryUserInfo',{line:line,date:date},function(result){
  155 + $get('/realSchedule/queryUserInfo',{line:line,date:date,state:2},function(result){
156 156 // 把数据填充到模版中
157 157 var tbodyHtml = template('list_info',{list:result});
158 158 // 把渲染好的模版html文本追加到表格中
... ...
src/main/resources/static/pages/forms/statement/waybillQp.html
... ... @@ -152,7 +152,7 @@
152 152 var line = $("#line").val();
153 153 date = $("#date").val();
154 154 $(".hidden").removeClass("hidden");
155   - $get('/realSchedule/queryUserInfo',{line:line,date:date},function(result){
  155 + $get('/realSchedule/queryUserInfo',{line:line,date:date,state:3},function(result){
156 156 // 把数据填充到模版中
157 157 var tbodyHtml = template('list_info',{list:result});
158 158 // 把渲染好的模版html文本追加到表格中
... ...
src/main/resources/static/pages/forms/statement/waybillday.html
... ... @@ -28,14 +28,14 @@
28 28 <div class="portlet light porttlet-fit bordered">
29 29 <div class="portlet-title">
30 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 32 <span class="item-label" style="width: 80px;">公司: </span>
33 33 <select class="form-control" name="company" id="gsdmWaybillday" style="width: 140px;"></select>
34 34 </div>
35 35 <div style="display: inline-block; margin-left: 24px;" id="fgsdmDiv_waybillday">
36 36 <span class="item-label" style="width: 80px;">分公司: </span>
37 37 <select class="form-control" name="subCompany" id="fgsdmWaybillday" style="width: 140px;"></select>
38   - </div> -->
  38 + </div>
39 39 <div style="display: inline-block;">
40 40 <span class="item-label" style="width: 80px;">线路: </span>
41 41 <select class="form-control" name="line" id="line" style="width: 180px;"></select>
... ... @@ -142,7 +142,7 @@
142 142 gsdmWaybillday=$("#gsdmWaybillday").val();
143 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 146 $.each(result, function(i, obj) {
147 147 obj.requestType = reqCodeMap[obj.requestType];
148 148 });
... ... @@ -154,7 +154,11 @@
154 154 });
155 155  
156 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 162 window.open("/downloadFile/download?fileName=行车路单日报表"+moment(date).format("YYYYMMDD"));
159 163 });
160 164 });
... ...
src/main/resources/static/pages/mapmonitor/real/js/map/platform/baidu.js
... ... @@ -57,37 +57,39 @@ var baiduMap = (function(){
57 57  
58 58 map.clearOverlays();
59 59 linePolyline = [];
60   - //从localStorage里读取路由信息
61 60 var upLineOps = {strokeColor:"blue", strokeWeight:6, strokeOpacity:0.5}
62 61 ,downLineOps = {strokeColor:"red", strokeWeight:6, strokeOpacity:0.5};
63 62  
64   - var upPos = [], downPos = [], tempArray;
65 63 var route = opts.route;
66   - //上行
  64 + var pos,temps, polyline;
67 65 if(route.up){
68   - $.each(route.up.split(','), function(){
69   - tempArray = this.split(' ');
70   - upPos.push(new BMap.Point(tempArray[0], tempArray[1]));
  66 + $.each(route.up_bd, function (i, item) {
  67 + pos = [];
  68 + $.each(item.split(','), function () {
  69 + temps = this.split(' ');
  70 + pos.push(new BMap.Point(temps[0], temps[1]));
  71 + });
  72 + polyline = new BMap.Polyline(pos, upLineOps);
  73 + map.addOverlay(polyline);
  74 +
  75 + linePolyline.push(polyline);
71 76 });
72 77  
73   - var upLine = new BMap.Polyline(upPos, upLineOps);
74   - map.addOverlay(upLine);
75   -
76   - linePolyline.push(upLine);
77   -
78   - map.panTo(upPos[parseInt(upPos.length / 2)]);
  78 + map.panTo(pos[parseInt(pos.length / 2)]);
79 79 }
80   - //下行
  80 +
81 81 if(route.down){
82   - $.each(route.down.split(','), function(){
83   - tempArray = this.split(' ');
84   - downPos.push(new BMap.Point(tempArray[0], tempArray[1]));
  82 + $.each(route.down_bd, function (i, item) {
  83 + pos = [];
  84 + $.each(item.split(','), function () {
  85 + temps = this.split(' ');
  86 + pos.push(new BMap.Point(temps[0], temps[1]));
  87 + });
  88 + polyline = new BMap.Polyline(pos, downLineOps);
  89 + map.addOverlay(polyline);
  90 +
  91 + linePolyline.push(polyline);
85 92 });
86   -
87   - var downLine = new BMap.Polyline(downPos, downLineOps);
88   - map.addOverlay(downLine);
89   -
90   - linePolyline.push(downLine);
91 93 }
92 94 },
93 95 //绘制GPS信号
... ...
src/main/resources/static/pages/mapmonitor/real/js/map/platform/gaode.js
... ... @@ -77,11 +77,43 @@ var gaodeMap = (function() {
77 77  
78 78 map.clearMap();
79 79  
80   - var upArr = [], downArr = [];
81   - var upLineOps = {path: upArr, strokeColor:"blue", strokeWeight:6, strokeOpacity:0.5}
82   - ,downLineOps = {path: downArr, strokeColor:"red", strokeWeight:6, strokeOpacity:0.5};
  80 + //var upArr = [], downArr = [];
  81 + var upLineOps = {strokeColor:"blue", strokeWeight:6, strokeOpacity:0.5}
  82 + ,downLineOps = {strokeColor:"red", strokeWeight:6, strokeOpacity:0.5};
83 83 var route = opts.route;
84   - //上行
  84 +
  85 + var pos,temps;
  86 + if(route.up){
  87 + $.each(route.up_gcj, function (i, item) {
  88 + pos = [];
  89 + $.each(item.split(','), function () {
  90 + temps = this.split(' ');
  91 + pos.push([temps[0], temps[1]]);
  92 + });
  93 + upLineOps.path=pos;
  94 + var polyline = new AMap.Polyline(upLineOps);
  95 + polyline.setMap(map);
  96 +
  97 + linePolyline.push(polyline);
  98 + });
  99 + map.setCenter(pos[parseInt(pos.length / 2)]);
  100 + }
  101 +
  102 + if(route.down){
  103 + $.each(route.down_gcj, function (i, item) {
  104 + pos = [];
  105 + $.each(item.split(','), function () {
  106 + temps = this.split(' ');
  107 + pos.push([temps[0], temps[1]]);
  108 + });
  109 + downLineOps.path=pos;
  110 + var polyline = new AMap.Polyline(downLineOps);
  111 + polyline.setMap(map);
  112 +
  113 + linePolyline.push(polyline);
  114 + });
  115 + }
  116 + /*//上行
85 117 if(route.up){
86 118 $.each(route.up_gcj.split(','), function(){
87 119 tempArray = this.split(' ');
... ... @@ -104,7 +136,7 @@ var gaodeMap = (function() {
104 136 //保存线条引用
105 137 linePolyline.push(downLine);
106 138 downLine.setMap(map);
107   - }
  139 + }*/
108 140 //实时路况下不显示
109 141 if(traffVisible)
110 142 hideLinePolyline();
... ...
src/main/resources/static/pages/oil/list.html
... ... @@ -330,7 +330,6 @@
330 330 $('tr.filter .filter-submit').on('click', function () {
331 331 var ylbGsdm=$("#ylbListGsdmId").val();
332 332 var ylbFgsdm=$("#ylbListFgsdmId").val();
333   - console.log();
334 333 if ($("#rq").val() == "" || $("#rq").val() ==null){
335 334 layer.msg('请选择日期.');
336 335 }else if(ylbGsdm=="" || ylbGsdm==null || ylbFgsdm=="" ||ylbFgsdm==null){
... ...
src/main/resources/static/pages/oil/list_ph.html 0 → 100644
  1 +<div class="page-head">
  2 + <div class="page-title">
  3 + <h1>进出场存油量</h1>
  4 + </div>
  5 +</div>
  6 +
  7 +<ul class="page-breadcrumb breadcrumb">
  8 + <li><a href="/pages/home.html" data-pjax>首页</a> <i class="fa fa-circle"></i></li>
  9 + <li><span class="active">用油管理</span> <i class="fa fa-circle"></i></li>
  10 + <li><span class="active">进出场存油量</span></li>
  11 +</ul>
  12 +
  13 +<div class="row" id="ll_oil_list">
  14 + <div class="col-md-12">
  15 + <!-- Begin: life time stats -->
  16 + <div class="portlet light portlet-fit portlet-datatable bordered">
  17 + <div class="portlet-title">
  18 + <div class="caption">
  19 + <i class="fa fa-fire-extinguisher"></i> <span
  20 + class="caption-subject font-dark sbold uppercase">进出场存油量表</span>
  21 + </div>
  22 + <div class="actions">
  23 + <a class="btn btn-circle blue" href="add.html" data-pjax><i class="fa fa-plus"></i> 添加</a>
  24 + <!-- <button type="button" class="btn btn-circle blue" id="removeButton"><i class="fa fa-trash-o"></i> 删除</button> -->
  25 + <button type="button" class="btn btn-circle blue" id="sortButton"><i class="fa fa-minus-square"></i>
  26 + 拆分/保存
  27 + </button>
  28 + <!-- <button type="button" class="btn btn-circle red" disabled="disabled" id="removeButton"><i class="fa fa-trash"></i> 删除用户</button> -->
  29 + <div class="btn-group">
  30 + <a class="btn red btn-outline btn-circle" href="javascript:;"
  31 + data-toggle="dropdown"> <i class="fa fa-share"></i> <span
  32 + class="hidden-xs"> 系统工具 </span> <i class="fa fa-angle-down"></i>
  33 + </a>
  34 + <ul class="dropdown-menu pull-right" id="datatable_ajax_tools">
  35 + <li><a href="javascript:;" data-action="0"
  36 + class="tool-action" id="obtain"> <i class="fa fa-hourglass-half"></i> 获取加/存油信息
  37 + </a></li>
  38 + <li><a href="javascript:;" data-action="1"
  39 + class="tool-action" id="outAndIn"> <i class="fa fa-pencil"></i> 油耗计算(进场=出场)
  40 + </a></li>
  41 + <li><a href="javascript:;" id="checkYl" data-action="3"
  42 + class="tool-action"> <i class="fa fa-gg-circle"></i>
  43 + 核对加注量(有加油无里程)
  44 + </a></li>
  45 + <li class="divider"></li>
  46 + <li><a href="javascript:;" data-action="3"
  47 + class="tool-action" id="export"> <i class="fa fa-file-excel-o"></i>
  48 + 导出Excel
  49 + </a></li>
  50 + </ul>
  51 + </div>
  52 + </div>
  53 + </div>
  54 + <div class="portlet-body">
  55 + <div class="table-container" style="margin-top: 10px">
  56 + <table
  57 + class="table table-striped table-bordered table-hover table-checkable"
  58 + id="datatable_ylb">
  59 + <thead>
  60 + <tr role="row" class="filter">
  61 + <td> 公司:</td>
  62 + <td colspan="2">
  63 +
  64 + <select class="form-control" name="ssgsdm_like" id="ylbListGsdmId" ></select>
  65 +
  66 + </td>
  67 + <td>
  68 + 分公司:
  69 + </td>
  70 + <td colspan="2">
  71 +
  72 + <select class="form-control" name="fgsdm_like" id="ylbListFgsdmId" ></select>
  73 + </td>
  74 +
  75 + <td>
  76 + 日期:
  77 + </td>
  78 + <td>
  79 + <input type="text" style="width: 80px" name="rq" id="rq"/>
  80 + </td>
  81 + <td >
  82 + 线路:
  83 + </td>
  84 + <td colspan="3">
  85 + <select class="form-control" name="xlbm_eq" id="xlbm" style="width: 120px;"></select>
  86 + &nbsp;
  87 + </td>
  88 + <td >
  89 + 内部编码:
  90 + </td>
  91 + <td colspan="3">
  92 + <select class="form-control" name="nbbm_eq" id="nbbm" style="width: 120px;"></select>
  93 + </td>
  94 + <td colspan="4">
  95 + <button class="btn btn-sm green btn-outline filter-submit margin-bottom" style="margin-right:0px">
  96 + <i class="fa fa-search"></i> 搜索
  97 + </button>
  98 +
  99 + <button class="btn btn-sm red btn-outline filter-cancel" style="margin-right:0px">
  100 + <i class="fa fa-times"></i> 重置
  101 + </button>
  102 +
  103 + </td>
  104 + </tr>
  105 + <tr role="row" class="heading">
  106 + <th width="2%">#</th>
  107 + <th width="8%">日期</th>
  108 + <th width="5%">公司</th>
  109 + <th width="8%">线路</th>
  110 + <th width="5%">自编号</th>
  111 + <th width="6%">驾驶员</th>
  112 + <th width="4%">加油量</th>
  113 + <th width="5%">出场公里</th>
  114 + <th width="4%">进场公里</th>
  115 + <th width="4%">出场存油</th>
  116 + <th width="4%">进场存油</th>
  117 + <th width="5%">油耗</th>
  118 + <th width="5%">燃油类型</th>
  119 + <th width="4%">尿素</th>
  120 + <th width="5%">耗损原因</th>
  121 + <th width="5%">耗损油量</th>
  122 + <th width="5%">当日总里程</th>
  123 + <th width="5%">数据类型</th>
  124 + <th width="5%">百公里油耗</th>
  125 + <!-- <th width="5%">操作</th> -->
  126 + </tr>
  127 + </thead>
  128 + <tbody></tbody>
  129 + </table>
  130 + <div style="text-align: right;">
  131 + <ul id="pagination" class="pagination"></ul>
  132 + </div>
  133 + </div>
  134 + </div>
  135 + </div>
  136 + </div>
  137 +</div>
  138 +
  139 +<script id="ylb_list_temp" type="text/html">
  140 + {{each list as obj i}}
  141 + <tr>
  142 + <td style="vertical-align: middle;">
  143 + <input type="radio" name="id" class="group-checkable icheck" data-id="{{obj.id}}">
  144 + </td>
  145 +
  146 + <td>
  147 + {{obj.rq}}
  148 + </td>
  149 + <td>
  150 + {{obj.gsname}}
  151 + </td>
  152 + <td>
  153 + {{obj.xlname}}
  154 + </td>
  155 + <td>
  156 + {{obj.nbbm}}
  157 + </td>
  158 + <td>
  159 + {{obj.jsy}}
  160 + </td>
  161 + <td>
  162 + {{obj.jzl}}
  163 + </td>
  164 + <td>
  165 + {{obj.czlc}}
  166 + </td>
  167 + <td>
  168 + {{obj.jzlc}}
  169 + </td>
  170 + <td>
  171 + {{obj.czyl}}
  172 + </td>
  173 + <td>
  174 + <a data-id="{{obj.id}}" href="javascript:;" class="in_carpark_jzyl">
  175 + {{obj.jzyl}}
  176 + </a>
  177 + </td>
  178 + <td>
  179 + {{obj.yh}}
  180 + </td>
  181 + <td>
  182 + {{obj.rylx}}
  183 + </td>
  184 + <td>
  185 + {{obj.ns}}
  186 + </td>
  187 + <td>
  188 + {{obj.shyy}}
  189 + </td>
  190 + <td>
  191 + {{obj.sh}}
  192 + </td>
  193 + <td>
  194 + {{obj.zlc}}
  195 + </td>
  196 + <td>
  197 + {{obj.yhlx}}
  198 + </td>
  199 + <td>
  200 + {{obj.bglyh}}
  201 + </td>
  202 + <td>
  203 + <!--<a class="btn btn-sm blue btn-outline" href="edit.html?no={{obj.id}}" data-pjax><i class="fa fa-edit"></i> 编辑</a>-->
  204 + </td>
  205 + </tr>
  206 + {{/each}}
  207 + {{if list.length == 0}}
  208 + <tr>
  209 + <td colspan=20><h6 class="muted">没有找到相关数据</h6></td>
  210 + </tr>
  211 + {{/if}}
  212 +</script>
  213 +
  214 +<script>
  215 + $(function () {
  216 + //var id = 15;
  217 + //$('.in_carpark_jzyl[data-id='+id+']', '#ll_oil_list')
  218 +
  219 + $("#checkYl").on('click', function () {
  220 + console.log("核对加注量");
  221 + if ($("#rq").val() != "") {
  222 + var cells = $('tr.filter')[0].cells
  223 + , params = {}
  224 + , name;
  225 + $.each(cells, function (i, cell) {
  226 + var items = $('input,select', cell);
  227 + for (var j = 0, item; item = items[j++];) {
  228 + name = $(item).attr('name');
  229 + if (name) {
  230 + params[name] = $(item).val();
  231 + }
  232 + }
  233 + });
  234 + $get('/ylb/checkYl', params, function () {
  235 + jsDoQuery(null, true);
  236 + });
  237 + } else {
  238 + layer.msg('请选择日期.');
  239 + }
  240 + })
  241 +
  242 + //进场等于出场
  243 + $("#outAndIn").on('click', function () {
  244 + console.log("进场油量等于出场油量");
  245 + if ($("#rq").val() != "") {
  246 + var cells = $('tr.filter')[0].cells
  247 + , params = {}
  248 + , name;
  249 + $.each(cells, function (i, cell) {
  250 + var items = $('input,select', cell);
  251 + for (var j = 0, item; item = items[j++];) {
  252 + name = $(item).attr('name');
  253 + if (name) {
  254 + params[name] = $(item).val();
  255 + }
  256 + }
  257 + });
  258 + $get('/ylb/outAndIn', params, function () {
  259 + jsDoQuery(null, true);
  260 + });
  261 + } else {
  262 + layer.msg('请选择日期.');
  263 + }
  264 + })
  265 + //拆分
  266 + $("#sortButton").on('click', function () {
  267 + if ($("#rq").val() != "") {
  268 + var id = $('input.icheck:checked').data('id');
  269 +
  270 + if (typeof(id) == 'undefined') {
  271 + layer.msg("请选择一行进行拆分");
  272 + } else {
  273 + //获取输入的进场存油
  274 + var jzyl = $('.in_carpark_jzyl[data-id='+id+']', '#ll_oil_list').html();
  275 + // $("#jzyl" + id).html();
  276 + console.log(jzyl);
  277 + var params = {};
  278 + params['jzyl'] = jzyl;
  279 + params['id'] = id;
  280 + $get('/ylb/sort', params, function () {
  281 + jsDoQuery(null, true);
  282 + });
  283 +
  284 + }
  285 + } else {
  286 + layer.msg('请选择日期.');
  287 + }
  288 + })
  289 + //获取加存信息
  290 + $("#obtain").on('click', function () {
  291 + console.log("获取加存");
  292 + if ($("#rq").val() != "") {
  293 + var cells = $('tr.filter')[0].cells
  294 + , params = {}
  295 + , name;
  296 + $.each(cells, function (i, cell) {
  297 + var items = $('input,select', cell);
  298 + for (var j = 0, item; item = items[j++];) {
  299 + name = $(item).attr('name');
  300 + if (name) {
  301 + params[name] = $(item).val();
  302 + }
  303 + }
  304 + });
  305 + $get('/ylb/obtain', params, function () {
  306 + jsDoQuery(params, true);
  307 + });
  308 + } else {
  309 + layer.msg('请选择日期.');
  310 + }
  311 +
  312 + })
  313 + $("#rq").datetimepicker({
  314 + format: 'YYYY-MM-DD',
  315 + locale: 'zh-cn'
  316 + });
  317 +
  318 + var page = 0, initPagination;
  319 + var icheckOptions = {
  320 + radioClass: 'iradio_square-blue icheck',
  321 + increaseArea: '20%'
  322 + }
  323 +
  324 + //重置
  325 + $('tr.filter .filter-cancel').on('click', function () {
  326 + $('tr.filter input, select').val('').change();
  327 + });
  328 +
  329 + //提交
  330 + $('tr.filter .filter-submit').on('click', function () {
  331 + var ylbGsdm=$("#ylbListGsdmId").val();
  332 + var ylbFgsdm=$("#ylbListFgsdmId").val();
  333 + if ($("#rq").val() == "" || $("#rq").val() ==null){
  334 + layer.msg('请选择日期.');
  335 + }else if(ylbGsdm=="" || ylbGsdm==null || ylbFgsdm=="" ||ylbFgsdm==null){
  336 + layer.msg('请选择公司和分公司.');
  337 + }else {
  338 + var cells = $('tr.filter')[0].cells
  339 + , params = {}
  340 + , name;
  341 + $.each(cells, function (i, cell) {
  342 + var items = $('input,select', cell);
  343 + for (var j = 0, item; item = items[j++];) {
  344 + name = $(item).attr('name');
  345 + if (name) {
  346 + params[name] = $(item).val();
  347 + }
  348 + }
  349 + });
  350 + page = 0;
  351 + jsDoQuery(params, true);
  352 + }
  353 + });
  354 +
  355 +
  356 +// var gsqxdm="";
  357 +
  358 +
  359 + $.get('/user/companyData', function(result){
  360 + obj = result;
  361 + var options="";
  362 +// = '<option value="">请选择</option>';
  363 + for(var i = 0; i < obj.length; i++){
  364 + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';
  365 +// setFgsqx(obj[i].companyCode);
  366 + }
  367 + $('#ylbListGsdmId').html(options);
  368 + updateCompany();
  369 + });
  370 + /* function setFgsqx(gs){
  371 + var company =gs
  372 + var options = '';
  373 + for(var i = 0; i < obj.length; i++){
  374 + if(obj[i].companyCode == company){
  375 + var children = obj[i].children;
  376 + for(var j = 0; j < children.length; j++){
  377 + gsqxdm +=company+""+children[j].code+",";
  378 + }
  379 + }
  380 + }
  381 + } */
  382 + $("#ylbListGsdmId").on("change",updateCompany);
  383 + function updateCompany(){
  384 + var company = $('#ylbListGsdmId').val();
  385 + var options ="";
  386 +// = '<option value="">请选择</option>';
  387 + for(var i = 0; i < obj.length; i++){
  388 + if(obj[i].companyCode == company){
  389 + var children = obj[i].children;
  390 + for(var j = 0; j < children.length; j++){
  391 + options += '<option value="'+children[j].code+'">'+children[j].name+'</option>';
  392 + }
  393 + }
  394 + }
  395 + $('#ylbListFgsdmId').html(options);
  396 + }
  397 + /*
  398 + * 获取数据 p: 要提交的参数, pagination: 是否重新分页
  399 + */
  400 + function jsDoQuery(p, pagination) {
  401 + var params = {};
  402 + if (p)
  403 + params = p;
  404 + //更新时间排序
  405 + params['order'] = 'nbbm';
  406 + params['page'] = page;
  407 + params['rq'] = $("#rq").val();
  408 +
  409 + /* var ylbGsdm=$("#ylbListGsdmId").val();
  410 + var ylbFgsdm=$("#ylbListFgsdmId").val();
  411 + if(ylbGsdm==''|| ylbGsdm==null){
  412 + params['concat(ssgsdm,fgsdm)_in']=gsqxdm;
  413 + }else{
  414 + if(ylbFgsdm==''||ylbFgsdm==null){
  415 + var fgsqx1='';
  416 + for(var i = 0; i < obj.length; i++){
  417 + if(obj[i].companyCode == ylbGsdm){
  418 + var children = obj[i].children;
  419 + for(var j = 0; j < children.length; j++){
  420 + fgsqx1 +=children[j].code+",";
  421 + }
  422 + }
  423 + }
  424 + params['fgsdm_in']=fgsqx1;
  425 + }
  426 + } */
  427 + var i = layer.load(2);
  428 + $get('/ylb', params, function (data) {
  429 + $.each(data.content, function (i, obj) {
  430 + obj.rq = moment(obj.rq).format("YYYY-MM-DD");
  431 + });
  432 + var bodyHtm = template('ylb_list_temp', {list: data.content});
  433 +
  434 + $('#datatable_ylb tbody').html(bodyHtm)
  435 + .find('.icheck').iCheck(icheckOptions)
  436 + .on('ifChanged', iCheckChange);
  437 + if (pagination && data.content.length > 0) {
  438 + //重新分页
  439 + initPagination = true;
  440 + showPagination(data);
  441 + }
  442 + layer.close(i);
  443 +
  444 + startOptJzylLink($('#ll_oil_list .in_carpark_jzyl'));
  445 + });
  446 + }
  447 +
  448 + //改变状态
  449 + function startOptJzylLink(es) {
  450 + es.editable({
  451 + type: 'text',
  452 + placement: 'right',
  453 + width: 100,
  454 + display: false,
  455 + validate: function (value) {
  456 + if (!value)
  457 + return '值不能为空!';
  458 + if (isNaN(value))
  459 + return '只能为数字!';
  460 + if (value < 0)
  461 + return '值不能小于0!';
  462 + },
  463 + inputclass: 'form-control input-medium input-edtable-sm'
  464 + })
  465 + .on('save', function (e, params) {
  466 + $(this).text(params.newValue);
  467 + });
  468 + }
  469 +
  470 + function iCheckChange() {
  471 + var tr = $(this).parents('tr');
  472 + if (this.checked)
  473 + tr.addClass('row-active');
  474 + else
  475 + tr.removeClass('row-active');
  476 +
  477 + /* if($('#datatable_resource input.icheck:checked').length == 1)
  478 + $('#removeButton').removeAttr('disabled');
  479 + else
  480 + $('#removeButton').attr('disabled', 'disabled'); */
  481 + }
  482 +
  483 + function showPagination(data) {
  484 + //分页
  485 + $('#pagination').jqPaginator({
  486 + totalPages: data.totalPages,
  487 + visiblePages: 6,
  488 + currentPage: page + 1,
  489 + first: '<li class="first"><a href="javascript:void(0);">首页<\/a><\/li>',
  490 + prev: '<li class="prev"><a href="javascript:void(0);">上一页<\/a><\/li>',
  491 + next: '<li class="next"><a href="javascript:void(0);">下一页<\/a><\/li>',
  492 + last: '<li class="last"><a href="javascript:void(0);">尾页<\/a><\/li>',
  493 + page: '<li class="page"><a href="javascript:void(0);">{{page}}<\/a><\/li>',
  494 + onPageChange: function (num, type) {
  495 + if (initPagination) {
  496 + initPagination = false;
  497 + return;
  498 + }
  499 +
  500 + var cells = $('tr.filter')[0].cells
  501 + , params = {}
  502 + , name;
  503 + $.each(cells, function (i, cell) {
  504 + var items = $('input,select', cell);
  505 + for (var j = 0, item; item = items[j++];) {
  506 + name = $(item).attr('name');
  507 + if (name) {
  508 + params[name] = $(item).val();
  509 + }
  510 + }
  511 + });
  512 + page = num - 1;
  513 + jsDoQuery(params, true);
  514 + }
  515 + });
  516 + }
  517 +
  518 +
  519 + //删除
  520 + $('#removeButton').on('click', function () {
  521 + if ($(this).attr('disabled'))
  522 + return;
  523 +
  524 + var id = $('input.icheck:checked').data('id');
  525 + removeConfirm('确定要删除选中的数据?', '/resource/' + id, function () {
  526 + $('tr.filter .filter-submit').click();
  527 + });
  528 + });
  529 +
  530 + //搜索线路
  531 + $.get('/basic/lineCode2Name',function(result){
  532 + var data=[];
  533 +
  534 + for(var code in result){
  535 + data.push({id: code, text: result[code]});
  536 + }
  537 + console.log(data);
  538 + initPinYinSelect2('#xlbm',data,'');
  539 +
  540 + })
  541 +
  542 + $('#nbbm').select2({
  543 + placeholder: '搜索车辆...',
  544 + ajax: {
  545 + url: '/realSchedule/sreachVehic',
  546 + dataType: 'json',
  547 + delay: 150,
  548 + data: function (params) {
  549 + return {nbbm: params.term};
  550 + },
  551 + processResults: function (data) {
  552 + return {
  553 + results: data
  554 + };
  555 + },
  556 + cache: true
  557 + },
  558 + templateResult: function (repo) {
  559 + if (repo.loading) return repo.text;
  560 + var h = '<span>' + repo.text + '</span>';
  561 + h += (repo.lineName ? '&nbsp;<span class="select2-desc">' + repo.lineName + '</span>' : '');
  562 + return h;
  563 + },
  564 + escapeMarkup: function (markup) {
  565 + return markup;
  566 + },
  567 + minimumInputLength: 1,
  568 + templateSelection: function (repo) {
  569 + return repo.text;
  570 + },
  571 + language: {
  572 + noResults: function () {
  573 + return '<span style="color:red;font-size: 12px;">没有搜索到车辆!</span>';
  574 + },
  575 + inputTooShort: function (e) {
  576 + return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入自编号搜索车辆</span>';
  577 + },
  578 + searching: function () {
  579 + return '<span style="color:gray;font-size: 12px;"> 正在搜索车辆...</span>';
  580 + }
  581 + }
  582 + })
  583 +
  584 +
  585 +//导出
  586 +
  587 + $("#export").on("click", function () {
  588 + if ($("#rq").val() != "") {
  589 + var cells = $('tr.filter')[0].cells
  590 + , params = {}
  591 + , name;
  592 + $.each(cells, function (i, cell) {
  593 + var items = $('input,select', cell);
  594 + for (var j = 0, item; item = items[j++];) {
  595 + name = $(item).attr('name');
  596 + if (name) {
  597 + params[name] = $(item).val();
  598 + }
  599 + }
  600 + });
  601 + console.log(params);
  602 + $post('/ylb/listExport', params, function (result) {
  603 + console.log(result);
  604 + window.open("/downloadFile/download?fileName=进出场存油量" + moment($("#rq").val()).format("YYYYMMDD"));
  605 + });
  606 + } else {
  607 + layer.msg('请选择日期.');
  608 + }
  609 + });
  610 +
  611 + });
  612 +</script>
0 613 \ No newline at end of file
... ...
src/main/resources/static/pages/report/timetable/timetable.html
... ... @@ -40,8 +40,8 @@
40 40 <select class="form-control" name="line" id="line" style="width: 180px;"></select>
41 41 </div>
42 42 <div style="display: inline-block;margin-left: 15px;">
43   - <span class="item-label" style="width: 80px;">时间: </span>
44   - <input class="form-control" type="text" id="date" style="width: 180px;"/>
  43 + <span class="item-label" style="width: 80px;">时刻表: </span>
  44 + <select class="form-control" name="ttinfo" id="ttinfo" style="width: 180px;"></select>
45 45 </div>
46 46 <div class="form-group">
47 47 <input class="btn btn-default" type="button" id="query" value="查询"/>
... ... @@ -196,10 +196,6 @@
196 196 if (!$('body').hasClass('page-sidebar-closed'))
197 197 $('.menu-toggler.sidebar-toggler').click();
198 198  
199   - $("#date").datetimepicker({
200   - format : 'YYYY-MM-DD',
201   - locale : 'zh-cn'
202   - });
203 199  
204 200 var obj = [];
205 201 $.get('/user/companyData', function(result){
... ... @@ -246,27 +242,49 @@
246 242  
247 243 })
248 244  
  245 +
  246 + var flag = 0;
  247 + function updateTtinfo(){
  248 + if(flag == 1)
  249 + return;
  250 + flag = 1;
  251 + var treeData = [];
  252 + var params = {};
  253 + params['line'] = $("#line").val();
  254 + $get('/report/getTtinfo', params, function(result){
  255 + treeData = createTreeData(result);
  256 + var options = '<option value="">请选择...</option>';
  257 + $.each(treeData, function(i, g){
  258 + options += '<option value="'+g.id+'">'+g.name+'</option>';
  259 + });
  260 + $('#ttinfo').html(options)/* .select2() */;
  261 + flag = 0;
  262 + });
  263 + }
  264 +
  265 + $("#line").on("change", function(){
  266 + updateTtinfo();
  267 + })
  268 +
249 269 //查询
250 270 $("#query").on('click',function(){
251   - console.log($("#gsdmTime").val());
252   - console.log($("#fgsdmTime").val());
253 271 var line = $("#line").val();
254 272 var xlName = $("#select2-line-container").html();
255   - var date = $("#date").val();
256   - if(date==null|| date==""){
257   - layer.msg('请选择日期.');
258   - }else if(line==null || line ==""){
  273 + var ttinfo = $("#ttinfo").val();
  274 + if(line==null || line ==""){
259 275 layer.msg('请选择线路.');
  276 + }else if(ttinfo==null|| ttinfo==""){
  277 + layer.msg('请选择时刻表.');
260 278 }else{
261   - $get('/report/tbodyTime1',{line:line,date:date},function(result){
  279 + $get('/report/tbodyTime1',{line:line,ttinfo:ttinfo},function(result){
262 280 var tbodyTime1 = template('tbodyTime1',{map:result});
263 281 $('#formsTime1 .tbody_time_1').html(tbodyTime1);
264 282 });
265   - $.get('/report/tbodyTime2',{line:line,date:date},function(result){
  283 + $.get('/report/tbodyTime2',{line:line,ttinfo:ttinfo},function(result){
266 284 var tbodyTime2 = template('tbodyTime2',{map:result});
267 285 $('#formsTime2 .tbody_time_2').html(tbodyTime2);
268   - });
269   - $.get('/report/tbodyTime3',{line:line,date:date},function(result){
  286 + });/*
  287 + $.get('/report/tbodyTime3',{line:line,ttinfo:ttinfo},function(result){
270 288  
271 289 var tbodyTime3 = template('tbodyTime3',{list:result});
272 290 $('#formsTime3 .tbody_time_3').html(tbodyTime3);
... ... @@ -274,15 +292,17 @@
274 292 var divTime2 = window.document.getElementById('formsTime2');
275 293 console.log(divTime3.offsetHeight);
276 294 divTime2.style.height=divTime3.offsetHeight+"px";
277   - });/*
  295 + }); */
  296 +
  297 + /*
278 298 $.get('/report/tbodyTime4',{line:line,date:date},function(result){
279 299 var scheduleDaily_3 = template('scheduleDaily_3',{list:result});
280 300 $('#forms .scheduleDaily_3').html(scheduleDaily_3);
281 301 });*/
282   - $.get('/report/tbodyTime5',{line:line,date:date},function(result){
  302 + /* $.get('/report/tbodyTime5',{line:line,ttinfo:ttinfo},function(result){
283 303 var tbodyTime5 = template('tbodyTime5',{list:result});
284 304 $('#formsTime5 .tbody_time_5').html(tbodyTime5);
285   - });
  305 + }); */
286 306 }
287 307  
288 308  
... ...
src/main/resources/static/pages/scheduleApp/module/basicInfo/busInfoManage/list.html
... ... @@ -26,7 +26,7 @@
26 26 <input type="text" class="form-control form-filter input-sm" ng-model="ctrl.searchCondition().equipmentCode_like" placeholder="输入设备编号..."/>
27 27 </td>
28 28 <td>
29   - <input type="text" class="form-control form-filter input-sm" ng-model="ctrl.searchCondition().carCode_like" placeholder="输入车牌号..."/>
  29 + <input type="text" class="form-control form-filter input-sm" ng-model="ctrl.searchCondition().carPlate_like" placeholder="输入车牌号..."/>
30 30 </td>
31 31 <td>
32 32 <div>
... ...