Commit 5acbb9c83336b90911063fc503873145a79102bc
Merge branch 'minhang' of 192.168.168.201:panzhaov5/bsth_control into minhang
Showing
104 changed files
with
5012 additions
and
1123 deletions
pom.xml
| ... | ... | @@ -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<Ylb, Integer>{ |
| 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<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
src/main/java/com/bsth/entity/realcontrol/ScheduleType.java
0 → 100644
src/main/java/com/bsth/repository/realcontrol/ScheduleRealInfoRepository.java
| ... | ... | @@ -24,6 +24,9 @@ public interface ScheduleRealInfoRepository extends BaseRepository<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<Ylb,Integer> 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<Ylb,Integer> 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<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<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<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<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<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<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<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 晚高峰: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 | + | |
| 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 ? ' <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> | ... | ... |
src/main/resources/static/pages/scheduleApp/module/common/prj-common-globalservice-legacy.js
| ... | ... | @@ -158,12 +158,20 @@ angular.module('ScheduleApp').factory('$$SearchInfoService_g', ['$resource', fun |
| 158 | 158 | } |
| 159 | 159 | ), |
| 160 | 160 | ttInfo: $resource( |
| 161 | - '/tic/:type', | |
| 161 | + '/tic_ec/:type', | |
| 162 | 162 | {order: "name", direction: 'ASC'}, |
| 163 | 163 | { |
| 164 | 164 | list: { |
| 165 | 165 | method: 'GET', |
| 166 | - isArray: true | |
| 166 | + isArray: true, | |
| 167 | + transformResponse: function(rs) { | |
| 168 | + var dst = angular.fromJson(rs); | |
| 169 | + if (dst.status == 'SUCCESS') { | |
| 170 | + return dst.data; | |
| 171 | + } else { | |
| 172 | + return dst; // 业务错误留给控制器处理 | |
| 173 | + } | |
| 174 | + } | |
| 167 | 175 | } |
| 168 | 176 | } |
| 169 | 177 | ), | ... | ... |
src/main/resources/static/pages/scheduleApp/module/common/prj-common-globalservice.js
| ... | ... | @@ -522,78 +522,86 @@ angular.module('ScheduleApp').factory( |
| 522 | 522 | ); |
| 523 | 523 | |
| 524 | 524 | // 时刻表明细管理service |
| 525 | -angular.module('ScheduleApp').factory('TimeTableDetailManageService_g', ['$resource', function($resource) { | |
| 526 | - return { | |
| 527 | - rest: $resource( | |
| 528 | - '/tidc/:id', | |
| 529 | - {order: 'createDate', direction: 'DESC', id: '@id_route'}, | |
| 530 | - { | |
| 531 | - get: { | |
| 532 | - method: 'GET' | |
| 533 | - }, | |
| 534 | - save: { | |
| 535 | - method: 'POST' | |
| 536 | - } | |
| 537 | - } | |
| 538 | - ), | |
| 539 | - import: $resource( | |
| 540 | - '/tidc/importfile', | |
| 541 | - {}, | |
| 542 | - { | |
| 543 | - do: { | |
| 544 | - method: 'POST', | |
| 545 | - headers: { | |
| 546 | - 'Content-Type': 'application/x-www-form-urlencoded' | |
| 547 | - }, | |
| 548 | - transformRequest: function(obj) { | |
| 549 | - var str = []; | |
| 550 | - for (var p in obj) { | |
| 551 | - str.push(encodeURIComponent(p) + "=" + encodeURIComponent(obj[p])); | |
| 525 | +angular.module('ScheduleApp').factory( | |
| 526 | + 'TimeTableDetailManageService_g', | |
| 527 | + [ | |
| 528 | + '$resource', | |
| 529 | + function($resource) { | |
| 530 | + return { | |
| 531 | + rest: $resource( | |
| 532 | + '/tidc/:id', | |
| 533 | + {order: 'createDate', direction: 'DESC', id: '@id'}, | |
| 534 | + { | |
| 535 | + get: { | |
| 536 | + method: 'GET' | |
| 537 | + }, | |
| 538 | + save: { | |
| 539 | + method: 'POST' | |
| 552 | 540 | } |
| 553 | - return str.join("&"); | |
| 554 | 541 | } |
| 555 | - } | |
| 556 | - } | |
| 557 | - ), | |
| 558 | - edit: $resource( | |
| 559 | - '/tidc/edit/:xlid/:ttid', | |
| 560 | - {}, | |
| 561 | - { | |
| 562 | - list: { | |
| 563 | - method: 'GET' | |
| 564 | - } | |
| 565 | - } | |
| 566 | - ), | |
| 567 | - bcdetails: $resource( | |
| 568 | - '/tidc/bcdetail', | |
| 569 | - {}, | |
| 570 | - { | |
| 571 | - list: { | |
| 572 | - method: 'GET', | |
| 573 | - isArray: true | |
| 574 | - } | |
| 575 | - } | |
| 576 | - ), | |
| 577 | - dataTools: $resource( | |
| 578 | - '/tidc/:type', | |
| 579 | - {}, | |
| 580 | - { | |
| 581 | - dataExport: { | |
| 582 | - method: 'GET', | |
| 583 | - responseType: "arraybuffer", | |
| 584 | - params: { | |
| 585 | - type: "dataExportExt" | |
| 586 | - }, | |
| 587 | - transformResponse: function(data, headers){ | |
| 588 | - return {data : data}; | |
| 542 | + ), | |
| 543 | + import: $resource( | |
| 544 | + '/tidc/importfile', | |
| 545 | + {}, | |
| 546 | + { | |
| 547 | + do: { | |
| 548 | + method: 'POST', | |
| 549 | + headers: { | |
| 550 | + 'Content-Type': 'application/x-www-form-urlencoded' | |
| 551 | + }, | |
| 552 | + transformRequest: function(obj) { | |
| 553 | + var str = []; | |
| 554 | + for (var p in obj) { | |
| 555 | + str.push(encodeURIComponent(p) + "=" + encodeURIComponent(obj[p])); | |
| 556 | + } | |
| 557 | + return str.join("&"); | |
| 558 | + } | |
| 559 | + } | |
| 589 | 560 | } |
| 590 | - } | |
| 591 | - } | |
| 592 | - ) | |
| 561 | + ), | |
| 562 | + edit: $resource( | |
| 563 | + '/tidc/edit/:xlid/:ttid', | |
| 564 | + {}, | |
| 565 | + { | |
| 566 | + list: { | |
| 567 | + method: 'GET' | |
| 568 | + } | |
| 569 | + } | |
| 570 | + ), | |
| 571 | + bcdetails: $resource( | |
| 572 | + '/tidc/bcdetail', | |
| 573 | + {}, | |
| 574 | + { | |
| 575 | + list: { | |
| 576 | + method: 'GET', | |
| 577 | + isArray: true | |
| 578 | + } | |
| 579 | + } | |
| 580 | + ), | |
| 581 | + dataTools: $resource( | |
| 582 | + '/tidc/:type', | |
| 583 | + {}, | |
| 584 | + { | |
| 585 | + dataExport: { | |
| 586 | + method: 'GET', | |
| 587 | + responseType: "arraybuffer", | |
| 588 | + params: { | |
| 589 | + type: "dataExportExt" | |
| 590 | + }, | |
| 591 | + transformResponse: function(data, headers){ | |
| 592 | + return {data : data}; | |
| 593 | + } | |
| 594 | + } | |
| 595 | + } | |
| 596 | + ) | |
| 593 | 597 | |
| 594 | - // TODO:导入数据 | |
| 595 | - }; | |
| 596 | -}]); | |
| 598 | + // TODO:导入数据 | |
| 599 | + }; | |
| 600 | + | |
| 601 | + } | |
| 602 | + | |
| 603 | + ] | |
| 604 | +); | |
| 597 | 605 | // 项目通用的全局service服务,供不同的controller使用,自定义指令不使用 |
| 598 | 606 | |
| 599 | 607 | // 文件下载服务 |
| ... | ... | @@ -754,12 +762,20 @@ angular.module('ScheduleApp').factory('$$SearchInfoService_g', ['$resource', fun |
| 754 | 762 | } |
| 755 | 763 | ), |
| 756 | 764 | ttInfo: $resource( |
| 757 | - '/tic/:type', | |
| 765 | + '/tic_ec/:type', | |
| 758 | 766 | {order: "name", direction: 'ASC'}, |
| 759 | 767 | { |
| 760 | 768 | list: { |
| 761 | 769 | method: 'GET', |
| 762 | - isArray: true | |
| 770 | + isArray: true, | |
| 771 | + transformResponse: function(rs) { | |
| 772 | + var dst = angular.fromJson(rs); | |
| 773 | + if (dst.status == 'SUCCESS') { | |
| 774 | + return dst.data; | |
| 775 | + } else { | |
| 776 | + return dst; // 业务错误留给控制器处理 | |
| 777 | + } | |
| 778 | + } | |
| 763 | 779 | } |
| 764 | 780 | } |
| 765 | 781 | ), | ... | ... |
src/main/resources/static/pages/scheduleApp/module/common/prj-common-ui-route-state.js
| ... | ... | @@ -1096,7 +1096,7 @@ ScheduleApp.config([ |
| 1096 | 1096 | } |
| 1097 | 1097 | }) |
| 1098 | 1098 | .state("ttInfoDetailManage_edit", { // 时刻表详细信息编辑 |
| 1099 | - url: '/ttInfoDetailManage_edit/:xlid/:ttid/:xlname/:ttname', | |
| 1099 | + url: '/ttInfoDetailManage_edit/:xlid/:ttid/:xlname/:ttname/:rflag', | |
| 1100 | 1100 | views: { |
| 1101 | 1101 | "": {templateUrl: 'pages/scheduleApp/module/core/ttInfoManage/detailedit/edit.html'} |
| 1102 | 1102 | }, |
| ... | ... | @@ -1123,7 +1123,7 @@ ScheduleApp.config([ |
| 1123 | 1123 | name: 'ttInfoDetailManage_edit_module', |
| 1124 | 1124 | insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 |
| 1125 | 1125 | files: [ |
| 1126 | - "pages/scheduleApp/module/core/ttInfoManage/detailedit/timeTableDetailManage_old.js" | |
| 1126 | + "pages/scheduleApp/module/core/ttInfoManage/detailedit/module2.js" | |
| 1127 | 1127 | ] |
| 1128 | 1128 | }); |
| 1129 | 1129 | }] |
| ... | ... | @@ -1147,6 +1147,25 @@ ScheduleApp.config([ |
| 1147 | 1147 | }); |
| 1148 | 1148 | }] |
| 1149 | 1149 | } |
| 1150 | + }) | |
| 1151 | + .state("ttInfoDetailManage_detail_edit2", { // 时刻表详细信息批量单元格修改 | |
| 1152 | + url: '/ttInfoDetailManage_detail_edit/:xlid/:ttid/:xlname/:ttname', | |
| 1153 | + views: { | |
| 1154 | + "": {templateUrl: 'pages/scheduleApp/module/core/ttInfoManage/detailedit/edit-detail2.html'} | |
| 1155 | + }, | |
| 1156 | + resolve: { | |
| 1157 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 1158 | + return $ocLazyLoad.load({ | |
| 1159 | + name: 'ttInfoDetailManage_detail_edit_module', | |
| 1160 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 1161 | + files: [ | |
| 1162 | + "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 1163 | + "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 1164 | + "pages/scheduleApp/module/core/ttInfoManage/detailedit/timeTableDetailManage_old.js" | |
| 1165 | + ] | |
| 1166 | + }); | |
| 1167 | + }] | |
| 1168 | + } | |
| 1150 | 1169 | }); |
| 1151 | 1170 | |
| 1152 | 1171 | } | ... | ... |
src/main/resources/static/pages/scheduleApp/module/core/rerunManage/edit.html
| ... | ... | @@ -69,7 +69,7 @@ |
| 69 | 69 | cmaps="{'rerunTtinfo.id' : 'id'}" |
| 70 | 70 | dcname="rerunTtinfo.id" |
| 71 | 71 | icname="id" |
| 72 | - dsparams="{{ {type: 'ajax', param:{'xl.id_eq': ctrl.rerunManageForSave.rerunXl.id, 'isCancel_eq': false}, atype:'ttInfo' } | json }}" | |
| 72 | + dsparams="{{ {type: 'ajax', param:{'xl.id_eq': ctrl.rerunManageForSave.rerunXl.id, 'isCancel_eq': false, 'isEnableDisTemplate_eq': true}, atype:'ttInfo' } | json }}" | |
| 73 | 73 | dsparamsextra="{'type':'all'}" |
| 74 | 74 | iterobjname="item" |
| 75 | 75 | iterobjexp="item.name + '-' + item.xl.name" | ... | ... |
src/main/resources/static/pages/scheduleApp/module/core/rerunManage/form.html
| ... | ... | @@ -69,7 +69,7 @@ |
| 69 | 69 | cmaps="{'rerunTtinfo.id' : 'id'}" |
| 70 | 70 | dcname="rerunTtinfo.id" |
| 71 | 71 | icname="id" |
| 72 | - dsparams="{{ {type: 'ajax', param:{'xl.id_eq': ctrl.rerunManageForSave.rerunXl.id, 'isCancel_eq': false}, atype:'ttInfo' } | json }}" | |
| 72 | + dsparams="{{ {type: 'ajax', param:{'xl.id_eq': ctrl.rerunManageForSave.rerunXl.id, 'isCancel_eq': false, 'isEnableDisTemplate_eq': true}, atype:'ttInfo' } | json }}" | |
| 73 | 73 | dsparamsextra="{'type':'all'}" |
| 74 | 74 | iterobjname="item" |
| 75 | 75 | iterobjexp="item.name + '-' + item.xl.name" | ... | ... |
src/main/resources/static/pages/scheduleApp/module/core/schedulePlanManage/info/list_info.html
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage/detailedit/edit-detail2.html
0 → 100644
| 1 | +<div ng-controller="TimeTableDetailManageFormCtrl_old2 as ctrl"> | |
| 2 | + <div class="page-head"> | |
| 3 | + <div class="page-title"> | |
| 4 | + <h1>修改班次信息</h1> | |
| 5 | + </div> | |
| 6 | + </div> | |
| 7 | + | |
| 8 | + <ul class="page-breadcrumb breadcrumb"> | |
| 9 | + <li> | |
| 10 | + <a href="/pages/home.html" data-pjax>首页</a> | |
| 11 | + <i class="fa fa-circle"></i> | |
| 12 | + </li> | |
| 13 | + <li> | |
| 14 | + <span class="active">运营计划管理</span> | |
| 15 | + <i class="fa fa-circle"></i> | |
| 16 | + </li> | |
| 17 | + <li> | |
| 18 | + <a ui-sref="ttInfoManage">时刻表管理</a> | |
| 19 | + <i class="fa fa-circle"></i> | |
| 20 | + </li> | |
| 21 | + <li> | |
| 22 | + <a ui-sref="ttInfoDetailManage_edit({xlid: ctrl.xlid, ttid : ctrl.ttid, xlname: ctrl.xlname, ttname : ctrl.ttname})"><span ng-bind="ctrl.title1"></span></a> | |
| 23 | + <i class="fa fa-circle"></i> | |
| 24 | + </li> | |
| 25 | + <li> | |
| 26 | + <span class="active">修改班次信息</span> | |
| 27 | + </li> | |
| 28 | + </ul> | |
| 29 | + | |
| 30 | + <div class="portlet light bordered"> | |
| 31 | + <div class="portlet-title"> | |
| 32 | + <div class="caption"> | |
| 33 | + <i class="icon-equalizer font-red-sunglo"></i> <span | |
| 34 | + class="caption-subject font-red-sunglo bold uppercase" >批量信息修改</span> | |
| 35 | + </div> | |
| 36 | + </div> | |
| 37 | + | |
| 38 | + <div class="portlet-body form"> | |
| 39 | + <form ng-submit="ctrl.submit()" class="form-horizontal" novalidate name="myForm"> | |
| 40 | + <div class="form-body"> | |
| 41 | + | |
| 42 | + <div class="form-group has-success has-feedback"> | |
| 43 | + <label class="col-md-3 control-label">方向:</label> | |
| 44 | + <div class="col-md-7"> | |
| 45 | + <sa-Radiogroup model="ctrl.TimeTableDetailForSave.xlDir" dicgroup="LineTrend" name="xlDir"></sa-Radiogroup> | |
| 46 | + </div> | |
| 47 | + | |
| 48 | + </div> | |
| 49 | + <div class="form-group"> | |
| 50 | + <label class="col-md-3 control-label">起点站:</label> | |
| 51 | + <div class="col-md-7"> | |
| 52 | + <sa-Select3 model="ctrl.TimeTableDetailForSave" | |
| 53 | + name="qdz" | |
| 54 | + placeholder="请输拼音..." | |
| 55 | + dcvalue="{{ctrl.TimeTableDetailForSave.qdz.id}}" | |
| 56 | + dcname="qdz.id" | |
| 57 | + icname="stationid" | |
| 58 | + icnames="stationname" | |
| 59 | + datatype="zd" | |
| 60 | + dataassociate="true" | |
| 61 | + dataparam="{{ {'xlid': ctrl.xlid, 'xldir': ctrl.TimeTableDetailForSave.xlDir} | json }}" | |
| 62 | + mlp="true" | |
| 63 | + > | |
| 64 | + </sa-Select3> | |
| 65 | + </div> | |
| 66 | + </div> | |
| 67 | + <div class="form-group"> | |
| 68 | + <label class="col-md-3 control-label">终点站:</label> | |
| 69 | + <div class="col-md-7"> | |
| 70 | + <sa-Select3 model="ctrl.TimeTableDetailForSave" | |
| 71 | + name="zdz" | |
| 72 | + placeholder="请输拼音..." | |
| 73 | + dcvalue="{{ctrl.TimeTableDetailForSave.zdz.id}}" | |
| 74 | + dcname="zdz.id" | |
| 75 | + icname="stationid" | |
| 76 | + icnames="stationname" | |
| 77 | + datatype="zd" | |
| 78 | + dataassociate="true" | |
| 79 | + dataparam="{{ {'xlid': ctrl.xlid, 'xldir': ctrl.TimeTableDetailForSave.xlDir} | json }}" | |
| 80 | + mlp="true" | |
| 81 | + > | |
| 82 | + </sa-Select3> | |
| 83 | + </div> | |
| 84 | + </div> | |
| 85 | + <div class="form-group"> | |
| 86 | + <label class="col-md-3 control-label">停车场:</label> | |
| 87 | + <div class="col-md-7"> | |
| 88 | + <sa-Select3 model="ctrl.TimeTableDetailForSave" | |
| 89 | + name="tcc" | |
| 90 | + placeholder="请输拼音..." | |
| 91 | + dcvalue="{{ctrl.TimeTableDetailForSave.tcc.id}}" | |
| 92 | + dcname="tcc.id" | |
| 93 | + icname="id" | |
| 94 | + icnames="parkName" | |
| 95 | + datatype="tcc" | |
| 96 | + mlp="true" | |
| 97 | + > | |
| 98 | + </sa-Select3> | |
| 99 | + </div> | |
| 100 | + </div> | |
| 101 | + | |
| 102 | + <div class="form-group has-success has-feedback"> | |
| 103 | + <label class="col-md-3 control-label">发车时间:</label> | |
| 104 | + <div class="col-md-7"> | |
| 105 | + <input type="text" class="form-control" | |
| 106 | + ng-model="ctrl.TimeTableDetailForSave.fcsj" | |
| 107 | + /> | |
| 108 | + </div> | |
| 109 | + | |
| 110 | + </div> | |
| 111 | + <div class="form-group"> | |
| 112 | + <label class="col-md-3 control-label">计划里程:</label> | |
| 113 | + <div class="col-md-7"> | |
| 114 | + <input type="text" class="form-control" | |
| 115 | + ng-model="ctrl.TimeTableDetailForSave.jhlc" | |
| 116 | + /> | |
| 117 | + </div> | |
| 118 | + | |
| 119 | + </div> | |
| 120 | + <div class="form-group"> | |
| 121 | + <label class="col-md-3 control-label">班次历时:</label> | |
| 122 | + <div class="col-md-7"> | |
| 123 | + <input type="text" class="form-control" | |
| 124 | + ng-model="ctrl.TimeTableDetailForSave.bcsj" | |
| 125 | + /> | |
| 126 | + </div> | |
| 127 | + | |
| 128 | + </div> | |
| 129 | + | |
| 130 | + </div> | |
| 131 | + | |
| 132 | + <div class="form-actions"> | |
| 133 | + <div class="row"> | |
| 134 | + <div class="col-md-offset-3 col-md-4"> | |
| 135 | + <button type="submit" class="btn green" | |
| 136 | + ng-disabled="!myForm.$valid"><i class="fa fa-check"></i> 提交</button> | |
| 137 | + <a type="button" class="btn default" | |
| 138 | + ui-sref="ttInfoDetailManage_edit({xlid: ctrl.xlid, ttid : ctrl.ttid, xlname: ctrl.xlname, ttname : ctrl.ttname})" ><i class="fa fa-times"></i> 取消</a> | |
| 139 | + </div> | |
| 140 | + </div> | |
| 141 | + </div> | |
| 142 | + </form> | |
| 143 | + | |
| 144 | + </div> | |
| 145 | + </div> | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | +</div> | ... | ... |
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage/detailedit/edit.html
| ... | ... | @@ -55,9 +55,9 @@ |
| 55 | 55 | </a> |
| 56 | 56 | <ul class="dropdown-menu pull-right"> |
| 57 | 57 | <li> |
| 58 | - <a href="javascript:" class="tool-action"> | |
| 58 | + <a href="javascript:" class="tool-action" ng-click="ctrl.editInfos()"> | |
| 59 | 59 | <i class="fa fa-file-excel-o"></i> |
| 60 | - 导出excel | |
| 60 | + 批量修改 | |
| 61 | 61 | </a> |
| 62 | 62 | </li> |
| 63 | 63 | <li class="divider"></li> |
| ... | ... | @@ -79,20 +79,21 @@ |
| 79 | 79 | <table style="width: 2000px" class="table table-striped table-bordered table-hover table-checkable order-column"> |
| 80 | 80 | <thead> |
| 81 | 81 | <tr> |
| 82 | - <th ng-repeat="head in ctrl.detailHeads track by $index"> | |
| 82 | + <th ng-repeat="head in ctrl.getDetailHeads() track by $index"> | |
| 83 | 83 | <span ng-bind="head"></span> |
| 84 | 84 | </th> |
| 85 | 85 | |
| 86 | 86 | </tr> |
| 87 | 87 | </thead> |
| 88 | 88 | <tbody> |
| 89 | - <tr ng-repeat="info in ctrl.detailInfos"> | |
| 89 | + <tr ng-repeat="info in ctrl.getDetailInfos()"> | |
| 90 | 90 | <td ng-repeat="cell in info track by $index"> |
| 91 | 91 | |
| 92 | 92 | <!--<span ng-bind="cell.fcsj"></span>--> |
| 93 | 93 | <span ng-if="!cell.ttdid" ng-bind="cell.fcsj"></span> |
| 94 | 94 | |
| 95 | 95 | <div ng-if="cell.ttdid" class="btn-group"> |
| 96 | + <input type="checkbox" ng-model="cell.sel"/> | |
| 96 | 97 | <a href="javascript:" class="btn blue btn-outline btn-circle" data-toggle="dropdown"> |
| 97 | 98 | <!-- 上下行图标 --> |
| 98 | 99 | <i ng-if="cell.xldir == '0'" class="fa fa-arrow-up" aria-hidden="true"></i> | ... | ... |
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage/detailedit/edit2.html
| 1 | -<h1>测试handsontable</h1> | |
| 1 | +<div class="page-head"> | |
| 2 | + <div class="page-title"> | |
| 3 | + <h1>时刻表管理</h1> | |
| 4 | + </div> | |
| 5 | +</div> | |
| 2 | 6 | |
| 3 | -<div ng-controller="tt_edit2 as ctrl"> | |
| 4 | - <hot-table col-headers="ctrl.colHeaders" datarows="ctrl.data"> | |
| 5 | - <hot-column ng-repeat="column in ctrl.columns" data="{{column.data}}" | |
| 6 | - title="column.title" read-only="column.readOnly"></hot-column> | |
| 7 | - </hot-table> | |
| 7 | +<ul class="page-breadcrumb breadcrumb"> | |
| 8 | + <li> | |
| 9 | + <a href="/pages/home.html" data-pjax>首页</a> | |
| 10 | + <i class="fa fa-circle"></i> | |
| 11 | + </li> | |
| 12 | + <li> | |
| 13 | + <span class="active">运营计划管理</span> | |
| 14 | + <i class="fa fa-circle"></i> | |
| 15 | + </li> | |
| 16 | + <li> | |
| 17 | + <a ui-sref="ttInfoManage">时刻表管理</a> | |
| 18 | + <i class="fa fa-circle"></i> | |
| 19 | + </li> | |
| 20 | + <li> | |
| 21 | + <span class="active">编辑时刻表明细信息</span> | |
| 22 | + </li> | |
| 23 | +</ul> | |
| 24 | + | |
| 25 | +<div class="row" id="timeTableDetail" ng-controller="TTInfoDetailManageCtrl as ctrl"> | |
| 26 | + <div class="col-md-12"> | |
| 27 | + <div class="portlet light bordered"> | |
| 28 | + <div class="portlet-title"> | |
| 29 | + <div class="caption font-dark"> | |
| 30 | + <i class="fa fa-database font-dark"></i> | |
| 31 | + <span class="caption-subject bold uppercase" ng-bind="ctrl.title"></span> | |
| 32 | + </div> | |
| 33 | + <div class="actions"> | |
| 34 | + <i class="fa fa-arrow-up" aria-hidden="true"></i> | |
| 35 | + <span style="padding-right: 10px;">上行班次</span> | |
| 36 | + <i class="fa fa-arrow-down" aria-hidden="true"></i> | |
| 37 | + <span style="padding-right: 10px;">下行班次</span> | |
| 38 | + <i class="fa fa-circle-o-notch" aria-hidden="true"></i> | |
| 39 | + <span style="padding-right: 10px;">区间班次</span> | |
| 40 | + <i class="fa fa-adjust" aria-hidden="true"></i> | |
| 41 | + <span style="padding-right: 10px;">分班班次</span> | |
| 42 | + | |
| 43 | + <div class="btn-group"> | |
| 44 | + <a href="javascript:" class="btn red btn-outline btn-circle" data-toggle="dropdown"> | |
| 45 | + <i class="fa fa-share"></i> | |
| 46 | + <span>数据工具</span> | |
| 47 | + <i class="fa fa-angle-down"></i> | |
| 48 | + </a> | |
| 49 | + <ul class="dropdown-menu pull-right"> | |
| 50 | + <li> | |
| 51 | + <a href="javascript:" class="tool-action"> | |
| 52 | + <i class="fa fa-file-excel-o"></i> | |
| 53 | + 导出excel | |
| 54 | + </a> | |
| 55 | + </li> | |
| 56 | + <li class="divider"></li> | |
| 57 | + <li> | |
| 58 | + <a href="javascript:" class="tool-action" ng-click="ctrl.refresh()"> | |
| 59 | + <i class="fa fa-refresh"></i> | |
| 60 | + 刷行数据 | |
| 61 | + </a> | |
| 62 | + </li> | |
| 63 | + </ul> | |
| 64 | + </div> | |
| 65 | + | |
| 66 | + </div> | |
| 67 | + </div> | |
| 68 | + | |
| 69 | + <div class="portlet-body"> | |
| 70 | + <!--<div ng-view></div>--> | |
| 71 | + <div class="fixDiv"> | |
| 72 | + | |
| 73 | + <hot-table datarows="ctrl.getData()" settings="ctrl.settings"> | |
| 74 | + <hot-column ng-repeat="column in ctrl.getColHeaders()" | |
| 75 | + data="{{column.data}}" | |
| 76 | + title="column.title" read-only="column.readOnly"></hot-column> | |
| 77 | + </hot-table> | |
| 78 | + | |
| 79 | + </div> | |
| 80 | + | |
| 81 | + | |
| 82 | + </div> | |
| 83 | + </div> | |
| 84 | + </div> | |
| 8 | 85 | </div> |
| 9 | 86 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage/detailedit/module2.js
0 → 100644
| 1 | +// 保存时刻表明细编辑信息 | |
| 2 | +angular.module('ScheduleApp').factory( | |
| 3 | + '$$TTInfoDetail_edit2_info', | |
| 4 | + [ | |
| 5 | + 'TimeTableDetailManageService_g', | |
| 6 | + function(service) { | |
| 7 | + var editInfo = {}; // 转换好的内部明细数据 | |
| 8 | + editInfo.colHeaders = [ // 这个要动态生成的 | |
| 9 | + { | |
| 10 | + data: 'lpName', | |
| 11 | + title: '路牌', | |
| 12 | + type: 'text', | |
| 13 | + readOnly: true | |
| 14 | + }, | |
| 15 | + { | |
| 16 | + data: 'fcsj1', | |
| 17 | + id: 'detailId1', | |
| 18 | + title: '出场', | |
| 19 | + type: 'text', | |
| 20 | + readOnly: true | |
| 21 | + }, | |
| 22 | + { | |
| 23 | + data: 'fcsj2', | |
| 24 | + id: 'detailId2', | |
| 25 | + title: '和静路安亭老街', | |
| 26 | + type: 'text', | |
| 27 | + readOnly: true | |
| 28 | + }, | |
| 29 | + { | |
| 30 | + data: 'fcsj3', | |
| 31 | + id: 'detailId3', | |
| 32 | + title: '福泉路天山西路', | |
| 33 | + type: 'text', | |
| 34 | + readOnly: true | |
| 35 | + }, | |
| 36 | + { | |
| 37 | + data: 'fcsj4', | |
| 38 | + id: 'detailId4', | |
| 39 | + title: '和静路安亭老街', | |
| 40 | + type: 'text', | |
| 41 | + readOnly: true | |
| 42 | + }, | |
| 43 | + { | |
| 44 | + data: 'fcsj5', | |
| 45 | + id: 'detailId5', | |
| 46 | + title: '福泉路天山西路', | |
| 47 | + type: 'text', | |
| 48 | + readOnly: true | |
| 49 | + }, | |
| 50 | + { | |
| 51 | + data: 'fcsj6', | |
| 52 | + id: 'detailId6', | |
| 53 | + title: '进场', | |
| 54 | + type: 'text', | |
| 55 | + readOnly: true | |
| 56 | + } | |
| 57 | + | |
| 58 | + | |
| 59 | + ]; | |
| 60 | + editInfo.items= [ | |
| 61 | + { | |
| 62 | + lpName: '1', | |
| 63 | + fcsj1: '0615', | |
| 64 | + detailId1: 1, | |
| 65 | + fcsj2: '0615', | |
| 66 | + detailId2: 1, | |
| 67 | + fcsj3: '0615', | |
| 68 | + detailId3: 1, | |
| 69 | + fcsj4: '0615', | |
| 70 | + detailId4: 1, | |
| 71 | + fcsj5: '0615', | |
| 72 | + detailId5: 1, | |
| 73 | + fcsj6: '0615', | |
| 74 | + detailId6: 1, | |
| 75 | + }, | |
| 76 | + { | |
| 77 | + lpName: '2', | |
| 78 | + fcsj1: '0615', | |
| 79 | + detailId1: 1, | |
| 80 | + fcsj2: '0615', | |
| 81 | + detailId2: 1, | |
| 82 | + fcsj3: '0615', | |
| 83 | + detailId3: 1, | |
| 84 | + fcsj4: '0615', | |
| 85 | + detailId4: 1, | |
| 86 | + fcsj5: '0615', | |
| 87 | + detailId5: 1, | |
| 88 | + fcsj6: '0615', | |
| 89 | + detailId6: 1, | |
| 90 | + }, | |
| 91 | + { | |
| 92 | + lpName: '3', | |
| 93 | + fcsj1: '0615', | |
| 94 | + detailId1: 1, | |
| 95 | + fcsj2: '0615', | |
| 96 | + detailId2: 1, | |
| 97 | + fcsj3: '0615', | |
| 98 | + detailId3: 1, | |
| 99 | + fcsj4: '0615', | |
| 100 | + detailId4: 1, | |
| 101 | + fcsj5: '0615', | |
| 102 | + detailId5: 1, | |
| 103 | + fcsj6: '0615', | |
| 104 | + detailId6: 1, | |
| 105 | + }, | |
| 106 | + { | |
| 107 | + lpName: '4', | |
| 108 | + fcsj1: '0615', | |
| 109 | + detailId1: 1, | |
| 110 | + fcsj2: '0615', | |
| 111 | + detailId2: 1, | |
| 112 | + fcsj3: '0615', | |
| 113 | + detailId3: 1, | |
| 114 | + fcsj4: '0615', | |
| 115 | + detailId4: 1, | |
| 116 | + fcsj5: '0615', | |
| 117 | + detailId5: 1, | |
| 118 | + fcsj6: '0615', | |
| 119 | + detailId6: 1, | |
| 120 | + }, | |
| 121 | + { | |
| 122 | + lpName: '5', | |
| 123 | + fcsj1: '0615', | |
| 124 | + detailId1: 1, | |
| 125 | + fcsj2: '0615', | |
| 126 | + detailId2: 1, | |
| 127 | + fcsj3: '0615', | |
| 128 | + detailId3: 1, | |
| 129 | + fcsj4: '0615', | |
| 130 | + detailId4: 1, | |
| 131 | + fcsj5: '0615', | |
| 132 | + detailId5: 1, | |
| 133 | + fcsj6: '0615', | |
| 134 | + detailId6: 1, | |
| 135 | + }, | |
| 136 | + { | |
| 137 | + lpName: '6', | |
| 138 | + fcsj1: '0615', | |
| 139 | + detailId1: 1, | |
| 140 | + fcsj2: '0615', | |
| 141 | + detailId2: 1, | |
| 142 | + fcsj3: '0615', | |
| 143 | + detailId3: 1, | |
| 144 | + fcsj4: '0615', | |
| 145 | + detailId4: 1, | |
| 146 | + fcsj5: '0615', | |
| 147 | + detailId5: 1, | |
| 148 | + fcsj6: '0615', | |
| 149 | + detailId6: 1, | |
| 150 | + } | |
| 151 | + | |
| 152 | + ]; | |
| 153 | + | |
| 154 | + | |
| 155 | + //this.columns = [ | |
| 156 | + // { | |
| 157 | + // data: 'id', | |
| 158 | + // title: 'ID', | |
| 159 | + // readOnly: true | |
| 160 | + // }, | |
| 161 | + // { | |
| 162 | + // data: 'price', | |
| 163 | + // title: 'Price', | |
| 164 | + // readOnly: false | |
| 165 | + // } | |
| 166 | + //]; | |
| 167 | + | |
| 168 | + // demo data | |
| 169 | + | |
| 170 | + | |
| 171 | + return { | |
| 172 | + getEditDetailInfo: function() { | |
| 173 | + return editInfo; | |
| 174 | + }, | |
| 175 | + refreshEditDetail: function() { | |
| 176 | + // TODO: | |
| 177 | + | |
| 178 | + return editInfo; | |
| 179 | + } | |
| 180 | + } | |
| 181 | + } | |
| 182 | + ] | |
| 183 | +); | |
| 184 | + | |
| 185 | +// edit2.html 页面 | |
| 186 | +angular.module('ScheduleApp').controller( | |
| 187 | + 'TTInfoDetailManageCtrl', | |
| 188 | + [ | |
| 189 | + 'TimeTableDetailManageService_g', | |
| 190 | + '$stateParams', | |
| 191 | + '$$TTInfoDetail_edit2_info', | |
| 192 | + function(service, $stateParams, detailService) { | |
| 193 | + var self = this; | |
| 194 | + self.xlid = $stateParams.xlid; // 获取传过来的线路id | |
| 195 | + self.ttid = $stateParams.ttid; // 获取传过来的时刻表id | |
| 196 | + self.xlname = $stateParams.xlname; // 获取传过来的线路名字 | |
| 197 | + self.ttname = $stateParams.ttname; // 获取传过来的时刻表名字 | |
| 198 | + | |
| 199 | + self.title = self.xlname + "(" + self.ttname + ")" + "时刻表明细信息"; | |
| 200 | + | |
| 201 | + self.getColHeaders = function() { | |
| 202 | + return detailService.getEditDetailInfo().colHeaders; | |
| 203 | + }; | |
| 204 | + self.getData = function() { | |
| 205 | + return detailService.getEditDetailInfo().items; | |
| 206 | + }; | |
| 207 | + self.test = function() { | |
| 208 | + alert("test"); | |
| 209 | + }; | |
| 210 | + | |
| 211 | + var m1 = '<a href="javascript:" class="tool-action" ng-click="ctrl.test()">m1</a>'; | |
| 212 | + | |
| 213 | + self.settings = { | |
| 214 | + contextMenu: [ | |
| 215 | + m1 | |
| 216 | + ] | |
| 217 | + }; | |
| 218 | + | |
| 219 | + // TODO:判定是否刷新数据 | |
| 220 | + detailService.refreshEditDetail(); | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + } | |
| 225 | + ] | |
| 226 | +); | |
| 0 | 227 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage/detailedit/route.js
| ... | ... | @@ -30,7 +30,7 @@ ScheduleApp.config([ |
| 30 | 30 | } |
| 31 | 31 | }) |
| 32 | 32 | .state("ttInfoDetailManage_edit", { // 时刻表详细信息编辑 |
| 33 | - url: '/ttInfoDetailManage_edit/:xlid/:ttid/:xlname/:ttname', | |
| 33 | + url: '/ttInfoDetailManage_edit/:xlid/:ttid/:xlname/:ttname/:rflag', | |
| 34 | 34 | views: { |
| 35 | 35 | "": {templateUrl: 'pages/scheduleApp/module/core/ttInfoManage/detailedit/edit.html'} |
| 36 | 36 | }, |
| ... | ... | @@ -57,7 +57,7 @@ ScheduleApp.config([ |
| 57 | 57 | name: 'ttInfoDetailManage_edit_module', |
| 58 | 58 | insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 |
| 59 | 59 | files: [ |
| 60 | - "pages/scheduleApp/module/core/ttInfoManage/detailedit/timeTableDetailManage_old.js" | |
| 60 | + "pages/scheduleApp/module/core/ttInfoManage/detailedit/module2.js" | |
| 61 | 61 | ] |
| 62 | 62 | }); |
| 63 | 63 | }] |
| ... | ... | @@ -81,6 +81,25 @@ ScheduleApp.config([ |
| 81 | 81 | }); |
| 82 | 82 | }] |
| 83 | 83 | } |
| 84 | + }) | |
| 85 | + .state("ttInfoDetailManage_detail_edit2", { // 时刻表详细信息批量单元格修改 | |
| 86 | + url: '/ttInfoDetailManage_detail_edit/:xlid/:ttid/:xlname/:ttname', | |
| 87 | + views: { | |
| 88 | + "": {templateUrl: 'pages/scheduleApp/module/core/ttInfoManage/detailedit/edit-detail2.html'} | |
| 89 | + }, | |
| 90 | + resolve: { | |
| 91 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 92 | + return $ocLazyLoad.load({ | |
| 93 | + name: 'ttInfoDetailManage_detail_edit_module', | |
| 94 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 95 | + files: [ | |
| 96 | + "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 97 | + "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 98 | + "pages/scheduleApp/module/core/ttInfoManage/detailedit/timeTableDetailManage_old.js" | |
| 99 | + ] | |
| 100 | + }); | |
| 101 | + }] | |
| 102 | + } | |
| 84 | 103 | }); |
| 85 | 104 | |
| 86 | 105 | } | ... | ... |
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage/detailedit/timeTableDetailManage_old.js
| 1 | +// 时刻表明晰编辑信息service | |
| 2 | +angular.module('ScheduleApp').factory( | |
| 3 | + 'TimeTableDetailManageService_old', | |
| 4 | + [ | |
| 5 | + 'TimeTableDetailManageService_g', | |
| 6 | + '$state', | |
| 7 | + '$q', | |
| 8 | + function(service, $state, $q) { | |
| 1 | 9 | |
| 2 | -angular.module('ScheduleApp').factory('TimeTableDetailManageService_old', ['TimeTableDetailManageService_g', function(service) { | |
| 3 | - | |
| 4 | - return { | |
| 5 | - /** | |
| 6 | - * 获取明细信息。 | |
| 7 | - * @param id 车辆id | |
| 8 | - * @return 返回一个 promise | |
| 9 | - */ | |
| 10 | - getDetail: function(id) { | |
| 11 | - var params = {id: id}; | |
| 12 | - return service.rest.get(params).$promise; | |
| 13 | - }, | |
| 14 | - /** | |
| 15 | - * 保存信息。 | |
| 16 | - * @param obj 车辆详细信息 | |
| 17 | - * @return 返回一个 promise | |
| 18 | - */ | |
| 19 | - saveDetail: function(obj) { | |
| 20 | - return service.rest.save(obj).$promise; | |
| 21 | - }, | |
| 22 | - /** | |
| 23 | - * 获取编辑用的时刻表明细数据。 | |
| 24 | - * @param ttid 时刻表id | |
| 25 | - */ | |
| 26 | - getEditInfo: function(xlid, ttid) { | |
| 27 | - var params = {xlid : xlid, ttid : ttid}; | |
| 28 | - return service.edit.list(params).$promise; | |
| 29 | - } | |
| 30 | - }; | |
| 31 | - | |
| 32 | -}]); | |
| 33 | - | |
| 34 | -angular.module('ScheduleApp').controller('TimeTableDetailManageCtrl_old', ['TimeTableDetailManageService_old', '$stateParams', '$uibModal', function(service, $stateParams, $uibModal) { | |
| 35 | - var self = this; | |
| 36 | - self.xlid = $stateParams.xlid; // 获取传过来的线路id | |
| 37 | - self.ttid = $stateParams.ttid; // 获取传过来的时刻表id | |
| 38 | - self.xlname = $stateParams.xlname; // 获取传过来的线路名字 | |
| 39 | - self.ttname = $stateParams.ttname; // 获取传过来的时刻表名字 | |
| 40 | - | |
| 41 | - self.title = self.xlname + "(" + self.ttname + ")" + "时刻表明细信息"; | |
| 42 | - | |
| 43 | - // 载入待编辑的时刻表明细数据 | |
| 44 | - service.getEditInfo(self.xlid, self.ttid).then( | |
| 45 | - function(result) { | |
| 46 | - // TODO;获取数据待展示 | |
| 47 | - self.detailHeads = result.header; | |
| 48 | - self.detailInfos = result.contents; | |
| 49 | - }, | |
| 50 | - function(result) { | |
| 51 | - alert("出错啦!"); | |
| 10 | + // 查询对象类 | |
| 11 | + var queryClass = service.rest; | |
| 12 | + | |
| 13 | + // 时刻表信息 | |
| 14 | + var editInfo = { | |
| 15 | + detailHeads: [], // 时刻表头信息 | |
| 16 | + detailInfos: [] // 时刻表明细信息 | |
| 17 | + }; | |
| 18 | + | |
| 19 | + return { | |
| 20 | + getQueryClass: function() { | |
| 21 | + return queryClass; | |
| 22 | + }, | |
| 23 | + getEditInfo: function() { | |
| 24 | + return editInfo; | |
| 25 | + }, | |
| 26 | + | |
| 27 | + /** | |
| 28 | + * 获取编辑用的时刻表明细数据。 | |
| 29 | + * @param xlid 线路id | |
| 30 | + * @param ttid 时刻表id | |
| 31 | + */ | |
| 32 | + refreshEditInfo: function(xlid, ttid) { | |
| 33 | + editInfo = { | |
| 34 | + detailHeads: [], // 时刻表头信息 | |
| 35 | + detailInfos: [] // 时刻表明细信息 | |
| 36 | + }; | |
| 37 | + | |
| 38 | + service.edit.list({xlid: xlid, ttid: ttid}, function(result) { | |
| 39 | + editInfo.detailHeads = result.header; | |
| 40 | + editInfo.detailInfos = result.contents; | |
| 41 | + | |
| 42 | + // detailInfos里添加是否选中的flag | |
| 43 | + for (var i = 0; i < editInfo.detailInfos.length; i++) { | |
| 44 | + for (var j = 0; j < editInfo.detailInfos[i].length; j++) { | |
| 45 | + editInfo.detailInfos[i][j].sel = false; | |
| 46 | + } | |
| 47 | + } | |
| 48 | + }); | |
| 49 | + }, | |
| 50 | + | |
| 51 | + editIsSel: function() { // 是否有被选中的 | |
| 52 | + var flag = false; | |
| 53 | + for (var i = 0; i < editInfo.detailInfos.length; i++) { | |
| 54 | + for (var j = 0; j < editInfo.detailInfos[i].length; j++) { | |
| 55 | + if (editInfo.detailInfos[i][j].sel == true) | |
| 56 | + return true; | |
| 57 | + } | |
| 58 | + } | |
| 59 | + return flag; | |
| 60 | + }, | |
| 61 | + | |
| 62 | + editInfos: function(updateObject) { // 批量保存数据 | |
| 63 | + var deferred = $q.defer(); | |
| 64 | + | |
| 65 | + // 找出所有选中的ttinfodetailids | |
| 66 | + var ttinfodetailIds = []; | |
| 67 | + for (var i = 0; i < editInfo.detailInfos.length; i++) { | |
| 68 | + for (var j = 0; j < editInfo.detailInfos[i].length; j++) { | |
| 69 | + if (editInfo.detailInfos[i][j].sel == true) | |
| 70 | + ttinfodetailIds.push(editInfo.detailInfos[i][j]); | |
| 71 | + } | |
| 72 | + } | |
| 73 | + // ajax调用 | |
| 74 | + var success_counts = 0; // 成功数 | |
| 75 | + var error_counts = 0; // 失败数 | |
| 76 | + for (var n = 0; n < ttinfodetailIds.length; n++) { | |
| 77 | + (function(index) { | |
| 78 | + queryClass.get({id: ttinfodetailIds[index].ttdid}, function(value) { | |
| 79 | + for (var key in updateObject) { | |
| 80 | + if (updateObject[key]) { | |
| 81 | + value[key] = updateObject[key]; | |
| 82 | + } | |
| 83 | + } | |
| 84 | + value.$save(function() { | |
| 85 | + // 赋值(上下行,发车时间,班次类型) | |
| 86 | + if (value.fcsj) { | |
| 87 | + ttinfodetailIds[index].fcsj = value.fcsj; | |
| 88 | + } | |
| 89 | + if (value.xlDir) { | |
| 90 | + ttinfodetailIds[index].xldir = value.xlDir; | |
| 91 | + } | |
| 92 | + if (value.bcType) { | |
| 93 | + ttinfodetailIds[index].bc_type = value.bcType; | |
| 94 | + } | |
| 95 | + | |
| 96 | + success_counts ++; | |
| 97 | + if (success_counts + error_counts == ttinfodetailIds.length) { | |
| 98 | + deferred.resolve(); | |
| 99 | + } | |
| 100 | + }, function() { | |
| 101 | + error_counts ++; | |
| 102 | + if (success_counts + error_counts == ttinfodetailIds.length) { | |
| 103 | + deferred.reject(); | |
| 104 | + } | |
| 105 | + }); | |
| 106 | + }, function() { | |
| 107 | + error_counts ++; | |
| 108 | + if (success_counts + error_counts == ttinfodetailIds.length) { | |
| 109 | + deferred.reject(); | |
| 110 | + } | |
| 111 | + }); | |
| 112 | + })(n); | |
| 113 | + } | |
| 114 | + | |
| 115 | + return deferred.promise; | |
| 116 | + } | |
| 117 | + | |
| 118 | + | |
| 119 | + }; | |
| 52 | 120 | } |
| 53 | - ); | |
| 54 | - | |
| 55 | - // 刷新数据 | |
| 56 | - self.refresh = function() { | |
| 57 | - service.getEditInfo(self.xlid, self.ttid).then( | |
| 58 | - function(result) { | |
| 59 | - // TODO;获取数据待展示 | |
| 60 | - self.detailHeads = result.header; | |
| 61 | - self.detailInfos = result.contents; | |
| 62 | - }, | |
| 63 | - function(result) { | |
| 64 | - alert("出错啦!"); | |
| 65 | - } | |
| 66 | - ); | |
| 67 | - }; | |
| 68 | - | |
| 69 | - /** | |
| 70 | - * 反向操作。 | |
| 71 | - * @param cell 明细信息 | |
| 72 | - */ | |
| 73 | - self.changeDirect = function(detailInfo, xldir) { | |
| 74 | - service.getDetail(detailInfo.ttdid).then( | |
| 75 | - function(result) { | |
| 76 | - result.xlDir = xldir; | |
| 77 | - service.saveDetail(result).then( | |
| 78 | - function(result) { | |
| 121 | + | |
| 122 | + ] | |
| 123 | +); | |
| 124 | + | |
| 125 | +// edit.html 时刻表编辑界面 | |
| 126 | +angular.module('ScheduleApp').controller( | |
| 127 | + 'TimeTableDetailManageCtrl_old', | |
| 128 | + [ | |
| 129 | + 'TimeTableDetailManageService_old', | |
| 130 | + '$stateParams', | |
| 131 | + '$uibModal', | |
| 132 | + '$state', | |
| 133 | + function(service, $stateParams, $uibModal, $state) { | |
| 134 | + var self = this; | |
| 135 | + self.xlid = $stateParams.xlid; // 获取传过来的线路id | |
| 136 | + self.ttid = $stateParams.ttid; // 获取传过来的时刻表id | |
| 137 | + self.xlname = $stateParams.xlname; // 获取传过来的线路名字 | |
| 138 | + self.ttname = $stateParams.ttname; // 获取传过来的时刻表名字 | |
| 139 | + self.rflag = $stateParams.rflag; // 刷新标志 | |
| 140 | + | |
| 141 | + self.title = self.xlname + "(" + self.ttname + ")" + "时刻表明细信息"; | |
| 142 | + | |
| 143 | + // 获取时刻表明细数据(内部保存) | |
| 144 | + self.getDetailHeads = function() { | |
| 145 | + return service.getEditInfo().detailHeads; | |
| 146 | + }; | |
| 147 | + self.getDetailInfos = function() { | |
| 148 | + return service.getEditInfo().detailInfos; | |
| 149 | + }; | |
| 150 | + | |
| 151 | + // 刷新时刻表数据 | |
| 152 | + self.refresh = function() { | |
| 153 | + service.refreshEditInfo(self.xlid, self.ttid); | |
| 154 | + }; | |
| 155 | + | |
| 156 | + // 批量修改 | |
| 157 | + self.editInfos = function() { | |
| 158 | + if (!service.editIsSel()) { | |
| 159 | + alert("请选择班次信息"); | |
| 160 | + return; | |
| 161 | + } else { | |
| 162 | + $state.go("ttInfoDetailManage_detail_edit2", { | |
| 163 | + xlid: self.xlid, | |
| 164 | + ttid: self.ttid, | |
| 165 | + xlname: self.xlname, | |
| 166 | + ttname: self.ttname | |
| 167 | + }); | |
| 168 | + } | |
| 169 | + | |
| 170 | + | |
| 171 | + }; | |
| 172 | + | |
| 173 | + // 查询对象类 | |
| 174 | + var TTInfoDetail = service.getQueryClass(); | |
| 175 | + | |
| 176 | + /** | |
| 177 | + * 反向操作。 | |
| 178 | + * @param cell 明细信息 | |
| 179 | + */ | |
| 180 | + self.changeDirect = function(detailInfo, xldir) { | |
| 181 | + TTInfoDetail.get({id: detailInfo.ttdid}, function(value) { | |
| 182 | + value.xlDir = xldir; | |
| 183 | + value.$save(function() { | |
| 79 | 184 | detailInfo.xldir = xldir; |
| 80 | - }, | |
| 81 | - function(result) { | |
| 82 | - alert("出错啦!"); | |
| 83 | - } | |
| 84 | - ); | |
| 85 | - }, | |
| 86 | - function(result) { | |
| 87 | - alert("出错啦!"); | |
| 88 | - } | |
| 89 | - ); | |
| 90 | - }; | |
| 91 | - | |
| 92 | - /** | |
| 93 | - * 更新分班。 | |
| 94 | - * @param detailInfo 明细信息 | |
| 95 | - * @param flag 分班标识 | |
| 96 | - */ | |
| 97 | - self.changeFB = function(detailInfo, flag) { | |
| 98 | - service.getDetail(detailInfo.ttdid).then( | |
| 99 | - function(result) { | |
| 100 | - result.isFB = flag; | |
| 101 | - service.saveDetail(result).then( | |
| 102 | - function(result) { | |
| 185 | + }); | |
| 186 | + }); | |
| 187 | + }; | |
| 188 | + | |
| 189 | + /** | |
| 190 | + * 更新分班。 | |
| 191 | + * @param detailInfo 明细信息 | |
| 192 | + * @param flag 分班标识 | |
| 193 | + */ | |
| 194 | + self.changeFB = function(detailInfo, flag) { | |
| 195 | + TTInfoDetail.get({id: detailInfo.ttdid}, function(value) { | |
| 196 | + value.isFB = flag; | |
| 197 | + value.$save(function() { | |
| 103 | 198 | detailInfo.isfb = flag; |
| 104 | - }, | |
| 105 | - function(result) { | |
| 106 | - alert("出错啦!"); | |
| 107 | - } | |
| 108 | - ); | |
| 109 | - }, | |
| 110 | - function(result) { | |
| 111 | - alert("出错啦!"); | |
| 112 | - } | |
| 113 | - ); | |
| 114 | - }; | |
| 115 | - | |
| 116 | - /** | |
| 117 | - * 改变便次类型。 | |
| 118 | - * @param detailInfo 明细信息 | |
| 119 | - * @param type 班次类型 | |
| 120 | - */ | |
| 121 | - self.changeBCType = function(detailInfo, type) { | |
| 122 | - service.getDetail(detailInfo.ttdid).then( | |
| 123 | - function(result) { | |
| 124 | - result.bcType = type; | |
| 125 | - service.saveDetail(result).then( | |
| 126 | - function(result) { | |
| 199 | + }); | |
| 200 | + }); | |
| 201 | + | |
| 202 | + }; | |
| 203 | + | |
| 204 | + /** | |
| 205 | + * 改变便次类型。 | |
| 206 | + * @param detailInfo 明细信息 | |
| 207 | + * @param type 班次类型 | |
| 208 | + */ | |
| 209 | + self.changeBCType = function(detailInfo, type) { | |
| 210 | + TTInfoDetail.get({id: detailInfo.ttdid}, function(value) { | |
| 211 | + value.bcType = type; | |
| 212 | + value.$save(function() { | |
| 127 | 213 | detailInfo.bc_type = type; |
| 128 | - }, | |
| 129 | - function(result) { | |
| 130 | - alert("出错啦!"); | |
| 131 | - } | |
| 132 | - ); | |
| 133 | - }, | |
| 134 | - function(result) { | |
| 135 | - alert("出错啦!"); | |
| 214 | + }); | |
| 215 | + }); | |
| 216 | + | |
| 217 | + }; | |
| 218 | + | |
| 219 | + if (self.rflag) { // 是否刷新 | |
| 220 | + self.refresh(); // 刷新数据 | |
| 136 | 221 | } |
| 137 | - ); | |
| 138 | - }; | |
| 139 | 222 | |
| 140 | -}]); | |
| 141 | 223 | |
| 142 | -angular.module('ScheduleApp').controller('TimeTableDetailManageFormCtrl_old', ['TimeTableDetailManageService_old', '$stateParams', '$state', function(service, $stateParams, $state) { | |
| 143 | - var self = this; | |
| 224 | + } | |
| 225 | + | |
| 226 | + ] | |
| 227 | +); | |
| 144 | 228 | |
| 145 | - // 欲保存的busInfo信息,绑定 | |
| 146 | - self.TimeTableDetailForSave = {}; | |
| 229 | +// edit-detail.html 具体班次明细修改页面 | |
| 230 | +angular.module('ScheduleApp').controller( | |
| 231 | + 'TimeTableDetailManageFormCtrl_old', | |
| 232 | + [ | |
| 233 | + 'TimeTableDetailManageService_old', | |
| 234 | + '$stateParams', | |
| 235 | + '$state', | |
| 236 | + function(service, $stateParams, $state) { | |
| 237 | + var self = this; | |
| 238 | + var TTInfoDetail = service.getQueryClass(); | |
| 147 | 239 | |
| 148 | - // 获取传过来的id,有的话就是修改,获取一遍数据 | |
| 149 | - var id = $stateParams.id; // 时刻明细班次id | |
| 150 | - self.xlid = $stateParams.xlid; // 获取传过来的线路id | |
| 151 | - self.ttid = $stateParams.ttid; // 获取传过来的时刻表id | |
| 152 | - self.xlname = $stateParams.xlname; // 获取传过来的线路名字 | |
| 153 | - self.ttname = $stateParams.ttname; // 获取传过来的时刻表名字 | |
| 240 | + // 欲保存的busInfo信息,绑定 | |
| 241 | + self.TimeTableDetailForSave = new TTInfoDetail; | |
| 154 | 242 | |
| 155 | - self.title1 = self.xlname + "(" + self.ttname + ")" + "时刻表明细信息"; | |
| 243 | + // 获取传过来的id,有的话就是修改,获取一遍数据 | |
| 244 | + var id = $stateParams.id; // 时刻明细班次id | |
| 245 | + self.xlid = $stateParams.xlid; // 获取传过来的线路id | |
| 246 | + self.ttid = $stateParams.ttid; // 获取传过来的时刻表id | |
| 247 | + self.xlname = $stateParams.xlname; // 获取传过来的线路名字 | |
| 248 | + self.ttname = $stateParams.ttname; // 获取传过来的时刻表名字 | |
| 156 | 249 | |
| 157 | - if (id) { | |
| 158 | - self.TimeTableDetailForSave.id = id; | |
| 159 | - service.getDetail(id).then( | |
| 160 | - function(result) { | |
| 161 | - var key; | |
| 162 | - for (key in result) { | |
| 163 | - self.TimeTableDetailForSave[key] = result[key]; | |
| 164 | - } | |
| 250 | + self.title1 = self.xlname + "(" + self.ttname + ")" + "时刻表明细信息"; | |
| 165 | 251 | |
| 166 | - self.title2 = | |
| 167 | - self.xlname + "(" + self.ttname + ")" + "时刻表明细信息" + | |
| 168 | - "->路牌" + self.TimeTableDetailForSave.lp.lpName + | |
| 169 | - "->发车顺序号" + self.TimeTableDetailForSave.fcno + | |
| 170 | - "->班次详细信息"; | |
| 252 | + if (id) { | |
| 253 | + TTInfoDetail.get({id: id}, function(value) { | |
| 254 | + self.TimeTableDetailForSave = value; | |
| 255 | + self.title2 = | |
| 256 | + self.xlname + "(" + self.ttname + ")" + "时刻表明细信息" + | |
| 257 | + "->路牌" + self.TimeTableDetailForSave.lp.lpName + | |
| 258 | + "->发车顺序号" + self.TimeTableDetailForSave.fcno + | |
| 259 | + "->班次详细信息"; | |
| 260 | + }); | |
| 171 | 261 | |
| 172 | - }, | |
| 173 | - function(result) { | |
| 174 | - alert("出错啦!"); | |
| 175 | 262 | } |
| 176 | - ); | |
| 177 | - } | |
| 178 | - | |
| 179 | - // 提交方法 | |
| 180 | - self.submit = function() { | |
| 181 | - console.log(self.TimeTableDetailForSave); | |
| 182 | - //if (self.busInfoForSave) { | |
| 183 | - // delete $stateParams.id; | |
| 184 | - //} | |
| 185 | - service.saveDetail(self.TimeTableDetailForSave).then( | |
| 186 | - function(result) { | |
| 187 | - // TODO:弹出框方式以后改 | |
| 188 | - if (result.status == 'SUCCESS') { | |
| 189 | - //alert("保存成功!"); | |
| 263 | + | |
| 264 | + // 提交方法 | |
| 265 | + self.submit = function() { | |
| 266 | + console.log(self.TimeTableDetailForSave); | |
| 267 | + //if (self.busInfoForSave) { | |
| 268 | + // delete $stateParams.id; | |
| 269 | + //} | |
| 270 | + | |
| 271 | + if (self.TimeTableDetailForSave.tcc && !self.TimeTableDetailForSave.tcc.id) | |
| 272 | + delete self.TimeTableDetailForSave.tcc; | |
| 273 | + if (self.TimeTableDetailForSave.qdz && !self.TimeTableDetailForSave.qdz.id) | |
| 274 | + delete self.TimeTableDetailForSave.qdz; | |
| 275 | + if (self.TimeTableDetailForSave.zdz && !self.TimeTableDetailForSave.zdz.id) | |
| 276 | + delete self.TimeTableDetailForSave.zdz; | |
| 277 | + | |
| 278 | + self.TimeTableDetailForSave.$save(function(value) { | |
| 279 | + // 修正内部edit的值 | |
| 280 | + var detailInfos = service.getEditInfo().detailInfos; | |
| 281 | + for (var i = 0; i < detailInfos.length; i ++) { | |
| 282 | + for (var j = 0; j < detailInfos[i].length; j++) { | |
| 283 | + if (detailInfos[i][j].ttdid == id) { | |
| 284 | + // 赋值(上下行,发车时间,班次类型) | |
| 285 | + detailInfos[i][j].fcsj = value.fcsj; | |
| 286 | + detailInfos[i][j].xldir = value.xlDir; | |
| 287 | + detailInfos[i][j].bc_type = value.bcType; | |
| 288 | + } | |
| 289 | + } | |
| 290 | + } | |
| 190 | 291 | $state.go("ttInfoDetailManage_edit", { |
| 191 | 292 | xlid: self.xlid, |
| 192 | 293 | ttid: self.ttid, |
| 193 | 294 | xlname: self.xlname, |
| 194 | 295 | ttname: self.ttname |
| 195 | 296 | }); |
| 196 | - } else { | |
| 197 | - alert("保存异常!"); | |
| 198 | - } | |
| 199 | - }, | |
| 200 | - function(result) { | |
| 201 | - // TODO:弹出框方式以后改 | |
| 202 | - alert("出错啦!"); | |
| 203 | - } | |
| 204 | - ); | |
| 205 | - }; | |
| 297 | + }); | |
| 206 | 298 | |
| 207 | -}]); | |
| 299 | + }; | |
| 208 | 300 | |
| 209 | -// 测试edit2功能 | |
| 210 | -angular.module("ScheduleApp").controller( | |
| 211 | - 'tt_edit2', | |
| 212 | - [ | |
| 213 | - function() { | |
| 214 | - this.colHeaders = [ | |
| 215 | - '路牌', | |
| 216 | - '出场', | |
| 217 | - '和静路安亭老街', | |
| 218 | - '福泉路天山西路', | |
| 219 | - '和静路安亭老街', | |
| 220 | - '福泉路天山西路', | |
| 221 | - '和静路安亭老街', | |
| 222 | - '福泉路天山西路', | |
| 223 | - '和静路安亭老街', | |
| 224 | - '福泉路天山西路', | |
| 225 | - '和静路安亭老街', | |
| 226 | - '福泉路天山西路', | |
| 227 | - '和静路安亭老街', | |
| 228 | - '福泉路天山西路', | |
| 229 | - '和静路安亭老街', | |
| 230 | - '进场' | |
| 231 | - ]; | |
| 232 | - | |
| 233 | - | |
| 234 | - | |
| 235 | - | |
| 236 | - | |
| 237 | - | |
| 238 | - | |
| 239 | - var items = [ | |
| 240 | - ['1', '0615', '', '', '0630', '0755', '0935', '1055', '1305', '1425', '1640', '1805', '', '', '1915', '1925'] | |
| 241 | - ]; | |
| 242 | - | |
| 243 | - this.data = items; | |
| 244 | - //this.columns = [ | |
| 245 | - // { | |
| 246 | - // data: 'id', | |
| 247 | - // title: 'ID', | |
| 248 | - // readOnly: true | |
| 249 | - // }, | |
| 250 | - // { | |
| 251 | - // data: 'price', | |
| 252 | - // title: 'Price', | |
| 253 | - // readOnly: false | |
| 254 | - // } | |
| 255 | - //]; | |
| 256 | 301 | } |
| 302 | + ] | |
| 303 | +); | |
| 257 | 304 | |
| 305 | +// edit-detail2.html 具体班次明细修改页面 | |
| 306 | +angular.module('ScheduleApp').controller( | |
| 307 | + 'TimeTableDetailManageFormCtrl_old2', | |
| 308 | + [ | |
| 309 | + 'TimeTableDetailManageService_old', | |
| 310 | + '$stateParams', | |
| 311 | + '$state', | |
| 312 | + function(service, $stateParams, $state) { | |
| 313 | + var self = this; | |
| 314 | + var TTInfoDetail = service.getQueryClass(); | |
| 315 | + | |
| 316 | + // 欲保存的busInfo信息,绑定 | |
| 317 | + self.TimeTableDetailForSave = new TTInfoDetail; | |
| 318 | + self.TimeTableDetailForSave.tcc = {}; | |
| 319 | + self.TimeTableDetailForSave.qdz = {}; | |
| 320 | + self.TimeTableDetailForSave.zdz = {}; | |
| 321 | + | |
| 322 | + // 获取传过来的id,有的话就是修改,获取一遍数据 | |
| 323 | + self.xlid = $stateParams.xlid; // 获取传过来的线路id | |
| 324 | + self.ttid = $stateParams.ttid; // 获取传过来的时刻表id | |
| 325 | + self.xlname = $stateParams.xlname; // 获取传过来的线路名字 | |
| 326 | + self.ttname = $stateParams.ttname; // 获取传过来的时刻表名字 | |
| 327 | + | |
| 328 | + self.title1 = self.xlname + "(" + self.ttname + ")" + "时刻表明细信息"; | |
| 329 | + | |
| 330 | + // 提交方法 | |
| 331 | + self.submit = function() { | |
| 332 | + if (!self.TimeTableDetailForSave.tcc.id) | |
| 333 | + delete self.TimeTableDetailForSave.tcc; | |
| 334 | + if (!self.TimeTableDetailForSave.qdz.id) | |
| 335 | + delete self.TimeTableDetailForSave.qdz; | |
| 336 | + if (!self.TimeTableDetailForSave.zdz.id) | |
| 337 | + delete self.TimeTableDetailForSave.zdz; | |
| 338 | + | |
| 339 | + service.editInfos(self.TimeTableDetailForSave).then(function() { | |
| 340 | + alert("批量更新成功!"); | |
| 341 | + $state.go("ttInfoDetailManage_edit", { | |
| 342 | + xlid: self.xlid, | |
| 343 | + ttid: self.ttid, | |
| 344 | + xlname: self.xlname, | |
| 345 | + ttname: self.ttname | |
| 346 | + }); | |
| 347 | + }, function() { | |
| 348 | + alert("批量更新失败!"); | |
| 349 | + $state.go("ttInfoDetailManage_edit", { | |
| 350 | + xlid: self.xlid, | |
| 351 | + ttid: self.ttid, | |
| 352 | + xlname: self.xlname, | |
| 353 | + ttname: self.ttname | |
| 354 | + }); | |
| 355 | + }); | |
| 356 | + | |
| 357 | + }; | |
| 358 | + | |
| 359 | + } | |
| 258 | 360 | ] |
| 259 | -); | |
| 260 | 361 | \ No newline at end of file |
| 362 | +); | |
| 363 | + | ... | ... |
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage/list.html
| ... | ... | @@ -79,10 +79,10 @@ |
| 79 | 79 | <span class="glyphicon glyphicon-remove" ng-if="info.isCancel == '1'"></span> |
| 80 | 80 | </td> |
| 81 | 81 | <td> |
| 82 | - <a ui-sref="ttInfoDetailManage_edit({xlid: info.xl.id, ttid : info.id, xlname: info.xl.name, ttname : info.name})" | |
| 82 | + <a ui-sref="ttInfoDetailManage_edit({xlid: info.xl.id, ttid : info.id, xlname: info.xl.name, ttname : info.name, rflag : true})" | |
| 83 | 83 | class="btn btn-info btn-sm" ng-if="info.isCancel == '0'"> 编辑 </a> |
| 84 | - <a ui-sref="ttInfoDetailManage_edit2({xlid: info.xl.id, ttid : info.id, xlname: info.xl.name, ttname : info.name})" | |
| 85 | - class="btn btn-info btn-sm" ng-if="info.isCancel == '0'"> 编辑2 </a> | |
| 84 | + <!--<a ui-sref="ttInfoDetailManage_edit2({xlid: info.xl.id, ttid : info.id, xlname: info.xl.name, ttname : info.name})"--> | |
| 85 | + <!--class="btn btn-info btn-sm" ng-if="info.isCancel == '0'"> 编辑2 </a>--> | |
| 86 | 86 | <a ng-click="ctrl.toTtInfoDetailAuto()" |
| 87 | 87 | class="btn btn-info btn-sm" ng-if="info.isCancel == '0'"> 生成 </a> |
| 88 | 88 | <a ui-sref="ttInfoDetailManage_form({xlid: info.xl.id, ttid : info.id, xlname: info.xl.name, ttname : info.name})" | ... | ... |
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage/service.js
| ... | ... | @@ -43,75 +43,83 @@ angular.module('ScheduleApp').factory( |
| 43 | 43 | ); |
| 44 | 44 | |
| 45 | 45 | // 时刻表明细管理service |
| 46 | -angular.module('ScheduleApp').factory('TimeTableDetailManageService_g', ['$resource', function($resource) { | |
| 47 | - return { | |
| 48 | - rest: $resource( | |
| 49 | - '/tidc/:id', | |
| 50 | - {order: 'createDate', direction: 'DESC', id: '@id_route'}, | |
| 51 | - { | |
| 52 | - get: { | |
| 53 | - method: 'GET' | |
| 54 | - }, | |
| 55 | - save: { | |
| 56 | - method: 'POST' | |
| 57 | - } | |
| 58 | - } | |
| 59 | - ), | |
| 60 | - import: $resource( | |
| 61 | - '/tidc/importfile', | |
| 62 | - {}, | |
| 63 | - { | |
| 64 | - do: { | |
| 65 | - method: 'POST', | |
| 66 | - headers: { | |
| 67 | - 'Content-Type': 'application/x-www-form-urlencoded' | |
| 68 | - }, | |
| 69 | - transformRequest: function(obj) { | |
| 70 | - var str = []; | |
| 71 | - for (var p in obj) { | |
| 72 | - str.push(encodeURIComponent(p) + "=" + encodeURIComponent(obj[p])); | |
| 46 | +angular.module('ScheduleApp').factory( | |
| 47 | + 'TimeTableDetailManageService_g', | |
| 48 | + [ | |
| 49 | + '$resource', | |
| 50 | + function($resource) { | |
| 51 | + return { | |
| 52 | + rest: $resource( | |
| 53 | + '/tidc/:id', | |
| 54 | + {order: 'createDate', direction: 'DESC', id: '@id'}, | |
| 55 | + { | |
| 56 | + get: { | |
| 57 | + method: 'GET' | |
| 58 | + }, | |
| 59 | + save: { | |
| 60 | + method: 'POST' | |
| 61 | + } | |
| 62 | + } | |
| 63 | + ), | |
| 64 | + import: $resource( | |
| 65 | + '/tidc/importfile', | |
| 66 | + {}, | |
| 67 | + { | |
| 68 | + do: { | |
| 69 | + method: 'POST', | |
| 70 | + headers: { | |
| 71 | + 'Content-Type': 'application/x-www-form-urlencoded' | |
| 72 | + }, | |
| 73 | + transformRequest: function(obj) { | |
| 74 | + var str = []; | |
| 75 | + for (var p in obj) { | |
| 76 | + str.push(encodeURIComponent(p) + "=" + encodeURIComponent(obj[p])); | |
| 77 | + } | |
| 78 | + return str.join("&"); | |
| 79 | + } | |
| 80 | + } | |
| 81 | + } | |
| 82 | + ), | |
| 83 | + edit: $resource( | |
| 84 | + '/tidc/edit/:xlid/:ttid', | |
| 85 | + {}, | |
| 86 | + { | |
| 87 | + list: { | |
| 88 | + method: 'GET' | |
| 73 | 89 | } |
| 74 | - return str.join("&"); | |
| 75 | 90 | } |
| 76 | - } | |
| 77 | - } | |
| 78 | - ), | |
| 79 | - edit: $resource( | |
| 80 | - '/tidc/edit/:xlid/:ttid', | |
| 81 | - {}, | |
| 82 | - { | |
| 83 | - list: { | |
| 84 | - method: 'GET' | |
| 85 | - } | |
| 86 | - } | |
| 87 | - ), | |
| 88 | - bcdetails: $resource( | |
| 89 | - '/tidc/bcdetail', | |
| 90 | - {}, | |
| 91 | - { | |
| 92 | - list: { | |
| 93 | - method: 'GET', | |
| 94 | - isArray: true | |
| 95 | - } | |
| 96 | - } | |
| 97 | - ), | |
| 98 | - dataTools: $resource( | |
| 99 | - '/tidc/:type', | |
| 100 | - {}, | |
| 101 | - { | |
| 102 | - dataExport: { | |
| 103 | - method: 'GET', | |
| 104 | - responseType: "arraybuffer", | |
| 105 | - params: { | |
| 106 | - type: "dataExportExt" | |
| 107 | - }, | |
| 108 | - transformResponse: function(data, headers){ | |
| 109 | - return {data : data}; | |
| 91 | + ), | |
| 92 | + bcdetails: $resource( | |
| 93 | + '/tidc/bcdetail', | |
| 94 | + {}, | |
| 95 | + { | |
| 96 | + list: { | |
| 97 | + method: 'GET', | |
| 98 | + isArray: true | |
| 99 | + } | |
| 100 | + } | |
| 101 | + ), | |
| 102 | + dataTools: $resource( | |
| 103 | + '/tidc/:type', | |
| 104 | + {}, | |
| 105 | + { | |
| 106 | + dataExport: { | |
| 107 | + method: 'GET', | |
| 108 | + responseType: "arraybuffer", | |
| 109 | + params: { | |
| 110 | + type: "dataExportExt" | |
| 111 | + }, | |
| 112 | + transformResponse: function(data, headers){ | |
| 113 | + return {data : data}; | |
| 114 | + } | |
| 115 | + } | |
| 110 | 116 | } |
| 111 | - } | |
| 112 | - } | |
| 113 | - ) | |
| 117 | + ) | |
| 114 | 118 | |
| 115 | - // TODO:导入数据 | |
| 116 | - }; | |
| 117 | -}]); | |
| 118 | 119 | \ No newline at end of file |
| 120 | + // TODO:导入数据 | |
| 121 | + }; | |
| 122 | + | |
| 123 | + } | |
| 124 | + | |
| 125 | + ] | |
| 126 | +); | |
| 119 | 127 | \ No newline at end of file | ... | ... |
src/main/resources/static/real_control_v2/assets/plugins/uikit-2.27.1/components/progress.gradient.min.css
0 → 100644
| 1 | +/*! UIkit 2.27.1 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ | |
| 2 | +.uk-progress{box-sizing:border-box;height:20px;margin-bottom:15px;background:#f7f7f7;overflow:hidden;line-height:20px;box-shadow:inset 0 0 0 1px rgba(0,0,0,.07),inset 0 2px 2px rgba(0,0,0,.07);border-radius:4px}*+.uk-progress{margin-top:15px}.uk-progress-bar{width:0;height:100%;background:#009dd8;float:left;-webkit-transition:width .6s ease;transition:width .6s ease;font-size:12px;color:#fff;text-align:center;background-image:-webkit-linear-gradient(top,#00b4f5,#008dc5);background-image:linear-gradient(to bottom,#00b4f5,#008dc5);box-shadow:inset 0 -1px 0 rgba(0,0,0,.2),inset 0 0 0 1px rgba(0,0,0,.1);text-shadow:0 -1px 0 rgba(0,0,0,.2)}.uk-progress-mini{height:6px}.uk-progress-small{height:12px}.uk-progress-success .uk-progress-bar{background-color:#82bb42;background-image:-webkit-linear-gradient(top,#9fd256,#6fac34);background-image:linear-gradient(to bottom,#9fd256,#6fac34)}.uk-progress-warning .uk-progress-bar{background-color:#f9a124;background-image:-webkit-linear-gradient(top,#fbb450,#f89406);background-image:linear-gradient(to bottom,#fbb450,#f89406)}.uk-progress-danger .uk-progress-bar{background-color:#d32c46;background-image:-webkit-linear-gradient(top,#ee465a,#c11a39);background-image:linear-gradient(to bottom,#ee465a,#c11a39)}.uk-progress-striped .uk-progress-bar{background-image:-webkit-linear-gradient(-45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(-45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-size:30px 30px}.uk-progress-striped.uk-active .uk-progress-bar{-webkit-animation:uk-progress-bar-stripes 2s linear infinite;animation:uk-progress-bar-stripes 2s linear infinite}@-webkit-keyframes uk-progress-bar-stripes{0%{background-position:0 0}100%{background-position:30px 0}}@keyframes uk-progress-bar-stripes{0%{background-position:0 0}100%{background-position:30px 0}}.uk-progress-mini,.uk-progress-small{border-radius:500px} | |
| 0 | 3 | \ No newline at end of file | ... | ... |
src/main/resources/static/real_control_v2/css/line_schedule.css
| ... | ... | @@ -965,22 +965,32 @@ dd.fcsjActualCell div.last-sch-sunken{ |
| 965 | 965 | /*border-top: 1px solid #eeeeee;*/ |
| 966 | 966 | } |
| 967 | 967 | |
| 968 | +dd.fcsjActualCell.tl-yzx div.last-sch-sunken { | |
| 969 | + background: #c1ddf0; | |
| 970 | + border-top: 1px solid #c1d3df; | |
| 971 | +} | |
| 972 | + | |
| 973 | +dd.fcsjActualCell.tl-yzx div.last-sch-sunken span._badge { | |
| 974 | + background: rgb(255, 255, 255); | |
| 975 | + color: black; | |
| 976 | +} | |
| 977 | + | |
| 968 | 978 | dd.fcsjActualCell div.last-sch-sunken span._badge{ |
| 969 | 979 | font-size: 12px; |
| 970 | 980 | border-radius: 0 7px 7px 0; |
| 971 | 981 | padding-left: 0; |
| 972 | - width: 29px; | |
| 982 | + width: 79px; | |
| 973 | 983 | display: inline-block; |
| 974 | - height: 18px; | |
| 975 | - line-height: 18px; | |
| 984 | + height: 22px; | |
| 985 | + line-height: 22px; | |
| 976 | 986 | box-shadow: 2px 0px 2px 0 rgba(0,0,0,0.16), 2px 0px 4px 0 rgba(0,0,0,0.12); |
| 977 | 987 | vertical-align: top; |
| 978 | 988 | margin-right: 3px; |
| 979 | - margin-top: 3px; | |
| 989 | + margin-top: 1px; | |
| 980 | 990 | margin-left: -7px; |
| 981 | - text-indent: 2px; | |
| 991 | + /*text-indent: 2px;*/ | |
| 982 | 992 | border-left: 0; |
| 983 | - transform: scale(.9); | |
| 993 | + /* transform: scale(.9); */ | |
| 984 | 994 | color: grey; |
| 985 | 995 | } |
| 986 | 996 | ... | ... |
src/main/resources/static/real_control_v2/fragments/geo/calc_station_space.html
| ... | ... | @@ -109,7 +109,6 @@ |
| 109 | 109 | if(upSuccess && downSuccess){ |
| 110 | 110 | window.localStorage.setItem('control_route_distance_' + sch.xlBm, JSON.stringify(locData)); |
| 111 | 111 | //刷新父页面 |
| 112 | - console.log('$(drawer).parents', $(drawer).parents('.uk-modal')); | |
| 113 | 112 | $(drawer).parents('.uk-modal').trigger('refresh_station_space'); |
| 114 | 113 | } |
| 115 | 114 | ... | ... |
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/sub_task/add_sub_task_inpark.html
| ... | ... | @@ -388,8 +388,9 @@ |
| 388 | 388 | |
| 389 | 389 | //营运开始时间 |
| 390 | 390 | $('input[name=startDate]', serviceForm).val(sch.dfsj); |
| 391 | + | |
| 391 | 392 | //营运班次类型 |
| 392 | - $('input[name=type1]', serviceForm).val(sch['sflj']?'临加':'正常'); | |
| 393 | + $('select[name=type1]', serviceForm).val(sch['sflj']?'临加':'正常'); | |
| 393 | 394 | } |
| 394 | 395 | |
| 395 | 396 | //点击 路径 | ... | ... |
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/sub_task/station_route_spacing_chart.html
| ... | ... | @@ -23,6 +23,7 @@ |
| 23 | 23 | $('.delete_route_spacing_link', drawer).on('click', function () { |
| 24 | 24 | alt_confirm('确定要删除【'+sch.xlName+'】基于空间坐标计算的站间距数据?', function () { |
| 25 | 25 | window.localStorage.removeItem('control_route_distance_' + sch.xlBm); |
| 26 | + $(drawer).parents('.uk-modal').trigger('refresh_station_space'); | |
| 26 | 27 | toGeoCalcPage(); |
| 27 | 28 | }, '确定删除'); |
| 28 | 29 | }); |
| ... | ... | @@ -248,4 +249,5 @@ |
| 248 | 249 | }); |
| 249 | 250 | })(); |
| 250 | 251 | </script> |
| 252 | + | |
| 251 | 253 | </div> |
| 252 | 254 | \ No newline at end of file | ... | ... |
src/main/resources/static/real_control_v2/fragments/line_schedule/sch_table.html
| ... | ... | @@ -167,7 +167,7 @@ |
| 167 | 167 | |
| 168 | 168 | <script id="last-sch-sunken-temp" type="text/html"> |
| 169 | 169 | <div class="last-sch-sunken"> |
| 170 | - <span class="_badge">终点</span>{{zdsj}}/{{zdsjActual}} | |
| 170 | + <span class="_badge">{{zdsj}}/{{zdsjActual}}</span> | |
| 171 | 171 | </div> |
| 172 | 172 | </script> |
| 173 | 173 | </div> | ... | ... |
src/main/resources/static/real_control_v2/js/data/data_gps.js
| ... | ... | @@ -3,7 +3,7 @@ |
| 3 | 3 | var gb_data_gps = (function() { |
| 4 | 4 | |
| 5 | 5 | //fixed time refresh delay |
| 6 | - var delay = 1000 * 7; | |
| 6 | + var delay = 1000 * 6; | |
| 7 | 7 | //deviceId ——> gps |
| 8 | 8 | var realData = {}; |
| 9 | 9 | //refresh after callback |
| ... | ... | @@ -30,7 +30,7 @@ var gb_data_gps = (function() { |
| 30 | 30 | }, |
| 31 | 31 | error: function (xr, t) { |
| 32 | 32 | notify_err('刷新GPS失败,稍后重试' + t); |
| 33 | - cb(); | |
| 33 | + //cb(); | |
| 34 | 34 | } |
| 35 | 35 | }); |
| 36 | 36 | }; | ... | ... |
src/main/resources/static/real_control_v2/js/data/json/north_toolbar.json
src/main/resources/static/real_control_v2/js/north/toolbar.js
| ... | ... | @@ -68,6 +68,9 @@ var gb_northToolbar = (function() { |
| 68 | 68 | }, |
| 69 | 69 | sch_exec_rate: function () { |
| 70 | 70 | open_modal('/real_control_v2/fragments/north/nav/charts/sch_exec_rate.html', {}, modal_opts); |
| 71 | + }, | |
| 72 | + gps_play_back: function () { | |
| 73 | + gb_map_play_back.initParams(); | |
| 71 | 74 | } |
| 72 | 75 | } |
| 73 | 76 | })(); | ... | ... |
src/main/resources/static/real_control_v2/js/utils/svg_chart_map.js
| ... | ... | @@ -3,22 +3,25 @@ var gb_svg_map_util = (function () { |
| 3 | 3 | var drawLine = function (map, gps) { |
| 4 | 4 | //从storage里获取路段路由数据 |
| 5 | 5 | var routes = JSON.parse(storage.getItem(gps.lineId + '_route')), |
| 6 | - updown = gps.upDown == 0 ? 'up' : 'down', | |
| 7 | - pots = [], | |
| 8 | - tempArr; | |
| 6 | + updown = gps.upDown == 0 ? 'up_bd' : 'down_bd', | |
| 7 | + pos = [], | |
| 8 | + temps; | |
| 9 | 9 | |
| 10 | - $.each(routes[updown].split(','), function () { | |
| 11 | - tempArr = this.split(' '); | |
| 12 | - pots.push(new BMap.Point(tempArr[0], tempArr[1])); | |
| 13 | - }); | |
| 10 | + $.each(routes[updown], function (i, item) { | |
| 14 | 11 | |
| 15 | - var polyline = new BMap.Polyline(pots, { | |
| 16 | - strokeWeight: 6, | |
| 17 | - strokeOpacity: 0.5, | |
| 18 | - strokeColor: gps.upDown == 0 ? 'blue' : 'red' | |
| 19 | - }); | |
| 12 | + pos = []; | |
| 13 | + $.each(item.split(','), function () { | |
| 14 | + temps = this.split(' '); | |
| 15 | + pos.push(new BMap.Point(temps[0], temps[1])); | |
| 16 | + }); | |
| 17 | + var polyline = new BMap.Polyline(pos, { | |
| 18 | + strokeWeight: 6, | |
| 19 | + strokeOpacity: 0.5, | |
| 20 | + strokeColor: gps.upDown == 0 ? 'blue' : 'red' | |
| 21 | + }); | |
| 22 | + map.addOverlay(polyline); | |
| 20 | 23 | |
| 21 | - map.addOverlay(polyline); | |
| 24 | + }); | |
| 22 | 25 | |
| 23 | 26 | $.each(gb_data_basic.stationRoutes(gps.lineId), function (i) { |
| 24 | 27 | if (this.directions == gps.upDown) { | ... | ... |
src/main/resources/static/real_control_v2/mapmonitor/css/real.css
| ... | ... | @@ -94,18 +94,9 @@ input[type=checkbox].disabled{ |
| 94 | 94 | |
| 95 | 95 | /**/ |
| 96 | 96 | .real_bottom_panel{ |
| 97 | -/* position: absolute !important; | |
| 98 | - height: 180px; | |
| 99 | - width: 100%; | |
| 100 | - width: calc(100% - 342px); | |
| 101 | - bottom: 2px !important; | |
| 102 | - left: 0px !important; | |
| 103 | - background: #fff; | |
| 104 | - box-shadow: 0 8px 17px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); | |
| 105 | - border: 1px solid #bfbcbc;*/ | |
| 106 | 97 | |
| 107 | 98 | position: absolute !important; |
| 108 | - height: 124px; | |
| 99 | + height: 256px; | |
| 109 | 100 | bottom: 2px !important; |
| 110 | 101 | background: #fff; |
| 111 | 102 | box-shadow: 0 8px 17px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); |
| ... | ... | @@ -247,7 +238,7 @@ input[type=checkbox].disabled{ |
| 247 | 238 | } |
| 248 | 239 | |
| 249 | 240 | .gps_info_win p{ |
| 250 | - margin: 9px 0; | |
| 241 | + margin: 6px 0; | |
| 251 | 242 | font-size: 13px; |
| 252 | 243 | } |
| 253 | 244 | |
| ... | ... | @@ -452,4 +443,132 @@ input[type=checkbox].disabled{ |
| 452 | 443 | |
| 453 | 444 | #spatial-tree-content .jstree-default .jstree-anchor{ |
| 454 | 445 | font-size: 13px; |
| 455 | -} | |
| 456 | 446 | \ No newline at end of file |
| 447 | +} | |
| 448 | + | |
| 449 | +#map-playback-modal .uk-modal-dialog{ | |
| 450 | + width: 600px; | |
| 451 | +} | |
| 452 | + | |
| 453 | +#map-playback-modal .play-back-run-modal{ | |
| 454 | + transition: all .5s ease; | |
| 455 | + width: 1400px; | |
| 456 | + max-width: 90%; | |
| 457 | +} | |
| 458 | + | |
| 459 | +.play-back-run-modal>h1{ | |
| 460 | + transition: all .7s ease; | |
| 461 | + font-size: 22px; | |
| 462 | + line-height: 22px; | |
| 463 | +} | |
| 464 | + | |
| 465 | +#playback_run_body{ | |
| 466 | + height: 680px; | |
| 467 | + max-height: 780px; | |
| 468 | +} | |
| 469 | + | |
| 470 | +#playback_run_body .pb_footer_tools{ | |
| 471 | + animation-delay: .1s; | |
| 472 | + position: absolute; | |
| 473 | + width: 100%; | |
| 474 | + height: 68px; | |
| 475 | + background: #ffffff; | |
| 476 | + bottom: 0; | |
| 477 | + margin-left: -20px; | |
| 478 | + box-shadow: 1px 0px 5px 0 rgba(0,0,0,0.16), -1px 0px 10px 0 rgba(0,0,0,0.12); | |
| 479 | +} | |
| 480 | + | |
| 481 | +#playback_run_body .pb_footer_tools .uk-progress{ | |
| 482 | + width: 75%; | |
| 483 | + margin: 25px 15px 0 1%; | |
| 484 | + cursor: pointer; | |
| 485 | +} | |
| 486 | + | |
| 487 | +#playback_run_body .pb_footer_tools>div{ | |
| 488 | + display: inline-block; | |
| 489 | +} | |
| 490 | + | |
| 491 | +.pb_tools_icon{ | |
| 492 | + vertical-align: top; | |
| 493 | + font-size: 32px; | |
| 494 | + margin: 15px 5px 0 5px; | |
| 495 | +} | |
| 496 | + | |
| 497 | +.pb_tools_icon i{ | |
| 498 | + cursor: pointer; | |
| 499 | +} | |
| 500 | + | |
| 501 | +.pb_log_panel{ | |
| 502 | + animation-delay: .1s; | |
| 503 | + position: absolute; | |
| 504 | + width: 300px; | |
| 505 | + height: 600px; | |
| 506 | + background: white; | |
| 507 | + right: 0; | |
| 508 | + bottom: 80px; | |
| 509 | + box-shadow: 1px 0px 5px 0 rgba(0,0,0,0.16), -1px 0px 10px 0 rgba(0,0,0,0.12); | |
| 510 | +} | |
| 511 | + | |
| 512 | +#playback_run_body .map_wrap{ | |
| 513 | + height: 100%; | |
| 514 | + width: calc(100% + 40px); | |
| 515 | + margin-left: -20px; | |
| 516 | +} | |
| 517 | + | |
| 518 | + | |
| 519 | +.pb_log_panel .ct_table dl dt:nth-of-type(1), .pb_log_panel .ct_table dl dd:nth-of-type(1) { | |
| 520 | + width: 24%; | |
| 521 | +} | |
| 522 | +.pb_log_panel .ct_table dl dt:nth-of-type(2), .pb_log_panel .ct_table dl dd:nth-of-type(2) { | |
| 523 | + width: 14%; | |
| 524 | +} | |
| 525 | +.pb_log_panel .ct_table dl dt:nth-of-type(3), .pb_log_panel .ct_table dl dd:nth-of-type(3) { | |
| 526 | + width: 44%; | |
| 527 | +} | |
| 528 | +.pb_log_panel .ct_table dl dt:nth-of-type(4), .pb_log_panel .ct_table dl dd:nth-of-type(4) { | |
| 529 | + width: 16%; | |
| 530 | +} | |
| 531 | + | |
| 532 | +.pb_log_panel .ct_table .ct_table_body dl:last-child dd{ | |
| 533 | + border-bottom: 1px solid #dedede; | |
| 534 | +} | |
| 535 | + | |
| 536 | +.ui-slider-tip{ | |
| 537 | + position: absolute; | |
| 538 | + visibility: hidden; | |
| 539 | + bottom: 50px; | |
| 540 | + display: block; | |
| 541 | + width: 54px; | |
| 542 | + height: 20px; | |
| 543 | + line-height: 20px; | |
| 544 | + background: white; | |
| 545 | + border-radius: 3px; | |
| 546 | + box-shadow: 0 0 3px rgba(0, 0, 0, 0.72); | |
| 547 | + text-align: center; | |
| 548 | + font-size: 12px; | |
| 549 | + /*opacity: 0;*/ | |
| 550 | + /*transition: all .3s ease;*/ | |
| 551 | + color: #333; | |
| 552 | +} | |
| 553 | + | |
| 554 | +.ui-slider-tip:after{ | |
| 555 | + content: " "; | |
| 556 | + width: 0; | |
| 557 | + height: 0; | |
| 558 | + border: 5px solid rgba(255, 255, 255, 0); | |
| 559 | + border-top-color: #d3d3d3; | |
| 560 | + position: absolute; | |
| 561 | + bottom: -10px; | |
| 562 | + left: 50%; | |
| 563 | + margin-left: -5px; | |
| 564 | +} | |
| 565 | + | |
| 566 | +/* | |
| 567 | +.pb_log_item>div{ | |
| 568 | + display: inline-block; | |
| 569 | +}*/ | |
| 570 | + | |
| 571 | +/* | |
| 572 | +.pb_tools_icon i:hover{ | |
| 573 | + color: #787676; | |
| 574 | + box-shadow: 1px 0px 5px 0 rgba(0,0,0,0.16), -1px 0px 10px 0 rgba(0,0,0,0.12); | |
| 575 | +}*/ | ... | ... |
src/main/resources/static/real_control_v2/mapmonitor/fragments/map_config.html
| ... | ... | @@ -23,10 +23,17 @@ |
| 23 | 23 | <span class="uk-form-label">车辆图标</span> |
| 24 | 24 | <div class="uk-form-controls"> |
| 25 | 25 | <label><input name="carIcon_angle" type="checkbox" {{if carIcon.angle}}checked{{/if}}> 标示角度</label> |
| 26 | - <label><input class="disabled" disabled type="checkbox" {{if carIcon.converge}}checked{{/if}}> 聚合</label> | |
| 26 | + <!--<label><input class="disabled" disabled type="checkbox" {{if carIcon.converge}}checked{{/if}}> 聚合</label>--> | |
| 27 | + </div> | |
| 28 | + </div> | |
| 29 | + <div class="uk-form-row"> | |
| 30 | + <span class="uk-form-label">异常警报</span> | |
| 31 | + <div class="uk-form-controls"> | |
| 32 | + <label><input type="checkbox" {{if abnormalPrint.speeding}}checked{{/if}}> 超速</label> | |
| 33 | + <label><input type="checkbox" {{if abnormalPrint.outBounds}}checked{{/if}}> 越界</label> | |
| 34 | + <label><input type="checkbox" {{if abnormalPrint.largeMargin}}checked{{/if}}> 大间隔</label> | |
| 27 | 35 | </div> |
| 28 | 36 | </div> |
| 29 | - | |
| 30 | 37 | <div class="uk-form-row"> |
| 31 | 38 | <span class="uk-form-label">车辆颜色</span> |
| 32 | 39 | <div class="uk-form-controls"> |
| ... | ... | @@ -71,15 +78,6 @@ |
| 71 | 78 | </div> |
| 72 | 79 | </div> |
| 73 | 80 | </div> |
| 74 | - | |
| 75 | - <div class="uk-form-row"> | |
| 76 | - <span class="uk-form-label">异常警报输出</span> | |
| 77 | - <div class="uk-form-controls"> | |
| 78 | - <label><input class="disabled" disabled type="checkbox" {{if abnormalPrint.speeding}}checked{{/if}}> 超速</label> | |
| 79 | - <label><input class="disabled" disabled type="checkbox" {{if abnormalPrint.outBounds}}checked{{/if}}> 越界</label> | |
| 80 | - <label><input class="disabled" disabled type="checkbox" {{if abnormalPrint.largeMargin}}checked{{/if}}> 大间隔</label> | |
| 81 | - </div> | |
| 82 | - </div> | |
| 83 | 81 | </form> |
| 84 | 82 | </script> |
| 85 | 83 | </div> | ... | ... |
src/main/resources/static/real_control_v2/mapmonitor/fragments/map_infowindow.html
| 1 | 1 | <div> |
| 2 | 2 | <script id="map-win-gps-detail-temp" type="text/html"> |
| 3 | - <div class="gps_info_win"> | |
| 3 | + <div class="gps_info_win" style="width: 200px;"> | |
| 4 | 4 | <h4>{{nbbm}}</h4> |
| 5 | 5 | <h5> |
| 6 | 6 | {{lineName}} |
| 7 | - ({{if stationName!=null}} | |
| 8 | - {{stationName}} | |
| 7 | + </h5> | |
| 8 | + <h5> | |
| 9 | + {{if stationName!=null}} | |
| 10 | + {{stationName}} 站 | |
| 9 | 11 | {{else}} |
| 10 | 12 | 未知站点 |
| 11 | - {{/if}}) | |
| 13 | + {{/if}} | |
| 12 | 14 | </h5> |
| 15 | + <p>设备状态:正常</p> | |
| 16 | + <p>设备号:{{deviceId}}</p> | |
| 13 | 17 | <p>速度:{{speed}}</p> |
| 14 | 18 | <p>角度:{{direction}}</p> |
| 15 | 19 | <p>经度:{{lon}}</p> |
| ... | ... | @@ -20,7 +24,7 @@ |
| 20 | 24 | {{if expectStopTime!=null}} |
| 21 | 25 | <a href="javascript:;" style="color: #07D;margin-right: 7px;">预计 {{expectStopTime}} 分钟到达终点</a> |
| 22 | 26 | {{/if}} |
| 23 | - <a href="javascript:;" style="float: right;">轨迹回放</a> | |
| 27 | + <a href="javascript:;" style="float: right;" onclick="javascript:gb_map_play_back.initParams('{{deviceId}}', '{{nbbm}}');">轨迹回放</a> | |
| 24 | 28 | </div> |
| 25 | 29 | </script> |
| 26 | 30 | ... | ... |
src/main/resources/static/real_control_v2/mapmonitor/fragments/playback/before_form.html
0 → 100644
| 1 | +<div class="uk-alert uk-alert-success">开始~结束时间最大间隔24小时</div> | |
| 2 | +<div style="width: 68%;margin: auto;" id="playback_before_form"> | |
| 3 | + <form class="uk-form uk-form-horizontal" style="margin-bottom: 0 !important;"> | |
| 4 | + <div class="uk-grid"> | |
| 5 | + <div class="uk-width-1-1"> | |
| 6 | + <div class="uk-form-row"> | |
| 7 | + <label class="uk-form-label">车辆编码</label> | |
| 8 | + <div class="uk-form-controls"> | |
| 9 | + <div class="uk-autocomplete uk-form autocomplete-nbbm"> | |
| 10 | + <input name="nbbm" required/> | |
| 11 | + </div> | |
| 12 | + </div> | |
| 13 | + </div> | |
| 14 | + </div> | |
| 15 | + </div> | |
| 16 | + <div class="uk-grid"> | |
| 17 | + <div class="uk-width-2-3"> | |
| 18 | + <div class="uk-form-row"> | |
| 19 | + <label class="uk-form-label">开始时间</label> | |
| 20 | + <div class="uk-form-controls"> | |
| 21 | + <input name="sDate" type="date" required/> | |
| 22 | + </div> | |
| 23 | + </div> | |
| 24 | + </div> | |
| 25 | + <div class="uk-width-1-3" style="padding-left: 15px;"> | |
| 26 | + <div class="uk-form-row"> | |
| 27 | + <div class="uk-form-controls" style="margin-left: 0;"> | |
| 28 | + <input name="sTime" type="time" required/> | |
| 29 | + </div> | |
| 30 | + </div> | |
| 31 | + </div> | |
| 32 | + </div> | |
| 33 | + <div class="uk-grid"> | |
| 34 | + <div class="uk-width-2-3"> | |
| 35 | + <div class="uk-form-row"> | |
| 36 | + <label class="uk-form-label">结束时间</label> | |
| 37 | + <div class="uk-form-controls"> | |
| 38 | + <input name="eDate" type="date" required/> | |
| 39 | + </div> | |
| 40 | + </div> | |
| 41 | + </div> | |
| 42 | + <div class="uk-width-1-3" style="padding-left: 15px;"> | |
| 43 | + <div class="uk-form-row"> | |
| 44 | + <div class="uk-form-controls" style="margin-left: 0;"> | |
| 45 | + <input name="eTime" type="time" required/> | |
| 46 | + </div> | |
| 47 | + </div> | |
| 48 | + </div> | |
| 49 | + </div> | |
| 50 | + | |
| 51 | + <div style="text-align: center;margin-top: 25px;"> | |
| 52 | + <button class="uk-button uk-button-large uk-button-primary" type="submit"><i | |
| 53 | + class="uk-icon-play-circle"> </i> 开始回放 | |
| 54 | + </button> | |
| 55 | + </div> | |
| 56 | + <i class="uk-icon-spinner uk-icon-spin" | |
| 57 | + style="font-size: 18px;color: rgb(213, 31, 31);position: absolute;bottom: 25px;left: calc(50% + 70px);display: none;"></i> | |
| 58 | + </form> | |
| 59 | + | |
| 60 | + <script> | |
| 61 | + (function () { | |
| 62 | + $('#playback_before_form').on('init_form', function (e, data) { | |
| 63 | + //车辆 autocomplete | |
| 64 | + $.get('/basic/cars', function (rs) { | |
| 65 | + gb_common.carAutocomplete($('#playback_before_form .autocomplete-nbbm'), rs); | |
| 66 | + }); | |
| 67 | + | |
| 68 | + if (data.nbbm) | |
| 69 | + $('[name=nbbm]', this).val(data.nbbm); | |
| 70 | + //默认时间 | |
| 71 | + var m = moment() | |
| 72 | + , rq = 'YYYY-MM-DD', sj = 'HH:mm'; | |
| 73 | + $('[name=eDate]', this).val(m.format(rq)); | |
| 74 | + $('[name=eTime]', this).val(m.format('HH:mm')); | |
| 75 | + $('[name=sDate]', this).val(m.subtract(2, 'hour').format(rq)); | |
| 76 | + $('[name=sTime]', this).val(m.format(sj)); | |
| 77 | + | |
| 78 | + //test | |
| 79 | + $('[name=nbbm]', this).val('W9H-003'); | |
| 80 | + $('[name=eDate]', this).val('2016-12-10'); | |
| 81 | + $('[name=eTime]', this).val('09:00'); | |
| 82 | + $('[name=sDate]', this).val('2016-12-10'); | |
| 83 | + $('[name=sTime]', this).val('07:00'); | |
| 84 | + }); | |
| 85 | + | |
| 86 | + var ONE_DAY = 1000 * 60 * 60 * 24; | |
| 87 | + var f = $('form', '#playback_before_form').formValidation({ | |
| 88 | + framework: 'uikit', | |
| 89 | + locale: 'zh_CN' | |
| 90 | + }); | |
| 91 | + f.on('success.form.fv', function (e) { | |
| 92 | + e.preventDefault(); | |
| 93 | + disabledBtn(); | |
| 94 | + var data = $(this).serializeJSON(); | |
| 95 | + | |
| 96 | + //校验时间间隔 | |
| 97 | + var fs = 'YYYY-MM-DDHH:mm'; | |
| 98 | + var st = moment(data.sDate + data.sTime, fs).format('X'); | |
| 99 | + var et = moment(data.eDate + data.eTime, fs).format('X'); | |
| 100 | + | |
| 101 | + if (et < st) | |
| 102 | + return abortSubmit('结束时间小于开始时间???'); | |
| 103 | + else if ((et - st) > ONE_DAY) | |
| 104 | + return abortSubmit('时间间隔不能超过24小时!'); | |
| 105 | + else if (et == st) | |
| 106 | + return abortSubmit('一点时间间隔都不给???'); | |
| 107 | + | |
| 108 | + $('#playback_before_form i.uk-icon-spinner').show(); | |
| 109 | + $.ajax({ | |
| 110 | + url: '/gps/gpsHistory/multiple', | |
| 111 | + traditional: true, | |
| 112 | + data: {nbbmArray: [data.nbbm], st: st, et: et}, | |
| 113 | + success: function (rs) { | |
| 114 | + if (!rs || rs.length == 0) | |
| 115 | + return abortSubmit('失败,服务器没有返回轨迹数据!'); | |
| 116 | + | |
| 117 | + //排序 | |
| 118 | + rs.sort(function (a, b) { | |
| 119 | + return a.timestamp - b.timestamp; | |
| 120 | + }); | |
| 121 | + //格式化时间 | |
| 122 | + $.each(rs, function () { | |
| 123 | + var mom = moment(this.timestamp); | |
| 124 | + this.timeStr = mom.format('HH:mm.ss'); | |
| 125 | + this.timeStr2 = mom.format('YYYY-MM-DD HH:mm.ss'); | |
| 126 | + }); | |
| 127 | + | |
| 128 | + //获取路段信息 | |
| 129 | + if (!rs[0] || !rs[0].lineId) | |
| 130 | + return notify_err('首个点位无效....'); | |
| 131 | + | |
| 132 | + jsQueryRoads(rs[0].lineId, function (roads) { | |
| 133 | + //gps关联到路段 | |
| 134 | + matchRoad(rs, roads); | |
| 135 | + | |
| 136 | + var f = $('#playback_before_form'); | |
| 137 | + var fileName = $('[name=nbbm]', f).val() + '轨迹数据' | |
| 138 | + + $('[name=sDate]', f).val() + $('[name=sTime]', f).val() + '至' | |
| 139 | + + $('[name=eDate]', f).val() + $('[name=eTime]', f).val() + '.xls'; | |
| 140 | + | |
| 141 | + $('#playback_before_form').parents('.uk-modal').trigger('show_play_body', { | |
| 142 | + gpsList: rs, | |
| 143 | + roads: roads, | |
| 144 | + lineCode: rs[0].lineId, | |
| 145 | + fileName: fileName.replace(new RegExp(/-/g),'').replace(new RegExp(/:/g),'') | |
| 146 | + }); | |
| 147 | + }); | |
| 148 | + } | |
| 149 | + }); | |
| 150 | + }); | |
| 151 | + | |
| 152 | + function abortSubmit(t) { | |
| 153 | + $('#playback_before_form i.uk-icon-spinner').hide(); | |
| 154 | + notify_err(t); | |
| 155 | + $('form button[type=submit]', '#playback_before_form').removeClass('disabled').removeAttr('disabled'); | |
| 156 | + } | |
| 157 | + | |
| 158 | + function disabledBtn() { | |
| 159 | + $('form button[type=submit]', '#playback_before_form').addClass('disabled').attr('disabled', 'disabled'); | |
| 160 | + } | |
| 161 | + | |
| 162 | + function jsQueryRoads(lineCode, cb) { | |
| 163 | + gb_common.$get('/gps/findRoadSpeed', {lineCode: lineCode}, function (rs) { | |
| 164 | + //处理路段坐标集合 | |
| 165 | + var roads = rs.roads; | |
| 166 | + var cds, coordArray, array; | |
| 167 | + | |
| 168 | + for (var i = 0, road; road = roads[i++];) { | |
| 169 | + cds = road['GROAD_VECTOR']; | |
| 170 | + cds = cds.substring(11, cds.length - 1); | |
| 171 | + coordArray = cds.split(','); | |
| 172 | + | |
| 173 | + array = []; | |
| 174 | + | |
| 175 | + for (var j = 0, cd; cd = coordArray[j++];) { | |
| 176 | + var cdArray = cd.split(' '); | |
| 177 | + | |
| 178 | + //wgs84 to baidu | |
| 179 | + var bdCd = TransGPS.wgsToBD(parseFloat(cdArray[1]), parseFloat(cdArray[0])); | |
| 180 | + array.push({ | |
| 181 | + longitude: bdCd.lng, | |
| 182 | + latitude: bdCd.lat | |
| 183 | + }); | |
| 184 | + } | |
| 185 | + road.coords = array; | |
| 186 | + } | |
| 187 | + cb && cb(roads); | |
| 188 | + }); | |
| 189 | + } | |
| 190 | + | |
| 191 | + | |
| 192 | + function matchRoad(gpsArray, roads) { | |
| 193 | + var rs; | |
| 194 | + $.each(gpsArray, function () { | |
| 195 | + rs = gpsMatchRoad(this, roads); | |
| 196 | + this.road = rs.road; | |
| 197 | + this.minDistance = rs.min; | |
| 198 | + }); | |
| 199 | + } | |
| 200 | + | |
| 201 | + function gpsMatchRoad(gps, roads) { | |
| 202 | + var point = {latitude: gps.bd_lat, longitude: gps.bd_lon}; | |
| 203 | + | |
| 204 | + var min, road; | |
| 205 | + $.each(roads, function () { | |
| 206 | + | |
| 207 | + var len = this.coords.length; | |
| 208 | + for (var i = 0; i < len - 1; i++) { | |
| 209 | + //点到线的距离 | |
| 210 | + var distance = geolib.getDistanceFromLine(point, this.coords[i], this.coords[i + 1]); | |
| 211 | + if (min > distance || min == null) { | |
| 212 | + min = distance; | |
| 213 | + road = this; | |
| 214 | + } | |
| 215 | + } | |
| 216 | + }); | |
| 217 | + | |
| 218 | + return {road: road, min: min}; | |
| 219 | + } | |
| 220 | + })(); | |
| 221 | + </script> | |
| 222 | +</div> | |
| 0 | 223 | \ No newline at end of file | ... | ... |
src/main/resources/static/real_control_v2/mapmonitor/fragments/playback/main.html
0 → 100644
| 1 | +<div class="uk-modal ct-form-modal" id="map-playback-modal"> | |
| 2 | + <div class="uk-modal-dialog" > | |
| 3 | + <a href="" class="uk-modal-close uk-close"></a> | |
| 4 | + <h1>轨迹回放</h1> | |
| 5 | + <div class="pb_modal_body"></div> | |
| 6 | + </div> | |
| 7 | + <script> | |
| 8 | + (function () { | |
| 9 | + var modal = '#map-playback-modal'; | |
| 10 | + | |
| 11 | + $(modal).on('show_form', function (e, data) { | |
| 12 | + $('.pb_modal_body', modal).load('/real_control_v2/mapmonitor/fragments/playback/before_form.html', function () { | |
| 13 | + $('#playback_before_form', modal).trigger('init_form', data); | |
| 14 | + }); | |
| 15 | + }); | |
| 16 | + | |
| 17 | + //show播放界面 | |
| 18 | + $(modal).on('show_play_body', function (e, data) { | |
| 19 | + $('.pb_modal_body', modal).empty(); | |
| 20 | + $('.uk-modal-dialog', modal).addClass('play-back-run-modal').one('transitionend', function () { | |
| 21 | + //最小宽度 | |
| 22 | + $(this).css('min-width', '1280px'); | |
| 23 | + }); | |
| 24 | + $('.pb_modal_body', modal).load('/real_control_v2/mapmonitor/fragments/playback/run.html', function () { | |
| 25 | + $('#playback_run_body', modal).trigger('init', data); | |
| 26 | + }); | |
| 27 | + }); | |
| 28 | + })(); | |
| 29 | + </script> | |
| 30 | +</div> | ... | ... |
src/main/resources/static/real_control_v2/mapmonitor/fragments/playback/run.html
0 → 100644
| 1 | +<div id="playback_run_body"> | |
| 2 | + <div class="map_wrap"></div> | |
| 3 | + <!-- 日志输出 --> | |
| 4 | + <div class="pb_log_panel uk-animation-slide-right" style="overflow: auto;"> | |
| 5 | + <div class="ct_table" style="height: calc(100% - 30px);"> | |
| 6 | + <div class="ct_table_head"> | |
| 7 | + <dl> | |
| 8 | + <dt>时间</dt> | |
| 9 | + <dt>速度</dt> | |
| 10 | + <dt>路段</dt> | |
| 11 | + <dt>状态</dt> | |
| 12 | + </dl> | |
| 13 | + </div> | |
| 14 | + <div class="ct_table_body"> | |
| 15 | + </div> | |
| 16 | + </div> | |
| 17 | + </div> | |
| 18 | + <div class="pb_footer_tools uk-animation-slide-bottom" onselectstart="return false;" style="-moz-user-select:none;"> | |
| 19 | + <span class="ui-slider-tip">08:30.50</span> | |
| 20 | + <div class="uk-progress uk-progress-small uk-progress-success uk-progress-striped"> | |
| 21 | + <div class="uk-progress-bar" style="width: 0;"></div> | |
| 22 | + </div> | |
| 23 | + | |
| 24 | + <div class="pb_tools_icon"> | |
| 25 | + <div class="uk-button-group"> | |
| 26 | + <a class="uk-button" data-uk-tooltip title="快退" data-type="rewind"><i class="uk-icon-fast-backward"></i></a> | |
| 27 | + <a class="uk-button" data-uk-tooltip title="停止" data-type="stop"><i class="uk-icon-stop"></i></a> | |
| 28 | + <a class="uk-button play-btn" data-type="play"><i class="uk-icon-play"></i></a> | |
| 29 | + <a class="uk-button" data-uk-tooltip title="快进" data-type="fast_forward"><i class="uk-icon-fast-forward"></i></a> | |
| 30 | + </div> | |
| 31 | + </div> | |
| 32 | + | |
| 33 | + <div class="pb_tools_icon"> | |
| 34 | + <div class="uk-button-dropdown" data-uk-dropdown="{mode:'hover', pos:'top-left'}"> | |
| 35 | + <button class="uk-button"><i class="uk-icon-cog"> </i> 工具 <i class="uk-icon-caret-down"></i></button> | |
| 36 | + <div class="uk-dropdown uk-dropdown-bottom uk-dropdown-small" style="top: 30px; left: 0px;"> | |
| 37 | + <ul class="uk-nav uk-nav-dropdown pb_dropdown_tool"> | |
| 38 | + <!--<li><a>显示站点</a></li> | |
| 39 | + <li><a>显示电子围栏</a></li> | |
| 40 | + <li class="uk-nav-divider"></li> | |
| 41 | + <li><a>关闭日志输出</a></li> | |
| 42 | + <li class="uk-nav-divider"></li>--> | |
| 43 | + <li><a data-name="exportExcel" href="javascript:;" >导出轨迹</a></li> | |
| 44 | + </ul> | |
| 45 | + </div> | |
| 46 | + </div> | |
| 47 | + </div> | |
| 48 | + </div> | |
| 49 | + | |
| 50 | + <script> | |
| 51 | + (function () { | |
| 52 | + | |
| 53 | + var logTemp = template.compile('{{each list as gps i}}<dl data-code="{{gps.road.ROAD_CODE}}">' + | |
| 54 | + '<dd>{{gps.timeStr}}</dd>' + | |
| 55 | + '<dd>{{gps.speed}}</dd>' + | |
| 56 | + '<dd>{{gps.road.ROAD_NAME}}</dd><dd>正常</dd></dl>{{/each}}'); | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + var _body = '#playback_run_body' | |
| 61 | + , map, gpsArray, roads, marker, width, trailArray = [], trailPolyline; | |
| 62 | + | |
| 63 | + var upRoutePos = [], downRoutePos = []; | |
| 64 | + var storage = window.localStorage; | |
| 65 | + var lineCode; | |
| 66 | + | |
| 67 | + //进度条 | |
| 68 | + var progress = $('.pb_footer_tools .uk-progress', _body); | |
| 69 | + var bar = $('.uk-progress-bar', progress); | |
| 70 | + var step; | |
| 71 | + var prsTip = $('.ui-slider-tip', _body); | |
| 72 | + progress.mousemove(function (e) { | |
| 73 | + var x = e.offsetX; | |
| 74 | + var i = parseInt(x / step); | |
| 75 | + var time = moment(gpsArray[i].timestamp).format('HH:mm.ss'); | |
| 76 | + | |
| 77 | + prsTip.text(time).css('left', x - 11).css('visibility', 'visible'); | |
| 78 | + }).mouseout(function () { | |
| 79 | + prsTip.css('visibility', 'hidden') | |
| 80 | + }).on('click', function (e) { | |
| 81 | + var x = e.offsetX; | |
| 82 | + goto(parseInt(x / step)); | |
| 83 | + }); | |
| 84 | + | |
| 85 | + $(_body).on('init', function (e, data) { | |
| 86 | + roads = data.roads; | |
| 87 | + lineCode = data.lineCode; | |
| 88 | + | |
| 89 | + setTimeout(function () { | |
| 90 | + initMap(data.gpsList); | |
| 91 | + len = gpsArray.length; | |
| 92 | + step = progress.width() / gpsArray.length; | |
| 93 | + }, 600); | |
| 94 | + | |
| 95 | + //导出的文件名 | |
| 96 | + $('a[data-name=exportExcel]').attr('download', data.fileName); | |
| 97 | + }); | |
| 98 | + | |
| 99 | + $('.pb_tools_icon a.uk-button', _body).on('click', function () { | |
| 100 | + var type = $(this).data('type'); | |
| 101 | + switch (type) { | |
| 102 | + case 'play': | |
| 103 | + play(); | |
| 104 | + break; | |
| 105 | + case 'pause': | |
| 106 | + pause(); | |
| 107 | + break; | |
| 108 | + case 'fast_forward': | |
| 109 | + goto(index + 10); | |
| 110 | + break; | |
| 111 | + case 'rewind': | |
| 112 | + goto(index - 10); | |
| 113 | + break; | |
| 114 | + case 'stop': | |
| 115 | + pause(); | |
| 116 | + break; | |
| 117 | + } | |
| 118 | + }); | |
| 119 | + | |
| 120 | + $('.pb_dropdown_tool li a', _body).on('click', function () { | |
| 121 | + var name = $(this).data('name'); | |
| 122 | + switch (name) { | |
| 123 | + case 'exportExcel': | |
| 124 | + var base64Str = gb_map_play_back.listToExcel(gpsArray); | |
| 125 | + $(this).attr('href', base64Str); | |
| 126 | + break; | |
| 127 | + } | |
| 128 | + }); | |
| 129 | + | |
| 130 | + function goto(ei) { | |
| 131 | + if(ei < 0 || ei >= len) | |
| 132 | + return; | |
| 133 | + | |
| 134 | + bar.css('width', ei * step); | |
| 135 | + var gps = gpsArray[ei]; | |
| 136 | + //重新定位marker | |
| 137 | + try { | |
| 138 | + drawLine(gps.direction); | |
| 139 | + } catch (e) { | |
| 140 | + console.log(e); | |
| 141 | + } | |
| 142 | + var point = new BMap.Point(gps.bd_lon, gps.bd_lat); | |
| 143 | + marker.setPosition(point); | |
| 144 | + marker.setIcon(new BMap.Icon(gb_map_imap.createCarIconRotation(gps, width), new BMap.Size(width, 75))); | |
| 145 | + | |
| 146 | + //重新填充轨迹线,更新日志面板 | |
| 147 | + trailArray = []; | |
| 148 | + var logs = []; | |
| 149 | + for (var i = 0; i <= ei; i++) { | |
| 150 | + trailArray.push(new BMap.Point(gpsArray[i].bd_lon, gpsArray[i].bd_lat)); | |
| 151 | + if(i > 0 && logs[logs.length - 1].road.ROAD_CODE == gpsArray[i].road.ROAD_CODE) | |
| 152 | + logs.pop(); | |
| 153 | + | |
| 154 | + logs.push(gpsArray[i]); | |
| 155 | + } | |
| 156 | + trailPolyline.setPath(trailArray); | |
| 157 | + | |
| 158 | + index = ei; | |
| 159 | + map.panTo(marker.getPosition()); | |
| 160 | + //更新日志面板 | |
| 161 | + logPanel.empty().html(logTemp({list: logs})); | |
| 162 | + logWrap.scrollTop(logWrap[0].scrollHeight); | |
| 163 | + } | |
| 164 | + | |
| 165 | + //播放 | |
| 166 | + function play() { | |
| 167 | + $('.play-btn', _body) | |
| 168 | + .data('type', 'pause') | |
| 169 | + .find('i') | |
| 170 | + .removeClass('uk-icon-play') | |
| 171 | + .addClass('uk-icon-pause'); | |
| 172 | + pauseFlag = false; | |
| 173 | + progress.addClass('uk-active'); | |
| 174 | + run(); | |
| 175 | + | |
| 176 | + //定时居中 | |
| 177 | + fixedToCenter(); | |
| 178 | + } | |
| 179 | + | |
| 180 | + var toCenterTimer; | |
| 181 | + | |
| 182 | + function fixedToCenter() { | |
| 183 | + toCenterTimer = setInterval(function () { | |
| 184 | + map.panTo(marker.getPosition()); | |
| 185 | + }, 5000); | |
| 186 | + } | |
| 187 | + | |
| 188 | + //暂停 | |
| 189 | + var pauseFlag; | |
| 190 | + | |
| 191 | + function pause() { | |
| 192 | + $('.play-btn', _body) | |
| 193 | + .data('type', 'play') | |
| 194 | + .find('i') | |
| 195 | + .removeClass('uk-icon-pause') | |
| 196 | + .addClass('uk-icon-play'); | |
| 197 | + pauseFlag = true; | |
| 198 | + progress.removeClass('uk-active'); | |
| 199 | + clearInterval(toCenterTimer); | |
| 200 | + } | |
| 201 | + | |
| 202 | + var index = 1; | |
| 203 | + var len; | |
| 204 | + | |
| 205 | + function run() { | |
| 206 | + //暂停 | |
| 207 | + if (pauseFlag) { | |
| 208 | + pauseFlag = false; | |
| 209 | + return | |
| 210 | + } | |
| 211 | + //结束 | |
| 212 | + if (index >= len) { | |
| 213 | + bar.css('width', '100%') | |
| 214 | + pause(); | |
| 215 | + return; | |
| 216 | + } | |
| 217 | + | |
| 218 | + //marker 移动 | |
| 219 | + var gps = gpsArray[index]; | |
| 220 | + | |
| 221 | + //线路走向 | |
| 222 | + if (gps.direction != gpsArray[index - 1].direction || index == 1) | |
| 223 | + drawLine(gps.direction); | |
| 224 | + | |
| 225 | + var point = new BMap.Point(gps.bd_lon, gps.bd_lat); | |
| 226 | + marker.setPosition(point); | |
| 227 | + marker.setIcon(new BMap.Icon(gb_map_imap.createCarIconRotation(gps, width), new BMap.Size(width, 75))); | |
| 228 | + | |
| 229 | + //轨迹线 | |
| 230 | + trailArray.push(point); | |
| 231 | + trailPolyline.setPath(trailArray); | |
| 232 | + | |
| 233 | + //进度条 | |
| 234 | + bar.css('width', step * index); | |
| 235 | + | |
| 236 | + //日志输出 | |
| 237 | + logWrite(gps, gpsArray[index - 1]); | |
| 238 | + | |
| 239 | + index++; | |
| 240 | + setTimeout(run, 1000); | |
| 241 | + } | |
| 242 | + | |
| 243 | + //初始化地图 | |
| 244 | + function initMap(data) { | |
| 245 | + gpsArray = data; | |
| 246 | + var firstPoint = new BMap.Point(data[0].bd_lon, data[0].bd_lat); | |
| 247 | + map = new BMap.Map($('.map_wrap', _body)[0]); | |
| 248 | + map.centerAndZoom(firstPoint, 17); | |
| 249 | + map.enableScrollWheelZoom(); | |
| 250 | + | |
| 251 | + //创建车辆marker | |
| 252 | + marker = new BMap.Marker(firstPoint); | |
| 253 | + width = gb_map_imap.calcGpsMarkerWidth(data[0].nbbm); | |
| 254 | + //渲染icon | |
| 255 | + marker.setIcon(new BMap.Icon(gb_map_imap.createCarIconRotation(data[0], width), new BMap.Size(width, 75))); | |
| 256 | + marker.disableMassClear(); | |
| 257 | + map.addOverlay(marker); | |
| 258 | + | |
| 259 | + //线路图层 数据 | |
| 260 | + var routeCache = JSON.parse(storage.getItem(lineCode + '_route')); | |
| 261 | + upRoutePos = initRoutePosData(routeCache.up_bd); | |
| 262 | + downRoutePos = initRoutePosData(routeCache.down_bd); | |
| 263 | + | |
| 264 | + trailArray.push(firstPoint); | |
| 265 | + drawTrailLine(); | |
| 266 | + //输出第一个点 | |
| 267 | + logWrite(data[0], null); | |
| 268 | + } | |
| 269 | + | |
| 270 | + function drawTrailLine() { | |
| 271 | + trailPolyline = new BMap.Polyline(trailArray, {strokeWeight: 3, strokeColor: 'black'}); | |
| 272 | + map.addOverlay(trailPolyline); | |
| 273 | + } | |
| 274 | + | |
| 275 | + function initRoutePosData(routeStr) { | |
| 276 | + var array = [], temps; | |
| 277 | + $.each(routeStr, function (i, item) { | |
| 278 | + var pos = []; | |
| 279 | + $.each(item.split(','), function () { | |
| 280 | + temps = this.split(' '); | |
| 281 | + pos.push(new BMap.Point(temps[0], temps[1])); | |
| 282 | + }); | |
| 283 | + array.push(pos); | |
| 284 | + }); | |
| 285 | + return array; | |
| 286 | + } | |
| 287 | + | |
| 288 | + function drawLine(updown) { | |
| 289 | + map.clearOverlays(); | |
| 290 | + | |
| 291 | + var pos = updown == 0 ? upRoutePos : downRoutePos; | |
| 292 | + $.each(pos, function () { | |
| 293 | + map.addOverlay(new BMap.Polyline(this, {strokeWeight: 12, strokeColor: 'rgba(0, 0, 255, 0.6)'})); | |
| 294 | + }); | |
| 295 | + | |
| 296 | + drawTrailLine(); | |
| 297 | + } | |
| 298 | + | |
| 299 | + //日志输出 | |
| 300 | + var logWrap = $('.pb_log_panel', _body); | |
| 301 | + var logPanel = $('.pb_log_panel .ct_table_body', _body); | |
| 302 | + gb_ct_table.fixedHead(logWrap); | |
| 303 | + | |
| 304 | + function logWrite(gps, prve) { | |
| 305 | + var code = gps.road.ROAD_CODE; | |
| 306 | + if (!prve || code != prve.road.ROAD_CODE) { | |
| 307 | + logPanel.append('<dl data-code="' + code + '" ><dd>' + gps.timeStr + '</dd><dd>' + gps.speed + '</dd><dd>' + gps.road.ROAD_NAME + '</dd><dd>正常</dd></dl>'); | |
| 308 | + } | |
| 309 | + else { | |
| 310 | + var dds = logPanel.find('dl[data-code=' + code + ']').last().find('dd'); | |
| 311 | + $(dds[0]).text(gps.timeStr); | |
| 312 | + $(dds[1]).text(gps.speed); | |
| 313 | + } | |
| 314 | + | |
| 315 | + logWrap.scrollTop(logWrap[0].scrollHeight); | |
| 316 | + } | |
| 317 | + })(); | |
| 318 | + </script> | |
| 319 | +</div> | |
| 0 | 320 | \ No newline at end of file | ... | ... |
src/main/resources/static/real_control_v2/mapmonitor/js/gps_tree.js
| ... | ... | @@ -43,7 +43,7 @@ var gb_map_gps_tree = (function () { |
| 43 | 43 | 'keep_selected_style': false, |
| 44 | 44 | 'whole_node': false, |
| 45 | 45 | 'tie_selection': false |
| 46 | - }, | |
| 46 | + }/*, | |
| 47 | 47 | 'contextmenu': { |
| 48 | 48 | 'items': { |
| 49 | 49 | '轨迹回放': { |
| ... | ... | @@ -59,12 +59,12 @@ var gb_map_gps_tree = (function () { |
| 59 | 59 | } |
| 60 | 60 | } |
| 61 | 61 | } |
| 62 | - }, | |
| 62 | + }*/, | |
| 63 | 63 | //local storage里的key |
| 64 | 64 | 'state': { |
| 65 | 65 | 'key': 'jstree_map_devices' |
| 66 | 66 | }, |
| 67 | - 'plugins': ['checkbox', 'contextmenu', 'state'] | |
| 67 | + 'plugins': ['checkbox'/*, 'contextmenu'*/, 'state'] | |
| 68 | 68 | }); |
| 69 | 69 | }; |
| 70 | 70 | ... | ... |
src/main/resources/static/real_control_v2/mapmonitor/js/map/iMap.js
| ... | ... | @@ -18,7 +18,7 @@ var gb_map_imap = (function () { |
| 18 | 18 | return; |
| 19 | 19 | if (maps[mapName]) { |
| 20 | 20 | //原地图 destroy |
| 21 | - if(currentMap){ | |
| 21 | + if (currentMap) { | |
| 22 | 22 | var oldMap = maps[currentMap].instance; |
| 23 | 23 | oldMap.destroy && oldMap.destroy(); |
| 24 | 24 | } |
| ... | ... | @@ -33,7 +33,7 @@ var gb_map_imap = (function () { |
| 33 | 33 | createCarIcon: createCarIcon, |
| 34 | 34 | busIcon: '/real_control_v2/assets/imgs/bus1-R.png', |
| 35 | 35 | _color: color, |
| 36 | - //createCarIcon_angle: createCarIcon_angle, | |
| 36 | + createCarIconRotation: createCarIconRotation, | |
| 37 | 37 | createStationIcon: createStationIcon, |
| 38 | 38 | call: function (f, opts) { |
| 39 | 39 | var instance = maps[currentMap].instance; |
| ... | ... | @@ -42,6 +42,18 @@ var gb_map_imap = (function () { |
| 42 | 42 | else |
| 43 | 43 | alertErr('当前地图实例不支持操作:' + f); |
| 44 | 44 | return mapProxy; |
| 45 | + }, | |
| 46 | + calcGpsMarkerWidth: function (nbbm) { | |
| 47 | + var width = 0; | |
| 48 | + $.each(nbbm.split(''), function () { | |
| 49 | + if (!isNaN(this)) | |
| 50 | + width += 7;//icon_num_width[this]; | |
| 51 | + else if (this == '-') | |
| 52 | + width += 10; | |
| 53 | + else | |
| 54 | + width += 16; | |
| 55 | + }); | |
| 56 | + return width; | |
| 45 | 57 | } |
| 46 | 58 | }; |
| 47 | 59 | |
| ... | ... | @@ -72,67 +84,102 @@ var gb_map_imap = (function () { |
| 72 | 84 | return canvas.toDataURL(); |
| 73 | 85 | } |
| 74 | 86 | |
| 75 | - //绘制车辆icon 带角度 | |
| 76 | -/* var busIcon='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAZCAYAAADE6YVjAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKTWlDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVN3WJP3Fj7f92UPVkLY8LGXbIEAIiOsCMgQWaIQkgBhhBASQMWFiApWFBURnEhVxILVCkidiOKgKLhnQYqIWotVXDjuH9yntX167+3t+9f7vOec5/zOec8PgBESJpHmomoAOVKFPDrYH49PSMTJvYACFUjgBCAQ5svCZwXFAADwA3l4fnSwP/wBr28AAgBw1S4kEsfh/4O6UCZXACCRAOAiEucLAZBSAMguVMgUAMgYALBTs2QKAJQAAGx5fEIiAKoNAOz0ST4FANipk9wXANiiHKkIAI0BAJkoRyQCQLsAYFWBUiwCwMIAoKxAIi4EwK4BgFm2MkcCgL0FAHaOWJAPQGAAgJlCLMwAIDgCAEMeE80DIEwDoDDSv+CpX3CFuEgBAMDLlc2XS9IzFLiV0Bp38vDg4iHiwmyxQmEXKRBmCeQinJebIxNI5wNMzgwAABr50cH+OD+Q5+bk4eZm52zv9MWi/mvwbyI+IfHf/ryMAgQAEE7P79pf5eXWA3DHAbB1v2upWwDaVgBo3/ldM9sJoFoK0Hr5i3k4/EAenqFQyDwdHAoLC+0lYqG9MOOLPv8z4W/gi372/EAe/tt68ABxmkCZrcCjg/1xYW52rlKO58sEQjFu9+cj/seFf/2OKdHiNLFcLBWK8ViJuFAiTcd5uVKRRCHJleIS6X8y8R+W/QmTdw0ArIZPwE62B7XLbMB+7gECiw5Y0nYAQH7zLYwaC5EAEGc0Mnn3AACTv/mPQCsBAM2XpOMAALzoGFyolBdMxggAAESggSqwQQcMwRSswA6cwR28wBcCYQZEQAwkwDwQQgbkgBwKoRiWQRlUwDrYBLWwAxqgEZrhELTBMTgN5+ASXIHrcBcGYBiewhi8hgkEQcgIE2EhOogRYo7YIs4IF5mOBCJhSDSSgKQg6YgUUSLFyHKkAqlCapFdSCPyLXIUOY1cQPqQ28ggMor8irxHMZSBslED1AJ1QLmoHxqKxqBz0XQ0D12AlqJr0Rq0Hj2AtqKn0UvodXQAfYqOY4DRMQ5mjNlhXIyHRWCJWBomxxZj5Vg1Vo81Yx1YN3YVG8CeYe8IJAKLgBPsCF6EEMJsgpCQR1hMWEOoJewjtBK6CFcJg4Qxwicik6hPtCV6EvnEeGI6sZBYRqwm7iEeIZ4lXicOE1+TSCQOyZLkTgohJZAySQtJa0jbSC2kU6Q+0hBpnEwm65Btyd7kCLKArCCXkbeQD5BPkvvJw+S3FDrFiOJMCaIkUqSUEko1ZT/lBKWfMkKZoKpRzame1AiqiDqfWkltoHZQL1OHqRM0dZolzZsWQ8ukLaPV0JppZ2n3aC/pdLoJ3YMeRZfQl9Jr6Afp5+mD9HcMDYYNg8dIYigZaxl7GacYtxkvmUymBdOXmchUMNcyG5lnmA+Yb1VYKvYqfBWRyhKVOpVWlX6V56pUVXNVP9V5qgtUq1UPq15WfaZGVbNQ46kJ1Bar1akdVbupNq7OUndSj1DPUV+jvl/9gvpjDbKGhUaghkijVGO3xhmNIRbGMmXxWELWclYD6yxrmE1iW7L57Ex2Bfsbdi97TFNDc6pmrGaRZp3mcc0BDsax4PA52ZxKziHODc57LQMtPy2x1mqtZq1+rTfaetq+2mLtcu0W7eva73VwnUCdLJ31Om0693UJuja6UbqFutt1z+o+02PreekJ9cr1Dund0Uf1bfSj9Rfq79bv0R83MDQINpAZbDE4Y/DMkGPoa5hpuNHwhOGoEctoupHEaKPRSaMnuCbuh2fjNXgXPmasbxxirDTeZdxrPGFiaTLbpMSkxeS+Kc2Ua5pmutG003TMzMgs3KzYrMnsjjnVnGueYb7ZvNv8jYWlRZzFSos2i8eW2pZ8ywWWTZb3rJhWPlZ5VvVW16xJ1lzrLOtt1ldsUBtXmwybOpvLtqitm63Edptt3xTiFI8p0in1U27aMez87ArsmuwG7Tn2YfYl9m32zx3MHBId1jt0O3xydHXMdmxwvOuk4TTDqcSpw+lXZxtnoXOd8zUXpkuQyxKXdpcXU22niqdun3rLleUa7rrStdP1o5u7m9yt2W3U3cw9xX2r+00umxvJXcM970H08PdY4nHM452nm6fC85DnL152Xlle+70eT7OcJp7WMG3I28Rb4L3Le2A6Pj1l+s7pAz7GPgKfep+Hvqa+It89viN+1n6Zfgf8nvs7+sv9j/i/4XnyFvFOBWABwQHlAb2BGoGzA2sDHwSZBKUHNQWNBbsGLww+FUIMCQ1ZH3KTb8AX8hv5YzPcZyya0RXKCJ0VWhv6MMwmTB7WEY6GzwjfEH5vpvlM6cy2CIjgR2yIuB9pGZkX+X0UKSoyqi7qUbRTdHF09yzWrORZ+2e9jvGPqYy5O9tqtnJ2Z6xqbFJsY+ybuIC4qriBeIf4RfGXEnQTJAntieTE2MQ9ieNzAudsmjOc5JpUlnRjruXcorkX5unOy553PFk1WZB8OIWYEpeyP+WDIEJQLxhP5aduTR0T8oSbhU9FvqKNolGxt7hKPJLmnVaV9jjdO31D+miGT0Z1xjMJT1IreZEZkrkj801WRNberM/ZcdktOZSclJyjUg1plrQr1zC3KLdPZisrkw3keeZtyhuTh8r35CP5c/PbFWyFTNGjtFKuUA4WTC+oK3hbGFt4uEi9SFrUM99m/ur5IwuCFny9kLBQuLCz2Lh4WfHgIr9FuxYji1MXdy4xXVK6ZHhp8NJ9y2jLspb9UOJYUlXyannc8o5Sg9KlpUMrglc0lamUycturvRauWMVYZVkVe9ql9VbVn8qF5VfrHCsqK74sEa45uJXTl/VfPV5bdra3kq3yu3rSOuk626s91m/r0q9akHV0IbwDa0b8Y3lG19tSt50oXpq9Y7NtM3KzQM1YTXtW8y2rNvyoTaj9nqdf13LVv2tq7e+2Sba1r/dd3vzDoMdFTve75TsvLUreFdrvUV99W7S7oLdjxpiG7q/5n7duEd3T8Wej3ulewf2Re/ranRvbNyvv7+yCW1SNo0eSDpw5ZuAb9qb7Zp3tXBaKg7CQeXBJ9+mfHvjUOihzsPcw83fmX+39QjrSHkr0jq/dawto22gPaG97+iMo50dXh1Hvrf/fu8x42N1xzWPV56gnSg98fnkgpPjp2Snnp1OPz3Umdx590z8mWtdUV29Z0PPnj8XdO5Mt1/3yfPe549d8Lxw9CL3Ytslt0utPa49R35w/eFIr1tv62X3y+1XPK509E3rO9Hv03/6asDVc9f41y5dn3m978bsG7duJt0cuCW69fh29u0XdwruTNxdeo94r/y+2v3qB/oP6n+0/rFlwG3g+GDAYM/DWQ/vDgmHnv6U/9OH4dJHzEfVI0YjjY+dHx8bDRq98mTOk+GnsqcTz8p+Vv9563Or59/94vtLz1j82PAL+YvPv655qfNy76uprzrHI8cfvM55PfGm/K3O233vuO+638e9H5ko/ED+UPPR+mPHp9BP9z7nfP78L/eE8/sl0p8zAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAOgSURBVHjarJZfSCNXFMZ/mWgwmq5KyBKcNBaiMTAKCYbUQPdFEFrXat+EMkhhxXbZbfsgfS0UH4uFhba01tKieVgfWjZLurS7rA9VREWrBYVoLJVZBwIxq8WY+Ic0feg4GE1iq3vgcjnn3Pm+e++5c84xjI+PU0LMwE2gG2gFRKAa+AtQgEXgJ21kioGUFbGbgA+Bj5xOp83hcGC1WqmsrKS8vJzj4+Pq/f39lmQy2aKq6juKosSBz4B7wNFZMEOBkziBiMfjafF4PFgsFi6SVCpFNBolGo0uA12AetovnFkfABZ8Pl+L3+//TwQAFosFv9+P1+v1Akva1RYkcQLhYDBokySJy0hzczNtbW02IKLh5cXECIR9Pp/d5XJx/9c/eDC7yfO9w3NARsFAY101778p0VhXfc7f0NDA4eGhfWlpKQz4gewJyYDb7fZKksQ3v0QZuv9byR2vKjs8/V3l8VAnorXqnF+SJFKplDcWi90CRgTtJX3sdrsB+P7pOntbq2QP9/V55O4NlO/e1sdXd15jL3PMjzObOvD09HQekYb3CWASgA5RFO01NTUAPEukOM7skfs7q8+vt76cB9Dp//e61ef7um1wcJCJiQldr62tRRRFO9AhAN0Oh4OrSjabpa+vj8nJSd2m4XYLQKvVauVFyNHRET09PczPzwOg4bYKgGg2m0t+/PPiszz90YJS8sfs6upibW2NiooKAHsZYL+IZODzqf91okQiQX9/P1NTUwBiGRDPZDIliUbu3sgL/qMFhfe+mC663mazMTo6SjqdBlAFQM1kMiV3Vux1FUsxkUiEpqYmDg4OAOICsJhMJl9I4E0mE+FwmEAgAICGuygAD7e2tq5MYDQaGRsbo729XbdpuA8F4ImqqvHd3V0AXPZrGAQjYNDnYq/rlesv6bbh4WF6e3t1fWdnB1VV48ATQy6XIxQK3Xa73V8GAgEezG7ywdczF+7cXlvJ46FOaqpMBf1zc3PEYrF3ZVkeOUmQI+vr6wNVVVXet9okrleb+WHmT5J7BwWysEBj3TVudXiKEqyurhKLxZaBbwEMuVwOgFAo5ATmgsGg3eVyXTo2GxsbzM7OxoFXZVlW8kg0ogAQ8fl8lypcKysrLC8vJ4A3ZFle1Gv8aZJTJ7pSjZdlOa/GnyPRiPRupb6+3iaK4tluhXQ6zfb2NqqqoihKAvgUuCfL8vlupRDJKTKz1nPdLNB3qcD8Sd8ly3LRtPHPAJ0EcbP62i0iAAAAAElFTkSuQmCC'; | |
| 77 | - function createCarIcon_angle(gps, w) { | |
| 87 | + | |
| 88 | + //绘制车辆icon 带角度标示 | |
| 89 | + function createCarIconRotation(gps, w) { | |
| 90 | + if (!w) | |
| 91 | + w = 70; | |
| 92 | + | |
| 78 | 93 | var canvas = $('<canvas></canvas>')[0]; |
| 94 | + canvas.width = w; | |
| 95 | + canvas.height = 75; | |
| 79 | 96 | var ctx = canvas.getContext('2d'); |
| 80 | 97 | |
| 81 | - //旋转画布 | |
| 98 | + var colours = color(gps); | |
| 99 | + //ctx.shadowOffsetX = 5; // 阴影Y轴偏移 | |
| 100 | + //ctx.shadowOffsetY = 5; // 阴影X轴偏移 | |
| 101 | + //ctx.shadowBlur = 1; // 模糊尺寸 | |
| 102 | + //ctx.shadowColor = colours.shadow; // 颜色 | |
| 82 | 103 | |
| 83 | - //console.log('gps', gps);direction | |
| 84 | - //车辆角度图片 | |
| 85 | - var img = new Image(); | |
| 86 | - img.src = busIcon; | |
| 104 | + ctx.roundRect(0, 0, w, 24, 5).stroke(); | |
| 105 | + ctx.fillStyle = colours.bgColor; | |
| 106 | + ctx.fill(); | |
| 107 | + //文字 | |
| 108 | + ctx.font = "14px arial"; | |
| 109 | + ctx.fillStyle = "#fff"; | |
| 110 | + ctx.fillText(gps.nbbm, 4, 17); | |
| 87 | 111 | |
| 112 | + //角度图标 | |
| 113 | + var img = new Image(); | |
| 114 | + img.src = rotationIcon(colours.bgColor); | |
| 88 | 115 | ctx.save(); |
| 89 | - ctx.translate(w/2, 25); | |
| 90 | - ctx.rotate(-((gps.direction+300) * Math.PI / 180)); | |
| 116 | + ctx.translate(canvas.width / 2, canvas.height / 2); | |
| 117 | + ctx.rotate(gps.direction * Math.PI / 180); | |
| 118 | + ctx.drawImage(img, -img.width / 2, -img.width / 2); | |
| 119 | + ctx.restore(); | |
| 91 | 120 | |
| 92 | - ctx.drawImage(img,-12, 0); | |
| 121 | + return canvas.toDataURL(); | |
| 122 | + } | |
| 93 | 123 | |
| 94 | - ctx.restore(); | |
| 95 | 124 | |
| 96 | - var colours = color(gps); | |
| 125 | + function rotationIcon(color) { | |
| 126 | + var canvas = $('<canvas></canvas>')[0]; | |
| 127 | + canvas.width = 25; | |
| 128 | + canvas.height = 25; | |
| 97 | 129 | |
| 98 | - ctx.shadowOffsetX = 5; // 阴影Y轴偏移 | |
| 99 | - ctx.shadowOffsetY = 5; // 阴影X轴偏移 | |
| 100 | - ctx.shadowBlur = 1; // 模糊尺寸 | |
| 101 | - ctx.shadowColor = colours.shadow; // 颜色 | |
| 130 | + var ctx = canvas.getContext('2d'); | |
| 102 | 131 | |
| 103 | - //绘制背景 | |
| 104 | - if (!w) | |
| 105 | - w = 70; | |
| 132 | + ctx.beginPath(); | |
| 133 | + ctx.strokeStyle = color; | |
| 134 | + var circle = { | |
| 135 | + x: 12.5, //圆心的x轴坐标值 | |
| 136 | + y: 12.5, //圆心的y轴坐标值 | |
| 137 | + r: 12 //圆的半径 | |
| 138 | + }; | |
| 139 | + //以canvas中的坐标点(100,100)为圆心,绘制一个半径为50px的圆形 | |
| 140 | + ctx.arc(circle.x, circle.y, circle.r, 0, Math.PI * 2, true); | |
| 141 | + //按照指定的路径绘制弧线 | |
| 142 | + ctx.stroke(); | |
| 143 | + ctx.fillStyle = "#ffffff"; | |
| 144 | + ctx.fill(); | |
| 106 | 145 | |
| 107 | - ctx.roundRect(0, 0, w, 25, 5).stroke(); | |
| 108 | - ctx.fillStyle = colours.bgColor; | |
| 146 | + //下方矩形 | |
| 147 | + ctx.beginPath(); | |
| 148 | + ctx.fillStyle = color; | |
| 149 | + ctx.fillRect(5, 16, 15, 4); | |
| 150 | + | |
| 151 | + ctx.rect(5, 11, 7.5, 8); | |
| 152 | + ctx.rect(12.5, 11, 7.5, 8); | |
| 153 | + ctx.strokeStyle = color; | |
| 154 | + ctx.stroke(); | |
| 155 | + | |
| 156 | + //上方三角形 | |
| 157 | + ctx.beginPath(); | |
| 158 | + ctx.fillStyle = "#111111"; | |
| 159 | + ctx.moveTo(12.5, 3); | |
| 160 | + ctx.lineTo(6.5, 7.5); | |
| 161 | + ctx.lineTo(18.5, 7.5); | |
| 162 | + ctx.closePath(); | |
| 109 | 163 | ctx.fill(); |
| 110 | - //文字 | |
| 111 | - ctx.font = "14px arial"; | |
| 112 | - ctx.fillStyle = "#fff"; | |
| 113 | - ctx.fillText(gps.nbbm, 4, 18); | |
| 114 | 164 | |
| 115 | 165 | return canvas.toDataURL(); |
| 116 | - }*/ | |
| 166 | + } | |
| 117 | 167 | |
| 118 | 168 | //绘制站点icon |
| 119 | 169 | function createStationIcon(station, w) { |
| 120 | 170 | var canvas = $('<canvas></canvas>')[0]; |
| 121 | 171 | var ctx = canvas.getContext('2d'); |
| 122 | 172 | |
| 123 | -/* var color=station.directions==0?'#125688':'#fb1804' | |
| 124 | - ,bg='rgba(255, 255, 255, 0.87)';*/ | |
| 173 | + /* var color=station.directions==0?'#125688':'#fb1804' | |
| 174 | + ,bg='rgba(255, 255, 255, 0.87)';*/ | |
| 125 | 175 | |
| 126 | - var color='#fff', | |
| 127 | - bg=station.directions==0?'#125688':'#fb1804'; | |
| 176 | + var color = '#fff', | |
| 177 | + bg = station.directions == 0 ? '#125688' : '#fb1804'; | |
| 128 | 178 | //矩形 |
| 129 | 179 | //ctx.roundRect(0, 0, w, 17, 1).stroke(); |
| 130 | - ctx.rect(-1,-1,w,17); | |
| 180 | + ctx.rect(-1, -1, w, 17); | |
| 131 | 181 | ctx.fillStyle = bg; |
| 132 | 182 | ctx.fill(); |
| 133 | - //ctx.lineWidth = 1; | |
| 134 | - //ctx.strokeStyle=color; | |
| 135 | - //ctx.stroke(); | |
| 136 | 183 | |
| 137 | 184 | //文字 |
| 138 | 185 | ctx.font = "12px arial"; |
| ... | ... | @@ -140,16 +187,16 @@ var gb_map_imap = (function () { |
| 140 | 187 | ctx.fillText(station.stationName, 2, 12); |
| 141 | 188 | |
| 142 | 189 | //角 |
| 143 | - var c=w/2; | |
| 190 | + var c = w / 2; | |
| 144 | 191 | ctx.beginPath(); |
| 145 | - ctx.moveTo(c - 7,16); | |
| 146 | - ctx.lineTo(c,24); | |
| 147 | - ctx.lineTo(c + 7,16); | |
| 192 | + ctx.moveTo(c - 7, 16); | |
| 193 | + ctx.lineTo(c, 24); | |
| 194 | + ctx.lineTo(c + 7, 16); | |
| 148 | 195 | ctx.closePath(); |
| 149 | 196 | |
| 150 | 197 | ctx.fillStyle = bg; |
| 151 | 198 | ctx.fill(); |
| 152 | - ctx.strokeStyle='#fff'; | |
| 199 | + ctx.strokeStyle = '#fff'; | |
| 153 | 200 | ctx.stroke(); |
| 154 | 201 | return canvas.toDataURL(); |
| 155 | 202 | } | ... | ... |
src/main/resources/static/real_control_v2/mapmonitor/js/map/platform/baidu.js
| ... | ... | @@ -3,8 +3,6 @@ var gb_map_baidu = (function(){ |
| 3 | 3 | |
| 4 | 4 | var map; |
| 5 | 5 | var topMarker; |
| 6 | - //实时路况是否打开 | |
| 7 | - //var traffVisible; | |
| 8 | 6 | var realMarkers = {}; |
| 9 | 7 | //路段对照 |
| 10 | 8 | var polylines={}; |
| ... | ... | @@ -14,8 +12,6 @@ var gb_map_baidu = (function(){ |
| 14 | 12 | var electronicFences = {}; |
| 15 | 13 | //停车场对照 |
| 16 | 14 | var carparks = {}; |
| 17 | - //var buffAreas = {}; | |
| 18 | - | |
| 19 | 15 | |
| 20 | 16 | var ctrl; |
| 21 | 17 | var baiduInstance = { |
| ... | ... | @@ -31,42 +27,12 @@ var gb_map_baidu = (function(){ |
| 31 | 27 | map.enableScrollWheelZoom(); |
| 32 | 28 | |
| 33 | 29 | cb && cb(); |
| 34 | - //window.localStorage.setItem('real_map', 'baidu'); | |
| 35 | - | |
| 36 | 30 | // 路况控件 |
| 37 | 31 | ctrl = new BMapLib.TrafficControl(); |
| 38 | 32 | map.addControl(ctrl); |
| 39 | - | |
| 40 | - /*$(gb_map_consts.trafficBtn).on('click', function() { | |
| 41 | - if (traffVisible) { | |
| 42 | - ctrl.hide(); | |
| 43 | - traffVisible = false; | |
| 44 | - showLinePolyline(); | |
| 45 | - } else { | |
| 46 | - ctrl.show(); | |
| 47 | - traffVisible = true; | |
| 48 | - hideLinePolyline(); | |
| 49 | - } | |
| 50 | - }); | |
| 51 | - //百度路况控件自身关闭按钮 | |
| 52 | - $('.portlet-fullscreen').on('click', '.maplibTc .maplibTcClose', function(){ | |
| 53 | - traffVisible = false; | |
| 54 | - showLinePolyline(); | |
| 55 | - });*/ | |
| 56 | - | |
| 57 | - //$('#tcWrap.maplibTc').addClass('animated bounceInLeft'); | |
| 58 | - //$('.maplibTcBtn_deskTop.anchorTR').remove(); | |
| 59 | -/* //缩放事件 | |
| 60 | - map.addEventListener("zoomend", function(type, target){ | |
| 61 | - //console.log('zoomend', type, target, map.getZoom()); | |
| 62 | - //刷新站点marker | |
| 63 | - refreshStation(); | |
| 64 | - });*/ | |
| 65 | 33 | }, |
| 66 | 34 | destroy: function(){ |
| 67 | 35 | this.clearAll(); |
| 68 | - //realMarkers = {}; | |
| 69 | - //linePolyline = []; | |
| 70 | 36 | }, |
| 71 | 37 | //画线路图层 |
| 72 | 38 | drawLine: function(opt){ |
| ... | ... | @@ -91,21 +57,6 @@ var gb_map_baidu = (function(){ |
| 91 | 57 | |
| 92 | 58 | //根据ID保存映射 |
| 93 | 59 | polylines[opt.id]=_pLines; |
| 94 | - /*$.each(route.split(','), function(){ | |
| 95 | - temps = this.split(' '); | |
| 96 | - pos.push(new BMap.Point(temps[0], temps[1])); | |
| 97 | - });*/ | |
| 98 | - | |
| 99 | - /*var polyline = new BMap.Polyline(pos, opt.style); | |
| 100 | - //根据ID保存映射 | |
| 101 | - polylines[opt.id]=polyline; | |
| 102 | - if(opt.hide) | |
| 103 | - polyline.hide(); | |
| 104 | - map.addOverlay(polyline);*/ | |
| 105 | - | |
| 106 | - //延迟居中,避免多次调用时抖动 | |
| 107 | - //delayToCenter(pos[parseInt(pos.length / 2)]); | |
| 108 | - //map.panTo(pos[parseInt(pos.length / 2)]); | |
| 109 | 60 | }, |
| 110 | 61 | traffic: function (enable) { |
| 111 | 62 | if(enable) |
| ... | ... | @@ -133,8 +84,6 @@ var gb_map_baidu = (function(){ |
| 133 | 84 | centerToLine: function (opt) { |
| 134 | 85 | var _pLines = polylines[opt.id]; |
| 135 | 86 | delayToCenter(_pLines[parseInt(_pLines.length/2)].getPath()[0]); |
| 136 | - //var pos=polylines[opt.id].getPath(); | |
| 137 | - //delayToCenter(pos[parseInt(pos.length / 2)]); | |
| 138 | 87 | }, |
| 139 | 88 | //绘制GPS信号 |
| 140 | 89 | drawRealGpsMarker: function(opts){ |
| ... | ... | @@ -157,12 +106,6 @@ var gb_map_baidu = (function(){ |
| 157 | 106 | map.addOverlay(marker); |
| 158 | 107 | //设备号和marker映射 |
| 159 | 108 | realMarkers[gps.deviceId] = marker; |
| 160 | - /*//新上线的设备,默认隐藏 | |
| 161 | - if(gps.newNodeHide){ | |
| 162 | - marker.hide(); | |
| 163 | - gps.newNodeHide=null; | |
| 164 | - delete gps.newNodeHide; | |
| 165 | - }*/ | |
| 166 | 109 | } |
| 167 | 110 | } |
| 168 | 111 | }); |
| ... | ... | @@ -228,10 +171,10 @@ var gb_map_baidu = (function(){ |
| 228 | 171 | clearAll: function () { |
| 229 | 172 | //清除所有覆盖物 |
| 230 | 173 | realMarkers = {}; |
| 231 | - polylines={}; | |
| 232 | - stationMarkers={}; | |
| 233 | - electronicFences={}; | |
| 234 | - carparks={}; | |
| 174 | + polylines = {}; | |
| 175 | + stationMarkers = {}; | |
| 176 | + electronicFences = {}; | |
| 177 | + carparks = {}; | |
| 235 | 178 | map.clearOverlays(); |
| 236 | 179 | }, |
| 237 | 180 | showGpsMarker:function (opt) { |
| ... | ... | @@ -284,6 +227,11 @@ var gb_map_baidu = (function(){ |
| 284 | 227 | ,m = realMarkers[deviceId]; |
| 285 | 228 | bdOpenWindow(m); |
| 286 | 229 | }, |
| 230 | + closeWin: function (deviceId) { | |
| 231 | + var m = realMarkers[deviceId]; | |
| 232 | + if(m) | |
| 233 | + map.closeInfoWindow(m.infoWindow) | |
| 234 | + }, | |
| 287 | 235 | //打开站点信息窗口 |
| 288 | 236 | openStationWin: function (opt) { |
| 289 | 237 | |
| ... | ... | @@ -362,7 +310,7 @@ var gb_map_baidu = (function(){ |
| 362 | 310 | var marker = new BMap.Marker(point); |
| 363 | 311 | |
| 364 | 312 | //根据编码长度 计算marker 宽度 |
| 365 | - var w = calcGpsMarkerWidth(gpsData.nbbm);//gpsData.nbbm.length * 10; | |
| 313 | + var w = gb_map_imap.calcGpsMarkerWidth(gpsData.nbbm);//gpsData.nbbm.length * 10; | |
| 366 | 314 | //渲染icon |
| 367 | 315 | renderIcon(marker, gpsData, w); |
| 368 | 316 | |
| ... | ... | @@ -374,9 +322,9 @@ var gb_map_baidu = (function(){ |
| 374 | 322 | bdOpenWindow(this); |
| 375 | 323 | }); |
| 376 | 324 | //mouseover |
| 377 | - /*marker.addEventListener('mouseover', function(){ | |
| 325 | + marker.addEventListener('mouseover', function(){ | |
| 378 | 326 | setTop(this); |
| 379 | - });*/ | |
| 327 | + }); | |
| 380 | 328 | marker.setTop(true); |
| 381 | 329 | return marker; |
| 382 | 330 | } |
| ... | ... | @@ -385,36 +333,11 @@ var gb_map_baidu = (function(){ |
| 385 | 333 | var config = gb_map_config.getConfig(); |
| 386 | 334 | |
| 387 | 335 | //如果需要标识角度 |
| 388 | - if(config.carIcon.angle){ | |
| 389 | - | |
| 390 | - var icon = new BMap.Icon(gb_map_imap.busIcon, new BMap.Size(24,24)); | |
| 391 | - var label = new BMap.Label(gpsData.nbbm,{offset:new BMap.Size(-(w/2-10),-24)}); | |
| 392 | - var color=gb_map_imap._color(gpsData).bgColor; | |
| 393 | - | |
| 394 | - label.setStyle({borderColor: color,borderRadius: '5px', padding: '1px 2px', color: '#fff', backgroundColor: color, font: 14}); | |
| 395 | - marker.setIcon(icon); | |
| 396 | - marker.setLabel(label); | |
| 397 | - //旋转角度 | |
| 398 | - marker.setRotation(gpsData.direction-90); | |
| 399 | - | |
| 400 | - } | |
| 336 | + if(config.carIcon.angle) | |
| 337 | + marker.setIcon(new BMap.Icon(gb_map_imap.createCarIconRotation(gpsData, w), new BMap.Size(w,75))); | |
| 401 | 338 | else |
| 402 | 339 | marker.setIcon(new BMap.Icon(gb_map_imap.createCarIcon(gpsData, w), new BMap.Size(w,25))); |
| 403 | 340 | } |
| 404 | - | |
| 405 | - | |
| 406 | - function calcGpsMarkerWidth(nbbm) { | |
| 407 | - var width=0; | |
| 408 | - $.each(nbbm.split(''), function () { | |
| 409 | - if(!isNaN(this)) | |
| 410 | - width += 7; | |
| 411 | - else if(this=='-') | |
| 412 | - width += 10; | |
| 413 | - else | |
| 414 | - width += 16; | |
| 415 | - }); | |
| 416 | - return width; | |
| 417 | - } | |
| 418 | 341 | |
| 419 | 342 | function createStationMark(statio) { |
| 420 | 343 | var point = new BMap.Point(statio.bd_lon, statio.bd_lat); |
| ... | ... | @@ -448,16 +371,8 @@ var gb_map_baidu = (function(){ |
| 448 | 371 | m.gpsData = gps; |
| 449 | 372 | //重新设置icon |
| 450 | 373 | //根据编码长度 计算marker 宽度 |
| 451 | - var w = m._icon_width;//calcGpsMarkerWidth(gps.nbbm);//gps.nbbm.length * 10; | |
| 452 | - | |
| 374 | + var w = m._icon_width; | |
| 453 | 375 | renderIcon(m, gps, w); |
| 454 | - /*//如果需要标识角度 | |
| 455 | - if(config.carIcon.angle) | |
| 456 | - m.setIcon(new BMap.Icon(gb_map_imap.createCarIcon_angle(gps, w), new BMap.Size(w,50))); | |
| 457 | - else | |
| 458 | - m.setIcon(new BMap.Icon(gb_map_imap.createCarIcon(gps, w), new BMap.Size(w,25)));*/ | |
| 459 | - //m.setIcon(new BMap.Icon(gb_map_imap.createCarIcon(gps, w), new BMap.Size(w,25))); | |
| 460 | - | |
| 461 | 376 | //更新 infoWindow |
| 462 | 377 | if(m.infoWindow.isOpen()){ |
| 463 | 378 | bdOpenWindow(m); |
| ... | ... | @@ -465,6 +380,9 @@ var gb_map_baidu = (function(){ |
| 465 | 380 | } |
| 466 | 381 | |
| 467 | 382 | function setTop(m){ |
| 383 | + if(gb_map_config.getConfig().spatialData.station) | |
| 384 | + return; | |
| 385 | + | |
| 468 | 386 | if(topMarker) |
| 469 | 387 | topMarker.setTop(false); |
| 470 | 388 | m.setTop(true); | ... | ... |
src/main/resources/static/real_control_v2/mapmonitor/js/map/platform/gaode.js
| ... | ... | @@ -20,9 +20,7 @@ var gb_map_gaode = (function() { |
| 20 | 20 | var stationMarkers={}; |
| 21 | 21 | var electronicFences={}; |
| 22 | 22 | var carparks={}; |
| 23 | - //实时路况是否显示 | |
| 24 | - //var traffVisible; | |
| 25 | - //var trafficLayer; | |
| 23 | + | |
| 26 | 24 | var gaodeInstance = { |
| 27 | 25 | init : function(cb) { |
| 28 | 26 | var $mapCon = $(gb_map_consts.mapContainer); |
| ... | ... | @@ -35,9 +33,6 @@ var gb_map_gaode = (function() { |
| 35 | 33 | map.setZoomAndCenter(13, [ gb_map_consts.center_point.lng, gb_map_consts.center_point.lat ]); |
| 36 | 34 | // 加载完成 |
| 37 | 35 | AMap.event.addListener(map, 'complete', function() { |
| 38 | - //window.localStorage.setItem('real_map', 'gaode'); | |
| 39 | - /*storage.setItem('real_map', REAL_GAODE_TEXT); | |
| 40 | - $('.sk-cube-grid._center').remove();*/ | |
| 41 | 36 | cb && cb(); |
| 42 | 37 | }); |
| 43 | 38 | |
| ... | ... | @@ -45,20 +40,6 @@ var gb_map_gaode = (function() { |
| 45 | 40 | trafficLayer = new AMap.TileLayer.Traffic(); |
| 46 | 41 | trafficLayer.setMap(map); |
| 47 | 42 | trafficLayer.hide(); |
| 48 | - | |
| 49 | - /*$(gb_map_consts.trafficBtn).on('click', function() { | |
| 50 | - if (traffVisible) { | |
| 51 | - trafficLayer.hide(); | |
| 52 | - traffVisible = false; | |
| 53 | - $(this).removeClass('active'); | |
| 54 | - showLinePolyline(); | |
| 55 | - } else { | |
| 56 | - trafficLayer.show(); | |
| 57 | - traffVisible = true; | |
| 58 | - $(this).addClass('active'); | |
| 59 | - hideLinePolyline(); | |
| 60 | - } | |
| 61 | - });*/ | |
| 62 | 43 | }, |
| 63 | 44 | setStyle : function() { |
| 64 | 45 | $('.mapRightWrap').addClass('gaode'); |
| ... | ... | @@ -106,29 +87,9 @@ var gb_map_gaode = (function() { |
| 106 | 87 | }); |
| 107 | 88 | |
| 108 | 89 | polylines[opt.id]=_pLines; |
| 109 | - | |
| 110 | - /*var pos = [], temps; | |
| 111 | - var route = opt.upDown==0?opt.route.up_gcj:opt.route.down_gcj; | |
| 112 | - | |
| 113 | - $.each(route.split(','), function(){ | |
| 114 | - temps = this.split(' '); | |
| 115 | - pos.push([temps[0], temps[1]]); | |
| 116 | - }); | |
| 117 | - | |
| 118 | - opt.style.path=pos; | |
| 119 | - var polyline = new AMap.Polyline(opt.style); | |
| 120 | - //根据ID保存映射 | |
| 121 | - polylines[opt.id]=polyline; | |
| 122 | - if(opt.hide) | |
| 123 | - polyline.hide(); | |
| 124 | - | |
| 125 | - polyline.setMap(map);*/ | |
| 126 | 90 | }, |
| 127 | 91 | //定位到线路中间点 |
| 128 | 92 | centerToLine: function (opt) { |
| 129 | - //var pos=polylines[opt.id].getPath(); | |
| 130 | - //map.setCenter(pos[parseInt(pos.length / 2)]); | |
| 131 | - | |
| 132 | 93 | var _pLines = polylines[opt.id]; |
| 133 | 94 | map.setCenter(_pLines[parseInt(_pLines.length/2)].getPath()[0]); |
| 134 | 95 | }, |
| ... | ... | @@ -316,6 +277,11 @@ var gb_map_gaode = (function() { |
| 316 | 277 | var deviceId = opts.deviceId |
| 317 | 278 | ,m = realMarkers[deviceId]; |
| 318 | 279 | openWindow(m); |
| 280 | + }, | |
| 281 | + closeWin: function (deviceId) { | |
| 282 | + var m = realMarkers[deviceId]; | |
| 283 | + if(m) | |
| 284 | + m.infoWindow.close(); | |
| 319 | 285 | } |
| 320 | 286 | }; |
| 321 | 287 | |
| ... | ... | @@ -327,7 +293,7 @@ var gb_map_gaode = (function() { |
| 327 | 293 | |
| 328 | 294 | function createGDMarkerByGps(gps){ |
| 329 | 295 | //根据编码长度 计算marker 宽度 |
| 330 | - var w = calcGpsMarkerWidth(gps.nbbm); | |
| 296 | + var w = gb_map_imap.calcGpsMarkerWidth(gps.nbbm); | |
| 331 | 297 | |
| 332 | 298 | var marker = new AMap.Marker({ |
| 333 | 299 | map: map, |
| ... | ... | @@ -362,21 +328,19 @@ var gb_map_gaode = (function() { |
| 362 | 328 | |
| 363 | 329 | //如果需要标识角度 |
| 364 | 330 | if(config.carIcon.angle) { |
| 365 | - marker.setIcon(gb_map_imap.busIcon); | |
| 366 | - marker.setAngle(gps.direction - 90); | |
| 367 | - | |
| 368 | - marker.setLabel({ | |
| 369 | - content: gps.nbbm, | |
| 370 | - offset: new AMap.Pixel(-20, -20), | |
| 371 | - }); | |
| 331 | + marker.setIcon(new AMap.Icon({ | |
| 332 | + size: new AMap.Size(w, 75), //图标大小 | |
| 333 | + image: gb_map_imap.createCarIconRotation(gps, w) | |
| 334 | + })); | |
| 335 | + marker.setOffset(new AMap.Pixel(-(w / 2), -35)); | |
| 372 | 336 | } |
| 373 | 337 | else{ |
| 374 | 338 | marker.setIcon(new AMap.Icon({ |
| 375 | 339 | size: new AMap.Size(w, 25), //图标大小 |
| 376 | 340 | image: gb_map_imap.createCarIcon(gps, w) |
| 377 | 341 | })); |
| 342 | + marker.setOffset(new AMap.Pixel(-(w / 2), -12.5)); | |
| 378 | 343 | } |
| 379 | - marker.setOffset(new AMap.Pixel(-(w / 2), -12.5)); | |
| 380 | 344 | } |
| 381 | 345 | |
| 382 | 346 | //创建站点marker |
| ... | ... | @@ -425,27 +389,10 @@ var gb_map_gaode = (function() { |
| 425 | 389 | //渲染icon |
| 426 | 390 | renderIcon(marker, gps, w); |
| 427 | 391 | |
| 428 | - /*m.setIcon(new AMap.Icon({ | |
| 429 | - size: new AMap.Size(w, 25), | |
| 430 | - image: gb_map_imap.createCarIcon(gps, w) | |
| 431 | - }));*/ | |
| 432 | - | |
| 433 | 392 | if(m.infoWindow.getIsOpen()) |
| 434 | 393 | openWindow(m); |
| 435 | 394 | } |
| 436 | 395 | |
| 437 | - function calcGpsMarkerWidth(nbbm) { | |
| 438 | - var width=0; | |
| 439 | - $.each(nbbm.split(''), function () { | |
| 440 | - if(!isNaN(this)) | |
| 441 | - width += 7;//icon_num_width[this]; | |
| 442 | - else if(this=='-') | |
| 443 | - width += 10; | |
| 444 | - else | |
| 445 | - width += 16; | |
| 446 | - }); | |
| 447 | - return width; | |
| 448 | - } | |
| 449 | 396 | |
| 450 | 397 | function transMultiWGSToGCJ(obj) { |
| 451 | 398 | if(!obj._gPoints) |
| ... | ... | @@ -466,7 +413,6 @@ var gb_map_gaode = (function() { |
| 466 | 413 | gps.lineName = gb_data_basic.lineCode2NameAll()[gps.lineId]; |
| 467 | 414 | //时间 |
| 468 | 415 | gps.dateStr = moment(gps.timestamp).format('YYYY-MM-DD HH:mm:ss'); |
| 469 | -//{size: AMap.Size(290,255)} | |
| 470 | 416 | marker.infoWindow.setContent(gb_map_overlay_mge.map_gps_win_temp(gps)); |
| 471 | 417 | marker.infoWindow.open(map, marker.getPosition()); |
| 472 | 418 | } | ... | ... |
src/main/resources/static/real_control_v2/mapmonitor/js/map_overlay_manager.js
| ... | ... | @@ -203,11 +203,11 @@ var gb_map_overlay_mge = (function () { |
| 203 | 203 | |
| 204 | 204 | //地图居中至合理的位置 |
| 205 | 205 | var centerToRational=function () { |
| 206 | - /*var chs=getCheckedDevice(); | |
| 206 | + var chs=getCheckedDevice(); | |
| 207 | 207 | if(chs && chs.length > 0){ |
| 208 | 208 | var id=chs[0].data.lineId+'_'+chs[0].data.upDown; |
| 209 | 209 | gb_map_imap.call('centerToLine', {id: id}); |
| 210 | - }*/ | |
| 210 | + } | |
| 211 | 211 | } |
| 212 | 212 | |
| 213 | 213 | return { | ... | ... |
src/main/resources/static/real_control_v2/mapmonitor/js/playback.js
0 → 100644
| 1 | +/* 地图模块 轨迹回放 */ | |
| 2 | + | |
| 3 | +var gb_map_play_back = (function () { | |
| 4 | + | |
| 5 | + var dom; | |
| 6 | + $.get('/real_control_v2/mapmonitor/fragments/playback/main.html', function (rs) { | |
| 7 | + dom = rs; | |
| 8 | + }); | |
| 9 | + | |
| 10 | + var initParams = function (deviceId, nbbm) { | |
| 11 | + //关闭infowindow | |
| 12 | + if (deviceId) | |
| 13 | + gb_map_imap.call('closeWin', deviceId); | |
| 14 | + | |
| 15 | + //show modal | |
| 16 | + var modal = '#map-playback-modal'; | |
| 17 | + $(document.body).append(dom); | |
| 18 | + UIkit.modal(modal, {bgclose: false}).show(); | |
| 19 | + $(modal).trigger('show_form', {deviceId: deviceId, nbbm: nbbm}); | |
| 20 | + }; | |
| 21 | + | |
| 22 | + //导出excel | |
| 23 | + var listToExcel = function (list) { | |
| 24 | + var temp = '<html>' + | |
| 25 | + ' <head> '+ | |
| 26 | + ' </head>' + | |
| 27 | + ' <body>' + | |
| 28 | + ' <table border="1">' + | |
| 29 | + ' <tr><th>序号</th><th>车辆</th><th>所在道路</th><th>经度</th><th>纬度</th><th>时间</th><th>速度</th></tr>' + | |
| 30 | + ' {{each list as gps i}}' + | |
| 31 | + ' <tr><td>{{i+1}}</td><td>{{gps.nbbm}}</td><td>{{gps.road.ROAD_NAME}}</td><td>{{gps.bd_lon}}</td><td>{{gps.bd_lat}}</td><td>{{gps.timeStr2}}</td><td>{{gps.speed}}</td></tr>' + | |
| 32 | + ' {{/each}}' + | |
| 33 | + ' </table>' + | |
| 34 | + ' </body>' + | |
| 35 | + ' </html>'; | |
| 36 | + | |
| 37 | + var rs = template.compile(temp)({list: list}); | |
| 38 | + | |
| 39 | + var uri = 'data:application/vnd.ms-excel;base64,'; | |
| 40 | + return uri + base64(rs); | |
| 41 | + //location.href = uri + base64(rs); | |
| 42 | + }; | |
| 43 | + | |
| 44 | + | |
| 45 | + function base64(string) { | |
| 46 | + return window.btoa(unescape(encodeURIComponent(string))); | |
| 47 | + } | |
| 48 | + | |
| 49 | + return { | |
| 50 | + initParams: initParams, | |
| 51 | + listToExcel: listToExcel | |
| 52 | + } | |
| 53 | +})(); | |
| 0 | 54 | \ No newline at end of file | ... | ... |
src/main/resources/static/real_control_v2/mapmonitor/js/real.js
| ... | ... | @@ -10,10 +10,10 @@ var mapmonitor_load_ep = EventProxy.create('load_iMap', 'load_baidu', 'load_gaod |
| 10 | 10 | .changeMap(gb_map_config.getConfig().map_type); |
| 11 | 11 | |
| 12 | 12 | //init tree |
| 13 | - /* gb_map_gps_tree.init(function () { | |
| 13 | + gb_map_gps_tree.init(function () { | |
| 14 | 14 | gb_map_overlay_mge.init(); |
| 15 | 15 | gb_map_spatial_data.init(); |
| 16 | - });*/ | |
| 16 | + }); | |
| 17 | 17 | |
| 18 | 18 | /* |
| 19 | 19 | $(".real_bottom_panel").resizable({ | ... | ... |
src/main/resources/static/real_control_v2/mapmonitor/real.html
| ... | ... | @@ -3,6 +3,7 @@ |
| 3 | 3 | <link rel="stylesheet" href="/real_control_v2/assets/plugins/spectrum/spectrum.css"/> |
| 4 | 4 | <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/components/form-advanced.gradient.min.css"/> |
| 5 | 5 | <link rel="stylesheet" href="/real_control_v2/mapmonitor/css/real.css"/> |
| 6 | +<link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/components/progress.gradient.min.css"> | |
| 6 | 7 | |
| 7 | 8 | <div class="map-system-msg"> |
| 8 | 9 | <a class="z-depth-2" href="/pages/mapmonitor/alone/wrap.html" target="_blank"> |
| ... | ... | @@ -17,6 +18,10 @@ |
| 17 | 18 | $('.map-system-msg').addClass('flex-left'); |
| 18 | 19 | return false; |
| 19 | 20 | }); |
| 21 | + | |
| 22 | + setTimeout(function () { | |
| 23 | + $('.map-system-msg-close').trigger('click'); | |
| 24 | + }, 2000); | |
| 20 | 25 | </script> |
| 21 | 26 | |
| 22 | 27 | <div id="real_map_container"></div> |
| ... | ... | @@ -73,4 +78,6 @@ |
| 73 | 78 | <script src="/real_control_v2/assets/plugins/jquery.ui/mouse.js"></script> |
| 74 | 79 | <script src="/real_control_v2/assets/plugins/jquery.ui/resizable.js"></script> |
| 75 | 80 | <!-- 颜色选择器 --> |
| 76 | -<script src="/real_control_v2/assets/plugins/spectrum/spectrum.js"></script> | |
| 77 | 81 | \ No newline at end of file |
| 82 | +<script src="/real_control_v2/assets/plugins/spectrum/spectrum.js"></script> | |
| 83 | +<!-- play back --> | |
| 84 | +<script src="/real_control_v2/mapmonitor/js/playback.js"></script> | |
| 78 | 85 | \ No newline at end of file | ... | ... |
src/main/resources/static/real_control_v2/mapmonitor/real_monitor/js/gps_play_back.js
| ... | ... | @@ -5,7 +5,7 @@ var gb_map_playback = (function() { |
| 5 | 5 | }; |
| 6 | 6 | |
| 7 | 7 | var temps; |
| 8 | - $.get('/real_control_v2/mapmonitor/real_monitor/fragments/playback.html', function(dom) { | |
| 8 | + $.get('/real_control_v2/mapmonitor/real_monitor/fragments/main.html', function(dom) { | |
| 9 | 9 | temps= gb_common.compileTempByDom(dom); |
| 10 | 10 | }); |
| 11 | 11 | ... | ... |