From bf18e7de3ebfa4d258b1b4c94451a2221a17cd42 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期三, 03 四月 2024 14:06:14 +0800
Subject: [PATCH] #
---
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/utils/Utils.java | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 56 insertions(+), 0 deletions(-)
diff --git a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/utils/Utils.java b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/utils/Utils.java
index 81dae25..d8f7718 100644
--- a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/utils/Utils.java
+++ b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/utils/Utils.java
@@ -1,10 +1,66 @@
package com.zy.asrs.wcs.core.utils;
+import com.zy.asrs.framework.common.Cools;
+
import java.util.ArrayList;
import java.util.List;
public class Utils {
+ public static final String _LINK = "-";
+
+ /**
+ * 閫氳繃搴撲綅鍙疯幏鍙� 鎺�
+ */
+ public static int getRow(String locNo) {
+ if (!Cools.isEmpty(locNo)) {
+ String[] split = locNo.split(_LINK);
+ return Integer.parseInt(split[0]);
+ }
+ throw new RuntimeException("搴撲綅瑙f瀽寮傚父");
+ }
+
+ /**
+ * 閫氳繃搴撲綅鍙疯幏鍙� 鍒�
+ */
+ public static int getBay(String locNo) {
+ if (!Cools.isEmpty(locNo)) {
+ String[] split = locNo.split(_LINK);
+ return Integer.parseInt(split[1]);
+ }
+ throw new RuntimeException("搴撲綅瑙f瀽寮傚父");
+ }
+
+ /**
+ * 閫氳繃搴撲綅鍙疯幏鍙� 灞�
+ */
+ public static int getLev(String locNo) {
+ if (!Cools.isEmpty(locNo)) {
+ String[] split = locNo.split(_LINK);
+ return Integer.parseInt(split[2]);
+ }
+ throw new RuntimeException("搴撲綅瑙f瀽寮傚父");
+ }
+
+ public static String getLocNo(Number row, Number bay, Number lev) {
+ return row + _LINK + bay + _LINK + lev;
+// return zerofill(String.valueOf(row), 2) + zerofill(String.valueOf(bay), 3) + zerofill(String.valueOf(lev), 2);
+ }
+
+ public static String zerofill(String msg, Integer count){
+ if (msg.length() == count){
+ return msg;
+ } else if (msg.length() > count){
+ return msg.substring(0, 16);
+ } else {
+ StringBuilder msgBuilder = new StringBuilder(msg);
+ for (int i = 0; i<count-msg.length(); i++){
+ msgBuilder.insert(0,"0");
+ }
+ return msgBuilder.toString();
+ }
+ }
+
//鑾峰彇闄ょ櫧鍚嶅崟澶栫殑鎸囧畾妤煎眰鍏ㄩ儴绌挎杞y鍧愭爣鐐�
public static List<int[]> getShuttlePoints(Integer whiteShuttle, Integer lev) {
// SlaveProperties slaveProperties = SpringUtils.getBean(SlaveProperties.class);
--
Gitblit v1.9.1