From b7e0039880d9f6e71230dbf9c13538de4f8135b8 Mon Sep 17 00:00:00 2001
From: Junjie <fallin.jie@qq.com>
Date: 星期六, 10 六月 2023 19:23:26 +0800
Subject: [PATCH] 输送线条码读取bug、出入库模式信号、链条控制信号
---
src/main/java/com/zy/common/utils/NavigatePositionConvert.java | 48 +++++++++++++++++++++++++++++++++++++++++++++---
1 files changed, 45 insertions(+), 3 deletions(-)
diff --git a/src/main/java/com/zy/common/utils/NavigatePositionConvert.java b/src/main/java/com/zy/common/utils/NavigatePositionConvert.java
index 84ba529..be0be98 100644
--- a/src/main/java/com/zy/common/utils/NavigatePositionConvert.java
+++ b/src/main/java/com/zy/common/utils/NavigatePositionConvert.java
@@ -1,5 +1,11 @@
package com.zy.common.utils;
+import com.core.common.SpringUtils;
+import com.zy.asrs.entity.BasDevp;
+import com.zy.asrs.entity.LocMast;
+import com.zy.asrs.service.BasDevpService;
+import com.zy.asrs.service.LocMastService;
+
/**
* 搴撲綅缂栧彿鍜孉*绠楁硶鐨剎y杞磋浆鎹㈠伐鍏风被
*/
@@ -18,14 +24,50 @@
//xy杞磋浆鍧愭爣缂栧彿
public static Short xyToPosition(int x, int y) {
StringBuffer sb = new StringBuffer();
- sb.append(y);
+ sb.append(x);
if (x < 10) {
sb.append("00");
} else if (x < 100) {
sb.append("0");
}
- sb.append(x);
+ sb.append(y);
return Short.parseShort(sb.toString());
+ }
+
+ //xyz杞磋浆鍧愭爣缂栧彿
+ public static Short xyToPosition(int x, int y, int z) {
+ StringBuffer sb = new StringBuffer();
+ if (x < 10) {
+ sb.append("0");
+ }
+ sb.append(x);
+
+ if (y < 10) {
+ sb.append("00");
+ }else if (y < 100) {
+ sb.append("0");
+ }
+ sb.append(y);
+
+ if (z < 10) {
+ sb.append("0");
+ }
+ sb.append(z);
+ String position = sb.toString();//搴撲綅鍙�
+
+ //搴撲綅鍙疯浆灏忚溅浜岀淮鐮�
+ LocMastService locMastService = SpringUtils.getBean(LocMastService.class);
+ LocMast locMast = locMastService.queryByLoc(position);
+ if (locMast == null) {
+ //褰撳墠搴撲綅鍙锋煡涓嶅埌锛屽彲鑳芥槸绔欑偣搴撲綅鍙�
+ BasDevpService basDevpService = SpringUtils.getBean(BasDevpService.class);
+ BasDevp basDevp = basDevpService.queryByLocNo(position);
+ if (basDevp == null) {
+ return null;
+ }
+ return Short.parseShort(basDevp.getQrCodeValue());
+ }
+ return Short.parseShort(locMast.getQrCodeValue());
}
//杞崲琛屽彿锛屽疄闄呬腑鏈�搴曞眰鍙兘鏄涓�琛岋紝鍦ㄦ暟缁勪腑鏈�搴曞眰鏄渶鍚庝竴琛岋紝鍥犳闇�瑕佽繘琛岃浆鎹㈡墠鍙互鍖归厤鏁版嵁
@@ -38,7 +80,7 @@
}
public static int[] coverPosition(int col,int row) {
- return new int[]{row, col};
+ return new int[]{col, row};
}
}
--
Gitblit v1.9.1