From 257bd3879f139cdf328e78158544130656c676fc Mon Sep 17 00:00:00 2001 From: cl <418351270@qq.com> Date: 星期日, 04 八月 2024 15:33:01 +0800 Subject: [PATCH] 修改采集参数 --- jcdm-main/src/main/java/com/jcdm/main/plcserver/CustomRunner.java | 10 ++++++++++ jcdm-main/src/main/java/com/jcdm/main/da/paramCollection/service/impl/DaParamCollectionServiceImpl.java | 8 +++++--- jcdm-main/src/main/java/com/jcdm/main/constant/Constants.java | 1 + 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/jcdm-main/src/main/java/com/jcdm/main/constant/Constants.java b/jcdm-main/src/main/java/com/jcdm/main/constant/Constants.java index 5ee9d56..a5fda13 100644 --- a/jcdm-main/src/main/java/com/jcdm/main/constant/Constants.java +++ b/jcdm-main/src/main/java/com/jcdm/main/constant/Constants.java @@ -19,6 +19,7 @@ public static final Map<String,String> materialMap = new HashMap();//浜哄伐宸ヤ綅 + public static final Map<String,String> thoroughfareMap = new HashMap();//浜哄伐宸ヤ綅 public static final String YES = "Y"; public static final String NG = "2"; public static final String UN_PASS= "涓嶅悎鏍�"; diff --git a/jcdm-main/src/main/java/com/jcdm/main/da/paramCollection/service/impl/DaParamCollectionServiceImpl.java b/jcdm-main/src/main/java/com/jcdm/main/da/paramCollection/service/impl/DaParamCollectionServiceImpl.java index 6eeb4c2..0921ff4 100644 --- a/jcdm-main/src/main/java/com/jcdm/main/da/paramCollection/service/impl/DaParamCollectionServiceImpl.java +++ b/jcdm-main/src/main/java/com/jcdm/main/da/paramCollection/service/impl/DaParamCollectionServiceImpl.java @@ -265,12 +265,14 @@ @Override public void saveCampaignTimeParameters(DaParamCollection daParamCollection) { + String locationCode = daParamCollection.getLocationCode(); + String thoroughfare = Constants.thoroughfareMap.get(locationCode); BsFormulaChildInfo childInfo = daParamCollection.getFormulaChildEntity(); if(StringUtils.isNotBlank(childInfo.getResults())){ if(!childInfo.getResults().equals("OK")){ try { - miloService.writeToOpcShort(ReadWriteEntity.builder().identifier("JCDM035."+daParamCollection.getLocationCode()+".RecordDataDone").value(22).build()); + miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(thoroughfare+"."+daParamCollection.getLocationCode()+".RecordDataDone").value(22).build()); } catch (Exception e) { throw new RuntimeException(e); } @@ -278,7 +280,7 @@ } }else { try { - miloService.writeToOpcShort(ReadWriteEntity.builder().identifier("JCDM035."+daParamCollection.getLocationCode()+".RecordDataDone").value(22).build()); + miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(thoroughfare+"."+daParamCollection.getLocationCode()+".RecordDataDone").value(22).build()); } catch (Exception e) { throw new RuntimeException(e); } @@ -308,7 +310,7 @@ this.saveParameters(daParamCollection); //缁檕pc鍙�21 - miloService.writeToOpcShort(ReadWriteEntity.builder().identifier("JCDM035."+daParamCollection.getLocationCode()+".RecordDataDone").value(21).build()); + miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(thoroughfare+"."+daParamCollection.getLocationCode()+".RecordDataDone").value(21).build()); /* if(daParamCollection.getLocationCode().equals("M1OP100-1") || daParamCollection.getLocationCode().equals("M1OP100-2") ){ try{ //鏇存柊宸ュ崟鐘舵�佷负宸叉墽琛� diff --git a/jcdm-main/src/main/java/com/jcdm/main/plcserver/CustomRunner.java b/jcdm-main/src/main/java/com/jcdm/main/plcserver/CustomRunner.java index 7c4cc17..9257c4d 100644 --- a/jcdm-main/src/main/java/com/jcdm/main/plcserver/CustomRunner.java +++ b/jcdm-main/src/main/java/com/jcdm/main/plcserver/CustomRunner.java @@ -57,6 +57,16 @@ Constants.materialMap.put("1","9900199052A"); Constants.materialMap.put("2","9900199053B"); + //閫氶亾 + Constants.thoroughfareMap.put(Constants.OP040,"JCDM035-3"); + Constants.thoroughfareMap.put(Constants.OP050,"JCDM035-3"); + Constants.thoroughfareMap.put(Constants.OP060,"JCDM035-3"); + Constants.thoroughfareMap.put(Constants.OP070,"JCDM035-3"); + Constants.thoroughfareMap.put(Constants.OP080,"JCDM035-3"); + Constants.thoroughfareMap.put(Constants.OP090,"JCDM035-3"); + Constants.thoroughfareMap.put(Constants.OP100,"JCDM035-3"); + Constants.thoroughfareMap.put(Constants.OP110,"JCDM035-3"); + //涓荤嚎浜哄伐宸ヤ綅 Constants.OP040_OP160.add(Constants.OP040); Constants.OP040_OP160.add(Constants.OP050); -- Gitblit v1.9.3