From 46b20f92401ec475e3d3b655df1e5cfa780525ac Mon Sep 17 00:00:00 2001 From: cl <418351270@qq.com> Date: 星期三, 14 八月 2024 15:26:02 +0800 Subject: [PATCH] 修改采集参数 --- jcdm-main/src/main/java/com/jcdm/main/plcserver/CustomRunner.java | 7 +++++-- jcdm-main/src/main/java/com/jcdm/main/plcserver/sub/OPCUaSubscription.java | 6 ++++-- jcdm-main/src/main/java/com/jcdm/main/constant/Constants.java | 4 +++- 3 files changed, 12 insertions(+), 5 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 2be16ab..aa2ca2a 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,7 +19,9 @@ public static final List<String> ModuleList = new ArrayList<>();//妯$粍宸ヤ綅锛岀敤浜庢牎楠屾槸鍚︿紶鍏ユā缁勭爜 - public static final Map<String,String> materialMap = new HashMap();//浜哄伐宸ヤ綅 + public static final Map<String,String> materialMap = new HashMap();//鐗╂枡闆嗗悎 + + public static final Map<String,String> facMaterialMap = new HashMap();//鐢熶骇鐗╂枡杞伐鍘傜墿鏂欒姹傚伐鍗� public static final Map<String,String> thoroughfareMap = new HashMap();//浜哄伐宸ヤ綅 public static final String YES = "Y"; 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 1d2fd10..f5843bf 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 @@ -54,8 +54,11 @@ public void run(ApplicationArguments args) throws Exception { //PLC鍒癕ES鐗╂枡杞崲 - Constants.materialMap.put("1","9900200461");//寰崱鐢甸┍鍔ㄧ郴缁熸�绘垚 - Constants.materialMap.put("2","9900207783");//寰潰鐢甸┍鍔ㄧ郴缁熸�绘垚 + Constants.materialMap.put("1","9900200461");//寰崱鐢甸┍鍔ㄧ郴缁熸�绘垚(9999276636)//9900200461 + Constants.materialMap.put("2","9900207783");//寰潰鐢甸┍鍔ㄧ郴缁熸�绘垚(9999276639)//9900207783 + + Constants.materialMap.put("9900200461","9999276636");//鐢熶骇鐗╂枡杞伐鍘傜墿鏂欒姹傚伐鍗� + Constants.materialMap.put("9900207783","9999276639");//鐢熶骇鐗╂枡杞伐鍘傜墿鏂欒姹傚伐鍗� //閫氶亾 Constants.thoroughfareMap.put(Constants.OP010,"JCDM035-1"); 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 9ecec9d..45e4e90 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 @@ -388,7 +388,8 @@ OmProductionOrdeInfo lastOrder = omProductionOrdeInfoService.getLastOrder(); log.info("璇锋眰宸ュ巶MES宸ュ崟锛氬叆鍙俤evice{},materialCode锛歿}", device, materialCode); - String orderJsonString = RestfulService.getProductionWorkOrderRequest(lastOrder.getProductNum(), "OP010",materialCode); + String facMaterialCode = Constants.facMaterialMap.get(materialCode); + String orderJsonString = RestfulService.getProductionWorkOrderRequest(lastOrder.getProductNum(), "OP010",facMaterialCode); log.info("璇锋眰宸ュ巶MES宸ュ崟锛氬嚭鍙俻ack锛歿}", orderJsonString); JSONObject jsonObject = new JSONObject(orderJsonString); @@ -401,7 +402,8 @@ omProductionOrdeInfo.setWorkOrderNo(dataObject.getStr("productionOrderNum")); omProductionOrdeInfo.setProductNum(dataObject.getStr("productNum")); omProductionOrdeInfo.setStationCode(device); - omProductionOrdeInfo.setProductCode(dataObject.getStr("materialCode")); + omProductionOrdeInfo.setProductCode(materialCode); + omProductionOrdeInfo.setMaterialCode(dataObject.getStr("materialCode")); omProductionOrdeInfo.setPlanQty(Long.valueOf(dataObject.getStr("plannedQuantity"))); omProductionOrdeInfo.setOnlineCompletionMark("0"); omProductionOrdeInfo.setSfResult("0"); -- Gitblit v1.9.3