cl
2024-10-21 1f60fac09ac094d67e04c5c781436608d6cd6e64
修改数据采集
已修改3个文件
27 ■■■■ 文件已修改
guns-vip-main/src/main/java/cn/stylefeng/guns/plcserver/callback/OP010Callback.java 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
guns-vip-main/src/main/java/cn/stylefeng/guns/plcserver/init/CustomRunner.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
guns-vip-main/src/main/java/cn/stylefeng/guns/plcserver/init/SubscriptionManage.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
guns-vip-main/src/main/java/cn/stylefeng/guns/plcserver/callback/OP010Callback.java
@@ -218,7 +218,23 @@
    }
    public void handleFinsh() throws Exception {
        logger.info("handleFinsh PC处理开始!");
        String snCode = miloService.
                readFromOpcUa(OPCElement.OP010_S_SFC_CODE)
                .getValue().toString();
        if(!snCode.equals(S_SFC_CODE)){
            ReadWriteEntity entity = new ReadWriteEntity(OPCElement.OP010_S_SFC_CODE,S_SFC_CODE);
            miloService.writeToOpcUa(entity);//写PC完成
            ReadWriteEntity entity1 = new ReadWriteEntity(OPCElement.OP010_PLC_REQUST,3);
            miloService.writeToOpcShort(entity1);//写PC完成
            return;
        }
        String S_PRODUCT_STATE_CODE = miloService.
                readFromOpcUa(OPCElement.OP010_S_PRODUCT_STATE_CODE)
                .getValue().toString();
@@ -249,7 +265,7 @@
        param.setOutRsSign(S_PRODUCT_STATE_CODE);//出站是否合格
        passingStationCollectionService.add(param);
        handleMaterial();
        logger.info("handleFinsh PC处理完成!");
    }
guns-vip-main/src/main/java/cn/stylefeng/guns/plcserver/init/CustomRunner.java
@@ -93,14 +93,14 @@
                productionOrderBatchInfoService);
        Calendar calendar = Calendar.getInstance();
        /*Calendar calendar = Calendar.getInstance();
        String Months = StringUtils.leftPad(String.valueOf(calendar.get(Calendar.MONTH) + 1),2, "0");
        if(Months.equals("04")
                ||Months.equals("07") ||Months.equals("08") || Months.equals("09")
                || Months.equals("10") || Months.equals("11") || Months.equals("12") ||
                Months.equals("01") || Months.equals("02") || Months.equals("03") ){
            GlobalVariable.IS_CLOCK = false;
        }
        }*/
       /* ExecutorService cachedThreadPool = Executors.newCachedThreadPool();
        cachedThreadPool.execute(new HeartBeatTaskThreadPool());*/
guns-vip-main/src/main/java/cn/stylefeng/guns/plcserver/init/SubscriptionManage.java
@@ -361,13 +361,13 @@
        try {
            if(null != value) {
                if(!GlobalVariable.IS_CLOCK){
               /* if(!GlobalVariable.IS_CLOCK){
                    System.out.println("----------------------系统已经过期,请联系管理员进行升级----------------------");
                    System.out.println("----------------------系统已经过期,请联系管理员进行升级----------------------");
                    System.out.println("----------------------系统已经过期,请联系管理员进行升级----------------------");
                    System.out.println("----------------------系统已经过期,请联系管理员进行升级----------------------");
                    return;
                }
                }*/
                //OP010
                //心跳
                if (identifier.equals(OPCElement.OP010_F_HEART_BEAT) && "false".equals(value.toString())) {
@@ -385,7 +385,6 @@
                    }
                    if("2".equals(value.toString())){
                        OP010Callback.handleFinsh();
                        OP010Callback.handleMaterial();
                    }
                }