Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Z
zhny
Project
Project
Details
Activity
Releases
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
王夏晖
zhny
Commits
bbdfd05f
Commit
bbdfd05f
authored
Oct 24, 2018
by
jichao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加网关数据监测
parent
f880d13e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
0 deletions
+28
-0
BusProjectController.java
...soft/business/manage/controller/BusProjectController.java
+7
-0
BusProjectService.java
...rg/rcisoft/business/manage/service/BusProjectService.java
+7
-0
BusProjectServiceImpl.java
...t/business/manage/service/impl/BusProjectServiceImpl.java
+14
-0
No files found.
src/main/java/org/rcisoft/business/manage/controller/BusProjectController.java
View file @
bbdfd05f
...
...
@@ -113,6 +113,13 @@ public class BusProjectController extends PaginationController<BusProject> {
busProjectServiceImpl
.
downloadExcel
(
response
,
new
ExcelParams
(
proId
,
start
,
end
,
code
,
type
));
}
@ApiOperation
(
value
=
"检查网关数据"
,
notes
=
"返回值,1:正确,0:有错误"
)
@RequestMapping
(
value
=
"/checkData"
)
public
Result
checkData
(
@RequestParam
String
proId
)
{
Integer
result
=
busProjectServiceImpl
.
checkData
(
proId
);
return
Result
.
builder
(
new
PersistModel
(
result
),
null
,
"网关数据接收异常"
,
null
);
}
@InitBinder
public
void
initBinder
(
WebDataBinder
webDataBinder
,
WebRequest
webRequest
)
{
DateFormat
dateFormat
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
...
...
src/main/java/org/rcisoft/business/manage/service/BusProjectService.java
View file @
bbdfd05f
...
...
@@ -73,4 +73,11 @@ public interface BusProjectService {
*/
void
downloadExcel
(
HttpServletResponse
response
,
ExcelParams
excelParams
);
/**
* 检查网关数据
* @param proId
* @return
*/
Integer
checkData
(
String
proId
);
}
src/main/java/org/rcisoft/business/manage/service/impl/BusProjectServiceImpl.java
View file @
bbdfd05f
...
...
@@ -425,6 +425,20 @@ public class BusProjectServiceImpl implements BusProjectService {
}
@Override
public
Integer
checkData
(
String
proId
)
{
Integer
result
=
1
;
String
count
=
rcRedisService
.
get
(
proId
+
"-count"
);
// 如果等于空,认为是正确的值
if
(
StringUtils
.
isNotEmpty
(
count
))
{
// 计数超过5,认为数据没有正确的接收
if
(
Integer
.
parseInt
(
count
)
>
5
)
{
result
=
0
;
}
}
return
result
;
}
/**
* 根据id,type获取表具或设备的名称
* @param type 1:表具,2:设备
...
...
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