From 0e0cf6f88516ca1aad92a0f2df7129a95dc4d1fc Mon Sep 17 00:00:00 2001 From: Junjie <fallin.jie@qq.com> Date: 星期一, 10 四月 2023 13:48:45 +0800 Subject: [PATCH] 四向穿梭车界面+错误码 --- src/main/java/com/zy/common/utils/NavigatePositionConvert.java | 44 +++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 43 insertions(+), 1 deletions(-) diff --git a/src/main/java/com/zy/common/utils/NavigatePositionConvert.java b/src/main/java/com/zy/common/utils/NavigatePositionConvert.java index fe443b0..28a2324 100644 --- a/src/main/java/com/zy/common/utils/NavigatePositionConvert.java +++ b/src/main/java/com/zy/common/utils/NavigatePositionConvert.java @@ -1,5 +1,9 @@ package com.zy.common.utils; +import com.core.common.SpringUtils; +import com.zy.asrs.entity.LocMast; +import com.zy.asrs.service.LocMastService; + /** * 搴撲綅缂栧彿鍜孉*绠楁硶鐨剎y杞磋浆鎹㈠伐鍏风被 */ @@ -15,6 +19,44 @@ return newPosition; } + //xy杞磋浆鍧愭爣缂栧彿 + public static Short xyToPosition(int x, int y) { + StringBuffer sb = new StringBuffer(); + sb.append(x); + if (x < 10) { + sb.append("00"); + } else if (x < 100) { + sb.append("0"); + } + sb.append(y); + return Short.parseShort(sb.toString()); + } + + //xyz杞磋浆鍧愭爣缂栧彿 + public static Short xyToPosition(int x, int y, int z) { + StringBuffer sb = new StringBuffer(); + sb.append(x); + if (x < 10) { + sb.append("00"); + } else if (x < 100) { + sb.append("0"); + } + + if (y < 10) { + 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); + return Short.parseShort(locMast.getQrCodeValue()); + } + //杞崲琛屽彿锛屽疄闄呬腑鏈�搴曞眰鍙兘鏄涓�琛岋紝鍦ㄦ暟缁勪腑鏈�搴曞眰鏄渶鍚庝竴琛岋紝鍥犳闇�瑕佽繘琛岃浆鎹㈡墠鍙互鍖归厤鏁版嵁 public static int covertRow(int row) { NavigateMapData mapData = new NavigateMapData(); @@ -25,7 +67,7 @@ } public static int[] coverPosition(int col,int row) { - return new int[]{row, col}; + return new int[]{col, row}; } } -- Gitblit v1.9.1