From f0493682f12b0b241f8628475fa4a49570f11497 Mon Sep 17 00:00:00 2001 From: Comair <1464848666@qq.com> Date: Mon, 19 May 2025 09:34:30 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=A0=E7=9B=98=E6=9C=BA=E4=B8=8A=E6=8A=A5?= =?UTF-8?q?=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/shkj/wcs/plc/PlcEventTask.java | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/shkj-wms/src/main/java/com/shkj/wcs/plc/PlcEventTask.java b/shkj-wms/src/main/java/com/shkj/wcs/plc/PlcEventTask.java index 072c811..517518e 100644 --- a/shkj-wms/src/main/java/com/shkj/wcs/plc/PlcEventTask.java +++ b/shkj-wms/src/main/java/com/shkj/wcs/plc/PlcEventTask.java @@ -292,6 +292,11 @@ public class PlcEventTask { } else if (pointType.equals("retInOutSwit")) { retInOutSwit = plcProperty.getAddress(); retInOutSwitVt = plcProperty.getPointType(); + } else if (pointType.equals("stk")) { + stk = plcProperty.getAddress(); + } else if (pointType.equals("retStk")) { + retStk = plcProperty.getAddress(); + retStkVt = plcProperty.getPointType(); } } @@ -432,9 +437,38 @@ public class PlcEventTask { log.info("出入库切换时,写入的命令返回结果:"+inOutSwitBoolean.toString()); } + //叠盘机 + if (pointMap.containsKey(stk) && Boolean.valueOf(pointMap.get(stk).toString())) { + WcsIncomingTaskRequestBody body = new WcsIncomingTaskRequestBody(); + body.setStation("叠盘机点位"); + body.setTaskType(TaskTypeEnum.In.getValue()); + body.setBussinessType(BusinTaskTypeEnum.stockIn.getValue()); + body.setCreateDt(new Date().toString()); + //调用agv接口查询库区状态 + Object[] areaStatus = {}; + body.setAreaStatus(areaStatus); + WcsResponseVo vo = wcsUtil.wcsIncomingTaskRequest(body); + log.info("空托申请wz-wcs返回:" + vo.getHeader()); + Map allMap = new HashMap<>(1); + Map reqMap = new HashMap<>(1); + + if (Result.isOk(vo.getHeader().getMsgCode())) { + reqMap.put(retStkVt,1); + } else { + reqMap.put(retStkVt,0); + } + allMap.put(retStk, reqMap); + String allMapJson = JsonUtil.toJSONString(allMap); + log.info("叠盘机叠满上报时,给输送线写命令数据:{}",allMapJson); + Boolean bCR01Boolean = plcReadAndWrite.execWrite(plcOperate, allMapJson); + log.info("叠盘机叠满上报时,写入的命令返回结果:"+bCR01Boolean.toString()); + } + } catch (Exception e) { log.error("dpsRealTimeTask:" + e.getMessage()); } + + } }