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
b3077db1
Commit
b3077db1
authored
Jun 21, 2023
by
刘林
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(equip):苏州换流站代码优化
parent
7e9c0b42
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
72 additions
and
2 deletions
+72
-2
RedisKey.java
...java/com/yeejoin/amos/boot/biz/common/utils/RedisKey.java
+10
-0
EquipmentIndexVO.java
...eejoin/equipmanage/common/entity/vo/EquipmentIndexVO.java
+9
-0
EquipmentIndexCacheRunner.java
...yeejoin/equipmanage/config/EquipmentIndexCacheRunner.java
+48
-0
MqttReceiveServiceImpl.java
...join/equipmanage/service/impl/MqttReceiveServiceImpl.java
+0
-0
EquipmentSpecificIndexMapper.xml
...rc/main/resources/mapper/EquipmentSpecificIndexMapper.xml
+5
-2
No files found.
amos-boot-biz-common/src/main/java/com/yeejoin/amos/boot/biz/common/utils/RedisKey.java
View file @
b3077db1
...
@@ -42,6 +42,16 @@ public class RedisKey {
...
@@ -42,6 +42,16 @@ public class RedisKey {
/** 企业用户注册前缀 */
/** 企业用户注册前缀 */
public
static
final
String
FLC_USER_TEL
=
"flc_tel_"
;
public
static
final
String
FLC_USER_TEL
=
"flc_tel_"
;
/**
* 装备指标Key值
*/
public
static
final
String
EQUIP_INDEX_ADDRESS
=
"equip_index_address"
;
/**
* 装备指标Key值
*/
public
static
final
String
EQUIP_INDEX_ADDRESS_KEY
=
"equip_index_address_key"
;
/** 驼峰转下划线(简单写法,效率低于 ) */
/** 驼峰转下划线(简单写法,效率低于 ) */
public
static
String
humpToLine
(
String
str
)
{
public
static
String
humpToLine
(
String
str
)
{
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-equip-api/src/main/java/com/yeejoin/equipmanage/common/entity/vo/EquipmentIndexVO.java
View file @
b3077db1
...
@@ -69,4 +69,13 @@ public class EquipmentIndexVO {
...
@@ -69,4 +69,13 @@ public class EquipmentIndexVO {
@ApiModelProperty
(
value
=
"指标枚举"
)
@ApiModelProperty
(
value
=
"指标枚举"
)
private
String
valueEnum
;
private
String
valueEnum
;
@ApiModelProperty
(
value
=
"信号的索引键key,用于唯一索引信号"
)
private
String
indexAddress
;
@ApiModelProperty
(
value
=
"测点类型,analog/state"
)
private
String
dataType
;
@ApiModelProperty
(
value
=
"网关标识"
)
private
String
gatewayId
;
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/config/EquipmentIndexCacheRunner.java
0 → 100644
View file @
b3077db1
package
com
.
yeejoin
.
equipmanage
.
config
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisKey
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.equipmanage.common.entity.vo.EquipmentIndexVO
;
import
com.yeejoin.equipmanage.mapper.EquipmentSpecificIndexMapper
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.boot.CommandLineRunner
;
import
org.springframework.stereotype.Component
;
import
javax.annotation.Resource
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.function.Function
;
import
java.util.stream.Collectors
;
/**
* @author LiuLin
* @date 2023/6/15
* @apiNote
*/
@Component
@Slf4j
public
class
EquipmentIndexCacheRunner
implements
CommandLineRunner
{
@Resource
private
EquipmentSpecificIndexMapper
equipmentSpecificIndexMapper
;
@Resource
private
RedisUtils
redisUtils
;
@Override
public
void
run
(
String
...
args
)
throws
Exception
{
log
.
info
(
">>服务启动执行,执行预加载数据等操作"
);
redisUtils
.
del
(
RedisKey
.
EQUIP_INDEX_ADDRESS
);
redisUtils
.
del
(
RedisKey
.
EQUIP_INDEX_ADDRESS_KEY
);
List
<
EquipmentIndexVO
>
equipSpecificIndexList
=
equipmentSpecificIndexMapper
.
getEquipSpecificIndexList
(
null
);
Map
<
String
,
Object
>
equipmentIndexVOMap
=
equipSpecificIndexList
.
stream
()
.
filter
(
v
->
v
.
getGatewayId
()
!=
null
)
.
collect
(
Collectors
.
toMap
(
vo
->
vo
.
getIndexAddress
()
+
"_"
+
vo
.
getGatewayId
(),
Function
.
identity
()));
Map
<
String
,
Object
>
equipmentIndexKeyMap
=
equipSpecificIndexList
.
stream
()
.
filter
(
v
->
v
.
getIndexAddress
()
!=
null
&&
v
.
getGatewayId
()
==
null
)
.
collect
(
Collectors
.
toMap
(
EquipmentIndexVO:
:
getIndexAddress
,
Function
.
identity
()));
redisUtils
.
hmset
(
RedisKey
.
EQUIP_INDEX_ADDRESS
,
equipmentIndexVOMap
);
redisUtils
.
hmset
(
RedisKey
.
EQUIP_INDEX_ADDRESS_KEY
,
equipmentIndexKeyMap
);
}
}
\ No newline at end of file
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/MqttReceiveServiceImpl.java
View file @
b3077db1
This diff is collapsed.
Click to expand it.
amos-boot-system-equip/src/main/resources/mapper/EquipmentSpecificIndexMapper.xml
View file @
b3077db1
...
@@ -329,10 +329,13 @@
...
@@ -329,10 +329,13 @@
ei.`name` AS perfQuotaName,
ei.`name` AS perfQuotaName,
si.`value`,
si.`value`,
ei.is_iot,
ei.is_iot,
e
i.unit AS unitName,
s
i.unit AS unitName,
ei.sort_num,
ei.sort_num,
si.create_date,
si.create_date,
si.update_date
si.update_date,
si.index_address,
si.gateway_id,
si.data_type
FROM
FROM
wl_equipment_specific_index si
wl_equipment_specific_index si
LEFT JOIN wl_equipment_index ei ON si.equipment_index_id = ei.id
LEFT JOIN wl_equipment_index ei ON si.equipment_index_id = ei.id
...
...
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