Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
J
jyzb_platformV2
概览
Overview
Details
Activity
Cycle Analytics
版本库
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
问题
0
Issues
0
列表
Board
标记
里程碑
合并请求
0
Merge Requests
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
Snippets
成员
Members
Collapse sidebar
Close sidebar
活动
图像
聊天
创建新问题
作业
提交
Issue Boards
Open sidebar
赵剑炜
jyzb_platformV2
Commits
8492c3d3
Commit
8492c3d3
authored
Dec 25, 2023
by
赵剑炜
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
先恢复至可用
parent
6ffc99ae
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
28 行增加
和
24 行删除
+28
-24
pom.xml
jyzb-biz/pom.xml
+4
-1
MsgRedisCache.java
jyzb-biz/src/main/java/com/junmp/jyzb/cache/MsgRedisCache.java
+1
-0
TemperatureRedisCache.java
jyzb-biz/src/main/java/com/junmp/jyzb/cache/TemperatureRedisCache.java
+19
-22
HumidityAndtemperature.java
jyzb-biz/src/main/java/com/junmp/jyzb/entity/Temp/HumidityAndtemperature.java
+4
-1
没有找到文件。
jyzb-biz/pom.xml
View file @
8492c3d3
...
@@ -17,7 +17,10 @@
...
@@ -17,7 +17,10 @@
<artifactId>
spring-boot-starter-data-elasticsearch
</artifactId>
<artifactId>
spring-boot-starter-data-elasticsearch
</artifactId>
</dependency>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-data-redis
</artifactId>
</dependency>
<dependency>
<dependency>
<groupId>
io.swagger
</groupId>
<groupId>
io.swagger
</groupId>
<artifactId>
swagger-annotations
</artifactId>
<artifactId>
swagger-annotations
</artifactId>
...
...
jyzb-biz/src/main/java/com/junmp/jyzb/cache/MsgRedisCache.java
View file @
8492c3d3
package
com
.
junmp
.
jyzb
.
cache
;
package
com
.
junmp
.
jyzb
.
cache
;
import
com.junmp.jyzb.api.constant.JYZBConstant
;
import
com.junmp.jyzb.api.constant.JYZBConstant
;
import
com.junmp.v2.cache.AbstractRedisCache
;
import
com.junmp.v2.cache.AbstractRedisCache
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.data.redis.core.RedisTemplate
;
...
...
jyzb-biz/src/main/java/com/junmp/jyzb/cache/TemperatureRedisCache.java
View file @
8492c3d3
...
@@ -6,16 +6,13 @@ import com.junmp.v2.cache.AbstractRedisCache;
...
@@ -6,16 +6,13 @@ import com.junmp.v2.cache.AbstractRedisCache;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Set
;
import
java.util.stream.Collectors
;
@Component
@Component
public
class
TemperatureRedisCache
extends
AbstractRedisCache
<
HumidityAndtemperature
>
{
public
class
TemperatureRedisCache
extends
AbstractRedisCache
<
Object
>
{
public
TemperatureRedisCache
(
RedisTemplate
<
String
,
HumidityAndtemperature
>
redisTemplate
)
{
public
TemperatureRedisCache
(
RedisTemplate
<
String
,
Object
>
redisTemplate
)
{
super
(
redisTemplate
);
super
(
redisTemplate
);
// super(redisTemplate);
}
}
@Override
@Override
...
@@ -24,21 +21,21 @@ public class TemperatureRedisCache extends AbstractRedisCache<HumidityAndtempera
...
@@ -24,21 +21,21 @@ public class TemperatureRedisCache extends AbstractRedisCache<HumidityAndtempera
}
}
public
void
addTemperatureHumidity
(
String
warehouseId
,
String
warehouseName
,
long
timestamp
,
double
humidity
,
double
temperature
)
{
public
void
addTemperatureHumidity
(
String
warehouseId
,
String
warehouseName
,
long
timestamp
,
double
humidity
,
double
temperature
)
{
HumidityAndtemperature
data
=
new
HumidityAndtemperature
();
// HumidityAndtemperature data = new HumidityAndtemperature();
data
.
setHumidity
(
humidity
);
// data.setHumidity(humidity);
data
.
setTemperature
(
temperature
);
// data.setTemperature(temperature);
data
.
setCreateTime
(
timestamp
);
// data.setCreateTime(timestamp);
data
.
setWarehouseId
(
warehouseId
);
// data.setWarehouseId(warehouseId);
data
.
setWarehouseName
(
warehouseName
);
// data.setWarehouseName(warehouseName);
String
key
=
warehouseId
;
// String key = warehouseId;
getRedisTemplate
().
opsForZSet
().
add
(
key
,
data
,
timestamp
);
// getRedisTemplate().opsForZSet().add(key, data, timestamp);
//
put
(
key
,
data
);
// put(key, data);
}
public
List
<
HumidityAndtemperature
>
getDataByTimestampRange
(
String
warehouseId
,
long
startTimestamp
,
long
endTimestamp
)
{
String
key
=
warehouseId
;
Set
<
HumidityAndtemperature
>
dataInRange
=
getRedisTemplate
().
opsForZSet
().
rangeByScore
(
key
,
startTimestamp
,
endTimestamp
);
return
new
ArrayList
<>(
dataInRange
);
}
}
// public List<HumidityAndtemperature> getDataByTimestampRange(String warehouseId, long startTimestamp, long endTimestamp) {
// String key = warehouseId;
//
// Set<HumidityAndtemperature> dataInRange = getRedisTemplate().opsForZSet().rangeByScore(key, startTimestamp, endTimestamp);
// return new ArrayList<>(dataInRange);
// }
}
}
jyzb-biz/src/main/java/com/junmp/jyzb/entity/Temp/HumidityAndtemperature.java
View file @
8492c3d3
package
com
.
junmp
.
jyzb
.
entity
.
Temp
;
package
com
.
junmp
.
jyzb
.
entity
.
Temp
;
import
lombok.Data
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.io.Serializable
;
import
java.sql.Time
;
import
java.sql.Time
;
import
java.util.Date
;
import
java.util.Date
;
@Data
@Data
public
class
HumidityAndtemperature
{
@NoArgsConstructor
public
class
HumidityAndtemperature
implements
Serializable
{
//湿度
//湿度
private
Double
humidity
;
private
Double
humidity
;
//温度
//温度
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论