From bfe469c7fa604a6431d58ea5e5143c959d76bd86 Mon Sep 17 00:00:00 2001
From: Junjie <540245094@qq.com>
Date: 星期二, 11 十一月 2025 16:09:38 +0800
Subject: [PATCH] #

---
 src/main/java/com/zy/asrs/utils/Utils.java |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/src/main/java/com/zy/asrs/utils/Utils.java b/src/main/java/com/zy/asrs/utils/Utils.java
index a55a484..cf9784b 100644
--- a/src/main/java/com/zy/asrs/utils/Utils.java
+++ b/src/main/java/com/zy/asrs/utils/Utils.java
@@ -8,6 +8,7 @@
 
 public class Utils {
 
+    private static final String LOC_NO_FLAG = "-";
     private static final DecimalFormat fmt = new DecimalFormat("##0.00");
 
     public static float scale(Float f){
@@ -36,7 +37,8 @@
      */
     public static int getRow(String locNo) {
         if (!Cools.isEmpty(locNo)) {
-            return Integer.parseInt(locNo.substring(0, 2));
+            String[] split = locNo.split(LOC_NO_FLAG);
+            return Integer.parseInt(split[0]);
         }
         throw new RuntimeException("搴撲綅瑙f瀽寮傚父");
     }
@@ -46,7 +48,8 @@
      */
     public static int getBay(String locNo) {
         if (!Cools.isEmpty(locNo)) {
-            return Integer.parseInt(locNo.substring(2, 5));
+            String[] split = locNo.split(LOC_NO_FLAG);
+            return Integer.parseInt(split[1]);
         }
         throw new RuntimeException("搴撲綅瑙f瀽寮傚父");
     }
@@ -56,13 +59,14 @@
      */
     public static int getLev(String locNo) {
         if (!Cools.isEmpty(locNo)) {
-            return Integer.parseInt(locNo.substring(5, 7));
+            String[] split = locNo.split(LOC_NO_FLAG);
+            return Integer.parseInt(split[2]);
         }
         throw new RuntimeException("搴撲綅瑙f瀽寮傚父");
     }
 
     public static String getLocNo(Number row, Number bay, Number lev) {
-        return zerofill(String.valueOf(row), 2) + zerofill(String.valueOf(bay), 3) + zerofill(String.valueOf(lev), 2);
+        return row + LOC_NO_FLAG + bay + LOC_NO_FLAG + lev;
     }
 
     public static boolean isJSON(String value) {

--
Gitblit v1.9.1