From e31d3ceb4a6196f565794ccfd6b4540e99e4d71b Mon Sep 17 00:00:00 2001 From: luxiaotao1123 <t1341870251@163.com> Date: 星期四, 28 三月 2024 15:32:00 +0800 Subject: [PATCH] Merge branch 'Four-Way-Rack' of http://47.97.1.152:5880/r/zy-asrs-master into Four-Way-Rack --- zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/model/protocol/ShuttleProtocol.java | 43 +++++++++++++++++++++++++++++++++++++++---- 1 files changed, 39 insertions(+), 4 deletions(-) diff --git a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/model/protocol/ShuttleProtocol.java b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/model/protocol/ShuttleProtocol.java index d9a3147..0eb07b2 100644 --- a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/model/protocol/ShuttleProtocol.java +++ b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/model/protocol/ShuttleProtocol.java @@ -16,6 +16,8 @@ import lombok.Data; import lombok.extern.slf4j.Slf4j; +import java.util.HashMap; + /** * 鍥涘悜绌挎杞� */ @@ -27,7 +29,7 @@ /** * 鍥涘悜绌挎杞﹀彿 */ - private String shuttleNo; + private Integer shuttleNo; /** * 浠诲姟鍙� @@ -87,6 +89,11 @@ * 鏄惁椤跺崌 */ private Boolean hasLift; + + /** + * 鏄惁鏈夋墭鐩� + */ + private Boolean hasPallet; /** * 琛岄┒鏂瑰悜 @@ -220,12 +227,20 @@ public Integer getTaskNo() { RedisUtil redisUtil = SpringUtils.getBean(RedisUtil.class); if (null != redisUtil) { - Object o = redisUtil.get(DeviceRedisConstant.SHUTTLE_FLAG + this.taskNo); + Object o = redisUtil.get(DeviceRedisConstant.SHUTTLE_FLAG + this.shuttleNo); if (!Cools.isEmpty(o)) { this.taskNo = Integer.parseInt(String.valueOf(o)); } } return this.taskNo == null ? 0 : this.taskNo; + } + + public void setTaskNo(Integer taskNo) { + RedisUtil redisUtil = SpringUtils.getBean(RedisUtil.class); + if (null != redisUtil) { + redisUtil.set(DeviceRedisConstant.SHUTTLE_FLAG + this.shuttleNo, taskNo); + this.taskNo = taskNo; + } } //閫氳繃褰撳墠浜岀淮鐮佽幏鍙栧綋鍓嶅簱浣嶅彿 @@ -239,9 +254,10 @@ } //婧愬簱浣�(灏忚溅褰撳墠浣嶇疆) - Loc currentLoc = locService.getOne(new LambdaQueryWrapper<Loc>() + LambdaQueryWrapper<Loc> wrapper = new LambdaQueryWrapper<Loc>() .eq(Loc::getCode, this.currentCode) - .eq(Loc::getHostId, this.device.getHostId())); + .eq(Loc::getHostId, this.device.getHostId()); + Loc currentLoc = locService.getOne(wrapper); if (currentLoc == null) { return null; } @@ -249,4 +265,23 @@ return currentLoc.getLocNo(); } + // 鏄惁澶勪簬绌洪棽寰呭懡鐘舵�� + public Boolean isIdle() { + if (this.deviceStatus == null + || this.pakMk == null + || this.errorCode == null + || this.protocolStatus == null + ) { + return false; + } + + boolean res = this.deviceStatus.equals(ShuttleDeviceStatusType.IDLE) + && this.pakMk + && !this.errorCode.equals("0") + && this.getTaskNo() == 0 + && this.protocolStatus.intValue() == ShuttleProtocolStatusType.IDLE.id + ; + return res; + } + } -- Gitblit v1.9.1