春风项目四线(合箱线、总装线)
wujian
2024-04-22 2b59de22fbd48ad356b79499722e948d7817c9c3
jcdm-main/src/main/java/com/jcdm/main/plcserver/sub/OPCUaSubscription.java
@@ -155,8 +155,8 @@
            Object SNCodeObject = miloService.readFromOpcUa(parts[0] + "." + parts[1] + ".Code").getValue();
            if(null != SNCodeObject) {
                String SNCode=SNCodeObject.toString();
                String a=passingStationCollectionServiceImpl.SelectSN(SNCode,parts[1]);
//                String a="1";
//                String a=passingStationCollectionServiceImpl.SelectSN(SNCode,parts[1]);
                String a="1";
                // 1:OK可生产 2:NG不可生产 3:NG可返工 4:PC检索失败(无记录)5:PC检索失败(软件)
                if (StrUtil.isNotBlank(a)){
                    int input = Integer.parseInt(a);
@@ -175,7 +175,7 @@
                        }
                        ReadWriteEntity entity2 = new ReadWriteEntity(parts[0]+"."+parts[1]+".OrderNumber", orderNum);
                        miloService.writeToOpcByte(entity2);
                        miloService.writeToOpcUa(entity2);
                    }
                    //如果是返修工位需要传输返修工位号
                    if (OPCElement.OP465_ZZ_CODE_CHECK.equals(Node) || OPCElement.OP355_ZZ_CODE_CHECK.equals(Node)){
@@ -245,6 +245,7 @@
            List<DaCollectionParamConf> list;
            DaCollectionParamConf daCollectionParamConf = new DaCollectionParamConf();
            daCollectionParamConf.setGatherAddress(parts[0] + "." + parts[1]);
            daCollectionParamConf.setRemarks("1");
            list = collectionParamConfService.selectDaCollectionParamConfList(daCollectionParamConf);
            List<String> nodeIdList = list.stream().map(info -> {
@@ -256,8 +257,8 @@
                List<ReadWriteEntity> readWriteEntityList = miloService.readFromOpcUa(nodeIdList);
                List<DaParamCollection> daParamCollectionlist = new ArrayList<>();
                for(int i=0;i<nodeIdList.size();i++){
                    DaParamCollection ParamCollection = new DaParamCollection();
                    if(!readWriteEntityList.get(i).getValue().toString().equals("0.0")){
                        DaParamCollection ParamCollection = new DaParamCollection();
                        ParamCollection.setParamCode(readWriteEntityList.get(i).getIdentifier().toString().split("[.]")[2]);
                        ParamCollection.setLocationCode(parts[1]);
                        ParamCollection.setParamValue(readWriteEntityList.get(i).getValue().toString());
@@ -272,6 +273,7 @@
                        daParamCollectionlist.add(ParamCollection);
                    }
                }
                System.out.println("11111111111111");
                daParamCollectionService.saveBeachDaParamCollection(daParamCollectionlist);
            }