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
563155ee
Commit
563155ee
authored
Jul 13, 2023
by
zhangsen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
模拟量消息开发
parent
53375ff4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
39 additions
and
1 deletion
+39
-1
MonitorFanIndicatorMapper.xml
...i/src/main/resources/mapper/MonitorFanIndicatorMapper.xml
+1
-1
MonitorFanIdxController.java
.../module/jxiop/biz/controller/MonitorFanIdxController.java
+14
-0
IndicatorsDto.java
...yeejoin/amos/boot/module/jxiop/biz/dto/IndicatorsDto.java
+1
-0
MonitorFanIndicatorImpl.java
...odule/jxiop/biz/service/impl/MonitorFanIndicatorImpl.java
+23
-0
No files found.
amos-boot-system-jxiop/amos-boot-module-jxiop-api/src/main/resources/mapper/MonitorFanIndicatorMapper.xml
View file @
563155ee
...
@@ -95,7 +95,7 @@
...
@@ -95,7 +95,7 @@
`gateway_id` as gatewayId,
`gateway_id` as gatewayId,
`booster_name` as text,
`booster_name` as text,
booster_name as boosterName,
booster_name as boosterName,
<!-- `booster_code` as value,-->
`booster_code` as boosterCode,
`sort` as value
`sort` as value
from booster_station_info
from booster_station_info
<where>
<where>
...
...
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 @
563155ee
...
@@ -19,6 +19,7 @@ import io.swagger.annotations.ApiOperation;
...
@@ -19,6 +19,7 @@ import io.swagger.annotations.ApiOperation;
import
org.elasticsearch.index.Index
;
import
org.elasticsearch.index.Index
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RequestParam
;
...
@@ -361,5 +362,18 @@ public class MonitorFanIdxController extends BaseController {
...
@@ -361,5 +362,18 @@ public class MonitorFanIdxController extends BaseController {
return
ResponseHelper
.
buildResponse
(
resultsData
);
return
ResponseHelper
.
buildResponse
(
resultsData
);
}
}
@Scheduled
(
cron
=
"0/10 * * * * ? "
)
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"模拟量列表消息"
)
@GetMapping
(
"/getAnalogQuantityInfo"
)
public
ResponseModel
getAnalogQuantityInfo
()
{
LambdaQueryWrapper
<
StationBasic
>
wrapper
=
new
LambdaQueryWrapper
<>();
List
<
StationBasic
>
stationBasics
=
stationBasicMapper
.
selectList
(
wrapper
);
for
(
StationBasic
stationBasic
:
stationBasics
)
{
String
gatewayId
=
stationBasic
.
getFanGatewayId
();
monitorFanIndicator
.
getAnalogQuantityInfo
(
gatewayId
,
stationBasic
.
getSequenceNbr
().
toString
());
}
return
CommonResponseUtil
.
success
();
}
}
}
amos-boot-system-jxiop/amos-boot-module-jxiop-monitor-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/dto/IndicatorsDto.java
View file @
563155ee
...
@@ -26,6 +26,7 @@ public class IndicatorsDto {
...
@@ -26,6 +26,7 @@ public class IndicatorsDto {
private
String
distinct
;
private
String
distinct
;
private
String
time
;
private
String
time
;
private
String
displayName
;
private
String
displayName
;
private
String
title
;
public
String
getTime
()
{
public
String
getTime
()
{
...
...
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 @
563155ee
...
@@ -711,5 +711,28 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
...
@@ -711,5 +711,28 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
ResultsData
resultsData
=
new
ResultsData
(
DataGridMock
,
listColModel
);
ResultsData
resultsData
=
new
ResultsData
(
DataGridMock
,
listColModel
);
return
resultsData
;
return
resultsData
;
}
}
public
void
getAnalogQuantityInfo
(
String
gatewayId
,
String
stationId
)
{
List
<
Map
<
String
,
String
>>
boosterStationInfo
=
monitorFanIndicatorregionMapper
.
getBoosterStationInfo
(
gatewayId
);
for
(
Map
<
String
,
String
>
map
:
boosterStationInfo
)
{
String
sql
=
String
.
format
(
"SELECT equipmentIndexName, value, frontModule, unit, displayName FROM \"indicators_%s\" WHERE systemType = '%s' and frontModule =~/%s/ "
,
gatewayId
,
"模拟量"
,
map
.
get
(
"boosterName"
));
List
<
IndicatorsDto
>
listData
=
influxDButils
.
getListData
(
sql
,
IndicatorsDto
.
class
);
listData
.
forEach
(
item
->
{
if
(
StringUtils
.
isNotEmpty
(
item
.
getUnit
()))
{
item
.
setDisplayName
(
String
.
format
(
"%s(%s)"
,
item
.
getDisplayName
(),
item
.
getUnit
()));
}
});
IPage
<
IndicatorsDto
>
result
=
new
Page
<>();
result
.
setRecords
(
listData
);
result
.
setCurrent
(
1
);
result
.
setTotal
(
listData
.
size
());
try
{
emqKeeper
.
getMqttClient
().
publish
(
String
.
format
(
"%s/%s/%s"
,
stationId
,
map
.
get
(
"boosterCode"
),
"mnl"
),
JSON
.
toJSONString
(
result
).
getBytes
(),
0
,
false
);
}
catch
(
MqttException
e
)
{
log
.
info
(
"消息发送失败"
);
e
.
printStackTrace
();
}
}
}
}
}
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