From e9a4418c14ef68fb454300b092c413e8df259ec2 Mon Sep 17 00:00:00 2001 From: Junjie <xjj@123> Date: 星期六, 13 四月 2024 11:50:56 +0800 Subject: [PATCH] # --- zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/utils/NavigatePositionConvert.java | 32 ++++---------------------------- 1 files changed, 4 insertions(+), 28 deletions(-) diff --git a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/utils/NavigatePositionConvert.java b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/utils/NavigatePositionConvert.java index a44bd3d..fb6fa67 100644 --- a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/utils/NavigatePositionConvert.java +++ b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/utils/NavigatePositionConvert.java @@ -12,38 +12,14 @@ public class NavigatePositionConvert { public static String xyToPosition(int x, int y, int z, Long hostId) { - 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();//搴撲綅鍙� + String locNo = Utils.getLocNo(x, y, z); //搴撲綅鍙疯浆灏忚溅浜岀淮鐮� LocService locMastService = SpringUtils.getBean(LocService.class); Loc locMast = locMastService.getOne(new LambdaQueryWrapper<Loc>() - .eq(Loc::getLocNo, position) + .eq(Loc::getLocNo, locNo) .eq(Loc::getHostId, hostId)); 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 null; } return locMast.getCode(); @@ -51,8 +27,8 @@ //鍧愭爣缂栧彿杞瑇y杞� public static int[] positionToXY(String position) { - int col = Integer.parseInt(position.substring(0, 2)); - int row = Integer.parseInt(position.substring(2, 5)); + int col = Utils.getRow(position); + int row = Utils.getBay(position); int[] newPosition = coverPosition(col,row); //杩斿洖x鍜寉 // return new int[]{row, col}; -- Gitblit v1.9.1