cl
2024-01-23 6dadf36ef118fbb3b2cd5aca94cde88e29fb55dc
提交 | 用户 | 时间
d43481 1 package cn.stylefeng.guns.plcserver.callback;
C 2
3
4 import cn.stylefeng.guns.modular.bs.collectionParamConf.model.params.CollectionParamConfParam;
5 import cn.stylefeng.guns.modular.bs.collectionParamConf.model.result.CollectionParamConfResult;
6 import cn.stylefeng.guns.modular.bs.collectionParamConf.service.CollectionParamConfService;
7 import cn.stylefeng.guns.modular.bs.equipmentInfo.model.params.EquipmentInfoParam;
8 import cn.stylefeng.guns.modular.bs.equipmentInfo.model.result.EquipmentInfoResult;
9 import cn.stylefeng.guns.modular.bs.equipmentInfo.service.EquipmentInfoService;
10 import cn.stylefeng.guns.modular.bs.locationInfo.model.params.LocationInfoParam;
11 import cn.stylefeng.guns.modular.bs.locationInfo.model.result.LocationInfoResult;
12 import cn.stylefeng.guns.modular.bs.locationInfo.service.LocationInfoService;
13 import cn.stylefeng.guns.modular.cm.paramCollection.model.params.ParamCollectionParam;
14 import cn.stylefeng.guns.modular.cm.paramCollection.service.ParamCollectionService;
15 import cn.stylefeng.guns.modular.cm.passingStationCollection.model.params.PassingStationCollectionParam;
16 import cn.stylefeng.guns.modular.cm.passingStationCollection.service.PassingStationCollectionService;
17 import cn.stylefeng.guns.modular.dq.materialTraceability.model.params.MaterialTraceabilityParam;
18 import cn.stylefeng.guns.modular.dq.materialTraceability.service.MaterialTraceabilityService;
19 import cn.stylefeng.guns.modular.em.equipmentAlarm.model.params.EquipmentAlarmParam;
20 import cn.stylefeng.guns.modular.em.equipmentAlarm.service.EquipmentAlarmService;
21 import cn.stylefeng.guns.modular.em.equipmentStatus.model.params.EquipmentStatusParam;
22 import cn.stylefeng.guns.modular.em.equipmentStatus.model.result.EquipmentStatusResult;
23 import cn.stylefeng.guns.modular.em.equipmentStatus.service.EquipmentStatusService;
24 import cn.stylefeng.guns.modular.gm.greaseManage.service.GreaseManageService;
25 import cn.stylefeng.guns.modular.om.productionOrdeInfo.model.params.ProductionOrdeInfoParam;
26 import cn.stylefeng.guns.modular.om.productionOrdeInfo.model.result.ProductionOrdeInfoResult;
27 import cn.stylefeng.guns.modular.om.productionOrdeInfo.service.ProductionOrdeInfoService;
28 import cn.stylefeng.guns.modular.om.productionOrderBatchInfo.model.params.ProductionOrderBatchInfoParam;
29 import cn.stylefeng.guns.modular.om.productionOrderBatchInfo.model.result.ProductionOrderBatchInfoResult;
30 import cn.stylefeng.guns.modular.om.productionOrderBatchInfo.service.ProductionOrderBatchInfoService;
31 import cn.stylefeng.guns.modular.om.productionOrderRecords.model.params.ProductionOrderRecordsParam;
32 import cn.stylefeng.guns.modular.om.productionOrderRecords.model.result.ProductionOrderRecordsResult;
33 import cn.stylefeng.guns.modular.om.productionOrderRecords.service.ProductionOrderRecordsService;
34 import cn.stylefeng.guns.modular.sc.repairManageInfo.model.params.RepairManageInfoParam;
35 import cn.stylefeng.guns.modular.sc.repairManageInfo.model.result.RepairManageInfoResult;
36 import cn.stylefeng.guns.modular.sc.repairManageInfo.service.RepairManageInfoService;
37 import cn.stylefeng.guns.modular.sc.serialNumbersConf.model.params.SerialNumbersConfParam;
38 import cn.stylefeng.guns.modular.sc.serialNumbersConf.model.result.SerialNumbersConfResult;
39 import cn.stylefeng.guns.modular.sc.serialNumbersConf.service.SerialNumbersConfService;
40 import cn.stylefeng.guns.plcserver.opc.GlobalVariable;
41 import cn.stylefeng.guns.plcserver.opc.OPCElement;
42 import cn.stylefeng.guns.plcserver.opc.unit.SFCCodeTool;
43 import cn.stylefeng.guns.plcserver.tool.DateTool;
44 import cn.stylefeng.guns.plcserver.tool.LogUtil;
45 import com.kangaroohy.milo.model.ReadWriteEntity;
46 import com.kangaroohy.milo.runner.subscription.SubscriptionCallback;
47 import com.kangaroohy.milo.service.MiloService;
48 import org.apache.commons.lang3.StringUtils;
49 import org.apache.log4j.Logger;
50 import org.springframework.beans.factory.annotation.Autowired;
51 import org.springframework.stereotype.Component;
52
53 import java.util.ArrayList;
54 import java.util.Calendar;
55 import java.util.Date;
56 import java.util.List;
57
58 @Component
59 public class InitCallback implements SubscriptionCallback {
60
61     public MiloService miloService;
62
63     @Autowired
64     public ProductionOrdeInfoService productionOrdeInfoService;
65     @Autowired
66     public PassingStationCollectionService passingStationCollectionService;
67     @Autowired
68     public ParamCollectionService paramCollectionService;
69     @Autowired
70     public CollectionParamConfService collectionParamConfService;
71     @Autowired
72     public SerialNumbersConfService serialNumbersConfService;
73     @Autowired
74     private EquipmentStatusService equipmentStatusService;
75
76     @Autowired
77     private EquipmentAlarmService equipmentAlarmService;
78     @Autowired
79     private MaterialTraceabilityService materialTraceabilityService;
80     @Autowired
81     private EquipmentInfoService equipmentInfoService;
82     @Autowired
83     private RepairManageInfoService repairManageInfoService;
84
85     @Autowired
86     private LocationInfoService locationInfoService;
87
88     @Autowired
89     private GreaseManageService greaseManageService;
90
91     @Autowired
92     private ProductionOrderRecordsService productionOrderRecordsService;
93
94     @Autowired
95     private ProductionOrderBatchInfoService productionOrderBatchInfoService;
96
97     private static Logger logger;
98     LogUtil logUtil = new LogUtil();
99     static {
100         logger = Logger.getLogger(InitCallback.class);
101     }
102     private static Date IN_TIME = null;
103     private static String S_ORDER_CODE = "";//工单编号
104     private static String S_PRODUCT_CODE = "";//产品编号
105     private static String S_PRODUCT_TYPE= "";//产品类型
106     private static String S_SFC_CODE = "";//总成编码
107     private static String PRODUCTION_LINE  = "OP";//产线号
108     private static String LOCATION_CODE  = "OP010";//工位号
109
110     private static Integer ACTUAL_ONLINE_QTY  = 0 ;//上线数量
111
112     OP010Callback OP010Callback;
113     OP020Callback OP020Callback;
114     OP030Callback OP030Callback;
115     OP040Callback OP040Callback;
116     OP050Callback OP050Callback;
117     OP070Callback OP070Callback;
118     OP080Callback OP080Callback;
119     OP090Callback OP090Callback;
120     OP100Callback OP100Callback;
121     OP110Callback OP110Callback;
122     OP120Callback OP120Callback;
123     OP120BCallback OP120BCallback;
124     OP130Callback OP130Callback;
125     OP130BCallback OP130BCallback;
126     OP140Callback OP140Callback;
127     OP150Callback OP150Callback;
128     OP160Callback OP160Callback;
129     OP170Callback OP170Callback;
130     BOP010Callback BOP010Callback;
131     BOP020Callback BOP020Callback;
132     BOP030Callback BOP030Callback;
133     BOP030BCallback BOP030BCallback;
134     BOP040Callback BOP040Callback;
135     BOP040BCallback BOP040BCallback;
136     COP010Callback COP010Callback;
137     COP020Callback COP020Callback;
138     COP030Callback COP030Callback;
139     DOP010Callback DOP010Callback;
140     DOP020Callback DOP020Callback;
141     EOP010Callback EOP010Callback;
142     EOP020Callback EOP020Callback;
143     EOP030Callback EOP030Callback;
144     EOP040Callback EOP040Callback;
145     EOP050Callback EOP050Callback;
146     EOP060Callback EOP060Callback;
147     EOP070Callback EOP070Callback;
148     EOP080Callback EOP080Callback;
149     EOP090Callback EOP090Callback;
150     EOP090BCallback EOP090BCallback;
151
152     StateCallback StateCallback;
153
154
155     public InitCallback(MiloService miloService,
156                         ProductionOrdeInfoService productionOrdeInfoService,
157                         PassingStationCollectionService passingStationCollectionService,
158                         ParamCollectionService paramCollectionService,
159                         CollectionParamConfService collectionParamConfService,
160                         SerialNumbersConfService serialNumbersConfService,
161                         EquipmentStatusService equipmentStatusService,
162                         EquipmentAlarmService equipmentAlarmService,
163                         MaterialTraceabilityService materialTraceabilityService,
164                         EquipmentInfoService equipmentInfoService,
165                         RepairManageInfoService repairManageInfoService,
166                         LocationInfoService locationInfoService,
167                         GreaseManageService greaseManageService,
168                         ProductionOrderRecordsService productionOrderRecordsService,
169                         ProductionOrderBatchInfoService productionOrderBatchInfoService) {
170         this.miloService = miloService;
171         this.productionOrdeInfoService = productionOrdeInfoService;
172         this.passingStationCollectionService = passingStationCollectionService;
173         this.paramCollectionService = paramCollectionService;
174         this.collectionParamConfService = collectionParamConfService;
175         this.serialNumbersConfService = serialNumbersConfService;
176         this.equipmentStatusService = equipmentStatusService;
177         this.equipmentAlarmService = equipmentAlarmService;
178         this.materialTraceabilityService = materialTraceabilityService;
179         this.equipmentInfoService = equipmentInfoService;
180         this.repairManageInfoService = repairManageInfoService;
181         this.locationInfoService = locationInfoService;
182         this.greaseManageService = greaseManageService;
183         this.productionOrderRecordsService = productionOrderRecordsService;
184         this.productionOrderBatchInfoService = productionOrderBatchInfoService;
185
186         OP010Callback = new OP010Callback(miloService,productionOrdeInfoService,
187                 passingStationCollectionService,paramCollectionService,collectionParamConfService,serialNumbersConfService,
188                 equipmentStatusService,equipmentAlarmService,materialTraceabilityService,equipmentInfoService,
189                 repairManageInfoService,locationInfoService,greaseManageService,productionOrderRecordsService,
190                 productionOrderBatchInfoService);
191         OP020Callback = new OP020Callback(miloService,productionOrdeInfoService,
192                 passingStationCollectionService,paramCollectionService,collectionParamConfService,serialNumbersConfService,
193                 equipmentStatusService,equipmentAlarmService,materialTraceabilityService,equipmentInfoService,
194                 repairManageInfoService,locationInfoService,greaseManageService,productionOrderRecordsService,
195                 productionOrderBatchInfoService);
196         OP030Callback = new OP030Callback(miloService,productionOrdeInfoService,
197                 passingStationCollectionService,paramCollectionService,collectionParamConfService,serialNumbersConfService,
198                 equipmentStatusService,equipmentAlarmService,materialTraceabilityService,equipmentInfoService,
199                 repairManageInfoService,locationInfoService,greaseManageService,productionOrderRecordsService,
200                 productionOrderBatchInfoService);
201         OP040Callback = new OP040Callback(miloService,productionOrdeInfoService,
202                 passingStationCollectionService,paramCollectionService,collectionParamConfService,serialNumbersConfService,
203                 equipmentStatusService,equipmentAlarmService,materialTraceabilityService,equipmentInfoService,
204                 repairManageInfoService,locationInfoService,greaseManageService,productionOrderRecordsService,
205                 productionOrderBatchInfoService);
206         OP050Callback = new OP050Callback(miloService,productionOrdeInfoService,
207                 passingStationCollectionService,paramCollectionService,collectionParamConfService,serialNumbersConfService,
208                 equipmentStatusService,equipmentAlarmService,materialTraceabilityService,equipmentInfoService,
209                 repairManageInfoService,locationInfoService,greaseManageService,productionOrderRecordsService,
210                 productionOrderBatchInfoService);
211    /*     OP060Callback = new OP060Callback(miloService,productionOrdeInfoService,
212                 passingStationCollectionService,paramCollectionService,collectionParamConfService,serialNumbersConfService,
213                 equipmentStatusService,equipmentAlarmService,materialTraceabilityService,equipmentInfoService,
214                 repairManageInfoService,locationInfoService,greaseManageService,productionOrderRecordsService,
215                 productionOrderBatchInfoService);*/
216         OP070Callback = new OP070Callback(miloService,productionOrdeInfoService,
217                 passingStationCollectionService,paramCollectionService,collectionParamConfService,serialNumbersConfService,
218                 equipmentStatusService,equipmentAlarmService,materialTraceabilityService,equipmentInfoService,
219                 repairManageInfoService,locationInfoService,greaseManageService,productionOrderRecordsService,
220                 productionOrderBatchInfoService);
221         OP080Callback = new OP080Callback(miloService,productionOrdeInfoService,
222                 passingStationCollectionService,paramCollectionService,collectionParamConfService,serialNumbersConfService,
223                 equipmentStatusService,equipmentAlarmService,materialTraceabilityService,equipmentInfoService,
224                 repairManageInfoService,locationInfoService,greaseManageService,productionOrderRecordsService,
225                 productionOrderBatchInfoService);
226         OP090Callback = new OP090Callback(miloService,productionOrdeInfoService,
227                 passingStationCollectionService,paramCollectionService,collectionParamConfService,serialNumbersConfService,
228                 equipmentStatusService,equipmentAlarmService,materialTraceabilityService,equipmentInfoService,
229                 repairManageInfoService,locationInfoService,greaseManageService,productionOrderRecordsService,
230                 productionOrderBatchInfoService);
231         OP100Callback = new OP100Callback(miloService,productionOrdeInfoService,
232                 passingStationCollectionService,paramCollectionService,collectionParamConfService,serialNumbersConfService,
233                 equipmentStatusService,equipmentAlarmService,materialTraceabilityService,equipmentInfoService,
234                 repairManageInfoService,locationInfoService,greaseManageService,productionOrderRecordsService,
235                 productionOrderBatchInfoService);
236         OP110Callback = new OP110Callback(miloService,productionOrdeInfoService,
237                 passingStationCollectionService,paramCollectionService,collectionParamConfService,serialNumbersConfService,
238                 equipmentStatusService,equipmentAlarmService,materialTraceabilityService,equipmentInfoService,
239                 repairManageInfoService,locationInfoService,greaseManageService,productionOrderRecordsService,
240                 productionOrderBatchInfoService);
241         OP120Callback = new OP120Callback(miloService,productionOrdeInfoService,
242                 passingStationCollectionService,paramCollectionService,collectionParamConfService,serialNumbersConfService,
243                 equipmentStatusService,equipmentAlarmService,materialTraceabilityService,equipmentInfoService,
244                 repairManageInfoService,locationInfoService,greaseManageService,productionOrderRecordsService,
245                 productionOrderBatchInfoService);
246         OP120BCallback = new OP120BCallback(miloService,productionOrdeInfoService,
247                 passingStationCollectionService,paramCollectionService,collectionParamConfService,serialNumbersConfService,
248                 equipmentStatusService,equipmentAlarmService,materialTraceabilityService,equipmentInfoService,
249                 repairManageInfoService,locationInfoService,greaseManageService,productionOrderRecordsService,
250                 productionOrderBatchInfoService);
251         OP130Callback = new OP130Callback(miloService,productionOrdeInfoService,
252                 passingStationCollectionService,paramCollectionService,collectionParamConfService,serialNumbersConfService,
253                 equipmentStatusService,equipmentAlarmService,materialTraceabilityService,equipmentInfoService,
254                 repairManageInfoService,locationInfoService,greaseManageService,productionOrderRecordsService,
255                 productionOrderBatchInfoService);
256         OP130BCallback = new OP130BCallback(miloService,productionOrdeInfoService,
257                 passingStationCollectionService,paramCollectionService,collectionParamConfService,serialNumbersConfService,
258                 equipmentStatusService,equipmentAlarmService,materialTraceabilityService,equipmentInfoService,
259                 repairManageInfoService,locationInfoService,greaseManageService,productionOrderRecordsService,
260                 productionOrderBatchInfoService);
261         OP140Callback = new OP140Callback(miloService,productionOrdeInfoService,
262                 passingStationCollectionService,paramCollectionService,collectionParamConfService,serialNumbersConfService,
263                 equipmentStatusService,equipmentAlarmService,materialTraceabilityService,equipmentInfoService,
264                 repairManageInfoService,locationInfoService,greaseManageService,productionOrderRecordsService,
265                 productionOrderBatchInfoService);
266         OP150Callback = new OP150Callback(miloService,productionOrdeInfoService,
267                 passingStationCollectionService,paramCollectionService,collectionParamConfService,serialNumbersConfService,
268                 equipmentStatusService,equipmentAlarmService,materialTraceabilityService,equipmentInfoService,
269                 repairManageInfoService,locationInfoService,greaseManageService,productionOrderRecordsService,
270                 productionOrderBatchInfoService);
271         OP160Callback = new OP160Callback(miloService,productionOrdeInfoService,
272                 passingStationCollectionService,paramCollectionService,collectionParamConfService,serialNumbersConfService,
273                 equipmentStatusService,equipmentAlarmService,materialTraceabilityService,equipmentInfoService,
274                 repairManageInfoService,locationInfoService,greaseManageService,productionOrderRecordsService,
275                 productionOrderBatchInfoService);
276         OP170Callback = new OP170Callback(miloService,productionOrdeInfoService,
277                 passingStationCollectionService,paramCollectionService,collectionParamConfService,serialNumbersConfService,
278                 equipmentStatusService,equipmentAlarmService,materialTraceabilityService,equipmentInfoService,
279                 repairManageInfoService,locationInfoService,greaseManageService,productionOrderRecordsService,
280                 productionOrderBatchInfoService);
281         COP010Callback = new COP010Callback(miloService,productionOrdeInfoService,
282                 passingStationCollectionService,paramCollectionService,collectionParamConfService,serialNumbersConfService,
283                 equipmentStatusService,equipmentAlarmService,materialTraceabilityService,equipmentInfoService,
284                 repairManageInfoService,locationInfoService,greaseManageService,productionOrderRecordsService,
285                 productionOrderBatchInfoService);
286         COP020Callback = new COP020Callback(miloService,productionOrdeInfoService,
287                 passingStationCollectionService,paramCollectionService,collectionParamConfService,serialNumbersConfService,
288                 equipmentStatusService,equipmentAlarmService,materialTraceabilityService,equipmentInfoService,
289                 repairManageInfoService,locationInfoService,greaseManageService,productionOrderRecordsService,
290                 productionOrderBatchInfoService);
291         COP030Callback = new COP030Callback(miloService,productionOrdeInfoService,
292                 passingStationCollectionService,paramCollectionService,collectionParamConfService,serialNumbersConfService,
293                 equipmentStatusService,equipmentAlarmService,materialTraceabilityService,equipmentInfoService,
294                 repairManageInfoService,locationInfoService,greaseManageService,productionOrderRecordsService,
295                 productionOrderBatchInfoService);
296         BOP010Callback = new BOP010Callback(miloService,productionOrdeInfoService,
297                 passingStationCollectionService,paramCollectionService,collectionParamConfService,serialNumbersConfService,
298                 equipmentStatusService,equipmentAlarmService,materialTraceabilityService,equipmentInfoService,
299                 repairManageInfoService,locationInfoService,greaseManageService,productionOrderRecordsService,
300                 productionOrderBatchInfoService);
301         BOP020Callback = new BOP020Callback(miloService,productionOrdeInfoService,
302                 passingStationCollectionService,paramCollectionService,collectionParamConfService,serialNumbersConfService,
303                 equipmentStatusService,equipmentAlarmService,materialTraceabilityService,equipmentInfoService,
304                 repairManageInfoService,locationInfoService,greaseManageService,productionOrderRecordsService,
305                 productionOrderBatchInfoService);
306         BOP030Callback = new BOP030Callback(miloService,productionOrdeInfoService,
307                 passingStationCollectionService,paramCollectionService,collectionParamConfService,serialNumbersConfService,
308                 equipmentStatusService,equipmentAlarmService,materialTraceabilityService,equipmentInfoService,
309                 repairManageInfoService,locationInfoService,greaseManageService,productionOrderRecordsService,
310                 productionOrderBatchInfoService);
311         BOP030BCallback = new BOP030BCallback(miloService,productionOrdeInfoService,
312                 passingStationCollectionService,paramCollectionService,collectionParamConfService,serialNumbersConfService,
313                 equipmentStatusService,equipmentAlarmService,materialTraceabilityService,equipmentInfoService,
314                 repairManageInfoService,locationInfoService,greaseManageService,productionOrderRecordsService,
315                 productionOrderBatchInfoService);
316         BOP040Callback = new BOP040Callback(miloService,productionOrdeInfoService,
317                 passingStationCollectionService,paramCollectionService,collectionParamConfService,serialNumbersConfService,
318                 equipmentStatusService,equipmentAlarmService,materialTraceabilityService,equipmentInfoService,
319                 repairManageInfoService,locationInfoService,greaseManageService,productionOrderRecordsService,
320                 productionOrderBatchInfoService);
321         BOP040BCallback = new BOP040BCallback(miloService,productionOrdeInfoService,
322                 passingStationCollectionService,paramCollectionService,collectionParamConfService,serialNumbersConfService,
323                 equipmentStatusService,equipmentAlarmService,materialTraceabilityService,equipmentInfoService,
324                 repairManageInfoService,locationInfoService,greaseManageService,productionOrderRecordsService,
325                 productionOrderBatchInfoService);
326         DOP010Callback = new DOP010Callback(miloService,productionOrdeInfoService,
327                 passingStationCollectionService,paramCollectionService,collectionParamConfService,serialNumbersConfService,
328                 equipmentStatusService,equipmentAlarmService,materialTraceabilityService,equipmentInfoService,
329                 repairManageInfoService,locationInfoService,greaseManageService,productionOrderRecordsService,
330                 productionOrderBatchInfoService);
331         DOP020Callback = new DOP020Callback(miloService,productionOrdeInfoService,
332                 passingStationCollectionService,paramCollectionService,collectionParamConfService,serialNumbersConfService,
333                 equipmentStatusService,equipmentAlarmService,materialTraceabilityService,equipmentInfoService,
334                 repairManageInfoService,locationInfoService,greaseManageService,productionOrderRecordsService,
335                 productionOrderBatchInfoService);
336         EOP010Callback = new EOP010Callback(miloService,productionOrdeInfoService,
337                 passingStationCollectionService,paramCollectionService,collectionParamConfService,serialNumbersConfService,
338                 equipmentStatusService,equipmentAlarmService,materialTraceabilityService,equipmentInfoService,
339                 repairManageInfoService,locationInfoService,greaseManageService,productionOrderRecordsService,
340                 productionOrderBatchInfoService);
341         EOP020Callback = new EOP020Callback(miloService,productionOrdeInfoService,
342                 passingStationCollectionService,paramCollectionService,collectionParamConfService,serialNumbersConfService,
343                 equipmentStatusService,equipmentAlarmService,materialTraceabilityService,equipmentInfoService,
344                 repairManageInfoService,locationInfoService,greaseManageService,productionOrderRecordsService,
345                 productionOrderBatchInfoService);
346         EOP030Callback = new EOP030Callback(miloService,productionOrdeInfoService,
347                 passingStationCollectionService,paramCollectionService,collectionParamConfService,serialNumbersConfService,
348                 equipmentStatusService,equipmentAlarmService,materialTraceabilityService,equipmentInfoService,
349                 repairManageInfoService,locationInfoService,greaseManageService,productionOrderRecordsService,
350                 productionOrderBatchInfoService);
351         EOP040Callback = new EOP040Callback(miloService,productionOrdeInfoService,
352                 passingStationCollectionService,paramCollectionService,collectionParamConfService,serialNumbersConfService,
353                 equipmentStatusService,equipmentAlarmService,materialTraceabilityService,equipmentInfoService,
354                 repairManageInfoService,locationInfoService,greaseManageService,productionOrderRecordsService,
355                 productionOrderBatchInfoService);
356         EOP050Callback = new EOP050Callback(miloService,productionOrdeInfoService,
357                 passingStationCollectionService,paramCollectionService,collectionParamConfService,serialNumbersConfService,
358                 equipmentStatusService,equipmentAlarmService,materialTraceabilityService,equipmentInfoService,
359                 repairManageInfoService,locationInfoService,greaseManageService,productionOrderRecordsService,
360                 productionOrderBatchInfoService);
361         EOP060Callback = new EOP060Callback(miloService,productionOrdeInfoService,
362                 passingStationCollectionService,paramCollectionService,collectionParamConfService,serialNumbersConfService,
363                 equipmentStatusService,equipmentAlarmService,materialTraceabilityService,equipmentInfoService,
364                 repairManageInfoService,locationInfoService,greaseManageService,productionOrderRecordsService,
365                 productionOrderBatchInfoService);
366         EOP070Callback = new EOP070Callback(miloService,productionOrdeInfoService,
367                 passingStationCollectionService,paramCollectionService,collectionParamConfService,serialNumbersConfService,
368                 equipmentStatusService,equipmentAlarmService,materialTraceabilityService,equipmentInfoService,
369                 repairManageInfoService,locationInfoService,greaseManageService,productionOrderRecordsService,
370                 productionOrderBatchInfoService);
371         EOP080Callback = new EOP080Callback(miloService,productionOrdeInfoService,
372                 passingStationCollectionService,paramCollectionService,collectionParamConfService,serialNumbersConfService,
373                 equipmentStatusService,equipmentAlarmService,materialTraceabilityService,equipmentInfoService,
374                 repairManageInfoService,locationInfoService,greaseManageService,productionOrderRecordsService,
375                 productionOrderBatchInfoService);
376         EOP090Callback = new EOP090Callback(miloService,productionOrdeInfoService,
377                 passingStationCollectionService,paramCollectionService,collectionParamConfService,serialNumbersConfService,
378                 equipmentStatusService,equipmentAlarmService,materialTraceabilityService,equipmentInfoService,
379                 repairManageInfoService,locationInfoService,greaseManageService,productionOrderRecordsService,
380                 productionOrderBatchInfoService);
381         EOP090BCallback = new EOP090BCallback(miloService,productionOrdeInfoService,
382                 passingStationCollectionService,paramCollectionService,collectionParamConfService,serialNumbersConfService,
383                 equipmentStatusService,equipmentAlarmService,materialTraceabilityService,equipmentInfoService,
384                 repairManageInfoService,locationInfoService,greaseManageService,productionOrderRecordsService,
385                 productionOrderBatchInfoService);
386
387         StateCallback = new StateCallback(miloService,productionOrdeInfoService,
388                 passingStationCollectionService,paramCollectionService,collectionParamConfService,serialNumbersConfService,
389                 equipmentStatusService,equipmentAlarmService,materialTraceabilityService,equipmentInfoService,
390                 repairManageInfoService,locationInfoService,greaseManageService,productionOrderRecordsService,
391                 productionOrderBatchInfoService);
392     }
393
394
395
396     @Override
397     public void onSubscribe(String identifier, Object value) {
398         String ecpStr = "";//异常记录标记
399         try {
400             if(null != value) {
401                 //OP010
402                 //心跳
403                 if (identifier.equals(OPCElement.OP010_F_HEART_BEAT) && null != value && "false".equals(value.toString())) {
404                     ReadWriteEntity entity = new ReadWriteEntity(OPCElement.OP010_F_HEART_BEAT, true);
405                     miloService.writeToOpcUa(entity);
406                 }
407                 //PLC进站
408                 else if (identifier.equals(OPCElement.OP010_J_PLC_START) && null != value && "true".equals(value.toString())) {
409                     String isRepair = miloService.readFromOpcUa(OPCElement.OP010_P_REPAIR).getValue().toString();//是否返修
410                     if (isRepair.equals("true")) {
411                         OP010Callback.handleRepair();
412                     } else {
413                         OP010Callback.handleOrder();
414                     }
415                 }
416                 //PLC出站
417                 else if (identifier.equals(OPCElement.OP010_J_PLC_FINISH) && null != value && "true".equals(value.toString())) {
418                     OP010Callback.handleFinsh();
419                     OP010Callback.handleMaterial();
420                 }
421
422                 //OP020
423                 //心跳
424                 else if (identifier.equals(OPCElement.OP020_F_HEART_BEAT) && null != value && "false".equals(value.toString())) {
425                     ReadWriteEntity entity = new ReadWriteEntity(OPCElement.OP020_F_HEART_BEAT, true);
426                     miloService.writeToOpcUa(entity);
427                 }
428                 //PLC进站
429                 else if (identifier.equals(OPCElement.OP020_J_PLC_START) && null != value && "true".equals(value.toString())) {
430                     OP020Callback.handleOrder();
431                 }
432                 //PLC出站
433                 else if (identifier.equals(OPCElement.OP020_J_PLC_FINISH) && null != value && "true".equals(value.toString())) {
434                     OP020Callback.handleFinsh();
435                     OP020Callback.handleMaterial();
436                     OP020Callback.handleInfo();
437                 }
438
439                 //OP030
440                 //心跳
441                 else if (identifier.equals(OPCElement.OP030_F_HEART_BEAT) && null != value && "false".equals(value.toString())) {
442                     ReadWriteEntity entity = new ReadWriteEntity(OPCElement.OP030_F_HEART_BEAT, true);
443                     miloService.writeToOpcUa(entity);
444                 }
445                 //PLC进站
446                 else if (identifier.equals(OPCElement.OP030_J_PLC_START) && null != value && "true".equals(value.toString())) {
447                     OP030Callback.handleOrder();
448                 }
449                 //PLC出站
450                 else if (identifier.equals(OPCElement.OP030_J_PLC_FINISH) && null != value && "true".equals(value.toString())) {
451                     OP030Callback.handleFinsh();
452                     OP030Callback.handleMaterial();
453                     OP030Callback.handleInfo();
454                 }
455
456                 //OP040
457                 //心跳
458                 else if (identifier.equals(OPCElement.OP040_F_HEART_BEAT) && null != value && "false".equals(value.toString())) {
459                     ReadWriteEntity entity = new ReadWriteEntity(OPCElement.OP040_F_HEART_BEAT, true);
460                     miloService.writeToOpcUa(entity);
461                 }
462                 //PLC进站
463                 else if (identifier.equals(OPCElement.OP040_J_PLC_START) && null != value && "true".equals(value.toString())) {
464                     OP040Callback.handleOrder();
465                 }
466                 //PLC出站
467                 else if (identifier.equals(OPCElement.OP040_J_PLC_FINISH) && null != value && "true".equals(value.toString())) {
468                     OP040Callback.handleFinsh();
469                     OP040Callback.handleMaterial();
470                     OP040Callback.handleInfo();
471                 }
472
473                 //OP050
474                 //心跳
475                 else if (identifier.equals(OPCElement.OP050_F_HEART_BEAT) && null != value && "false".equals(value.toString())) {
476                     ReadWriteEntity entity = new ReadWriteEntity(OPCElement.OP050_F_HEART_BEAT, true);
477                     miloService.writeToOpcUa(entity);
478                 }
479                 //PLC进站
480                 else if (identifier.equals(OPCElement.OP050_J_PLC_START) && null != value && "true".equals(value.toString())) {
481                     OP050Callback.handleOrder();
482                 }
483                 //PLC出站
484                 else if (identifier.equals(OPCElement.OP050_J_PLC_FINISH) && null != value && "true".equals(value.toString())) {
485                     OP050Callback.handleMaterial();
486                     OP050Callback.handleInfo();
487                     OP050Callback.handleFinsh();
488                 }
489
490                 //OP070
491                 //心跳
492                 else if (identifier.equals(OPCElement.OP070_F_HEART_BEAT) && null != value && "false".equals(value.toString())) {
493                     ReadWriteEntity entity = new ReadWriteEntity(OPCElement.OP070_F_HEART_BEAT, true);
494                     miloService.writeToOpcUa(entity);
495                 }
496                 //PLC进站
497                 else if (identifier.equals(OPCElement.OP070_J_PLC_START) && null != value && "true".equals(value.toString())) {
498                     OP070Callback.handleOrder();
499                 }
500                 //PLC出站
501                 else if (identifier.equals(OPCElement.OP070_J_PLC_FINISH) && null != value && "true".equals(value.toString())) {
502                     OP070Callback.handleFinsh();
503                     OP070Callback.handleMaterial();
504                     OP070Callback.handleInfo();
505                 }
506
507                 //OP080
508                 //心跳
509                 else if (identifier.equals(OPCElement.OP080_F_HEART_BEAT) && null != value && "false".equals(value.toString())) {
510                     ReadWriteEntity entity = new ReadWriteEntity(OPCElement.OP080_F_HEART_BEAT, true);
511                     miloService.writeToOpcUa(entity);
512                 }
513                 //PLC进站
514                 else if (identifier.equals(OPCElement.OP080_J_PLC_START) && null != value && "true".equals(value.toString())) {
515                     String isRepair = miloService.readFromOpcUa(OPCElement.OP080_P_REPAIR).getValue().toString();//是否返修
516                     if (isRepair.equals("true")) {
517                         OP080Callback.handleRepair();
518                     } else {
519                         OP080Callback.handleOrder();
520                     }
521                 }
522                 //PLC出站
523                 else if (identifier.equals(OPCElement.OP080_J_PLC_FINISH) && null != value && "true".equals(value.toString())) {
524                     OP080Callback.handleFinsh();
525                     OP080Callback.handleInfo();
6dadf3 526                     OP080Callback.handleMaterial();
C 527
d43481 528                 }
C 529
530                 //OP090
531                 //心跳
532                 else if (identifier.equals(OPCElement.OP090_F_HEART_BEAT) && null != value && "false".equals(value.toString())) {
533                     ReadWriteEntity entity = new ReadWriteEntity(OPCElement.OP090_F_HEART_BEAT, true);
534                     miloService.writeToOpcUa(entity);
535                 }
536                 //PLC进站
537                 else if (identifier.equals(OPCElement.OP090_J_PLC_START) && null != value && "true".equals(value.toString())) {
538                     OP090Callback.handleOrder();
6dadf3 539                 }
C 540                 //PLC出站
541                 else if (identifier.equals(OPCElement.OP090_J_PLC_FINISH) && null != value && "true".equals(value.toString())) {
542                     OP090Callback.handleMaterial();
543                     OP090Callback.handleInfo();
544                     OP090Callback.handleFinsh();
545                 }
546
547                 //OP100
548                 //心跳
549                 else if (identifier.equals(OPCElement.OP100_F_HEART_BEAT) && null != value && "false".equals(value.toString())) {
550                     ReadWriteEntity entity = new ReadWriteEntity(OPCElement.OP100_F_HEART_BEAT, true);
551                     miloService.writeToOpcUa(entity);
552                 }
553                 //PLC进站
554                 else if (identifier.equals(OPCElement.OP100_J_PLC_START) && null != value && "true".equals(value.toString())) {
555                     OP100Callback.handleOrder();
d43481 556                 }
C 557                 //PLC出站
558                 else if (identifier.equals(OPCElement.OP100_J_PLC_FINISH) && null != value && "true".equals(value.toString())) {
559                     OP100Callback.handleMaterial();
560                     OP100Callback.handleInfo();
561                     OP100Callback.handleFinsh();
562                 }
563
564                 //OP110
565                 //心跳
566                 else if (identifier.equals(OPCElement.OP110_F_HEART_BEAT) && null != value && "false".equals(value.toString())) {
567                     ReadWriteEntity entity = new ReadWriteEntity(OPCElement.OP110_F_HEART_BEAT, true);
568                     miloService.writeToOpcUa(entity);
569                 }
570                 //PLC进站
571                 else if (identifier.equals(OPCElement.OP110_J_PLC_START) && null != value && "true".equals(value.toString())) {
572                     OP110Callback.handleOrder();
573                 }
574                 //PLC出站
575                 else if (identifier.equals(OPCElement.OP110_J_PLC_FINISH) && null != value && "true".equals(value.toString())) {
576                     OP110Callback.handleFinsh();
577                     OP110Callback.handleMaterial();
578                     OP110Callback.handleInfo();
579                 }
580
581                 //OP120
582                 //心跳
583                 else if (identifier.equals(OPCElement.OP120_F_HEART_BEAT) && null != value && "false".equals(value.toString())) {
584                     ReadWriteEntity entity = new ReadWriteEntity(OPCElement.OP120_F_HEART_BEAT, true);
585                     miloService.writeToOpcUa(entity);
586                 }
587                 //PLC进站
588                 else if (identifier.equals(OPCElement.OP120_J_PLC_START) && null != value && "true".equals(value.toString())) {
589                     OP120Callback.handleOrder();
590                 }
591                 //PLC出站
592                 else if (identifier.equals(OPCElement.OP120_J_PLC_FINISH) && null != value && "true".equals(value.toString())) {
593                     OP120Callback.handleFinsh();
594                     OP120Callback.handleMaterial();
595                     OP120Callback.handleInfo();
596                 }
597
598                 //OP120B
599                 //心跳
600                 else if (identifier.equals(OPCElement.OP120B_F_HEART_BEAT) && null != value && "false".equals(value.toString())) {
601                     ReadWriteEntity entity = new ReadWriteEntity(OPCElement.OP120B_F_HEART_BEAT, true);
602                     miloService.writeToOpcUa(entity);
603                 }
604                 //PLC进站
605                 else if (identifier.equals(OPCElement.OP120B_J_PLC_START) && null != value && "true".equals(value.toString())) {
606                     OP120BCallback.handleOrder();
607                 }
608                 //PLC出站
609                 else if (identifier.equals(OPCElement.OP120B_J_PLC_FINISH) && null != value && "true".equals(value.toString())) {
610                     OP120BCallback.handleFinsh();
6dadf3 611                     //OP120BCallback.handleMaterial();
C 612                     //OP120BCallback.handleInfo();
d43481 613                 }
C 614
615                 //OP130
616                 //心跳
617                 else if (identifier.equals(OPCElement.OP130_F_HEART_BEAT) && null != value && "false".equals(value.toString())) {
618                     ReadWriteEntity entity = new ReadWriteEntity(OPCElement.OP130_F_HEART_BEAT, true);
619                     miloService.writeToOpcUa(entity);
620                 }
621                 //PLC进站
622                 else if (identifier.equals(OPCElement.OP130_J_PLC_START) && null != value && "true".equals(value.toString())) {
623                     OP130Callback.handleOrder();
624                 }
625                 //PLC出站
626                 else if (identifier.equals(OPCElement.OP130_J_PLC_FINISH) && null != value && "true".equals(value.toString())) {
627                     OP130Callback.handleFinsh();
628                     OP130Callback.handleMaterial();
629                     OP130Callback.handleInfo();
630                 }
631
632                 //OP130B
633                 //心跳
634                 else if (identifier.equals(OPCElement.OP130B_F_HEART_BEAT) && null != value && "false".equals(value.toString())) {
635                     ReadWriteEntity entity = new ReadWriteEntity(OPCElement.OP130B_F_HEART_BEAT, true);
636                     miloService.writeToOpcUa(entity);
637                 }
638                 //PLC进站
639                 else if (identifier.equals(OPCElement.OP130B_J_PLC_START) && null != value && "true".equals(value.toString())) {
640                     OP130BCallback.handleOrder();
641                 }
642                 //PLC出站
643                 else if (identifier.equals(OPCElement.OP130B_J_PLC_FINISH) && null != value && "true".equals(value.toString())) {
644                     OP130BCallback.handleFinsh();
645                     OP130BCallback.handleMaterial();
646                     OP130BCallback.handleInfo();
647                 }
648
649                 //OP140
650                 //心跳
651                 else if (identifier.equals(OPCElement.OP140_F_HEART_BEAT) && null != value && "false".equals(value.toString())) {
652                     ReadWriteEntity entity = new ReadWriteEntity(OPCElement.OP140_F_HEART_BEAT, true);
653                     miloService.writeToOpcUa(entity);
654                 }
655                 //PLC进站
656                 else if (identifier.equals(OPCElement.OP140_J_PLC_START) && null != value && "true".equals(value.toString())) {
657                     OP140Callback.handleOrder();
658                 }
659                 //PLC出站
660                 else if (identifier.equals(OPCElement.OP140_J_PLC_FINISH) && null != value && "true".equals(value.toString())) {
661                     OP140Callback.handleFinsh();
662                     OP140Callback.handleMaterial();
663                     OP140Callback.handleInfo();
664                 }
665
666                 //OP150
667                 //心跳
668                 else if (identifier.equals(OPCElement.OP150_F_HEART_BEAT) && null != value && "false".equals(value.toString())) {
669                     ReadWriteEntity entity = new ReadWriteEntity(OPCElement.OP150_F_HEART_BEAT, true);
670                     miloService.writeToOpcUa(entity);
671                 }
672                 //PLC进站
673                 else if (identifier.equals(OPCElement.OP150_J_PLC_START) && null != value && "true".equals(value.toString())) {
674                     OP150Callback.handleOrder();
675                 }
676                 //PLC出站
677                 else if (identifier.equals(OPCElement.OP150_J_PLC_FINISH) && null != value && "true".equals(value.toString())) {
678                     OP150Callback.handleFinsh();
679                     OP150Callback.handleMaterial();
680                     OP150Callback.handleInfo();
681                 }
682
683                 //OP160
684                 //心跳
685                 else if (identifier.equals(OPCElement.OP160_F_HEART_BEAT) && null != value && "false".equals(value.toString())) {
686                     ReadWriteEntity entity = new ReadWriteEntity(OPCElement.OP160_F_HEART_BEAT, true);
687                     miloService.writeToOpcUa(entity);
688                 }
689                 //PLC进站
690                 else if (identifier.equals(OPCElement.OP160_J_PLC_START) && null != value && "true".equals(value.toString())) {
691                     OP160Callback.handleOrder();
692                 }
693                 //PLC出站
694                 else if (identifier.equals(OPCElement.OP160_J_PLC_FINISH) && null != value && "true".equals(value.toString())) {
695                     OP160Callback.handleFinsh();
696                     OP160Callback.handleMaterial();
697                     OP160Callback.handleInfo();
698                 }
699
700                 //OP170
701                 //心跳
702                 else if (identifier.equals(OPCElement.OP170_F_HEART_BEAT) && null != value && "false".equals(value.toString())) {
703                     ReadWriteEntity entity = new ReadWriteEntity(OPCElement.OP170_F_HEART_BEAT, true);
704                     miloService.writeToOpcUa(entity);
705                 }
706                 //PLC进站
707                 else if (identifier.equals(OPCElement.OP170_J_PLC_START) && null != value && "true".equals(value.toString())) {
708                     OP170Callback.handleOrder();
709                 }
710                 //PLC出站
711                 else if (identifier.equals(OPCElement.OP170_J_PLC_FINISH) && null != value && "true".equals(value.toString())) {
712                     OP170Callback.handleFinsh();
713                     OP170Callback.handleMaterial();
714                     //OP170Callback.handleInfo();
715                 }
716
717                 //BOP010
718                 //心跳
719                 else if (identifier.equals(OPCElement.BOP010_F_HEART_BEAT) && null != value && "false".equals(value.toString())) {
720                     ReadWriteEntity entity = new ReadWriteEntity(OPCElement.BOP010_F_HEART_BEAT, true);
721                     miloService.writeToOpcUa(entity);
722                 }
723                 //PLC进站
724                 else if (identifier.equals(OPCElement.BOP010_J_PLC_START) && null != value && "true".equals(value.toString())) {
725                     String isRepair = miloService.readFromOpcUa(OPCElement.BOP010_P_REPAIR).getValue().toString();//是否返修
726                     if (isRepair.equals("true")) {
727                         BOP010Callback.handleRepair();
728                     } else {
729                         BOP010Callback.handleOrder();
730                     }
731                 }
732                 //PLC出站
733                 else if (identifier.equals(OPCElement.BOP010_J_PLC_FINISH) && null != value && "true".equals(value.toString())) {
734                     BOP010Callback.handleFinsh();
735                     BOP010Callback.handleMaterial();
736                     //BOP010Callback.handleInfo();
737                 }
738
739
740                 //BOP020
741                 //心跳
742                 else if (identifier.equals(OPCElement.BOP020_F_HEART_BEAT) && null != value && "false".equals(value.toString())) {
743                     ReadWriteEntity entity = new ReadWriteEntity(OPCElement.BOP020_F_HEART_BEAT, true);
744                     miloService.writeToOpcUa(entity);
745                 }
746                 //PLC进站
747                 else if (identifier.equals(OPCElement.BOP020_J_PLC_START) && null != value && "true".equals(value.toString())) {
748                     BOP020Callback.handleOrder();
749                 }
750                 //PLC出站
751                 else if (identifier.equals(OPCElement.BOP020_J_PLC_FINISH) && null != value && "true".equals(value.toString())) {
752                     BOP020Callback.handleFinsh();
753                     BOP020Callback.handleMaterial();
754                     BOP020Callback.handleInfo();
755                 }
756
757
758                 //BOP030
759                 //心跳
760                 else if (identifier.equals(OPCElement.BOP030_F_HEART_BEAT) && null != value && "false".equals(value.toString())) {
761                     ReadWriteEntity entity = new ReadWriteEntity(OPCElement.BOP030_F_HEART_BEAT, true);
762                     miloService.writeToOpcUa(entity);
763                 }
764                 //PLC进站
765                 else if (identifier.equals(OPCElement.BOP030_J_PLC_START) && null != value && "true".equals(value.toString())) {
766                     BOP030Callback.handleOrder();
767                 }
768                 //PLC出站
769                 else if (identifier.equals(OPCElement.BOP030_J_PLC_FINISH) && null != value && "true".equals(value.toString())) {
770                     BOP030Callback.handleFinsh();
771                     BOP030Callback.handleMaterial();
772                     BOP030Callback.handleInfo();
773                 }
774
775                 //BOP030B
776                 //心跳
777                 else if (identifier.equals(OPCElement.BOP030B_F_HEART_BEAT) && null != value && "false".equals(value.toString())) {
778                     ReadWriteEntity entity = new ReadWriteEntity(OPCElement.BOP030B_F_HEART_BEAT, true);
779                     miloService.writeToOpcUa(entity);
780                 }
781                 //PLC进站
782                 else if (identifier.equals(OPCElement.BOP030B_J_PLC_START) && null != value && "true".equals(value.toString())) {
783                     BOP030BCallback.handleOrder();
784                 }
785                 //PLC出站
786                 else if (identifier.equals(OPCElement.BOP030B_J_PLC_FINISH) && null != value && "true".equals(value.toString())) {
787                     BOP030BCallback.handleFinsh();
788                     //BOP030BCallback.handleMaterial();
789                     //BOP030BCallback.handleInfo();
790                 }
791
792                 //BOP040
793                 //心跳
794                 else if (identifier.equals(OPCElement.BOP040_F_HEART_BEAT) && null != value && "false".equals(value.toString())) {
795                     ReadWriteEntity entity = new ReadWriteEntity(OPCElement.BOP040_F_HEART_BEAT, true);
796                     miloService.writeToOpcUa(entity);
797                 }
798                 //PLC进站
799                 else if (identifier.equals(OPCElement.BOP040_J_PLC_START) && null != value && "true".equals(value.toString())) {
800                     BOP040Callback.handleOrder();
801                 }
802                 //PLC出站
803                 else if (identifier.equals(OPCElement.BOP040_J_PLC_FINISH) && null != value && "true".equals(value.toString())) {
804                     BOP040Callback.handleFinsh();
805                     BOP040Callback.handleMaterial();
806                     BOP040Callback.handleInfo();
807                 }
808
809                 //BOP040B
810                 //心跳
811                 else if (identifier.equals(OPCElement.BOP040B_F_HEART_BEAT) && null != value && "false".equals(value.toString())) {
812                     ReadWriteEntity entity = new ReadWriteEntity(OPCElement.BOP040B_F_HEART_BEAT, true);
813                     miloService.writeToOpcUa(entity);
814                 }
815                 //PLC进站
816                 else if (identifier.equals(OPCElement.BOP040B_J_PLC_START) && null != value && "true".equals(value.toString())) {
817                     BOP040BCallback.handleOrder();
818                 }
819                 //PLC出站
820                 else if (identifier.equals(OPCElement.BOP040B_J_PLC_FINISH) && null != value && "true".equals(value.toString())) {
821                     BOP040BCallback.handleFinsh();
6dadf3 822                     // BOP040BCallback.handleMaterial();
d43481 823                     //BOP040BCallback.handleInfo();
C 824                 }
825
826
827                 //COP010
828                 //心跳
829                 else if (identifier.equals(OPCElement.COP010_F_HEART_BEAT) && null != value && "false".equals(value.toString())) {
830                     ReadWriteEntity entity = new ReadWriteEntity(OPCElement.COP010_F_HEART_BEAT, true);
831                     miloService.writeToOpcUa(entity);
832                 }
833                 //PLC进站
834                 else if (identifier.equals(OPCElement.COP010_J_PLC_START) && null != value && "true".equals(value.toString())) {
835                     String isRepair = miloService.readFromOpcUa(OPCElement.COP010_P_REPAIR).getValue().toString();//是否返修
836                     if (isRepair.equals("true")) {
837                         COP010Callback.handleRepair();
838                     } else {
839                         COP010Callback.handleOrder();
840                     }
841                 }
842                 //PLC出站
843                 else if (identifier.equals(OPCElement.COP010_J_PLC_FINISH) && null != value && "true".equals(value.toString())) {
844                     COP010Callback.handleFinsh();
845                     COP010Callback.handleMaterial();
846                     //COP010Callback.handleInfo();
847                 }
848
849
850                 //COP020
851                 //心跳
852                 else if (identifier.equals(OPCElement.COP020_F_HEART_BEAT) && null != value && "false".equals(value.toString())) {
853                     ReadWriteEntity entity = new ReadWriteEntity(OPCElement.COP020_F_HEART_BEAT, true);
854                     miloService.writeToOpcUa(entity);
855                 }
856                 //PLC进站
857                 else if (identifier.equals(OPCElement.COP020_J_PLC_START) && null != value && "true".equals(value.toString())) {
858                     COP020Callback.handleOrder();
859                 }
860                 //PLC出站
861                 else if (identifier.equals(OPCElement.COP020_J_PLC_FINISH) && null != value && "true".equals(value.toString())) {
862                     COP020Callback.handleFinsh();
863                     COP020Callback.handleMaterial();
864                     COP020Callback.handleInfo();
865                 }
866
867
868                 //COP030
869                 //心跳
870                 else if (identifier.equals(OPCElement.COP030_F_HEART_BEAT) && null != value && "false".equals(value.toString())) {
871                     ReadWriteEntity entity = new ReadWriteEntity(OPCElement.COP030_F_HEART_BEAT, true);
872                     miloService.writeToOpcUa(entity);
873                 }
874                 //PLC进站
875                 else if (identifier.equals(OPCElement.COP030_J_PLC_START) && null != value && "true".equals(value.toString())) {
876                     COP030Callback.handleOrder();
877                 }
878                 //PLC出站
879                 else if (identifier.equals(OPCElement.COP030_J_PLC_FINISH) && null != value && "true".equals(value.toString())) {
880                     COP030Callback.handleFinsh();
881                     COP030Callback.handleMaterial();
882                     COP030Callback.handleInfo();
883                 }
884
885
886                 //DOP010
887                 //心跳
888                 else if (identifier.equals(OPCElement.DOP010_F_HEART_BEAT) && null != value && "false".equals(value.toString())) {
889                     ReadWriteEntity entity = new ReadWriteEntity(OPCElement.DOP010_F_HEART_BEAT, true);
890                     miloService.writeToOpcUa(entity);
891                 }
892                 //PLC进站
893                 else if (identifier.equals(OPCElement.DOP010_J_PLC_START) && null != value && "true".equals(value.toString())) {
894                     String isRepair = miloService.readFromOpcUa(OPCElement.DOP010_P_REPAIR).getValue().toString();//是否返修
895                     if (isRepair.equals("true")) {
896                         DOP010Callback.handleRepair();
897                     } else {
898                         DOP010Callback.handleOrder();
899                     }
900                 }
901                 //PLC出站
902                 else if (identifier.equals(OPCElement.DOP010_J_PLC_FINISH) && null != value && "true".equals(value.toString())) {
903                     DOP010Callback.handleFinsh();
904                     DOP010Callback.handleMaterial();
905                     //DOP010Callback.handleInfo();
906                 }
907
908
909                 //DOP020
910                 //心跳
911                 else if (identifier.equals(OPCElement.DOP020_F_HEART_BEAT) && null != value && "false".equals(value.toString())) {
912                     ReadWriteEntity entity = new ReadWriteEntity(OPCElement.DOP020_F_HEART_BEAT, true);
913                     miloService.writeToOpcUa(entity);
914                 }
915                 //PLC进站
916                 else if (identifier.equals(OPCElement.DOP020_J_PLC_START) && null != value && "true".equals(value.toString())) {
917                     DOP020Callback.handleOrder();
918                 }
919                 //PLC出站
920                 else if (identifier.equals(OPCElement.DOP020_J_PLC_FINISH) && null != value && "true".equals(value.toString())) {
921                     DOP020Callback.handleFinsh();
922                     DOP020Callback.handleMaterial();
923                     DOP020Callback.handleInfo();
924                 }
925
926                 //EOP010
927                 //心跳
928                 else if (identifier.equals(OPCElement.EOP010_F_HEART_BEAT) && null != value && "false".equals(value.toString())) {
929                     ReadWriteEntity entity = new ReadWriteEntity(OPCElement.EOP010_F_HEART_BEAT, true);
930                     miloService.writeToOpcUa(entity);
931                 }
932                 //PLC进站
933                 else if (identifier.equals(OPCElement.EOP010_J_PLC_START) && null != value && "true".equals(value.toString())) {
934                     EOP010Callback.handleOrder();
935                 }
936                 //PLC出站
937                 else if (identifier.equals(OPCElement.EOP010_J_PLC_FINISH) && null != value && "true".equals(value.toString())) {
938                     EOP010Callback.handleFinsh();
939                     EOP010Callback.handleMaterial();
940                     EOP010Callback.handleInfo();
941                 }
942                 //EOP020
943                 //心跳
944                 else if (identifier.equals(OPCElement.EOP020_F_HEART_BEAT) && null != value && "false".equals(value.toString())) {
945                     ReadWriteEntity entity = new ReadWriteEntity(OPCElement.EOP020_F_HEART_BEAT, true);
946                     miloService.writeToOpcUa(entity);
947                 }
948                 //PLC进站
949                 else if (identifier.equals(OPCElement.EOP020_J_PLC_START) && null != value && "true".equals(value.toString())) {
950                     EOP020Callback.handleOrder();
951                 }
952                 //PLC出站
953                 else if (identifier.equals(OPCElement.EOP020_J_PLC_FINISH) && null != value && "true".equals(value.toString())) {
954                     EOP020Callback.handleFinsh();
955                     EOP020Callback.handleMaterial();
956                     EOP020Callback.handleInfo();
957                 }
958
959                 //EOP030
960                 //心跳
961                 else if (identifier.equals(OPCElement.EOP030_F_HEART_BEAT) && null != value && "false".equals(value.toString())) {
962                     ReadWriteEntity entity = new ReadWriteEntity(OPCElement.EOP030_F_HEART_BEAT, true);
963                     miloService.writeToOpcUa(entity);
964                 }
965                 //PLC进站
966                 else if (identifier.equals(OPCElement.EOP030_J_PLC_START) && null != value && "true".equals(value.toString())) {
967                     EOP030Callback.handleOrder();
968                 }
969                 //PLC出站
970                 else if (identifier.equals(OPCElement.EOP030_J_PLC_FINISH) && null != value && "true".equals(value.toString())) {
971                     EOP030Callback.handleFinsh();
972                     EOP030Callback.handleMaterial();
973                     EOP030Callback.handleInfo();
974                 }
975
976                 //EOP040
977                 //心跳
978                 else if (identifier.equals(OPCElement.EOP040_F_HEART_BEAT) && null != value && "false".equals(value.toString())) {
979                     ReadWriteEntity entity = new ReadWriteEntity(OPCElement.EOP040_F_HEART_BEAT, true);
980                     miloService.writeToOpcUa(entity);
981                 }
982                 //PLC进站
983                 else if (identifier.equals(OPCElement.EOP040_J_PLC_START) && null != value && "true".equals(value.toString())) {
984                     EOP040Callback.handleOrder();
985                 }
986                 //PLC出站
987                 else if (identifier.equals(OPCElement.EOP040_J_PLC_FINISH) && null != value && "true".equals(value.toString())) {
988                     EOP040Callback.handleFinsh();
989                     EOP040Callback.handleMaterial();
990                     EOP040Callback.handleInfo();
991                 }
992
993                 //EOP050
994                 //心跳
995                 else if (identifier.equals(OPCElement.EOP050_F_HEART_BEAT) && null != value && "false".equals(value.toString())) {
996                     ReadWriteEntity entity = new ReadWriteEntity(OPCElement.EOP050_F_HEART_BEAT, true);
997                     miloService.writeToOpcUa(entity);
998                 }
999                 //PLC进站
1000                 else if (identifier.equals(OPCElement.EOP050_J_PLC_START) && null != value && "true".equals(value.toString())) {
1001                     EOP050Callback.handleOrder();
1002                 }
1003                 //PLC出站
1004                 else if (identifier.equals(OPCElement.EOP050_J_PLC_FINISH) && null != value && "true".equals(value.toString())) {
1005                     EOP050Callback.handleFinsh();
1006                     EOP050Callback.handleMaterial();
1007                     EOP050Callback.handleInfo();
1008                 }
1009
1010                 //EOP060
1011                 //心跳
1012                 else if (identifier.equals(OPCElement.EOP060_F_HEART_BEAT) && null != value && "false".equals(value.toString())) {
1013                     ReadWriteEntity entity = new ReadWriteEntity(OPCElement.EOP060_F_HEART_BEAT, true);
1014                     miloService.writeToOpcUa(entity);
1015                 }
1016                 //PLC进站
1017                 else if (identifier.equals(OPCElement.EOP060_J_PLC_START) && null != value && "true".equals(value.toString())) {
1018                     EOP060Callback.handleOrder();
1019                 }
1020                 //PLC出站
1021                 else if (identifier.equals(OPCElement.EOP060_J_PLC_FINISH) && null != value && "true".equals(value.toString())) {
1022                     EOP060Callback.handleFinsh();
1023                     EOP060Callback.handleMaterial();
1024                     EOP060Callback.handleInfo();
1025                 }
1026
1027                 //EOP070
1028                 //心跳
1029                 else if (identifier.equals(OPCElement.EOP070_F_HEART_BEAT) && null != value && "false".equals(value.toString())) {
1030                     ReadWriteEntity entity = new ReadWriteEntity(OPCElement.EOP070_F_HEART_BEAT, true);
1031                     miloService.writeToOpcUa(entity);
1032                 }
1033                 //PLC进站
1034                 else if (identifier.equals(OPCElement.EOP070_J_PLC_START) && null != value && "true".equals(value.toString())) {
1035                     EOP070Callback.handleOrder();
1036                 }
1037                 //PLC出站
1038                 else if (identifier.equals(OPCElement.EOP070_J_PLC_FINISH) && null != value && "true".equals(value.toString())) {
1039                     EOP070Callback.handleFinsh();
1040                     EOP070Callback.handleMaterial();
1041                     EOP070Callback.handleInfo();
1042                 }
1043
1044                 //EOP080
1045                 //心跳
1046                 else if (identifier.equals(OPCElement.EOP080_F_HEART_BEAT) && null != value && "false".equals(value.toString())) {
1047                     ReadWriteEntity entity = new ReadWriteEntity(OPCElement.EOP080_F_HEART_BEAT, true);
1048                     miloService.writeToOpcUa(entity);
1049                 }
1050                 //PLC进站
1051                 else if (identifier.equals(OPCElement.EOP080_J_PLC_START) && null != value && "true".equals(value.toString())) {
1052                     EOP080Callback.handleOrder();
1053                 }
1054                 //PLC出站
1055                 else if (identifier.equals(OPCElement.EOP080_J_PLC_FINISH) && null != value && "true".equals(value.toString())) {
1056                     EOP080Callback.handleFinsh();
1057                     EOP080Callback.handleMaterial();
1058                     EOP080Callback.handleInfo();
1059                 }
1060
1061                 //EOP090
1062                 //心跳
1063                 else if (identifier.equals(OPCElement.EOP090_F_HEART_BEAT) && null != value && "false".equals(value.toString())) {
1064                     ReadWriteEntity entity = new ReadWriteEntity(OPCElement.EOP090_F_HEART_BEAT, true);
1065                     miloService.writeToOpcUa(entity);
1066                 }
1067                 //PLC进站
1068                 else if (identifier.equals(OPCElement.EOP090_J_PLC_START) && null != value && "true".equals(value.toString())) {
1069                     EOP090Callback.handleOrder();
1070                 }
1071                 //PLC出站
1072                 else if (identifier.equals(OPCElement.EOP090_J_PLC_FINISH) && null != value && "true".equals(value.toString())) {
1073                     EOP090Callback.handleFinsh();
1074                     EOP090Callback.handleMaterial();
1075                     EOP090Callback.handleInfo();
1076                 }
1077
1078                 //EOP090B
1079                 //心跳
1080                 else if (identifier.equals(OPCElement.EOP090B_F_HEART_BEAT) && null != value && "false".equals(value.toString())) {
1081                     ReadWriteEntity entity = new ReadWriteEntity(OPCElement.EOP090B_F_HEART_BEAT, true);
1082                     miloService.writeToOpcUa(entity);
1083                 }
1084                 //PLC进站
1085                 else if (identifier.equals(OPCElement.EOP090B_J_PLC_START) && null != value && "true".equals(value.toString())) {
1086                     EOP090BCallback.handleOrder();
1087                 }
1088                 //PLC出站
1089                 else if (identifier.equals(OPCElement.EOP090B_J_PLC_FINISH) && null != value && "true".equals(value.toString())) {
1090                     EOP090BCallback.handleFinsh();
1091                     EOP090BCallback.handleMaterial();
1092                     EOP090BCallback.handleInfo();
1093                 }
1094
314bc7 1095                 else if (identifier.contains("STATE") && null != value) {
d43481 1096                     EquipmentInfoParam equipmentInfoParam = new EquipmentInfoParam();
C 1097                     equipmentInfoParam.setSpareField1(identifier);
1098                     List<EquipmentInfoResult> lists = equipmentInfoService.findListBySpec(equipmentInfoParam);
6dadf3 1099                     if(!lists.isEmpty() && lists.size()>0){
C 1100                         EquipmentInfoResult result = (EquipmentInfoResult) lists.get(0);
d43481 1101                         String equipmentNo = result.getEquipmentNo();
C 1102                         EquipmentStatusParam equipmentStatusParam = new EquipmentStatusParam();
1103                         equipmentStatusParam.setEquipmentNo(equipmentNo);
1104                         List statuslist = equipmentStatusService.findListBySpec(equipmentStatusParam);
1105                         if(statuslist.size()>0){
1106                             EquipmentStatusResult equipmentStatusResult = (EquipmentStatusResult) statuslist.get(0);
1107                             if(!value.equals(equipmentStatusResult.getStatus())){
1108                                 equipmentStatusParam.setId(equipmentStatusResult.getId());
1109                                 equipmentStatusParam.setStatus(value.toString());
1110                                 equipmentStatusParam.setUpdateTime(DateTool.getLocalTimeForDate());
1111                                 equipmentStatusService.update(equipmentStatusParam);//更新设备状态
1112
1113                                 //添加设备报警
1114                                 if("3".equals(value)){
1115                                     EquipmentAlarmParam equipmentAlarmParam = new EquipmentAlarmParam();
1116                                     equipmentAlarmParam.setEquipmentNo(equipmentNo);
1117                                     equipmentAlarmParam.setEquipmentName(result.getEquipmentName());
1118                                     equipmentAlarmParam.setWorkshopCode(result.getWorkshopCode());
1119                                     equipmentAlarmParam.setProductionLineCode(result.getProductionLineCode());
1120                                     equipmentAlarmParam.setLocationCode(result.getLocationCode());
1121                                     equipmentAlarmParam.setErrorDesc(result.getEquipmentName()+"报警!");
1122                                     equipmentAlarmParam.setAlarmTime(DateTool.getLocalTimeForDate());
1123                                     equipmentAlarmService.add(equipmentAlarmParam);
1124                                 }
1125                             }
1126
1127                         }else{
1128                             equipmentStatusParam.setEquipmentName(result.getEquipmentName());
1129                             equipmentStatusParam.setWorkshopCode(result.getWorkshopCode());
1130                             equipmentStatusParam.setProductionLineCode(result.getProductionLineCode());
1131                             equipmentStatusParam.setLocationCode(result.getLocationCode());
1132                             equipmentStatusParam.setStatus(value.toString());
1133                             equipmentStatusParam.setUpdateTime(DateTool.getLocalTimeForDate());
1134                             equipmentStatusService.add(equipmentStatusParam);
1135
1136                             //添加设备报警
1137                             if("3".equals(value)){
1138                                 EquipmentAlarmParam equipmentAlarmParam = new EquipmentAlarmParam();
1139                                 equipmentAlarmParam.setEquipmentNo(equipmentNo);
1140                                 equipmentAlarmParam.setEquipmentName(result.getEquipmentName());
1141                                 equipmentAlarmParam.setWorkshopCode(result.getWorkshopCode());
1142                                 equipmentAlarmParam.setProductionLineCode(result.getProductionLineCode());
1143                                 equipmentAlarmParam.setLocationCode(result.getLocationCode());
1144                                 equipmentAlarmParam.setErrorDesc(result.getEquipmentName()+"报警!");
1145                                 equipmentAlarmParam.setAlarmTime(DateTool.getLocalTimeForDate());
1146                                 equipmentAlarmService.add(equipmentAlarmParam);
1147                             }
1148                         }
1149                     }
1150
314bc7 1151                     if(identifier.contains("OP050") && !identifier.contains("EOP050") ){
C 1152                         StateCallback.handleOilStateOP050("OP050");
1153                     }
1154                     if (identifier.contains("BOP030")){
1155                         StateCallback.handleOilStateBOP030("BOP030");
1156                     }
d43481 1157                 }
C 1158
1159                 else {
1160                     System.out.println("值没有变");
1161                 }
1162
1163
1164             }else {
1165                 System.out.println("值为空");
1166             }
1167
1168         } catch (Exception e) {
1169             ecpStr ="出现异常:" + logUtil.getTrace(e);
1170         }finally {
1171             if(!"".equals(ecpStr)){
1172                 System.out.println(ecpStr+"\r\n");
1173                 logger.info(ecpStr+"\r\n");
1174             }
1175         }
1176     }
1177
1178
1179
1180 }