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
4fa3d0da
Commit
4fa3d0da
authored
Jul 04, 2023
by
tangwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加告警接口
parent
50e7c5a3
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
84 additions
and
1 deletion
+84
-1
IndexDto.java
.../com/yeejoin/amos/boot/module/jxiop/api/dto/IndexDto.java
+2
-0
DeviceController.java
...os/boot/module/jxiop/biz/controller/DeviceController.java
+75
-0
MonitoringMapController.java
.../module/jxiop/biz/controller/MonitoringMapController.java
+6
-0
StationDataTaskImpl.java
...ot/module/jxiop/biz/service/impl/StationDataTaskImpl.java
+1
-1
No files found.
amos-boot-system-jxiop/amos-boot-module-jxiop-api/src/main/java/com/yeejoin/amos/boot/module/jxiop/api/dto/IndexDto.java
View file @
4fa3d0da
...
@@ -16,4 +16,6 @@ public class IndexDto {
...
@@ -16,4 +16,6 @@ public class IndexDto {
private
String
valueLabel
;
// '指标值', 取valueLable
private
String
valueLabel
;
// '指标值', 取valueLable
private
String
address
;
// 指标地址
private
String
address
;
// 指标地址
private
String
createdTime
;
// '上报时间',
private
String
createdTime
;
// '上报时间',
private
String
equipmentSpecificName
;
//
private
String
value
;
}
}
amos-boot-system-jxiop/amos-boot-module-jxiop-monitor-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/controller/DeviceController.java
0 → 100644
View file @
4fa3d0da
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
biz
.
controller
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.module.jxiop.api.dto.DeviceDto
;
import
com.yeejoin.amos.boot.module.jxiop.api.dto.IndexDto
;
import
com.yeejoin.amos.boot.module.jxiop.api.dto.PersonAccountDto
;
import
com.yeejoin.amos.boot.module.jxiop.biz.dto.RegionNationWideDto
;
import
com.yeejoin.amos.boot.module.jxiop.biz.utils.InfluxDButils
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
java.util.List
;
/**
* @description:
* @author: tw
* @createDate: 2023/7/4
*/
@RestController
@Api
(
tags
=
"device"
)
@RequestMapping
(
value
=
"/device"
)
public
class
DeviceController
extends
BaseController
{
@Autowired
InfluxDButils
influxDButils
;
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"获取告警数据"
)
@GetMapping
(
"/nationwide"
)
public
ResponseModel
<
Page
<
IndexDto
>>
getNationWideInfo
(
@RequestParam
(
value
=
"current"
)
int
current
,
@RequestParam
(
value
=
"size"
)
int
size
,
@RequestParam
(
value
=
"gateway"
)
String
gateway
)
{
Page
<
IndexDto
>
page
=
new
Page
<
IndexDto
>();
page
.
setCurrent
(
current
);
page
.
setSize
(
size
);
StringBuffer
querysql
=
new
StringBuffer
(
"SELECT createdTime ,gatewayId,address,valueLabel,equipmentSpecificName,value FROM iot_data WHERE isAlarm='1' and value!='0.0' and time > now() - 1d "
);
if
(
StringUtils
.
isNotEmpty
(
gateway
)){
String
[]
da
=
gateway
.
split
(
","
);
for
(
int
i
=
0
;
i
<
da
.
length
;
i
++)
{
if
(
i
==
0
){
querysql
.
append
(
"and ( gatewayId = "
).
append
(
"'"
+
da
[
i
]+
"'"
);
}
else
if
(
i
==
da
.
length
-
1
){
querysql
.
append
(
" or gatewayId = "
).
append
(
"'"
+
da
[
i
]+
"'"
).
append
(
") "
);
}
else
{
querysql
.
append
(
" or gatewayId = "
).
append
(
"'"
+
da
[
i
]+
"'"
);
}
}
}
querysql
.
append
(
" ORDER BY time desc LIMIT "
).
append
(
page
.
getSize
()).
append
(
" OFFSET "
).
append
((
page
.
getCurrent
()
-
1
)*
page
.
getSize
());
//每个分机的指标数据
List
<
IndexDto
>
list
=
influxDButils
.
getListData
(
querysql
.
toString
(),
IndexDto
.
class
);
page
.
setRecords
(
list
);
return
ResponseHelper
.
buildResponse
(
page
);
}
}
amos-boot-system-jxiop/amos-boot-module-jxiop-monitor-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/controller/MonitoringMapController.java
View file @
4fa3d0da
...
@@ -45,4 +45,10 @@ public class MonitoringMapController extends BaseController {
...
@@ -45,4 +45,10 @@ public class MonitoringMapController extends BaseController {
public
ResponseModel
<
List
<
RegionNationWideDto
>>
getNationWideInfo
(
@RequestParam
(
value
=
"provinceName"
,
required
=
false
)
String
provinceName
)
{
public
ResponseModel
<
List
<
RegionNationWideDto
>>
getNationWideInfo
(
@RequestParam
(
value
=
"provinceName"
,
required
=
false
)
String
provinceName
)
{
return
ResponseHelper
.
buildResponse
(
monitoringServiceImpl
.
getNationWideInfo
(
provinceName
));
return
ResponseHelper
.
buildResponse
(
monitoringServiceImpl
.
getNationWideInfo
(
provinceName
));
}
}
}
}
amos-boot-system-jxiop/amos-boot-module-jxiop-monitor-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/StationDataTaskImpl.java
View file @
4fa3d0da
...
@@ -89,7 +89,7 @@ public class StationDataTaskImpl {
...
@@ -89,7 +89,7 @@ public class StationDataTaskImpl {
List
<
List
<
IndexDto
>>
listfp4
=
Lists
.
partition
(
list
,
100
);
List
<
List
<
IndexDto
>>
listfp4
=
Lists
.
partition
(
list
,
100
);
for
(
List
<
IndexDto
>
indexDtos
:
listfp4
)
{
for
(
List
<
IndexDto
>
indexDtos
:
listfp4
)
{
//每个分级信息处理
//每个分级信息处理
monitorFanIndicatorImpl
.
UpdateMonitorFanIndicator
(
list
);
monitorFanIndicatorImpl
.
UpdateMonitorFanIndicator
(
indexDtos
);
}
}
}
}
}
}
...
...
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