cl
2024-01-23 ff13e6159eab48d53bb528a10d0ab8850fdf7ad5
修改数据采集
已修改3个文件
90 ■■■■■ 文件已修改
guns-vip-main/src/main/java/cn/stylefeng/guns/plcserver/callback/InitCallback.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
guns-vip-main/src/main/java/cn/stylefeng/guns/plcserver/callback/OP050Callback.java 45 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
guns-vip-main/src/main/java/cn/stylefeng/guns/plcserver/callback/OP090Callback.java 37 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
guns-vip-main/src/main/java/cn/stylefeng/guns/plcserver/callback/InitCallback.java
@@ -482,9 +482,10 @@
                }
                //PLC出站
                else if (identifier.equals(OPCElement.OP050_J_PLC_FINISH) && null != value && "true".equals(value.toString())) {
                    OP050Callback.handleMaterial();
                    OP050Callback.handleInfo();
                    OP050Callback.handleFinsh();
                    OP050Callback.handleInfo();
                    OP050Callback.handleMaterial();
                }
                //OP070
@@ -539,9 +540,10 @@
                }
                //PLC出站
                else if (identifier.equals(OPCElement.OP090_J_PLC_FINISH) && null != value && "true".equals(value.toString())) {
                    OP090Callback.handleFinsh();
                    OP090Callback.handleMaterial();
                    OP090Callback.handleInfo();
                    OP090Callback.handleFinsh();
                }
                //OP100
guns-vip-main/src/main/java/cn/stylefeng/guns/plcserver/callback/OP050Callback.java
@@ -194,10 +194,18 @@
    }
    public void handleFinsh() throws Exception{
        logger.info("handleFinsh PC处理开始!");
        String S_PRODUCT_STATE_CODE = miloService.
        Object object = miloService.
                readFromOpcUa(OPCElement.OP050_S_PRODUCT_STATE_CODE)
                .getValue().toString();
                .getValue();
        String S_PRODUCT_STATE_CODE = "";
        if(null != object){
            S_PRODUCT_STATE_CODE = object.toString();
        }
        PassingStationCollectionParam param = new PassingStationCollectionParam();
        param.setWorkOrderNo(S_ORDER_CODE);
@@ -211,26 +219,27 @@
        passingStationCollectionService.add(param);
        String copSfcCode = miloService.
        Object copSfcCode = miloService.
                readFromOpcUa(OPCElement.OP050_S_SFC_CODE_COP)
                .getValue().toString();
        String bopSfcCode = miloService.
                .getValue();
        Object bopSfcCode = miloService.
                readFromOpcUa(OPCElement.OP050_S_SFC_CODE_BOP)
                .getValue().toString();
                .getValue();
        if(null != copSfcCode && null != bopSfcCode){
        //根据分总成编码,将EOP物料数据绑定关系修改为总成编码
        materialTraceabilityService.updateSFC(S_SFC_CODE,copSfcCode);
        materialTraceabilityService.updateSFC(S_SFC_CODE,bopSfcCode);
            materialTraceabilityService.updateSFC(S_SFC_CODE,copSfcCode.toString());
            materialTraceabilityService.updateSFC(S_SFC_CODE,bopSfcCode.toString());
        //根据分总成编码,将EOP过站数据绑定关系修改为总成编码
        passingStationCollectionService.updateSFC(S_SFC_CODE,copSfcCode);
        passingStationCollectionService.updateSFC(S_SFC_CODE,bopSfcCode);
            //根据分总成编码,将EOP过站数据绑定关系修改为总成编码
            passingStationCollectionService.updateSFC(S_SFC_CODE,copSfcCode.toString());
            passingStationCollectionService.updateSFC(S_SFC_CODE,bopSfcCode.toString());
        //根据分总成编码,将EOP采集数据绑定关系修改为总成编码
        paramCollectionService.updateSFC(S_SFC_CODE,copSfcCode);
        paramCollectionService.updateSFC(S_SFC_CODE,bopSfcCode);
            //根据分总成编码,将EOP采集数据绑定关系修改为总成编码
            paramCollectionService.updateSFC(S_SFC_CODE,copSfcCode.toString());
            paramCollectionService.updateSFC(S_SFC_CODE,bopSfcCode.toString());
        }
        logger.info("S_SFC_CODE:"+S_SFC_CODE);
        logger.info("copSfcCode:"+copSfcCode);
        logger.info("bopSfcCode:"+bopSfcCode);
@@ -244,13 +253,13 @@
        String isProductState = "true";
        for(int i=0;i<passingStationCollectionResultList.size();i++){
            PassingStationCollectionResult passingStationCollectionResult = passingStationCollectionResultList.get(i);
            if("false".equals(passingStationCollectionResult.getOutRsSign())){
            if("2".equals(passingStationCollectionResult.getOutRsSign())){
                isProductState = "false";
                break;
            }
        }
        //修改报工记录
        if("false".equals(S_PRODUCT_STATE_CODE) || "false".equals(isProductState)){
        if("2".equals(S_PRODUCT_STATE_CODE) || "false".equals(isProductState)){
            ProductionOrderRecordsParam productionOrderRecordsParam = new ProductionOrderRecordsParam();
            productionOrderRecordsParam.setWorkOrderNo(S_ORDER_CODE);
            productionOrderRecordsParam.setProductNo(S_SFC_CODE);
@@ -258,7 +267,7 @@
            if(list.size()>0){
                ProductionOrderRecordsResult productionOrderRecordsResult = list.get(0);
                productionOrderRecordsParam.setId(productionOrderRecordsResult.getId());
                productionOrderRecordsParam.setWhetherPass("false");
                productionOrderRecordsParam.setWhetherPass("2");
                productionOrderRecordsService.update(productionOrderRecordsParam);
            }
        }
guns-vip-main/src/main/java/cn/stylefeng/guns/plcserver/callback/OP090Callback.java
@@ -198,9 +198,15 @@
    public void handleFinsh() throws Exception {
        logger.info("handleFinsh PC处理开始!");
        //处理过站信息
        String S_PRODUCT_STATE_CODE = miloService.
        Object object = miloService.
                readFromOpcUa(OPCElement.OP090_S_PRODUCT_STATE_CODE)
                .getValue().toString();
                .getValue();
        String S_PRODUCT_STATE_CODE = "";
        if(null != object){
            S_PRODUCT_STATE_CODE = object.toString();
        }
        PassingStationCollectionParam param = new PassingStationCollectionParam();
        param.setWorkOrderNo(S_ORDER_CODE);
        param.setProductCode(S_PRODUCT_CODE);
@@ -212,22 +218,23 @@
        param.setOutRsSign(S_PRODUCT_STATE_CODE);//出站是否合格
        passingStationCollectionService.add(param);
        String eopSfcCode = miloService.
        Object eopSfcCode = miloService.
                readFromOpcUa(OPCElement.OP090_S_SFC_CODE_EOP)
                .getValue().toString();
                .getValue();
        //根据分总成编码,将EOP物料数据绑定关系修改为总成编码
        materialTraceabilityService.updateSFC(S_SFC_CODE,eopSfcCode);
        if(null != eopSfcCode) {
            //根据分总成编码,将EOP物料数据绑定关系修改为总成编码
            materialTraceabilityService.updateSFC(S_SFC_CODE, eopSfcCode.toString());
        //根据分总成编码,将EOP过站数据绑定关系修改为总成编码
        passingStationCollectionService.updateSFC(S_SFC_CODE,eopSfcCode);
            //根据分总成编码,将EOP过站数据绑定关系修改为总成编码
            passingStationCollectionService.updateSFC(S_SFC_CODE, eopSfcCode.toString());
        //根据分总成编码,将EOP采集数据绑定关系修改为总成编码
        paramCollectionService.updateSFC(S_SFC_CODE,eopSfcCode);
            //根据分总成编码,将EOP采集数据绑定关系修改为总成编码
            paramCollectionService.updateSFC(S_SFC_CODE, eopSfcCode.toString());
        logger.info("S_SFC_CODE:"+S_SFC_CODE);
        logger.info("eopSfcCode:"+eopSfcCode);
            logger.info("S_SFC_CODE:" + S_SFC_CODE);
            logger.info("eopSfcCode:" + eopSfcCode);
        }
        //查询COP和BOP是否合格
        PassingStationCollectionParam passingStationCollectionParam = new PassingStationCollectionParam();
        passingStationCollectionParam.setSfcCode(S_SFC_CODE);
@@ -243,7 +250,7 @@
            }
        }
        //修改报工记录
        if("false".equals(S_PRODUCT_STATE_CODE) || "false".equals(isProductState)){
        if("2".equals(S_PRODUCT_STATE_CODE) || "false".equals(isProductState)){
            ProductionOrderRecordsParam productionOrderRecordsParam = new ProductionOrderRecordsParam();
            productionOrderRecordsParam.setWorkOrderNo(S_ORDER_CODE);
            productionOrderRecordsParam.setProductNo(S_SFC_CODE);
@@ -252,7 +259,7 @@
            if(list.size()>0){
                ProductionOrderRecordsResult productionOrderRecordsResult = list.get(0);
                productionOrderRecordsParam.setId(productionOrderRecordsResult.getId());
                productionOrderRecordsParam.setWhetherPass("false");
                productionOrderRecordsParam.setWhetherPass("2");
                productionOrderRecordsService.update(productionOrderRecordsParam);
            }
        }