Commit e8bc5f845ecad6054925202f3b520fb65878586f

Authored by 潘钊
1 parent fc1818a3

update...

Showing 26 changed files with 1072 additions and 9 deletions
src/main/java/com/bsth/StartCommand.java
1 1 package com.bsth;
2 2  
3 3  
  4 +import com.bsth.data.abnormal.thread.AbnormalFixedScannerThread;
4 5 import com.bsth.data.in_out.buffer.BerthDataBuffer;
5 6 import com.bsth.data.in_out.thread.Car2BerthDataPstThread;
6 7 import com.bsth.data.in_out.thread.SignalPstThread;
... ... @@ -34,6 +35,8 @@ public class StartCommand implements CommandLineRunner{
34 35 BerthDataBuffer berthDataBuffer;
35 36 @Autowired
36 37 Car2BerthDataPstThread car2BerthDataPstThread;
  38 + @Autowired
  39 + AbnormalFixedScannerThread abnormalFixedScannerThread;
37 40  
38 41 @Override
39 42 public void run(String... arg0){
... ... @@ -43,7 +46,7 @@ public class StartCommand implements CommandLineRunner{
43 46 invocationSecurityMetadataSourceService.loadResourceDefine();
44 47  
45 48 //同步屏 LED 推送服务
46   - ledHttpPushHandler.start();
  49 + //ledHttpPushHandler.start();
47 50  
48 51 //signal、牌照识别、查询一体机数据消费队列
49 52 SignalAndAttConsumeQueue.start();
... ... @@ -59,6 +62,11 @@ public class StartCommand implements CommandLineRunner{
59 62 //实时车辆泊位数据入库
60 63 sexec.scheduleWithFixedDelay(car2BerthDataPstThread, 20, 20, TimeUnit.SECONDS);
61 64  
  65 +
  66 + /**
  67 + * 异常监管
  68 + */
  69 + sexec.scheduleAtFixedRate(abnormalFixedScannerThread, 80, 60, TimeUnit.SECONDS);
62 70 } catch (Exception e) {
63 71 e.printStackTrace();
64 72 }
... ...
src/main/java/com/bsth/controller/schedule/InOutScheduleController.java
... ... @@ -4,10 +4,12 @@ import com.bsth.data.schedule.dto.ScheduleInOut;
4 4 import com.bsth.service.schedule.ScheduleService;
5 5 import org.springframework.beans.factory.annotation.Autowired;
6 6 import org.springframework.web.bind.annotation.RequestMapping;
  7 +import org.springframework.web.bind.annotation.RequestParam;
7 8 import org.springframework.web.bind.annotation.RestController;
8 9  
9 10 import java.util.Collection;
10 11 import java.util.List;
  12 +import java.util.Map;
11 13  
12 14 /**
13 15 * Created by panzhao on 2017/9/4.
... ... @@ -28,4 +30,9 @@ public class InOutScheduleController {
28 30 public List<ScheduleInOut> all_out(){
29 31 return inOutScheduleService.all_out();
30 32 }
  33 +
  34 + @RequestMapping("findAbnormalByLineArray")
  35 + public Map<String, Object> findAbnormalByLineArray(@RequestParam String idx){
  36 + return inOutScheduleService.findAbnormalByLineArray(idx);
  37 + }
31 38 }
... ...
src/main/java/com/bsth/data/abnormal/MainAbnormalClient.java 0 → 100644
  1 +package com.bsth.data.abnormal;
  2 +
  3 +import com.alibaba.fastjson.JSON;
  4 +import com.bsth.data.abnormal.entity.AbnormalEntity;
  5 +import com.bsth.websocket.handler.SendUtils;
  6 +import com.google.common.collect.ArrayListMultimap;
  7 +import org.slf4j.Logger;
  8 +import org.slf4j.LoggerFactory;
  9 +import org.springframework.beans.factory.annotation.Autowired;
  10 +import org.springframework.stereotype.Component;
  11 +
  12 +import java.util.List;
  13 +import java.util.concurrent.ConcurrentHashMap;
  14 +import java.util.concurrent.ConcurrentMap;
  15 +
  16 +/**
  17 + * 异常监管主处理程序
  18 + * Created by panzhao on 2018/3/1.
  19 + */
  20 +@Component
  21 +public class MainAbnormalClient {
  22 +
  23 + private static ArrayListMultimap<String, AbnormalEntity> lineMultimap;
  24 + private static ConcurrentMap<Long, AbnormalEntity> schIdMap;
  25 +
  26 + static {
  27 + lineMultimap = ArrayListMultimap.create();
  28 + schIdMap = new ConcurrentHashMap<>();
  29 + }
  30 +
  31 + @Autowired
  32 + SendUtils sendUtils;
  33 +
  34 + Logger logger = LoggerFactory.getLogger(this.getClass());
  35 +
  36 + public void put(AbnormalEntity ae){
  37 + lineMultimap.put(ae.getLineCode(), ae);
  38 + schIdMap.put(ae.getSchId(), ae);
  39 +
  40 + //web socket
  41 + sendUtils.abnormal_ydwd(ae);
  42 +
  43 + logger.info("应到未到: " + JSON.toJSONString(ae));
  44 + }
  45 +
  46 + public List<AbnormalEntity> findByLine(String lineCode){
  47 + return lineMultimap.get(lineCode);
  48 + }
  49 +}
... ...
src/main/java/com/bsth/data/abnormal/entity/AbnormalEntity.java 0 → 100644
  1 +package com.bsth.data.abnormal.entity;
  2 +
  3 +/**
  4 + *
  5 + * Created by panzhao on 2018/3/1.
  6 + */
  7 +public class AbnormalEntity {
  8 +
  9 + /**
  10 + * 异常类型
  11 + * 0:未签到
  12 + * 1:未出场
  13 + */
  14 + private int type;
  15 +
  16 + /**
  17 + * 对应的出场班次ID
  18 + */
  19 + private long schId;
  20 +
  21 + /**
  22 + * 计划时间
  23 + */
  24 + private String planTimeStr;
  25 + /**
  26 + * 计划时间戳
  27 + */
  28 + private long planTime;
  29 +
  30 + /**
  31 + * 驾驶员
  32 + */
  33 + private String jsy;
  34 +
  35 + /**
  36 + * 车辆
  37 + */
  38 + private String nbbm;
  39 +
  40 + /**
  41 + * 线路
  42 + */
  43 + private String lineCode;
  44 +
  45 + public int getType() {
  46 + return type;
  47 + }
  48 +
  49 + public void setType(int type) {
  50 + this.type = type;
  51 + }
  52 +
  53 + public long getSchId() {
  54 + return schId;
  55 + }
  56 +
  57 + public void setSchId(long schId) {
  58 + this.schId = schId;
  59 + }
  60 +
  61 + public String getPlanTimeStr() {
  62 + return planTimeStr;
  63 + }
  64 +
  65 + public void setPlanTimeStr(String planTimeStr) {
  66 + this.planTimeStr = planTimeStr;
  67 + }
  68 +
  69 + public String getJsy() {
  70 + return jsy;
  71 + }
  72 +
  73 + public void setJsy(String jsy) {
  74 + this.jsy = jsy;
  75 + }
  76 +
  77 + public String getNbbm() {
  78 + return nbbm;
  79 + }
  80 +
  81 + public void setNbbm(String nbbm) {
  82 + this.nbbm = nbbm;
  83 + }
  84 +
  85 + public String getLineCode() {
  86 + return lineCode;
  87 + }
  88 +
  89 + public void setLineCode(String lineCode) {
  90 + this.lineCode = lineCode;
  91 + }
  92 +
  93 + public long getPlanTime() {
  94 + return planTime;
  95 + }
  96 +
  97 + public void setPlanTime(long planTime) {
  98 + this.planTime = planTime;
  99 + }
  100 +}
... ...
src/main/java/com/bsth/data/abnormal/handler/AttendanceHandler.java 0 → 100644
  1 +package com.bsth.data.abnormal.handler;
  2 +
  3 +/**
  4 + * 考勤异常处理
  5 + * Created by panzhao on 2018/3/1.
  6 + */
  7 +public class AttendanceHandler {
  8 +}
... ...
src/main/java/com/bsth/data/abnormal/handler/InOutHandler.java 0 → 100644
  1 +package com.bsth.data.abnormal.handler;
  2 +
  3 +/**
  4 + * 进出场异常处理
  5 + * Created by panzhao on 2018/3/1.
  6 + */
  7 +public class InOutHandler {
  8 +}
... ...
src/main/java/com/bsth/data/abnormal/scanner/AttendanceAbnormalScanner.java 0 → 100644
  1 +package com.bsth.data.abnormal.scanner;
  2 +
  3 +import com.bsth.data.abnormal.MainAbnormalClient;
  4 +import com.bsth.data.abnormal.entity.AbnormalEntity;
  5 +import com.bsth.data.schedule.dto.ScheduleInOut;
  6 +import com.bsth.data.schedule.real.ScheduleDataBuffer;
  7 +import org.joda.time.format.DateTimeFormat;
  8 +import org.joda.time.format.DateTimeFormatter;
  9 +import org.springframework.beans.factory.annotation.Autowired;
  10 +import org.springframework.stereotype.Component;
  11 +
  12 +import java.util.List;
  13 +
  14 +/**
  15 + * 考勤异常检测
  16 + * Created by panzhao on 2018/3/1.
  17 + */
  18 +@Component
  19 +public class AttendanceAbnormalScanner {
  20 +
  21 + private static DateTimeFormatter fmtHHmm = DateTimeFormat.forPattern("HH:mm");
  22 +
  23 + @Autowired
  24 + MainAbnormalClient mainAbnormalClient;
  25 +
  26 + public void scan(){
  27 + List<ScheduleInOut> list = ScheduleDataBuffer.all_out();
  28 +
  29 + AbnormalEntity ae;
  30 + Long t = System.currentTimeMillis();
  31 + for(ScheduleInOut sio : list){
  32 +
  33 + if(sio.getAttJhTime() >= t)
  34 + continue;//时间未到
  35 +
  36 + if(sio.getAttSjTime() != null)
  37 + continue;//已报到
  38 +
  39 + if(sio.getAbnormalStatus() < 0)
  40 + continue;//已报异常
  41 +
  42 +
  43 + ae = new AbnormalEntity();
  44 + ae.setType(0);
  45 + ae.setSchId(sio.getId());
  46 + ae.setLineCode(sio.getLineCode());
  47 + ae.setJsy(sio.getJsy());
  48 + ae.setPlanTimeStr(fmtHHmm.print(sio.getAttJhTime()));
  49 + ae.setPlanTime(sio.getAttJhTime());
  50 +
  51 +
  52 + mainAbnormalClient.put(ae);
  53 +
  54 + sio.setAbnormalStatus(-1);
  55 + }
  56 + }
  57 +}
... ...
src/main/java/com/bsth/data/abnormal/scanner/InOutAbnormalScanner.java 0 → 100644
  1 +package com.bsth.data.abnormal.scanner;
  2 +
  3 +/**
  4 + * 进出场异常检测
  5 + * Created by panzhao on 2018/3/1.
  6 + */
  7 +public class InOutAbnormalScanner {
  8 +}
... ...
src/main/java/com/bsth/data/abnormal/thread/AbnormalFixedScannerThread.java 0 → 100644
  1 +package com.bsth.data.abnormal.thread;
  2 +
  3 +import com.bsth.data.abnormal.scanner.AttendanceAbnormalScanner;
  4 +import org.slf4j.Logger;
  5 +import org.slf4j.LoggerFactory;
  6 +import org.springframework.beans.factory.annotation.Autowired;
  7 +import org.springframework.stereotype.Component;
  8 +
  9 +/**
  10 + * 定时扫描异常
  11 + * Created by panzhao on 2018/3/1.
  12 + */
  13 +@Component
  14 +public class AbnormalFixedScannerThread extends Thread {
  15 +
  16 + Logger logger = LoggerFactory.getLogger(this.getClass());
  17 +
  18 + @Autowired
  19 + AttendanceAbnormalScanner attendanceAbnormalScanner;
  20 +
  21 + @Override
  22 + public void run() {
  23 +
  24 + try {
  25 + attendanceAbnormalScanner.scan();
  26 + } catch (Exception e) {
  27 + logger.error("", e);
  28 + }
  29 + }
  30 +}
... ...
src/main/java/com/bsth/data/schedule/dto/ScheduleInOut.java
... ... @@ -28,6 +28,14 @@ public class ScheduleInOut {
28 28 /**班次状态 0 未执行 1 正在执行 2 已执行 -1 已烂班 */
29 29 private int status;
30 30  
  31 + /**
  32 + * 异常状态
  33 + * 0 正常
  34 + * -1 应到未到
  35 + * -2 应出未出
  36 + */
  37 + private int abnormalStatus = 0;
  38 +
31 39 private String gsbm;//公司编码
32 40 private String fgsbm;//分公司编码
33 41 private Long attJhTime;//计划报到
... ... @@ -271,4 +279,12 @@ public class ScheduleInOut {
271 279 public void setOutTimePzsb(Long outTimePzsb) {
272 280 this.outTimePzsb = outTimePzsb;
273 281 }
  282 +
  283 + public int getAbnormalStatus() {
  284 + return abnormalStatus;
  285 + }
  286 +
  287 + public void setAbnormalStatus(int abnormalStatus) {
  288 + this.abnormalStatus = abnormalStatus;
  289 + }
274 290 }
... ...
src/main/java/com/bsth/data/schedule/real/ScheduleDataBuffer.java
... ... @@ -135,6 +135,10 @@ public class ScheduleDataBuffer implements CommandLineRunner {
135 135 }
136 136 }
137 137  
  138 + //排序
  139 + Collections.sort(outListCopy, schComparator);
  140 + Collections.sort(inListCopy, schComparator);
  141 +
138 142 outList = outListCopy;
139 143 inList = inListCopy;
140 144 }
... ...
src/main/java/com/bsth/service/schedule/ScheduleService.java
... ... @@ -5,6 +5,7 @@ import com.bsth.data.schedule.dto.ScheduleInOut;
5 5  
6 6 import java.util.Collection;
7 7 import java.util.List;
  8 +import java.util.Map;
8 9  
9 10 /**
10 11 * Created by panzhao on 2017/8/30.
... ... @@ -23,6 +24,8 @@ public interface ScheduleService {
23 24 */
24 25 void jsyReport(JsyAttendance att);
25 26  
  27 + Map<String, Object> findAbnormalByLineArray(String idx);
  28 +
26 29 //void inOut(CarInOutEntity obj);
27 30  
28 31 //void busInOut(CarInOutEntity obj);
... ...
src/main/java/com/bsth/service/schedule/impl/ScheduleServiceImpl.java
1 1 package com.bsth.service.schedule.impl;
2 2  
  3 +import com.bsth.common.ResponseCode;
  4 +import com.bsth.data.abnormal.MainAbnormalClient;
  5 +import com.bsth.data.abnormal.entity.AbnormalEntity;
3 6 import com.bsth.data.attendance.entity.JsyAttendance;
4 7 import com.bsth.data.schedule.dto.ScheduleInOut;
5 8 import com.bsth.data.schedule.real.ScheduleDataBuffer;
6 9 import com.bsth.service.schedule.ScheduleService;
  10 +import com.google.common.base.Splitter;
  11 +import org.slf4j.Logger;
  12 +import org.slf4j.LoggerFactory;
  13 +import org.springframework.beans.factory.annotation.Autowired;
7 14 import org.springframework.stereotype.Service;
8 15  
9   -import java.util.Collection;
10   -import java.util.List;
  16 +import java.util.*;
11 17  
12 18 /**
13 19 * Created by panzhao on 2017/9/4.
... ... @@ -16,8 +22,12 @@ import java.util.List;
16 22 public class ScheduleServiceImpl implements ScheduleService {
17 23  
18 24  
19   - /* @Autowired
20   - BerthService berthService;*/
  25 + /* @Autowired
  26 + BerthService berthService;*/
  27 + @Autowired
  28 + MainAbnormalClient mainAbnormalClient;
  29 +
  30 + Logger logger = LoggerFactory.getLogger(this.getClass());
21 31  
22 32 @Override
23 33 public List<ScheduleInOut> findByCurrentTime() {
... ... @@ -45,11 +55,38 @@ public class ScheduleServiceImpl implements ScheduleService {
45 55 ScheduleInOut sio = ScheduleDataBuffer.getCurrExecOut(att.getCompany(), att.getUserId(), att.getAt());
46 56  
47 57 //报到时间不覆盖
48   - if(sio.getAttSjTime() != null)
  58 + if (sio.getAttSjTime() != null)
49 59 return;
50 60  
51 61 sio.setAttSjTime(att.getAt());
52 62 //通知页面
53 63  
54 64 }
  65 +
  66 + @Override
  67 + public Map<String, Object> findAbnormalByLineArray(String idx) {
  68 + Map<String, Object> rs = new HashMap<>();
  69 + try {
  70 + List<String> lineArray = Splitter.on(",").splitToList(idx);
  71 + List<AbnormalEntity> list = new ArrayList<>();
  72 + for (String lineCode : lineArray) {
  73 + list.addAll(mainAbnormalClient.findByLine(lineCode));
  74 + }
  75 +
  76 + //排序
  77 + Collections.sort(list, new Comparator<AbnormalEntity>() {
  78 + @Override
  79 + public int compare(AbnormalEntity o1, AbnormalEntity o2) {
  80 + return (int) (o2.getPlanTime() - o2.getPlanTime());
  81 + }
  82 + });
  83 +
  84 + rs.put("status", ResponseCode.SUCCESS);
  85 + rs.put("list", list);
  86 + } catch (Exception e) {
  87 + logger.error("", e);
  88 + rs.put("status", ResponseCode.ERROR);
  89 + }
  90 + return rs;
  91 + }
55 92 }
... ...
src/main/java/com/bsth/websocket/handler/SendUtils.java
1 1 package com.bsth.websocket.handler;
2 2  
  3 +import com.bsth.data.abnormal.entity.AbnormalEntity;
3 4 import com.fasterxml.jackson.databind.ObjectMapper;
4 5 import org.slf4j.Logger;
5 6 import org.slf4j.LoggerFactory;
... ... @@ -51,4 +52,21 @@ public class SendUtils{
51 52 logger.error("", e);
52 53 }
53 54 }
  55 +
  56 + /**
  57 + * 异常-应到未到
  58 + */
  59 + public void abnormal_ydwd(AbnormalEntity ae){
  60 + Map<String, Object> map = new HashMap<>();
  61 + map.put("fn", "abnormal_ydwd");
  62 + map.put("entity", ae);
  63 +
  64 + ObjectMapper mapper = new ObjectMapper();
  65 +
  66 + try {
  67 + socketHandler.sendMessage(mapper.writeValueAsString(map));
  68 + } catch (Exception e) {
  69 + logger.error("", e);
  70 + }
  71 + }
54 72 }
... ...
src/main/resources/static/assets/css/abnormal_monitor.css 0 → 100644
  1 +#abnormal_monitor_wrap{
  2 + height: 100%;
  3 +}
  4 +#abnormal_monitor_wrap>div{
  5 + font-size: 14px;
  6 + vertical-align: top;
  7 + border: 1px solid #e6e5e5;
  8 +}
  9 +
  10 +#abnormal_monitor_wrap>div.left_panel{
  11 + display: inline-block;
  12 + width: 480px;
  13 + height: calc(100% - 20px);
  14 + margin: 12px 5px 2px 4px;
  15 + box-shadow: 1px -3px 15px rgba(0,0,0,0.08);
  16 +}
  17 +
  18 +#abnormal_monitor_wrap>div.right_panel{
  19 + display: inline-block;
  20 + width: calc(100% - 500px);
  21 + height: calc(100% - 20px);
  22 + margin: 12px 0 2px 0;
  23 + box-shadow: -1px -3px 15px rgba(0,0,0,0.08);
  24 +}
  25 +
  26 +.red_line_bts{
  27 + height: 60px;
  28 + border-bottom: 1px solid #e6e5e5;
  29 + box-shadow: 0px 1px 2px rgba(0,0,0,0.08);
  30 + padding: 12px;
  31 +}
  32 +
  33 +span.red_line_empty{
  34 + margin-top: 18px;
  35 + display: block;
  36 + color: #727272;
  37 +}
  38 +
  39 +.red_line_bts>span.red_btn{
  40 + background-color: #ec2147;
  41 + color: #fff;
  42 + cursor: pointer;
  43 + display: inline-block;
  44 + box-sizing: border-box;
  45 + padding: 0 24px;
  46 + text-align: center;
  47 + line-height: 28px;
  48 + margin-bottom: 8px;
  49 + margin-left: 3px;
  50 + box-shadow: 1px 3px 15px 0px rgba(0, 0, 0, 0.08);
  51 +}
  52 +
  53 +.sys-notice{
  54 + height: 27px;
  55 + padding: 7px;
  56 + background: #f0f0f0;
  57 + position: relative;
  58 +}
  59 +
  60 +.sys-notice .bell_icon{
  61 + position: absolute;
  62 + width: 25px;
  63 + height: inherit;
  64 + top: 0;
  65 + left: 0;
  66 + padding: inherit;
  67 + padding-left: 12px;
  68 + border-right: 1px solid #dcdcdc;
  69 + color: #ababab;
  70 +}
  71 +
  72 +#abnormal_monitor_wrap .abnormal_data_tabs{
  73 + margin-top: 20px;
  74 + height: calc(100% - 247px);
  75 +}
  76 +
  77 +#abnormal_monitor_wrap .data_charts{
  78 + height: 100px;
  79 + background: #f0f0f0;
  80 +}
  81 +
  82 +.abnormal_data_list .uk-card-body{
  83 + padding: 0;
  84 + height: 66px;
  85 + border: 1px solid #e3e1e1;
  86 + width: 95%;
  87 + margin-left: 2%;
  88 + margin-top: 12px;
  89 + background: #fdfdfd;
  90 +}
  91 +
  92 +.abnormal_data_list .detail_wrap{
  93 + display: inline-block;
  94 + height: 100%;
  95 + padding-top: 2px;
  96 +}
  97 +
  98 +.abnormal_data_list .abnormal_detail{
  99 + line-height: 24px;
  100 + margin-top: 4px;
  101 +}
  102 +
  103 +.abnormal_data_list .abnormal_detail .badge_line_name{
  104 + background: #f2f2f2;
  105 + padding: 1px 12px 1px 11px;
  106 + border-radius: 7px;
  107 + font-size: 13px;
  108 + color: #000;
  109 +}
  110 +
  111 +.abnormal_data_list .abnormal_detail ._detail{
  112 + display: inline-block;
  113 + margin-right: 15px;
  114 +}
  115 +
  116 +.abnormal_data_list .abnormal_detail a{
  117 + text-decoration: underline;
  118 +}
  119 +
  120 +.abnormal_data_list .uk-card-body ._title{
  121 + display: inline-block;
  122 + margin: 0 15px;
  123 + height: 100%;
  124 + line-height: 66px;
  125 + vertical-align: top;
  126 + font-size: 13px;
  127 +}
  128 +
  129 +.abnormal_data_list .uk-card-body ._title .uk-icon{
  130 + margin-top: -5px;
  131 + vertical-align: middle;
  132 +}
  133 +
  134 +.bus_icon15{
  135 + background: url(/assets/icon/_bus15.png);
  136 + width: 26px;
  137 + height: 28px;
  138 + background-position: -11px;
  139 +}
  140 +
  141 +.abnormal_data_body_ul{
  142 + height: calc(100% - 59px);
  143 +}
  144 +
  145 +.abnormal_data_body_ul>li{
  146 + height: 100%;
  147 + overflow: auto;
  148 + position: relative;
  149 +}
  150 +
  151 +.handler_btn_panel{
  152 + position: absolute;
  153 + top: 0;
  154 + right: 0;
  155 +}
  156 +
  157 +.handler_btn_panel>button{
  158 + height: 64px;
  159 + padding: 0 20px;
  160 +}
  161 +.o_s_line_card{
  162 + width: 310px;
  163 + margin: 15px;
  164 + padding: 0;
  165 + border: 1px solid #e8e7e7;
  166 + display: inline-block;
  167 + background: #fbfbfb;
  168 + vertical-align: top;
  169 + height: 418px;
  170 +}
  171 +
  172 +.o_s_c_table dl{
  173 + font-size: 0;
  174 +}
  175 +
  176 +.o_s_c_table dl dd, .o_s_c_table dl dt {
  177 + display: inline-block;
  178 + white-space: nowrap;
  179 + overflow: hidden;
  180 + text-overflow: ellipsis;
  181 + height: 100%;
  182 + line-height: 30px;
  183 + text-indent: 5px;
  184 + font-size: 14px;
  185 + text-align: center;
  186 +}
  187 +
  188 +
  189 +.o_s_c_table dl dt:nth-of-type(1), .o_s_c_table dl dd:nth-of-type(1) {
  190 + width: 19%;
  191 + text-align: center;
  192 + text-indent: 10px;
  193 +}
  194 +.o_s_c_table dl dt:nth-of-type(2), .o_s_c_table dl dd:nth-of-type(2) {
  195 + width: 25%;
  196 +}
  197 +.o_s_c_table dl dt:nth-of-type(3), .o_s_c_table dl dd:nth-of-type(3) {
  198 + width: 26%;
  199 +}
  200 +.o_s_c_table dl dt:nth-of-type(4), .o_s_c_table dl dd:nth-of-type(4) {
  201 + width: 26%;
  202 +}
  203 +
  204 +.o_s_c_table dl:nth-child(1){
  205 + margin: 0;
  206 +}
  207 +
  208 +.o_s_c_table dl:nth-child(n+2){
  209 + margin: 2px 0;
  210 +}
  211 +
  212 +.parallel_dl{
  213 + padding-top: 6px;
  214 +}
  215 +
  216 +.parallel_dl>span{
  217 + display: block;
  218 + line-height: 20px;
  219 +}
  220 +
  221 +.o_s_c_table dl>dt,.o_s_c_table dl>dd{
  222 + line-height: 45px;
  223 + height: 45px;
  224 +}
  225 +
  226 +.parallel_dl .green{
  227 + color: #02c202;
  228 +}
  229 +
  230 +
  231 +
  232 +.o_s_line_card .title_name{
  233 + height: 40px;
  234 + line-height: 40px;
  235 + text-align: center;
  236 + font-size: 22px;
  237 + border-bottom: 1px solid #e8e7e7;
  238 + position: relative;
  239 +}
  240 +
  241 +
  242 +.o_s_line_card .title_name .expand_card_icon{
  243 + position: absolute;
  244 + right: 10px;
  245 + top: 10px;
  246 + background: url(/assets/icon/blue_point.png);
  247 + width: 18px;
  248 + height: 18px;
  249 + cursor: pointer;
  250 +}
  251 +
  252 +.osc_table_head dl>dt{
  253 + font-weight: 600;
  254 + font-size: 13px;
  255 +}
  256 +
  257 +.osc_table_body dl{
  258 + border-top: 1px solid #cbcbcb;
  259 + color: #000;
  260 +}
  261 +
  262 +.line_card_list{
  263 + height: 100%;
  264 + overflow: auto;
  265 + position: relative;
  266 +}
  267 +
  268 +.o_s_expand_table_modal table{
  269 + font-size: 13px;
  270 +}
  271 +
  272 +.o_s_expand_table_modal table tr>th:nth-of-type(1) {
  273 + width: 12%;
  274 +}
  275 +.o_s_expand_table_modal table tr>th:nth-of-type(2) {
  276 + width: 8%;
  277 +}
  278 +.o_s_expand_table_modal table tr>th:nth-of-type(3) {
  279 + width: 14%;
  280 +}
  281 +.o_s_expand_table_modal table tr>th:nth-of-type(4) {
  282 + width: 10%;
  283 +}
  284 +.o_s_expand_table_modal table tr>th:nth-of-type(5) {
  285 + width: 13%;
  286 +}
  287 +.o_s_expand_table_modal table tr>th:nth-of-type(6),
  288 +.o_s_expand_table_modal table tr>td:nth-of-type(6){
  289 + width: 14%;
  290 + text-align: center;
  291 +}
  292 +.o_s_expand_table_modal table tr>th:nth-of-type(7),
  293 +.o_s_expand_table_modal table tr>td:nth-of-type(7){
  294 + width: 14%;
  295 + text-align: center;
  296 +}
  297 +.o_s_expand_table_modal table tr>th:nth-of-type(8),
  298 +.o_s_expand_table_modal table tr>td:nth-of-type(8){
  299 + width: 15%;
  300 + border-left: 1px solid gainsboro;
  301 + text-indent: 12px
  302 +}
  303 +
  304 +.o_s_expand_table_modal .uk-table td,
  305 +.o_s_expand_table_modal .uk-table th{
  306 + padding: 11px 0px;
  307 +}
0 308 \ No newline at end of file
... ...
src/main/resources/static/assets/css/main.css
1 1 html, body, .ct-container {
2 2 height: 100%;
3 3 color: #151515;
  4 + font-family: "Arial","Microsoft YaHei","黑体","宋体",sans-serif;
4 5 }
5 6  
6 7 .ct-container {
... ... @@ -13,7 +14,7 @@ input::-webkit-input-placeholder {
13 14 }
14 15  
15 16 .top_tools.uk-card-body {
16   - padding: 30px 30px 15px;
  17 + padding: 30px 30px 5px;
17 18 }
18 19  
19 20 .top_tools .uk-card-title {
... ... @@ -68,7 +69,7 @@ input::-webkit-input-placeholder {
68 69  
69 70 .ct-cont-body {
70 71 width: 100%;
71   - height: calc(100% - 110px);
  72 + height: calc(100% - 100px);
72 73 position: relative;
73 74 }
74 75  
... ...
src/main/resources/static/assets/icon/_bus15.png 0 → 100644

541 Bytes

src/main/resources/static/assets/icon/blue_point.png 0 → 100644

219 Bytes

src/main/resources/static/assets/js/common.js
... ... @@ -293,6 +293,29 @@ var gb_common = (function () {
293 293 };
294 294  
295 295 /**
  296 + * 默认 modal 无页脚
  297 + * @param page
  298 + * @param data
  299 + */
  300 + var open_modal_default = function (page, title, data, width) {
  301 + if(!data)
  302 + data={};
  303 + if(!width)
  304 + width = 600;
  305 + var id = 'uk3_' + Math.random().toString(36).substr(2);
  306 + var modal_wrap = '<div id="'+id+'" uk-modal>' +
  307 + '<div class="uk-modal-dialog" style="width: '+width+'px">' +
  308 + '<div class="uk-modal-body">' +
  309 + '<button class="uk-modal-close-default" type="button" uk-close></button>' +
  310 + '<h2 class="uk-modal-title">'+title+'</h2>' +
  311 + '<div uk-spinner></div></div>' +
  312 + '</div>' +
  313 + '</div>';
  314 +
  315 + show_modal(id, modal_wrap, page, data);
  316 + };
  317 +
  318 + /**
296 319 * 无页脚小modal
297 320 * @param page
298 321 * @param title
... ... @@ -409,6 +432,7 @@ var gb_common = (function () {
409 432 open_modal: open_modal,
410 433 open_modal_2: open_modal_2,
411 434 open_modal_3: open_modal_3,
  435 + open_modal_default: open_modal_default,
412 436 pad_left: pad_left,
413 437 alt_confirm: alt_confirm,
414 438 alt_prompt: alt_prompt
... ...
src/main/resources/static/index.html
... ... @@ -7,6 +7,7 @@
7 7 <link rel="stylesheet" href="/assets/fontawesome/css/font-awesome.min.css" />
8 8 <link href="/assets/uikit-3.0.0/css/uikit.min.css" rel="stylesheet" type="text/css"/>
9 9 <link href="/assets/css/main.css" rel="stylesheet" type="text/css"/>
  10 + <link href="/assets/css/abnormal_monitor.css" rel="stylesheet" type="text/css"/>
10 11 <link href="/assets/selectize/css/selectize.default.css" rel="stylesheet" type="text/css"/>
11 12 <link href="/assets/plugins/simplePagination/simplePagination.css" rel="stylesheet" type="text/css"/>
12 13 <link href="/assets/plugins/perfect-scrollbar/perfect-scrollbar.css" rel="stylesheet" type="text/css"/>
... ... @@ -27,7 +28,7 @@
27 28 <h3 class="uk-card-title"><img src="/assets/svg/park.svg"> 调派系统</h3>
28 29 <div class="ct-btn-list">
29 30 <span class="ct-btn-link lasting" data-name="b_p_manager" data-page="/pages/b_p_manager/b_p_main.html">停放监管</span>
30   - <span class="ct-btn-link lasting">异常监管</span>
  31 + <span class="ct-btn-link lasting" data-name="abnormal_data" data-page="/pages/abnormal/main.html">异常监管</span>
31 32 <span class="ct-btn-link" data-name="inout_data" data-page="/pages/inout/in_out_main.html">进出场</span>
32 33 <span class="ct-btn-link" data-name="attendance_data" data-page="/pages/attendance/att_data_main.html">签到/退</span>
33 34 <span class="ct-btn-link">计划/任务</span>
... ... @@ -269,5 +270,10 @@
269 270 }
270 271 }
271 272 </script>
  273 +
  274 +<!-- 异常监管 JS -->
  275 +<script src="/pages/abnormal/js/o_s_card.js"></script>
  276 +<script src="/pages/abnormal/js/o_s_abnormal.js"></script>
  277 +<script src="/pages/abnormal/js/o_s_basic_data.js"></script>
272 278 </body>
273 279 </html>
274 280 \ No newline at end of file
... ...
src/main/resources/static/pages/abnormal/fragments/abnormal_handler.html 0 → 100644
  1 +<div class="o_s_abnormal_handler_modal">
  2 + <ul class="uk-subnav" uk-switcher uk-tab style="margin-top: 35px">
  3 + <li><a><i uk-icon="file-edit"></i>&nbsp;人已报到</a></li>
  4 + <li><a><i uk-icon="users" style="vertical-align: middle;margin-top: -3px;"></i>&nbsp;换人出场</a></li>
  5 + <li><a><i uk-icon="clock"></i>&nbsp;调整出场时间</a></li>
  6 + </ul>
  7 +
  8 + <ul class="uk-switcher uk-margin">
  9 + <li>
  10 + <div class="uk-alert-danger" uk-alert>
  11 + <a class="uk-alert-close" uk-close></a>
  12 + <p><i uk-icon="info"></i>&nbsp;如果人员无法正常使用刷卡机签到,请手动录入人员报到时间。</p>
  13 + </div>
  14 +
  15 + </li>
  16 + <li>222</li>
  17 + <li>333</li>
  18 + </ul>
  19 +
  20 + <script>
  21 + (function () {
  22 + var wrap = '.o_s_abnormal_handler_modal', modalId;
  23 +
  24 + $(wrap).on('init', function (e, data) {
  25 + e.stopPropagation();
  26 + modalId = '#' + data.modalId;
  27 +
  28 + var ae = gb_o_s_abnormal.get(data.key);
  29 + console.log('aeae', ae);
  30 + /*var list = gb_common.get_vals(gb_os_card.findByLineCode(data.lineCode));
  31 + list.sort(sch_sort_fun);
  32 + //渲染表格
  33 + var htmlStr = template('o_s_expand_sch_list-temp', {list: list});
  34 + $('table>tbody', wrap).html(htmlStr);*/
  35 +
  36 + data && data.caller && data.caller();
  37 + });
  38 + })();
  39 + </script>
  40 +</div>
0 41 \ No newline at end of file
... ...
src/main/resources/static/pages/abnormal/fragments/expand_card_modal.html 0 → 100644
  1 +<div class="o_s_expand_table_modal">
  2 + <table class="uk-table uk-table-hover uk-table-divider">
  3 + <thead>
  4 + <tr>
  5 + <th>日期</th>
  6 + <th>路牌</th>
  7 + <th>驾驶员</th>
  8 + <th>车辆</th>
  9 + <th>终点</th>
  10 + <th>签到<br>计划/实际</th>
  11 + <th>出场<br>计划/实际</th>
  12 + <th>备注</th>
  13 + </tr>
  14 + </thead>
  15 + <tbody>
  16 + </tbody>
  17 + </table>
  18 +
  19 + <script id="o_s_expand_sch_list-temp" type="text/html">
  20 + {{each list as sch i}}
  21 + <tr>
  22 + <td>{{sch.scheduleDateStr}}</td>
  23 + <td>{{sch.lpName}}</td>
  24 + <td>{{sch.jsy}}</td>
  25 + <td>{{sch.nbbm}}</td>
  26 + <td>{{sch.zdzName}}</td>
  27 + <td>{{sch.attJhTimeStr}}/04:22</td>
  28 + <td>{{sch.dfsjStr}}/04:30</td>
  29 + <td>{{sch.remarks}}</td>
  30 + </tr>
  31 + {{/each}}
  32 + </script>
  33 +
  34 + <script>
  35 + (function () {
  36 + var wrap = '.o_s_expand_table_modal', modalId;
  37 +
  38 + $(wrap).on('init', function (e, data) {
  39 + e.stopPropagation();
  40 + modalId = '#' + data.modalId;
  41 +
  42 + var list = gb_common.get_vals(gb_os_card.findByLineCode(data.lineCode));
  43 + list.sort(sch_sort_fun);
  44 + //渲染表格
  45 + var htmlStr = template('o_s_expand_sch_list-temp', {list: list});
  46 + $('table>tbody', wrap).html(htmlStr);
  47 +
  48 + data && data.caller && data.caller();
  49 + });
  50 +
  51 + var sch_sort_fun = function (a, b) {
  52 + return a.dfsjT- b.dfsjT;
  53 + };
  54 + })();
  55 + </script>
  56 +</div>
0 57 \ No newline at end of file
... ...
src/main/resources/static/pages/abnormal/js/o_s_abnormal.js 0 → 100644
  1 +/**
  2 + * 异常监管,异常处理
  3 + */
  4 +var gb_o_s_abnormal = (function () {
  5 +
  6 + var storage = window.localStorage;
  7 +
  8 + var wrap = 'ul.abnormal_data_body_ul>li:eq(0)>div.abnormal_data_list';
  9 + //key: sch_type
  10 + var _data = {};
  11 +
  12 + var init = function (cb) {
  13 + var idx = storage.getItem("abnormal_line_idx");
  14 +
  15 + gb_common.$get('/in_out/findAbnormalByLineArray', {idx: idx}, function (rs) {
  16 + var list = rs.list;
  17 + for(var i=0,obj;obj=list[i++];){
  18 + obj.lineName = gb_o_s_basic_data.findLineNameByCode(obj.lineCode);
  19 + _data[obj['schId']+'_'+obj['type']]=obj;
  20 + }
  21 +
  22 + //渲染
  23 + var htmlStr = template('abnormal_card_list-temp', {list: list});
  24 + $(wrap).html(htmlStr);
  25 + cb && cb();
  26 + });
  27 + };
  28 +
  29 + /**
  30 + * 人未到异常处理
  31 + */
  32 + $(document).on('click', wrap + ' .handler_btn_panel>button', function () {
  33 + var key = $(this).data('key');
  34 + gb_common.open_modal_default('/pages/abnormal/fragments/abnormal_handler.html', '异常处理 -未签到', {key:key}, 800);
  35 + });
  36 +
  37 + var getByKey = function (key) {
  38 + return _data[key];
  39 + };
  40 +
  41 + return {
  42 + init: init,
  43 + get: getByKey
  44 + }
  45 +})();
0 46 \ No newline at end of file
... ...
src/main/resources/static/pages/abnormal/js/o_s_basic_data.js 0 → 100644
  1 +/**
  2 + * 相关基础数据
  3 + */
  4 +var gb_o_s_basic_data = (function () {
  5 +
  6 + var lineCode2NameMaps;
  7 + var init = function (cb) {
  8 + var ep = EventProxy.create("line_code2name", function (lineCode2Names) {
  9 + lineCode2NameMaps = lineCode2Names;
  10 +
  11 + cb && cb();
  12 + });
  13 +
  14 + //线路code 2 name
  15 + gb_common.$get('/line/all', {}, function (rs) {
  16 + var maps={},list=rs.list;
  17 + for(var i=0,line;line=list[i++];){
  18 + maps[line.lineCode]=line.name;
  19 + }
  20 + ep.emit('line_code2name', maps);
  21 + });
  22 + };
  23 +
  24 + var findLineNameByCode = function (code) {
  25 + return lineCode2NameMaps[code];
  26 + };
  27 +
  28 + return {
  29 + init: init,
  30 + findLineNameByCode: findLineNameByCode
  31 + }
  32 +})();
0 33 \ No newline at end of file
... ...
src/main/resources/static/pages/abnormal/js/o_s_card.js 0 → 100644
  1 +/**
  2 + * 出场班次卡片相关操作
  3 + */
  4 +var gb_os_card = (function () {
  5 +
  6 + //按线路分组的出场班次数据{id: sch}
  7 + var _data;
  8 +
  9 + var init = function (cb) {
  10 + $.get('/in_out/all_out', function (list) {
  11 + list.sort(function (a, b) {
  12 + return a.dfsjT - b.dfsjT;
  13 + });
  14 + for (var i = 0, sch; sch = list[i++];) {
  15 + sch.attJhTimeStr = moment(sch.attJhTime).format('HH:mm');
  16 + sch.dfsjStr = moment(sch.dfsjT).format('HH:mm');
  17 + }
  18 + //按线路分组数据
  19 + var data = gb_common.groupBy(list, 'lineCode');
  20 +
  21 + _data = {};
  22 + for (var lineCode in data) {
  23 + _data[lineCode] = {};
  24 + for (var i = 0, sch; sch = data[lineCode][i++];) {
  25 + _data[lineCode][sch.id] = sch;
  26 + }
  27 + }
  28 +
  29 + //渲染
  30 + var htmlStr = template('a_out_sch_cards-temp', {data: data});
  31 + $('.right_panel>.line_card_list').html(htmlStr);
  32 +
  33 + cb && cb();
  34 + });
  35 + };
  36 +
  37 + //展开单线路全部
  38 + $(document).on('click', '.right_panel>.line_card_list .expand_card_icon', function () {
  39 + var lineName = $(this).data('name'),
  40 + lineCode = $(this).data('code');
  41 + gb_common.open_modal_default('/pages/abnormal/fragments/expand_card_modal.html', lineName, {lineCode: lineCode}, 900);
  42 + });
  43 +
  44 + var findByLineCode = function (lineCode) {
  45 + return _data[lineCode];
  46 + };
  47 +
  48 + return {
  49 + init: init,
  50 + findByLineCode: findByLineCode
  51 + };
  52 +})();
0 53 \ No newline at end of file
... ...
src/main/resources/static/pages/abnormal/main.html 0 → 100644
  1 +<div id="abnormal_monitor_wrap" class="">
  2 +
  3 + <div class="left_panel">
  4 + <div class="red_line_bts">
  5 + <!--<span class="red_line_empty">没有出现异常的线路</span>-->
  6 + <span class="red_btn">778路</span>
  7 + <span class="red_btn">610路</span>
  8 + <span class="red_btn">604路</span>
  9 + <span class="red_btn">81路</span>
  10 + <span class="red_btn">971路</span>
  11 + <span class="red_btn">浦东35路</span>
  12 + </div>
  13 +
  14 + <div class="sys-notice">
  15 + <span class="bell_icon">
  16 + <i uk-icon="bell"></i>
  17 + </span>
  18 + </div>
  19 +
  20 + <div class="abnormal_data_tabs">
  21 + <ul class="uk-subnav" uk-switcher uk-tab>
  22 + <li><a>异常情况&nbsp;50</a></li>
  23 + <li><a>已处理</a></li>
  24 + </ul>
  25 +
  26 + <ul class="uk-switcher uk-margin abnormal_data_body_ul">
  27 + <li><div class="abnormal_data_list"></div></li>
  28 + <li>Hello again!</li>
  29 + </ul>
  30 + </div>
  31 +
  32 + <div class="data_charts">
  33 + </div>
  34 + </div>
  35 +
  36 + <div class="right_panel">
  37 + <div class="line_card_list">
  38 + </div>
  39 + </div>
  40 +
  41 + <script id="abnormal_card_list-temp" type="text/html">
  42 + {{each list as obj i}}
  43 + <div class="uk-card uk-card-default uk-card-body">
  44 + {{if obj.type==0}}
  45 + <div class="_title">
  46 + <span uk-icon="user"></span>
  47 + <span class="sub-title">&nbsp;未签到</span>
  48 + </div>
  49 +
  50 + <div class="detail_wrap">
  51 + <div class="abnormal_detail">
  52 + <div class="_detail">应到:<a>{{obj.planTimeStr}}</a></div>
  53 + <div class="_detail">人员:<a>{{obj.jsy}}</a></div>
  54 + </div>
  55 +
  56 + <div class="abnormal_detail">
  57 + <span class="badge_line_name">{{obj.lineName}}</span>
  58 + </div>
  59 + </div>
  60 + {{else obj.type==1}}
  61 + <div class="_title">
  62 + <span class="uk-icon bus_icon15"></span>
  63 + <span class="sub-title">未出场</span>
  64 + </div>
  65 +
  66 + <div class="detail_wrap">
  67 + <div class="abnormal_detail">
  68 + <div class="_detail">应出:<a>{{obj.planTimeStr}}</a></div>
  69 + <div class="_detail">车辆:<a>{{obj.nbbm}}</a></div>
  70 + </div>
  71 +
  72 + <div class="abnormal_detail">
  73 + <span class="badge_line_name">{{obj.lineName}}</span>
  74 + </div>
  75 + </div>
  76 + {{/if}}
  77 + <div class="handler_btn_panel">
  78 + <button class="uk-button uk-button-primary uk-button-small" data-key="{{obj.schId}}_{{obj.type}}">处理</button>
  79 + </div>
  80 + </div>
  81 + {{/each}}
  82 + </script>
  83 +
  84 + <script id="a_out_sch_cards-temp" type="text/html">
  85 + {{each data as a k}}
  86 + <div class="uk-card uk-card-default uk-card-body o_s_line_card">
  87 + <div class="title_name">
  88 + {{data[k][0].lineName}}
  89 + <span class="expand_card_icon" data-code="{{data[k][0].lineCode}}" data-name="{{data[k][0].lineName}}"></span>
  90 + </div>
  91 + <div class="o_s_c_table">
  92 + <div class="osc_table_head">
  93 + <dl>
  94 + <dt>路牌</dt>
  95 + <dt>车号</dt>
  96 + <dt class="parallel_dl">
  97 + <span>计划报到</span>
  98 + <span>实际报到</span>
  99 + </dt>
  100 + <dt class="parallel_dl">
  101 + <span>计划出场</span>
  102 + <span>实际出场</span>
  103 + </dt>
  104 + </dl>
  105 + </div>
  106 + <div class="osc_table_body">
  107 + {{each data[k] as sch i}}
  108 + {{if i <=5}}
  109 + <dl>
  110 + <dd>{{sch.lpName}}</dd>
  111 + <dd>{{sch.nbbm}}</dd>
  112 + <dd class="parallel_dl">
  113 + <span>{{sch.attJhTimeStr}}</span>
  114 + <span class="green"></span>
  115 + </dd>
  116 + <dd class="parallel_dl">
  117 + <span>{{sch.dfsjStr}}</span>
  118 + <span class="green"></span>
  119 + </dd>
  120 + </dl>
  121 + {{/if}}
  122 + {{/each}}
  123 + </div>
  124 + </div>
  125 + </div>
  126 + {{/each}}
  127 + </script>
  128 + <script>
  129 + (function () {
  130 + var wrap = '#abnormal_monitor_wrap';
  131 + var lineIdx='10066,10067,10068,10146,10253,10335,10337,10340,10348,11014,60009,70123,104731';
  132 + window.localStorage.setItem("abnormal_line_idx", lineIdx);
  133 +
  134 + gb_o_s_basic_data.init(function () {
  135 + //初始化班次卡片
  136 + gb_os_card.init(function () {
  137 + //初始化异常信息
  138 + gb_o_s_abnormal.init(function () {
  139 + //滚动条
  140 + $('.abnormal_data_body_ul>li', wrap).perfectScrollbar({suppressScrollX: true});
  141 + $('.line_card_list', wrap).perfectScrollbar({suppressScrollX: true});
  142 + });
  143 + });
  144 + });
  145 + })();
  146 + </script>
  147 +</div>
0 148 \ No newline at end of file
... ...