hdy
3 天以前 51eb318f6df9ebc7d1ff47522e33b2ee7cea1ba8
提交 | 用户 | 时间
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);
58         Constants.PLC2.add(Constants.OP075);
59         Constants.PLC2.add(Constants.OP080);
60         Constants.PLC2.add(Constants.OP090);
61         Constants.PLC2.add(Constants.OP095_1);
62         Constants.PLC2.add(Constants.OP095_2);
63         Constants.PLC2.add(Constants.OP100_1);
64         Constants.PLC2.add(Constants.OP100_2);
65         Constants.PLC2.add(Constants.OP120);
66         //PLC3设备//排查上下线
67         Constants.PLC3.add(Constants.OP130);
68         Constants.PLC3.add(Constants.OP145_1);
69         Constants.PLC3.add(Constants.OP145_2);
70         Constants.PLC3.add(Constants.OP150_1);
71         Constants.PLC3.add(Constants.OP150_2);
72         Constants.PLC3.add(Constants.OP160);
73         Constants.PLC3.add(Constants.OP165_1);
74         Constants.PLC3.add(Constants.OP165_2);
75         Constants.PLC3.add(Constants.OP170_1);
76         Constants.PLC3.add(Constants.OP170_2);
77         Constants.PLC3.add(Constants.OP180);
78         Constants.PLC3.add(Constants.OP190_1);
79         Constants.PLC3.add(Constants.OP190_2);
80         Constants.PLC3.add(Constants.OP200_1);
81         Constants.PLC3.add(Constants.OP200_2);
82         Constants.PLC3.add(Constants.OP210_1);
83         Constants.PLC3.add(Constants.OP210_2);
84         Constants.PLC3.add(Constants.OP220_1);
85         Constants.PLC3.add(Constants.OP220_2);
86         Constants.PLC3.add(Constants.OP230_1);
87         Constants.PLC3.add(Constants.OP230_2);
88         Constants.PLC3.add(Constants.OP240_1);
89         Constants.PLC3.add(Constants.OP240_2);
90         Constants.PLC3.add(Constants.OP250_1);
91         Constants.PLC3.add(Constants.OP250_2);
92         Constants.PLC3.add(Constants.OP260_1);
93         Constants.PLC3.add(Constants.OP260_2);
94         Constants.PLC3.add(Constants.OP270_1);
95         Constants.PLC3.add(Constants.OP270_2);
96         Constants.PLC3.add(Constants.OP275);
97         Constants.PLC3.add(Constants.OP280);
98         Constants.PLC3.add(Constants.OP290_1);
99         Constants.PLC3.add(Constants.OP290_2);
100         Constants.PLC3.add(Constants.OP295);
101         Constants.PLC3.add(Constants.OP300);
102         Constants.PLC3.add(Constants.OP310);
103         //PLC4//排查上下线
104         Constants.PLC4.add(Constants.C040);
105         Constants.PLC4.add(Constants.OP030);
106         Constants.PLC4.add(Constants.OP050);
107         Constants.PLC4.add(Constants.OP110);
108         Constants.PLC4.add(Constants.OP140);
109         //上线工位
110         Constants.ONLINE.add(Constants.C005);
111         Constants.ONLINE.add(Constants.OP005);
112         //下线工位
51eb31 113         Constants.OFFLINE.add(Constants.C060);
b9df2f 114         Constants.OFFLINE.add(Constants.OP310);
1e2ff5 115
H 116         OPCUaSubscription OPCUaSubscription = new OPCUaSubscription(miloService,
a2cd0f 117                 daParamCollectionService,
H 118                 daStationCollectionService,
119                 omProductionOrderInfoService,
120                 omOrderSchedulingService,
bf5dcc 121                 bsBomChildInfoService,
H 122                 daCollectionParamConfService,
b9df2f 123                 daMaterialCollectionService,
H 124                 sysCountService);
1e2ff5 125
H 126         List<String> lists = getList();
127         System.out.println("订阅内容:"+lists);
128         miloService.subscriptionFromOpcUa(lists,OPCUaSubscription);
129
130     }
131
132     public List<String> getList(){
133         List<String> lists = new ArrayList<>();
51eb31 134 //        //PLC1
H 135 //        lists.add("PLC1.C005.RecordData");
136 //        lists.add("PLC1.C005.WorkOrderRequest");//请求工单
137 //        lists.add("PLC1.C010.RecordData");
138 //        lists.add("PLC1.C020.RecordData");
139 //        lists.add("PLC1.C030.RecordData");
140 //        lists.add("PLC1.C050.RecordData");
141 //        lists.add("PLC1.C060.RecordData");
142 //        //PLC2
143 //        lists.add("PLC2.OP005.RecordData");
144 //        lists.add("PLC2.OP010.WorkOrderRequest");//请求工单
145 //        lists.add("PLC2.OP020.RecordData");
146 //        lists.add("PLC2.OP040.RecordData");
147 //        lists.add("PLC2.OP045.RecordData");
148 //        lists.add("PLC2.OP060.RecordData");
149 //        lists.add("PLC2.OP070.RecordData");
150 //        lists.add("PLC2.OP075.RecordData");
151 //        lists.add("PLC2.OP080.RecordData");
152 //        lists.add("PLC2.OP090.RecordData");
153 //        lists.add("PLC2.OP095-1.RecordData");
154 //        lists.add("PLC2.OP095-2.RecordData");
155 //        lists.add("PLC2.OP100-1.RecordData");
156 //        lists.add("PLC2.OP100-2.RecordData");
157 //        lists.add("PLC2.OP120.RecordData");
158 //        lists.add("PLC2.P010.RecordData");
159 //        lists.add("PLC2.P010.WorkOrderRequest");//请求工单
160 //        //PLC3
161 //        lists.add("PLC3.OP130.RecordData");
162 //        lists.add("PLC3.OP145-1.RecordData");
163 //        lists.add("PLC3.OP145-2.RecordData");
164 //        lists.add("PLC3.OP150-1.RecordData");
165 //        lists.add("PLC3.OP150-2.RecordData");
166 //        lists.add("PLC3.OP160.RecordData");
167 //        lists.add("PLC3.OP165-1.RecordData");
168 //        lists.add("PLC3.OP165-2.RecordData");
169 //        lists.add("PLC3.OP170-1.RecordData");
170 //        lists.add("PLC3.OP170-2.RecordData");
171 //        lists.add("PLC3.OP180.RecordData");
172 //        lists.add("PLC3.OP190-1.RecordData");
173 //        lists.add("PLC3.OP190-2.RecordData");
174 //        lists.add("PLC3.OP200-1.RecordData");
175 //        lists.add("PLC3.OP200-2.RecordData");
176 //        lists.add("PLC3.OP210-1.RecordData");
177 //        lists.add("PLC3.OP210-2.RecordData");
178 //        lists.add("PLC3.OP220-1.RecordData");
179 //        lists.add("PLC3.OP220-2.RecordData");
180 //        lists.add("PLC3.OP230-1.RecordData");
181 //        lists.add("PLC3.OP230-2.RecordData");
182 //        lists.add("PLC3.OP240-1.RecordData");
183 //        lists.add("PLC3.OP240-2.RecordData");
184 //        lists.add("PLC3.OP250-1.RecordData");
185 //        lists.add("PLC3.OP250-2.RecordData");
186 //        lists.add("PLC3.OP260-1.RecordData");
187 //        lists.add("PLC3.OP260-2.RecordData");
188 //        lists.add("PLC3.OP270-1.RecordData");
189 //        lists.add("PLC3.OP270-2.RecordData");
190 //        lists.add("PLC3.OP275.RecordData");
191 //        lists.add("PLC3.OP280.RecordData");
192 //        lists.add("PLC3.OP290-1.RecordData");
193 //        lists.add("PLC3.OP290-2.RecordData");
194 //        lists.add("PLC3.OP295.RecordData");
195 //        lists.add("PLC3.OP300.RecordData");
196 //        lists.add("PLC3.OP310.RecordData");
197 //        //PLC4
198 //        lists.add("PLC4.C040.RecordData");
199 //        lists.add("PLC4.OP030.RecordData");
200 //        lists.add("PLC4.OP050.RecordData");
201 //        lists.add("PLC4.OP070.RecordData");
202 //        lists.add("PLC3.OP110.RecordData");
203 //        lists.add("PLC3.OP140.RecordData");
204
205         //TEST
206         lists.add("TEST.C005.RecordData");
207         lists.add("TEST.C005.WorkOrderRequest");
208         lists.add("TEST.C060.RecordData");
209         lists.add("TEST.OP005.RecordData");
210         lists.add("TEST.OP005.WorkOrderRequest");
211         lists.add("TEST.OP010.RecordData");
212         lists.add("TEST.OP310.RecordData");
213         lists.add("TEST.P010.RecordData");
214         lists.add("TEST.P010.WorkOrderRequest");
b9df2f 215
H 216
217
a2cd0f 218
1e2ff5 219         return lists;
H 220     }
221 }