提交 | 用户 | 时间
|
8069b5
|
1 |
package com.jcdm.main.plcserver.init; |
H |
2 |
|
|
3 |
|
|
4 |
import com.jcdm.main.da.collectionParamConf.service.IDaCollectionParamConfService; |
|
5 |
import com.jcdm.main.da.paramCollection.service.IDaParamCollectionService; |
|
6 |
import com.jcdm.main.da.passingStationCollection.service.impl.DaPassingStationCollectionServiceImpl; |
|
7 |
import com.jcdm.main.da.tileMatchRules.service.IDaTileMatchRulesService; |
|
8 |
import com.jcdm.main.plcserver.callback.InitCallback; |
|
9 |
import com.kangaroohy.milo.service.MiloService; |
|
10 |
import org.springframework.beans.factory.annotation.Autowired; |
|
11 |
import org.springframework.boot.ApplicationArguments; |
|
12 |
import org.springframework.boot.ApplicationRunner; |
|
13 |
import org.springframework.stereotype.Component; |
|
14 |
|
|
15 |
import javax.annotation.Resource; |
|
16 |
import java.util.ArrayList; |
|
17 |
import java.util.List; |
|
18 |
|
|
19 |
@Component |
|
20 |
public class CustomRunner implements ApplicationRunner { |
|
21 |
|
|
22 |
@Autowired |
|
23 |
public MiloService miloService; |
|
24 |
|
|
25 |
@Autowired |
|
26 |
public IDaCollectionParamConfService collectionParamConfService; |
|
27 |
|
|
28 |
@Autowired |
|
29 |
public IDaParamCollectionService daParamCollectionService; |
|
30 |
|
|
31 |
@Resource |
|
32 |
private DaPassingStationCollectionServiceImpl passingStationCollectionServiceImpl; |
|
33 |
|
|
34 |
|
|
35 |
@Resource |
|
36 |
private IDaTileMatchRulesService daTileMatchRulesService; |
|
37 |
|
|
38 |
@Override |
|
39 |
public void run(ApplicationArguments args) throws Exception { |
|
40 |
|
|
41 |
InitCallback InitCallback = new InitCallback(miloService, |
|
42 |
collectionParamConfService, |
|
43 |
daParamCollectionService, |
|
44 |
passingStationCollectionServiceImpl, |
|
45 |
daTileMatchRulesService); |
|
46 |
|
|
47 |
List<String> lists = getList(); |
a4362d
|
48 |
System.out.println("订阅内容:"+lists); |
8069b5
|
49 |
miloService.subscriptionFromOpcUa(lists,InitCallback); |
H |
50 |
|
|
51 |
} |
|
52 |
|
|
53 |
public List<String> getList(){ |
|
54 |
List<String> lists = new ArrayList<>(); |
|
55 |
lists.add("CFL4CVT.BCOP010.RecordData");//请求保存 |
|
56 |
lists.add("CFL4CVT.BCOP040.RecordData");//请求保存 |
|
57 |
lists.add("CFL4CVT.BCOP060.RecordData");//请求保存 |
|
58 |
lists.add("CFL4CVT.BCOP100.RecordData");//请求保存 |
|
59 |
lists.add("CFL4CVT.BP020.RecordData");//请求保存 |
a4362d
|
60 |
lists.add("CFL4CVT.OP220.RecordData");//请求保存 |
H |
61 |
lists.add("CFL4CVT.BCOP010.MesRecordDataDone");//请求保存 |
|
62 |
lists.add("CFL4CVT.BCOP040.MesRecordDataDone");//请求保存 |
|
63 |
lists.add("CFL4CVT.BCOP060.MesRecordDataDone");//请求保存 |
|
64 |
lists.add("CFL4CVT.BCOP100.MesRecordDataDone");//请求保存 |
|
65 |
lists.add("CFL4CVT.BP020.MesRecordDataDone");//请求保存 |
|
66 |
lists.add("CFL4CVT.OP220.MesRecordDataDone");//请求保存 |
8069b5
|
67 |
return lists; |
H |
68 |
} |
|
69 |
} |
|
70 |
|