From 0e5bddf6084d3dfb7bcad7217d4320898416eba3 Mon Sep 17 00:00:00 2001
From: zouyu <2723363702@qq.com>
Date: 星期四, 23 十月 2025 16:49:12 +0800
Subject: [PATCH] 拆分原材料和外购成品的业务流程(报检、下单、检验)

---
 ruoyi-common/src/main/java/com/ruoyi/common/utils/RedisUtil.java |   56 +++++++++++++++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 53 insertions(+), 3 deletions(-)

diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/RedisUtil.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/RedisUtil.java
index ad77b81..fd82b06 100644
--- a/ruoyi-common/src/main/java/com/ruoyi/common/utils/RedisUtil.java
+++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/RedisUtil.java
@@ -153,6 +153,7 @@
 
     public static boolean set(String key, Object value) {
         try {
+
             redisTemplate.opsForValue().set(key, value);
             return true;
         } catch (Exception e) {
@@ -470,7 +471,7 @@
      * @param start 寮�濮�
      * @param end   缁撴潫 0 鍒� -1浠h〃鎵�鏈夊��
      */
-    public static List<Object> lGet(String key, long start, long end) {
+    public static List<?> lGet(String key, long start, long end) {
         try {
             return redisTemplate.opsForList().range(key, start, end);
         } catch (Exception e) {
@@ -556,7 +557,7 @@
      * @param value 鍊�
      * @return true 瀛樻斁鎴愬姛 false瀛樻斁澶辫触
      */
-    public static boolean lSet(String key, List<Object> value) {
+    public static boolean lSet(String key, List<?> value) {
         try {
             redisTemplate.opsForList().rightPushAll(key, value);
             return true;
@@ -576,7 +577,7 @@
      * @param time  鏃堕棿(绉�)
      * @return true 瀛樻斁鎴愬姛 false瀛樻斁澶辫触
      */
-    public static boolean lSet(String key, List<Object> value, long time) {
+    public static boolean lSet(String key, List<?> value, long time) {
         try {
             if (time > 0) {
                 redisTemplate.opsForList().rightPushAll(key, value);
@@ -627,5 +628,54 @@
             return 0;
         }
     }
+
+    //====================================================ZSet=======================================================
+
+    /**
+     * 鑾峰彇zset鏁版嵁闀垮害
+     * @param key 閿�
+     * @return
+     */
+    public static long getZSetSize(String key){
+        try {
+            return redisTemplate.opsForZSet().size(key);
+        }catch (Exception e){
+            e.printStackTrace();
+            return 0L;
+        }
+    }
+
+    /**
+     * 鏂板涓�涓獄set
+     * @param key    閿�
+     * @param source 鍒嗘暟
+     * @param value  鍊�
+     * @return
+     */
+    public static boolean addZSet(String key,double source,Object value){
+        try {
+            return redisTemplate.opsForZSet().add(key, value, source);
+        }catch(Exception e){
+            e.printStackTrace();
+            return false;
+        }
+    }
+
+    /**
+     * 鍒犻櫎zset鍏冪礌锛屾寜鎺掑悕
+     * @param key   閿�
+     * @param start 寮�濮嬬储寮�
+     * @param end   缁撴潫绱㈠紩
+     * @return
+     */
+    public static long delZSetRange(String key,long start,long end){
+        try {
+            return redisTemplate.opsForZSet().removeRange(key,start,end);
+        }catch(Exception e){
+            e.printStackTrace();
+            return 0L;
+        }
+    }
+
 }
 

--
Gitblit v1.9.3