From 2f3cd0975b753d535054a9ffb19e61c4031032a4 Mon Sep 17 00:00:00 2001
From: buhuazhen <hua100783@gmail.com>
Date: 星期三, 18 三月 2026 15:32:34 +0800
Subject: [PATCH] feat(sales): 新增加工承揽合同导出功能

---
 src/main/java/com/ruoyi/common/utils/StringUtils.java |   45 +++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 45 insertions(+), 0 deletions(-)

diff --git a/src/main/java/com/ruoyi/common/utils/StringUtils.java b/src/main/java/com/ruoyi/common/utils/StringUtils.java
index fc6c6b5..4e9b245 100644
--- a/src/main/java/com/ruoyi/common/utils/StringUtils.java
+++ b/src/main/java/com/ruoyi/common/utils/StringUtils.java
@@ -287,6 +287,32 @@
     }
 
     /**
+     * 鍦ㄥ瓧绗︿覆涓煡鎵剧涓�涓嚭鐜扮殑 `open` 鍜屾渶鍚庝竴涓嚭鐜扮殑 `close` 涔嬮棿鐨勫瓙瀛楃涓�
+     * 
+     * @param str 瑕佹埅鍙栫殑瀛楃涓�
+     * @param open 璧峰瀛楃涓�
+     * @param close 缁撴潫瀛楃涓�
+     * @return 鎴彇缁撴灉
+     */
+    public static String substringBetweenLast(final String str, final String open, final String close)
+    {
+        if (isEmpty(str) || isEmpty(open) || isEmpty(close))
+        {
+            return NULLSTR;
+        }
+        final int start = str.indexOf(open);
+        if (start != INDEX_NOT_FOUND)
+        {
+            final int end = str.lastIndexOf(close);
+            if (end != INDEX_NOT_FOUND)
+            {
+                return str.substring(start + open.length(), end);
+            }
+        }
+        return NULLSTR;
+    }
+
+    /**
      * 鍒ゆ柇鏄惁涓虹┖锛屽苟涓斾笉鏄┖鐧藉瓧绗�
      * 
      * @param str 瑕佸垽鏂殑value
@@ -353,6 +379,18 @@
     public static final Set<String> str2Set(String str, String sep)
     {
         return new HashSet<String>(str2List(str, sep, true, false));
+    }
+
+    /**
+     * 瀛楃涓茶浆list
+     * 
+     * @param str 瀛楃涓�
+     * @param sep 鍒嗛殧绗�
+     * @return list闆嗗悎
+     */
+    public static final List<String> str2List(String str, String sep)
+    {
+        return str2List(str, sep, true, false);
     }
 
     /**
@@ -681,4 +719,11 @@
         }
         return sb.toString();
     }
+
+    public static String padRight(String str, int length) {
+        if (str == null) str = "";
+        if (str.length() >= length) return str;
+        // 鐢ㄧ┖鏍艰ˉ榻�
+        return String.format("%-" + length + "s", str);
+    }
 }
\ No newline at end of file

--
Gitblit v1.9.3