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()); } + + } }