Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
hg-smart
Overview
Overview
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
platform
hg-smart
Commits
47542f6d
Commit
47542f6d
authored
Oct 21, 2024
by
liuyang
Committed by
lyy
Oct 21, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
2024-10-21
1.新增APP设备管理接口
parent
c1ae1a43
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
68 additions
and
1 deletions
+68
-1
ServiceHGSB010.java
.../java/com/baosight/hggp/hg/sb/service/ServiceHGSB010.java
+67
-0
HGSB010.xml
src/main/java/com/baosight/hggp/hg/sb/sql/HGSB010.xml
+1
-1
No files found.
src/main/java/com/baosight/hggp/hg/sb/service/ServiceHGSB010.java
View file @
47542f6d
...
@@ -18,6 +18,21 @@ import java.util.stream.Collectors;
...
@@ -18,6 +18,21 @@ import java.util.stream.Collectors;
*/
*/
public
class
ServiceHGSB010
extends
ServiceEPBase
{
public
class
ServiceHGSB010
extends
ServiceEPBase
{
@OperationLogAnnotation
(
operModul
=
"设备监控"
,
operType
=
"app查询"
,
operDesc
=
"app查询设备状态"
)
public
EiInfo
queryAppBySbStatus
(
EiInfo
inInfo
)
{
Map
params
=
EiInfoUtils
.
getFirstRow
(
inInfo
);
if
(
params
.
containsKey
(
"date"
)){
params
.
put
(
"date"
,
DateUtils
.
formatShort
(
params
.
get
(
"date"
)));
}
List
<
Map
>
result
=
DaoBase
.
getInstance
().
query
(
"HGSB010.queryBySbStatus"
,
params
);
inInfo
.
set
(
"result"
,
result
);
this
.
sbYes
(
inInfo
,
params
);
this
.
sbNo
(
inInfo
,
params
);
inInfo
.
setStatus
(
EiConstant
.
STATUS_DEFAULT
);
return
inInfo
;
}
@OperationLogAnnotation
(
operModul
=
"设备监控"
,
operType
=
"查询"
,
operDesc
=
"查询设备状态"
)
@OperationLogAnnotation
(
operModul
=
"设备监控"
,
operType
=
"查询"
,
operDesc
=
"查询设备状态"
)
public
EiInfo
queryBySbStatus
(
EiInfo
inInfo
)
{
public
EiInfo
queryBySbStatus
(
EiInfo
inInfo
)
{
Map
params
=
EiInfoUtils
.
getFirstRow
(
inInfo
);
Map
params
=
EiInfoUtils
.
getFirstRow
(
inInfo
);
...
@@ -95,4 +110,56 @@ public class ServiceHGSB010 extends ServiceEPBase {
...
@@ -95,4 +110,56 @@ public class ServiceHGSB010 extends ServiceEPBase {
inInfo
.
set
(
EiConstant
.
resultBlock
,
result
);
inInfo
.
set
(
EiConstant
.
resultBlock
,
result
);
return
inInfo
;
return
inInfo
;
}
}
public
void
sbYes
(
EiInfo
inInfo
,
Map
params
){
params
.
put
(
"logValues"
,
Arrays
.
asList
(
"1"
,
"2"
,
"4"
));
List
<
Map
>
result
=
(
List
<
Map
>)
inInfo
.
get
(
EiConstant
.
resultBlock
);
List
<
Map
>
list
=
new
ArrayList
<>();
List
<
Map
>
listMap
=
DaoBase
.
getInstance
().
query
(
"HGSB010.queryBySbYes"
,
params
,
0
,
100
);
List
listMap2
=
listMap
.
stream
().
map
(
map
->
map
.
get
(
"date"
)).
sorted
().
distinct
().
collect
(
Collectors
.
toList
());
Map
<
Object
,
List
<
Map
>>
listMap1
=
listMap
.
stream
().
collect
(
Collectors
.
groupingBy
(
m
->
m
.
get
(
"deviceCode"
)));
for
(
Object
key:
listMap1
.
keySet
())
{
Map
<
Object
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"name"
,
key
);
List
list1
=
new
ArrayList
<>();
for
(
Map
map1:
listMap1
.
get
(
key
))
{
Map
map2
=
new
HashMap
();
map2
.
put
(
map1
.
get
(
"date"
),
map1
.
get
(
"num"
));
list1
.
add
(
map2
);
}
map
.
put
(
"data"
,
list1
);
list
.
add
(
map
);
}
for
(
Map
map:
result
)
{
Map
resultMap
=
list
.
stream
().
filter
(
m
->
m
.
get
(
"name"
).
equals
(
map
.
get
(
"deviceCode"
))).
findAny
().
get
();
map
.
put
(
"runTime"
,
resultMap
.
get
(
"data"
));
}
}
public
void
sbNo
(
EiInfo
inInfo
,
Map
params
){
params
.
put
(
"logValues"
,
Arrays
.
asList
(
"3"
,
"5"
,
"6"
));
List
<
Map
>
result
=
(
List
<
Map
>)
inInfo
.
get
(
EiConstant
.
resultBlock
);
List
<
Map
>
list
=
new
ArrayList
<>();
List
<
Map
>
listMap
=
DaoBase
.
getInstance
().
query
(
"HGSB010.queryBySbYes"
,
params
,
0
,
100
);
List
listMap2
=
listMap
.
stream
().
map
(
map
->
map
.
get
(
"date"
)).
sorted
().
distinct
().
collect
(
Collectors
.
toList
());
Map
<
Object
,
List
<
Map
>>
listMap1
=
listMap
.
stream
().
collect
(
Collectors
.
groupingBy
(
m
->
m
.
get
(
"deviceCode"
)));
for
(
Object
key:
listMap1
.
keySet
())
{
Map
<
Object
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"name"
,
key
);
List
list1
=
new
ArrayList
<>();
for
(
Map
map1:
listMap1
.
get
(
key
))
{
Map
map2
=
new
HashMap
();
map2
.
put
(
map1
.
get
(
"date"
),
map1
.
get
(
"num"
));
list1
.
add
(
map2
);
}
map
.
put
(
"data"
,
list1
);
list
.
add
(
map
);
}
for
(
Map
map:
result
)
{
Map
resultMap
=
list
.
stream
().
filter
(
m
->
m
.
get
(
"name"
).
equals
(
map
.
get
(
"deviceCode"
))).
findAny
().
get
();
map
.
put
(
"errerTime"
,
resultMap
.
get
(
"data"
));
}
//inInfo.set("errerDate", listMap2);
//inInfo.set("errerTime", result);
}
}
}
src/main/java/com/baosight/hggp/hg/sb/sql/HGSB010.xml
View file @
47542f6d
...
@@ -180,7 +180,7 @@
...
@@ -180,7 +180,7 @@
a.DEVICE_CODE as "deviceCode",
a.DEVICE_CODE as "deviceCode",
a.DEVICE_NAME as "deviceName",
a.DEVICE_NAME as "deviceName",
a.DEVICE_MODEL as "deviceModel",
a.DEVICE_MODEL as "deviceModel",
c
ase when c.LOG_VALUE = 3 || c.LOG_VALUE = 5 || c.LOG_VALUE = 6 then '关机' else '开机' end as status
c
.LOG_VALUE as "status"
from ${hggpSchema}.HGSB001 a
from ${hggpSchema}.HGSB001 a
join ${hggpSchema}.HGSB010 c on a.DEVICE_CODE = c.EQUIPMENT_CODE
join ${hggpSchema}.HGSB010 c on a.DEVICE_CODE = c.EQUIPMENT_CODE
where
where
...
...
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