package cn.stylefeng.guns.plcserver.callback; import cn.stylefeng.guns.modular.bs.collectionParamConf.model.params.CollectionParamConfParam; import cn.stylefeng.guns.modular.bs.collectionParamConf.model.result.CollectionParamConfResult; import cn.stylefeng.guns.modular.bs.collectionParamConf.service.CollectionParamConfService; import cn.stylefeng.guns.modular.bs.equipmentInfo.model.params.EquipmentInfoParam; import cn.stylefeng.guns.modular.bs.equipmentInfo.model.result.EquipmentInfoResult; import cn.stylefeng.guns.modular.bs.equipmentInfo.service.EquipmentInfoService; import cn.stylefeng.guns.modular.bs.locationInfo.model.params.LocationInfoParam; import cn.stylefeng.guns.modular.bs.locationInfo.model.result.LocationInfoResult; import cn.stylefeng.guns.modular.bs.locationInfo.service.LocationInfoService; import cn.stylefeng.guns.modular.cm.paramCollection.model.params.ParamCollectionParam; import cn.stylefeng.guns.modular.cm.paramCollection.service.ParamCollectionService; import cn.stylefeng.guns.modular.cm.passingStationCollection.model.params.PassingStationCollectionParam; import cn.stylefeng.guns.modular.cm.passingStationCollection.service.PassingStationCollectionService; import cn.stylefeng.guns.modular.dq.materialTraceability.model.params.MaterialTraceabilityParam; import cn.stylefeng.guns.modular.dq.materialTraceability.service.MaterialTraceabilityService; import cn.stylefeng.guns.modular.em.equipmentAlarm.model.params.EquipmentAlarmParam; import cn.stylefeng.guns.modular.em.equipmentAlarm.service.EquipmentAlarmService; import cn.stylefeng.guns.modular.em.equipmentStatus.model.params.EquipmentStatusParam; import cn.stylefeng.guns.modular.em.equipmentStatus.model.result.EquipmentStatusResult; import cn.stylefeng.guns.modular.em.equipmentStatus.service.EquipmentStatusService; import cn.stylefeng.guns.modular.gm.greaseManage.service.GreaseManageService; import cn.stylefeng.guns.modular.om.productionOrdeInfo.model.params.ProductionOrdeInfoParam; import cn.stylefeng.guns.modular.om.productionOrdeInfo.model.result.ProductionOrdeInfoResult; import cn.stylefeng.guns.modular.om.productionOrdeInfo.service.ProductionOrdeInfoService; import cn.stylefeng.guns.modular.om.productionOrderBatchInfo.model.params.ProductionOrderBatchInfoParam; import cn.stylefeng.guns.modular.om.productionOrderBatchInfo.model.result.ProductionOrderBatchInfoResult; import cn.stylefeng.guns.modular.om.productionOrderBatchInfo.service.ProductionOrderBatchInfoService; import cn.stylefeng.guns.modular.om.productionOrderRecords.model.params.ProductionOrderRecordsParam; import cn.stylefeng.guns.modular.om.productionOrderRecords.model.result.ProductionOrderRecordsResult; import cn.stylefeng.guns.modular.om.productionOrderRecords.service.ProductionOrderRecordsService; import cn.stylefeng.guns.modular.sc.repairManageInfo.model.params.RepairManageInfoParam; import cn.stylefeng.guns.modular.sc.repairManageInfo.model.result.RepairManageInfoResult; import cn.stylefeng.guns.modular.sc.repairManageInfo.service.RepairManageInfoService; import cn.stylefeng.guns.modular.sc.serialNumbersConf.model.params.SerialNumbersConfParam; import cn.stylefeng.guns.modular.sc.serialNumbersConf.model.result.SerialNumbersConfResult; import cn.stylefeng.guns.modular.sc.serialNumbersConf.service.SerialNumbersConfService; import cn.stylefeng.guns.plcserver.opc.GlobalVariable; import cn.stylefeng.guns.plcserver.opc.OPCElement; import cn.stylefeng.guns.plcserver.opc.unit.SFCCodeTool; import cn.stylefeng.guns.plcserver.tool.DateTool; import cn.stylefeng.guns.plcserver.tool.LogUtil; import com.kangaroohy.milo.model.ReadWriteEntity; import com.kangaroohy.milo.runner.subscription.SubscriptionCallback; import com.kangaroohy.milo.service.MiloService; import org.apache.commons.lang3.StringUtils; import org.apache.log4j.Logger; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import java.util.ArrayList; import java.util.Calendar; import java.util.Date; import java.util.List; @Component public class InitCallback implements SubscriptionCallback { public MiloService miloService; @Autowired public ProductionOrdeInfoService productionOrdeInfoService; @Autowired public PassingStationCollectionService passingStationCollectionService; @Autowired public ParamCollectionService paramCollectionService; @Autowired public CollectionParamConfService collectionParamConfService; @Autowired public SerialNumbersConfService serialNumbersConfService; @Autowired private EquipmentStatusService equipmentStatusService; @Autowired private EquipmentAlarmService equipmentAlarmService; @Autowired private MaterialTraceabilityService materialTraceabilityService; @Autowired private EquipmentInfoService equipmentInfoService; @Autowired private RepairManageInfoService repairManageInfoService; @Autowired private LocationInfoService locationInfoService; @Autowired private GreaseManageService greaseManageService; @Autowired private ProductionOrderRecordsService productionOrderRecordsService; @Autowired private ProductionOrderBatchInfoService productionOrderBatchInfoService; private static Logger logger; LogUtil logUtil = new LogUtil(); static { logger = Logger.getLogger(InitCallback.class); } private static Date IN_TIME = null; private static String S_ORDER_CODE = "";//工单编号 private static String S_PRODUCT_CODE = "";//产品编号 private static String S_PRODUCT_TYPE= "";//产品类型 private static String S_SFC_CODE = "";//总成编码 private static String PRODUCTION_LINE = "OP";//产线号 private static String LOCATION_CODE = "OP010";//工位号 private static Integer ACTUAL_ONLINE_QTY = 0 ;//上线数量 OP010Callback OP010Callback; OP020Callback OP020Callback; OP030Callback OP030Callback; OP040Callback OP040Callback; OP050Callback OP050Callback; OP070Callback OP070Callback; OP080Callback OP080Callback; OP090Callback OP090Callback; OP100Callback OP100Callback; OP110Callback OP110Callback; OP120Callback OP120Callback; OP120BCallback OP120BCallback; OP130Callback OP130Callback; OP130BCallback OP130BCallback; OP140Callback OP140Callback; OP150Callback OP150Callback; OP160Callback OP160Callback; OP170Callback OP170Callback; BOP010Callback BOP010Callback; BOP020Callback BOP020Callback; BOP030Callback BOP030Callback; BOP030BCallback BOP030BCallback; BOP040Callback BOP040Callback; BOP040BCallback BOP040BCallback; COP010Callback COP010Callback; COP020Callback COP020Callback; COP030Callback COP030Callback; DOP010Callback DOP010Callback; DOP020Callback DOP020Callback; EOP010Callback EOP010Callback; EOP020Callback EOP020Callback; EOP030Callback EOP030Callback; EOP040Callback EOP040Callback; EOP050Callback EOP050Callback; EOP060Callback EOP060Callback; EOP070Callback EOP070Callback; EOP080Callback EOP080Callback; EOP090Callback EOP090Callback; EOP090BCallback EOP090BCallback; StateCallback StateCallback; public InitCallback(MiloService miloService, ProductionOrdeInfoService productionOrdeInfoService, PassingStationCollectionService passingStationCollectionService, ParamCollectionService paramCollectionService, CollectionParamConfService collectionParamConfService, SerialNumbersConfService serialNumbersConfService, EquipmentStatusService equipmentStatusService, EquipmentAlarmService equipmentAlarmService, MaterialTraceabilityService materialTraceabilityService, EquipmentInfoService equipmentInfoService, RepairManageInfoService repairManageInfoService, LocationInfoService locationInfoService, GreaseManageService greaseManageService, ProductionOrderRecordsService productionOrderRecordsService, ProductionOrderBatchInfoService productionOrderBatchInfoService) { this.miloService = miloService; this.productionOrdeInfoService = productionOrdeInfoService; this.passingStationCollectionService = passingStationCollectionService; this.paramCollectionService = paramCollectionService; this.collectionParamConfService = collectionParamConfService; this.serialNumbersConfService = serialNumbersConfService; this.equipmentStatusService = equipmentStatusService; this.equipmentAlarmService = equipmentAlarmService; this.materialTraceabilityService = materialTraceabilityService; this.equipmentInfoService = equipmentInfoService; this.repairManageInfoService = repairManageInfoService; this.locationInfoService = locationInfoService; this.greaseManageService = greaseManageService; this.productionOrderRecordsService = productionOrderRecordsService; this.productionOrderBatchInfoService = productionOrderBatchInfoService; OP010Callback = new OP010Callback(miloService,productionOrdeInfoService, passingStationCollectionService,paramCollectionService,collectionParamConfService,serialNumbersConfService, equipmentStatusService,equipmentAlarmService,materialTraceabilityService,equipmentInfoService, repairManageInfoService,locationInfoService,greaseManageService,productionOrderRecordsService, productionOrderBatchInfoService); OP020Callback = new OP020Callback(miloService,productionOrdeInfoService, passingStationCollectionService,paramCollectionService,collectionParamConfService,serialNumbersConfService, equipmentStatusService,equipmentAlarmService,materialTraceabilityService,equipmentInfoService, repairManageInfoService,locationInfoService,greaseManageService,productionOrderRecordsService, productionOrderBatchInfoService); OP030Callback = new OP030Callback(miloService,productionOrdeInfoService, passingStationCollectionService,paramCollectionService,collectionParamConfService,serialNumbersConfService, equipmentStatusService,equipmentAlarmService,materialTraceabilityService,equipmentInfoService, repairManageInfoService,locationInfoService,greaseManageService,productionOrderRecordsService, productionOrderBatchInfoService); OP040Callback = new OP040Callback(miloService,productionOrdeInfoService, passingStationCollectionService,paramCollectionService,collectionParamConfService,serialNumbersConfService, equipmentStatusService,equipmentAlarmService,materialTraceabilityService,equipmentInfoService, repairManageInfoService,locationInfoService,greaseManageService,productionOrderRecordsService, productionOrderBatchInfoService); OP050Callback = new OP050Callback(miloService,productionOrdeInfoService, passingStationCollectionService,paramCollectionService,collectionParamConfService,serialNumbersConfService, equipmentStatusService,equipmentAlarmService,materialTraceabilityService,equipmentInfoService, repairManageInfoService,locationInfoService,greaseManageService,productionOrderRecordsService, productionOrderBatchInfoService); /* OP060Callback = new OP060Callback(miloService,productionOrdeInfoService, passingStationCollectionService,paramCollectionService,collectionParamConfService,serialNumbersConfService, equipmentStatusService,equipmentAlarmService,materialTraceabilityService,equipmentInfoService, repairManageInfoService,locationInfoService,greaseManageService,productionOrderRecordsService, productionOrderBatchInfoService);*/ OP070Callback = new OP070Callback(miloService,productionOrdeInfoService, passingStationCollectionService,paramCollectionService,collectionParamConfService,serialNumbersConfService, equipmentStatusService,equipmentAlarmService,materialTraceabilityService,equipmentInfoService, repairManageInfoService,locationInfoService,greaseManageService,productionOrderRecordsService, productionOrderBatchInfoService); OP080Callback = new OP080Callback(miloService,productionOrdeInfoService, passingStationCollectionService,paramCollectionService,collectionParamConfService,serialNumbersConfService, equipmentStatusService,equipmentAlarmService,materialTraceabilityService,equipmentInfoService, repairManageInfoService,locationInfoService,greaseManageService,productionOrderRecordsService, productionOrderBatchInfoService); OP090Callback = new OP090Callback(miloService,productionOrdeInfoService, passingStationCollectionService,paramCollectionService,collectionParamConfService,serialNumbersConfService, equipmentStatusService,equipmentAlarmService,materialTraceabilityService,equipmentInfoService, repairManageInfoService,locationInfoService,greaseManageService,productionOrderRecordsService, productionOrderBatchInfoService); OP100Callback = new OP100Callback(miloService,productionOrdeInfoService, passingStationCollectionService,paramCollectionService,collectionParamConfService,serialNumbersConfService, equipmentStatusService,equipmentAlarmService,materialTraceabilityService,equipmentInfoService, repairManageInfoService,locationInfoService,greaseManageService,productionOrderRecordsService, productionOrderBatchInfoService); OP110Callback = new OP110Callback(miloService,productionOrdeInfoService, passingStationCollectionService,paramCollectionService,collectionParamConfService,serialNumbersConfService, equipmentStatusService,equipmentAlarmService,materialTraceabilityService,equipmentInfoService, repairManageInfoService,locationInfoService,greaseManageService,productionOrderRecordsService, productionOrderBatchInfoService); OP120Callback = new OP120Callback(miloService,productionOrdeInfoService, passingStationCollectionService,paramCollectionService,collectionParamConfService,serialNumbersConfService, equipmentStatusService,equipmentAlarmService,materialTraceabilityService,equipmentInfoService, repairManageInfoService,locationInfoService,greaseManageService,productionOrderRecordsService, productionOrderBatchInfoService); OP120BCallback = new OP120BCallback(miloService,productionOrdeInfoService, passingStationCollectionService,paramCollectionService,collectionParamConfService,serialNumbersConfService, equipmentStatusService,equipmentAlarmService,materialTraceabilityService,equipmentInfoService, repairManageInfoService,locationInfoService,greaseManageService,productionOrderRecordsService, productionOrderBatchInfoService); OP130Callback = new OP130Callback(miloService,productionOrdeInfoService, passingStationCollectionService,paramCollectionService,collectionParamConfService,serialNumbersConfService, equipmentStatusService,equipmentAlarmService,materialTraceabilityService,equipmentInfoService, repairManageInfoService,locationInfoService,greaseManageService,productionOrderRecordsService, productionOrderBatchInfoService); OP130BCallback = new OP130BCallback(miloService,productionOrdeInfoService, passingStationCollectionService,paramCollectionService,collectionParamConfService,serialNumbersConfService, equipmentStatusService,equipmentAlarmService,materialTraceabilityService,equipmentInfoService, repairManageInfoService,locationInfoService,greaseManageService,productionOrderRecordsService, productionOrderBatchInfoService); OP140Callback = new OP140Callback(miloService,productionOrdeInfoService, passingStationCollectionService,paramCollectionService,collectionParamConfService,serialNumbersConfService, equipmentStatusService,equipmentAlarmService,materialTraceabilityService,equipmentInfoService, repairManageInfoService,locationInfoService,greaseManageService,productionOrderRecordsService, productionOrderBatchInfoService); OP150Callback = new OP150Callback(miloService,productionOrdeInfoService, passingStationCollectionService,paramCollectionService,collectionParamConfService,serialNumbersConfService, equipmentStatusService,equipmentAlarmService,materialTraceabilityService,equipmentInfoService, repairManageInfoService,locationInfoService,greaseManageService,productionOrderRecordsService, productionOrderBatchInfoService); OP160Callback = new OP160Callback(miloService,productionOrdeInfoService, passingStationCollectionService,paramCollectionService,collectionParamConfService,serialNumbersConfService, equipmentStatusService,equipmentAlarmService,materialTraceabilityService,equipmentInfoService, repairManageInfoService,locationInfoService,greaseManageService,productionOrderRecordsService, productionOrderBatchInfoService); OP170Callback = new OP170Callback(miloService,productionOrdeInfoService, passingStationCollectionService,paramCollectionService,collectionParamConfService,serialNumbersConfService, equipmentStatusService,equipmentAlarmService,materialTraceabilityService,equipmentInfoService, repairManageInfoService,locationInfoService,greaseManageService,productionOrderRecordsService, productionOrderBatchInfoService); COP010Callback = new COP010Callback(miloService,productionOrdeInfoService, passingStationCollectionService,paramCollectionService,collectionParamConfService,serialNumbersConfService, equipmentStatusService,equipmentAlarmService,materialTraceabilityService,equipmentInfoService, repairManageInfoService,locationInfoService,greaseManageService,productionOrderRecordsService, productionOrderBatchInfoService); COP020Callback = new COP020Callback(miloService,productionOrdeInfoService, passingStationCollectionService,paramCollectionService,collectionParamConfService,serialNumbersConfService, equipmentStatusService,equipmentAlarmService,materialTraceabilityService,equipmentInfoService, repairManageInfoService,locationInfoService,greaseManageService,productionOrderRecordsService, productionOrderBatchInfoService); COP030Callback = new COP030Callback(miloService,productionOrdeInfoService, passingStationCollectionService,paramCollectionService,collectionParamConfService,serialNumbersConfService, equipmentStatusService,equipmentAlarmService,materialTraceabilityService,equipmentInfoService, repairManageInfoService,locationInfoService,greaseManageService,productionOrderRecordsService, productionOrderBatchInfoService); BOP010Callback = new BOP010Callback(miloService,productionOrdeInfoService, passingStationCollectionService,paramCollectionService,collectionParamConfService,serialNumbersConfService, equipmentStatusService,equipmentAlarmService,materialTraceabilityService,equipmentInfoService, repairManageInfoService,locationInfoService,greaseManageService,productionOrderRecordsService, productionOrderBatchInfoService); BOP020Callback = new BOP020Callback(miloService,productionOrdeInfoService, passingStationCollectionService,paramCollectionService,collectionParamConfService,serialNumbersConfService, equipmentStatusService,equipmentAlarmService,materialTraceabilityService,equipmentInfoService, repairManageInfoService,locationInfoService,greaseManageService,productionOrderRecordsService, productionOrderBatchInfoService); BOP030Callback = new BOP030Callback(miloService,productionOrdeInfoService, passingStationCollectionService,paramCollectionService,collectionParamConfService,serialNumbersConfService, equipmentStatusService,equipmentAlarmService,materialTraceabilityService,equipmentInfoService, repairManageInfoService,locationInfoService,greaseManageService,productionOrderRecordsService, productionOrderBatchInfoService); BOP030BCallback = new BOP030BCallback(miloService,productionOrdeInfoService, passingStationCollectionService,paramCollectionService,collectionParamConfService,serialNumbersConfService, equipmentStatusService,equipmentAlarmService,materialTraceabilityService,equipmentInfoService, repairManageInfoService,locationInfoService,greaseManageService,productionOrderRecordsService, productionOrderBatchInfoService); BOP040Callback = new BOP040Callback(miloService,productionOrdeInfoService, passingStationCollectionService,paramCollectionService,collectionParamConfService,serialNumbersConfService, equipmentStatusService,equipmentAlarmService,materialTraceabilityService,equipmentInfoService, repairManageInfoService,locationInfoService,greaseManageService,productionOrderRecordsService, productionOrderBatchInfoService); BOP040BCallback = new BOP040BCallback(miloService,productionOrdeInfoService, passingStationCollectionService,paramCollectionService,collectionParamConfService,serialNumbersConfService, equipmentStatusService,equipmentAlarmService,materialTraceabilityService,equipmentInfoService, repairManageInfoService,locationInfoService,greaseManageService,productionOrderRecordsService, productionOrderBatchInfoService); DOP010Callback = new DOP010Callback(miloService,productionOrdeInfoService, passingStationCollectionService,paramCollectionService,collectionParamConfService,serialNumbersConfService, equipmentStatusService,equipmentAlarmService,materialTraceabilityService,equipmentInfoService, repairManageInfoService,locationInfoService,greaseManageService,productionOrderRecordsService, productionOrderBatchInfoService); DOP020Callback = new DOP020Callback(miloService,productionOrdeInfoService, passingStationCollectionService,paramCollectionService,collectionParamConfService,serialNumbersConfService, equipmentStatusService,equipmentAlarmService,materialTraceabilityService,equipmentInfoService, repairManageInfoService,locationInfoService,greaseManageService,productionOrderRecordsService, productionOrderBatchInfoService); EOP010Callback = new EOP010Callback(miloService,productionOrdeInfoService, passingStationCollectionService,paramCollectionService,collectionParamConfService,serialNumbersConfService, equipmentStatusService,equipmentAlarmService,materialTraceabilityService,equipmentInfoService, repairManageInfoService,locationInfoService,greaseManageService,productionOrderRecordsService, productionOrderBatchInfoService); EOP020Callback = new EOP020Callback(miloService,productionOrdeInfoService, passingStationCollectionService,paramCollectionService,collectionParamConfService,serialNumbersConfService, equipmentStatusService,equipmentAlarmService,materialTraceabilityService,equipmentInfoService, repairManageInfoService,locationInfoService,greaseManageService,productionOrderRecordsService, productionOrderBatchInfoService); EOP030Callback = new EOP030Callback(miloService,productionOrdeInfoService, passingStationCollectionService,paramCollectionService,collectionParamConfService,serialNumbersConfService, equipmentStatusService,equipmentAlarmService,materialTraceabilityService,equipmentInfoService, repairManageInfoService,locationInfoService,greaseManageService,productionOrderRecordsService, productionOrderBatchInfoService); EOP040Callback = new EOP040Callback(miloService,productionOrdeInfoService, passingStationCollectionService,paramCollectionService,collectionParamConfService,serialNumbersConfService, equipmentStatusService,equipmentAlarmService,materialTraceabilityService,equipmentInfoService, repairManageInfoService,locationInfoService,greaseManageService,productionOrderRecordsService, productionOrderBatchInfoService); EOP050Callback = new EOP050Callback(miloService,productionOrdeInfoService, passingStationCollectionService,paramCollectionService,collectionParamConfService,serialNumbersConfService, equipmentStatusService,equipmentAlarmService,materialTraceabilityService,equipmentInfoService, repairManageInfoService,locationInfoService,greaseManageService,productionOrderRecordsService, productionOrderBatchInfoService); EOP060Callback = new EOP060Callback(miloService,productionOrdeInfoService, passingStationCollectionService,paramCollectionService,collectionParamConfService,serialNumbersConfService, equipmentStatusService,equipmentAlarmService,materialTraceabilityService,equipmentInfoService, repairManageInfoService,locationInfoService,greaseManageService,productionOrderRecordsService, productionOrderBatchInfoService); EOP070Callback = new EOP070Callback(miloService,productionOrdeInfoService, passingStationCollectionService,paramCollectionService,collectionParamConfService,serialNumbersConfService, equipmentStatusService,equipmentAlarmService,materialTraceabilityService,equipmentInfoService, repairManageInfoService,locationInfoService,greaseManageService,productionOrderRecordsService, productionOrderBatchInfoService); EOP080Callback = new EOP080Callback(miloService,productionOrdeInfoService, passingStationCollectionService,paramCollectionService,collectionParamConfService,serialNumbersConfService, equipmentStatusService,equipmentAlarmService,materialTraceabilityService,equipmentInfoService, repairManageInfoService,locationInfoService,greaseManageService,productionOrderRecordsService, productionOrderBatchInfoService); EOP090Callback = new EOP090Callback(miloService,productionOrdeInfoService, passingStationCollectionService,paramCollectionService,collectionParamConfService,serialNumbersConfService, equipmentStatusService,equipmentAlarmService,materialTraceabilityService,equipmentInfoService, repairManageInfoService,locationInfoService,greaseManageService,productionOrderRecordsService, productionOrderBatchInfoService); EOP090BCallback = new EOP090BCallback(miloService,productionOrdeInfoService, passingStationCollectionService,paramCollectionService,collectionParamConfService,serialNumbersConfService, equipmentStatusService,equipmentAlarmService,materialTraceabilityService,equipmentInfoService, repairManageInfoService,locationInfoService,greaseManageService,productionOrderRecordsService, productionOrderBatchInfoService); StateCallback = new StateCallback(miloService,productionOrdeInfoService, passingStationCollectionService,paramCollectionService,collectionParamConfService,serialNumbersConfService, equipmentStatusService,equipmentAlarmService,materialTraceabilityService,equipmentInfoService, repairManageInfoService,locationInfoService,greaseManageService,productionOrderRecordsService, productionOrderBatchInfoService); } @Override public void onSubscribe(String identifier, Object value) { String ecpStr = "";//异常记录标记 try { if(null != value) { //OP010 //心跳 if (identifier.equals(OPCElement.OP010_F_HEART_BEAT) && null != value && "false".equals(value.toString())) { ReadWriteEntity entity = new ReadWriteEntity(OPCElement.OP010_F_HEART_BEAT, true); miloService.writeToOpcUa(entity); } //PLC进站 else if (identifier.equals(OPCElement.OP010_J_PLC_START) && null != value && "true".equals(value.toString())) { String isRepair = miloService.readFromOpcUa(OPCElement.OP010_P_REPAIR).getValue().toString();//是否返修 if (isRepair.equals("true")) { OP010Callback.handleRepair(); } else { OP010Callback.handleOrder(); } } //PLC出站 else if (identifier.equals(OPCElement.OP010_J_PLC_FINISH) && null != value && "true".equals(value.toString())) { OP010Callback.handleFinsh(); OP010Callback.handleMaterial(); } //OP020 //心跳 else if (identifier.equals(OPCElement.OP020_F_HEART_BEAT) && null != value && "false".equals(value.toString())) { ReadWriteEntity entity = new ReadWriteEntity(OPCElement.OP020_F_HEART_BEAT, true); miloService.writeToOpcUa(entity); } //PLC进站 else if (identifier.equals(OPCElement.OP020_J_PLC_START) && null != value && "true".equals(value.toString())) { OP020Callback.handleOrder(); } //PLC出站 else if (identifier.equals(OPCElement.OP020_J_PLC_FINISH) && null != value && "true".equals(value.toString())) { OP020Callback.handleFinsh(); OP020Callback.handleMaterial(); OP020Callback.handleInfo(); } //OP030 //心跳 else if (identifier.equals(OPCElement.OP030_F_HEART_BEAT) && null != value && "false".equals(value.toString())) { ReadWriteEntity entity = new ReadWriteEntity(OPCElement.OP030_F_HEART_BEAT, true); miloService.writeToOpcUa(entity); } //PLC进站 else if (identifier.equals(OPCElement.OP030_J_PLC_START) && null != value && "true".equals(value.toString())) { OP030Callback.handleOrder(); } //PLC出站 else if (identifier.equals(OPCElement.OP030_J_PLC_FINISH) && null != value && "true".equals(value.toString())) { OP030Callback.handleFinsh(); OP030Callback.handleMaterial(); OP030Callback.handleInfo(); } //OP040 //心跳 else if (identifier.equals(OPCElement.OP040_F_HEART_BEAT) && null != value && "false".equals(value.toString())) { ReadWriteEntity entity = new ReadWriteEntity(OPCElement.OP040_F_HEART_BEAT, true); miloService.writeToOpcUa(entity); } //PLC进站 else if (identifier.equals(OPCElement.OP040_J_PLC_START) && null != value && "true".equals(value.toString())) { OP040Callback.handleOrder(); } //PLC出站 else if (identifier.equals(OPCElement.OP040_J_PLC_FINISH) && null != value && "true".equals(value.toString())) { OP040Callback.handleFinsh(); OP040Callback.handleMaterial(); OP040Callback.handleInfo(); } //OP050 //心跳 else if (identifier.equals(OPCElement.OP050_F_HEART_BEAT) && null != value && "false".equals(value.toString())) { ReadWriteEntity entity = new ReadWriteEntity(OPCElement.OP050_F_HEART_BEAT, true); miloService.writeToOpcUa(entity); } //PLC进站 else if (identifier.equals(OPCElement.OP050_J_PLC_START) && null != value && "true".equals(value.toString())) { OP050Callback.handleOrder(); } //PLC出站 else if (identifier.equals(OPCElement.OP050_J_PLC_FINISH) && null != value && "true".equals(value.toString())) { OP050Callback.handleFinsh(); OP050Callback.handleInfo(); OP050Callback.handleMaterial(); } //OP070 //心跳 else if (identifier.equals(OPCElement.OP070_F_HEART_BEAT) && null != value && "false".equals(value.toString())) { ReadWriteEntity entity = new ReadWriteEntity(OPCElement.OP070_F_HEART_BEAT, true); miloService.writeToOpcUa(entity); } //PLC进站 else if (identifier.equals(OPCElement.OP070_J_PLC_START) && null != value && "true".equals(value.toString())) { OP070Callback.handleOrder(); } //PLC出站 else if (identifier.equals(OPCElement.OP070_J_PLC_FINISH) && null != value && "true".equals(value.toString())) { OP070Callback.handleFinsh(); OP070Callback.handleMaterial(); OP070Callback.handleInfo(); } //OP080 //心跳 else if (identifier.equals(OPCElement.OP080_F_HEART_BEAT) && null != value && "false".equals(value.toString())) { ReadWriteEntity entity = new ReadWriteEntity(OPCElement.OP080_F_HEART_BEAT, true); miloService.writeToOpcUa(entity); } //PLC进站 else if (identifier.equals(OPCElement.OP080_J_PLC_START) && null != value && "true".equals(value.toString())) { String isRepair = miloService.readFromOpcUa(OPCElement.OP080_P_REPAIR).getValue().toString();//是否返修 if (isRepair.equals("true")) { OP080Callback.handleRepair(); } else { OP080Callback.handleOrder(); } } //PLC出站 else if (identifier.equals(OPCElement.OP080_J_PLC_FINISH) && null != value && "true".equals(value.toString())) { OP080Callback.handleFinsh(); OP080Callback.handleInfo(); OP080Callback.handleMaterial(); } //OP090 //心跳 else if (identifier.equals(OPCElement.OP090_F_HEART_BEAT) && null != value && "false".equals(value.toString())) { ReadWriteEntity entity = new ReadWriteEntity(OPCElement.OP090_F_HEART_BEAT, true); miloService.writeToOpcUa(entity); } //PLC进站 else if (identifier.equals(OPCElement.OP090_J_PLC_START) && null != value && "true".equals(value.toString())) { OP090Callback.handleOrder(); } //PLC出站 else if (identifier.equals(OPCElement.OP090_J_PLC_FINISH) && null != value && "true".equals(value.toString())) { OP090Callback.handleFinsh(); OP090Callback.handleMaterial(); OP090Callback.handleInfo(); } //OP100 //心跳 else if (identifier.equals(OPCElement.OP100_F_HEART_BEAT) && null != value && "false".equals(value.toString())) { ReadWriteEntity entity = new ReadWriteEntity(OPCElement.OP100_F_HEART_BEAT, true); miloService.writeToOpcUa(entity); } //PLC进站 else if (identifier.equals(OPCElement.OP100_J_PLC_START) && null != value && "true".equals(value.toString())) { OP100Callback.handleOrder(); } //PLC出站 else if (identifier.equals(OPCElement.OP100_J_PLC_FINISH) && null != value && "true".equals(value.toString())) { OP100Callback.handleMaterial(); OP100Callback.handleInfo(); OP100Callback.handleFinsh(); } //OP110 //心跳 else if (identifier.equals(OPCElement.OP110_F_HEART_BEAT) && null != value && "false".equals(value.toString())) { ReadWriteEntity entity = new ReadWriteEntity(OPCElement.OP110_F_HEART_BEAT, true); miloService.writeToOpcUa(entity); } //PLC进站 else if (identifier.equals(OPCElement.OP110_J_PLC_START) && null != value && "true".equals(value.toString())) { OP110Callback.handleOrder(); } //PLC出站 else if (identifier.equals(OPCElement.OP110_J_PLC_FINISH) && null != value && "true".equals(value.toString())) { OP110Callback.handleFinsh(); OP110Callback.handleMaterial(); OP110Callback.handleInfo(); } //OP120 //心跳 else if (identifier.equals(OPCElement.OP120_F_HEART_BEAT) && null != value && "false".equals(value.toString())) { ReadWriteEntity entity = new ReadWriteEntity(OPCElement.OP120_F_HEART_BEAT, true); miloService.writeToOpcUa(entity); } //PLC进站 else if (identifier.equals(OPCElement.OP120_J_PLC_START) && null != value && "true".equals(value.toString())) { OP120Callback.handleOrder(); } //PLC出站 else if (identifier.equals(OPCElement.OP120_J_PLC_FINISH) && null != value && "true".equals(value.toString())) { OP120Callback.handleFinsh(); OP120Callback.handleMaterial(); OP120Callback.handleInfo(); } //OP120B //心跳 else if (identifier.equals(OPCElement.OP120B_F_HEART_BEAT) && null != value && "false".equals(value.toString())) { ReadWriteEntity entity = new ReadWriteEntity(OPCElement.OP120B_F_HEART_BEAT, true); miloService.writeToOpcUa(entity); } //PLC进站 else if (identifier.equals(OPCElement.OP120B_J_PLC_START) && null != value && "true".equals(value.toString())) { OP120BCallback.handleOrder(); } //PLC出站 else if (identifier.equals(OPCElement.OP120B_J_PLC_FINISH) && null != value && "true".equals(value.toString())) { OP120BCallback.handleFinsh(); //OP120BCallback.handleMaterial(); //OP120BCallback.handleInfo(); } //OP130 //心跳 else if (identifier.equals(OPCElement.OP130_F_HEART_BEAT) && null != value && "false".equals(value.toString())) { ReadWriteEntity entity = new ReadWriteEntity(OPCElement.OP130_F_HEART_BEAT, true); miloService.writeToOpcUa(entity); } //PLC进站 else if (identifier.equals(OPCElement.OP130_J_PLC_START) && null != value && "true".equals(value.toString())) { OP130Callback.handleOrder(); } //PLC出站 else if (identifier.equals(OPCElement.OP130_J_PLC_FINISH) && null != value && "true".equals(value.toString())) { OP130Callback.handleFinsh(); OP130Callback.handleMaterial(); OP130Callback.handleInfo(); } //OP130B //心跳 else if (identifier.equals(OPCElement.OP130B_F_HEART_BEAT) && null != value && "false".equals(value.toString())) { ReadWriteEntity entity = new ReadWriteEntity(OPCElement.OP130B_F_HEART_BEAT, true); miloService.writeToOpcUa(entity); } //PLC进站 else if (identifier.equals(OPCElement.OP130B_J_PLC_START) && null != value && "true".equals(value.toString())) { OP130BCallback.handleOrder(); } //PLC出站 else if (identifier.equals(OPCElement.OP130B_J_PLC_FINISH) && null != value && "true".equals(value.toString())) { OP130BCallback.handleFinsh(); OP130BCallback.handleMaterial(); OP130BCallback.handleInfo(); } //OP140 //心跳 else if (identifier.equals(OPCElement.OP140_F_HEART_BEAT) && null != value && "false".equals(value.toString())) { ReadWriteEntity entity = new ReadWriteEntity(OPCElement.OP140_F_HEART_BEAT, true); miloService.writeToOpcUa(entity); } //PLC进站 else if (identifier.equals(OPCElement.OP140_J_PLC_START) && null != value && "true".equals(value.toString())) { OP140Callback.handleOrder(); } //PLC出站 else if (identifier.equals(OPCElement.OP140_J_PLC_FINISH) && null != value && "true".equals(value.toString())) { OP140Callback.handleFinsh(); OP140Callback.handleMaterial(); OP140Callback.handleInfo(); } //OP150 //心跳 else if (identifier.equals(OPCElement.OP150_F_HEART_BEAT) && null != value && "false".equals(value.toString())) { ReadWriteEntity entity = new ReadWriteEntity(OPCElement.OP150_F_HEART_BEAT, true); miloService.writeToOpcUa(entity); } //PLC进站 else if (identifier.equals(OPCElement.OP150_J_PLC_START) && null != value && "true".equals(value.toString())) { OP150Callback.handleOrder(); } //PLC出站 else if (identifier.equals(OPCElement.OP150_J_PLC_FINISH) && null != value && "true".equals(value.toString())) { OP150Callback.handleFinsh(); OP150Callback.handleMaterial(); OP150Callback.handleInfo(); } //OP160 //心跳 else if (identifier.equals(OPCElement.OP160_F_HEART_BEAT) && null != value && "false".equals(value.toString())) { ReadWriteEntity entity = new ReadWriteEntity(OPCElement.OP160_F_HEART_BEAT, true); miloService.writeToOpcUa(entity); } //PLC进站 else if (identifier.equals(OPCElement.OP160_J_PLC_START) && null != value && "true".equals(value.toString())) { OP160Callback.handleOrder(); } //PLC出站 else if (identifier.equals(OPCElement.OP160_J_PLC_FINISH) && null != value && "true".equals(value.toString())) { OP160Callback.handleFinsh(); OP160Callback.handleMaterial(); OP160Callback.handleInfo(); } //OP170 //心跳 else if (identifier.equals(OPCElement.OP170_F_HEART_BEAT) && null != value && "false".equals(value.toString())) { ReadWriteEntity entity = new ReadWriteEntity(OPCElement.OP170_F_HEART_BEAT, true); miloService.writeToOpcUa(entity); } //PLC进站 else if (identifier.equals(OPCElement.OP170_J_PLC_START) && null != value && "true".equals(value.toString())) { OP170Callback.handleOrder(); } //PLC出站 else if (identifier.equals(OPCElement.OP170_J_PLC_FINISH) && null != value && "true".equals(value.toString())) { OP170Callback.handleFinsh(); OP170Callback.handleMaterial(); //OP170Callback.handleInfo(); } //BOP010 //心跳 else if (identifier.equals(OPCElement.BOP010_F_HEART_BEAT) && null != value && "false".equals(value.toString())) { ReadWriteEntity entity = new ReadWriteEntity(OPCElement.BOP010_F_HEART_BEAT, true); miloService.writeToOpcUa(entity); } //PLC进站 else if (identifier.equals(OPCElement.BOP010_J_PLC_START) && null != value && "true".equals(value.toString())) { String isRepair = miloService.readFromOpcUa(OPCElement.BOP010_P_REPAIR).getValue().toString();//是否返修 if (isRepair.equals("true")) { BOP010Callback.handleRepair(); } else { BOP010Callback.handleOrder(); } } //PLC出站 else if (identifier.equals(OPCElement.BOP010_J_PLC_FINISH) && null != value && "true".equals(value.toString())) { BOP010Callback.handleFinsh(); BOP010Callback.handleMaterial(); //BOP010Callback.handleInfo(); } //BOP020 //心跳 else if (identifier.equals(OPCElement.BOP020_F_HEART_BEAT) && null != value && "false".equals(value.toString())) { ReadWriteEntity entity = new ReadWriteEntity(OPCElement.BOP020_F_HEART_BEAT, true); miloService.writeToOpcUa(entity); } //PLC进站 else if (identifier.equals(OPCElement.BOP020_J_PLC_START) && null != value && "true".equals(value.toString())) { BOP020Callback.handleOrder(); } //PLC出站 else if (identifier.equals(OPCElement.BOP020_J_PLC_FINISH) && null != value && "true".equals(value.toString())) { BOP020Callback.handleFinsh(); BOP020Callback.handleMaterial(); BOP020Callback.handleInfo(); } //BOP030 //心跳 else if (identifier.equals(OPCElement.BOP030_F_HEART_BEAT) && null != value && "false".equals(value.toString())) { ReadWriteEntity entity = new ReadWriteEntity(OPCElement.BOP030_F_HEART_BEAT, true); miloService.writeToOpcUa(entity); } //PLC进站 else if (identifier.equals(OPCElement.BOP030_J_PLC_START) && null != value && "true".equals(value.toString())) { BOP030Callback.handleOrder(); } //PLC出站 else if (identifier.equals(OPCElement.BOP030_J_PLC_FINISH) && null != value && "true".equals(value.toString())) { BOP030Callback.handleFinsh(); BOP030Callback.handleMaterial(); BOP030Callback.handleInfo(); } //BOP030B //心跳 else if (identifier.equals(OPCElement.BOP030B_F_HEART_BEAT) && null != value && "false".equals(value.toString())) { ReadWriteEntity entity = new ReadWriteEntity(OPCElement.BOP030B_F_HEART_BEAT, true); miloService.writeToOpcUa(entity); } //PLC进站 else if (identifier.equals(OPCElement.BOP030B_J_PLC_START) && null != value && "true".equals(value.toString())) { BOP030BCallback.handleOrder(); } //PLC出站 else if (identifier.equals(OPCElement.BOP030B_J_PLC_FINISH) && null != value && "true".equals(value.toString())) { BOP030BCallback.handleFinsh(); //BOP030BCallback.handleMaterial(); //BOP030BCallback.handleInfo(); } //BOP040 //心跳 else if (identifier.equals(OPCElement.BOP040_F_HEART_BEAT) && null != value && "false".equals(value.toString())) { ReadWriteEntity entity = new ReadWriteEntity(OPCElement.BOP040_F_HEART_BEAT, true); miloService.writeToOpcUa(entity); } //PLC进站 else if (identifier.equals(OPCElement.BOP040_J_PLC_START) && null != value && "true".equals(value.toString())) { BOP040Callback.handleOrder(); } //PLC出站 else if (identifier.equals(OPCElement.BOP040_J_PLC_FINISH) && null != value && "true".equals(value.toString())) { BOP040Callback.handleFinsh(); BOP040Callback.handleMaterial(); BOP040Callback.handleInfo(); } //BOP040B //心跳 else if (identifier.equals(OPCElement.BOP040B_F_HEART_BEAT) && null != value && "false".equals(value.toString())) { ReadWriteEntity entity = new ReadWriteEntity(OPCElement.BOP040B_F_HEART_BEAT, true); miloService.writeToOpcUa(entity); } //PLC进站 else if (identifier.equals(OPCElement.BOP040B_J_PLC_START) && null != value && "true".equals(value.toString())) { BOP040BCallback.handleOrder(); } //PLC出站 else if (identifier.equals(OPCElement.BOP040B_J_PLC_FINISH) && null != value && "true".equals(value.toString())) { BOP040BCallback.handleFinsh(); // BOP040BCallback.handleMaterial(); //BOP040BCallback.handleInfo(); } //COP010 //心跳 else if (identifier.equals(OPCElement.COP010_F_HEART_BEAT) && null != value && "false".equals(value.toString())) { ReadWriteEntity entity = new ReadWriteEntity(OPCElement.COP010_F_HEART_BEAT, true); miloService.writeToOpcUa(entity); } //PLC进站 else if (identifier.equals(OPCElement.COP010_J_PLC_START) && null != value && "true".equals(value.toString())) { String isRepair = miloService.readFromOpcUa(OPCElement.COP010_P_REPAIR).getValue().toString();//是否返修 if (isRepair.equals("true")) { COP010Callback.handleRepair(); } else { COP010Callback.handleOrder(); } } //PLC出站 else if (identifier.equals(OPCElement.COP010_J_PLC_FINISH) && null != value && "true".equals(value.toString())) { COP010Callback.handleFinsh(); COP010Callback.handleMaterial(); //COP010Callback.handleInfo(); } //COP020 //心跳 else if (identifier.equals(OPCElement.COP020_F_HEART_BEAT) && null != value && "false".equals(value.toString())) { ReadWriteEntity entity = new ReadWriteEntity(OPCElement.COP020_F_HEART_BEAT, true); miloService.writeToOpcUa(entity); } //PLC进站 else if (identifier.equals(OPCElement.COP020_J_PLC_START) && null != value && "true".equals(value.toString())) { COP020Callback.handleOrder(); } //PLC出站 else if (identifier.equals(OPCElement.COP020_J_PLC_FINISH) && null != value && "true".equals(value.toString())) { COP020Callback.handleFinsh(); COP020Callback.handleMaterial(); COP020Callback.handleInfo(); } //COP030 //心跳 else if (identifier.equals(OPCElement.COP030_F_HEART_BEAT) && null != value && "false".equals(value.toString())) { ReadWriteEntity entity = new ReadWriteEntity(OPCElement.COP030_F_HEART_BEAT, true); miloService.writeToOpcUa(entity); } //PLC进站 else if (identifier.equals(OPCElement.COP030_J_PLC_START) && null != value && "true".equals(value.toString())) { COP030Callback.handleOrder(); } //PLC出站 else if (identifier.equals(OPCElement.COP030_J_PLC_FINISH) && null != value && "true".equals(value.toString())) { COP030Callback.handleFinsh(); COP030Callback.handleMaterial(); COP030Callback.handleInfo(); } //DOP010 //心跳 else if (identifier.equals(OPCElement.DOP010_F_HEART_BEAT) && null != value && "false".equals(value.toString())) { ReadWriteEntity entity = new ReadWriteEntity(OPCElement.DOP010_F_HEART_BEAT, true); miloService.writeToOpcUa(entity); } //PLC进站 else if (identifier.equals(OPCElement.DOP010_J_PLC_START) && null != value && "true".equals(value.toString())) { String isRepair = miloService.readFromOpcUa(OPCElement.DOP010_P_REPAIR).getValue().toString();//是否返修 if (isRepair.equals("true")) { DOP010Callback.handleRepair(); } else { DOP010Callback.handleOrder(); } } //PLC出站 else if (identifier.equals(OPCElement.DOP010_J_PLC_FINISH) && null != value && "true".equals(value.toString())) { DOP010Callback.handleFinsh(); DOP010Callback.handleMaterial(); //DOP010Callback.handleInfo(); } //DOP020 //心跳 else if (identifier.equals(OPCElement.DOP020_F_HEART_BEAT) && null != value && "false".equals(value.toString())) { ReadWriteEntity entity = new ReadWriteEntity(OPCElement.DOP020_F_HEART_BEAT, true); miloService.writeToOpcUa(entity); } //PLC进站 else if (identifier.equals(OPCElement.DOP020_J_PLC_START) && null != value && "true".equals(value.toString())) { DOP020Callback.handleOrder(); } //PLC出站 else if (identifier.equals(OPCElement.DOP020_J_PLC_FINISH) && null != value && "true".equals(value.toString())) { DOP020Callback.handleFinsh(); DOP020Callback.handleMaterial(); DOP020Callback.handleInfo(); } //EOP010 //心跳 else if (identifier.equals(OPCElement.EOP010_F_HEART_BEAT) && null != value && "false".equals(value.toString())) { ReadWriteEntity entity = new ReadWriteEntity(OPCElement.EOP010_F_HEART_BEAT, true); miloService.writeToOpcUa(entity); } //PLC进站 else if (identifier.equals(OPCElement.EOP010_J_PLC_START) && null != value && "true".equals(value.toString())) { EOP010Callback.handleOrder(); } //PLC出站 else if (identifier.equals(OPCElement.EOP010_J_PLC_FINISH) && null != value && "true".equals(value.toString())) { EOP010Callback.handleFinsh(); EOP010Callback.handleMaterial(); EOP010Callback.handleInfo(); } //EOP020 //心跳 else if (identifier.equals(OPCElement.EOP020_F_HEART_BEAT) && null != value && "false".equals(value.toString())) { ReadWriteEntity entity = new ReadWriteEntity(OPCElement.EOP020_F_HEART_BEAT, true); miloService.writeToOpcUa(entity); } //PLC进站 else if (identifier.equals(OPCElement.EOP020_J_PLC_START) && null != value && "true".equals(value.toString())) { EOP020Callback.handleOrder(); } //PLC出站 else if (identifier.equals(OPCElement.EOP020_J_PLC_FINISH) && null != value && "true".equals(value.toString())) { EOP020Callback.handleFinsh(); EOP020Callback.handleMaterial(); EOP020Callback.handleInfo(); } //EOP030 //心跳 else if (identifier.equals(OPCElement.EOP030_F_HEART_BEAT) && null != value && "false".equals(value.toString())) { ReadWriteEntity entity = new ReadWriteEntity(OPCElement.EOP030_F_HEART_BEAT, true); miloService.writeToOpcUa(entity); } //PLC进站 else if (identifier.equals(OPCElement.EOP030_J_PLC_START) && null != value && "true".equals(value.toString())) { EOP030Callback.handleOrder(); } //PLC出站 else if (identifier.equals(OPCElement.EOP030_J_PLC_FINISH) && null != value && "true".equals(value.toString())) { EOP030Callback.handleFinsh(); EOP030Callback.handleMaterial(); EOP030Callback.handleInfo(); } //EOP040 //心跳 else if (identifier.equals(OPCElement.EOP040_F_HEART_BEAT) && null != value && "false".equals(value.toString())) { ReadWriteEntity entity = new ReadWriteEntity(OPCElement.EOP040_F_HEART_BEAT, true); miloService.writeToOpcUa(entity); } //PLC进站 else if (identifier.equals(OPCElement.EOP040_J_PLC_START) && null != value && "true".equals(value.toString())) { EOP040Callback.handleOrder(); } //PLC出站 else if (identifier.equals(OPCElement.EOP040_J_PLC_FINISH) && null != value && "true".equals(value.toString())) { EOP040Callback.handleFinsh(); EOP040Callback.handleMaterial(); EOP040Callback.handleInfo(); } //EOP050 //心跳 else if (identifier.equals(OPCElement.EOP050_F_HEART_BEAT) && null != value && "false".equals(value.toString())) { ReadWriteEntity entity = new ReadWriteEntity(OPCElement.EOP050_F_HEART_BEAT, true); miloService.writeToOpcUa(entity); } //PLC进站 else if (identifier.equals(OPCElement.EOP050_J_PLC_START) && null != value && "true".equals(value.toString())) { EOP050Callback.handleOrder(); } //PLC出站 else if (identifier.equals(OPCElement.EOP050_J_PLC_FINISH) && null != value && "true".equals(value.toString())) { EOP050Callback.handleFinsh(); EOP050Callback.handleMaterial(); EOP050Callback.handleInfo(); } //EOP060 //心跳 else if (identifier.equals(OPCElement.EOP060_F_HEART_BEAT) && null != value && "false".equals(value.toString())) { ReadWriteEntity entity = new ReadWriteEntity(OPCElement.EOP060_F_HEART_BEAT, true); miloService.writeToOpcUa(entity); } //PLC进站 else if (identifier.equals(OPCElement.EOP060_J_PLC_START) && null != value && "true".equals(value.toString())) { EOP060Callback.handleOrder(); } //PLC出站 else if (identifier.equals(OPCElement.EOP060_J_PLC_FINISH) && null != value && "true".equals(value.toString())) { EOP060Callback.handleFinsh(); EOP060Callback.handleMaterial(); EOP060Callback.handleInfo(); } //EOP070 //心跳 else if (identifier.equals(OPCElement.EOP070_F_HEART_BEAT) && null != value && "false".equals(value.toString())) { ReadWriteEntity entity = new ReadWriteEntity(OPCElement.EOP070_F_HEART_BEAT, true); miloService.writeToOpcUa(entity); } //PLC进站 else if (identifier.equals(OPCElement.EOP070_J_PLC_START) && null != value && "true".equals(value.toString())) { EOP070Callback.handleOrder(); } //PLC出站 else if (identifier.equals(OPCElement.EOP070_J_PLC_FINISH) && null != value && "true".equals(value.toString())) { EOP070Callback.handleFinsh(); EOP070Callback.handleMaterial(); EOP070Callback.handleInfo(); } //EOP080 //心跳 else if (identifier.equals(OPCElement.EOP080_F_HEART_BEAT) && null != value && "false".equals(value.toString())) { ReadWriteEntity entity = new ReadWriteEntity(OPCElement.EOP080_F_HEART_BEAT, true); miloService.writeToOpcUa(entity); } //PLC进站 else if (identifier.equals(OPCElement.EOP080_J_PLC_START) && null != value && "true".equals(value.toString())) { EOP080Callback.handleOrder(); } //PLC出站 else if (identifier.equals(OPCElement.EOP080_J_PLC_FINISH) && null != value && "true".equals(value.toString())) { EOP080Callback.handleFinsh(); EOP080Callback.handleMaterial(); EOP080Callback.handleInfo(); } //EOP090 //心跳 else if (identifier.equals(OPCElement.EOP090_F_HEART_BEAT) && null != value && "false".equals(value.toString())) { ReadWriteEntity entity = new ReadWriteEntity(OPCElement.EOP090_F_HEART_BEAT, true); miloService.writeToOpcUa(entity); } //PLC进站 else if (identifier.equals(OPCElement.EOP090_J_PLC_START) && null != value && "true".equals(value.toString())) { EOP090Callback.handleOrder(); } //PLC出站 else if (identifier.equals(OPCElement.EOP090_J_PLC_FINISH) && null != value && "true".equals(value.toString())) { EOP090Callback.handleFinsh(); EOP090Callback.handleMaterial(); EOP090Callback.handleInfo(); } //EOP090B //心跳 else if (identifier.equals(OPCElement.EOP090B_F_HEART_BEAT) && null != value && "false".equals(value.toString())) { ReadWriteEntity entity = new ReadWriteEntity(OPCElement.EOP090B_F_HEART_BEAT, true); miloService.writeToOpcUa(entity); } //PLC进站 else if (identifier.equals(OPCElement.EOP090B_J_PLC_START) && null != value && "true".equals(value.toString())) { EOP090BCallback.handleOrder(); } //PLC出站 else if (identifier.equals(OPCElement.EOP090B_J_PLC_FINISH) && null != value && "true".equals(value.toString())) { EOP090BCallback.handleFinsh(); EOP090BCallback.handleMaterial(); EOP090BCallback.handleInfo(); } else if (identifier.contains("STATE") && null != value) { EquipmentInfoParam equipmentInfoParam = new EquipmentInfoParam(); equipmentInfoParam.setSpareField1(identifier); List lists = equipmentInfoService.findListBySpec(equipmentInfoParam); if(!lists.isEmpty() && lists.size()>0){ EquipmentInfoResult result = (EquipmentInfoResult) lists.get(0); String equipmentNo = result.getEquipmentNo(); EquipmentStatusParam equipmentStatusParam = new EquipmentStatusParam(); equipmentStatusParam.setEquipmentNo(equipmentNo); List statuslist = equipmentStatusService.findListBySpec(equipmentStatusParam); if(statuslist.size()>0){ EquipmentStatusResult equipmentStatusResult = (EquipmentStatusResult) statuslist.get(0); if(!value.equals(equipmentStatusResult.getStatus())){ equipmentStatusParam.setId(equipmentStatusResult.getId()); equipmentStatusParam.setStatus(value.toString()); equipmentStatusParam.setUpdateTime(DateTool.getLocalTimeForDate()); equipmentStatusService.update(equipmentStatusParam);//更新设备状态 //添加设备报警 if("3".equals(value)){ EquipmentAlarmParam equipmentAlarmParam = new EquipmentAlarmParam(); equipmentAlarmParam.setEquipmentNo(equipmentNo); equipmentAlarmParam.setEquipmentName(result.getEquipmentName()); equipmentAlarmParam.setWorkshopCode(result.getWorkshopCode()); equipmentAlarmParam.setProductionLineCode(result.getProductionLineCode()); equipmentAlarmParam.setLocationCode(result.getLocationCode()); equipmentAlarmParam.setErrorDesc(result.getEquipmentName()+"报警!"); equipmentAlarmParam.setAlarmTime(DateTool.getLocalTimeForDate()); equipmentAlarmService.add(equipmentAlarmParam); } } }else{ equipmentStatusParam.setEquipmentName(result.getEquipmentName()); equipmentStatusParam.setWorkshopCode(result.getWorkshopCode()); equipmentStatusParam.setProductionLineCode(result.getProductionLineCode()); equipmentStatusParam.setLocationCode(result.getLocationCode()); equipmentStatusParam.setStatus(value.toString()); equipmentStatusParam.setUpdateTime(DateTool.getLocalTimeForDate()); equipmentStatusService.add(equipmentStatusParam); //添加设备报警 if("3".equals(value)){ EquipmentAlarmParam equipmentAlarmParam = new EquipmentAlarmParam(); equipmentAlarmParam.setEquipmentNo(equipmentNo); equipmentAlarmParam.setEquipmentName(result.getEquipmentName()); equipmentAlarmParam.setWorkshopCode(result.getWorkshopCode()); equipmentAlarmParam.setProductionLineCode(result.getProductionLineCode()); equipmentAlarmParam.setLocationCode(result.getLocationCode()); equipmentAlarmParam.setErrorDesc(result.getEquipmentName()+"报警!"); equipmentAlarmParam.setAlarmTime(DateTool.getLocalTimeForDate()); equipmentAlarmService.add(equipmentAlarmParam); } } } if(identifier.contains("OP050") && !identifier.contains("EOP050") ){ StateCallback.handleOilStateOP050("OP050"); } if (identifier.contains("BOP030")){ StateCallback.handleOilStateBOP030("BOP030"); } } else { System.out.println("值没有变"); } }else { System.out.println("值为空"); } } catch (Exception e) { ecpStr ="出现异常:" + logUtil.getTrace(e); }finally { if(!"".equals(ecpStr)){ System.out.println(ecpStr+"\r\n"); logger.info(ecpStr+"\r\n"); } } } }