From ab63141eaf175c6c544d2ef37833dea9016d0d26 Mon Sep 17 00:00:00 2001 From: cl <418351270@qq.com> Date: 星期五, 12 七月 2024 08:42:08 +0800 Subject: [PATCH] 修改参数采集 --- jcdm-main/src/main/java/com/jcdm/main/om/productionOrde/controller/OmProductionOrdeInfoController.java | 9 ++++++--- 1 files changed, 6 insertions(+), 3 deletions(-) diff --git a/jcdm-main/src/main/java/com/jcdm/main/om/productionOrde/controller/OmProductionOrdeInfoController.java b/jcdm-main/src/main/java/com/jcdm/main/om/productionOrde/controller/OmProductionOrdeInfoController.java index bcb937b..abe3e3b 100644 --- a/jcdm-main/src/main/java/com/jcdm/main/om/productionOrde/controller/OmProductionOrdeInfoController.java +++ b/jcdm-main/src/main/java/com/jcdm/main/om/productionOrde/controller/OmProductionOrdeInfoController.java @@ -141,7 +141,7 @@ if(code.equals("success")){ logger.info("璇锋眰宸ュ巶MES宸ュ崟锛氬叆鍙俻ack{}鍑哄弬pack锛歿}",paramProductNum,dataObject.getStr("productNum")); List<OmProductionOrdeInfo> check = omProductionOrdeInfoService.list(new LambdaQueryWrapper<OmProductionOrdeInfo>().eq(OmProductionOrdeInfo::getProductNum,dataObject.getStr("productNum"))); - if(check.size() == 0){ + if(check.isEmpty()){ try { log.info("璇锋眰宸ュ巶MES宸ュ崟锛氬叆鍙俻ack{}鍑哄弬pack锛歿}", paramProductNum, dataObject.getStr("productNum")); OmProductionOrdeInfo omProductionOrdeInfo = new OmProductionOrdeInfo(); @@ -156,12 +156,15 @@ omProductionOrdeInfo.setCreateTime(new Date()); omProductionOrdeInfo.setCreateUser("宸ュ巶MES"); omProductionOrdeInfoService.save(omProductionOrdeInfo); + //鍐橮LC - miloService.writeToOpcUa(ReadWriteEntity.builder().identifier("MOZU1." + paramOrder.getLineCode() + ".MES_WorkOrderNumber").value(dataObject.getStr("productionOrderNum")).build()); - miloService.writeToOpcUa(ReadWriteEntity.builder().identifier("MOZU1." + paramOrder.getLineCode() + ".MES_ModuleCode").value(dataObject.getStr("productNum")).build()); + miloService.writeToOpcUa(ReadWriteEntity.builder().identifier("MOZU1." + paramOrder.getLineCode() + ".WorkOrderNumber").value(dataObject.getStr("productionOrderNum")).build()); + miloService.writeToOpcUa(ReadWriteEntity.builder().identifier("MOZU1." + paramOrder.getLineCode() + ".ModuleCode").value(dataObject.getStr("productNum")).build()); } catch (Exception e) { throw new RuntimeException(e); } + }else{ + return AjaxResult.error("宸ュ崟閲嶅,璇烽噸鏂版帴鏀�"); } }else { return AjaxResult.error("鎺ュ崟澶辫触,璇疯仈绯荤鐞嗗憳"); -- Gitblit v1.9.3