XDApplication.java 22.1 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469
<<<<<<< HEAD
package com.bsth;

import com.bsth.data.BasicData;
import com.bsth.data.LineVersionsData;
import com.bsth.data.ThreadMonotor;
import com.bsth.data.car_out_info.UpdateDBThread;
import com.bsth.data.directive.DirectivesPstThread;
import com.bsth.data.forecast.SampleTimeDataLoader;
import com.bsth.data.gpsdata_v2.thread.GpsDataLoaderThread;
import com.bsth.data.gpsdata_v2.thread.OfflineMonitorThread;
import com.bsth.data.msg_queue.DirectivePushQueue;
import com.bsth.data.msg_queue.WebSocketPushQueue;
import com.bsth.data.safe_driv.SafeDrivDataLoadThread;
import com.bsth.data.schedule.DayOfSchedule;
import com.bsth.data.schedule.auto_exec.AutoExecScanThread;
import com.bsth.data.schedule.e_state_check.thread.FixedCheckStationCodeThread;
import com.bsth.data.schedule.edit_logs.SeiPstThread;
import com.bsth.data.schedule.late_adjust.ScheduleLateThread;
import com.bsth.data.schedule.signal.SchSiginUpdateDBThread;
import com.bsth.data.schedule.thread.CalcOilThread;
import com.bsth.data.schedule.thread.SchedulePstThread;
import com.bsth.data.schedule.thread.ScheduleRefreshThread;
import com.bsth.data.schedule.thread.SubmitToTrafficManage;
import com.bsth.util.DateUtils;
import com.bsth.util.Tools;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;

/**
 * 线调大部分服务都在这里启动
 * Created by panzhao on 2017/5/14.
 */
@Component
public class XDApplication implements CommandLineRunner {

    Logger log = LoggerFactory.getLogger(this.getClass());

    @Autowired
    BasicData.BasicDataLoader basicDataLoader;
    @Autowired
    UpdateDBThread fcxxUpdateThread;
    @Autowired
    ScheduleRefreshThread scheduleRefreshThread;
    @Autowired
    SchedulePstThread schedulePstThread;
    @Autowired
    ScheduleLateThread scheduleLateThread;
    @Autowired
    SubmitToTrafficManage submitToTrafficManage;
    @Autowired
    CalcOilThread calcOilThread;
    @Autowired
    DirectivesPstThread directivesPstThread;
    @Autowired
    ThreadMonotor threadMonotor;
    @Autowired
    SeiPstThread seiPstThread;
    @Autowired
    SampleTimeDataLoader sampleTimeDataLoader;
    @Autowired
    SchSiginUpdateDBThread schSiginUpdateDBThread;
    @Autowired
    AutoExecScanThread autoExecScanThread;

    @Autowired
    GpsDataLoaderThread gpsDataLoader;

    @Autowired
    OfflineMonitorThread offlineMonitorThread;

    @Autowired
    LineVersionsData lineVersionsData;

    /*@Autowired
    FixedEnableVerionsThread fixedEnableVerionsThread;*/

    @Autowired
    SafeDrivDataLoadThread safeDrivDataLoadThread;

    @Autowired
    FixedCheckStationCodeThread fixedCheckStationCodeThread;

    private static long timeDiff;
    private static long timeDiffTraffic;

    static {
        // 早上2:20
        timeDiff = (DateUtils.getTimestamp() + 1000 * 60 * 140) - System.currentTimeMillis();
        if (timeDiff < 0)
            timeDiff += (1000 * 60 * 60 * 24);
        // 早上07:00
        timeDiffTraffic = (DateUtils.getTimestamp() + 1000 * 60 * 60 * 7) - System.currentTimeMillis();
        if (timeDiffTraffic < 0)
            timeDiffTraffic += (1000 * 60 * 60 * 24);
    }

    @Override
    public void run(String... strings) throws Exception {
        try {
            Tools tools = new Tools("application.properties");
            String environment = tools.getValue("spring.profiles.active");
            //预先加载基础的对照数据
            basicDataLoader.loadAllData();
            switch (environment){
                case "dev":
                    devInit();
                    break;
                case "prod":
                    prodInit();
                    break;
            }
        }catch (Exception e){
            log.error("线调后台启动出现异常!!", e);
            System.exit(1);
        }
    }

    @Autowired
    DayOfSchedule dayOfSchedule;
    public void devInit(){
        log.info("devInit...");
        ScheduledExecutorService sexec = Application.mainServices;
        //抓取GPS数据
        GpsDataLoaderThread.setFlag(-1);
        //dayOfSchedule.dataRecovery();
        //sexec.scheduleWithFixedDelay(gpsDataLoader, 60, 4, TimeUnit.SECONDS);
        //实际排班更新线程
        //sexec.scheduleWithFixedDelay(scheduleRefreshThread, 15, 240, TimeUnit.SECONDS);
        //sexec.scheduleWithFixedDelay(scheduleLateThread, 140, 30, TimeUnit.SECONDS);//检查班次误点
        //sexec.scheduleWithFixedDelay(autoExecScanThread, 100, 50, TimeUnit.SECONDS);//班次自动执行
        //WebSocketPushQueue.start();//消息队列 -webSocket ,推送至线调web页面的

        //sexec.scheduleWithFixedDelay(fixedCheckStationCodeThread, 50, 60 * 5, TimeUnit.SECONDS);//检查班次站点编码
        //实际排班延迟入库线程
        //sexec.scheduleWithFixedDelay(schedulePstThread, 60, 15, TimeUnit.SECONDS);
        //班次修正日志延迟入库
        //sexec.scheduleWithFixedDelay(seiPstThread, 60, 30, TimeUnit.SECONDS);
        //调度指令延迟入库
        //sexec.scheduleWithFixedDelay(directivesPstThread, 180, 180, TimeUnit.SECONDS);
        //线程监听(防止重要的线程阻塞、异常结束。以及部分主备切换工作)
        //sexec.scheduleWithFixedDelay(threadMonotor, 240, 60, TimeUnit.SECONDS);

        //安全驾驶
        //sexec.scheduleWithFixedDelay(safeDrivDataLoadThread, 40, 30, TimeUnit.SECONDS);

        //sexec.scheduleWithFixedDelay(fixedEnableVerionsThread, 20, 60 * 2 , TimeUnit.SECONDS);
    }

    public void prodInit(){
        log.info("prodInit...");
        ScheduledExecutorService sexec = Application.mainServices;
        //安全驾驶
        //sexec.scheduleWithFixedDelay(safeDrivDataLoadThread, 180, 10, TimeUnit.SECONDS);

        /** 线调业务 */
        sexec.scheduleWithFixedDelay(scheduleRefreshThread, 10, 120, TimeUnit.SECONDS);//班次更新线程
        sexec.scheduleWithFixedDelay(scheduleLateThread, 140, 20, TimeUnit.SECONDS);//检查班次误点
        GpsDataLoaderThread.setFlag(-1);
        sexec.scheduleWithFixedDelay(gpsDataLoader, 100, 2, TimeUnit.SECONDS);//抓取GPS数据
        sexec.scheduleWithFixedDelay(fixedCheckStationCodeThread, 60, 60 * 5, TimeUnit.SECONDS);//检查班次站点编码

        sexec.scheduleWithFixedDelay(offlineMonitorThread, 120, 60, TimeUnit.SECONDS);//GPS设备掉离线
        sexec.scheduleWithFixedDelay(schedulePstThread, 180, 10, TimeUnit.SECONDS);//班次延迟入库线程
        sexec.scheduleWithFixedDelay(seiPstThread, 180, 60, TimeUnit.SECONDS);//班次修正日志入库
        sexec.scheduleWithFixedDelay(directivesPstThread, 120, 60, TimeUnit.SECONDS);//调度指令延迟入库
        //sexec.scheduleWithFixedDelay(threadMonotor, 240, 60, TimeUnit.SECONDS);//线程监听(防止重要的线程阻塞、异常结束。以及部分主备切换工作)
        sexec.scheduleWithFixedDelay(sampleTimeDataLoader, 140, 120 * 60, TimeUnit.SECONDS);//到离站预测需要的站点间耗时数据
        sexec.scheduleWithFixedDelay(basicDataLoader, 1, 1, TimeUnit.HOURS);//基础数据更新
        sexec.scheduleWithFixedDelay(autoExecScanThread, 180, 50, TimeUnit.SECONDS);//班次自动执行
        DirectivePushQueue.start();//消息队列 -指令,系统下发的
        WebSocketPushQueue.start();//消息队列 -webSocket ,推送至线调web页面的

        /** 线调为其他程序提供的数据 --写入数据库 */
        sexec.scheduleWithFixedDelay(fcxxUpdateThread, 160, 30, TimeUnit.SECONDS);//发车信息(发车屏、信息发布)
        //线路首末班数据(网关用,班次更新时写入)
        //com.bsth.data.schedule.f_a_l.FirstAndLastHandler
        sexec.scheduleWithFixedDelay(schSiginUpdateDBThread, 160, 60 * 30, TimeUnit.SECONDS);//无法自动完成的班次信息(网关用,补信号)

        //运管处静态数据提交
        //log.info(timeDiff / 1000 / 60 + "分钟之后提交到运管处");
        //sexec.scheduleAtFixedRate(submitToTrafficManage, timeDiffTraffic / 1000, 60 * 60 * 24, TimeUnit.SECONDS);
        //计算油、公里加注
        sexec.scheduleAtFixedRate(calcOilThread, timeDiff / 1000, 60 * 60 * 24, TimeUnit.SECONDS);

        //线路版本更新
        sexec.scheduleWithFixedDelay(lineVersionsData, 60 * 5, 60 * 15, TimeUnit.SECONDS);

        //线路版本更新
        //sexec.scheduleWithFixedDelay(fixedEnableVerionsThread, 60 * 4, 60 * 2 , TimeUnit.SECONDS);
    }
}
=======
package com.bsth;

import com.bsth.data.BasicData;
import com.bsth.data.LineVersionsData;
import com.bsth.data.ThreadMonotor;
import com.bsth.data.car_out_info.UpdateDBThread;
import com.bsth.data.directive.DirectivesPstThread;
import com.bsth.data.forecast.SampleTimeDataLoader;
import com.bsth.data.gpsdata_v2.thread.GpsDataLoaderThread;
import com.bsth.data.gpsdata_v2.thread.OfflineMonitorThread;
import com.bsth.data.gpsdata_v2.thread.RfidDataLoaderThread;
import com.bsth.data.msg_queue.DirectivePushQueue;
import com.bsth.data.msg_queue.WebSocketPushQueue;
import com.bsth.data.safe_driv.SafeDrivDataLoadThread;
import com.bsth.data.schedule.DayOfSchedule;
import com.bsth.data.schedule.auto_exec.AutoExecScanThread;
import com.bsth.data.schedule.e_state_check.thread.FixedCheckStationCodeThread;
import com.bsth.data.schedule.edit_logs.SeiPstThread;
import com.bsth.data.schedule.late_adjust.ScheduleLateThread;
import com.bsth.data.schedule.signal.SchSiginUpdateDBThread;
import com.bsth.data.schedule.thread.CalcOilThread;
import com.bsth.data.schedule.thread.SchedulePstThread;
import com.bsth.data.schedule.thread.ScheduleRefreshThread;
import com.bsth.data.schedule.thread.SubmitToTrafficManage;
import com.bsth.util.DateUtils;
import com.bsth.util.Tools;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;

/**
 * 线调大部分服务都在这里启动
 * Created by panzhao on 2017/5/14.
 */
@Component
public class XDApplication implements CommandLineRunner {

    Logger log = LoggerFactory.getLogger(this.getClass());

    @Autowired
    BasicData.BasicDataLoader basicDataLoader;
    @Autowired
    UpdateDBThread fcxxUpdateThread;
    @Autowired
    ScheduleRefreshThread scheduleRefreshThread;
    @Autowired
    SchedulePstThread schedulePstThread;
    @Autowired
    ScheduleLateThread scheduleLateThread;
    @Autowired
    SubmitToTrafficManage submitToTrafficManage;
    @Autowired
    CalcOilThread calcOilThread;
    @Autowired
    DirectivesPstThread directivesPstThread;
    @Autowired
    ThreadMonotor threadMonotor;
    @Autowired
    SeiPstThread seiPstThread;
    @Autowired
    SampleTimeDataLoader sampleTimeDataLoader;
    @Autowired
    SchSiginUpdateDBThread schSiginUpdateDBThread;
    @Autowired
    AutoExecScanThread autoExecScanThread;

    @Autowired
    GpsDataLoaderThread gpsDataLoader;
    @Autowired
    RfidDataLoaderThread rfidDataLoader;

    @Autowired
    OfflineMonitorThread offlineMonitorThread;

    @Autowired
    LineVersionsData lineVersionsData;

    /*@Autowired
    FixedEnableVerionsThread fixedEnableVerionsThread;*/

    @Autowired
    SafeDrivDataLoadThread safeDrivDataLoadThread;

    @Autowired
    FixedCheckStationCodeThread fixedCheckStationCodeThread;

    private static long timeDiff;
    private static long timeDiffTraffic;

    static {
        // 早上2:20
        timeDiff = (DateUtils.getTimestamp() + 1000 * 60 * 140) - System.currentTimeMillis();
        if (timeDiff < 0)
            timeDiff += (1000 * 60 * 60 * 24);
        // 早上07:00
        timeDiffTraffic = (DateUtils.getTimestamp() + 1000 * 60 * 60 * 7) - System.currentTimeMillis();
        if (timeDiffTraffic < 0)
            timeDiffTraffic += (1000 * 60 * 60 * 24);
    }

    @Override
    public void run(String... strings) throws Exception {
        try {
            Tools tools = new Tools("application.properties");
            String environment = tools.getValue("spring.profiles.active");
            //预先加载基础的对照数据
            basicDataLoader.loadAllData();
            switch (environment){
                case "dev":
                    devInit();
                    break;
                case "prod":
                    prodInit();
                    break;
                case "test":
                    testInit();
                    break;
                default:
                    break;
            }
        }catch (Exception e){
            log.error("线调后台启动出现异常!!", e);
            System.exit(1);
        }
    }

    @Autowired
    DayOfSchedule dayOfSchedule;
    public void devInit(){
        log.info("devInit...");
        ScheduledExecutorService sexec = Application.mainServices;
        //抓取GPS数据
        gpsDataLoader.setFlag(-1);
        //dayOfSchedule.dataRecovery();

        //安全驾驶
        sexec.scheduleWithFixedDelay(safeDrivDataLoadThread, 180, 10, TimeUnit.SECONDS);

        /** 线调业务 */
        sexec.scheduleWithFixedDelay(scheduleRefreshThread, 10, 120, TimeUnit.SECONDS);//班次更新线程
        sexec.scheduleWithFixedDelay(scheduleLateThread, 140, 20, TimeUnit.SECONDS);//检查班次误点
        sexec.scheduleWithFixedDelay(gpsDataLoader, 100, 2, TimeUnit.SECONDS);//抓取GPS数据
        //sexec.scheduleWithFixedDelay(rfidDataLoader, 5, 5, TimeUnit.SECONDS);//抓取RFID数据
        sexec.scheduleWithFixedDelay(fixedCheckStationCodeThread, 60, 60 * 5, TimeUnit.SECONDS);//检查班次站点编码

        sexec.scheduleWithFixedDelay(offlineMonitorThread, 120, 60, TimeUnit.SECONDS);//GPS设备掉离线
        sexec.scheduleWithFixedDelay(schedulePstThread, 180, 10, TimeUnit.SECONDS);//班次延迟入库线程
        sexec.scheduleWithFixedDelay(seiPstThread, 180, 60, TimeUnit.SECONDS);//班次修正日志入库
        sexec.scheduleWithFixedDelay(directivesPstThread, 120, 60, TimeUnit.SECONDS);//调度指令延迟入库
        sexec.scheduleWithFixedDelay(threadMonotor, 240, 60, TimeUnit.SECONDS);//线程监听(防止重要的线程阻塞、异常结束。以及部分主备切换工作)
        sexec.scheduleWithFixedDelay(sampleTimeDataLoader, 140, 120 * 60, TimeUnit.SECONDS);//到离站预测需要的站点间耗时数据
        sexec.scheduleWithFixedDelay(basicDataLoader, 1, 1, TimeUnit.HOURS);//基础数据更新
        sexec.scheduleWithFixedDelay(autoExecScanThread, 180, 50, TimeUnit.SECONDS);//班次自动执行
        //DirectivePushQueue.start();//消息队列 -指令,系统下发的
        WebSocketPushQueue.start();//消息队列 -webSocket ,推送至线调web页面的

        /** 线调为其他程序提供的数据 --写入数据库 */
        sexec.scheduleWithFixedDelay(fcxxUpdateThread, 160, 30, TimeUnit.SECONDS);//发车信息(发车屏、信息发布)
        //线路首末班数据(网关用,班次更新时写入)
        //com.bsth.data.schedule.f_a_l.FirstAndLastHandler
        sexec.scheduleWithFixedDelay(schSiginUpdateDBThread, 160, 60 * 30, TimeUnit.SECONDS);//无法自动完成的班次信息(网关用,补信号)

        //运管处静态数据提交
        //log.info(timeDiff / 1000 / 60 + "分钟之后提交到运管处");
        //sexec.scheduleAtFixedRate(submitToTrafficManage, timeDiffTraffic / 1000, 60 * 60 * 24, TimeUnit.SECONDS);
        //计算油、公里加注
        sexec.scheduleAtFixedRate(calcOilThread, timeDiff / 1000, 60 * 60 * 24, TimeUnit.SECONDS);

        //线路版本更新
        sexec.scheduleWithFixedDelay(lineVersionsData, 60 * 5, 60 * 15, TimeUnit.SECONDS);

        //线路版本更新
        //sexec.scheduleWithFixedDelay(fixedEnableVerionsThread, 60 * 4, 60 * 2 , TimeUnit.SECONDS);
    }

    public void prodInit(){
        log.info("prodInit...");
        ScheduledExecutorService sexec = Application.mainServices;
        //安全驾驶
        sexec.scheduleWithFixedDelay(safeDrivDataLoadThread, 180, 10, TimeUnit.SECONDS);

        GpsDataLoaderThread.setFlag(-1);
        /** 线调业务 */
        sexec.scheduleWithFixedDelay(scheduleRefreshThread, 10, 120, TimeUnit.SECONDS);//班次更新线程
        sexec.scheduleWithFixedDelay(scheduleLateThread, 140, 20, TimeUnit.SECONDS);//检查班次误点
        sexec.scheduleWithFixedDelay(gpsDataLoader, 0, 2, TimeUnit.SECONDS);//抓取GPS数据
        //sexec.scheduleWithFixedDelay(rfidDataLoader, 5, 5, TimeUnit.SECONDS);//抓取RFID数据
        sexec.scheduleWithFixedDelay(fixedCheckStationCodeThread, 60, 60 * 5, TimeUnit.SECONDS);//检查班次站点编码

        sexec.scheduleWithFixedDelay(offlineMonitorThread, 120, 60, TimeUnit.SECONDS);//GPS设备掉离线
        sexec.scheduleWithFixedDelay(schedulePstThread, 180, 10, TimeUnit.SECONDS);//班次延迟入库线程
        sexec.scheduleWithFixedDelay(seiPstThread, 180, 60, TimeUnit.SECONDS);//班次修正日志入库
        sexec.scheduleWithFixedDelay(directivesPstThread, 120, 60, TimeUnit.SECONDS);//调度指令延迟入库
        sexec.scheduleWithFixedDelay(threadMonotor, 240, 60, TimeUnit.SECONDS);//线程监听(防止重要的线程阻塞、异常结束。以及部分主备切换工作)
        sexec.scheduleWithFixedDelay(sampleTimeDataLoader, 140, 120 * 60, TimeUnit.SECONDS);//到离站预测需要的站点间耗时数据
        sexec.scheduleWithFixedDelay(basicDataLoader, 1, 1, TimeUnit.HOURS);//基础数据更新
        sexec.scheduleWithFixedDelay(autoExecScanThread, 180, 50, TimeUnit.SECONDS);//班次自动执行
        DirectivePushQueue.start();//消息队列 -指令,系统下发的
        WebSocketPushQueue.start();//消息队列 -webSocket ,推送至线调web页面的

        /** 线调为其他程序提供的数据 --写入数据库 */
        sexec.scheduleWithFixedDelay(fcxxUpdateThread, 160, 30, TimeUnit.SECONDS);//发车信息(发车屏、信息发布)
        //线路首末班数据(网关用,班次更新时写入)
        //com.bsth.data.schedule.f_a_l.FirstAndLastHandler
        sexec.scheduleWithFixedDelay(schSiginUpdateDBThread, 160, 60 * 30, TimeUnit.SECONDS);//无法自动完成的班次信息(网关用,补信号)

        //运管处静态数据提交
        log.info(timeDiff / 1000 / 60 + "分钟之后提交到运管处");
        sexec.scheduleAtFixedRate(submitToTrafficManage, timeDiffTraffic / 1000, 60 * 60 * 24, TimeUnit.SECONDS);
        //计算油、公里加注
        sexec.scheduleAtFixedRate(calcOilThread, timeDiff / 1000, 60 * 60 * 24, TimeUnit.SECONDS);

        //线路版本更新
        sexec.scheduleWithFixedDelay(lineVersionsData, 60 * 5, 60 * 15, TimeUnit.SECONDS);

        //线路版本更新
        //sexec.scheduleWithFixedDelay(fixedEnableVerionsThread, 60 * 4, 60 * 2 , TimeUnit.SECONDS);
    }

    public void testInit(){
        log.info("testInit...");
        ScheduledExecutorService sexec = Application.mainServices;
        //安全驾驶
        sexec.scheduleWithFixedDelay(safeDrivDataLoadThread, 180, 10, TimeUnit.SECONDS);

        GpsDataLoaderThread.setFlag(-1);
        //dayOfSchedule.dataRecovery();
        /** 线调业务 */
        sexec.scheduleWithFixedDelay(scheduleRefreshThread, 10, 120, TimeUnit.SECONDS);//班次更新线程
        sexec.scheduleWithFixedDelay(scheduleLateThread, 140, 20, TimeUnit.SECONDS);//检查班次误点
        sexec.scheduleWithFixedDelay(gpsDataLoader, 0, 2, TimeUnit.SECONDS);//抓取GPS数据
        //sexec.scheduleWithFixedDelay(rfidDataLoader, 5, 5, TimeUnit.SECONDS);//抓取RFID数据
        sexec.scheduleWithFixedDelay(fixedCheckStationCodeThread, 60, 60 * 5, TimeUnit.SECONDS);//检查班次站点编码

        sexec.scheduleWithFixedDelay(offlineMonitorThread, 120, 60, TimeUnit.SECONDS);//GPS设备掉离线
        sexec.scheduleWithFixedDelay(schedulePstThread, 180, 10, TimeUnit.SECONDS);//班次延迟入库线程
        sexec.scheduleWithFixedDelay(seiPstThread, 180, 60, TimeUnit.SECONDS);//班次修正日志入库
        sexec.scheduleWithFixedDelay(directivesPstThread, 120, 60, TimeUnit.SECONDS);//调度指令延迟入库
        sexec.scheduleWithFixedDelay(threadMonotor, 240, 60, TimeUnit.SECONDS);//线程监听(防止重要的线程阻塞、异常结束。以及部分主备切换工作)
        sexec.scheduleWithFixedDelay(sampleTimeDataLoader, 140, 120 * 60, TimeUnit.SECONDS);//到离站预测需要的站点间耗时数据
        sexec.scheduleWithFixedDelay(basicDataLoader, 1, 1, TimeUnit.HOURS);//基础数据更新
        sexec.scheduleWithFixedDelay(autoExecScanThread, 180, 50, TimeUnit.SECONDS);//班次自动执行
        //DirectivePushQueue.start();//消息队列 -指令,系统下发的
        WebSocketPushQueue.start();//消息队列 -webSocket ,推送至线调web页面的

        /** 线调为其他程序提供的数据 --写入数据库 */
        sexec.scheduleWithFixedDelay(fcxxUpdateThread, 160, 30, TimeUnit.SECONDS);//发车信息(发车屏、信息发布)
        //线路首末班数据(网关用,班次更新时写入)
        //com.bsth.data.schedule.f_a_l.FirstAndLastHandler
        sexec.scheduleWithFixedDelay(schSiginUpdateDBThread, 160, 60 * 30, TimeUnit.SECONDS);//无法自动完成的班次信息(网关用,补信号)

        //运管处静态数据提交
        //log.info(timeDiff / 1000 / 60 + "分钟之后提交到运管处");
        //sexec.scheduleAtFixedRate(submitToTrafficManage, timeDiffTraffic / 1000, 60 * 60 * 24, TimeUnit.SECONDS);
        //计算油、公里加注
        sexec.scheduleAtFixedRate(calcOilThread, timeDiff / 1000, 60 * 60 * 24, TimeUnit.SECONDS);

        //线路版本更新
        sexec.scheduleWithFixedDelay(lineVersionsData, 60 * 5, 60 * 15, TimeUnit.SECONDS);

        //线路版本更新
        //sexec.scheduleWithFixedDelay(fixedEnableVerionsThread, 60 * 4, 60 * 2 , TimeUnit.SECONDS);
    }
}
>>>>>>> 6cafe1acab4252c1fd171e0669654f317bf0fd4a