From 1a5cd57e23835da1fd582ca51e7ee1626d15148b Mon Sep 17 00:00:00 2001 From: Administrator <pjb> Date: 星期五, 25 七月 2025 18:02:56 +0800 Subject: [PATCH] 入库站点修改 --- src/main/java/com/zy/core/model/protocol/StaProtocol.java | 117 +++++++++++++++++++++++++++++++++++++++++++++++++--------- 1 files changed, 98 insertions(+), 19 deletions(-) diff --git a/src/main/java/com/zy/core/model/protocol/StaProtocol.java b/src/main/java/com/zy/core/model/protocol/StaProtocol.java index a31159e..ab271a0 100644 --- a/src/main/java/com/zy/core/model/protocol/StaProtocol.java +++ b/src/main/java/com/zy/core/model/protocol/StaProtocol.java @@ -1,7 +1,6 @@ package com.zy.core.model.protocol; import com.zy.asrs.entity.BasDevp; -import com.zy.asrs.entity.CommandInfo; import lombok.Data; import java.util.ArrayList; @@ -65,6 +64,12 @@ //鎸囦护ID private Integer commandId; + // 鐗╂枡鍙峰垪琛� + private List<String> matIdList; + + // 楂樺害 + private String height; + // 澶栧舰妫�娴� ------------------------------------------------------------------------ // 鍓嶈秴闄� @@ -105,7 +110,15 @@ private Boolean upcontactErr = false; //椤跺崌鐢垫満鎺ヨЕ鍣ㄦ晠闅� + private Boolean pushTheEnvelopeErr = false; // 鎻愬崌涓婃瀬闄� + private Boolean raiseTheLowerLimitErr = false; // 鎻愬崌涓嬫瀬闄� + + private Boolean leftProtectionTriggersErr = false; // 宸︿繚鎶よЕ鍙� + + private Boolean rightProtectionTriggersErr = false; // 鍙充繚鎶よЕ鍙� + + private Boolean gratingBlockingErr = false; // 鍏夋爡闃绘尅 private Short agvStartPick; //鍏佽鍙栬揣 private Short agvStartPlace; //鍏佽鏀捐揣 @@ -117,53 +130,119 @@ private List<Integer> alarm; + // 鑾峰彇鏁呴殰鎻忚堪 + public String getFaultDescription(){ + String faultDescription = ""; + if (breakerErr) { + faultDescription = "鐢佃矾淇濇姢鍣ㄦ柇寮�"; + } else if(infraredErr) { + faultDescription = "鍏夌數寮傚父(妫�鏌ユ墭鐩樻槸鍚﹀崱浣�)"; + }else if(outTimeErr) { + faultDescription = "杩愯瓒呮椂(妫�鏌ユ墭鐩樻槸鍚﹀崱浣�)"; + }else if(seizeSeatErr) { + faultDescription = "鍗犱綅瓒呮椂(妫�鏌GV鏄惁闀挎椂闂撮樆鎸″厜鐢典笖鏃犱氦浜掍俊鍙�)"; + }else if(wrkYgoodsN) { + faultDescription = "鏈変换鍔℃棤璐ф晠闅�(AGV鍙栬揣绂诲紑鍚庨暱鏃堕棿娌℃湁鏀跺埌AGV绂诲紑淇″彿)"; + }else if(inverterErr) { + faultDescription = "鍙橀鍣ㄦ晠闅�:"; + }else if(contactErr) { + faultDescription = "鎺ヨЕ鍣ㄦ晠闅�"; + }else if(upcontactErr) { + faultDescription = "椤跺崌鐢垫満鎺ヨЕ鍣ㄦ晠闅�"; + } else if(pushTheEnvelopeErr) { + faultDescription = "鎻愬崌涓婃瀬闄�"; + } else if(raiseTheLowerLimitErr) { + faultDescription = "鎻愬崌涓嬫瀬闄�"; + } else if(leftProtectionTriggersErr) { + faultDescription = "淇濇姢鍏夌數瑙﹀彂(妫�鏌GV鏀捐揣浣嶇疆)"; + } else if(rightProtectionTriggersErr) { + faultDescription = "鍙充繚鎶よЕ鍙�"; + } else if(gratingBlockingErr) { + faultDescription = "鍏夋爡闃绘尅"; + } + return faultDescription; + } - public List<Integer> getAlarm(){ + public List<Integer> getAlarm() { List<Integer> alarm = new ArrayList<>(); - if (breakerErr){ + if (breakerErr) { alarm.add(1); } - if (infraredErr){ + if (infraredErr) { alarm.add(2); } - if (outTimeErr){ + if (outTimeErr) { alarm.add(3); } - if (seizeSeatErr){ + if (seizeSeatErr) { alarm.add(4); } - if (wrkYgoodsN){ + if (wrkYgoodsN) { alarm.add(5); } - if (inverterErr){ + if (inverterErr) { alarm.add(6); } - if (contactErr){ + if (contactErr) { alarm.add(7); } - if (upcontactErr){ + if (upcontactErr) { alarm.add(8); } return alarm; } - - public BasDevp toSqlModel(){ + public BasDevp toSqlModel() { BasDevp basDevp = new BasDevp(); basDevp.setDevNo(siteId); basDevp.setWrkNo(workNo.intValue()); - basDevp.setAutoing(autoing?"Y":"N"); - basDevp.setLoading(loading?"Y":"N"); - basDevp.setInEnable(inEnable?"Y":"N"); - basDevp.setOutEnable(outEnable?"Y":"N"); + basDevp.setAutoing(autoing ? "Y" : "N"); + basDevp.setLoading(loading ? "Y" : "N"); + if (frontErr) { + basDevp.setStaErr(11); + } else if (backErr) { + basDevp.setStaErr(12); + } else if (highErr) { + basDevp.setStaErr(13); + } else if (leftErr) { + basDevp.setStaErr(14); + } else if (rightErr) { + basDevp.setStaErr(15); + } else if (weightErr) { + basDevp.setStaErr(16); + } else if (barcodeErr) { + basDevp.setStaErr(17); + } else if (breakerErr) { + basDevp.setStaErr(18); + } else if (infraredErr) { + basDevp.setStaErr(19); + } else if (outTimeErr) { + basDevp.setStaErr(110); + } else if (seizeSeatErr) { + basDevp.setStaErr(111); + } else if (wrkYgoodsN) { + basDevp.setStaErr(112); + } else if (inverterErr) { + basDevp.setStaErr(113); + } else if (contactErr) { + basDevp.setStaErr(114); + } else if (upcontactErr) { + basDevp.setStaErr(115); + } else { + if (!loading) { + basDevp.setStaErr(0); + } + } + basDevp.setInEnable(inEnable ? "Y" : "N"); + basDevp.setOutEnable(outEnable ? "Y" : "N"); basDevp.setLocType1((short) 0); // 楂樹綆绫诲瀷{0:鏈煡,1:浣庡簱浣�,2:楂樺簱浣峿 basDevp.setLocType2((short) 0); // 瀹界獎绫诲瀷{0:鏈煡,1:绐勫簱浣�,2:瀹藉簱浣峿 basDevp.setLocType3((short) 0); // 杞婚噸绫诲瀷{0:鏈煡,1:杞诲簱浣�,2:閲嶅簱浣峿 basDevp.setLocType1(high != low && low ? (short) 1 : (short) 2); - basDevp.setInQty(inQty !=null ?(int)inQty : 0); - basDevp.setAgvStartPick(agvStartPick.intValue()); - basDevp.setAgvStartPlace(agvStartPlace.intValue()); + basDevp.setInQty(inQty != null ? (int) inQty : 0); +// basDevp.setAgvStartPick(agvStartPick.intValue()); +// basDevp.setAgvStartPlace(agvStartPlace.intValue()); return basDevp; } -- Gitblit v1.9.1