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
8463cf1c
Commit
8463cf1c
authored
Jul 15, 2023
by
chenzhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
开关优化为消息接口
parent
97659aed
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
7 deletions
+34
-7
MonitorFanIdxController.java
.../module/jxiop/biz/controller/MonitorFanIdxController.java
+10
-5
MonitorFanIndicatorImpl.java
...odule/jxiop/biz/service/impl/MonitorFanIndicatorImpl.java
+24
-2
No files found.
amos-boot-system-jxiop/amos-boot-module-jxiop-monitor-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/controller/MonitorFanIdxController.java
View file @
8463cf1c
...
...
@@ -424,15 +424,20 @@ public class MonitorFanIdxController extends BaseController {
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"开关图片API"
)
@ApiOperation
(
value
=
"开关图片API
/消息
"
)
@GetMapping
(
"/switchUrl"
)
public
ResponseModel
<
Map
<
String
,
Object
>>
getElectricQuantityList
(
@RequestParam
(
value
=
"stationId"
)
String
stationId
,
@RequestParam
(
value
=
"equipName"
)
String
equipName
@RequestParam
(
value
=
"stationId"
)
String
stationId
)
{
StationBasic
stationBasic
=
stationBasicMapper
.
selectById
(
stationId
);
LambdaQueryWrapper
<
StationBasic
>
wrapper
=
new
LambdaQueryWrapper
<>();
List
<
StationBasic
>
stationBasics
=
stationBasicMapper
.
selectList
(
wrapper
);
for
(
StationBasic
stationBasic
:
stationBasics
)
{
String
gatewayId
=
stationBasic
.
getBoosterGatewayId
();
return
ResponseHelper
.
buildResponse
(
monitorFanIndicatorImpl
.
getSwitchUrl
(
gatewayId
,
equipName
));
monitorFanIndicatorImpl
.
getSwitchUrlAll
(
gatewayId
);
}
return
CommonResponseUtil
.
success
();
}
}
amos-boot-system-jxiop/amos-boot-module-jxiop-monitor-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/MonitorFanIndicatorImpl.java
View file @
8463cf1c
...
...
@@ -974,8 +974,23 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
}
}
public
void
getSwitchUrlAll
(
String
gatewayId
){
String
sql
=
"SELECT * FROM indicators_"
+
gatewayId
+
" WHERE systemType = '开关' and displayName =~/合位$/"
;
List
<
IndicatorsDto
>
listData
=
influxDButils
.
getListData
(
sql
,
IndicatorsDto
.
class
);
Set
<
String
>
names
=
new
HashSet
<>();
for
(
IndicatorsDto
listDatum
:
listData
)
{
names
.
add
(
listDatum
.
getFrontModule
());
}
for
(
String
name
:
names
)
{
getSwitchUrl
(
gatewayId
,
name
);
}
}
public
Map
<
String
,
Object
>
getSwitchUrl
(
String
gatewayId
,
String
equipName
){
public
void
getSwitchUrl
(
String
gatewayId
,
String
equipName
){
String
sql
=
"SELECT * FROM indicators_"
+
gatewayId
+
" WHERE systemType = '开关' and frontModule =~ /"
+
equipName
+
"/ and displayName =~/合位$/"
;
List
<
IndicatorsDto
>
listData
=
influxDButils
.
getListData
(
sql
,
IndicatorsDto
.
class
);
Map
<
String
,
Object
>
photoUrls
=
new
HashMap
<>();
...
...
@@ -989,7 +1004,14 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
}
photoUrls
.
put
(
listDatum
.
getDisplayName
().
split
(
"_"
)[
0
]+
"url"
,
url
);
}
return
photoUrls
;
try
{
emqKeeper
.
getMqttClient
().
publish
(
gatewayId
+
"/switch"
,
JSON
.
toJSONString
(
photoUrls
).
getBytes
(),
0
,
false
);
}
catch
(
MqttException
e
)
{
e
.
printStackTrace
();
log
.
error
(
"开关消息发送失败"
);
}
}
}
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