版本更新
This commit is contained in:
@@ -5,10 +5,7 @@ import java.util.concurrent.TimeUnit;
|
||||
|
||||
import com.core.common.exception.UtilException;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.redis.core.BoundSetOperations;
|
||||
import org.springframework.data.redis.core.HashOperations;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.data.redis.core.ValueOperations;
|
||||
import org.springframework.data.redis.core.*;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
@@ -256,4 +253,28 @@ public class RedisCache {
|
||||
return this.redisTemplate.opsForValue().increment(key, delta);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 获取所有String类型的键值对(开发环境下使用)
|
||||
*/
|
||||
public Map<String, Object> getAllDictDataWithKeys(String pattern) {
|
||||
pattern+="*";
|
||||
Map<String, Object> allDict = new HashMap<>();
|
||||
// 1. 获取所有键("*"匹配所有键)
|
||||
Set<String> allKeys = redisTemplate.keys(pattern);
|
||||
if (allKeys == null || allKeys.isEmpty()) {
|
||||
return allDict;
|
||||
}
|
||||
// 2. 批量获取值(使用multiGet高效批量查询)
|
||||
ValueOperations<String, Object> valueOps = redisTemplate.opsForValue();
|
||||
List<Object> values = valueOps.multiGet(allKeys);
|
||||
// 3. 组装键值对
|
||||
Iterator<String> keyIter = allKeys.iterator();
|
||||
for (Object value : values) {
|
||||
if (keyIter.hasNext()) {
|
||||
allDict.put(keyIter.next(), value);
|
||||
}
|
||||
}
|
||||
return allDict;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -197,7 +197,39 @@ public enum TenantOptionDict {
|
||||
/**
|
||||
* PACSAppSecret
|
||||
*/
|
||||
FORWARD_SWITCH("forwardSwitch", "电子发票中转服务开关", 47);
|
||||
FORWARD_SWITCH("forwardSwitch", "电子发票中转服务开关", 47),
|
||||
/**
|
||||
* 食源性开关
|
||||
*/
|
||||
FOODBORNE_SWITCH("foodborneSwitch", "食源性开关", 48),
|
||||
/**
|
||||
* 食源性接口地址 ../goto(格式如下:http://172.16.7.247/infections/goto 需指定到/goto)
|
||||
*/
|
||||
FOODBORNE_API_URL("foodborneApiUrl", "食源性接口地址 ../goto", 49),
|
||||
/**
|
||||
* 食源性医疗机构
|
||||
*/
|
||||
FOODBORNE_HOSPITAL("foodborneHospital", "食源性医疗机构", 50),
|
||||
/**
|
||||
* 食源性登录账号
|
||||
*/
|
||||
FOODBORNE_USER_NAME("foodborneUserName", "食源性登录账号", 51),
|
||||
/**
|
||||
* BPC商户号
|
||||
*/
|
||||
BPC_MID("bpcMid", "BPC商户号", 52),
|
||||
/**
|
||||
* BPC终端号
|
||||
*/
|
||||
BPC_TID("bpcTid", "BPC终端号", 53),
|
||||
/**
|
||||
* BPCMD5签名密钥
|
||||
*/
|
||||
BPC_MD5_SHARED_SECRET("bpcMd5SharedSecret", "BPCMD5签名密钥", 54),
|
||||
/**
|
||||
* BPC请求URL
|
||||
*/
|
||||
BPC_REQUEST_URL("bpcRequestUrl", "BPC请求URL", 55);
|
||||
|
||||
private final String code;
|
||||
private final String name;
|
||||
|
||||
Reference in New Issue
Block a user