Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-zx-biz
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
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
Jobs
Commits
Open sidebar
项目统一框架
一体化_户用光伏项目代码
amos-boot-zx-biz
Commits
9ae08238
Commit
9ae08238
authored
Oct 22, 2025
by
wujiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交代码
parent
30aae562
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
57 additions
and
14 deletions
+57
-14
EquipmentIndexVO.java
.../main/java/com/yeejoin/equip/entity/EquipmentIndexVO.java
+2
-0
MqttConnector.java
...p/src/main/java/com/yeejoin/equip/eqmx/MqttConnector.java
+10
-4
SystemInit.java
...quip/src/main/java/com/yeejoin/equip/eqmx/SystemInit.java
+32
-9
EquipmentSpecificIndexMapper.xml
...n/resources/mapper/mysql/EquipmentSpecificIndexMapper.xml
+13
-1
No files found.
amos-boot-data/amos-boot-data-equip/src/main/java/com/yeejoin/equip/entity/EquipmentIndexVO.java
View file @
9ae08238
...
@@ -95,4 +95,6 @@ public class EquipmentIndexVO implements Serializable {
...
@@ -95,4 +95,6 @@ public class EquipmentIndexVO implements Serializable {
private
String
newAddress
;
private
String
newAddress
;
private
String
dType
;
}
}
amos-boot-data/amos-boot-data-equip/src/main/java/com/yeejoin/equip/eqmx/MqttConnector.java
View file @
9ae08238
...
@@ -91,23 +91,29 @@ public class MqttConnector implements Connector, MqttCallback {
...
@@ -91,23 +91,29 @@ public class MqttConnector implements Connector, MqttCallback {
{
{
com
.
alibaba
.
fastjson
.
JSONObject
msg
=
com
.
alibaba
.
fastjson
.
JSONObject
.
parseObject
(
message
.
toString
());
com
.
alibaba
.
fastjson
.
JSONObject
msg
=
com
.
alibaba
.
fastjson
.
JSONObject
.
parseObject
(
message
.
toString
());
String
node
=
msg
.
getString
(
"node"
);
String
node
=
msg
.
getString
(
"node"
);
if
(
node
.
contains
(
"fan"
))
Map
<
String
,
String
>
map
=
null
;
if
(
node
.
contains
(
"fan2.5"
))
{
{
gatewayId
=
"1668801435891929089"
;
gatewayId
=
"1668801435891929089"
;
map
=
SystemInit
.
fanmap
.
get
(
"fan2.5"
);
}
else
if
(
node
.
contains
(
"fan3.45"
))
{
gatewayId
=
"1668801435891929089"
;
map
=
SystemInit
.
fanmap
.
get
(
"fan3.45"
);
}
else
if
(
node
.
contains
(
"station"
))
}
else
if
(
node
.
contains
(
"station"
))
{
{
gatewayId
=
"1668801570352926721"
;
gatewayId
=
"1668801570352926721"
;
map
=
SystemInit
.
map
.
get
(
gatewayId
);
}
else
}
else
{
{
return
;
return
;
}
}
String
values
=
msg
.
getString
(
"values"
);
String
values
=
msg
.
getString
(
"values"
);
JSONObject
vobj
=
JSONObject
.
parseObject
(
values
,
JSONObject
.
class
);
JSONObject
vobj
=
JSONObject
.
parseObject
(
values
,
JSONObject
.
class
);
Map
<
String
,
String
>
map
=
SystemInit
.
map
.
get
(
gatewayId
);
for
(
String
key:
vobj
.
keySet
())
for
(
String
key:
vobj
.
keySet
())
{
{
JSONObject
result
=
new
JSONObject
();
JSONObject
result
=
new
JSONObject
();
if
(
map
.
containsKey
(
key
))
if
(
map
!=
null
&&
map
.
containsKey
(
key
))
{
{
String
oldAddress
=
map
.
get
(
key
);
String
oldAddress
=
map
.
get
(
key
);
result
.
put
(
"address"
,
oldAddress
);
result
.
put
(
"address"
,
oldAddress
);
...
@@ -142,7 +148,7 @@ public class MqttConnector implements Connector, MqttCallback {
...
@@ -142,7 +148,7 @@ public class MqttConnector implements Connector, MqttCallback {
for
(
String
key:
vobj
.
keySet
())
for
(
String
key:
vobj
.
keySet
())
{
{
JSONObject
result
=
new
JSONObject
();
JSONObject
result
=
new
JSONObject
();
if
(
map
.
containsKey
(
key
))
if
(
map
!=
null
&&
map
.
containsKey
(
key
))
{
{
String
oldAddress
=
map
.
get
(
key
);
String
oldAddress
=
map
.
get
(
key
);
result
.
put
(
"address"
,
oldAddress
);
result
.
put
(
"address"
,
oldAddress
);
...
...
amos-boot-data/amos-boot-data-equip/src/main/java/com/yeejoin/equip/eqmx/SystemInit.java
View file @
9ae08238
...
@@ -20,23 +20,46 @@ public class SystemInit {
...
@@ -20,23 +20,46 @@ public class SystemInit {
public
static
Map
<
String
,
Map
<
String
,
String
>>
map
=
new
HashMap
<>();
public
static
Map
<
String
,
Map
<
String
,
String
>>
map
=
new
HashMap
<>();
public
static
Map
<
String
,
Map
<
String
,
String
>>
fanmap
=
new
HashMap
<>();
@Autowired
@Autowired
private
EquipmentSpecificIndexMapper
equipmentSpecificIndexMapper
;
private
EquipmentSpecificIndexMapper
equipmentSpecificIndexMapper
;
@PostConstruct
@PostConstruct
public
void
point
()
public
void
point
()
{
{
List
<
EquipmentIndexVO
>
list
=
equipmentSpecificIndexMapper
.
getEquipSpecificIndexList
(
null
);
EquipmentIndexVO
equipmentIndexVO
=
new
EquipmentIndexVO
();
Map
<
String
,
Map
<
String
,
String
>>
result
=
list
.
stream
()
equipmentIndexVO
.
setDType
(
"null"
);
equipmentIndexVO
.
setNewAddress
(
"notnull"
);
List
<
EquipmentIndexVO
>
list
=
equipmentSpecificIndexMapper
.
getEquipSpecificIndexList
(
equipmentIndexVO
);
Map
<
String
,
List
<
EquipmentIndexVO
>>
glist
=
list
.
stream
()
.
collect
(
Collectors
.
groupingBy
(
.
collect
(
Collectors
.
groupingBy
(
EquipmentIndexVO:
:
getGatewayId
,
EquipmentIndexVO:
:
getGatewayId
Collectors
.
toMap
(
vo
->
Optional
.
ofNullable
(
vo
.
getNewAddress
()).
orElse
(
""
),
EquipmentIndexVO:
:
getIndexAddress
)
));
));
map
=
result
;
for
(
String
key
:
glist
.
keySet
())
{
Map
<
String
,
String
>
map1
=
new
HashMap
<>();
for
(
EquipmentIndexVO
v
:
glist
.
get
(
key
))
{
map1
.
put
(
v
.
getNewAddress
(),
v
.
getIndexAddress
());
}
map
.
put
(
key
,
map1
);
}
equipmentIndexVO
.
setDType
(
"notnull"
);
List
<
EquipmentIndexVO
>
list2
=
equipmentSpecificIndexMapper
.
getEquipSpecificIndexList
(
equipmentIndexVO
);
Map
<
String
,
List
<
EquipmentIndexVO
>>
list3
=
list2
.
stream
()
.
collect
(
Collectors
.
groupingBy
(
EquipmentIndexVO:
:
getDType
));
for
(
String
key
:
list3
.
keySet
())
{
Map
<
String
,
String
>
map1
=
new
HashMap
<>();
for
(
EquipmentIndexVO
v
:
list3
.
get
(
key
))
{
map1
.
put
(
v
.
getNewAddress
(),
v
.
getIndexAddress
());
}
fanmap
.
put
(
key
,
map1
);
}
}
}
}
}
amos-boot-data/amos-boot-data-equip/src/main/resources/mapper/mysql/EquipmentSpecificIndexMapper.xml
View file @
9ae08238
...
@@ -16,6 +16,7 @@
...
@@ -16,6 +16,7 @@
<result
property=
"equipmentSpecificName"
column=
"equipment_specific_name"
/>
<result
property=
"equipmentSpecificName"
column=
"equipment_specific_name"
/>
<result
property=
"dataType"
column=
"data_type"
/>
<result
property=
"dataType"
column=
"data_type"
/>
<result
property=
"newAddress"
column=
"new_address"
/>
<result
property=
"newAddress"
column=
"new_address"
/>
<result
property=
"dType"
column=
"d_type"
/>
</resultMap>
</resultMap>
<select
id=
"getEquipSpecificIndexList"
resultMap=
"ComplementCode"
>
<select
id=
"getEquipSpecificIndexList"
resultMap=
"ComplementCode"
>
...
@@ -32,7 +33,8 @@
...
@@ -32,7 +33,8 @@
si.equipment_specific_name,
si.equipment_specific_name,
si.equipment_index_name,
si.equipment_index_name,
si.is_alarm,
si.is_alarm,
si.new_address
si.new_address,
si.d_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
...
@@ -43,6 +45,15 @@
...
@@ -43,6 +45,15 @@
<if
test=
"isIot != null and isIot !=''"
>
<if
test=
"isIot != null and isIot !=''"
>
AND ei.is_iot = #{isIot}
AND ei.is_iot = #{isIot}
</if>
</if>
<if
test=
"newAddress =='notnull'"
>
AND si.new_address is not null
</if>
<if
test=
"dType =='null'"
>
AND si.d_type is null
</if>
<if
test=
"dType =='notnull'"
>
AND si.d_type is not null
</if>
</where>
</where>
</select>
</select>
</mapper>
</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