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
a128e36c
Commit
a128e36c
authored
Sep 12, 2023
by
刘林
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(equip):对接韶山换流站kafka数据
parent
5560474f
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
116 additions
and
14 deletions
+116
-14
RedisKey.java
...java/com/yeejoin/amos/boot/biz/common/utils/RedisKey.java
+5
-1
EquipmentIndexVO.java
...eejoin/equipmanage/common/entity/vo/EquipmentIndexVO.java
+3
-0
MqttConstant.java
...va/com/yeejoin/equipmanage/common/enums/MqttConstant.java
+14
-0
SShanMessage.java
.../java/com/yeejoin/equipmanage/common/vo/SShanMessage.java
+21
-0
SShanStationMessage.java
...om/yeejoin/equipmanage/common/vo/SShanStationMessage.java
+20
-0
StationMessage.java
...ava/com/yeejoin/equipmanage/common/vo/StationMessage.java
+26
-0
EquipmentIndexCacheRunner.java
...yeejoin/equipmanage/config/EquipmentIndexCacheRunner.java
+6
-0
EquipmentIotMqttReceiveConfig.java
...oin/equipmanage/config/EquipmentIotMqttReceiveConfig.java
+3
-2
EquipmentSpecificIndexMapper.java
...join/equipmanage/mapper/EquipmentSpecificIndexMapper.java
+1
-1
IEquipmentSpecificIndexService.java
...n/equipmanage/service/IEquipmentSpecificIndexService.java
+1
-1
MqttReceiveService.java
...a/com/yeejoin/equipmanage/service/MqttReceiveService.java
+1
-1
EquipmentSpecificIndexServiceImpl.java
...anage/service/impl/EquipmentSpecificIndexServiceImpl.java
+2
-2
MqttReceiveServiceImpl.java
...join/equipmanage/service/impl/MqttReceiveServiceImpl.java
+0
-0
EquipmentSpecificIndexMapper.xml
...rc/main/resources/mapper/EquipmentSpecificIndexMapper.xml
+13
-6
No files found.
amos-boot-biz-common/src/main/java/com/yeejoin/amos/boot/biz/common/utils/RedisKey.java
View file @
a128e36c
...
...
@@ -52,7 +52,11 @@ public class RedisKey {
* 装备指标Key值
*/
public
static
final
String
EQUIP_INDEX_ADDRESS_KEY
=
"equip_index_address_key"
;
/**
* 韶山换流站指标Key
*/
public
static
final
String
EQUIP_INDEX_ADDRESS_KEY_STATION
=
"equip_index_address_key_station"
;
/** 驼峰转下划线(简单写法,效率低于 ) */
public
static
String
humpToLine
(
String
str
)
{
return
str
.
replaceAll
(
"[A-Z]"
,
"_$0"
).
toLowerCase
();
...
...
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 @
a128e36c
...
...
@@ -72,6 +72,9 @@ public class EquipmentIndexVO {
@ApiModelProperty
(
value
=
"信号的索引键key,用于唯一索引信号"
)
private
String
indexAddress
;
@ApiModelProperty
(
value
=
"信号的索引键pointId,用于唯一索引信号"
)
private
String
eventAddress
;
@ApiModelProperty
(
value
=
"测点类型,analog/state"
)
private
String
dataType
;
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-equip-api/src/main/java/com/yeejoin/equipmanage/common/enums/MqttConstant.java
0 → 100644
View file @
a128e36c
package
com
.
yeejoin
.
equipmanage
.
common
.
enums
;
/**
* @author LiuLin
* @date 2023年08月02日 11:02
*/
public
interface
MqttConstant
{
String
TRUE
=
"true"
;
String
FALSE
=
"false"
;
String
STATE
=
"state"
;
String
DIS_CREATE
=
"discreate"
;
String
ONE_1
=
"1"
;
String
ONE_1_0
=
"1.0"
;
}
amos-boot-module/amos-boot-module-api/amos-boot-module-equip-api/src/main/java/com/yeejoin/equipmanage/common/vo/SShanMessage.java
0 → 100644
View file @
a128e36c
package
com
.
yeejoin
.
equipmanage
.
common
.
vo
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
lombok.ToString
;
/**
* @author LiuLin
* @date 2023年08月02日 11:02
*/
@Data
@ToString
@AllArgsConstructor
@NoArgsConstructor
public
class
SShanMessage
{
private
String
eventTextL1
;
private
String
pointId
;
private
String
time
;
private
String
deviceId
;
}
amos-boot-module/amos-boot-module-api/amos-boot-module-equip-api/src/main/java/com/yeejoin/equipmanage/common/vo/SShanStationMessage.java
0 → 100644
View file @
a128e36c
package
com
.
yeejoin
.
equipmanage
.
common
.
vo
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
lombok.ToString
;
import
java.util.List
;
/**
* @author LiuLin
* @date 2023年08月02日 11:02
*/
@Data
@ToString
@AllArgsConstructor
@NoArgsConstructor
public
class
SShanStationMessage
{
private
String
timestamp
;
private
List
<
SShanMessage
>
warns
;
}
amos-boot-module/amos-boot-module-api/amos-boot-module-equip-api/src/main/java/com/yeejoin/equipmanage/common/vo/StationMessage.java
0 → 100644
View file @
a128e36c
package
com
.
yeejoin
.
equipmanage
.
common
.
vo
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
lombok.ToString
;
/**
* 对接苏州,绍兴换流站Kafka数据
* @author LiuLin
* @date 2023年08月02日 11:02
*/
@Data
@ToString
@AllArgsConstructor
@NoArgsConstructor
public
class
StationMessage
{
private
String
dataType
;
private
String
value
;
private
String
timeStamp
;
private
String
quality
;
private
String
scadaId
;
private
String
key
;
private
String
disCreate
;
private
String
name
;
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/config/EquipmentIndexCacheRunner.java
View file @
a128e36c
...
...
@@ -33,6 +33,7 @@ public class EquipmentIndexCacheRunner implements CommandLineRunner {
log
.
info
(
">>服务启动执行,执行预加载数据等操作"
);
redisUtils
.
del
(
RedisKey
.
EQUIP_INDEX_ADDRESS
);
redisUtils
.
del
(
RedisKey
.
EQUIP_INDEX_ADDRESS_KEY
);
redisUtils
.
del
(
RedisKey
.
EQUIP_INDEX_ADDRESS_KEY_STATION
);
List
<
EquipmentIndexVO
>
equipSpecificIndexList
=
equipmentSpecificIndexMapper
.
getEquipSpecificIndexList
(
null
);
Map
<
String
,
Object
>
equipmentIndexVOMap
=
equipSpecificIndexList
.
stream
()
.
filter
(
v
->
v
.
getGatewayId
()
!=
null
)
...
...
@@ -40,8 +41,12 @@ public class EquipmentIndexCacheRunner implements CommandLineRunner {
Map
<
String
,
Object
>
equipmentIndexKeyMap
=
equipSpecificIndexList
.
stream
()
.
filter
(
v
->
v
.
getIndexAddress
()
!=
null
&&
v
.
getGatewayId
()
==
null
)
.
collect
(
Collectors
.
toMap
(
EquipmentIndexVO:
:
getIndexAddress
,
Function
.
identity
(),(
v1
,
v2
)
->
v1
));
Map
<
String
,
Object
>
equipmentIndexEventMap
=
equipSpecificIndexList
.
stream
()
.
filter
(
v
->
v
.
getEventAddress
()
!=
null
)
.
collect
(
Collectors
.
toMap
(
EquipmentIndexVO:
:
getEventAddress
,
Function
.
identity
(),(
v1
,
v2
)
->
v1
));
redisUtils
.
hmset
(
RedisKey
.
EQUIP_INDEX_ADDRESS
,
equipmentIndexVOMap
);
redisUtils
.
hmset
(
RedisKey
.
EQUIP_INDEX_ADDRESS_KEY
,
equipmentIndexKeyMap
);
redisUtils
.
hmset
(
RedisKey
.
EQUIP_INDEX_ADDRESS_KEY_STATION
,
equipmentIndexEventMap
);
}
}
\ No newline at end of file
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/config/EquipmentIotMqttReceiveConfig.java
View file @
a128e36c
...
...
@@ -126,6 +126,7 @@ public class EquipmentIotMqttReceiveConfig {
list
.
add
(
"+/+/event"
);
// 添加iot事件监听
list
.
add
(
"+/+/transmit"
);
// 添加交换站事件监听
list
.
add
(
"+/+/perspective"
);
// 添加交换站事件监听
list
.
add
(
"+/+/shaoshan"
);
// 添加换流站韶山监听事件
String
[]
arr
=
list
.
toArray
(
new
String
[
list
.
size
()]);
adapter
=
new
MqttPahoMessageDrivenChannelAdapter
(
clientId
+
"_inbound"
,
mqttPahoClientFactory
(),
arr
);
adapter
.
setCompletionTimeout
(
completionTimeout
);
...
...
@@ -151,8 +152,8 @@ public class EquipmentIotMqttReceiveConfig {
mqttEventReceiveService
.
handlerMqttIncrementMessage
(
topic
,
msg
);
}
else
if
(
dataType
.
equals
(
"transmit"
)
&&
StringUtil
.
isNotEmpty
(
msg
)){
mqttReceiveService
.
handlerMqttRomaMessage
(
topic
,
msg
);
}
else
if
(
dataType
.
equals
(
"
perspective
"
)
&&
StringUtil
.
isNotEmpty
(
msg
)){
mqttReceiveService
.
handlerMqtt
Iot
Message
(
topic
,
msg
);
}
else
if
(
dataType
.
equals
(
"
shaoshan
"
)
&&
StringUtil
.
isNotEmpty
(
msg
)){
mqttReceiveService
.
handlerMqtt
Station
Message
(
topic
,
msg
);
}
}
};
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/mapper/EquipmentSpecificIndexMapper.java
View file @
a128e36c
...
...
@@ -114,5 +114,5 @@ public interface EquipmentSpecificIndexMapper extends BaseMapper<EquipmentSpecif
List
<
EquipmentSpecificIndex
>
getEquipIndexInIndex
(
@Param
(
"list"
)
List
<
String
>
listIndex
);
EquipmentSpecificIndex
getEquipmentSpeIndexBy
IndexAddress
(
String
indexAddress
,
String
gatewayId
);
EquipmentSpecificIndex
getEquipmentSpeIndexBy
Address
(
String
indexAddress
,
String
eventAddress
,
String
gatewayId
);
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/IEquipmentSpecificIndexService.java
View file @
a128e36c
...
...
@@ -40,5 +40,5 @@ public interface IEquipmentSpecificIndexService extends IService<EquipmentSpecif
* @param indexAddress indexAddress
* @return EquipmentSpecificIndex
*/
EquipmentSpecificIndex
getEquipmentSpeIndexBy
IndexAddress
(
String
indexAddress
,
String
gatewayId
);
EquipmentSpecificIndex
getEquipmentSpeIndexBy
Address
(
String
indexAddress
,
String
eventAddress
,
String
gatewayId
);
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/MqttReceiveService.java
View file @
a128e36c
...
...
@@ -30,5 +30,5 @@ public interface MqttReceiveService {
* @param topic 主题
* @param message 消息内容
*/
void
handlerMqtt
Iot
Message
(
String
topic
,
String
message
);
void
handlerMqtt
Station
Message
(
String
topic
,
String
message
);
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/EquipmentSpecificIndexServiceImpl.java
View file @
a128e36c
...
...
@@ -30,7 +30,7 @@ public class EquipmentSpecificIndexServiceImpl extends ServiceImpl<EquipmentSpec
}
@Override
public
EquipmentSpecificIndex
getEquipmentSpeIndexBy
IndexAddress
(
String
indexAddress
,
String
gatewayId
)
{
return
this
.
baseMapper
.
getEquipmentSpeIndexBy
IndexAddress
(
indexAddress
,
gatewayId
);
public
EquipmentSpecificIndex
getEquipmentSpeIndexBy
Address
(
String
indexAddress
,
String
eventAddress
,
String
gatewayId
)
{
return
this
.
baseMapper
.
getEquipmentSpeIndexBy
Address
(
indexAddress
,
eventAddress
,
gatewayId
);
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/MqttReceiveServiceImpl.java
View file @
a128e36c
This diff is collapsed.
Click to expand it.
amos-boot-system-equip/src/main/resources/mapper/EquipmentSpecificIndexMapper.xml
View file @
a128e36c
...
...
@@ -522,7 +522,7 @@
</select>
<!-- 根据信号索引查询装备性能指标 -->
<select
id=
"getEquipmentSpeIndexBy
Index
Address"
<select
id=
"getEquipmentSpeIndexByAddress"
resultType=
"com.yeejoin.equipmanage.common.entity.EquipmentSpecificIndex"
>
SELECT wesi.id AS id,
wei.name_key AS nameKey,
...
...
@@ -561,10 +561,16 @@
LEFT JOIN wl_equipment_specific AS wes ON wes.id = wesi.equipment_specific_id
LEFT JOIN wl_equipment_detail ed ON ed.id = wes.equipment_detail_id
LEFT JOIN wl_equipment_index AS wei ON wei.id = wesi.equipment_index_id
WHERE
wesi.index_address = #{indexAddress}
<if
test=
"gatewayId != null"
>
AND wesi.gateway_id = #{gatewayId}
</if>
<where>
<if
test=
"indexAddress != null"
>
AND wesi.index_address = #{indexAddress}
</if>
<if
test=
"eventAddress != null"
>
AND wesi.event_address = #{eventAddress}
</if>
<if
test=
"gatewayId != null"
>
AND wesi.gateway_id = #{gatewayId}
</if>
</where>
</select>
</mapper>
\ No newline at end of file
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