cl
2024-01-23 6dadf36ef118fbb3b2cd5aca94cde88e29fb55dc
guns-vip-main/src/main/java/cn/stylefeng/guns/plcserver/callback/InitCallback.java
@@ -106,7 +106,6 @@
    private static String S_SFC_CODE = "";//总成编码
    private static String PRODUCTION_LINE  = "OP";//产线号
    private static String LOCATION_CODE  = "OP010";//工位号
    private static List list = null;
    private static Integer ACTUAL_ONLINE_QTY  = 0 ;//上线数量
@@ -398,7 +397,6 @@
    public void onSubscribe(String identifier, Object value) {
        String ecpStr = "";//异常记录标记
        try {
            if(null != value) {
                //OP010
                //心跳
@@ -524,8 +522,9 @@
                //PLC出站
                else if (identifier.equals(OPCElement.OP080_J_PLC_FINISH) && null != value && "true".equals(value.toString())) {
                    OP080Callback.handleFinsh();
                    OP080Callback.handleMaterial();
                    OP080Callback.handleInfo();
                    OP080Callback.handleMaterial();
                }
                //OP090
@@ -537,6 +536,23 @@
                //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.handleMaterial();
                    OP090Callback.handleInfo();
                    OP090Callback.handleFinsh();
                }
                //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())) {
@@ -592,8 +608,8 @@
                //PLC出站
                else if (identifier.equals(OPCElement.OP120B_J_PLC_FINISH) && null != value && "true".equals(value.toString())) {
                    OP120BCallback.handleFinsh();
                    OP120BCallback.handleMaterial();
                    OP120BCallback.handleInfo();
                    //OP120BCallback.handleMaterial();
                    //OP120BCallback.handleInfo();
                }
                //OP130
@@ -803,7 +819,7 @@
                //PLC出站
                else if (identifier.equals(OPCElement.BOP040B_J_PLC_FINISH) && null != value && "true".equals(value.toString())) {
                    BOP040BCallback.handleFinsh();
                   // BOP040BCallback.handleMaterial();
                    // BOP040BCallback.handleMaterial();
                    //BOP040BCallback.handleInfo();
                }
@@ -1076,12 +1092,12 @@
                    EOP090BCallback.handleInfo();
                }
                else if (identifier.contains("STATE") && null != value && "true".equals(value.toString())) {
                else if (identifier.contains("STATE") && null != value) {
                    EquipmentInfoParam equipmentInfoParam = new EquipmentInfoParam();
                    equipmentInfoParam.setSpareField1(identifier);
                    List<EquipmentInfoResult> lists = equipmentInfoService.findListBySpec(equipmentInfoParam);
                    if(!lists.isEmpty()){
                        EquipmentInfoResult result = (EquipmentInfoResult) list.get(0);
                    if(!lists.isEmpty() && lists.size()>0){
                        EquipmentInfoResult result = (EquipmentInfoResult) lists.get(0);
                        String equipmentNo = result.getEquipmentNo();
                        EquipmentStatusParam equipmentStatusParam = new EquipmentStatusParam();
                        equipmentStatusParam.setEquipmentNo(equipmentNo);
@@ -1132,10 +1148,12 @@
                        }
                    }
                    // handleOilState("DOP020");
                    StateCallback.handleOilStateOP050("OP050");
                    StateCallback.handleOilStateBOP030("BOP030");
                    if(identifier.contains("OP050") && !identifier.contains("EOP050") ){
                        StateCallback.handleOilStateOP050("OP050");
                    }
                    if (identifier.contains("BOP030")){
                        StateCallback.handleOilStateBOP030("BOP030");
                    }
                }
                else {