From b590231a4d4cabde1a9452e87050adb9cee227d4 Mon Sep 17 00:00:00 2001 From: cl <418351270@qq.com> Date: 星期二, 16 七月 2024 16:04:48 +0800 Subject: [PATCH] 修改参数采集 --- jcdm-ui/package.json | 2 +- jcdm-main/src/main/java/com/jcdm/main/plcserver/sub/OPCUaSubscription.java | 29 +++++++++++++++++++++++++---- 2 files changed, 26 insertions(+), 5 deletions(-) diff --git a/jcdm-main/src/main/java/com/jcdm/main/plcserver/sub/OPCUaSubscription.java b/jcdm-main/src/main/java/com/jcdm/main/plcserver/sub/OPCUaSubscription.java index 801adc5..5c83e28 100644 --- a/jcdm-main/src/main/java/com/jcdm/main/plcserver/sub/OPCUaSubscription.java +++ b/jcdm-main/src/main/java/com/jcdm/main/plcserver/sub/OPCUaSubscription.java @@ -194,9 +194,30 @@ Integer result = 21; //璇诲彇鐢佃姱鐮� List<String> cellCodeList = readCellCodeList(thoroughfare, device); - if(ObjectUtil.isNull(cellCodeList) || cellCodeList.size() != 4){ + if(ObjectUtil.isNull(cellCodeList) || cellCodeList.size() != 4 ){ result = 23; }else{ + String cellCode1 = cellCodeList.get(0); + String cellCode2 = cellCodeList.get(1); + String cellCode3 = cellCodeList.get(2); + String cellCode4 = cellCodeList.get(3); + + if(cellCode1.isEmpty() || cellCode2.isEmpty()){ + result = 23; + miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(thoroughfare + "." + device + ".RecordDataDone").value(result).build()); + return; + } + if(!cellCode3.isEmpty() && cellCode4.isEmpty()){ + result = 23; + miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(thoroughfare + "." + device + ".RecordDataDone").value(result).build()); + return; + } + if(cellCode3.isEmpty() && !cellCode4.isEmpty()){ + result = 23; + miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(thoroughfare + "." + device + ".RecordDataDone").value(result).build()); + return; + } + result = savePassingStation(thoroughfare, device,cellCodeList);//淇濆瓨杩囩珯 if(result == 21) { result = saveParamCollection(device,cellCodeList);//淇濆瓨鍙傛暟锛屽彂閫佸伐鍘侻ES @@ -330,11 +351,11 @@ try { List<ReadWriteEntity> readWriteEntityList = miloService.readFromOpcUa(readList);//鐢佃姱鐮� for (ReadWriteEntity readWriteEntity : readWriteEntityList) { - if (ObjectUtil.isNotNull(readWriteEntity.getValue()) && !"".equals(readWriteEntity.getValue().toString().trim())){ + if (ObjectUtil.isNotNull(readWriteEntity.getValue()) && !readWriteEntity.getValue().toString().trim().isEmpty()){ cellCodeList.add(readWriteEntity.getValue().toString());//灏佽鐢佃姱鐮� - }/*else{ + }else{ cellCodeList.add("");//灏佽鐢佃姱鐮� - }*/ + } } } catch (Exception e) { diff --git a/jcdm-ui/package.json b/jcdm-ui/package.json index 887cea5..01d45af 100644 --- a/jcdm-ui/package.json +++ b/jcdm-ui/package.json @@ -1,5 +1,5 @@ { - "name": "ruoyi", + "name": "dema", "version": "3.8.6", "description": "姹熷MES绠$悊绯荤粺", "author": "姹熷", -- Gitblit v1.9.3