hdy
昨天 1c50cb5546715fa21496fbdf2bdacb7ae8836b8a
提交 | 用户 | 时间
1e2ff5 1 package com.billion.main.plcServer;
H 2
a2cd0f 3 import com.billion.main.bs.service.IBsBomChildInfoService;
H 4 import com.billion.main.constant.Constants;
bf5dcc 5 import com.billion.main.da.service.IDaCollectionParamConfService;
H 6 import com.billion.main.da.service.IDaMaterialCollectionService;
1e2ff5 7 import com.billion.main.da.service.IDaParamCollectionService;
a2cd0f 8 import com.billion.main.da.service.IDaStationCollectionService;
H 9 import com.billion.main.om.service.IOmOrderSchedulingService;
10 import com.billion.main.om.service.IOmProductionOrderInfoService;
1e2ff5 11 import com.billion.main.plcServer.sub.OPCUaSubscription;
b9df2f 12 import com.billion.main.sys.service.ISysCountService;
1e2ff5 13 import com.kangaroohy.milo.service.MiloService;
H 14 import org.springframework.beans.factory.annotation.Autowired;
15 import org.springframework.boot.ApplicationArguments;
16 import org.springframework.boot.ApplicationRunner;
a2cd0f 17 import org.springframework.stereotype.Component;
1e2ff5 18
H 19 import java.util.ArrayList;
20 import java.util.List;
a2cd0f 21 @Component
1e2ff5 22 public class CustomRunner implements ApplicationRunner {
H 23     @Autowired
24     private MiloService miloService;
25     @Autowired
26     public IDaParamCollectionService daParamCollectionService;
a2cd0f 27     @Autowired
H 28     public IDaStationCollectionService daStationCollectionService;
29     @Autowired
30     public IOmProductionOrderInfoService omProductionOrderInfoService;
31     @Autowired
32     public IOmOrderSchedulingService omOrderSchedulingService;
33     @Autowired
bf5dcc 34     public IBsBomChildInfoService bsBomChildInfoService;
H 35     @Autowired
36     public IDaCollectionParamConfService daCollectionParamConfService;
37     @Autowired
38     public IDaMaterialCollectionService daMaterialCollectionService;
b9df2f 39     @Autowired
H 40     public ISysCountService sysCountService;
a2cd0f 41
H 42
1e2ff5 43     @Override
H 44     public void run(ApplicationArguments args) throws Exception {
b9df2f 45         //PLC1设备//排查上下线
H 46         Constants.PLC1.add(Constants.C010);
47         Constants.PLC1.add(Constants.C020);
48         Constants.PLC1.add(Constants.C030);
49         Constants.PLC1.add(Constants.C050);
50         //PLC2设备//排查上下线
51         Constants.PLC2.add(Constants.OP005);
52         Constants.PLC2.add(Constants.OP010);
53         Constants.PLC2.add(Constants.OP020);
54         Constants.PLC2.add(Constants.OP040);
55         Constants.PLC2.add(Constants.OP045);
56         Constants.PLC2.add(Constants.OP060);
57         Constants.PLC2.add(Constants.OP070);
1c50cb 58         Constants.PLC2.add(Constants.OP070_1);
b9df2f 59         Constants.PLC2.add(Constants.OP075);
H 60         Constants.PLC2.add(Constants.OP080);
61         Constants.PLC2.add(Constants.OP090);
62         Constants.PLC2.add(Constants.OP095_1);
63         Constants.PLC2.add(Constants.OP095_2);
64         Constants.PLC2.add(Constants.OP100_1);
65         Constants.PLC2.add(Constants.OP100_2);
66         Constants.PLC2.add(Constants.OP120);
67         //PLC3设备//排查上下线
68         Constants.PLC3.add(Constants.OP130);
69         Constants.PLC3.add(Constants.OP145_1);
70         Constants.PLC3.add(Constants.OP145_2);
71         Constants.PLC3.add(Constants.OP150_1);
72         Constants.PLC3.add(Constants.OP150_2);
73         Constants.PLC3.add(Constants.OP160);
74         Constants.PLC3.add(Constants.OP165_1);
75         Constants.PLC3.add(Constants.OP165_2);
76         Constants.PLC3.add(Constants.OP170_1);
77         Constants.PLC3.add(Constants.OP170_2);
78         Constants.PLC3.add(Constants.OP180);
79         Constants.PLC3.add(Constants.OP190_1);
80         Constants.PLC3.add(Constants.OP190_2);
81         Constants.PLC3.add(Constants.OP200_1);
82         Constants.PLC3.add(Constants.OP200_2);
83         Constants.PLC3.add(Constants.OP210_1);
84         Constants.PLC3.add(Constants.OP210_2);
85         Constants.PLC3.add(Constants.OP220_1);
86         Constants.PLC3.add(Constants.OP220_2);
87         Constants.PLC3.add(Constants.OP230_1);
88         Constants.PLC3.add(Constants.OP230_2);
89         Constants.PLC3.add(Constants.OP240_1);
90         Constants.PLC3.add(Constants.OP240_2);
91         Constants.PLC3.add(Constants.OP250_1);
92         Constants.PLC3.add(Constants.OP250_2);
93         Constants.PLC3.add(Constants.OP260_1);
94         Constants.PLC3.add(Constants.OP260_2);
95         Constants.PLC3.add(Constants.OP270_1);
96         Constants.PLC3.add(Constants.OP270_2);
97         Constants.PLC3.add(Constants.OP275);
98         Constants.PLC3.add(Constants.OP280);
99         Constants.PLC3.add(Constants.OP290_1);
100         Constants.PLC3.add(Constants.OP290_2);
101         Constants.PLC3.add(Constants.OP295);
102         Constants.PLC3.add(Constants.OP300);
103         Constants.PLC3.add(Constants.OP310);
104         //PLC4//排查上下线
105         Constants.PLC4.add(Constants.C040);
106         Constants.PLC4.add(Constants.OP030);
107         Constants.PLC4.add(Constants.OP050);
108         Constants.PLC4.add(Constants.OP110);
109         Constants.PLC4.add(Constants.OP140);
110         //上线工位
111         Constants.ONLINE.add(Constants.C005);
112         Constants.ONLINE.add(Constants.OP005);
113         //下线工位
51eb31 114         Constants.OFFLINE.add(Constants.C060);
b9df2f 115         Constants.OFFLINE.add(Constants.OP310);
1e2ff5 116
1c50cb 117
H 118
119
120
1e2ff5 121         OPCUaSubscription OPCUaSubscription = new OPCUaSubscription(miloService,
a2cd0f 122                 daParamCollectionService,
H 123                 daStationCollectionService,
124                 omProductionOrderInfoService,
125                 omOrderSchedulingService,
bf5dcc 126                 bsBomChildInfoService,
H 127                 daCollectionParamConfService,
b9df2f 128                 daMaterialCollectionService,
H 129                 sysCountService);
1e2ff5 130
H 131         List<String> lists = getList();
132         System.out.println("订阅内容:"+lists);
133         miloService.subscriptionFromOpcUa(lists,OPCUaSubscription);
134
135     }
136
137     public List<String> getList(){
138         List<String> lists = new ArrayList<>();
1c50cb 139         //PLC1
H 140         lists.add("PLC1.C005.RecordData");
141         lists.add("PLC1.C005.WorkOrderRequest");//请求工单
142         lists.add("PLC1.C010.RecordData");
143         lists.add("PLC1.C020.RecordData");
144         lists.add("PLC1.C030.RecordData");
145         lists.add("PLC1.C050.RecordData");
146         lists.add("PLC1.C060.RecordData");
147         //PLC2
148         lists.add("PLC2.OP005.RecordData");
149         lists.add("PLC2.OP005.WorkOrderRequest");//请求工单
150         lists.add("PLC2.OP010.RecordData");
151         lists.add("PLC2.OP020.RecordData");
152         lists.add("PLC2.OP040.RecordData");
153         lists.add("PLC2.OP045.RecordData");
154         lists.add("PLC2.OP060.RecordData");
155         lists.add("PLC2.OP070.RecordData");
156         lists.add("PLC2.OP075.RecordData");
157         lists.add("PLC2.OP080.RecordData");
158         lists.add("PLC2.OP090.RecordData");
159         lists.add("PLC2.OP095-1.RecordData");
160         lists.add("PLC2.OP095-2.RecordData");
161         lists.add("PLC2.OP100-1.RecordData");
162         lists.add("PLC2.OP100-2.RecordData");
163         lists.add("PLC2.OP120.RecordData");
164         lists.add("PLC2.P010.RecordData");
165         lists.add("PLC2.P010.WorkOrderRequest");//请求工单
166         //PLC3
167         lists.add("PLC3.OP130.RecordData");
168         lists.add("PLC3.OP145-1.RecordData");
169         lists.add("PLC3.OP145-2.RecordData");
170         lists.add("PLC3.OP150-1.RecordData");
171         lists.add("PLC3.OP150-2.RecordData");
172         lists.add("PLC3.OP160.RecordData");
173         lists.add("PLC3.OP165-1.RecordData");
174         lists.add("PLC3.OP165-2.RecordData");
175         lists.add("PLC3.OP170-1.RecordData");
176         lists.add("PLC3.OP170-2.RecordData");
177         lists.add("PLC3.OP180.RecordData");
178         lists.add("PLC3.OP190-1.RecordData");
179         lists.add("PLC3.OP190-2.RecordData");
180         lists.add("PLC3.OP200-1.RecordData");
181         lists.add("PLC3.OP200-2.RecordData");
182         lists.add("PLC3.OP210-1.RecordData");
183         lists.add("PLC3.OP210-2.RecordData");
184         lists.add("PLC3.OP220-1.RecordData");
185         lists.add("PLC3.OP220-2.RecordData");
186         lists.add("PLC3.OP230-1.RecordData");
187         lists.add("PLC3.OP230-2.RecordData");
188         lists.add("PLC3.OP240-1.RecordData");
189         lists.add("PLC3.OP240-2.RecordData");
190         lists.add("PLC3.OP250-1.RecordData");
191         lists.add("PLC3.OP250-2.RecordData");
192         lists.add("PLC3.OP260-1.RecordData");
193         lists.add("PLC3.OP260-2.RecordData");
194         lists.add("PLC3.OP270-1.RecordData");
195         lists.add("PLC3.OP270-2.RecordData");
196         lists.add("PLC3.OP275.RecordData");
197         lists.add("PLC3.OP280.RecordData");
198         lists.add("PLC3.OP290-1.RecordData");
199         lists.add("PLC3.OP290-2.RecordData");
200         lists.add("PLC3.OP295.RecordData");
201         lists.add("PLC3.OP300.RecordData");
202         lists.add("PLC3.OP310.RecordData");
203         //PLC4
204         lists.add("PLC4.C040.RecordData");
205         lists.add("PLC4.OP030.RecordData");
206         lists.add("PLC4.OP050.RecordData");
207         lists.add("PLC4.OP070_1.RecordData");
208         lists.add("PLC3.OP110.RecordData");
209         lists.add("PLC3.OP140.RecordData");
51eb31 210
H 211         //TEST
212         lists.add("TEST.C005.RecordData");
213         lists.add("TEST.C005.WorkOrderRequest");
214         lists.add("TEST.C060.RecordData");
215         lists.add("TEST.OP005.RecordData");
216         lists.add("TEST.OP005.WorkOrderRequest");
217         lists.add("TEST.OP010.RecordData");
218         lists.add("TEST.OP310.RecordData");
219         lists.add("TEST.P010.RecordData");
220         lists.add("TEST.P010.WorkOrderRequest");
b9df2f 221
H 222
223
a2cd0f 224
1e2ff5 225         return lists;
H 226     }
227 }