Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
New MineTRS
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
kiritoausna
New MineTRS
Commits
900ed303
Commit
900ed303
authored
May 28, 2022
by
kiritoausna
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
2022-5.28
parent
e094b47b
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
110 additions
and
18 deletions
+110
-18
WebMonitorChartController.java
...ngjie/gemho/controller/web/WebMonitorChartController.java
+6
-0
IWebMonitorChartService.java
...e/zhengjie/gemho/service/web/IWebMonitorChartService.java
+7
-0
WebMonitorChartServiceImpl.java
...ie/gemho/service/web/impl/WebMonitorChartServiceImpl.java
+97
-0
ReadJsonFileUtil.java
...rc/main/java/me/zhengjie/gemho/util/ReadJsonFileUtil.java
+0
-10
ServiceUtil.java
...tem/src/main/java/me/zhengjie/gemho/util/ServiceUtil.java
+0
-8
No files found.
eladmin-system/src/main/java/me/zhengjie/gemho/controller/web/WebMonitorChartController.java
View file @
900ed303
...
...
@@ -77,4 +77,10 @@ public class WebMonitorChartController {
MonitorChartVo
getmonbase
=
iWebMonitorChartService
.
getmonbasevisual
(
request
);
return
new
ResponseEntity
<>(
new
PageResult
().
nopagesuccess
(
getmonbase
),
HttpStatus
.
OK
);
}
@ApiOperation
(
value
=
"监测点模块信息_大屏使用"
)
@GetMapping
(
"tailingno"
)
public
ResponseEntity
<
Object
>
getvisual
(
HttpServletRequest
request
,
String
tailingno
)
{
MonitorChartVo
getmonbase
=
iWebMonitorChartService
.
getmonbasevisual
(
request
,
tailingno
);
return
new
ResponseEntity
<>(
new
PageResult
().
nopagesuccess
(
getmonbase
),
HttpStatus
.
OK
);
}
}
eladmin-system/src/main/java/me/zhengjie/gemho/service/web/IWebMonitorChartService.java
View file @
900ed303
...
...
@@ -45,6 +45,13 @@ public interface IWebMonitorChartService extends IService<WebMonitorChart> {
*/
MonitorChartVo
getmonbasevisual
(
HttpServletRequest
request
);
/**
* 获取监测点信息
*
* @return
*/
MonitorChartVo
getmonbasevisual
(
HttpServletRequest
request
,
String
tailno
);
/**
* 根据当前尾矿库获取chart
*
...
...
eladmin-system/src/main/java/me/zhengjie/gemho/service/web/impl/WebMonitorChartServiceImpl.java
View file @
900ed303
...
...
@@ -21,6 +21,7 @@ import me.zhengjie.utils.SecurityUtils;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.ObjectUtils
;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.*
;
...
...
@@ -229,6 +230,102 @@ public class WebMonitorChartServiceImpl extends ServiceImpl<WebMonitorChartMappe
return
monitorChartVo
;
}
@Override
public
MonitorChartVo
getmonbasevisual
(
HttpServletRequest
request
,
String
tailno
)
{
//获取设备的状态
List
<
HashMap
<
String
,
Object
>>
hashMaps
=
drybeachequipinforService
.
dryStateCount
(
request
);
//获取所有设备的实时数据
List
<
RealDataVo
>
realData
=
(
List
<
RealDataVo
>)
redisUtils
.
get
(
"realData"
);
//获取设备的实时报警状态
List
<
HashMap
<
String
,
Object
>>
realalarm
=
tabAbnormalMapper
.
realalarm
();
MonitorChartVo
monitorChartVo
=
getsimplemonbase
(
request
,
tailno
);
List
<
WebMonitorPointsVo
>
points
=
monitorChartVo
.
getPoints
();
if
(!
ObjectUtils
.
isEmpty
(
points
))
{
for
(
WebMonitorPointsVo
point
:
points
)
{
List
<
HashMap
<
String
,
Object
>>
items
=
point
.
getItems
();
if
(!
ObjectUtils
.
isEmpty
(
items
))
{
for
(
HashMap
<
String
,
Object
>
item
:
items
)
{
String
id1
=
(
String
)
item
.
get
(
"id"
);
for
(
HashMap
<
String
,
Object
>
hashMap
:
hashMaps
)
{
String
equipno
=
(
String
)
hashMap
.
get
(
"equipno"
);
if
(
equipno
.
equals
(
id1
))
{
Long
state
=
(
Long
)
hashMap
.
get
(
"state"
);
item
.
put
(
"state"
,
state
);
break
;
}
;
}
String
id
=
(
String
)
item
.
get
(
"id"
);
for
(
HashMap
<
String
,
Object
>
map
:
realalarm
)
{
String
equipno
=
(
String
)
map
.
get
(
"equipno"
);
if
(
equipno
.
equals
(
id
))
{
item
.
put
(
"alarmlevel"
,
map
.
get
(
"alarmlevel"
));
break
;
}
}
for
(
RealDataVo
realDataVo
:
realData
)
{
if
(
realDataVo
.
getEquipno
().
equals
(
id
))
{
List
<
Map
>
keys
=
(
List
<
Map
>)
realDataVo
.
getKeys
();
HashMap
<
String
,
Object
>
data
=
realDataVo
.
getData
();
Set
<
String
>
strings
=
data
.
keySet
();
for
(
Map
key
:
keys
)
{
Set
keyset1
=
key
.
keySet
();
for
(
Object
o
:
keyset1
)
{
String
s
=
(
String
)
key
.
get
(
o
.
toString
());
for
(
String
string
:
strings
)
{
if
(
s
.
equals
(
string
))
{
key
.
put
(
o
.
toString
(),
data
.
get
(
string
));
}
}
}
}
item
.
put
(
"realdata"
,
keys
);
}
}
}
}
}
}
return
monitorChartVo
;
}
public
MonitorChartVo
getsimplemonbase
(
HttpServletRequest
request
,
String
tailno
)
{
//构建返回结构
MonitorChartVo
monitorChartVo
=
new
MonitorChartVo
();
//获取对应尾矿库的图片
WebMonitorChart
webMonitorChart
=
webMonitorChartMapper
.
getpic
(
tailno
);
HashMap
<
String
,
Integer
>
id1
=
webMonitorChartMapper
.
getId
(
tailno
);
if
(
id1
!=
null
)
{
Integer
cid
=
id1
.
get
(
"id"
);
monitorChartVo
.
setChart
(
webMonitorChart
);
//获取对应检测项配置的监测点信息
List
<
WebMonitorPointsVo
>
webMonitorPointsVos
=
webMonitorPointsMapper
.
getbycid
(
cid
);
if
(
webMonitorPointsVos
!=
null
)
{
List
<
HashMap
<
String
,
Object
>>
links
=
webMonitorLinkMapper
.
getByChartId
(
cid
);
if
(
links
!=
null
)
{
//遍历监测信息
for
(
WebMonitorPointsVo
webMonitorPointsVo
:
webMonitorPointsVos
)
{
List
<
HashMap
<
String
,
Object
>>
hashMaps
=
new
ArrayList
<>();
Integer
id
=
webMonitorPointsVo
.
getId
();
String
guid
=
webMonitorPointsVo
.
getGuid
();
//遍历监测点和设备关系
for
(
HashMap
<
String
,
Object
>
link
:
links
)
{
String
pointid
=
(
String
)
link
.
get
(
"pointid"
);
if
(
pointid
.
equals
(
guid
))
{
hashMaps
.
add
(
link
);
}
}
webMonitorPointsVo
.
setItems
(
hashMaps
);
}
}
monitorChartVo
.
setPoints
(
webMonitorPointsVos
);
}
}
return
monitorChartVo
;
}
@Override
public
WebMonitorChart
getbytailno
(
HttpServletRequest
request
)
{
String
currentUsername
=
SecurityUtils
.
getCurrentUsername
();
...
...
eladmin-system/src/main/java/me/zhengjie/gemho/util/ReadJsonFileUtil.java
View file @
900ed303
...
...
@@ -30,14 +30,4 @@ public class ReadJsonFileUtil {
}
return
map
;
}
public
static
void
main
(
String
[]
args
)
{
/* //Map<String,String> result = ReadJsonFileUtil.getMap("dbdata");
for (Map.Entry map : result.entrySet()) {
System.out.println("key:" + map.getKey());
System.out.println("value:" + map.getValue());
}
}*/
}
}
\ No newline at end of file
eladmin-system/src/main/java/me/zhengjie/gemho/util/ServiceUtil.java
View file @
900ed303
...
...
@@ -388,10 +388,6 @@ public class ServiceUtil {
}
public
static
void
imgQuery
(
QueryWrapper
<?>
queryWrapper
,
DataQueryCriteria
dataQueryCriteria
)
{
/* String sensorname = dataQueryCriteria.getSensorname();
if (sensorname != null) {
queryWrapper.eq("sensorname", sensorname);
}*/
String
code
=
dataQueryCriteria
.
getCode
();
if
(
code
!=
null
)
{
queryWrapper
.
eq
(
"sensorid"
,
code
);
...
...
@@ -425,10 +421,6 @@ public class ServiceUtil {
}
public
static
void
rgImgQuery
(
QueryWrapper
<?>
queryWrapper
,
DataQueryCriteria
dataQueryCriteria
)
{
/* String sensorname = dataQueryCriteria.getSensorname();
if (sensorname != null) {
queryWrapper.eq("sensorname", sensorname);
}*/
String
code
=
dataQueryCriteria
.
getCode
();
if
(
code
!=
null
)
{
queryWrapper
.
eq
(
"sensorid"
,
code
);
...
...
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