Commit 2d42e00bd21536ca534d315ce45410535da493ec
1 parent
8c67a447
update
Showing
17 changed files
with
193 additions
and
40 deletions
src/main/java/com/bsth/data/arrival/DataLoader.java
| @@ -96,8 +96,11 @@ public class DataLoader { | @@ -96,8 +96,11 @@ public class DataLoader { | ||
| 96 | st = conf.getCurrStartTime(); | 96 | st = conf.getCurrStartTime(); |
| 97 | if(t < st) | 97 | if(t < st) |
| 98 | st = st - DAY_TIME; | 98 | st = st - DAY_TIME; |
| 99 | - | ||
| 100 | - all.addAll(loadByLineAndTime(conf.getLine().getLineCode(), st, t)); | 99 | + try{ |
| 100 | + all.addAll(loadByLineAndTime(conf.getLine().getLineCode(), st, t)); | ||
| 101 | + }catch(Exception e){ | ||
| 102 | + logger.error("", e); | ||
| 103 | + } | ||
| 101 | } | 104 | } |
| 102 | 105 | ||
| 103 | prveLoadTime = t; | 106 | prveLoadTime = t; |
src/main/java/com/bsth/data/directive/FirstScheduleCheckThread.java
0 → 100644
| 1 | +package com.bsth.data.directive; | ||
| 2 | + | ||
| 3 | +import java.util.List; | ||
| 4 | +import java.util.Set; | ||
| 5 | + | ||
| 6 | +import org.slf4j.Logger; | ||
| 7 | +import org.slf4j.LoggerFactory; | ||
| 8 | +import org.springframework.beans.factory.annotation.Autowired; | ||
| 9 | +import org.springframework.stereotype.Component; | ||
| 10 | + | ||
| 11 | +import com.bsth.data.schedule.DayOfSchedule; | ||
| 12 | +import com.bsth.entity.realcontrol.ScheduleRealInfo; | ||
| 13 | +import com.bsth.service.directive.DirectiveService; | ||
| 14 | + | ||
| 15 | +/** | ||
| 16 | + * | ||
| 17 | + * @ClassName: FirstScheduleCheckThread | ||
| 18 | + * @Description: TODO(首班出场检测) | ||
| 19 | + * @author PanZhao | ||
| 20 | + * @date 2016年8月27日 上午1:25:21 | ||
| 21 | + * | ||
| 22 | + */ | ||
| 23 | +@Component | ||
| 24 | +public class FirstScheduleCheckThread extends Thread{ | ||
| 25 | + | ||
| 26 | + @Autowired | ||
| 27 | + DayOfSchedule dayOfSchedule; | ||
| 28 | + | ||
| 29 | + @Autowired | ||
| 30 | + DirectiveService directiveService; | ||
| 31 | + | ||
| 32 | + Logger logger = LoggerFactory.getLogger(this.getClass()); | ||
| 33 | + | ||
| 34 | + private final static long THREE_MINUTES = 1000 * 60 * 3L; | ||
| 35 | + | ||
| 36 | + @Override | ||
| 37 | + public void run() { | ||
| 38 | + try{ | ||
| 39 | + Set<String> cars = dayOfSchedule.allCar(); | ||
| 40 | + | ||
| 41 | + long t = System.currentTimeMillis(); | ||
| 42 | + List<ScheduleRealInfo> schList; | ||
| 43 | + ScheduleRealInfo first; | ||
| 44 | + for(String car : cars){ | ||
| 45 | + schList = dayOfSchedule.findByNbbm(car); | ||
| 46 | + | ||
| 47 | + if(null == schList || schList.size() == 0) | ||
| 48 | + continue; | ||
| 49 | + | ||
| 50 | + first = schList.get(0); | ||
| 51 | + | ||
| 52 | + if(null != first.getBcType() | ||
| 53 | + && first.getBcType().equals("out")){ | ||
| 54 | + | ||
| 55 | + //没有计划里程的出场班次,出场既是首发站,发送下一班次的营运指令 | ||
| 56 | + if(first.getJhlc() == null) | ||
| 57 | + first = schList.get(1); | ||
| 58 | + | ||
| 59 | + //为首班补发指令 | ||
| 60 | + if(first.getDirectiveState() == -1 | ||
| 61 | + && Math.abs(first.getDfsjT() - t) < THREE_MINUTES){ | ||
| 62 | + | ||
| 63 | + directiveService.send60Dispatch(first, dayOfSchedule.doneSum(first.getClZbh()), "定补@系统"); | ||
| 64 | + } | ||
| 65 | + } | ||
| 66 | + } | ||
| 67 | + }catch(Exception e){ | ||
| 68 | + logger.error("", e); | ||
| 69 | + } | ||
| 70 | + } | ||
| 71 | +} |
src/main/java/com/bsth/data/match/Arrival2Schedule.java
| @@ -60,6 +60,10 @@ public class Arrival2Schedule implements ApplicationContextAware { | @@ -60,6 +60,10 @@ public class Arrival2Schedule implements ApplicationContextAware { | ||
| 60 | } | 60 | } |
| 61 | @Override | 61 | @Override |
| 62 | public void run() { | 62 | public void run() { |
| 63 | + if(nbbm.equals("YT-CD002")){ | ||
| 64 | + System.out.println("debugger.."); | ||
| 65 | + } | ||
| 66 | + | ||
| 63 | //班次列表 | 67 | //班次列表 |
| 64 | List<ScheduleRealInfo> schList = dayOfSchedule.findByNbbm(nbbm); | 68 | List<ScheduleRealInfo> schList = dayOfSchedule.findByNbbm(nbbm); |
| 65 | //进出起终点数据 | 69 | //进出起终点数据 |
| @@ -67,6 +71,8 @@ public class Arrival2Schedule implements ApplicationContextAware { | @@ -67,6 +71,8 @@ public class Arrival2Schedule implements ApplicationContextAware { | ||
| 67 | //排序 | 71 | //排序 |
| 68 | Collections.sort(schList, schComparator); | 72 | Collections.sort(schList, schComparator); |
| 69 | Collections.sort(arrList, arrComparator); | 73 | Collections.sort(arrList, arrComparator); |
| 74 | + //过滤班次 | ||
| 75 | + schList = matchFilter(schList); | ||
| 70 | 76 | ||
| 71 | //用实际来匹配计划 | 77 | //用实际来匹配计划 |
| 72 | for(ArrivalEntity arr : arrList){ | 78 | for(ArrivalEntity arr : arrList){ |
| @@ -74,7 +80,6 @@ public class Arrival2Schedule implements ApplicationContextAware { | @@ -74,7 +80,6 @@ public class Arrival2Schedule implements ApplicationContextAware { | ||
| 74 | } | 80 | } |
| 75 | } | 81 | } |
| 76 | private void match(ArrivalEntity arr, List<ScheduleRealInfo> schList) { | 82 | private void match(ArrivalEntity arr, List<ScheduleRealInfo> schList) { |
| 77 | - schList = matchFilter(schList); | ||
| 78 | 83 | ||
| 79 | if(arr.getInOut() == 1) | 84 | if(arr.getInOut() == 1) |
| 80 | matchOut(arr, schList); | 85 | matchOut(arr, schList); |
| @@ -185,7 +190,7 @@ public class Arrival2Schedule implements ApplicationContextAware { | @@ -185,7 +190,7 @@ public class Arrival2Schedule implements ApplicationContextAware { | ||
| 185 | if(null != next){ | 190 | if(null != next){ |
| 186 | next.setQdzArrDateSJ(mr.sch.getZdsjActual()); | 191 | next.setQdzArrDateSJ(mr.sch.getZdsjActual()); |
| 187 | //下发调度指令 | 192 | //下发调度指令 |
| 188 | - directiveService.send60Dispatch(next, doneSum, "系统"); | 193 | + directiveService.send60Dispatch(next, doneSum, "到站@系统"); |
| 189 | } | 194 | } |
| 190 | else//下发文本指令(已结束运营) | 195 | else//下发文本指令(已结束运营) |
| 191 | directiveService.send60Phrase(nbbm, "到达终点 " + mr.sch.getZdzName() + ",已完成当日所有排班。", "系统"); | 196 | directiveService.send60Phrase(nbbm, "到达终点 " + mr.sch.getZdzName() + ",已完成当日所有排班。", "系统"); |
src/main/java/com/bsth/data/pilot80/PilotReport.java
| @@ -78,8 +78,13 @@ public class PilotReport { | @@ -78,8 +78,13 @@ public class PilotReport { | ||
| 78 | ScheduleRealInfo outSch = dayOfSchedule.nextByBcType(nbbm, "out"); | 78 | ScheduleRealInfo outSch = dayOfSchedule.nextByBcType(nbbm, "out"); |
| 79 | //如果有对应出场班次 | 79 | //如果有对应出场班次 |
| 80 | if(outSch != null){ | 80 | if(outSch != null){ |
| 81 | + | ||
| 82 | + //没有计划里程的出场班次,出场既是首发站,发送下一班次的营运指令 | ||
| 83 | + if(outSch.getJhlc() == null) | ||
| 84 | + outSch = dayOfSchedule.next(outSch); | ||
| 85 | + | ||
| 81 | //下发调度指令 | 86 | //下发调度指令 |
| 82 | - directiveService.send60Dispatch(outSch, dayOfSchedule.doneSum(nbbm), "系统"); | 87 | + directiveService.send60Dispatch(outSch, dayOfSchedule.doneSum(nbbm), "请出@系统"); |
| 83 | d80.setRemarks("计划出场时间:" + outSch.getDfsj()); | 88 | d80.setRemarks("计划出场时间:" + outSch.getDfsj()); |
| 84 | //当前GPS位置 | 89 | //当前GPS位置 |
| 85 | GpsEntity gps = gpsRealData.get(d80.getDeviceId()); | 90 | GpsEntity gps = gpsRealData.get(d80.getDeviceId()); |
src/main/java/com/bsth/data/schedule/DayOfSchedule.java
| @@ -24,6 +24,7 @@ import com.alibaba.fastjson.JSON; | @@ -24,6 +24,7 @@ import com.alibaba.fastjson.JSON; | ||
| 24 | import com.alibaba.fastjson.JSONArray; | 24 | import com.alibaba.fastjson.JSONArray; |
| 25 | import com.bsth.Application; | 25 | import com.bsth.Application; |
| 26 | import com.bsth.data.LineConfigData; | 26 | import com.bsth.data.LineConfigData; |
| 27 | +import com.bsth.data.directive.FirstScheduleCheckThread; | ||
| 27 | import com.bsth.entity.realcontrol.LineConfig; | 28 | import com.bsth.entity.realcontrol.LineConfig; |
| 28 | import com.bsth.entity.realcontrol.ScheduleRealInfo; | 29 | import com.bsth.entity.realcontrol.ScheduleRealInfo; |
| 29 | import com.bsth.entity.schedule.SchedulePlanInfo; | 30 | import com.bsth.entity.schedule.SchedulePlanInfo; |
| @@ -99,6 +100,9 @@ public class DayOfSchedule implements CommandLineRunner { | @@ -99,6 +100,9 @@ public class DayOfSchedule implements CommandLineRunner { | ||
| 99 | 100 | ||
| 100 | @Autowired | 101 | @Autowired |
| 101 | SchedulePstThread schedulePstThread; | 102 | SchedulePstThread schedulePstThread; |
| 103 | + | ||
| 104 | + @Autowired | ||
| 105 | + FirstScheduleCheckThread firstScheduleCheckThread; | ||
| 102 | 106 | ||
| 103 | @Override | 107 | @Override |
| 104 | public void run(String... arg0) throws Exception { | 108 | public void run(String... arg0) throws Exception { |
| @@ -106,6 +110,8 @@ public class DayOfSchedule implements CommandLineRunner { | @@ -106,6 +110,8 @@ public class DayOfSchedule implements CommandLineRunner { | ||
| 106 | Application.mainServices.scheduleWithFixedDelay(scheduleRefreshThread, 20, 120, TimeUnit.SECONDS); | 110 | Application.mainServices.scheduleWithFixedDelay(scheduleRefreshThread, 20, 120, TimeUnit.SECONDS); |
| 107 | //入库 | 111 | //入库 |
| 108 | Application.mainServices.scheduleWithFixedDelay(schedulePstThread, 60, 60, TimeUnit.SECONDS); | 112 | Application.mainServices.scheduleWithFixedDelay(schedulePstThread, 60, 60, TimeUnit.SECONDS); |
| 113 | + //首班出场指令补发器 | ||
| 114 | + Application.mainServices.scheduleWithFixedDelay(firstScheduleCheckThread, 60, 60, TimeUnit.SECONDS); | ||
| 109 | } | 115 | } |
| 110 | 116 | ||
| 111 | public Map<String, String> getCurrSchDate() { | 117 | public Map<String, String> getCurrSchDate() { |
| @@ -483,7 +489,7 @@ public class DayOfSchedule implements CommandLineRunner { | @@ -483,7 +489,7 @@ public class DayOfSchedule implements CommandLineRunner { | ||
| 483 | int rs = 0; | 489 | int rs = 0; |
| 484 | 490 | ||
| 485 | for(ScheduleRealInfo sch : list){ | 491 | for(ScheduleRealInfo sch : list){ |
| 486 | - if(sch.getZdsjActual() != null && !sch.isDestroy()) | 492 | + if(sch.getStatus() == 2 && !sch.isDestroy()) |
| 487 | rs ++; | 493 | rs ++; |
| 488 | } | 494 | } |
| 489 | return rs; | 495 | return rs; |
| @@ -583,6 +589,7 @@ public class DayOfSchedule implements CommandLineRunner { | @@ -583,6 +589,7 @@ public class DayOfSchedule implements CommandLineRunner { | ||
| 583 | */ | 589 | */ |
| 584 | public ScheduleRealInfo nextByBcType(String nbbm, String bcType){ | 590 | public ScheduleRealInfo nextByBcType(String nbbm, String bcType){ |
| 585 | List<ScheduleRealInfo> list = findByBcType(nbbm, bcType); | 591 | List<ScheduleRealInfo> list = findByBcType(nbbm, bcType); |
| 592 | + | ||
| 586 | Collections.sort(list, schNoComparator); | 593 | Collections.sort(list, schNoComparator); |
| 587 | ScheduleRealInfo sch = null; | 594 | ScheduleRealInfo sch = null; |
| 588 | for(ScheduleRealInfo temp : list){ | 595 | for(ScheduleRealInfo temp : list){ |
| @@ -612,4 +619,8 @@ public class DayOfSchedule implements CommandLineRunner { | @@ -612,4 +619,8 @@ public class DayOfSchedule implements CommandLineRunner { | ||
| 612 | nbbmScheduleMap.remove(sch.getClZbh(), sch); | 619 | nbbmScheduleMap.remove(sch.getClZbh(), sch); |
| 613 | return sch; | 620 | return sch; |
| 614 | } | 621 | } |
| 622 | + | ||
| 623 | + public Set<String> allCar(){ | ||
| 624 | + return nbbmScheduleMap.keySet(); | ||
| 625 | + } | ||
| 615 | } | 626 | } |
src/main/java/com/bsth/entity/directive/Directive.java
src/main/java/com/bsth/service/directive/DirectiveServiceImpl.java
| @@ -14,8 +14,6 @@ import org.apache.commons.lang3.StringUtils; | @@ -14,8 +14,6 @@ import org.apache.commons.lang3.StringUtils; | ||
| 14 | import org.slf4j.Logger; | 14 | import org.slf4j.Logger; |
| 15 | import org.slf4j.LoggerFactory; | 15 | import org.slf4j.LoggerFactory; |
| 16 | import org.springframework.beans.factory.annotation.Autowired; | 16 | import org.springframework.beans.factory.annotation.Autowired; |
| 17 | -import org.springframework.data.domain.Page; | ||
| 18 | -import org.springframework.data.domain.PageRequest; | ||
| 19 | import org.springframework.stereotype.Service; | 17 | import org.springframework.stereotype.Service; |
| 20 | 18 | ||
| 21 | import com.alibaba.fastjson.JSON; | 19 | import com.alibaba.fastjson.JSON; |
| @@ -32,12 +30,8 @@ import com.bsth.data.schedule.DayOfSchedule; | @@ -32,12 +30,8 @@ import com.bsth.data.schedule.DayOfSchedule; | ||
| 32 | import com.bsth.entity.directive.D60; | 30 | import com.bsth.entity.directive.D60; |
| 33 | import com.bsth.entity.directive.D64; | 31 | import com.bsth.entity.directive.D64; |
| 34 | import com.bsth.entity.directive.D80; | 32 | import com.bsth.entity.directive.D80; |
| 35 | -import com.bsth.entity.directive.DC0; | ||
| 36 | -import com.bsth.entity.directive.D64.D64Data; | ||
| 37 | -import com.bsth.entity.directive.DC0.DC0Data; | ||
| 38 | import com.bsth.entity.directive.Directive; | 33 | import com.bsth.entity.directive.Directive; |
| 39 | import com.bsth.entity.realcontrol.ScheduleRealInfo; | 34 | import com.bsth.entity.realcontrol.ScheduleRealInfo; |
| 40 | -import com.bsth.entity.search.CustomerSpecs; | ||
| 41 | import com.bsth.entity.sys.SysUser; | 35 | import com.bsth.entity.sys.SysUser; |
| 42 | import com.bsth.repository.directive.D60Repository; | 36 | import com.bsth.repository.directive.D60Repository; |
| 43 | import com.bsth.repository.directive.D64Repository; | 37 | import com.bsth.repository.directive.D64Repository; |
| @@ -129,16 +123,24 @@ public class DirectiveServiceImpl extends BaseServiceImpl<D60, Integer> implemen | @@ -129,16 +123,24 @@ public class DirectiveServiceImpl extends BaseServiceImpl<D60, Integer> implemen | ||
| 129 | logger.error("生成调度指令时出现异常", e); | 123 | logger.error("生成调度指令时出现异常", e); |
| 130 | return -1; | 124 | return -1; |
| 131 | } | 125 | } |
| 132 | - | 126 | + |
| 133 | if (null == d60) | 127 | if (null == d60) |
| 134 | return -1; | 128 | return -1; |
| 135 | 129 | ||
| 136 | d60.setSender(sender); | 130 | d60.setSender(sender); |
| 137 | - | 131 | + |
| 132 | + JSONObject jObj = JSON.parseObject(JSON.toJSONString(d60)); | ||
| 133 | + | ||
| 134 | + //进场或者出场班次时,附加lock 标识 | ||
| 135 | + if(null != sch.getBcType() | ||
| 136 | + && (sch.getBcType().equals("out") || sch.getBcType().equals("in"))){ | ||
| 137 | + | ||
| 138 | + jObj.put("lock", 1); | ||
| 139 | + } | ||
| 140 | + | ||
| 138 | // 发送指令 | 141 | // 发送指令 |
| 139 | - int code = GatewayHttpUtils.postJson(JSON.toJSONString(d60)); | 142 | + int code = GatewayHttpUtils.postJson(jObj.toJSONString()); |
| 140 | 143 | ||
| 141 | - sch.setDirectiveState(60); | ||
| 142 | // 添加到缓存,等待入库 | 144 | // 添加到缓存,等待入库 |
| 143 | d60.setDispatch(true); | 145 | d60.setDispatch(true); |
| 144 | d60.setSch(sch); | 146 | d60.setSch(sch); |
| @@ -146,9 +148,11 @@ public class DirectiveServiceImpl extends BaseServiceImpl<D60, Integer> implemen | @@ -146,9 +148,11 @@ public class DirectiveServiceImpl extends BaseServiceImpl<D60, Integer> implemen | ||
| 146 | dayOfDirectives.put60(d60); | 148 | dayOfDirectives.put60(d60); |
| 147 | 149 | ||
| 148 | if (code == 0) { | 150 | if (code == 0) { |
| 149 | - // 通知页面,消息已发出 | 151 | + sch.setDirectiveState(60); |
| 152 | + // 通知页面 | ||
| 150 | sendD60ToPage(sch); | 153 | sendD60ToPage(sch); |
| 151 | - } else { | 154 | + } |
| 155 | + else{ | ||
| 152 | d60.setErrorText("网关通讯失败, code: " + code); | 156 | d60.setErrorText("网关通讯失败, code: " + code); |
| 153 | d60Repository.save(d60); | 157 | d60Repository.save(d60); |
| 154 | } | 158 | } |
src/main/resources/fatso/start.js
| @@ -37,9 +37,9 @@ fs.mkdir(dest, function(e){ | @@ -37,9 +37,9 @@ fs.mkdir(dest, function(e){ | ||
| 37 | var cProcess; | 37 | var cProcess; |
| 38 | 38 | ||
| 39 | ep.tail('mvn-clean',function(){ | 39 | ep.tail('mvn-clean',function(){ |
| 40 | - ep.emit('copy-project'); | 40 | + //ep.emit('copy-project'); |
| 41 | //清理target | 41 | //清理target |
| 42 | - /*logInfo('mvn clean...'); | 42 | + logInfo('mvn clean...'); |
| 43 | cProcess = child_process.exec("mvn clean",{cwd: workspace + '\\' + pName},function(error){ | 43 | cProcess = child_process.exec("mvn clean",{cwd: workspace + '\\' + pName},function(error){ |
| 44 | if(error) | 44 | if(error) |
| 45 | logError(error); | 45 | logError(error); |
| @@ -47,7 +47,7 @@ ep.tail('mvn-clean',function(){ | @@ -47,7 +47,7 @@ ep.tail('mvn-clean',function(){ | ||
| 47 | logSuccess('mvn clean success'); | 47 | logSuccess('mvn clean success'); |
| 48 | 48 | ||
| 49 | ep.emit('copy-project'); | 49 | ep.emit('copy-project'); |
| 50 | - });*/ | 50 | + }); |
| 51 | output(cProcess); | 51 | output(cProcess); |
| 52 | }); | 52 | }); |
| 53 | 53 |
src/main/resources/logback.xml
| @@ -58,6 +58,33 @@ | @@ -58,6 +58,33 @@ | ||
| 58 | <appender-ref ref="ACCESS" /> | 58 | <appender-ref ref="ACCESS" /> |
| 59 | </logger> | 59 | </logger> |
| 60 | 60 | ||
| 61 | + <!-- 和网关通讯日志日志 --> | ||
| 62 | + <appender name="GATEWAY" | ||
| 63 | + class="ch.qos.logback.core.rolling.RollingFileAppender"> | ||
| 64 | + <file>${LOG_BASE}/gateway/gateway.log</file> | ||
| 65 | + <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> | ||
| 66 | + <fileNamePattern>${LOG_BASE}/gateway/gateway-%d{yyyy-MM-dd}.%i.log</fileNamePattern> | ||
| 67 | + <timeBasedFileNamingAndTriggeringPolicy | ||
| 68 | + class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> | ||
| 69 | + <maxFileSize>100MB</maxFileSize> | ||
| 70 | + </timeBasedFileNamingAndTriggeringPolicy> | ||
| 71 | + </rollingPolicy> | ||
| 72 | + | ||
| 73 | + <layout class="ch.qos.logback.classic.PatternLayout"> | ||
| 74 | + <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%file:%line] %-5level -%msg%n | ||
| 75 | + </pattern> | ||
| 76 | + </layout> | ||
| 77 | + </appender> | ||
| 78 | + <logger name="com.bsth.service.directive.DirectiveServiceImpl" level="INFO" additivity="false" > | ||
| 79 | + <appender-ref ref="GATEWAY" /> | ||
| 80 | + </logger> | ||
| 81 | + <logger name="com.bsth.controller.directive.UpstreamEntrance" level="INFO" additivity="false" > | ||
| 82 | + <appender-ref ref="GATEWAY" /> | ||
| 83 | + </logger> | ||
| 84 | + <logger name="com.bsth.data.directive.GatewayHttpUtils" level="INFO" additivity="false" > | ||
| 85 | + <appender-ref ref="GATEWAY" /> | ||
| 86 | + </logger> | ||
| 87 | + | ||
| 61 | 88 | ||
| 62 | <!-- 日志输出级别 --> | 89 | <!-- 日志输出级别 --> |
| 63 | <root level="info"> | 90 | <root level="info"> |
src/main/resources/static/pages/control/line/child_pages/historyDirective.html
| @@ -44,11 +44,11 @@ | @@ -44,11 +44,11 @@ | ||
| 44 | <td>{{item.timeHHmm}}</td> | 44 | <td>{{item.timeHHmm}}</td> |
| 45 | <td>{{item.nbbm}}</td> | 45 | <td>{{item.nbbm}}</td> |
| 46 | <td> | 46 | <td> |
| 47 | - <div class="text-furl"> | 47 | + <div class="text-furl" title="{{item.data.txtContent}}"> |
| 48 | {{item.data.txtContent}} | 48 | {{item.data.txtContent}} |
| 49 | </div> | 49 | </div> |
| 50 | </td> | 50 | </td> |
| 51 | - <td>{{item.sender}}</td> | 51 | + <td>{{item.sender}}{{if item.event != null}}<span class="device_event_str">{{item.event}}</span>{{/if}}</td> |
| 52 | <td> | 52 | <td> |
| 53 | {{if item.errorText != null}} | 53 | {{if item.errorText != null}} |
| 54 | <span class="label label-sm label-danger">{{item.errorText}}</span> | 54 | <span class="label label-sm label-danger">{{item.errorText}}</span> |
| @@ -102,6 +102,13 @@ | @@ -102,6 +102,13 @@ | ||
| 102 | params.size = pSize; | 102 | params.size = pSize; |
| 103 | 103 | ||
| 104 | $.get('/directive/list', params, function(rs){ | 104 | $.get('/directive/list', params, function(rs){ |
| 105 | + $.each(rs.list, function(i, e){ | ||
| 106 | + if(e.sender && e.sender.indexOf('@') != -1){ | ||
| 107 | + var ss = e.sender.split('@'); | ||
| 108 | + e.sender = ss[1]; | ||
| 109 | + e.event = ss[0]; | ||
| 110 | + } | ||
| 111 | + }); | ||
| 105 | 112 | ||
| 106 | var htmlStr = template('history_directive_list_temp', rs); | 113 | var htmlStr = template('history_directive_list_temp', rs); |
| 107 | $table.find('tbody').html(htmlStr); | 114 | $table.find('tbody').html(htmlStr); |
src/main/resources/static/pages/control/line/css/lineControl.css
| @@ -2565,4 +2565,10 @@ tr.linjia td:nth-child(1):AFTER { | @@ -2565,4 +2565,10 @@ tr.linjia td:nth-child(1):AFTER { | ||
| 2565 | padding: 1px 3px 1px 3px; | 2565 | padding: 1px 3px 1px 3px; |
| 2566 | background: #e7505a; | 2566 | background: #e7505a; |
| 2567 | border-radius: 15px; | 2567 | border-radius: 15px; |
| 2568 | +} | ||
| 2569 | + | ||
| 2570 | +.device_event_str{ | ||
| 2571 | + font-size: 10px; | ||
| 2572 | + color: #bdbdbd; | ||
| 2573 | + margin-left: 3px; | ||
| 2568 | } | 2574 | } |
| 2569 | \ No newline at end of file | 2575 | \ No newline at end of file |
src/main/resources/static/pages/control/line/index.html
| @@ -228,8 +228,8 @@ function countDown(name){ | @@ -228,8 +228,8 @@ function countDown(name){ | ||
| 228 | 228 | ||
| 229 | <script> | 229 | <script> |
| 230 | var updateLog = { | 230 | var updateLog = { |
| 231 | - text: '<div class="updete_log"><p>1、调整停车场进出场算法。</p><p>2、临加班车可被删除,前提是还没有下发调度指令(即使下发失败)。</p><p class="font-red">注意:进出场班次必须按照起点站划分上下行,起点发出则上行,终点发出为下行,否则该班次将不会有发车时间。</p></div>' | ||
| 232 | - ,title: '2016年8月26号凌晨更新日志' | 231 | + text: '<div class="updete_log"><p>1、当出场班次没有计划里程时,系统将下发下一个营运班次指令。</p><p>2、如果首班出场“待发时间”前3分钟没有收到驾驶员出场请求,系统将自动下发调度指令。</p></div>' |
| 232 | + ,title: '2016年8月27号凌晨更新日志' | ||
| 233 | } | 233 | } |
| 234 | 234 | ||
| 235 | var lineCodes = '' //全部线路编码字符串,由data.js初始化 | 235 | var lineCodes = '' //全部线路编码字符串,由data.js初始化 |
src/main/resources/static/pages/control/line/js/home.js
| @@ -87,14 +87,14 @@ var _home = (function() { | @@ -87,14 +87,14 @@ var _home = (function() { | ||
| 87 | 87 | ||
| 88 | setTimeout(function() { | 88 | setTimeout(function() { |
| 89 | // 提示文本 | 89 | // 提示文本 |
| 90 | - var promptFlag = storage.getItem('promptFlag_08251'); | 90 | + var promptFlag = storage.getItem('promptFlag_0827'); |
| 91 | if (!promptFlag) { | 91 | if (!promptFlag) { |
| 92 | layer.alert(updateLog.text, { | 92 | layer.alert(updateLog.text, { |
| 93 | title: updateLog.title, | 93 | title: updateLog.title, |
| 94 | - area: ['490px', '320px'], | 94 | + area: ['410px', '250px'], |
| 95 | shift : 5 | 95 | shift : 5 |
| 96 | }); | 96 | }); |
| 97 | - storage.setItem('promptFlag_08251', 1); | 97 | + storage.setItem('promptFlag_0827', 1); |
| 98 | } | 98 | } |
| 99 | }, 1500); | 99 | }, 1500); |
| 100 | } | 100 | } |
src/main/resources/static/pages/control/line/js/toolbarEvent.js
| @@ -20,7 +20,7 @@ var _toolbarEvent = (function(){ | @@ -20,7 +20,7 @@ var _toolbarEvent = (function(){ | ||
| 20 | $.get('/pages/control/line/child_pages/historyDirective.html', function(content){ | 20 | $.get('/pages/control/line/child_pages/historyDirective.html', function(content){ |
| 21 | layer.open({ | 21 | layer.open({ |
| 22 | type: 1, | 22 | type: 1, |
| 23 | - area: '930px', | 23 | + area: '980px', |
| 24 | content: content, | 24 | content: content, |
| 25 | title : false, | 25 | title : false, |
| 26 | shift: 5, | 26 | shift: 5, |
| @@ -64,7 +64,7 @@ var _toolbarEvent = (function(){ | @@ -64,7 +64,7 @@ var _toolbarEvent = (function(){ | ||
| 64 | $('#updateLogLink').on('click', function(){ | 64 | $('#updateLogLink').on('click', function(){ |
| 65 | layer.alert(updateLog.text, { | 65 | layer.alert(updateLog.text, { |
| 66 | title: updateLog.title, | 66 | title: updateLog.title, |
| 67 | - area: ['490px', '320px'], | 67 | + area: ['410px', '250px'], |
| 68 | shift : 5 | 68 | shift : 5 |
| 69 | }); | 69 | }); |
| 70 | }); | 70 | }); |
src/main/resources/static/pages/mapmonitor/real/js/map/iMap.js
| @@ -55,7 +55,7 @@ var iMap = (function(){ | @@ -55,7 +55,7 @@ var iMap = (function(){ | ||
| 55 | } | 55 | } |
| 56 | 56 | ||
| 57 | //绘制车辆icon | 57 | //绘制车辆icon |
| 58 | - function createCarIcon(gps){ | 58 | + function createCarIcon(gps, w){ |
| 59 | var canvas = $('<canvas></canvas>')[0]; | 59 | var canvas = $('<canvas></canvas>')[0]; |
| 60 | var ctx = canvas.getContext('2d'); | 60 | var ctx = canvas.getContext('2d'); |
| 61 | 61 | ||
| @@ -67,7 +67,10 @@ var iMap = (function(){ | @@ -67,7 +67,10 @@ var iMap = (function(){ | ||
| 67 | ctx.shadowColor = colours.shadow; // 颜色 | 67 | ctx.shadowColor = colours.shadow; // 颜色 |
| 68 | 68 | ||
| 69 | //绘制背景 | 69 | //绘制背景 |
| 70 | - ctx.roundRect(0, 0, 70, 25, 5).stroke(); | 70 | + if(!w) |
| 71 | + w = 70; | ||
| 72 | + | ||
| 73 | + ctx.roundRect(0, 0, w, 25, 5).stroke(); | ||
| 71 | ctx.fillStyle=colours.bgColor; | 74 | ctx.fillStyle=colours.bgColor; |
| 72 | ctx.fill(); | 75 | ctx.fill(); |
| 73 | //文字 | 76 | //文字 |
src/main/resources/static/pages/mapmonitor/real/js/map/platform/baidu.js
| @@ -175,9 +175,13 @@ var baiduMap = (function(){ | @@ -175,9 +175,13 @@ var baiduMap = (function(){ | ||
| 175 | enableMessage:true | 175 | enableMessage:true |
| 176 | }; | 176 | }; |
| 177 | function createBDMarkerByGps(gpsData){ | 177 | function createBDMarkerByGps(gpsData){ |
| 178 | + | ||
| 178 | var point = new BMap.Point(gpsData.bd_lon, gpsData.bd_lat); | 179 | var point = new BMap.Point(gpsData.bd_lon, gpsData.bd_lat); |
| 179 | - var marker = new BMap.Marker(point/*, {offset: new BMap.Size(-35,-12)}*/); | ||
| 180 | - marker.setIcon(new BMap.Icon(iMap.createCarIcon(gpsData), new BMap.Size(70,25))); | 180 | + var marker = new BMap.Marker(point); |
| 181 | + | ||
| 182 | + //根据编码长度 计算marker 宽度 | ||
| 183 | + var w = gpsData.nbbm.length * 10; | ||
| 184 | + marker.setIcon(new BMap.Icon(iMap.createCarIcon(gpsData, w), new BMap.Size(w,25))); | ||
| 181 | 185 | ||
| 182 | marker.infoWindow = new BMap.InfoWindow(bd_gps_info_win_opts); | 186 | marker.infoWindow = new BMap.InfoWindow(bd_gps_info_win_opts); |
| 183 | marker.gpsData = gpsData; | 187 | marker.gpsData = gpsData; |
| @@ -218,7 +222,9 @@ var baiduMap = (function(){ | @@ -218,7 +222,9 @@ var baiduMap = (function(){ | ||
| 218 | m.setPosition(new BMap.Point(gps.bd_lon, gps.bd_lat)); | 222 | m.setPosition(new BMap.Point(gps.bd_lon, gps.bd_lat)); |
| 219 | m.gpsData = gps; | 223 | m.gpsData = gps; |
| 220 | //重新设置icon | 224 | //重新设置icon |
| 221 | - m.setIcon(new BMap.Icon(iMap.createCarIcon(gps), new BMap.Size(70,25))); | 225 | + //根据编码长度 计算marker 宽度 |
| 226 | + var w = gps.nbbm.length * 10; | ||
| 227 | + m.setIcon(new BMap.Icon(iMap.createCarIcon(gps, w), new BMap.Size(w,25))); | ||
| 222 | 228 | ||
| 223 | //更新 infoWindow | 229 | //更新 infoWindow |
| 224 | if(m.infoWindow.isOpen()){ | 230 | if(m.infoWindow.isOpen()){ |
src/main/resources/static/pages/mapmonitor/real/js/map/platform/gaode.js
| @@ -150,12 +150,15 @@ var gaodeMap = (function() { | @@ -150,12 +150,15 @@ var gaodeMap = (function() { | ||
| 150 | return gaodeInstance; | 150 | return gaodeInstance; |
| 151 | 151 | ||
| 152 | function createGDMarkerByGps(gps){ | 152 | function createGDMarkerByGps(gps){ |
| 153 | + //根据编码长度 计算marker 宽度 | ||
| 154 | + var w = gps.nbbm.length * 10; | ||
| 155 | + | ||
| 153 | var marker = new AMap.Marker({ | 156 | var marker = new AMap.Marker({ |
| 154 | map: map, | 157 | map: map, |
| 155 | position: [gps.gcj_lon, gps.gcj_lat], | 158 | position: [gps.gcj_lon, gps.gcj_lat], |
| 156 | icon: new AMap.Icon({ | 159 | icon: new AMap.Icon({ |
| 157 | - size: new AMap.Size(70, 25), //图标大小 | ||
| 158 | - image: iMap.createCarIcon(gps) | 160 | + size: new AMap.Size(w, 25), //图标大小 |
| 161 | + image: iMap.createCarIcon(gps, w) | ||
| 159 | }), | 162 | }), |
| 160 | offset: new AMap.Pixel(-35, -12) | 163 | offset: new AMap.Pixel(-35, -12) |
| 161 | }); | 164 | }); |
| @@ -179,9 +182,11 @@ var gaodeMap = (function() { | @@ -179,9 +182,11 @@ var gaodeMap = (function() { | ||
| 179 | m.setPosition(new AMap.LngLat(gps.gcj_lon, gps.gcj_lat)); | 182 | m.setPosition(new AMap.LngLat(gps.gcj_lon, gps.gcj_lat)); |
| 180 | m.gpsData = gps; | 183 | m.gpsData = gps; |
| 181 | //重新设置icon | 184 | //重新设置icon |
| 185 | + //根据编码长度 计算marker 宽度 | ||
| 186 | + var w = gps.nbbm.length * 10; | ||
| 182 | m.setIcon(new AMap.Icon({ | 187 | m.setIcon(new AMap.Icon({ |
| 183 | - size: new AMap.Size(70, 25), | ||
| 184 | - image: iMap.createCarIcon(gps) | 188 | + size: new AMap.Size(w, 25), |
| 189 | + image: iMap.createCarIcon(gps, w) | ||
| 185 | })); | 190 | })); |
| 186 | 191 | ||
| 187 | if(m.infoWindow.getIsOpen()) | 192 | if(m.infoWindow.getIsOpen()) |