From 593cbad35cb45247ac022127ca7edad48ff92b12 Mon Sep 17 00:00:00 2001
From: maven <2163098428@qq.com>
Date: 星期四, 05 三月 2026 15:51:44 +0800
Subject: [PATCH] yys 1.人员入职同步新增用户,离职禁用登录 2.社保管理模块开发
---
src/main/java/com/ruoyi/common/utils/OrderUtils.java | 49 ++++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 48 insertions(+), 1 deletions(-)
diff --git a/src/main/java/com/ruoyi/common/utils/OrderUtils.java b/src/main/java/com/ruoyi/common/utils/OrderUtils.java
index 42c154d..32e55a0 100644
--- a/src/main/java/com/ruoyi/common/utils/OrderUtils.java
+++ b/src/main/java/com/ruoyi/common/utils/OrderUtils.java
@@ -2,6 +2,7 @@
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.ruoyi.common.utils.uuid.UUID;
import org.apache.poi.ss.formula.functions.T;
import org.springframework.stereotype.Component;
@@ -12,6 +13,7 @@
import java.time.format.DateTimeFormatter;
import java.util.Date;
import java.util.HashMap;
+import java.util.List;
import java.util.Map;
/**
@@ -19,6 +21,50 @@
* @date : 2025/9/15 15:31
*/
public class OrderUtils {
+
+ /**
+ * List<Integer> 杞崲涓� Long[] 鏁扮粍
+ * @param ids
+ * @return
+ */
+ public static Long[] listIntegerToLongArray(List<Integer> ids) {
+ return ids.stream()
+ // 澶勭悊null鍊硷細濡傛灉鍏冪礌涓簄ull锛岃浆鎹负0L锛堝彲鏍规嵁涓氬姟璋冩暣锛屾瘮濡傛姏寮傚父锛�
+ .map(id -> id != null ? id.longValue() : -1L)
+ // 灏哠tream<Long>杞崲涓篖ong[]鏁扮粍
+ .toArray(Long[]::new);
+ }
+
+ /**
+ * 鍒ゆ柇鐩爣id鏄惁鍦ㄩ�楀彿鍒嗛殧鐨勫瓧绗︿覆涓�
+ * @param targetId
+ * @param str
+ * @return
+ */
+ public boolean isStaffIdExist(Object targetId,String str) {
+ // 绌哄�兼牎楠岋紝閬垮厤绌烘寚閽�
+ if (str == null || str.trim().isEmpty() || targetId == null) {
+ return false;
+ }
+ // 鎸夐�楀彿鍒嗗壊鎴愭暟缁�
+ String[] idArray = str.split(",");
+ // 閬嶅巻鏁扮粍鍒ゆ柇鏄惁鍖呭惈鐩爣id
+ for (String id : idArray) {
+ // 鍘婚櫎绌烘牸锛堥槻姝㈠瓧绗︿覆涓湁澶氫綑绌烘牸锛屽"1, 121"锛�
+ String cleanId = id.trim();
+ // 杞崲涓烘暟瀛楀苟姣旇緝
+ try {
+ if (cleanId.equals(String.valueOf(targetId))) {
+ return true;
+ }
+ } catch (NumberFormatException e) {
+ // 鑻ュ瓨鍦ㄩ潪鏁板瓧ID锛岀洿鎺ヨ繑鍥瀎alse
+ return false;
+ }
+ }
+ return false;
+ }
+
/**
@@ -51,5 +97,6 @@
// 鎵ц鏌ヨ
Long aLong = mapper.selectCount(queryWrapper);
// 鎷兼帴璁㈠崟缂栧彿 preFix + 鏃堕棿锛坹yyyMMdd锛� + 璁㈠崟鏁伴噺(001)
- return preFix + LocalDate.now().format(DateTimeFormatter.ISO_LOCAL_DATE).replaceAll("-", "") + String.format("%03d", (aLong + 1));}
+ return preFix + LocalDate.now().format(DateTimeFormatter.ISO_LOCAL_DATE).replaceAll("-", "") + String.format("%03d", (aLong + 1)) + "-" + new Date().getTime();
+ }
}
--
Gitblit v1.9.3