中控上报信息存储优化
This commit is contained in:
parent
cef25e8180
commit
a819ced87f
@ -9,6 +9,7 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author attiya
|
||||
@ -490,4 +491,18 @@ public class RedisUtil {
|
||||
public Object getEcu(String ecuSn) {
|
||||
return get(Database.DB2, BIKE_ECU_PREFIX + ecuSn);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量获取ECU信息(基于已知的SN列表)
|
||||
*
|
||||
* @param ecuSnList ECU序列号列表
|
||||
* @return ECU信息列表,顺序与输入列表对应
|
||||
*/
|
||||
public List<Object> batchGetEcu(List<String> ecuSnList) {
|
||||
List<String> keys = ecuSnList.stream()
|
||||
.map(sn -> BIKE_ECU_PREFIX + sn)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
return getRedisTemplate(Database.DB2).opsForValue().multiGet(keys);
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user