StartCommand.java
1.04 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
package com.bsth;
import com.bsth.server_rs.thread.RfidCardInfoPersistenceThread;
import com.bsth.service.Line2SystemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;
import java.util.concurrent.ScheduledExecutorService;
/**
* 随应用启动运行
* @author PanZhao
*
*/
@Component
public class StartCommand implements CommandLineRunner{
@Autowired
Line2SystemService line2SystemService;
@Autowired
RfidCardInfoPersistenceThread rfidCardInfoPersistenceThread;
@Override
public void run(String... arg0){
try {
//将增量的线路load到对照清单
line2SystemService.loadByLineInfo();
ScheduledExecutorService sexec = Application.mainServices;
//定时将人车卡数据入库
//sexec.scheduleWithFixedDelay(rfidCardInfoPersistenceThread, 120, 60 * 5, TimeUnit.SECONDS);
//OldWSClient.returnCCInfo();
//OldWSClient.getCurrentDayPlan();
} catch (Exception e) {
e.printStackTrace();
}
}
}