Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
项目统一框架
amos-boot-biz
Commits
30bcda9e
Commit
30bcda9e
authored
Oct 15, 2024
by
张森
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
健康诊断告警,稳压泵每小时启动次数>15次生成了告警记录、但是设备未赋红码
parent
4f7fae68
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
2 deletions
+18
-2
RedisUtils.java
...va/com/yeejoin/amos/boot/biz/common/utils/RedisUtils.java
+16
-0
MqttReceiveServiceImpl.java
...join/equipmanage/service/impl/MqttReceiveServiceImpl.java
+2
-2
No files found.
amos-boot-biz-common/src/main/java/com/yeejoin/amos/boot/biz/common/utils/RedisUtils.java
View file @
30bcda9e
...
...
@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.biz.common.utils;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.data.redis.core.StringRedisTemplate
;
import
org.springframework.stereotype.Component
;
import
org.springframework.util.CollectionUtils
;
import
org.typroject.tyboot.component.cache.enumeration.CacheType
;
...
...
@@ -24,6 +25,10 @@ public class RedisUtils {
@Autowired
private
RedisTemplate
redisTemplate
;
@Autowired
private
StringRedisTemplate
stringRedisTemplate
;
/**
* 指定缓存失效时间
*
...
...
@@ -41,6 +46,17 @@ public class RedisUtils {
}
/**
* 普通缓存获取
*
* @param key 键
* @return 值
*/
public
String
getString
(
String
key
)
{
String
object
=
stringRedisTemplate
.
opsForValue
().
get
(
key
);
return
object
;
}
/**
* 根据key 获取过期时间
*
* @param key 键 不能为null
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/MqttReceiveServiceImpl.java
View file @
30bcda9e
...
...
@@ -3111,10 +3111,10 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
}
private
JSONObject
getRiskTriggerConfig
(
String
tableName
)
{
Map
<
String
,
Object
>
configMap
=
JSON
.
parseObject
(
redisUtils
.
get
(
QRCODE_REDIS_KEY
).
toString
(
),
Map
.
class
);
Map
<
String
,
Object
>
configMap
=
JSON
.
parseObject
(
redisUtils
.
get
String
(
QRCODE_REDIS_KEY
),
Map
.
class
);
if
(!
ObjectUtils
.
isEmpty
(
configMap
))
{
String
config
=
configMap
.
get
(
tableName
+
"0"
).
toString
();
return
JSONObject
.
parseObject
(
config
).
getJSONObject
(
"extra"
);
return
JSONObject
.
parseObject
(
config
).
getJSONObject
(
"
content"
).
getJSONObject
(
"
extra"
);
}
return
null
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment