Commit ff1b492a334ac8e36ead494a1efebb6c707c1d13
Merge branch 'minhang' of http://192.168.168.201:8888/panzhaov5/bsth_control into minhang
Showing
82 changed files
with
4571 additions
and
1704 deletions
pom.xml
| @@ -237,6 +237,27 @@ | @@ -237,6 +237,27 @@ | ||
| 237 | <version>1.13</version> | 237 | <version>1.13</version> |
| 238 | </dependency> | 238 | </dependency> |
| 239 | 239 | ||
| 240 | + <dependency> | ||
| 241 | + <groupId>org.dbunit</groupId> | ||
| 242 | + <artifactId>dbunit</artifactId> | ||
| 243 | + <version>2.4.9</version> | ||
| 244 | + <scope>test</scope> | ||
| 245 | + | ||
| 246 | + <exclusions> | ||
| 247 | + <exclusion> | ||
| 248 | + <groupId>org.slf4j</groupId> | ||
| 249 | + <artifactId>slf4j-api</artifactId> | ||
| 250 | + </exclusion> | ||
| 251 | + </exclusions> | ||
| 252 | + </dependency> | ||
| 253 | + | ||
| 254 | + <dependency> | ||
| 255 | + <groupId>com.h2database</groupId> | ||
| 256 | + <artifactId>h2</artifactId> | ||
| 257 | + <version>1.2.132</version> | ||
| 258 | + <scope>test</scope> | ||
| 259 | + </dependency> | ||
| 260 | + | ||
| 240 | </dependencies> | 261 | </dependencies> |
| 241 | 262 | ||
| 242 | <dependencyManagement> | 263 | <dependencyManagement> |
src/main/java/com/bsth/controller/gps/GpsController.java
| @@ -108,4 +108,22 @@ public class GpsController { | @@ -108,4 +108,22 @@ public class GpsController { | ||
| 108 | public Map<String, Object> history_v2(@PathVariable("nbbm") String nbbm, @RequestParam long st, @RequestParam long et){ | 108 | public Map<String, Object> history_v2(@PathVariable("nbbm") String nbbm, @RequestParam long st, @RequestParam long et){ |
| 109 | return gpsService.history_v2(nbbm, st, et); | 109 | return gpsService.history_v2(nbbm, st, et); |
| 110 | } | 110 | } |
| 111 | + | ||
| 112 | + /** | ||
| 113 | + * 安全驾驶数据 分页查询 | ||
| 114 | + * @param map | ||
| 115 | + * @param page | ||
| 116 | + * @param size | ||
| 117 | + * @param order | ||
| 118 | + * @param direction | ||
| 119 | + * @return | ||
| 120 | + */ | ||
| 121 | + @RequestMapping(value = "/safeDriv") | ||
| 122 | + public Map<String, Object> safeDrivList(@RequestParam Map<String, Object> map, | ||
| 123 | + @RequestParam(defaultValue = "0") int page, | ||
| 124 | + @RequestParam(defaultValue = "15") int size, | ||
| 125 | + @RequestParam(defaultValue = "timestamp") String order, | ||
| 126 | + @RequestParam(defaultValue = "DESC") String direction){ | ||
| 127 | + return gpsService.safeDrivList(map , page, size, order, direction); | ||
| 128 | + } | ||
| 111 | } | 129 | } |
src/main/java/com/bsth/controller/realcontrol/ScheduleRealInfoController.java
| @@ -369,8 +369,35 @@ public class ScheduleRealInfoController extends BaseController<ScheduleRealInfo, | @@ -369,8 +369,35 @@ public class ScheduleRealInfoController extends BaseController<ScheduleRealInfo, | ||
| 369 | } | 369 | } |
| 370 | 370 | ||
| 371 | @RequestMapping(value="/statisticsDailyTj") | 371 | @RequestMapping(value="/statisticsDailyTj") |
| 372 | - public List<Map<String,Object>> statisticsDailyTj(@RequestParam String gsdm,@RequestParam String fgsdm, @RequestParam String line, @RequestParam String date, | ||
| 373 | - @RequestParam String date2,@RequestParam String xlName, @RequestParam String type){ | 372 | + public List<Map<String,Object>> statisticsDailyTj(@RequestParam Map<String, Object> map){ |
| 373 | + String gsdm=""; | ||
| 374 | + if(map.get("gsdm")!=null){ | ||
| 375 | + gsdm=map.get("gsdm").toString(); | ||
| 376 | + } | ||
| 377 | + String fgsdm=""; | ||
| 378 | + if(map.get("fgsdm")!=null){ | ||
| 379 | + fgsdm=map.get("fgsdm").toString(); | ||
| 380 | + } | ||
| 381 | + String line=""; | ||
| 382 | + if(map.get("line")!=null){ | ||
| 383 | + line=map.get("line").toString(); | ||
| 384 | + } | ||
| 385 | + String date=""; | ||
| 386 | + if(map.get("date")!=null){ | ||
| 387 | + date=map.get("date").toString(); | ||
| 388 | + } | ||
| 389 | + String date2=""; | ||
| 390 | + if(map.get("date2")!=null){ | ||
| 391 | + date2=map.get("date2").toString(); | ||
| 392 | + } | ||
| 393 | + String xlName=""; | ||
| 394 | + if(map.get("xlName")!=null){ | ||
| 395 | + xlName=map.get("xlName").toString(); | ||
| 396 | + } | ||
| 397 | + String type=""; | ||
| 398 | + if(map.get("type")!=null){ | ||
| 399 | + type=map.get("type").toString(); | ||
| 400 | + } | ||
| 374 | return scheduleRealInfoService.statisticsDailyTj(gsdm,fgsdm,line, date,date2, xlName, type); | 401 | return scheduleRealInfoService.statisticsDailyTj(gsdm,fgsdm,line, date,date2, xlName, type); |
| 375 | } | 402 | } |
| 376 | 403 |
src/main/java/com/bsth/data/gpsdata/arrival/handlers/InOutStationSignalHandle.java
| @@ -155,12 +155,32 @@ public class InOutStationSignalHandle extends SignalHandle{ | @@ -155,12 +155,32 @@ public class InOutStationSignalHandle extends SignalHandle{ | ||
| 155 | } | 155 | } |
| 156 | else if(sch.getBcType().equals("out")){ | 156 | else if(sch.getBcType().equals("out")){ |
| 157 | ScheduleRealInfo next = dayOfSchedule.nextSame(sch); | 157 | ScheduleRealInfo next = dayOfSchedule.nextSame(sch); |
| 158 | + //如果下一个班次是区间,并且是环线 | ||
| 159 | + if(next != null && next.getBcType().equals("region")){ | ||
| 160 | + next = dayOfSchedule.nextSame(next); | ||
| 161 | + if(next == null || !next.getQdzName().equals(next.getZdzName())){ | ||
| 162 | + return; | ||
| 163 | + } | ||
| 164 | + } | ||
| 158 | if(next != null && prev.getStopNo().equals(next.getQdzCode())){ | 165 | if(next != null && prev.getStopNo().equals(next.getQdzCode())){ |
| 159 | //发下一个班次 | 166 | //发下一个班次 |
| 160 | dayOfSchedule.addExecPlan(next); | 167 | dayOfSchedule.addExecPlan(next); |
| 161 | outStation(gps, prev); | 168 | outStation(gps, prev); |
| 162 | } | 169 | } |
| 163 | } | 170 | } |
| 171 | + //当前班次是区间 | ||
| 172 | + else if(sch.getBcType().equals("region")){ | ||
| 173 | + ScheduleRealInfo next = dayOfSchedule.nextSame(sch); | ||
| 174 | + if(next==null || !next.getQdzName().equals(next.getZdzName())){ | ||
| 175 | + return; | ||
| 176 | + } | ||
| 177 | + //是环线 | ||
| 178 | + if(prev.getStopNo().equals(next.getQdzCode())){ | ||
| 179 | + //发下一个班次 | ||
| 180 | + dayOfSchedule.addExecPlan(next); | ||
| 181 | + outStation(gps, prev); | ||
| 182 | + } | ||
| 183 | + } | ||
| 164 | } | 184 | } |
| 165 | 185 | ||
| 166 | 186 | ||
| @@ -260,7 +280,7 @@ public class InOutStationSignalHandle extends SignalHandle{ | @@ -260,7 +280,7 @@ public class InOutStationSignalHandle extends SignalHandle{ | ||
| 260 | //如果当前班次是出场,并且进的是下一个班次的终点 | 280 | //如果当前班次是出场,并且进的是下一个班次的终点 |
| 261 | if(sch.getBcType().equals("out")){ | 281 | if(sch.getBcType().equals("out")){ |
| 262 | ScheduleRealInfo next = dayOfSchedule.next(sch); | 282 | ScheduleRealInfo next = dayOfSchedule.next(sch); |
| 263 | - if(next.getZdzCode().equals(gps.getStopNo())){ | 283 | + if(next != null && next.getZdzCode().equals(gps.getStopNo())){ |
| 264 | List<ScheduleRealInfo> halfList = dayOfSchedule.findByNbbm(sch.getClZbh()); | 284 | List<ScheduleRealInfo> halfList = dayOfSchedule.findByNbbm(sch.getClZbh()); |
| 265 | //和当前进站信号最匹配的一个班次 | 285 | //和当前进站信号最匹配的一个班次 |
| 266 | ScheduleRealInfo nearSch = nearScheduleByGpsIn(gps, halfList); | 286 | ScheduleRealInfo nearSch = nearScheduleByGpsIn(gps, halfList); |
src/main/java/com/bsth/data/gpsdata/recovery/GpsDataRecovery.java
| @@ -60,7 +60,7 @@ public class GpsDataRecovery implements ApplicationContextAware { | @@ -60,7 +60,7 @@ public class GpsDataRecovery implements ApplicationContextAware { | ||
| 60 | for (String nbbm : keys) { | 60 | for (String nbbm : keys) { |
| 61 | Collections.sort(listMap.get(nbbm), comp); | 61 | Collections.sort(listMap.get(nbbm), comp); |
| 62 | threadPool.execute(new RecoveryThread(listMap.get(nbbm), count)); | 62 | threadPool.execute(new RecoveryThread(listMap.get(nbbm), count)); |
| 63 | - /*if(nbbm.equals("SXC-YD012")) | 63 | + /*if(nbbm.equals("W9G-013")) |
| 64 | new RecoveryThread(listMap.get(nbbm), count).run();*/ | 64 | new RecoveryThread(listMap.get(nbbm), count).run();*/ |
| 65 | } | 65 | } |
| 66 | 66 | ||
| @@ -150,6 +150,8 @@ public class GpsDataRecovery implements ApplicationContextAware { | @@ -150,6 +150,8 @@ public class GpsDataRecovery implements ApplicationContextAware { | ||
| 150 | CircleQueue<GpsEntity> prevs; | 150 | CircleQueue<GpsEntity> prevs; |
| 151 | boolean task; | 151 | boolean task; |
| 152 | for (GpsEntity gps : list) { | 152 | for (GpsEntity gps : list) { |
| 153 | + /*if(gps.getTimestamp() > 1491951840000L) | ||
| 154 | + System.out.print("");*/ | ||
| 153 | 155 | ||
| 154 | //是否有任务 | 156 | //是否有任务 |
| 155 | 157 |
src/main/java/com/bsth/data/safe_driv/SafeDriv.java
| 1 | -package com.bsth.data.safe_driv; | ||
| 2 | - | ||
| 3 | -/** | ||
| 4 | - * 安全驾驶 | ||
| 5 | - * Created by panzhao on 2017/4/6. | ||
| 6 | - */ | ||
| 7 | -public class SafeDriv { | ||
| 8 | - | ||
| 9 | - /** | ||
| 10 | - * 时间 | ||
| 11 | - * 2017-04-06 08:00:00.0 | ||
| 12 | - */ | ||
| 13 | - private String Startime; | ||
| 14 | - | ||
| 15 | - /** | ||
| 16 | - * 时间戳 | ||
| 17 | - */ | ||
| 18 | - private Long ts; | ||
| 19 | - | ||
| 20 | - /** | ||
| 21 | - * 设备编号 | ||
| 22 | - */ | ||
| 23 | - private String sbbh; | ||
| 24 | - | ||
| 25 | - /** | ||
| 26 | - * 线路名称 | ||
| 27 | - */ | ||
| 28 | - private String xlmc; | ||
| 29 | - | ||
| 30 | - /** | ||
| 31 | - * 车辆自编号 | ||
| 32 | - */ | ||
| 33 | - private String clzbh; | ||
| 34 | - | ||
| 35 | - /** | ||
| 36 | - * 车牌号 | ||
| 37 | - */ | ||
| 38 | - private String cph; | ||
| 39 | - | ||
| 40 | - /** | ||
| 41 | - * 检查属性 | ||
| 42 | - * 双脱手 0 单脱手 1 其他为0都是异常 | ||
| 43 | - */ | ||
| 44 | - private String jctype; | ||
| 45 | - | ||
| 46 | - /** | ||
| 47 | - * 异常种类 | ||
| 48 | - * 手部检测: 1 | ||
| 49 | - * 脸部检测: 5 | ||
| 50 | - * 摄像头检测: 2 | ||
| 51 | - * 安全带检测: 3 | ||
| 52 | - * 袖章检测: 4 | ||
| 53 | - */ | ||
| 54 | - private String yczltype; | ||
| 55 | - | ||
| 56 | - @Override | ||
| 57 | - public int hashCode() { | ||
| 58 | - return ("safe_" + (this.getClzbh() + this.getStartime())).hashCode(); | ||
| 59 | - } | ||
| 60 | - | ||
| 61 | - @Override | ||
| 62 | - public boolean equals(Object obj) { | ||
| 63 | - SafeDriv s2 = (SafeDriv)obj; | ||
| 64 | - return (this.getClzbh() + this.getStartime()).equals(s2.getClzbh() + s2.getStartime()); | ||
| 65 | - } | ||
| 66 | - | ||
| 67 | - public String getStartime() { | ||
| 68 | - return Startime; | ||
| 69 | - } | ||
| 70 | - | ||
| 71 | - public void setStartime(String startime) { | ||
| 72 | - Startime = startime; | ||
| 73 | - } | ||
| 74 | - | ||
| 75 | - public String getSbbh() { | ||
| 76 | - return sbbh; | ||
| 77 | - } | ||
| 78 | - | ||
| 79 | - public void setSbbh(String sbbh) { | ||
| 80 | - this.sbbh = sbbh; | ||
| 81 | - } | ||
| 82 | - | ||
| 83 | - public String getXlmc() { | ||
| 84 | - return xlmc; | ||
| 85 | - } | ||
| 86 | - | ||
| 87 | - public void setXlmc(String xlmc) { | ||
| 88 | - this.xlmc = xlmc; | ||
| 89 | - } | ||
| 90 | - | ||
| 91 | - public String getClzbh() { | ||
| 92 | - return clzbh; | ||
| 93 | - } | ||
| 94 | - | ||
| 95 | - public void setClzbh(String clzbh) { | ||
| 96 | - this.clzbh = clzbh; | ||
| 97 | - } | ||
| 98 | - | ||
| 99 | - public String getCph() { | ||
| 100 | - return cph; | ||
| 101 | - } | ||
| 102 | - | ||
| 103 | - public void setCph(String cph) { | ||
| 104 | - this.cph = cph; | ||
| 105 | - } | ||
| 106 | - | ||
| 107 | - public String getJctype() { | ||
| 108 | - return jctype; | ||
| 109 | - } | ||
| 110 | - | ||
| 111 | - public void setJctype(String jctype) { | ||
| 112 | - this.jctype = jctype; | ||
| 113 | - } | ||
| 114 | - | ||
| 115 | - public String getYczltype() { | ||
| 116 | - return yczltype; | ||
| 117 | - } | ||
| 118 | - | ||
| 119 | - public void setYczltype(String yczltype) { | ||
| 120 | - this.yczltype = yczltype; | ||
| 121 | - } | ||
| 122 | - | ||
| 123 | - public Long getTs() { | ||
| 124 | - return ts; | ||
| 125 | - } | ||
| 126 | - | ||
| 127 | - public void setTs(Long ts) { | ||
| 128 | - this.ts = ts; | ||
| 129 | - } | ||
| 130 | -} | 1 | +package com.bsth.data.safe_driv; |
| 2 | + | ||
| 3 | +/** | ||
| 4 | + * 安全驾驶 | ||
| 5 | + * Created by panzhao on 2017/4/6. | ||
| 6 | + */ | ||
| 7 | +public class SafeDriv { | ||
| 8 | + | ||
| 9 | + /** | ||
| 10 | + * 时间 | ||
| 11 | + * 2017-04-06 08:00:00.0 | ||
| 12 | + */ | ||
| 13 | + private String Startime; | ||
| 14 | + | ||
| 15 | + /** | ||
| 16 | + * 时间戳 | ||
| 17 | + */ | ||
| 18 | + private Long ts; | ||
| 19 | + | ||
| 20 | + /** | ||
| 21 | + * 设备编号 | ||
| 22 | + */ | ||
| 23 | + private String sbbh; | ||
| 24 | + | ||
| 25 | + /** | ||
| 26 | + * 线路名称 | ||
| 27 | + */ | ||
| 28 | + private String xlmc; | ||
| 29 | + | ||
| 30 | + private String xlbm; | ||
| 31 | + | ||
| 32 | + /** | ||
| 33 | + * 车辆自编号 | ||
| 34 | + */ | ||
| 35 | + private String clzbh; | ||
| 36 | + | ||
| 37 | + /** | ||
| 38 | + * 车牌号 | ||
| 39 | + */ | ||
| 40 | + private String cph; | ||
| 41 | + | ||
| 42 | + /** | ||
| 43 | + * 检查属性 | ||
| 44 | + * 双脱手 0 单脱手 1 其他为0都是异常 | ||
| 45 | + */ | ||
| 46 | + private String jctype; | ||
| 47 | + | ||
| 48 | + /** | ||
| 49 | + * 异常种类 | ||
| 50 | + * 手部检测: 1 | ||
| 51 | + * 脸部检测: 5 | ||
| 52 | + * 摄像头检测: 2 | ||
| 53 | + * 安全带检测: 3 | ||
| 54 | + * 袖章检测: 4 | ||
| 55 | + */ | ||
| 56 | + private String yczltype; | ||
| 57 | + | ||
| 58 | + @Override | ||
| 59 | + public int hashCode() { | ||
| 60 | + return ("safe_" + (this.getClzbh() + this.getStartime())).hashCode(); | ||
| 61 | + } | ||
| 62 | + | ||
| 63 | + @Override | ||
| 64 | + public boolean equals(Object obj) { | ||
| 65 | + SafeDriv s2 = (SafeDriv)obj; | ||
| 66 | + return (this.getClzbh() + this.getStartime()).equals(s2.getClzbh() + s2.getStartime()); | ||
| 67 | + } | ||
| 68 | + | ||
| 69 | + public String getStartime() { | ||
| 70 | + return Startime; | ||
| 71 | + } | ||
| 72 | + | ||
| 73 | + public void setStartime(String startime) { | ||
| 74 | + Startime = startime; | ||
| 75 | + } | ||
| 76 | + | ||
| 77 | + public String getSbbh() { | ||
| 78 | + return sbbh; | ||
| 79 | + } | ||
| 80 | + | ||
| 81 | + public void setSbbh(String sbbh) { | ||
| 82 | + this.sbbh = sbbh; | ||
| 83 | + } | ||
| 84 | + | ||
| 85 | + public String getXlmc() { | ||
| 86 | + return xlmc; | ||
| 87 | + } | ||
| 88 | + | ||
| 89 | + public void setXlmc(String xlmc) { | ||
| 90 | + this.xlmc = xlmc; | ||
| 91 | + } | ||
| 92 | + | ||
| 93 | + public String getClzbh() { | ||
| 94 | + return clzbh; | ||
| 95 | + } | ||
| 96 | + | ||
| 97 | + public void setClzbh(String clzbh) { | ||
| 98 | + this.clzbh = clzbh; | ||
| 99 | + } | ||
| 100 | + | ||
| 101 | + public String getCph() { | ||
| 102 | + return cph; | ||
| 103 | + } | ||
| 104 | + | ||
| 105 | + public void setCph(String cph) { | ||
| 106 | + this.cph = cph; | ||
| 107 | + } | ||
| 108 | + | ||
| 109 | + public String getJctype() { | ||
| 110 | + return jctype; | ||
| 111 | + } | ||
| 112 | + | ||
| 113 | + public void setJctype(String jctype) { | ||
| 114 | + this.jctype = jctype; | ||
| 115 | + } | ||
| 116 | + | ||
| 117 | + public String getYczltype() { | ||
| 118 | + return yczltype; | ||
| 119 | + } | ||
| 120 | + | ||
| 121 | + public void setYczltype(String yczltype) { | ||
| 122 | + this.yczltype = yczltype; | ||
| 123 | + } | ||
| 124 | + | ||
| 125 | + public Long getTs() { | ||
| 126 | + return ts; | ||
| 127 | + } | ||
| 128 | + | ||
| 129 | + public void setTs(Long ts) { | ||
| 130 | + this.ts = ts; | ||
| 131 | + } | ||
| 132 | + | ||
| 133 | + public String getXlbm() { | ||
| 134 | + return xlbm; | ||
| 135 | + } | ||
| 136 | + | ||
| 137 | + public void setXlbm(String xlbm) { | ||
| 138 | + this.xlbm = xlbm; | ||
| 139 | + } | ||
| 140 | +} |
src/main/java/com/bsth/data/safe_driv/SafeDrivCenter.java
| 1 | -package com.bsth.data.safe_driv; | ||
| 2 | - | ||
| 3 | -import com.bsth.Application; | ||
| 4 | -import com.bsth.websocket.handler.SendUtils; | ||
| 5 | -import org.joda.time.format.DateTimeFormat; | ||
| 6 | -import org.joda.time.format.DateTimeFormatter; | ||
| 7 | -import org.springframework.beans.BeansException; | ||
| 8 | -import org.springframework.beans.factory.annotation.Autowired; | ||
| 9 | -import org.springframework.boot.CommandLineRunner; | ||
| 10 | -import org.springframework.context.ApplicationContext; | ||
| 11 | -import org.springframework.context.ApplicationContextAware; | ||
| 12 | -import org.springframework.stereotype.Component; | ||
| 13 | - | ||
| 14 | -import java.util.HashMap; | ||
| 15 | -import java.util.HashSet; | ||
| 16 | -import java.util.Map; | ||
| 17 | -import java.util.Set; | ||
| 18 | -import java.util.concurrent.TimeUnit; | ||
| 19 | - | ||
| 20 | -/** | ||
| 21 | - * 安全驾驶 | ||
| 22 | - * Created by panzhao on 2017/4/6. | ||
| 23 | - */ | ||
| 24 | -@Component | ||
| 25 | -public class SafeDrivCenter implements CommandLineRunner,ApplicationContextAware { | ||
| 26 | - | ||
| 27 | - private static Set<SafeDriv> data; | ||
| 28 | - | ||
| 29 | - @Autowired | ||
| 30 | - SafeDrivDataLoadThread safeDrivDataLoadThread; | ||
| 31 | - | ||
| 32 | - static SendUtils sendUtils; | ||
| 33 | - | ||
| 34 | - /** | ||
| 35 | - * 车辆自编号 和 最新一条数据对照 | ||
| 36 | - */ | ||
| 37 | - private static Map<String, SafeDriv> safeMap; | ||
| 38 | - | ||
| 39 | - static { | ||
| 40 | - data = new HashSet<>(); | ||
| 41 | - safeMap = new HashMap<>(); | ||
| 42 | - } | ||
| 43 | - | ||
| 44 | - private static DateTimeFormatter fmt = DateTimeFormat.forPattern("yyyy-MM-dd HH:mm:ss.SSS"); | ||
| 45 | - public static void put(SafeDriv sd){ | ||
| 46 | - sd.setTs(fmt.parseMillis(sd.getStartime())); | ||
| 47 | - data.add(sd); | ||
| 48 | - | ||
| 49 | - if(sd.getYczltype().indexOf("A") == -1) | ||
| 50 | - sd.setYczltype("A" + sd.getYczltype()); | ||
| 51 | - | ||
| 52 | - SafeDriv old = safeMap.get(sd.getClzbh()); | ||
| 53 | - if(old == null || sd.getTs() > old.getTs()){ | ||
| 54 | - //通知客户端 | ||
| 55 | - sendUtils.sendSafeDriv(sd); | ||
| 56 | - } | ||
| 57 | - | ||
| 58 | - safeMap.put(sd.getClzbh(), sd); | ||
| 59 | - } | ||
| 60 | - | ||
| 61 | - @Override | ||
| 62 | - public void run(String... strings) throws Exception { | ||
| 63 | - //定时加载安全驾驶数据 | ||
| 64 | - Application.mainServices.scheduleWithFixedDelay(safeDrivDataLoadThread, 60, 5, TimeUnit.SECONDS); | ||
| 65 | - } | ||
| 66 | - | ||
| 67 | - @Override | ||
| 68 | - public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { | ||
| 69 | - sendUtils = applicationContext.getBean(SendUtils.class); | ||
| 70 | - } | ||
| 71 | -} | 1 | +package com.bsth.data.safe_driv; |
| 2 | + | ||
| 3 | +import com.bsth.websocket.handler.SendUtils; | ||
| 4 | +import org.joda.time.format.DateTimeFormat; | ||
| 5 | +import org.joda.time.format.DateTimeFormatter; | ||
| 6 | +import org.springframework.beans.BeansException; | ||
| 7 | +import org.springframework.beans.factory.annotation.Autowired; | ||
| 8 | +import org.springframework.boot.CommandLineRunner; | ||
| 9 | +import org.springframework.context.ApplicationContext; | ||
| 10 | +import org.springframework.context.ApplicationContextAware; | ||
| 11 | +import org.springframework.stereotype.Component; | ||
| 12 | + | ||
| 13 | +import java.util.HashMap; | ||
| 14 | +import java.util.HashSet; | ||
| 15 | +import java.util.Map; | ||
| 16 | +import java.util.Set; | ||
| 17 | + | ||
| 18 | +/** | ||
| 19 | + * 安全驾驶 | ||
| 20 | + * Created by panzhao on 2017/4/6. | ||
| 21 | + */ | ||
| 22 | +@Component | ||
| 23 | +public class SafeDrivCenter implements CommandLineRunner,ApplicationContextAware { | ||
| 24 | + | ||
| 25 | + private static Set<SafeDriv> data; | ||
| 26 | + | ||
| 27 | + @Autowired | ||
| 28 | + SafeDrivDataLoadThread safeDrivDataLoadThread; | ||
| 29 | + | ||
| 30 | + static SendUtils sendUtils; | ||
| 31 | + | ||
| 32 | + /** | ||
| 33 | + * 车辆自编号 和 最新一条数据对照 | ||
| 34 | + */ | ||
| 35 | + private static Map<String, SafeDriv> safeMap; | ||
| 36 | + | ||
| 37 | + static { | ||
| 38 | + data = new HashSet<>(); | ||
| 39 | + safeMap = new HashMap<>(); | ||
| 40 | + } | ||
| 41 | + | ||
| 42 | + private static DateTimeFormatter fmt = DateTimeFormat.forPattern("yyyy-MM-dd HH:mm:ss.SSS"); | ||
| 43 | + public static void put(SafeDriv sd){ | ||
| 44 | + sd.setTs(fmt.parseMillis(sd.getStartime())); | ||
| 45 | + | ||
| 46 | + if(sd.getYczltype().indexOf("A") == -1) | ||
| 47 | + sd.setYczltype("A" + sd.getYczltype()); | ||
| 48 | + | ||
| 49 | + //SafeDriv old = safeMap.get(sd.getClzbh()); | ||
| 50 | + if(!data.contains(sd)){ | ||
| 51 | + //通知客户端 | ||
| 52 | + sendUtils.sendSafeDriv(sd); | ||
| 53 | + data.add(sd); | ||
| 54 | + safeMap.put(sd.getClzbh(), sd); | ||
| 55 | + } | ||
| 56 | + } | ||
| 57 | + | ||
| 58 | + public static Set<SafeDriv> findAll(){ | ||
| 59 | + return data; | ||
| 60 | + } | ||
| 61 | + | ||
| 62 | + public static void clear(){ | ||
| 63 | + data = new HashSet<>(); | ||
| 64 | + safeMap = new HashMap<>(); | ||
| 65 | + } | ||
| 66 | + | ||
| 67 | + @Override | ||
| 68 | + public void run(String... strings) throws Exception { | ||
| 69 | + //定时加载安全驾驶数据 | ||
| 70 | + //Application.mainServices.scheduleWithFixedDelay(safeDrivDataLoadThread, 60, 4, TimeUnit.SECONDS); | ||
| 71 | + } | ||
| 72 | + | ||
| 73 | + @Override | ||
| 74 | + public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { | ||
| 75 | + sendUtils = applicationContext.getBean(SendUtils.class); | ||
| 76 | + } | ||
| 77 | +} |
src/main/java/com/bsth/data/safe_driv/SafeDrivDataLoadThread.java
| 1 | -package com.bsth.data.safe_driv; | ||
| 2 | - | ||
| 3 | -import com.alibaba.fastjson.JSON; | ||
| 4 | -import org.apache.http.HttpEntity; | ||
| 5 | -import org.apache.http.client.methods.CloseableHttpResponse; | ||
| 6 | -import org.apache.http.client.methods.HttpGet; | ||
| 7 | -import org.apache.http.impl.client.CloseableHttpClient; | ||
| 8 | -import org.apache.http.impl.client.HttpClients; | ||
| 9 | -import org.slf4j.Logger; | ||
| 10 | -import org.slf4j.LoggerFactory; | ||
| 11 | -import org.springframework.stereotype.Component; | ||
| 12 | - | ||
| 13 | -import java.io.BufferedReader; | ||
| 14 | -import java.io.InputStreamReader; | ||
| 15 | -import java.util.List; | ||
| 16 | - | ||
| 17 | -/** | ||
| 18 | - * 安全驾驶数据加载线程 | ||
| 19 | - * Created by panzhao on 2017/4/6. | ||
| 20 | - */ | ||
| 21 | -@Component | ||
| 22 | -public class SafeDrivDataLoadThread extends Thread{ | ||
| 23 | - | ||
| 24 | - private final static String url = "http://180.166.5.82:9988//bsth-safedriving/Crlcxb/realtimeInterface.do"; | ||
| 25 | - | ||
| 26 | - Logger logger = LoggerFactory.getLogger(this.getClass()); | ||
| 27 | - | ||
| 28 | - @Override | ||
| 29 | - public void run() { | ||
| 30 | - List<SafeDriv> list = null; | ||
| 31 | - CloseableHttpClient httpClient = null; | ||
| 32 | - CloseableHttpResponse response = null; | ||
| 33 | - try { | ||
| 34 | - httpClient = HttpClients.createDefault(); | ||
| 35 | - HttpGet get = new HttpGet(url); | ||
| 36 | - | ||
| 37 | - response = httpClient.execute(get); | ||
| 38 | - | ||
| 39 | - HttpEntity entity = response.getEntity(); | ||
| 40 | - if (null != entity) { | ||
| 41 | - BufferedReader br = new BufferedReader(new InputStreamReader(entity.getContent())); | ||
| 42 | - StringBuffer stringBuffer = new StringBuffer(); | ||
| 43 | - String str = ""; | ||
| 44 | - while ((str = br.readLine()) != null) | ||
| 45 | - stringBuffer.append(str); | ||
| 46 | - | ||
| 47 | - | ||
| 48 | - list = JSON.parseArray(stringBuffer.toString(), SafeDriv.class); | ||
| 49 | - /** | ||
| 50 | - * 模拟数据 | ||
| 51 | - | ||
| 52 | - SafeDriv sd1 = new SafeDriv(); | ||
| 53 | - sd1.setYczltype("1"); | ||
| 54 | - sd1.setClzbh("W2B-001"); | ||
| 55 | - sd1.setStartime("2017-04-07 08:00:00.0"); | ||
| 56 | - | ||
| 57 | - SafeDriv sd2 = new SafeDriv(); | ||
| 58 | - sd2.setYczltype("2"); | ||
| 59 | - sd2.setClzbh("W2B-002"); | ||
| 60 | - sd2.setStartime("2017-04-07 08:02:00.0"); | ||
| 61 | - | ||
| 62 | - SafeDriv sd3 = new SafeDriv(); | ||
| 63 | - sd3.setYczltype("3"); | ||
| 64 | - sd3.setClzbh("W2B-003"); | ||
| 65 | - sd3.setStartime("2017-04-07 08:03:00.0"); | ||
| 66 | - | ||
| 67 | - SafeDriv sd4 = new SafeDriv(); | ||
| 68 | - sd4.setYczltype("4"); | ||
| 69 | - sd4.setClzbh("W2B-004"); | ||
| 70 | - sd4.setStartime("2017-04-07 08:04:00.0"); | ||
| 71 | - | ||
| 72 | - SafeDriv sd5 = new SafeDriv(); | ||
| 73 | - sd5.setYczltype("5"); | ||
| 74 | - sd5.setClzbh("W2B-005"); | ||
| 75 | - sd5.setStartime("2017-04-07 08:05:00.0"); | ||
| 76 | - | ||
| 77 | - list.add(sd1); | ||
| 78 | - list.add(sd2); | ||
| 79 | - list.add(sd3); | ||
| 80 | - list.add(sd4); | ||
| 81 | - list.add(sd5); | ||
| 82 | - */ | ||
| 83 | - for(SafeDriv sd : list){ | ||
| 84 | - SafeDrivCenter.put(sd); | ||
| 85 | - } | ||
| 86 | - } | ||
| 87 | - | ||
| 88 | - httpClient.close(); | ||
| 89 | - response.close(); | ||
| 90 | - } catch (Exception e) { | ||
| 91 | - logger.error("", e); | ||
| 92 | - } | ||
| 93 | - } | ||
| 94 | -} | 1 | +package com.bsth.data.safe_driv; |
| 2 | + | ||
| 3 | +import com.alibaba.fastjson.JSON; | ||
| 4 | +import org.apache.http.HttpEntity; | ||
| 5 | +import org.apache.http.client.methods.CloseableHttpResponse; | ||
| 6 | +import org.apache.http.client.methods.HttpGet; | ||
| 7 | +import org.apache.http.impl.client.CloseableHttpClient; | ||
| 8 | +import org.apache.http.impl.client.HttpClients; | ||
| 9 | +import org.slf4j.Logger; | ||
| 10 | +import org.slf4j.LoggerFactory; | ||
| 11 | +import org.springframework.stereotype.Component; | ||
| 12 | + | ||
| 13 | +import java.io.BufferedReader; | ||
| 14 | +import java.io.InputStreamReader; | ||
| 15 | +import java.util.List; | ||
| 16 | + | ||
| 17 | +/** | ||
| 18 | + * 安全驾驶数据加载线程 | ||
| 19 | + * Created by panzhao on 2017/4/6. | ||
| 20 | + */ | ||
| 21 | +@Component | ||
| 22 | +public class SafeDrivDataLoadThread extends Thread{ | ||
| 23 | + | ||
| 24 | + private final static String url = "http://180.166.5.82:9988//bsth-safedriving/Crlcxb/realtimeInterface.do"; | ||
| 25 | + | ||
| 26 | + Logger logger = LoggerFactory.getLogger(this.getClass()); | ||
| 27 | + | ||
| 28 | + @Override | ||
| 29 | + public void run() { | ||
| 30 | + List<SafeDriv> list = null; | ||
| 31 | + CloseableHttpClient httpClient = null; | ||
| 32 | + CloseableHttpResponse response = null; | ||
| 33 | + try { | ||
| 34 | + httpClient = HttpClients.createDefault(); | ||
| 35 | + HttpGet get = new HttpGet(url); | ||
| 36 | + | ||
| 37 | + response = httpClient.execute(get); | ||
| 38 | + | ||
| 39 | + HttpEntity entity = response.getEntity(); | ||
| 40 | + if (null != entity) { | ||
| 41 | + BufferedReader br = new BufferedReader(new InputStreamReader(entity.getContent())); | ||
| 42 | + StringBuffer stringBuffer = new StringBuffer(); | ||
| 43 | + String str = ""; | ||
| 44 | + while ((str = br.readLine()) != null) | ||
| 45 | + stringBuffer.append(str); | ||
| 46 | + | ||
| 47 | + | ||
| 48 | + list = JSON.parseArray(stringBuffer.toString(), SafeDriv.class); | ||
| 49 | + /** | ||
| 50 | + * 模拟数据 | ||
| 51 | + | ||
| 52 | + SafeDriv sd1 = new SafeDriv(); | ||
| 53 | + sd1.setYczltype("1"); | ||
| 54 | + sd1.setClzbh("W2B-001"); | ||
| 55 | + sd1.setStartime("2017-04-07 08:00:00.0"); | ||
| 56 | + | ||
| 57 | + SafeDriv sd2 = new SafeDriv(); | ||
| 58 | + sd2.setYczltype("2"); | ||
| 59 | + sd2.setClzbh("W2B-002"); | ||
| 60 | + sd2.setStartime("2017-04-07 08:02:00.0"); | ||
| 61 | + | ||
| 62 | + SafeDriv sd3 = new SafeDriv(); | ||
| 63 | + sd3.setYczltype("3"); | ||
| 64 | + sd3.setClzbh("W2B-003"); | ||
| 65 | + sd3.setStartime("2017-04-07 08:03:00.0"); | ||
| 66 | + | ||
| 67 | + SafeDriv sd4 = new SafeDriv(); | ||
| 68 | + sd4.setYczltype("4"); | ||
| 69 | + sd4.setClzbh("W2B-004"); | ||
| 70 | + sd4.setStartime("2017-04-07 08:04:00.0"); | ||
| 71 | + | ||
| 72 | + SafeDriv sd5 = new SafeDriv(); | ||
| 73 | + sd5.setYczltype("5"); | ||
| 74 | + sd5.setClzbh("W2B-005"); | ||
| 75 | + sd5.setStartime("2017-04-07 08:05:00.0"); | ||
| 76 | + | ||
| 77 | + list.add(sd1); | ||
| 78 | + list.add(sd2); | ||
| 79 | + list.add(sd3); | ||
| 80 | + list.add(sd4); | ||
| 81 | + list.add(sd5); | ||
| 82 | + */ | ||
| 83 | + for(SafeDriv sd : list){ | ||
| 84 | + SafeDrivCenter.put(sd); | ||
| 85 | + } | ||
| 86 | + } | ||
| 87 | + | ||
| 88 | + httpClient.close(); | ||
| 89 | + response.close(); | ||
| 90 | + } catch (Exception e) { | ||
| 91 | + logger.error("", e); | ||
| 92 | + } | ||
| 93 | + } | ||
| 94 | +} |
src/main/java/com/bsth/data/schedule/DayOfSchedule.java
| @@ -138,7 +138,7 @@ public class DayOfSchedule implements CommandLineRunner { | @@ -138,7 +138,7 @@ public class DayOfSchedule implements CommandLineRunner { | ||
| 138 | //dataRecovery(); | 138 | //dataRecovery(); |
| 139 | 139 | ||
| 140 | //翻班线程 | 140 | //翻班线程 |
| 141 | - Application.mainServices.scheduleWithFixedDelay(scheduleRefreshThread, 15, 240, TimeUnit.SECONDS); | 141 | +// Application.mainServices.scheduleWithFixedDelay(scheduleRefreshThread, 15, 240, TimeUnit.SECONDS); |
| 142 | //入库 | 142 | //入库 |
| 143 | // Application.mainServices.scheduleWithFixedDelay(schedulePstThread, 60, 30, TimeUnit.SECONDS); | 143 | // Application.mainServices.scheduleWithFixedDelay(schedulePstThread, 60, 30, TimeUnit.SECONDS); |
| 144 | //班次误点扫描 | 144 | //班次误点扫描 |
| @@ -384,9 +384,9 @@ public class DayOfSchedule implements CommandLineRunner { | @@ -384,9 +384,9 @@ public class DayOfSchedule implements CommandLineRunner { | ||
| 384 | } | 384 | } |
| 385 | 385 | ||
| 386 | sch.setJhlcOrig(sch.getJhlc()); | 386 | sch.setJhlcOrig(sch.getJhlc()); |
| 387 | - //计划里程为0,设置NULL | ||
| 388 | - //if (sch.getJhlc() != null && sch.getJhlc() == 0) | ||
| 389 | - // sch.setJhlc(null); | 387 | + //保留备注 |
| 388 | + if(StringUtils.isNotEmpty(sch.getRemark())) | ||
| 389 | + sch.setRemarks(sch.getRemark()); | ||
| 390 | } | 390 | } |
| 391 | } catch (Exception e) { | 391 | } catch (Exception e) { |
| 392 | logger.error("", e); | 392 | logger.error("", e); |
src/main/java/com/bsth/data/schedule/thread/CalcOilThread.java
| 1 | package com.bsth.data.schedule.thread; | 1 | package com.bsth.data.schedule.thread; |
| 2 | 2 | ||
| 3 | +import com.bsth.service.oil.DlbService; | ||
| 4 | +import com.bsth.data.safe_driv.SafeDrivCenter; | ||
| 3 | import com.bsth.service.oil.YlbService; | 5 | import com.bsth.service.oil.YlbService; |
| 4 | import org.slf4j.Logger; | 6 | import org.slf4j.Logger; |
| 5 | import org.slf4j.LoggerFactory; | 7 | import org.slf4j.LoggerFactory; |
| @@ -15,7 +17,8 @@ public class CalcOilThread extends Thread{ | @@ -15,7 +17,8 @@ public class CalcOilThread extends Thread{ | ||
| 15 | 17 | ||
| 16 | @Autowired | 18 | @Autowired |
| 17 | YlbService ylbService; | 19 | YlbService ylbService; |
| 18 | - | 20 | + @Autowired |
| 21 | + DlbService dlbService; | ||
| 19 | Logger logger = LoggerFactory.getLogger(this.getClass()); | 22 | Logger logger = LoggerFactory.getLogger(this.getClass()); |
| 20 | 23 | ||
| 21 | @Override | 24 | @Override |
| @@ -23,7 +26,11 @@ public class CalcOilThread extends Thread{ | @@ -23,7 +26,11 @@ public class CalcOilThread extends Thread{ | ||
| 23 | try{ | 26 | try{ |
| 24 | logger.info("开始计算路单里程加注量...."); | 27 | logger.info("开始计算路单里程加注量...."); |
| 25 | ylbService.obtainDsq(); | 28 | ylbService.obtainDsq(); |
| 29 | + dlbService.obtainDsq(); | ||
| 26 | logger.info("计算路单里程加注量结束!"); | 30 | logger.info("计算路单里程加注量结束!"); |
| 31 | + | ||
| 32 | + //清除安全驾驶数据 先临时蹭这个线程 | ||
| 33 | + SafeDrivCenter.clear(); | ||
| 27 | } catch(Exception e){ | 34 | } catch(Exception e){ |
| 28 | logger.error("计算路单里程加注量失败",e); | 35 | logger.error("计算路单里程加注量失败",e); |
| 29 | } | 36 | } |
src/main/java/com/bsth/entity/realcontrol/ChildTaskPlan.java
| @@ -223,7 +223,7 @@ public class ChildTaskPlan { | @@ -223,7 +223,7 @@ public class ChildTaskPlan { | ||
| 223 | 223 | ||
| 224 | @Override | 224 | @Override |
| 225 | public int hashCode() { | 225 | public int hashCode() { |
| 226 | - return ("" + this.getId() + this.getSchedule().getId()).hashCode(); | 226 | + return ("cTask" + this.getId() + this.getSchedule().getId()).hashCode(); |
| 227 | } | 227 | } |
| 228 | 228 | ||
| 229 | @Override | 229 | @Override |
src/main/java/com/bsth/entity/realcontrol/ScheduleRealInfo.java
| @@ -145,6 +145,9 @@ public class ScheduleRealInfo { | @@ -145,6 +145,9 @@ public class ScheduleRealInfo { | ||
| 145 | 145 | ||
| 146 | /** 备注*/ | 146 | /** 备注*/ |
| 147 | private String remarks; | 147 | private String remarks; |
| 148 | + | ||
| 149 | + /** 原计划排班备注 */ | ||
| 150 | + private String remark; | ||
| 148 | 151 | ||
| 149 | /**待发时间(格式 HH:mm) */ | 152 | /**待发时间(格式 HH:mm) */ |
| 150 | private String dfsj; | 153 | private String dfsj; |
| @@ -168,7 +171,7 @@ public class ScheduleRealInfo { | @@ -168,7 +171,7 @@ public class ScheduleRealInfo { | ||
| 168 | private String qdzArrDatesj; | 171 | private String qdzArrDatesj; |
| 169 | 172 | ||
| 170 | /** 子任务 */ | 173 | /** 子任务 */ |
| 171 | - @OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL) | 174 | + @OneToMany(fetch = FetchType.LAZY, mappedBy = "schedule") |
| 172 | private Set<ChildTaskPlan> cTasks = new HashSet<>(); | 175 | private Set<ChildTaskPlan> cTasks = new HashSet<>(); |
| 173 | 176 | ||
| 174 | /** 关联的公司名称 */ | 177 | /** 关联的公司名称 */ |
| @@ -875,4 +878,12 @@ public class ScheduleRealInfo { | @@ -875,4 +878,12 @@ public class ScheduleRealInfo { | ||
| 875 | else | 878 | else |
| 876 | this.setLate(false); | 879 | this.setLate(false); |
| 877 | } | 880 | } |
| 881 | + | ||
| 882 | + public String getRemark() { | ||
| 883 | + return remark; | ||
| 884 | + } | ||
| 885 | + | ||
| 886 | + public void setRemark(String remark) { | ||
| 887 | + this.remark = remark; | ||
| 888 | + } | ||
| 878 | } | 889 | } |
src/main/java/com/bsth/entity/schedule/SchedulePlanInfo.java
| @@ -128,6 +128,9 @@ public class SchedulePlanInfo { | @@ -128,6 +128,9 @@ public class SchedulePlanInfo { | ||
| 128 | /** 关联的时刻表名字 */ | 128 | /** 关联的时刻表名字 */ |
| 129 | private String ttInfoName; | 129 | private String ttInfoName; |
| 130 | 130 | ||
| 131 | + /** 时刻表的明细备注 */ | ||
| 132 | + private String remark; | ||
| 133 | + | ||
| 131 | 134 | ||
| 132 | /** 创建人 */ | 135 | /** 创建人 */ |
| 133 | @ManyToOne(cascade = CascadeType.PERSIST, fetch = FetchType.LAZY) | 136 | @ManyToOne(cascade = CascadeType.PERSIST, fetch = FetchType.LAZY) |
| @@ -269,6 +272,9 @@ public class SchedulePlanInfo { | @@ -269,6 +272,9 @@ public class SchedulePlanInfo { | ||
| 269 | // 使用的时刻表名字 | 272 | // 使用的时刻表名字 |
| 270 | this.ttInfoName = ttInfoDetail.getTtinfo().getName(); | 273 | this.ttInfoName = ttInfoDetail.getTtinfo().getName(); |
| 271 | 274 | ||
| 275 | + // 备注信息 | ||
| 276 | + this.remark = ttInfoDetail.getRemark(); | ||
| 277 | + | ||
| 272 | // 使用车辆配置的停车场信息 | 278 | // 使用车辆配置的停车场信息 |
| 273 | String pzType = carConfigInfo.getPzType(); // 配置类型 | 279 | String pzType = carConfigInfo.getPzType(); // 配置类型 |
| 274 | if (pzType != null && !pzType.equals("BSY")) { | 280 | if (pzType != null && !pzType.equals("BSY")) { |
| @@ -648,4 +654,12 @@ public class SchedulePlanInfo { | @@ -648,4 +654,12 @@ public class SchedulePlanInfo { | ||
| 648 | public void setTtInfoName(String ttInfoName) { | 654 | public void setTtInfoName(String ttInfoName) { |
| 649 | this.ttInfoName = ttInfoName; | 655 | this.ttInfoName = ttInfoName; |
| 650 | } | 656 | } |
| 657 | + | ||
| 658 | + public String getRemark() { | ||
| 659 | + return remark; | ||
| 660 | + } | ||
| 661 | + | ||
| 662 | + public void setRemark(String remark) { | ||
| 663 | + this.remark = remark; | ||
| 664 | + } | ||
| 651 | } | 665 | } |
src/main/java/com/bsth/repository/realcontrol/ScheduleRealInfoRepository.java
| @@ -155,8 +155,13 @@ public interface ScheduleRealInfoRepository extends BaseRepository<ScheduleRealI | @@ -155,8 +155,13 @@ public interface ScheduleRealInfoRepository extends BaseRepository<ScheduleRealI | ||
| 155 | List<ScheduleRealInfo> scheduleByDateAndLineTj(String line,String date,String date2,String gsdm,String fgsdm); | 155 | List<ScheduleRealInfo> scheduleByDateAndLineTj(String line,String date,String date2,String gsdm,String fgsdm); |
| 156 | 156 | ||
| 157 | //按照时间段统计 | 157 | //按照时间段统计 |
| 158 | - @Query(value="select DISTINCT s from ScheduleRealInfo s where s.xlBm = ?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') between ?2 and ?3 and s.bcType not in ('in','out') order by s.xlBm") | ||
| 159 | - List<ScheduleRealInfo> scheduleByDateAndLineTj2(String line,String date,String date2); | 158 | + @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH) |
| 159 | + @Query(value="select DISTINCT s from ScheduleRealInfo s where s.xlBm = ?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') between ?2 and ?3 and s.bcType not in ('in','out') order by s.xlBm") | ||
| 160 | + List<ScheduleRealInfo> scheduleByDateAndLineTj2(String line,String date,String date2); | ||
| 161 | + //月报表 | ||
| 162 | + @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH) | ||
| 163 | + @Query(value="select DISTINCT s from ScheduleRealInfo s where s.xlBm = ?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') between ?2 and ?3 order by s.xlBm") | ||
| 164 | + List<ScheduleRealInfo> scheduleByDateAndLineYbb(String line,String date,String date2); | ||
| 160 | 165 | ||
| 161 | @Query(value="select new map(s.scheduleDate as scheduleDate,s.xlBm as xlBm,s.clZbh as clZbh,s.jGh as jGh,min(s.fcsj) as fcsj ) from ScheduleRealInfo s where s.xlBm like %?1% and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 and s.gsBm like %?3% and s.fgsBm like %?4% GROUP BY xlBm,clZbh,jGh,scheduleDate,jGh ORDER BY clZbh,fcsj") | 166 | @Query(value="select new map(s.scheduleDate as scheduleDate,s.xlBm as xlBm,s.clZbh as clZbh,s.jGh as jGh,min(s.fcsj) as fcsj ) from ScheduleRealInfo s where s.xlBm like %?1% and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 and s.gsBm like %?3% and s.fgsBm like %?4% GROUP BY xlBm,clZbh,jGh,scheduleDate,jGh ORDER BY clZbh,fcsj") |
| 162 | List<Map<String,Object>> yesterdayDataList(String line,String date,String gsbm,String fgsbm); | 167 | List<Map<String,Object>> yesterdayDataList(String line,String date,String gsbm,String fgsbm); |
src/main/java/com/bsth/repository/schedule/SchedulePlanInfoRepository.java
| @@ -35,21 +35,22 @@ public interface SchedulePlanInfoRepository extends BaseRepository<SchedulePlanI | @@ -35,21 +35,22 @@ public interface SchedulePlanInfoRepository extends BaseRepository<SchedulePlanI | ||
| 35 | "info.cl_zbh as clZbh, " + | 35 | "info.cl_zbh as clZbh, " + |
| 36 | "group_concat(info.fcsj order by info.fcno) ccsj, " + | 36 | "group_concat(info.fcsj order by info.fcno) ccsj, " + |
| 37 | "group_concat(info.bc_type order by info.fcno) bctype, " + | 37 | "group_concat(info.bc_type order by info.fcno) bctype, " + |
| 38 | - "group_concat(distinct info.j) jsyId, " + | ||
| 39 | - "group_concat(distinct info.j_gh) jsyGh, " + | ||
| 40 | - "group_concat(distinct info.j_name) jsyName, " + | ||
| 41 | - "group_concat(distinct info.s) spyId, " + | ||
| 42 | - "group_concat(distinct info.s_gh) spyGh, " + | ||
| 43 | - "group_concat(distinct info.s_name) spyName, " + | 38 | + "group_concat(distinct info.j order by info.fcno) jsyId, " + |
| 39 | + "group_concat(distinct info.j_gh order by info.fcno) jsyGh, " + | ||
| 40 | + "group_concat(distinct info.j_name order by info.fcno) jsyName, " + | ||
| 41 | + "group_concat(distinct info.s order by info.fcno) spyId, " + | ||
| 42 | + "group_concat(distinct info.s_gh order by info.fcno) spyGh, " + | ||
| 43 | + "group_concat(distinct info.s_name order by info.fcno) spyName, " + | ||
| 44 | "group_concat(info.fcno order by info.fcno) fcno, " + | 44 | "group_concat(info.fcno order by info.fcno) fcno, " + |
| 45 | "max(info.update_date) as updateDate, " + | 45 | "max(info.update_date) as updateDate, " + |
| 46 | "max(user.user_name) as updateUserName, " + | 46 | "max(user.user_name) as updateUserName, " + |
| 47 | "max(info.tt_info_name) as ttInfoName " + | 47 | "max(info.tt_info_name) as ttInfoName " + |
| 48 | "from bsth_c_s_sp_info info left join bsth_c_sys_user user on info.update_by = user.id " + | 48 | "from bsth_c_s_sp_info info left join bsth_c_sys_user user on info.update_by = user.id " + |
| 49 | + "left join bsth_c_s_gbi gbi on info.lp = gbi.id " + | ||
| 49 | "where info.xl = ?1 and " + | 50 | "where info.xl = ?1 and " + |
| 50 | "info.schedule_date = ?2 " + | 51 | "info.schedule_date = ?2 " + |
| 51 | "group by info.xl_name, info.schedule_date, info.lp, info.lp_name, info.cl, info.cl_zbh " + | 52 | "group by info.xl_name, info.schedule_date, info.lp, info.lp_name, info.cl, info.cl_zbh " + |
| 52 | - "order by info.xl_name, info.schedule_date, info.lp ", nativeQuery = true) | 53 | + "order by info.xl_name, info.schedule_date, gbi.lp_no ", nativeQuery = true) |
| 53 | List<Object[]> findGroupInfo(Integer xlid, Date scheduleDate); | 54 | List<Object[]> findGroupInfo(Integer xlid, Date scheduleDate); |
| 54 | 55 | ||
| 55 | @Modifying | 56 | @Modifying |
src/main/java/com/bsth/service/gps/GpsService.java
| 1 | package com.bsth.service.gps; | 1 | package com.bsth.service.gps; |
| 2 | 2 | ||
| 3 | +import com.bsth.service.gps.entity.GpsOutbound_DTO; | ||
| 4 | +import com.bsth.service.gps.entity.GpsSpeed_DTO; | ||
| 5 | + | ||
| 3 | import java.util.List; | 6 | import java.util.List; |
| 4 | import java.util.Map; | 7 | import java.util.Map; |
| 5 | 8 | ||
| @@ -20,4 +23,10 @@ public interface GpsService { | @@ -20,4 +23,10 @@ public interface GpsService { | ||
| 20 | Map<String,Object> gpsCompletion(long schId); | 23 | Map<String,Object> gpsCompletion(long schId); |
| 21 | 24 | ||
| 22 | Map<String,Object> history_v2(String nbbm, long st, long et); | 25 | Map<String,Object> history_v2(String nbbm, long st, long et); |
| 26 | + | ||
| 27 | + List<GpsSpeed_DTO> speeds(String nbbm, long st, long et); | ||
| 28 | + | ||
| 29 | + List<GpsOutbound_DTO> outbounds(String nbbm, long st, long et); | ||
| 30 | + | ||
| 31 | + Map<String, Object> safeDrivList(Map<String, Object> map, int page, int size, String order, String direction); | ||
| 23 | } | 32 | } |
src/main/java/com/bsth/service/gps/GpsServiceImpl.java
| @@ -6,11 +6,15 @@ import com.bsth.data.arrival.ArrivalEntity; | @@ -6,11 +6,15 @@ import com.bsth.data.arrival.ArrivalEntity; | ||
| 6 | import com.bsth.data.gpsdata.GpsEntity; | 6 | import com.bsth.data.gpsdata.GpsEntity; |
| 7 | import com.bsth.data.gpsdata.GpsRealData; | 7 | import com.bsth.data.gpsdata.GpsRealData; |
| 8 | import com.bsth.data.gpsdata.arrival.utils.GeoUtils; | 8 | import com.bsth.data.gpsdata.arrival.utils.GeoUtils; |
| 9 | +import com.bsth.data.safe_driv.SafeDriv; | ||
| 10 | +import com.bsth.data.safe_driv.SafeDrivCenter; | ||
| 9 | import com.bsth.data.schedule.DayOfSchedule; | 11 | import com.bsth.data.schedule.DayOfSchedule; |
| 10 | import com.bsth.entity.realcontrol.ScheduleRealInfo; | 12 | import com.bsth.entity.realcontrol.ScheduleRealInfo; |
| 11 | import com.bsth.repository.CarParkRepository; | 13 | import com.bsth.repository.CarParkRepository; |
| 12 | import com.bsth.repository.StationRepository; | 14 | import com.bsth.repository.StationRepository; |
| 13 | import com.bsth.repository.realcontrol.ScheduleRealInfoRepository; | 15 | import com.bsth.repository.realcontrol.ScheduleRealInfoRepository; |
| 16 | +import com.bsth.service.gps.entity.GpsOutbound_DTO; | ||
| 17 | +import com.bsth.service.gps.entity.GpsSpeed_DTO; | ||
| 14 | import com.bsth.service.gps.entity.HistoryGps_DTO; | 18 | import com.bsth.service.gps.entity.HistoryGps_DTO; |
| 15 | import com.bsth.service.gps.entity.Road_DTO; | 19 | import com.bsth.service.gps.entity.Road_DTO; |
| 16 | import com.bsth.util.DateUtils; | 20 | import com.bsth.util.DateUtils; |
| @@ -29,6 +33,7 @@ import java.lang.reflect.Field; | @@ -29,6 +33,7 @@ import java.lang.reflect.Field; | ||
| 29 | import java.sql.Connection; | 33 | import java.sql.Connection; |
| 30 | import java.sql.PreparedStatement; | 34 | import java.sql.PreparedStatement; |
| 31 | import java.sql.ResultSet; | 35 | import java.sql.ResultSet; |
| 36 | +import java.text.DecimalFormat; | ||
| 32 | import java.util.*; | 37 | import java.util.*; |
| 33 | 38 | ||
| 34 | @Service | 39 | @Service |
| @@ -192,7 +197,6 @@ public class GpsServiceImpl implements GpsService { | @@ -192,7 +197,6 @@ public class GpsServiceImpl implements GpsService { | ||
| 192 | return (int) (Long.parseLong(o1.get("ts").toString()) - Long.parseLong(o2.get("ts").toString())); | 197 | return (int) (Long.parseLong(o1.get("ts").toString()) - Long.parseLong(o2.get("ts").toString())); |
| 193 | } | 198 | } |
| 194 | }); | 199 | }); |
| 195 | - ; | ||
| 196 | return list; | 200 | return list; |
| 197 | } | 201 | } |
| 198 | 202 | ||
| @@ -207,10 +211,10 @@ public class GpsServiceImpl implements GpsService { | @@ -207,10 +211,10 @@ public class GpsServiceImpl implements GpsService { | ||
| 207 | inv = inv.substring(0, inv.length() - 1); | 211 | inv = inv.substring(0, inv.length() - 1); |
| 208 | 212 | ||
| 209 | // 查询到离站数据 | 213 | // 查询到离站数据 |
| 210 | - Map<String, ArrivalEntity> arrivalMap = findArrivalByTs(weekOfYear/* 30 */, st, et, inv); | 214 | + Map<String, ArrivalEntity> arrivalMap = findArrivalByTs(weekOfYear, st, et, inv); |
| 211 | 215 | ||
| 212 | 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 (" | 216 | 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 (" |
| 213 | - + inv + ") and ts > ? and ts < ?"; | 217 | + + inv + ") and ts > ? and ts < ? ORDER BY device_id,ts,stop_no"; |
| 214 | try { | 218 | try { |
| 215 | conn = DBUtils_MS.getConnection(); | 219 | conn = DBUtils_MS.getConnection(); |
| 216 | ps = conn.prepareStatement(sql); | 220 | ps = conn.prepareStatement(sql); |
| @@ -296,6 +300,9 @@ public class GpsServiceImpl implements GpsService { | @@ -296,6 +300,9 @@ public class GpsServiceImpl implements GpsService { | ||
| 296 | prefix = lineId + "_" + updown + "_"; | 300 | prefix = lineId + "_" + updown + "_"; |
| 297 | stationName = BasicData.getStationNameByCode(rs.getString("STOP_NO"), prefix); | 301 | stationName = BasicData.getStationNameByCode(rs.getString("STOP_NO"), prefix); |
| 298 | 302 | ||
| 303 | + if (StringUtils.isEmpty(stationName)) | ||
| 304 | + continue; | ||
| 305 | + | ||
| 299 | arr = new ArrivalEntity(rs.getString("DEVICE_ID"), rs.getLong("TS"), lineId, | 306 | arr = new ArrivalEntity(rs.getString("DEVICE_ID"), rs.getLong("TS"), lineId, |
| 300 | updown, rs.getString("STOP_NO"), rs.getInt("IN_OUT"), rs.getLong("CREATE_DATE"), | 307 | updown, rs.getString("STOP_NO"), rs.getInt("IN_OUT"), rs.getLong("CREATE_DATE"), |
| 301 | rs.getInt("WEEKS_YEAR"), stationName); | 308 | rs.getInt("WEEKS_YEAR"), stationName); |
| @@ -352,17 +359,12 @@ public class GpsServiceImpl implements GpsService { | @@ -352,17 +359,12 @@ public class GpsServiceImpl implements GpsService { | ||
| 352 | //过滤后的 | 359 | //过滤后的 |
| 353 | List<GpsEntity> rs = new ArrayList<>(); | 360 | List<GpsEntity> rs = new ArrayList<>(); |
| 354 | Field[] fields = GpsEntity.class.getDeclaredFields(); | 361 | Field[] fields = GpsEntity.class.getDeclaredFields(); |
| 355 | - //排序字段 | ||
| 356 | - Field orderField = null; | ||
| 357 | //参与过滤的字段 | 362 | //参与过滤的字段 |
| 358 | List<Field> fs = new ArrayList<>(); | 363 | List<Field> fs = new ArrayList<>(); |
| 359 | for (Field f : fields) { | 364 | for (Field f : fields) { |
| 360 | f.setAccessible(true); | 365 | f.setAccessible(true); |
| 361 | if (map.containsKey(f.getName())) | 366 | if (map.containsKey(f.getName())) |
| 362 | fs.add(f); | 367 | fs.add(f); |
| 363 | - | ||
| 364 | - if (f.getName().equals(order)) | ||
| 365 | - orderField = f; | ||
| 366 | } | 368 | } |
| 367 | //过滤数据 | 369 | //过滤数据 |
| 368 | for (GpsEntity gps : list) { | 370 | for (GpsEntity gps : list) { |
| @@ -370,9 +372,6 @@ public class GpsServiceImpl implements GpsService { | @@ -370,9 +372,6 @@ public class GpsServiceImpl implements GpsService { | ||
| 370 | rs.add(gps); | 372 | rs.add(gps); |
| 371 | } | 373 | } |
| 372 | 374 | ||
| 373 | - //排序 | ||
| 374 | -/* if (null != orderField) | ||
| 375 | - sortGpsList(orderField, rs);*/ | ||
| 376 | //时间戳排序 | 375 | //时间戳排序 |
| 377 | Collections.sort(rs, new Comparator<GpsEntity>() { | 376 | Collections.sort(rs, new Comparator<GpsEntity>() { |
| 378 | @Override | 377 | @Override |
| @@ -444,7 +443,7 @@ public class GpsServiceImpl implements GpsService { | @@ -444,7 +443,7 @@ public class GpsServiceImpl implements GpsService { | ||
| 444 | return rs; | 443 | return rs; |
| 445 | } | 444 | } |
| 446 | 445 | ||
| 447 | - if(sch.isReissue()){ | 446 | + if (sch.isReissue()) { |
| 448 | rs.put("status", ResponseCode.ERROR); | 447 | rs.put("status", ResponseCode.ERROR); |
| 449 | rs.put("msg", "你不能重复这个操作"); | 448 | rs.put("msg", "你不能重复这个操作"); |
| 450 | return rs; | 449 | return rs; |
| @@ -453,7 +452,7 @@ public class GpsServiceImpl implements GpsService { | @@ -453,7 +452,7 @@ public class GpsServiceImpl implements GpsService { | ||
| 453 | String sql = "select * from bsth_gps_template where line_id='" + sch.getXlBm() + "' and up_down=" + sch.getXlDir(); | 452 | String sql = "select * from bsth_gps_template where line_id='" + sch.getXlBm() + "' and up_down=" + sch.getXlDir(); |
| 454 | List<Map<String, Object>> list = jdbcTemplate.queryForList(sql); | 453 | List<Map<String, Object>> list = jdbcTemplate.queryForList(sql); |
| 455 | 454 | ||
| 456 | - if(list.size() == 0){ | 455 | + if (list.size() == 0) { |
| 457 | rs.put("status", ResponseCode.ERROR); | 456 | rs.put("status", ResponseCode.ERROR); |
| 458 | rs.put("msg", "缺少模板数据,请联系系统管理员!!"); | 457 | rs.put("msg", "缺少模板数据,请联系系统管理员!!"); |
| 459 | return rs; | 458 | return rs; |
| @@ -470,21 +469,20 @@ public class GpsServiceImpl implements GpsService { | @@ -470,21 +469,20 @@ public class GpsServiceImpl implements GpsService { | ||
| 470 | int diff = (int) (sch.getDfsjT() - Long.parseLong(fs.get("ts").toString()) - 1000 * 70); | 469 | int diff = (int) (sch.getDfsjT() - Long.parseLong(fs.get("ts").toString()) - 1000 * 70); |
| 471 | 470 | ||
| 472 | String deviceId = BasicData.deviceId2NbbmMap.inverse().get(sch.getClZbh()); | 471 | String deviceId = BasicData.deviceId2NbbmMap.inverse().get(sch.getClZbh()); |
| 473 | - for(Map<String, Object> map : list){ | 472 | + for (Map<String, Object> map : list) { |
| 474 | map.put("device_id", deviceId); | 473 | map.put("device_id", deviceId); |
| 475 | map.put("ts", Long.parseLong(map.get("ts").toString()) + diff); | 474 | map.put("ts", Long.parseLong(map.get("ts").toString()) + diff); |
| 476 | } | 475 | } |
| 477 | 476 | ||
| 478 | - String sqlBefore = "insert into bsth_c_template(" | ||
| 479 | - ,sqlValues = " values("; | 477 | + String sqlBefore = "insert into bsth_c_template(", sqlValues = " values("; |
| 480 | 478 | ||
| 481 | Set<String> ks = fs.keySet(); | 479 | Set<String> ks = fs.keySet(); |
| 482 | - for(String k : ks){ | 480 | + for (String k : ks) { |
| 483 | sqlBefore += (k + ","); | 481 | sqlBefore += (k + ","); |
| 484 | sqlValues += "?,"; | 482 | sqlValues += "?,"; |
| 485 | } | 483 | } |
| 486 | sqlBefore = sqlBefore.substring(0, sqlBefore.length() - 1) + ", create_ts)"; | 484 | sqlBefore = sqlBefore.substring(0, sqlBefore.length() - 1) + ", create_ts)"; |
| 487 | - sqlValues = sqlValues.substring(0, sqlValues.length() - 1) + ", "+System.currentTimeMillis()+")"; | 485 | + sqlValues = sqlValues.substring(0, sqlValues.length() - 1) + ", " + System.currentTimeMillis() + ")"; |
| 488 | sql = sqlBefore + " " + sqlValues; | 486 | sql = sqlBefore + " " + sqlValues; |
| 489 | 487 | ||
| 490 | Connection conn = DBUtils_MS.getConnection(); | 488 | Connection conn = DBUtils_MS.getConnection(); |
| @@ -492,9 +490,9 @@ public class GpsServiceImpl implements GpsService { | @@ -492,9 +490,9 @@ public class GpsServiceImpl implements GpsService { | ||
| 492 | ps = conn.prepareStatement(sql); | 490 | ps = conn.prepareStatement(sql); |
| 493 | int fsize = ks.size(); | 491 | int fsize = ks.size(); |
| 494 | List<Object> vs; | 492 | List<Object> vs; |
| 495 | - for(Map<String, Object> map : list){ | 493 | + for (Map<String, Object> map : list) { |
| 496 | vs = new ArrayList<>(map.values()); | 494 | vs = new ArrayList<>(map.values()); |
| 497 | - for(int i = 0; i < fsize; i ++){ | 495 | + for (int i = 0; i < fsize; i++) { |
| 498 | ps.setObject(i + 1, vs.get(i)); | 496 | ps.setObject(i + 1, vs.get(i)); |
| 499 | } | 497 | } |
| 500 | ps.addBatch(); | 498 | ps.addBatch(); |
| @@ -523,30 +521,122 @@ public class GpsServiceImpl implements GpsService { | @@ -523,30 +521,122 @@ public class GpsServiceImpl implements GpsService { | ||
| 523 | try { | 521 | try { |
| 524 | //获取历史gps 数据 | 522 | //获取历史gps 数据 |
| 525 | List<HistoryGps_DTO> list = HistoryGps_DTO.craete(history(new String[]{nbbm}, st, et)); | 523 | List<HistoryGps_DTO> list = HistoryGps_DTO.craete(history(new String[]{nbbm}, st, et)); |
| 526 | - if(list!=null && list.size() > 0){ | 524 | + if (list != null && list.size() > 0) { |
| 527 | //获取路段信息 | 525 | //获取路段信息 |
| 528 | 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)"; | 526 | 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)"; |
| 529 | List<Road_DTO> roads = Road_DTO.craete(jdbcTemplate.queryForList(sql, list.get(0).getLineId())); | 527 | List<Road_DTO> roads = Road_DTO.craete(jdbcTemplate.queryForList(sql, list.get(0).getLineId())); |
| 530 | 528 | ||
| 531 | //为GPS数据关联路段信息 | 529 | //为GPS数据关联路段信息 |
| 532 | - for(HistoryGps_DTO gps : list){ | 530 | + for (HistoryGps_DTO gps : list) { |
| 533 | matchRoadToGps(gps, roads); | 531 | matchRoadToGps(gps, roads); |
| 534 | } | 532 | } |
| 535 | } | 533 | } |
| 536 | 534 | ||
| 535 | + //超速数据 | ||
| 536 | + List<GpsSpeed_DTO> speedList = speeds(nbbm, st, et); | ||
| 537 | + //越界数据 | ||
| 538 | + List<GpsOutbound_DTO> outboundList = outbounds(nbbm, st, et); | ||
| 539 | + //计算里程 | ||
| 540 | + List<HistoryGps_DTO> effList = new ArrayList<>(); | ||
| 541 | + for(HistoryGps_DTO gps : list){ | ||
| 542 | + if(gps.getLat() != 0 && gps.getLon() != 0) | ||
| 543 | + effList.add(gps); | ||
| 544 | + } | ||
| 545 | + double sum = 0, dist; | ||
| 546 | + for (int i = 0; i < effList.size() - 1; i++) { | ||
| 547 | + dist = GeoUtils.getDistance(effList.get(i).getPoint(), effList.get(i + 1).getPoint()); | ||
| 548 | + //点位相同时,dist会NaN | ||
| 549 | + if(String.valueOf(dist).matches("^[0.0-9.0]+$")) | ||
| 550 | + sum += dist; | ||
| 551 | + } | ||
| 552 | + | ||
| 537 | rs.put("status", ResponseCode.SUCCESS); | 553 | rs.put("status", ResponseCode.SUCCESS); |
| 538 | - rs.put("list", list); | ||
| 539 | - }catch (Exception e){ | 554 | + rs.put("list", removeDuplicate(effList)); |
| 555 | + rs.put("speedList", speedList); | ||
| 556 | + rs.put("outboundList", outboundList); | ||
| 557 | + rs.put("sumMileage", new DecimalFormat(".##").format(sum / 1000)); | ||
| 558 | + } catch (Exception e) { | ||
| 540 | logger.error("", e); | 559 | logger.error("", e); |
| 541 | rs.put("status", ResponseCode.ERROR); | 560 | rs.put("status", ResponseCode.ERROR); |
| 542 | } | 561 | } |
| 543 | return rs; | 562 | return rs; |
| 544 | } | 563 | } |
| 545 | 564 | ||
| 546 | - private void matchRoadToGps(HistoryGps_DTO gps, List<Road_DTO> roads){ | ||
| 547 | - double min = -1,distance; | 565 | + @Override |
| 566 | + public List<GpsSpeed_DTO> speeds(String nbbm, long st, long et) { | ||
| 567 | + String deviceId = BasicData.deviceId2NbbmMap.inverse().get(nbbm); | ||
| 568 | + String sql = "select vehicle, line, up_down, lon, lat, speed,timestamp from bsth_c_speeding where vehicle=? and timestamp>? and timestamp<?"; | ||
| 569 | + | ||
| 570 | + return GpsSpeed_DTO.create(new JdbcTemplate(DBUtils_MS.getDataSource()).queryForList(sql, deviceId, st * 1000, et * 1000)); | ||
| 571 | + } | ||
| 572 | + | ||
| 573 | + @Override | ||
| 574 | + public List<GpsOutbound_DTO> outbounds(String nbbm, long st, long et) { | ||
| 575 | + /** | ||
| 576 | + * 如果 st 和 et 跨了周分区,也只查询st 分区的数据。 | ||
| 577 | + */ | ||
| 578 | + st = st * 1000; | ||
| 579 | + et = et * 1000; | ||
| 580 | + //按周分区 | ||
| 581 | + Calendar weekCal = Calendar.getInstance(); | ||
| 582 | + weekCal.setTimeInMillis(st); | ||
| 583 | + int weekYear = weekCal.get(Calendar.WEEK_OF_YEAR); | ||
| 584 | + //设备号 | ||
| 585 | + String deviceId = BasicData.deviceId2NbbmMap.inverse().get(nbbm); | ||
| 586 | + String sql = "select vehicle,line,up_down,lon,lat,timestamp from bsth_c_outbound where weeks_year=" + weekYear + " and vehicle=? and timestamp>? and timestamp<?"; | ||
| 587 | + return GpsOutbound_DTO.create(new JdbcTemplate(DBUtils_MS.getDataSource()).queryForList(sql, deviceId, st, et)); | ||
| 588 | + } | ||
| 589 | + | ||
| 590 | + @Override | ||
| 591 | + public Map<String, Object> safeDrivList(Map<String, Object> map, int page, int size, String order, String direction) { | ||
| 592 | + Map<String, Object> rsMap = new HashMap<>(); | ||
| 593 | + try { | ||
| 594 | + //全量 | ||
| 595 | + List<SafeDriv> list = new ArrayList<>(SafeDrivCenter.findAll()); | ||
| 596 | + //过滤后的 | ||
| 597 | + List<SafeDriv> rs = new ArrayList<>(); | ||
| 598 | + Field[] fields = SafeDriv.class.getDeclaredFields(); | ||
| 599 | + //参与过滤的字段 | ||
| 600 | + List<Field> fs = new ArrayList<>(); | ||
| 601 | + for (Field f : fields) { | ||
| 602 | + f.setAccessible(true); | ||
| 603 | + if (map.containsKey(f.getName())) | ||
| 604 | + fs.add(f); | ||
| 605 | + } | ||
| 606 | + //过滤数据 | ||
| 607 | + for (SafeDriv sd : list) { | ||
| 608 | + if (fieldEquals(fs, sd, map)) | ||
| 609 | + rs.add(sd); | ||
| 610 | + } | ||
| 611 | + | ||
| 612 | + //时间戳排序 | ||
| 613 | + Collections.sort(rs, new Comparator<SafeDriv>() { | ||
| 614 | + @Override | ||
| 615 | + public int compare(SafeDriv o1, SafeDriv o2) { | ||
| 616 | + return o2.getTs().intValue() - o1.getTs().intValue(); | ||
| 617 | + } | ||
| 618 | + }); | ||
| 619 | + | ||
| 620 | + //分页 | ||
| 621 | + int count = rs.size(), s = page * size, e = s + size; | ||
| 622 | + if (e > count) | ||
| 623 | + e = count; | ||
| 624 | + | ||
| 625 | + rsMap.put("list", rs.subList(s, e)); | ||
| 626 | + rsMap.put("totalPages", count % size == 0 ? count / size - 1 : count / size); | ||
| 627 | + rsMap.put("page", page); | ||
| 628 | + rsMap.put("status", ResponseCode.SUCCESS); | ||
| 629 | + } catch (Exception e) { | ||
| 630 | + logger.error("", e); | ||
| 631 | + rsMap.put("status", ResponseCode.ERROR); | ||
| 632 | + } | ||
| 633 | + return rsMap; | ||
| 634 | + } | ||
| 635 | + | ||
| 636 | + private void matchRoadToGps(HistoryGps_DTO gps, List<Road_DTO> roads) { | ||
| 637 | + double min = -1, distance; | ||
| 548 | Road_DTO nearRoad = null; | 638 | Road_DTO nearRoad = null; |
| 549 | - for(Road_DTO road : roads){ | 639 | + for (Road_DTO road : roads) { |
| 550 | distance = GeoUtils.getDistanceFromLine(road.getLineStr(), gps.getPoint()); | 640 | distance = GeoUtils.getDistanceFromLine(road.getLineStr(), gps.getPoint()); |
| 551 | 641 | ||
| 552 | if (min > distance || min == -1) { | 642 | if (min > distance || min == -1) { |
| @@ -559,6 +649,20 @@ public class GpsServiceImpl implements GpsService { | @@ -559,6 +649,20 @@ public class GpsServiceImpl implements GpsService { | ||
| 559 | gps.setRoadMinDistance(min); | 649 | gps.setRoadMinDistance(min); |
| 560 | } | 650 | } |
| 561 | 651 | ||
| 652 | + /** | ||
| 653 | + * 去重复 | ||
| 654 | + * | ||
| 655 | + * @param list | ||
| 656 | + * @return | ||
| 657 | + */ | ||
| 658 | + private Set<HistoryGps_DTO> removeDuplicate(List<HistoryGps_DTO> list) { | ||
| 659 | + Set<HistoryGps_DTO> set = new HashSet<>(); | ||
| 660 | + for (HistoryGps_DTO gps : list) { | ||
| 661 | + set.add(gps); | ||
| 662 | + } | ||
| 663 | + return set; | ||
| 664 | + } | ||
| 665 | + | ||
| 562 | private void sortGpsList(final Field f, List<GpsEntity> rs) { | 666 | private void sortGpsList(final Field f, List<GpsEntity> rs) { |
| 563 | Collections.sort(rs, new Comparator<GpsEntity>() { | 667 | Collections.sort(rs, new Comparator<GpsEntity>() { |
| 564 | 668 |
src/main/java/com/bsth/service/gps/entity/GpsOutbound.java
0 → 100644
| 1 | +package com.bsth.service.gps.entity; | ||
| 2 | + | ||
| 3 | +/** | ||
| 4 | + * 越界异常 --ms数据库格式 | ||
| 5 | + * Created by panzhao on 2017/4/9. | ||
| 6 | + */ | ||
| 7 | +public class GpsOutbound { | ||
| 8 | + | ||
| 9 | + private String vehicle; | ||
| 10 | + | ||
| 11 | + private String line; | ||
| 12 | + | ||
| 13 | + private int up_down; | ||
| 14 | + | ||
| 15 | + private float lon; | ||
| 16 | + | ||
| 17 | + private float lat; | ||
| 18 | + | ||
| 19 | + private long timestamp; | ||
| 20 | + | ||
| 21 | + public String location(){ | ||
| 22 | + return lon + "," + lat; | ||
| 23 | + } | ||
| 24 | + | ||
| 25 | + public String getVehicle() { | ||
| 26 | + return vehicle; | ||
| 27 | + } | ||
| 28 | + | ||
| 29 | + public void setVehicle(String vehicle) { | ||
| 30 | + this.vehicle = vehicle; | ||
| 31 | + } | ||
| 32 | + | ||
| 33 | + public String getLine() { | ||
| 34 | + return line; | ||
| 35 | + } | ||
| 36 | + | ||
| 37 | + public void setLine(String line) { | ||
| 38 | + this.line = line; | ||
| 39 | + } | ||
| 40 | + | ||
| 41 | + public int getUp_down() { | ||
| 42 | + return up_down; | ||
| 43 | + } | ||
| 44 | + | ||
| 45 | + public void setUp_down(int up_down) { | ||
| 46 | + this.up_down = up_down; | ||
| 47 | + } | ||
| 48 | + | ||
| 49 | + public float getLon() { | ||
| 50 | + return lon; | ||
| 51 | + } | ||
| 52 | + | ||
| 53 | + public void setLon(float lon) { | ||
| 54 | + this.lon = lon; | ||
| 55 | + } | ||
| 56 | + | ||
| 57 | + public float getLat() { | ||
| 58 | + return lat; | ||
| 59 | + } | ||
| 60 | + | ||
| 61 | + public void setLat(float lat) { | ||
| 62 | + this.lat = lat; | ||
| 63 | + } | ||
| 64 | + | ||
| 65 | + public long getTimestamp() { | ||
| 66 | + return timestamp; | ||
| 67 | + } | ||
| 68 | + | ||
| 69 | + public void setTimestamp(long timestamp) { | ||
| 70 | + this.timestamp = timestamp; | ||
| 71 | + } | ||
| 72 | +} |
src/main/java/com/bsth/service/gps/entity/GpsOutbound_DTO.java
0 → 100644
| 1 | +package com.bsth.service.gps.entity; | ||
| 2 | + | ||
| 3 | +import com.alibaba.fastjson.JSON; | ||
| 4 | +import com.alibaba.fastjson.JSONObject; | ||
| 5 | +import com.bsth.data.BasicData; | ||
| 6 | + | ||
| 7 | +import java.util.*; | ||
| 8 | + | ||
| 9 | +/** | ||
| 10 | + * 越界异常 dto | ||
| 11 | + * Created by panzhao on 2017/4/7. | ||
| 12 | + */ | ||
| 13 | +public class GpsOutbound_DTO { | ||
| 14 | + | ||
| 15 | + public static List<GpsOutbound_DTO> create(List<Map<String, Object>> mapList){ | ||
| 16 | + //默认都是一辆车的数据 | ||
| 17 | + List<GpsOutbound> list = JSONObject.parseArray(JSON.toJSONString(mapList), GpsOutbound.class); | ||
| 18 | + GpsOutbound outbound; | ||
| 19 | + | ||
| 20 | + //排序 | ||
| 21 | + Collections.sort(list, new Comparator<GpsOutbound>() { | ||
| 22 | + @Override | ||
| 23 | + public int compare(GpsOutbound o1, GpsOutbound o2) { | ||
| 24 | + return (int) (o1.getTimestamp() - o2.getTimestamp()); | ||
| 25 | + } | ||
| 26 | + }); | ||
| 27 | + | ||
| 28 | + int space = 1000 * 60; | ||
| 29 | + int size = list.size(); | ||
| 30 | + StringBuffer locations = new StringBuffer(""); | ||
| 31 | + | ||
| 32 | + List<GpsOutbound_DTO> rsList = new ArrayList<>(); | ||
| 33 | + GpsOutbound_DTO dto = null; | ||
| 34 | + | ||
| 35 | + for(int i = 0; i < size; i++){ | ||
| 36 | + outbound = list.get(i); | ||
| 37 | + locations.append(outbound.location() + ";"); | ||
| 38 | + if(dto == null){ | ||
| 39 | + dto = new GpsOutbound_DTO(); | ||
| 40 | + dto.setDeviceId(outbound.getVehicle()); | ||
| 41 | + dto.setNbbm(BasicData.deviceId2NbbmMap.get(outbound.getVehicle())); | ||
| 42 | + dto.setSt(outbound.getTimestamp()); | ||
| 43 | + } | ||
| 44 | + else{ | ||
| 45 | + //越界结束 | ||
| 46 | + if((i < size - 1 && list.get(i + 1).getTimestamp() - outbound.getTimestamp() > space)){ | ||
| 47 | + dto.setEt(outbound.getTimestamp()); | ||
| 48 | + dto.setLocations(locations.toString()); | ||
| 49 | + | ||
| 50 | + rsList.add(dto); | ||
| 51 | + dto = null; | ||
| 52 | + locations = new StringBuffer(""); | ||
| 53 | + continue; | ||
| 54 | + } | ||
| 55 | + | ||
| 56 | + if(i == size - 1) | ||
| 57 | + rsList.add(dto); | ||
| 58 | + } | ||
| 59 | + } | ||
| 60 | + | ||
| 61 | + return rsList; | ||
| 62 | + } | ||
| 63 | + | ||
| 64 | + /** | ||
| 65 | + * 设备号 | ||
| 66 | + */ | ||
| 67 | + private String deviceId; | ||
| 68 | + | ||
| 69 | + /** | ||
| 70 | + * 自编号 | ||
| 71 | + */ | ||
| 72 | + private String nbbm; | ||
| 73 | + | ||
| 74 | + /** | ||
| 75 | + * 越界开始时间 | ||
| 76 | + */ | ||
| 77 | + private long st; | ||
| 78 | + | ||
| 79 | + /** | ||
| 80 | + * 越界结束时间 | ||
| 81 | + */ | ||
| 82 | + private long et; | ||
| 83 | + | ||
| 84 | + /** | ||
| 85 | + * 越界点位集合 | ||
| 86 | + */ | ||
| 87 | + private String locations; | ||
| 88 | + | ||
| 89 | + private String abnormalType = "outbound"; | ||
| 90 | + | ||
| 91 | + public String getDeviceId() { | ||
| 92 | + return deviceId; | ||
| 93 | + } | ||
| 94 | + | ||
| 95 | + public void setDeviceId(String deviceId) { | ||
| 96 | + this.deviceId = deviceId; | ||
| 97 | + } | ||
| 98 | + | ||
| 99 | + public String getNbbm() { | ||
| 100 | + return nbbm; | ||
| 101 | + } | ||
| 102 | + | ||
| 103 | + public void setNbbm(String nbbm) { | ||
| 104 | + this.nbbm = nbbm; | ||
| 105 | + } | ||
| 106 | + | ||
| 107 | + public long getSt() { | ||
| 108 | + return st; | ||
| 109 | + } | ||
| 110 | + | ||
| 111 | + public void setSt(long st) { | ||
| 112 | + this.st = st; | ||
| 113 | + } | ||
| 114 | + | ||
| 115 | + public long getEt() { | ||
| 116 | + return et; | ||
| 117 | + } | ||
| 118 | + | ||
| 119 | + public void setEt(long et) { | ||
| 120 | + this.et = et; | ||
| 121 | + } | ||
| 122 | + | ||
| 123 | + public String getLocations() { | ||
| 124 | + return locations; | ||
| 125 | + } | ||
| 126 | + | ||
| 127 | + public void setLocations(String locations) { | ||
| 128 | + this.locations = locations; | ||
| 129 | + } | ||
| 130 | + | ||
| 131 | + public String getAbnormalType() { | ||
| 132 | + return abnormalType; | ||
| 133 | + } | ||
| 134 | + | ||
| 135 | + public void setAbnormalType(String abnormalType) { | ||
| 136 | + this.abnormalType = abnormalType; | ||
| 137 | + } | ||
| 138 | +} |
src/main/java/com/bsth/service/gps/entity/GpsSpeed.java
0 → 100644
| 1 | +package com.bsth.service.gps.entity; | ||
| 2 | + | ||
| 3 | +/** | ||
| 4 | + * 超速异常 -ms数据库格式 | ||
| 5 | + * Created by panzhao on 2017/4/7. | ||
| 6 | + */ | ||
| 7 | +public class GpsSpeed { | ||
| 8 | + | ||
| 9 | + private String vehicle; | ||
| 10 | + | ||
| 11 | + private String line; | ||
| 12 | + | ||
| 13 | + private int up_down; | ||
| 14 | + | ||
| 15 | + private float lon; | ||
| 16 | + | ||
| 17 | + private float lat; | ||
| 18 | + | ||
| 19 | + private float speed; | ||
| 20 | + | ||
| 21 | + private long timestamp; | ||
| 22 | + | ||
| 23 | + public String getVehicle() { | ||
| 24 | + return vehicle; | ||
| 25 | + } | ||
| 26 | + | ||
| 27 | + public void setVehicle(String vehicle) { | ||
| 28 | + this.vehicle = vehicle; | ||
| 29 | + } | ||
| 30 | + | ||
| 31 | + public String getLine() { | ||
| 32 | + return line; | ||
| 33 | + } | ||
| 34 | + | ||
| 35 | + public void setLine(String line) { | ||
| 36 | + this.line = line; | ||
| 37 | + } | ||
| 38 | + | ||
| 39 | + public int getUp_down() { | ||
| 40 | + return up_down; | ||
| 41 | + } | ||
| 42 | + | ||
| 43 | + public void setUp_down(int up_down) { | ||
| 44 | + this.up_down = up_down; | ||
| 45 | + } | ||
| 46 | + | ||
| 47 | + public float getLon() { | ||
| 48 | + return lon; | ||
| 49 | + } | ||
| 50 | + | ||
| 51 | + public void setLon(float lon) { | ||
| 52 | + this.lon = lon; | ||
| 53 | + } | ||
| 54 | + | ||
| 55 | + public float getLat() { | ||
| 56 | + return lat; | ||
| 57 | + } | ||
| 58 | + | ||
| 59 | + public void setLat(float lat) { | ||
| 60 | + this.lat = lat; | ||
| 61 | + } | ||
| 62 | + | ||
| 63 | + public float getSpeed() { | ||
| 64 | + return speed; | ||
| 65 | + } | ||
| 66 | + | ||
| 67 | + public void setSpeed(float speed) { | ||
| 68 | + this.speed = speed; | ||
| 69 | + } | ||
| 70 | + | ||
| 71 | + public long getTimestamp() { | ||
| 72 | + return timestamp; | ||
| 73 | + } | ||
| 74 | + | ||
| 75 | + public void setTimestamp(long timestamp) { | ||
| 76 | + this.timestamp = timestamp; | ||
| 77 | + } | ||
| 78 | +} |
src/main/java/com/bsth/service/gps/entity/GpsSpeed_DTO.java
0 → 100644
| 1 | +package com.bsth.service.gps.entity; | ||
| 2 | + | ||
| 3 | +import com.alibaba.fastjson.JSON; | ||
| 4 | +import com.alibaba.fastjson.JSONObject; | ||
| 5 | +import com.bsth.data.BasicData; | ||
| 6 | + | ||
| 7 | +import java.util.*; | ||
| 8 | + | ||
| 9 | +/** | ||
| 10 | + * 超速异常 dto | ||
| 11 | + * Created by panzhao on 2017/4/7. | ||
| 12 | + */ | ||
| 13 | +public class GpsSpeed_DTO { | ||
| 14 | + | ||
| 15 | + public static List<GpsSpeed_DTO> create(List<Map<String, Object>> mapList){ | ||
| 16 | + //默认都是一辆车的数据 | ||
| 17 | + List<GpsSpeed> list = JSONObject.parseArray(JSON.toJSONString(mapList), GpsSpeed.class); | ||
| 18 | + GpsSpeed gs; | ||
| 19 | + //排序 | ||
| 20 | + Collections.sort(list, new Comparator<GpsSpeed>() { | ||
| 21 | + @Override | ||
| 22 | + public int compare(GpsSpeed o1, GpsSpeed o2) { | ||
| 23 | + return (int) (o1.getTimestamp() - o2.getTimestamp()); | ||
| 24 | + } | ||
| 25 | + }); | ||
| 26 | + | ||
| 27 | + int space = 1000 * 60; | ||
| 28 | + int size = list.size(); | ||
| 29 | + | ||
| 30 | + List<GpsSpeed_DTO> rsList = new ArrayList<>(); | ||
| 31 | + GpsSpeed_DTO dto = null; | ||
| 32 | + | ||
| 33 | + for(int i = 0; i < size; i++){ | ||
| 34 | + gs = list.get(i); | ||
| 35 | + if(dto == null){ | ||
| 36 | + dto = new GpsSpeed_DTO(); | ||
| 37 | + dto.setDeviceId(gs.getVehicle()); | ||
| 38 | + dto.setNbbm(BasicData.deviceId2NbbmMap.get(gs.getVehicle())); | ||
| 39 | + dto.setSt(gs.getTimestamp()); | ||
| 40 | + dto.setSpeed(gs.getSpeed()); | ||
| 41 | + } | ||
| 42 | + else{ | ||
| 43 | + //超速结束 | ||
| 44 | + if((i < size - 1 && list.get(i + 1).getTimestamp() - gs.getTimestamp() > space)){ | ||
| 45 | + dto.setEt(gs.getTimestamp()); | ||
| 46 | + rsList.add(dto); | ||
| 47 | + dto = null; | ||
| 48 | + continue; | ||
| 49 | + } | ||
| 50 | + | ||
| 51 | + //记录最大速度 | ||
| 52 | + if(gs.getSpeed() > dto.getSpeed()) | ||
| 53 | + dto.setSpeed(gs.getSpeed()); | ||
| 54 | + | ||
| 55 | + if(i == size - 1) | ||
| 56 | + rsList.add(dto); | ||
| 57 | + } | ||
| 58 | + } | ||
| 59 | + return rsList; | ||
| 60 | + } | ||
| 61 | + | ||
| 62 | + /** | ||
| 63 | + * 设备号 | ||
| 64 | + */ | ||
| 65 | + private String deviceId; | ||
| 66 | + | ||
| 67 | + /** | ||
| 68 | + * 自编号 | ||
| 69 | + */ | ||
| 70 | + private String nbbm; | ||
| 71 | + | ||
| 72 | + /** | ||
| 73 | + * 超速开始时间 | ||
| 74 | + */ | ||
| 75 | + private long st; | ||
| 76 | + | ||
| 77 | + /** | ||
| 78 | + * 超速结束时间 | ||
| 79 | + */ | ||
| 80 | + private long et; | ||
| 81 | + | ||
| 82 | + /** | ||
| 83 | + * 速度 | ||
| 84 | + */ | ||
| 85 | + private float speed; | ||
| 86 | + | ||
| 87 | + private String abnormalType = "speed"; | ||
| 88 | + | ||
| 89 | + public String getDeviceId() { | ||
| 90 | + return deviceId; | ||
| 91 | + } | ||
| 92 | + | ||
| 93 | + public void setDeviceId(String deviceId) { | ||
| 94 | + this.deviceId = deviceId; | ||
| 95 | + } | ||
| 96 | + | ||
| 97 | + public String getNbbm() { | ||
| 98 | + return nbbm; | ||
| 99 | + } | ||
| 100 | + | ||
| 101 | + public void setNbbm(String nbbm) { | ||
| 102 | + this.nbbm = nbbm; | ||
| 103 | + } | ||
| 104 | + | ||
| 105 | + public long getSt() { | ||
| 106 | + return st; | ||
| 107 | + } | ||
| 108 | + | ||
| 109 | + public void setSt(long st) { | ||
| 110 | + this.st = st; | ||
| 111 | + } | ||
| 112 | + | ||
| 113 | + public long getEt() { | ||
| 114 | + return et; | ||
| 115 | + } | ||
| 116 | + | ||
| 117 | + public void setEt(long et) { | ||
| 118 | + this.et = et; | ||
| 119 | + } | ||
| 120 | + | ||
| 121 | + public float getSpeed() { | ||
| 122 | + return speed; | ||
| 123 | + } | ||
| 124 | + | ||
| 125 | + public void setSpeed(float speed) { | ||
| 126 | + this.speed = speed; | ||
| 127 | + } | ||
| 128 | + | ||
| 129 | + public String getAbnormalType() { | ||
| 130 | + return abnormalType; | ||
| 131 | + } | ||
| 132 | + | ||
| 133 | + public void setAbnormalType(String abnormalType) { | ||
| 134 | + this.abnormalType = abnormalType; | ||
| 135 | + } | ||
| 136 | +} |
src/main/java/com/bsth/service/gps/entity/HistoryGps_DTO.java
| @@ -17,20 +17,20 @@ import java.util.Map; | @@ -17,20 +17,20 @@ import java.util.Map; | ||
| 17 | */ | 17 | */ |
| 18 | public class HistoryGps_DTO { | 18 | public class HistoryGps_DTO { |
| 19 | 19 | ||
| 20 | - public static List<HistoryGps_DTO> craete(List<Map<String, Object>> mapList){ | 20 | + public static List<HistoryGps_DTO> craete(List<Map<String, Object>> mapList) { |
| 21 | List<HistoryGps_DTO> list = JSONObject.parseArray(JSON.toJSONString(mapList), HistoryGps_DTO.class); | 21 | List<HistoryGps_DTO> list = JSONObject.parseArray(JSON.toJSONString(mapList), HistoryGps_DTO.class); |
| 22 | 22 | ||
| 23 | GeometryFactory geometryFactory = new GeometryFactory(); | 23 | GeometryFactory geometryFactory = new GeometryFactory(); |
| 24 | Point point; | 24 | Point point; |
| 25 | - for(HistoryGps_DTO gps : list){ | 25 | + for (HistoryGps_DTO gps : list) { |
| 26 | point = geometryFactory.createPoint(new Coordinate(gps.getLat(), gps.getLon())); | 26 | point = geometryFactory.createPoint(new Coordinate(gps.getLat(), gps.getLon())); |
| 27 | gps.setPoint(point); | 27 | gps.setPoint(point); |
| 28 | } | 28 | } |
| 29 | return list; | 29 | return list; |
| 30 | } | 30 | } |
| 31 | 31 | ||
| 32 | - private double gcj_lon; | ||
| 33 | - private double gcj_lat; | 32 | + //private double gcj_lon; |
| 33 | + //private double gcj_lat; | ||
| 34 | 34 | ||
| 35 | private double bd_lon; | 35 | private double bd_lon; |
| 36 | private double bd_lat; | 36 | private double bd_lat; |
| @@ -56,12 +56,33 @@ public class HistoryGps_DTO { | @@ -56,12 +56,33 @@ public class HistoryGps_DTO { | ||
| 56 | @JsonIgnore | 56 | @JsonIgnore |
| 57 | private Point point; | 57 | private Point point; |
| 58 | 58 | ||
| 59 | - /** 路段 */ | 59 | + /** |
| 60 | + * 路段 | ||
| 61 | + */ | ||
| 60 | private Road_DTO road; | 62 | private Road_DTO road; |
| 61 | - /** 和路段的最短距离 */ | 63 | + /** |
| 64 | + * 和路段的最短距离 | ||
| 65 | + */ | ||
| 62 | private double roadMinDistance; | 66 | private double roadMinDistance; |
| 63 | 67 | ||
| 64 | - public double getGcj_lon() { | 68 | + @Override |
| 69 | + public int hashCode() { | ||
| 70 | + return this.toString().hashCode(); | ||
| 71 | + } | ||
| 72 | + | ||
| 73 | + @Override | ||
| 74 | + public boolean equals(Object obj) { | ||
| 75 | + HistoryGps_DTO g2 = (HistoryGps_DTO) obj; | ||
| 76 | + return this.toString().equals(g2.toString()); | ||
| 77 | + } | ||
| 78 | + | ||
| 79 | + | ||
| 80 | + @Override | ||
| 81 | + public String toString() { | ||
| 82 | + return (this.getDeviceId() + "_" + (inout_stop_info==null?this.getStopNo():inout_stop_info.getStopName()) + "_" + this.getTs() + "_" + this.getLon() + "_" + this.getLat()); | ||
| 83 | + } | ||
| 84 | + | ||
| 85 | +/* public double getGcj_lon() { | ||
| 65 | return gcj_lon; | 86 | return gcj_lon; |
| 66 | } | 87 | } |
| 67 | 88 | ||
| @@ -75,7 +96,7 @@ public class HistoryGps_DTO { | @@ -75,7 +96,7 @@ public class HistoryGps_DTO { | ||
| 75 | 96 | ||
| 76 | public void setGcj_lat(double gcj_lat) { | 97 | public void setGcj_lat(double gcj_lat) { |
| 77 | this.gcj_lat = gcj_lat; | 98 | this.gcj_lat = gcj_lat; |
| 78 | - } | 99 | + }*/ |
| 79 | 100 | ||
| 80 | public double getBd_lon() { | 101 | public double getBd_lon() { |
| 81 | return bd_lon; | 102 | return bd_lon; |
src/main/java/com/bsth/service/oil/DlbService.java
| @@ -18,4 +18,6 @@ public interface DlbService extends BaseService<Dlb, Integer>{ | @@ -18,4 +18,6 @@ public interface DlbService extends BaseService<Dlb, Integer>{ | ||
| 18 | Map<String, Object> sumYlb(Map<String, Object> map); | 18 | Map<String, Object> sumYlb(Map<String, Object> map); |
| 19 | 19 | ||
| 20 | Map<String, Object> saveDlbList(Map<String, Object> map) throws Exception; | 20 | Map<String, Object> saveDlbList(Map<String, Object> map) throws Exception; |
| 21 | + | ||
| 22 | + String obtainDsq() throws Exception; | ||
| 21 | } | 23 | } |
src/main/java/com/bsth/service/oil/impl/DlbServiceImpl.java
| @@ -6,6 +6,7 @@ import java.text.DecimalFormat; | @@ -6,6 +6,7 @@ import java.text.DecimalFormat; | ||
| 6 | import java.text.ParseException; | 6 | import java.text.ParseException; |
| 7 | import java.text.SimpleDateFormat; | 7 | import java.text.SimpleDateFormat; |
| 8 | import java.util.ArrayList; | 8 | import java.util.ArrayList; |
| 9 | +import java.util.Calendar; | ||
| 9 | import java.util.Date; | 10 | import java.util.Date; |
| 10 | import java.util.HashMap; | 11 | import java.util.HashMap; |
| 11 | import java.util.Iterator; | 12 | import java.util.Iterator; |
| @@ -70,8 +71,144 @@ public class DlbServiceImpl extends BaseServiceImpl<Dlb,Integer> implements DlbS | @@ -70,8 +71,144 @@ public class DlbServiceImpl extends BaseServiceImpl<Dlb,Integer> implements DlbS | ||
| 70 | JdbcTemplate jdbcTemplate; | 71 | JdbcTemplate jdbcTemplate; |
| 71 | 72 | ||
| 72 | Logger logger = LoggerFactory.getLogger(this.getClass()); | 73 | Logger logger = LoggerFactory.getLogger(this.getClass()); |
| 74 | + | ||
| 75 | + @Transactional | ||
| 76 | + @Override | ||
| 77 | + public String obtainDsq() throws Exception{ | ||
| 78 | + String result = "failure"; | ||
| 79 | + List<Cars> carsList=carsRepository.findCars(); | ||
| 80 | + Map<String, Boolean> carsMap=new HashMap<String, Boolean>(); | ||
| 81 | + for (int i = 0; i < carsList.size(); i++) { | ||
| 82 | + Cars c=carsList.get(i); | ||
| 83 | + carsMap.put(c.getInsideCode(), c.getSfdc()); | ||
| 84 | + } | ||
| 85 | + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd"); | ||
| 86 | + Date dNow = new Date(); //当前时间 | ||
| 87 | + Date dBefore = new Date(); | ||
| 88 | + Calendar calendar = Calendar.getInstance(); //得到日历 | ||
| 89 | + calendar.setTime(dNow);//把当前时间赋给日历 | ||
| 90 | + calendar.add(Calendar.DAY_OF_MONTH, -1); //设置为前一天 | ||
| 91 | + dBefore = calendar.getTime(); //得到前一天的时间 | ||
| 92 | + String rq=sdf.format(dBefore); | ||
| 93 | + String line=""; | ||
| 94 | + //保留两位小数 | ||
| 95 | + DecimalFormat df = new DecimalFormat("#.00"); | ||
| 96 | + // TODO Auto-generated method stub | ||
| 97 | + Map<String, Object> newMap=new HashMap<String,Object>(); | ||
| 98 | + //当天DLB信息 | ||
| 99 | + List<Dlb> dlList=repository.obtainDl(rq, "", "", line, "", "nbbm"); | ||
| 100 | + //当天YLXXB信息 | ||
| 101 | + List<Ylxxb> ylxxList=ylxxbRepository.obtainYlxx(rq,1,""); | ||
| 102 | + //当天加电信息表 | ||
| 103 | + List<Jdl> jdlList=jdlRepository.JdlList(rq); | ||
| 104 | + //前一天所有车辆最后进场班次信息 | ||
| 105 | + List<Dlb> dlListBe=repository.obtainYlbefore(rq, "", "", "", ""); | ||
| 106 | + List<Cdl> cdyList=cdlRepository.obtainCdl(); | ||
| 107 | + //从排班表中计算出行驶的总里程 | ||
| 108 | + List<Map<String,Object>> listpb=scheduleRealInfoService.yesterdayDataList(line,rq,"","","",""); | ||
| 109 | + List<Ylb> addList=new ArrayList<Ylb>(); | ||
| 110 | + List<Ylb> updateList=new ArrayList<Ylb>(); | ||
| 111 | + for(int x=0;x<listpb.size();x++){ | ||
| 112 | + String type="add"; | ||
| 113 | + boolean sfdc=false; | ||
| 114 | + Map<String, Object> map=listpb.get(x); | ||
| 115 | + if (carsMap.get(map.get("clZbh").toString())!=null) { | ||
| 116 | + sfdc= carsMap.get(map.get("clZbh").toString()); | ||
| 117 | + }else{ | ||
| 118 | + sfdc=false; | ||
| 119 | + } | ||
| 120 | + if(sfdc){ | ||
| 121 | + //判断驾驶员驾驶的该车辆是否已经存入了(查出的结果集中日期是相同的,根据驾驶员、内部编号、线路编码判断) | ||
| 122 | + Dlb t=new Dlb(); | ||
| 123 | + for(int k=0;k<dlList.size();k++){ | ||
| 124 | + Dlb t1=dlList.get(k); | ||
| 125 | + if(t1.getNbbm().equals(map.get("clZbh").toString()) | ||
| 126 | + &&t1.getJsy().equals(map.get("jGh").toString()) | ||
| 127 | + &&t1.getXlbm().equals(map.get("xlBm").toString())) | ||
| 128 | + { | ||
| 129 | + t=t1; | ||
| 130 | + type="update"; | ||
| 131 | + } | ||
| 132 | + } | ||
| 133 | + try { | ||
| 134 | + //当日的第一个班次,出场油量等于前一天的最后一个班次的进场油量 | ||
| 135 | + Double jzl=0.0; | ||
| 136 | + if(map.get("seqNumber").toString().equals("1")){ | ||
| 137 | + boolean fage=true; | ||
| 138 | + for (int i = 0; i < dlListBe.size(); i++) { | ||
| 139 | + Dlb dlb=dlListBe.get(i); | ||
| 140 | + if(map.get("clZbh").toString().equals(dlb.getNbbm())){ | ||
| 141 | + t.setCzcd(dlb.getJzcd()); | ||
| 142 | + fage=false; | ||
| 143 | + break; | ||
| 144 | + } | ||
| 145 | + } | ||
| 146 | + if(fage){ | ||
| 147 | + for (int y = 0; y < cdyList.size(); y++) { | ||
| 148 | + Cdl cdl=cdyList.get(y); | ||
| 149 | + if(map.get("clZbh").toString().equals(cdl.getNbbm())){ | ||
| 150 | + t.setCzcd(cdl.getClcd()==null?0:cdl.getClcd()); | ||
| 151 | + fage=false; | ||
| 152 | + break; | ||
| 153 | + } | ||
| 154 | + } | ||
| 155 | + } | ||
| 156 | + if(fage){ | ||
| 157 | + t.setCzcd(0.0); | ||
| 158 | + } | ||
| 159 | + | ||
| 160 | + //手动导入没有驾驶员工号 | ||
| 161 | + for (int i = 0; i < jdlList.size(); i++) { | ||
| 162 | + Jdl jdl=jdlList.get(i); | ||
| 163 | + if(map.get("clZbh").toString().equals(jdl.getNbbm()) ){ | ||
| 164 | + jzl+=jdl.getJdl(); | ||
| 165 | + } | ||
| 166 | + } | ||
| 167 | + } | ||
| 168 | + | ||
| 169 | + | ||
| 170 | + //把当天的YLXXB的加注量设置为当天YLB的加注量(根据车号,驾驶员判断) | ||
| 171 | + for(int j=0;j<ylxxList.size();j++){ | ||
| 172 | + Ylxxb ylxxb= ylxxList.get(j); | ||
| 173 | + if(map.get("clZbh").toString().equals(ylxxb.getNbbm()) &&map.get("jGh").toString().equals(ylxxb.getJsy())){ | ||
| 174 | + jzl+=ylxxb.getJzl(); | ||
| 175 | + } | ||
| 176 | + } | ||
| 177 | + | ||
| 178 | + t.setCdl(jzl); | ||
| 179 | + if(type.equals("add")){ | ||
| 180 | + t.setHd(jzl); | ||
| 181 | + t.setJzcd(t.getCzcd()); | ||
| 182 | + } | ||
| 183 | + | ||
| 184 | + t.setNbbm(map.get("clZbh").toString()); | ||
| 185 | + t.setJsy(map.get("jGh")==null?"":map.get("jGh").toString()); | ||
| 186 | + t.setZlc(map.get("totalKilometers")==null?0.0:Double.parseDouble(df.format(Double.parseDouble(map.get("totalKilometers").toString())))); | ||
| 187 | + t.setXlbm(map.get("xlBm")==null?"":map.get("xlBm").toString()); | ||
| 188 | + t.setJcsx(Integer.parseInt(map.get("seqNumber").toString())); | ||
| 189 | + t.setSsgsdm(map.get("company")==null?"":map.get("company").toString()); | ||
| 190 | + t.setFgsdm(map.get("bCompany")==null?"":map.get("bCompany").toString()); | ||
| 191 | + t.setJhsj(map.get("fcsj")==null?"":map.get("fcsj").toString()); | ||
| 192 | + t.setRq(sdf.parse(rq)); | ||
| 193 | + t.setCreatetime(new Date()); | ||
| 194 | + /*if(type.equals("add")){ | ||
| 195 | + addList.add(t); | ||
| 196 | + }else{ | ||
| 197 | + updateList.add(t); | ||
| 198 | + }*/ | ||
| 199 | + repository.save(t); | ||
| 200 | + newMap.put("status", ResponseCode.SUCCESS); | ||
| 201 | + } catch (ParseException e) { | ||
| 202 | + // TODO Auto-generated catch block | ||
| 203 | + newMap.put("status", ResponseCode.ERROR); | ||
| 204 | + e.printStackTrace(); | ||
| 205 | + } | ||
| 206 | + } | ||
| 207 | + } | ||
| 208 | + return result; | ||
| 209 | + } | ||
| 73 | /** | 210 | /** |
| 74 | - * 获取进存油信息 | 211 | + * 获取进存电信息 |
| 75 | * @Transactional 回滚事物 | 212 | * @Transactional 回滚事物 |
| 76 | */ | 213 | */ |
| 77 | @Transactional | 214 | @Transactional |
src/main/java/com/bsth/service/oil/impl/YlbServiceImpl.java
| @@ -135,9 +135,11 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | @@ -135,9 +135,11 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | ||
| 135 | Ylb ylb=ylListBe.get(i); | 135 | Ylb ylb=ylListBe.get(i); |
| 136 | if(map.get("clZbh").toString().equals(ylb.getNbbm())){ | 136 | if(map.get("clZbh").toString().equals(ylb.getNbbm())){ |
| 137 | if(ylb.getJzyl()!=null){ | 137 | if(ylb.getJzyl()!=null){ |
| 138 | - t.setCzyl(ylb.getJzyl()); | ||
| 139 | - fage=false; | ||
| 140 | - break; | 138 | + if(ylb.getJzyl()>0){ |
| 139 | + t.setCzyl(ylb.getJzyl()); | ||
| 140 | + fage=false; | ||
| 141 | + break; | ||
| 142 | + } | ||
| 141 | } | 143 | } |
| 142 | 144 | ||
| 143 | } | 145 | } |
| @@ -170,7 +172,7 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | @@ -170,7 +172,7 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | ||
| 170 | t.setJzl(jzl);*/ | 172 | t.setJzl(jzl);*/ |
| 171 | t.setNbbm(map.get("clZbh").toString()); | 173 | t.setNbbm(map.get("clZbh").toString()); |
| 172 | t.setJsy(map.get("jGh")==null?"":map.get("jGh").toString()); | 174 | t.setJsy(map.get("jGh")==null?"":map.get("jGh").toString()); |
| 173 | - t.setZlc(map.get("totalKilometers")==null?0.0:Double.parseDouble(df.format(Double.parseDouble(map.get("totalKilometers").toString())))); | 175 | + t.setZlc(map.get("totalKilometers")==null?0.0:Double.parseDouble(map.get("totalKilometers").toString())); |
| 174 | t.setXlbm(map.get("xlBm")==null?"":map.get("xlBm").toString()); | 176 | t.setXlbm(map.get("xlBm")==null?"":map.get("xlBm").toString()); |
| 175 | t.setJcsx(Integer.parseInt(map.get("seqNumber").toString())); | 177 | t.setJcsx(Integer.parseInt(map.get("seqNumber").toString())); |
| 176 | t.setSsgsdm(map.get("company")==null?"":map.get("company").toString()); | 178 | t.setSsgsdm(map.get("company")==null?"":map.get("company").toString()); |
| @@ -270,7 +272,7 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | @@ -270,7 +272,7 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | ||
| 270 | for (int i = 0; i < ylListBe.size(); i++) { | 272 | for (int i = 0; i < ylListBe.size(); i++) { |
| 271 | Ylb ylb = ylListBe.get(i); | 273 | Ylb ylb = ylListBe.get(i); |
| 272 | if (map.get("clZbh").toString().equals(ylb.getNbbm())) { | 274 | if (map.get("clZbh").toString().equals(ylb.getNbbm())) { |
| 273 | - if(ylb.getJzyl()>=0){ | 275 | + if(ylb.getJzyl()>0){ |
| 274 | t.setCzyl(ylb.getJzyl()); | 276 | t.setCzyl(ylb.getJzyl()); |
| 275 | fage = false; | 277 | fage = false; |
| 276 | break; | 278 | break; |
| @@ -282,16 +284,18 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | @@ -282,16 +284,18 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | ||
| 282 | for (int y = 0; y < clyList.size(); y++) { | 284 | for (int y = 0; y < clyList.size(); y++) { |
| 283 | Cyl cyl = clyList.get(y); | 285 | Cyl cyl = clyList.get(y); |
| 284 | if (map.get("clZbh").toString().equals(cyl.getNbbm())) { | 286 | if (map.get("clZbh").toString().equals(cyl.getNbbm())) { |
| 285 | - if(cyl.getCyl()>=0){ | ||
| 286 | - t.setCzyl(cyl.getCyl()); | ||
| 287 | - fage = false; | ||
| 288 | - break; | ||
| 289 | - }else { | ||
| 290 | - if(cyl.getCxrl()!=null){ | ||
| 291 | - if(cyl.getCxrl()>0){ | ||
| 292 | - t.setCzyl(cyl.getCxrl()); | ||
| 293 | - fage = false; | ||
| 294 | - break; | 287 | + if(cyl!=null){ |
| 288 | + if(cyl.getCyl()>=0){ | ||
| 289 | + t.setCzyl(cyl.getCyl()); | ||
| 290 | + fage = false; | ||
| 291 | + break; | ||
| 292 | + }else { | ||
| 293 | + if(cyl.getCxrl()!=null){ | ||
| 294 | + if(cyl.getCxrl()>0){ | ||
| 295 | + t.setCzyl(cyl.getCxrl()); | ||
| 296 | + fage = false; | ||
| 297 | + break; | ||
| 298 | + } | ||
| 295 | } | 299 | } |
| 296 | } | 300 | } |
| 297 | } | 301 | } |
src/main/java/com/bsth/service/realcontrol/impl/ChildTaskPlanServiceImpl.java
| 1 | package com.bsth.service.realcontrol.impl; | 1 | package com.bsth.service.realcontrol.impl; |
| 2 | 2 | ||
| 3 | +import com.bsth.common.ResponseCode; | ||
| 3 | import com.bsth.data.BasicData; | 4 | import com.bsth.data.BasicData; |
| 4 | -import com.bsth.data.match.Arrival2Schedule; | ||
| 5 | import com.bsth.data.schedule.DayOfSchedule; | 5 | import com.bsth.data.schedule.DayOfSchedule; |
| 6 | import com.bsth.entity.realcontrol.ChildTaskPlan; | 6 | import com.bsth.entity.realcontrol.ChildTaskPlan; |
| 7 | import com.bsth.entity.realcontrol.ScheduleRealInfo; | 7 | import com.bsth.entity.realcontrol.ScheduleRealInfo; |
| @@ -10,19 +10,19 @@ import com.bsth.repository.realcontrol.ScheduleRealInfoRepository; | @@ -10,19 +10,19 @@ import com.bsth.repository.realcontrol.ScheduleRealInfoRepository; | ||
| 10 | import com.bsth.service.impl.BaseServiceImpl; | 10 | import com.bsth.service.impl.BaseServiceImpl; |
| 11 | import com.bsth.service.realcontrol.ChildTaskPlanService; | 11 | import com.bsth.service.realcontrol.ChildTaskPlanService; |
| 12 | import org.apache.commons.lang3.StringUtils; | 12 | import org.apache.commons.lang3.StringUtils; |
| 13 | +import org.slf4j.Logger; | ||
| 14 | +import org.slf4j.LoggerFactory; | ||
| 13 | import org.springframework.beans.factory.annotation.Autowired; | 15 | import org.springframework.beans.factory.annotation.Autowired; |
| 14 | import org.springframework.jdbc.core.JdbcTemplate; | 16 | import org.springframework.jdbc.core.JdbcTemplate; |
| 15 | import org.springframework.stereotype.Service; | 17 | import org.springframework.stereotype.Service; |
| 16 | 18 | ||
| 17 | import javax.transaction.Transactional; | 19 | import javax.transaction.Transactional; |
| 20 | +import java.util.HashMap; | ||
| 18 | import java.util.Map; | 21 | import java.util.Map; |
| 19 | 22 | ||
| 20 | @Service | 23 | @Service |
| 21 | public class ChildTaskPlanServiceImpl extends BaseServiceImpl<ChildTaskPlan, Long> implements ChildTaskPlanService { | 24 | public class ChildTaskPlanServiceImpl extends BaseServiceImpl<ChildTaskPlan, Long> implements ChildTaskPlanService { |
| 22 | 25 | ||
| 23 | - /*@Autowired | ||
| 24 | - ScheduleRealInfoServiceImpl scheduleRealInfoService;*/ | ||
| 25 | - | ||
| 26 | @Autowired | 26 | @Autowired |
| 27 | ScheduleRealInfoRepository scheduleRealInfoRepository; | 27 | ScheduleRealInfoRepository scheduleRealInfoRepository; |
| 28 | 28 | ||
| @@ -33,34 +33,41 @@ public class ChildTaskPlanServiceImpl extends BaseServiceImpl<ChildTaskPlan, Lon | @@ -33,34 +33,41 @@ public class ChildTaskPlanServiceImpl extends BaseServiceImpl<ChildTaskPlan, Lon | ||
| 33 | DayOfSchedule dayOfSchedule; | 33 | DayOfSchedule dayOfSchedule; |
| 34 | 34 | ||
| 35 | @Autowired | 35 | @Autowired |
| 36 | - Arrival2Schedule arrival2Schedule; | ||
| 37 | - | ||
| 38 | - @Autowired | ||
| 39 | JdbcTemplate jdbcTemplate; | 36 | JdbcTemplate jdbcTemplate; |
| 40 | 37 | ||
| 38 | + Logger logger = LoggerFactory.getLogger(this.getClass()); | ||
| 39 | + | ||
| 41 | @Transactional | 40 | @Transactional |
| 42 | @Override | 41 | @Override |
| 43 | public Map<String, Object> save(ChildTaskPlan t) { | 42 | public Map<String, Object> save(ChildTaskPlan t) { |
| 44 | - ScheduleRealInfo sch = dayOfSchedule.get(t.getSchedule().getId()); | ||
| 45 | - Map<String, Object> rs; | ||
| 46 | - //保存起终点名称 | ||
| 47 | - String prefix = sch.getXlBm() + "_" + sch.getXlDir() + "_"; | ||
| 48 | - | ||
| 49 | - if(StringUtils.isEmpty(t.getStartStationName())) | ||
| 50 | - t.setStartStationName(BasicData.getStationNameByCode(t.getStartStation(), prefix)); | ||
| 51 | - | ||
| 52 | - if(StringUtils.isEmpty(t.getEndStationName())) | ||
| 53 | - t.setEndStationName(BasicData.getStationNameByCode(t.getEndStation(), prefix)); | ||
| 54 | - //先持久化子任务 | ||
| 55 | - rs = super.save(t); | ||
| 56 | - //再关联主任务 | ||
| 57 | - sch.getcTasks().add(t); | ||
| 58 | - dayOfSchedule.save(sch); | ||
| 59 | - | ||
| 60 | - rs.put("t", sch); | ||
| 61 | 43 | ||
| 62 | - if (sch.getZdsjActual() == null) | ||
| 63 | - arrival2Schedule.removeExpect(sch.getClZbh()); | 44 | + Map<String, Object> rs = new HashMap(); |
| 45 | + try { | ||
| 46 | + ScheduleRealInfo sch = dayOfSchedule.get(t.getSchedule().getId()); | ||
| 47 | + //保存起终点名称 | ||
| 48 | + String prefix = sch.getXlBm() + "_" + sch.getXlDir() + "_"; | ||
| 49 | + if(StringUtils.isEmpty(t.getStartStationName())) | ||
| 50 | + t.setStartStationName(BasicData.getStationNameByCode(t.getStartStation(), prefix)); | ||
| 51 | + | ||
| 52 | + if(StringUtils.isEmpty(t.getEndStationName())) | ||
| 53 | + t.setEndStationName(BasicData.getStationNameByCode(t.getEndStation(), prefix)); | ||
| 54 | + //先持久化子任务 | ||
| 55 | + rs = super.save(t); | ||
| 56 | + //关联主任务 | ||
| 57 | + System.out.println("schschsch: " + sch); | ||
| 58 | + System.out.println("sch.getcTasks()sch.getcTasks(): " + sch.getcTasks()); | ||
| 59 | + sch.getcTasks().add(t); | ||
| 60 | + dayOfSchedule.save(sch); | ||
| 61 | + //直接持久化 | ||
| 62 | + //scheduleRealInfoRepository.save(sch); | ||
| 63 | + | ||
| 64 | + rs.put("status", ResponseCode.SUCCESS); | ||
| 65 | + rs.put("t", sch); | ||
| 66 | + }catch (Exception e){ | ||
| 67 | + logger.error("", e); | ||
| 68 | + rs.put("status", ResponseCode.ERROR); | ||
| 69 | + rs.put("msg", e.getMessage()); | ||
| 70 | + } | ||
| 64 | return rs; | 71 | return rs; |
| 65 | } | 72 | } |
| 66 | 73 | ||
| @@ -69,16 +76,13 @@ public class ChildTaskPlanServiceImpl extends BaseServiceImpl<ChildTaskPlan, Lon | @@ -69,16 +76,13 @@ public class ChildTaskPlanServiceImpl extends BaseServiceImpl<ChildTaskPlan, Lon | ||
| 69 | Map<String, Object> rs; | 76 | Map<String, Object> rs; |
| 70 | 77 | ||
| 71 | ChildTaskPlan cPlan = childTaskPlanRepository.findOne(id); | 78 | ChildTaskPlan cPlan = childTaskPlanRepository.findOne(id); |
| 72 | - //解除和主任务关联 | ||
| 73 | - ScheduleRealInfo sch = dayOfSchedule.get(cPlan.getSchedule().getId()); | ||
| 74 | - sch.getcTasks().remove(cPlan); | ||
| 75 | - //删除关联表数据 | ||
| 76 | - jdbcTemplate.execute("delete from bsth_c_s_sp_info_real_c_tasks where bsth_c_s_sp_info_real=" + sch.getId() + " and c_tasks=" + cPlan.getId()); | ||
| 77 | 79 | ||
| 78 | //删除子任务 | 80 | //删除子任务 |
| 79 | rs = super.delete(id); | 81 | rs = super.delete(id); |
| 80 | - dayOfSchedule.save(sch); | ||
| 81 | - | 82 | + //dayOfSchedule.save(sch); |
| 83 | + //解除和主任务关联 | ||
| 84 | + ScheduleRealInfo sch = dayOfSchedule.get(cPlan.getSchedule().getId()); | ||
| 85 | + sch.getcTasks().remove(cPlan); | ||
| 82 | rs.put("t", sch); | 86 | rs.put("t", sch); |
| 83 | return rs; | 87 | return rs; |
| 84 | } | 88 | } |
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
| @@ -581,62 +581,20 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -581,62 +581,20 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 581 | List<Iterator<?>> list = new ArrayList<Iterator<?>>(); | 581 | List<Iterator<?>> list = new ArrayList<Iterator<?>>(); |
| 582 | List<ScheduleRealInfo> scheduleRealInfos = scheduleRealInfoRepository.queryListWaybill(jName, clZbh, lpName, date, line); | 582 | List<ScheduleRealInfo> scheduleRealInfos = scheduleRealInfoRepository.queryListWaybill(jName, clZbh, lpName, date, line); |
| 583 | List<Map<String, Object>> listMap = new ArrayList<Map<String, Object>>(); | 583 | List<Map<String, Object>> listMap = new ArrayList<Map<String, Object>>(); |
| 584 | - | 584 | +// List<ScheduleRealInfo> scheduleRealInfos=scheduleRealInfoRepository.queryListWaybillXcld(jName, clZbh, lpName, date, line); |
| 585 | + List<ScheduleRealInfo> lists=new ArrayList<ScheduleRealInfo>(); | ||
| 586 | + for (int i = 0; i < scheduleRealInfos.size(); i++) { | ||
| 587 | + ScheduleRealInfo s=scheduleRealInfos.get(i); | ||
| 588 | + if(s.getZdsjActual()!=null){ | ||
| 589 | + lists.add(s); | ||
| 590 | + } | ||
| 591 | + } | ||
| 585 | DecimalFormat format = new DecimalFormat("0.00"); | 592 | DecimalFormat format = new DecimalFormat("0.00"); |
| 586 | // int cjbc = scheduleRealInfoRepository.findCjbc(jName, clZbh, lpName); | 593 | // int cjbc = scheduleRealInfoRepository.findCjbc(jName, clZbh, lpName); |
| 587 | // int ljbc = scheduleRealInfoRepository.findLjbc(jName, clZbh, lpName); | 594 | // int ljbc = scheduleRealInfoRepository.findLjbc(jName, clZbh, lpName); |
| 588 | - int jhbc = 0, cjbc = 0, ljbc = 0; | ||
| 589 | - double jhlc = 0, yygl = 0, ksgl = 0, tempJhlc = 0; | ||
| 590 | - float addMileage = 0l, remMileage = 0l; | ||
| 591 | 595 | ||
| 592 | Map<String, Object> map; | 596 | Map<String, Object> map; |
| 593 | for (ScheduleRealInfo scheduleRealInfo : scheduleRealInfos) { | 597 | for (ScheduleRealInfo scheduleRealInfo : scheduleRealInfos) { |
| 594 | - if (scheduleRealInfo != null) { | ||
| 595 | - //计算计划里程(主任务过滤掉临加班次),烂班里程,临加里程,计划班次,烂班班次,增加班次 | ||
| 596 | - if (scheduleRealInfo != null) { | ||
| 597 | - //计划里程(主任务过滤掉临加班次), | ||
| 598 | - //烂班里程(主任务烂班), | ||
| 599 | - //临加里程(主任务临加), | ||
| 600 | - //计划班次,烂班班次,增加班次 | ||
| 601 | - tempJhlc = scheduleRealInfo.getJhlc() == null ? 0 : scheduleRealInfo.getJhlc(); | ||
| 602 | - if (scheduleRealInfo.isSflj()) { | ||
| 603 | - ljbc++; | ||
| 604 | - } else { | ||
| 605 | - jhlc += tempJhlc; | ||
| 606 | - jhbc++; | ||
| 607 | - if (scheduleRealInfo.getStatus() == -1) { | ||
| 608 | - remMileage += tempJhlc; | ||
| 609 | - cjbc++; | ||
| 610 | - } | ||
| 611 | - } | ||
| 612 | - Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks(); | ||
| 613 | - //计算营运里程,空驶里程 | ||
| 614 | - if (childTaskPlans.isEmpty()) { | ||
| 615 | - if (scheduleRealInfo.getBcType().equals("in") || scheduleRealInfo.getBcType().equals("out") | ||
| 616 | - ) { | ||
| 617 | - ksgl += tempJhlc; | ||
| 618 | - } else { | ||
| 619 | - yygl += tempJhlc; | ||
| 620 | - } | ||
| 621 | - } else { | ||
| 622 | - Iterator<ChildTaskPlan> it = childTaskPlans.iterator(); | ||
| 623 | - while (it.hasNext()) { | ||
| 624 | - ChildTaskPlan childTaskPlan = it.next(); | ||
| 625 | - if (childTaskPlan.getMileageType().equals("empty")) { | ||
| 626 | - if (scheduleRealInfo.isSflj()) { | ||
| 627 | - addMileage += tempJhlc; | ||
| 628 | - } | ||
| 629 | - ksgl += childTaskPlan.getMileage() == null ? 0 : childTaskPlan.getMileage(); | ||
| 630 | - } else { | ||
| 631 | - if (scheduleRealInfo.isSflj()) { | ||
| 632 | - addMileage += tempJhlc; | ||
| 633 | - } | ||
| 634 | - yygl += childTaskPlan.getMileage() == null ? 0 : childTaskPlan.getMileage(); | ||
| 635 | - } | ||
| 636 | - } | ||
| 637 | - } | ||
| 638 | - } | ||
| 639 | - | ||
| 640 | map = new HashMap<String, Object>(); | 598 | map = new HashMap<String, Object>(); |
| 641 | try { | 599 | try { |
| 642 | scheduleRealInfo.setjName(scheduleRealInfo.getjGh() + scheduleRealInfo.getjName()); | 600 | scheduleRealInfo.setjName(scheduleRealInfo.getjGh() + scheduleRealInfo.getjName()); |
| @@ -661,21 +619,23 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -661,21 +619,23 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 661 | } catch (Exception e) { | 619 | } catch (Exception e) { |
| 662 | e.printStackTrace(); | 620 | e.printStackTrace(); |
| 663 | } | 621 | } |
| 664 | - } | ||
| 665 | } | 622 | } |
| 666 | 623 | ||
| 667 | //计算里程和班次数,并放入Map里 | 624 | //计算里程和班次数,并放入Map里 |
| 668 | map = new HashMap<String, Object>(); | 625 | map = new HashMap<String, Object>(); |
| 669 | - map.put("jhlc", format.format(jhlc)); | ||
| 670 | - map.put("remMileage", format.format(remMileage)); | ||
| 671 | - map.put("addMileage", format.format(addMileage)); | ||
| 672 | - map.put("yygl", format.format(yygl)); | ||
| 673 | - map.put("ksgl", format.format(ksgl)); | ||
| 674 | - map.put("realMileage", format.format(yygl + ksgl)); | ||
| 675 | - map.put("jhbc", jhbc); | ||
| 676 | - map.put("cjbc", cjbc); | ||
| 677 | - map.put("ljbc", ljbc); | ||
| 678 | - map.put("sjbc", jhbc - cjbc + ljbc); | 626 | + map.put("jhlc", culateMieageService.culateJhgl(scheduleRealInfos)); |
| 627 | + map.put("remMileage",culateMieageService.culateLbgl(lists)); | ||
| 628 | + map.put("addMileage", culateMieageService.culateLjgl(lists)); | ||
| 629 | + double yygl=Arith.add(culateMieageService.culateSjgl(lists),culateMieageService.culateLjgl(lists)); | ||
| 630 | + map.put("yygl", yygl); | ||
| 631 | + double ksgl=Arith.add(culateMieageService.culateKsgl(lists),culateMieageService.culateJccgl(lists)); | ||
| 632 | + map.put("ksgl",ksgl); | ||
| 633 | + map.put("realMileage", Arith.add(yygl ,ksgl)); | ||
| 634 | + map.put("jhbc", culateMieageService.culateJhgl(scheduleRealInfos)); | ||
| 635 | + map.put("cjbc", culateMieageService.culateLbbc(lists)); | ||
| 636 | + map.put("ljbc", culateMieageService.culateLjbc(lists, "")); | ||
| 637 | + int sjbc =culateMieageService.culateLjbc(lists, "")+culateMieageService.culateSjbc(lists, ""); | ||
| 638 | + map.put("sjbc", sjbc); | ||
| 679 | 639 | ||
| 680 | String path = this.getClass().getResource("/").getPath() + "static/pages/forms/"; | 640 | String path = this.getClass().getResource("/").getPath() + "static/pages/forms/"; |
| 681 | 641 | ||
| @@ -1414,19 +1374,27 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -1414,19 +1374,27 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 1414 | public Map<String, Object> findKMBC(String jGh, String clZbh, | 1374 | public Map<String, Object> findKMBC(String jGh, String clZbh, |
| 1415 | String lpName, String date, String line) { | 1375 | String lpName, String date, String line) { |
| 1416 | Map<String, Object> map = new HashMap<String, Object>(); | 1376 | Map<String, Object> map = new HashMap<String, Object>(); |
| 1417 | - List<ScheduleRealInfo> lists=scheduleRealInfoRepository.queryListWaybillXcld(jGh, clZbh, lpName, date, line); | 1377 | + List<ScheduleRealInfo> list=scheduleRealInfoRepository.queryListWaybillXcld(jGh, clZbh, lpName, date, line); |
| 1378 | + List<ScheduleRealInfo> lists=new ArrayList<ScheduleRealInfo>(); | ||
| 1379 | + for (int i = 0; i < list.size(); i++) { | ||
| 1380 | + ScheduleRealInfo s=list.get(i); | ||
| 1381 | + if(s.getZdsjActual()!=null){ | ||
| 1382 | + lists.add(s); | ||
| 1383 | + } | ||
| 1384 | + } | ||
| 1418 | double ksgl=culateService.culateKsgl(lists); | 1385 | double ksgl=culateService.culateKsgl(lists); |
| 1419 | double sjgl=culateService.culateSjgl(lists); | 1386 | double sjgl=culateService.culateSjgl(lists); |
| 1420 | double jccgl=culateService.culateJccgl(lists); | 1387 | double jccgl=culateService.culateJccgl(lists); |
| 1421 | double ljgl=culateService.culateLjgl(lists); | 1388 | double ljgl=culateService.culateLjgl(lists); |
| 1422 | - map.put("jhlc", culateService.culateJhgl(lists)); //计划里程 | 1389 | + |
| 1390 | + map.put("jhlc", culateService.culateJhgl(list)); //计划里程 | ||
| 1423 | map.put("remMileage", culateService.culateLbgl(lists)); //烂班公里 | 1391 | map.put("remMileage", culateService.culateLbgl(lists)); //烂班公里 |
| 1424 | map.put("addMileage", ljgl); //临加公里 | 1392 | map.put("addMileage", ljgl); //临加公里 |
| 1425 | map.put("yygl",Arith.add(sjgl,ljgl)); //实际公里 | 1393 | map.put("yygl",Arith.add(sjgl,ljgl)); //实际公里 |
| 1426 | map.put("ksgl", ksgl);//空驶公里 | 1394 | map.put("ksgl", ksgl);//空驶公里 |
| 1427 | map.put("realMileage",Arith.add(Arith.add(ksgl,jccgl ),Arith.add(sjgl,ljgl))); | 1395 | map.put("realMileage",Arith.add(Arith.add(ksgl,jccgl ),Arith.add(sjgl,ljgl))); |
| 1428 | // map.put("realMileage", format.format(yygl + ksgl + jcclc+addMileage)); | 1396 | // map.put("realMileage", format.format(yygl + ksgl + jcclc+addMileage)); |
| 1429 | - map.put("jhbc", culateService.culateJhbc(lists,"")); | 1397 | + map.put("jhbc", culateService.culateJhbc(list,"")); |
| 1430 | map.put("cjbc", culateService.culateLbbc(lists)); | 1398 | map.put("cjbc", culateService.culateLbbc(lists)); |
| 1431 | map.put("ljbc", culateService.culateLjbc(lists,"")); | 1399 | map.put("ljbc", culateService.culateLjbc(lists,"")); |
| 1432 | map.put("sjbc", culateService.culateJhbc(lists,"") - culateService.culateLbbc(lists) + culateService.culateLjbc(lists,"")); | 1400 | map.put("sjbc", culateService.culateJhbc(lists,"") - culateService.culateLbbc(lists) + culateService.culateLjbc(lists,"")); |
| @@ -1670,7 +1638,11 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -1670,7 +1638,11 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 1670 | map.put("ssgl_kx", culateService.culateCJLC(lists, "客稀")); | 1638 | map.put("ssgl_kx", culateService.culateCJLC(lists, "客稀")); |
| 1671 | map.put("ssgl_qh", culateService.culateCJLC(lists, "气候")); | 1639 | map.put("ssgl_qh", culateService.culateCJLC(lists, "气候")); |
| 1672 | map.put("ssgl_yw", culateService.culateCJLC(lists, "援外")); | 1640 | map.put("ssgl_yw", culateService.culateCJLC(lists, "援外")); |
| 1673 | - map.put("ssgl_other", culateService.culateCJLC(lists, "其他")); | 1641 | + double ssgl_pc=culateService.culateCJLC(lists, "配车"); |
| 1642 | + double ssgl_by=culateService.culateCJLC(lists, "保养"); | ||
| 1643 | + double ssgl_cj=culateService.culateCJLC(lists, "抽减"); | ||
| 1644 | + double ssgl_qt=culateService.culateCJLC(lists, "其他"); | ||
| 1645 | + map.put("ssgl_other", Arith.add(Arith.add(ssgl_pc, ssgl_by),Arith.add(ssgl_cj, ssgl_qt))); | ||
| 1674 | map.put("ssbc", culateService.culateLbbc(lists)); | 1646 | map.put("ssbc", culateService.culateLbbc(lists)); |
| 1675 | map.put("ljgl", culateService.culateLjgl(lists)); | 1647 | map.put("ljgl", culateService.culateLjgl(lists)); |
| 1676 | map.put("jhbc", culateService.culateJhbc(lists,"")); | 1648 | map.put("jhbc", culateService.culateJhbc(lists,"")); |
| @@ -3793,6 +3765,76 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -3793,6 +3765,76 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 3793 | return new ArrayList<Map<String, Object>>(); | 3765 | return new ArrayList<Map<String, Object>>(); |
| 3794 | } | 3766 | } |
| 3795 | 3767 | ||
| 3768 | + public List<ScheduleRealInfo> exportWaybill_pl(List<ScheduleRealInfo> listpl,String date,String jName, String clZbh,String lpName) { | ||
| 3769 | + ReportUtils ee = new ReportUtils(); | ||
| 3770 | + ReportRelatedUtils rru = new ReportRelatedUtils(); | ||
| 3771 | + List<Iterator<?>> list = new ArrayList<Iterator<?>>(); | ||
| 3772 | + List<ScheduleRealInfo> scheduleRealInfos = listpl; | ||
| 3773 | + List<Map<String, Object>> listMap = new ArrayList<Map<String, Object>>(); | ||
| 3774 | +// List<ScheduleRealInfo> scheduleRealInfos=scheduleRealInfoRepository.queryListWaybillXcld(jName, clZbh, lpName, date, line); | ||
| 3775 | + List<ScheduleRealInfo> lists=new ArrayList<ScheduleRealInfo>(); | ||
| 3776 | + for (int i = 0; i < scheduleRealInfos.size(); i++) { | ||
| 3777 | + ScheduleRealInfo s=scheduleRealInfos.get(i); | ||
| 3778 | + if(s.getZdsjActual()!=null){ | ||
| 3779 | + lists.add(s); | ||
| 3780 | + } | ||
| 3781 | + } | ||
| 3782 | + DecimalFormat format = new DecimalFormat("0.00"); | ||
| 3783 | +// int cjbc = scheduleRealInfoRepository.findCjbc(jName, clZbh, lpName); | ||
| 3784 | +// int ljbc = scheduleRealInfoRepository.findLjbc(jName, clZbh, lpName); | ||
| 3785 | + | ||
| 3786 | + Map<String, Object> map; | ||
| 3787 | + for (ScheduleRealInfo scheduleRealInfo : scheduleRealInfos) { | ||
| 3788 | + map = new HashMap<String, Object>(); | ||
| 3789 | + try { | ||
| 3790 | + scheduleRealInfo.setjName(scheduleRealInfo.getjGh() + scheduleRealInfo.getjName()); | ||
| 3791 | + scheduleRealInfo.setsName(scheduleRealInfo.getsGh() + scheduleRealInfo.getsName()); | ||
| 3792 | + map = rru.getMapValue(scheduleRealInfo); | ||
| 3793 | + String zdsj = scheduleRealInfo.getZdsj(); | ||
| 3794 | + String zdsjActual = scheduleRealInfo.getZdsjActual(); | ||
| 3795 | + if (zdsj != null && zdsjActual != null && | ||
| 3796 | + !zdsj.equals(zdsjActual)) { | ||
| 3797 | + if (zdsj.compareTo(zdsjActual) > 0) { | ||
| 3798 | + map.put("fast", TimeUtils.getTimeDifference(zdsj, zdsjActual)); | ||
| 3799 | + map.put("slow", ""); | ||
| 3800 | + } else { | ||
| 3801 | + map.put("fast", ""); | ||
| 3802 | + map.put("slow", TimeUtils.getTimeDifference(zdsj, zdsjActual)); | ||
| 3803 | + } | ||
| 3804 | + } else { | ||
| 3805 | + map.put("fast", ""); | ||
| 3806 | + map.put("slow", ""); | ||
| 3807 | + } | ||
| 3808 | + listMap.add(map); | ||
| 3809 | + } catch (Exception e) { | ||
| 3810 | + e.printStackTrace(); | ||
| 3811 | + } | ||
| 3812 | + } | ||
| 3813 | + | ||
| 3814 | + //计算里程和班次数,并放入Map里 | ||
| 3815 | + map = new HashMap<String, Object>(); | ||
| 3816 | + map.put("jhlc", culateMieageService.culateJhgl(scheduleRealInfos)); | ||
| 3817 | + map.put("remMileage",culateMieageService.culateLbgl(lists)); | ||
| 3818 | + map.put("addMileage", culateMieageService.culateLjgl(lists)); | ||
| 3819 | + double yygl=Arith.add(culateMieageService.culateSjgl(lists),culateMieageService.culateLjgl(lists)); | ||
| 3820 | + map.put("yygl", yygl); | ||
| 3821 | + double ksgl=Arith.add(culateMieageService.culateKsgl(lists),culateMieageService.culateJccgl(lists)); | ||
| 3822 | + map.put("ksgl",ksgl); | ||
| 3823 | + map.put("realMileage", Arith.add(yygl ,ksgl)); | ||
| 3824 | + map.put("jhbc", culateMieageService.culateJhgl(scheduleRealInfos)); | ||
| 3825 | + map.put("cjbc", culateMieageService.culateLbbc(lists)); | ||
| 3826 | + map.put("ljbc", culateMieageService.culateLjbc(lists, "")); | ||
| 3827 | + int sjbc =culateMieageService.culateLjbc(lists, "")+culateMieageService.culateSjbc(lists, ""); | ||
| 3828 | + map.put("sjbc", sjbc); | ||
| 3829 | + | ||
| 3830 | + String path = this.getClass().getResource("/").getPath() + "static/pages/forms/"; | ||
| 3831 | + | ||
| 3832 | + list.add(listMap.iterator()); | ||
| 3833 | + ee.excelReplace(list, new Object[]{scheduleRealInfos.get(0), map}, path + "mould/waybill_minhang.xls", | ||
| 3834 | + path + "export/" + date + "-" + jName + "-" + clZbh + "-" + lpName + "-行车路单.xls"); | ||
| 3835 | + return scheduleRealInfos; | ||
| 3836 | + } | ||
| 3837 | + | ||
| 3796 | @Override | 3838 | @Override |
| 3797 | public Map<String, Object> exportWaybillMore(Map<String, Object> map) { | 3839 | public Map<String, Object> exportWaybillMore(Map<String, Object> map) { |
| 3798 | String date = map.get("date").toString(); | 3840 | String date = map.get("date").toString(); |
| @@ -3814,12 +3856,19 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -3814,12 +3856,19 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 3814 | } | 3856 | } |
| 3815 | } | 3857 | } |
| 3816 | file.mkdirs(); | 3858 | file.mkdirs(); |
| 3817 | - | 3859 | + List<ScheduleRealInfo> lists_line=scheduleRealInfoRepository.scheduleByDateAndLineTjrb(line, date); |
| 3818 | for (List<String> list : lists) { | 3860 | for (List<String> list : lists) { |
| 3861 | + List<ScheduleRealInfo> newList=new ArrayList<ScheduleRealInfo>(); | ||
| 3819 | String jName = list.get(0); | 3862 | String jName = list.get(0); |
| 3820 | String clZbh = list.get(1); | 3863 | String clZbh = list.get(1); |
| 3821 | String lpName = list.get(2); | 3864 | String lpName = list.get(2); |
| 3822 | - this.exportWaybill(jName, clZbh, lpName, date, line); | 3865 | + for (int i = 0; i < lists_line.size(); i++) { |
| 3866 | + ScheduleRealInfo s=lists_line.get(i); | ||
| 3867 | + if(s.getjName().equals(jName) && s.getClZbh().equals(clZbh) && s.getLpName().equals(lpName)){ | ||
| 3868 | + newList.add(s); | ||
| 3869 | + } | ||
| 3870 | + } | ||
| 3871 | + this.exportWaybill_pl(newList, date, jName, clZbh, lpName); | ||
| 3823 | File temp = new File(path + date + "-" + jName + "-" + clZbh + "-" + lpName + "-行车路单.xls"); | 3872 | File temp = new File(path + date + "-" + jName + "-" + clZbh + "-" + lpName + "-行车路单.xls"); |
| 3824 | String fileName = file.getName(); | 3873 | String fileName = file.getName(); |
| 3825 | temp.renameTo(new File(path + fileName + "/" + temp.getName())); | 3874 | temp.renameTo(new File(path + fileName + "/" + temp.getName())); |
src/main/resources/datatools/ktrs/guideboardDataInput.ktr
| @@ -276,6 +276,155 @@ | @@ -276,6 +276,155 @@ | ||
| 276 | <hop> <from>启用被数据flag</from><to>插入/更新bsth_c_s_gbi</to><enabled>Y</enabled> </hop> | 276 | <hop> <from>启用被数据flag</from><to>插入/更新bsth_c_s_gbi</to><enabled>Y</enabled> </hop> |
| 277 | </order> | 277 | </order> |
| 278 | <step> | 278 | <step> |
| 279 | + <name>原始系统导出的Excel输入</name> | ||
| 280 | + <type>ExcelInput</type> | ||
| 281 | + <description/> | ||
| 282 | + <distribute>Y</distribute> | ||
| 283 | + <custom_distribution/> | ||
| 284 | + <copies>1</copies> | ||
| 285 | + <partitioning> | ||
| 286 | + <method>none</method> | ||
| 287 | + <schema_name/> | ||
| 288 | + </partitioning> | ||
| 289 | + <header>Y</header> | ||
| 290 | + <noempty>Y</noempty> | ||
| 291 | + <stoponempty>N</stoponempty> | ||
| 292 | + <filefield/> | ||
| 293 | + <sheetfield/> | ||
| 294 | + <sheetrownumfield/> | ||
| 295 | + <rownumfield/> | ||
| 296 | + <sheetfield/> | ||
| 297 | + <filefield/> | ||
| 298 | + <limit>0</limit> | ||
| 299 | + <encoding/> | ||
| 300 | + <add_to_result_filenames>Y</add_to_result_filenames> | ||
| 301 | + <accept_filenames>Y</accept_filenames> | ||
| 302 | + <accept_field>filepath_</accept_field> | ||
| 303 | + <accept_stepname>获取变量</accept_stepname> | ||
| 304 | + <file> | ||
| 305 | + <name/> | ||
| 306 | + <filemask/> | ||
| 307 | + <exclude_filemask/> | ||
| 308 | + <file_required>N</file_required> | ||
| 309 | + <include_subfolders>N</include_subfolders> | ||
| 310 | + </file> | ||
| 311 | + <fields> | ||
| 312 | + <field> | ||
| 313 | + <name>线路</name> | ||
| 314 | + <type>String</type> | ||
| 315 | + <length>-1</length> | ||
| 316 | + <precision>-1</precision> | ||
| 317 | + <trim_type>none</trim_type> | ||
| 318 | + <repeat>N</repeat> | ||
| 319 | + <format/> | ||
| 320 | + <currency/> | ||
| 321 | + <decimal/> | ||
| 322 | + <group/> | ||
| 323 | + </field> | ||
| 324 | + <field> | ||
| 325 | + <name>路牌编号</name> | ||
| 326 | + <type>String</type> | ||
| 327 | + <length>-1</length> | ||
| 328 | + <precision>-1</precision> | ||
| 329 | + <trim_type>none</trim_type> | ||
| 330 | + <repeat>N</repeat> | ||
| 331 | + <format>#</format> | ||
| 332 | + <currency/> | ||
| 333 | + <decimal/> | ||
| 334 | + <group/> | ||
| 335 | + </field> | ||
| 336 | + <field> | ||
| 337 | + <name>路牌名称</name> | ||
| 338 | + <type>String</type> | ||
| 339 | + <length>-1</length> | ||
| 340 | + <precision>-1</precision> | ||
| 341 | + <trim_type>none</trim_type> | ||
| 342 | + <repeat>N</repeat> | ||
| 343 | + <format>#</format> | ||
| 344 | + <currency/> | ||
| 345 | + <decimal/> | ||
| 346 | + <group/> | ||
| 347 | + </field> | ||
| 348 | + <field> | ||
| 349 | + <name>路牌类型</name> | ||
| 350 | + <type>String</type> | ||
| 351 | + <length>-1</length> | ||
| 352 | + <precision>-1</precision> | ||
| 353 | + <trim_type>none</trim_type> | ||
| 354 | + <repeat>N</repeat> | ||
| 355 | + <format/> | ||
| 356 | + <currency/> | ||
| 357 | + <decimal/> | ||
| 358 | + <group/> | ||
| 359 | + </field> | ||
| 360 | + </fields> | ||
| 361 | + <sheets> | ||
| 362 | + <sheet> | ||
| 363 | + <name>工作表1</name> | ||
| 364 | + <startrow>0</startrow> | ||
| 365 | + <startcol>0</startcol> | ||
| 366 | + </sheet> | ||
| 367 | + </sheets> | ||
| 368 | + <strict_types>N</strict_types> | ||
| 369 | + <error_ignored>N</error_ignored> | ||
| 370 | + <error_line_skipped>N</error_line_skipped> | ||
| 371 | + <bad_line_files_destination_directory/> | ||
| 372 | + <bad_line_files_extension>warning</bad_line_files_extension> | ||
| 373 | + <error_line_files_destination_directory/> | ||
| 374 | + <error_line_files_extension>error</error_line_files_extension> | ||
| 375 | + <line_number_files_destination_directory/> | ||
| 376 | + <line_number_files_extension>line</line_number_files_extension> | ||
| 377 | + <shortFileFieldName/> | ||
| 378 | + <pathFieldName/> | ||
| 379 | + <hiddenFieldName/> | ||
| 380 | + <lastModificationTimeFieldName/> | ||
| 381 | + <uriNameFieldName/> | ||
| 382 | + <rootUriNameFieldName/> | ||
| 383 | + <extensionFieldName/> | ||
| 384 | + <sizeFieldName/> | ||
| 385 | + <spreadsheet_type>JXL</spreadsheet_type> | ||
| 386 | + <cluster_schema/> | ||
| 387 | + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> | ||
| 388 | + <xloc>150</xloc> | ||
| 389 | + <yloc>68</yloc> | ||
| 390 | + <draw>Y</draw> | ||
| 391 | + </GUI> | ||
| 392 | + </step> | ||
| 393 | + | ||
| 394 | + <step> | ||
| 395 | + <name>启用被数据flag</name> | ||
| 396 | + <type>Constant</type> | ||
| 397 | + <description/> | ||
| 398 | + <distribute>Y</distribute> | ||
| 399 | + <custom_distribution/> | ||
| 400 | + <copies>1</copies> | ||
| 401 | + <partitioning> | ||
| 402 | + <method>none</method> | ||
| 403 | + <schema_name/> | ||
| 404 | + </partitioning> | ||
| 405 | + <fields> | ||
| 406 | + <field> | ||
| 407 | + <name>isCancel</name> | ||
| 408 | + <type>Integer</type> | ||
| 409 | + <format/> | ||
| 410 | + <currency/> | ||
| 411 | + <decimal/> | ||
| 412 | + <group/> | ||
| 413 | + <nullif>0</nullif> | ||
| 414 | + <length>-1</length> | ||
| 415 | + <precision>-1</precision> | ||
| 416 | + <set_empty_string>N</set_empty_string> | ||
| 417 | + </field> | ||
| 418 | + </fields> | ||
| 419 | + <cluster_schema/> | ||
| 420 | + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> | ||
| 421 | + <xloc>544</xloc> | ||
| 422 | + <yloc>70</yloc> | ||
| 423 | + <draw>Y</draw> | ||
| 424 | + </GUI> | ||
| 425 | + </step> | ||
| 426 | + | ||
| 427 | + <step> | ||
| 279 | <name>字段改名</name> | 428 | <name>字段改名</name> |
| 280 | <type>SelectValues</type> | 429 | <type>SelectValues</type> |
| 281 | <description/> | 430 | <description/> |
| @@ -393,27 +542,27 @@ | @@ -393,27 +542,27 @@ | ||
| 393 | <value> | 542 | <value> |
| 394 | <name>xl</name> | 543 | <name>xl</name> |
| 395 | <rename>xlid</rename> | 544 | <rename>xlid</rename> |
| 396 | - <update>N</update> | 545 | + <update>Y</update> |
| 397 | </value> | 546 | </value> |
| 398 | <value> | 547 | <value> |
| 399 | <name>lp_no</name> | 548 | <name>lp_no</name> |
| 400 | <rename>lpno</rename> | 549 | <rename>lpno</rename> |
| 401 | - <update>N</update> | 550 | + <update>Y</update> |
| 402 | </value> | 551 | </value> |
| 403 | <value> | 552 | <value> |
| 404 | <name>lp_name</name> | 553 | <name>lp_name</name> |
| 405 | <rename>lpname</rename> | 554 | <rename>lpname</rename> |
| 406 | - <update>N</update> | 555 | + <update>Y</update> |
| 407 | </value> | 556 | </value> |
| 408 | <value> | 557 | <value> |
| 409 | <name>lp_type</name> | 558 | <name>lp_type</name> |
| 410 | <rename>lptype</rename> | 559 | <rename>lptype</rename> |
| 411 | - <update>N</update> | 560 | + <update>Y</update> |
| 412 | </value> | 561 | </value> |
| 413 | <value> | 562 | <value> |
| 414 | <name>is_cancel</name> | 563 | <name>is_cancel</name> |
| 415 | <rename>isCancel</rename> | 564 | <rename>isCancel</rename> |
| 416 | - <update>N</update> | 565 | + <update>Y</update> |
| 417 | </value> | 566 | </value> |
| 418 | </lookup> | 567 | </lookup> |
| 419 | <cluster_schema/> | 568 | <cluster_schema/> |
| @@ -512,122 +661,6 @@ | @@ -512,122 +661,6 @@ | ||
| 512 | </step> | 661 | </step> |
| 513 | 662 | ||
| 514 | <step> | 663 | <step> |
| 515 | - <name>原始系统导出的Excel输入</name> | ||
| 516 | - <type>ExcelInput</type> | ||
| 517 | - <description/> | ||
| 518 | - <distribute>Y</distribute> | ||
| 519 | - <custom_distribution/> | ||
| 520 | - <copies>1</copies> | ||
| 521 | - <partitioning> | ||
| 522 | - <method>none</method> | ||
| 523 | - <schema_name/> | ||
| 524 | - </partitioning> | ||
| 525 | - <header>Y</header> | ||
| 526 | - <noempty>Y</noempty> | ||
| 527 | - <stoponempty>N</stoponempty> | ||
| 528 | - <filefield/> | ||
| 529 | - <sheetfield/> | ||
| 530 | - <sheetrownumfield/> | ||
| 531 | - <rownumfield/> | ||
| 532 | - <sheetfield/> | ||
| 533 | - <filefield/> | ||
| 534 | - <limit>0</limit> | ||
| 535 | - <encoding/> | ||
| 536 | - <add_to_result_filenames>Y</add_to_result_filenames> | ||
| 537 | - <accept_filenames>Y</accept_filenames> | ||
| 538 | - <accept_field>filepath_</accept_field> | ||
| 539 | - <accept_stepname>获取变量</accept_stepname> | ||
| 540 | - <file> | ||
| 541 | - <name/> | ||
| 542 | - <filemask/> | ||
| 543 | - <exclude_filemask/> | ||
| 544 | - <file_required>N</file_required> | ||
| 545 | - <include_subfolders>N</include_subfolders> | ||
| 546 | - </file> | ||
| 547 | - <fields> | ||
| 548 | - <field> | ||
| 549 | - <name>线路</name> | ||
| 550 | - <type>String</type> | ||
| 551 | - <length>-1</length> | ||
| 552 | - <precision>-1</precision> | ||
| 553 | - <trim_type>none</trim_type> | ||
| 554 | - <repeat>N</repeat> | ||
| 555 | - <format/> | ||
| 556 | - <currency/> | ||
| 557 | - <decimal/> | ||
| 558 | - <group/> | ||
| 559 | - </field> | ||
| 560 | - <field> | ||
| 561 | - <name>路牌编号</name> | ||
| 562 | - <type>String</type> | ||
| 563 | - <length>-1</length> | ||
| 564 | - <precision>-1</precision> | ||
| 565 | - <trim_type>none</trim_type> | ||
| 566 | - <repeat>N</repeat> | ||
| 567 | - <format>#</format> | ||
| 568 | - <currency/> | ||
| 569 | - <decimal/> | ||
| 570 | - <group/> | ||
| 571 | - </field> | ||
| 572 | - <field> | ||
| 573 | - <name>路牌名称</name> | ||
| 574 | - <type>String</type> | ||
| 575 | - <length>-1</length> | ||
| 576 | - <precision>-1</precision> | ||
| 577 | - <trim_type>none</trim_type> | ||
| 578 | - <repeat>N</repeat> | ||
| 579 | - <format>#</format> | ||
| 580 | - <currency/> | ||
| 581 | - <decimal/> | ||
| 582 | - <group/> | ||
| 583 | - </field> | ||
| 584 | - <field> | ||
| 585 | - <name>路牌类型</name> | ||
| 586 | - <type>String</type> | ||
| 587 | - <length>-1</length> | ||
| 588 | - <precision>-1</precision> | ||
| 589 | - <trim_type>none</trim_type> | ||
| 590 | - <repeat>N</repeat> | ||
| 591 | - <format/> | ||
| 592 | - <currency/> | ||
| 593 | - <decimal/> | ||
| 594 | - <group/> | ||
| 595 | - </field> | ||
| 596 | - </fields> | ||
| 597 | - <sheets> | ||
| 598 | - <sheet> | ||
| 599 | - <name>工作表1</name> | ||
| 600 | - <startrow>0</startrow> | ||
| 601 | - <startcol>0</startcol> | ||
| 602 | - </sheet> | ||
| 603 | - </sheets> | ||
| 604 | - <strict_types>N</strict_types> | ||
| 605 | - <error_ignored>N</error_ignored> | ||
| 606 | - <error_line_skipped>N</error_line_skipped> | ||
| 607 | - <bad_line_files_destination_directory/> | ||
| 608 | - <bad_line_files_extension>warning</bad_line_files_extension> | ||
| 609 | - <error_line_files_destination_directory/> | ||
| 610 | - <error_line_files_extension>error</error_line_files_extension> | ||
| 611 | - <line_number_files_destination_directory/> | ||
| 612 | - <line_number_files_extension>line</line_number_files_extension> | ||
| 613 | - <shortFileFieldName/> | ||
| 614 | - <pathFieldName/> | ||
| 615 | - <hiddenFieldName/> | ||
| 616 | - <lastModificationTimeFieldName/> | ||
| 617 | - <uriNameFieldName/> | ||
| 618 | - <rootUriNameFieldName/> | ||
| 619 | - <extensionFieldName/> | ||
| 620 | - <sizeFieldName/> | ||
| 621 | - <spreadsheet_type>JXL</spreadsheet_type> | ||
| 622 | - <cluster_schema/> | ||
| 623 | - <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> | ||
| 624 | - <xloc>150</xloc> | ||
| 625 | - <yloc>68</yloc> | ||
| 626 | - <draw>Y</draw> | ||
| 627 | - </GUI> | ||
| 628 | - </step> | ||
| 629 | - | ||
| 630 | - <step> | ||
| 631 | <name>错误输出</name> | 664 | <name>错误输出</name> |
| 632 | <type>ExcelOutput</type> | 665 | <type>ExcelOutput</type> |
| 633 | <description/> | 666 | <description/> |
| @@ -754,39 +787,6 @@ | @@ -754,39 +787,6 @@ | ||
| 754 | </GUI> | 787 | </GUI> |
| 755 | </step> | 788 | </step> |
| 756 | 789 | ||
| 757 | - <step> | ||
| 758 | - <name>启用被数据flag</name> | ||
| 759 | - <type>Constant</type> | ||
| 760 | - <description/> | ||
| 761 | - <distribute>Y</distribute> | ||
| 762 | - <custom_distribution/> | ||
| 763 | - <copies>1</copies> | ||
| 764 | - <partitioning> | ||
| 765 | - <method>none</method> | ||
| 766 | - <schema_name/> | ||
| 767 | - </partitioning> | ||
| 768 | - <fields> | ||
| 769 | - <field> | ||
| 770 | - <name>isCancel</name> | ||
| 771 | - <type>Integer</type> | ||
| 772 | - <format/> | ||
| 773 | - <currency/> | ||
| 774 | - <decimal/> | ||
| 775 | - <group/> | ||
| 776 | - <nullif>0</nullif> | ||
| 777 | - <length>-1</length> | ||
| 778 | - <precision>-1</precision> | ||
| 779 | - <set_empty_string>N</set_empty_string> | ||
| 780 | - </field> | ||
| 781 | - </fields> | ||
| 782 | - <cluster_schema/> | ||
| 783 | - <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> | ||
| 784 | - <xloc>544</xloc> | ||
| 785 | - <yloc>70</yloc> | ||
| 786 | - <draw>Y</draw> | ||
| 787 | - </GUI> | ||
| 788 | - </step> | ||
| 789 | - | ||
| 790 | <step_error_handling> | 790 | <step_error_handling> |
| 791 | <error> | 791 | <error> |
| 792 | <source_step>插入/更新bsth_c_s_gbi</source_step> | 792 | <source_step>插入/更新bsth_c_s_gbi</source_step> |
src/main/resources/static/pages/base/timesmodel/countadd.html
0 → 100644
| 1 | +<!-- 统计数据 --> | ||
| 2 | +<div class="modal fade" id="countadd_mobal" tabindex="-1" role="basic" aria-hidden="true"> | ||
| 3 | + <div class="modal-dialog" style="margin-left: 400px;"> | ||
| 4 | + <div class="modal-content" style="width: 700px;"> | ||
| 5 | + <div class="modal-header"> | ||
| 6 | + <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button> | ||
| 7 | + <h4 class="modal-title">统计数据 </h4> | ||
| 8 | + </div> | ||
| 9 | + <div class="modal-body"> | ||
| 10 | + <div class="portlet-body"> | ||
| 11 | + <div class="table-container" style="margin-top: 10px"> | ||
| 12 | + <table class="table table-striped table-bordered table-hover table-checkable" id="datatable_countadd"> | ||
| 13 | + <thead> | ||
| 14 | + <tr role="row" class="heading"> | ||
| 15 | + <th width="1%">序号</th> | ||
| 16 | + <th width="45%">统计项目</th> | ||
| 17 | + <th width="15%">统计数值</th> | ||
| 18 | + </tr> | ||
| 19 | + </thead> | ||
| 20 | + <tbody></tbody> | ||
| 21 | + </table> | ||
| 22 | + </div> | ||
| 23 | + </div> | ||
| 24 | + </div> | ||
| 25 | + <div class="modal-footer"> | ||
| 26 | + <button type="button" class="btn default" data-dismiss="modal">关闭</button> | ||
| 27 | + </div> | ||
| 28 | + </div> | ||
| 29 | + </div> | ||
| 30 | +</div> | ||
| 31 | +<script type="text/html" id="countAdd_temp"> | ||
| 32 | +{{each list as obj i }} | ||
| 33 | + <tr role="row" class="filter"> | ||
| 34 | + <td>{{i+1}}</td> | ||
| 35 | + <td> | ||
| 36 | + {{obj.name}} | ||
| 37 | + </td> | ||
| 38 | + <td style="vertical-align:middle; text-align:center;"> | ||
| 39 | + {{if obj.name == '综合评估'}} | ||
| 40 | + <div id="star"></div> | ||
| 41 | + {{else}} | ||
| 42 | + {{obj.value}} | ||
| 43 | + {{/if}} | ||
| 44 | + </td> | ||
| 45 | + </tr> | ||
| 46 | +{{/each}} | ||
| 47 | +{{if list.length == 0}} | ||
| 48 | + <tr> | ||
| 49 | + <td colspan=3><h6 class="muted">没有找到相关数据</h6></td> | ||
| 50 | + </tr> | ||
| 51 | +{{/if}} | ||
| 52 | +</script> | ||
| 53 | +<script type="text/javascript"> | ||
| 54 | +$('#countadd_mobal').on('countAddMobal.show', function(e,countDate){ | ||
| 55 | + // 加载延迟200毫秒显示mobal | ||
| 56 | + setTimeout(function(){$('#countadd_mobal').modal({show : true,backdrop: 'static', keyboard: false});},200); | ||
| 57 | + // 当模态框对用户可见时触发(将等待 CSS 过渡效果完成)。 | ||
| 58 | + $('#countadd_mobal').on('show.bs.modal', function () { | ||
| 59 | + // 把数据填充到模版中 | ||
| 60 | + var tbodyHtml = template('countAdd_temp',{list:countDate}); | ||
| 61 | + // 把渲染好的模版html文本追加到表格中 | ||
| 62 | + $('#datatable_countadd tbody').html(tbodyHtml); | ||
| 63 | + $('#star').raty({ readOnly: true,score: 4.5 }); | ||
| 64 | + }); | ||
| 65 | +}); | ||
| 66 | +</script> | ||
| 0 | \ No newline at end of file | 67 | \ No newline at end of file |
src/main/resources/static/pages/base/timesmodel/gantt.html
| @@ -19,19 +19,15 @@ | @@ -19,19 +19,15 @@ | ||
| 19 | 19 | ||
| 20 | <!-- row 组件START --> | 20 | <!-- row 组件START --> |
| 21 | <div class="row"> | 21 | <div class="row"> |
| 22 | - | ||
| 23 | <!-- col-md-12 组件START --> | 22 | <!-- col-md-12 组件START --> |
| 24 | <div class="col-md-12"> | 23 | <div class="col-md-12"> |
| 25 | - | ||
| 26 | <!-- portlet 组件START --> | 24 | <!-- portlet 组件START --> |
| 27 | <div class="portlet light porttlet-fit bordered"> | 25 | <div class="portlet light porttlet-fit bordered"> |
| 28 | - | ||
| 29 | <!-- portlet-title组件START --> | 26 | <!-- portlet-title组件START --> |
| 30 | <div class="portlet-title"> | 27 | <div class="portlet-title"> |
| 31 | - | ||
| 32 | <!-- caption 组件START --> | 28 | <!-- caption 组件START --> |
| 33 | <div class="caption"> | 29 | <div class="caption"> |
| 34 | - <i class="fa fa-database font-dark"></i> | 30 | + <i class="fa fa-bar-chart font-dark"></i> |
| 35 | <span class="caption-subject font-dark sbold uppercase">时刻表明细模型</span> | 31 | <span class="caption-subject font-dark sbold uppercase">时刻表明细模型</span> |
| 36 | </div> | 32 | </div> |
| 37 | <!-- caption 组件END --> | 33 | <!-- caption 组件END --> |
| @@ -40,6 +36,9 @@ | @@ -40,6 +36,9 @@ | ||
| 40 | </div> | 36 | </div> |
| 41 | <!-- actions 组件START --> | 37 | <!-- actions 组件START --> |
| 42 | <div class="actions"> | 38 | <div class="actions"> |
| 39 | + <div class="btn-group btn-group-devided countbtn" data-toggle="buttons"> | ||
| 40 | + <a class="btn btn-circle blue countAdd" href="javascript:;" data-pjax><i class="fa fa-database"></i> 统计数据</a> | ||
| 41 | + </div> | ||
| 43 | <div class="btn-group btn-group-devided checkbtn" data-toggle="buttons"> | 42 | <div class="btn-group btn-group-devided checkbtn" data-toggle="buttons"> |
| 44 | <a class="btn btn-circle blue checkAdd" href="javascript:;" data-pjax><i class="fa fa-check"></i> 保存数据</a> | 43 | <a class="btn btn-circle blue checkAdd" href="javascript:;" data-pjax><i class="fa fa-check"></i> 保存数据</a> |
| 45 | </div> | 44 | </div> |
| @@ -107,6 +106,7 @@ | @@ -107,6 +106,7 @@ | ||
| 107 | <!-- col-md-12 组件END --> | 106 | <!-- col-md-12 组件END --> |
| 108 | </div> | 107 | </div> |
| 109 | <!-- row 组件END --> | 108 | <!-- row 组件END --> |
| 109 | +<script src="/pages/base/timesmodel/js/raty/lib/jquery.raty.js"></script> | ||
| 110 | <script src="/pages/base/timesmodel/js/ContextJS/js/context.js"></script> | 110 | <script src="/pages/base/timesmodel/js/ContextJS/js/context.js"></script> |
| 111 | <script src="/pages/base/timesmodel/js/base-fun.js"></script> | 111 | <script src="/pages/base/timesmodel/js/base-fun.js"></script> |
| 112 | <script src="/pages/base/timesmodel/js/d3.relationshipgraph.js"></script> | 112 | <script src="/pages/base/timesmodel/js/d3.relationshipgraph.js"></script> |
src/main/resources/static/pages/base/timesmodel/js/d3.relationshipgraph.js
| @@ -201,7 +201,7 @@ $('.reladplus').on('click',function() { | @@ -201,7 +201,7 @@ $('.reladplus').on('click',function() { | ||
| 201 | /************************************************************************************************************************************************/ | 201 | /************************************************************************************************************************************************/ |
| 202 | 202 | ||
| 203 | /** | 203 | /** |
| 204 | - * @description : (TODO) 均匀发车事件. | 204 | + * @description : (TODO) 监听均匀发车事件. |
| 205 | * | 205 | * |
| 206 | * @stutas : OK. | 206 | * @stutas : OK. |
| 207 | * | 207 | * |
| @@ -229,8 +229,9 @@ $('.updownread').on('click',function() { | @@ -229,8 +229,9 @@ $('.updownread').on('click',function() { | ||
| 229 | /************************************************************************************************************************************************/ | 229 | /************************************************************************************************************************************************/ |
| 230 | 230 | ||
| 231 | /** | 231 | /** |
| 232 | - * 调整班次点击事件 | ||
| 233 | - * | 232 | + * @description : (TODO) 调整班次点击事件 |
| 233 | + * | ||
| 234 | + * @status OK. | ||
| 234 | ************************************************************************************************************************************************/ | 235 | ************************************************************************************************************************************************/ |
| 235 | $('.aboutread').on('click',function() { | 236 | $('.aboutread').on('click',function() { |
| 236 | // 判断选择框是否存在. | 237 | // 判断选择框是否存在. |
| @@ -255,7 +256,7 @@ $('.aboutread').on('click',function() { | @@ -255,7 +256,7 @@ $('.aboutread').on('click',function() { | ||
| 255 | /************************************************************************************************************************************************/ | 256 | /************************************************************************************************************************************************/ |
| 256 | 257 | ||
| 257 | /** | 258 | /** |
| 258 | - * @description : (TODO) 保存数据. | 259 | + * @description : (TODO) 监听保存数据事件. |
| 259 | * | 260 | * |
| 260 | * @status OK. | 261 | * @status OK. |
| 261 | ************************************************************************************************************************************************/ | 262 | ************************************************************************************************************************************************/ |
| @@ -282,6 +283,112 @@ $('.aboutread').on('click',function() { | @@ -282,6 +283,112 @@ $('.aboutread').on('click',function() { | ||
| 282 | /************************************************************************************************************************************************/ | 283 | /************************************************************************************************************************************************/ |
| 283 | 284 | ||
| 284 | /** | 285 | /** |
| 286 | + * @description : (TODO) 监听统计数据事件. | ||
| 287 | + * | ||
| 288 | + * @status OK. | ||
| 289 | + ************************************************************************************************************************************************/ | ||
| 290 | + $('.countAdd').on('click',function() { | ||
| 291 | + var list = $_GlobalGraph.getDataArray(); | ||
| 292 | + var countBc = 0,// 总班次 | ||
| 293 | + serviceBc = 0,// 营运班次 | ||
| 294 | + jcbc = 0, // 进场总班次. | ||
| 295 | + ccbc = 0, // 出场总班次. | ||
| 296 | + cfbc = 0,// 吃饭总班次. | ||
| 297 | + zwlbbc = 0,// 早晚例保总班次. | ||
| 298 | + countGs = 0.0,// 总工时 | ||
| 299 | + servicesj = 0,// 营运班次总时间 | ||
| 300 | + jcsj = 0.0,// 进场总时间. | ||
| 301 | + ccsj = 0.0 // 出场总时间. | ||
| 302 | + cfsj = 0.0, // 吃饭总时间. | ||
| 303 | + zwlbsj = 0.0, // 早晚例保总时间. | ||
| 304 | + ksBc = 0,// 空驶班次 | ||
| 305 | + serviceLc = 0.0 ,// 营运里程 | ||
| 306 | + ksLc = 0.0 ,// 空驶里程 | ||
| 307 | + avgTzjx = 0.0,// 平均停站间隙 | ||
| 308 | + gfServiceBc = 0,// 高峰营运班次 | ||
| 309 | + dgServiceBc = 0,// 低谷营运班次 | ||
| 310 | + gfAvgTzjx = 0.0,// 高峰平均停站间隙 | ||
| 311 | + dgAvgTzjx = 0.0;// 低谷平均停站间隙 | ||
| 312 | + for(var i = 0;i<list.length;i++) { | ||
| 313 | + if(list[i].bcsj>0) { | ||
| 314 | + countBc = countBc + 1; | ||
| 315 | + countGs = countGs + list[i].STOPTIME + list[i].bcsj; | ||
| 316 | + var nowDate = BaseFun.getDateTime(list[i].fcsj); | ||
| 317 | + if((BaseFun.isgfsjd($_GlobalGraph.configuration.dataMap.zgfsjd[0].st,$_GlobalGraph.configuration.dataMap.zgfsjd[0].ed,nowDate) || | ||
| 318 | + BaseFun.isgfsjd($_GlobalGraph.configuration.dataMap.wgfsjd[0].st,$_GlobalGraph.configuration.dataMap.wgfsjd[0].ed,nowDate)) && | ||
| 319 | + (list[i].bcType == $_GlobalGraph.configuration.dataMap.bcTypeArr.normal || | ||
| 320 | + list[i].bcType == $_GlobalGraph.configuration.dataMap.bcTypeArr.region || | ||
| 321 | + list[i].bcType == $_GlobalGraph.configuration.dataMap.bcTypeArr.major)) { | ||
| 322 | + gfServiceBc = gfServiceBc + 1; | ||
| 323 | + gfAvgTzjx = gfAvgTzjx + list[i].STOPTIME; | ||
| 324 | + } else if((!BaseFun.isgfsjd($_GlobalGraph.configuration.dataMap.zgfsjd[0].st,$_GlobalGraph.configuration.dataMap.zgfsjd[0].ed,nowDate) || | ||
| 325 | + !BaseFun.isgfsjd($_GlobalGraph.configuration.dataMap.wgfsjd[0].st,$_GlobalGraph.configuration.dataMap.wgfsjd[0].ed,nowDate)) && | ||
| 326 | + (list[i].bcType == $_GlobalGraph.configuration.dataMap.bcTypeArr.normal || | ||
| 327 | + list[i].bcType == $_GlobalGraph.configuration.dataMap.bcTypeArr.region || | ||
| 328 | + list[i].bcType == $_GlobalGraph.configuration.dataMap.bcTypeArr.major)){ | ||
| 329 | + dgServiceBc = dgServiceBc + 1; | ||
| 330 | + dgAvgTzjx = dgAvgTzjx + list[i].STOPTIME; | ||
| 331 | + } | ||
| 332 | + if(list[i].bcType == $_GlobalGraph.configuration.dataMap.bcTypeArr.normal || | ||
| 333 | + list[i].bcType == $_GlobalGraph.configuration.dataMap.bcTypeArr.region || | ||
| 334 | + list[i].bcType == $_GlobalGraph.configuration.dataMap.bcTypeArr.major) { | ||
| 335 | + serviceBc = serviceBc + 1; | ||
| 336 | + serviceLc = serviceLc + list[i].jhlc; | ||
| 337 | + servicesj = servicesj + list[i].bcsj; | ||
| 338 | + avgTzjx = avgTzjx + list[i].STOPTIME; | ||
| 339 | + }else if(list[i].bcType == $_GlobalGraph.configuration.dataMap.bcTypeArr.venting) { | ||
| 340 | + ksBc = ksBc +1; | ||
| 341 | + ksLc = ksLc + list[i].jhlc; | ||
| 342 | + }else if(list[i].bcType == $_GlobalGraph.configuration.dataMap.bcTypeArr.in_) { | ||
| 343 | + jcbc = jcbc +1; | ||
| 344 | + jcsj = jcsj + list[i].bcsj; | ||
| 345 | + }else if(list[i].bcType == $_GlobalGraph.configuration.dataMap.bcTypeArr.out) { | ||
| 346 | + ccbc = ccbc +1; | ||
| 347 | + ccsj = ccsj + list[i].bcsj; | ||
| 348 | + }else if(list[i].bcType == $_GlobalGraph.configuration.dataMap.bcTypeArr.cf) { | ||
| 349 | + cfbc = cfbc +1; | ||
| 350 | + cfsj = cfsj + list[i].bcsj; | ||
| 351 | + }else if(list[i].bcType == $_GlobalGraph.configuration.dataMap.bcTypeArr.bd || | ||
| 352 | + list[i].bcType == $_GlobalGraph.configuration.dataMap.bcTypeArr.lc ) { | ||
| 353 | + zwlbbc = zwlbbc +1; | ||
| 354 | + zwlbsj = zwlbsj + list[i].bcsj; | ||
| 355 | + } | ||
| 356 | + } | ||
| 357 | + } | ||
| 358 | + dgAvgTzjx = dgAvgTzjx/dgServiceBc; | ||
| 359 | + gfAvgTzjx = gfAvgTzjx/gfServiceBc; | ||
| 360 | + avgTzjx = avgTzjx/dgServiceBc; | ||
| 361 | + var countDate = [{'name':'总班次(包括进出场、吃饭时间、早晚例保、营运且班次时间大于零的班次)','value':countBc}, | ||
| 362 | + {'name':'进场总班次(包括进场且班次时间大于零的班次)','value':jcbc}, | ||
| 363 | + {'name':'出场总班次(包括进场且班次时间大于零的班次)','value':ccbc}, | ||
| 364 | + {'name':'吃饭总班次(包括吃饭且班次时间大于零的班次)','value':cfbc}, | ||
| 365 | + {'name':'早晚例保总班次(包括早晚例保且时间大于零的班次)','value':zwlbbc}, | ||
| 366 | + {'name':'营运总班次(包括正常、区间、放大站且班次时间大于零班次)','value':serviceBc}, | ||
| 367 | + {'name':'进场总时间(包括进场班次且班次时间大于零)','value':parseFloat((jcsj/60).toFixed(2)) + ' 小时'}, | ||
| 368 | + {'name':'出场总时间(包括进场班次且班次时间大于零)','value':parseFloat((ccsj/60).toFixed(2)) + ' 小时'}, | ||
| 369 | + {'name':'吃饭总时间(包括吃饭班次且班次时间大于零)','value':parseFloat((cfsj/60).toFixed(2)) + ' 小时'}, | ||
| 370 | + {'name':'早晚例保总时间(包括早晚例保班次且时间大于零的)','value':parseFloat((zwlbsj/60).toFixed(2)) + ' 小时'}, | ||
| 371 | + {'name':'营运班次总时间(包括正常、区间、放大站且班次时间大于零)','value':parseFloat((servicesj/60).toFixed(2)) + ' 小时'}, | ||
| 372 | + {'name':'总工时(包括进出场、吃饭时间、早晚例保、营运班次时间)','value': parseFloat((countGs/60).toFixed(2)) + ' 小时'}, | ||
| 373 | + {'name':'空驶班次(包括直放班次)','value':ksBc}, | ||
| 374 | + {'name':'营运里程(包括正常、区间、放大站里程)','value':serviceLc + ' 公里'}, | ||
| 375 | + {'name':'空驶里程(包括直放里程)','value':ksLc + ' 公里'}, | ||
| 376 | + {'name':'平均停站时间(营运班次停站时间总和/营运总班次)','value':parseInt(avgTzjx) + ' 分钟' }, | ||
| 377 | + {'name':'高峰营运班次(包括早晚高峰时段的正常、区间、放大站班次)','value':gfServiceBc}, | ||
| 378 | + {'name':'低谷营运班次(包括低谷时段的正常、区间、放大站班次)','value':dgServiceBc}, | ||
| 379 | + {'name':'高峰平均停站间隙(高峰营运班次停站时间总和/高峰营运班次总和)','value':parseInt(gfAvgTzjx) + ' 分钟'}, | ||
| 380 | + {'name':'低谷平均停站间隙(低谷营运班次停站时间总和/低谷营运班次总和)','value':parseInt(dgAvgTzjx) + ' 分钟'}, | ||
| 381 | + {'name':'综合评估','value':3}]; | ||
| 382 | + // 弹出层mobal页面 | ||
| 383 | + $.get('/pages/base/timesmodel/countadd.html', function(m){ | ||
| 384 | + $(pjaxContainer).append(m); | ||
| 385 | + // 规定被选元素要触发的事件。可以使自定义事件(使用 bind() 函数来附加),或者任何标准事件。 | ||
| 386 | + $('#countadd_mobal').trigger('countAddMobal.show',[countDate]); | ||
| 387 | + }); | ||
| 388 | + }); | ||
| 389 | +/************************************************************************************************************************************************/ | ||
| 390 | + | ||
| 391 | +/** | ||
| 285 | * @description : (TODO)获取路牌对应的班次数(这里的班次不包括早晚例保班次、吃饭时间) | 392 | * @description : (TODO)获取路牌对应的班次数(这里的班次不包括早晚例保班次、吃饭时间) |
| 286 | * | 393 | * |
| 287 | * @params : [a1--班次数组;a2--路牌数组] | 394 | * @params : [a1--班次数组;a2--路牌数组] |
src/main/resources/static/pages/base/timesmodel/js/raty/lib/img/cancel-off.png
0 → 100644
649 Bytes
src/main/resources/static/pages/base/timesmodel/js/raty/lib/img/cancel-on.png
0 → 100644
715 Bytes
src/main/resources/static/pages/base/timesmodel/js/raty/lib/img/star-half.png
0 → 100644
667 Bytes
src/main/resources/static/pages/base/timesmodel/js/raty/lib/img/star-off.png
0 → 100644
652 Bytes
src/main/resources/static/pages/base/timesmodel/js/raty/lib/img/star-on.png
0 → 100644
631 Bytes
src/main/resources/static/pages/base/timesmodel/js/raty/lib/jquery.raty.js
0 → 100644
| 1 | +/*! | ||
| 2 | + * jQuery Raty - A Star Rating Plugin | ||
| 3 | + * ------------------------------------------------------------------ | ||
| 4 | + * | ||
| 5 | + * jQuery Raty is a plugin that generates a customizable star rating. | ||
| 6 | + * | ||
| 7 | + * Licensed under The MIT License | ||
| 8 | + * | ||
| 9 | + * @version 2.5.2 | ||
| 10 | + * @since 2010.06.11 | ||
| 11 | + * @author Washington Botelho | ||
| 12 | + * @documentation wbotelhos.com/raty | ||
| 13 | + * | ||
| 14 | + * ------------------------------------------------------------------ | ||
| 15 | + * | ||
| 16 | + * <div id="star"></div> | ||
| 17 | + * | ||
| 18 | + * $('#star').raty(); | ||
| 19 | + * | ||
| 20 | + */ | ||
| 21 | + | ||
| 22 | +;(function($) { | ||
| 23 | + | ||
| 24 | + var methods = { | ||
| 25 | + init: function(settings) { | ||
| 26 | + return this.each(function() { | ||
| 27 | + methods.destroy.call(this); | ||
| 28 | + | ||
| 29 | + this.opt = $.extend(true, {}, $.fn.raty.defaults, settings); | ||
| 30 | + | ||
| 31 | + var that = $(this), | ||
| 32 | + inits = ['number', 'readOnly', 'score', 'scoreName']; | ||
| 33 | + | ||
| 34 | + methods._callback.call(this, inits); | ||
| 35 | + | ||
| 36 | + if (this.opt.precision) { | ||
| 37 | + methods._adjustPrecision.call(this); | ||
| 38 | + } | ||
| 39 | + | ||
| 40 | + this.opt.number = methods._between(this.opt.number, 0, this.opt.numberMax) | ||
| 41 | + | ||
| 42 | + this.opt.path = this.opt.path || ''; | ||
| 43 | + | ||
| 44 | + if (this.opt.path && this.opt.path.slice(this.opt.path.length - 1, this.opt.path.length) !== '/') { | ||
| 45 | + this.opt.path += '/'; | ||
| 46 | + } | ||
| 47 | + | ||
| 48 | + this.stars = methods._createStars.call(this); | ||
| 49 | + this.score = methods._createScore.call(this); | ||
| 50 | + | ||
| 51 | + methods._apply.call(this, this.opt.score); | ||
| 52 | + | ||
| 53 | + var space = this.opt.space ? 4 : 0, | ||
| 54 | + width = this.opt.width || (this.opt.number * this.opt.size + this.opt.number * space); | ||
| 55 | + | ||
| 56 | + if (this.opt.cancel) { | ||
| 57 | + this.cancel = methods._createCancel.call(this); | ||
| 58 | + | ||
| 59 | + width += (this.opt.size + space); | ||
| 60 | + } | ||
| 61 | + | ||
| 62 | + if (this.opt.readOnly) { | ||
| 63 | + methods._lock.call(this); | ||
| 64 | + } else { | ||
| 65 | + that.css('cursor', 'pointer'); | ||
| 66 | + methods._binds.call(this); | ||
| 67 | + } | ||
| 68 | + | ||
| 69 | + if (this.opt.width !== false) { | ||
| 70 | + that.css('width', width); | ||
| 71 | + } | ||
| 72 | + | ||
| 73 | + methods._target.call(this, this.opt.score); | ||
| 74 | + | ||
| 75 | + that.data({ 'settings': this.opt, 'raty': true }); | ||
| 76 | + }); | ||
| 77 | + }, _adjustPrecision: function() { | ||
| 78 | + this.opt.targetType = 'score'; | ||
| 79 | + this.opt.half = true; | ||
| 80 | + }, _apply: function(score) { | ||
| 81 | + if (score && score > 0) { | ||
| 82 | + score = methods._between(score, 0, this.opt.number); | ||
| 83 | + this.score.val(score); | ||
| 84 | + } | ||
| 85 | + | ||
| 86 | + methods._fill.call(this, score); | ||
| 87 | + | ||
| 88 | + if (score) { | ||
| 89 | + methods._roundStars.call(this, score); | ||
| 90 | + } | ||
| 91 | + }, _between: function(value, min, max) { | ||
| 92 | + return Math.min(Math.max(parseFloat(value), min), max); | ||
| 93 | + }, _binds: function() { | ||
| 94 | + if (this.cancel) { | ||
| 95 | + methods._bindCancel.call(this); | ||
| 96 | + } | ||
| 97 | + | ||
| 98 | + methods._bindClick.call(this); | ||
| 99 | + methods._bindOut.call(this); | ||
| 100 | + methods._bindOver.call(this); | ||
| 101 | + }, _bindCancel: function() { | ||
| 102 | + methods._bindClickCancel.call(this); | ||
| 103 | + methods._bindOutCancel.call(this); | ||
| 104 | + methods._bindOverCancel.call(this); | ||
| 105 | + }, _bindClick: function() { | ||
| 106 | + var self = this, | ||
| 107 | + that = $(self); | ||
| 108 | + | ||
| 109 | + self.stars.on('click.raty', function(evt) { | ||
| 110 | + self.score.val((self.opt.half || self.opt.precision) ? that.data('score') : this.alt); | ||
| 111 | + | ||
| 112 | + if (self.opt.click) { | ||
| 113 | + self.opt.click.call(self, parseFloat(self.score.val()), evt); | ||
| 114 | + } | ||
| 115 | + }); | ||
| 116 | + }, _bindClickCancel: function() { | ||
| 117 | + var self = this; | ||
| 118 | + | ||
| 119 | + self.cancel.on('click.raty', function(evt) { | ||
| 120 | + self.score.removeAttr('value'); | ||
| 121 | + | ||
| 122 | + if (self.opt.click) { | ||
| 123 | + self.opt.click.call(self, null, evt); | ||
| 124 | + } | ||
| 125 | + }); | ||
| 126 | + }, _bindOut: function() { | ||
| 127 | + var self = this; | ||
| 128 | + | ||
| 129 | + $(this).on('mouseleave.raty', function(evt) { | ||
| 130 | + var score = parseFloat(self.score.val()) || undefined; | ||
| 131 | + | ||
| 132 | + methods._apply.call(self, score); | ||
| 133 | + methods._target.call(self, score, evt); | ||
| 134 | + | ||
| 135 | + if (self.opt.mouseout) { | ||
| 136 | + self.opt.mouseout.call(self, score, evt); | ||
| 137 | + } | ||
| 138 | + }); | ||
| 139 | + }, _bindOutCancel: function() { | ||
| 140 | + var self = this; | ||
| 141 | + | ||
| 142 | + self.cancel.on('mouseleave.raty', function(evt) { | ||
| 143 | + $(this).attr('src', self.opt.path + self.opt.cancelOff); | ||
| 144 | + | ||
| 145 | + if (self.opt.mouseout) { | ||
| 146 | + self.opt.mouseout.call(self, self.score.val() || null, evt); | ||
| 147 | + } | ||
| 148 | + }); | ||
| 149 | + }, _bindOverCancel: function() { | ||
| 150 | + var self = this; | ||
| 151 | + | ||
| 152 | + self.cancel.on('mouseover.raty', function(evt) { | ||
| 153 | + $(this).attr('src', self.opt.path + self.opt.cancelOn); | ||
| 154 | + | ||
| 155 | + self.stars.attr('src', self.opt.path + self.opt.starOff); | ||
| 156 | + | ||
| 157 | + methods._target.call(self, null, evt); | ||
| 158 | + | ||
| 159 | + if (self.opt.mouseover) { | ||
| 160 | + self.opt.mouseover.call(self, null); | ||
| 161 | + } | ||
| 162 | + }); | ||
| 163 | + }, _bindOver: function() { | ||
| 164 | + var self = this, | ||
| 165 | + that = $(self), | ||
| 166 | + action = self.opt.half ? 'mousemove.raty' : 'mouseover.raty'; | ||
| 167 | + | ||
| 168 | + self.stars.on(action, function(evt) { | ||
| 169 | + var score = parseInt(this.alt, 10); | ||
| 170 | + | ||
| 171 | + if (self.opt.half) { | ||
| 172 | + var position = parseFloat((evt.pageX - $(this).offset().left) / self.opt.size), | ||
| 173 | + plus = (position > .5) ? 1 : .5; | ||
| 174 | + | ||
| 175 | + score = score - 1 + plus; | ||
| 176 | + | ||
| 177 | + methods._fill.call(self, score); | ||
| 178 | + | ||
| 179 | + if (self.opt.precision) { | ||
| 180 | + score = score - plus + position; | ||
| 181 | + } | ||
| 182 | + | ||
| 183 | + methods._roundStars.call(self, score); | ||
| 184 | + | ||
| 185 | + that.data('score', score); | ||
| 186 | + } else { | ||
| 187 | + methods._fill.call(self, score); | ||
| 188 | + } | ||
| 189 | + | ||
| 190 | + methods._target.call(self, score, evt); | ||
| 191 | + | ||
| 192 | + if (self.opt.mouseover) { | ||
| 193 | + self.opt.mouseover.call(self, score, evt); | ||
| 194 | + } | ||
| 195 | + }); | ||
| 196 | + }, _callback: function(options) { | ||
| 197 | + for (i in options) { | ||
| 198 | + if (typeof this.opt[options[i]] === 'function') { | ||
| 199 | + this.opt[options[i]] = this.opt[options[i]].call(this); | ||
| 200 | + } | ||
| 201 | + } | ||
| 202 | + }, _createCancel: function() { | ||
| 203 | + var that = $(this), | ||
| 204 | + icon = this.opt.path + this.opt.cancelOff, | ||
| 205 | + cancel = $('<img />', { src: icon, alt: 'x', title: this.opt.cancelHint, 'class': 'raty-cancel' }); | ||
| 206 | + | ||
| 207 | + if (this.opt.cancelPlace == 'left') { | ||
| 208 | + that.prepend(' ').prepend(cancel); | ||
| 209 | + } else { | ||
| 210 | + that.append(' ').append(cancel); | ||
| 211 | + } | ||
| 212 | + | ||
| 213 | + return cancel; | ||
| 214 | + }, _createScore: function() { | ||
| 215 | + return $('<input />', { type: 'hidden', name: this.opt.scoreName }).appendTo(this); | ||
| 216 | + }, _createStars: function() { | ||
| 217 | + var that = $(this); | ||
| 218 | + | ||
| 219 | + for (var i = 1; i <= this.opt.number; i++) { | ||
| 220 | + var title = methods._getHint.call(this, i), | ||
| 221 | + icon = (this.opt.score && this.opt.score >= i) ? 'starOn' : 'starOff'; | ||
| 222 | + | ||
| 223 | + icon = this.opt.path + this.opt[icon]; | ||
| 224 | + | ||
| 225 | + $('<img />', { src : icon, alt: i, title: title }).appendTo(this); | ||
| 226 | + | ||
| 227 | + if (this.opt.space) { | ||
| 228 | + that.append((i < this.opt.number) ? ' ' : ''); | ||
| 229 | + } | ||
| 230 | + } | ||
| 231 | + | ||
| 232 | + return that.children('img'); | ||
| 233 | + }, _error: function(message) { | ||
| 234 | + $(this).html(message); | ||
| 235 | + | ||
| 236 | + $.error(message); | ||
| 237 | + }, _fill: function(score) { | ||
| 238 | + var self = this, | ||
| 239 | + hash = 0; | ||
| 240 | + | ||
| 241 | + for (var i = 1; i <= self.stars.length; i++) { | ||
| 242 | + var star = self.stars.eq(i - 1), | ||
| 243 | + select = self.opt.single ? (i == score) : (i <= score); | ||
| 244 | + | ||
| 245 | + if (self.opt.iconRange && self.opt.iconRange.length > hash) { | ||
| 246 | + var irange = self.opt.iconRange[hash], | ||
| 247 | + on = irange.on || self.opt.starOn, | ||
| 248 | + off = irange.off || self.opt.starOff, | ||
| 249 | + icon = select ? on : off; | ||
| 250 | + | ||
| 251 | + if (i <= irange.range) { | ||
| 252 | + star.attr('src', self.opt.path + icon); | ||
| 253 | + } | ||
| 254 | + | ||
| 255 | + if (i == irange.range) { | ||
| 256 | + hash++; | ||
| 257 | + } | ||
| 258 | + } else { | ||
| 259 | + var icon = select ? 'starOn' : 'starOff'; | ||
| 260 | + | ||
| 261 | + star.attr('src', this.opt.path + this.opt[icon]); | ||
| 262 | + } | ||
| 263 | + } | ||
| 264 | + }, _getHint: function(score) { | ||
| 265 | + var hint = this.opt.hints[score - 1]; | ||
| 266 | + return (hint === '') ? '' : (hint || score); | ||
| 267 | + }, _lock: function() { | ||
| 268 | + var score = parseInt(this.score.val(), 10), // TODO: 3.1 >> [['1'], ['2'], ['3', '.1', '.2']] | ||
| 269 | + hint = score ? methods._getHint.call(this, score) : this.opt.noRatedMsg; | ||
| 270 | + | ||
| 271 | + $(this).data('readonly', true).css('cursor', '').attr('title', hint); | ||
| 272 | + | ||
| 273 | + this.score.attr('readonly', 'readonly'); | ||
| 274 | + this.stars.attr('title', hint); | ||
| 275 | + | ||
| 276 | + if (this.cancel) { | ||
| 277 | + this.cancel.hide(); | ||
| 278 | + } | ||
| 279 | + }, _roundStars: function(score) { | ||
| 280 | + var rest = (score - Math.floor(score)).toFixed(2); | ||
| 281 | + | ||
| 282 | + if (rest > this.opt.round.down) { | ||
| 283 | + var icon = 'starOn'; // Up: [x.76 .. x.99] | ||
| 284 | + | ||
| 285 | + if (this.opt.halfShow && rest < this.opt.round.up) { // Half: [x.26 .. x.75] | ||
| 286 | + icon = 'starHalf'; | ||
| 287 | + } else if (rest < this.opt.round.full) { // Down: [x.00 .. x.5] | ||
| 288 | + icon = 'starOff'; | ||
| 289 | + } | ||
| 290 | + | ||
| 291 | + this.stars.eq(Math.ceil(score) - 1).attr('src', this.opt.path + this.opt[icon]); | ||
| 292 | + } // Full down: [x.00 .. x.25] | ||
| 293 | + }, _target: function(score, evt) { | ||
| 294 | + if (this.opt.target) { | ||
| 295 | + var target = $(this.opt.target); | ||
| 296 | + | ||
| 297 | + if (target.length === 0) { | ||
| 298 | + methods._error.call(this, 'Target selector invalid or missing!'); | ||
| 299 | + } | ||
| 300 | + | ||
| 301 | + if (this.opt.targetFormat.indexOf('{score}') < 0) { | ||
| 302 | + methods._error.call(this, 'Template "{score}" missing!'); | ||
| 303 | + } | ||
| 304 | + | ||
| 305 | + var mouseover = evt && evt.type == 'mouseover'; | ||
| 306 | + | ||
| 307 | + if (score === undefined) { | ||
| 308 | + score = this.opt.targetText; | ||
| 309 | + } else if (score === null) { | ||
| 310 | + score = mouseover ? this.opt.cancelHint : this.opt.targetText; | ||
| 311 | + } else { | ||
| 312 | + if (this.opt.targetType == 'hint') { | ||
| 313 | + score = methods._getHint.call(this, Math.ceil(score)); | ||
| 314 | + } else if (this.opt.precision) { | ||
| 315 | + score = parseFloat(score).toFixed(1); | ||
| 316 | + } | ||
| 317 | + | ||
| 318 | + if (!mouseover && !this.opt.targetKeep) { | ||
| 319 | + score = this.opt.targetText; | ||
| 320 | + } | ||
| 321 | + } | ||
| 322 | + | ||
| 323 | + if (score) { | ||
| 324 | + score = this.opt.targetFormat.toString().replace('{score}', score); | ||
| 325 | + } | ||
| 326 | + | ||
| 327 | + if (target.is(':input')) { | ||
| 328 | + target.val(score); | ||
| 329 | + } else { | ||
| 330 | + target.html(score); | ||
| 331 | + } | ||
| 332 | + } | ||
| 333 | + }, _unlock: function() { | ||
| 334 | + $(this).data('readonly', false).css('cursor', 'pointer').removeAttr('title'); | ||
| 335 | + | ||
| 336 | + this.score.removeAttr('readonly', 'readonly'); | ||
| 337 | + | ||
| 338 | + for (var i = 0; i < this.opt.number; i++) { | ||
| 339 | + this.stars.eq(i).attr('title', methods._getHint.call(this, i + 1)); | ||
| 340 | + } | ||
| 341 | + | ||
| 342 | + if (this.cancel) { | ||
| 343 | + this.cancel.css('display', ''); | ||
| 344 | + } | ||
| 345 | + }, cancel: function(click) { | ||
| 346 | + return this.each(function() { | ||
| 347 | + if ($(this).data('readonly') !== true) { | ||
| 348 | + methods[click ? 'click' : 'score'].call(this, null); | ||
| 349 | + this.score.removeAttr('value'); | ||
| 350 | + } | ||
| 351 | + }); | ||
| 352 | + }, click: function(score) { | ||
| 353 | + return $(this).each(function() { | ||
| 354 | + if ($(this).data('readonly') !== true) { | ||
| 355 | + methods._apply.call(this, score); | ||
| 356 | + | ||
| 357 | + if (!this.opt.click) { | ||
| 358 | + methods._error.call(this, 'You must add the "click: function(score, evt) { }" callback.'); | ||
| 359 | + } | ||
| 360 | + | ||
| 361 | + this.opt.click.call(this, score, { type: 'click' }); | ||
| 362 | + | ||
| 363 | + methods._target.call(this, score); | ||
| 364 | + } | ||
| 365 | + }); | ||
| 366 | + }, destroy: function() { | ||
| 367 | + return $(this).each(function() { | ||
| 368 | + var that = $(this), | ||
| 369 | + raw = that.data('raw'); | ||
| 370 | + | ||
| 371 | + if (raw) { | ||
| 372 | + that.off('.raty').empty().css({ cursor: raw.style.cursor, width: raw.style.width }).removeData('readonly'); | ||
| 373 | + } else { | ||
| 374 | + that.data('raw', that.clone()[0]); | ||
| 375 | + } | ||
| 376 | + }); | ||
| 377 | + }, getScore: function() { | ||
| 378 | + var score = [], | ||
| 379 | + value ; | ||
| 380 | + | ||
| 381 | + $(this).each(function() { | ||
| 382 | + value = this.score.val(); | ||
| 383 | + | ||
| 384 | + score.push(value ? parseFloat(value) : undefined); | ||
| 385 | + }); | ||
| 386 | + | ||
| 387 | + return (score.length > 1) ? score : score[0]; | ||
| 388 | + }, readOnly: function(readonly) { | ||
| 389 | + return this.each(function() { | ||
| 390 | + var that = $(this); | ||
| 391 | + | ||
| 392 | + if (that.data('readonly') !== readonly) { | ||
| 393 | + if (readonly) { | ||
| 394 | + that.off('.raty').children('img').off('.raty'); | ||
| 395 | + | ||
| 396 | + methods._lock.call(this); | ||
| 397 | + } else { | ||
| 398 | + methods._binds.call(this); | ||
| 399 | + methods._unlock.call(this); | ||
| 400 | + } | ||
| 401 | + | ||
| 402 | + that.data('readonly', readonly); | ||
| 403 | + } | ||
| 404 | + }); | ||
| 405 | + }, reload: function() { | ||
| 406 | + return methods.set.call(this, {}); | ||
| 407 | + }, score: function() { | ||
| 408 | + return arguments.length ? methods.setScore.apply(this, arguments) : methods.getScore.call(this); | ||
| 409 | + }, set: function(settings) { | ||
| 410 | + return this.each(function() { | ||
| 411 | + var that = $(this), | ||
| 412 | + actual = that.data('settings'), | ||
| 413 | + news = $.extend({}, actual, settings); | ||
| 414 | + | ||
| 415 | + that.raty(news); | ||
| 416 | + }); | ||
| 417 | + }, setScore: function(score) { | ||
| 418 | + return $(this).each(function() { | ||
| 419 | + if ($(this).data('readonly') !== true) { | ||
| 420 | + methods._apply.call(this, score); | ||
| 421 | + methods._target.call(this, score); | ||
| 422 | + } | ||
| 423 | + }); | ||
| 424 | + } | ||
| 425 | + }; | ||
| 426 | + | ||
| 427 | + $.fn.raty = function(method) { | ||
| 428 | + if (methods[method]) { | ||
| 429 | + return methods[method].apply(this, Array.prototype.slice.call(arguments, 1)); | ||
| 430 | + } else if (typeof method === 'object' || !method) { | ||
| 431 | + return methods.init.apply(this, arguments); | ||
| 432 | + } else { | ||
| 433 | + $.error('Method ' + method + ' does not exist!'); | ||
| 434 | + } | ||
| 435 | + }; | ||
| 436 | + | ||
| 437 | + $.fn.raty.defaults = { | ||
| 438 | + cancel : false, | ||
| 439 | + cancelHint : 'Cancel this rating!', | ||
| 440 | + cancelOff : 'cancel-off.png', | ||
| 441 | + cancelOn : 'cancel-on.png', | ||
| 442 | + cancelPlace : 'left', | ||
| 443 | + click : undefined, | ||
| 444 | + half : false, | ||
| 445 | + halfShow : true, | ||
| 446 | + hints : ['bad', 'poor', 'regular', 'good', 'gorgeous'], | ||
| 447 | + iconRange : undefined, | ||
| 448 | + mouseout : undefined, | ||
| 449 | + mouseover : undefined, | ||
| 450 | + noRatedMsg : 'Not rated yet!', | ||
| 451 | + number : 5, | ||
| 452 | + numberMax : 20, | ||
| 453 | + path : 'js/raty/lib/img/', | ||
| 454 | + precision : false, | ||
| 455 | + readOnly : false, | ||
| 456 | + round : { down: .25, full: .6, up: .76 }, | ||
| 457 | + score : undefined, | ||
| 458 | + scoreName : 'score', | ||
| 459 | + single : false, | ||
| 460 | + size : 16, | ||
| 461 | + space : true, | ||
| 462 | + starHalf : 'star-half.png', | ||
| 463 | + starOff : 'star-off.png', | ||
| 464 | + starOn : 'star-on.png', | ||
| 465 | + target : undefined, | ||
| 466 | + targetFormat : '{score}', | ||
| 467 | + targetKeep : false, | ||
| 468 | + targetText : '', | ||
| 469 | + targetType : 'hint', | ||
| 470 | + width : undefined | ||
| 471 | + }; | ||
| 472 | + | ||
| 473 | +})(jQuery); |
src/main/resources/static/pages/base/timesmodel/js/raty/lib/jquery.raty.min.js
0 → 100644
| 1 | +/*! | ||
| 2 | + * jQuery Raty - A Star Rating Plugin | ||
| 3 | + * | ||
| 4 | + * Licensed under The MIT License | ||
| 5 | + * | ||
| 6 | + * @version 2.5.2 | ||
| 7 | + * @author Washington Botelho | ||
| 8 | + * @documentation wbotelhos.com/raty | ||
| 9 | + * | ||
| 10 | + */ | ||
| 11 | + | ||
| 12 | +;(function(b){var a={init:function(c){return this.each(function(){a.destroy.call(this);this.opt=b.extend(true,{},b.fn.raty.defaults,c);var e=b(this),g=["number","readOnly","score","scoreName"];a._callback.call(this,g);if(this.opt.precision){a._adjustPrecision.call(this);}this.opt.number=a._between(this.opt.number,0,this.opt.numberMax);this.opt.path=this.opt.path||"";if(this.opt.path&&this.opt.path.slice(this.opt.path.length-1,this.opt.path.length)!=="/"){this.opt.path+="/";}this.stars=a._createStars.call(this);this.score=a._createScore.call(this);a._apply.call(this,this.opt.score);var f=this.opt.space?4:0,d=this.opt.width||(this.opt.number*this.opt.size+this.opt.number*f);if(this.opt.cancel){this.cancel=a._createCancel.call(this);d+=(this.opt.size+f);}if(this.opt.readOnly){a._lock.call(this);}else{e.css("cursor","pointer");a._binds.call(this);}if(this.opt.width!==false){e.css("width",d);}a._target.call(this,this.opt.score);e.data({settings:this.opt,raty:true});});},_adjustPrecision:function(){this.opt.targetType="score";this.opt.half=true;},_apply:function(c){if(c&&c>0){c=a._between(c,0,this.opt.number);this.score.val(c);}a._fill.call(this,c);if(c){a._roundStars.call(this,c);}},_between:function(e,d,c){return Math.min(Math.max(parseFloat(e),d),c);},_binds:function(){if(this.cancel){a._bindCancel.call(this);}a._bindClick.call(this);a._bindOut.call(this);a._bindOver.call(this);},_bindCancel:function(){a._bindClickCancel.call(this);a._bindOutCancel.call(this);a._bindOverCancel.call(this);},_bindClick:function(){var c=this,d=b(c);c.stars.on("click.raty",function(e){c.score.val((c.opt.half||c.opt.precision)?d.data("score"):this.alt);if(c.opt.click){c.opt.click.call(c,parseFloat(c.score.val()),e);}});},_bindClickCancel:function(){var c=this;c.cancel.on("click.raty",function(d){c.score.removeAttr("value");if(c.opt.click){c.opt.click.call(c,null,d);}});},_bindOut:function(){var c=this;b(this).on("mouseleave.raty",function(d){var e=parseFloat(c.score.val())||undefined;a._apply.call(c,e);a._target.call(c,e,d);if(c.opt.mouseout){c.opt.mouseout.call(c,e,d);}});},_bindOutCancel:function(){var c=this;c.cancel.on("mouseleave.raty",function(d){b(this).attr("src",c.opt.path+c.opt.cancelOff);if(c.opt.mouseout){c.opt.mouseout.call(c,c.score.val()||null,d);}});},_bindOverCancel:function(){var c=this;c.cancel.on("mouseover.raty",function(d){b(this).attr("src",c.opt.path+c.opt.cancelOn);c.stars.attr("src",c.opt.path+c.opt.starOff);a._target.call(c,null,d);if(c.opt.mouseover){c.opt.mouseover.call(c,null);}});},_bindOver:function(){var c=this,d=b(c),e=c.opt.half?"mousemove.raty":"mouseover.raty";c.stars.on(e,function(g){var h=parseInt(this.alt,10);if(c.opt.half){var f=parseFloat((g.pageX-b(this).offset().left)/c.opt.size),j=(f>0.5)?1:0.5;h=h-1+j;a._fill.call(c,h);if(c.opt.precision){h=h-j+f;}a._roundStars.call(c,h);d.data("score",h);}else{a._fill.call(c,h);}a._target.call(c,h,g);if(c.opt.mouseover){c.opt.mouseover.call(c,h,g);}});},_callback:function(c){for(i in c){if(typeof this.opt[c[i]]==="function"){this.opt[c[i]]=this.opt[c[i]].call(this);}}},_createCancel:function(){var e=b(this),c=this.opt.path+this.opt.cancelOff,d=b("<img />",{src:c,alt:"x",title:this.opt.cancelHint,"class":"raty-cancel"});if(this.opt.cancelPlace=="left"){e.prepend(" ").prepend(d);}else{e.append(" ").append(d);}return d;},_createScore:function(){return b("<input />",{type:"hidden",name:this.opt.scoreName}).appendTo(this);},_createStars:function(){var e=b(this);for(var c=1;c<=this.opt.number;c++){var f=a._getHint.call(this,c),d=(this.opt.score&&this.opt.score>=c)?"starOn":"starOff";d=this.opt.path+this.opt[d];b("<img />",{src:d,alt:c,title:f}).appendTo(this);if(this.opt.space){e.append((c<this.opt.number)?" ":"");}}return e.children("img");},_error:function(c){b(this).html(c);b.error(c);},_fill:function(d){var m=this,e=0;for(var f=1;f<=m.stars.length;f++){var g=m.stars.eq(f-1),l=m.opt.single?(f==d):(f<=d);if(m.opt.iconRange&&m.opt.iconRange.length>e){var j=m.opt.iconRange[e],h=j.on||m.opt.starOn,c=j.off||m.opt.starOff,k=l?h:c;if(f<=j.range){g.attr("src",m.opt.path+k);}if(f==j.range){e++;}}else{var k=l?"starOn":"starOff";g.attr("src",this.opt.path+this.opt[k]);}}},_getHint:function(d){var c=this.opt.hints[d-1];return(c==="")?"":(c||d);},_lock:function(){var d=parseInt(this.score.val(),10),c=d?a._getHint.call(this,d):this.opt.noRatedMsg;b(this).data("readonly",true).css("cursor","").attr("title",c);this.score.attr("readonly","readonly");this.stars.attr("title",c);if(this.cancel){this.cancel.hide();}},_roundStars:function(e){var d=(e-Math.floor(e)).toFixed(2);if(d>this.opt.round.down){var c="starOn";if(this.opt.halfShow&&d<this.opt.round.up){c="starHalf";}else{if(d<this.opt.round.full){c="starOff";}}this.stars.eq(Math.ceil(e)-1).attr("src",this.opt.path+this.opt[c]);}},_target:function(f,d){if(this.opt.target){var e=b(this.opt.target);if(e.length===0){a._error.call(this,"Target selector invalid or missing!");}if(this.opt.targetFormat.indexOf("{score}")<0){a._error.call(this,'Template "{score}" missing!');}var c=d&&d.type=="mouseover";if(f===undefined){f=this.opt.targetText;}else{if(f===null){f=c?this.opt.cancelHint:this.opt.targetText;}else{if(this.opt.targetType=="hint"){f=a._getHint.call(this,Math.ceil(f));}else{if(this.opt.precision){f=parseFloat(f).toFixed(1);}}if(!c&&!this.opt.targetKeep){f=this.opt.targetText;}}}if(f){f=this.opt.targetFormat.toString().replace("{score}",f);}if(e.is(":input")){e.val(f);}else{e.html(f);}}},_unlock:function(){b(this).data("readonly",false).css("cursor","pointer").removeAttr("title");this.score.removeAttr("readonly","readonly");for(var c=0;c<this.opt.number;c++){this.stars.eq(c).attr("title",a._getHint.call(this,c+1));}if(this.cancel){this.cancel.css("display","");}},cancel:function(c){return this.each(function(){if(b(this).data("readonly")!==true){a[c?"click":"score"].call(this,null);this.score.removeAttr("value");}});},click:function(c){return b(this).each(function(){if(b(this).data("readonly")!==true){a._apply.call(this,c);if(!this.opt.click){a._error.call(this,'You must add the "click: function(score, evt) { }" callback.');}this.opt.click.call(this,c,{type:"click"});a._target.call(this,c);}});},destroy:function(){return b(this).each(function(){var d=b(this),c=d.data("raw");if(c){d.off(".raty").empty().css({cursor:c.style.cursor,width:c.style.width}).removeData("readonly");}else{d.data("raw",d.clone()[0]);}});},getScore:function(){var d=[],c;b(this).each(function(){c=this.score.val();d.push(c?parseFloat(c):undefined);});return(d.length>1)?d:d[0];},readOnly:function(c){return this.each(function(){var d=b(this);if(d.data("readonly")!==c){if(c){d.off(".raty").children("img").off(".raty");a._lock.call(this);}else{a._binds.call(this);a._unlock.call(this);}d.data("readonly",c);}});},reload:function(){return a.set.call(this,{});},score:function(){return arguments.length?a.setScore.apply(this,arguments):a.getScore.call(this);},set:function(c){return this.each(function(){var e=b(this),f=e.data("settings"),d=b.extend({},f,c);e.raty(d);});},setScore:function(c){return b(this).each(function(){if(b(this).data("readonly")!==true){a._apply.call(this,c);a._target.call(this,c);}});}};b.fn.raty=function(c){if(a[c]){return a[c].apply(this,Array.prototype.slice.call(arguments,1));}else{if(typeof c==="object"||!c){return a.init.apply(this,arguments);}else{b.error("Method "+c+" does not exist!");}}};b.fn.raty.defaults={cancel:false,cancelHint:"Cancel this rating!",cancelOff:"cancel-off.png",cancelOn:"cancel-on.png",cancelPlace:"left",click:undefined,half:false,halfShow:true,hints:["bad","poor","regular","good","gorgeous"],iconRange:undefined,mouseout:undefined,mouseover:undefined,noRatedMsg:"Not rated yet!",number:5,numberMax:20,path:"",precision:false,readOnly:false,round:{down:0.25,full:0.6,up:0.76},score:undefined,scoreName:"score",single:false,size:16,space:true,starHalf:"star-half.png",starOff:"star-off.png",starOn:"star-on.png",target:undefined,targetFormat:"{score}",targetKeep:false,targetText:"",targetType:"hint",width:undefined};})(jQuery); |
src/main/resources/static/pages/forms/mould/list.xls
No preview for this file type
src/main/resources/static/pages/forms/mould/listDl.xls
No preview for this file type
src/main/resources/static/pages/forms/statement/scheduleDaily.html
| @@ -401,7 +401,6 @@ | @@ -401,7 +401,6 @@ | ||
| 401 | $('#forms .scheduleDaily_1').html(scheduleDaily_1); | 401 | $('#forms .scheduleDaily_1').html(scheduleDaily_1); |
| 402 | }); | 402 | }); |
| 403 | $.get('/realSchedule/queryUserInfo',{line:line,date:date,state:2,type:"query"},function(result){ | 403 | $.get('/realSchedule/queryUserInfo',{line:line,date:date,state:2,type:"query"},function(result){ |
| 404 | - console.log(result); | ||
| 405 | var scheduleDaily_2 = template('scheduleDaily_2',{list:result}); | 404 | var scheduleDaily_2 = template('scheduleDaily_2',{list:result}); |
| 406 | $('#forms .scheduleDaily_2').html(scheduleDaily_2); | 405 | $('#forms .scheduleDaily_2').html(scheduleDaily_2); |
| 407 | }); | 406 | }); |
| @@ -541,9 +540,18 @@ | @@ -541,9 +540,18 @@ | ||
| 541 | <td>{{obj.fast}}</td> | 540 | <td>{{obj.fast}}</td> |
| 542 | <td>{{obj.slow}}</td> | 541 | <td>{{obj.slow}}</td> |
| 543 | <td>{{obj.fcsj}}</td> | 542 | <td>{{obj.fcsj}}</td> |
| 544 | - <td>{{obj.fcsjActual}}</td> | 543 | + <td>{{obj.fcsjActual}} |
| 544 | + {{if obj.bcType== "in"}} | ||
| 545 | + (进) | ||
| 546 | + {{/if}} | ||
| 547 | + {{if obj.bcType== "out"}} | ||
| 548 | + (出) | ||
| 549 | + {{/if}} | ||
| 550 | + </td> | ||
| 545 | <td>{{obj.fast0}}</td> | 551 | <td>{{obj.fast0}}</td> |
| 546 | - <td>{{obj.slow0}}</td> | 552 | + <td>{{obj.slow0}} |
| 553 | + | ||
| 554 | + </td> | ||
| 547 | <td colspan="2">{{obj.remarks}}</td> | 555 | <td colspan="2">{{obj.remarks}}</td> |
| 548 | {{if (i+1)%3 == 0}} | 556 | {{if (i+1)%3 == 0}} |
| 549 | <td> </td> | 557 | <td> </td> |
src/main/resources/static/pages/forms/statement/statisticsDaily.html
| @@ -247,8 +247,15 @@ | @@ -247,8 +247,15 @@ | ||
| 247 | if(date==null || date =="" ||date2==null || date2 ==""){ | 247 | if(date==null || date =="" ||date2==null || date2 ==""){ |
| 248 | layer.msg('请选择时间段.'); | 248 | layer.msg('请选择时间段.'); |
| 249 | }else{ | 249 | }else{ |
| 250 | - | ||
| 251 | - $get('/realSchedule/statisticsDailyTj',{gsdm:gsdm,fgsdm:fgsdm,line:line,date:date,date2:date2,xlName:xlName,type:"query"},function(result){ | 250 | + var params = {}; |
| 251 | + params['gsdm'] = gsdm; | ||
| 252 | + params['fgsdm'] =fgsdm ; | ||
| 253 | + params['line'] = line; | ||
| 254 | + params['date'] = date; | ||
| 255 | + params['date2'] = date2; | ||
| 256 | + params['xlName'] = xlName; | ||
| 257 | + params['type'] = "query"; | ||
| 258 | + $get('/realSchedule/statisticsDailyTj',params,function(result){ | ||
| 252 | // 把数据填充到模版中 | 259 | // 把数据填充到模版中 |
| 253 | var tbodyHtml = template('statisticsDaily',{list:result}); | 260 | var tbodyHtml = template('statisticsDaily',{list:result}); |
| 254 | // 把渲染好的模版html文本追加到表格中 | 261 | // 把渲染好的模版html文本追加到表格中 |
| @@ -264,7 +271,15 @@ | @@ -264,7 +271,15 @@ | ||
| 264 | }); | 271 | }); |
| 265 | 272 | ||
| 266 | $("#export").on("click",function(){ | 273 | $("#export").on("click",function(){ |
| 267 | - $get('/realSchedule/statisticsDailyTj',{gsdm:gsdm,fgsdm:fgsdm,line:line,date:date,date2:date2,xlName:xlName,type:"export"},function(result){ | 274 | + var params = {}; |
| 275 | + params['gsdm'] = gsdm; | ||
| 276 | + params['fgsdm'] =fgsdm ; | ||
| 277 | + params['line'] = line; | ||
| 278 | + params['date'] = date; | ||
| 279 | + params['date2'] = date2; | ||
| 280 | + params['xlName'] = xlName; | ||
| 281 | + params['type'] = "export"; | ||
| 282 | + $get('/realSchedule/statisticsDailyTj',params,function(result){ | ||
| 268 | window.open("/downloadFile/download?fileName=统计日报"+moment(date).format("YYYYMMDD")); | 283 | window.open("/downloadFile/download?fileName=统计日报"+moment(date).format("YYYYMMDD")); |
| 269 | }); | 284 | }); |
| 270 | }); | 285 | }); |
src/main/resources/static/pages/forms/statement/waybill.html
| @@ -307,7 +307,7 @@ | @@ -307,7 +307,7 @@ | ||
| 307 | param[index][i] = $(this).text().split("\\")[0]; | 307 | param[index][i] = $(this).text().split("\\")[0]; |
| 308 | }); | 308 | }); |
| 309 | }); | 309 | }); |
| 310 | - $post('/realSchedule/exportWaybillMore',{date:date,line:line,strs:JSON.stringify(param)},function(result){ | 310 | + $get('/realSchedule/exportWaybillMore',{date:date,line:line,strs:JSON.stringify(param)},function(result){ |
| 311 | window.open("/downloadFile/downloadList?fileName="+result.fileName); | 311 | window.open("/downloadFile/downloadList?fileName="+result.fileName); |
| 312 | }); | 312 | }); |
| 313 | }); | 313 | }); |
| @@ -435,7 +435,7 @@ | @@ -435,7 +435,7 @@ | ||
| 435 | <td>{{obj.fast}}</td> | 435 | <td>{{obj.fast}}</td> |
| 436 | <td>{{obj.slow}}</td> | 436 | <td>{{obj.slow}}</td> |
| 437 | <td> | 437 | <td> |
| 438 | - {{if obj.fcsjActual !=null || obj.zdsjActual!=null}} | 438 | + {{if obj.zdsjActual!=null}} |
| 439 | {{obj.jhlc}} | 439 | {{obj.jhlc}} |
| 440 | {{/if}} | 440 | {{/if}} |
| 441 | </td> | 441 | </td> |
src/main/resources/static/pages/scheduleApp/module/common/dts2/ttinfotable/saTimeTable.js
| @@ -97,8 +97,8 @@ angular.module('ScheduleApp').factory( | @@ -97,8 +97,8 @@ angular.module('ScheduleApp').factory( | ||
| 97 | } | 97 | } |
| 98 | } | 98 | } |
| 99 | } else { | 99 | } else { |
| 100 | - this.isValidInfo = true; | ||
| 101 | - return true; | 100 | + this.isValidInfo = false; |
| 101 | + return false; | ||
| 102 | } | 102 | } |
| 103 | }; | 103 | }; |
| 104 | 104 |
src/main/resources/static/pages/scheduleApp/module/common/dts2/ttinfotable/saTimeTableTemplate.html
| @@ -324,7 +324,7 @@ | @@ -324,7 +324,7 @@ | ||
| 324 | ng-dblclick="$saTimeTableCtrl.$$cell_dbclick(rowIndex, colIndex, cell)" | 324 | ng-dblclick="$saTimeTableCtrl.$$cell_dbclick(rowIndex, colIndex, cell)" |
| 325 | ng-class="{ | 325 | ng-class="{ |
| 326 | lpName: !cell.ttdid, | 326 | lpName: !cell.ttdid, |
| 327 | - error: cell.invalidFlag, | 327 | + error: cell.isValidInfo, |
| 328 | active: cell.sel, | 328 | active: cell.sel, |
| 329 | region: cell.bc_type == 'region', | 329 | region: cell.bc_type == 'region', |
| 330 | isfb: cell.isfb | 330 | isfb: cell.isfb |
src/main/resources/static/pages/scheduleApp/module/common/prj-common-directive.js
| @@ -3795,8 +3795,8 @@ angular.module('ScheduleApp').factory( | @@ -3795,8 +3795,8 @@ angular.module('ScheduleApp').factory( | ||
| 3795 | } | 3795 | } |
| 3796 | } | 3796 | } |
| 3797 | } else { | 3797 | } else { |
| 3798 | - this.isValidInfo = true; | ||
| 3799 | - return true; | 3798 | + this.isValidInfo = false; |
| 3799 | + return false; | ||
| 3800 | } | 3800 | } |
| 3801 | }; | 3801 | }; |
| 3802 | 3802 |
src/main/resources/static/pages/scheduleApp/module/core/schedulePlanManage/info/list_info.html
| @@ -14,8 +14,9 @@ | @@ -14,8 +14,9 @@ | ||
| 14 | <th style="width: 80px;">班次类型</th> | 14 | <th style="width: 80px;">班次类型</th> |
| 15 | <th style="width: 80px;">上下行</th> | 15 | <th style="width: 80px;">上下行</th> |
| 16 | <th style="width: 80px;">发车时间</th> | 16 | <th style="width: 80px;">发车时间</th> |
| 17 | - <th style="width: 100px;">起点站</th> | ||
| 18 | - <th style="width: 100px;">终点站</th> | 17 | + <th style="width: 80px;">起点站</th> |
| 18 | + <th style="width: 80px;">终点站</th> | ||
| 19 | + <th style="width: 60px">备注</th> | ||
| 19 | <th style="width: 100%">时刻表</th> | 20 | <th style="width: 100%">时刻表</th> |
| 20 | <th style="width: 90px;">修改人</th> | 21 | <th style="width: 90px;">修改人</th> |
| 21 | <th style="width: 90px;">修改时间</th> | 22 | <th style="width: 90px;">修改时间</th> |
| @@ -110,6 +111,15 @@ | @@ -110,6 +111,15 @@ | ||
| 110 | <a href="#" | 111 | <a href="#" |
| 111 | tooltip-animation="false" | 112 | tooltip-animation="false" |
| 112 | tooltip-placement="top" | 113 | tooltip-placement="top" |
| 114 | + uib-tooltip="{{info.remark}}" | ||
| 115 | + tooltip-class="headClass"> | ||
| 116 | + {{info.remark}} | ||
| 117 | + </a> | ||
| 118 | + </td> | ||
| 119 | + <td> | ||
| 120 | + <a href="#" | ||
| 121 | + tooltip-animation="false" | ||
| 122 | + tooltip-placement="top" | ||
| 113 | uib-tooltip="{{info.ttInfoName}}" | 123 | uib-tooltip="{{info.ttInfoName}}" |
| 114 | tooltip-class="headClass"> | 124 | tooltip-class="headClass"> |
| 115 | {{info.ttInfoName}} | 125 | {{info.ttInfoName}} |
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage/detailedit/edit-detail2.html
| @@ -31,76 +31,160 @@ | @@ -31,76 +31,160 @@ | ||
| 31 | <div class="portlet-title"> | 31 | <div class="portlet-title"> |
| 32 | <div class="caption"> | 32 | <div class="caption"> |
| 33 | <i class="icon-equalizer font-red-sunglo"></i> <span | 33 | <i class="icon-equalizer font-red-sunglo"></i> <span |
| 34 | - class="caption-subject font-red-sunglo bold uppercase" >批量信息修改</span> | 34 | + class="caption-subject font-red-sunglo bold uppercase" ng-bind="ctrl.title1"></span> |
| 35 | </div> | 35 | </div> |
| 36 | </div> | 36 | </div> |
| 37 | 37 | ||
| 38 | <div class="portlet-body form"> | 38 | <div class="portlet-body form"> |
| 39 | <form ng-submit="ctrl.submit()" class="form-horizontal" novalidate name="myForm"> | 39 | <form ng-submit="ctrl.submit()" class="form-horizontal" novalidate name="myForm"> |
| 40 | <div class="form-body"> | 40 | <div class="form-body"> |
| 41 | - | ||
| 42 | - <div class="form-group"> | ||
| 43 | - <label class="col-md-3 control-label">方向:</label> | ||
| 44 | - <div class="col-md-5"> | ||
| 45 | - <sa-Radiogroup model="ctrl.tt.xlDir" dicgroup="LineTrend" name="xlDir"></sa-Radiogroup> | 41 | + <div class="form-group has-success has-feedback"> |
| 42 | + <label class="col-md-2 control-label">线路*:</label> | ||
| 43 | + <div class="col-md-3"> | ||
| 44 | + <input type="text" class="form-control" | ||
| 45 | + ng-value="ctrl.xlname" | ||
| 46 | + readonly/> | ||
| 46 | </div> | 47 | </div> |
| 47 | 48 | ||
| 48 | </div> | 49 | </div> |
| 49 | - <div class="form-group"> | ||
| 50 | - <label class="col-md-3 control-label">起点站:</label> | ||
| 51 | - <div class="col-md-5"> | ||
| 52 | - <sa-Select5 name="qdz" | ||
| 53 | - model="ctrl.tt" | ||
| 54 | - cmaps="{'qdz.id' : 'stationid'}" | ||
| 55 | - dcname="qdz.id" | ||
| 56 | - icname="stationid" | ||
| 57 | - dsparams="{{ {type: 'ajax', param:{'xlid': ctrl.xlid, 'xldir': ctrl.tt.xlDir}, atype:'zd' } | json }}" | ||
| 58 | - iterobjname="item" | ||
| 59 | - iterobjexp="item.stationname" | ||
| 60 | - searchph="请输拼音..." | ||
| 61 | - searchexp="this.stationname" | ||
| 62 | - > | ||
| 63 | - </sa-Select5> | 50 | + <div class="form-group has-success has-feedback"> |
| 51 | + <label class="col-md-2 control-label">时刻表名称*:</label> | ||
| 52 | + <div class="col-md-3"> | ||
| 53 | + <input type="text" class="form-control" | ||
| 54 | + ng-value="ctrl.ttname" | ||
| 55 | + readonly/> | ||
| 64 | </div> | 56 | </div> |
| 65 | </div> | 57 | </div> |
| 66 | - <div class="form-group"> | ||
| 67 | - <label class="col-md-3 control-label">终点站:</label> | ||
| 68 | - <div class="col-md-5"> | ||
| 69 | - <sa-Select5 name="zdz" | ||
| 70 | - model="ctrl.tt" | ||
| 71 | - cmaps="{'zdz.id' : 'stationid'}" | ||
| 72 | - dcname="zdz.id" | ||
| 73 | - icname="stationid" | ||
| 74 | - dsparams="{{ {type: 'ajax', param:{'xlid': ctrl.xlid, 'xldir': ctrl.tt.xlDir}, atype:'zd' } | json }}" | ||
| 75 | - iterobjname="item" | ||
| 76 | - iterobjexp="item.stationname" | ||
| 77 | - searchph="请输拼音..." | ||
| 78 | - searchexp="this.stationname" | ||
| 79 | - > | ||
| 80 | - </sa-Select5> | 58 | + |
| 59 | + <div class="form-group" ng-if="ctrl.isZdModify == true"> | ||
| 60 | + <label class="col-md-2 control-label">方向:</label> | ||
| 61 | + <div class="col-md-3"> | ||
| 62 | + <sa-Radiogroup model="ctrl.tt.xlDir" dicgroup="LineTrend" name="xlDir"></sa-Radiogroup> | ||
| 81 | </div> | 63 | </div> |
| 64 | + | ||
| 82 | </div> | 65 | </div> |
| 83 | - <div class="form-group"> | ||
| 84 | - <label class="col-md-3 control-label">停车场:</label> | ||
| 85 | - <div class="col-md-5"> | ||
| 86 | - <sa-Select5 name="tcc" | ||
| 87 | - model="ctrl.tt" | ||
| 88 | - cmaps="{'tcc.id': 'id'}" | ||
| 89 | - dcname="tcc.id" | ||
| 90 | - icname="id" | ||
| 91 | - dsparams="{{ {type: 'ajax', param:{type: 'all'}, atype:'tcc' } | json }}" | ||
| 92 | - iterobjname="item" | ||
| 93 | - iterobjexp="item.parkName" | ||
| 94 | - searchph="请输拼音..." | ||
| 95 | - searchexp="this.parkName" | ||
| 96 | - > | ||
| 97 | - </sa-Select5> | 66 | + |
| 67 | + <div ng-if="ctrl.isZdModify == true"> | ||
| 68 | + | ||
| 69 | + <!--- 出场班次判定 --> | ||
| 70 | + <div class="form-group" | ||
| 71 | + ng-if="ctrl.tt.bcType == 'out'"> | ||
| 72 | + <label class="col-md-2 control-label">停车场:</label> | ||
| 73 | + <div class="col-md-3"> | ||
| 74 | + <sa-Select5 name="tcc" | ||
| 75 | + model="ctrl.tt" | ||
| 76 | + cmaps="{'tcc.id': 'id'}" | ||
| 77 | + dcname="tcc.id" | ||
| 78 | + icname="id" | ||
| 79 | + dsparams="{{ {type: 'ajax', param:{type: 'all'}, atype:'tcc' } | json }}" | ||
| 80 | + iterobjname="item" | ||
| 81 | + iterobjexp="item.parkName" | ||
| 82 | + searchph="请输拼音..." | ||
| 83 | + searchexp="this.parkName" | ||
| 84 | + > | ||
| 85 | + </sa-Select5> | ||
| 86 | + </div> | ||
| 87 | + </div> | ||
| 88 | + <div class="form-group" | ||
| 89 | + ng-if="ctrl.tt.bcType == 'out'"> | ||
| 90 | + <label class="col-md-2 control-label">终点站:</label> | ||
| 91 | + <div class="col-md-3"> | ||
| 92 | + <sa-Select5 name="zdz" | ||
| 93 | + model="ctrl.tt" | ||
| 94 | + cmaps="{'zdz.id' : 'stationid'}" | ||
| 95 | + dcname="zdz.id" | ||
| 96 | + icname="stationid" | ||
| 97 | + dsparams="{{ {type: 'ajax', param:{'xlid': ctrl.xlid, 'xldir': ctrl.tt.xlDir}, atype:'zd' } | json }}" | ||
| 98 | + iterobjname="item" | ||
| 99 | + iterobjexp="item.stationname" | ||
| 100 | + searchph="请输拼音..." | ||
| 101 | + searchexp="this.stationname" | ||
| 102 | + > | ||
| 103 | + </sa-Select5> | ||
| 104 | + </div> | ||
| 105 | + </div> | ||
| 106 | + | ||
| 107 | + <!--- 进场班次判定 --> | ||
| 108 | + <div class="form-group" | ||
| 109 | + ng-if="ctrl.tt.bcType == 'in'"> | ||
| 110 | + <label class="col-md-2 control-label">起点站:</label> | ||
| 111 | + <div class="col-md-3"> | ||
| 112 | + <sa-Select5 name="qdz" | ||
| 113 | + model="ctrl.tt" | ||
| 114 | + cmaps="{'qdz.id' : 'stationid'}" | ||
| 115 | + dcname="qdz.id" | ||
| 116 | + icname="stationid" | ||
| 117 | + dsparams="{{ {type: 'ajax', param:{'xlid': ctrl.xlid, 'xldir': ctrl.tt.xlDir}, atype:'zd' } | json }}" | ||
| 118 | + iterobjname="item" | ||
| 119 | + iterobjexp="item.stationname" | ||
| 120 | + searchph="请输拼音..." | ||
| 121 | + searchexp="this.stationname" | ||
| 122 | + > | ||
| 123 | + </sa-Select5> | ||
| 124 | + </div> | ||
| 125 | + </div> | ||
| 126 | + <div class="form-group" | ||
| 127 | + ng-if="ctrl.tt.bcType == 'in'"> | ||
| 128 | + <label class="col-md-2 control-label">停车场:</label> | ||
| 129 | + <div class="col-md-3"> | ||
| 130 | + <sa-Select5 name="tcc" | ||
| 131 | + model="ctrl.tt" | ||
| 132 | + cmaps="{'tcc.id': 'id'}" | ||
| 133 | + dcname="tcc.id" | ||
| 134 | + icname="id" | ||
| 135 | + dsparams="{{ {type: 'ajax', param:{type: 'all'}, atype:'tcc' } | json }}" | ||
| 136 | + iterobjname="item" | ||
| 137 | + iterobjexp="item.parkName" | ||
| 138 | + searchph="请输拼音..." | ||
| 139 | + searchexp="this.parkName" | ||
| 140 | + > | ||
| 141 | + </sa-Select5> | ||
| 142 | + </div> | ||
| 143 | + </div> | ||
| 144 | + | ||
| 145 | + <!-- 其他班次类型 --> | ||
| 146 | + <div class="form-group" | ||
| 147 | + ng-if="ctrl.tt.bcType != 'in' && ctrl.tt.bcType != 'out'"> | ||
| 148 | + <label class="col-md-2 control-label">起点站:</label> | ||
| 149 | + <div class="col-md-3"> | ||
| 150 | + <sa-Select5 name="qdz" | ||
| 151 | + model="ctrl.tt" | ||
| 152 | + cmaps="{'qdz.id' : 'stationid'}" | ||
| 153 | + dcname="qdz.id" | ||
| 154 | + icname="stationid" | ||
| 155 | + dsparams="{{ {type: 'ajax', param:{'xlid': ctrl.xlid, 'xldir': ctrl.tt.xlDir}, atype:'zd' } | json }}" | ||
| 156 | + iterobjname="item" | ||
| 157 | + iterobjexp="item.stationname" | ||
| 158 | + searchph="请输拼音..." | ||
| 159 | + searchexp="this.stationname" | ||
| 160 | + > | ||
| 161 | + </sa-Select5> | ||
| 162 | + </div> | ||
| 163 | + </div> | ||
| 164 | + <div class="form-group" | ||
| 165 | + ng-if="ctrl.tt.bcType != 'in' && ctrl.tt.bcType != 'out'"> | ||
| 166 | + <label class="col-md-2 control-label">终点站:</label> | ||
| 167 | + <div class="col-md-3"> | ||
| 168 | + <sa-Select5 name="zdz" | ||
| 169 | + model="ctrl.tt" | ||
| 170 | + cmaps="{'zdz.id' : 'stationid'}" | ||
| 171 | + dcname="zdz.id" | ||
| 172 | + icname="stationid" | ||
| 173 | + dsparams="{{ {type: 'ajax', param:{'xlid': ctrl.xlid, 'xldir': ctrl.tt.xlDir}, atype:'zd' } | json }}" | ||
| 174 | + iterobjname="item" | ||
| 175 | + iterobjexp="item.stationname" | ||
| 176 | + searchph="请输拼音..." | ||
| 177 | + searchexp="this.stationname" | ||
| 178 | + > | ||
| 179 | + </sa-Select5> | ||
| 180 | + </div> | ||
| 98 | </div> | 181 | </div> |
| 182 | + | ||
| 99 | </div> | 183 | </div> |
| 100 | 184 | ||
| 101 | <div class="form-group"> | 185 | <div class="form-group"> |
| 102 | - <label class="col-md-3 control-label">发车时间:</label> | ||
| 103 | - <div class="col-md-5"> | 186 | + <label class="col-md-2 control-label">发车时间:</label> |
| 187 | + <div class="col-md-3"> | ||
| 104 | <input type="text" class="form-control" name="fcsj" | 188 | <input type="text" class="form-control" name="fcsj" |
| 105 | ng-model="ctrl.tt.fcsj" | 189 | ng-model="ctrl.tt.fcsj" |
| 106 | ng-pattern="ctrl.time_regex" | 190 | ng-pattern="ctrl.time_regex" |
| @@ -113,8 +197,8 @@ | @@ -113,8 +197,8 @@ | ||
| 113 | 197 | ||
| 114 | </div> | 198 | </div> |
| 115 | <div class="form-group"> | 199 | <div class="form-group"> |
| 116 | - <label class="col-md-3 control-label">计划里程:</label> | ||
| 117 | - <div class="col-md-5"> | 200 | + <label class="col-md-2 control-label">计划里程:</label> |
| 201 | + <div class="col-md-3"> | ||
| 118 | <input type="text" class="form-control" name="jhlc" | 202 | <input type="text" class="form-control" name="jhlc" |
| 119 | ng-model="ctrl.tt.jhlc" | 203 | ng-model="ctrl.tt.jhlc" |
| 120 | ng-pattern="ctrl.float_regex" | 204 | ng-pattern="ctrl.float_regex" |
| @@ -127,8 +211,8 @@ | @@ -127,8 +211,8 @@ | ||
| 127 | 211 | ||
| 128 | </div> | 212 | </div> |
| 129 | <div class="form-group"> | 213 | <div class="form-group"> |
| 130 | - <label class="col-md-3 control-label">班次历时:</label> | ||
| 131 | - <div class="col-md-5"> | 214 | + <label class="col-md-2 control-label">班次历时:</label> |
| 215 | + <div class="col-md-3"> | ||
| 132 | <input type="text" class="form-control" name="bcsj" | 216 | <input type="text" class="form-control" name="bcsj" |
| 133 | ng-model="ctrl.tt.bcsj" | 217 | ng-model="ctrl.tt.bcsj" |
| 134 | ng-pattern="ctrl.number_regex" | 218 | ng-pattern="ctrl.number_regex" |
| @@ -140,9 +224,10 @@ | @@ -140,9 +224,10 @@ | ||
| 140 | </div> | 224 | </div> |
| 141 | 225 | ||
| 142 | </div> | 226 | </div> |
| 143 | - <div class="form-group"> | ||
| 144 | - <label class="col-md-3 control-label">班次类型:</label> | ||
| 145 | - <div class="col-md-5"> | 227 | + <div class="form-group" |
| 228 | + ng-if="ctrl.isZdModify == true"> | ||
| 229 | + <label class="col-md-2 control-label">班次类型:</label> | ||
| 230 | + <div class="col-md-3"> | ||
| 146 | <sa-Select5 name="bcType" | 231 | <sa-Select5 name="bcType" |
| 147 | model="ctrl.tt" | 232 | model="ctrl.tt" |
| 148 | cmaps="{'bcType': 'code'}" | 233 | cmaps="{'bcType': 'code'}" |
| @@ -159,6 +244,14 @@ | @@ -159,6 +244,14 @@ | ||
| 159 | 244 | ||
| 160 | </div> | 245 | </div> |
| 161 | 246 | ||
| 247 | + <div class="form-group has-success has-feedback"> | ||
| 248 | + <label class="col-md-2 control-label">开始分班:</label> | ||
| 249 | + <div class="col-md-3"> | ||
| 250 | + <sa-Radiogroup model="ctrl.tt.isFB" dicgroup="truefalseType" name="isFB"></sa-Radiogroup> | ||
| 251 | + </div> | ||
| 252 | + | ||
| 253 | + </div> | ||
| 254 | + | ||
| 162 | </div> | 255 | </div> |
| 163 | 256 | ||
| 164 | <div class="form-actions"> | 257 | <div class="form-actions"> |
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage/detailedit/timeTableDetailManage_old.js
| @@ -184,6 +184,7 @@ angular.module('ScheduleApp').factory( | @@ -184,6 +184,7 @@ angular.module('ScheduleApp').factory( | ||
| 184 | ttinfodetailIds[index].qdz = value.qdz || undefined; | 184 | ttinfodetailIds[index].qdz = value.qdz || undefined; |
| 185 | ttinfodetailIds[index].zdz = value.zdz || undefined; | 185 | ttinfodetailIds[index].zdz = value.zdz || undefined; |
| 186 | ttinfodetailIds[index].tcc = value.tcc || undefined; | 186 | ttinfodetailIds[index].tcc = value.tcc || undefined; |
| 187 | + ttinfodetailIds[index].isfb = value.isFB || undefined; | ||
| 187 | 188 | ||
| 188 | ttinfodetailIds[index].validInfo(); | 189 | ttinfodetailIds[index].validInfo(); |
| 189 | 190 | ||
| @@ -585,10 +586,16 @@ angular.module('ScheduleApp').controller( | @@ -585,10 +586,16 @@ angular.module('ScheduleApp').controller( | ||
| 585 | '$stateParams', | 586 | '$stateParams', |
| 586 | '$state', | 587 | '$state', |
| 587 | function(service, $stateParams, $state) { | 588 | function(service, $stateParams, $state) { |
| 588 | - // TODO: | ||
| 589 | - | ||
| 590 | var self = this; | 589 | var self = this; |
| 591 | - var TTInfoDetail = service.getQueryClass(); | 590 | + // 获取传过来的id,有的话就是修改,获取一遍数据 |
| 591 | + self.xlid = $stateParams.xlid; // 获取传过来的线路id | ||
| 592 | + self.ttid = $stateParams.ttid; // 获取传过来的时刻表id | ||
| 593 | + self.xlname = $stateParams.xlname; // 获取传过来的线路名字 | ||
| 594 | + self.ttname = $stateParams.ttname; // 获取传过来的时刻表名字 | ||
| 595 | + | ||
| 596 | + self.title1 = self.xlname + "(" + self.ttname + ")" + "时刻表明细信息 批量修改班次信息"; | ||
| 597 | + | ||
| 598 | + //var TTInfoDetail = service.getQueryClass(); | ||
| 592 | 599 | ||
| 593 | // 时间正则表达式(格式hh:mm,如:06:39) | 600 | // 时间正则表达式(格式hh:mm,如:06:39) |
| 594 | self.time_regex = /^([01]?[0-9]|2[0-3]):[0-5][0-9]$/; | 601 | self.time_regex = /^([01]?[0-9]|2[0-3]):[0-5][0-9]$/; |
| @@ -599,11 +606,14 @@ angular.module('ScheduleApp').controller( | @@ -599,11 +606,14 @@ angular.module('ScheduleApp').controller( | ||
| 599 | 606 | ||
| 600 | // 欲保存的busInfo信息,绑定 | 607 | // 欲保存的busInfo信息,绑定 |
| 601 | //self.tt = new TTInfoDetail; | 608 | //self.tt = new TTInfoDetail; |
| 609 | + | ||
| 602 | self.tt = { | 610 | self.tt = { |
| 603 | xlDir: undefined, | 611 | xlDir: undefined, |
| 604 | tcc: {id: undefined}, | 612 | tcc: {id: undefined}, |
| 605 | qdz: {id: undefined}, | 613 | qdz: {id: undefined}, |
| 606 | zdz: {id: undefined}, | 614 | zdz: {id: undefined}, |
| 615 | + bcType: undefined, | ||
| 616 | + isFB: undefined, | ||
| 607 | reSetTTinfoDetail: function(value) { | 617 | reSetTTinfoDetail: function(value) { |
| 608 | for (var key in this) { | 618 | for (var key in this) { |
| 609 | if (!angular.isFunction(this[key])) { | 619 | if (!angular.isFunction(this[key])) { |
| @@ -611,7 +621,7 @@ angular.module('ScheduleApp').controller( | @@ -611,7 +621,7 @@ angular.module('ScheduleApp').controller( | ||
| 611 | if (this[key].id) { | 621 | if (this[key].id) { |
| 612 | value[key] = this[key]; | 622 | value[key] = this[key]; |
| 613 | } | 623 | } |
| 614 | - } else if (this[key]) { | 624 | + } else if (this[key] != undefined) { |
| 615 | value[key] = this[key]; | 625 | value[key] = this[key]; |
| 616 | } | 626 | } |
| 617 | } | 627 | } |
| @@ -619,13 +629,32 @@ angular.module('ScheduleApp').controller( | @@ -619,13 +629,32 @@ angular.module('ScheduleApp').controller( | ||
| 619 | } | 629 | } |
| 620 | }; | 630 | }; |
| 621 | 631 | ||
| 622 | - // 获取传过来的id,有的话就是修改,获取一遍数据 | ||
| 623 | - self.xlid = $stateParams.xlid; // 获取传过来的线路id | ||
| 624 | - self.ttid = $stateParams.ttid; // 获取传过来的时刻表id | ||
| 625 | - self.xlname = $stateParams.xlname; // 获取传过来的线路名字 | ||
| 626 | - self.ttname = $stateParams.ttname; // 获取传过来的时刻表名字 | 632 | + // 修正self.tt |
| 627 | 633 | ||
| 628 | - self.title1 = self.xlname + "(" + self.ttname + ")" + "时刻表明细信息"; | 634 | + self.isZdModify = false; // 是否可以修改站点(如果不是同一圈的数据是不能修改站点的) |
| 635 | + var colIndexs_maps = {}; | ||
| 636 | + var detailInfos = service.getEditInfo().detailInfos; | ||
| 637 | + for (var i = 0; i < detailInfos.length; i++) { | ||
| 638 | + for (var j = 0; j < detailInfos[i].length; j++) { | ||
| 639 | + if (detailInfos[i][j].canDelete()) { | ||
| 640 | + colIndexs_maps[j] = j; | ||
| 641 | + } | ||
| 642 | + } | ||
| 643 | + } | ||
| 644 | + var colIndexs = []; | ||
| 645 | + for (var kk in colIndexs_maps) { | ||
| 646 | + colIndexs.push(kk); | ||
| 647 | + } | ||
| 648 | + if (colIndexs.length == 1) { | ||
| 649 | + self.isZdModify = true; | ||
| 650 | + var columnBcInfo = service.getEditInfo().columnBcInfo[colIndexs[0]]; | ||
| 651 | + | ||
| 652 | + self.tt.xlDir = columnBcInfo.xldir; | ||
| 653 | + self.tt.bcType = columnBcInfo.bc_type; | ||
| 654 | + self.tt.qdz.id = columnBcInfo.qdz; | ||
| 655 | + self.tt.zdz.id = columnBcInfo.zdz; | ||
| 656 | + self.tt.tcc.id = columnBcInfo.tcc; | ||
| 657 | + } | ||
| 629 | 658 | ||
| 630 | // 提交方法 | 659 | // 提交方法 |
| 631 | self.submit = function() { | 660 | self.submit = function() { |
| @@ -646,6 +675,8 @@ angular.module('ScheduleApp').controller( | @@ -646,6 +675,8 @@ angular.module('ScheduleApp').controller( | ||
| 646 | // }); | 675 | // }); |
| 647 | //}); | 676 | //}); |
| 648 | 677 | ||
| 678 | + console.log(self.tt); | ||
| 679 | + | ||
| 649 | service.editInfos(self.tt).then(function() { | 680 | service.editInfos(self.tt).then(function() { |
| 650 | $state.go("ttInfoDetailManage_edit3", { | 681 | $state.go("ttInfoDetailManage_edit3", { |
| 651 | xlid: self.xlid, | 682 | xlid: self.xlid, |
src/main/resources/static/real_control_v2/assets/imgs/icon/pause.png
0 → 100644
2.29 KB
src/main/resources/static/real_control_v2/assets/imgs/icon/play.png
0 → 100644
2.36 KB
src/main/resources/static/real_control_v2/assets/plugins/uikit-2.27.1/components/lightbox.min.js
0 → 100644
| 1 | +/*! UIkit 2.27.1 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ | ||
| 2 | +!function(i){var t;window.UIkit&&(t=i(UIkit)),"function"==typeof define&&define.amd&&define("uikit-lightbox",["uikit"],function(){return t||i(UIkit)})}(function(i){"use strict";function t(t){if(e)return e.lightbox=t,e;e=i.$(['<div class="uk-modal">','<div class="uk-modal-dialog uk-modal-dialog-lightbox uk-slidenav-position" style="margin-left:auto;margin-right:auto;width:200px;height:200px;top:'+Math.abs(window.innerHeight/2-200)+'px;">','<a href="#" class="uk-modal-close uk-close uk-close-alt"></a>','<div class="uk-lightbox-content"></div>','<div class="uk-modal-spinner uk-hidden"></div>',"</div>","</div>"].join("")).appendTo("body"),e.dialog=e.find(".uk-modal-dialog:first"),e.content=e.find(".uk-lightbox-content:first"),e.loader=e.find(".uk-modal-spinner:first"),e.closer=e.find(".uk-close.uk-close-alt"),e.modal=i.modal(e,{modal:!1}),e.on("swipeRight swipeLeft",function(i){e.lightbox["swipeLeft"==i.type?"next":"previous"]()}).on("click","[data-lightbox-previous], [data-lightbox-next]",function(t){t.preventDefault(),e.lightbox[i.$(this).is("[data-lightbox-next]")?"next":"previous"]()}),e.on("hide.uk.modal",function(){e.content.html("")});var o={w:window.innerWidth,h:window.innerHeight};return i.$win.on("load resize orientationchange",i.Utils.debounce(function(){o.w!==window.innerWidth&&e.is(":visible")&&!i.Utils.isFullscreen()&&e.lightbox.fitSize(),o={w:window.innerWidth,h:window.innerHeight}},100)),e.lightbox=t,e}var e,o={};return i.component("lightbox",{defaults:{allowfullscreen:!0,duration:400,group:!1,keyboard:!0},index:0,items:!1,boot:function(){i.$html.on("click","[data-uk-lightbox]",function(t){t.preventDefault();var e=i.$(this);e.data("lightbox")||i.lightbox(e,i.Utils.options(e.attr("data-uk-lightbox"))),e.data("lightbox").show(e)}),i.$doc.on("keyup",function(i){if(e&&e.is(":visible")&&e.lightbox.options.keyboard)switch(i.preventDefault(),i.keyCode){case 37:e.lightbox.previous();break;case 39:e.lightbox.next()}})},init:function(){var t=[];if(this.index=0,this.siblings=[],this.element&&this.element.length){var e=this.options.group?i.$(['[data-uk-lightbox*="'+this.options.group+'"]',"[data-uk-lightbox*='"+this.options.group+"']"].join(",")):this.element;e.each(function(){var e=i.$(this);t.push({source:e.attr("href"),title:e.attr("data-title")||e.attr("title"),type:e.attr("data-lightbox-type")||"auto",link:e})}),this.index=e.index(this.element),this.siblings=t}else this.options.group&&this.options.group.length&&(this.siblings=this.options.group);this.trigger("lightbox-init",[this])},show:function(e){this.modal=t(this),this.modal.dialog.stop(),this.modal.content.stop();var o,n,s=this,h=i.$.Deferred();e=e||0,"object"==typeof e&&this.siblings.forEach(function(i,t){e[0]===i.link[0]&&(e=t)}),0>e?e=this.siblings.length-e:this.siblings[e]||(e=0),n=this.siblings[e],o={lightbox:s,source:n.source,type:n.type,index:e,promise:h,title:n.title,item:n,meta:{content:"",width:null,height:null}},this.index=e,this.modal.content.empty(),this.modal.is(":visible")||(this.modal.content.css({width:"",height:""}).empty(),this.modal.modal.show()),this.modal.loader.removeClass("uk-hidden"),h.promise().done(function(){s.data=o,s.fitSize(o)}).fail(function(){o.meta.content='<div class="uk-position-cover uk-flex uk-flex-middle uk-flex-center"><strong>Loading resource failed!</strong></div>',o.meta.width=400,o.meta.height=300,s.data=o,s.fitSize(o)}),s.trigger("showitem.uk.lightbox",[o])},fitSize:function(){var t=this,e=this.data,o=this.modal.dialog.outerWidth()-this.modal.dialog.width(),n=parseInt(this.modal.dialog.css("margin-top"),10),s=parseInt(this.modal.dialog.css("margin-bottom"),10),h=n+s,a=e.meta.content,l=t.options.duration;this.siblings.length>1&&(a=[a,'<a href="#" class="uk-slidenav uk-slidenav-contrast uk-slidenav-previous uk-hidden-touch" data-lightbox-previous></a>','<a href="#" class="uk-slidenav uk-slidenav-contrast uk-slidenav-next uk-hidden-touch" data-lightbox-next></a>'].join(""));var d,r,u=i.$("<div> </div>").css({opacity:0,position:"absolute",top:0,left:0,width:"100%","max-width":t.modal.dialog.css("max-width"),padding:t.modal.dialog.css("padding"),margin:t.modal.dialog.css("margin")}),c=e.meta.width,g=e.meta.height;u.appendTo("body").width(),d=u.width(),r=window.innerHeight-h,u.remove(),this.modal.dialog.find(".uk-modal-caption").remove(),e.title&&(this.modal.dialog.append('<div class="uk-modal-caption">'+e.title+"</div>"),r-=this.modal.dialog.find(".uk-modal-caption").outerHeight()),d<e.meta.width&&(g=Math.floor(g*(d/c)),c=d),g>r&&(g=Math.floor(r),c=Math.ceil(e.meta.width*(r/e.meta.height))),this.modal.content.css("opacity",0).width(c).html(a),"iframe"==e.type&&this.modal.content.find("iframe:first").height(g);var m=g+o,p=Math.floor(window.innerHeight/2-m/2)-h;0>p&&(p=0),this.modal.closer.addClass("uk-hidden"),t.modal.data("mwidth")==c&&t.modal.data("mheight")==g&&(l=0),this.modal.dialog.animate({width:c+o,height:g+o,top:p},l,"swing",function(){t.modal.loader.addClass("uk-hidden"),t.modal.content.css({width:""}).animate({opacity:1},function(){t.modal.closer.removeClass("uk-hidden")}),t.modal.data({mwidth:c,mheight:g})})},next:function(){this.show(this.siblings[this.index+1]?this.index+1:0)},previous:function(){this.show(this.siblings[this.index-1]?this.index-1:this.siblings.length-1)}}),i.plugin("lightbox","image",{init:function(i){i.on("showitem.uk.lightbox",function(i,t){if("image"==t.type||t.source&&t.source.match(/\.(jpg|jpeg|png|gif|svg)$/i)){var e=function(i,e,o){t.meta={content:'<img class="uk-responsive-width" width="'+e+'" height="'+o+'" src ="'+i+'">',width:e,height:o},t.type="image",t.promise.resolve()};if(o[t.source])e(t.source,o[t.source].width,o[t.source].height);else{var n=new Image;n.onerror=function(){t.promise.reject("Loading image failed")},n.onload=function(){o[t.source]={width:n.width,height:n.height},e(t.source,o[t.source].width,o[t.source].height)},n.src=t.source}}})}}),i.plugin("lightbox","youtube",{init:function(i){var t=/(\/\/.*?youtube\.[a-z]+)\/watch\?v=([^&]+)&?(.*)/,n=/youtu\.be\/(.*)/;i.on("showitem.uk.lightbox",function(i,s){var h,a,l=function(i,t,o){s.meta={content:'<iframe src="//www.youtube.com/embed/'+i+'" width="'+t+'" height="'+o+'" style="max-width:100%;"'+(e.lightbox.options.allowfullscreen?" allowfullscreen":"")+"></iframe>",width:t,height:o},s.type="iframe",s.promise.resolve()};if((a=s.source.match(t))&&(h=a[2]),(a=s.source.match(n))&&(h=a[1]),h){if(o[h])l(h,o[h].width,o[h].height);else{var d=new Image,r=!1;d.onerror=function(){o[h]={width:640,height:320},l(h,o[h].width,o[h].height)},d.onload=function(){120==d.width&&90==d.height?r?(o[h]={width:640,height:320},l(h,o[h].width,o[h].height)):(r=!0,d.src="//img.youtube.com/vi/"+h+"/0.jpg"):(o[h]={width:d.width,height:d.height},l(h,d.width,d.height))},d.src="//img.youtube.com/vi/"+h+"/maxresdefault.jpg"}i.stopImmediatePropagation()}})}}),i.plugin("lightbox","vimeo",{init:function(t){var n,s=/(\/\/.*?)vimeo\.[a-z]+\/([0-9]+).*?/;t.on("showitem.uk.lightbox",function(t,h){var a,l=function(i,t,o){h.meta={content:'<iframe src="//player.vimeo.com/video/'+i+'" width="'+t+'" height="'+o+'" style="width:100%;box-sizing:border-box;"'+(e.lightbox.options.allowfullscreen?" allowfullscreen":"")+"></iframe>",width:t,height:o},h.type="iframe",h.promise.resolve()};(n=h.source.match(s))&&(a=n[2],o[a]?l(a,o[a].width,o[a].height):i.$.ajax({type:"GET",url:"//vimeo.com/api/oembed.json?url="+encodeURI(h.source),jsonp:"callback",dataType:"jsonp",success:function(i){o[a]={width:i.width,height:i.height},l(a,o[a].width,o[a].height)}}),t.stopImmediatePropagation())})}}),i.plugin("lightbox","video",{init:function(t){t.on("showitem.uk.lightbox",function(t,e){var n=function(i,t,o){e.meta={content:'<video class="uk-responsive-width" src="'+i+'" width="'+t+'" height="'+o+'" controls></video>',width:t,height:o},e.type="video",e.promise.resolve()};if("video"==e.type||e.source.match(/\.(mp4|webm|ogv)$/i))if(o[e.source])n(e.source,o[e.source].width,o[e.source].height);else var s=i.$('<video style="position:fixed;visibility:hidden;top:-10000px;"></video>').attr("src",e.source).appendTo("body"),h=setInterval(function(){s[0].videoWidth&&(clearInterval(h),o[e.source]={width:s[0].videoWidth,height:s[0].videoHeight},n(e.source,o[e.source].width,o[e.source].height),s.remove())},20)})}}),UIkit.plugin("lightbox","iframe",{init:function(i){i.on("showitem.uk.lightbox",function(t,o){var n=function(i,t,n){o.meta={content:'<iframe class="uk-responsive-width" src="'+i+'" width="'+t+'" height="'+n+'"'+(e.lightbox.options.allowfullscreen?" allowfullscreen":"")+"></iframe>",width:t,height:n},o.type="iframe",o.promise.resolve()};("iframe"===o.type||o.source.match(/\.(html|php)$/))&&n(o.source,i.options.width||800,i.options.height||600)})}}),i.lightbox.create=function(t,e){if(t){var o,n=[];return t.forEach(function(t){n.push(i.$.extend({source:"",title:"",type:"auto",link:!1},"string"==typeof t?{source:t}:t))}),o=i.lightbox(i.$.extend({},e,{group:n}))}},i.lightbox}); | ||
| 0 | \ No newline at end of file | 3 | \ No newline at end of file |
src/main/resources/static/real_control_v2/assets/plugins/uikit-2.27.1/components/slidenav.gradient.min.css
0 → 100644
| 1 | +/*! UIkit 2.27.1 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ | ||
| 2 | +.uk-slidenav{display:inline-block;box-sizing:border-box;width:60px;height:60px;line-height:60px;color:rgba(50,50,50,.4);font-size:60px;text-align:center}.uk-slidenav:focus,.uk-slidenav:hover{outline:0;text-decoration:none;color:rgba(50,50,50,.7);cursor:pointer}.uk-slidenav:active{color:rgba(50,50,50,.9)}.uk-slidenav-previous:before{content:"\f104";font-family:FontAwesome}.uk-slidenav-next:before{content:"\f105";font-family:FontAwesome}.uk-slidenav-position{position:relative}.uk-slidenav-position .uk-slidenav{display:none;position:absolute;top:50%;z-index:1;margin-top:-30px}.uk-slidenav-position:hover .uk-slidenav{display:block}.uk-slidenav-position .uk-slidenav-previous{left:20px}.uk-slidenav-position .uk-slidenav-next{right:20px}.uk-slidenav-contrast{color:rgba(255,255,255,.5)}.uk-slidenav-contrast:focus,.uk-slidenav-contrast:hover{color:rgba(255,255,255,.7)}.uk-slidenav-contrast:active{color:rgba(255,255,255,.9)} | ||
| 0 | \ No newline at end of file | 3 | \ No newline at end of file |
src/main/resources/static/real_control_v2/css/main.css
| @@ -930,18 +930,19 @@ option.oil_station_opt{ | @@ -930,18 +930,19 @@ option.oil_station_opt{ | ||
| 930 | position: absolute; | 930 | position: absolute; |
| 931 | right: 12px; | 931 | right: 12px; |
| 932 | bottom: 12px; | 932 | bottom: 12px; |
| 933 | + z-index: 99; | ||
| 933 | } | 934 | } |
| 934 | 935 | ||
| 935 | .safe_driv_pop{ | 936 | .safe_driv_pop{ |
| 936 | - height: 45px; | ||
| 937 | background: #d44b4b; | 937 | background: #d44b4b; |
| 938 | - color: #f2f2f2; | ||
| 939 | font-size: 15px; | 938 | font-size: 15px; |
| 940 | padding: 9px 10px 0; | 939 | padding: 9px 10px 0; |
| 941 | border: 1px solid #f4f0f0; | 940 | border: 1px solid #f4f0f0; |
| 942 | border-radius: 5px; | 941 | border-radius: 5px; |
| 943 | cursor: pointer; | 942 | cursor: pointer; |
| 944 | box-shadow: 0 8px 17px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); | 943 | box-shadow: 0 8px 17px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); |
| 944 | + transition: all .03s; | ||
| 945 | + color: #f2f2f2; | ||
| 945 | } | 946 | } |
| 946 | 947 | ||
| 947 | .safe_driv_pop:hover{ | 948 | .safe_driv_pop:hover{ |
| @@ -949,15 +950,33 @@ option.oil_station_opt{ | @@ -949,15 +950,33 @@ option.oil_station_opt{ | ||
| 949 | } | 950 | } |
| 950 | 951 | ||
| 951 | .safe_driv_pop .title{ | 952 | .safe_driv_pop .title{ |
| 952 | - font-weight: 600; | ||
| 953 | } | 953 | } |
| 954 | 954 | ||
| 955 | -.safe_driv_pop i.uk-icon-times-circle{ | 955 | +/*.safe_driv_pop i.uk-icon-times-circle{ |
| 956 | margin-right: 5px; | 956 | margin-right: 5px; |
| 957 | -} | 957 | +}*/ |
| 958 | .safe_driv_pop .desc{ | 958 | .safe_driv_pop .desc{ |
| 959 | display: block; | 959 | display: block; |
| 960 | font-size: 12px; | 960 | font-size: 12px; |
| 961 | - margin: 2px 0 0 20px; | ||
| 962 | - color: #e3e3e3; | ||
| 963 | -} | ||
| 964 | \ No newline at end of file | 961 | \ No newline at end of file |
| 962 | + color: #ff9d9d; | ||
| 963 | + text-align: right; | ||
| 964 | + margin-right: 5px; | ||
| 965 | +} | ||
| 966 | + | ||
| 967 | +/*.safe_driv_pop .detail_content{ | ||
| 968 | + display: none; | ||
| 969 | +} | ||
| 970 | + | ||
| 971 | +.safe_driv_pop.open .detail_content{ | ||
| 972 | + display: block; | ||
| 973 | + background: rgb(255, 255, 255); | ||
| 974 | + height: 200px; | ||
| 975 | + margin: 7px 0; | ||
| 976 | + border-radius: 5px; | ||
| 977 | + color: #000000; | ||
| 978 | +} | ||
| 979 | + | ||
| 980 | +.safe_driv_pop.open .desc{ | ||
| 981 | + display: none; | ||
| 982 | +}*/ | ||
| 983 | +/** 安全驾驶相关css结束 */ | ||
| 965 | \ No newline at end of file | 984 | \ No newline at end of file |
src/main/resources/static/real_control_v2/css/north.css
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/lj_zrw.html
| @@ -97,6 +97,8 @@ | @@ -97,6 +97,8 @@ | ||
| 97 | <span class="uk-badge uk-badge-danger">直放</span> | 97 | <span class="uk-badge uk-badge-danger">直放</span> |
| 98 | {{else if sch.bcType == "major"}} | 98 | {{else if sch.bcType == "major"}} |
| 99 | <span class="uk-badge uk-badge-danger">放站</span> | 99 | <span class="uk-badge uk-badge-danger">放站</span> |
| 100 | + {{else if sch.bcType == "region"}} | ||
| 101 | + <span class="uk-badge">区间</span> | ||
| 100 | {{/if}} | 102 | {{/if}} |
| 101 | {{if sch.sflj}} | 103 | {{if sch.sflj}} |
| 102 | <span class="uk-badge uk-badge-danger">临加</span> | 104 | <span class="uk-badge uk-badge-danger">临加</span> |
| @@ -422,7 +424,7 @@ | @@ -422,7 +424,7 @@ | ||
| 422 | name: '加油' | 424 | name: '加油' |
| 423 | }, | 425 | }, |
| 424 | 'add_sub_task_in': { | 426 | 'add_sub_task_in': { |
| 425 | - name: '回场' | 427 | + name: '进场' |
| 426 | }, | 428 | }, |
| 427 | 'add_sub_task_out': { | 429 | 'add_sub_task_out': { |
| 428 | name: '出场' | 430 | name: '出场' |
src/main/resources/static/real_control_v2/fragments/line_schedule/sch_table.html
| @@ -72,6 +72,8 @@ | @@ -72,6 +72,8 @@ | ||
| 72 | <span class="uk-badge uk-badge-danger">直放</span> | 72 | <span class="uk-badge uk-badge-danger">直放</span> |
| 73 | {{else if sch.bcType == "major"}} | 73 | {{else if sch.bcType == "major"}} |
| 74 | <span class="uk-badge uk-badge-danger">放站</span> | 74 | <span class="uk-badge uk-badge-danger">放站</span> |
| 75 | + {{else if sch.bcType == "region"}} | ||
| 76 | + <span class="uk-badge">区间</span> | ||
| 75 | {{/if}} | 77 | {{/if}} |
| 76 | {{if sch.sflj}} | 78 | {{if sch.sflj}} |
| 77 | <span class="uk-badge uk-badge-danger">临加</span> | 79 | <span class="uk-badge uk-badge-danger">临加</span> |
| @@ -119,6 +121,8 @@ | @@ -119,6 +121,8 @@ | ||
| 119 | <span class="uk-badge uk-badge-danger">直放</span> | 121 | <span class="uk-badge uk-badge-danger">直放</span> |
| 120 | {{else if bcType == "major"}} | 122 | {{else if bcType == "major"}} |
| 121 | <span class="uk-badge uk-badge-danger">放站</span> | 123 | <span class="uk-badge uk-badge-danger">放站</span> |
| 124 | + {{else if bcType == "region"}} | ||
| 125 | + <span class="uk-badge">区间</span> | ||
| 122 | {{/if}} | 126 | {{/if}} |
| 123 | {{if sflj}} | 127 | {{if sflj}} |
| 124 | <span class="uk-badge uk-badge-danger">临加</span> | 128 | <span class="uk-badge uk-badge-danger">临加</span> |
src/main/resources/static/real_control_v2/fragments/north/nav/all_devices.html
| 1 | -<div class="uk-modal" id="all-devices-modal"> | 1 | +<div class="uk-modal ct_move_modal" id="all-devices-modal"> |
| 2 | <div class="uk-modal-dialog" style="width: 1100px;"> | 2 | <div class="uk-modal-dialog" style="width: 1100px;"> |
| 3 | <a href="" class="uk-modal-close uk-close"></a> | 3 | <a href="" class="uk-modal-close uk-close"></a> |
| 4 | <div class="uk-modal-header"> | 4 | <div class="uk-modal-header"> |
src/main/resources/static/real_control_v2/fragments/north/nav/safeDriving.html
0 → 100644
| 1 | +<div class="uk-modal ct_move_modal" id="safe_dring_list-modal" style="z-index: 99;"> | ||
| 2 | + <div class="uk-modal-dialog" style="width: 1100px;"> | ||
| 3 | + <a href="" class="uk-modal-close uk-close"></a> | ||
| 4 | + <div class="uk-modal-header"> | ||
| 5 | + <h2>安全驾驶图像信息(当日)</h2></div> | ||
| 6 | + | ||
| 7 | + <div class="uk-panel uk-panel-box uk-panel-box-primary"> | ||
| 8 | + <form class="uk-form search-form"> | ||
| 9 | + <fieldset data-uk-margin> | ||
| 10 | + <legend> | ||
| 11 | + 数据检索 | ||
| 12 | + </legend> | ||
| 13 | + <span class="horizontal-field">车辆</span> | ||
| 14 | + <div class="uk-autocomplete uk-form autocomplete-cars" > | ||
| 15 | + <input type="text" name="clzbh" placeholder="车辆自编号"> | ||
| 16 | + </div> | ||
| 17 | + <span class="horizontal-field">异常类型</span> | ||
| 18 | + <select name="yczltype"> | ||
| 19 | + <option value="">全部</option> | ||
| 20 | + <option value="A1">手部离开方向盘</option> | ||
| 21 | + <option value="A2">摄像头异常</option> | ||
| 22 | + <option value="A3">未戴安全带</option> | ||
| 23 | + <option value="A4">未戴袖章</option> | ||
| 24 | + <option value="A5">眨眼/疲劳驾驶</option> | ||
| 25 | + <option value="A6">打哈欠/打瞌睡</option> | ||
| 26 | + <option value="A7">行驶中与人交谈</option> | ||
| 27 | + </select> | ||
| 28 | + <button class="uk-button">检索</button> | ||
| 29 | + </fieldset> | ||
| 30 | + </form> | ||
| 31 | + </div> | ||
| 32 | + <div style="height: 495px;margin:5px 0 -18px;"> | ||
| 33 | + <table class="ct-fixed-table uk-table uk-table-hover"> | ||
| 34 | + <thead> | ||
| 35 | + <tr> | ||
| 36 | + <th style="width: 12%;">线路</th> | ||
| 37 | + <th style="width: 13%;">车辆自编号</th> | ||
| 38 | + <th style="width: 13%;">设备</th> | ||
| 39 | + <th style="width: 13%;">异常类型</th> | ||
| 40 | + <th style="width: 17%;">时间</th> | ||
| 41 | + <th style="width: 11%;">检查属性</th> | ||
| 42 | + <th style="width: 11%;">图像</th> | ||
| 43 | + <th>视频</th> | ||
| 44 | + </tr> | ||
| 45 | + </thead> | ||
| 46 | + <tbody data-uk-observe> | ||
| 47 | + </tbody> | ||
| 48 | + </table> | ||
| 49 | + </div> | ||
| 50 | + | ||
| 51 | + <div class="uk-modal-footer uk-text-right pagination-wrap"> | ||
| 52 | + </div> | ||
| 53 | + </div> | ||
| 54 | + | ||
| 55 | + <script id="all-safe_dring-table-temp" type="text/html"> | ||
| 56 | + {{each array as sd i}} | ||
| 57 | + <tr> | ||
| 58 | + <td style="width: 14%;">{{sd.xlmc}}</td> | ||
| 59 | + <td style="width: 14%;">{{sd.clzbh}}</td> | ||
| 60 | + <td style="width: 13%;">{{sd.sbbh}}</td> | ||
| 61 | + <td style="width: 13%;">{{sd.yczlText}}</td> | ||
| 62 | + <td style="width: 10%;">{{sd.timeStr}}</td> | ||
| 63 | + <td style="width: 10%;"> | ||
| 64 | + {{if sd.yczltype=='A1'}} | ||
| 65 | + {{if sd.jctype==0}} | ||
| 66 | + 双脱手 | ||
| 67 | + {{else if sd.jctype==1}} | ||
| 68 | + 单脱手 | ||
| 69 | + {{/if}} | ||
| 70 | + {{/if}} | ||
| 71 | + </td> | ||
| 72 | + <td style="width: 10%;"> | ||
| 73 | + <a class="image_link" href="{{sd.url}}.jpg" data-uk-lightbox="{group:'jpg_group1'}" title="{{sd.title}}">JPG</a> | ||
| 74 | + </td> | ||
| 75 | + <td> | ||
| 76 | + <a class="image_link" href="{{sd.url}}.gif" data-uk-lightbox="{group:'gif_group2'}" title="{{sd.title}}">查看视频</a> | ||
| 77 | + </td> | ||
| 78 | + </tr> | ||
| 79 | + {{/each}} | ||
| 80 | + </script> | ||
| 81 | + | ||
| 82 | + <script> | ||
| 83 | + (function() { | ||
| 84 | + var modal = '#safe_dring_list-modal'; | ||
| 85 | + var form = $('.search-form', modal); | ||
| 86 | + var page = 0; | ||
| 87 | + var pageSize = 12; | ||
| 88 | + | ||
| 89 | + $(modal).on('init', function(e, data) { | ||
| 90 | + e.stopPropagation(); | ||
| 91 | + | ||
| 92 | + query(); | ||
| 93 | + }); | ||
| 94 | + | ||
| 95 | + //sumit event | ||
| 96 | + form.on('submit', function(e) { | ||
| 97 | + e.preventDefault(); | ||
| 98 | + resetPagination = true; | ||
| 99 | + page=0; | ||
| 100 | + query(); | ||
| 101 | + }); | ||
| 102 | + | ||
| 103 | + var query = function() { | ||
| 104 | + scanFlag = false; | ||
| 105 | + var data = form.serializeJSON(); | ||
| 106 | + data.page = page; | ||
| 107 | + data.size = pageSize; | ||
| 108 | + | ||
| 109 | + gb_common.$get('/gps/safeDriv', data, function (rs) { | ||
| 110 | + //数据转换 | ||
| 111 | + var code2Name=gb_data_basic.lineCode2NameAll(), url,stm, p; | ||
| 112 | + $.each(rs.list, function(){ | ||
| 113 | + if(this.xlbm) | ||
| 114 | + this.xlmc=code2Name[this.xlbm]; | ||
| 115 | + else | ||
| 116 | + this.xlmc=''; | ||
| 117 | + stm = moment(this.ts); | ||
| 118 | + this.timeStr = stm.format('YYYY-MM-DD HH:mm:ss'); | ||
| 119 | + this.yczlText= gb_safe_driv.safeCode[this.yczltype]; | ||
| 120 | + //拼接图片地址 | ||
| 121 | + p = (this.sbbh+'_'+this.yczltype+'_'+stm.format('YYYYMMDDHHmmss')); | ||
| 122 | + url = stm.format('YYYYMMDD')+'/'+p+'/'+p; | ||
| 123 | + this.url = gb_safe_driv.urlPath + url; | ||
| 124 | + //title | ||
| 125 | + this.title = this.clzbh+' '+stm.format('HH时mm分ss秒')+' '+this.yczlText; | ||
| 126 | + }); | ||
| 127 | + | ||
| 128 | + var bodyHtml = template('all-safe_dring-table-temp', { | ||
| 129 | + array: rs.list | ||
| 130 | + }); | ||
| 131 | + $('table tbody', modal).html(bodyHtml); | ||
| 132 | + if (resetPagination) | ||
| 133 | + pagination(rs.totalPages + 1, rs.page); | ||
| 134 | + | ||
| 135 | + //扫描图片是否存在 | ||
| 136 | + scanFlag = true; | ||
| 137 | + scanImgIsExist(); | ||
| 138 | + }); | ||
| 139 | + }; | ||
| 140 | + | ||
| 141 | + var scanFlag; | ||
| 142 | + var scanImgIsExist = function () { | ||
| 143 | + var array = $('table tbody a.image_link', modal); | ||
| 144 | + var i = 0; | ||
| 145 | + //匿名函数递归 | ||
| 146 | + (function () { | ||
| 147 | + //计数 | ||
| 148 | + if(i >= array.length || !scanFlag){ | ||
| 149 | + console.log('扫描图片结束'); | ||
| 150 | + return; | ||
| 151 | + } | ||
| 152 | + var f = arguments.callee; | ||
| 153 | + var $a = $(array[i]); | ||
| 154 | + i ++; | ||
| 155 | + var img = new Image(); | ||
| 156 | + img.onerror = function(){ | ||
| 157 | + $a.removeAttr('href').removeAttr('data-uk-lightbox').text('无').css('color', '#b8b8b8'); | ||
| 158 | + f(); | ||
| 159 | + }; | ||
| 160 | + img.onload = function(){ | ||
| 161 | + f(); | ||
| 162 | + }; | ||
| 163 | + img.src=$a.attr('href'); | ||
| 164 | + })(); | ||
| 165 | + }; | ||
| 166 | + | ||
| 167 | + var resetPagination = true; | ||
| 168 | + var pagination = function(pages, currentPage) { | ||
| 169 | + var wrap = $('.pagination-wrap', modal).empty() | ||
| 170 | + ,e = $('<ul class="uk-pagination"></ul>').appendTo(wrap); | ||
| 171 | + | ||
| 172 | + var pagination = UIkit.pagination(e, { | ||
| 173 | + pages: pages, | ||
| 174 | + currentPage: currentPage | ||
| 175 | + }); | ||
| 176 | + | ||
| 177 | + e.on('select.uk.pagination', function(e, pageIndex){ | ||
| 178 | + page = pageIndex; | ||
| 179 | + query(); | ||
| 180 | + }); | ||
| 181 | + | ||
| 182 | + resetPagination = false; | ||
| 183 | + }; | ||
| 184 | + })(); | ||
| 185 | + </script> | ||
| 186 | +</div> |
src/main/resources/static/real_control_v2/js/data/json/north_toolbar.json
src/main/resources/static/real_control_v2/js/line_schedule/context_menu.js
| @@ -227,7 +227,7 @@ var gb_schedule_context_menu = (function () { | @@ -227,7 +227,7 @@ var gb_schedule_context_menu = (function () { | ||
| 227 | name: '(子任务)加油' | 227 | name: '(子任务)加油' |
| 228 | }, | 228 | }, |
| 229 | 'add_sub_task_in': { | 229 | 'add_sub_task_in': { |
| 230 | - name: '(子任务)回场' | 230 | + name: '(子任务)进场' |
| 231 | }, | 231 | }, |
| 232 | 'add_sub_task_out': { | 232 | 'add_sub_task_out': { |
| 233 | name: '(子任务)出场' | 233 | name: '(子任务)出场' |
src/main/resources/static/real_control_v2/js/modal_extend.js
| 1 | -//modal hide remove dom | ||
| 2 | -$(document).on('hide.uk.modal', '.uk-modal', function () { | ||
| 3 | - $(this).remove(); | ||
| 4 | -}); | ||
| 5 | - | ||
| 6 | -$(document).on('show.uk.modal', '.uk-modal.ct_move_modal', function () { | ||
| 7 | - if($('.uk-modal-dialog', this).hasClass('uk-modal-dialog-blank')) | ||
| 8 | - return; | ||
| 9 | - | ||
| 10 | - /* //临时放过轨迹回放 | ||
| 11 | - if($(this).attr('id')=='map-playback-modal') | ||
| 12 | - return;*/ | ||
| 13 | - | ||
| 14 | - //计算居中位置 | ||
| 15 | - var win = $('body'); | ||
| 16 | - var Y = (win.width() - $('.uk-modal-dialog', this).width()) / 2 - 10; | ||
| 17 | - $('.uk-modal-dialog', this).css('top', '50px').css('left', Y + 'px'); | ||
| 18 | -}); | ||
| 19 | - | ||
| 20 | -var show_modal = function (id, dom) { | ||
| 21 | - $(document.body).append(dom); | ||
| 22 | - return UIkit.modal(id, { | ||
| 23 | - bgclose: false, modal: false | ||
| 24 | - }).show(); | ||
| 25 | -}; | ||
| 26 | - | ||
| 27 | -var open_modal = function (pageUrl, data, opt) { | ||
| 28 | - $.get(pageUrl, function (dom) { | ||
| 29 | - open_modal_dom(dom, data, opt); | ||
| 30 | - }); | ||
| 31 | -}; | ||
| 32 | - | ||
| 33 | -var open_modal_dom = function (dom, data, opt) { | ||
| 34 | - if (!$(dom).hasClass('uk-modal')) { | ||
| 35 | - alert('无效的dom片段!'); | ||
| 36 | - return; | ||
| 37 | - } | ||
| 38 | - var id = '#' + $(dom).attr('id'); | ||
| 39 | - | ||
| 40 | - $(document.body).append(dom); | ||
| 41 | - UIkit.modal(id, opt).show(); | ||
| 42 | - //move | ||
| 43 | - if($(id).hasClass('ct_move_modal')) | ||
| 44 | - modal_move($('.uk-modal-header',id)); | ||
| 45 | - | ||
| 46 | - if (data) | ||
| 47 | - $(id).trigger('init', data); | ||
| 48 | -}; | ||
| 49 | - | ||
| 50 | -var modal_move = function (m_header) { | ||
| 51 | - var _moveFlag; | ||
| 52 | - var _moveObj; | ||
| 53 | - var _offset; | ||
| 54 | - var dict= {}; | ||
| 55 | - var win = $('body'); | ||
| 56 | - | ||
| 57 | - $(m_header).on('mousedown', function (e) { | ||
| 58 | - console.log('mousedown'); | ||
| 59 | - e.preventDefault(); | ||
| 60 | - _moveFlag = true; | ||
| 61 | - _moveObj = $(this).parent(); | ||
| 62 | - _offset = [ | ||
| 63 | - e.clientX - parseFloat(_moveObj.css('left')) - 1, | ||
| 64 | - e.clientY - parseFloat(_moveObj.css('top')) - 1 | ||
| 65 | - ]; | ||
| 66 | - }); | ||
| 67 | - | ||
| 68 | - $(m_header).parents('.uk-modal').mousemove(function (e) { | ||
| 69 | - if(!_moveFlag || !_moveObj) | ||
| 70 | - return; | ||
| 71 | - | ||
| 72 | - var X = e.clientX - _offset[0] | ||
| 73 | - ,Y = e.clientY - _offset[1]; | ||
| 74 | - | ||
| 75 | - dict.stX = win.scrollLeft(); | ||
| 76 | - dict.stY = win.scrollTop(); | ||
| 77 | - | ||
| 78 | - //控制元素不被拖出窗口外 | ||
| 79 | - var setRig = win.width() - _moveObj.outerWidth() + dict.stX | ||
| 80 | - ,setBot = win.height() - _moveObj.outerHeight() + dict.stY; | ||
| 81 | - X < dict.stX && (X = dict.stX); | ||
| 82 | - X > setRig && (X = setRig); | ||
| 83 | - Y < dict.stY && (Y = dict.stY); | ||
| 84 | - Y > setBot && (Y = setBot); | ||
| 85 | - | ||
| 86 | - _moveObj.css({ | ||
| 87 | - left: X | ||
| 88 | - ,top: Y | ||
| 89 | - }); | ||
| 90 | - }); | ||
| 91 | - $(window).on('mouseup', function () { | ||
| 92 | - _moveFlag = false; | ||
| 93 | - _moveObj = null; | ||
| 94 | - }); | 1 | +//modal hide remove dom |
| 2 | +$(document).on('hide.uk.modal', '.uk-modal', function () { | ||
| 3 | + //放过灯箱 | ||
| 4 | + if($('.uk-modal-dialog', this).hasClass('uk-modal-dialog-lightbox')){ | ||
| 5 | + return; | ||
| 6 | + } | ||
| 7 | + $(this).remove(); | ||
| 8 | +}); | ||
| 9 | + | ||
| 10 | +$(document).on('show.uk.modal', '.uk-modal.ct_move_modal', function () { | ||
| 11 | + if($('.uk-modal-dialog', this).hasClass('uk-modal-dialog-blank')) | ||
| 12 | + return; | ||
| 13 | + | ||
| 14 | + //计算居中位置 | ||
| 15 | + var win = $('body'); | ||
| 16 | + var Y = (win.width() - $('.uk-modal-dialog', this).width()) / 2 - 10; | ||
| 17 | + $('.uk-modal-dialog', this).css('top', '50px').css('left', Y + 'px'); | ||
| 18 | +}); | ||
| 19 | + | ||
| 20 | +var show_modal = function (id, dom) { | ||
| 21 | + $(document.body).append(dom); | ||
| 22 | + return UIkit.modal(id, { | ||
| 23 | + bgclose: false, modal: false | ||
| 24 | + }).show(); | ||
| 25 | +}; | ||
| 26 | + | ||
| 27 | +var open_modal = function (pageUrl, data, opt) { | ||
| 28 | + $.get(pageUrl, function (dom) { | ||
| 29 | + open_modal_dom(dom, data, opt); | ||
| 30 | + }); | ||
| 31 | +}; | ||
| 32 | + | ||
| 33 | +var open_modal_dom = function (dom, data, opt) { | ||
| 34 | + if (!$(dom).hasClass('uk-modal')) { | ||
| 35 | + alert('无效的dom片段!'); | ||
| 36 | + return; | ||
| 37 | + } | ||
| 38 | + var id = '#' + $(dom).attr('id'); | ||
| 39 | + | ||
| 40 | + $(document.body).append(dom); | ||
| 41 | + UIkit.modal(id, opt).show(); | ||
| 42 | + //move | ||
| 43 | + if($(id).hasClass('ct_move_modal')) | ||
| 44 | + modal_move($('.uk-modal-header',id)); | ||
| 45 | + | ||
| 46 | + if (data) | ||
| 47 | + $(id).trigger('init', data); | ||
| 48 | +}; | ||
| 49 | + | ||
| 50 | +var modal_move = function (m_header) { | ||
| 51 | + var _moveFlag; | ||
| 52 | + var _moveObj; | ||
| 53 | + var _offset; | ||
| 54 | + var dict= {}; | ||
| 55 | + var win = $('body'); | ||
| 56 | + | ||
| 57 | + $(m_header).on('mousedown', function (e) { | ||
| 58 | + e.preventDefault(); | ||
| 59 | + _moveFlag = true; | ||
| 60 | + _moveObj = $(this).parent(); | ||
| 61 | + _offset = [ | ||
| 62 | + e.clientX - parseFloat(_moveObj.css('left')) - 1, | ||
| 63 | + e.clientY - parseFloat(_moveObj.css('top')) - 1 | ||
| 64 | + ]; | ||
| 65 | + }); | ||
| 66 | + | ||
| 67 | + $(m_header).parents('.uk-modal').mousemove(function (e) { | ||
| 68 | + if(!_moveFlag || !_moveObj) | ||
| 69 | + return; | ||
| 70 | + | ||
| 71 | + var X = e.clientX - _offset[0] | ||
| 72 | + ,Y = e.clientY - _offset[1]; | ||
| 73 | + | ||
| 74 | + dict.stX = win.scrollLeft(); | ||
| 75 | + dict.stY = win.scrollTop(); | ||
| 76 | + | ||
| 77 | + //控制元素不被拖出窗口外 | ||
| 78 | + var setRig = win.width() - _moveObj.outerWidth() + dict.stX | ||
| 79 | + ,setBot = win.height() - _moveObj.outerHeight() + dict.stY; | ||
| 80 | + X < dict.stX && (X = dict.stX); | ||
| 81 | + X > setRig && (X = setRig); | ||
| 82 | + Y < dict.stY && (Y = dict.stY); | ||
| 83 | + Y > setBot && (Y = setBot); | ||
| 84 | + | ||
| 85 | + _moveObj.css({ | ||
| 86 | + left: X | ||
| 87 | + ,top: Y | ||
| 88 | + }); | ||
| 89 | + }); | ||
| 90 | + $(window).on('mouseup', function () { | ||
| 91 | + _moveFlag = false; | ||
| 92 | + _moveObj = null; | ||
| 93 | + }); | ||
| 95 | }; | 94 | }; |
| 96 | \ No newline at end of file | 95 | \ No newline at end of file |
src/main/resources/static/real_control_v2/js/north/toolbar.js
| @@ -188,6 +188,9 @@ var gb_northToolbar = (function () { | @@ -188,6 +188,9 @@ var gb_northToolbar = (function () { | ||
| 188 | }, | 188 | }, |
| 189 | form_schedule_daily: function () { | 189 | form_schedule_daily: function () { |
| 190 | gb_embed_form_hanlde.open_modal_form_fragment('/pages/forms/statement/scheduleDaily.html', '调度工作日报表'); | 190 | gb_embed_form_hanlde.open_modal_form_fragment('/pages/forms/statement/scheduleDaily.html', '调度工作日报表'); |
| 191 | + }, | ||
| 192 | + safe_driving: function () { | ||
| 193 | + open_modal('/real_control_v2/fragments/north/nav/safeDriving.html', {}, modal_opts); | ||
| 191 | } | 194 | } |
| 192 | }; | 195 | }; |
| 193 | 196 |
src/main/resources/static/real_control_v2/js/safe_driv/safeDriv.js
| 1 | -/** | ||
| 2 | - * 安全驾驶相关 | ||
| 3 | - */ | ||
| 4 | -var gb_safe_driv = (function () { | ||
| 5 | - | ||
| 6 | - var codes = { | ||
| 7 | - 'A1': '手部违规', | ||
| 8 | - 'A2': '摄像头偏离', | ||
| 9 | - 'A3': '安全带', | ||
| 10 | - 'A4': '手臂袖章', | ||
| 11 | - 'A5': '脸部检测' | ||
| 12 | - }; | ||
| 13 | - | ||
| 14 | - var $wrap = $('.safe_driv_pop_wrap'); | ||
| 15 | - var max = 5; | ||
| 16 | - | ||
| 17 | - var pop = function (sd) { | ||
| 18 | - //只有admin用户能收到 | ||
| 19 | - var user = gb_northToolbar.user(); | ||
| 20 | - if(!user || user.userName.indexOf('admin') == -1) | ||
| 21 | - return; | ||
| 22 | - | ||
| 23 | - var htmlStr = '<div class="safe_driv_pop uk-animation-slide-bottom">'+ | ||
| 24 | - ' <span class="title"><i class="uk-icon-times-circle"></i>安全驾驶 '+moment(sd.ts).format('HH:mm')+'</span>'+ | ||
| 25 | - ' <span class="text"> '+sd.clzbh+' 违规驾驶('+codes[sd.yczltype]+')</span><span class="desc">请至安全驾驶监管平台查看图像信息</span>'+ | ||
| 26 | - '</div>'; | ||
| 27 | - | ||
| 28 | - var items = $wrap.find('.safe_driv_pop'), len = items.length; | ||
| 29 | - if(len >= max) | ||
| 30 | - $wrap.find('.safe_driv_pop:lt('+(len - max)+')').remove(); | ||
| 31 | - | ||
| 32 | - $wrap.append(htmlStr); | ||
| 33 | - }; | ||
| 34 | - | ||
| 35 | - $wrap.on('click', '.safe_driv_pop', function () { | ||
| 36 | - $(this).remove(); | ||
| 37 | - }); | ||
| 38 | - | ||
| 39 | - return { | ||
| 40 | - pop: pop | ||
| 41 | - } | 1 | +/** |
| 2 | + * 安全驾驶相关 | ||
| 3 | + */ | ||
| 4 | +var gb_safe_driv = (function () { | ||
| 5 | + | ||
| 6 | + var codes = { | ||
| 7 | + 'A1': '手部违规', | ||
| 8 | + 'A2': '摄像头偏离', | ||
| 9 | + 'A3': '安全带', | ||
| 10 | + 'A4': '未戴袖章', | ||
| 11 | + 'A5': '眨眼/疲劳驾驶', | ||
| 12 | + 'A6': '打哈欠/打瞌睡', | ||
| 13 | + 'A7': '与人交谈' | ||
| 14 | + }; | ||
| 15 | + | ||
| 16 | + var path = 'http://180.166.5.82:9988/CurrentSafeDriving/'; | ||
| 17 | + | ||
| 18 | + var $wrap = $('.safe_driv_pop_wrap'); | ||
| 19 | + var max = 5; | ||
| 20 | + | ||
| 21 | + var pop = function (sd) { | ||
| 22 | + //只有admin用户能收到 | ||
| 23 | + var user = gb_northToolbar.user(); | ||
| 24 | + if (!user || user.userName.indexOf('admin') == -1) | ||
| 25 | + return; | ||
| 26 | + | ||
| 27 | + //时间格式化 | ||
| 28 | + var stm = moment(sd.ts); | ||
| 29 | + sd.timeStr = stm.format('HH时mm分ss秒'); | ||
| 30 | + //异常状态文本 | ||
| 31 | + sd.ycztText = codes[sd.yczltype]; | ||
| 32 | + //图片地址 | ||
| 33 | + var p = (sd.sbbh+'_'+sd.yczltype+'_'+stm.format('YYYYMMDDHHmmss')); | ||
| 34 | + var url = stm.format('YYYYMMDD')+'/'+p+'/'+p; | ||
| 35 | + sd.url = path + url + '.jpg'; | ||
| 36 | + | ||
| 37 | + var htmlStr = template('safe_driv_item-temp', sd); | ||
| 38 | + var items = $wrap.find('.safe_driv_pop'), len = items.length; | ||
| 39 | + if (len >= max) | ||
| 40 | + $wrap.find('.safe_driv_pop:lt(' + (len - max) + ')').remove(); | ||
| 41 | + | ||
| 42 | + $wrap.append(htmlStr); | ||
| 43 | + }; | ||
| 44 | + | ||
| 45 | + $wrap.on('click', '.safe_driv_pop', function () { | ||
| 46 | + var title = $(this).data('title'); | ||
| 47 | + var url = $(this).data('url'); | ||
| 48 | + $(this).remove(); | ||
| 49 | + var lightbox = UIkit.lightbox.create([ | ||
| 50 | + {title: title, 'source': url} | ||
| 51 | + ]); | ||
| 52 | + | ||
| 53 | + lightbox.show(); | ||
| 54 | + }); | ||
| 55 | + | ||
| 56 | + return { | ||
| 57 | + pop: pop, | ||
| 58 | + safeCode: codes, | ||
| 59 | + urlPath: path | ||
| 60 | + } | ||
| 42 | })(); | 61 | })(); |
| 43 | \ No newline at end of file | 62 | \ No newline at end of file |
src/main/resources/static/real_control_v2/main.html
| @@ -5,26 +5,27 @@ | @@ -5,26 +5,27 @@ | ||
| 5 | <meta charset="UTF-8"> | 5 | <meta charset="UTF-8"> |
| 6 | <title>线路调度 v2.0</title> | 6 | <title>线路调度 v2.0</title> |
| 7 | <!-- uikit core style--> | 7 | <!-- uikit core style--> |
| 8 | - <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/css/uikit.gradient.min.css"/> | ||
| 9 | - <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/components/notify.gradient.min.css"/> | ||
| 10 | - <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/components/tooltip.gradient.min.css"/> | 8 | + <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/css/uikit.gradient.min.css" merge="uikit"/> |
| 9 | + <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/components/notify.gradient.min.css" merge="uikit"/> | ||
| 10 | + <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/components/tooltip.gradient.min.css" merge="uikit"/> | ||
| 11 | <link rel="stylesheet" | 11 | <link rel="stylesheet" |
| 12 | - href="/real_control_v2/assets/plugins/uikit-2.27.1/components/autocomplete.gradient.min.css"/> | ||
| 13 | - <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/components/accordion.gradient.min.css"/> | 12 | + href="/real_control_v2/assets/plugins/uikit-2.27.1/components/autocomplete.gradient.min.css" merge="uikit"/> |
| 13 | + <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/components/accordion.gradient.min.css" merge="uikit"/> | ||
| 14 | + <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/components/slidenav.gradient.min.css" merge="uikit"/> | ||
| 14 | 15 | ||
| 15 | <!-- main style --> | 16 | <!-- main style --> |
| 16 | - <link rel="stylesheet" href="/real_control_v2/css/main.css"/> | 17 | + <link rel="stylesheet" href="/real_control_v2/css/main.css" merge="custom_style"/> |
| 17 | <!-- north style --> | 18 | <!-- north style --> |
| 18 | - <link rel="stylesheet" href="/real_control_v2/css/north.css"/> | 19 | + <link rel="stylesheet" href="/real_control_v2/css/north.css" merge="custom_style"/> |
| 19 | <!-- home style --> | 20 | <!-- home style --> |
| 20 | - <link rel="stylesheet" href="/real_control_v2/css/home.css"/> | 21 | + <link rel="stylesheet" href="/real_control_v2/css/home.css" merge="custom_style"/> |
| 21 | <!-- line style --> | 22 | <!-- line style --> |
| 22 | - <link rel="stylesheet" href="/real_control_v2/css/line_schedule.css"/> | ||
| 23 | - <link rel="stylesheet" href="/real_control_v2/css/sch_autocomp_result.css"/> | 23 | + <link rel="stylesheet" href="/real_control_v2/css/line_schedule.css" merge="custom_style"/> |
| 24 | + <link rel="stylesheet" href="/real_control_v2/css/sch_autocomp_result.css" merge="custom_style"/> | ||
| 24 | <!-- custom table --> | 25 | <!-- custom table --> |
| 25 | - <link rel="stylesheet" href="/real_control_v2/css/ct_table.css"/> | 26 | + <link rel="stylesheet" href="/real_control_v2/css/ct_table.css" merge="custom_style"/> |
| 26 | <!-- jquery contextMenu style --> | 27 | <!-- jquery contextMenu style --> |
| 27 | - <link rel="stylesheet" href="/real_control_v2/assets/css/jquery.contextMenu.min.css"/> | 28 | + <link rel="stylesheet" href="/real_control_v2/assets/css/jquery.contextMenu.min.css" /> |
| 28 | <!-- formvalidation style --> | 29 | <!-- formvalidation style --> |
| 29 | <link rel="stylesheet" href="/real_control_v2/assets/plugins/formvalidation/formValidation.min.css"/> | 30 | <link rel="stylesheet" href="/real_control_v2/assets/plugins/formvalidation/formValidation.min.css"/> |
| 30 | <!-- js tree --> | 31 | <!-- js tree --> |
| @@ -33,7 +34,7 @@ | @@ -33,7 +34,7 @@ | ||
| 33 | <link rel="stylesheet" href="/real_control_v2/assets/plugins/qtip/jquery.qtip.min.css"/> | 34 | <link rel="stylesheet" href="/real_control_v2/assets/plugins/qtip/jquery.qtip.min.css"/> |
| 34 | <link rel="stylesheet" href="/real_control_v2/css/pace.css"/> | 35 | <link rel="stylesheet" href="/real_control_v2/css/pace.css"/> |
| 35 | 36 | ||
| 36 | - <link rel="stylesheet" href="/real_control_v2/css/modal_extend.css"/> | 37 | + <link rel="stylesheet" href="/real_control_v2/css/modal_extend.css" merge="custom_style"/> |
| 37 | </head> | 38 | </head> |
| 38 | 39 | ||
| 39 | <body> | 40 | <body> |
| @@ -60,7 +61,6 @@ | @@ -60,7 +61,6 @@ | ||
| 60 | </div> | 61 | </div> |
| 61 | </div> | 62 | </div> |
| 62 | 63 | ||
| 63 | -<div class="safe_driv_pop_wrap"></div> | ||
| 64 | <script> | 64 | <script> |
| 65 | delete window.exports; | 65 | delete window.exports; |
| 66 | delete window.module; | 66 | delete window.module; |
| @@ -116,13 +116,14 @@ | @@ -116,13 +116,14 @@ | ||
| 116 | <!-- main js --> | 116 | <!-- main js --> |
| 117 | <script src="/real_control_v2/js/main.js"></script> | 117 | <script src="/real_control_v2/js/main.js"></script> |
| 118 | <!-- uikit core --> | 118 | <!-- uikit core --> |
| 119 | -<script src="/real_control_v2/assets/plugins/uikit-2.27.1/uikit.min.js"></script> | ||
| 120 | -<script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/notify.min.js"></script> | ||
| 121 | -<script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/pagination.min.js"></script> | ||
| 122 | -<script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/tooltip.min.js"></script> | ||
| 123 | -<script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/autocomplete.min.js"></script> | ||
| 124 | -<script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/accordion.min.js"></script> | ||
| 125 | -<script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/timepicker.min.js"></script> | 119 | +<script src="/real_control_v2/assets/plugins/uikit-2.27.1/uikit.min.js" merge="uikit_js"></script> |
| 120 | +<script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/notify.min.js" merge="uikit_js"></script> | ||
| 121 | +<script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/pagination.min.js" merge="uikit_js"></script> | ||
| 122 | +<script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/tooltip.min.js" merge="uikit_js"></script> | ||
| 123 | +<script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/autocomplete.min.js" merge="uikit_js"></script> | ||
| 124 | +<script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/accordion.min.js" merge="uikit_js"></script> | ||
| 125 | +<script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/timepicker.min.js" merge="uikit_js"></script> | ||
| 126 | +<script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/lightbox.min.js" merge="uikit_js"></script> | ||
| 126 | 127 | ||
| 127 | <!-- jquery contextMenu --> | 128 | <!-- jquery contextMenu --> |
| 128 | <script src="/real_control_v2/assets/js/jquery.contextMenu.min.js"></script> | 129 | <script src="/real_control_v2/assets/js/jquery.contextMenu.min.js"></script> |
| @@ -139,54 +140,67 @@ | @@ -139,54 +140,67 @@ | ||
| 139 | <script src="/real_control_v2/assets/plugins/qtip/jquery.qtip.min.js"></script> | 140 | <script src="/real_control_v2/assets/plugins/qtip/jquery.qtip.min.js"></script> |
| 140 | 141 | ||
| 141 | <!-- 数据 --> | 142 | <!-- 数据 --> |
| 142 | -<script src="/real_control_v2/js/data/data_basic.js"></script> | ||
| 143 | -<script src="/real_control_v2/js/data/data_gps.js"></script> | ||
| 144 | -<script src="/real_control_v2/js/data/gps_abnormal.js"></script> | 143 | +<script src="/real_control_v2/js/data/data_basic.js" merge="custom_js"></script> |
| 144 | +<script src="/real_control_v2/js/data/data_gps.js" merge="custom_js"></script> | ||
| 145 | +<script src="/real_control_v2/js/data/gps_abnormal.js" merge="custom_js"></script> | ||
| 145 | <!-- 线路模拟图 --> | 146 | <!-- 线路模拟图 --> |
| 146 | -<script src="/real_control_v2/js/utils/svg_chart.js"></script> | ||
| 147 | -<script src="/real_control_v2/js/utils/svg_data_convert.js"></script> | ||
| 148 | -<script src="/real_control_v2/js/utils/svg_chart_tooltip.js"></script> | ||
| 149 | -<script src="/real_control_v2/js/utils/svg_chart_map.js"></script> | 147 | +<script src="/real_control_v2/js/utils/svg_chart.js" merge="custom_js"></script> |
| 148 | +<script src="/real_control_v2/js/utils/svg_data_convert.js" merge="custom_js"></script> | ||
| 149 | +<script src="/real_control_v2/js/utils/svg_chart_tooltip.js" merge="custom_js"></script> | ||
| 150 | +<script src="/real_control_v2/js/utils/svg_chart_map.js" merge="custom_js"></script> | ||
| 150 | 151 | ||
| 151 | <!-- custom table js --> | 152 | <!-- custom table js --> |
| 152 | -<script src="/real_control_v2/js/utils/ct_table.js"></script> | 153 | +<script src="/real_control_v2/js/utils/ct_table.js" merge="custom_js"></script> |
| 153 | <!-- north js --> | 154 | <!-- north js --> |
| 154 | -<script src="/real_control_v2/js/north/toolbar.js"></script> | ||
| 155 | -<script src="/real_control_v2/js/north/tabs.js"></script> | 155 | +<script src="/real_control_v2/js/north/toolbar.js" merge="custom_js"></script> |
| 156 | +<script src="/real_control_v2/js/north/tabs.js" merge="custom_js"></script> | ||
| 156 | <!-- home js --> | 157 | <!-- home js --> |
| 157 | -<script src="/real_control_v2/js/home/layout.js"></script> | ||
| 158 | -<script src="/real_control_v2/js/home/line_panel.js"></script> | ||
| 159 | -<script src="/real_control_v2/js/home/context_menu.js"></script> | 158 | +<script src="/real_control_v2/js/home/layout.js" merge="custom_js"></script> |
| 159 | +<script src="/real_control_v2/js/home/line_panel.js" merge="custom_js"></script> | ||
| 160 | +<script src="/real_control_v2/js/home/context_menu.js" merge="custom_js"></script> | ||
| 160 | <!-- line schedule js --> | 161 | <!-- line schedule js --> |
| 161 | -<script src="/real_control_v2/js/line_schedule/legend.js"></script> | ||
| 162 | -<script src="/real_control_v2/js/line_schedule/layout.js"></script> | ||
| 163 | -<script src="/real_control_v2/js/line_schedule/sch_table.js"></script> | ||
| 164 | -<script src="/real_control_v2/js/line_schedule/context_menu.js"></script> | ||
| 165 | -<script src="/real_control_v2/js/line_schedule/dbclick.js"></script> | ||
| 166 | -<script src="/real_control_v2/js/line_schedule/search.js"></script> | 162 | +<script src="/real_control_v2/js/line_schedule/legend.js" merge="custom_js"></script> |
| 163 | +<script src="/real_control_v2/js/line_schedule/layout.js" merge="custom_js"></script> | ||
| 164 | +<script src="/real_control_v2/js/line_schedule/sch_table.js" merge="custom_js"></script> | ||
| 165 | +<script src="/real_control_v2/js/line_schedule/context_menu.js" merge="custom_js"></script> | ||
| 166 | +<script src="/real_control_v2/js/line_schedule/dbclick.js" merge="custom_js"></script> | ||
| 167 | +<script src="/real_control_v2/js/line_schedule/search.js" merge="custom_js"></script> | ||
| 167 | 168 | ||
| 168 | <!-- 字典相关 --> | 169 | <!-- 字典相关 --> |
| 169 | -<script src="/assets/js/dictionary.js"></script> | 170 | +<script src="/assets/js/dictionary.js" merge="custom_js"></script> |
| 170 | <!-- websocket --> | 171 | <!-- websocket --> |
| 171 | <script src="/assets/js/sockjs.min.js"></script> | 172 | <script src="/assets/js/sockjs.min.js"></script> |
| 172 | -<script src="/real_control_v2/js/websocket/sch_websocket.js"></script> | 173 | +<script src="/real_control_v2/js/websocket/sch_websocket.js" merge="custom_js"></script> |
| 173 | <!-- tts --> | 174 | <!-- tts --> |
| 174 | -<script src="/real_control_v2/js/utils/tts.js"></script> | 175 | +<script src="/real_control_v2/js/utils/tts.js" merge="custom_js"></script> |
| 175 | 176 | ||
| 176 | <!-- echart --> | 177 | <!-- echart --> |
| 177 | <script src="/real_control_v2/assets/echarts-3/echarts.js"></script> | 178 | <script src="/real_control_v2/assets/echarts-3/echarts.js"></script> |
| 178 | <!-- Geolib --> | 179 | <!-- Geolib --> |
| 179 | <script src="/real_control_v2/geolib/geolib.js"></script> | 180 | <script src="/real_control_v2/geolib/geolib.js"></script> |
| 180 | 181 | ||
| 181 | -<script src="/real_control_v2/js/signal_state/signal_state.js"></script> | ||
| 182 | -<script src="/real_control_v2/js/utils/dispatch_pattern.js"></script> | 182 | +<script src="/real_control_v2/js/signal_state/signal_state.js" merge="custom_js"></script> |
| 183 | +<script src="/real_control_v2/js/utils/dispatch_pattern.js" merge="custom_js"></script> | ||
| 183 | 184 | ||
| 184 | <!-- 处理表单片段嵌入问题 --> | 185 | <!-- 处理表单片段嵌入问题 --> |
| 185 | -<script src="/real_control_v2/js/forms/form_embed.js"></script> | 186 | +<script src="/real_control_v2/js/forms/form_embed.js" merge="custom_js"></script> |
| 186 | <!-- 模态框扩展 --> | 187 | <!-- 模态框扩展 --> |
| 187 | -<script src="/real_control_v2/js/modal_extend.js"></script> | ||
| 188 | -<!-- 安全驾驶相关 --> | ||
| 189 | -<script src="/real_control_v2/js/safe_driv/safeDriv.js" ></script> | 188 | +<script src="/real_control_v2/js/modal_extend.js" merge="custom_js"></script> |
| 189 | + | ||
| 190 | +<!-- #### 安全驾驶 start ### --> | ||
| 191 | +<div class="safe_driv_pop_wrap" ></div> | ||
| 192 | +<script id="safe_driv_item-temp" type="text/html"> | ||
| 193 | + <div class="safe_driv_pop uk-animation-slide-bottom" data-title="{{clzbh}} {{timeStr}} {{ycztText}}" data-url="{{url}}"> | ||
| 194 | + <div> | ||
| 195 | + <span class="title">异常 {{clzbh}}</span> | ||
| 196 | + <span class="text"> {{timeStr}} 出现违规驾驶({{ycztText}})</span> | ||
| 197 | + <span class="desc">--安全驾驶监管平台</span> | ||
| 198 | + </div> | ||
| 199 | + </div> | ||
| 200 | +</script> | ||
| 201 | + | ||
| 202 | +<script src="/real_control_v2/js/safe_driv/safeDriv.js" merge="custom_js"></script> | ||
| 203 | +<!-- #### 安全驾驶 end ### --> | ||
| 190 | </body> | 204 | </body> |
| 191 | 205 | ||
| 192 | </html> | 206 | </html> |
src/main/resources/static/real_control_v2/mapmonitor/css/real.css
| @@ -800,4 +800,125 @@ input[type=checkbox].disabled{ | @@ -800,4 +800,125 @@ input[type=checkbox].disabled{ | ||
| 800 | .cc_info_accordion{ | 800 | .cc_info_accordion{ |
| 801 | height: calc(100% - 40px); | 801 | height: calc(100% - 40px); |
| 802 | overflow: auto; | 802 | overflow: auto; |
| 803 | +} | ||
| 804 | + | ||
| 805 | +.map-wrap-tools{ | ||
| 806 | + position: absolute; | ||
| 807 | + top: 0; | ||
| 808 | + width: 100%; | ||
| 809 | + background: #ffffff; | ||
| 810 | + z-index: 10; | ||
| 811 | + box-shadow: 3px 1px 8px 0 rgba(0, 0, 0, 0.12), 1px 0px 8px 0 rgba(0, 0, 0, 0.12); | ||
| 812 | + height: 70px; | ||
| 813 | + display: none; | ||
| 814 | +} | ||
| 815 | + | ||
| 816 | +.map-container{ | ||
| 817 | + width: 100%; | ||
| 818 | + height: 100%; | ||
| 819 | +} | ||
| 820 | + | ||
| 821 | +.map-container.show_tools{ | ||
| 822 | + height: calc(100% - 63px); | ||
| 823 | + margin-top: 63px; | ||
| 824 | +} | ||
| 825 | + | ||
| 826 | +#map-playback2-modal .uk-modal-close{ | ||
| 827 | + z-index: 11; | ||
| 828 | + background: #ff3333; | ||
| 829 | + opacity: 1; | ||
| 830 | + border-radius: 15px; | ||
| 831 | + color: white; | ||
| 832 | +} | ||
| 833 | + | ||
| 834 | +.map-wrap-tools .ct-progress-bar{ | ||
| 835 | + position: absolute; | ||
| 836 | + height: 11px; | ||
| 837 | + width: 100%; | ||
| 838 | + bottom: 0; | ||
| 839 | + cursor: pointer; | ||
| 840 | + overflow: hidden; | ||
| 841 | + /*border-top: 5px solid white;*/ | ||
| 842 | +} | ||
| 843 | + | ||
| 844 | +.map-wrap-tools .ct-progress-bar .scale{ | ||
| 845 | + width: 85%; | ||
| 846 | + height: 6px; | ||
| 847 | + border-top: 5px solid white; | ||
| 848 | + background: #2bc2d5; | ||
| 849 | +} | ||
| 850 | + | ||
| 851 | +.map-wrap-tools .btns{ | ||
| 852 | + padding: 5px 10px 0 25px; | ||
| 853 | +} | ||
| 854 | + | ||
| 855 | +.map-wrap-tools .btns>span.ct_btn{ | ||
| 856 | + cursor: pointer; | ||
| 857 | +} | ||
| 858 | + | ||
| 859 | +.map-wrap-tools .btns>.play_btn{ | ||
| 860 | + width: 48px; | ||
| 861 | + height: 48px; | ||
| 862 | + display: inline-block; | ||
| 863 | + background: url("/real_control_v2/assets/imgs/icon/play.png"); | ||
| 864 | + margin-right: 10px; | ||
| 865 | +} | ||
| 866 | + | ||
| 867 | +.map-wrap-tools .btns>.play_btn.play{ | ||
| 868 | + background: url("/real_control_v2/assets/imgs/icon/pause.png"); | ||
| 869 | +} | ||
| 870 | + | ||
| 871 | +.map-wrap-tools .btns>.play_btn:hover{ | ||
| 872 | + box-shadow: 0px 0px 8px 0 rgba(220, 35, 35, 0.61), 0px 0px 8px 0 rgba(206, 50, 50, 0.26); | ||
| 873 | + border-radius: 35px; | ||
| 874 | +} | ||
| 875 | + | ||
| 876 | +.map-wrap-tools .btns>.multi-items{ | ||
| 877 | + display: inline-block; | ||
| 878 | + vertical-align: top; | ||
| 879 | + background: #f1f1f1; | ||
| 880 | + padding: 7px 15px; | ||
| 881 | + margin: 12px 5px; | ||
| 882 | + border-radius: 5px; | ||
| 883 | +} | ||
| 884 | + | ||
| 885 | +.map-wrap-tools .btns>.multi-items label{ | ||
| 886 | + margin-right: 10px; | ||
| 887 | +} | ||
| 888 | + | ||
| 889 | +.map-wrap-tools .btns>.multi-items label:last-child{ | ||
| 890 | + margin-right: 0; | ||
| 891 | +} | ||
| 892 | + | ||
| 893 | +.map-wrap-tools .ct_btn.text-panel{ | ||
| 894 | + vertical-align: top; | ||
| 895 | + display: inline-block; | ||
| 896 | + margin-top: 8px; | ||
| 897 | + margin-left: 15px; | ||
| 898 | + font-size: 13px; | ||
| 899 | +} | ||
| 900 | + | ||
| 901 | +.map-wrap-tools .ct_btn.a.export-excel { | ||
| 902 | + color: #F44336; | ||
| 903 | +} | ||
| 904 | + | ||
| 905 | +.map-wrap-tools .ct_btn.clock{ | ||
| 906 | + display: inline-block; | ||
| 907 | + vertical-align: top; | ||
| 908 | + margin-top: 22px; | ||
| 909 | + font-size: 22px; | ||
| 910 | + color: #8b8686; | ||
| 911 | + margin-right: 10px; | ||
| 912 | +} | ||
| 913 | + | ||
| 914 | +.play_back_form_shade{ | ||
| 915 | + background: rgb(196, 194, 194); | ||
| 916 | + position: absolute; | ||
| 917 | + width: 98%; | ||
| 918 | + height: 205px; | ||
| 919 | + left: 2%; | ||
| 920 | + z-index: 99; | ||
| 921 | + top: 0; | ||
| 922 | + opacity: .2; | ||
| 923 | + display: none; | ||
| 803 | } | 924 | } |
| 804 | \ No newline at end of file | 925 | \ No newline at end of file |
src/main/resources/static/real_control_v2/mapmonitor/fragments/playback_v2/main.html
| 1 | -<div class="uk-modal" id="map-playback2-modal"> | ||
| 2 | - <div class="uk-modal-dialog uk-modal-dialog-blank"> | ||
| 3 | - <button class="uk-modal-close uk-close" type="button"></button> | ||
| 4 | - <div class="uk-grid uk-flex-middle" data-uk-grid-margin> | ||
| 5 | - <div class="uk-width-medium-1-10 uk-height-viewport z-depth-viewport"> | ||
| 6 | - <h5 style="color: #868484;text-indent: 5px;"> | ||
| 7 | - 线路配车 | ||
| 8 | - </h5> | ||
| 9 | - <div class="uk-accordion cc_info_accordion" data-uk-accordion data-uk-observe> | ||
| 10 | - </div> | ||
| 11 | - | ||
| 12 | - </div> | ||
| 13 | - <div class="uk-width-medium-2-10 uk-height-viewport z-depth-viewport "> | ||
| 14 | - <form class="uk-form uk-form-horizontal playBackForm"> | ||
| 15 | - <div class="uk-grid"> | ||
| 16 | - <div class="uk-width-1-1"> | ||
| 17 | - <div class="uk-form-row"> | ||
| 18 | - <label class="uk-form-label">车辆编码</label> | ||
| 19 | - <div class="uk-form-controls"> | ||
| 20 | - <div class="uk-autocomplete uk-form autocomplete-nbbm"> | ||
| 21 | - <input name="nbbm" required/> | ||
| 22 | - </div> | ||
| 23 | - </div> | ||
| 24 | - </div> | ||
| 25 | - </div> | ||
| 26 | - </div> | ||
| 27 | - <div class="uk-grid"> | ||
| 28 | - <div class="uk-width-2-3"> | ||
| 29 | - <div class="uk-form-row"> | ||
| 30 | - <label class="uk-form-label">开始时间</label> | ||
| 31 | - <div class="uk-form-controls"> | ||
| 32 | - <input name="sDate" type="date" required/> | ||
| 33 | - </div> | ||
| 34 | - </div> | ||
| 35 | - </div> | ||
| 36 | - <div class="uk-width-1-3" style="padding-left: 15px;"> | ||
| 37 | - <div class="uk-form-row"> | ||
| 38 | - <div class="uk-form-controls" style="margin-left: 0;"> | ||
| 39 | - <input name="sTime" type="time" required/> | ||
| 40 | - </div> | ||
| 41 | - </div> | ||
| 42 | - </div> | ||
| 43 | - </div> | ||
| 44 | - <div class="uk-grid"> | ||
| 45 | - <div class="uk-width-2-3"> | ||
| 46 | - <div class="uk-form-row"> | ||
| 47 | - <label class="uk-form-label">结束时间</label> | ||
| 48 | - <div class="uk-form-controls"> | ||
| 49 | - <input name="eDate" type="date" required/> | ||
| 50 | - </div> | ||
| 51 | - </div> | ||
| 52 | - </div> | ||
| 53 | - <div class="uk-width-1-3" style="padding-left: 15px;"> | ||
| 54 | - <div class="uk-form-row"> | ||
| 55 | - <div class="uk-form-controls" style="margin-left: 0;"> | ||
| 56 | - <input name="eTime" type="time" required/> | ||
| 57 | - </div> | ||
| 58 | - </div> | ||
| 59 | - </div> | ||
| 60 | - </div> | ||
| 61 | - <div class="uk-grid"> | ||
| 62 | - <button class="uk-button uk-button-large uk-button-primary playBackButton" type="submit"><i | ||
| 63 | - class="uk-icon-search"> </i> 搜索轨迹 | ||
| 64 | - </button> | ||
| 65 | - </div> | ||
| 66 | - </form> | ||
| 67 | - <!-- 异常警报 --> | ||
| 68 | - <div class="abnormal_table_wrap"> | ||
| 69 | - <div class="abnormal_table_panel" | ||
| 70 | - style="height: calc(100% - 15px);margin-top: 15px;overflow: auto;"> | ||
| 71 | - <div class="ct_table abnormal_table" style="height: calc(100% - 30px);"> | ||
| 72 | - <div class="ct_table_head"> | ||
| 73 | - <dl> | ||
| 74 | - <dt>异常状态</dt> | ||
| 75 | - <dt>开始时间</dt> | ||
| 76 | - <dt>结束时间</dt> | ||
| 77 | - <dt>图像</dt> | ||
| 78 | - </dl> | ||
| 79 | - </div> | ||
| 80 | - <div class="ct_table_body"> | ||
| 81 | - <dl> | ||
| 82 | - <dd>超速(80)</dd> | ||
| 83 | - <dd>05:00.20</dd> | ||
| 84 | - <dd>05:00.20</dd> | ||
| 85 | - <dd></dd> | ||
| 86 | - </dl> | ||
| 87 | - <dl> | ||
| 88 | - <dd>越界</dd> | ||
| 89 | - <dd>05:00.20</dd> | ||
| 90 | - <dd>05:00.20</dd> | ||
| 91 | - <dd></dd> | ||
| 92 | - </dl> | ||
| 93 | - <dl> | ||
| 94 | - <dd>超速(80)</dd> | ||
| 95 | - <dd>05:00.20</dd> | ||
| 96 | - <dd>05:00.20</dd> | ||
| 97 | - <dd></dd> | ||
| 98 | - </dl> | ||
| 99 | - <dl> | ||
| 100 | - <dd>越界</dd> | ||
| 101 | - <dd>05:00.20</dd> | ||
| 102 | - <dd>05:00.20</dd> | ||
| 103 | - <dd></dd> | ||
| 104 | - </dl> | ||
| 105 | - <dl> | ||
| 106 | - <dd>超速(180)</dd> | ||
| 107 | - <dd>05:00.20</dd> | ||
| 108 | - <dd>05:00.20</dd> | ||
| 109 | - <dd></dd> | ||
| 110 | - </dl> | ||
| 111 | - <dl> | ||
| 112 | - <dd>越界</dd> | ||
| 113 | - <dd>05:00.20</dd> | ||
| 114 | - <dd>05:00.20</dd> | ||
| 115 | - <dd></dd> | ||
| 116 | - </dl> | ||
| 117 | - <dl> | ||
| 118 | - <dd>超速(80)</dd> | ||
| 119 | - <dd>05:00.20</dd> | ||
| 120 | - <dd>05:00.20</dd> | ||
| 121 | - <dd></dd> | ||
| 122 | - </dl> | ||
| 123 | - <dl> | ||
| 124 | - <dd>越界</dd> | ||
| 125 | - <dd>05:00.20</dd> | ||
| 126 | - <dd>05:00.20</dd> | ||
| 127 | - <dd></dd> | ||
| 128 | - </dl> | ||
| 129 | - <dl> | ||
| 130 | - <dd>超速(80)</dd> | ||
| 131 | - <dd>05:00.20</dd> | ||
| 132 | - <dd>05:00.20</dd> | ||
| 133 | - <dd></dd> | ||
| 134 | - </dl> | ||
| 135 | - <dl> | ||
| 136 | - <dd>越界</dd> | ||
| 137 | - <dd>05:00.20</dd> | ||
| 138 | - <dd>05:00.20</dd> | ||
| 139 | - <dd></dd> | ||
| 140 | - </dl> | ||
| 141 | - <dl> | ||
| 142 | - <dd>超速(80)</dd> | ||
| 143 | - <dd>05:00.20</dd> | ||
| 144 | - <dd>05:00.20</dd> | ||
| 145 | - <dd></dd> | ||
| 146 | - </dl> | ||
| 147 | - <dl> | ||
| 148 | - <dd>越界</dd> | ||
| 149 | - <dd>05:00.20</dd> | ||
| 150 | - <dd>05:00.20</dd> | ||
| 151 | - <dd></dd> | ||
| 152 | - </dl> | ||
| 153 | - <dl> | ||
| 154 | - <dd>超速(80)</dd> | ||
| 155 | - <dd>05:00.20</dd> | ||
| 156 | - <dd>05:00.20</dd> | ||
| 157 | - <dd></dd> | ||
| 158 | - </dl> | ||
| 159 | - <dl> | ||
| 160 | - <dd>越界</dd> | ||
| 161 | - <dd>05:00.20</dd> | ||
| 162 | - <dd>05:00.20</dd> | ||
| 163 | - <dd></dd> | ||
| 164 | - </dl> | ||
| 165 | - <dl> | ||
| 166 | - <dd>超速(80)</dd> | ||
| 167 | - <dd>05:00.20</dd> | ||
| 168 | - <dd>05:00.20</dd> | ||
| 169 | - <dd></dd> | ||
| 170 | - </dl> | ||
| 171 | - <dl> | ||
| 172 | - <dd>越界</dd> | ||
| 173 | - <dd>05:00.20</dd> | ||
| 174 | - <dd>05:00.20</dd> | ||
| 175 | - <dd></dd> | ||
| 176 | - </dl> | ||
| 177 | - <dl> | ||
| 178 | - <dd>超速(80)</dd> | ||
| 179 | - <dd>05:00.20</dd> | ||
| 180 | - <dd>05:00.20</dd> | ||
| 181 | - <dd></dd> | ||
| 182 | - </dl> | ||
| 183 | - <dl> | ||
| 184 | - <dd>越界</dd> | ||
| 185 | - <dd>05:00.20</dd> | ||
| 186 | - <dd>05:00.20</dd> | ||
| 187 | - <dd></dd> | ||
| 188 | - </dl> | ||
| 189 | - <dl> | ||
| 190 | - <dd>超速(80)</dd> | ||
| 191 | - <dd>05:00.20</dd> | ||
| 192 | - <dd>05:00.20</dd> | ||
| 193 | - <dd></dd> | ||
| 194 | - </dl> | ||
| 195 | - <dl> | ||
| 196 | - <dd>越界</dd> | ||
| 197 | - <dd>05:00.20</dd> | ||
| 198 | - <dd>05:00.20</dd> | ||
| 199 | - <dd></dd> | ||
| 200 | - </dl> | ||
| 201 | - | ||
| 202 | - </div> | ||
| 203 | - </div> | ||
| 204 | - </div> | ||
| 205 | - </div> | ||
| 206 | - <!-- 路段 和 到离站信息 --> | ||
| 207 | - <div class="uk-margin uk-grid other_info_table_wrap" data-uk-grid-margin> | ||
| 208 | - <div class="uk-width-medium-1-1" style="padding-left: 0;"> | ||
| 209 | - | ||
| 210 | - <ul class="uk-tab" data-uk-tab="{connect:'#real_gps_info_tab_content'}" | ||
| 211 | - style="padding-left: 12px;"> | ||
| 212 | - <li class="uk-active"><a>行车轨迹</a></li> | ||
| 213 | - <li><a>到离站信息</a></li> | ||
| 214 | - </ul> | ||
| 215 | - | ||
| 216 | - <ul id="real_gps_info_tab_content" class="uk-switcher uk-margin" | ||
| 217 | - style="height: calc(100% - 44px);margin-top: 7px;"> | ||
| 218 | - <li class="uk-active" style="height: 100%;"> | ||
| 219 | - <div class="road_table_wrap" style="height: 100%;overflow: auto;"> | ||
| 220 | - <div class="ct_table gps-road-info" | ||
| 221 | - style="height: calc(100% - 30px);"> | ||
| 222 | - <div class="ct_table_head"> | ||
| 223 | - <dl> | ||
| 224 | - <dt>时间</dt> | ||
| 225 | - <dt>速度</dt> | ||
| 226 | - <dt>所在路段</dt> | ||
| 227 | - </dl> | ||
| 228 | - </div> | ||
| 229 | - <div class="ct_table_body"> | ||
| 230 | - </div> | ||
| 231 | - </div> | ||
| 232 | - </div> | ||
| 233 | - </li> | ||
| 234 | - <!-- 到离站数据 --> | ||
| 235 | - <li style="height: 100%;"> | ||
| 236 | - <div class="inout_table_wrap" style="height: 100%;overflow: auto;"> | ||
| 237 | - <div class="ct_table" style="height: calc(100% - 30px);"> | ||
| 238 | - <div class="ct_table_head"> | ||
| 239 | - <dl> | ||
| 240 | - <dt>站点</dt> | ||
| 241 | - <dt>到站时间</dt> | ||
| 242 | - <dt>离站时间</dt> | ||
| 243 | - <dt>上客</dt> | ||
| 244 | - <dt>下客</dt> | ||
| 245 | - </dl> | ||
| 246 | - </div> | ||
| 247 | - <div class="ct_table_body"> | ||
| 248 | - </div> | ||
| 249 | - </div> | ||
| 250 | - </div> | ||
| 251 | - </li> | ||
| 252 | - </ul> | ||
| 253 | - | ||
| 254 | - </div> | ||
| 255 | - </div> | ||
| 256 | - </div> | ||
| 257 | - <div class="uk-width-medium-7-10 uk-height-viewport map-wrap"> | ||
| 258 | - </div> | ||
| 259 | - </div> | ||
| 260 | - </div> | ||
| 261 | - | ||
| 262 | - <script id="cc_info_accordion_cont_temp" type="text/html"> | ||
| 263 | - {{each ccInfo as cc i}} | ||
| 264 | - <h3 class="uk-accordion-title">{{cc.name}}</h3> | ||
| 265 | - <div class="uk-accordion-content"> | ||
| 266 | - <ul class="uk-list"> | ||
| 267 | - {{each cc.cars as c j}} | ||
| 268 | - <li>{{c}}</li> | ||
| 269 | - {{/each}} | ||
| 270 | - </ul> | ||
| 271 | - </div> | ||
| 272 | - {{/each}} | ||
| 273 | - </script> | ||
| 274 | - | ||
| 275 | - <script id="gps_road_info_cont_temp" type="text/html"> | ||
| 276 | - {{each array as gps i}} | ||
| 277 | - <dl data-code="{{gps.road.road_CODE}}"> | ||
| 278 | - <dd>{{gps.timeStr}}</dd> | ||
| 279 | - <dd>{{gps.speed}}</dd> | ||
| 280 | - <dd>{{gps.road.road_NAME}}</dd> | ||
| 281 | - </dl> | ||
| 282 | - {{/each}} | ||
| 283 | - </script> | ||
| 284 | - | ||
| 285 | - <script id="multi_inout_info_cont_temp" type="text/html"> | ||
| 286 | - {{each list as item i}} | ||
| 287 | - <dl> | ||
| 288 | - <dd>{{item.stopName}}</dd> | ||
| 289 | - <dd>{{item.in_time_str}}</dd> | ||
| 290 | - <dd>{{item.out_time_str}}</dd> | ||
| 291 | - <dd></dd> | ||
| 292 | - <dd></dd> | ||
| 293 | - </dl> | ||
| 294 | - {{/each}} | ||
| 295 | - </script> | ||
| 296 | - <script> | ||
| 297 | - (function () { | ||
| 298 | - var modal = '#map-playback2-modal', gpsArray; | ||
| 299 | - | ||
| 300 | - $(modal).on('init', function (e, data) { | ||
| 301 | - try{ | ||
| 302 | - //初始化地图 | ||
| 303 | - map = new BMap.Map($('.map-wrap', modal)[0]); | ||
| 304 | - //中心点和缩放级别 | ||
| 305 | - map.centerAndZoom(new BMap.Point(gb_map_consts.center_point.lng, gb_map_consts.center_point.lat), 16); | ||
| 306 | - map.enableScrollWheelZoom(); | ||
| 307 | - }catch (e){ | ||
| 308 | - console.log(e);} | ||
| 309 | - | ||
| 310 | - //固定表头 | ||
| 311 | - gb_ct_table.fixedHead($('.road_table_wrap', modal)); | ||
| 312 | - gb_ct_table.fixedHead($('.inout_table_wrap', modal)); | ||
| 313 | - gb_ct_table.fixedHead($('.abnormal_table_panel', modal)); | ||
| 314 | - //线路配车 | ||
| 315 | - ccInfo.init(); | ||
| 316 | - | ||
| 317 | - //表单初始值 | ||
| 318 | - searchForm.init(data); | ||
| 319 | - }); | ||
| 320 | - | ||
| 321 | - /** | ||
| 322 | - * 线路配车相关 | ||
| 323 | - */ | ||
| 324 | - var ccInfo = (function () { | ||
| 325 | - | ||
| 326 | - function init() { | ||
| 327 | - $.get('/basic/ccInfo', function (rs) { | ||
| 328 | - var ccInfo = [], lines = gb_data_basic.codeToLine; | ||
| 329 | - for (var code in lines) { | ||
| 330 | - ccInfo.push({ | ||
| 331 | - name: lines[code].name, | ||
| 332 | - cars: carSort(rs[code]) | ||
| 333 | - }); | ||
| 334 | - } | ||
| 335 | - | ||
| 336 | - var htmlStr = template('cc_info_accordion_cont_temp', {ccInfo: ccInfo}); | ||
| 337 | - $('.cc_info_accordion', modal).html(htmlStr) | ||
| 338 | - .find('.uk-list li').on('click', itemClick); | ||
| 339 | - }); | ||
| 340 | - } | ||
| 341 | - | ||
| 342 | - function carSort(list) { | ||
| 343 | - if (!list) | ||
| 344 | - return []; | ||
| 345 | - return list.sort(); | ||
| 346 | - } | ||
| 347 | - | ||
| 348 | - function itemClick() { | ||
| 349 | - $(this).parent().find('li.active').removeClass('active'); | ||
| 350 | - $(this).addClass('active'); | ||
| 351 | - searchForm.setNbbm($(this).text()); | ||
| 352 | - } | ||
| 353 | - | ||
| 354 | - return { | ||
| 355 | - init: init | ||
| 356 | - }; | ||
| 357 | - })(); | ||
| 358 | - | ||
| 359 | - /** | ||
| 360 | - * 搜索表单相关 | ||
| 361 | - */ | ||
| 362 | - var searchForm = (function () { | ||
| 363 | - | ||
| 364 | - var f = $('.playBackForm', modal); | ||
| 365 | - | ||
| 366 | - var init = function (data) { | ||
| 367 | - //设置初始值 | ||
| 368 | - if (data.nbbm) | ||
| 369 | - $('[name=nbbm]', f).val(data.nbbm); | ||
| 370 | - var st = moment().subtract(2, 'hour'); | ||
| 371 | - if (data.st) | ||
| 372 | - st = moment(data.st, 'YYYY-MM-DD HH:mm'); | ||
| 373 | - $('[name=sDate]', f).val(st.format('YYYY-MM-DD')); | ||
| 374 | - $('[name=sTime]', f).val(st.format('HH:mm')); | ||
| 375 | - var et = moment(); | ||
| 376 | - if (data.et) | ||
| 377 | - et = moment(data.et, 'YYYY-MM-DD HH:mm'); | ||
| 378 | - $('[name=eDate]', f).val(et.format('YYYY-MM-DD')); | ||
| 379 | - $('[name=eTime]', f).val(et.format('HH:mm')); | ||
| 380 | - | ||
| 381 | - //搜索事件 | ||
| 382 | - $('button[type=submit]', f).on('click', search); | ||
| 383 | - }; | ||
| 384 | - | ||
| 385 | - var setNbbm = function (v) { | ||
| 386 | - $('[name=nbbm]', f).val(v); | ||
| 387 | - }; | ||
| 388 | - | ||
| 389 | - var ONE_DAY = 60 * 60 * 24; | ||
| 390 | - var MIN_SPACE = 60; | ||
| 391 | - var search = function (e) { | ||
| 392 | - e.stopPropagation(); | ||
| 393 | - var data = f.serializeJSON(); | ||
| 394 | - | ||
| 395 | - //校验时间间隔 | ||
| 396 | - var fs = 'YYYY-MM-DDHH:mm'; | ||
| 397 | - var st = parseInt(moment(data.sDate + data.sTime, fs).format('X')); | ||
| 398 | - var et = parseInt(moment(data.eDate + data.eTime, fs).format('X')); | ||
| 399 | - | ||
| 400 | - if (et < st) | ||
| 401 | - notify_err('结束时间不能小于开始时间'); | ||
| 402 | - else if ((et - st) > ONE_DAY) | ||
| 403 | - notify_err('最大间隔24小时!'); | ||
| 404 | - else if ((et - st) < MIN_SPACE) | ||
| 405 | - notify_err('最小间隔1分钟!'); | ||
| 406 | - else { | ||
| 407 | - $.ajax({ | ||
| 408 | - url: '/gps/history_v2/' + data.nbbm, | ||
| 409 | - traditional: true, | ||
| 410 | - data: {st: st, et: et}, | ||
| 411 | - success: function (rs) { | ||
| 412 | - gpsArray = rs.list; | ||
| 413 | - if (!rs || rs.length == 0) { | ||
| 414 | - notify_err('没有搜索到轨迹数据!'); | ||
| 415 | - return; | ||
| 416 | - } | ||
| 417 | - | ||
| 418 | - //排序 | ||
| 419 | - gpsArray.sort(function (a, b) { | ||
| 420 | - return a.ts - b.ts; | ||
| 421 | - }); | ||
| 422 | - console.log('gpsArray', gpsArray); | ||
| 423 | - //行车轨迹 | ||
| 424 | - trailTableObj.showInitData(gpsArray); | ||
| 425 | - //到离站信息 | ||
| 426 | - inOutStationTableObj.showInitData(gpsArray); | ||
| 427 | - } | ||
| 428 | - }); | ||
| 429 | - } | ||
| 430 | - return false; | ||
| 431 | - }; | ||
| 432 | - return { | ||
| 433 | - init: init, | ||
| 434 | - setNbbm: setNbbm | ||
| 435 | - }; | ||
| 436 | - })(); | ||
| 437 | - | ||
| 438 | - /** | ||
| 439 | - * 行车轨迹表格 | ||
| 440 | - */ | ||
| 441 | - var trailTableObj = (function () { | ||
| 442 | - | ||
| 443 | - var showInitData = function (list) { | ||
| 444 | - var array = []; | ||
| 445 | - for (var i = 0, gps; gps = list[i++];) { | ||
| 446 | - //格式化时间 | ||
| 447 | - gps.timeStr = moment(gps.timestamp).format('HH:mm.ss'); | ||
| 448 | - try { | ||
| 449 | - if (i > 0 && array[array.length - 1].road.road_CODE == gps.road.road_CODE) | ||
| 450 | - array.pop(); | ||
| 451 | - } | ||
| 452 | - catch (e) {} | ||
| 453 | - | ||
| 454 | - if (gps.road) | ||
| 455 | - array.push(gps); | ||
| 456 | - } | ||
| 457 | - | ||
| 458 | - var htmlStr = template('gps_road_info_cont_temp', {array: array}); | ||
| 459 | - $('.gps-road-info .ct_table_body', modal).html(htmlStr); | ||
| 460 | - }; | ||
| 461 | - | ||
| 462 | - return { | ||
| 463 | - showInitData: showInitData | ||
| 464 | - }; | ||
| 465 | - })(); | ||
| 466 | - | ||
| 467 | - /** | ||
| 468 | - * 到离站信息表格 | ||
| 469 | - * @type {{}} | ||
| 470 | - */ | ||
| 471 | - var inOutStationTableObj = (function () { | ||
| 472 | - | ||
| 473 | - var data = []; | ||
| 474 | - var showInitData = function (list) { | ||
| 475 | - clear(); | ||
| 476 | - data = []; | ||
| 477 | - | ||
| 478 | - $.each(list, function (i, gps) { | ||
| 479 | - if(gps['inout_stop'] == -1) | ||
| 480 | - return true; | ||
| 481 | - | ||
| 482 | - if(gps['inout_stop'] == 1){ | ||
| 483 | - data.push(createIn(gps)); | ||
| 484 | - } | ||
| 485 | - else if(gps['inout_stop'] == 0){ | ||
| 486 | - matchOut(data[data.length - 1], gps); | ||
| 487 | - } | ||
| 488 | - }); | ||
| 489 | - | ||
| 490 | - //格式化时间 | ||
| 491 | - $.each(data, function () { | ||
| 492 | - if(this.in_ts) | ||
| 493 | - this.in_time_str = moment(this.in_ts).format('HH:mm.ss'); | ||
| 494 | - if(this.out_ts) | ||
| 495 | - this.out_time_str = moment(this.out_ts).format('HH:mm.ss'); | ||
| 496 | - }); | ||
| 497 | - | ||
| 498 | - console.log('data', data); | ||
| 499 | - var htmlStr = template('multi_inout_info_cont_temp', {list: data}); | ||
| 500 | - $('.inout_table_wrap .ct_table_body', modal).html(htmlStr); | ||
| 501 | - }; | ||
| 502 | - | ||
| 503 | - var add = function (gps) { | ||
| 504 | - | ||
| 505 | - /*if (gps.inout_stop == -1) | ||
| 506 | - return; | ||
| 507 | - | ||
| 508 | - var htmlStr = template('', {obj: gps['inout_stop_info']}); | ||
| 509 | - $('.inout_table_wrap .ct_table .ct_table_body', modal).html(htmlStr);*/ | ||
| 510 | - }; | ||
| 511 | - | ||
| 512 | - var clear = function () { | ||
| 513 | - | ||
| 514 | - }; | ||
| 515 | - | ||
| 516 | - var createIn = function (gps) { | ||
| 517 | - var info = gps['inout_stop_info']; | ||
| 518 | - return { | ||
| 519 | - in_ts: info.ts, | ||
| 520 | - stopNo: info.stopNo, | ||
| 521 | - stopName: info.stopName | ||
| 522 | - } | ||
| 523 | - }; | ||
| 524 | - | ||
| 525 | - | ||
| 526 | - var matchOut = function (info, gps) { | ||
| 527 | - if(!info) | ||
| 528 | - return; | ||
| 529 | - var outInfo = gps['inout_stop_info']; | ||
| 530 | - if(info.stopName == outInfo.stopName){ | ||
| 531 | - info['out_ts'] = outInfo.ts; | ||
| 532 | - } | ||
| 533 | - }; | ||
| 534 | - | ||
| 535 | - return { | ||
| 536 | - showInitData: showInitData | ||
| 537 | - }; | ||
| 538 | - })(); | ||
| 539 | - })(); | ||
| 540 | - </script> | 1 | +<div class="uk-modal" id="map-playback2-modal"> |
| 2 | + <div class="uk-modal-dialog uk-modal-dialog-blank"> | ||
| 3 | + <button class="uk-modal-close uk-close" type="button"></button> | ||
| 4 | + <div class="uk-grid uk-flex-middle" data-uk-grid-margin> | ||
| 5 | + <div class="uk-width-medium-1-10 uk-height-viewport z-depth-viewport"> | ||
| 6 | + <h5 style="color: #868484;text-indent: 5px;"> | ||
| 7 | + 线路配车 | ||
| 8 | + </h5> | ||
| 9 | + <div class="uk-accordion cc_info_accordion" data-uk-accordion data-uk-observe> | ||
| 10 | + </div> | ||
| 11 | + | ||
| 12 | + </div> | ||
| 13 | + <div class="uk-width-medium-2-10 uk-height-viewport z-depth-viewport " style="position: relative;"> | ||
| 14 | + <div class="play_back_form_shade uk-animation-scale"></div> | ||
| 15 | + <form class="uk-form uk-form-horizontal playBackForm"> | ||
| 16 | + <div class="uk-grid"> | ||
| 17 | + <div class="uk-width-1-1"> | ||
| 18 | + <div class="uk-form-row"> | ||
| 19 | + <label class="uk-form-label">车辆编码</label> | ||
| 20 | + <div class="uk-form-controls"> | ||
| 21 | + <div class="uk-autocomplete uk-form autocomplete-nbbm"> | ||
| 22 | + <div class="uk-autocomplete uk-form autocomplete-nbbm"> | ||
| 23 | + <input name="nbbm" required/> | ||
| 24 | + </div> | ||
| 25 | + </div> | ||
| 26 | + </div> | ||
| 27 | + </div> | ||
| 28 | + </div> | ||
| 29 | + </div> | ||
| 30 | + <div class="uk-grid"> | ||
| 31 | + <div class="uk-width-2-3"> | ||
| 32 | + <div class="uk-form-row"> | ||
| 33 | + <label class="uk-form-label">开始时间</label> | ||
| 34 | + <div class="uk-form-controls"> | ||
| 35 | + <input name="sDate" type="date" required/> | ||
| 36 | + </div> | ||
| 37 | + </div> | ||
| 38 | + </div> | ||
| 39 | + <div class="uk-width-1-3" style="padding-left: 15px;"> | ||
| 40 | + <div class="uk-form-row"> | ||
| 41 | + <div class="uk-form-controls" style="margin-left: 0;"> | ||
| 42 | + <input name="sTime" type="time" required/> | ||
| 43 | + </div> | ||
| 44 | + </div> | ||
| 45 | + </div> | ||
| 46 | + </div> | ||
| 47 | + <div class="uk-grid"> | ||
| 48 | + <div class="uk-width-2-3"> | ||
| 49 | + <div class="uk-form-row"> | ||
| 50 | + <label class="uk-form-label">结束时间</label> | ||
| 51 | + <div class="uk-form-controls"> | ||
| 52 | + <input name="eDate" type="date" required/> | ||
| 53 | + </div> | ||
| 54 | + </div> | ||
| 55 | + </div> | ||
| 56 | + <div class="uk-width-1-3" style="padding-left: 15px;"> | ||
| 57 | + <div class="uk-form-row"> | ||
| 58 | + <div class="uk-form-controls" style="margin-left: 0;"> | ||
| 59 | + <input name="eTime" type="time" required/> | ||
| 60 | + </div> | ||
| 61 | + </div> | ||
| 62 | + </div> | ||
| 63 | + </div> | ||
| 64 | + <div class="uk-grid"> | ||
| 65 | + <button class="uk-button uk-button-large uk-button-primary playBackButton" type="submit"><i | ||
| 66 | + class="uk-icon-search"> </i> 搜索轨迹 | ||
| 67 | + </button> | ||
| 68 | + </div> | ||
| 69 | + </form> | ||
| 70 | + <!-- 异常警报 --> | ||
| 71 | + <div class="abnormal_table_wrap"> | ||
| 72 | + <div class="abnormal_table_panel" | ||
| 73 | + style="height: calc(100% - 15px);margin-top: 15px;overflow: auto;"> | ||
| 74 | + <div class="ct_table abnormal_table" style="height: calc(100% - 30px);"> | ||
| 75 | + <div class="ct_table_head"> | ||
| 76 | + <dl> | ||
| 77 | + <dt>异常状态</dt> | ||
| 78 | + <dt>开始时间</dt> | ||
| 79 | + <dt>结束时间</dt> | ||
| 80 | + <dt>图像</dt> | ||
| 81 | + </dl> | ||
| 82 | + </div> | ||
| 83 | + <div class="ct_table_body"> | ||
| 84 | + </div> | ||
| 85 | + </div> | ||
| 86 | + </div> | ||
| 87 | + </div> | ||
| 88 | + <!-- 路段 和 到离站信息 --> | ||
| 89 | + <div class="uk-margin uk-grid other_info_table_wrap" data-uk-grid-margin> | ||
| 90 | + <div class="uk-width-medium-1-1" style="padding-left: 0;"> | ||
| 91 | + | ||
| 92 | + <ul class="uk-tab" data-uk-tab="{connect:'#real_gps_info_tab_content'}" | ||
| 93 | + style="padding-left: 12px;"> | ||
| 94 | + <li class="uk-active"><a>行车轨迹</a></li> | ||
| 95 | + <li><a>到离站信息</a></li> | ||
| 96 | + </ul> | ||
| 97 | + | ||
| 98 | + <ul id="real_gps_info_tab_content" class="uk-switcher uk-margin" | ||
| 99 | + style="height: calc(100% - 44px);margin-top: 7px;"> | ||
| 100 | + <li class="uk-active" style="height: 100%;"> | ||
| 101 | + <div class="road_table_wrap" style="height: 100%;overflow: auto;"> | ||
| 102 | + <div class="ct_table gps-road-info" | ||
| 103 | + style="height: calc(100% - 30px);"> | ||
| 104 | + <div class="ct_table_head"> | ||
| 105 | + <dl> | ||
| 106 | + <dt>时间</dt> | ||
| 107 | + <dt>速度</dt> | ||
| 108 | + <dt>所在路段</dt> | ||
| 109 | + </dl> | ||
| 110 | + </div> | ||
| 111 | + <div class="ct_table_body"> | ||
| 112 | + </div> | ||
| 113 | + </div> | ||
| 114 | + </div> | ||
| 115 | + </li> | ||
| 116 | + <!-- 到离站数据 --> | ||
| 117 | + <li style="height: 100%;"> | ||
| 118 | + <div class="inout_table_wrap" style="height: 100%;overflow: auto;"> | ||
| 119 | + <div class="ct_table" style="height: calc(100% - 30px);"> | ||
| 120 | + <div class="ct_table_head"> | ||
| 121 | + <dl> | ||
| 122 | + <dt>站点</dt> | ||
| 123 | + <dt>到站时间</dt> | ||
| 124 | + <dt>离站时间</dt> | ||
| 125 | + <dt>上客</dt> | ||
| 126 | + <dt>下客</dt> | ||
| 127 | + </dl> | ||
| 128 | + </div> | ||
| 129 | + <div class="ct_table_body"> | ||
| 130 | + </div> | ||
| 131 | + </div> | ||
| 132 | + </div> | ||
| 133 | + </li> | ||
| 134 | + </ul> | ||
| 135 | + | ||
| 136 | + </div> | ||
| 137 | + </div> | ||
| 138 | + </div> | ||
| 139 | + <div class="uk-width-medium-7-10 uk-height-viewport map-wrap" style="padding-left: 0;position: relative;"> | ||
| 140 | + <div class="map-wrap-tools uk-animation-slide-top"> | ||
| 141 | + <div class="btns"> | ||
| 142 | + <span class="ct_btn play_btn"></span> | ||
| 143 | + <span class="ct_btn clock"></span> | ||
| 144 | + <div class="multi-items"> | ||
| 145 | + <form class="uk-form speed_form"> | ||
| 146 | + <label> | ||
| 147 | + <input type="radio" name="playSpeed" value="1"> x1 | ||
| 148 | + </label> | ||
| 149 | + <label> | ||
| 150 | + <input type="radio" name="playSpeed" value="5"> x5 | ||
| 151 | + </label> | ||
| 152 | + <label> | ||
| 153 | + <input type="radio" name="playSpeed" value="10"> x10 | ||
| 154 | + </label> | ||
| 155 | + <label> | ||
| 156 | + <input type="radio" name="playSpeed" value="20"> x20 | ||
| 157 | + </label> | ||
| 158 | + </form> | ||
| 159 | + </div> | ||
| 160 | + <div class="multi-items"> | ||
| 161 | + <form class="uk-form buffer_area_form"> | ||
| 162 | + <label> | ||
| 163 | + <input type="checkbox" name="drawPoint"> 站点 | ||
| 164 | + </label> | ||
| 165 | + <label> | ||
| 166 | + <input type="checkbox" name="drawBuffArea"> 缓冲区 | ||
| 167 | + </label> | ||
| 168 | + <label> | ||
| 169 | + <input type="checkbox" name="stationName"> 站点名称 | ||
| 170 | + </label> | ||
| 171 | + <label> | ||
| 172 | + <a>停车场 <i class="uk-icon-angle-down"></i></a> | ||
| 173 | + </label> | ||
| 174 | + </form> | ||
| 175 | + </div> | ||
| 176 | + <span class="ct_btn text-panel"> | ||
| 177 | + <span>共约 <span class="sum_mileage"></span> 公里,<span class="count_point"></span> 个GPS点</span><br> | ||
| 178 | + <a class="export-excel"><i class="uk-icon-file-excel-o"></i> 导出轨迹</a> | ||
| 179 | + </span> | ||
| 180 | + </div> | ||
| 181 | + <div class="ct-progress-bar" > | ||
| 182 | + <div class="scale"></div> | ||
| 183 | + </div> | ||
| 184 | + </div> | ||
| 185 | + <div class="map-container"></div> | ||
| 186 | + </div> | ||
| 187 | + </div> | ||
| 188 | + </div> | ||
| 189 | + | ||
| 190 | + <script id="cc_info_accordion_cont_temp" type="text/html"> | ||
| 191 | + {{each ccInfo as cc i}} | ||
| 192 | + <h3 class="uk-accordion-title">{{cc.name}}</h3> | ||
| 193 | + <div class="uk-accordion-content"> | ||
| 194 | + <ul class="uk-list"> | ||
| 195 | + {{each cc.cars as c j}} | ||
| 196 | + <li>{{c}}</li> | ||
| 197 | + {{/each}} | ||
| 198 | + </ul> | ||
| 199 | + </div> | ||
| 200 | + {{/each}} | ||
| 201 | + </script> | ||
| 202 | + | ||
| 203 | + <script id="gps_road_info_cont_temp" type="text/html"> | ||
| 204 | + {{each array as gps i}} | ||
| 205 | + <dl data-code="{{gps.road.road_CODE}}"> | ||
| 206 | + <dd>{{gps.timeStr}}</dd> | ||
| 207 | + <dd>{{gps.speed}}</dd> | ||
| 208 | + <dd>{{gps.road.road_NAME}}</dd> | ||
| 209 | + </dl> | ||
| 210 | + {{/each}} | ||
| 211 | + </script> | ||
| 212 | + | ||
| 213 | + <script id="multi_inout_info_cont_temp" type="text/html"> | ||
| 214 | + {{each list as item i}} | ||
| 215 | + <dl data-id="{{item.id}}"> | ||
| 216 | + <dd>{{item.stopName}}</dd> | ||
| 217 | + <dd>{{item.in_time_str}}</dd> | ||
| 218 | + <dd>{{item.out_time_str}}</dd> | ||
| 219 | + <dd></dd> | ||
| 220 | + <dd></dd> | ||
| 221 | + </dl> | ||
| 222 | + {{/each}} | ||
| 223 | + </script> | ||
| 224 | + | ||
| 225 | + <script id="inout_info_cont_temp" type="text/html"> | ||
| 226 | + <dl data-id="{{id}}"> | ||
| 227 | + <dd>{{stopName}}</dd> | ||
| 228 | + <dd>{{in_time_str}}</dd> | ||
| 229 | + <dd></dd> | ||
| 230 | + <dd></dd> | ||
| 231 | + <dd></dd> | ||
| 232 | + </dl> | ||
| 233 | + </script> | ||
| 234 | + | ||
| 235 | + | ||
| 236 | + <script id="abnormal_table_cont_temp" type="text/html"> | ||
| 237 | + {{each array as item i}} | ||
| 238 | + <dl> | ||
| 239 | + <dd> | ||
| 240 | + {{if item.abnormalType == 'speed'}} | ||
| 241 | + 超速({{item.speed}}) | ||
| 242 | + {{else if item.abnormalType == 'outbound'}} | ||
| 243 | + 越界 | ||
| 244 | + {{/if}} | ||
| 245 | + </dd> | ||
| 246 | + <dd>{{item.st_str}}</dd> | ||
| 247 | + <dd>{{item.et_str}}</dd> | ||
| 248 | + <dd></dd> | ||
| 249 | + </dl> | ||
| 250 | + {{/each}} | ||
| 251 | + </script> | ||
| 252 | + <script> | ||
| 253 | + (function () { | ||
| 254 | + var modal = '#map-playback2-modal', gpsArray; | ||
| 255 | + | ||
| 256 | + $(modal).on('init', function (e, data) { | ||
| 257 | + //初始化地图 | ||
| 258 | + mapObj.initMap(); | ||
| 259 | + | ||
| 260 | + //固定表头 | ||
| 261 | + gb_ct_table.fixedHead($('.road_table_wrap', modal)); | ||
| 262 | + gb_ct_table.fixedHead($('.inout_table_wrap', modal)); | ||
| 263 | + gb_ct_table.fixedHead($('.abnormal_table_panel', modal)); | ||
| 264 | + //线路配车 | ||
| 265 | + ccInfo.init(); | ||
| 266 | + | ||
| 267 | + //表单初始值 | ||
| 268 | + searchForm.init(data); | ||
| 269 | + | ||
| 270 | + //车辆 autocomplete | ||
| 271 | + $.get('/basic/cars', function (rs) { | ||
| 272 | + gb_common.carAutocomplete($('.autocomplete-nbbm', modal), rs); | ||
| 273 | + }); | ||
| 274 | + }); | ||
| 275 | + | ||
| 276 | + /** | ||
| 277 | + * 线路配车相关 | ||
| 278 | + */ | ||
| 279 | + var ccInfo = (function () { | ||
| 280 | + | ||
| 281 | + function init() { | ||
| 282 | + $.get('/basic/ccInfo', function (rs) { | ||
| 283 | + var ccInfo = [], lines = gb_data_basic.codeToLine; | ||
| 284 | + for (var code in lines) { | ||
| 285 | + ccInfo.push({ | ||
| 286 | + name: lines[code].name, | ||
| 287 | + cars: carSort(rs[code]) | ||
| 288 | + }); | ||
| 289 | + } | ||
| 290 | + | ||
| 291 | + var htmlStr = template('cc_info_accordion_cont_temp', {ccInfo: ccInfo}); | ||
| 292 | + $('.cc_info_accordion', modal).html(htmlStr) | ||
| 293 | + .find('.uk-list li').on('click', itemClick); | ||
| 294 | + }); | ||
| 295 | + } | ||
| 296 | + | ||
| 297 | + function carSort(list) { | ||
| 298 | + if (!list) | ||
| 299 | + return []; | ||
| 300 | + return list.sort(); | ||
| 301 | + } | ||
| 302 | + | ||
| 303 | + function itemClick() { | ||
| 304 | + $(this).parent().find('li.active').removeClass('active'); | ||
| 305 | + $(this).addClass('active'); | ||
| 306 | + searchForm.setNbbm($(this).text()); | ||
| 307 | + } | ||
| 308 | + | ||
| 309 | + return { | ||
| 310 | + init: init | ||
| 311 | + }; | ||
| 312 | + })(); | ||
| 313 | + | ||
| 314 | + /** | ||
| 315 | + * 搜索表单相关 | ||
| 316 | + */ | ||
| 317 | + var searchForm = (function () { | ||
| 318 | + | ||
| 319 | + var f = $('.playBackForm', modal); | ||
| 320 | + | ||
| 321 | + var init = function (data) { | ||
| 322 | + //设置初始值 | ||
| 323 | + if (data.nbbm) | ||
| 324 | + $('[name=nbbm]', f).val(data.nbbm); | ||
| 325 | + var st = moment().subtract(2, 'hour'); | ||
| 326 | + if (data.st) | ||
| 327 | + st = moment(data.st, 'YYYY-MM-DD HH:mm'); | ||
| 328 | + $('[name=sDate]', f).val(st.format('YYYY-MM-DD')); | ||
| 329 | + $('[name=sTime]', f).val(st.format('HH:mm')); | ||
| 330 | + var et = moment(); | ||
| 331 | + if (data.et) | ||
| 332 | + et = moment(data.et, 'YYYY-MM-DD HH:mm'); | ||
| 333 | + $('[name=eDate]', f).val(et.format('YYYY-MM-DD')); | ||
| 334 | + $('[name=eTime]', f).val(et.format('HH:mm')); | ||
| 335 | + | ||
| 336 | + | ||
| 337 | + /*$('[name=nbbm]', f).val('W0A-018'); | ||
| 338 | + $('[name=sDate]', f).val('2017-04-06'); | ||
| 339 | + $('[name=sTime]', f).val('04:49'); | ||
| 340 | + | ||
| 341 | + $('[name=eDate]', f).val('2017-04-06'); | ||
| 342 | + $('[name=eTime]', f).val('09:49');*/ | ||
| 343 | + //搜索事件 | ||
| 344 | + $('button[type=submit]', f).on('click', search); | ||
| 345 | + }; | ||
| 346 | + | ||
| 347 | + var setNbbm = function (v) { | ||
| 348 | + $('[name=nbbm]', f).val(v); | ||
| 349 | + }; | ||
| 350 | + | ||
| 351 | + var ONE_DAY = 60 * 60 * 24; | ||
| 352 | + var MIN_SPACE = 60; | ||
| 353 | + var search = function (e) { | ||
| 354 | + e.stopPropagation(); | ||
| 355 | + var data = f.serializeJSON(); | ||
| 356 | + | ||
| 357 | + //校验时间间隔 | ||
| 358 | + var fs = 'YYYY-MM-DDHH:mm'; | ||
| 359 | + var st = parseInt(moment(data.sDate + data.sTime, fs).format('X')); | ||
| 360 | + var et = parseInt(moment(data.eDate + data.eTime, fs).format('X')); | ||
| 361 | + | ||
| 362 | + if (et < st) | ||
| 363 | + notify_err('结束时间不能小于开始时间'); | ||
| 364 | + else if ((et - st) > ONE_DAY) | ||
| 365 | + notify_err('最大间隔24小时!'); | ||
| 366 | + else if ((et - st) < MIN_SPACE) | ||
| 367 | + notify_err('最小间隔1分钟!'); | ||
| 368 | + else { | ||
| 369 | + show_wait_modal('搜索数据...'); | ||
| 370 | + $.ajax({ | ||
| 371 | + url: '/gps/history_v2/' + data.nbbm, | ||
| 372 | + traditional: true, | ||
| 373 | + data: {st: st, et: et}, | ||
| 374 | + success: function (rs) { | ||
| 375 | + hide_wait_modal(); | ||
| 376 | + //重置相关对象 | ||
| 377 | + playObj.reset(); | ||
| 378 | + mapObj.reset(); | ||
| 379 | + | ||
| 380 | + gpsArray = rs.list; | ||
| 381 | + if (!gpsArray || gpsArray.length == 0) { | ||
| 382 | + notify_err('没有搜索到轨迹数据!'); | ||
| 383 | + return; | ||
| 384 | + } | ||
| 385 | + | ||
| 386 | + //排序 | ||
| 387 | + gpsArray.sort(function (a, b) { | ||
| 388 | + return parseInt((a.ts - b.ts) + '' + (a.stop_no - b.stop_no)); | ||
| 389 | + }); | ||
| 390 | + //行车轨迹 | ||
| 391 | + trailTableObj.showInitData(gpsArray); | ||
| 392 | + //到离站信息 | ||
| 393 | + inOutStationTableObj.showInitData(gpsArray); | ||
| 394 | + //异常信息 | ||
| 395 | + abnormalTableObj.showInitData(rs['outboundList'], rs['speedList']); | ||
| 396 | + //show 工具条 | ||
| 397 | + mapTools.show(rs); | ||
| 398 | + //地图 | ||
| 399 | + mapObj.initData(rs); | ||
| 400 | + //play 对象 | ||
| 401 | + playObj.init(rs); | ||
| 402 | + //设置导出文件名称 | ||
| 403 | + mapTools.setExcelName(); | ||
| 404 | + } | ||
| 405 | + }); | ||
| 406 | + } | ||
| 407 | + return false; | ||
| 408 | + }; | ||
| 409 | + | ||
| 410 | + //遮罩 | ||
| 411 | + var shade = $('.play_back_form_shade', modal); | ||
| 412 | + var showShade = function () { | ||
| 413 | + shade.show(); | ||
| 414 | + }; | ||
| 415 | + var hideShade = function () { | ||
| 416 | + shade.hide(); | ||
| 417 | + }; | ||
| 418 | + | ||
| 419 | + return { | ||
| 420 | + init: init, | ||
| 421 | + setNbbm: setNbbm, | ||
| 422 | + showShade: showShade, | ||
| 423 | + hideShade: hideShade | ||
| 424 | + }; | ||
| 425 | + })(); | ||
| 426 | + | ||
| 427 | + /** | ||
| 428 | + * 行车轨迹表格 | ||
| 429 | + */ | ||
| 430 | + var trailTableObj = (function () { | ||
| 431 | + | ||
| 432 | + var $tbody = $('.gps-road-info .ct_table_body', modal); | ||
| 433 | + var $wrap = $('.road_table_wrap', modal); | ||
| 434 | + var initFlag, gpsArray; | ||
| 435 | + var showInitData = function (list) { | ||
| 436 | + var array = []; | ||
| 437 | + for (var i = 0, gps; gps = list[i++];) { | ||
| 438 | + //格式化时间 | ||
| 439 | + gps.timeStr = moment(gps.timestamp).format('HH:mm.ss'); | ||
| 440 | + try { | ||
| 441 | + if (i > 0 && array[array.length - 1].road.road_CODE == gps.road.road_CODE) | ||
| 442 | + array.pop(); | ||
| 443 | + } | ||
| 444 | + catch (e) { | ||
| 445 | + } | ||
| 446 | + | ||
| 447 | + if (gps.road) | ||
| 448 | + array.push(gps); | ||
| 449 | + } | ||
| 450 | + | ||
| 451 | + var htmlStr = template('gps_road_info_cont_temp', {array: array}); | ||
| 452 | + $tbody.html(htmlStr); | ||
| 453 | + initFlag = true; | ||
| 454 | + gpsArray = list; | ||
| 455 | + }; | ||
| 456 | + | ||
| 457 | + var prev; | ||
| 458 | + var add = function (gps, i) { | ||
| 459 | + if(i == 0) | ||
| 460 | + return; | ||
| 461 | + if(initFlag){ | ||
| 462 | + //清理初始化的数据 | ||
| 463 | + $tbody.html(''); | ||
| 464 | + initFlag = false; | ||
| 465 | + } | ||
| 466 | + if (!gps.road) | ||
| 467 | + return; | ||
| 468 | + var code = gps.road.road_CODE; | ||
| 469 | + if (!prev || code != prev.road.road_CODE) { | ||
| 470 | + $tbody.append(template('gps_road_info_cont_temp', {array: [gps]})); | ||
| 471 | + } | ||
| 472 | + else{ | ||
| 473 | + var dds = $tbody.find('dl[data-code=' + code + ']').last().find('dd'); | ||
| 474 | + $(dds[0]).text(gps.timeStr); | ||
| 475 | + $(dds[1]).text(gps.speed); | ||
| 476 | + } | ||
| 477 | + prev = gps; | ||
| 478 | + $wrap.scrollTop($wrap[0].scrollHeight); | ||
| 479 | + }; | ||
| 480 | + | ||
| 481 | + return { | ||
| 482 | + showInitData: showInitData, | ||
| 483 | + add : add, | ||
| 484 | + gpsArray : function () { | ||
| 485 | + return gpsArray; | ||
| 486 | + } | ||
| 487 | + }; | ||
| 488 | + })(); | ||
| 489 | + | ||
| 490 | + /** | ||
| 491 | + * 到离站信息表格 | ||
| 492 | + * @type {{}} | ||
| 493 | + */ | ||
| 494 | + var inOutStationTableObj = (function () { | ||
| 495 | + | ||
| 496 | + var data, f, prev, initFlag; | ||
| 497 | + var $wrap = $('.inout_table_wrap', modal); | ||
| 498 | + var $tbody = $('.ct_table_body', $wrap); | ||
| 499 | + var showInitData = function (list) { | ||
| 500 | + clear(); | ||
| 501 | + data = []; | ||
| 502 | + $.each(list, function (i, gps) { | ||
| 503 | + prev = data[data.length - 1]; | ||
| 504 | + if (gps['inout_stop'] == -1) | ||
| 505 | + return true; | ||
| 506 | + if (gps['inout_stop'] == 0 && gps['inout_stop_info']) { | ||
| 507 | + //连续进站信号,取第一个 | ||
| 508 | + if(prev && prev['out_ts'] == null | ||
| 509 | + && prev['stopName'] == gps['inout_stop_info'].stopName){ | ||
| 510 | + return true; | ||
| 511 | + } | ||
| 512 | + data.push(createIn(gps)); | ||
| 513 | + } | ||
| 514 | + else if (gps['inout_stop'] == 1) { | ||
| 515 | + f = matchOut(prev, gps); | ||
| 516 | + if(f) | ||
| 517 | + data.push(f); | ||
| 518 | + } | ||
| 519 | + }); | ||
| 520 | + //格式化时间 | ||
| 521 | + $.each(data, function (i) { | ||
| 522 | + if (this.in_ts) | ||
| 523 | + this.in_time_str = moment(this.in_ts).format('HH:mm.ss'); | ||
| 524 | + if (this.out_ts) | ||
| 525 | + this.out_time_str = moment(this.out_ts).format('HH:mm.ss'); | ||
| 526 | + //id | ||
| 527 | + this.id = 'in_out_' + i; | ||
| 528 | + }); | ||
| 529 | + var htmlStr = template('multi_inout_info_cont_temp', {list: data}); | ||
| 530 | + $tbody.html(htmlStr); | ||
| 531 | + initFlag = true; | ||
| 532 | + len = data.length; | ||
| 533 | + }; | ||
| 534 | + | ||
| 535 | + var inoutIndex=0, len, item; | ||
| 536 | + var add = function (gps, i) { | ||
| 537 | + if(i == 0) | ||
| 538 | + return; | ||
| 539 | + if(initFlag) | ||
| 540 | + clear(); | ||
| 541 | + | ||
| 542 | + var $dl; | ||
| 543 | + for(j = inoutIndex; j < len; j++){ | ||
| 544 | + item = data[j]; | ||
| 545 | + $dl = $tbody.find('dl[data-id='+item.id+']'); | ||
| 546 | + if(gps.ts >= item.in_ts && $dl.length==0){ | ||
| 547 | + $tbody.append(template('inout_info_cont_temp', item)); | ||
| 548 | + inoutIndex = j; | ||
| 549 | + } | ||
| 550 | + | ||
| 551 | + if(gps.ts >= item.out_ts){ | ||
| 552 | + var dds = $dl.find('dd'); | ||
| 553 | + if($dl.length==0) | ||
| 554 | + $tbody.append(template('inout_info_cont_temp', item)); | ||
| 555 | + else | ||
| 556 | + $(dds[2]).text(item.out_time_str); | ||
| 557 | + inoutIndex = j; | ||
| 558 | + } | ||
| 559 | + else { | ||
| 560 | + break; | ||
| 561 | + } | ||
| 562 | + } | ||
| 563 | + $wrap.scrollTop($wrap[0].scrollHeight); | ||
| 564 | + }; | ||
| 565 | + | ||
| 566 | + var clear = function () { | ||
| 567 | + $tbody.html(''); | ||
| 568 | + initFlag = false; | ||
| 569 | + }; | ||
| 570 | + | ||
| 571 | + var createIn = function (gps) { | ||
| 572 | + var info = gps['inout_stop_info']; | ||
| 573 | + return {in_ts: info.ts, stopNo: info.stopNo, stopName: info.stopName} | ||
| 574 | + }; | ||
| 575 | + | ||
| 576 | + var matchOut = function (prevInfo, gps) { | ||
| 577 | + var oi = gps['inout_stop_info']; | ||
| 578 | + if(!oi) | ||
| 579 | + return; | ||
| 580 | + if(prevInfo && prevInfo.stopName == oi.stopName){ | ||
| 581 | + prevInfo['out_ts'] = oi.ts; | ||
| 582 | + return null; | ||
| 583 | + } | ||
| 584 | + else { | ||
| 585 | + return {out_ts: oi.ts,stopNo: oi.stopNo,stopName: oi.stopName} | ||
| 586 | + } | ||
| 587 | + }; | ||
| 588 | + | ||
| 589 | + return { | ||
| 590 | + showInitData: showInitData, | ||
| 591 | + add: add | ||
| 592 | + }; | ||
| 593 | + })(); | ||
| 594 | + | ||
| 595 | + /** | ||
| 596 | + * 异常信息表格 | ||
| 597 | + * @type {{showInitData}} | ||
| 598 | + */ | ||
| 599 | + var abnormalTableObj = (function () { | ||
| 600 | + | ||
| 601 | + var showInitData = function () { | ||
| 602 | + var array = []; | ||
| 603 | + for(var i = 0; i < arguments.length; i ++){ | ||
| 604 | + array = array.concat(arguments[i]); | ||
| 605 | + } | ||
| 606 | + //格式化时间 | ||
| 607 | + $.each(array, function () { | ||
| 608 | + if(this.st) | ||
| 609 | + this.st_str = moment(this.st).format('HH:mm.ss'); | ||
| 610 | + if(this.et) | ||
| 611 | + this.et_str = moment(this.et).format('HH:mm.ss'); | ||
| 612 | + }); | ||
| 613 | + | ||
| 614 | + //排序 | ||
| 615 | + array.sort(function (a, b) { | ||
| 616 | + return a.st - b.st; | ||
| 617 | + }); | ||
| 618 | + | ||
| 619 | + var htmlStr = template('abnormal_table_cont_temp', {array: array}); | ||
| 620 | + $('.abnormal_table .ct_table_body', modal).html(htmlStr); | ||
| 621 | + }; | ||
| 622 | + | ||
| 623 | + return { | ||
| 624 | + showInitData: showInitData | ||
| 625 | + } | ||
| 626 | + })(); | ||
| 627 | + | ||
| 628 | + /** | ||
| 629 | + * 工具条相关 | ||
| 630 | + */ | ||
| 631 | + var mapTools = (function () { | ||
| 632 | + | ||
| 633 | + $('.map-wrap-tools .play_btn', modal).on('click', function () { | ||
| 634 | + if($(this).hasClass('play')){ | ||
| 635 | + //暂停 | ||
| 636 | + $(this).removeClass('play'); | ||
| 637 | + playObj.pause(); | ||
| 638 | + searchForm.hideShade(); | ||
| 639 | + } | ||
| 640 | + else { | ||
| 641 | + //播放 | ||
| 642 | + $(this).addClass('play'); | ||
| 643 | + playObj.play(); | ||
| 644 | + playObj.fixedToCenter(); | ||
| 645 | + searchForm.showShade(); | ||
| 646 | + } | ||
| 647 | + }); | ||
| 648 | + | ||
| 649 | + //播放速度 | ||
| 650 | + $('.speed_form input[name=playSpeed]', modal).on('click', function () { | ||
| 651 | + playObj.setConf('playSpeed', $(this).val()); | ||
| 652 | + }); | ||
| 653 | + | ||
| 654 | + //空间数据 | ||
| 655 | + $('.buffer_area_form input[type=checkbox]', modal).on('click', function () { | ||
| 656 | + playObj.setConf($(this).attr('name'), $(this)[0].checked); | ||
| 657 | + mapObj.refreshOverlay(); | ||
| 658 | + }); | ||
| 659 | + | ||
| 660 | + //进度条 | ||
| 661 | + var step, $scale = $('.ct-progress-bar .scale', modal); | ||
| 662 | + var upProgressBar = function (i) { | ||
| 663 | + $scale.css('width', step * (i + 1)); | ||
| 664 | + }; | ||
| 665 | + | ||
| 666 | + //导出 | ||
| 667 | + $('.export-excel', modal).on('click', function () { | ||
| 668 | + var base64Str = gb_map_play_back.listToExcel(trailTableObj.gpsArray()); | ||
| 669 | + $(this).attr('href', base64Str); | ||
| 670 | + }); | ||
| 671 | + | ||
| 672 | + var setExcelName = function () { | ||
| 673 | + var f = $('.playBackForm', modal); | ||
| 674 | + var fileName = ($('[name=nbbm]', f).val() + '轨迹数据' + $('[name=sDate]', f).val() + $('[name=sTime]', f).val() + '至' + $('[name=eDate]', f).val() + $('[name=eTime]', f).val() + '.xls').replace(new RegExp(/-/g),'').replace(new RegExp(/:/g),''); | ||
| 675 | + $('.export-excel', modal).attr('download', fileName); | ||
| 676 | + }; | ||
| 677 | + | ||
| 678 | + var gpsArray; | ||
| 679 | + var show = function (rs) { | ||
| 680 | + $('.map-wrap-tools').show(); | ||
| 681 | + $('.map-container', modal).addClass('show_tools'); | ||
| 682 | + //总里程 | ||
| 683 | + $('.text-panel .sum_mileage', modal).text(rs.sumMileage); | ||
| 684 | + | ||
| 685 | + var size = rs.list.length; | ||
| 686 | + $('.text-panel .count_point', modal).text(size); | ||
| 687 | + step = $('.ct-progress-bar', modal).width() / size; | ||
| 688 | + | ||
| 689 | + //console.log('stepstep', step); | ||
| 690 | + }; | ||
| 691 | + | ||
| 692 | + return { | ||
| 693 | + show: show, | ||
| 694 | + upProgressBar: upProgressBar, | ||
| 695 | + setExcelName: setExcelName | ||
| 696 | + } | ||
| 697 | + })(); | ||
| 698 | + | ||
| 699 | + /** | ||
| 700 | + * 地图相关 | ||
| 701 | + */ | ||
| 702 | + var mapObj = (function () { | ||
| 703 | + var map; | ||
| 704 | + var initMap = function () { | ||
| 705 | + //初始化地图 | ||
| 706 | + map = new BMap.Map($('.map-container', modal)[0]); | ||
| 707 | + //中心点和缩放级别 | ||
| 708 | + map.centerAndZoom(new BMap.Point(gb_map_consts.center_point.lng, gb_map_consts.center_point.lat), 16); | ||
| 709 | + map.enableScrollWheelZoom(); | ||
| 710 | + } | ||
| 711 | + | ||
| 712 | + var storage = window.localStorage; | ||
| 713 | + var routes;//路段 | ||
| 714 | + var stations;//站点 | ||
| 715 | + var parks;//停车场 | ||
| 716 | + | ||
| 717 | + var initData = function (rs) { | ||
| 718 | + var gpsArray = rs.list; | ||
| 719 | + if(!gpsArray || gpsArray.length==0) | ||
| 720 | + return; | ||
| 721 | + var lineCode = gpsArray[0].lineId; | ||
| 722 | + //从地图模块获取站点数据 | ||
| 723 | + stations = gb_map_spatial_data.getStationArray(lineCode); | ||
| 724 | + //从地图模块获取停车场数据 | ||
| 725 | + parks = gb_map_spatial_data.carparkArray(); | ||
| 726 | + //从localStorage 获取路段 | ||
| 727 | + routes = JSON.parse(storage.getItem(lineCode + '_route')); | ||
| 728 | + routes = [routes.up_bd, routes.down_bd]; | ||
| 729 | + }; | ||
| 730 | + | ||
| 731 | + | ||
| 732 | + /** | ||
| 733 | + * 更新车辆位置 | ||
| 734 | + */ | ||
| 735 | + var gpsMarker; | ||
| 736 | + var updateCar = function (gps) { | ||
| 737 | + if(!gpsMarker){ | ||
| 738 | + gpsMarker = new BMap.Marker(new BMap.Point(gps.bd_lon, gps.bd_lat)); | ||
| 739 | + var width = gb_map_imap.calcGpsMarkerWidth(gps.nbbm); | ||
| 740 | + gpsMarker.setIcon(new BMap.Icon(gb_map_imap.createCarIconRotation(gps, width), new BMap.Size(width, 75))); | ||
| 741 | + gpsMarker.disableMassClear();//禁止marker被清除 | ||
| 742 | + gpsMarker.setTop(true); | ||
| 743 | + map.addOverlay(gpsMarker); | ||
| 744 | + //居中 | ||
| 745 | + map.panTo(gpsMarker.getPosition()); | ||
| 746 | + } | ||
| 747 | + else{ | ||
| 748 | + gpsMarker.setPosition(new BMap.Point(gps.bd_lon, gps.bd_lat)); | ||
| 749 | + var width = gb_map_imap.calcGpsMarkerWidth(gps.nbbm); | ||
| 750 | + gpsMarker.setIcon(new BMap.Icon(gb_map_imap.createCarIconRotation(gps, width), new BMap.Size(width, 75))); | ||
| 751 | + } | ||
| 752 | + | ||
| 753 | + //更新路段底图 | ||
| 754 | + if(gps.upDown!=roadUpdown){ | ||
| 755 | + switchPolyline(gps.upDown); | ||
| 756 | + //清除轨迹线 | ||
| 757 | + trailArray = []; | ||
| 758 | + } | ||
| 759 | + }; | ||
| 760 | + | ||
| 761 | + /** | ||
| 762 | + * 绘制轨迹线 | ||
| 763 | + */ | ||
| 764 | + var trailArray=[], trailPolyline; | ||
| 765 | + var updateTrailLine = function () { | ||
| 766 | + trailArray.push(gpsMarker.getPosition()); | ||
| 767 | + if(!trailPolyline){ | ||
| 768 | + trailPolyline = new BMap.Polyline(trailArray, {strokeWeight: 3, strokeColor: '#000000'}); | ||
| 769 | + trailPolyline.disableMassClear();//禁止trailPolyline被清除 | ||
| 770 | + map.addOverlay(trailPolyline); | ||
| 771 | + } | ||
| 772 | + else{ | ||
| 773 | + trailPolyline.setPath(trailArray); | ||
| 774 | + } | ||
| 775 | + }; | ||
| 776 | + | ||
| 777 | + /** | ||
| 778 | + * 绘制路段底图(包括站点) | ||
| 779 | + */ | ||
| 780 | + var roadUpdown=-1; | ||
| 781 | + var switchPolyline = function (upDown) { | ||
| 782 | + if(typeof(upDown) == "undefined") | ||
| 783 | + upDown = roadUpdown; | ||
| 784 | + | ||
| 785 | + map.clearOverlays(); | ||
| 786 | + //路段 | ||
| 787 | + drawRoadPolyline(upDown); | ||
| 788 | + //站点 | ||
| 789 | + if(playObj.getConf().drawPoint) | ||
| 790 | + drawStationPoint(upDown); | ||
| 791 | + //缓冲区 | ||
| 792 | + if(playObj.getConf().drawBuffArea) | ||
| 793 | + drawStationBfArea(upDown); | ||
| 794 | + //站点名称 | ||
| 795 | + if(playObj.getConf().stationName) | ||
| 796 | + drawStationName(upDown); | ||
| 797 | + roadUpdown = upDown; | ||
| 798 | + }; | ||
| 799 | + | ||
| 800 | + /** | ||
| 801 | + * 根据走向绘制路段 | ||
| 802 | + */ | ||
| 803 | + var drawRoadPolyline = function (upDown) { | ||
| 804 | + var colour = gb_map_config.getConfig().section.color; | ||
| 805 | + var plConfig = {strokeWeight: 12, strokeColor: upDown?colour.down:colour.up, strokeOpacity: .4}, pos; | ||
| 806 | + $.each(routes[upDown], function (i, item) { | ||
| 807 | + pos = []; | ||
| 808 | + $.each(item.split(','), function () { | ||
| 809 | + temps = this.split(' '); | ||
| 810 | + pos.push(new BMap.Point(temps[0], temps[1])); | ||
| 811 | + }); | ||
| 812 | + map.addOverlay(new BMap.Polyline(pos, plConfig)); | ||
| 813 | + }); | ||
| 814 | + }; | ||
| 815 | + | ||
| 816 | + /** | ||
| 817 | + * 根据走向绘制站点点位 | ||
| 818 | + */ | ||
| 819 | + var drawStationPoint = function (upDown) { | ||
| 820 | + var array = stations[upDown], psm; | ||
| 821 | + $.each(array, function () { | ||
| 822 | + //坐标转换 | ||
| 823 | + var coord = TransGPS.wgsToBD(this.lat, this.lon); | ||
| 824 | + this.bd_lat = coord.lat; | ||
| 825 | + this.bd_lon = coord.lng; | ||
| 826 | + psm = new BMap.Marker(new BMap.Point(this.bd_lon, this.bd_lat)); | ||
| 827 | + psm.setTitle(this.stationName); | ||
| 828 | + map.addOverlay(psm); | ||
| 829 | + psm.setIcon(new BMap.Icon(gb_map_imap.createStationPointIcon(), new BMap.Size(12, 12))); | ||
| 830 | + }); | ||
| 831 | + }; | ||
| 832 | + | ||
| 833 | + /** | ||
| 834 | + * 为站点绘制缓冲区 | ||
| 835 | + */ | ||
| 836 | + var drawStationBfArea = function (upDown) { | ||
| 837 | + var array = stations[upDown]; | ||
| 838 | + $.each(array, function () { | ||
| 839 | + if(this.shapesType=='r') | ||
| 840 | + drawCircle(new BMap.Point(this.bd_lon, this.bd_lat), this.radius); | ||
| 841 | + else if(this.shapesType=='d') | ||
| 842 | + drawPolygon(this); | ||
| 843 | + }); | ||
| 844 | + }; | ||
| 845 | + | ||
| 846 | + /** | ||
| 847 | + * 绘制站点名称 | ||
| 848 | + */ | ||
| 849 | + var drawStationName = function (upDown) { | ||
| 850 | + var style = {backgroundColor: "rgba(255, 255, 255, 0.69)",color : "black", borderColor: "black", fontSize : "12px", height : "16px", lineHeight : "16px", fontFamily:"微软雅黑"} | ||
| 851 | + var array = stations[upDown]; | ||
| 852 | + $.each(array, function () { | ||
| 853 | + var width = this.stationName.length * 12; | ||
| 854 | + var label = new BMap.Label(this.stationName, { | ||
| 855 | + position:new BMap.Point(this.bd_lon, this.bd_lat), | ||
| 856 | + offset: new BMap.Size(-(width / 2), -27) | ||
| 857 | + }); | ||
| 858 | + label.setStyle(style); | ||
| 859 | + map.addOverlay(label); | ||
| 860 | + }); | ||
| 861 | + }; | ||
| 862 | + var drawCircle = function (point, radius) { | ||
| 863 | + var circle = new BMap.Circle(point, radius); | ||
| 864 | + circle.setStrokeColor('#000000'); | ||
| 865 | + circle.setStrokeWeight(1); | ||
| 866 | + map.addOverlay(circle); | ||
| 867 | + }; | ||
| 868 | + | ||
| 869 | + var drawPolygon = function () { | ||
| 870 | + | ||
| 871 | + }; | ||
| 872 | + | ||
| 873 | + /** | ||
| 874 | + * 重置 | ||
| 875 | + */ | ||
| 876 | + var reset = function () { | ||
| 877 | + if(trailPolyline) | ||
| 878 | + trailPolyline.enableMassClear(); | ||
| 879 | + if(gpsMarker) | ||
| 880 | + gpsMarker.enableMassClear(); | ||
| 881 | + map.clearOverlays(); | ||
| 882 | + roadUpdown = -1; | ||
| 883 | + trailArray=[]; | ||
| 884 | + trailPolyline = null; | ||
| 885 | + gpsMarker = null; | ||
| 886 | + }; | ||
| 887 | + | ||
| 888 | + /** | ||
| 889 | + * 居中车辆,超出边界时 | ||
| 890 | + */ | ||
| 891 | + var toCenterByBounds = function () { | ||
| 892 | + var markerIsVisible = BMapLib.GeoUtils.isPointInRect(gpsMarker.getPosition(),map.getBounds()); | ||
| 893 | + if(!markerIsVisible) | ||
| 894 | + map.panTo(gpsMarker.getPosition()); | ||
| 895 | + }; | ||
| 896 | + return { | ||
| 897 | + initData: initData, | ||
| 898 | + updateCar: updateCar, | ||
| 899 | + initMap: initMap, | ||
| 900 | + updateTrailLine: updateTrailLine, | ||
| 901 | + refreshOverlay: switchPolyline, | ||
| 902 | + toCenterByBounds: toCenterByBounds, | ||
| 903 | + reset: reset | ||
| 904 | + } | ||
| 905 | + })(); | ||
| 906 | + | ||
| 907 | + /** | ||
| 908 | + * 播放相关 | ||
| 909 | + * @type {{}} | ||
| 910 | + */ | ||
| 911 | + var playObj = (function () { | ||
| 912 | + var conf = { | ||
| 913 | + playSpeed: 1,//播放速度 | ||
| 914 | + drawPoint: 1,//绘制站点 | ||
| 915 | + drawBuffArea: 1 ,//缓冲区 | ||
| 916 | + stationName: 0, //站点名称 | ||
| 917 | + carPark: [] //停车场 | ||
| 918 | + }; | ||
| 919 | + | ||
| 920 | + var gpsArray;//gps点位集合 | ||
| 921 | + var init = function (rs) { | ||
| 922 | + gpsArray = rs.list; | ||
| 923 | + if(!gpsArray || gpsArray.length==0) | ||
| 924 | + return; | ||
| 925 | + | ||
| 926 | + len = gpsArray.length; | ||
| 927 | + //渲染配置信息 | ||
| 928 | + renderConfig(); | ||
| 929 | + //播放第一个点 | ||
| 930 | + run(); | ||
| 931 | + }; | ||
| 932 | + | ||
| 933 | + var renderConfig = function () { | ||
| 934 | + $('.speed_form [name=playSpeed][value='+conf.playSpeed+']', modal)[0].checked = true; | ||
| 935 | + $('.buffer_area_form input[type=checkbox]', modal).each(function () { | ||
| 936 | + var name = $(this).attr('name'); | ||
| 937 | + $(this)[0].checked = conf[name]; | ||
| 938 | + }); | ||
| 939 | + }; | ||
| 940 | + | ||
| 941 | + /** | ||
| 942 | + * 播放函数 | ||
| 943 | + */ | ||
| 944 | + var runTimer; //播放定时器 | ||
| 945 | + var toCenterTimer;//居中定时器 | ||
| 946 | + var index = 0; //gps下标 | ||
| 947 | + var play = function () { | ||
| 948 | + if(!run()) | ||
| 949 | + runTimer = setTimeout(play, 1000 / conf.playSpeed); | ||
| 950 | + }; | ||
| 951 | + | ||
| 952 | + /** | ||
| 953 | + * 定时居中 | ||
| 954 | + */ | ||
| 955 | + var fixedToCenter = function () { | ||
| 956 | + toCenterTimer = setInterval(function () { | ||
| 957 | + mapObj.toCenterByBounds(); | ||
| 958 | + }, 500); | ||
| 959 | + }; | ||
| 960 | + | ||
| 961 | + var pause = function () { | ||
| 962 | + clearInterval(runTimer); | ||
| 963 | + runTimer = null; | ||
| 964 | + clearInterval(toCenterTimer); | ||
| 965 | + toCenterTimer = null; | ||
| 966 | + }; | ||
| 967 | + | ||
| 968 | + var clock = $('.ct_btn.clock', modal), gps, len; | ||
| 969 | + var run = function () { | ||
| 970 | + if(index == len){ | ||
| 971 | + $('.map-wrap-tools .play_btn', modal).removeClass('play'); | ||
| 972 | + pause(); | ||
| 973 | + notify_succ('本次轨迹回放已结束!'); | ||
| 974 | + searchForm.hideShade(); | ||
| 975 | + return true; | ||
| 976 | + } | ||
| 977 | + gps = gpsArray[index]; | ||
| 978 | + //更新GPS点位 | ||
| 979 | + mapObj.updateCar(gps); | ||
| 980 | + //绘制轨迹线 | ||
| 981 | + mapObj.updateTrailLine(); | ||
| 982 | + //时间文本 | ||
| 983 | + clock.text(gps.timeStr); | ||
| 984 | + //输出行车轨迹 | ||
| 985 | + trailTableObj.add(gps, index); | ||
| 986 | + //输出到离站信息 | ||
| 987 | + inOutStationTableObj.add(gps, index); | ||
| 988 | + //进度条 | ||
| 989 | + mapTools.upProgressBar(index); | ||
| 990 | + index ++; | ||
| 991 | + }; | ||
| 992 | + | ||
| 993 | + /** | ||
| 994 | + * 重置 | ||
| 995 | + */ | ||
| 996 | + var reset = function () { | ||
| 997 | + index = 0; | ||
| 998 | + gpsArray = null; | ||
| 999 | + pause(); | ||
| 1000 | + }; | ||
| 1001 | + return { | ||
| 1002 | + init: init, | ||
| 1003 | + getConf: function () { | ||
| 1004 | + return conf; | ||
| 1005 | + }, | ||
| 1006 | + setConf: function (k, v) { | ||
| 1007 | + conf[k] = v; | ||
| 1008 | + }, | ||
| 1009 | + play: play, | ||
| 1010 | + fixedToCenter: fixedToCenter, | ||
| 1011 | + pause: pause, | ||
| 1012 | + reset: reset | ||
| 1013 | + } | ||
| 1014 | + })(); | ||
| 1015 | + })(); | ||
| 1016 | + </script> | ||
| 541 | </div> | 1017 | </div> |
| 542 | \ No newline at end of file | 1018 | \ No newline at end of file |
src/main/resources/static/real_control_v2/mapmonitor/js/gps_tree.js
| @@ -203,7 +203,6 @@ var gb_map_gps_tree = (function () { | @@ -203,7 +203,6 @@ var gb_map_gps_tree = (function () { | ||
| 203 | if(this.nbbm.indexOf(v) != -1){ | 203 | if(this.nbbm.indexOf(v) != -1){ |
| 204 | rs.push({ | 204 | rs.push({ |
| 205 | value: this.nbbm, | 205 | value: this.nbbm, |
| 206 | - lineName: '青浦1路', | ||
| 207 | stationName: this.stationName?this.stationName:'', | 206 | stationName: this.stationName?this.stationName:'', |
| 208 | dateStr: this.dateStr | 207 | dateStr: this.dateStr |
| 209 | }); | 208 | }); |
src/main/resources/static/real_control_v2/mapmonitor/js/map/iMap.js
| @@ -34,6 +34,7 @@ var gb_map_imap = (function () { | @@ -34,6 +34,7 @@ var gb_map_imap = (function () { | ||
| 34 | busIcon: '/real_control_v2/assets/imgs/bus1-R.png', | 34 | busIcon: '/real_control_v2/assets/imgs/bus1-R.png', |
| 35 | _color: color, | 35 | _color: color, |
| 36 | createCarIconRotation: createCarIconRotation, | 36 | createCarIconRotation: createCarIconRotation, |
| 37 | + createStationPointIcon: createStationPointIcon, | ||
| 37 | createStationIcon: createStationIcon, | 38 | createStationIcon: createStationIcon, |
| 38 | call: function (f, opts) { | 39 | call: function (f, opts) { |
| 39 | var instance = maps[currentMap].instance; | 40 | var instance = maps[currentMap].instance; |
| @@ -86,7 +87,7 @@ var gb_map_imap = (function () { | @@ -86,7 +87,7 @@ var gb_map_imap = (function () { | ||
| 86 | 87 | ||
| 87 | 88 | ||
| 88 | //绘制车辆icon 带角度标示 | 89 | //绘制车辆icon 带角度标示 |
| 89 | - function createCarIconRotation(gps, w) { | 90 | +/* function createCarIconRotation(gps, w) { |
| 90 | if (!w) | 91 | if (!w) |
| 91 | w = 70; | 92 | w = 70; |
| 92 | 93 | ||
| @@ -119,6 +120,81 @@ var gb_map_imap = (function () { | @@ -119,6 +120,81 @@ var gb_map_imap = (function () { | ||
| 119 | ctx.restore(); | 120 | ctx.restore(); |
| 120 | 121 | ||
| 121 | return canvas.toDataURL(); | 122 | return canvas.toDataURL(); |
| 123 | + }*/ | ||
| 124 | + | ||
| 125 | + function createCarIconRotation(gps, w) { | ||
| 126 | + if (!w) | ||
| 127 | + w = 70; | ||
| 128 | + | ||
| 129 | + var canvas = $('<canvas></canvas>')[0]; | ||
| 130 | + canvas.width = w; | ||
| 131 | + canvas.height = 64; | ||
| 132 | + var ctx = canvas.getContext('2d'); | ||
| 133 | + | ||
| 134 | + var colours = color(gps); | ||
| 135 | + | ||
| 136 | + ctx.roundRect(0, 0, w, 19, 4).stroke(); | ||
| 137 | + ctx.fillStyle = colours.bgColor; | ||
| 138 | + ctx.fill(); | ||
| 139 | + //文字 | ||
| 140 | + ctx.font = "14px arial"; | ||
| 141 | + ctx.fillStyle = "#fff"; | ||
| 142 | + ctx.fillText(gps.nbbm, 2, 14); | ||
| 143 | + | ||
| 144 | + //角度图标 | ||
| 145 | + //var img = new Image(); | ||
| 146 | + //img.src = rotationIcon(colours.bgColor); | ||
| 147 | + ctx.save(); | ||
| 148 | + ctx.translate(canvas.width / 2, canvas.height / 2); | ||
| 149 | + ctx.rotate(gps.direction * Math.PI / 180); | ||
| 150 | + //ctx.drawImage(img, -img.width / 2, -img.width / 2); | ||
| 151 | + /** | ||
| 152 | + * 绘制角度图标 | ||
| 153 | + */ | ||
| 154 | + ctx.beginPath(); | ||
| 155 | + ctx.strokeStyle = colours.bgColor; | ||
| 156 | + var circle = { | ||
| 157 | + x: 0, //圆心的x轴坐标值 | ||
| 158 | + y: 0, //圆心的y轴坐标值 | ||
| 159 | + r: 12 //圆的半径 | ||
| 160 | + }; | ||
| 161 | + var d = 12.5; | ||
| 162 | + //绘制圆形 | ||
| 163 | + ctx.arc(circle.x, circle.y, circle.r, 0, Math.PI * 2, true); | ||
| 164 | + //按照指定的路径绘制弧线 | ||
| 165 | + ctx.stroke(); | ||
| 166 | + ctx.fillStyle = "#ffffff"; | ||
| 167 | + ctx.fill(); | ||
| 168 | + //下方矩形 | ||
| 169 | + ctx.beginPath(); | ||
| 170 | + ctx.fillStyle = colours.bgColor; | ||
| 171 | + ctx.fillRect(5 - d, 16 - d, 15, 4); | ||
| 172 | + ctx.rect(5 - d, 11 - d, 7.5, 8); | ||
| 173 | + ctx.rect(12.5 - d, 11 - d, 7.5, 8); | ||
| 174 | + ctx.strokeStyle = colours.bgColor; | ||
| 175 | + ctx.stroke(); | ||
| 176 | + //上方三角形 | ||
| 177 | + ctx.beginPath(); | ||
| 178 | + ctx.fillStyle = "#111111"; | ||
| 179 | + ctx.moveTo(12.5 - d, 3 - d); | ||
| 180 | + ctx.lineTo(6.5 - d, 7.5 - d); | ||
| 181 | + ctx.lineTo(18.5 - d, 7.5 - d); | ||
| 182 | + ctx.closePath(); | ||
| 183 | + ctx.fill(); | ||
| 184 | + | ||
| 185 | + ctx.restore(); | ||
| 186 | + return canvas.toDataURL(); | ||
| 187 | + } | ||
| 188 | + | ||
| 189 | + //绘制站点点位icon | ||
| 190 | + function createStationPointIcon() { | ||
| 191 | + var canvas = $('<canvas></canvas>')[0]; | ||
| 192 | + var ctx = canvas.getContext('2d'); | ||
| 193 | + ctx.beginPath(); | ||
| 194 | + ctx.arc(6,6,6,0,2*Math.PI); | ||
| 195 | + ctx.fillStyle = '#000000'; | ||
| 196 | + ctx.fill(); | ||
| 197 | + return canvas.toDataURL(); | ||
| 122 | } | 198 | } |
| 123 | 199 | ||
| 124 | 200 | ||
| @@ -136,7 +212,7 @@ var gb_map_imap = (function () { | @@ -136,7 +212,7 @@ var gb_map_imap = (function () { | ||
| 136 | y: 12.5, //圆心的y轴坐标值 | 212 | y: 12.5, //圆心的y轴坐标值 |
| 137 | r: 12 //圆的半径 | 213 | r: 12 //圆的半径 |
| 138 | }; | 214 | }; |
| 139 | - //以canvas中的坐标点(100,100)为圆心,绘制一个半径为50px的圆形 | 215 | + //绘制圆形 |
| 140 | ctx.arc(circle.x, circle.y, circle.r, 0, Math.PI * 2, true); | 216 | ctx.arc(circle.x, circle.y, circle.r, 0, Math.PI * 2, true); |
| 141 | //按照指定的路径绘制弧线 | 217 | //按照指定的路径绘制弧线 |
| 142 | ctx.stroke(); | 218 | ctx.stroke(); |
src/main/resources/static/real_control_v2/mapmonitor/js/playback.js
| @@ -3,7 +3,7 @@ | @@ -3,7 +3,7 @@ | ||
| 3 | var gb_map_play_back = (function () { | 3 | var gb_map_play_back = (function () { |
| 4 | 4 | ||
| 5 | var dom; | 5 | var dom; |
| 6 | - $.get('/real_control_v2/mapmonitor/fragments/playback/main.html', function (rs) { | 6 | + $.get('/real_control_v2/mapmonitor/fragments/playback_v2/main.html', function (rs) { |
| 7 | dom = rs; | 7 | dom = rs; |
| 8 | }); | 8 | }); |
| 9 | 9 | ||
| @@ -13,10 +13,11 @@ var gb_map_play_back = (function () { | @@ -13,10 +13,11 @@ var gb_map_play_back = (function () { | ||
| 13 | gb_map_imap.call('closeWin', deviceId); | 13 | gb_map_imap.call('closeWin', deviceId); |
| 14 | 14 | ||
| 15 | //show modal | 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}); | 16 | + open_modal_dom(dom, {deviceId: deviceId, nbbm: nbbm}); |
| 17 | + //var modal = '#map-playback2-modal'; | ||
| 18 | + //$(document.body).append(dom); | ||
| 19 | + //UIkit.modal(modal, {bgclose: false}).show(); | ||
| 20 | + //$(modal).trigger('show_form', {deviceId: deviceId, nbbm: nbbm}); | ||
| 20 | }; | 21 | }; |
| 21 | 22 | ||
| 22 | //导出excel | 23 | //导出excel |
| @@ -28,7 +29,7 @@ var gb_map_play_back = (function () { | @@ -28,7 +29,7 @@ var gb_map_play_back = (function () { | ||
| 28 | ' <table border="1">' + | 29 | ' <table border="1">' + |
| 29 | ' <tr><th>序号</th><th>车辆</th><th>所在道路</th><th>经度</th><th>纬度</th><th>时间</th><th>速度</th></tr>' + | 30 | ' <tr><th>序号</th><th>车辆</th><th>所在道路</th><th>经度</th><th>纬度</th><th>时间</th><th>速度</th></tr>' + |
| 30 | ' {{each list as gps i}}' + | 31 | ' {{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 | + ' <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.timeStr}}</td><td>{{gps.speed}}</td></tr>' + |
| 32 | ' {{/each}}' + | 33 | ' {{/each}}' + |
| 33 | ' </table>' + | 34 | ' </table>' + |
| 34 | ' </body>' + | 35 | ' </body>' + |
src/main/resources/static/real_control_v2/mapmonitor/js/spatial_data.js
| @@ -328,6 +328,12 @@ var gb_map_spatial_data = (function () { | @@ -328,6 +328,12 @@ var gb_map_spatial_data = (function () { | ||
| 328 | refresh: refresh, | 328 | refresh: refresh, |
| 329 | init: init, | 329 | init: init, |
| 330 | getCheckedStation:getCheckedStation, | 330 | getCheckedStation:getCheckedStation, |
| 331 | - gteCheckedCarpark: gteCheckedCarpark | 331 | + gteCheckedCarpark: gteCheckedCarpark, |
| 332 | + getStationArray: function (lineCode) { | ||
| 333 | + return lineStationArr[lineCode]; | ||
| 334 | + }, | ||
| 335 | + carparkArray: function () { | ||
| 336 | + return carparkArr; | ||
| 337 | + } | ||
| 332 | }; | 338 | }; |
| 333 | })(); | 339 | })(); |
| 334 | \ No newline at end of file | 340 | \ No newline at end of file |
src/main/resources/static/real_control_v2/mapmonitor/real.html
| @@ -51,14 +51,14 @@ | @@ -51,14 +51,14 @@ | ||
| 51 | </div> | 51 | </div> |
| 52 | 52 | ||
| 53 | <script src="/real_control_v2/assets/js/GeoUtils_min.js"></script> | 53 | <script src="/real_control_v2/assets/js/GeoUtils_min.js"></script> |
| 54 | -<script src="/real_control_v2/mapmonitor/js/config.js"></script> | ||
| 55 | -<script src="/real_control_v2/mapmonitor/js/gps_tree.js"></script> | ||
| 56 | -<script src="/real_control_v2/mapmonitor/js/spatial_data.js"></script> | ||
| 57 | -<script src="/real_control_v2/mapmonitor/js/map_overlay_manager.js"></script> | ||
| 58 | -<script src="/real_control_v2/mapmonitor/js/real.js"></script> | ||
| 59 | -<script src="/real_control_v2/mapmonitor/js/map/iMap.js"></script> | ||
| 60 | -<script src="/real_control_v2/mapmonitor/js/map/platform/baidu.js"></script> | ||
| 61 | -<script src="/real_control_v2/mapmonitor/js/map/platform/gaode.js"></script> | 54 | +<script src="/real_control_v2/mapmonitor/js/config.js" merge="custom_map_js"></script> |
| 55 | +<script src="/real_control_v2/mapmonitor/js/gps_tree.js" merge="custom_map_js"></script> | ||
| 56 | +<script src="/real_control_v2/mapmonitor/js/spatial_data.js" merge="custom_map_js"></script> | ||
| 57 | +<script src="/real_control_v2/mapmonitor/js/map_overlay_manager.js" merge="custom_map_js"></script> | ||
| 58 | +<script src="/real_control_v2/mapmonitor/js/real.js" merge="custom_map_js"></script> | ||
| 59 | +<script src="/real_control_v2/mapmonitor/js/map/iMap.js" merge="custom_map_js"></script> | ||
| 60 | +<script src="/real_control_v2/mapmonitor/js/map/platform/baidu.js" merge="custom_map_js"></script> | ||
| 61 | +<script src="/real_control_v2/mapmonitor/js/map/platform/gaode.js" merge="custom_map_js"></script> | ||
| 62 | <!-- jquery ui --> | 62 | <!-- jquery ui --> |
| 63 | <script src="/real_control_v2/assets/plugins/jquery.ui/core.js"></script> | 63 | <script src="/real_control_v2/assets/plugins/jquery.ui/core.js"></script> |
| 64 | <script src="/real_control_v2/assets/plugins/jquery.ui/widget.js"></script> | 64 | <script src="/real_control_v2/assets/plugins/jquery.ui/widget.js"></script> |
| @@ -67,4 +67,4 @@ | @@ -67,4 +67,4 @@ | ||
| 67 | <!-- 颜色选择器 --> | 67 | <!-- 颜色选择器 --> |
| 68 | <script src="/real_control_v2/assets/plugins/spectrum/spectrum.js"></script> | 68 | <script src="/real_control_v2/assets/plugins/spectrum/spectrum.js"></script> |
| 69 | <!-- play back --> | 69 | <!-- play back --> |
| 70 | -<script src="/real_control_v2/mapmonitor/js/playback.js"></script> | ||
| 71 | \ No newline at end of file | 70 | \ No newline at end of file |
| 71 | +<script src="/real_control_v2/mapmonitor/js/playback.js" merge="custom_map_js"></script> | ||
| 72 | \ No newline at end of file | 72 | \ No newline at end of file |
src/test/java/com/bsth/service/schedule/BaseTest.java
0 → 100644
| 1 | +package com.bsth.service.schedule; | ||
| 2 | + | ||
| 3 | +import org.junit.runner.RunWith; | ||
| 4 | +import org.springframework.boot.test.SpringApplicationConfiguration; | ||
| 5 | +import org.springframework.test.context.ActiveProfiles; | ||
| 6 | +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; | ||
| 7 | + | ||
| 8 | +/** | ||
| 9 | + * 基础测试类。 | ||
| 10 | + */ | ||
| 11 | +@RunWith(SpringJUnit4ClassRunner.class) | ||
| 12 | +@SpringApplicationConfiguration(classes = ScheduleTestApp.class) | ||
| 13 | +@ActiveProfiles("scheduletest") | ||
| 14 | +//@WebIntegrationTest({"server.port=0","management.port=0"}) | ||
| 15 | +public class BaseTest { | ||
| 16 | +} |
src/test/java/com/bsth/service/schedule/ScheduleTestApp.java
0 → 100644
| 1 | +package com.bsth.service.schedule; | ||
| 2 | + | ||
| 3 | +import com.bsth.service.schedule.impl.SchedulePlanRuleResultServiceImpl; | ||
| 4 | +import com.bsth.service.schedule.impl.SchedulePlanServiceImpl; | ||
| 5 | +import com.bsth.service.schedule.rules.MyDroolsConfiguration; | ||
| 6 | +import com.bsth.service.schedule.utils.DataToolsServiceImpl; | ||
| 7 | +import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
| 8 | +import org.springframework.boot.orm.jpa.EntityScan; | ||
| 9 | +import org.springframework.context.annotation.ComponentScan; | ||
| 10 | +import org.springframework.context.annotation.Configuration; | ||
| 11 | +import org.springframework.context.annotation.FilterType; | ||
| 12 | +import org.springframework.data.jpa.repository.config.EnableJpaRepositories; | ||
| 13 | + | ||
| 14 | +/** | ||
| 15 | + * 基础测试类(用于计划调度模块测试测试)。 | ||
| 16 | + * 配置计划调度的模块的用到的entity,repository,service | ||
| 17 | + * | ||
| 18 | + * 注意:测试环境下测试类 TestApp 和springdata的类不在统一级包里,必须指定EnableJpaRepositories | ||
| 19 | + */ | ||
| 20 | +@Configuration | ||
| 21 | +@EntityScan( | ||
| 22 | + basePackages = {"com.bsth.entity"} | ||
| 23 | +) | ||
| 24 | +@ComponentScan( | ||
| 25 | + basePackages = {"com.bsth.repository", "com.bsth.service"}, | ||
| 26 | + useDefaultFilters = false, | ||
| 27 | + includeFilters = { | ||
| 28 | + @ComponentScan.Filter( | ||
| 29 | + type = FilterType.ASSIGNABLE_TYPE, | ||
| 30 | + value = SchedulePlanRuleResultServiceImpl.class | ||
| 31 | + ), | ||
| 32 | + @ComponentScan.Filter( | ||
| 33 | + type = FilterType.ASSIGNABLE_TYPE, | ||
| 34 | + value = SchedulePlanServiceImpl.class | ||
| 35 | + ), | ||
| 36 | + @ComponentScan.Filter( | ||
| 37 | + type = FilterType.ASSIGNABLE_TYPE, | ||
| 38 | + value = MyDroolsConfiguration.class | ||
| 39 | + ), | ||
| 40 | + @ComponentScan.Filter( | ||
| 41 | + type = FilterType.ASSIGNABLE_TYPE, | ||
| 42 | + value = DataToolsServiceImpl.class | ||
| 43 | + ) | ||
| 44 | + } | ||
| 45 | +) | ||
| 46 | +@EnableJpaRepositories( | ||
| 47 | + basePackages = {"com.bsth.repository"} | ||
| 48 | +) | ||
| 49 | +@SpringBootApplication | ||
| 50 | +public class ScheduleTestApp { | ||
| 51 | +} |
src/test/java/com/bsth/service/schedule/rules/DroolsRulesTest.java deleted
100644 → 0
| 1 | -package com.bsth.service.schedule.rules; | ||
| 2 | - | ||
| 3 | -import com.bsth.Application; | ||
| 4 | -import com.bsth.service.schedule.rules.shiftloop.ScheduleCalcuParam_input; | ||
| 5 | -import com.bsth.service.schedule.rules.shiftloop.ScheduleResults_output; | ||
| 6 | -import com.bsth.service.schedule.rules.shiftloop.ScheduleRule_input; | ||
| 7 | -import com.bsth.service.schedule.rules.ttinfo.TTInfoCalcuParam_input; | ||
| 8 | -import com.bsth.service.schedule.rules.ttinfo.TTInfoResults_output; | ||
| 9 | -import com.bsth.service.schedule.rules.ttinfo.TTInfo_input; | ||
| 10 | -import org.joda.time.DateTime; | ||
| 11 | -import org.junit.Test; | ||
| 12 | -import org.junit.runner.RunWith; | ||
| 13 | -import org.kie.api.KieBase; | ||
| 14 | -import org.kie.api.runtime.KieSession; | ||
| 15 | -import org.slf4j.Logger; | ||
| 16 | -import org.slf4j.LoggerFactory; | ||
| 17 | -import org.springframework.beans.factory.annotation.Autowired; | ||
| 18 | -import org.springframework.boot.test.SpringApplicationConfiguration; | ||
| 19 | -import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; | ||
| 20 | - | ||
| 21 | -import java.util.Arrays; | ||
| 22 | - | ||
| 23 | -@RunWith(SpringJUnit4ClassRunner.class) | ||
| 24 | -@SpringApplicationConfiguration(classes = {Application.class}) | ||
| 25 | -public class DroolsRulesTest { | ||
| 26 | - | ||
| 27 | - /** 日志记录器 */ | ||
| 28 | - private final static Logger logger = LoggerFactory.getLogger(DroolsRulesTest.class); | ||
| 29 | - | ||
| 30 | - @Autowired | ||
| 31 | - private KieBase kieBase; | ||
| 32 | - | ||
| 33 | -// @Test | ||
| 34 | -// public void helloWorldDrlTest() throws Exception { | ||
| 35 | -// // 1、创建session,内部配置的是stateful | ||
| 36 | -// KieSession session = kieBase.newKieSession(); | ||
| 37 | -// | ||
| 38 | -// // 1.1 设置gloable对象,在drl中通过别名使用 | ||
| 39 | -// List<String> gloableList = new ArrayList<String>(); | ||
| 40 | -// session.setGlobal("list", gloableList); | ||
| 41 | -// | ||
| 42 | -// // 1.2 可以设置一些监听器,再议 | ||
| 43 | -// | ||
| 44 | -// // 2、创建fact对象 | ||
| 45 | -// Message message = new Message(); | ||
| 46 | -// message.setMessage("Hello World"); | ||
| 47 | -// message.setStatus(Message.HELLO); | ||
| 48 | -// session.insert(message); | ||
| 49 | -// | ||
| 50 | -// // 3、执行rule | ||
| 51 | -// session.fireAllRules(); | ||
| 52 | -// | ||
| 53 | -// System.out.println(gloableList); | ||
| 54 | -// | ||
| 55 | -// // 4、执行完毕销毁,有日志的也要关闭 | ||
| 56 | -// session.dispose(); | ||
| 57 | -// } | ||
| 58 | - | ||
| 59 | -// @Test | ||
| 60 | - public void ttinfoDrlTest() throws Exception { | ||
| 61 | - logger.info("------------ttinfoDrlTest 测试---------------"); | ||
| 62 | - | ||
| 63 | - // 1、创建session,内部配置的是stateful | ||
| 64 | - KieSession session = kieBase.newKieSession(); | ||
| 65 | - | ||
| 66 | - // 1.1 设置gloable对象,在drl中通过别人使用 | ||
| 67 | - session.setGlobal("log", logger); | ||
| 68 | - TTInfoResults_output ttInfoResults_output = new TTInfoResults_output(); | ||
| 69 | - session.setGlobal("results", ttInfoResults_output); | ||
| 70 | - | ||
| 71 | - // 1.2 可以设置一些监听器,再议 | ||
| 72 | - | ||
| 73 | - // 2、创建fact对象 | ||
| 74 | - TTInfoCalcuParam_input ttInfoCalcuParam_input = new TTInfoCalcuParam_input( | ||
| 75 | - new DateTime(2016, 8, 1, 0, 0), | ||
| 76 | - new DateTime(2016, 8, 10, 0, 0), | ||
| 77 | - "1" | ||
| 78 | - ); | ||
| 79 | - | ||
| 80 | - | ||
| 81 | - TTInfo_input ttInfo_input1 = new TTInfo_input(); | ||
| 82 | - ttInfo_input1.setTtInfoId("1"); | ||
| 83 | - ttInfo_input1.setXlId("1"); | ||
| 84 | - ttInfo_input1.setWeekdays(Arrays.asList(true, true, true, true, true, false, false)); | ||
| 85 | - ttInfo_input1.getSpecialDays().add(new DateTime(2016, 8, 1, 0, 0)); | ||
| 86 | - ttInfo_input1.setUpdateDate(new DateTime(2016, 1, 1, 0, 0)); | ||
| 87 | - ttInfo_input1.setIsEnable(true); | ||
| 88 | - ttInfo_input1.setQyDate(new DateTime(2016, 1, 1, 0, 0)); | ||
| 89 | - | ||
| 90 | - TTInfo_input ttInfo_input1_2 = new TTInfo_input(); | ||
| 91 | - ttInfo_input1_2.setTtInfoId("2"); | ||
| 92 | - ttInfo_input1_2.setXlId("1"); | ||
| 93 | - ttInfo_input1_2.setWeekdays(Arrays.asList(true, false, false, false, false, true, false)); | ||
| 94 | - ttInfo_input1_2.getSpecialDays().add(new DateTime(2016, 8, 11, 0, 0)); | ||
| 95 | - ttInfo_input1_2.setUpdateDate(new DateTime(2015, 2, 1, 0, 0)); | ||
| 96 | - ttInfo_input1_2.setIsEnable(true); | ||
| 97 | - ttInfo_input1_2.setQyDate(new DateTime(2016, 1, 1, 0, 0)); | ||
| 98 | - | ||
| 99 | - | ||
| 100 | - TTInfoCalcuParam_input ttInfoCalcuParam_inpu2 = new TTInfoCalcuParam_input( | ||
| 101 | - new DateTime(2016, 8, 1, 0, 0), | ||
| 102 | - new DateTime(2016, 8, 10, 0, 0), | ||
| 103 | - "2" | ||
| 104 | - ); | ||
| 105 | - | ||
| 106 | - TTInfo_input ttInfo_input2 = new TTInfo_input(); | ||
| 107 | - ttInfo_input2.setTtInfoId("2"); | ||
| 108 | - ttInfo_input2.setXlId("2"); | ||
| 109 | - ttInfo_input2.setWeekdays(Arrays.asList(true, false, false, false, false, true, false)); | ||
| 110 | - ttInfo_input2.getSpecialDays().add(new DateTime(2016, 8, 11, 0, 0)); | ||
| 111 | - ttInfo_input2.setUpdateDate(new DateTime(2016, 1, 1, 0, 0)); | ||
| 112 | - ttInfo_input2.setIsEnable(true); | ||
| 113 | - ttInfo_input2.setQyDate(new DateTime(2016, 1, 1, 0, 0)); | ||
| 114 | - | ||
| 115 | - session.insert(ttInfoCalcuParam_input); | ||
| 116 | - session.insert(ttInfo_input1); | ||
| 117 | - session.insert(ttInfo_input1_2); | ||
| 118 | - session.insert(ttInfoCalcuParam_inpu2); | ||
| 119 | - session.insert(ttInfo_input2); | ||
| 120 | - | ||
| 121 | - | ||
| 122 | - | ||
| 123 | - // 3、执行rule | ||
| 124 | - session.fireAllRules(); | ||
| 125 | - | ||
| 126 | - // 4、执行完毕销毁,有日志的也要关闭 | ||
| 127 | - session.dispose(); | ||
| 128 | - | ||
| 129 | - // 打印global结果 | ||
| 130 | - logger.info(ttInfoResults_output.showTTInfoDesc1()); | ||
| 131 | - | ||
| 132 | - } | ||
| 133 | - | ||
| 134 | - @Test | ||
| 135 | - public void shiftloopDrlTest() throws Exception { | ||
| 136 | - // 1、创建session,内部配置的是stateful | ||
| 137 | - KieSession session = kieBase.newKieSession(); | ||
| 138 | - | ||
| 139 | - // 1.1 设置gloable对象,在drl中通过别名使用 | ||
| 140 | - ScheduleResults_output scheduleResults_output = new ScheduleResults_output(); | ||
| 141 | - session.setGlobal("scheduleResult", scheduleResults_output); | ||
| 142 | - | ||
| 143 | - // 1.2 可以设置一些监听器,再议 | ||
| 144 | - | ||
| 145 | - // 2、创建fact对象 | ||
| 146 | - | ||
| 147 | - ScheduleCalcuParam_input scheduleCalcuParam_input = new ScheduleCalcuParam_input(); | ||
| 148 | - scheduleCalcuParam_input.setFromDate(new DateTime(2016, 8, 1, 0, 0)); | ||
| 149 | - scheduleCalcuParam_input.setToDate(new DateTime(2016, 8, 10, 0, 0)); | ||
| 150 | - | ||
| 151 | - ScheduleRule_input scheduleRule_input1 = new ScheduleRule_input(); | ||
| 152 | - scheduleRule_input1.setRuleId("1"); | ||
| 153 | - scheduleRule_input1.setQyrq(new DateTime(2016, 7, 22, 0, 0)); | ||
| 154 | - scheduleRule_input1.getGuideboardIds().addAll(Arrays.asList( | ||
| 155 | - "9", "9" , "8" ,"8" ,"7" ,"7" ,"6" ,"6", "5", "5", "4", "4", "3", "3", "2", "2", "1", "1")); | ||
| 156 | - scheduleRule_input1.setStartGbdIndex(3); | ||
| 157 | - scheduleRule_input1.getEmployeeConfigIds().addAll(Arrays.asList("1", "2")); | ||
| 158 | - scheduleRule_input1.setStartEIndex(1); | ||
| 159 | - scheduleRule_input1.setCarConfigId("1"); | ||
| 160 | - | ||
| 161 | -// ScheduleRule_input scheduleRule_input2 = new ScheduleRule_input(); | ||
| 162 | -// scheduleRule_input2.setRuleId(2L); | ||
| 163 | -// scheduleRule_input2.setQyrq(new DateTime(2016, 7, 22, 0, 0)); | ||
| 164 | -// scheduleRule_input2.getGuideboardIds().addAll(Arrays.asList( | ||
| 165 | -// 1L, 1L, 2L, 2L, 3L, 3L, 4L, 4L, 5L, 5L, 6L, 6L, 7L, 7L, 8L, 8L, 9L, 9L, 10L, 10L, | ||
| 166 | -// 11L, 11L, 12L, 12L, 13L, 13L)); | ||
| 167 | -// scheduleRule_input2.setStartGbdIndex(7); | ||
| 168 | -// scheduleRule_input2.getEmployeeConfigIds().addAll(Arrays.asList(11L, 12L)); | ||
| 169 | -// scheduleRule_input2.setStartEIndex(1); | ||
| 170 | -// scheduleRule_input2.setCarConfigId(2L); | ||
| 171 | - | ||
| 172 | - session.insert(scheduleCalcuParam_input); | ||
| 173 | - session.insert(scheduleRule_input1); | ||
| 174 | -// session.insert(scheduleRule_input2); | ||
| 175 | - | ||
| 176 | - | ||
| 177 | - // 3、执行rule | ||
| 178 | - session.fireAllRules(); | ||
| 179 | - | ||
| 180 | - // 4、执行完毕销毁,有日志的也要关闭 | ||
| 181 | - session.dispose(); | ||
| 182 | - | ||
| 183 | - System.out.println(scheduleResults_output.showGuideboardDesc1()); | ||
| 184 | - | ||
| 185 | - } | ||
| 186 | -} |
src/test/java/com/bsth/service/schedule/rules/DroolsRulesTest2.java deleted
100644 → 0
| 1 | -package com.bsth.service.schedule.rules; | ||
| 2 | - | ||
| 3 | -import com.bsth.Application; | ||
| 4 | -import org.junit.runner.RunWith; | ||
| 5 | -import org.kie.api.KieBase; | ||
| 6 | -import org.springframework.beans.factory.annotation.Autowired; | ||
| 7 | -import org.springframework.boot.test.SpringApplicationConfiguration; | ||
| 8 | -import org.springframework.context.annotation.ComponentScan; | ||
| 9 | -import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; | ||
| 10 | - | ||
| 11 | -/** | ||
| 12 | - * 测试类。 | ||
| 13 | - */ | ||
| 14 | -@RunWith(SpringJUnit4ClassRunner.class) | ||
| 15 | -@SpringApplicationConfiguration(classes = {Application.class}) | ||
| 16 | -@ComponentScan(basePackages = {"com.bsth.entity"}) | ||
| 17 | -public class DroolsRulesTest2 { | ||
| 18 | - @Autowired | ||
| 19 | - private KieBase kieBase; | ||
| 20 | - | ||
| 21 | - @org.junit.Test | ||
| 22 | - public void test1() throws Exception { | ||
| 23 | - System.out.println("dfdfdfdfd"); | ||
| 24 | - } | ||
| 25 | - | ||
| 26 | -} |
src/test/java/com/bsth/service/schedule/rules/RuleTest1.java
0 → 100644
| 1 | +package com.bsth.service.schedule.rules; | ||
| 2 | + | ||
| 3 | +import com.bsth.entity.sys.SysUser; | ||
| 4 | +import com.bsth.repository.sys.SysUserRepository; | ||
| 5 | +import com.bsth.service.schedule.BaseTest; | ||
| 6 | +import com.vividsolutions.jts.util.Assert; | ||
| 7 | +import org.dbunit.database.DatabaseConnection; | ||
| 8 | +import org.dbunit.database.IDatabaseConnection; | ||
| 9 | +import org.dbunit.dataset.IDataSet; | ||
| 10 | +import org.dbunit.dataset.xml.FlatXmlDataSetBuilder; | ||
| 11 | +import org.dbunit.operation.DatabaseOperation; | ||
| 12 | +import org.junit.After; | ||
| 13 | +import org.junit.Before; | ||
| 14 | +import org.slf4j.Logger; | ||
| 15 | +import org.slf4j.LoggerFactory; | ||
| 16 | +import org.springframework.beans.factory.annotation.Autowired; | ||
| 17 | +import org.springframework.core.io.ClassPathResource; | ||
| 18 | +import org.springframework.core.io.Resource; | ||
| 19 | + | ||
| 20 | +import javax.sql.DataSource; | ||
| 21 | + | ||
| 22 | +public class RuleTest1 extends BaseTest { | ||
| 23 | + /** 日志记录器 */ | ||
| 24 | + private static final Logger logger = LoggerFactory.getLogger(RuleTest1.class); | ||
| 25 | + | ||
| 26 | + @Autowired | ||
| 27 | + private DataSource dataSource; | ||
| 28 | + | ||
| 29 | + @Autowired | ||
| 30 | + private SysUserRepository sysUserRepository; | ||
| 31 | + | ||
| 32 | + /** | ||
| 33 | + * 初始化数据。 | ||
| 34 | + */ | ||
| 35 | + @Before | ||
| 36 | + public void initData() throws Exception { | ||
| 37 | + logger.info("载入数据......"); | ||
| 38 | + | ||
| 39 | + // 获取数据库连接 | ||
| 40 | + IDatabaseConnection iDatabaseConnection = new DatabaseConnection(dataSource.getConnection()); | ||
| 41 | + // 获取Dbunit数据源 | ||
| 42 | + Resource res = new ClassPathResource("testdata/d1.xml"); | ||
| 43 | + FlatXmlDataSetBuilder flatXmlDataSetBuilder = new FlatXmlDataSetBuilder(); | ||
| 44 | + flatXmlDataSetBuilder.setColumnSensing(false); | ||
| 45 | + flatXmlDataSetBuilder.setCaseSensitiveTableNames(false); | ||
| 46 | + IDataSet iDataSet = flatXmlDataSetBuilder.build(res.getInputStream()); | ||
| 47 | + | ||
| 48 | + // 载入数据 | ||
| 49 | + DatabaseOperation.CLEAN_INSERT.execute(iDatabaseConnection, iDataSet); | ||
| 50 | + } | ||
| 51 | + | ||
| 52 | + /** | ||
| 53 | + * 清除数据。 | ||
| 54 | + */ | ||
| 55 | + @After | ||
| 56 | + public void destoryData() throws Exception { | ||
| 57 | + logger.info("清除数据......"); | ||
| 58 | + // 获取数据库连接 | ||
| 59 | + IDatabaseConnection iDatabaseConnection = new DatabaseConnection(dataSource.getConnection()); | ||
| 60 | + // 获取Dbunit数据源 | ||
| 61 | + Resource res = new ClassPathResource("testdata/d1.xml"); | ||
| 62 | + FlatXmlDataSetBuilder flatXmlDataSetBuilder = new FlatXmlDataSetBuilder(); | ||
| 63 | + flatXmlDataSetBuilder.setColumnSensing(false); | ||
| 64 | + flatXmlDataSetBuilder.setCaseSensitiveTableNames(false); | ||
| 65 | + IDataSet iDataSet = flatXmlDataSetBuilder.build(res.getInputStream()); | ||
| 66 | + | ||
| 67 | + // 清除数据 | ||
| 68 | + DatabaseOperation.DELETE_ALL.execute(iDatabaseConnection, iDataSet); | ||
| 69 | + } | ||
| 70 | + | ||
| 71 | + @org.junit.Test | ||
| 72 | + public void t1() { | ||
| 73 | + logger.info("t1()测试......"); | ||
| 74 | + SysUser sysUser = sysUserRepository.findOne(1); | ||
| 75 | + Assert.equals("admin", sysUser.getUserName()); | ||
| 76 | + } | ||
| 77 | +} | ||
| 78 | + | ||
| 79 | +// | ||
| 80 | +// | ||
| 81 | +//package com.bsth.service.schedule.rules; | ||
| 82 | +// | ||
| 83 | +// import com.bsth.Application; | ||
| 84 | +// import com.bsth.service.schedule.rules.shiftloop.ScheduleCalcuParam_input; | ||
| 85 | +// import com.bsth.service.schedule.rules.shiftloop.ScheduleResults_output; | ||
| 86 | +// import com.bsth.service.schedule.rules.shiftloop.ScheduleRule_input; | ||
| 87 | +// import com.bsth.service.schedule.rules.ttinfo.TTInfoCalcuParam_input; | ||
| 88 | +// import com.bsth.service.schedule.rules.ttinfo.TTInfoResults_output; | ||
| 89 | +// import com.bsth.service.schedule.rules.ttinfo.TTInfo_input; | ||
| 90 | +// import org.joda.time.DateTime; | ||
| 91 | +// import org.junit.Test; | ||
| 92 | +// import org.junit.runner.RunWith; | ||
| 93 | +// import org.kie.api.KieBase; | ||
| 94 | +// import org.kie.api.runtime.KieSession; | ||
| 95 | +// import org.slf4j.Logger; | ||
| 96 | +// import org.slf4j.LoggerFactory; | ||
| 97 | +// import org.springframework.beans.factory.annotation.Autowired; | ||
| 98 | +// import org.springframework.boot.test.SpringApplicationConfiguration; | ||
| 99 | +// import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; | ||
| 100 | +// | ||
| 101 | +// import java.util.Arrays; | ||
| 102 | +// | ||
| 103 | +//@RunWith(SpringJUnit4ClassRunner.class) | ||
| 104 | +//@SpringApplicationConfiguration(classes = {Application.class}) | ||
| 105 | +//public class DroolsRulesTest { | ||
| 106 | +// | ||
| 107 | +// /** 日志记录器 */ | ||
| 108 | +// private final static Logger logger = LoggerFactory.getLogger(DroolsRulesTest.class); | ||
| 109 | +// | ||
| 110 | +// @Autowired | ||
| 111 | +// private KieBase kieBase; | ||
| 112 | +// | ||
| 113 | +//// @Test | ||
| 114 | +//// public void helloWorldDrlTest() throws Exception { | ||
| 115 | +//// // 1、创建session,内部配置的是stateful | ||
| 116 | +//// KieSession session = kieBase.newKieSession(); | ||
| 117 | +//// | ||
| 118 | +//// // 1.1 设置gloable对象,在drl中通过别名使用 | ||
| 119 | +//// List<String> gloableList = new ArrayList<String>(); | ||
| 120 | +//// session.setGlobal("list", gloableList); | ||
| 121 | +//// | ||
| 122 | +//// // 1.2 可以设置一些监听器,再议 | ||
| 123 | +//// | ||
| 124 | +//// // 2、创建fact对象 | ||
| 125 | +//// Message message = new Message(); | ||
| 126 | +//// message.setMessage("Hello World"); | ||
| 127 | +//// message.setStatus(Message.HELLO); | ||
| 128 | +//// session.insert(message); | ||
| 129 | +//// | ||
| 130 | +//// // 3、执行rule | ||
| 131 | +//// session.fireAllRules(); | ||
| 132 | +//// | ||
| 133 | +//// System.out.println(gloableList); | ||
| 134 | +//// | ||
| 135 | +//// // 4、执行完毕销毁,有日志的也要关闭 | ||
| 136 | +//// session.dispose(); | ||
| 137 | +//// } | ||
| 138 | +// | ||
| 139 | +// // @Test | ||
| 140 | +// public void ttinfoDrlTest() throws Exception { | ||
| 141 | +// logger.info("------------ttinfoDrlTest 测试---------------"); | ||
| 142 | +// | ||
| 143 | +// // 1、创建session,内部配置的是stateful | ||
| 144 | +// KieSession session = kieBase.newKieSession(); | ||
| 145 | +// | ||
| 146 | +// // 1.1 设置gloable对象,在drl中通过别人使用 | ||
| 147 | +// session.setGlobal("log", logger); | ||
| 148 | +// TTInfoResults_output ttInfoResults_output = new TTInfoResults_output(); | ||
| 149 | +// session.setGlobal("results", ttInfoResults_output); | ||
| 150 | +// | ||
| 151 | +// // 1.2 可以设置一些监听器,再议 | ||
| 152 | +// | ||
| 153 | +// // 2、创建fact对象 | ||
| 154 | +// TTInfoCalcuParam_input ttInfoCalcuParam_input = new TTInfoCalcuParam_input( | ||
| 155 | +// new DateTime(2016, 8, 1, 0, 0), | ||
| 156 | +// new DateTime(2016, 8, 10, 0, 0), | ||
| 157 | +// "1" | ||
| 158 | +// ); | ||
| 159 | +// | ||
| 160 | +// | ||
| 161 | +// TTInfo_input ttInfo_input1 = new TTInfo_input(); | ||
| 162 | +// ttInfo_input1.setTtInfoId("1"); | ||
| 163 | +// ttInfo_input1.setXlId("1"); | ||
| 164 | +// ttInfo_input1.setWeekdays(Arrays.asList(true, true, true, true, true, false, false)); | ||
| 165 | +// ttInfo_input1.getSpecialDays().add(new DateTime(2016, 8, 1, 0, 0)); | ||
| 166 | +// ttInfo_input1.setUpdateDate(new DateTime(2016, 1, 1, 0, 0)); | ||
| 167 | +// ttInfo_input1.setIsEnable(true); | ||
| 168 | +// ttInfo_input1.setQyDate(new DateTime(2016, 1, 1, 0, 0)); | ||
| 169 | +// | ||
| 170 | +// TTInfo_input ttInfo_input1_2 = new TTInfo_input(); | ||
| 171 | +// ttInfo_input1_2.setTtInfoId("2"); | ||
| 172 | +// ttInfo_input1_2.setXlId("1"); | ||
| 173 | +// ttInfo_input1_2.setWeekdays(Arrays.asList(true, false, false, false, false, true, false)); | ||
| 174 | +// ttInfo_input1_2.getSpecialDays().add(new DateTime(2016, 8, 11, 0, 0)); | ||
| 175 | +// ttInfo_input1_2.setUpdateDate(new DateTime(2015, 2, 1, 0, 0)); | ||
| 176 | +// ttInfo_input1_2.setIsEnable(true); | ||
| 177 | +// ttInfo_input1_2.setQyDate(new DateTime(2016, 1, 1, 0, 0)); | ||
| 178 | +// | ||
| 179 | +// | ||
| 180 | +// TTInfoCalcuParam_input ttInfoCalcuParam_inpu2 = new TTInfoCalcuParam_input( | ||
| 181 | +// new DateTime(2016, 8, 1, 0, 0), | ||
| 182 | +// new DateTime(2016, 8, 10, 0, 0), | ||
| 183 | +// "2" | ||
| 184 | +// ); | ||
| 185 | +// | ||
| 186 | +// TTInfo_input ttInfo_input2 = new TTInfo_input(); | ||
| 187 | +// ttInfo_input2.setTtInfoId("2"); | ||
| 188 | +// ttInfo_input2.setXlId("2"); | ||
| 189 | +// ttInfo_input2.setWeekdays(Arrays.asList(true, false, false, false, false, true, false)); | ||
| 190 | +// ttInfo_input2.getSpecialDays().add(new DateTime(2016, 8, 11, 0, 0)); | ||
| 191 | +// ttInfo_input2.setUpdateDate(new DateTime(2016, 1, 1, 0, 0)); | ||
| 192 | +// ttInfo_input2.setIsEnable(true); | ||
| 193 | +// ttInfo_input2.setQyDate(new DateTime(2016, 1, 1, 0, 0)); | ||
| 194 | +// | ||
| 195 | +// session.insert(ttInfoCalcuParam_input); | ||
| 196 | +// session.insert(ttInfo_input1); | ||
| 197 | +// session.insert(ttInfo_input1_2); | ||
| 198 | +// session.insert(ttInfoCalcuParam_inpu2); | ||
| 199 | +// session.insert(ttInfo_input2); | ||
| 200 | +// | ||
| 201 | +// | ||
| 202 | +// | ||
| 203 | +// // 3、执行rule | ||
| 204 | +// session.fireAllRules(); | ||
| 205 | +// | ||
| 206 | +// // 4、执行完毕销毁,有日志的也要关闭 | ||
| 207 | +// session.dispose(); | ||
| 208 | +// | ||
| 209 | +// // 打印global结果 | ||
| 210 | +// logger.info(ttInfoResults_output.showTTInfoDesc1()); | ||
| 211 | +// | ||
| 212 | +// } | ||
| 213 | +// | ||
| 214 | +// @Test | ||
| 215 | +// public void shiftloopDrlTest() throws Exception { | ||
| 216 | +// // 1、创建session,内部配置的是stateful | ||
| 217 | +// KieSession session = kieBase.newKieSession(); | ||
| 218 | +// | ||
| 219 | +// // 1.1 设置gloable对象,在drl中通过别名使用 | ||
| 220 | +// ScheduleResults_output scheduleResults_output = new ScheduleResults_output(); | ||
| 221 | +// session.setGlobal("scheduleResult", scheduleResults_output); | ||
| 222 | +// | ||
| 223 | +// // 1.2 可以设置一些监听器,再议 | ||
| 224 | +// | ||
| 225 | +// // 2、创建fact对象 | ||
| 226 | +// | ||
| 227 | +// ScheduleCalcuParam_input scheduleCalcuParam_input = new ScheduleCalcuParam_input(); | ||
| 228 | +// scheduleCalcuParam_input.setFromDate(new DateTime(2016, 8, 1, 0, 0)); | ||
| 229 | +// scheduleCalcuParam_input.setToDate(new DateTime(2016, 8, 10, 0, 0)); | ||
| 230 | +// | ||
| 231 | +// ScheduleRule_input scheduleRule_input1 = new ScheduleRule_input(); | ||
| 232 | +// scheduleRule_input1.setRuleId("1"); | ||
| 233 | +// scheduleRule_input1.setQyrq(new DateTime(2016, 7, 22, 0, 0)); | ||
| 234 | +// scheduleRule_input1.getGuideboardIds().addAll(Arrays.asList( | ||
| 235 | +// "9", "9" , "8" ,"8" ,"7" ,"7" ,"6" ,"6", "5", "5", "4", "4", "3", "3", "2", "2", "1", "1")); | ||
| 236 | +// scheduleRule_input1.setStartGbdIndex(3); | ||
| 237 | +// scheduleRule_input1.getEmployeeConfigIds().addAll(Arrays.asList("1", "2")); | ||
| 238 | +// scheduleRule_input1.setStartEIndex(1); | ||
| 239 | +// scheduleRule_input1.setCarConfigId("1"); | ||
| 240 | +// | ||
| 241 | +//// ScheduleRule_input scheduleRule_input2 = new ScheduleRule_input(); | ||
| 242 | +//// scheduleRule_input2.setRuleId(2L); | ||
| 243 | +//// scheduleRule_input2.setQyrq(new DateTime(2016, 7, 22, 0, 0)); | ||
| 244 | +//// scheduleRule_input2.getGuideboardIds().addAll(Arrays.asList( | ||
| 245 | +//// 1L, 1L, 2L, 2L, 3L, 3L, 4L, 4L, 5L, 5L, 6L, 6L, 7L, 7L, 8L, 8L, 9L, 9L, 10L, 10L, | ||
| 246 | +//// 11L, 11L, 12L, 12L, 13L, 13L)); | ||
| 247 | +//// scheduleRule_input2.setStartGbdIndex(7); | ||
| 248 | +//// scheduleRule_input2.getEmployeeConfigIds().addAll(Arrays.asList(11L, 12L)); | ||
| 249 | +//// scheduleRule_input2.setStartEIndex(1); | ||
| 250 | +//// scheduleRule_input2.setCarConfigId(2L); | ||
| 251 | +// | ||
| 252 | +// session.insert(scheduleCalcuParam_input); | ||
| 253 | +// session.insert(scheduleRule_input1); | ||
| 254 | +//// session.insert(scheduleRule_input2); | ||
| 255 | +// | ||
| 256 | +// | ||
| 257 | +// // 3、执行rule | ||
| 258 | +// session.fireAllRules(); | ||
| 259 | +// | ||
| 260 | +// // 4、执行完毕销毁,有日志的也要关闭 | ||
| 261 | +// session.dispose(); | ||
| 262 | +// | ||
| 263 | +// System.out.println(scheduleResults_output.showGuideboardDesc1()); | ||
| 264 | +// | ||
| 265 | +// } | ||
| 266 | +//} | ||
| 267 | + |
src/test/java/com/bsth/service/schedule/rules/Test.java deleted
100644 → 0
| 1 | -package com.bsth.service.schedule.rules; | ||
| 2 | - | ||
| 3 | -import org.apache.tika.Tika; | ||
| 4 | - | ||
| 5 | -import java.io.File; | ||
| 6 | - | ||
| 7 | -/** | ||
| 8 | - * Created by xu on 17/1/3. | ||
| 9 | - */ | ||
| 10 | -public class Test { | ||
| 11 | - public static void main(String[] args) throws Exception { | ||
| 12 | - Tika tika = new Tika(); | ||
| 13 | - File file = new File("/Users/xu/Downloads/排班规则练习1.xls"); | ||
| 14 | - | ||
| 15 | - // application/vnd.ms-excel | ||
| 16 | - // application/vnd.openxmlformats-officedocument.spreadsheetml.sheet | ||
| 17 | - | ||
| 18 | - String detecttype = tika.detect(file); | ||
| 19 | - System.out.println(detecttype); | ||
| 20 | - | ||
| 21 | - | ||
| 22 | - } | ||
| 23 | -} |
src/test/resources/application-scheduletest.properties
0 → 100644
| 1 | +#嵌入式tomcat配置 | ||
| 2 | +#server.port=9088 | ||
| 3 | +#management.port= 9001 | ||
| 4 | +#management.address= 127.0.0.1 | ||
| 5 | + | ||
| 6 | +#JPA配置 | ||
| 7 | +spring.jpa.hibernate.ddl-auto= update | ||
| 8 | +spring.jpa.hibernate.naming_strategy= org.hibernate.cfg.ImprovedNamingStrategy | ||
| 9 | +spring.jpa.database= MYSQL | ||
| 10 | +spring.jpa.show-sql= true | ||
| 11 | + | ||
| 12 | +#数据库连接池配置 | ||
| 13 | +spring.datasource.driver-class-name= com.mysql.jdbc.Driver | ||
| 14 | +spring.datasource.url= jdbc:mysql://127.0.0.1/test_control?useUnicode=true&characterEncoding=utf-8&useSSL=false | ||
| 15 | +spring.datasource.username= root | ||
| 16 | +spring.datasource.password= | ||
| 17 | + | ||
| 18 | +#spring.datasource.driver-class-name= org.h2.Driver | ||
| 19 | +#spring.datasource.url= jdbc:h2:mem:bookstore;DB_CLOSE_ON_EXIT=FALSE | ||
| 20 | +#spring.datasource.username= sa | ||
| 21 | +#spring.datasource.password= | ||
| 22 | + | ||
| 23 | +spring.datasource.max-active=100 | ||
| 24 | +spring.datasource.max-idle=8 | ||
| 25 | +spring.datasource.min-idle=8 | ||
| 26 | +spring.datasource.initial-size=5 | ||
| 27 | + | ||
| 28 | +spring.datasource.test-on-borrow=true | ||
| 29 | +spring.datasource.test-on-connect=true | ||
| 30 | +spring.datasource.test-on-return=true | ||
| 31 | +spring.datasource.test-while-idle=true | ||
| 32 | +spring.datasource.validation-query=select 1 | ||
| 33 | + |
src/test/resources/datatools/config-scheduletest.properties
0 → 100644
| 1 | +# 配置数据导入导出用到的配置信息 | ||
| 2 | + | ||
| 3 | +# 1、kettle配置文件路径(类路径) | ||
| 4 | +datatools.kettle_properties=/datatools/kettle.properties | ||
| 5 | +# 2、ktr文件通用配置变量(数据库连接,根据不同的环境需要修正) | ||
| 6 | +#数据库ip地址 | ||
| 7 | +datatools.kvars_dbip=127.0.0.1 | ||
| 8 | +#数据库用户名 | ||
| 9 | +datatools.kvars_dbuname=root | ||
| 10 | +#数据库密码 | ||
| 11 | +datatools.kvars_dbpwd= | ||
| 12 | +#数据库库名 | ||
| 13 | +datatools.kvars_dbdname=qp_control | ||
| 14 | + | ||
| 15 | +# 3、上传数据配置信息 | ||
| 16 | +# 上传文件目录配置(根据不同的环境需要修正) | ||
| 17 | +datatools.fileupload_dir=/Users/xu/resource/project_code/runtime_temp/bsth_control_u_d_files | ||
| 18 | +# ktr转换文件,中配置的错误输出目录(根据不同的环境需要修正) | ||
| 19 | +datatools.trans_errordir=/Users/xu/resource/project_code/runtime_temp/bsth_control_u_d_files/erroroutput | ||
| 20 | +# 临时输出文件目录 | ||
| 21 | +datatools.trans_tempdir=/Users/xu/resource/project_code/runtime_temp/bsth_control_u_d_files/temp | ||
| 22 | +# 模版文件目录 | ||
| 23 | +datatools.trans_templatedir=/Users/xu/resource/project_code/runtime_temp/bsth_control_u_d_files/template | ||
| 24 | + | ||
| 25 | +##---------------------------- 导入数据ktr ----------------------------## | ||
| 26 | +# 车辆信息导入ktr转换 | ||
| 27 | +datatools.cars_datainputktr=/datatools/ktrs/carsDataInput.ktr | ||
| 28 | +# 人员信息导入 | ||
| 29 | +datatools.employees_datainputktr=/datatools/ktrs/employeesDataInput.ktr | ||
| 30 | +# 路牌信息导入 | ||
| 31 | +datatools.guideboards_datainputktr=/datatools/ktrs/guideboardDataInput.ktr | ||
| 32 | +# 时刻表基础信息导入 | ||
| 33 | +datatools.ttinfo_datainputktr=/datatools/ktrs/ttinfoDataInput.ktr | ||
| 34 | +# 时刻表明细信息导入(元数据) | ||
| 35 | +datatools.ttinfodetail_metadatainputktr=/datatools/ktrs/ttinfodetailDataInputMetaData.ktr | ||
| 36 | +# 时刻表明细编辑用数据 | ||
| 37 | +datatools.ttinfodetail_foreditktr=/datatools/ktrs/ttinfodetailoutputforedit.ktr | ||
| 38 | +# 时刻表明细信息导入 | ||
| 39 | +datatools.ttinfodetail_datainputktr=/datatools/ktrs/ttinfodetailDataInput.ktr | ||
| 40 | +# 时刻表明细信息导入2 | ||
| 41 | +datatools.ttinfodetail_datainputktr2=/datatools/ktrs/ttinfodetailDataInput2.ktr | ||
| 42 | + | ||
| 43 | +# 车辆配置信息导入 | ||
| 44 | +datatools.carsconfig_datainputktr=/datatools/ktrs/carsConfigDataInput.ktr | ||
| 45 | +# 人员配置信息导入 | ||
| 46 | +datatools.employeesconfig_datainputktr=/datatools/ktrs/employeesConfigDataInput.ktr | ||
| 47 | + | ||
| 48 | +# 排版规则信息导入 | ||
| 49 | +datatools.schedulerule_datainputktr=/datatools/ktrs/scheduleRuleDataInput.ktr | ||
| 50 | + | ||
| 51 | +# 4、数据导出配置信息 | ||
| 52 | +# 导出数据文件目录配置(根据不同的环境需要修正) | ||
| 53 | +datatools.fileoutput_dir=/Users/xu/resource/project_code/runtime_temp/bsth_control_u_d_files | ||
| 54 | + | ||
| 55 | +##---------------------------- 导出数据ktr -----------------------------## | ||
| 56 | +# 车辆信息导出ktr转换 | ||
| 57 | +datatools.cars_dataoutputktr=/datatools/ktrs/carsDataOutput.ktr | ||
| 58 | +# 人员信息导出ktr转换 | ||
| 59 | +datatools.employees_dataoutputktr=/datatools/ktrs/employeesDataOutput.ktr | ||
| 60 | +# 时刻表导出元数据ktr转换 | ||
| 61 | +datatools.ttinfodetail_metaoutput=/datatools/ktrs/ttinfodetailDataOutputMetaData.ktr | ||
| 62 | +# 时刻表导出数据ktr转换 | ||
| 63 | +datatools.ttinfodetail_output=/datatools/ktrs/ttinfodetailDataOutput.ktr | ||
| 64 | +# 排版规则导出数据ktr转换 | ||
| 65 | +datatools.schedulerule_output=/datatools/ktrs/scheduleRuleDataOutput.ktr | ||
| 66 | + | ||
| 67 | +# 车辆配置信息导出ktr转换 | ||
| 68 | +datatools.carsconfig_dataoutputktr=/datatools/ktrs/carsConfigDataOutput.ktr | ||
| 69 | +# 人员配置信息导出ktr转换 | ||
| 70 | +datatools.employeesconfig_dataoutputktr=/datatools/ktrs/employeesConfigDataOutput.ktr | ||
| 71 | + | ||
| 72 | +# 路牌信息导出 | ||
| 73 | +datatools.guideboards_dataoutputktr=/datatools/ktrs/guideboardDataOutput.ktr | ||
| 74 | + | ||
| 75 | + | ||
| 76 | +# TODO: | ||
| 77 | + | ||
| 78 | + | ||
| 79 | + | ||
| 80 | + | ||
| 81 | + | ||
| 82 | + | ||
| 83 | + | ||
| 84 | + |
src/test/resources/test.properties deleted
100644 → 0
src/test/resources/testdata/d1.xml
0 → 100644