Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
张雷
/
fmboot
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
构建
提交
问题看板
文件
提交
网络
比较
分支
标签
192b5a18
由
张雷
编写于
2023-06-26 18:42:28 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
奥体项目增加报警功能
1 个父辈
a6407388
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
152 行增加
和
1 行删除
fm-product/src/main/java/com/skua/modules/business/controller/OlympicCenterController.java
fm-product/src/main/java/com/skua/modules/business/service/IOlympicCenterService.java
fm-product/src/main/java/com/skua/modules/business/service/impl/OlympicCenterServiceImpl.java
fm-product/src/main/java/com/skua/modules/business/controller/OlympicCenterController.java
查看文件 @
192b5a1
...
...
@@ -71,6 +71,16 @@ public class OlympicCenterController {
return
result
;
}
@ApiOperation
(
value
=
"新获取整体实时数据给V3.0"
,
notes
=
"新获取整体实时数据给V3.0"
)
@GetMapping
(
value
=
"/getRealDataToUE"
)
public
Result
<
Map
<
String
,
Object
>>
getRealDataToUE
(){
Result
<
Map
<
String
,
Object
>>
result
=
new
Result
<
Map
<
String
,
Object
>>();
Map
<
String
,
Object
>
map
=
olympicCenterService
.
getRealDataToUENew
();
result
.
setResult
(
map
);
result
.
setSuccess
(
true
);
return
result
;
}
/**
* 获取泵站指标历史趋势曲线
* @param field ssll:瞬时流量 ljll:累计流量 rll:日流量
...
...
fm-product/src/main/java/com/skua/modules/business/service/IOlympicCenterService.java
查看文件 @
192b5a1
...
...
@@ -30,6 +30,8 @@ public interface IOlympicCenterService {
Map
<
String
,
Object
>
getRealTimeDataToUENew
();
Map
<
String
,
Object
>
getRealDataToUENew
();
List
<
Map
<
String
,
Object
>>
getFlowData
(
String
equipId
);
List
<
Map
<
String
,
Object
>>
getRealTimeReport
(
String
dataType
,
String
loction
);
...
...
@@ -47,4 +49,5 @@ public interface IOlympicCenterService {
List
<
EchartResult
>
getHistoryTrendsByDate
(
InputQueryParams
inputQueryParams
);
List
<
Map
<
String
,
Object
>>
getAlarmList
(
AlarmParams
alarmParams
);
}
...
...
fm-product/src/main/java/com/skua/modules/business/service/impl/OlympicCenterServiceImpl.java
查看文件 @
192b5a1
...
...
@@ -16,7 +16,6 @@ import org.springframework.jdbc.core.JdbcTemplate;
import
org.springframework.stereotype.Service
;
import
java.text.DateFormat
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.util.*
;
...
...
@@ -1059,8 +1058,12 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService {
for
(
WhatStructData
whatStructData:
otherList
)
{
if
(
whatStructData
.
getMonitorId
()!=
null
){
if
(
"pressure"
.
equals
(
whatStructData
.
getEquipType
())){
if
(
monitorMap
.
get
(
whatStructData
.
getMonitorId
())==
null
){
map
.
put
(
whatStructData
.
getId
(),
"--"
);
}
else
{
double
pResult
=
formatDouble
(
Double
.
parseDouble
(
monitorMap
.
get
(
whatStructData
.
getMonitorId
()).
toString
())*
Double
.
parseDouble
(
whatStructData
.
getMonitorZoom
()));
map
.
put
(
whatStructData
.
getId
(),
String
.
valueOf
(
pResult
));
}
}
else
{
map
.
put
(
whatStructData
.
getId
(),
monitorMap
.
get
(
whatStructData
.
getMonitorId
()));
}
...
...
@@ -1083,6 +1086,141 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService {
return
map
;
}
/**
* 获取30秒内报警数据
* @return
*/
public
Map
<
String
,
Object
>
getNowAlarmData
(){
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
SimpleDateFormat
dateFormat
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
Date
now
=
new
Date
();
Date
before
=
new
Date
(
now
.
getTime
()
-
30
*
1000
);
JdbcTemplate
alarmDB
=
(
JdbcTemplate
)
SpringContextUtils
.
getBean
(
"mysql-alarm"
);
List
<
Map
<
String
,
Object
>>
list
=
alarmDB
.
queryForList
(
"select DISTINCT alarm_param_code as alarmCode from alert_record_history "
+
" where handle_status = 0 "
+
" and record_time between '"
+
dateFormat
.
format
(
before
)+
"' and '"
+
dateFormat
.
format
(
now
)+
"' "
+
" ORDER BY record_time"
);
if
(
list
.
size
()>
0
){
for
(
Map
<
String
,
Object
>
bean
:
list
)
{
if
(
bean
.
get
(
"alarm_param_code"
)!=
null
){
map
.
put
(
bean
.
get
(
"alarm_param_code"
).
toString
(),
"abnormal"
);
}
}
return
map
;
}
else
{
return
map
;
}
}
@Override
public
Map
<
String
,
Object
>
getRealDataToUENew
()
{
List
<
WhatStructData
>
list
=
whatStructDataMapper
.
getListForUENew
();
List
<
WhatStructData
>
fList
=
new
ArrayList
<>();
List
<
WhatStructData
>
otherList
=
new
ArrayList
<>();
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
Map
<
String
,
Object
>
monitorMap
=
new
HashMap
<>();
Map
<
String
,
Object
>
alarmMap
=
getNowAlarmData
();
String
pgField
=
""
;
for
(
WhatStructData
whatStructData:
list
)
{
pgField
=
pgField
+
","
+
whatStructData
.
getMonitorId
();
if
(
"flow"
.
equals
(
whatStructData
.
getEquipType
())){
fList
.
add
(
whatStructData
);
}
if
(!
whatStructData
.
getEquipType
().
contains
(
"flow"
)){
otherList
.
add
(
whatStructData
);
}
}
List
<
Map
<
String
,
Object
>>
monitorList
=
fmPgQueryService
.
queryFactoryMonitorFromRealTimeData
(
AT_ID
,
pgField
);
if
(
monitorList
.
size
()==
1
){
monitorMap
=
monitorList
.
get
(
0
);
for
(
WhatStructData
whatStructData:
fList
)
{
if
(
whatStructData
.
getMonitorId
()!=
null
){
String
fId
=
whatStructData
.
getId
();
Map
<
String
,
Object
>
beanMap
=
new
HashMap
<>();
for
(
WhatStructData
bean
:
list
)
{
Map
<
String
,
Object
>
dataMap
=
new
HashMap
<>();
dataMap
.
put
(
"value"
,
"--"
);
dataMap
.
put
(
"status"
,
"abnormal"
);
if
(
bean
.
getId
().
startsWith
(
fId
)){
if
(
monitorMap
.
get
(
bean
.
getMonitorId
())!=
null
){
dataMap
.
put
(
"value"
,
monitorMap
.
get
(
bean
.
getMonitorId
()));
if
(
alarmMap
.
get
(
bean
.
getMonitorId
())==
null
){
dataMap
.
put
(
"status"
,
"normal"
);
}
else
{
dataMap
.
put
(
"status"
,
"abnormal"
);
}
beanMap
.
put
(
bean
.
getEquipType
(),
dataMap
);
}
else
{
dataMap
.
put
(
"value"
,
"--"
);
dataMap
.
put
(
"status"
,
"abnormal"
);
beanMap
.
put
(
bean
.
getEquipType
(),
dataMap
);
}
}
}
map
.
put
(
fId
,
beanMap
);
}
else
{
Map
<
String
,
Object
>
kMap
=
new
HashMap
<>();
Map
<
String
,
Object
>
dataMap
=
new
HashMap
<>();
dataMap
.
put
(
"value"
,
"--"
);
dataMap
.
put
(
"status"
,
"abnormal"
);
kMap
.
put
(
"flow"
,
dataMap
);
kMap
.
put
(
"flow_ljll"
,
dataMap
);
kMap
.
put
(
"flow_rljll"
,
dataMap
);
map
.
put
(
whatStructData
.
getId
(),
kMap
);
}
}
for
(
WhatStructData
whatStructData:
otherList
)
{
if
(
whatStructData
.
getMonitorId
()!=
null
){
Map
<
String
,
Object
>
dataMap
=
new
HashMap
<>();
dataMap
.
put
(
"value"
,
"--"
);
dataMap
.
put
(
"status"
,
"abnormal"
);
if
(
"pressure"
.
equals
(
whatStructData
.
getEquipType
())){
if
(
monitorMap
.
get
(
whatStructData
.
getMonitorId
())==
null
){
map
.
put
(
whatStructData
.
getId
(),
dataMap
);
}
else
{
double
pResult
=
formatDouble
(
Double
.
parseDouble
(
monitorMap
.
get
(
whatStructData
.
getMonitorId
()).
toString
())*
Double
.
parseDouble
(
whatStructData
.
getMonitorZoom
()));
dataMap
.
put
(
"value"
,
String
.
valueOf
(
pResult
));
if
(
alarmMap
.
get
(
whatStructData
.
getMonitorId
())==
null
){
dataMap
.
put
(
"status"
,
"normal"
);
}
else
{
dataMap
.
put
(
"status"
,
"abnormal"
);
}
map
.
put
(
whatStructData
.
getId
(),
dataMap
);
}
}
else
{
dataMap
.
put
(
"value"
,
monitorMap
.
get
(
whatStructData
.
getMonitorId
()));
if
(
alarmMap
.
get
(
whatStructData
.
getMonitorId
())==
null
){
dataMap
.
put
(
"status"
,
"normal"
);
}
else
{
dataMap
.
put
(
"status"
,
"abnormal"
);
}
map
.
put
(
whatStructData
.
getId
(),
dataMap
);
}
}
else
{
Map
<
String
,
Object
>
dataMap
=
new
HashMap
<>();
dataMap
.
put
(
"value"
,
"--"
);
dataMap
.
put
(
"status"
,
"abnormal"
);
map
.
put
(
whatStructData
.
getId
(),
dataMap
);
}
}
}
else
{
Map
<
String
,
Object
>
dataMap
=
new
HashMap
<>();
dataMap
.
put
(
"value"
,
"--"
);
dataMap
.
put
(
"status"
,
"abnormal"
);
for
(
WhatStructData
whatStructData:
fList
)
{
Map
<
String
,
Object
>
kMap
=
new
HashMap
<>();
kMap
.
put
(
"flow"
,
dataMap
);
kMap
.
put
(
"flow_ljll"
,
dataMap
);
kMap
.
put
(
"flow_rljll"
,
dataMap
);
map
.
put
(
whatStructData
.
getId
(),
kMap
);
}
for
(
WhatStructData
whatStructData:
otherList
)
{
map
.
put
(
whatStructData
.
getId
(),
dataMap
);
}
}
return
map
;
}
@Override
public
List
<
Map
<
String
,
Object
>>
getFlowData
(
String
equipId
)
{
List
<
Map
<
String
,
Object
>>
list
=
new
ArrayList
<>();
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论