From 335a11cce9569e97eb967407b867caf584d35316 Mon Sep 17 00:00:00 2001
From: Junjie <fallin.jie@qq.com>
Date: 星期二, 20 五月 2025 13:19:46 +0800
Subject: [PATCH] #
---
src/main/java/com/zy/common/utils/ForkLiftUtils.java | 42 ++++++++++++++++++++++++++++++++++++++++++
1 files changed, 42 insertions(+), 0 deletions(-)
diff --git a/src/main/java/com/zy/common/utils/ForkLiftUtils.java b/src/main/java/com/zy/common/utils/ForkLiftUtils.java
index 045054a..a7dbe75 100644
--- a/src/main/java/com/zy/common/utils/ForkLiftUtils.java
+++ b/src/main/java/com/zy/common/utils/ForkLiftUtils.java
@@ -24,6 +24,48 @@
*/
public class ForkLiftUtils {
+ //鑾峰彇鎻愬崌鏈烘墍鏈夌珯鐐�
+ public static List<Integer> getLiftAllStaNo(Integer liftNo) {
+ List<Integer> list = new ArrayList<>();
+ ForkLiftThread forkLiftThread = (ForkLiftThread) SlaveConnection.get(SlaveType.ForkLift, liftNo);
+ if (forkLiftThread == null) {
+ return list;
+ }
+
+ for (ForkLiftStaProtocol forkLiftStaProtocol : forkLiftThread.getForkLiftStaProtocols()) {
+ list.add(forkLiftStaProtocol.getStaNo());
+ }
+
+ return list;
+ }
+
+ //鑾峰彇鎻愬崌鏈烘墍缁戝畾鐨勮緭閫佺嚎鎵�鏈夌珯鐐�
+ public static List<Integer> getConveyorBindLiftAllStaNo(Integer liftNo) {
+ List<Integer> list = new ArrayList<>();
+ ConfigService configService = SpringUtils.getBean(ConfigService.class);
+ if (configService == null) {
+ return list;
+ }
+
+ Config conveyorLiftBindConfig = configService.selectOne(new EntityWrapper<Config>().eq("code", "conveyorLiftBind"));
+ if(conveyorLiftBindConfig == null) {
+ return list;
+ }
+
+ List<JSONObject> val = JSON.parseArray(conveyorLiftBindConfig.getValue(), JSONObject.class);
+ if (val.isEmpty()) {
+ return list;
+ }
+
+ for (JSONObject data : val) {
+ if(data.getInteger("liftNo").equals(liftNo)) {
+ list.add(data.getInteger("staNo"));
+ }
+ }
+
+ return list;
+ }
+
//鑾峰彇鎻愬崌鏈虹珯鐐�
public static ForkLiftStaProtocol getLiftStaByStaNo(Integer staNo) {
SlaveProperties slaveProperties = SpringUtils.getBean(SlaveProperties.class);
--
Gitblit v1.9.1