From a76e1d17d67641993dea6335cb8e1465a94df58d Mon Sep 17 00:00:00 2001
From: liding <756868258@qq.com>
Date: 星期四, 21 五月 2026 15:39:05 +0800
Subject: [PATCH] feat(stock): 优化库存管理和成品树结构功能 1- 为ApproveProcessMapper.xml和ProductBomMapper.xml添加排序功能 2- 在ProductionProductMainDto中新增bomInputQty字段用于产品结构投入数量 3- 修改ProductionProductMainServiceImpl中投入数量计算逻辑,使用前端传入的bomInputQty值 4- 在ProductWorkOrderDto中添加bomInputQty字段并在服务实现中计算标准投入数量 5- 更新SalesLedgerMapper.xml查询逻辑,从product_summary获取电压信息 6- 为SalesLedgerProduct添加stockId字段并修改库存扣减逻辑使用具体库存ID 7- 重构StockInventoryController中的成品库存树查询接口和导入导出功能 8- 新增成品和非成品库存导入导出的数据模型和Excel工具类 9- 优化StockInventoryServiceImpl中的库存扣减逻辑,支持按特定库存ID操作 10- 更新库存导入导出功能,区分成品和非成品类型并提供相应模板
---
src/main/java/com/ruoyi/framework/redis/RedisCache.java | 44 +++++++++++++++++++++++++++++++++++++++-----
1 files changed, 39 insertions(+), 5 deletions(-)
diff --git a/src/main/java/com/ruoyi/framework/redis/RedisCache.java b/src/main/java/com/ruoyi/framework/redis/RedisCache.java
index 6157274..121b27b 100644
--- a/src/main/java/com/ruoyi/framework/redis/RedisCache.java
+++ b/src/main/java/com/ruoyi/framework/redis/RedisCache.java
@@ -15,7 +15,7 @@
/**
* spring redis 宸ュ叿绫�
- *
+ *
* @author ruoyi
**/
@SuppressWarnings(value = { "unchecked", "rawtypes" })
@@ -75,6 +75,28 @@
}
/**
+ * 鑾峰彇鏈夋晥鏃堕棿
+ *
+ * @param key Redis閿�
+ * @return 鏈夋晥鏃堕棿
+ */
+ public long getExpire(final String key)
+ {
+ return redisTemplate.getExpire(key);
+ }
+
+ /**
+ * 鍒ゆ柇 key鏄惁瀛樺湪
+ *
+ * @param key 閿�
+ * @return true 瀛樺湪 false涓嶅瓨鍦�
+ */
+ public Boolean hasKey(String key)
+ {
+ return redisTemplate.hasKey(key);
+ }
+
+ /**
* 鑾峰緱缂撳瓨鐨勫熀鏈璞°��
*
* @param key 缂撳瓨閿��
@@ -102,16 +124,16 @@
* @param collection 澶氫釜瀵硅薄
* @return
*/
- public long deleteObject(final Collection collection)
+ public boolean deleteObject(final Collection collection)
{
- return redisTemplate.delete(collection);
+ return redisTemplate.delete(collection) > 0;
}
/**
* 缂撳瓨List鏁版嵁
*
* @param key 缂撳瓨鐨勯敭鍊�
- * @param values 寰呯紦瀛樼殑List鏁版嵁
+ * @param dataList 寰呯紦瀛樼殑List鏁版嵁
* @return 缂撳瓨鐨勫璞�
*/
public <T> long setCacheList(final String key, final List<T> dataList)
@@ -222,8 +244,20 @@
}
/**
+ * 鍒犻櫎Hash涓殑鏌愭潯鏁版嵁
+ *
+ * @param key Redis閿�
+ * @param hKey Hash閿�
+ * @return 鏄惁鎴愬姛
+ */
+ public boolean deleteCacheMapValue(final String key, final String hKey)
+ {
+ return redisTemplate.opsForHash().delete(key, hKey) > 0;
+ }
+
+ /**
* 鑾峰緱缂撳瓨鐨勫熀鏈璞″垪琛�
- *
+ *
* @param pattern 瀛楃涓插墠缂�
* @return 瀵硅薄鍒楄〃
*/
--
Gitblit v1.9.3