Commit 62704a44ce46f477e0751ce126e88452afc341fe

Authored by ljq
1 parent c4b60541

智能调度-实发撤销、实发调整

src/main/java/com/bsth/XDApplication.java
... ... @@ -22,6 +22,8 @@ import com.bsth.data.schedule.thread.CalcOilThread;
22 22 import com.bsth.data.schedule.thread.SchedulePstThread;
23 23 import com.bsth.data.schedule.thread.ScheduleRefreshThread;
24 24 import com.bsth.data.schedule.thread.SubmitToTrafficManage;
  25 +import com.bsth.data.zndd.StationAllThread;
  26 +import com.bsth.data.zndd.ZnddThread;
25 27 import com.bsth.util.DateUtils;
26 28 import com.bsth.util.Tools;
27 29 import org.slf4j.Logger;
... ... @@ -82,7 +84,10 @@ public class XDApplication implements CommandLineRunner {
82 84  
83 85 /*@Autowired
84 86 FixedEnableVerionsThread fixedEnableVerionsThread;*/
85   -
  87 + @Autowired
  88 + ZnddThread znddThread;
  89 + @Autowired
  90 + StationAllThread stationAllThread;
86 91 @Autowired
87 92 SafeDrivDataLoadThread safeDrivDataLoadThread;
88 93  
... ... @@ -142,6 +147,9 @@ public class XDApplication implements CommandLineRunner {
142 147 gpsDataLoader.setFlag(-1);
143 148 //dayOfSchedule.dataRecovery();
144 149  
  150 + //智能调度
  151 + sexec.scheduleWithFixedDelay(znddThread, 15, 60, TimeUnit.SECONDS);
  152 +
145 153 //安全驾驶
146 154 sexec.scheduleWithFixedDelay(safeDrivDataLoadThread, 180, 10, TimeUnit.SECONDS);
147 155  
... ... @@ -187,7 +195,8 @@ public class XDApplication implements CommandLineRunner {
187 195 ScheduledExecutorService sexec = Application.mainServices;
188 196 //安全驾驶
189 197 sexec.scheduleWithFixedDelay(safeDrivDataLoadThread, 180, 10, TimeUnit.SECONDS);
190   -
  198 + //智能调度
  199 + sexec.scheduleWithFixedDelay(znddThread, 15, 60, TimeUnit.SECONDS);
191 200 GpsDataLoaderThread.setFlag(-1);
192 201 /** 线调业务 */
193 202 sexec.scheduleWithFixedDelay(scheduleRefreshThread, 10, 120, TimeUnit.SECONDS);//班次更新线程
... ... @@ -231,7 +240,8 @@ public class XDApplication implements CommandLineRunner {
231 240 ScheduledExecutorService sexec = Application.mainServices;
232 241 //安全驾驶
233 242 sexec.scheduleWithFixedDelay(safeDrivDataLoadThread, 180, 10, TimeUnit.SECONDS);
234   -
  243 + //智能调度
  244 + sexec.scheduleWithFixedDelay(znddThread, 15, 60, TimeUnit.SECONDS);
235 245 GpsDataLoaderThread.setFlag(-1);
236 246 //dayOfSchedule.dataRecovery();
237 247 /** 线调业务 */
... ... @@ -276,6 +286,8 @@ public class XDApplication implements CommandLineRunner {
276 286 ScheduledExecutorService sexec = Application.mainServices;
277 287 //安全驾驶
278 288 sexec.scheduleWithFixedDelay(safeDrivDataLoadThread, 180, 10, TimeUnit.SECONDS);
  289 + //智能调度
  290 + sexec.scheduleWithFixedDelay(znddThread, 15, 60, TimeUnit.SECONDS);
279 291  
280 292 GpsDataLoaderThread.setFlag(-1);
281 293 /** 线调业务 */
... ...
src/main/java/com/bsth/data/zndd/AutomaticSch.java 0 → 100644
  1 +package com.bsth.data.zndd;
  2 +
  3 +import com.alibaba.fastjson.JSON;
  4 +import com.alibaba.fastjson.JSONObject;
  5 +import com.bsth.data.BasicData;
  6 +import com.bsth.data.adjg.domain.LargeGap;
  7 +import com.bsth.data.directive.DayOfDirectives;
  8 +import com.bsth.data.directive.GatewayHttpUtils;
  9 +import com.bsth.data.directive.MsgIdGenerator;
  10 +import com.bsth.data.gpsdata_v2.GpsRealData;
  11 +import com.bsth.data.gpsdata_v2.entity.GpsEntity;
  12 +import com.bsth.data.schedule.DayOfSchedule;
  13 +import com.bsth.data.schedule.ScheduleComparator;
  14 +import com.bsth.entity.StationRoute;
  15 +import com.bsth.entity.directive.D60;
  16 +import com.bsth.entity.realcontrol.LineConfig;
  17 +import com.bsth.entity.realcontrol.ScheduleRealInfo;
  18 +import com.bsth.repository.StationRouteRepository;
  19 +import com.bsth.service.directive.DirectiveService;
  20 +import com.bsth.service.realcontrol.ScheduleRealInfoService;
  21 +import com.bsth.util.HttpClientUtils;
  22 +import org.apache.commons.lang3.StringUtils;
  23 +import org.joda.time.format.DateTimeFormat;
  24 +import org.joda.time.format.DateTimeFormatter;
  25 +import org.slf4j.Logger;
  26 +import org.slf4j.LoggerFactory;
  27 +import org.springframework.beans.factory.annotation.Autowired;
  28 +import org.springframework.stereotype.Component;
  29 +
  30 +import javax.xml.crypto.Data;
  31 +import java.text.ParseException;
  32 +import java.text.SimpleDateFormat;
  33 +import java.util.*;
  34 +import java.util.concurrent.ConcurrentHashMap;
  35 +import java.util.concurrent.ConcurrentMap;
  36 +
  37 +/**
  38 + * 自动检测调度异常
  39 + */
  40 +@Component
  41 +public class AutomaticSch {
  42 +
  43 + Logger logger = LoggerFactory.getLogger(this.getClass());
  44 + @Autowired
  45 + GpsRealData gpsRealData;
  46 + @Autowired
  47 + DayOfSchedule dayOfSchedule;
  48 + @Autowired
  49 + DayOfDirectives dayOfDirectives;
  50 + @Autowired
  51 + ScheduleRealInfoService scheduleRealInfoService;
  52 + @Autowired
  53 + DirectiveService directiveService;
  54 + @Autowired
  55 + StationRouteRepository stationRouteRepository;
  56 + @Autowired
  57 + OutEntrance outEntrance;
  58 +
  59 + private static DateTimeFormatter fmtHHmmss = DateTimeFormat.forPattern("HHmmss");
  60 + private static SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd");
  61 + private static DateTimeFormatter fmtyyyyMMddHHmmss = DateTimeFormat.forPattern("yyyy-MM-ddHHmmss");
  62 + private static SimpleDateFormat sdfHHmm = new SimpleDateFormat("HH:mm");
  63 + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm");
  64 +
  65 + private Map<String,String> drivreMap =new HashMap<>(); //自动重发map
  66 + // 当日60指令缓存
  67 + private ConcurrentMap<Integer, D60> d60Map = new ConcurrentHashMap<>();//d60map
  68 +
  69 + String urldkl = "http://10.10.200.202:5580/monitor/api/getMonitorInfoByDay?key=1&solt=1111&t=1&dayStr=2024-07-23"; //大间隔接口
  70 +
  71 + //http://10.10.200.201:8083/wxk-prod-api/service-api/lggj/schedule/drByInfo 维修接口
  72 +
  73 + private Map<String,Long> SFMAP = new HashMap<>();
  74 +
  75 + //满载
  76 + public void mz(){
  77 + try {
  78 + ScheduleRealInfo sr = dayOfSchedule.executeCurr("S0R-054");
  79 + ts(addStationPeople(sr, "MZ", 0L));//第二种 设备未离线 出站时间内未出站
  80 + }
  81 + catch (Exception e){
  82 + logger.error("满载------------------",e);
  83 + }
  84 + }
  85 +
  86 + //大间隔的情况
  87 + public void dfTz(){
  88 + try{
  89 + StringBuilder sb = HttpClientUtils.get(urldkl /*+ sdfMonth.format(new Date())*/);
  90 + if (sb == null)
  91 + return;
  92 + JSONObject obj = JSON.parseObject(sb.toString());
  93 + List<LargeGap> lgs = JSON.parseArray(obj.getString("largeGap"), LargeGap.class);
  94 + Long its = 0l;
  95 + //数据转换 并推送
  96 + for (LargeGap lg : lgs){
  97 + if(dayOfSchedule.executeCurr(lg.getNbbm()) != null){
  98 + its= dayOfSchedule.executeCurr(lg.getNbbm()).getId();
  99 + }else {
  100 + continue;
  101 + }
  102 + ts(ConvertDJK(lg,its.toString()));
  103 + }
  104 +
  105 + }catch (Exception e){
  106 + logger.error("大间隔推送失败------------------",e);
  107 + }
  108 + }
  109 +
  110 + //撤销班次 检测人员或者车辆故障 --//换人换车或烂班 //路牌对调
  111 + public void cxJC(){
  112 +
  113 +
  114 + }
  115 +
  116 + //撤销撤销班次 检测人员或者车辆故障 --//换人换车或烂班 //路牌对调
  117 + public void cxJCX(){
  118 +
  119 + }
  120 +
  121 + //实发调整检测 -- 车辆GPS掉线的情况下,车辆该出站了
  122 + /**
  123 + * 1。已过待发时间还没发车的
  124 + * 2.设备离线
  125 + * --上一班次还没有抵达终点不做操作
  126 + */
  127 + public void sftz(){
  128 + logger.warn("实发调整扫描开始");
  129 + try {
  130 + //获取所有线路
  131 + Map<String, String> lineMap = BasicData.lineCode2NameMap;
  132 + for (Map.Entry<String, String> t : lineMap.entrySet()){
  133 + List<GpsEntity> gpslist = gpsRealData.getByLine(t.getKey());
  134 + List<ScheduleRealInfo> srList = dayOfSchedule.findByLineCode(t.getKey());
  135 + for (ScheduleRealInfo sr : srList){
  136 + //1.离线 2.实发时间为空 3.已过待发时间还没发车的
  137 + long time = System.currentTimeMillis();//实际时间+2分钟
  138 + //超过待发时间 实发时间还是null的
  139 + if (sr.getFcsjT() + (1000*2) < time) {
  140 +
  141 + //起点站实际到达时间为null的情况下
  142 + if (StringUtils.isEmpty(sr.getQdzArrDatesj())) {
  143 + ScheduleRealInfo prev = dayOfSchedule.prev(sr);
  144 + //上一个班次没有实际终点到达时间
  145 + if (prev != null && StringUtils.isEmpty(prev.getZdsjActual())) {
  146 + continue;
  147 + }
  148 + }
  149 + //第一种 设备离线的情况下改出站
  150 + Integer staus = 0; //状态
  151 + if (StringUtils.isEmpty(sr.getFcsjActual()) && sr.getRemarks() == null) {
  152 +
  153 + GpsEntity gps = gpsRealData.getByNbbm(sr.getClZbh());
  154 + //当前设备离线的情况
  155 + //1。一直没收到gps
  156 + //2.gps长时间离线的情况下
  157 + //3.人为调整过的都跳过
  158 + if (gps == null || (gps.getAbnormalStatus() != null && gps.getAbnormalStatus().equals("offline"))){
  159 + ts(addStationPeople(sr, "SFTZ_1", 0L));
  160 + break;
  161 + }
  162 + /* if (staus == 0)
  163 + ts(addStationPeople(sr, "SFTZ_2", 0L));//第二种 设备未离线 出站时间内未出站 */
  164 + }
  165 + }
  166 + }
  167 +
  168 + }
  169 + }catch (Exception e){
  170 + logger.error("自动调度,实发调整推送失败---",e);
  171 + }
  172 + logger.warn("实发调整扫描结束");
  173 + }
  174 +
  175 + //实发撤销检测 -- 出现快一慢三的情况 && 指令重发
  176 + public void sfCX(){
  177 + //查询所有班次
  178 + //remark 人工干预过的的不检测
  179 + try {
  180 + Map<String, String> lineMap = BasicData.lineCode2NameMap;
  181 + List<ScheduleRealInfo> oldSchDateList;
  182 + String lineCode;
  183 + for (Map.Entry<String, String> ts : lineMap.entrySet()){
  184 + lineCode =ts.getKey();
  185 + oldSchDateList = dayOfSchedule.findByLineCode(lineCode);
  186 + //排序
  187 + Collections.sort(oldSchDateList, new ScheduleComparator.FCSJ());
  188 + for (ScheduleRealInfo t : oldSchDateList){
  189 + // 发车误点
  190 + if (t.getFcsj() != null && t.getFcsjActual() != null && t.getRemarks() == null){
  191 + Long sst = ((t.getFcsjActualTime() - t.getFcsjT()) / 1000 / 60);
  192 + Long dfsj = t.getDfsjT() / 1000 ;
  193 + Long sfsj = t.getFcsjActualTime() / 1000;
  194 + //获取车辆状态 gps没有的情况下,或者车辆状态异常的情况
  195 + //判定gps发送时间和现在时间作对比
  196 + GpsEntity gps = gpsRealData.getByNbbm(t.getClZbh());
  197 + /* if (gps)*/
  198 + //1.gps一直掉后一直没上线
  199 + //2.车辆gps判断还在场站内
  200 + //3.车辆信号离线的
  201 + if (gps == null || gps.getInstation() == 2 ||
  202 + (gps.getAbnormalStatus() != null && gps.getAbnormalStatus().equals("offline"))){
  203 + //实发快一慢三
  204 + /* if (sst <= 3 && sst >= -1){*/
  205 + if(dfsj.equals(sfsj))
  206 + continue;
  207 + //快1
  208 + if(sfsj < dfsj && dfsj - sfsj <= 60*4)
  209 + continue;
  210 + //慢3
  211 + if(dfsj < sfsj && sfsj - dfsj <= 60 *6)
  212 + continue;
  213 +
  214 +
  215 + //异常实发
  216 + ts(addStationPeople(t,"YCSF",sst));
  217 + }
  218 + /*}*/
  219 +
  220 + }
  221 + }
  222 + }
  223 + }catch (Exception e){
  224 + logger.error("实发撤销推送接口出错-----------",e);
  225 + }
  226 +
  227 +
  228 + }
  229 +
  230 + //发车信息微调检测 -- 车辆掉线后实发检测,重新计算时间发车时间
  231 + public void updatesf(){
  232 +
  233 + }
  234 +
  235 + //临加班次 -- 检测到大客流 //走落地屏客流接口
  236 + public void ljbc(){
  237 +
  238 +
  239 + }
  240 +
  241 + /**
  242 + * 指令重发
  243 + * 指令下发后设备未响应后 5分钟后重新发送一次 还未响应的话 未来一小时不自动发送该设备
  244 + */
  245 + public void drivresponse(){
  246 + logger.warn("指令重发扫描开始");
  247 + try {
  248 + Map<String,Object> tempmap =new HashMap<>();
  249 + //所有缓存指令
  250 + Collection<D60> dptArray = dayOfDirectives.all60();
  251 +
  252 + Map<String, String> lineMap = BasicData.lineCode2NameMap;
  253 + List<ScheduleRealInfo> oldSchDateList;
  254 + String lineCode;
  255 + for (Map.Entry<String, String> ts : lineMap.entrySet()) {
  256 + lineCode = ts.getKey();
  257 + oldSchDateList = dayOfSchedule.findByLineCode(lineCode);
  258 + for (ScheduleRealInfo t : oldSchDateList){
  259 + //指令重发
  260 + //1.待发时间是要超过当前时间的,2.当实际发车时间不为空的
  261 + //3.状态 驾驶员未响应的
  262 + if(t.getFcsjT() < new Date().getTime() && t.getFcsjActual() != null){
  263 +
  264 + }
  265 +
  266 +
  267 + }
  268 + }
  269 + }catch (Exception e){
  270 + logger.error("自动调度,指令重发---",e);
  271 + }
  272 + logger.warn("指令重发扫描结束");
  273 + }
  274 +
  275 + //误点检测 调度有的-LateAdjustHandle
  276 + public Map wd(ScheduleRealInfo sch){
  277 + //推送
  278 + try{
  279 + return addStationPeople(sch, "WD", 0L);
  280 + }catch (Exception e){
  281 + logger.error("自动调度,推送失败---",e);
  282 + }
  283 + return null;
  284 + }
  285 +
  286 +
  287 +
  288 + public void ts(Map m) throws ParseException {
  289 + //记录存一下 --超过当前时间的是否推送?
  290 + String st = m.get("lineCode")+"_"+m.get("type")+"_"+m.get("rqStr");
  291 + Long sj = sdf.parse(m.get("rqStr").toString() +" "+ m.get("rq")).getTime();
  292 + Long dsj = new Date().getTime();
  293 + List<Long> list = new ArrayList();
  294 + //111_DJG_2024-06-24
  295 + if (ZnddThread.ZNDDTYPEMAP.get(st) != null ) {
  296 + list = ZnddThread.ZNDDTYPEMAP.get(st);
  297 + int i = 0;
  298 +
  299 + for (Long s : list){ //推送过的同样情况1小时内 &&//超过当前时间的不推送&& sj < dsj
  300 + if (Math.abs(s - sj) > (60 * 60 * 1000)){
  301 + i ++ ;
  302 + }
  303 + }
  304 + outEntrance.Znddjk(m);//测试推送
  305 + if (i == list.size()){
  306 + list.add(sj);
  307 + ZnddThread.ZNDDTYPEMAP.put(st,list);//存记录
  308 + outEntrance.Znddjk(m);//推送
  309 + }
  310 + return;
  311 + }else {
  312 + list.add(sj);
  313 + ZnddThread.ZNDDTYPEMAP.put(st,list);//存记录
  314 + outEntrance.Znddjk(m);//推送
  315 + }
  316 +
  317 + }
  318 +
  319 +
  320 +
  321 +
  322 + //大间隔数据转换
  323 + public Map ConvertDJK(LargeGap lg,String ids){
  324 + Map sp = new HashMap();
  325 + sp.put("uuid",UUID());
  326 + sp.put("lineCode",lg.getLineCode());
  327 + sp.put("lineName",lg.getLineName() );
  328 + sp.put("rqStr",lg.getDateStr());
  329 + sp.put("rq",sdfHHmm.format(lg.getTsTime()));
  330 + sp.put("type","DJG");
  331 + sp.put("xlDir",lg.getUpDown());
  332 + sp.put("numType",lg.getIntervalMinute());
  333 + sp.put("stationCode",lg.getStationName());
  334 + sp.put("stationName",lg.getStationName());
  335 + sp.put("clzbh",lg.getNbbm());
  336 + sp.put("fcsj",lg.getBcfcsj());
  337 + sp.put("ids",ids);
  338 + sp.put("lg",lg);
  339 + return sp;
  340 +
  341 + }
  342 +
  343 + //转换
  344 + public Map addStationPeople(ScheduleRealInfo info,String type,Long sst) throws ParseException{
  345 + Map sp = new HashMap();
  346 + sp.put("uuid",UUID());
  347 + sp.put("lineCode",info.getXlBm());
  348 + sp.put("lineName",info.getXlName() );
  349 + sp.put("rqStr",info.getScheduleDateStr());
  350 + sp.put("rq",sdfHHmm.format(new Date())); //检测到时间
  351 + sp.put("type",type);
  352 + sp.put("xlDir",info.getXlDir());
  353 + sp.put("numType",sst);
  354 + sp.put("fcsj",info.getFcsj());
  355 + sp.put("id",info.getId());
  356 + sp.put("clzbh",info.getClZbh());
  357 + sp.put("ids",info.getId());
  358 + sp.put("sch",info);
  359 + return sp;
  360 + }
  361 + //生成唯一id
  362 + public String UUID(){
  363 + String uuid = UUID.randomUUID().toString().replaceAll("-", "");
  364 + uuid=uuid.substring(0,10);
  365 + StringBuilder builder=new StringBuilder();
  366 + builder.append(uuid)
  367 + .append(getRandom(3));
  368 + return builder.toString();
  369 + }
  370 +
  371 +
  372 + private static long getRandom(long n) {
  373 + long min = 1, max = 9;
  374 + for (int i = 1; i < n; i++) {
  375 + min *= 10;
  376 + max *= 10;
  377 + }
  378 + long rangeLong = (((long) (new Random().nextDouble() * (max - min)))) + min;
  379 + return rangeLong;
  380 + }
  381 +}
... ...
src/main/java/com/bsth/data/zndd/OutEntrance.java 0 → 100644
  1 +package com.bsth.data.zndd;
  2 +import com.bsth.common.ResponseCode;
  3 +import com.bsth.controller.station_signs.carMonitorThread;
  4 +import com.bsth.data.schedule.DayOfSchedule;
  5 +import com.bsth.data.schedule.ScheduleComparator;
  6 +import com.bsth.data.adjg.domain.LargeGap;
  7 +import com.bsth.entity.logger.StationSignsLogger;
  8 +import com.bsth.entity.realcontrol.ScheduleRealInfo;
  9 +import com.bsth.entity.zndd.StationPeopleLogger;
  10 +import com.bsth.service.logger.StationSignsLoggerService;
  11 +import com.bsth.service.zndd.ZnddLoggerService;
  12 +import com.bsth.websocket.handler.SendUtils;
  13 +import com.fasterxml.jackson.databind.ObjectMapper;
  14 +import org.slf4j.Logger;
  15 +import org.slf4j.LoggerFactory;
  16 +import org.springframework.beans.factory.annotation.Autowired;
  17 +import org.springframework.beans.factory.annotation.Value;
  18 +import org.springframework.web.bind.annotation.*;
  19 +import sun.misc.BASE64Decoder;
  20 +
  21 +import java.io.*;
  22 +import java.text.SimpleDateFormat;
  23 +import java.time.LocalTime;
  24 +import java.time.format.DateTimeFormatter;
  25 +import java.util.*;
  26 +
  27 +/**
  28 + * 对外接口
  29 + * 与站牌、小程序对接接口
  30 + * 调度预案通用接口
  31 + */
  32 +@RestController
  33 +@RequestMapping("/out")
  34 +public class OutEntrance {
  35 +
  36 + @Autowired
  37 + StationSignsLoggerService stationSignsLoggerService;
  38 +
  39 + @Autowired
  40 + SendUtils sendUtils;
  41 + @Autowired
  42 + DayOfSchedule dayOfSchedule;
  43 +
  44 + @Autowired
  45 + ZnddLoggerService znddLoggerService;
  46 + @Autowired
  47 + carMonitorThread carMonitorThread;
  48 +
  49 +
  50 + @Value("${dc.imgurl}")
  51 + private String imgurl; //存储图片地址
  52 +
  53 + @Value("${dc.profile}")
  54 + private String profile; //存储图片地址
  55 +
  56 + static String url= "http://58.34.52.130:9777/xxfb/carMonitor?"; //信息发布地址
  57 + Logger logger = LoggerFactory.getLogger(this.getClass());
  58 +
  59 +
  60 +
  61 + /*
  62 + 调度屏小程序接口。
  63 + */
  64 + @RequestMapping(value = "/OutCar", method = RequestMethod.POST)
  65 + public Map OutCarOutCar(@RequestParam Map m,@RequestBody Map<String, String> map) {
  66 +
  67 +
  68 + Map rtn = new HashMap<>();
  69 + try {
  70 +
  71 + ObjectMapper mapper = new ObjectMapper();
  72 + m.put("image", uploadBase64Img(map.get("img").toString()));
  73 + //map转换实体类
  74 + StationSignsLogger ssLogger = mapper.convertValue(m, StationSignsLogger.class);
  75 + //stationSignsLoggerService.save(ssLogger);
  76 +
  77 + //线调页面推送
  78 + sendUtils.stationcf(m);
  79 +
  80 + //查询班次情况自动回复
  81 + //当前日期
  82 + //String rq = DateUtils.dqDate();
  83 + List<Map> dzList = carMonitorThread.carMonitor(ssLogger.getLineCode(), ssLogger.getDir(), ssLogger.getStation()); //信息发布接口
  84 + if (dzList.size() > 0){
  85 + rtn.put("message","车辆还有"+dzList.get(0).get("sj")+"抵达,请耐心等待");
  86 + }else {
  87 + //筛选方向
  88 + List<ScheduleRealInfo> rs = dayOfSchedule.findByLineCode(ssLogger.getLineCode());
  89 + //排序
  90 + Collections.sort(rs,new ScheduleComparator.FCSJ());
  91 + SimpleDateFormat sdf= new SimpleDateFormat("HH:ss");
  92 + String sjtext = "";
  93 + LocalTime t1 = LocalTime.parse(sdf.format(new Date()), DateTimeFormatter.ofPattern("HH:mm"));
  94 + for (ScheduleRealInfo sr:rs) {
  95 + LocalTime t2 = LocalTime.parse(sr.getFcsj(), DateTimeFormatter.ofPattern("HH:mm"));
  96 + //判断上下行
  97 + if(t1.isAfter(t2)){
  98 + sjtext = sr.getFcsj();
  99 + }
  100 + }
  101 +
  102 + rtn.put("message","航津路与杨高北路交叉口拥堵,请耐心等待");
  103 + rtn.put("message_els","The intersection of Hangjin Road and Yanggao North Road is congested, please be patient and wait");
  104 + }
  105 +
  106 +
  107 +
  108 + rtn.put("status",ResponseCode.SUCCESS);
  109 + } catch (Exception e) {
  110 + rtn.put("status", ResponseCode.ERROR);
  111 + logger.info(e.getMessage());
  112 + }
  113 +
  114 + return rtn;
  115 + }
  116 + /*
  117 + 智能调度接口--通用测试接口
  118 + */
  119 + @RequestMapping(value="/zjket",method = RequestMethod.GET)
  120 + public Map Znddjk(@RequestParam Map m) {
  121 + Map rtn = new HashMap<>();
  122 +
  123 + try {
  124 + ObjectMapper mapper = new ObjectMapper();
  125 + //线调页面推送
  126 + sendUtils.sendzndd(m);
  127 +
  128 + rtn.put("status",ResponseCode.SUCCESS);
  129 + } catch (Exception e) {
  130 + rtn.put("status",ResponseCode.ERROR);
  131 + logger.info("智能调度推送----",e);
  132 + }
  133 +
  134 + return rtn;
  135 + }
  136 +
  137 + /*
  138 + 智能调度接口-大客流
  139 + */
  140 + @RequestMapping(value="/dkl",method = RequestMethod.POST)
  141 + public Map ddkl(@RequestParam Map m) {
  142 + Map rtn = new HashMap<>();
  143 +
  144 + try {
  145 + ObjectMapper mapper = new ObjectMapper();
  146 + //map转换实体类
  147 + StationPeopleLogger ssLogger = mapper.convertValue(m, StationPeopleLogger.class);
  148 +
  149 + ssLogger.setType("大客流");
  150 +
  151 + //保存记录
  152 + znddLoggerService.save(ssLogger);
  153 + //线调页面推送
  154 + //sendUtils.sendzndd(ssLogger);
  155 +
  156 + rtn.put("status",ResponseCode.SUCCESS);
  157 + } catch (Exception e) {
  158 + rtn.put("status", ResponseCode.ERROR);
  159 + Logger logger = LoggerFactory.getLogger(this.getClass());
  160 + }
  161 + return rtn;
  162 + }
  163 +
  164 +
  165 +
  166 +
  167 + /**
  168 + * 保存base64图片
  169 + * @param base64Str base64文件
  170 + * @param 上传地址(示例:D:\\1.png)
  171 + * @return
  172 + */
  173 + public String uploadBase64Img(String base) {
  174 +
  175 + //获取年月日
  176 + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
  177 + //将年、月、日存入数组
  178 + String[] time = sdf.format(new Date()).split("-");
  179 + // 文件保存地址 默认地址为xxxx/年/月/日
  180 + String url = "avat/"+time[0]+"/"+time[1]+"/"+time[2];
  181 + String destDir = imgurl+"/"+url;
  182 +
  183 +
  184 + base=base.replaceAll("data:image/png;base64,","");
  185 + BASE64Decoder decoder = new BASE64Decoder();
  186 + byte[] imageByte = null;
  187 + try{
  188 + imageByte = decoder.decodeBuffer(base);
  189 + for (int i = 0; i < imageByte.length; ++i) {
  190 + if (imageByte[i] < 0) {// 调整异常数据
  191 + imageByte[i] += 256;
  192 + }
  193 + }
  194 + } catch (Exception e) {
  195 + e.printStackTrace();
  196 + }
  197 + if (imageByte.length>0) {
  198 + try {
  199 + String filepath = destDir;
  200 + File destfile = new File(filepath);
  201 + if (!destfile.exists()) {
  202 + destfile.mkdirs();
  203 + }
  204 + //文件新名称
  205 + String fileNameNew = "666"+ ".png";
  206 + File f = new File(destfile.getAbsoluteFile() + File.separator + fileNameNew);
  207 + // 将字符串转换成二进制,用于显示图片
  208 + // 将上面生成的图片格式字符串 imgStr,还原成图片显示
  209 + InputStream in = new ByteArrayInputStream(imageByte);
  210 + FileOutputStream fos = new FileOutputStream(f);
  211 + byte[] buf = new byte[1024];
  212 + int length;
  213 + length = in.read(buf, 0, buf.length);
  214 +
  215 + while (length != -1) {
  216 + fos.write(buf, 0, length);
  217 + length = in.read(buf);
  218 + }
  219 + fos.flush();
  220 + fos.close();
  221 + in.close();
  222 + return "/"+profile + "/" + url+"/"+fileNameNew;
  223 + } catch (Exception e) {
  224 + e.printStackTrace();
  225 + } finally {
  226 + }
  227 + }
  228 + return null;
  229 + }
  230 +
  231 +
  232 +
  233 +}
... ...
src/main/java/com/bsth/data/zndd/ZnddThread.java 0 → 100644
  1 +package com.bsth.data.zndd;
  2 +
  3 +import com.alibaba.fastjson.JSON;
  4 +import com.alibaba.fastjson.JSONArray;
  5 +import com.alibaba.fastjson.JSONObject;
  6 +import com.bsth.data.LineConfigData;
  7 +import com.bsth.data.adjg.UserCarCountHandler;
  8 +import com.bsth.data.gpsdata_v2.GpsRealData;
  9 +import com.bsth.data.gpsdata_v2.entity.GpsEntity;
  10 +import com.bsth.data.schedule.DayOfSchedule;
  11 +import com.bsth.data.schedule.ScheduleComparator;
  12 +import com.bsth.data.adjg.domain.LargeGap;
  13 +import com.bsth.entity.calc.CalcIntervalDetail;
  14 +import com.bsth.entity.realcontrol.LineConfig;
  15 +import com.bsth.entity.realcontrol.ScheduleRealInfo;
  16 +import com.bsth.entity.zndd.znddStatus;
  17 +import com.bsth.repository.StationRouteRepository;
  18 +import com.bsth.repository.zndd.StationPeopleLoggerRepository;
  19 +import com.bsth.repository.zndd.ZnddStatusRepository;
  20 +import com.bsth.util.HttpClientUtils;
  21 +import org.slf4j.Logger;
  22 +import org.slf4j.LoggerFactory;
  23 +import org.springframework.beans.factory.annotation.Autowired;
  24 +import org.springframework.stereotype.Component;
  25 +
  26 +import java.text.ParseException;
  27 +import java.text.SimpleDateFormat;
  28 +import java.util.*;
  29 +
  30 +/**
  31 + * 调度预案 发车间隔、误点、大间隔、满载、大客流
  32 + */
  33 +@Component
  34 +public class ZnddThread extends Thread{
  35 +
  36 + Logger logger = LoggerFactory.getLogger(this.getClass());
  37 + @Autowired
  38 + StationPeopleLoggerRepository stationPeopleLoggerRepository;
  39 + @Autowired
  40 + DayOfSchedule dayOfSchedule;
  41 + @Autowired
  42 + LineConfigData lineConfs;
  43 + @Autowired
  44 + GpsRealData gpsRealData;
  45 + @Autowired
  46 + StationRouteRepository stationRouteRepository;
  47 + @Autowired
  48 + private UserCarCountHandler userCarCountHandler;
  49 + @Autowired
  50 + OutEntrance outEntrance;
  51 + @Autowired
  52 + AutomaticSch automaticSch;
  53 +
  54 + @Autowired
  55 + ZnddStatusRepository znddStatusRepository;
  56 +
  57 + static Map<String,List> ZNDDTYPEMAP = new HashMap<>(); //已经推送过的检测
  58 +
  59 +
  60 + String url = "https://lgapp.bsth.tech:13089/bsth_passengerflow/klbus/currentInsideNum.do"; //车内客流接口
  61 +
  62 +
  63 + String urldkl = "https://lgapp.bsth.tech:8005//monitor/api/getMonitorInfoByDay?key=1&solt=1111&t=1&dayStr="; //大客流接口
  64 +
  65 + private static SimpleDateFormat sdfHHmm = new SimpleDateFormat("HH:mm");
  66 + private static SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd");
  67 + private static SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
  68 + @Override
  69 + public void run() {
  70 + List<znddStatus> znddStatusList = (List<znddStatus>) znddStatusRepository.findAll();
  71 + //FCJG();//发车间隔检查 报价
  72 + //GPSDJG();//大间隔
  73 + // MZ(); //满载
  74 + //DKL(); //大客流 以接口方式
  75 + //automaticSch.mz();
  76 + //automaticSch.dfTz();//大间隔
  77 + //automaticSch.drivresponse(); //设备重发
  78 + for (znddStatus zs : znddStatusList){
  79 +
  80 + if (zs.getOpenStatus().equals("0")) {
  81 + if (zs.getType().equals("sftz")) {
  82 + automaticSch.sftz();//实发调整
  83 + logger.info("实发执行完毕");
  84 + }
  85 + if (zs.getType().equals("ycsf")) {
  86 + automaticSch.sfCX();// 异常实发 - 实发撤销
  87 + logger.info("异常实发执行完毕");
  88 + }
  89 + }
  90 + }
  91 +
  92 +
  93 +
  94 + }
  95 + //满载
  96 + public void MZ(){
  97 + try {
  98 + StringBuilder sb = HttpClientUtils.get(url);
  99 + List<Object> list = JSONArray.parseArray(String.valueOf(sb));
  100 + for (Object b :list){
  101 + Map m = (Map) b;
  102 + Integer num = Integer.parseInt(m.get("inside_num").toString());
  103 + if (num >= 15){ //大间隔阈值 检测到超过15个人的时候推送
  104 + ScheduleRealInfo sr = dayOfSchedule.executeCurr(m.get("nbbm").toString()); //查询当前车辆执行班次
  105 + GpsEntity gps = gpsRealData.get(m.get("sbbh").toString());
  106 + Map msp = new HashMap();
  107 + msp.put("lineCode",m.get("xlbm"));
  108 + msp.put("lineName",m.get("xlmc"));
  109 + msp.put("stationName",gps.getStationName());
  110 + msp.put("rqStr",sdfMonth.format(new Date()));
  111 + msp.put("rq",sdfHHmm.format(new Date()));
  112 + msp.put("type","MZ");
  113 + msp.put("numType",num);
  114 + if (sr != null )
  115 + msp.put("xlDir",sr.getXlDir());
  116 +
  117 + if (gps != null )
  118 + msp.put("station",gps.getStation().getCode());
  119 +
  120 + ts(msp);
  121 + }
  122 + }
  123 +
  124 + }catch (Exception e){
  125 + logger.error("满载检测接口出错-----------",e);
  126 + }
  127 + }
  128 + public void ts(Map m) throws ParseException {
  129 + //记录存一下 --超过当前时间的是否推送?
  130 + String st = m.get("lineCode")+"_"+m.get("type")+"_"+m.get("rqStr");
  131 + Long sj = sdf.parse(m.get("rqStr").toString() +" "+ m.get("rq")).getTime();
  132 + List<Long> list = new ArrayList();
  133 + //111_DJG_2024-06-24
  134 + if (ZnddThread.ZNDDTYPEMAP.get(st) != null ) {
  135 + list = ZnddThread.ZNDDTYPEMAP.get(st);
  136 + int i = 0;
  137 +
  138 + for (Long s : list){ //推送过的同样情况1小时内
  139 + if (Math.abs(s - sj) > (60 * 60 * 1000)){
  140 + i ++ ;
  141 + }
  142 + }
  143 + outEntrance.Znddjk(m);//测试推送
  144 + if (i == list.size()){
  145 + list.add(sj);
  146 + ZnddThread.ZNDDTYPEMAP.put(st,list);//存记录
  147 + outEntrance.Znddjk(m);//推送
  148 + }
  149 + return;
  150 + }else {
  151 + list.add(sj);
  152 + ZnddThread.ZNDDTYPEMAP.put(st,list);//存记录
  153 + outEntrance.Znddjk(m);//推送
  154 + }
  155 +
  156 + }
  157 + /* public void ts(Map m) throws ParseException {
  158 + //记录存一下 --超过当前时间的是否推送?
  159 + String st = m.get("lineCode")+"_"+m.get("type")+"_"+m.get("rqStr");
  160 + Long sj = sdf.parse(m.get("rqStr").toString() +" "+ m.get("rq")).getTime();
  161 + List<Long> list = new ArrayList();
  162 + //111_DJG_2024-06-24
  163 + if (ZNDDTYPEMAP.get(st) != null ) {
  164 + list = ZNDDTYPEMAP.get(st);
  165 + int i = 0;
  166 + for (Long s : list){
  167 + if (Math.abs(s - sj) > (60 * 60 * 1000)){
  168 + i ++ ;
  169 + }
  170 + }
  171 + if (i == list.size()){
  172 + list.add(sj);
  173 + ZNDDTYPEMAP.put(st,list);//存记录
  174 + outEntrance.Znddjk(m);//推送
  175 + }
  176 + return;
  177 + }else {
  178 + list.add(sj);
  179 + ZNDDTYPEMAP.put(st,list);//存记录
  180 + outEntrance.Znddjk(m);//推送
  181 + }
  182 +
  183 + }
  184 +
  185 +*/
  186 +
  187 + //发车间隔
  188 + public void FCJG(){
  189 + try {
  190 + //无数据情况下 查看发车间隔配置数据是否正常bsth_c_calc_interval
  191 + List<CalcIntervalDetail> fcjgList = userCarCountHandler.calcLast();
  192 + if (fcjgList!= null && !fcjgList.isEmpty()){
  193 + for (CalcIntervalDetail cd : fcjgList){
  194 + Map sp = new HashMap();
  195 + sp.put("lineCode",cd.getLineCode());
  196 + sp.put("lineName",cd.getLineName());
  197 + sp.put("rqStr",cd.getDate());
  198 + sp.put("rq",cd.getSjfc2());
  199 + sp.put("type","FCJG");
  200 + sp.put("xlDir",cd.getXlDir());
  201 + sp.put("numType",cd.getSubTime());
  202 + sp.put("fcsj",cd.getSjfc2());
  203 + sp.put("stationName",cd.getStation());
  204 + ts(sp);
  205 + }
  206 + }
  207 + }catch (Exception e){
  208 + logger.error("发车间隔检测出现出错-----------",e);
  209 + }
  210 + }
  211 +
  212 +
  213 + //转换
  214 + public Map addStationPeople(ScheduleRealInfo info,String type,Long sst,String sj) throws ParseException{
  215 + Map sp = new HashMap();
  216 + sp.put("lineCode",info.getXlBm());
  217 + sp.put("lineName",info.getXlName() );
  218 + sp.put("rqStr",info.getScheduleDateStr());
  219 + sp.put("rq",new java.sql.Date(sdf.parse((info.getScheduleDateStr()+" " + sj)).getTime())); //检测到时间
  220 + sp.put("type",type);
  221 + sp.put("xlDir",info.getXlDir());
  222 + sp.put("numType",sst);
  223 + return sp;
  224 + }
  225 +
  226 +
  227 +
  228 + //排序
  229 + public static class GpsComp implements Comparator<GpsEntity> {
  230 + @Override
  231 + public int compare(GpsEntity o1, GpsEntity o2) {
  232 + return Integer.parseInt(o1.getRemark()) - Integer.parseInt(o2.getRemark());
  233 + }
  234 + }
  235 +
  236 +}
  237 +
... ...
src/main/java/com/bsth/entity/zndd/LoggerZndd.java 0 → 100644
  1 +package com.bsth.entity.zndd;
  2 +
  3 +import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
  4 +
  5 +import javax.persistence.*;
  6 +import java.io.Serializable;
  7 +import java.util.Date;
  8 +
  9 +@Entity
  10 +@Table(name = "logger_zndd")
  11 +@JsonIgnoreProperties(value={"hibernateLazyInitializer","handler","fieldHandler"})
  12 +public class LoggerZndd implements Serializable {
  13 +
  14 + // ID
  15 + @Id
  16 + @GeneratedValue(strategy = GenerationType.IDENTITY)
  17 + private Long id;
  18 +
  19 + //记录
  20 + private String text;
  21 +
  22 + // 创建人
  23 + private Integer createBy;
  24 +
  25 +
  26 + // 创建日期
  27 + @Column(updatable = false, name = "create_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP")
  28 + private Date createDate;
  29 +
  30 + public String getText() {
  31 + return text;
  32 + }
  33 +
  34 + public void setText(String text) {
  35 + this.text = text;
  36 + }
  37 +
  38 + public Long getId() {
  39 + return id;
  40 + }
  41 +
  42 + public void setId(Long id) {
  43 + this.id = id;
  44 + }
  45 +
  46 + public Integer getCreateBy() {
  47 + return createBy;
  48 + }
  49 +
  50 + public void setCreateBy(Integer createBy) {
  51 + this.createBy = createBy;
  52 + }
  53 +
  54 + public Date getCreateDate() {
  55 + return createDate;
  56 + }
  57 +
  58 + public void setCreateDate(Date createDate) {
  59 + this.createDate = createDate;
  60 + }
  61 +}
... ...
src/main/java/com/bsth/entity/zndd/znddStatus.java 0 → 100644
  1 +package com.bsth.entity.zndd;
  2 +
  3 +import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
  4 +
  5 +import javax.persistence.*;
  6 +
  7 +@Entity
  8 +@Table(name = "zndd_status")
  9 +@JsonIgnoreProperties(value={"hibernateLazyInitializer","handler","fieldHandler"})
  10 +public class znddStatus {
  11 +
  12 + // ID
  13 + @Id
  14 + @GeneratedValue(strategy = GenerationType.IDENTITY)
  15 + private Long id;
  16 +
  17 + //类型
  18 + private String type;
  19 + //状态 0 开 1关
  20 + private String openStatus;
  21 +
  22 + private String remark;
  23 +
  24 +
  25 + public String getType() {
  26 + return type;
  27 + }
  28 +
  29 + public void setType(String type) {
  30 + this.type = type;
  31 + }
  32 +
  33 + public String getOpenStatus() {
  34 + return openStatus;
  35 + }
  36 +
  37 + public void setOpenStatus(String openStatus) {
  38 + this.openStatus = openStatus;
  39 + }
  40 +
  41 + public String getRemark() {
  42 + return remark;
  43 + }
  44 +
  45 + public void setRemark(String remark) {
  46 + this.remark = remark;
  47 + }
  48 +}
... ...
src/main/java/com/bsth/repository/zndd/LoggerZnddRepository.java 0 → 100644
  1 +package com.bsth.repository.zndd;
  2 +
  3 +import com.bsth.entity.zndd.LoggerZndd;
  4 +import com.bsth.repository.BaseRepository;
  5 +import org.springframework.stereotype.Repository;
  6 +
  7 +@Repository
  8 +public interface LoggerZnddRepository extends BaseRepository<LoggerZndd, Integer> {
  9 +}
... ...
src/main/java/com/bsth/repository/zndd/ZnddStatusRepository.java 0 → 100644
  1 +package com.bsth.repository.zndd;
  2 +
  3 +import com.bsth.entity.zndd.znddStatus;
  4 +import com.bsth.repository.BaseRepository;
  5 +import org.springframework.stereotype.Repository;
  6 +
  7 +
  8 +@Repository
  9 +public interface ZnddStatusRepository extends BaseRepository<znddStatus, Integer> {
  10 +
  11 +}
... ...
src/main/java/com/bsth/websocket/handler/SendUtils.java
... ... @@ -7,6 +7,8 @@ import com.bsth.data.gpsdata_v2.entity.GpsEntity;
7 7 import com.bsth.data.safe_driv.SafeDriv;
8 8 import com.bsth.entity.directive.D80;
9 9 import com.bsth.entity.realcontrol.ScheduleRealInfo;
  10 +import com.bsth.entity.zndd.StationPeople;
  11 +import com.bsth.entity.zndd.StationPeopleLogger;
10 12 import com.bsth.websocket.dto.WsScheduleRealInfo;
11 13 import com.fasterxml.jackson.core.JsonProcessingException;
12 14 import com.fasterxml.jackson.databind.ObjectMapper;
... ... @@ -249,4 +251,37 @@ public class SendUtils{
249 251 logger.error("sendContingencyPlan", e);
250 252 }
251 253 }
  254 + /**
  255 + * 智能调度
  256 + * @param sch
  257 + */
  258 + public void sendzndd(Map m) {
  259 + Map<String, Object> map = new HashMap<>();
  260 + map.put("fn", "zndd");
  261 + map.put("data",m);
  262 + ObjectMapper mapper = new ObjectMapper();
  263 +
  264 + try {
  265 + socketHandler.sendMessageToLine(m.get("lineCode").toString(), mapper.writeValueAsString(map));
  266 + } catch (JsonProcessingException e) {
  267 + logger.error("sendRfid", e);
  268 + }
  269 + }
  270 +
  271 + /**
  272 + * 将催发信息送至线调页面
  273 + */
  274 + public void stationcf(Map<String, Object> cp) {
  275 + Map<String, Object> map = new HashMap<>();
  276 + map.put("fn", "stationcf");
  277 + map.put("data", cp);
  278 + ObjectMapper mapper = new ObjectMapper();
  279 +
  280 + try {
  281 + socketHandler.sendMessageToLine(cp.get("lineCode").toString(), mapper.writeValueAsString(map));
  282 + } catch (JsonProcessingException e) {
  283 + logger.error("sendContingencyPlan", e);
  284 + }
  285 + }
  286 +
252 287 }
... ...
src/main/resources/static/real_control_v2/css/main.css
... ... @@ -213,6 +213,13 @@ svg.line-chart g.gps-wrap &gt; rect {
213 213 cursor: pointer;
214 214 }
215 215  
  216 +svg.line-chart g.num-number > text {
  217 + font-size: 16px;
  218 + transform: translate(0, 5px);
  219 + color: red;
  220 + z-index: 99;
  221 +}
  222 +
216 223 svg.line-chart g.gps-wrap > rect[updown="0"] {
217 224 stroke: rgb(62, 80, 179);
218 225 fill: rgb(62, 80, 179);
... ... @@ -990,6 +997,48 @@ option.oil_station_opt {
990 997 margin-right: 5px;
991 998 }
992 999  
  1000 +
  1001 +.multi_plat_msg_pops .tests {
  1002 + display: block;
  1003 +}
  1004 +
  1005 +
  1006 +/** 智能调度 */
  1007 +.multi_plat_msg_pop_zndd {
  1008 + position: absolute;
  1009 + right: 12px;
  1010 + bottom: 12px;
  1011 + z-index: 99;
  1012 +}
  1013 +
  1014 +/** 催發 */
  1015 +.multi_plat_msg_pop_cf {
  1016 + position: absolute;
  1017 + right: 12px;
  1018 + bottom: 12px;
  1019 + z-index: 99;
  1020 + background: #ffffff
  1021 +}
  1022 +
  1023 + .multi_plat_msg_pops {
  1024 + color: grey;
  1025 + margin: 7px 0;
  1026 + padding: 7px 12px;
  1027 + box-shadow: 0px 0px 10px rgba(90, 90, 90, 0.29);
  1028 + cursor: pointer;
  1029 +}
  1030 +
  1031 +
  1032 +.multi_plat_msg_pops .desc {
  1033 + display: block;
  1034 + font-size: 12px;
  1035 + color: #ff9d9d;
  1036 + text-align: right;
  1037 + margin-right: 5px;
  1038 +}
  1039 +
  1040 +
  1041 +
993 1042 /** 嵌入表单modal滚动条样式 */
994 1043 #formFragmentModal::-webkit-scrollbar {
995 1044 width: 10px;
... ... @@ -2127,4 +2176,65 @@ g.gps-wrap rect.twinkle[updown=&quot;1&quot;] {
2127 2176 stroke: #c94f21;
2128 2177 fill: #c94f21;
2129 2178 }
  2179 +}
  2180 +.msg-popup {
  2181 + position: relative;
  2182 + min-width: 100%;
  2183 + box-sizing: border-box;
  2184 + min-height: 60px;
  2185 + cursor: pointer;
  2186 + border-radius: 5px;
  2187 + color: white;
  2188 + opacity: 0.9;
  2189 + padding: 10px;
  2190 + box-shadow: 0 0.125rem 0.8rem rgba(0, 0, 0, 0.1) !important;
  2191 +}
  2192 +.warning-color {
  2193 + border: 1px solid #e79a00;
  2194 + background-color: #7ecbe4;
  2195 + font-size: 18px;
  2196 + opacity: 0.9;
  2197 +}
  2198 +
  2199 +.msg-times {
  2200 + position: absolute;
  2201 + right: 10px;
  2202 + top: 0px;
  2203 +}
  2204 +
  2205 +.msg-times {
  2206 + position: absolute;
  2207 + right: 10px;
  2208 + top: 0px;
  2209 +}
  2210 +
  2211 +.centerSpace {
  2212 + display: flex;
  2213 + align-items: center;
  2214 + justify-content: space-between;
  2215 +}
  2216 +
  2217 +.msg-title {
  2218 + min-width: 100%;
  2219 + font-size: 14px;
  2220 +}
  2221 +
  2222 +.msg-date-info {
  2223 + padding-right: 20px;
  2224 +}
  2225 +.colsebc{
  2226 + line-height: 20px;
  2227 + font-size: 1px;
  2228 +}
  2229 +.popup-msg-contents{
  2230 +
  2231 + text-align: right ;
  2232 +}
  2233 +
  2234 +.multi_plat_config .timer{
  2235 + background-color: #0575c3ba;
  2236 + font-size: 15px;
  2237 + color: white;
  2238 + text-align: center;
  2239 + margin-top: 5px;
2130 2240 }
2131 2241 \ No newline at end of file
... ...
src/main/resources/static/real_control_v2/css/north.css
... ... @@ -566,4 +566,20 @@ span.sm-grey{
566 566  
567 567 .park-and-station-wrap .c_2_s_list>.item{
568 568 margin-top: 12px;
569   -}
570 569 \ No newline at end of file
  570 +}
  571 +.btn_title_lines1{
  572 + border-bottom: 1px solid #efeded;
  573 + margin: 10px 20px 10px;
  574 +}
  575 +
  576 +
  577 +.qtip-img > .qtip-content{
  578 + width: 600px;
  579 + padding: 0 0;
  580 +}
  581 +
  582 +.qtip-img > .qtip-content >img{
  583 + margin-top: -10px;
  584 + margin-left: -14px;
  585 + margin-bottom: -30px;
  586 +}
... ...
src/main/resources/static/real_control_v2/js/zndd/data_zndd.js 0 → 100644
  1 +var gb_dataZndd = (function (){
  2 +
  3 + var max = 1;
  4 + var $pop =$('.multi_plat_msg_pop_zndd');
  5 +
  6 + var codes = {
  7 + 'DJG': '大间隔',
  8 + 'FCJG': '发车间隔',
  9 + 'WD': '误点',
  10 + 'MZ': '满载率高',
  11 + 'DKL': '大客流',
  12 + 'YCSF':'异常实发',
  13 + 'SFTZ_1': '实发未发,信号异常',
  14 + };
  15 + let timelist = [],interval;
  16 + var dataMap = new Map();
  17 + var leftTime = 1000 * 40;//剩余的毫秒数
  18 + var timeType = false
  19 + var sop = function (data) {
  20 + /*//调度智能开关
  21 + var storage = window.localStorage;
  22 + var switchmap = storage.getItem("switchmap") != null ? JSON.parse(storage.getItem("switchmap")) : null; ; //智能调度开关 0 关闭 1 开启
  23 + if (switchmap == null){
  24 + console.log("智能调度开关未启动!")
  25 + return;
  26 + }
  27 +
  28 + for (let scp in switchmap){
  29 + if (data.type.includes(scp)){
  30 + if(switchmap[scp] == 0)
  31 + return;
  32 + }
  33 + }*/
  34 +
  35 + //时间格式化
  36 + data.types = codes[data.type];
  37 + var stm = moment(new Date());
  38 + data.uuid = data.uuid + "uuid";//会出现纯数字 key取不到
  39 +
  40 + data.datarq = stm.format('HH时mm分ss秒');
  41 + dataMap.set(data.uuid,data);
  42 +
  43 + //
  44 +
  45 + configure();
  46 +
  47 +
  48 + //配置 随到随发 配置div方案
  49 + function configure(){
  50 +
  51 + var htmlStr = template('zndd_plat_msg_template_config', data);
  52 + var items = $pop.find('.multi_plat_config'),
  53 + len = items.length;
  54 +
  55 + if (len >= max)
  56 + return
  57 +
  58 + //$pop.find('.multi_plat_config:lt(' + (len - max) + ')').remove();
  59 +
  60 + if (!interval){
  61 + interval = snt(data.type,data.ids);
  62 + }
  63 + timelist.push({ele:data.uuid,time:leftTime}) //自动调度定时器
  64 + $pop.append(htmlStr);
  65 + let msg ='检测到'+data.lineName+' '+(data.dir==0 ?'上行':'下行')
  66 + +data.datarq+'出现'+data.types+'事件'+'请尽快处理,否则40秒后自动选择最优方案处理。';
  67 +
  68 + //gb_tts.audition(msg, 1.2); //语音播报
  69 +
  70 +
  71 + }
  72 +
  73 +
  74 + };
  75 +
  76 + let close = true; //关闭弹出框的时候不弹出
  77 + $pop.on('click', '.multi_plat_config .msg-times', function () {
  78 + $(this).parent().parent().remove();
  79 + if (close) close = false
  80 + });
  81 + $pop.on('click', '.multi_plat_config .msg-times', function () {
  82 + $(this).parent().parent().remove();
  83 + if (close) close = false
  84 + });
  85 +
  86 +
  87 + //撤销实发
  88 + $pop.on('click', '.colsebc', function () {
  89 + if (close) close = false
  90 + let that = $(this);
  91 +
  92 + var content = '<h3>确定要撤销<span style="color:red;margin: 0 5px;">' + that.data('clzbh') + '( ' + that.data('fcsj') + ' )</span>的实发时间?</h3>'
  93 + alt_confirm(content, function () {
  94 + gb_common.$post('/realSchedule/revokeRealOutgo_zndd', {
  95 + id: that.data('id'),
  96 + remarks:"_智能调度-异常实发",
  97 + }, function (rs) {
  98 + gb_schedule_table.updateSchedule(rs.ts);
  99 + notify_succ('撤销实发操作成功!');
  100 + that.parent().parent().remove();
  101 + });
  102 + }, '确认撤销实发');
  103 + });
  104 +
  105 + //车辆掉线后-未实发 修改实发
  106 + $pop.on('click', '.sfTzbc', function () {
  107 + if (close) close = false
  108 + let that = $(this);
  109 +
  110 + var content = '<h3>确定要调整<span style="color:red;margin: 0 5px;">' + that.data('clzbh') + '( ' + that.data('fcsj') + ' )</span>的实发时间?</h3>'
  111 + alt_confirm(content, function () {
  112 + gb_common.$post('/realSchedule/realOutAdjust_zndd', {
  113 + id: that.data('id'),
  114 + remarks:'自动调度实发调整-车辆掉线',
  115 + fcsjActual:that.data('fcsj')
  116 +
  117 + }, function (rs) {
  118 + gb_schedule_table.updateSchedule(rs.ts);
  119 + notify_succ('实发调整操作成功!');
  120 + //calc 应发未发
  121 + that.parent().parent().remove();
  122 + });
  123 + }, '确认调整实发');
  124 + });
  125 +
  126 + //临加班次
  127 + $pop.on('click', '.multi_plat_config', function () {
  128 + if (!close) {close = true;return;}
  129 + let that = $(this);
  130 + let data = returnDate(that);
  131 + let sch = dataMap.get(that.data('uuid'));
  132 + let typeindex = typesx(data.type);
  133 + if (typeindex == null)
  134 + return;
  135 +
  136 + for(var i = 0;i < timelist.length; i++) {
  137 + if (timelist[i].ele == that.data('uuid')){
  138 + timelist.splice(i--, 1);
  139 + }
  140 + };
  141 +
  142 + folder = '/real_control_v2/zndd/type';
  143 + open_modal(folder + '/'+typeindex, {
  144 + data: sch
  145 + }, {center: true, bgclose: false, modal: true});
  146 + });
  147 +
  148 +
  149 + function typesx(type){
  150 + switch (type){
  151 + case 'YCSF':
  152 + return 'ycsf.html';
  153 + break;
  154 + case 'WD':
  155 + return 'wd.html';
  156 + break;
  157 + case 'DJG':
  158 + return 'djg1.html';
  159 + break;
  160 + case 'MZ':
  161 + return 'mz.html';
  162 + break;
  163 + case 'DKL':
  164 + break;
  165 + case 'FCJG':
  166 + return 'fcjg.html';
  167 + break;
  168 + case 'SFTZ_1':
  169 + return 'sftz_1.html';
  170 + break;
  171 + }
  172 + }
  173 +
  174 +
  175 + function returnDate(thisall){
  176 + var lineCode= thisall.data('linecode');
  177 + var xlDir = thisall.data('xldir');
  178 + var rqStr =thisall.data('rqstr');
  179 + var rq = thisall.data('rq');
  180 + var type = thisall.data('type');
  181 + var lineName = thisall.data('xlname');
  182 + var numType = thisall.data('numtype');
  183 + var station = thisall.data('station');
  184 + var stationName = thisall.data('stationName');
  185 + var types = thisall.data('types');
  186 + var nk = thisall.data('nk');
  187 + var regionStopid = thisall.data('regionstopid');
  188 + var ids = thisall.data('ids');
  189 + var lgtype = thisall.data('lgtype');
  190 + let selctype = $('#selc').val();
  191 + let date = {
  192 + selctype : selctype,
  193 + lineCode : lineCode,
  194 + lineName : lineName,
  195 + xlDir : xlDir,
  196 + rqStr : rqStr,
  197 + type : type,
  198 + rq : rq,
  199 + numType : numType,
  200 + station :station,
  201 + stationName:stationName,
  202 + types: types,
  203 + nk: nk,
  204 + regionStopid : regionStopid,
  205 + ids : ids,
  206 + lgtype : lgtype,
  207 + }
  208 +
  209 + return date;
  210 + }
  211 +
  212 +
  213 +
  214 +
  215 + //计时器
  216 + function snt(type,ids){
  217 + return setInterval(function(){leftTimer(type,ids);},1000); //开始倒计时
  218 + }
  219 + //定时器
  220 + function leftTimer(type,ids){
  221 + for(var i = 0;i < timelist.length; i++) {
  222 + getTimerstring(timelist[i].ele,timelist[i].time ? timelist[i].time -= 1000 : 0);
  223 + if (!timelist[i].time){
  224 + TimeChick(timelist[i].ele,type);
  225 + $("#"+timelist[i].ele).parent().remove();
  226 + if (close) close = false
  227 + timelist.splice(i--, 1);
  228 + }
  229 + }
  230 + }
  231 + //倒计时时间
  232 + function getTimerstring(ele,leftTime){
  233 + var days = checkTime(parseInt(leftTime / 1000 / 60 / 60 / 24 , 10)); //计算剩余的天数
  234 + var hours = checkTime(parseInt(leftTime / 1000 / 60 / 60 % 24 , 10)); //计算剩余的小时
  235 + var minutes = checkTime(parseInt(leftTime / 1000 / 60 % 60, 10));//计算剩余的分钟
  236 + var seconds = checkTime(parseInt(leftTime / 1000 % 60, 10));//计算剩余的秒数
  237 + $("#"+ele).html(seconds+"秒后将自动执行");
  238 + }
  239 +
  240 + //对比是哪个div需要减少时间
  241 + function chenckdiv(divs,ids){
  242 + for (let t in divs){
  243 + if (ids == divs[t].data('ids')){
  244 + return divs[t];
  245 + }
  246 + }
  247 + }
  248 +
  249 + //定时器自动提交
  250 + function TimeChick(ele,type){
  251 + debugger
  252 + var thisall= $("#"+ele).parent();
  253 + let sch = dataMap.get(thisall.data('uuid'));
  254 +
  255 + if (thisall.length == 0) return;
  256 + let date = returnDate(thisall);
  257 + if (date == null)
  258 + return
  259 + if (type == "DJG"){
  260 + $.post('/znddLogger/znddadd', date, function(res) {
  261 + if (res.code == 200){
  262 + notify_succ('新增临加班次成功(自动)');
  263 + }
  264 + if (res.code == 201){
  265 + notify_err('新增临加班次失败(自动),受影响的站点为终点站,不可自动添加');
  266 + }
  267 +
  268 + gb_schedule_table.refreshAll();
  269 + });
  270 + }
  271 + if (type == "YCSF"){
  272 + gb_common.$post('/realSchedule/revokeRealOutgo_zndd', {
  273 + id: sch.sch.id,
  274 + remarks:"_智能调度-异常实发",
  275 + }, function (rs) {
  276 + gb_schedule_table.updateSchedule(rs.ts);
  277 + notify_succ('撤销实发操作成功!');
  278 + });
  279 + }
  280 +
  281 + if (type == "SFTZ_1"){
  282 + debugger
  283 + gb_common.$post('/realSchedule/realOutAdjust_zndd', {
  284 + id: sch.sch.id,
  285 + remarks:'自动调度实发调整-车辆掉线',
  286 + fcsjActual: sch.sch.dfsj,
  287 + }, function (rs) {
  288 + gb_schedule_table.updateSchedule(rs.ts);
  289 + notify_succ('实发调整操作成功!');
  290 + });
  291 +
  292 +
  293 + }
  294 +
  295 + if (type == "WD"){
  296 + let minute = 6;
  297 + gb_common.$post_arr('/realSchedule/lateAdjust', {idx: sch.sch.id, minute: minute}, function (rs) {
  298 + console.log('误点调整rs', rs);
  299 + if(rs.ts){
  300 + gb_schedule_table.updateSchedule(rs.ts);
  301 + notify_succ('成功设置误点停靠时间');
  302 + UIkit.modal(modal).hide();
  303 + }
  304 + });
  305 + }
  306 + }
  307 + function checkTime(i){ //将0-9的数字前面加上0,例1变为01
  308 +
  309 + if(i<10)
  310 + {
  311 + i = "0" + i;
  312 + }
  313 + return i;
  314 +
  315 + }
  316 +
  317 + //定时器自动提交
  318 + function TimeChickConfig(){
  319 + var thisall= $('.multi_plat_msg_pop_zndd .multi_plat_config #submitTwo');
  320 + let date = returnDate(thisall);
  321 + date.selctype = $('#configSelect').val();
  322 +
  323 + if (date.selctype == 'X1'){
  324 + var data = {
  325 + lineCode : date.lineCode,
  326 + enableYjtk : '1' ,
  327 + yjtkStart : '00:00',
  328 + yjtkEnd : '23:59',
  329 + upStopMinute : 1,
  330 + downStopMinute : 1
  331 + };
  332 +
  333 + gb_common.$post('/lineConfig/yjtkSet', data, function (rs) {
  334 + conf = rs.conf;
  335 + //添加记录
  336 + $.post('/znddLogger/znddConfig', date, function(res) {
  337 + //只有一个 直接删除掉
  338 + if(res.status != null){
  339 + $('.multi_plat_msg_pop_zndd .multi_plat_config').remove();
  340 + notify_succ('已启用随到随发(自动)');
  341 + }else {
  342 + notify_err('随到随发启动失败!(自动)');
  343 + }
  344 + });
  345 + });
  346 + }else {
  347 + //添加记录
  348 + $.post('/znddLogger/znddConfig', date, function(res) {
  349 + //只有一个 直接删除掉
  350 + if(res.status != null){
  351 + notify_succ('班次设定成功!(自动)');
  352 + }else {
  353 + notify_err('班次设定失败!(自动)');
  354 + }
  355 + $('.multi_plat_msg_pop_zndd .multi_plat_config').remove();
  356 + if(res.ts && res.ts.length > 0){
  357 + gb_schedule_table.updateSchedule(res.ts);
  358 + var modal = '#schedule-multi-dftz-modal';
  359 + UIkit.modal(modal).hide();
  360 + notify_succ('待发调整成功');
  361 + }
  362 + });
  363 + }
  364 +
  365 +
  366 +
  367 + //取消定时器 防止二次提交
  368 + clearInterval(timeInt);
  369 + $(".timer").html("");
  370 + leftTime = 10 * 1000;
  371 + }
  372 +
  373 + return {
  374 + sop : sop,
  375 + };
  376 +
  377 +})();
0 378 \ No newline at end of file
... ...
src/main/resources/static/real_control_v2/main.html
... ... @@ -50,12 +50,20 @@
50 50 </head>
51 51  
52 52 <body>
  53 +<div id="recidress" style="display: none">
  54 + <div id="len" style="color:#ff6600;display:inline-block;">录音时长:0.00s</div>
  55 + <div id="loud" style="color:#ff6600;display:inline-block;margin-left:15px;">录音时长:0%</div>
  56 + <div style="width:120px;height:120px;padding:50px">
  57 + <div id="Microphone">
  58 + </div>
  59 + </div>
  60 +</div>
53 61 <div class="north uk-width-1-1 uk-panel-box">
54 62 <div class="uk-grid uk-grid-match">
55 63 <div class="uk-width-4-10">
56 64 <div class="uk-panel">
57 65 <h2 class="north-logo">
58   - <!--<i class="uk-icon-life-ring"></i>--> 临港公交线路调度
  66 + <!--<i class="uk-icon-life-ring"></i>--> 浦东公交线路调度
59 67 </h2>
60 68 </div>
61 69 </div>
... ... @@ -246,9 +254,83 @@
246 254 </div>
247 255 </div>
248 256 </script>
  257 +<div class="multi_plat_msg_pop_cf" ></div>
  258 +<script id="cf_plat_msg_template" type="text/html">
  259 + <div class="multi_plat_msg_pops uk-animation-slide-bottom" data-type="{{type}}" >
  260 + <div>
  261 + <span class="title">{{lineName}}的{{stationName}}({{dir == 0 ? '上行':'下行'}}
  262 + <span class="tests">当前站点人数&nbsp;&nbsp;&nbsp;{{num}}</span>
  263 + <span class="desc">催发时间:{{timeStr}}</span>
  264 + </div>
  265 + <button class="all" class="title" data-ip="{{dir}}" value="{{dir}}">拨打站台电话</button>
  266 + <button class="images" data-image="{{image}}" value="{{dir}}">查看图片</button>
  267 + </div>
  268 +</script>
  269 +<!-- #### 智能调度 start ### -->
  270 +<script id="zndd_plat_msg_template_config" type="text/html">
  271 + <div class="multi_plat_config" data-linecode="{{lineCode}}" data-station="{{station}}" data-stationname="{{stationName}}" data-numtype="{{numType}}"
  272 + data-xlname="{{lineName}}" data-type="{{type}}" data-xldir="{{xlDir}}" data-rqstr="{{rqStr}}" data-types ="{{types}}" data-regionstopid="{{lg != null?lg.regionStopid:''}}" data-lgtype ="{{lg != null?lg.lGType:''}}"
  273 + data-rq="{{rq}}" data-ids="{{ids}}" data-uuid="{{uuid}}">
  274 + <div id ={{uuid}} class="timer"></div>
  275 + <div class="msg-popup warning-color">
  276 + <div class="msg-times" style="cursor: pointer;">×</div>
  277 + <div class="centerSpace msg-title">
  278 + <div>自动调度消息-待确认</div>
  279 + <div class="msg-date-info">{{datarq}}</div>
  280 + </div>
  281 + <div class="popup-msg-content">
  282 + <i class="fa fa-info-circle" aria-hidden="true"></i>
  283 + <span>{{lineName}} {{xlDir ==0 ?'上行':'下行'}} {{clzbh}} {{fcsj}} 出现 {{types}}</span>
  284 + </div>
  285 + <div class="popup-msg-contents" style="display:{{type == 'YCSF'?'':'none'}}">
  286 + <button class="btn btn-default colsebc" data-fcsj="{{fcsj}}" data-clzbh="{{clzbh}}" data-id="{{id}}">取消实发</button>
  287 + </div>
  288 + <div class="centerSpace msg-title">
  289 + <div></div>
  290 + <div class="msg-date-info" style="display:{{type == 'SFTZ_1'?'':'none'}}" >
  291 + <button class="btn btn-default sfTzbc" data-fcsj="{{fcsj}}" data-clzbh="{{clzbh}}" data-id="{{id}}">补入发车时间</button>
  292 + </div>
  293 + </div>
  294 + </div>
  295 + </div>
  296 +
  297 +</script>
  298 +<div class="multi_plat_msg_pop_zndd">
  299 + <!--<div id="timer"></div>-->
  300 +</div>
  301 +
  302 +<script id="zndd_plat_msg_template" type="text/html">
  303 + <div class="multi_plat_msg_zndd" >
  304 + <span class="title">{{lineName}} ----</span>
  305 + <span class="title">{{datarq}} ----</span>
  306 + <span class="title">{{types}}</span>
  307 + <select id="selc" class="form-control">
  308 + <option value="X1">添加临加正常班次</option>
  309 + <option value="X2">添加临加区间班次</option>
  310 + <option value="X3">添加临加直放班次</option>
  311 + <option value="X4">添加临加放站班次</option>
  312 + </select>
  313 + <form class="form-horizontal" role="form" id="excelFile" method="post"
  314 + action="" enctype="multipart/form-data"></form>
  315 +
  316 + <button id="submit" data-linecode="{{lineCode}}" data-statione="{{station}}" data-numtype="{{numType}}"
  317 + data-xlname="{{lineName}}" data-xldir="{{xlDir}}" data-rqstr="{{rqStr}}"
  318 + data-rq="{{rq}}" data-stationname="{{stationName}}">确定执行</button>
  319 + </div>
  320 +
  321 +
  322 +</script>
  323 +
249 324  
250 325 <script src="/real_control_v2/js/safe_driv/safeDriv.js" merge="custom_js"></script>
251 326 <script src="/real_control_v2/js/con_plan/conPlan.js" merge="custom_js"></script>
  327 +<!--站点催发-->
  328 +<script src="/real_control_v2/js/stationcf/stationcf.js" merge="custom_js"></script>
  329 +<!--智能调度-->
  330 +<script src="/real_control_v2/js/zndd/data_zndd.js" merge="custom_js"></script>
  331 +<!--recorder-->
  332 +<script src="/real_control_v2/js/zndd/recorder/recorder.js"></script>
  333 +<script src="/real_control_v2/js/zndd/recorder/recorders.js"></script>
252 334 <!-- #### 安全驾驶 end ### -->
253 335  
254 336 <!-- 打电话 -->
... ...
src/main/resources/static/real_control_v2/zndd/type/sftz_1.html 0 → 100644
  1 +<div class="uk-modal ct-form-modal ct_move_modal" id="sftz-addsch-modal">
  2 + <div class="uk-modal-dialog" style="width: 850px;">
  3 + <a href="" class="uk-modal-close uk-close"></a>
  4 + <div class="uk-modal-header">
  5 + <h2>实发调整<i class="uk-icon-question-circle uk-icon-hover"></i></h2></div>
  6 + <form class="uk-form uk-form-horizontal"> </form>
  7 + </div>
  8 +
  9 + <script>
  10 + (function () {
  11 + var modal = '#sftz-addsch-modal',
  12 + sch, stationRoutes, parks, information, carsArray, st_park_data,conf;
  13 + var f = $('.uk-form-horizontal', modal);
  14 +
  15 + $(modal).on('init', function (e, data) {
  16 + e.stopPropagation();
  17 +
  18 + sch = data.data;
  19 + sch.xlBm = sch.lineCode;
  20 + //站点路由
  21 + stationRoutes = gb_common.groupBy(gb_data_basic.stationRoutes(sch.xlBm).sort(function (a, b) {
  22 + return a.stationRouteCode - b.stationRouteCode;
  23 + }), 'directions');
  24 + let route = stationRoutes[sch.xlDir];
  25 + sch.startStation = route[0];
  26 + sch.stopStation = route[route.length - 1];
  27 + var formHtml = template('sftz-form-temp', sch);
  28 + $('form', modal).html(formHtml);
  29 +
  30 + //frequent_phrases.init(modal);
  31 +
  32 +
  33 +
  34 +
  35 + f.formValidation(gb_form_validation_opts);
  36 + f.on('success.form.fv', function(e) {
  37 + debugger
  38 + e.preventDefault();
  39 + let data = $(this).serializeJSON();
  40 +
  41 + gb_common.$post('/realSchedule/realOutAdjust_zndd', {
  42 + id: sch.sch.id,
  43 + remarks:"_智能调度-实发调整",
  44 + fcsjActual:data.fcsjActual,
  45 + }, function (rs) {
  46 + gb_schedule_table.updateSchedule(rs.ts);
  47 + notify_succ('实发调整操作成功!');
  48 + //calc 应发未发
  49 + gb_schedule_table.calc_yfwf_num(sch.xlBm);
  50 +
  51 + UIkit.modal(modal).hide();
  52 + });
  53 +
  54 + /* $.post('/directive/phrase', data, function(rs) {
  55 + if (rs == 0) {
  56 + notify_succ('短语已发出');
  57 + } else
  58 + notify_err_form('发送短语消息失败', f);
  59 + });*/
  60 +
  61 + });
  62 + });
  63 +
  64 +
  65 + $(modal).on('mouseenter', '.uk-icon-question-circle', function() {
  66 +
  67 + debugger
  68 + $(this).qtip({
  69 + show: {
  70 + ready: true,
  71 + delay: 0
  72 + },
  73 + content: {
  74 + text: function() {
  75 + return template('home-icoe-img');
  76 + }
  77 + },
  78 + position: {
  79 + viewport: $(window) ,
  80 + },
  81 + style: {
  82 + classes: 'qtip-img'
  83 + },
  84 + hide: {
  85 + fixed: true,
  86 + delay: 300
  87 + },
  88 + });
  89 + });
  90 + var frequent_phrases = function () {
  91 +
  92 + var init = function (wrap) {
  93 + add(wrap);
  94 + minus(wrap);
  95 + //查询常用短语
  96 + $.get('/frequent_phrases/all', function (list) {
  97 + var t = $('textarea[name=text]', wrap).val();
  98 + var opts = '<option value="">------ 常用短语 -------</option>';
  99 + for(var i=0,obj;obj=list[i++];){
  100 + opts += '<option value="'+obj.text+'" data-id="'+obj.id+'" '+(obj.text==t?"selected":"")+'>'+obj.text+'</option>';
  101 + }
  102 + $('.common_phrase_sel', wrap).html(opts);
  103 + });
  104 + };
  105 +
  106 + var add = function (wrap) {
  107 + $('.add_frequent_phrases', wrap).unbind('click').on('click', function () {
  108 + var text = $('textarea[name=text]', wrap).val();
  109 + if(!$.trim(text))
  110 + return notify_err('请在下列文本框内输入文字');
  111 +
  112 + gb_common.$post('/frequent_phrases', {text: text}, function () {
  113 + notify_succ('添加成功!');
  114 + init(wrap);
  115 + });
  116 + });
  117 + };
  118 +
  119 + var minus = function (wrap) {
  120 + $('.minus_frequent_phrases', wrap).unbind('click').on('click', function () {
  121 + var text = $('.common_phrase_sel', wrap).val();
  122 + if(!$.trim(text))
  123 + return notify_err('请选中常用短语后再删除');
  124 +
  125 + var id = $('.common_phrase_sel', wrap).find("option:selected").data('id');
  126 + if(!id)
  127 + return notify_err('无法获取到索引');
  128 +
  129 + gb_common.$del('/frequent_phrases/' + id, function () {
  130 + notify_succ('删除成功!');
  131 + $('textarea[name=text]', wrap).val('');
  132 + init(wrap);
  133 + });
  134 + });
  135 + };
  136 +
  137 + return {
  138 + init: init
  139 + }
  140 + }();
  141 + })();
  142 + </script>
  143 +</div>
  144 +
  145 +
  146 +
  147 +<script id="sftz-form-temp" type="text/html">
  148 + <input type="hidden" name="id" value=""/>
  149 +
  150 + <div class="uk-grid">
  151 + <div class="uk-width-4-2">
  152 + <div class="uk-form-row">
  153 + <h3>实发调整信息</h3>
  154 + </div>
  155 + </div>
  156 + </div>
  157 + <div class="uk-grid">
  158 + <div class="uk-width-4-2">
  159 + <div class="uk-form-row">
  160 + <label class="uk-form-labels" >{{lineName}} {{startStation.stationName}} -> {{stopStation.stationName}}方向 的 {{clzbh}} 出现实发异常</label>
  161 + </div>
  162 + </div>
  163 + </div>
  164 + <div class="uk-grid">
  165 + <div class="uk-width-1-1">
  166 + <div class="uk-form-row">
  167 + <label class="uk-form-labels">待发时间 {{sch.fcsj}}-> 实发时间 {{sch.fcsjActual}}</label>
  168 +
  169 + </div>
  170 + </div>
  171 +
  172 + </div>
  173 + <div class="uk-grid">
  174 + <div class="uk-width-1-2">
  175 + <div class="uk-form-row">
  176 + <label class="uk-form-label">调整前:</label>
  177 + <div class="uk-form-controls">
  178 + </div>
  179 + </div>
  180 + </div>
  181 + <div class="uk-width-1-2">
  182 + <div class="uk-form-row">
  183 + <label class="uk-form-label">调整后:</label>
  184 + <div class="uk-form-controls">
  185 + </div>
  186 + </div>
  187 + </div>
  188 + </div>
  189 + <div class="uk-grid">
  190 + <div class="uk-width-1-2">
  191 + <div class="uk-form-row">
  192 + <label class="uk-form-label">线路名称</label>
  193 + <div class="uk-form-controls">
  194 + <input value="{{sch.xlName}}" disabled>
  195 + </div>
  196 + </div>
  197 + </div>
  198 + <div class="uk-width-1-2">
  199 + <div class="uk-form-row">
  200 + <label class="uk-form-label">线路名称</label>
  201 + <div class="uk-form-controls">
  202 + <input value="{{sch.xlName}}" disabled>
  203 + </div>
  204 + </div>
  205 + </div>
  206 + </div>
  207 + <div class="uk-grid">
  208 + <div class="uk-width-1-2">
  209 + <div class="uk-form-row">
  210 + <label class="uk-form-label">待发时间</label>
  211 + <div class="uk-form-controls">
  212 + <input value="{{sch.fcsj}}" disabled>
  213 + </div>
  214 + </div>
  215 + </div>
  216 + <div class="uk-width-1-2">
  217 + <div class="uk-form-row">
  218 + <label class="uk-form-label">待发时间</label>
  219 + <div class="uk-form-controls">
  220 + <input value="{{sch.fcsj}}" disabled>
  221 + </div>
  222 + </div>
  223 + </div>
  224 + </div>
  225 + <div class="uk-grid">
  226 + <div class="uk-width-1-2">
  227 + <div class="uk-form-row">
  228 + <label class="uk-form-label">实发时间</label>
  229 + <div class="uk-form-controls">
  230 + <input value="{{sch.fcsjActual}}" disabled>
  231 + </div>
  232 + </div>
  233 + </div>
  234 + <div class="uk-width-1-2">
  235 + <div class="uk-form-row">
  236 + <label class="uk-form-label">实发时间</label>
  237 + <div class="uk-form-controls">
  238 + <input type="time" value="{{sch.fcsj}}" name="fcsjActual">
  239 + </div>
  240 + </div>
  241 + </div>
  242 + </div>
  243 + <div class="uk-grid">
  244 + <div class="uk-width-1-2">
  245 + <div class="uk-form-row">
  246 + <label class="uk-form-label">车辆</label>
  247 + <div class="uk-form-controls">
  248 + <input value="{{sch.clZbh}}" disabled>
  249 + </div>
  250 + </div>
  251 + </div>
  252 + <div class="uk-width-1-2">
  253 + <div class="uk-form-row">
  254 + <label class="uk-form-label">车辆</label>
  255 + <div class="uk-form-controls">
  256 + <input value="{{sch.clZbh}}" disabled>
  257 + </div>
  258 + </div>
  259 + </div>
  260 + </div>
  261 + <div class="uk-grid">
  262 + <div class="uk-width-1-2">
  263 + <div class="uk-form-row">
  264 + <label class="uk-form-label">路牌</label>
  265 + <div class="uk-form-controls">
  266 + <input value="{{sch.lpName}}" disabled>
  267 + </div>
  268 + </div>
  269 + </div>
  270 + <div class="uk-width-1-2">
  271 + <div class="uk-form-row">
  272 + <label class="uk-form-label">路牌</label>
  273 + <div class="uk-form-controls">
  274 + <input value="{{sch.lpName}}" disabled>
  275 + </div>
  276 + </div>
  277 + </div>
  278 + </div>
  279 +
  280 +
  281 + <div class="uk-grid">
  282 + <div class="uk-width-1-2">
  283 + <div class="uk-form-row">
  284 + <label class="uk-form-label">备注</label>
  285 + <div class="uk-form-controls">
  286 + <input value="{{sch.remarks}}" disabled>
  287 + </div>
  288 + </div>
  289 + </div>
  290 + <div class="uk-width-1-2">
  291 + <div class="uk-form-row">
  292 + <label class="uk-form-label">备注</label>
  293 + <div class="uk-form-controls">
  294 + <input value="_自动调度-调整实发时间" disabled>
  295 + </div>
  296 + </div>
  297 + </div>
  298 + </div>
  299 +
  300 +
  301 + <!-- <div class="uk-grid">
  302 + <div class="uk-width-4-2">
  303 + <div class="uk-form-row">
  304 + <h3>向 {{sch.clZbh}} 发送消息短语</h3>
  305 + </div>
  306 + </div>
  307 + </div>
  308 +
  309 + <div class="uk-grid">
  310 + <div class="uk-width-1-2">
  311 + <input type="hidden" value="{{sch.clZbh}}" name="nbbm" />
  312 + <div class="uk-form-row">
  313 + <select style="width: 170px;" class="common_phrase_sel">
  314 + </select>
  315 + <div class="tools" >
  316 + <span data-uk-tooltip title="添加到常用短语" class="add_frequent_phrases">
  317 + <i class="uk-icon-plus"></i>
  318 + </span>
  319 + <span data-uk-tooltip title="删除这条常用短语" class="minus_frequent_phrases">
  320 + <i class="uk-icon-minus"></i>
  321 + </span>
  322 + </div>
  323 + </div>
  324 + </div>
  325 + <div class="uk-width-1-2">
  326 + <div class="uk-form-row">
  327 + <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>
  328 + </div>
  329 + </div>
  330 + </div>
  331 + -->
  332 + <div class="uk-grid">
  333 + <div class="uk-width-4-2">
  334 + <div class="uk-form-row">
  335 + <h3>方案优势</h3>
  336 + </div>
  337 + </div>
  338 + </div>
  339 + <div class="uk-grid">
  340 + <div class="uk-width-1-2">
  341 + <div class="uk-form-row">
  342 + <label class="uk-form-label">检测效率</label>
  343 + <div class="uk-form-controls">
  344 + <i class="icon-user"></i>
  345 + <input value="80%" disabled>
  346 + </div>
  347 + </div>
  348 + </div>
  349 + <div class="uk-width-1-2">
  350 + <div class="uk-form-row">
  351 + <label class="uk-form-label">执行准点率</label>
  352 + <div class="uk-form-controls">
  353 + <i class="icon-user"></i>
  354 + <input value="80%" disabled>
  355 + </div>
  356 + </div>
  357 + </div>
  358 + </div>
  359 + <div class="uk-grid">
  360 + <div class="uk-width-1-2">
  361 + <div class="uk-form-row">
  362 + <label class="uk-form-label">信息发布准确率</label>
  363 + <div class="uk-form-controls">
  364 + <i class="icon-user"></i>
  365 + <input value="20%" disabled>
  366 + </div>
  367 + </div>
  368 + </div>
  369 + <div class="uk-width-1-2">
  370 + <div class="uk-form-row">
  371 + <label class="uk-form-label">乘客满意度</label>
  372 + <div class="uk-form-controls">
  373 + <i class="icon-user"></i>
  374 + <input value="10%" disabled>
  375 + </div>
  376 + </div>
  377 + </div>
  378 + </div>
  379 + <div class="uk-modal-footer uk-text-right" style="margin-bottom: -20px;">
  380 + <button type="button" class="uk-button uk-modal-close">取消</button>
  381 + <button type="submit" class="uk-button uk-button-primary"><i class="uk-icon-check"></i> &nbsp;保存</button>
  382 + </div>
  383 +</script>
  384 +<style>
  385 + .uk-form-labels{
  386 + margin-top: 5px;
  387 + }
  388 + .tools{
  389 + display: inline-block;
  390 + margin-left: 5px;
  391 + }
  392 +</style>
  393 +
  394 +<script id="home-icoe-img" type="text/html">
  395 + <img src="/real_control_v2/zndd/img/sftz_0.png" style="width: 100%;height: 100%">
  396 +</script>
... ...
src/main/resources/static/real_control_v2/zndd/type/ycsf.html 0 → 100644
  1 +<div class="uk-modal ct-form-modal ct_move_modal" id="ycsf-addsch-modal">
  2 + <div class="uk-modal-dialog" style="width: 850px;">
  3 + <a href="" class="uk-modal-close uk-close"></a>
  4 + <div class="uk-modal-header">
  5 + <h2>异常实发<i class="uk-icon-question-circle uk-icon-hover"></i></h2></div>
  6 + <form class="uk-form uk-form-horizontal"> </form>
  7 + </div>
  8 +
  9 + <script>
  10 + (function () {
  11 + var modal = '#ycsf-addsch-modal',
  12 + sch, stationRoutes, parks, information, carsArray, st_park_data,conf;
  13 + var f = $('.uk-form-horizontal', modal);
  14 +
  15 + $(modal).on('init', function (e, data) {
  16 + e.stopPropagation();
  17 +
  18 + sch = data.data;
  19 + sch.xlBm = sch.lineCode;
  20 + //站点路由
  21 + stationRoutes = gb_common.groupBy(gb_data_basic.stationRoutes(sch.xlBm).sort(function (a, b) {
  22 + return a.stationRouteCode - b.stationRouteCode;
  23 + }), 'directions');
  24 + let route = stationRoutes[sch.xlDir];
  25 + sch.startStation = route[0];
  26 + sch.stopStation = route[route.length - 1];
  27 + var formHtml = template('ycsf-form-temp', sch);
  28 + $('form', modal).html(formHtml);
  29 +
  30 + f.formValidation(gb_form_validation_opts);
  31 + f.on('success.form.fv', function(e) {
  32 + debugger
  33 + e.preventDefault();
  34 + var data = $(this).serializeJSON();
  35 + debugger
  36 +
  37 + gb_common.$post('/realSchedule/revokeRealOutgo_zndd', {
  38 + id: sch.sch.id,
  39 + remarks:data.remarks,
  40 + }, function (rs) {
  41 + gb_schedule_table.updateSchedule(rs.ts);
  42 + notify_succ('撤销实发操作成功!');
  43 + //calc 应发未发
  44 + gb_schedule_table.calc_yfwf_num(sch.xlBm);
  45 + UIkit.modal(modal).hide();
  46 + });
  47 +
  48 + });
  49 + });
  50 +
  51 +
  52 + $(modal).on('mouseenter', '.uk-icon-question-circle', function() {
  53 +
  54 + debugger
  55 + $(this).qtip({
  56 + show: {
  57 + ready: true,
  58 + delay: 0
  59 + },
  60 + content: {
  61 + text: function() {
  62 + return template('home-icoe-img');
  63 + }
  64 + },
  65 + position: {
  66 + viewport: $(window) ,
  67 + },
  68 + style: {
  69 + classes: 'qtip-img'
  70 + },
  71 + hide: {
  72 + fixed: true,
  73 + delay: 300
  74 + },
  75 + });
  76 + });
  77 +
  78 + })();
  79 + </script>
  80 +</div>
  81 +
  82 +<script id="ycsf-form-temp" type="text/html">
  83 + <input type="hidden" name="id" value=""/>
  84 +
  85 + <div class="uk-grid">
  86 + <div class="uk-width-4-2">
  87 + <div class="uk-form-row">
  88 + <h3>异常实发信息</h3>
  89 + </div>
  90 + </div>
  91 + </div>
  92 + <div class="uk-grid">
  93 + <div class="uk-width-4-2">
  94 + <div class="uk-form-row">
  95 + <label class="uk-form-labels" >{{lineName}} {{startStation.stationName}} -> {{stopStation.stationName}}方向 的 {{clzbh}} 出现异常实发</label>
  96 + </div>
  97 + </div>
  98 + </div>
  99 + <div class="uk-grid">
  100 + <div class="uk-width-1-1">
  101 + <div class="uk-form-row">
  102 + <label class="uk-form-labels">待发时间 {{sch.fcsj}}-> 实发时间 {{sch.fcsjActual}}</label>
  103 +
  104 + </div>
  105 + </div>
  106 +
  107 + </div>
  108 + <div class="uk-grid">
  109 + <div class="uk-width-1-2">
  110 + <div class="uk-form-row">
  111 + <label class="uk-form-label">调整前:</label>
  112 + <div class="uk-form-controls">
  113 + </div>
  114 + </div>
  115 + </div>
  116 + <div class="uk-width-1-2">
  117 + <div class="uk-form-row">
  118 + <label class="uk-form-label">调整后:</label>
  119 + <div class="uk-form-controls">
  120 + </div>
  121 + </div>
  122 + </div>
  123 + </div>
  124 + <div class="uk-grid">
  125 + <div class="uk-width-1-2">
  126 + <div class="uk-form-row">
  127 + <label class="uk-form-label">线路名称</label>
  128 + <div class="uk-form-controls">
  129 + <input value="{{sch.xlName}}" disabled>
  130 + </div>
  131 + </div>
  132 + </div>
  133 + <div class="uk-width-1-2">
  134 + <div class="uk-form-row">
  135 + <label class="uk-form-label">线路名称</label>
  136 + <div class="uk-form-controls">
  137 + <input value="{{sch.xlName}}" disabled>
  138 + </div>
  139 + </div>
  140 + </div>
  141 + </div>
  142 + <div class="uk-grid">
  143 + <div class="uk-width-1-2">
  144 + <div class="uk-form-row">
  145 + <label class="uk-form-label">待发时间</label>
  146 + <div class="uk-form-controls">
  147 + <input value="{{sch.fcsj}}" disabled>
  148 + </div>
  149 + </div>
  150 + </div>
  151 + <div class="uk-width-1-2">
  152 + <div class="uk-form-row">
  153 + <label class="uk-form-label">待发时间</label>
  154 + <div class="uk-form-controls">
  155 + <input value="{{sch.fcsj}}" disabled>
  156 + </div>
  157 + </div>
  158 + </div>
  159 + </div>
  160 + <div class="uk-grid">
  161 + <div class="uk-width-1-2">
  162 + <div class="uk-form-row">
  163 + <label class="uk-form-label">实发时间</label>
  164 + <div class="uk-form-controls">
  165 + <input value="{{sch.fcsjActual}}" disabled>
  166 + </div>
  167 + </div>
  168 + </div>
  169 + <div class="uk-width-1-2">
  170 + <div class="uk-form-row">
  171 + <label class="uk-form-label">实发时间</label>
  172 + <div class="uk-form-controls">
  173 + <input type="time" value="" name="fcsjActual" disabled>
  174 + </div>
  175 + </div>
  176 + </div>
  177 + </div>
  178 + <div class="uk-grid">
  179 + <div class="uk-width-1-2">
  180 + <div class="uk-form-row">
  181 + <label class="uk-form-label">车辆</label>
  182 + <div class="uk-form-controls">
  183 + <input value="{{sch.clZbh}}" disabled>
  184 + </div>
  185 + </div>
  186 + </div>
  187 + <div class="uk-width-1-2">
  188 + <div class="uk-form-row">
  189 + <label class="uk-form-label">车辆</label>
  190 + <div class="uk-form-controls">
  191 + <input value="{{sch.clZbh}}" disabled>
  192 + </div>
  193 + </div>
  194 + </div>
  195 + </div>
  196 + <div class="uk-grid">
  197 + <div class="uk-width-1-2">
  198 + <div class="uk-form-row">
  199 + <label class="uk-form-label">路牌</label>
  200 + <div class="uk-form-controls">
  201 + <input value="{{sch.lpName}}" disabled>
  202 + </div>
  203 + </div>
  204 + </div>
  205 + <div class="uk-width-1-2">
  206 + <div class="uk-form-row">
  207 + <label class="uk-form-label">路牌</label>
  208 + <div class="uk-form-controls">
  209 + <input value="{{sch.lpName}}" disabled>
  210 + </div>
  211 + </div>
  212 + </div>
  213 + </div>
  214 + <div class="uk-grid">
  215 + <div class="uk-width-1-2">
  216 + <div class="uk-form-row">
  217 + <label class="uk-form-label">状态</label>
  218 + <div class="uk-form-controls">
  219 + <input value="已执行" disabled>
  220 + </div>
  221 + </div>
  222 + </div>
  223 + <div class="uk-width-1-2">
  224 + <div class="uk-form-row">
  225 + <label class="uk-form-label">状态</label>
  226 + <div class="uk-form-controls">
  227 + <input value="未执行" disabled>
  228 + </div>
  229 + </div>
  230 + </div>
  231 + </div>
  232 + <div class="uk-grid">
  233 + <div class="uk-width-1-2">
  234 + <div class="uk-form-row">
  235 + <label class="uk-form-label">备注</label>
  236 + <div class="uk-form-controls">
  237 + <input value="{{sch.remarks}}" disabled>
  238 + </div>
  239 + </div>
  240 + </div>
  241 + <div class="uk-width-1-2">
  242 + <div class="uk-form-row">
  243 + <label class="uk-form-label">备注</label>
  244 + <div class="uk-form-controls">
  245 + <input value="{{sch.remarks}}_智能调度-异常实发" disabled>
  246 + </div>
  247 + </div>
  248 + </div>
  249 + </div>
  250 +
  251 + <div class="uk-grid">
  252 + <div class="uk-width-4-2">
  253 + <div class="uk-form-row">
  254 + <h3>方案优势</h3>
  255 + </div>
  256 + </div>
  257 + </div>
  258 + <div class="uk-grid">
  259 + <div class="uk-width-1-2">
  260 + <div class="uk-form-row">
  261 + <label class="uk-form-label">检测效率</label>
  262 + <div class="uk-form-controls">
  263 + <i class="icon-user"></i>
  264 + <input value="80%" disabled>
  265 + </div>
  266 + </div>
  267 + </div>
  268 + <div class="uk-width-1-2">
  269 + <div class="uk-form-row">
  270 + <label class="uk-form-label">执行准点率</label>
  271 + <div class="uk-form-controls">
  272 + <i class="icon-user"></i>
  273 + <input value="80%" disabled>
  274 + </div>
  275 + </div>
  276 + </div>
  277 + </div>
  278 + <div class="uk-grid">
  279 + <div class="uk-width-1-2">
  280 + <div class="uk-form-row">
  281 + <label class="uk-form-label">信息发布准确率</label>
  282 + <div class="uk-form-controls">
  283 + <i class="icon-user"></i>
  284 + <input value="20%" disabled>
  285 + </div>
  286 + </div>
  287 + </div>
  288 + <div class="uk-width-1-2">
  289 + <div class="uk-form-row">
  290 + <label class="uk-form-label">乘客满意度</label>
  291 + <div class="uk-form-controls">
  292 + <i class="icon-user"></i>
  293 + <input value="10%" disabled>
  294 + </div>
  295 + </div>
  296 + </div>
  297 + </div>
  298 + <div class="uk-modal-footer uk-text-right" style="margin-bottom: -20px;">
  299 + <button type="button" class="uk-button uk-modal-close">取消</button>
  300 + <button type="submit" class="uk-button uk-button-primary"><i class="uk-icon-check"></i> &nbsp;保存</button>
  301 + </div>
  302 +</script>
  303 +<style>
  304 + .uk-form-labels{
  305 + margin-top: 5px;
  306 + }
  307 +</style>
  308 +
  309 +<script id="home-icoe-img" type="text/html">
  310 + <img src="/real_control_v2/zndd/img/ycsf_0.png" style="width: 100%;height: 100%">
  311 +</script>
... ...
src/main/resources/static/real_control_v2/zndd/zndd.html 0 → 100644
  1 +<div id="nav-zndd_config-modal" class="uk-modal">
  2 + <div class="uk-modal-dialog" style="width: 530px;">
  3 + <a href="" class="uk-modal-close uk-close"></a>
  4 + <div class="uk-modal-header">
  5 + <h2>智能调度检测</h2></div>
  6 +
  7 + <div style="margin: auto;width: 100%;display: flex;">
  8 + <div style="width: 49%;">
  9 + <ul>
  10 + <li>
  11 + <input id="s1" name="s1" value="DJG" type="checkbox" class="switch" >
  12 + <label for="s1">车辆大间隔</label>
  13 + </li>
  14 + <li>
  15 + <input id="s2" name="s1" value="YCSF" type="checkbox" class="switch">
  16 + <label for="s2">异常实发</label>
  17 + </li>
  18 + <li>
  19 + <input id="s3" name="s1" value="SFTZ" type="checkbox" class="switch">
  20 + <label for="s3">实发调整</label>
  21 + </li>
  22 + <li>
  23 + <input id="s4" name="s1" value="WD" type="checkbox" class="switch">
  24 + <label for="s4">误点</label>
  25 + </li>
  26 + </ul>
  27 + </div>
  28 + <div style="width: 49%;">
  29 + <ul>
  30 + <li>
  31 + <input id="ss1" type="checkbox" class="switch" checked>
  32 + <label for="ss1">指令重发</label>
  33 + </li>
  34 + <li>
  35 + <input id="ss2" value="FCJG" type="checkbox" class="switch">
  36 + <label for="ss2">发车间隔</label>
  37 + </li>
  38 + <li>
  39 + <input id="ss5" type="checkbox" class="switch" disabled>
  40 + <label for="ss5">大客流-未启用</label>
  41 + </li>
  42 + <li>
  43 + <input id="ss6" value="MZ" type="checkbox" class="switch" >
  44 + <label for="ss6">满载-未启用</label>
  45 + </li>
  46 + </ul>
  47 + </div>
  48 + </div>
  49 +
  50 + <div id ="hoverBox1" class="hoverBox">
  51 +
  52 + </div>
  53 +
  54 +
  55 + <div class="uk-modal-footer uk-text-right" style="margin-bottom: -20px;">
  56 + <button type="button" class="uk-button uk-modal-close">取消</button>
  57 + <button type="submit" class="uk-button uk-button-primary" id="submiton"><i class="uk-icon-check"></i> &nbsp;保存</button>
  58 + </div>
  59 + </div>
  60 + <script>
  61 + var storage = window.localStorage;
  62 + var switchmap = storage.getItem("switchmap") != null ? JSON.parse(storage.getItem("switchmap")) : null; //智能调度开关 0 关闭 1 开启
  63 +
  64 + var modal = '#nav-zndd_config-modal';
  65 +
  66 + checkboxes =$(".uk-modal-dialog input[type='checkbox']");
  67 +
  68 + checkboxes.each(function(){
  69 + $(this).click(function(){
  70 + var ischecked=$(this).prop("checked");
  71 + let type = $(this).val();
  72 + //null的情况下
  73 + if (switchmap == null){
  74 + k();
  75 + }
  76 +
  77 + for(let tm in switchmap){
  78 + if (tm == type){
  79 + if (ischecked){
  80 + switchmap[tm] = 1;
  81 + }else {
  82 + switchmap[tm] = 0;
  83 + }
  84 + }
  85 + }
  86 + });
  87 +
  88 + $(this).mouseover(function(){
  89 + debugger
  90 + let type = $(this).val();
  91 +
  92 + $("#hoverBox1").css({
  93 + 'background-image': 'url(/real_control_v2/zndd/img/'+type+'.png)',
  94 + 'position': 'absolute',
  95 + 'top': $(this).position().top,
  96 + //'left': $(this).position().left,
  97 + 'right': '550px',
  98 + 'width': "500px",
  99 + 'height': "500px",
  100 + 'display': 'block',
  101 + 'transition':'opacity .5s ease',
  102 + });
  103 + })
  104 + $(this).mouseleave(function(){
  105 + $("#hoverBox1").css({
  106 + 'display': 'none'
  107 + });
  108 + })
  109 + });
  110 +
  111 + function k (){
  112 + switchmap= {};
  113 + switchmap.DJG = 0;
  114 + switchmap.YCSF = 0;
  115 + switchmap.SFTZ = 0;
  116 + switchmap.WD = 0;
  117 + switchmap.FCJG = 0;
  118 + switchmap.MZ = 0;
  119 + }
  120 +
  121 + on_off(switchmap);
  122 + //0是关 1是开
  123 + function on_off(switchmap){
  124 + debugger
  125 + for(let i in checkboxes){
  126 + for(let tm in switchmap){
  127 + if (tm == checkboxes[i].value){
  128 + if (switchmap[tm] == 0){
  129 + checkboxes[i].checked = "";
  130 + }else {
  131 + checkboxes[i].checked = "checked";
  132 + }
  133 + }
  134 + }
  135 + }
  136 + }
  137 +
  138 + // 获取表单并提交.
  139 + $('#submiton').on('click',function() {
  140 + debugger
  141 + storage.setItem("switchmap", JSON.stringify(switchmap));
  142 + UIkit.modal(modal).hide();
  143 + notify_succ('修改成功!');
  144 + });
  145 +
  146 +
  147 +
  148 +
  149 + </script>
  150 +
  151 + <style>
  152 + @supports (-webkit-appearance: none) or (-moz-appearance: none) {
  153 + input[type=checkbox] {
  154 + --active: #275EFE;
  155 + --active-inner: #fff;
  156 + --focus: 2px rgba(39, 94, 254, .3);
  157 + --border: #BBC1E1;
  158 + --border-hover: #275EFE;
  159 + --background: #fff;
  160 + --disabled: #F6F8FF;
  161 + --disabled-inner: #E1E6F9;
  162 + -webkit-appearance: none;
  163 + -moz-appearance: none;
  164 + height: 21px;
  165 + outline: none;
  166 + display: inline-block;
  167 + vertical-align: top;
  168 + position: relative;
  169 + margin: 0;
  170 + cursor: pointer;
  171 + border: 1px solid var(--bc, var(--border));
  172 + background: var(--b, var(--background));
  173 + transition: background 0.3s, border-color 0.3s, box-shadow 0.2s;
  174 + }
  175 + input[type=checkbox]:after {
  176 + content: "";
  177 + display: block;
  178 + left: 0;
  179 + top: 0;
  180 + position: absolute;
  181 + transition: transform var(--d-t, 0.3s) var(--d-t-e, ease), opacity var(--d-o, 0.2s);
  182 + }
  183 + input[type=checkbox]:checked {
  184 + --b: var(--active);
  185 + --bc: var(--active);
  186 + --d-o: .3s;
  187 + --d-t: .6s;
  188 + --d-t-e: cubic-bezier(.2, .85, .32, 1.2);
  189 + }
  190 + input[type=checkbox]:disabled {
  191 + --b: var(--disabled);
  192 + cursor: not-allowed;
  193 + opacity: 0.9;
  194 + }
  195 + input[type=checkbox]:disabled:checked {
  196 + --b: var(--disabled-inner);
  197 + --bc: var(--border);
  198 + }
  199 + input[type=checkbox]:disabled + label {
  200 + cursor: not-allowed;
  201 + }
  202 + input[type=checkbox]:hover:not(:checked):not(:disabled) {
  203 + --bc: var(--border-hover);
  204 + }
  205 + input[type=checkbox]:focus {
  206 + box-shadow: 0 0 0 var(--focus);
  207 + }
  208 +
  209 + input[type=checkbox] + label {
  210 + font-size: 14px;
  211 + line-height: 21px;
  212 + display: inline-block;
  213 + vertical-align: top;
  214 + cursor: pointer;
  215 + margin-left: 4px;
  216 + }
  217 +
  218 +
  219 + input[type=checkbox].switch {
  220 + width: 38px;
  221 + border-radius: 11px;
  222 + }
  223 + input[type=checkbox].switch:after {
  224 + left: 2px;
  225 + top: 2px;
  226 + border-radius: 50%;
  227 + width: 15px;
  228 + height: 15px;
  229 + background: var(--ab, var(--border));
  230 + transform: translateX(var(--x, 0));
  231 + }
  232 + input[type=checkbox].switch:checked {
  233 + --ab: var(--active-inner);
  234 + --x: 17px;
  235 + }
  236 + input[type=checkbox].switch:disabled:not(:checked):after {
  237 + opacity: 0.6;
  238 + }
  239 +
  240 + }
  241 + .uk-modal-dialog ul {
  242 + margin: 12px;
  243 + padding: 0;
  244 + list-style: none;
  245 + width: 100%;
  246 + max-width: 320px;
  247 + }
  248 + .uk-modal-dialog ul li {
  249 + margin: 16px 0;
  250 + position: relative;
  251 + }
  252 + @media (max-width: 800px) {
  253 + body {
  254 + flex-direction: column;
  255 + }
  256 + }
  257 + .hoverBox{
  258 + display: none; /* 初始状态隐藏 */
  259 + }
  260 + </style>
  261 +</div>
... ...