Commit 80395991597ecfad9c2876d34c5c217b64b4566d
Merge branch 'minhang' of http://222.66.0.204:8090//panzhaov5/bsth_control into minhang
Showing
53 changed files
with
2289 additions
and
859 deletions
src/main/java/com/bsth/controller/realcontrol/FrequentPhrasesController.java
0 → 100644
| 1 | +package com.bsth.controller.realcontrol; | |
| 2 | + | |
| 3 | +import com.bsth.controller.BaseController; | |
| 4 | +import com.bsth.entity.realcontrol.FrequentPhrases; | |
| 5 | +import org.springframework.web.bind.annotation.RequestMapping; | |
| 6 | +import org.springframework.web.bind.annotation.RestController; | |
| 7 | + | |
| 8 | +/** | |
| 9 | + * Created by panzhao on 2017/9/17. | |
| 10 | + */ | |
| 11 | +@RestController | |
| 12 | +@RequestMapping("frequent_phrases") | |
| 13 | +public class FrequentPhrasesController extends BaseController<FrequentPhrases, Integer>{ | |
| 14 | + | |
| 15 | +} | ... | ... |
src/main/java/com/bsth/controller/realcontrol/LineConfigController.java
| ... | ... | @@ -79,6 +79,11 @@ public class LineConfigController extends BaseController<LineConfig, Integer>{ |
| 79 | 79 | return lineConfigService.getByLineCode(lineCode); |
| 80 | 80 | } |
| 81 | 81 | |
| 82 | + @RequestMapping(value = "/findByIdx") | |
| 83 | + public Map<String, Object> findByIdx(@RequestParam String idx){ | |
| 84 | + return lineConfigService.findByIdx(idx); | |
| 85 | + } | |
| 86 | + | |
| 82 | 87 | /** |
| 83 | 88 | * 到站缓冲区设置 |
| 84 | 89 | * @param lineCode | ... | ... |
src/main/java/com/bsth/data/schedule/SchAttrCalculator.java
| ... | ... | @@ -17,273 +17,291 @@ import java.util.Collections; |
| 17 | 17 | import java.util.List; |
| 18 | 18 | |
| 19 | 19 | /** |
| 20 | - * | |
| 20 | + * @author PanZhao | |
| 21 | 21 | * @ClassName: SchAttrCalculator |
| 22 | 22 | * @Description: TODO(班次相关属性计算器) |
| 23 | - * @author PanZhao | |
| 24 | 23 | * @date 2016年8月15日 下午4:40:26 |
| 25 | - * | |
| 26 | 24 | */ |
| 27 | 25 | @Component |
| 28 | 26 | public class SchAttrCalculator { |
| 29 | 27 | |
| 30 | - @Autowired | |
| 31 | - LineConfigData lineConfigData; | |
| 32 | - | |
| 33 | - private final static long DAY_TIME = 1000 * 60 * 60 * 24L; | |
| 34 | - | |
| 35 | - Logger logger = LoggerFactory.getLogger(this.getClass()); | |
| 36 | - | |
| 37 | - private static DateTimeFormatter fmtyyyyMMdd = DateTimeFormat.forPattern("yyyy-MM-dd") | |
| 38 | - ,fmtHHmm = DateTimeFormat.forPattern("HH:mm") | |
| 39 | - ,fmtyyyyMMddHHmm = DateTimeFormat.forPattern("yyyy-MM-ddHH:mm"); | |
| 40 | - | |
| 41 | - /** | |
| 42 | - * @Title: calcRealDate | |
| 43 | - * @Description: TODO(计算班次的真实执行日期) | |
| 44 | - */ | |
| 45 | - public SchAttrCalculator calcRealDate(ScheduleRealInfo sch) { | |
| 46 | - LineConfig conf = lineConfigData.get(sch.getXlBm()); | |
| 47 | - | |
| 48 | - try { | |
| 49 | - if (null == sch.getFcsjT()) | |
| 50 | - calcFcsjTime(sch); | |
| 51 | - | |
| 52 | - //计发時間 | |
| 53 | - if(sch.getFcsj().compareTo(conf.getStartOpt()) < 0){ | |
| 54 | - sch.setFcsjAll(fmtyyyyMMddHHmm.parseMillis(sch.getScheduleDateStr()+sch.getFcsj()) + DAY_TIME); | |
| 55 | - } | |
| 56 | - | |
| 57 | - //待发時間 | |
| 58 | - if(sch.getDfsj().compareTo(conf.getStartOpt()) < 0){ | |
| 59 | - sch.setDfsjAll(fmtyyyyMMddHHmm.parseMillis(sch.getScheduleDateStr()+sch.getDfsj()) + DAY_TIME); | |
| 60 | - } | |
| 61 | - else | |
| 62 | - sch.setDfsjAll(fmtyyyyMMddHHmm.parseMillis(sch.getScheduleDateStr()+sch.getDfsj())); | |
| 63 | - | |
| 64 | - //实发時間 | |
| 65 | - if(StringUtils.isNotEmpty(sch.getFcsjActual()) && | |
| 66 | - sch.getFcsjActual().compareTo(conf.getStartOpt()) < 0){ | |
| 67 | - sch.setFcsjActualAll(fmtyyyyMMddHHmm.parseMillis(sch.getScheduleDateStr()+sch.getFcsjActual()) + DAY_TIME); | |
| 68 | - } | |
| 69 | - | |
| 70 | - //实际终点時間 | |
| 71 | - if(StringUtils.isNotEmpty(sch.getZdsjActual()) && | |
| 72 | - sch.getZdsjActual().compareTo(conf.getStartOpt()) < 0){ | |
| 73 | - sch.setZdsjActualAll(fmtyyyyMMddHHmm.parseMillis(sch.getScheduleDateStr()+sch.getZdsjActual()) + DAY_TIME); | |
| 74 | - } | |
| 75 | - | |
| 76 | - sch.setRealExecDate(fmtyyyyMMdd.print(sch.getFcsjT())); | |
| 77 | - } catch (Exception e) { | |
| 78 | - logger.error("", e); | |
| 79 | - } | |
| 80 | - return this; | |
| 81 | - } | |
| 82 | - | |
| 83 | - /** | |
| 84 | - * | |
| 85 | - * @Title: calcAllTimeByFcsj | |
| 86 | - * @Description: TODO(根据发车时间字符串计算 (计发时间,终点时间,待发时间)) | |
| 87 | - */ | |
| 88 | - public SchAttrCalculator calcAllTimeByFcsj(ScheduleRealInfo sch) { | |
| 89 | - try { | |
| 90 | - // 生成时间戳 | |
| 91 | - calcTimestamp(sch); | |
| 92 | - | |
| 93 | - // 计划终点时间 | |
| 94 | - if (sch.getBcsj() != null) { | |
| 95 | - sch.setZdsjT(sch.getDfsjT() + (sch.getBcsj() * 60 * 1000)); | |
| 96 | - sch.setZdsj(fmtHHmm.print(sch.getZdsjT())); | |
| 97 | - } | |
| 98 | - } catch (ParseException e) { | |
| 99 | - logger.error("", e); | |
| 100 | - } | |
| 101 | - return this; | |
| 102 | - } | |
| 103 | - | |
| 104 | - /** | |
| 105 | - * | |
| 106 | - * @Title: calcQdzTimePlan | |
| 107 | - * @Description: TODO(计算班次的起点应到时间) | |
| 108 | - */ | |
| 109 | - public void calcQdzTimePlan(List<ScheduleRealInfo> list){ | |
| 110 | - Collections.sort(list, new ScheduleComparator.FCSJ()); | |
| 111 | - | |
| 112 | - int len = list.size(); | |
| 113 | - if(len == 0) | |
| 114 | - return; | |
| 115 | - | |
| 116 | - ScheduleRealInfo prve = list.get(0), curr; | |
| 117 | - for(int i = 1; i < len; i ++){ | |
| 118 | - curr = list.get(i); | |
| 119 | - | |
| 120 | - if(isJoin(prve, curr)){ | |
| 121 | - curr.setQdzArrDatejh(prve.getZdsj()); | |
| 122 | - if(StringUtils.isNotEmpty(prve.getZdsjActual())) | |
| 123 | - curr.setQdzArrDatesj(prve.getZdsjActual()); | |
| 124 | - } | |
| 125 | - prve = curr; | |
| 126 | - } | |
| 127 | - } | |
| 128 | - | |
| 129 | - private boolean isJoin(ScheduleRealInfo prve, ScheduleRealInfo curr) { | |
| 130 | - return prve.getZdzName().equals(curr.getQdzName())//名称相等 | |
| 131 | - || prve.getZdzCode().equals(curr.getQdzCode())//编码相等 | |
| 132 | - || prve.getZdzName().startsWith(curr.getQdzName())//起始包括 | |
| 133 | - || curr.getQdzName().startsWith(prve.getZdzName());//起始包括 | |
| 134 | - } | |
| 135 | - | |
| 136 | - /** | |
| 137 | - * | |
| 138 | - * @Title: updateQdzTimePlan | |
| 139 | - * @Description: TODO(更新班次的起点应到时间) 并返回被更新的班次 | |
| 140 | - */ | |
| 141 | - public List<ScheduleRealInfo> updateQdzTimePlan(List<ScheduleRealInfo> list){ | |
| 142 | - Collections.sort(list, new ScheduleComparator.FCSJ()); | |
| 143 | - | |
| 144 | - List<ScheduleRealInfo> updateList = new ArrayList<>(); | |
| 145 | - int len = list.size(); | |
| 146 | - if(len == 0) | |
| 147 | - return updateList; | |
| 148 | - | |
| 149 | - ScheduleRealInfo prve = list.get(0), curr; | |
| 150 | - for(int i = 1; i < len; i ++){ | |
| 151 | - curr = list.get(i); | |
| 152 | - | |
| 153 | - if(prve.getZdzName().equals(curr.getQdzName()) | |
| 154 | - || prve.getZdzCode().equals(curr.getQdzCode())){ | |
| 155 | - | |
| 156 | - if(curr.getQdzArrDatejh() != null && prve.getZdsj().equals(curr.getQdzArrDatejh())){ | |
| 157 | - prve = curr; | |
| 158 | - continue; | |
| 159 | - } | |
| 160 | - | |
| 161 | - curr.setQdzArrDatejh(prve.getZdsj()); | |
| 162 | - updateList.add(curr); | |
| 163 | - } | |
| 164 | - else{ | |
| 165 | - curr.setQdzArrDatejh(null); | |
| 166 | - updateList.add(curr); | |
| 167 | - } | |
| 168 | - prve = curr; | |
| 169 | - } | |
| 170 | - | |
| 171 | - return updateList; | |
| 172 | - } | |
| 173 | - | |
| 174 | - public SchAttrCalculator calcFcsjTime(ScheduleRealInfo sch) throws ParseException { | |
| 175 | - sch.setFcsjT(fmtyyyyMMddHHmm.parseMillis(sch.getRealExecDate() + sch.getFcsj())); | |
| 176 | - return this; | |
| 177 | - } | |
| 178 | - | |
| 179 | - public void calcTimestamp(ScheduleRealInfo sch) throws ParseException{ | |
| 180 | - //计发时间 | |
| 181 | - if(sch.getFcsjT() == null) | |
| 182 | - calcFcsjTime(sch); | |
| 183 | - | |
| 184 | - //待发时间 | |
| 185 | - if(sch.getDfsj() == null) | |
| 186 | - sch.setDfsjAll(sch.getFcsjT()); | |
| 187 | - if(sch.getDfsjT() == null) | |
| 188 | - sch.setDfsjAll(sch.getDfsj()); | |
| 189 | - | |
| 190 | - //实发时间戳 | |
| 191 | - if(sch.getFcsjActualTime() == null && sch.getFcsjActual() != null) | |
| 192 | - sch.setFcsjActualAll(sch.getFcsjActual()); | |
| 193 | - | |
| 194 | - //实达时间戳 | |
| 195 | - if(sch.getZdsjActualTime() == null && sch.getZdsjActual() != null) | |
| 196 | - sch.setZdsjActualAll(sch.getZdsjActual()); | |
| 197 | - } | |
| 198 | - | |
| 199 | - /** | |
| 200 | - * 计算当前要执行的班次 | |
| 201 | - * @param list | |
| 202 | - * @return | |
| 203 | - */ | |
| 204 | - public ScheduleRealInfo calcCurrentExecSch(List<ScheduleRealInfo> list){ | |
| 205 | - String lineCode = list.get(0).getXlBm(); | |
| 206 | - LineConfig conf = lineConfigData.get(lineCode); | |
| 207 | - long t = System.currentTimeMillis(); | |
| 208 | - int outConfig = -1; | |
| 209 | - //限定出站既出场的停车场 | |
| 210 | - String park = null; | |
| 211 | - if(conf != null){ | |
| 212 | - outConfig = conf.getOutConfig(); | |
| 213 | - park = conf.getTwinsPark(); | |
| 214 | - } | |
| 215 | - boolean limitPark = StringUtils.isNotEmpty(park); | |
| 216 | - | |
| 217 | - for(ScheduleRealInfo sch : list){ | |
| 218 | - //如果是出站既出场,忽略出场班次 | |
| 219 | - if(outConfig == 2 && sch.getBcType().equals("out") | |
| 220 | - && (!limitPark || park.equals(sch.getQdzCode()))) | |
| 221 | - continue; | |
| 222 | - | |
| 223 | - //忽略烂班 | |
| 224 | - if(sch.isDestroy()) | |
| 225 | - continue; | |
| 226 | - | |
| 227 | - //已执行 | |
| 228 | - if(StringUtils.isNotEmpty(sch.getZdsjActual())) | |
| 229 | - continue; | |
| 230 | - | |
| 231 | - if(Math.abs((t - sch.getDfsjT())) > 1000 * 60 * 60){ | |
| 232 | - //差值较大,倒着找看有没有更合适的 | |
| 233 | - ScheduleRealInfo schReverse = calcCurrentExecSchReverse(list, outConfig, limitPark, park); | |
| 234 | - if(null != schReverse && !schReverse.getId().equals(sch.getId())){ | |
| 235 | - logger.info("calc_current_exec_sch_reverse... -" + schReverse.getId()); | |
| 236 | - return suitableExecSch(schReverse, sch, t); | |
| 237 | - } | |
| 238 | - } | |
| 239 | - return sch; | |
| 240 | - } | |
| 241 | - return null; | |
| 242 | - } | |
| 243 | - | |
| 244 | - /** | |
| 245 | - * 反转匹配一个班次 | |
| 246 | - * @param list | |
| 247 | - * @param outConfig | |
| 248 | - * @param limitPark | |
| 249 | - * @param park | |
| 250 | - * @return | |
| 251 | - */ | |
| 252 | - private ScheduleRealInfo calcCurrentExecSchReverse(List<ScheduleRealInfo> list, int outConfig, boolean limitPark, String park){ | |
| 253 | - ScheduleRealInfo near = null; | |
| 254 | - for(ScheduleRealInfo sch : list){ | |
| 255 | - //如果是出站既出场,忽略出场班次 | |
| 256 | - if(outConfig == 2 && isInout(sch) | |
| 257 | - && (!limitPark || park.equals(sch.getQdzCode()) || park.equals(sch.getZdzCode()))) | |
| 258 | - continue; | |
| 259 | - | |
| 260 | - //忽略烂班 | |
| 261 | - if(sch.isDestroy()) | |
| 262 | - continue; | |
| 263 | - | |
| 264 | - if(StringUtils.isNotEmpty(sch.getZdsjActual())){ | |
| 265 | - near = null; | |
| 266 | - continue; | |
| 267 | - } | |
| 268 | - | |
| 269 | - if(null == near) | |
| 270 | - near = sch; | |
| 271 | - } | |
| 272 | - return near; | |
| 273 | - } | |
| 274 | - | |
| 275 | - /** | |
| 276 | - * 比较2个班次,谁是指定时间更合适执行的 | |
| 277 | - * @param schReverse | |
| 278 | - * @param sch | |
| 279 | - * @param t | |
| 280 | - * @return | |
| 281 | - */ | |
| 282 | - private ScheduleRealInfo suitableExecSch(ScheduleRealInfo schReverse, ScheduleRealInfo sch, long t){ | |
| 283 | - return Math.abs(t - schReverse.getDfsjT()) > Math.abs(t - sch.getDfsjT())?sch: schReverse; | |
| 284 | - } | |
| 285 | - | |
| 286 | - private boolean isInout(ScheduleRealInfo sch){ | |
| 287 | - return sch.getBcType().equals("out") || sch.getBcType().equals("in"); | |
| 288 | - } | |
| 28 | + @Autowired | |
| 29 | + LineConfigData lineConfigData; | |
| 30 | + | |
| 31 | + private final static long DAY_TIME = 1000 * 60 * 60 * 24L; | |
| 32 | + | |
| 33 | + Logger logger = LoggerFactory.getLogger(this.getClass()); | |
| 34 | + | |
| 35 | + private static DateTimeFormatter fmtyyyyMMdd = DateTimeFormat.forPattern("yyyy-MM-dd"), fmtHHmm = DateTimeFormat.forPattern("HH:mm"), fmtyyyyMMddHHmm = DateTimeFormat.forPattern("yyyy-MM-ddHH:mm"); | |
| 36 | + | |
| 37 | + /** | |
| 38 | + * @Title: calcRealDate | |
| 39 | + * @Description: TODO(计算班次的真实执行日期) | |
| 40 | + */ | |
| 41 | + public SchAttrCalculator calcRealDate(ScheduleRealInfo sch) { | |
| 42 | + LineConfig conf = lineConfigData.get(sch.getXlBm()); | |
| 43 | + | |
| 44 | + try { | |
| 45 | + if (null == sch.getFcsjT()) | |
| 46 | + calcFcsjTime(sch); | |
| 47 | + | |
| 48 | + String rq = sch.getScheduleDateStr(); | |
| 49 | + //计发時間 | |
| 50 | + sch.setFcsjAll(getTime(rq, sch.getFcsj(), conf)); | |
| 51 | + | |
| 52 | + //待发時間 | |
| 53 | + sch.setDfsjAll(getTime(rq, sch.getDfsj(), conf)); | |
| 54 | + /*if (sch.getDfsj().compareTo(conf.getStartOpt()) < 0) { | |
| 55 | + sch.setDfsjAll(fmtyyyyMMddHHmm.parseMillis(sch.getScheduleDateStr() + sch.getDfsj()) + DAY_TIME); | |
| 56 | + } else | |
| 57 | + sch.setDfsjAll(fmtyyyyMMddHHmm.parseMillis(sch.getScheduleDateStr() + sch.getDfsj()));*/ | |
| 58 | + | |
| 59 | + //实发時間 | |
| 60 | + sch.setFcsjActualAll(getTime(rq, sch.getFcsjActual(), conf)); | |
| 61 | + /*if (StringUtils.isNotEmpty(sch.getFcsjActual()) && | |
| 62 | + sch.getFcsjActual().compareTo(conf.getStartOpt()) < 0) { | |
| 63 | + sch.setFcsjActualAll(fmtyyyyMMddHHmm.parseMillis(sch.getScheduleDateStr() + sch.getFcsjActual()) + DAY_TIME); | |
| 64 | + }*/ | |
| 65 | + | |
| 66 | + //实际终点時間 | |
| 67 | + sch.setZdsjActualAll(getTime(rq, sch.getZdsjActual(), conf)); | |
| 68 | + /*if (StringUtils.isNotEmpty(sch.getZdsjActual()) && | |
| 69 | + sch.getZdsjActual().compareTo(conf.getStartOpt()) < 0) { | |
| 70 | + sch.setZdsjActualAll(fmtyyyyMMddHHmm.parseMillis(sch.getScheduleDateStr() + sch.getZdsjActual()) + DAY_TIME); | |
| 71 | + }*/ | |
| 72 | + | |
| 73 | + sch.setRealExecDate(fmtyyyyMMdd.print(sch.getFcsjT())); | |
| 74 | + } catch (Exception e) { | |
| 75 | + logger.error("", e); | |
| 76 | + } | |
| 77 | + return this; | |
| 78 | + } | |
| 79 | + | |
| 80 | + public Long getTime(String rq, String timeStr, LineConfig conf) { | |
| 81 | + Long t = null; | |
| 82 | + if (StringUtils.isNotEmpty(timeStr)) { | |
| 83 | + t = fmtyyyyMMddHHmm.parseMillis(rq + timeStr); | |
| 84 | + if(timeStr.compareTo(conf.getStartOpt()) < 0) | |
| 85 | + return t + DAY_TIME; | |
| 86 | + } | |
| 87 | + return t; | |
| 88 | + } | |
| 89 | + | |
| 90 | + /** | |
| 91 | + * @Title: calcAllTimeByFcsj | |
| 92 | + * @Description: TODO(根据发车时间字符串计算 (计发时间,终点时间,待发时间)) | |
| 93 | + */ | |
| 94 | + public SchAttrCalculator calcAllTimeByFcsj(ScheduleRealInfo sch) { | |
| 95 | + try { | |
| 96 | + // 生成时间戳 | |
| 97 | + calcTimestamp(sch); | |
| 98 | + | |
| 99 | + // 计划终点时间 | |
| 100 | + if (sch.getBcsj() != null) { | |
| 101 | + sch.setZdsjT(sch.getDfsjT() + (sch.getBcsj() * 60 * 1000)); | |
| 102 | + sch.setZdsj(fmtHHmm.print(sch.getZdsjT())); | |
| 103 | + } | |
| 104 | + } catch (ParseException e) { | |
| 105 | + logger.error("", e); | |
| 106 | + } | |
| 107 | + return this; | |
| 108 | + } | |
| 109 | + | |
| 110 | + /** | |
| 111 | + * @Title: calcQdzTimePlan | |
| 112 | + * @Description: TODO(计算班次的起点应到时间) | |
| 113 | + */ | |
| 114 | + public void calcQdzTimePlan(List<ScheduleRealInfo> list) { | |
| 115 | + Collections.sort(list, new ScheduleComparator.FCSJ()); | |
| 116 | + | |
| 117 | + int len = list.size(); | |
| 118 | + if (len == 0) | |
| 119 | + return; | |
| 120 | + | |
| 121 | + ScheduleRealInfo prve = list.get(0), curr; | |
| 122 | + for (int i = 1; i < len; i++) { | |
| 123 | + curr = list.get(i); | |
| 124 | + | |
| 125 | + if (isJoin(prve, curr)) { | |
| 126 | + curr.setQdzArrDatejh(prve.getZdsj()); | |
| 127 | + if (StringUtils.isNotEmpty(prve.getZdsjActual())) | |
| 128 | + curr.setQdzArrDatesj(prve.getZdsjActual()); | |
| 129 | + } | |
| 130 | + prve = curr; | |
| 131 | + } | |
| 132 | + } | |
| 133 | + | |
| 134 | + private boolean isJoin(ScheduleRealInfo prve, ScheduleRealInfo curr) { | |
| 135 | + return prve.getZdzName().equals(curr.getQdzName())//名称相等 | |
| 136 | + || prve.getZdzCode().equals(curr.getQdzCode())//编码相等 | |
| 137 | + || prve.getZdzName().startsWith(curr.getQdzName())//起始包括 | |
| 138 | + || curr.getQdzName().startsWith(prve.getZdzName());//起始包括 | |
| 139 | + } | |
| 140 | + | |
| 141 | + /** | |
| 142 | + * @Title: updateQdzTimePlan | |
| 143 | + * @Description: TODO(更新班次的起点应到时间) 并返回被更新的班次 | |
| 144 | + */ | |
| 145 | + public List<ScheduleRealInfo> updateQdzTimePlan(List<ScheduleRealInfo> list) { | |
| 146 | + Collections.sort(list, new ScheduleComparator.FCSJ()); | |
| 147 | + | |
| 148 | + List<ScheduleRealInfo> updateList = new ArrayList<>(); | |
| 149 | + int len = list.size(); | |
| 150 | + if (len == 0) | |
| 151 | + return updateList; | |
| 152 | + | |
| 153 | + ScheduleRealInfo prve = list.get(0), curr; | |
| 154 | + for (int i = 1; i < len; i++) { | |
| 155 | + curr = list.get(i); | |
| 156 | + | |
| 157 | + if (prve.getZdzName().equals(curr.getQdzName()) | |
| 158 | + || prve.getZdzCode().equals(curr.getQdzCode())) { | |
| 159 | + | |
| 160 | + if (curr.getQdzArrDatejh() != null && prve.getZdsj().equals(curr.getQdzArrDatejh())) { | |
| 161 | + prve = curr; | |
| 162 | + continue; | |
| 163 | + } | |
| 164 | + | |
| 165 | + curr.setQdzArrDatejh(prve.getZdsj()); | |
| 166 | + updateList.add(curr); | |
| 167 | + } else { | |
| 168 | + curr.setQdzArrDatejh(null); | |
| 169 | + updateList.add(curr); | |
| 170 | + } | |
| 171 | + prve = curr; | |
| 172 | + } | |
| 173 | + | |
| 174 | + return updateList; | |
| 175 | + } | |
| 176 | + | |
| 177 | + public SchAttrCalculator calcFcsjTime(ScheduleRealInfo sch) throws ParseException { | |
| 178 | + sch.setFcsjT(fmtyyyyMMddHHmm.parseMillis(sch.getRealExecDate() + sch.getFcsj())); | |
| 179 | + return this; | |
| 180 | + } | |
| 181 | + | |
| 182 | + public void calcTimestamp(ScheduleRealInfo sch) throws ParseException { | |
| 183 | + //计发时间 | |
| 184 | + if (sch.getFcsjT() == null) | |
| 185 | + calcFcsjTime(sch); | |
| 186 | + | |
| 187 | + //待发时间 | |
| 188 | + if (sch.getDfsj() == null) | |
| 189 | + sch.setDfsjAll(sch.getFcsjT()); | |
| 190 | + if (sch.getDfsjT() == null) | |
| 191 | + sch.setDfsjAll(sch.getDfsj()); | |
| 192 | + | |
| 193 | + //实发时间戳 | |
| 194 | + if (sch.getFcsjActualTime() == null && sch.getFcsjActual() != null) | |
| 195 | + sch.setFcsjActualAll(sch.getFcsjActual()); | |
| 196 | + | |
| 197 | + //实达时间戳 | |
| 198 | + if (sch.getZdsjActualTime() == null && sch.getZdsjActual() != null) | |
| 199 | + sch.setZdsjActualAll(sch.getZdsjActual()); | |
| 200 | + } | |
| 201 | + | |
| 202 | + /** | |
| 203 | + * 计算当前要执行的班次 | |
| 204 | + * | |
| 205 | + * @param list | |
| 206 | + * @return | |
| 207 | + */ | |
| 208 | + public ScheduleRealInfo calcCurrentExecSch(List<ScheduleRealInfo> list) { | |
| 209 | + String lineCode = list.get(0).getXlBm(); | |
| 210 | + LineConfig conf = lineConfigData.get(lineCode); | |
| 211 | + long t = System.currentTimeMillis(); | |
| 212 | + int outConfig = -1; | |
| 213 | + //限定出站既出场的停车场 | |
| 214 | + String park = null; | |
| 215 | + if (conf != null) { | |
| 216 | + outConfig = conf.getOutConfig(); | |
| 217 | + park = conf.getTwinsPark(); | |
| 218 | + } | |
| 219 | + boolean limitPark = StringUtils.isNotEmpty(park); | |
| 220 | + | |
| 221 | + for (ScheduleRealInfo sch : list) { | |
| 222 | + //如果是出站既出场,忽略出场班次 | |
| 223 | + if (outConfig == 2 && sch.getBcType().equals("out") | |
| 224 | + && (!limitPark || park.equals(sch.getQdzCode()))) | |
| 225 | + continue; | |
| 226 | + | |
| 227 | + //忽略烂班 | |
| 228 | + if (sch.isDestroy()) | |
| 229 | + continue; | |
| 230 | + | |
| 231 | + //已执行 | |
| 232 | + if (StringUtils.isNotEmpty(sch.getZdsjActual())) | |
| 233 | + continue; | |
| 234 | + | |
| 235 | + if (Math.abs((t - sch.getDfsjT())) > 1000 * 60 * 60) { | |
| 236 | + //差值较大,倒着找看有没有更合适的 | |
| 237 | + ScheduleRealInfo schReverse = calcCurrentExecSchReverse(list, outConfig, limitPark, park); | |
| 238 | + if (null != schReverse && !schReverse.getId().equals(sch.getId())) { | |
| 239 | + logger.info("calc_current_exec_sch_reverse... -" + schReverse.getId()); | |
| 240 | + return suitableExecSch(schReverse, sch, t); | |
| 241 | + } | |
| 242 | + } | |
| 243 | + return sch; | |
| 244 | + } | |
| 245 | + return null; | |
| 246 | + } | |
| 247 | + | |
| 248 | + /** | |
| 249 | + * 反转匹配一个班次 | |
| 250 | + * | |
| 251 | + * @param list | |
| 252 | + * @param outConfig | |
| 253 | + * @param limitPark | |
| 254 | + * @param park | |
| 255 | + * @return | |
| 256 | + */ | |
| 257 | + private ScheduleRealInfo calcCurrentExecSchReverse(List<ScheduleRealInfo> list, int outConfig, boolean limitPark, String park) { | |
| 258 | + ScheduleRealInfo near = null; | |
| 259 | + for (ScheduleRealInfo sch : list) { | |
| 260 | + //如果是出站既出场,忽略出场班次 | |
| 261 | + if (outConfig == 2 && isInout(sch) | |
| 262 | + && (!limitPark || park.equals(sch.getQdzCode()) || park.equals(sch.getZdzCode()))) | |
| 263 | + continue; | |
| 264 | + | |
| 265 | + //忽略烂班 | |
| 266 | + if (sch.isDestroy()) | |
| 267 | + continue; | |
| 268 | + | |
| 269 | + if (StringUtils.isNotEmpty(sch.getZdsjActual())) { | |
| 270 | + near = null; | |
| 271 | + continue; | |
| 272 | + } | |
| 273 | + | |
| 274 | + if (null == near) | |
| 275 | + near = sch; | |
| 276 | + } | |
| 277 | + return near; | |
| 278 | + } | |
| 279 | + | |
| 280 | + /** | |
| 281 | + * 比较2个班次,谁是指定时间更合适执行的 | |
| 282 | + * | |
| 283 | + * @param schReverse | |
| 284 | + * @param sch | |
| 285 | + * @param t | |
| 286 | + * @return | |
| 287 | + */ | |
| 288 | + private ScheduleRealInfo suitableExecSch(ScheduleRealInfo schReverse, ScheduleRealInfo sch, long t) { | |
| 289 | + return Math.abs(t - schReverse.getDfsjT()) > Math.abs(t - sch.getDfsjT()) ? sch : schReverse; | |
| 290 | + } | |
| 291 | + | |
| 292 | + private boolean isInout(ScheduleRealInfo sch) { | |
| 293 | + return sch.getBcType().equals("out") || sch.getBcType().equals("in"); | |
| 294 | + } | |
| 295 | + | |
| 296 | + /** | |
| 297 | + * | |
| 298 | + * @param fcsjT | |
| 299 | + * @param zdsjT | |
| 300 | + */ | |
| 301 | + public boolean isValid(Long fcsjT, Long zdsjT) { | |
| 302 | + if(null != fcsjT && null != zdsjT) | |
| 303 | + return fcsjT < zdsjT; | |
| 304 | + | |
| 305 | + return true; | |
| 306 | + } | |
| 289 | 307 | } | ... | ... |
src/main/java/com/bsth/data/schedule/edit_logs/FormLogger.java
| ... | ... | @@ -15,6 +15,7 @@ import org.springframework.beans.factory.annotation.Autowired; |
| 15 | 15 | import org.springframework.stereotype.Service; |
| 16 | 16 | |
| 17 | 17 | import java.util.Date; |
| 18 | +import java.util.LinkedList; | |
| 18 | 19 | |
| 19 | 20 | /** |
| 20 | 21 | * 为报表写入相关的班次修改记录 |
| ... | ... | @@ -27,9 +28,12 @@ public class FormLogger { |
| 27 | 28 | |
| 28 | 29 | Logger log = LoggerFactory.getLogger(this.getClass()); |
| 29 | 30 | |
| 31 | + static LinkedList<Changetochange> ccPsts = new LinkedList<>(); | |
| 32 | + | |
| 30 | 33 | @Autowired |
| 31 | 34 | ChangetochangeRepository changetochangeRepository; |
| 32 | 35 | |
| 36 | + | |
| 33 | 37 | /** |
| 34 | 38 | * 换人换车情况表 |
| 35 | 39 | */ |
| ... | ... | @@ -70,7 +74,9 @@ public class FormLogger { |
| 70 | 74 | if(StringUtils.isNotEmpty(newJsy)) |
| 71 | 75 | cc.setSjgh(newJsy); |
| 72 | 76 | |
| 73 | - changetochangeRepository.save(cc); | |
| 77 | + //改异步入库 | |
| 78 | + ccPsts.add(cc); | |
| 79 | + //changetochangeRepository.save(cc); | |
| 74 | 80 | }catch (Exception e){ |
| 75 | 81 | log.error("纪录换人换车情况表", e); |
| 76 | 82 | } |
| ... | ... | @@ -82,4 +88,13 @@ public class FormLogger { |
| 82 | 88 | cpc.setJsy(jsy); |
| 83 | 89 | saveChangetochange(sch, cpc); |
| 84 | 90 | } |
| 91 | + | |
| 92 | + public void saveDb(){ | |
| 93 | + Changetochange cc; | |
| 94 | + for(int i = 0; i < 1000; i ++){ | |
| 95 | + cc = ccPsts.poll(); | |
| 96 | + if(null != cc) | |
| 97 | + changetochangeRepository.save(cc); | |
| 98 | + } | |
| 99 | + } | |
| 85 | 100 | } | ... | ... |
src/main/java/com/bsth/data/schedule/edit_logs/SeiPstThread.java
| ... | ... | @@ -23,6 +23,9 @@ public class SeiPstThread extends Thread{ |
| 23 | 23 | |
| 24 | 24 | Logger log = LoggerFactory.getLogger(this.getClass()); |
| 25 | 25 | |
| 26 | + @Autowired | |
| 27 | + FormLogger formLogger; | |
| 28 | + | |
| 26 | 29 | @Override |
| 27 | 30 | public void run() { |
| 28 | 31 | try{ |
| ... | ... | @@ -40,6 +43,9 @@ public class SeiPstThread extends Thread{ |
| 40 | 43 | } |
| 41 | 44 | |
| 42 | 45 | repository.save(pstList); |
| 46 | + | |
| 47 | + //报表结构化日志入库 | |
| 48 | + formLogger.saveDb(); | |
| 43 | 49 | }catch (Exception e){ |
| 44 | 50 | log.error("", e); |
| 45 | 51 | } | ... | ... |
src/main/java/com/bsth/entity/realcontrol/FrequentPhrases.java
0 → 100644
| 1 | +package com.bsth.entity.realcontrol; | |
| 2 | + | |
| 3 | +import javax.persistence.Entity; | |
| 4 | +import javax.persistence.GeneratedValue; | |
| 5 | +import javax.persistence.Id; | |
| 6 | +import javax.persistence.Table; | |
| 7 | + | |
| 8 | +/** | |
| 9 | + * 常用短语 | |
| 10 | + * Created by panzhao on 2017/9/17. | |
| 11 | + */ | |
| 12 | +@Entity | |
| 13 | +@Table(name = "bsth_c_s_frequent_phrases") | |
| 14 | +public class FrequentPhrases { | |
| 15 | + | |
| 16 | + @Id | |
| 17 | + @GeneratedValue | |
| 18 | + private Integer id; | |
| 19 | + | |
| 20 | + /** | |
| 21 | + * 用户名 | |
| 22 | + */ | |
| 23 | + private String userName; | |
| 24 | + | |
| 25 | + /** | |
| 26 | + * 短语 | |
| 27 | + */ | |
| 28 | + private String text; | |
| 29 | + | |
| 30 | + public Integer getId() { | |
| 31 | + return id; | |
| 32 | + } | |
| 33 | + | |
| 34 | + public void setId(Integer id) { | |
| 35 | + this.id = id; | |
| 36 | + } | |
| 37 | + | |
| 38 | + public String getUserName() { | |
| 39 | + return userName; | |
| 40 | + } | |
| 41 | + | |
| 42 | + public void setUserName(String userName) { | |
| 43 | + this.userName = userName; | |
| 44 | + } | |
| 45 | + | |
| 46 | + public String getText() { | |
| 47 | + return text; | |
| 48 | + } | |
| 49 | + | |
| 50 | + public void setText(String text) { | |
| 51 | + this.text = text; | |
| 52 | + } | |
| 53 | +} | ... | ... |
src/main/java/com/bsth/entity/realcontrol/ScheduleRealInfo.java
| ... | ... | @@ -718,8 +718,12 @@ public class ScheduleRealInfo { |
| 718 | 718 | * @throws |
| 719 | 719 | */ |
| 720 | 720 | public void setFcsjActualAll(Long t){ |
| 721 | + | |
| 721 | 722 | this.fcsjActualTime = t; |
| 722 | - this.fcsjActual = fmtHHmm.print(t); | |
| 723 | + if(null == t) | |
| 724 | + this.fcsjActual = null; | |
| 725 | + else | |
| 726 | + this.fcsjActual = fmtHHmm.print(t); | |
| 723 | 727 | |
| 724 | 728 | //更新班次状态 |
| 725 | 729 | calcStatus(); |
| ... | ... | @@ -733,7 +737,11 @@ public class ScheduleRealInfo { |
| 733 | 737 | */ |
| 734 | 738 | public void setZdsjActualAll(Long t){ |
| 735 | 739 | this.zdsjActualTime = t; |
| 736 | - this.zdsjActual = fmtHHmm.print(t); | |
| 740 | + | |
| 741 | + if(null == t) | |
| 742 | + this.zdsjActual = null; | |
| 743 | + else | |
| 744 | + this.zdsjActual = fmtHHmm.print(t); | |
| 737 | 745 | |
| 738 | 746 | //更新班次状态 |
| 739 | 747 | calcStatus(); | ... | ... |
src/main/java/com/bsth/entity/traffic/VehicleInoutStop.java
0 → 100644
| 1 | +package com.bsth.entity.traffic; | |
| 2 | + | |
| 3 | +import com.bsth.entity.Cars; | |
| 4 | +import com.bsth.entity.Line; | |
| 5 | + | |
| 6 | +import javax.persistence.*; | |
| 7 | +import java.util.Date; | |
| 8 | + | |
| 9 | +/** | |
| 10 | + * | |
| 11 | + * @ClassName: VehicleInoutStop(车载上报停靠站信息) | |
| 12 | + * | |
| 13 | + * @Description: TODO(线路标准信息) | |
| 14 | + * | |
| 15 | + * @Author bsth@zq | |
| 16 | + * | |
| 17 | + * @Date 2017-9-18 9:34:39 | |
| 18 | + * | |
| 19 | + * @Version 公交调度系统BS版 0.1 | |
| 20 | + * | |
| 21 | + */ | |
| 22 | +@Entity | |
| 23 | +@Table(name = "bsth_c_shreal") | |
| 24 | +public class VehicleInoutStop { | |
| 25 | + | |
| 26 | + @Id | |
| 27 | + @GeneratedValue(strategy = GenerationType.IDENTITY) | |
| 28 | + private Integer id; | |
| 29 | + | |
| 30 | + @ManyToOne | |
| 31 | + private Line line; | |
| 32 | + | |
| 33 | + @ManyToOne | |
| 34 | + private Cars cars; | |
| 35 | + | |
| 36 | + // 站点序号 | |
| 37 | + private Integer stop; | |
| 38 | + | |
| 39 | + // 营运状态 | |
| 40 | + private Integer serviceState; | |
| 41 | + | |
| 42 | + // 上下行 | |
| 43 | + private Integer upDown; | |
| 44 | + | |
| 45 | + // 进出站/站内外 | |
| 46 | + private Integer inOutStop; | |
| 47 | + | |
| 48 | + // 上报时间 | |
| 49 | + private Date reportDate; | |
| 50 | + | |
| 51 | + public Integer getId() { | |
| 52 | + return id; | |
| 53 | + } | |
| 54 | + | |
| 55 | + public void setId(Integer id) { | |
| 56 | + this.id = id; | |
| 57 | + } | |
| 58 | + | |
| 59 | + public Line getLine() { | |
| 60 | + return line; | |
| 61 | + } | |
| 62 | + | |
| 63 | + public void setLine(Line line) { | |
| 64 | + this.line = line; | |
| 65 | + } | |
| 66 | + | |
| 67 | + public Cars getCars() { | |
| 68 | + return cars; | |
| 69 | + } | |
| 70 | + | |
| 71 | + public void setCars(Cars cars) { | |
| 72 | + this.cars = cars; | |
| 73 | + } | |
| 74 | + | |
| 75 | + public Integer getStop() { | |
| 76 | + return stop; | |
| 77 | + } | |
| 78 | + | |
| 79 | + public void setStop(Integer stop) { | |
| 80 | + this.stop = stop; | |
| 81 | + } | |
| 82 | + | |
| 83 | + public Integer getServiceState() { | |
| 84 | + return serviceState; | |
| 85 | + } | |
| 86 | + | |
| 87 | + public void setServiceState(Integer serviceState) { | |
| 88 | + this.serviceState = serviceState; | |
| 89 | + } | |
| 90 | + | |
| 91 | + public Integer getUpDown() { | |
| 92 | + return upDown; | |
| 93 | + } | |
| 94 | + | |
| 95 | + public void setUpDown(Integer upDown) { | |
| 96 | + this.upDown = upDown; | |
| 97 | + } | |
| 98 | + | |
| 99 | + public Integer getInOutStop() { | |
| 100 | + return inOutStop; | |
| 101 | + } | |
| 102 | + | |
| 103 | + public void setInOutStop(Integer inOutStop) { | |
| 104 | + this.inOutStop = inOutStop; | |
| 105 | + } | |
| 106 | + | |
| 107 | + public Date getReportDate() { | |
| 108 | + return reportDate; | |
| 109 | + } | |
| 110 | + | |
| 111 | + public void setReportDate(Date reportDate) { | |
| 112 | + this.reportDate = reportDate; | |
| 113 | + } | |
| 114 | +} | ... | ... |
src/main/java/com/bsth/repository/realcontrol/FrequentPhrasesRepository.java
0 → 100644
| 1 | +package com.bsth.repository.realcontrol; | |
| 2 | + | |
| 3 | +import com.bsth.entity.realcontrol.FrequentPhrases; | |
| 4 | +import com.bsth.repository.BaseRepository; | |
| 5 | +import org.springframework.stereotype.Repository; | |
| 6 | + | |
| 7 | +/** | |
| 8 | + * Created by panzhao on 2017/9/17. | |
| 9 | + */ | |
| 10 | +@Repository | |
| 11 | +public interface FrequentPhrasesRepository extends BaseRepository<FrequentPhrases, Integer> { | |
| 12 | +} | ... | ... |
src/main/java/com/bsth/repository/traffic/VehicleInoutStopRepository.java
0 → 100644
src/main/java/com/bsth/service/gps/GpsServiceImpl.java
| ... | ... | @@ -994,7 +994,7 @@ public class GpsServiceImpl implements GpsService { |
| 994 | 994 | fv = f.get(obj).toString(); |
| 995 | 995 | v = map.get(f.getName()).toString(); |
| 996 | 996 | |
| 997 | - if(!fv.startsWith(v) && !fv.endsWith(v)) | |
| 997 | + if(!fv.startsWith(v)/* && !fv.endsWith(v)*/) | |
| 998 | 998 | return false; |
| 999 | 999 | } |
| 1000 | 1000 | } catch (Exception e) { | ... | ... |
src/main/java/com/bsth/service/realcontrol/FrequentPhrasesService.java
0 → 100644
| 1 | +package com.bsth.service.realcontrol; | |
| 2 | + | |
| 3 | +import com.bsth.entity.realcontrol.FrequentPhrases; | |
| 4 | +import com.bsth.service.BaseService; | |
| 5 | + | |
| 6 | +/** | |
| 7 | + * Created by panzhao on 2017/9/17. | |
| 8 | + */ | |
| 9 | +public interface FrequentPhrasesService extends BaseService<FrequentPhrases, Integer> { | |
| 10 | +} | ... | ... |
src/main/java/com/bsth/service/realcontrol/LineConfigService.java
| ... | ... | @@ -24,4 +24,6 @@ public interface LineConfigService extends BaseService<LineConfig, Integer>{ |
| 24 | 24 | Map<String,Object> yjtkSet(Map<String, String> map); |
| 25 | 25 | |
| 26 | 26 | Map<String,Object> parkAndStationSet(Map<String, String> map); |
| 27 | + | |
| 28 | + Map<String,Object> findByIdx(String idx); | |
| 27 | 29 | } | ... | ... |
src/main/java/com/bsth/service/realcontrol/impl/FrequentPhrasesServiceImpl.java
0 → 100644
| 1 | +package com.bsth.service.realcontrol.impl; | |
| 2 | + | |
| 3 | +import com.bsth.entity.realcontrol.FrequentPhrases; | |
| 4 | +import com.bsth.security.util.SecurityUtils; | |
| 5 | +import com.bsth.service.impl.BaseServiceImpl; | |
| 6 | +import com.bsth.service.realcontrol.FrequentPhrasesService; | |
| 7 | +import org.springframework.stereotype.Service; | |
| 8 | + | |
| 9 | +import java.util.Map; | |
| 10 | + | |
| 11 | +/** | |
| 12 | + * Created by panzhao on 2017/9/17. | |
| 13 | + */ | |
| 14 | +@Service | |
| 15 | +public class FrequentPhrasesServiceImpl extends BaseServiceImpl<FrequentPhrases, Integer> implements FrequentPhrasesService { | |
| 16 | + | |
| 17 | + @Override | |
| 18 | + public Map<String, Object> save(FrequentPhrases fp) { | |
| 19 | + fp.setUserName(SecurityUtils.getCurrentUser().getUserName()); | |
| 20 | + return super.save(fp); | |
| 21 | + } | |
| 22 | + | |
| 23 | + @Override | |
| 24 | + public Iterable<FrequentPhrases> list(Map<String, Object> map) { | |
| 25 | + map.put("userName_eq", SecurityUtils.getCurrentUser().getUserName()); | |
| 26 | + return super.list(map); | |
| 27 | + } | |
| 28 | +} | ... | ... |
src/main/java/com/bsth/service/realcontrol/impl/LineConfigServiceImpl.java
| ... | ... | @@ -6,6 +6,7 @@ import com.bsth.entity.realcontrol.LineConfig; |
| 6 | 6 | import com.bsth.repository.realcontrol.LineConfigRepository; |
| 7 | 7 | import com.bsth.service.impl.BaseServiceImpl; |
| 8 | 8 | import com.bsth.service.realcontrol.LineConfigService; |
| 9 | +import com.google.common.base.Splitter; | |
| 9 | 10 | import org.slf4j.Logger; |
| 10 | 11 | import org.slf4j.LoggerFactory; |
| 11 | 12 | import org.springframework.beans.factory.annotation.Autowired; |
| ... | ... | @@ -203,4 +204,24 @@ public class LineConfigServiceImpl extends BaseServiceImpl<LineConfig, Integer> |
| 203 | 204 | } |
| 204 | 205 | return rs; |
| 205 | 206 | } |
| 207 | + | |
| 208 | + @Override | |
| 209 | + public Map<String, Object> findByIdx(String idx) { | |
| 210 | + Map<String, Object> rs = new HashMap(); | |
| 211 | + try{ | |
| 212 | + List<LineConfig> list = new ArrayList<>(); | |
| 213 | + List<String> ids = Splitter.on(",").splitToList(idx); | |
| 214 | + | |
| 215 | + for(String id : ids){ | |
| 216 | + list.add(lineConfigData.get(id)); | |
| 217 | + } | |
| 218 | + | |
| 219 | + rs.put("status", ResponseCode.SUCCESS); | |
| 220 | + rs.put("list", list); | |
| 221 | + }catch (Exception e){ | |
| 222 | + rs.put("status", ResponseCode.ERROR); | |
| 223 | + logger.error("", e); | |
| 224 | + } | |
| 225 | + return rs; | |
| 226 | + } | |
| 206 | 227 | } | ... | ... |
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
| ... | ... | @@ -226,6 +226,13 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 226 | 226 | |
| 227 | 227 | ScheduleRealInfo schedule = dayOfSchedule.get(id); |
| 228 | 228 | |
| 229 | + if(schedule.getStatus() > 0){ | |
| 230 | + map.put("status", ResponseCode.SUCCESS); | |
| 231 | + map.put("flag", "4008"); | |
| 232 | + map.put("t", schedule); | |
| 233 | + return map; | |
| 234 | + } | |
| 235 | + | |
| 229 | 236 | LineConfig config = lineConfigData.get(schedule.getXlBm()); |
| 230 | 237 | //小于线路开始运营时间,则默认跨过24点 |
| 231 | 238 | if (dfsj.compareTo(config.getStartOpt()) < 0) { |
| ... | ... | @@ -252,7 +259,13 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 252 | 259 | } |
| 253 | 260 | |
| 254 | 261 | //调整班次类型 |
| 255 | - if (StringUtils.isNotEmpty(bcType)) { | |
| 262 | + if (StringUtils.isNotEmpty(bcType) && !bcType.equals(schedule.getBcType())) { | |
| 263 | + if((schedule.getBcType().equals("major") | |
| 264 | + || schedule.getBcType().equals("venting")) | |
| 265 | + && bcType.equals("normal")){ | |
| 266 | + //清空备注 | |
| 267 | + schedule.setRemarks(""); | |
| 268 | + } | |
| 256 | 269 | schedule.setBcType(bcType); |
| 257 | 270 | } |
| 258 | 271 | |
| ... | ... | @@ -1264,8 +1277,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 1264 | 1277 | @Override |
| 1265 | 1278 | public Map<String, Object> spaceAdjust(Long[] ids, Integer space) { |
| 1266 | 1279 | |
| 1267 | - List<ScheduleRealInfo> list = new ArrayList<>(), updateList = new ArrayList<>(); | |
| 1268 | - Map<String, Object> rs = new HashMap<>(); | |
| 1280 | + List<ScheduleRealInfo> list = new ArrayList<>(), ts = new ArrayList<>(), tempTs = null; | |
| 1281 | + Map<String, Object> rs = new HashMap<>(), tempRs = new HashMap<>(); | |
| 1269 | 1282 | try { |
| 1270 | 1283 | ScheduleRealInfo sch, next; |
| 1271 | 1284 | for (Long id : ids) { |
| ... | ... | @@ -1290,12 +1303,17 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 1290 | 1303 | sch = list.get(i); |
| 1291 | 1304 | |
| 1292 | 1305 | //调整待发 |
| 1293 | - outgoAdjust(sch.getId(), null, fmtHHmm.print(st), null, "3"); | |
| 1306 | + tempRs = outgoAdjust(sch.getId(), null, fmtHHmm.print(st), null, "3"); | |
| 1307 | + | |
| 1308 | + if(null != tempRs && tempRs.get("ts") != null) | |
| 1309 | + tempTs = (List<ScheduleRealInfo>) tempRs.get("ts"); | |
| 1310 | + | |
| 1311 | + ts.addAll(tempTs); | |
| 1294 | 1312 | } |
| 1295 | 1313 | |
| 1296 | 1314 | rs.put("status", ResponseCode.SUCCESS); |
| 1297 | 1315 | //返回最后一个班次,页面会全量刷新 |
| 1298 | - rs.put("t", sch); | |
| 1316 | + rs.put("ts", ts); | |
| 1299 | 1317 | } |
| 1300 | 1318 | |
| 1301 | 1319 | } catch (Exception e) { |
| ... | ... | @@ -1386,6 +1404,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 1386 | 1404 | sch.setsName(""); |
| 1387 | 1405 | } |
| 1388 | 1406 | |
| 1407 | + LineConfig config = lineConfigData.get(sch.getXlBm()); | |
| 1389 | 1408 | /** |
| 1390 | 1409 | * 调整实发 |
| 1391 | 1410 | */ |
| ... | ... | @@ -1393,13 +1412,13 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 1393 | 1412 | if (StringUtils.isNotBlank(fcsjActual) |
| 1394 | 1413 | && !fcsjActual.equals(sch.getFcsjActual())) { |
| 1395 | 1414 | |
| 1396 | - LineConfig config = lineConfigData.get(sch.getXlBm()); | |
| 1397 | - long t = 0L; | |
| 1415 | + //long t = 0L; | |
| 1398 | 1416 | //小于线路开始运营时间,则默认跨过24点 |
| 1399 | - if (fcsjActual.compareTo(config.getStartOpt()) < 0) | |
| 1417 | + long t = schAttrCalculator.getTime(sch.getScheduleDateStr(), fcsjActual, config); | |
| 1418 | + /* if (fcsjActual.compareTo(config.getStartOpt()) < 0) | |
| 1400 | 1419 | t = fmtyyyyMMddHHmm.parseMillis(fmtyyyyMMdd.print(sch.getScheduleDate().getTime() + DAY_TIME) + fcsjActual); |
| 1401 | 1420 | else |
| 1402 | - t = fmtyyyyMMddHHmm.parseMillis(sch.getScheduleDateStr() + fcsjActual); | |
| 1421 | + t = fmtyyyyMMddHHmm.parseMillis(sch.getScheduleDateStr() + fcsjActual);*/ | |
| 1403 | 1422 | |
| 1404 | 1423 | fLog.log("调整实发时间", sch.getFcsjActual(), fcsjActual); |
| 1405 | 1424 | sch.setFcsjActualAll(t); |
| ... | ... | @@ -1423,7 +1442,9 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 1423 | 1442 | |
| 1424 | 1443 | //调整实达 |
| 1425 | 1444 | fLog.log("调整实达时间", sch.getZdsjActual(), zdsjActual); |
| 1426 | - sch.setZdsjActualAll(zdsjActual); | |
| 1445 | + | |
| 1446 | + long t = schAttrCalculator.getTime(sch.getScheduleDateStr(), zdsjActual, config); | |
| 1447 | + sch.setZdsjActualAll(t); | |
| 1427 | 1448 | //路牌下一班起点到达时间 |
| 1428 | 1449 | ScheduleRealInfo next = dayOfSchedule.nextByLp2(sch); |
| 1429 | 1450 | if (null != next) { |
| ... | ... | @@ -1432,15 +1453,6 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 1432 | 1453 | ts.add(next); |
| 1433 | 1454 | } |
| 1434 | 1455 | |
| 1435 | -/* try{ | |
| 1436 | - //车辆下一个要执行的班次 | |
| 1437 | - ScheduleRealInfo carNext = dayOfSchedule.next(sch); | |
| 1438 | - if(carNext != null && !carNext.getXlBm().equals(sch.getXlBm())){ | |
| 1439 | - DirectivePushQueue.put64(carNext.getClZbh(), carNext.getXlBm(), "套跑@系统"); | |
| 1440 | - fLog.log("下发线路切换指令", sch.getXlName(), carNext.getXlName()); | |
| 1441 | - } | |
| 1442 | - }catch (Exception e){logger.error("", e);}*/ | |
| 1443 | - | |
| 1444 | 1456 | //重新计算车辆执行班次 |
| 1445 | 1457 | dayOfSchedule.reCalcExecPlan(sch.getClZbh()); |
| 1446 | 1458 | } else if(StringUtils.isNotEmpty(sch.getZdsjActual()) && StringUtils.isEmpty(zdsjActual)){ |
| ... | ... | @@ -3005,9 +3017,11 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 3005 | 3017 | Set<ScheduleRealInfo> set = new HashSet<>(); |
| 3006 | 3018 | |
| 3007 | 3019 | ScheduleRealInfo sch; |
| 3020 | + StringBuilder sb = new StringBuilder(); | |
| 3008 | 3021 | |
| 3009 | 3022 | String jGh = null,jName,sGh,sName; |
| 3010 | 3023 | for (ChangePersonCar cpc : cpcs) { |
| 3024 | + sb = new StringBuilder(); | |
| 3011 | 3025 | |
| 3012 | 3026 | sch = dayOfSchedule.get(cpc.getSchId()); |
| 3013 | 3027 | if (sch == null) |
| ... | ... | @@ -3041,7 +3055,10 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 3041 | 3055 | //日志记录 |
| 3042 | 3056 | ScheduleModifyLogger.tzrc(sch, cpc); |
| 3043 | 3057 | |
| 3058 | + //换驾驶员 | |
| 3044 | 3059 | if (StringUtils.isNotEmpty(cpc.getJsy())) { |
| 3060 | + if(!jGh.equals(sch.getjGh())) | |
| 3061 | + sb.append(sch.getjGh() + " 换 " + jGh + ";"); | |
| 3045 | 3062 | //换驾驶员 |
| 3046 | 3063 | if(persoChange(sch, jGh)) |
| 3047 | 3064 | set.add(sch); |
| ... | ... | @@ -3056,6 +3073,9 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 3056 | 3073 | rs.put("status", ResponseCode.ERROR); |
| 3057 | 3074 | return rs; |
| 3058 | 3075 | } |
| 3076 | + | |
| 3077 | + if(!sGh.equals(sch.getsGh())) | |
| 3078 | + sb.append(sch.getsGh() + " 换 " + sGh + ";"); | |
| 3059 | 3079 | if(persoChangeSPY(sch, sGh)) |
| 3060 | 3080 | set.add(sch); |
| 3061 | 3081 | } |
| ... | ... | @@ -3066,10 +3086,14 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 3066 | 3086 | |
| 3067 | 3087 | //换车 |
| 3068 | 3088 | if (StringUtils.isNotEmpty(cpc.getClZbh()) && !cpc.getClZbh().equals(sch.getClZbh())) { |
| 3089 | + sb.append(sch.getClZbh() + " 换 " + cpc.getClZbh() + ";"); | |
| 3069 | 3090 | set.add(sch); |
| 3070 | 3091 | set.addAll(dayOfSchedule.changeCar(sch, cpc.getClZbh())); |
| 3071 | 3092 | } |
| 3072 | 3093 | |
| 3094 | + if(sb.length() > 0) | |
| 3095 | + sch.setRemarks(sb.toString()); | |
| 3096 | + | |
| 3073 | 3097 | dayOfSchedule.save(sch); |
| 3074 | 3098 | set.add(sch); |
| 3075 | 3099 | ... | ... |
src/main/java/com/bsth/service/traffic/VehicleInoutStopService.java
0 → 100644
src/main/java/com/bsth/service/traffic/impl/VehicleInoutStopServiceImpl.java
0 → 100644
| 1 | +package com.bsth.service.traffic.impl; | |
| 2 | + | |
| 3 | +import com.bsth.entity.traffic.VehicleInoutStop; | |
| 4 | +import com.bsth.service.impl.BaseServiceImpl; | |
| 5 | +import com.bsth.service.traffic.VehicleInoutStopService; | |
| 6 | +import org.slf4j.Logger; | |
| 7 | +import org.slf4j.LoggerFactory; | |
| 8 | +import org.springframework.stereotype.Service; | |
| 9 | + | |
| 10 | +/** | |
| 11 | + * | |
| 12 | + * @ClassName: TrafficManageServiceImpl(运管处接口service业务层实现类) | |
| 13 | + * | |
| 14 | + * @Extends : BaseService | |
| 15 | + * | |
| 16 | + * @Description: | |
| 17 | + * | |
| 18 | + * @Author bsth@zq | |
| 19 | + * | |
| 20 | + * @Date 2016年10月28日 上午9:21:17 | |
| 21 | + * | |
| 22 | + * @Version 公交调度系统BS版 0.1 | |
| 23 | + * | |
| 24 | + */ | |
| 25 | + | |
| 26 | +@Service | |
| 27 | +public class VehicleInoutStopServiceImpl extends BaseServiceImpl<VehicleInoutStop,Integer> implements VehicleInoutStopService { | |
| 28 | + | |
| 29 | + Logger logger = LoggerFactory.getLogger(this.getClass()); | |
| 30 | + | |
| 31 | +} | ... | ... |
src/main/resources/fatso/handle_real_ctl.js
| ... | ... | @@ -11,32 +11,35 @@ var fs = require('fs') |
| 11 | 11 | |
| 12 | 12 | var platform = process.platform; |
| 13 | 13 | var iswin = platform=='win32'; |
| 14 | -var separator = platform=='win32'?'\\':'/'; | |
| 14 | +var sp = platform=='win32'?'\\':'/'; | |
| 15 | 15 | //不参与的目录 |
| 16 | 16 | var pName = 'bsth_control' |
| 17 | 17 | , path = process.cwd() |
| 18 | 18 | //根目录 |
| 19 | - , root = path.substr(0, path.indexOf(separator + 'src'+separator+'main')) | |
| 20 | - , workspace = root.substr(0, root.lastIndexOf(separator + pName)) | |
| 19 | + , root = path.substr(0, path.indexOf(sp + 'src'+sp+'main')) | |
| 20 | + , workspace = root.substr(0, root.lastIndexOf(sp + pName)) | |
| 21 | 21 | //临时目录 |
| 22 | - , dest = (workspace + separator + pName + '@fatso_copy')//.replace(/\//g, '\\') | |
| 23 | - , _static = separator + 'src'+separator+'main'+separator+'resources'+separator+'static'; | |
| 22 | + , dest = (workspace + sp + pName + '@fatso_copy')//.replace(/\//g, '\\') | |
| 23 | + , _static = sp + 'src'+sp+'main'+sp+'resources'+sp+'static'; | |
| 24 | 24 | |
| 25 | 25 | |
| 26 | -var mainFile = dest + _static + separator + 'real_control_v2'+separator+'main.html'; | |
| 27 | -var mapFile = dest + _static + separator + 'real_control_v2'+separator+'mapmonitor'+separator+'real.html'; | |
| 26 | +var mainFile = dest + _static + sp + 'real_control_v2'+sp+'main.html'; | |
| 27 | +var aloneMapWrapFile = dest + _static + sp + 'real_control_v2'+sp+'alone_page'+sp+'map'+sp+'alone_wrap.html'; | |
| 28 | +var aloneHomeWrapFile = dest + _static + sp + 'real_control_v2'+sp+'alone_page'+sp+'home'+sp+'home_wrap.html'; | |
| 29 | +var mapFile = dest + _static + sp + 'real_control_v2'+sp+'mapmonitor'+sp+'real.html'; | |
| 28 | 30 | var realCtl = { |
| 29 | 31 | /** |
| 30 | 32 | * 处理线调首页 |
| 31 | 33 | */ |
| 32 | 34 | handleMain: function (cb) { |
| 33 | - //读取文件 | |
| 34 | - var data = fs.readFileSync(mainFile, 'utf-8') | |
| 35 | - , $ = cheerio.load(data); | |
| 36 | - | |
| 35 | + //处理main.html | |
| 36 | + var data = fs.readFileSync(mainFile, 'utf-8'), | |
| 37 | + $ = cheerio.load(data); | |
| 37 | 38 | handleCss($, function () { |
| 38 | 39 | handleJs($, mainFile, cb); |
| 39 | 40 | }); |
| 41 | + | |
| 42 | + | |
| 40 | 43 | }, |
| 41 | 44 | /** |
| 42 | 45 | * 处理地图模块 |
| ... | ... | @@ -50,7 +53,30 @@ var realCtl = { |
| 50 | 53 | handleCss($, function () { |
| 51 | 54 | handleJs($, mapFile, cb); |
| 52 | 55 | }); |
| 56 | + }, | |
| 57 | + /** | |
| 58 | + * 处理单屏地图页面 | |
| 59 | + * @param cb | |
| 60 | + */ | |
| 61 | + handleAlonePage: function (cb) { | |
| 62 | + var data = fs.readFileSync(aloneMapWrapFile, 'utf-8'); | |
| 63 | + var $ = cheerio.load(data); | |
| 64 | + handleCss($, function () { | |
| 65 | + handleJs($, aloneMapWrapFile, cb); | |
| 66 | + }); | |
| 67 | + }, | |
| 68 | + /** | |
| 69 | + * 处理单屏主页 | |
| 70 | + * @param cb | |
| 71 | + */ | |
| 72 | + handleAloneHomePage: function (cb) { | |
| 73 | + var data = fs.readFileSync(aloneHomeWrapFile, 'utf-8'); | |
| 74 | + var $ = cheerio.load(data); | |
| 75 | + handleCss($, function () { | |
| 76 | + handleJs($, aloneHomeWrapFile, cb); | |
| 77 | + }); | |
| 53 | 78 | } |
| 79 | + | |
| 54 | 80 | }; |
| 55 | 81 | |
| 56 | 82 | /** |
| ... | ... | @@ -84,7 +110,7 @@ var handleCss = function ($, cb) { |
| 84 | 110 | var data = out.styles; |
| 85 | 111 | var fName = (k + '_' + md5(data)) + '.css'; |
| 86 | 112 | //写入 assets css 目录下 |
| 87 | - var descFile = dest + _static + separator + 'real_control_v2'+separator+'assets'+separator+'css' + separator + fName; | |
| 113 | + var descFile = dest + _static + sp + 'real_control_v2'+sp+'assets'+sp+'css' + sp + fName; | |
| 88 | 114 | fs.open(descFile, 'a', function (err, fd) { |
| 89 | 115 | |
| 90 | 116 | fs.write(fd, data, function () { |
| ... | ... | @@ -138,7 +164,7 @@ var handleJs = function ($, file, cb) { |
| 138 | 164 | var data = result.code; |
| 139 | 165 | var fName = (k + '_' + md5(data)) + '.js'; |
| 140 | 166 | //写入 assets js 目录下 |
| 141 | - var descFile = dest + _static + separator + 'real_control_v2'+separator+'assets'+separator+'js' + separator + fName; | |
| 167 | + var descFile = dest + _static + sp + 'real_control_v2'+sp+'assets'+sp+'js' + sp + fName; | |
| 142 | 168 | fs.open(descFile, 'a', function (err, fd) { |
| 143 | 169 | |
| 144 | 170 | fs.write(fd, data, function () { | ... | ... |
src/main/resources/fatso/parse.js
src/main/resources/fatso/start.js
| ... | ... | @@ -14,19 +14,19 @@ var fs = require('fs') |
| 14 | 14 | |
| 15 | 15 | var platform = process.platform; |
| 16 | 16 | var iswin = platform=='win32'; |
| 17 | -var separator = platform=='win32'?'\\':'/'; | |
| 17 | +var sp = platform=='win32'?'\\':'/'; | |
| 18 | 18 | //不参与的目录 |
| 19 | -var excludes = ['scheduleApp', 'trafficManage', 'control', 'permission'+separator+'authorize_all', 'summary'] | |
| 19 | +var excludes = ['scheduleApp', 'trafficManage', 'control', 'permission'+sp+'authorize_all', 'summary', 'report'+sp+'oil'] | |
| 20 | 20 | ,ep = new EventProxy() |
| 21 | 21 | ,pName = 'bsth_control' |
| 22 | 22 | ,path = process.cwd() |
| 23 | 23 | //根目录 |
| 24 | - ,root = path.substr(0, path.indexOf(separator + 'src'+separator+'main')) | |
| 25 | - ,workspace = root.substr(0, root.lastIndexOf(separator + pName)) | |
| 24 | + ,root = path.substr(0, path.indexOf(sp + 'src'+sp+'main')) | |
| 25 | + ,workspace = root.substr(0, root.lastIndexOf(sp + pName)) | |
| 26 | 26 | //临时目录 |
| 27 | - ,dest = (workspace + separator + pName+'@fatso_copy') | |
| 28 | - ,_static = separator + 'src'+separator+'main'+separator+'resources'+separator+'static' | |
| 29 | - ,_pages = dest + _static + separator + 'pages'; | |
| 27 | + ,dest = (workspace + sp + pName+'@fatso_copy') | |
| 28 | + ,_static = sp + 'src'+sp+'main'+sp+'resources'+sp+'static' | |
| 29 | + ,_pages = dest + _static + sp + 'pages'; | |
| 30 | 30 | |
| 31 | 31 | |
| 32 | 32 | //创建临时目录 |
| ... | ... | @@ -45,7 +45,7 @@ ep.tail('mvn-clean',function(){ |
| 45 | 45 | //ep.emit('copy-project'); |
| 46 | 46 | //清理target |
| 47 | 47 | logInfo('mvn clean...'); |
| 48 | - cProcess = child_process.exec("mvn clean",{cwd: workspace + separator + pName},function(error){ | |
| 48 | + cProcess = child_process.exec("mvn clean",{cwd: workspace + sp + pName},function(error){ | |
| 49 | 49 | if(error) |
| 50 | 50 | logError(error); |
| 51 | 51 | |
| ... | ... | @@ -88,7 +88,7 @@ ep.tail('minifier-js', function(){ |
| 88 | 88 | //再处理首页 |
| 89 | 89 | ep.emit('handle-index', function(){ |
| 90 | 90 | //递归处理片段 |
| 91 | - walk(dest + _static + separator + 'pages', function(item){ | |
| 91 | + walk(dest + _static + sp + 'pages', function(item){ | |
| 92 | 92 | ep.emit('handle-fragment', item); |
| 93 | 93 | }, |
| 94 | 94 | function(){ |
| ... | ... | @@ -96,7 +96,13 @@ ep.tail('minifier-js', function(){ |
| 96 | 96 | handle_real_ctl.handleMain(function () { |
| 97 | 97 | //处理线调地图 |
| 98 | 98 | handle_real_ctl.handleMap(function () { |
| 99 | - ep.emit('package-jar'); | |
| 99 | + //处理单屏地图页面 | |
| 100 | + handle_real_ctl.handleAlonePage(function () { | |
| 101 | + //处理单屏主页 | |
| 102 | + handle_real_ctl.handleAloneHomePage(function () { | |
| 103 | + ep.emit('package-jar'); | |
| 104 | + }); | |
| 105 | + }); | |
| 100 | 106 | }); |
| 101 | 107 | }); |
| 102 | 108 | }); |
| ... | ... | @@ -112,7 +118,7 @@ ep.tail('package-jar', function(file){ |
| 112 | 118 | |
| 113 | 119 | logSuccess('mvn package success'); |
| 114 | 120 | |
| 115 | - console.log(('成功打包在 ' + dest + separator + 'target 目录下').cyan); | |
| 121 | + console.log(('成功打包在 ' + dest + sp + 'target 目录下').cyan); | |
| 116 | 122 | }); |
| 117 | 123 | |
| 118 | 124 | output(cProcess); |
| ... | ... | @@ -122,7 +128,7 @@ ep.tail('package-jar', function(file){ |
| 122 | 128 | ep.tail('handle-fragment', function(file){ |
| 123 | 129 | //要排除的文件 |
| 124 | 130 | for(var i = 0, ex; ex = excludes[i++];){ |
| 125 | - if(file.indexOf(_pages + separator + ex) != -1) | |
| 131 | + if(file.indexOf(_pages + sp + ex) != -1) | |
| 126 | 132 | return false; |
| 127 | 133 | } |
| 128 | 134 | handleJavascript(file, function(mini, $){ |
| ... | ... | @@ -139,12 +145,12 @@ ep.tail('handle-fragment', function(file){ |
| 139 | 145 | |
| 140 | 146 | //处理首页 |
| 141 | 147 | ep.tail('handle-index', function(cb){ |
| 142 | - var index = dest + _static + separator + 'index.html'; | |
| 148 | + var index = dest + _static + sp + 'index.html'; | |
| 143 | 149 | handleJavascript(index, function(mini, $){ |
| 144 | 150 | var jsMiniText = mini.inside + mini.outside; |
| 145 | 151 | |
| 146 | 152 | var code = md5(jsMiniText); |
| 147 | - fs.open( dest + _static + separator + 'assets'+separator+'js' + separator + code + '.js', 'a', function(err, fd){ | |
| 153 | + fs.open( dest + _static + sp + 'assets'+sp+'js' + sp + code + '.js', 'a', function(err, fd){ | |
| 148 | 154 | if(err) |
| 149 | 155 | logError(err); |
| 150 | 156 | |
| ... | ... | @@ -204,7 +210,7 @@ function write(file, text){ |
| 204 | 210 | console.log(err.toString().red); |
| 205 | 211 | process.exit(); |
| 206 | 212 | } |
| 207 | - console.log(file.green); | |
| 213 | + //console.log(file.green); | |
| 208 | 214 | }); |
| 209 | 215 | } |
| 210 | 216 | |
| ... | ... | @@ -219,7 +225,7 @@ function walk(path ,handleFile, over) { |
| 219 | 225 | console.log('read dir error'.red); |
| 220 | 226 | } else { |
| 221 | 227 | files.forEach(function(item) { |
| 222 | - var tmpPath = path + separator + item; | |
| 228 | + var tmpPath = path + sp + item; | |
| 223 | 229 | fs.stat(tmpPath, function(err1, stats) { |
| 224 | 230 | if (err1) { |
| 225 | 231 | console.log('stat error'); | ... | ... |
src/main/resources/static/pages/control/lineallot/allot.html
| 1 | 1 | <style> |
| 2 | 2 | .line-select { |
| 3 | 3 | border: 1px solid #ddd; |
| 4 | - height: 350px; | |
| 4 | + height: 310px; | |
| 5 | 5 | margin-top: 15px; |
| 6 | 6 | box-shadow: 0 2px 5px 0 rgba(221, 221, 221, 0.24), 0 2px 10px 0 rgba(221, 221, 221, 0.24); |
| 7 | 7 | } |
| ... | ... | @@ -35,7 +35,7 @@ |
| 35 | 35 | .line-select-cont { |
| 36 | 36 | text-align: left; |
| 37 | 37 | overflow: auto; |
| 38 | - height: 270px; | |
| 38 | + height: 230px; | |
| 39 | 39 | padding-right: 0px; |
| 40 | 40 | } |
| 41 | 41 | |
| ... | ... | @@ -267,7 +267,7 @@ |
| 267 | 267 | var htmlStr = template('line_select_cont_temp', {list: newArray}); |
| 268 | 268 | $('.line-select-body').html(htmlStr) |
| 269 | 269 | .slimscroll({//滚动条 |
| 270 | - height: '270px' | |
| 270 | + height: '230px' | |
| 271 | 271 | }); |
| 272 | 272 | |
| 273 | 273 | //映射 | ... | ... |
src/main/resources/static/real_control_v2/alone_page/home/alone_data_basic.js
0 → 100644
| 1 | +/* 基础数据管理模块 */ | |
| 2 | + | |
| 3 | +var gb_data_basic = (function () { | |
| 4 | + | |
| 5 | + var stationRoutes, lineCode2NameAll, lineInformations, nbbm2deviceMap, device2nbbmMap, allPersonnel, svgAttrs; | |
| 6 | + var ep = EventProxy.create("stationRoutes", "lineCode2Name", "lineInformations", "nbbm2deviceId", "all_personnel", "svg_attrs" | |
| 7 | + , function (routes, code2Name, informations, nbbm2device, all_personnel, svgAttrMap) { | |
| 8 | + stationRoutes = routes; | |
| 9 | + lineCode2NameAll = code2Name; | |
| 10 | + lineInformations = informations; | |
| 11 | + nbbm2deviceMap = nbbm2device; | |
| 12 | + device2nbbmMap = gb_common.inverse(nbbm2deviceMap); | |
| 13 | + allPersonnel = all_personnel; | |
| 14 | + svgAttrs = svgAttrMap; | |
| 15 | + | |
| 16 | + res_load_ep.emitLater('data-basic'); | |
| 17 | + }); | |
| 18 | + | |
| 19 | + var storage = window.localStorage; | |
| 20 | + //激活的线路 | |
| 21 | + var activeLines = JSON.parse(storage.getItem('lineControlItems')); | |
| 22 | + //lineCode to line object | |
| 23 | + var codeToLine = {}; | |
| 24 | + //lineCode idx string | |
| 25 | + var line_idx = (function () { | |
| 26 | + var str = ''; | |
| 27 | + for (var i = 0, item; item = activeLines[i++];) { | |
| 28 | + str += (',' + item.lineCode); | |
| 29 | + codeToLine[item.lineCode] = item; | |
| 30 | + } | |
| 31 | + return str.substr(1); | |
| 32 | + })(); | |
| 33 | + | |
| 34 | + //站点路由 | |
| 35 | + gb_common.$get('/stationroute/multiLine', {lineIds: line_idx}, function (rs) { | |
| 36 | + var list = rs.list;//JSON.parse(rs.list); | |
| 37 | + var routeData = gb_common.groupBy(list, 'lineCode'); | |
| 38 | + //排序 | |
| 39 | + for (var lineCode in routeData) { | |
| 40 | + routeData[lineCode].sort(stationRouteSort); | |
| 41 | + } | |
| 42 | + ep.emit('stationRoutes', routeData); | |
| 43 | + }); | |
| 44 | + | |
| 45 | + //线路标准信息 | |
| 46 | + /*gb_common.$get('/lineInformation/line/multi', {lineCodes: line_idx}, function (rs) { | |
| 47 | + var informations = {}; | |
| 48 | + $.each(rs, function () { | |
| 49 | + informations[this.line.lineCode] = this; | |
| 50 | + delete this['line']; | |
| 51 | + }); | |
| 52 | + ep.emit('lineInformations', informations); | |
| 53 | + });*/ | |
| 54 | + ep.emit('lineInformations', {}); | |
| 55 | + | |
| 56 | + //人员信息 | |
| 57 | + ep.emit('all_personnel', {}); | |
| 58 | + /*loadAllPersonnel(function (data) { | |
| 59 | + ep.emit('all_personnel', data); | |
| 60 | + }); | |
| 61 | + function loadAllPersonnel(cb) { | |
| 62 | + $.get('/personnel/all_py', function (rs) { | |
| 63 | + //转换成自动补全组件需要的数据 | |
| 64 | + var data = [], code; | |
| 65 | + for(var i =0, p; p = rs[i++];){ | |
| 66 | + code = p['workId'].indexOf('-')!=-1?p['workId'].split('-')[1]:p['workId']; | |
| 67 | + data.push({ | |
| 68 | + value: code + '/' + p.name, | |
| 69 | + fullChars: p.fullChars.toUpperCase(), | |
| 70 | + camelChars: p.camelChars.toUpperCase() | |
| 71 | + }); | |
| 72 | + } | |
| 73 | + cb && cb(data); | |
| 74 | + }); | |
| 75 | + }*/ | |
| 76 | + | |
| 77 | + var carparks = {}; | |
| 78 | + //停车场数据 | |
| 79 | +/* gb_common.$get('/realMap/carParkSpatialData', {}, function (rs) { | |
| 80 | + rs.list.sort(function (a, b) { | |
| 81 | + return a.parkName.localeCompare(b.parkName); | |
| 82 | + }); | |
| 83 | + $.each(rs.list, function () { | |
| 84 | + carparks[this.parkCode] = this; | |
| 85 | + }); | |
| 86 | + });*/ | |
| 87 | + | |
| 88 | + //车辆数据 | |
| 89 | + var carsArray; | |
| 90 | + /*$.get('/basic/cars?t=' + Math.random(), function (rs) { | |
| 91 | + carsArray = rs; | |
| 92 | + });*/ | |
| 93 | + | |
| 94 | + var getCarparkByCode = function (code) { | |
| 95 | + return carparks[code]; | |
| 96 | + }; | |
| 97 | + | |
| 98 | + //line code to name | |
| 99 | + $.get('/basic/lineCode2Name', function (rs) { | |
| 100 | + ep.emit('lineCode2Name', rs); | |
| 101 | + }); | |
| 102 | + | |
| 103 | + //nbbm to device id | |
| 104 | + $.get('/basic/nbbm2deviceId', function (rs) { | |
| 105 | + ep.emit('nbbm2deviceId', rs); | |
| 106 | + }); | |
| 107 | + //nbbm to 车牌号 | |
| 108 | + var nbbm2PlateMap; | |
| 109 | + $.get('/basic/nbbm2PlateNo', function (rs) { | |
| 110 | + nbbm2PlateMap = rs; | |
| 111 | + }); | |
| 112 | + | |
| 113 | + //模拟图属性数据 | |
| 114 | + gb_common.$get('/realSchedule/svgAttr', {idx: line_idx}, function (rs) { | |
| 115 | + var data = {}; | |
| 116 | + $.each(rs.list, function () { | |
| 117 | + this.hideStations = JSON.parse(this.hideStations); | |
| 118 | + this.nicknames = JSON.parse(this.nicknames); | |
| 119 | + data[this.lineCode] = this; | |
| 120 | + }); | |
| 121 | + ep.emit('svg_attrs', data); | |
| 122 | + }); | |
| 123 | + | |
| 124 | + //站点和停车场历时、公里对照数据 | |
| 125 | + var stat_park_data; | |
| 126 | + /*var load_stat_park_data = function () { | |
| 127 | + $.get('/basic/station2ParkData?t='+Math.random(), {idx: line_idx}, function (rs) { | |
| 128 | + stat_park_data = rs; | |
| 129 | + }); | |
| 130 | + } | |
| 131 | + load_stat_park_data();*/ | |
| 132 | + | |
| 133 | + function findLineByCodes(codeArr) { | |
| 134 | + var rs = []; | |
| 135 | + $.each(codeArr, function () { | |
| 136 | + rs.push(codeToLine[this]); | |
| 137 | + }); | |
| 138 | + return rs; | |
| 139 | + } | |
| 140 | + | |
| 141 | + var findCodeByLinename = function (name) { | |
| 142 | + for (var code in lineCode2NameAll) { | |
| 143 | + if (name == lineCode2NameAll[code]) | |
| 144 | + return code; | |
| 145 | + } | |
| 146 | + | |
| 147 | + return null; | |
| 148 | + }; | |
| 149 | + | |
| 150 | + var getLineInformation = function (lineCode) { | |
| 151 | + return lineInformations[lineCode]; | |
| 152 | + }; | |
| 153 | + | |
| 154 | + var stationRouteSort = function (a, b) { | |
| 155 | + return a.stationRouteCode - b.stationRouteCode; | |
| 156 | + }; | |
| 157 | + | |
| 158 | + /** | |
| 159 | + * 常用的备注补全列表 | |
| 160 | + */ | |
| 161 | + var remarksArray = ['保养', '故障', '肇事', '加油', '维修', '援外', '路阻' | |
| 162 | + , '故障(离合器坏)', '故障,(方向盘坏)', '故障(排挡坏)', '故障(门坏)', '故障(雨刮器坏)','故障(刹车坏)', '故障(气打不上)' | |
| 163 | + ,'故障(整车无电)', '故障(故障灯常亮)', '故障(警报灯亮)', '故障(玻璃坏)', '故障(反光镜坏)', '故障(发电机坏)', '故障(漏防冻液)' | |
| 164 | + , '故障(漏水)','故障(轮胎坏)', '故障(无动力)', '故障(喷机油)', '故障(水温高)', '保养(一级保养)' | |
| 165 | + , '保养(二级保养)', '保养(三级保养)', '换车出场', '临加进场', '临加出场']; | |
| 166 | + var remarksMapps = []; | |
| 167 | + $.each(remarksArray, function (i, t) { | |
| 168 | + remarksMapps.push({ | |
| 169 | + value: t, | |
| 170 | + fullChars: pinyin.getFullChars(t).toUpperCase(), | |
| 171 | + camelChars: pinyin.getCamelChars(t) | |
| 172 | + }); | |
| 173 | + }); | |
| 174 | + | |
| 175 | + //文件载入完毕 | |
| 176 | + res_load_ep.emitLater('load_data_basic'); | |
| 177 | + | |
| 178 | + return { | |
| 179 | + activeLines: activeLines, | |
| 180 | + line_idx: line_idx, | |
| 181 | + codeToLine: codeToLine, | |
| 182 | + nbbm2deviceMap: function () { | |
| 183 | + return nbbm2deviceMap; | |
| 184 | + }, | |
| 185 | + device2nbbmMap: function () { | |
| 186 | + return device2nbbmMap; | |
| 187 | + }, | |
| 188 | + getLineInformation: getLineInformation, | |
| 189 | + allInformations: function () { | |
| 190 | + return lineInformations; | |
| 191 | + }, | |
| 192 | + stationRoutes: function (lineCode) { | |
| 193 | + return stationRoutes[lineCode] | |
| 194 | + }, | |
| 195 | + findLineByCodes: findLineByCodes, | |
| 196 | + lineCode2NameAll: function () { | |
| 197 | + return lineCode2NameAll | |
| 198 | + }, | |
| 199 | + allPersonnel: function () { | |
| 200 | + return allPersonnel; | |
| 201 | + }, | |
| 202 | + findCodeByLinename: findCodeByLinename, | |
| 203 | + getCarparkByCode: getCarparkByCode, | |
| 204 | + getSvgAttr: function (lineCode) { | |
| 205 | + return svgAttrs[lineCode]; | |
| 206 | + }, | |
| 207 | + setSvgAttr: function (attr) { | |
| 208 | + attr.hideStations = JSON.parse(attr.hideStations); | |
| 209 | + attr.nicknames = JSON.parse(attr.nicknames); | |
| 210 | + svgAttrs[attr.lineCode] = attr; | |
| 211 | + }, | |
| 212 | + //是否是环线 | |
| 213 | + isLoopLine: function (lineCode) { | |
| 214 | + var data = gb_common.groupBy(stationRoutes[lineCode], 'directions'); | |
| 215 | + //下行只有2个站点 | |
| 216 | + var len = data[0].length; | |
| 217 | + if (len > 0 && data[1].length == 2) { | |
| 218 | + var first = data[0][0], | |
| 219 | + end = data[0][len - 1]; | |
| 220 | + | |
| 221 | + /*if(first.stationName != end.stationName) | |
| 222 | + return false;*/ | |
| 223 | + | |
| 224 | + var fPoint = {latitude: first.station.gLaty, longitude: first.station.gLonx} | |
| 225 | + , ePoint = {latitude: end.station.gLaty, longitude: end.station.gLonx}; | |
| 226 | + | |
| 227 | + //并且上行起终点距离200米内 | |
| 228 | + if (geolib.getDistance(fPoint, ePoint) < 200) { | |
| 229 | + return true; | |
| 230 | + } | |
| 231 | + } | |
| 232 | + | |
| 233 | + return false; | |
| 234 | + }, | |
| 235 | + //刷新员工信息 | |
| 236 | + refreshAllPersonnel: function (cb) { | |
| 237 | + loadAllPersonnel(function (data) { | |
| 238 | + allPersonnel = data; | |
| 239 | + cb && cb(); | |
| 240 | + }); | |
| 241 | + }, | |
| 242 | + nbbm2PlateMap: function () { | |
| 243 | + return nbbm2PlateMap; | |
| 244 | + }, | |
| 245 | + carsArray: function () { | |
| 246 | + return carsArray; | |
| 247 | + }, | |
| 248 | + simpleParksArray: function () { | |
| 249 | + var map = {}; | |
| 250 | + for(var code in carparks) | |
| 251 | + map[code] = carparks[code].parkName; | |
| 252 | + return map; | |
| 253 | + }, | |
| 254 | + remarksMapps: function () { | |
| 255 | + return remarksMapps; | |
| 256 | + }, | |
| 257 | + get_stat_park_data: function () { | |
| 258 | + return stat_park_data; | |
| 259 | + }, | |
| 260 | + reload_stat_park_data: function () { | |
| 261 | + load_stat_park_data(); | |
| 262 | + } | |
| 263 | + }; | |
| 264 | +})(); | ... | ... |
src/main/resources/static/real_control_v2/alone_page/home/alone_data_gps.js
0 → 100644
| 1 | +/* gps 数据管理模块 */ | |
| 2 | + | |
| 3 | +var gb_data_gps = (function () { | |
| 4 | + | |
| 5 | + //fixed time refresh delay | |
| 6 | + var delay = 1000 * 7; | |
| 7 | + //deviceId ——> gps | |
| 8 | + var realData = {}; | |
| 9 | + //refresh after callback | |
| 10 | + var refreshEventCallbacks = []; | |
| 11 | + //register callback function | |
| 12 | + var registerCallback = function (cb) { | |
| 13 | + if (cb) | |
| 14 | + refreshEventCallbacks.push(cb); | |
| 15 | + }; | |
| 16 | + | |
| 17 | + var refresh = function (cb) { | |
| 18 | + $.ajax({ | |
| 19 | + url: '/gps/real/line', | |
| 20 | + data: {lineCodes: gb_data_basic.line_idx}, | |
| 21 | + dataType: 'json', | |
| 22 | + success: function (rs) { | |
| 23 | + //用定时的gps来检测session断开 | |
| 24 | + if(rs.status && rs.status==407){ | |
| 25 | + location.href = '/login.html'; | |
| 26 | + return; | |
| 27 | + } | |
| 28 | + refreshData(rs); | |
| 29 | + cb(); | |
| 30 | + }, | |
| 31 | + error: function (xr, t) { | |
| 32 | + notify_err('刷新GPS失败,稍后重试' + t); | |
| 33 | + cb(); | |
| 34 | + } | |
| 35 | + }); | |
| 36 | + }; | |
| 37 | + | |
| 38 | + var refreshData = function (rs) { | |
| 39 | + var old, addArr = [], | |
| 40 | + upArr = [], | |
| 41 | + upDownChange = []; | |
| 42 | + | |
| 43 | + var schArray; | |
| 44 | + $.each(rs, function () { | |
| 45 | + old = realData[this.deviceId]; | |
| 46 | + if (old) { | |
| 47 | + if (this.timestamp > old.timestamp) { | |
| 48 | + if (old.upDown != this.upDown) | |
| 49 | + upDownChange.push(this); | |
| 50 | + else | |
| 51 | + upArr.push(this); | |
| 52 | + } | |
| 53 | + | |
| 54 | + } else | |
| 55 | + addArr.push(this); | |
| 56 | + | |
| 57 | + //班次信息 | |
| 58 | + /*if (this.schId) { | |
| 59 | + schArray = gb_schedule_table.findScheduleByLine(this.lineId); | |
| 60 | + if (schArray) | |
| 61 | + this.sch = schArray[this.schId]; | |
| 62 | + }*/ | |
| 63 | + | |
| 64 | + //时间格式化 | |
| 65 | + this.dateStr = moment(this.timestamp).format('YYYY-MM-DD HH:mm:ss'); | |
| 66 | + realData[this.deviceId] = this; | |
| 67 | + }); | |
| 68 | + | |
| 69 | + //console.log('add array size: ' + addArr.length, 'up array size: ' + upArr.length); | |
| 70 | + //CCCallFuncN | |
| 71 | + $.each(refreshEventCallbacks, function (i, cb) { | |
| 72 | + cb(addArr, upArr, upDownChange); | |
| 73 | + }); | |
| 74 | + | |
| 75 | + }; | |
| 76 | + | |
| 77 | + var startFixedTime; | |
| 78 | + var fixedTimeRefresh = function () { | |
| 79 | + if (startFixedTime) | |
| 80 | + return; | |
| 81 | + startFixedTime = true; | |
| 82 | + | |
| 83 | + (function () { | |
| 84 | + var f = arguments.callee; | |
| 85 | + refresh(function () { | |
| 86 | + setTimeout(f, delay); | |
| 87 | + }); | |
| 88 | + })(); | |
| 89 | + }; | |
| 90 | + | |
| 91 | + var gpsByLineCode = function (lineCode) { | |
| 92 | + var rs = []; | |
| 93 | + for (var device in realData) { | |
| 94 | + if (realData[device].lineId == lineCode) | |
| 95 | + rs.push(realData[device]); | |
| 96 | + } | |
| 97 | + return rs; | |
| 98 | + }; | |
| 99 | + | |
| 100 | + var findOne = function (deviceId) { | |
| 101 | + return realData[deviceId]; | |
| 102 | + }; | |
| 103 | + | |
| 104 | + var findGpsByNbbm = function (nbbm) { | |
| 105 | + return realData[gb_data_basic.nbbm2deviceMap()[nbbm]]; | |
| 106 | + }; | |
| 107 | + | |
| 108 | + /** | |
| 109 | + * 设备掉线事件 | |
| 110 | + */ | |
| 111 | + var deviceOffline = function (gps) { | |
| 112 | + $.each(offlineCallbacks, function (i, cb) { | |
| 113 | + cb(gps); | |
| 114 | + }); | |
| 115 | + }; | |
| 116 | + | |
| 117 | + //注册掉线事件回调函数 | |
| 118 | + var offlineCallbacks = []; | |
| 119 | + var registerOfflineCb = function (cb) { | |
| 120 | + if (cb) | |
| 121 | + offlineCallbacks.push(cb); | |
| 122 | + }; | |
| 123 | + | |
| 124 | + return { | |
| 125 | + fixedTimeRefresh: fixedTimeRefresh, | |
| 126 | + registerCallback: registerCallback, | |
| 127 | + allGps: realData, | |
| 128 | + gpsByLineCode: gpsByLineCode, | |
| 129 | + findOne: findOne, | |
| 130 | + findGpsByNbbm: findGpsByNbbm, | |
| 131 | + deviceOffline: deviceOffline, | |
| 132 | + registerOfflineCb: registerOfflineCb | |
| 133 | + }; | |
| 134 | +})(); | ... | ... |
src/main/resources/static/real_control_v2/alone_page/home/home_wrap.html
0 → 100644
| 1 | +<!DOCTYPE html> | |
| 2 | +<html lang="zh-cn"> | |
| 3 | + | |
| 4 | +<head> | |
| 5 | + <meta charset="UTF-8"> | |
| 6 | + <title>主页模拟图</title> | |
| 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" merge="plugins"/> | |
| 10 | + <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/components/tooltip.gradient.min.css" merge="plugins"/> | |
| 11 | + <link rel="stylesheet" | |
| 12 | + href="/real_control_v2/assets/plugins/uikit-2.27.1/components/autocomplete.gradient.min.css" merge="plugins"/> | |
| 13 | + <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/components/sticky.gradient.min.css" merge="plugins"/> | |
| 14 | + | |
| 15 | + <!-- main style --> | |
| 16 | + <link rel="stylesheet" href="/real_control_v2/css/main.css" /> | |
| 17 | + <!-- home style --> | |
| 18 | + <link rel="stylesheet" href="/real_control_v2/css/home.css" merge="custom_style"/> | |
| 19 | + | |
| 20 | + <!-- custom table --> | |
| 21 | + <link rel="stylesheet" href="/real_control_v2/css/ct_table.css" merge="custom_style"/> | |
| 22 | + <!-- jquery contextMenu style --> | |
| 23 | + <link rel="stylesheet" href="/real_control_v2/assets/css/jquery.contextMenu.min.css" merge="plugins"/> | |
| 24 | + <!-- formvalidation style --> | |
| 25 | + <link rel="stylesheet" href="/real_control_v2/assets/plugins/formvalidation/formValidation.min.css" merge="plugins"/> | |
| 26 | + <!-- js tree --> | |
| 27 | + <link rel="stylesheet" href="/real_control_v2/assets/plugins/jstree/default/style.css" merge="plugins"/> | |
| 28 | + <!-- tooltip css--> | |
| 29 | + <link rel="stylesheet" href="/real_control_v2/assets/plugins/qtip/jquery.qtip.min.css" merge="plugins"/> | |
| 30 | + <link rel="stylesheet" href="/real_control_v2/css/pace.css" merge="plugins"/> | |
| 31 | + | |
| 32 | + <link rel="stylesheet" href="/real_control_v2/css/modal_extend.css" merge="custom_style"/> | |
| 33 | + <!-- perfect-scrollbar style --> | |
| 34 | + <link rel="stylesheet" href="/real_control_v2/assets/plugins/perfect-scrollbar/perfect-scrollbar.css" merge="plugins"/> | |
| 35 | + <!-- layer 3.0.3 --> | |
| 36 | + <link rel="stylesheet" href="/real_control_v2/assets/plugins/layer3.0.3/skin/default/layer.css" merge="plugins"/> | |
| 37 | + <link rel="stylesheet" href="/real_control_v2/assets/plugins/layer3.0.3/skin/moon/style.css" merge="plugins"/> | |
| 38 | + | |
| 39 | + | |
| 40 | + <style> | |
| 41 | + .main-container{ | |
| 42 | + height: 100% !important; | |
| 43 | + } | |
| 44 | + | |
| 45 | + #main-tab-content{ | |
| 46 | + padding: 0 !important; | |
| 47 | + } | |
| 48 | + | |
| 49 | + .home-panel{ | |
| 50 | + | |
| 51 | + } | |
| 52 | + | |
| 53 | + #home-main-content{ | |
| 54 | + padding: 0 !important; | |
| 55 | + } | |
| 56 | + | |
| 57 | + #main-tab-content>.home-panel>#home-main-content{ | |
| 58 | + overflow: inherit !important; | |
| 59 | + } | |
| 60 | + </style> | |
| 61 | +</head> | |
| 62 | + | |
| 63 | +<body> | |
| 64 | +<!--<div class="main-container" style="height: 100%;"> | |
| 65 | +</div>--> | |
| 66 | +<div class="main-container"> | |
| 67 | + <ul id="main-tab-content"> | |
| 68 | + <li class="home-panel"></li> | |
| 69 | + </ul> | |
| 70 | +</div> | |
| 71 | + | |
| 72 | + | |
| 73 | +<!-- 地图相关 --> | |
| 74 | +<script src="http://api.map.baidu.com/api?v=2.0&ak=IGGrr4UjwIYzatoCRFKEL8sT"></script> | |
| 75 | +<script src="http://api.map.baidu.com/library/TrafficControl/1.4/src/TrafficControl_min.js"></script> | |
| 76 | +<script src="/assets/js/baidu//MarkerClusterer.js" merge="plugins"></script> | |
| 77 | +<script src="/assets/js/TransGPS.js" merge="plugins"></script> | |
| 78 | +<!-- jquery --> | |
| 79 | +<script src="/real_control_v2/assets/js/jquery.min.js"></script> | |
| 80 | +<!-- jquery actual --> | |
| 81 | +<script src="/real_control_v2/assets/js/jquery.actual.min.js" merge="plugins"></script> | |
| 82 | +<!-- jquery.serializejson JSON序列化插件 --> | |
| 83 | +<script src="/assets/plugins/jquery.serializejson.js" merge="plugins"></script> | |
| 84 | +<!-- moment.js 日期处理类库 --> | |
| 85 | +<script src="/real_control_v2/assets/plugins/moment/moment.min.js"></script> | |
| 86 | +<script src="/real_control_v2/assets/plugins/moment/zh-cn.js"></script> | |
| 87 | + | |
| 88 | +<!-- flatpickr --> | |
| 89 | +<script src="/real_control_v2/assets/plugins/flatpickr/flatpickr.min.js" merge="plugins"></script> | |
| 90 | +<script src="/real_control_v2/assets/plugins/flatpickr/l10n/zh.js" merge="plugins"></script> | |
| 91 | + | |
| 92 | +<!-- perfect-scrollbar --> | |
| 93 | +<script src="/real_control_v2/assets/plugins/perfect-scrollbar/perfect-scrollbar.jquery.js" merge="plugins"></script> | |
| 94 | +<!-- common js --> | |
| 95 | +<script src="/real_control_v2/js/common.js"></script> | |
| 96 | +<!-- art-template 模版引擎 --> | |
| 97 | +<script src="/assets/plugins/template.js" merge="plugins"></script> | |
| 98 | +<!-- d3 --> | |
| 99 | +<script src="/assets/js/d3.min.js"></script> | |
| 100 | +<!-- EventProxy --> | |
| 101 | +<script src="/assets/js/eventproxy.js"></script> | |
| 102 | + | |
| 103 | +<script> | |
| 104 | + | |
| 105 | + | |
| 106 | + var res_load_ep = EventProxy.create('load_home_layout', 'load_home_line_panel', 'load_data_basic', 'data-basic', function () { | |
| 107 | + //加载主页 | |
| 108 | + gb_home_layout.layout(function () { | |
| 109 | + gb_home_line_panel.init(function () { | |
| 110 | + //gps自刷新 | |
| 111 | + gb_data_gps.fixedTimeRefresh(); | |
| 112 | + | |
| 113 | + $('.uk-icon-send-o.home_alone_page').remove(); | |
| 114 | + }); | |
| 115 | + }); | |
| 116 | + }); | |
| 117 | + | |
| 118 | + function connectArr(arr, separator, transFun) { | |
| 119 | + var rs = ''; | |
| 120 | + $.each(arr, function (i, item) { | |
| 121 | + if (transFun) | |
| 122 | + item = transFun(item); | |
| 123 | + rs += (separator + item); | |
| 124 | + }); | |
| 125 | + return rs.substr(separator.length); | |
| 126 | + } | |
| 127 | + | |
| 128 | + var isArray = function (obj) { | |
| 129 | + return Object.prototype.toString.call(obj) === '[object Array]'; | |
| 130 | + }; | |
| 131 | + | |
| 132 | + var gb_form_validation_opts = { | |
| 133 | + framework: 'uikit', | |
| 134 | + locale: 'zh_CN', | |
| 135 | + icon: { | |
| 136 | + valid: 'uk-icon-check', | |
| 137 | + invalid: 'uk-icon-times', | |
| 138 | + validating: 'uk-icon-refresh' | |
| 139 | + } | |
| 140 | + }; | |
| 141 | + | |
| 142 | +</script> | |
| 143 | + | |
| 144 | +<!-- uikit core --> | |
| 145 | +<script src="/real_control_v2/assets/plugins/uikit-2.27.1/uikit.min.js" merge="uikit_js"></script> | |
| 146 | +<script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/notify.min.js" merge="uikit_js"></script> | |
| 147 | +<script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/pagination.min.js" merge="uikit_js"></script> | |
| 148 | +<script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/tooltip.min.js" merge="uikit_js"></script> | |
| 149 | +<script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/sticky.min.js" merge="uikit_js"></script> | |
| 150 | + | |
| 151 | + | |
| 152 | +<!-- jquery contextMenu --> | |
| 153 | +<script src="/real_control_v2/assets/js/jquery.contextMenu.min.js" merge="plugins"></script> | |
| 154 | +<script src="/real_control_v2/assets/js/jquery.ui.position.min.js" merge="plugins"></script> | |
| 155 | +<!-- formvalidation- --> | |
| 156 | +<script src="/real_control_v2/assets/plugins/formvalidation/formValidation.min.js" merge="plugins"></script> | |
| 157 | +<script src="/real_control_v2/assets/plugins/formvalidation/zh_CN.js" merge="plugins"></script> | |
| 158 | +<script src="/real_control_v2/assets/plugins/formvalidation/uikit.min.js" merge="plugins"></script> | |
| 159 | +<!-- js tree --> | |
| 160 | +<script src="/real_control_v2/assets/plugins/jstree/jstree.min.js" merge="plugins"></script> | |
| 161 | +<!-- simple pinyin --> | |
| 162 | +<script src="/assets/plugins/pinyin.js" merge="plugins"></script> | |
| 163 | +<!-- qtip --> | |
| 164 | +<script src="/real_control_v2/assets/plugins/qtip/jquery.qtip.min.js" merge="plugins"></script> | |
| 165 | +<!-- layer 3.0.3 --> | |
| 166 | +<script src="/real_control_v2/assets/plugins/layer3.0.3/layer.js" merge="plugins"></script> | |
| 167 | + | |
| 168 | +<!-- 数据 --> | |
| 169 | +<script src="/real_control_v2/alone_page/home/alone_data_basic.js" merge="custom_js"></script> | |
| 170 | +<script src="/real_control_v2/alone_page/home/alone_data_gps.js" merge="custom_js"></script> | |
| 171 | +<script src="/real_control_v2/js/data/gps_abnormal.js" merge="custom_js"></script> | |
| 172 | +<!-- 线路模拟图 --> | |
| 173 | +<script src="/real_control_v2/js/utils/svg_chart.js" merge="custom_js"></script> | |
| 174 | +<script src="/real_control_v2/js/utils/svg_data_convert.js" merge="custom_js"></script> | |
| 175 | +<script src="/real_control_v2/js/utils/svg_chart_tooltip.js" merge="custom_js"></script> | |
| 176 | +<script src="/real_control_v2/js/utils/svg_chart_map.js" merge="custom_js"></script> | |
| 177 | + | |
| 178 | +<!-- custom table js --> | |
| 179 | +<script src="/real_control_v2/js/utils/ct_table.js" merge="custom_js"></script> | |
| 180 | +<!-- home js --> | |
| 181 | +<script src="/real_control_v2/js/home/layout.js" merge="custom_js"></script> | |
| 182 | +<script src="/real_control_v2/js/home/line_panel.js" merge="custom_js"></script> | |
| 183 | +<script src="/real_control_v2/js/home/context_menu.js" merge="custom_js"></script> | |
| 184 | + | |
| 185 | + | |
| 186 | +<!-- 模态框扩展 --> | |
| 187 | +<script src="/real_control_v2/js/modal_extend.js" merge="custom_js"></script> | |
| 188 | + | |
| 189 | +</body> | |
| 190 | + | |
| 191 | +</html> | ... | ... |
src/main/resources/static/real_control_v2/mapmonitor/alone_page/alone_data_basic.js renamed to src/main/resources/static/real_control_v2/alone_page/map/alone_data_basic.js
| 1 | -/* 基础数据管理模块 */ | |
| 2 | - | |
| 3 | -var gb_data_basic = (function () { | |
| 4 | - | |
| 5 | - var stationRoutes, lineCode2NameAll, lineInformations, nbbm2deviceMap, device2nbbmMap, allPersonnel, svgAttrs; | |
| 6 | - var ep = EventProxy.create("stationRoutes", "lineCode2Name", "lineInformations", "nbbm2deviceId", "all_personnel", "svg_attrs" | |
| 7 | - , function (routes, code2Name, informations, nbbm2device, all_personnel, svgAttrMap) { | |
| 8 | - stationRoutes = routes; | |
| 9 | - lineCode2NameAll = code2Name; | |
| 10 | - lineInformations = informations; | |
| 11 | - nbbm2deviceMap = nbbm2device; | |
| 12 | - device2nbbmMap = gb_common.inverse(nbbm2deviceMap); | |
| 13 | - allPersonnel = all_personnel; | |
| 14 | - svgAttrs = svgAttrMap; | |
| 15 | - //gb_main_ep.emitLater('data-basic'); | |
| 16 | - }); | |
| 17 | - | |
| 18 | - var storage = window.localStorage; | |
| 19 | - //激活的线路 | |
| 20 | - var activeLines = JSON.parse(storage.getItem('lineControlItems')); | |
| 21 | - //lineCode to line object | |
| 22 | - var codeToLine = {}; | |
| 23 | - //lineCode idx string | |
| 24 | - var line_idx = (function () { | |
| 25 | - var str = ''; | |
| 26 | - for (var i = 0, item; item = activeLines[i++];) { | |
| 27 | - str += (',' + item.lineCode); | |
| 28 | - codeToLine[item.lineCode] = item; | |
| 29 | - } | |
| 30 | - return str.substr(1); | |
| 31 | - })(); | |
| 32 | - | |
| 33 | - //站点路由 | |
| 34 | - gb_common.$get('/stationroute/multiLine', {lineIds: line_idx}, function (rs) { | |
| 35 | - var list = rs.list;//JSON.parse(rs.list); | |
| 36 | - var routeData = gb_common.groupBy(list, 'lineCode'); | |
| 37 | - //排序 | |
| 38 | - for (var lineCode in routeData) { | |
| 39 | - routeData[lineCode].sort(stationRouteSort); | |
| 40 | - } | |
| 41 | - ep.emit('stationRoutes', routeData); | |
| 42 | - }); | |
| 43 | - | |
| 44 | - //线路标准信息 | |
| 45 | - gb_common.$get('/lineInformation/line/multi', {lineCodes: line_idx}, function (rs) { | |
| 46 | - var informations = {}; | |
| 47 | - $.each(rs, function () { | |
| 48 | - informations[this.line.lineCode] = this; | |
| 49 | - delete this['line']; | |
| 50 | - }); | |
| 51 | - ep.emit('lineInformations', informations); | |
| 52 | - }); | |
| 53 | - | |
| 54 | - //人员信息 | |
| 55 | - loadAllPersonnel(function (data) { | |
| 56 | - ep.emit('all_personnel', data); | |
| 57 | - }); | |
| 58 | - function loadAllPersonnel(cb) { | |
| 59 | - $.get('/personnel/all_py', function (rs) { | |
| 60 | - //转换成自动补全组件需要的数据 | |
| 61 | - var data = [], code; | |
| 62 | - for(var i =0, p; p = rs[i++];){ | |
| 63 | - code = p['workId'].indexOf('-')!=-1?p['workId'].split('-')[1]:p['workId']; | |
| 64 | - data.push({ | |
| 65 | - value: code + '/' + p.name, | |
| 66 | - fullChars: p.fullChars.toUpperCase(), | |
| 67 | - camelChars: p.camelChars.toUpperCase() | |
| 68 | - }); | |
| 69 | - } | |
| 70 | - cb && cb(data); | |
| 71 | - }); | |
| 72 | - } | |
| 73 | - | |
| 74 | - var carparks = {}; | |
| 75 | - //停车场数据 | |
| 76 | - gb_common.$get('/realMap/carParkSpatialData', {}, function (rs) { | |
| 77 | - rs.list.sort(function (a, b) { | |
| 78 | - return a.parkName.localeCompare(b.parkName); | |
| 79 | - }); | |
| 80 | - $.each(rs.list, function () { | |
| 81 | - carparks[this.parkCode] = this; | |
| 82 | - }); | |
| 83 | - }); | |
| 84 | - | |
| 85 | - //车辆数据 | |
| 86 | - var carsArray; | |
| 87 | - $.get('/basic/cars?t=' + Math.random(), function (rs) { | |
| 88 | - carsArray = rs; | |
| 89 | - }); | |
| 90 | - | |
| 91 | - var getCarparkByCode = function (code) { | |
| 92 | - return carparks[code]; | |
| 93 | - }; | |
| 94 | - | |
| 95 | - //line code to name | |
| 96 | - $.get('/basic/lineCode2Name', function (rs) { | |
| 97 | - ep.emit('lineCode2Name', rs); | |
| 98 | - }); | |
| 99 | - | |
| 100 | - //nbbm to device id | |
| 101 | - $.get('/basic/nbbm2deviceId', function (rs) { | |
| 102 | - ep.emit('nbbm2deviceId', rs); | |
| 103 | - }); | |
| 104 | - //nbbm to 车牌号 | |
| 105 | - var nbbm2PlateMap; | |
| 106 | - $.get('/basic/nbbm2PlateNo', function (rs) { | |
| 107 | - nbbm2PlateMap = rs; | |
| 108 | - }); | |
| 109 | - | |
| 110 | - //模拟图属性数据 | |
| 111 | - gb_common.$get('/realSchedule/svgAttr', {idx: line_idx}, function (rs) { | |
| 112 | - var data = {}; | |
| 113 | - $.each(rs.list, function () { | |
| 114 | - this.hideStations = JSON.parse(this.hideStations); | |
| 115 | - this.nicknames = JSON.parse(this.nicknames); | |
| 116 | - data[this.lineCode] = this; | |
| 117 | - }); | |
| 118 | - ep.emit('svg_attrs', data); | |
| 119 | - }); | |
| 120 | - | |
| 121 | - //站点和停车场历时、公里对照数据 | |
| 122 | - var stat_park_data; | |
| 123 | - var load_stat_park_data = function () { | |
| 124 | - $.get('/basic/station2ParkData?t='+Math.random(), {idx: line_idx}, function (rs) { | |
| 125 | - stat_park_data = rs; | |
| 126 | - }); | |
| 127 | - } | |
| 128 | - load_stat_park_data(); | |
| 129 | - | |
| 130 | - function findLineByCodes(codeArr) { | |
| 131 | - var rs = []; | |
| 132 | - $.each(codeArr, function () { | |
| 133 | - rs.push(codeToLine[this]); | |
| 134 | - }); | |
| 135 | - return rs; | |
| 136 | - } | |
| 137 | - | |
| 138 | - var findCodeByLinename = function (name) { | |
| 139 | - for (var code in lineCode2NameAll) { | |
| 140 | - if (name == lineCode2NameAll[code]) | |
| 141 | - return code; | |
| 142 | - } | |
| 143 | - | |
| 144 | - return null; | |
| 145 | - }; | |
| 146 | - | |
| 147 | - var getLineInformation = function (lineCode) { | |
| 148 | - return lineInformations[lineCode]; | |
| 149 | - }; | |
| 150 | - | |
| 151 | - var stationRouteSort = function (a, b) { | |
| 152 | - return a.stationRouteCode - b.stationRouteCode; | |
| 153 | - }; | |
| 154 | - | |
| 155 | - return { | |
| 156 | - activeLines: activeLines, | |
| 157 | - line_idx: line_idx, | |
| 158 | - codeToLine: codeToLine, | |
| 159 | - nbbm2deviceMap: function () { | |
| 160 | - return nbbm2deviceMap; | |
| 161 | - }, | |
| 162 | - device2nbbmMap: function () { | |
| 163 | - return device2nbbmMap; | |
| 164 | - }, | |
| 165 | - getLineInformation: getLineInformation, | |
| 166 | - allInformations: function () { | |
| 167 | - return lineInformations; | |
| 168 | - }, | |
| 169 | - stationRoutes: function (lineCode) { | |
| 170 | - return stationRoutes[lineCode] | |
| 171 | - }, | |
| 172 | - findLineByCodes: findLineByCodes, | |
| 173 | - lineCode2NameAll: function () { | |
| 174 | - return lineCode2NameAll | |
| 175 | - }, | |
| 176 | - allPersonnel: function () { | |
| 177 | - return allPersonnel; | |
| 178 | - }, | |
| 179 | - findCodeByLinename: findCodeByLinename, | |
| 180 | - getCarparkByCode: getCarparkByCode, | |
| 181 | - getSvgAttr: function (lineCode) { | |
| 182 | - return svgAttrs[lineCode]; | |
| 183 | - }, | |
| 184 | - setSvgAttr: function (attr) { | |
| 185 | - attr.hideStations = JSON.parse(attr.hideStations); | |
| 186 | - attr.nicknames = JSON.parse(attr.nicknames); | |
| 187 | - svgAttrs[attr.lineCode] = attr; | |
| 188 | - }, | |
| 189 | - //是否是环线 | |
| 190 | - isLoopLine: function (lineCode) { | |
| 191 | - var data = gb_common.groupBy(stationRoutes[lineCode], 'directions'); | |
| 192 | - //下行只有2个站点 | |
| 193 | - var len = data[0].length; | |
| 194 | - if (len > 0 && data[1].length == 2) { | |
| 195 | - var first = data[0][0], | |
| 196 | - end = data[0][len - 1]; | |
| 197 | - | |
| 198 | - /*if(first.stationName != end.stationName) | |
| 199 | - return false;*/ | |
| 200 | - | |
| 201 | - var fPoint = {latitude: first.station.gLaty, longitude: first.station.gLonx} | |
| 202 | - , ePoint = {latitude: end.station.gLaty, longitude: end.station.gLonx}; | |
| 203 | - | |
| 204 | - //并且上行起终点距离200米内 | |
| 205 | - if (geolib.getDistance(fPoint, ePoint) < 200) { | |
| 206 | - return true; | |
| 207 | - } | |
| 208 | - } | |
| 209 | - | |
| 210 | - return false; | |
| 211 | - }, | |
| 212 | - //刷新员工信息 | |
| 213 | - refreshAllPersonnel: function (cb) { | |
| 214 | - loadAllPersonnel(function (data) { | |
| 215 | - allPersonnel = data; | |
| 216 | - cb && cb(); | |
| 217 | - }); | |
| 218 | - }, | |
| 219 | - nbbm2PlateMap: function () { | |
| 220 | - return nbbm2PlateMap; | |
| 221 | - }, | |
| 222 | - carsArray: function () { | |
| 223 | - return carsArray; | |
| 224 | - }, | |
| 225 | - simpleParksArray: function () { | |
| 226 | - var map = {}; | |
| 227 | - for(var code in carparks) | |
| 228 | - map[code] = carparks[code].parkName; | |
| 229 | - return map; | |
| 230 | - }, | |
| 231 | - remarksMapps: function () { | |
| 232 | - return remarksMapps; | |
| 233 | - }, | |
| 234 | - get_stat_park_data: function () { | |
| 235 | - return stat_park_data; | |
| 236 | - }, | |
| 237 | - reload_stat_park_data: function () { | |
| 238 | - load_stat_park_data(); | |
| 239 | - } | |
| 240 | - }; | |
| 241 | -})(); | |
| 1 | +/* 基础数据管理模块 */ | |
| 2 | + | |
| 3 | +var gb_data_basic = (function () { | |
| 4 | + | |
| 5 | + var stationRoutes, lineCode2NameAll, lineInformations, nbbm2deviceMap, device2nbbmMap, allPersonnel, svgAttrs; | |
| 6 | + var ep = EventProxy.create("stationRoutes", "lineCode2Name", "lineInformations", "nbbm2deviceId", "all_personnel", "svg_attrs" | |
| 7 | + , function (routes, code2Name, informations, nbbm2device, all_personnel, svgAttrMap) { | |
| 8 | + stationRoutes = routes; | |
| 9 | + lineCode2NameAll = code2Name; | |
| 10 | + lineInformations = informations; | |
| 11 | + nbbm2deviceMap = nbbm2device; | |
| 12 | + device2nbbmMap = gb_common.inverse(nbbm2deviceMap); | |
| 13 | + allPersonnel = all_personnel; | |
| 14 | + svgAttrs = svgAttrMap; | |
| 15 | + | |
| 16 | + res_load_ep.emitLater('data-basic'); | |
| 17 | + }); | |
| 18 | + | |
| 19 | + var storage = window.localStorage; | |
| 20 | + //激活的线路 | |
| 21 | + var activeLines = JSON.parse(storage.getItem('lineControlItems')); | |
| 22 | + //lineCode to line object | |
| 23 | + var codeToLine = {}; | |
| 24 | + //lineCode idx string | |
| 25 | + var line_idx = (function () { | |
| 26 | + var str = ''; | |
| 27 | + for (var i = 0, item; item = activeLines[i++];) { | |
| 28 | + str += (',' + item.lineCode); | |
| 29 | + codeToLine[item.lineCode] = item; | |
| 30 | + } | |
| 31 | + return str.substr(1); | |
| 32 | + })(); | |
| 33 | + | |
| 34 | + //站点路由 | |
| 35 | + gb_common.$get('/stationroute/multiLine', {lineIds: line_idx}, function (rs) { | |
| 36 | + var list = rs.list;//JSON.parse(rs.list); | |
| 37 | + var routeData = gb_common.groupBy(list, 'lineCode'); | |
| 38 | + //排序 | |
| 39 | + for (var lineCode in routeData) { | |
| 40 | + routeData[lineCode].sort(stationRouteSort); | |
| 41 | + } | |
| 42 | + ep.emit('stationRoutes', routeData); | |
| 43 | + }); | |
| 44 | + | |
| 45 | + //线路标准信息 | |
| 46 | + gb_common.$get('/lineInformation/line/multi', {lineCodes: line_idx}, function (rs) { | |
| 47 | + var informations = {}; | |
| 48 | + $.each(rs, function () { | |
| 49 | + informations[this.line.lineCode] = this; | |
| 50 | + delete this['line']; | |
| 51 | + }); | |
| 52 | + ep.emit('lineInformations', informations); | |
| 53 | + }); | |
| 54 | + | |
| 55 | + //人员信息 | |
| 56 | + loadAllPersonnel(function (data) { | |
| 57 | + ep.emit('all_personnel', data); | |
| 58 | + }); | |
| 59 | + function loadAllPersonnel(cb) { | |
| 60 | + $.get('/personnel/all_py', function (rs) { | |
| 61 | + //转换成自动补全组件需要的数据 | |
| 62 | + var data = [], code; | |
| 63 | + for(var i =0, p; p = rs[i++];){ | |
| 64 | + code = p['workId'].indexOf('-')!=-1?p['workId'].split('-')[1]:p['workId']; | |
| 65 | + data.push({ | |
| 66 | + value: code + '/' + p.name, | |
| 67 | + fullChars: p.fullChars.toUpperCase(), | |
| 68 | + camelChars: p.camelChars.toUpperCase() | |
| 69 | + }); | |
| 70 | + } | |
| 71 | + cb && cb(data); | |
| 72 | + }); | |
| 73 | + } | |
| 74 | + | |
| 75 | + var carparks = {}; | |
| 76 | + //停车场数据 | |
| 77 | + gb_common.$get('/realMap/carParkSpatialData', {}, function (rs) { | |
| 78 | + rs.list.sort(function (a, b) { | |
| 79 | + return a.parkName.localeCompare(b.parkName); | |
| 80 | + }); | |
| 81 | + $.each(rs.list, function () { | |
| 82 | + carparks[this.parkCode] = this; | |
| 83 | + }); | |
| 84 | + }); | |
| 85 | + | |
| 86 | + //车辆数据 | |
| 87 | + var carsArray; | |
| 88 | + $.get('/basic/cars?t=' + Math.random(), function (rs) { | |
| 89 | + carsArray = rs; | |
| 90 | + }); | |
| 91 | + | |
| 92 | + var getCarparkByCode = function (code) { | |
| 93 | + return carparks[code]; | |
| 94 | + }; | |
| 95 | + | |
| 96 | + //line code to name | |
| 97 | + $.get('/basic/lineCode2Name', function (rs) { | |
| 98 | + ep.emit('lineCode2Name', rs); | |
| 99 | + }); | |
| 100 | + | |
| 101 | + //nbbm to device id | |
| 102 | + $.get('/basic/nbbm2deviceId', function (rs) { | |
| 103 | + ep.emit('nbbm2deviceId', rs); | |
| 104 | + }); | |
| 105 | + //nbbm to 车牌号 | |
| 106 | + var nbbm2PlateMap; | |
| 107 | + $.get('/basic/nbbm2PlateNo', function (rs) { | |
| 108 | + nbbm2PlateMap = rs; | |
| 109 | + }); | |
| 110 | + | |
| 111 | + //模拟图属性数据 | |
| 112 | + gb_common.$get('/realSchedule/svgAttr', {idx: line_idx}, function (rs) { | |
| 113 | + var data = {}; | |
| 114 | + $.each(rs.list, function () { | |
| 115 | + this.hideStations = JSON.parse(this.hideStations); | |
| 116 | + this.nicknames = JSON.parse(this.nicknames); | |
| 117 | + data[this.lineCode] = this; | |
| 118 | + }); | |
| 119 | + ep.emit('svg_attrs', data); | |
| 120 | + }); | |
| 121 | + | |
| 122 | + //站点和停车场历时、公里对照数据 | |
| 123 | + var stat_park_data; | |
| 124 | + var load_stat_park_data = function () { | |
| 125 | + $.get('/basic/station2ParkData?t='+Math.random(), {idx: line_idx}, function (rs) { | |
| 126 | + stat_park_data = rs; | |
| 127 | + }); | |
| 128 | + } | |
| 129 | + load_stat_park_data(); | |
| 130 | + | |
| 131 | + function findLineByCodes(codeArr) { | |
| 132 | + var rs = []; | |
| 133 | + $.each(codeArr, function () { | |
| 134 | + rs.push(codeToLine[this]); | |
| 135 | + }); | |
| 136 | + return rs; | |
| 137 | + } | |
| 138 | + | |
| 139 | + var findCodeByLinename = function (name) { | |
| 140 | + for (var code in lineCode2NameAll) { | |
| 141 | + if (name == lineCode2NameAll[code]) | |
| 142 | + return code; | |
| 143 | + } | |
| 144 | + | |
| 145 | + return null; | |
| 146 | + }; | |
| 147 | + | |
| 148 | + var getLineInformation = function (lineCode) { | |
| 149 | + return lineInformations[lineCode]; | |
| 150 | + }; | |
| 151 | + | |
| 152 | + var stationRouteSort = function (a, b) { | |
| 153 | + return a.stationRouteCode - b.stationRouteCode; | |
| 154 | + }; | |
| 155 | + | |
| 156 | + return { | |
| 157 | + activeLines: activeLines, | |
| 158 | + line_idx: line_idx, | |
| 159 | + codeToLine: codeToLine, | |
| 160 | + nbbm2deviceMap: function () { | |
| 161 | + return nbbm2deviceMap; | |
| 162 | + }, | |
| 163 | + device2nbbmMap: function () { | |
| 164 | + return device2nbbmMap; | |
| 165 | + }, | |
| 166 | + getLineInformation: getLineInformation, | |
| 167 | + allInformations: function () { | |
| 168 | + return lineInformations; | |
| 169 | + }, | |
| 170 | + stationRoutes: function (lineCode) { | |
| 171 | + return stationRoutes[lineCode] | |
| 172 | + }, | |
| 173 | + findLineByCodes: findLineByCodes, | |
| 174 | + lineCode2NameAll: function () { | |
| 175 | + return lineCode2NameAll | |
| 176 | + }, | |
| 177 | + allPersonnel: function () { | |
| 178 | + return allPersonnel; | |
| 179 | + }, | |
| 180 | + findCodeByLinename: findCodeByLinename, | |
| 181 | + getCarparkByCode: getCarparkByCode, | |
| 182 | + getSvgAttr: function (lineCode) { | |
| 183 | + return svgAttrs[lineCode]; | |
| 184 | + }, | |
| 185 | + setSvgAttr: function (attr) { | |
| 186 | + attr.hideStations = JSON.parse(attr.hideStations); | |
| 187 | + attr.nicknames = JSON.parse(attr.nicknames); | |
| 188 | + svgAttrs[attr.lineCode] = attr; | |
| 189 | + }, | |
| 190 | + //是否是环线 | |
| 191 | + isLoopLine: function (lineCode) { | |
| 192 | + var data = gb_common.groupBy(stationRoutes[lineCode], 'directions'); | |
| 193 | + //下行只有2个站点 | |
| 194 | + var len = data[0].length; | |
| 195 | + if (len > 0 && data[1].length == 2) { | |
| 196 | + var first = data[0][0], | |
| 197 | + end = data[0][len - 1]; | |
| 198 | + | |
| 199 | + /*if(first.stationName != end.stationName) | |
| 200 | + return false;*/ | |
| 201 | + | |
| 202 | + var fPoint = {latitude: first.station.gLaty, longitude: first.station.gLonx} | |
| 203 | + , ePoint = {latitude: end.station.gLaty, longitude: end.station.gLonx}; | |
| 204 | + | |
| 205 | + //并且上行起终点距离200米内 | |
| 206 | + if (geolib.getDistance(fPoint, ePoint) < 200) { | |
| 207 | + return true; | |
| 208 | + } | |
| 209 | + } | |
| 210 | + | |
| 211 | + return false; | |
| 212 | + }, | |
| 213 | + //刷新员工信息 | |
| 214 | + refreshAllPersonnel: function (cb) { | |
| 215 | + loadAllPersonnel(function (data) { | |
| 216 | + allPersonnel = data; | |
| 217 | + cb && cb(); | |
| 218 | + }); | |
| 219 | + }, | |
| 220 | + nbbm2PlateMap: function () { | |
| 221 | + return nbbm2PlateMap; | |
| 222 | + }, | |
| 223 | + carsArray: function () { | |
| 224 | + return carsArray; | |
| 225 | + }, | |
| 226 | + simpleParksArray: function () { | |
| 227 | + var map = {}; | |
| 228 | + for(var code in carparks) | |
| 229 | + map[code] = carparks[code].parkName; | |
| 230 | + return map; | |
| 231 | + }, | |
| 232 | + remarksMapps: function () { | |
| 233 | + return remarksMapps; | |
| 234 | + }, | |
| 235 | + get_stat_park_data: function () { | |
| 236 | + return stat_park_data; | |
| 237 | + }, | |
| 238 | + reload_stat_park_data: function () { | |
| 239 | + load_stat_park_data(); | |
| 240 | + } | |
| 241 | + }; | |
| 242 | +})(); | ... | ... |
src/main/resources/static/real_control_v2/mapmonitor/alone_page/alone_data_gps.js renamed to src/main/resources/static/real_control_v2/alone_page/map/alone_data_gps.js
| 1 | -/* gps 数据管理模块 */ | |
| 2 | - | |
| 3 | -var gb_data_gps = (function () { | |
| 4 | - | |
| 5 | - //fixed time refresh delay | |
| 6 | - var delay = 1000 * 7; | |
| 7 | - //deviceId ——> gps | |
| 8 | - var realData = {}; | |
| 9 | - //refresh after callback | |
| 10 | - var refreshEventCallbacks = []; | |
| 11 | - //register callback function | |
| 12 | - var registerCallback = function (cb) { | |
| 13 | - if (cb) | |
| 14 | - refreshEventCallbacks.push(cb); | |
| 15 | - }; | |
| 16 | - | |
| 17 | - var refresh = function (cb) { | |
| 18 | - $.ajax({ | |
| 19 | - url: '/gps/real/line', | |
| 20 | - data: {lineCodes: gb_data_basic.line_idx}, | |
| 21 | - dataType: 'json', | |
| 22 | - success: function (rs) { | |
| 23 | - //用定时的gps来检测session断开 | |
| 24 | - if(rs.status && rs.status==407){ | |
| 25 | - location.href = '/login.html'; | |
| 26 | - return; | |
| 27 | - } | |
| 28 | - refreshData(rs); | |
| 29 | - cb(); | |
| 30 | - }, | |
| 31 | - error: function (xr, t) { | |
| 32 | - notify_err('刷新GPS失败,稍后重试' + t); | |
| 33 | - cb(); | |
| 34 | - } | |
| 35 | - }); | |
| 36 | - }; | |
| 37 | - | |
| 38 | - var refreshData = function (rs) { | |
| 39 | - var old, addArr = [], | |
| 40 | - upArr = [], | |
| 41 | - upDownChange = []; | |
| 42 | - | |
| 43 | - var schArray; | |
| 44 | - $.each(rs, function () { | |
| 45 | - old = realData[this.deviceId]; | |
| 46 | - if (old) { | |
| 47 | - if (this.timestamp > old.timestamp) { | |
| 48 | - if (old.upDown != this.upDown) | |
| 49 | - upDownChange.push(this); | |
| 50 | - else | |
| 51 | - upArr.push(this); | |
| 52 | - } | |
| 53 | - | |
| 54 | - } else | |
| 55 | - addArr.push(this); | |
| 56 | - | |
| 57 | - /* //班次信息 | |
| 58 | - if (this.schId) { | |
| 59 | - schArray = gb_schedule_table.findScheduleByLine(this.lineId); | |
| 60 | - if (schArray) | |
| 61 | - this.sch = schArray[this.schId]; | |
| 62 | - }*/ | |
| 63 | - | |
| 64 | - //时间格式化 | |
| 65 | - this.dateStr = moment(this.timestamp).format('YYYY-MM-DD HH:mm:ss'); | |
| 66 | - realData[this.deviceId] = this; | |
| 67 | - }); | |
| 68 | - | |
| 69 | - //console.log('add array size: ' + addArr.length, 'up array size: ' + upArr.length); | |
| 70 | - //CCCallFuncN | |
| 71 | - $.each(refreshEventCallbacks, function (i, cb) { | |
| 72 | - cb(addArr, upArr, upDownChange); | |
| 73 | - }); | |
| 74 | - | |
| 75 | - }; | |
| 76 | - | |
| 77 | - var startFixedTime; | |
| 78 | - var fixedTimeRefresh = function () { | |
| 79 | - if (startFixedTime) | |
| 80 | - return; | |
| 81 | - startFixedTime = true; | |
| 82 | - | |
| 83 | - (function () { | |
| 84 | - var f = arguments.callee; | |
| 85 | - refresh(function () { | |
| 86 | - setTimeout(f, delay); | |
| 87 | - }); | |
| 88 | - })(); | |
| 89 | - }; | |
| 90 | - | |
| 91 | - var gpsByLineCode = function (lineCode) { | |
| 92 | - var rs = []; | |
| 93 | - for (var device in realData) { | |
| 94 | - if (realData[device].lineId == lineCode) | |
| 95 | - rs.push(realData[device]); | |
| 96 | - } | |
| 97 | - return rs; | |
| 98 | - }; | |
| 99 | - | |
| 100 | - var findOne = function (deviceId) { | |
| 101 | - return realData[deviceId]; | |
| 102 | - }; | |
| 103 | - | |
| 104 | - var findGpsByNbbm = function (nbbm) { | |
| 105 | - return realData[gb_data_basic.nbbm2deviceMap()[nbbm]]; | |
| 106 | - }; | |
| 107 | - | |
| 108 | - /** | |
| 109 | - * 设备掉线事件 | |
| 110 | - */ | |
| 111 | - var deviceOffline = function (gps) { | |
| 112 | - $.each(offlineCallbacks, function (i, cb) { | |
| 113 | - cb(gps); | |
| 114 | - }); | |
| 115 | - }; | |
| 116 | - | |
| 117 | - //注册掉线事件回调函数 | |
| 118 | - var offlineCallbacks = []; | |
| 119 | - var registerOfflineCb = function (cb) { | |
| 120 | - if (cb) | |
| 121 | - offlineCallbacks.push(cb); | |
| 122 | - }; | |
| 123 | - | |
| 124 | - return { | |
| 125 | - fixedTimeRefresh: fixedTimeRefresh, | |
| 126 | - registerCallback: registerCallback, | |
| 127 | - allGps: realData, | |
| 128 | - gpsByLineCode: gpsByLineCode, | |
| 129 | - findOne: findOne, | |
| 130 | - findGpsByNbbm: findGpsByNbbm, | |
| 131 | - deviceOffline: deviceOffline, | |
| 132 | - registerOfflineCb: registerOfflineCb | |
| 133 | - }; | |
| 134 | -})(); | |
| 1 | +/* gps 数据管理模块 */ | |
| 2 | + | |
| 3 | +var gb_data_gps = (function () { | |
| 4 | + | |
| 5 | + //fixed time refresh delay | |
| 6 | + var delay = 1000 * 7; | |
| 7 | + //deviceId ——> gps | |
| 8 | + var realData = {}; | |
| 9 | + //refresh after callback | |
| 10 | + var refreshEventCallbacks = []; | |
| 11 | + //register callback function | |
| 12 | + var registerCallback = function (cb) { | |
| 13 | + if (cb) | |
| 14 | + refreshEventCallbacks.push(cb); | |
| 15 | + }; | |
| 16 | + | |
| 17 | + var refresh = function (cb) { | |
| 18 | + $.ajax({ | |
| 19 | + url: '/gps/real/line', | |
| 20 | + data: {lineCodes: gb_data_basic.line_idx}, | |
| 21 | + dataType: 'json', | |
| 22 | + success: function (rs) { | |
| 23 | + //用定时的gps来检测session断开 | |
| 24 | + if(rs.status && rs.status==407){ | |
| 25 | + location.href = '/login.html'; | |
| 26 | + return; | |
| 27 | + } | |
| 28 | + refreshData(rs); | |
| 29 | + cb(); | |
| 30 | + }, | |
| 31 | + error: function (xr, t) { | |
| 32 | + notify_err('刷新GPS失败,稍后重试' + t); | |
| 33 | + cb(); | |
| 34 | + } | |
| 35 | + }); | |
| 36 | + }; | |
| 37 | + | |
| 38 | + var refreshData = function (rs) { | |
| 39 | + var old, addArr = [], | |
| 40 | + upArr = [], | |
| 41 | + upDownChange = []; | |
| 42 | + | |
| 43 | + var schArray; | |
| 44 | + $.each(rs, function () { | |
| 45 | + old = realData[this.deviceId]; | |
| 46 | + if (old) { | |
| 47 | + if (this.timestamp > old.timestamp) { | |
| 48 | + if (old.upDown != this.upDown) | |
| 49 | + upDownChange.push(this); | |
| 50 | + else | |
| 51 | + upArr.push(this); | |
| 52 | + } | |
| 53 | + | |
| 54 | + } else | |
| 55 | + addArr.push(this); | |
| 56 | + | |
| 57 | + /* //班次信息 | |
| 58 | + if (this.schId) { | |
| 59 | + schArray = gb_schedule_table.findScheduleByLine(this.lineId); | |
| 60 | + if (schArray) | |
| 61 | + this.sch = schArray[this.schId]; | |
| 62 | + }*/ | |
| 63 | + | |
| 64 | + //时间格式化 | |
| 65 | + this.dateStr = moment(this.timestamp).format('YYYY-MM-DD HH:mm:ss'); | |
| 66 | + realData[this.deviceId] = this; | |
| 67 | + }); | |
| 68 | + | |
| 69 | + //console.log('add array size: ' + addArr.length, 'up array size: ' + upArr.length); | |
| 70 | + //CCCallFuncN | |
| 71 | + $.each(refreshEventCallbacks, function (i, cb) { | |
| 72 | + cb(addArr, upArr, upDownChange); | |
| 73 | + }); | |
| 74 | + | |
| 75 | + }; | |
| 76 | + | |
| 77 | + var startFixedTime; | |
| 78 | + var fixedTimeRefresh = function () { | |
| 79 | + if (startFixedTime) | |
| 80 | + return; | |
| 81 | + startFixedTime = true; | |
| 82 | + | |
| 83 | + (function () { | |
| 84 | + var f = arguments.callee; | |
| 85 | + refresh(function () { | |
| 86 | + setTimeout(f, delay); | |
| 87 | + }); | |
| 88 | + })(); | |
| 89 | + }; | |
| 90 | + | |
| 91 | + var gpsByLineCode = function (lineCode) { | |
| 92 | + var rs = []; | |
| 93 | + for (var device in realData) { | |
| 94 | + if (realData[device].lineId == lineCode) | |
| 95 | + rs.push(realData[device]); | |
| 96 | + } | |
| 97 | + return rs; | |
| 98 | + }; | |
| 99 | + | |
| 100 | + var findOne = function (deviceId) { | |
| 101 | + return realData[deviceId]; | |
| 102 | + }; | |
| 103 | + | |
| 104 | + var findGpsByNbbm = function (nbbm) { | |
| 105 | + return realData[gb_data_basic.nbbm2deviceMap()[nbbm]]; | |
| 106 | + }; | |
| 107 | + | |
| 108 | + /** | |
| 109 | + * 设备掉线事件 | |
| 110 | + */ | |
| 111 | + var deviceOffline = function (gps) { | |
| 112 | + $.each(offlineCallbacks, function (i, cb) { | |
| 113 | + cb(gps); | |
| 114 | + }); | |
| 115 | + }; | |
| 116 | + | |
| 117 | + //注册掉线事件回调函数 | |
| 118 | + var offlineCallbacks = []; | |
| 119 | + var registerOfflineCb = function (cb) { | |
| 120 | + if (cb) | |
| 121 | + offlineCallbacks.push(cb); | |
| 122 | + }; | |
| 123 | + | |
| 124 | + return { | |
| 125 | + fixedTimeRefresh: fixedTimeRefresh, | |
| 126 | + registerCallback: registerCallback, | |
| 127 | + allGps: realData, | |
| 128 | + gpsByLineCode: gpsByLineCode, | |
| 129 | + findOne: findOne, | |
| 130 | + findGpsByNbbm: findGpsByNbbm, | |
| 131 | + deviceOffline: deviceOffline, | |
| 132 | + registerOfflineCb: registerOfflineCb | |
| 133 | + }; | |
| 134 | +})(); | ... | ... |
src/main/resources/static/real_control_v2/mapmonitor/alone_page/alone_wrap.html renamed to src/main/resources/static/real_control_v2/alone_page/map/alone_wrap.html
| 1 | -<!DOCTYPE html> | |
| 2 | -<html lang="zh-cn"> | |
| 3 | - | |
| 4 | -<head> | |
| 5 | - <meta charset="UTF-8"> | |
| 6 | - <title>地图监控 v2.0</title> | |
| 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" /> | |
| 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" /> | |
| 14 | - <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/components/slidenav.gradient.min.css" /> | |
| 15 | - <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/components/sticky.gradient.min.css" /> | |
| 16 | - | |
| 17 | - <!-- main style --> | |
| 18 | - <link rel="stylesheet" href="/real_control_v2/css/main.css" /> | |
| 19 | - <!-- north style --> | |
| 20 | - <link rel="stylesheet" href="/real_control_v2/css/north.css" /> | |
| 21 | - <!-- home style --> | |
| 22 | - <link rel="stylesheet" href="/real_control_v2/css/home.css" /> | |
| 23 | - | |
| 24 | - <!-- js tree --> | |
| 25 | - <link rel="stylesheet" href="/real_control_v2/assets/plugins/jstree/default/style.css" /> | |
| 26 | - | |
| 27 | - <link rel="stylesheet" href="/real_control_v2/css/modal_extend.css" /> | |
| 28 | - <!-- perfect-scrollbar style --> | |
| 29 | - <link rel="stylesheet" href="/real_control_v2/assets/plugins/perfect-scrollbar/perfect-scrollbar.css" /> | |
| 30 | - <!-- layer 3.0.3 --> | |
| 31 | - <link rel="stylesheet" href="/real_control_v2/assets/plugins/layer3.0.3/skin/default/layer.css" /> | |
| 32 | - <link rel="stylesheet" href="/real_control_v2/assets/plugins/layer3.0.3/skin/moon/style.css" /> | |
| 33 | - | |
| 34 | - <!-- flatpickr --> | |
| 35 | - <link rel="stylesheet" href="/real_control_v2/assets/plugins/flatpickr/flatpickr.min.css" > | |
| 36 | - <link rel="stylesheet" href="/real_control_v2/assets/plugins/flatpickr/themes/airbnb.css" > | |
| 37 | - | |
| 38 | - <link rel="stylesheet" href="/real_control_v2/css/ct_table.css" /> | |
| 39 | -</head> | |
| 40 | - | |
| 41 | -<body> | |
| 42 | -<div class="main-container" style="height: 100%;"> | |
| 43 | -</div> | |
| 44 | - | |
| 45 | -<!-- 地图相关 --> | |
| 46 | -<script src="http://api.map.baidu.com/api?v=2.0&ak=IGGrr4UjwIYzatoCRFKEL8sT"></script> | |
| 47 | -<script src="http://api.map.baidu.com/library/TrafficControl/1.4/src/TrafficControl_min.js"></script> | |
| 48 | -<script src="/assets/js/baidu//MarkerClusterer.js" merge="plugins"></script> | |
| 49 | -<script src="/assets/js/TransGPS.js" merge="plugins"></script> | |
| 50 | -<!-- 高德 --> | |
| 51 | -<script src="http://webapi.amap.com/maps?v=1.3&key=16cb1c5043847e09ef9edafdd77befda"></script> | |
| 52 | -<!-- jquery --> | |
| 53 | -<script src="/real_control_v2/assets/js/jquery.min.js"></script> | |
| 54 | -<!-- jquery actual --> | |
| 55 | -<script src="/real_control_v2/assets/js/jquery.actual.min.js" ></script> | |
| 56 | -<!-- moment.js 日期处理类库 --> | |
| 57 | -<script src="/real_control_v2/assets/plugins/moment/moment.min.js"></script> | |
| 58 | -<script src="/real_control_v2/assets/plugins/moment/zh-cn.js"></script> | |
| 59 | - | |
| 60 | -<!-- flatpickr --> | |
| 61 | -<script src="/real_control_v2/assets/plugins/flatpickr/flatpickr.min.js"></script> | |
| 62 | -<script src="/real_control_v2/assets/plugins/flatpickr/l10n/zh.js"></script> | |
| 63 | - | |
| 64 | -<!-- perfect-scrollbar --> | |
| 65 | -<script src="/real_control_v2/assets/plugins/perfect-scrollbar/perfect-scrollbar.jquery.js" ></script> | |
| 66 | -<!-- common js --> | |
| 67 | -<script src="/real_control_v2/js/common.js"></script> | |
| 68 | -<!-- art-template 模版引擎 --> | |
| 69 | -<script src="/assets/plugins/template.js" ></script> | |
| 70 | -<!-- d3 --> | |
| 71 | -<script src="/assets/js/d3.min.js"></script> | |
| 72 | -<!-- EventProxy --> | |
| 73 | -<script src="/assets/js/eventproxy.js"></script> | |
| 74 | -<!-- uikit core --> | |
| 75 | -<script src="/real_control_v2/assets/plugins/uikit-2.27.1/uikit.min.js" ></script> | |
| 76 | -<script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/notify.min.js" ></script> | |
| 77 | -<script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/tooltip.min.js"></script> | |
| 78 | -<script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/autocomplete.min.js"></script> | |
| 79 | -<script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/accordion.min.js" ></script> | |
| 80 | -<script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/sticky.min.js" ></script> | |
| 81 | - | |
| 82 | -<!-- js tree --> | |
| 83 | -<script src="/real_control_v2/assets/plugins/jstree/jstree.min.js" ></script> | |
| 84 | -<!-- layer 3.0.3 --> | |
| 85 | -<script src="/real_control_v2/assets/plugins/layer3.0.3/layer.js"></script> | |
| 86 | - | |
| 87 | -<!-- 模态框扩展 --> | |
| 88 | -<script src="/real_control_v2/js/modal_extend.js" ></script> | |
| 89 | - | |
| 90 | -<script src="/real_control_v2/mapmonitor/alone_page/alone_data_basic.js" ></script> | |
| 91 | -<script src="/real_control_v2/mapmonitor/alone_page/alone_data_gps.js" ></script> | |
| 92 | -<script src="/real_control_v2/js/utils/ct_table.js" ></script> | |
| 93 | -<!-- jquery.serializejson JSON序列化插件 --> | |
| 94 | -<script src="/assets/plugins/jquery.serializejson.js" ></script> | |
| 95 | -<script> | |
| 96 | - (function () { | |
| 97 | - gb_data_gps.fixedTimeRefresh(); | |
| 98 | - //嵌入地图页面 | |
| 99 | - $('.main-container').load('/real_control_v2/mapmonitor/real.html', function () { | |
| 100 | - $('.map-system-msg.flex-left').remove(); | |
| 101 | - }); | |
| 102 | - })(); | |
| 103 | -</script> | |
| 104 | -</body> | |
| 105 | - | |
| 106 | -</html> | |
| 1 | +<!DOCTYPE html> | |
| 2 | +<html lang="zh-cn"> | |
| 3 | + | |
| 4 | +<head> | |
| 5 | + <meta charset="UTF-8"> | |
| 6 | + <title>地图监控 v2.0</title> | |
| 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 | + merge="plugins"/> | |
| 11 | + <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/components/tooltip.gradient.min.css" | |
| 12 | + merge="plugins"/> | |
| 13 | + <link rel="stylesheet" | |
| 14 | + href="/real_control_v2/assets/plugins/uikit-2.27.1/components/autocomplete.gradient.min.css" merge="plugins"/> | |
| 15 | + <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/components/accordion.gradient.min.css" | |
| 16 | + merge="plugins"/> | |
| 17 | + <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/components/slidenav.gradient.min.css" | |
| 18 | + merge="plugins"/> | |
| 19 | + <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/components/sticky.gradient.min.css" | |
| 20 | + merge="plugins"/> | |
| 21 | + | |
| 22 | + <!-- main style --> | |
| 23 | + <link rel="stylesheet" href="/real_control_v2/css/main.css"/> | |
| 24 | + <!-- north style --> | |
| 25 | + <link rel="stylesheet" href="/real_control_v2/css/north.css" merge="custom_style"/> | |
| 26 | + <!-- home style --> | |
| 27 | + <link rel="stylesheet" href="/real_control_v2/css/home.css" merge="custom_style"/> | |
| 28 | + | |
| 29 | + <!-- js tree --> | |
| 30 | + <link rel="stylesheet" href="/real_control_v2/assets/plugins/jstree/default/style.css" merge="plugins"/> | |
| 31 | + | |
| 32 | + <link rel="stylesheet" href="/real_control_v2/css/modal_extend.css" merge="custom_style"/> | |
| 33 | + <!-- perfect-scrollbar style --> | |
| 34 | + <link rel="stylesheet" href="/real_control_v2/assets/plugins/perfect-scrollbar/perfect-scrollbar.css" | |
| 35 | + merge="plugins"/> | |
| 36 | + <!-- layer 3.0.3 --> | |
| 37 | + <link rel="stylesheet" href="/real_control_v2/assets/plugins/layer3.0.3/skin/default/layer.css" merge="plugins"/> | |
| 38 | + <link rel="stylesheet" href="/real_control_v2/assets/plugins/layer3.0.3/skin/moon/style.css" merge="plugins"/> | |
| 39 | + | |
| 40 | + <!-- flatpickr --> | |
| 41 | + <link rel="stylesheet" href="/real_control_v2/assets/plugins/flatpickr/flatpickr.min.css" merge="plugins"/> | |
| 42 | + <link rel="stylesheet" href="/real_control_v2/assets/plugins/flatpickr/themes/airbnb.css" merge="plugins"/> | |
| 43 | + | |
| 44 | + <link rel="stylesheet" href="/real_control_v2/css/ct_table.css" merge="custom_style"/> | |
| 45 | +</head> | |
| 46 | + | |
| 47 | +<body> | |
| 48 | +<div class="main-container" style="height: 100%;"> | |
| 49 | + <span style="position: absolute;left: calc(50% - 35px);top: calc(45% - 35px);">加载中...</span> | |
| 50 | +</div> | |
| 51 | + | |
| 52 | +<!-- 地图相关 --> | |
| 53 | +<script src="http://api.map.baidu.com/api?v=2.0&ak=IGGrr4UjwIYzatoCRFKEL8sT"></script> | |
| 54 | +<script src="http://api.map.baidu.com/library/TrafficControl/1.4/src/TrafficControl_min.js"></script> | |
| 55 | +<script src="/assets/js/baidu//MarkerClusterer.js" merge="plugins"></script> | |
| 56 | +<script src="/assets/js/TransGPS.js" merge="plugins"></script> | |
| 57 | +<!-- 高德 --> | |
| 58 | +<script src="http://webapi.amap.com/maps?v=1.3&key=16cb1c5043847e09ef9edafdd77befda"></script> | |
| 59 | +<!-- jquery --> | |
| 60 | +<script src="/real_control_v2/assets/js/jquery.min.js"></script> | |
| 61 | +<!-- jquery actual --> | |
| 62 | +<script src="/real_control_v2/assets/js/jquery.actual.min.js" merge="plugins"></script> | |
| 63 | +<!-- moment.js 日期处理类库 --> | |
| 64 | +<script src="/real_control_v2/assets/plugins/moment/moment.min.js"></script> | |
| 65 | +<script src="/real_control_v2/assets/plugins/moment/zh-cn.js"></script> | |
| 66 | + | |
| 67 | +<!-- flatpickr --> | |
| 68 | +<script src="/real_control_v2/assets/plugins/flatpickr/flatpickr.min.js" merge="plugins"></script> | |
| 69 | +<script src="/real_control_v2/assets/plugins/flatpickr/l10n/zh.js" merge="plugins"></script> | |
| 70 | + | |
| 71 | +<!-- perfect-scrollbar --> | |
| 72 | +<script src="/real_control_v2/assets/plugins/perfect-scrollbar/perfect-scrollbar.jquery.js" merge="plugins"></script> | |
| 73 | +<!-- common js --> | |
| 74 | +<script src="/real_control_v2/js/common.js"></script> | |
| 75 | +<!-- art-template 模版引擎 --> | |
| 76 | +<script src="/assets/plugins/template.js" merge="plugins"></script> | |
| 77 | +<!-- d3 --> | |
| 78 | +<script src="/assets/js/d3.min.js"></script> | |
| 79 | +<!-- EventProxy --> | |
| 80 | +<script src="/assets/js/eventproxy.js"></script> | |
| 81 | +<!-- uikit core --> | |
| 82 | +<script src="/real_control_v2/assets/plugins/uikit-2.27.1/uikit.min.js" merge="uikit_js"></script> | |
| 83 | +<script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/notify.min.js" merge="uikit_js"></script> | |
| 84 | +<script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/tooltip.min.js" merge="uikit_js"></script> | |
| 85 | +<script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/autocomplete.min.js" merge="uikit_js"></script> | |
| 86 | +<script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/accordion.min.js" merge="uikit_js"></script> | |
| 87 | +<script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/sticky.min.js" merge="uikit_js"></script> | |
| 88 | + | |
| 89 | +<!-- js tree --> | |
| 90 | +<script src="/real_control_v2/assets/plugins/jstree/jstree.min.js" merge="plugins"></script> | |
| 91 | +<!-- layer 3.0.3 --> | |
| 92 | +<script src="/real_control_v2/assets/plugins/layer3.0.3/layer.js" merge="plugins"></script> | |
| 93 | + | |
| 94 | +<!-- 模态框扩展 --> | |
| 95 | +<script src="/real_control_v2/js/modal_extend.js" merge="custom_js"></script> | |
| 96 | + | |
| 97 | +<script src="/real_control_v2/alone_page/map/alone_data_basic.js" merge="custom_js"></script> | |
| 98 | +<script src="/real_control_v2/alone_page/map/alone_data_gps.js" merge="custom_js"></script> | |
| 99 | +<script src="/real_control_v2/js/utils/ct_table.js" merge="custom_js"></script> | |
| 100 | +<!-- jquery.serializejson JSON序列化插件 --> | |
| 101 | +<script src="/assets/plugins/jquery.serializejson.js" merge="uikit_js"></script> | |
| 102 | + | |
| 103 | +</body> | |
| 104 | +<script> | |
| 105 | + gb_data_gps.fixedTimeRefresh(); | |
| 106 | + var res_load_ep = EventProxy.create('data-basic', function () { | |
| 107 | + | |
| 108 | + //嵌入地图页面 | |
| 109 | + $('.main-container').load('/real_control_v2/mapmonitor/real.html', function () { | |
| 110 | + $('.map-system-msg.flex-left').remove(); | |
| 111 | + }); | |
| 112 | + }); | |
| 113 | + | |
| 114 | + var isArray = function (obj) { | |
| 115 | + return Object.prototype.toString.call(obj) === '[object Array]'; | |
| 116 | + }; | |
| 117 | +</script> | |
| 118 | +</html> | ... | ... |
src/main/resources/static/real_control_v2/css/home.css
| ... | ... | @@ -309,4 +309,20 @@ span.signal-state-speed-limit{ |
| 309 | 309 | } |
| 310 | 310 | .uk-tab>li:nth-child(n+2)>a{ |
| 311 | 311 | margin-left: 0 !important; |
| 312 | +} | |
| 313 | + | |
| 314 | +.home_alone_page{ | |
| 315 | + cursor: pointer; | |
| 316 | +} | |
| 317 | + | |
| 318 | +#send-phrase-modal .tools, | |
| 319 | +#send-phrase-multi-modal .tools{ | |
| 320 | + display: inline-block; | |
| 321 | + margin-left: 5px; | |
| 322 | +} | |
| 323 | + | |
| 324 | +#send-phrase-modal .tools>span, | |
| 325 | +#send-phrase-multi-modal .tools>span{ | |
| 326 | + cursor: pointer; | |
| 327 | + margin-left: 12px; | |
| 312 | 328 | } |
| 313 | 329 | \ No newline at end of file | ... | ... |
src/main/resources/static/real_control_v2/css/main.css
| ... | ... | @@ -1582,8 +1582,16 @@ ul.left_tabs_lg li{ |
| 1582 | 1582 | color: #929292; |
| 1583 | 1583 | } |
| 1584 | 1584 | |
| 1585 | -#all-devices-modal .search-form input{ | |
| 1586 | - width: 160px; | |
| 1585 | +#all-devices-modal .search-form input[type=text]{ | |
| 1586 | + width: 100px; | |
| 1587 | +} | |
| 1588 | + | |
| 1589 | +#all-devices-modal .auto-refresh{ | |
| 1590 | + vertical-align: middle;margin-left: 5px;color: grey; | |
| 1591 | +} | |
| 1592 | + | |
| 1593 | +#all-devices-modal .auto-refresh.active{ | |
| 1594 | + color: #405dff; | |
| 1587 | 1595 | } |
| 1588 | 1596 | |
| 1589 | 1597 | #all-devices-modal .uk-margin-small-top { |
| ... | ... | @@ -1655,4 +1663,31 @@ ul.left_tabs_lg li{ |
| 1655 | 1663 | |
| 1656 | 1664 | #schedule-tzrc-modal dl.active input[type=checkbox]:before{ |
| 1657 | 1665 | color: #ffffff; |
| 1666 | +} | |
| 1667 | + | |
| 1668 | +.sch-search-autocom input{ | |
| 1669 | + padding: 0 !important; | |
| 1670 | + height: 100% !important; | |
| 1671 | +} | |
| 1672 | + | |
| 1673 | +label.blue_checkbox{ | |
| 1674 | + margin-left: 12px; | |
| 1675 | +} | |
| 1676 | + | |
| 1677 | +label.blue_checkbox>input{ | |
| 1678 | + width: 17px !important; | |
| 1679 | + height: 17px !important; | |
| 1680 | +} | |
| 1681 | + | |
| 1682 | +label.blue_checkbox>input:checked:before, | |
| 1683 | +label.blue_checkbox>input:indeterminate:before{ | |
| 1684 | + line-height: 15px !important; | |
| 1685 | +} | |
| 1686 | + | |
| 1687 | +dd.disabled{ | |
| 1688 | + color: #b5b3b3; | |
| 1689 | +} | |
| 1690 | + | |
| 1691 | +dl.active>dd.disabled{ | |
| 1692 | + color: #ececec; | |
| 1658 | 1693 | } |
| 1659 | 1694 | \ No newline at end of file | ... | ... |
src/main/resources/static/real_control_v2/css/north.css
| ... | ... | @@ -490,4 +490,14 @@ |
| 490 | 490 | .ct-badge.ct-badge-LSBCTZ:hover{ |
| 491 | 491 | background: red; |
| 492 | 492 | color: #fff; |
| 493 | +} | |
| 494 | + | |
| 495 | +span.sm-red{ | |
| 496 | + font-size: 12px; | |
| 497 | + color: #ff5454; | |
| 498 | +} | |
| 499 | + | |
| 500 | +span.sm-grey{ | |
| 501 | + font-size: 12px; | |
| 502 | + color: grey; | |
| 493 | 503 | } |
| 494 | 504 | \ No newline at end of file | ... | ... |
src/main/resources/static/real_control_v2/fragments/home/context_menu.html
| ... | ... | @@ -11,11 +11,15 @@ |
| 11 | 11 | <input type="hidden" value="{{nbbm}}" name="nbbm" /> |
| 12 | 12 | <div class="uk-form-row"> |
| 13 | 13 | <select style="width: 170px;" class="common_phrase_sel"> |
| 14 | - <option value="">------ 常用短语 -------</option> | |
| 15 | - <option value="天气异常,请小心驾驶">天气异常,请小心驾驶</option> | |
| 16 | - <option value="请适当减速慢行,保持最佳行车间距">请适当减速慢行,保持最佳行车间距</option> | |
| 17 | - <option value="请准点执行班次任务">请准点执行班次任务</option> | |
| 18 | 14 | </select> |
| 15 | + <div class="tools" > | |
| 16 | + <span data-uk-tooltip title="添加到常用短语" class="add_frequent_phrases"> | |
| 17 | + <i class="uk-icon-plus"></i> | |
| 18 | + </span> | |
| 19 | + <span data-uk-tooltip title="删除这条常用短语" class="minus_frequent_phrases"> | |
| 20 | + <i class="uk-icon-minus"></i> | |
| 21 | + </span> | |
| 22 | + </div> | |
| 19 | 23 | </div> |
| 20 | 24 | <div class="uk-form-row"> |
| 21 | 25 | <textarea cols="30" rows="5" name="text" data-fv-notempty data-fv-stringlength="true" data-fv-stringlength-max="50" placeholder="输入短语,不要超过50 个字符" style="margin: 0px; width: 100%; height: 110px;"></textarea> |
| ... | ... | @@ -43,9 +47,16 @@ |
| 43 | 47 | <div class="uk-width-4-6" style="border-left: 1px solid #dddddd;"> |
| 44 | 48 | <form class="uk-form fixed-tool"> |
| 45 | 49 | <div class="uk-form-row"> |
| 46 | - <select> | |
| 47 | - <option value="">------ 常用短语 -------</option> | |
| 48 | - </select> | |
| 50 | + <select style="width: 170px;" class="common_phrase_sel"> | |
| 51 | + </select> | |
| 52 | + <div class="tools" > | |
| 53 | + <span data-uk-tooltip title="添加到常用短语" class="add_frequent_phrases"> | |
| 54 | + <i class="uk-icon-plus"></i> | |
| 55 | + </span> | |
| 56 | + <span data-uk-tooltip title="删除这条常用短语" class="minus_frequent_phrases"> | |
| 57 | + <i class="uk-icon-minus"></i> | |
| 58 | + </span> | |
| 59 | + </div> | |
| 49 | 60 | </div> |
| 50 | 61 | <br /> |
| 51 | 62 | <div class="uk-form-row"> | ... | ... |
src/main/resources/static/real_control_v2/fragments/home/layout.html
| ... | ... | @@ -13,8 +13,12 @@ |
| 13 | 13 | <li {{if i==0}}class="uk-active"{{/if}}><a> {{t}}</a></li> |
| 14 | 14 | {{/each}} |
| 15 | 15 | </ul> |
| 16 | - <div class="home-rb-explain-icon uk-icon-hover"> | |
| 17 | - <i class="uk-icon-question-circle"></i> | |
| 16 | + <div class="home-rb-explain-icon "> | |
| 17 | + <a href="/real_control_v2/alone_page/home/home_wrap.html" target="_blank"> | |
| 18 | + <i class="uk-icon-send-o home_alone_page uk-icon-hover" ></i> | |
| 19 | + </a> | |
| 20 | + | |
| 21 | + <i class="uk-icon-question-circle uk-icon-hover"></i> | |
| 18 | 22 | </div> |
| 19 | 23 | </div> |
| 20 | 24 | </script> | ... | ... |
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/bc_type_major.html
| ... | ... | @@ -41,7 +41,7 @@ |
| 41 | 41 | <div class="uk-form-row"> |
| 42 | 42 | <div class="uk-form-controls" style="margin-left: 0;"> |
| 43 | 43 | <label style="color: #827f7f;font-size: 13px;"> |
| 44 | - <input class="i-cbox" type="checkbox" name="sendDirective" checked> | |
| 44 | + <input class="i-cbox" type="checkbox" name="sendDirective" > | |
| 45 | 45 | 下发调度指令 |
| 46 | 46 | </label> |
| 47 | 47 | </div> |
| ... | ... | @@ -50,7 +50,7 @@ |
| 50 | 50 | </div> |
| 51 | 51 | <div class="uk-modal-footer uk-text-right" style="margin-bottom: -20px;"> |
| 52 | 52 | <button type="button" class="uk-button uk-modal-close">取消</button> |
| 53 | - <button type="submit" class="uk-button uk-button-primary"><i class="uk-icon-send"></i> 确认调整并下发指令 | |
| 53 | + <button type="submit" class="uk-button uk-button-primary"><i class="uk-icon-send"></i> 确认调整 | |
| 54 | 54 | </button> |
| 55 | 55 | </div> |
| 56 | 56 | </form> |
| ... | ... | @@ -59,7 +59,7 @@ |
| 59 | 59 | <script> |
| 60 | 60 | (function () { |
| 61 | 61 | var modal = '#bctype-major-modal' |
| 62 | - , sch, stationRoutes, parentModal; | |
| 62 | + , sch, stationRoutes, parentModal, _dfsj; | |
| 63 | 63 | |
| 64 | 64 | $('[name=sendDirective]', modal).on('click', function () { |
| 65 | 65 | if ($(this)[0].checked) |
| ... | ... | @@ -134,6 +134,8 @@ |
| 134 | 134 | e.stopPropagation(); |
| 135 | 135 | sch = data.sch; |
| 136 | 136 | parentModal = data.parentModal; |
| 137 | + if(data._dfsj) | |
| 138 | + sch.dfsj = data._dfsj; | |
| 137 | 139 | |
| 138 | 140 | //submit |
| 139 | 141 | var f = $('form', modal).formValidation(gb_form_validation_opts); |
| ... | ... | @@ -181,7 +183,9 @@ |
| 181 | 183 | UIkit.modal(modal).hide(); |
| 182 | 184 | gb_schedule_table.updateSchedule(rs.t); |
| 183 | 185 | //触发父容器刷新事件 |
| 184 | - $(parentModal).trigger('init', {sch: rs.t}); | |
| 186 | + //$(parentModal).trigger('init', {sch: rs.t}); | |
| 187 | + //关闭 | |
| 188 | + UIkit.modal(parentModal).hide(); | |
| 185 | 189 | notify_succ('调整放站成功'); |
| 186 | 190 | }); |
| 187 | 191 | } | ... | ... |
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/bc_type_venting.html
| ... | ... | @@ -41,7 +41,7 @@ |
| 41 | 41 | <div class="uk-form-row"> |
| 42 | 42 | <div class="uk-form-controls" style="margin-left: 0;"> |
| 43 | 43 | <label style="color: #827f7f;font-size: 13px;"> |
| 44 | - <input class="i-cbox" type="checkbox" name="sendDirective" checked> | |
| 44 | + <input class="i-cbox" type="checkbox" name="sendDirective" > | |
| 45 | 45 | 下发调度指令 |
| 46 | 46 | </label> |
| 47 | 47 | </div> |
| ... | ... | @@ -50,7 +50,7 @@ |
| 50 | 50 | </div> |
| 51 | 51 | <div class="uk-modal-footer uk-text-right" style="margin-bottom: -20px;"> |
| 52 | 52 | <button type="button" class="uk-button uk-modal-close">取消</button> |
| 53 | - <button type="submit" class="uk-button uk-button-primary"><i class="uk-icon-send"></i> 确认调整并下发指令 | |
| 53 | + <button type="submit" class="uk-button uk-button-primary"><i class="uk-icon-send"></i> 确认调整 | |
| 54 | 54 | </button> |
| 55 | 55 | </div> |
| 56 | 56 | </form> |
| ... | ... | @@ -131,6 +131,8 @@ |
| 131 | 131 | e.stopPropagation(); |
| 132 | 132 | sch = data.sch; |
| 133 | 133 | parentModal = data.parentModal; |
| 134 | + if(data._dfsj) | |
| 135 | + sch.dfsj = data._dfsj; | |
| 134 | 136 | |
| 135 | 137 | //submit |
| 136 | 138 | var f = $('form', modal).formValidation(gb_form_validation_opts); |
| ... | ... | @@ -178,7 +180,9 @@ |
| 178 | 180 | UIkit.modal(modal).hide(); |
| 179 | 181 | gb_schedule_table.updateSchedule(rs.t); |
| 180 | 182 | //触发父容器刷新事件 |
| 181 | - $(parentModal).trigger('init', {sch: rs.t}); | |
| 183 | + //$(parentModal).trigger('init', {sch: rs.t}); | |
| 184 | + //关闭 | |
| 185 | + UIkit.modal(parentModal).hide(); | |
| 182 | 186 | notify_succ('调整直发成功'); |
| 183 | 187 | }); |
| 184 | 188 | } | ... | ... |
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/dftz.html
| ... | ... | @@ -185,7 +185,7 @@ |
| 185 | 185 | $(document.body).append(htmlStr); |
| 186 | 186 | |
| 187 | 187 | UIkit.modal(detailModal, {bgclose: true,modal:false}).show(); |
| 188 | - $(detailModal).trigger('init', {sch: sch, parentModal: modal}); | |
| 188 | + $(detailModal).trigger('init', {sch: sch, parentModal: modal, _dfsj: $('[name=dfsj]', modal).val()}); | |
| 189 | 189 | }) |
| 190 | 190 | }); |
| 191 | 191 | }); | ... | ... |
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/fcxxwt.html
| ... | ... | @@ -191,6 +191,12 @@ |
| 191 | 191 | e.preventDefault(); |
| 192 | 192 | var data = $(this).serializeJSON(); |
| 193 | 193 | |
| 194 | + //校验实发实达时间 | |
| 195 | + if(!validation_s_e_Time(data)){ | |
| 196 | + notify_err("实发时间不能晚于实达时间!"); | |
| 197 | + return; | |
| 198 | + } | |
| 199 | + | |
| 194 | 200 | if(!data.adjustExps && (data.status==-1 |
| 195 | 201 | || (data.jhlc==0 && sch.bcType != 'in' && sch.bcType != 'out'))){ |
| 196 | 202 | notify_err("当前操作需要选择调整原因!"); |
| ... | ... | @@ -280,6 +286,27 @@ |
| 280 | 286 | }) |
| 281 | 287 | }); |
| 282 | 288 | }); |
| 289 | + | |
| 290 | + function validation_s_e_Time(data) { | |
| 291 | + var config = gb_data_line_config.get(sch.xlBm); | |
| 292 | + var st = get_time(sch.scheduleDateStr, data.fcsjActual, config); | |
| 293 | + var et = get_time(sch.scheduleDateStr, data.zdsjActual, config); | |
| 294 | + if(st && et && st > et) | |
| 295 | + return false; | |
| 296 | + return true; | |
| 297 | + } | |
| 298 | + | |
| 299 | + var DAY_TIME = 1000 * 60 * 60 * 24; | |
| 300 | + function get_time(rq, timeStr, config) { | |
| 301 | + var t = null; | |
| 302 | + if(timeStr){ | |
| 303 | + t = moment(rq + timeStr, 'YYYY-MM-DDHH:mm'); | |
| 304 | + if(timeStr.localeCompare(config.startOpt) < 0) | |
| 305 | + return t + DAY_TIME; | |
| 306 | + } | |
| 307 | + | |
| 308 | + return t; | |
| 309 | + } | |
| 283 | 310 | })(); |
| 284 | 311 | </script> |
| 285 | 312 | </div> | ... | ... |
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/sub_task_v2/add_in_out.html
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/sub_task_v2/add_range_turn.html
| ... | ... | @@ -218,8 +218,8 @@ |
| 218 | 218 | } |
| 219 | 219 | if(this.checked){ |
| 220 | 220 | //烂班2 烂全程 |
| 221 | - $f('startStation', df2).val(sch.zdzCode); | |
| 222 | - $f('endStation', df2).val(sch.qdzCode); | |
| 221 | + $f('startStation', df2).val(nextSch.qdzCode); | |
| 222 | + $f('endStation', df2).val(nextSch.zdzCode); | |
| 223 | 223 | $f('mileage', df2).val(nextSch.jhlcOrig); |
| 224 | 224 | $f('startDate', df2).val(nextSch.dfsj); |
| 225 | 225 | $f('endDate', df2).val(nextSch.zdsj); | ... | ... |
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/tzrc.html
| ... | ... | @@ -47,10 +47,13 @@ |
| 47 | 47 | <div class="uk-width-1-2"> |
| 48 | 48 | <div class="uk-form-row"> |
| 49 | 49 | <label class="uk-form-label">车辆</label> |
| 50 | - <div class="uk-form-controls"> | |
| 51 | - <div class="uk-autocomplete uk-form car-autocom"> | |
| 50 | + <div class="uk-form-controls" > | |
| 51 | + <div class="uk-autocomplete uk-form car-autocom" style="width: 77%;"> | |
| 52 | 52 | <input type="text" value="" name="clZbh" required> |
| 53 | 53 | </div> |
| 54 | + <label class="blue_checkbox cl_enable_key_label"> | |
| 55 | + <input type="checkbox" checked> | |
| 56 | + </label> | |
| 54 | 57 | </div> |
| 55 | 58 | </div> |
| 56 | 59 | </div> |
| ... | ... | @@ -58,9 +61,12 @@ |
| 58 | 61 | <div class="uk-form-row"> |
| 59 | 62 | <label class="uk-form-label">驾驶员 </label> |
| 60 | 63 | <div class="uk-form-controls"> |
| 61 | - <div class="uk-autocomplete uk-form jsy-autocom"> | |
| 64 | + <div class="uk-autocomplete uk-form jsy-autocom" style="width: 77%;"> | |
| 62 | 65 | <input type="text" value="" name="jsy" required> |
| 63 | 66 | </div> |
| 67 | + <label class="blue_checkbox jsy_enable_key_label"> | |
| 68 | + <input type="checkbox" checked> | |
| 69 | + </label> | |
| 64 | 70 | </div> |
| 65 | 71 | </div> |
| 66 | 72 | </div> |
| ... | ... | @@ -77,7 +83,7 @@ |
| 77 | 83 | </div> |
| 78 | 84 | </div> |
| 79 | 85 | </div> |
| 80 | - <div class="uk-modal-footer uk-text-right" style="margin-bottom: -20px;"> | |
| 86 | + <div class="uk-modal-footer uk-text-right" style="margin-bottom: -20px;position: relative;"> | |
| 81 | 87 | <button type="button" class="uk-button uk-modal-close">取消</button> |
| 82 | 88 | <button type="submit" class="uk-button uk-button-primary" ><i class="uk-icon-check"></i> 保存 |
| 83 | 89 | </button> |
| ... | ... | @@ -107,9 +113,9 @@ |
| 107 | 113 | <span class="uk-badge uk-badge-notification">{{sch.cTasks.length}}</span> |
| 108 | 114 | {{/if}} |
| 109 | 115 | </dd> |
| 110 | - <dd>{{sch.clZbh}}</dd> | |
| 111 | - <dd>{{sch.jGh}}/{{sch.jName}}</dd> | |
| 112 | - <dd>{{sch.sGh}}/{{sch.sName}}</dd> | |
| 116 | + <dd data-old="{{sch.clZbh}}">{{sch.clZbh}}</dd> | |
| 117 | + <dd data-old="{{sch.jGh}}/{{sch.jName}}">{{sch.jGh}}/{{sch.jName}}</dd> | |
| 118 | + <dd data-old="{{sch.sGh}}/{{sch.sName}}">{{sch.sGh}}/{{sch.sName}}</dd> | |
| 113 | 119 | <dd> |
| 114 | 120 | {{if sch.status==2}} |
| 115 | 121 | <span class="ct_zt_yzx">已执行</span> |
| ... | ... | @@ -160,20 +166,26 @@ |
| 160 | 166 | $('.tzrc-table-wrap', modal).perfectScrollbar('update'); |
| 161 | 167 | }); |
| 162 | 168 | |
| 169 | + | |
| 170 | + writeSch2Form(sch); | |
| 163 | 171 | $(modal).on('click', '.sch-tzrc-table .ct_table_body dl', function () { |
| 164 | 172 | var cbox = $('input[type=checkbox]',this)[0]; |
| 165 | 173 | //var active = $(); |
| 166 | 174 | if(!$(this).hasClass('active')){ |
| 167 | 175 | $(this).addClass('active'); |
| 168 | 176 | cbox.checked = true; |
| 169 | - var lineCode = $('[name=lineSelect]', modal).val(); | |
| 170 | - var sch = gb_schedule_table.findScheduleByLine(lineCode)[$(this).data('id')]; | |
| 171 | - | |
| 172 | - writeSch2Form(sch); | |
| 177 | + renderCell(); | |
| 173 | 178 | } |
| 174 | 179 | else{ |
| 175 | 180 | $(this).removeClass('active'); |
| 176 | 181 | cbox.checked = false; |
| 182 | + //$(this).find('dd[data-old]').text() | |
| 183 | + var $jsyCell = $($($(this).find('dd')[2])); | |
| 184 | + var $spyCell = $($($(this).find('dd')[3])); | |
| 185 | + var $clCell = $($($(this).find('dd')[1])); | |
| 186 | + $jsyCell.text($jsyCell.data('old')); | |
| 187 | + $spyCell.text($spyCell.data('old')); | |
| 188 | + $clCell.text($clCell.data('old')); | |
| 177 | 189 | } |
| 178 | 190 | }); |
| 179 | 191 | |
| ... | ... | @@ -207,6 +219,7 @@ |
| 207 | 219 | var f = $('form.tzrc_form', modal); |
| 208 | 220 | f.on('submit', function (e) { |
| 209 | 221 | e.stopPropagation(); |
| 222 | + $('[type=submit]', f).attr('disabled', 'disabled'); | |
| 210 | 223 | |
| 211 | 224 | var checkeds = $('.sch-tzrc-table .ct_table_body input[type=checkbox]:checked', modal); |
| 212 | 225 | if (checkeds.length == 0) |
| ... | ... | @@ -236,8 +249,55 @@ |
| 236 | 249 | }); |
| 237 | 250 | return false; |
| 238 | 251 | }); |
| 252 | + | |
| 253 | + /** | |
| 254 | + * 驾驶员/售票员文本框改变事件 | |
| 255 | + */ | |
| 256 | + var renderRunFlag; | |
| 257 | + $('input[name=jsy],input[name=spy],input[name=clZbh]', modal).on('input change', function () { | |
| 258 | + if(renderRunFlag) | |
| 259 | + return; | |
| 260 | + renderRunFlag = true; | |
| 261 | + setTimeout(function () { | |
| 262 | + renderCell(); | |
| 263 | + renderRunFlag = false; | |
| 264 | + }, 200); | |
| 265 | + }); | |
| 266 | + | |
| 267 | + $('.jsy_enable_key_label', modal).on('click', function () { | |
| 268 | + var checked = $('input[type=checkbox]', this)[0].checked; | |
| 269 | + if(checked) | |
| 270 | + enableJsy(); | |
| 271 | + else | |
| 272 | + disabledJsy(); | |
| 273 | + }); | |
| 274 | + | |
| 275 | + $('.cl_enable_key_label', modal).on('click', function () { | |
| 276 | + var checked = $('input[type=checkbox]', this)[0].checked; | |
| 277 | + if(checked) | |
| 278 | + enableCl(); | |
| 279 | + else | |
| 280 | + disabledCl(); | |
| 281 | + }); | |
| 239 | 282 | }); |
| 240 | 283 | |
| 284 | + function renderCell() { | |
| 285 | + var jsy = $('input[name=jsy]:enabled', modal).val(); | |
| 286 | + var spy = $('input[name=spy]', modal).val(); | |
| 287 | + var nbbm = $('input[name=clZbh]:enabled', modal).val(); | |
| 288 | + $('.sch-tzrc-table .ct_table_body>dl.active').each(function () { | |
| 289 | + var jsyCell = $(this).find('dd')[2]; | |
| 290 | + var spyCell = $(this).find('dd')[3]; | |
| 291 | + var clCell = $(this).find('dd')[1]; | |
| 292 | + | |
| 293 | + if(jsy) | |
| 294 | + $(jsyCell).text(jsy); | |
| 295 | + if(nbbm) | |
| 296 | + $(clCell).text(nbbm); | |
| 297 | + $(spyCell).text(spy); | |
| 298 | + }); | |
| 299 | + } | |
| 300 | + | |
| 241 | 301 | function writeSch2Form(sch) { |
| 242 | 302 | var f = $('.tzrc_form', modal); |
| 243 | 303 | $('input[name=clZbh]', f).val(sch.clZbh).trigger('input'); |
| ... | ... | @@ -268,6 +328,43 @@ |
| 268 | 328 | $('.sch-tzrc-table .ct_table_body>dl', modal).each(function () { |
| 269 | 329 | $(this).removeClass('active'); |
| 270 | 330 | $('input[type=checkbox]',this)[0].checked = false; |
| 331 | + | |
| 332 | + $.each($('dd', this), function () { | |
| 333 | + if($(this).data('old')) | |
| 334 | + $(this).text($(this).data('old')); | |
| 335 | + }); | |
| 336 | + }); | |
| 337 | + } | |
| 338 | + | |
| 339 | + function disabledJsy() { | |
| 340 | + $('[name=jsy]',modal).attr('disabled', 'disabled'); | |
| 341 | + $('.sch-tzrc-table .ct_table_body>dl').each(function () { | |
| 342 | + var jsyCell = $(this).find('dd')[2]; | |
| 343 | + $(jsyCell).addClass('disabled').text($(jsyCell).data('old')); | |
| 344 | + }); | |
| 345 | + } | |
| 346 | + | |
| 347 | + function enableJsy() { | |
| 348 | + $('[name=jsy]',modal).removeAttr('disabled'); | |
| 349 | + $('.sch-tzrc-table .ct_table_body>dl').each(function () { | |
| 350 | + var jsyCell = $(this).find('dd')[2]; | |
| 351 | + $(jsyCell).removeClass('disabled').text($(jsyCell).data('old')); | |
| 352 | + }); | |
| 353 | + } | |
| 354 | + | |
| 355 | + function disabledCl() { | |
| 356 | + $('[name=clZbh]',modal).attr('disabled', 'disabled'); | |
| 357 | + $('.sch-tzrc-table .ct_table_body>dl').each(function () { | |
| 358 | + var clCell = $(this).find('dd')[1]; | |
| 359 | + $(clCell).addClass('disabled').text($(clCell).data('old')); | |
| 360 | + }); | |
| 361 | + } | |
| 362 | + | |
| 363 | + function enableCl() { | |
| 364 | + $('[name=clZbh]',modal).removeAttr('disabled'); | |
| 365 | + $('.sch-tzrc-table .ct_table_body>dl').each(function () { | |
| 366 | + var clCell = $(this).find('dd')[1]; | |
| 367 | + $(clCell).removeClass('disabled').text($(clCell).data('old')); | |
| 271 | 368 | }); |
| 272 | 369 | } |
| 273 | 370 | })(); | ... | ... |
src/main/resources/static/real_control_v2/fragments/north/nav/all_devices.html
| ... | ... | @@ -7,19 +7,13 @@ |
| 7 | 7 | <div class="uk-panel uk-panel-box uk-panel-box-primary"> |
| 8 | 8 | <form class="uk-form search-form"> |
| 9 | 9 | <fieldset data-uk-margin> |
| 10 | - <!--<legend> | |
| 11 | - 数据检索 | |
| 12 | - <!– <div class="legend-tools"> | |
| 13 | - <a class="uk-icon-small uk-icon-hover uk-icon-file-excel-o" data-uk-tooltip title="导出excel"></a> | |
| 14 | - </div> –> | |
| 15 | - </legend>--> | |
| 16 | 10 | <span class="horizontal-field">线路</span> |
| 17 | 11 | <div class="uk-autocomplete uk-form autocomplete-line" > |
| 18 | 12 | <input type="text" name="lineId" placeholder="线路"> |
| 19 | 13 | </div> |
| 20 | 14 | <span class="horizontal-field">车辆</span> |
| 21 | 15 | <div class="uk-autocomplete uk-form autocomplete-cars" > |
| 22 | - <input type="text" name="nbbm" placeholder="车辆自编号"> | |
| 16 | + <input type="text" name="nbbm" placeholder="自编号"> | |
| 23 | 17 | </div> |
| 24 | 18 | <span class="horizontal-field">设备号</span> |
| 25 | 19 | <div class="uk-autocomplete uk-form autocomplete-device" > |
| ... | ... | @@ -35,9 +29,23 @@ |
| 35 | 29 | </div> |
| 36 | 30 | <span class="horizontal-field">程序版本</span> |
| 37 | 31 | <div class="uk-autocomplete uk-form " > |
| 38 | - <input type="text" name="version" placeholder="程序版本" style="width: 110px;"> | |
| 32 | + <input type="text" name="version" placeholder="版本号" style="width: 60px;"> | |
| 39 | 33 | </div> |
| 40 | - <button class="uk-button">检索</button> | |
| 34 | + <span class="horizontal-field">状态</span> | |
| 35 | + <div class="uk-autocomplete uk-form " > | |
| 36 | + <select name="abnormalStatus"> | |
| 37 | + <option value="">全部</option> | |
| 38 | + <option value="outBounds">越界</option> | |
| 39 | + <option value="overspeed">超速</option> | |
| 40 | + <option value="offline">离线</option> | |
| 41 | + <option value="gps-offline">gps 0,0</option> | |
| 42 | + </select> | |
| 43 | + </div> | |
| 44 | + <button class="uk-button search-btn" title="只支持后模糊">检索</button> | |
| 45 | + <label class="auto-refresh" > | |
| 46 | + <input type="checkbox" value="1" name="schCBox" class="i-cbox"> | |
| 47 | + 自动刷新 | |
| 48 | + </label> | |
| 41 | 49 | </fieldset> |
| 42 | 50 | </form> |
| 43 | 51 | </div> |
| ... | ... | @@ -49,10 +57,10 @@ |
| 49 | 57 | <th style="width: 14%;">站点</th> |
| 50 | 58 | <th style="width: 11%;">车辆</th> |
| 51 | 59 | <th style="width: 11%;">设备号</th> |
| 52 | - <th style="width: 9%;">速度</th> | |
| 53 | 60 | <th style="width: 9%;">走向/营运</th> |
| 54 | - <th style="width: 10%;">程序版本</th> | |
| 61 | + <th style="width: 9%;">程序版本</th> | |
| 55 | 62 | <th>最后GPS时间</th> |
| 63 | + <th style="width: 9%;">状态</th> | |
| 56 | 64 | <th style="width: 8%;">来源</th> |
| 57 | 65 | </tr> |
| 58 | 66 | </thead> |
| ... | ... | @@ -72,17 +80,31 @@ |
| 72 | 80 | <td>{{gps.stationName}}</td> |
| 73 | 81 | <td>{{gps.nbbm}}</td> |
| 74 | 82 | <td>{{gps.deviceId}}</td> |
| 75 | - <td>{{gps.speed}}</td> | |
| 76 | 83 | <td>{{gps.upDown}}/{{gps.state}}</td> |
| 77 | 84 | <td>{{gps.version}}</td> |
| 78 | 85 | <td>{{gps.timeStr}}</td> |
| 79 | 86 | <td> |
| 87 | + {{if gps.valid==1}} | |
| 88 | + <span class="sm-red">invalid(-1</span> | |
| 89 | + {{else if gps.abnormalStatus=='outBounds'}} | |
| 90 | + <span class="sm-red" title="越界距离(米) {{gps.outOfBoundDistance}}">越界</span> | |
| 91 | + {{else if gps.abnormalStatus=='overspeed'}} | |
| 92 | + <span class="sm-red">超速({{gps.speed}})</span> | |
| 93 | + {{else if gps.abnormalStatus=='gps-offline'}} | |
| 94 | + <span class="sm-red">GPS (0,0)</span> | |
| 95 | + {{else if gps.abnormalStatus=='offline'}} | |
| 96 | + <span>离线</span> | |
| 97 | + {{else}} | |
| 98 | + ... | |
| 99 | + {{/if}} | |
| 100 | + </td> | |
| 101 | + <td> | |
| 80 | 102 | {{if gps.source==1}} |
| 81 | 103 | <span style="color: #1e1ef5;" title="已切换至新网关">网关</span> |
| 82 | 104 | {{else if gps.source==0}} |
| 83 | 105 | <span style="color: #8e8e8e;" title="转接的数据,无法下发指令">转发</span> |
| 84 | 106 | {{else}} |
| 85 | - <span>未知</span> | |
| 107 | + <span class="sm-grey">未知</span> | |
| 86 | 108 | {{/if}} |
| 87 | 109 | </td> |
| 88 | 110 | </tr> |
| ... | ... | @@ -148,7 +170,7 @@ |
| 148 | 170 | query(); |
| 149 | 171 | }); |
| 150 | 172 | |
| 151 | - var query = function() { | |
| 173 | + var query = function(cb) { | |
| 152 | 174 | var data = form.serializeJSON(); |
| 153 | 175 | data.page = page; |
| 154 | 176 | data.size = pageSize; |
| ... | ... | @@ -173,9 +195,75 @@ |
| 173 | 195 | //pagination |
| 174 | 196 | if (resetPagination) |
| 175 | 197 | pagination(rs.totalPages + 1, rs.page); |
| 198 | + | |
| 199 | + cb && cb(); | |
| 176 | 200 | }) |
| 177 | 201 | }; |
| 178 | 202 | |
| 203 | + /** | |
| 204 | + * 自动刷新 | |
| 205 | + */ | |
| 206 | + $('.auto-refresh', modal).on('click', function () { | |
| 207 | + var checked = $('input[type=checkbox]',this)[0].checked, | |
| 208 | + $sub_btn = $('.search-btn', form); | |
| 209 | + if(checked){ | |
| 210 | + $(this).addClass('active'); | |
| 211 | + $sub_btn.attr('disabled', 'disabled'); | |
| 212 | + auto_refresh.start(); | |
| 213 | + } | |
| 214 | + else{ | |
| 215 | + $(this).removeClass('active'); | |
| 216 | + $sub_btn.removeAttr('disabled'); | |
| 217 | + auto_refresh.stop(); | |
| 218 | + } | |
| 219 | + }); | |
| 220 | + | |
| 221 | + var auto_refresh = (function () { | |
| 222 | + var timer=null; | |
| 223 | + var span = $('.auto-refresh', modal).append('<span class="no"></span>').find('span.no'); | |
| 224 | + var space = 10; | |
| 225 | + var start = function () { | |
| 226 | + | |
| 227 | + (function () { | |
| 228 | + var f = arguments.callee; | |
| 229 | + run(); | |
| 230 | + if(space == 0){ | |
| 231 | + space = 10; | |
| 232 | + | |
| 233 | + resetPagination = true; | |
| 234 | + page=0; | |
| 235 | + query(function () { | |
| 236 | + timer = setTimeout(f, 1000); | |
| 237 | + }); | |
| 238 | + } | |
| 239 | + else{ | |
| 240 | + timer = setTimeout(f, 1000); | |
| 241 | + } | |
| 242 | + })(); | |
| 243 | + }; | |
| 244 | + | |
| 245 | + var stop = function () { | |
| 246 | + clearTimeout(timer); | |
| 247 | + timer = null; | |
| 248 | + space = 10; | |
| 249 | + span.text(''); | |
| 250 | + }; | |
| 251 | + | |
| 252 | + var run = function () { | |
| 253 | + space --; | |
| 254 | + span.text(space); | |
| 255 | + }; | |
| 256 | + | |
| 257 | + | |
| 258 | + return { | |
| 259 | + start: start, | |
| 260 | + stop: stop | |
| 261 | + } | |
| 262 | + })(); | |
| 263 | + | |
| 264 | + //注册 destroy | |
| 265 | + $(modal).on('ct-destroy', auto_refresh.stop); | |
| 266 | + | |
| 179 | 267 | var state_up_0 = function(device) { |
| 180 | 268 | var nbbm = gb_data_basic.device2nbbmMap()[device]; |
| 181 | 269 | stateChange(nbbm, 0, 0); | ... | ... |
src/main/resources/static/real_control_v2/js/data/data_line_config.js
0 → 100644
| 1 | +/** | |
| 2 | + * 线路配置信息 | |
| 3 | + * @type {{}} | |
| 4 | + */ | |
| 5 | +var gb_data_line_config = (function () { | |
| 6 | + | |
| 7 | + var lineConfigMap; | |
| 8 | + | |
| 9 | + var storage = window.localStorage; | |
| 10 | + var activeLines = JSON.parse(storage.getItem('lineControlItems')); | |
| 11 | + var line_idx = (function () { | |
| 12 | + var str = ''; | |
| 13 | + for (var i = 0, item; item = activeLines[i++];) { | |
| 14 | + str += (',' + item.lineCode); | |
| 15 | + } | |
| 16 | + return str.substr(1); | |
| 17 | + })(); | |
| 18 | + | |
| 19 | + gb_common.$get('/lineConfig/findByIdx', {idx: line_idx}, function (rs) { | |
| 20 | + lineConfigMap = {}; | |
| 21 | + $.each(rs.list, function () { | |
| 22 | + lineConfigMap[this.line.lineCode] = this; | |
| 23 | + }); | |
| 24 | + | |
| 25 | + console.log('lineConfigMap', lineConfigMap); | |
| 26 | + }); | |
| 27 | + | |
| 28 | + return { | |
| 29 | + get: function (lineCode) { | |
| 30 | + return lineConfigMap[lineCode]; | |
| 31 | + } | |
| 32 | + }; | |
| 33 | +})(); | |
| 0 | 34 | \ No newline at end of file | ... | ... |
src/main/resources/static/real_control_v2/js/home/context_menu.js
| ... | ... | @@ -53,6 +53,62 @@ var gb_home_context_menu = (function() { |
| 53 | 53 | }); |
| 54 | 54 | }; |
| 55 | 55 | |
| 56 | + /** | |
| 57 | + * 常用短语 | |
| 58 | + * @type {{add, minus}} | |
| 59 | + */ | |
| 60 | + var frequent_phrases = function () { | |
| 61 | + | |
| 62 | + var init = function (wrap) { | |
| 63 | + add(wrap); | |
| 64 | + minus(wrap); | |
| 65 | + //查询常用短语 | |
| 66 | + $.get('/frequent_phrases/all', function (list) { | |
| 67 | + var t = $('textarea[name=text]', wrap).val(); | |
| 68 | + var opts = '<option value="">------ 常用短语 -------</option>'; | |
| 69 | + for(var i=0,obj;obj=list[i++];){ | |
| 70 | + opts += '<option value="'+obj.text+'" data-id="'+obj.id+'" '+(obj.text==t?"selected":"")+'>'+obj.text+'</option>'; | |
| 71 | + } | |
| 72 | + $('.common_phrase_sel', wrap).html(opts); | |
| 73 | + }); | |
| 74 | + }; | |
| 75 | + | |
| 76 | + var add = function (wrap) { | |
| 77 | + $('.add_frequent_phrases', wrap).unbind('click').on('click', function () { | |
| 78 | + var text = $('textarea[name=text]', wrap).val(); | |
| 79 | + if(!$.trim(text)) | |
| 80 | + return notify_err('请在下列文本框内输入文字'); | |
| 81 | + | |
| 82 | + gb_common.$post('/frequent_phrases', {text: text}, function () { | |
| 83 | + notify_succ('添加成功!'); | |
| 84 | + init(wrap); | |
| 85 | + }); | |
| 86 | + }); | |
| 87 | + }; | |
| 88 | + | |
| 89 | + var minus = function (wrap) { | |
| 90 | + $('.minus_frequent_phrases', wrap).unbind('click').on('click', function () { | |
| 91 | + var text = $('.common_phrase_sel', wrap).val(); | |
| 92 | + if(!$.trim(text)) | |
| 93 | + return notify_err('请选中常用短语后再删除'); | |
| 94 | + | |
| 95 | + var id = $('.common_phrase_sel', wrap).find("option:selected").data('id'); | |
| 96 | + if(!id) | |
| 97 | + return notify_err('无法获取到索引'); | |
| 98 | + | |
| 99 | + gb_common.$del('/frequent_phrases/' + id, function () { | |
| 100 | + notify_succ('删除成功!'); | |
| 101 | + $('textarea[name=text]', wrap).val(''); | |
| 102 | + init(wrap); | |
| 103 | + }); | |
| 104 | + }); | |
| 105 | + }; | |
| 106 | + | |
| 107 | + return { | |
| 108 | + init: init | |
| 109 | + } | |
| 110 | + }(); | |
| 111 | + | |
| 56 | 112 | // send phrase |
| 57 | 113 | var sendPhrase = function() { |
| 58 | 114 | var dom = temps['home-send-phrase-temp']({ |
| ... | ... | @@ -62,10 +118,11 @@ var gb_home_context_menu = (function() { |
| 62 | 118 | // show modal |
| 63 | 119 | var elem = show_modal(modal, dom); |
| 64 | 120 | |
| 121 | + frequent_phrases.init(modal); | |
| 65 | 122 | //form submit |
| 66 | 123 | var f = $('form', modal).formValidation(gb_form_validation_opts); |
| 67 | 124 | $('.common_phrase_sel', f).on('change', function () { |
| 68 | - $('[name=text]', f).text($(this).val()); | |
| 125 | + $('[name=text]', f).val($(this).val()); | |
| 69 | 126 | }); |
| 70 | 127 | f.on('success.form.fv', function(e) { |
| 71 | 128 | e.preventDefault(); |
| ... | ... | @@ -92,8 +149,13 @@ var gb_home_context_menu = (function() { |
| 92 | 149 | }, |
| 93 | 150 | 'plugins': ['checkbox'] |
| 94 | 151 | }); |
| 152 | + | |
| 153 | + frequent_phrases.init(modal); | |
| 95 | 154 | //form submit |
| 96 | 155 | var f = $('form', modal).formValidation(gb_form_validation_opts); |
| 156 | + $('.common_phrase_sel', f).on('change', function () { | |
| 157 | + $('[name=text]', f).val($(this).val()); | |
| 158 | + }); | |
| 97 | 159 | f.on('success.form.fv', function(e) { |
| 98 | 160 | e.preventDefault(); |
| 99 | 161 | //tree checked node | ... | ... |
src/main/resources/static/real_control_v2/js/home/layout.js
| ... | ... | @@ -41,7 +41,7 @@ var gb_home_layout = (function () { |
| 41 | 41 | |
| 42 | 42 | //右下角说明icon |
| 43 | 43 | function initRbDxplain() { |
| 44 | - $(document).on('mouseenter', '.home-rb-explain-icon', function() { | |
| 44 | + $(document).on('mouseenter', '.home-rb-explain-icon>.uk-icon-question-circle', function() { | |
| 45 | 45 | $(this).qtip({ |
| 46 | 46 | show: { |
| 47 | 47 | ready: true, | ... | ... |
src/main/resources/static/real_control_v2/js/line_schedule/context_menu.js
| ... | ... | @@ -40,6 +40,10 @@ var gb_schedule_context_menu = (function () { |
| 40 | 40 | return add_sch_doms; |
| 41 | 41 | }, |
| 42 | 42 | dftz: function (sch) { |
| 43 | + if(sch.status > 0){ | |
| 44 | + notify_err((sch.status==1?'已发出':'已执行') + '的班次不能修改待发'); | |
| 45 | + return; | |
| 46 | + } | |
| 43 | 47 | open_modal(folder + '/dftz.html', { |
| 44 | 48 | sch: sch |
| 45 | 49 | }, modal_opts); |
| ... | ... | @@ -149,10 +153,10 @@ var gb_schedule_context_menu = (function () { |
| 149 | 153 | if (!isNaN(newValue) && newValue > 0) { |
| 150 | 154 | gb_common.$post_arr('/realSchedule/spaceAdjust', {ids: idArr, space: newValue}, function (rs) { |
| 151 | 155 | //刷新数据 |
| 152 | - if(rs.t){ | |
| 153 | - gb_schedule_table.reLoadAndRefresh(rs.t.xlBm); | |
| 154 | - } | |
| 155 | - //gb_schedule_table.updateSchedule(rs.ts); | |
| 156 | + //if(rs.t){ | |
| 157 | + // gb_schedule_table.reLoadAndRefresh(rs.t.xlBm); | |
| 158 | + //} | |
| 159 | + gb_schedule_table.updateSchedule(rs.ts); | |
| 156 | 160 | notify_succ('调整间隔成功!'); |
| 157 | 161 | }); |
| 158 | 162 | } else | ... | ... |
src/main/resources/static/real_control_v2/js/line_schedule/dbclick.js
| ... | ... | @@ -21,6 +21,11 @@ var gb_schedule_table_dbclick = (function() { |
| 21 | 21 | remarks: '', |
| 22 | 22 | opType: '0' |
| 23 | 23 | }, function(rs) { |
| 24 | + if(rs.flag && rs.flag==4008){ | |
| 25 | + notify_err('已发出的班次不能调整待发'); | |
| 26 | + gb_schedule_table.updateSchedule(rs.t); | |
| 27 | + return; | |
| 28 | + } | |
| 24 | 29 | gb_schedule_table.updateSchedule(rs.ts); |
| 25 | 30 | notify_succ('待发调整成功!'); |
| 26 | 31 | //重新计算应发未发 | ... | ... |
src/main/resources/static/real_control_v2/js/main.js
src/main/resources/static/real_control_v2/js/modal_extend.js
| ... | ... | @@ -4,7 +4,7 @@ $(document).on('hide.uk.modal', '.uk-modal', function () { |
| 4 | 4 | if($('.uk-modal-dialog', this).hasClass('uk-modal-dialog-lightbox')){ |
| 5 | 5 | return; |
| 6 | 6 | } |
| 7 | - $(this).remove(); | |
| 7 | + $(this).trigger('ct-destroy').remove(); | |
| 8 | 8 | }); |
| 9 | 9 | |
| 10 | 10 | $(document).on('show.uk.modal', '.uk-modal.ct_move_modal', function () { | ... | ... |
src/main/resources/static/real_control_v2/js/north/tabs.js
| ... | ... | @@ -18,12 +18,12 @@ var gb_tabs = (function() { |
| 18 | 18 | $('.main-container').html(tabContentHtmlStr); |
| 19 | 19 | |
| 20 | 20 | setTimeout(renderStyle, 4000); |
| 21 | - /*//地图选项卡初始点击 | |
| 21 | + //地图选项卡初始点击 | |
| 22 | 22 | $('#north_tabs_map_btn').one('click', function () { |
| 23 | 23 | if(typeof(gb_map_overlay_mge)!="undefined"){ |
| 24 | 24 | gb_map_overlay_mge.centerToRational(); |
| 25 | 25 | } |
| 26 | - });*/ | |
| 26 | + }); | |
| 27 | 27 | |
| 28 | 28 | //班次选项卡第一次点击,更新滚动条高度 |
| 29 | 29 | $('.north-tabs .uk-tab li.tab-line').one('click', function(e){ | ... | ... |
src/main/resources/static/real_control_v2/js/utils/svg_chart_tooltip.js
| ... | ... | @@ -108,7 +108,7 @@ var gb_svg_tooltip = (function () { |
| 108 | 108 | api.set({ |
| 109 | 109 | 'hide.event': false, |
| 110 | 110 | 'content.button': 'Close', |
| 111 | - 'content.title': 'GPS正常', | |
| 111 | + 'content.title': '...', | |
| 112 | 112 | 'position.my': 'top center', |
| 113 | 113 | 'position.at': 'bottom center' |
| 114 | 114 | }); | ... | ... |
src/main/resources/static/real_control_v2/main.html
| ... | ... | @@ -167,6 +167,7 @@ |
| 167 | 167 | <script src="/real_control_v2/js/data/data_basic.js" merge="custom_js"></script> |
| 168 | 168 | <script src="/real_control_v2/js/data/data_gps.js" merge="custom_js"></script> |
| 169 | 169 | <script src="/real_control_v2/js/data/gps_abnormal.js" merge="custom_js"></script> |
| 170 | +<script src="/real_control_v2/js/data/data_line_config.js" merge="custom_js"></script> | |
| 170 | 171 | <!-- 线路模拟图 --> |
| 171 | 172 | <script src="/real_control_v2/js/utils/svg_chart.js" merge="custom_js"></script> |
| 172 | 173 | <script src="/real_control_v2/js/utils/svg_data_convert.js" merge="custom_js"></script> | ... | ... |
src/main/resources/static/real_control_v2/mapmonitor/fragments/map_infowindow.html
| ... | ... | @@ -12,7 +12,21 @@ |
| 12 | 12 | 未知站点 |
| 13 | 13 | {{/if}} |
| 14 | 14 | </h5> |
| 15 | - <p>设备状态:正常</p> | |
| 15 | + <p>设备状态: | |
| 16 | + {{if valid==1}} | |
| 17 | + invalid(-1 | |
| 18 | + {{else if abnormalStatus=='outBounds'}} | |
| 19 | + 越界 | |
| 20 | + {{else if abnormalStatus=='overspeed'}} | |
| 21 | + 超速 | |
| 22 | + {{else if abnormalStatus=='gps-offline'}} | |
| 23 | + GPS掉线 | |
| 24 | + {{else if abnormalStatus=='offline'}} | |
| 25 | + 离线 | |
| 26 | + {{else}} | |
| 27 | + . | |
| 28 | + {{/if}} | |
| 29 | + </p> | |
| 16 | 30 | <p>设备号:{{deviceId}}</p> |
| 17 | 31 | <p>速度:{{speed}}</p> |
| 18 | 32 | <p>角度:{{direction}}</p> | ... | ... |
src/main/resources/static/real_control_v2/mapmonitor/real.html
| ... | ... | @@ -7,7 +7,7 @@ |
| 7 | 7 | |
| 8 | 8 | <div class="map-system-msg flex-left"> |
| 9 | 9 | <a class="z-depth-2 old_map" href="/pages/mapmonitor/alone/wrap.html" target="_blank"></a> |
| 10 | - <a class="z-depth-2 now_map" href="/real_control_v2/mapmonitor/alone_page/alone_wrap.html" target="_blank"> | |
| 10 | + <a class="z-depth-2 now_map" href="/real_control_v2/alone_page/map/alone_wrap.html" target="_blank"> | |
| 11 | 11 | <i class="uk-icon-send-o"></i> |
| 12 | 12 | </a> |
| 13 | 13 | </div> | ... | ... |