Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
张雷
/
fmboot
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
构建
提交
问题看板
文件
提交
网络
比较
分支
标签
d07e8068
由
张雷
编写于
2023-05-31 17:38:24 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
奥体项目数据报表接口修改
1 个父辈
ebb278a6
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
217 行增加
和
9 行删除
fm-product/src/main/java/com/skua/modules/business/controller/OlympicCenterController.java
fm-product/src/main/java/com/skua/modules/business/mapper/WhatStructDataMapper.java
fm-product/src/main/java/com/skua/modules/business/mapper/xml/WhatStructDataMapper.xml
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
查看文件 @
d07e806
...
...
@@ -129,11 +129,11 @@ public class OlympicCenterController {
}
@ApiOperation
(
value
=
"获取趋势图new"
,
notes
=
"获取趋势图new"
)
@GetMapping
(
value
=
"/get
PressureChartNew
"
)
public
Result
<
List
<
EchartResult
>>
get
PressureChartNew
(
String
equipId
,
String
type
){
@GetMapping
(
value
=
"/get
HistoryTrends
"
)
public
Result
<
List
<
EchartResult
>>
get
HistoryTrends
(
String
equipId
,
String
type
){
Result
<
List
<
EchartResult
>>
result
=
new
Result
<
List
<
EchartResult
>>();
List
<
EchartResult
>
list
=
new
ArrayList
<
EchartResult
>();
list
=
olympicCenterService
.
get
PressureChartNew
(
equipId
,
type
);
list
=
olympicCenterService
.
get
HistoryTrends
(
equipId
,
type
);
result
.
setResult
(
list
);
result
.
setSuccess
(
true
);
return
result
;
...
...
@@ -161,4 +161,25 @@ public class OlympicCenterController {
return
result
;
}
@ApiOperation
(
value
=
"获取泵站实时数据"
,
notes
=
"获取泵站实时数据"
)
@GetMapping
(
value
=
"/getPumpRealTimeData"
)
public
Result
<
Map
<
String
,
Object
>>
getPumpRealTimeData
(
String
sourceType
,
String
pumpId
){
Result
<
Map
<
String
,
Object
>>
result
=
new
Result
<
Map
<
String
,
Object
>>();
Map
<
String
,
Object
>
map
=
olympicCenterService
.
getPumpRealTimeData
(
sourceType
,
pumpId
);
result
.
setResult
(
map
);
result
.
setSuccess
(
true
);
return
result
;
}
@ApiOperation
(
value
=
"获取设备状态表格"
,
notes
=
"获取设备状态表格"
)
@GetMapping
(
value
=
"/getPumpRealTimeReport"
)
public
Result
<
List
<
Map
<
String
,
Object
>>>
getPumpRealTimeReport
(
String
sourceType
){
Result
<
List
<
Map
<
String
,
Object
>>>
result
=
new
Result
<
List
<
Map
<
String
,
Object
>>>();
List
<
Map
<
String
,
Object
>>
list
=
new
ArrayList
<>();
list
=
olympicCenterService
.
getPumpRealTimeReport
(
sourceType
);
result
.
setResult
(
list
);
result
.
setSuccess
(
true
);
return
result
;
}
}
...
...
fm-product/src/main/java/com/skua/modules/business/mapper/WhatStructDataMapper.java
查看文件 @
d07e806
...
...
@@ -27,4 +27,8 @@ public interface WhatStructDataMapper {
List
<
WhatStructData
>
getPressureList
(
@Param
(
"loction"
)
String
loction
);
List
<
WhatStructData
>
getTemperatureList
(
@Param
(
"loction"
)
String
loction
);
List
<
WhatStructData
>
getEquipDataList
(
@Param
(
"sourceType"
)
String
sourceType
,
@Param
(
"pumpId"
)
String
pumpId
);
List
<
WhatStructData
>
getEquipDataListBySource
(
@Param
(
"sourceType"
)
String
sourceType
);
}
...
...
fm-product/src/main/java/com/skua/modules/business/mapper/xml/WhatStructDataMapper.xml
查看文件 @
d07e806
...
...
@@ -54,4 +54,14 @@
</if>
</select>
<select
id=
"getEquipDataList"
resultType=
"com.skua.modules.business.entity.WhatStructData"
>
select * from what_struct_data_bak
where pump_code = #{sourceType} and equip_code = #{pumpId}
</select>
<select
id=
"getEquipDataListBySource"
resultType=
"com.skua.modules.business.entity.WhatStructData"
>
select * from what_struct_data_bak
where pump_code = #{sourceType}
</select>
</mapper>
\ No newline at end of file
...
...
fm-product/src/main/java/com/skua/modules/business/service/IOlympicCenterService.java
查看文件 @
d07e806
...
...
@@ -24,11 +24,15 @@ public interface IOlympicCenterService {
Map
<
String
,
Object
>
getRealTimeDataNew
(
String
sourceType
);
List
<
EchartResult
>
get
PressureChartNew
(
String
equipId
,
String
type
);
List
<
EchartResult
>
get
HistoryTrends
(
String
equipId
,
String
type
);
Map
<
String
,
Object
>
getRealTimeDataToUENew
();
List
<
Map
<
String
,
Object
>>
getFlowData
(
String
equipId
);
List
<
Map
<
String
,
Object
>>
getRealTimeReport
(
String
dataType
,
String
loction
);
Map
<
String
,
Object
>
getPumpRealTimeData
(
String
sourceType
,
String
pumpId
);
List
<
Map
<
String
,
Object
>>
getPumpRealTimeReport
(
String
sourceType
);
}
...
...
fm-product/src/main/java/com/skua/modules/business/service/impl/OlympicCenterServiceImpl.java
查看文件 @
d07e806
...
...
@@ -867,7 +867,7 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService {
}
@Override
public
List
<
EchartResult
>
get
PressureChartNew
(
String
equipId
,
String
type
)
{
public
List
<
EchartResult
>
get
HistoryTrends
(
String
equipId
,
String
type
)
{
List
<
EchartResult
>
list
=
new
ArrayList
<>();
List
<
WhatStructData
>
wList
=
whatStructDataMapper
.
getDataList
(
equipId
);
String
pgField
=
""
;
...
...
@@ -898,8 +898,20 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService {
for
(
WhatStructData
whatStructData:
wList
)
{
EchartResult
eResult
=
new
EchartResult
();
eResult
.
setName
(
map
.
get
(
"time"
).
toString
());
eResult
.
setValue
(
map
.
get
(
whatStructData
.
getMonitorId
()).
toString
());
eResult
.
setSeries
(
whatStructData
.
getEquipType
());
if
(
whatStructData
.
getMonitorId
()==
null
){
eResult
.
setValue
(
""
);
}
else
{
eResult
.
setValue
(
map
.
get
(
whatStructData
.
getMonitorId
()).
toString
());
}
if
(
"flow"
.
equals
(
whatStructData
.
getEquipType
())){
eResult
.
setSeries
(
"瞬时流量"
);
}
else
if
(
"flow_ljll"
.
equals
(
whatStructData
.
getEquipType
())){
eResult
.
setSeries
(
"正向累计流量"
);
}
else
if
(
"flow_rljll"
.
equals
(
whatStructData
.
getEquipType
())){
eResult
.
setSeries
(
"反向累计流量"
);
}
else
{
eResult
.
setSeries
(
whatStructData
.
getEquipType
());
}
list
.
add
(
eResult
);
}
}
else
if
(
"t"
.
equals
(
type
)){
...
...
@@ -1104,15 +1116,172 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService {
list
.
add
(
map
);
}
}
else
if
(
"pressure"
.
equals
(
dataType
)){
return
list
;
for
(
WhatStructData
whatStructData:
wList
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"id"
,
whatStructData
.
getId
());
map
.
put
(
"name"
,
whatStructData
.
getId
());
map
.
put
(
"time"
,
""
);
map
.
put
(
"value"
,
""
);
for
(
Map
<
String
,
Object
>
mMap
:
monitorList
)
{
if
(
whatStructData
.
getMonitorId
()!=
null
){
if
(
whatStructData
.
getMonitorId
().
equals
(
mMap
.
get
(
"monitorid"
))){
map
.
put
(
"time"
,
mMap
.
get
(
"time"
));
map
.
put
(
"value"
,
formatDouble
(
Double
.
parseDouble
(
mMap
.
get
(
"monitorvalue"
).
toString
())*
Double
.
parseDouble
(
whatStructData
.
getMonitorZoom
())));
}
}
else
{
break
;
}
}
list
.
add
(
map
);
}
}
else
if
(
"temperature"
.
equals
(
dataType
)){
return
list
;
for
(
WhatStructData
whatStructData:
wList
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"id"
,
whatStructData
.
getId
());
map
.
put
(
"name"
,
whatStructData
.
getId
());
map
.
put
(
"time"
,
""
);
map
.
put
(
"value"
,
""
);
list
.
add
(
map
);
}
}
else
{
return
list
;
}
return
list
;
}
@Override
public
Map
<
String
,
Object
>
getPumpRealTimeData
(
String
sourceType
,
String
pumpId
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"status"
,
"变频运行"
);
map
.
put
(
"runtime"
,
"0.6563"
);
map
.
put
(
"name"
,
pumpId
);
String
pgField
=
""
;
List
<
Map
<
String
,
Object
>>
statusList
=
new
ArrayList
<>();
List
<
WhatStructData
>
equipList
=
new
ArrayList
<>();
equipList
=
whatStructDataMapper
.
getEquipDataList
(
sourceType
,
pumpId
);
if
(
equipList
.
size
()==
0
){
return
map
;
}
Map
<
String
,
Object
>
equipMap
=
new
HashMap
<>();
for
(
WhatStructData
whatStructData
:
equipList
)
{
pgField
=
pgField
+
","
+
whatStructData
.
getMonitorId
();
if
(
"equip_status"
.
equals
(
whatStructData
.
getEquipType
())){
Map
<
String
,
Object
>
statusMap
=
new
HashMap
<>();
statusMap
.
put
(
"name"
,
whatStructData
.
getId
());
statusMap
.
put
(
"monitorid"
,
whatStructData
.
getMonitorId
());
statusList
.
add
(
statusMap
);
if
(
"0"
.
equals
(
whatStructData
.
getMonitorZoom
())){
equipMap
.
put
(
"show_model"
,
"2"
);
//根据两个点判断状态
}
else
{
equipMap
.
put
(
"show_model"
,
"1"
);
//根据1个点判断状态
}
}
if
(
"equip_time"
.
equals
(
whatStructData
.
getEquipType
())){
equipMap
.
put
(
"runtime"
,
whatStructData
.
getMonitorId
());
}
}
equipMap
.
put
(
"status"
,
statusList
);
Map
<
String
,
Object
>
monitorMap
=
new
HashMap
<>();
List
<
Map
<
String
,
Object
>>
monitorList
=
fmPgQueryService
.
queryFactoryMonitorFromRealTimeData
(
AT_ID
,
pgField
);
if
(
monitorList
.
size
()==
1
){
monitorMap
=
monitorList
.
get
(
0
);
map
.
put
(
"runtime"
,
monitorMap
.
get
(
equipMap
.
get
(
"runtime"
).
toString
()));
String
equipStatus
=
"停止"
;
if
(
"2"
.
equals
(
equipMap
.
get
(
"show_model"
))){
equipStatus
=
getStatus2
(
monitorMap
,
statusList
,
pumpId
);
}
else
{
equipStatus
=
getStatus1
(
monitorMap
,
statusList
,
pumpId
);
}
map
.
put
(
"status"
,
equipStatus
);
}
return
map
;
}
@Override
public
List
<
Map
<
String
,
Object
>>
getPumpRealTimeReport
(
String
sourceType
)
{
List
<
Map
<
String
,
Object
>>
list
=
new
ArrayList
<>();
List
<
WhatStructData
>
timeList
=
new
ArrayList
<>();
List
<
WhatStructData
>
equipList
=
new
ArrayList
<>();
String
pgField
=
""
;
equipList
=
whatStructDataMapper
.
getEquipDataListBySource
(
sourceType
);
if
(
equipList
.
size
()==
0
){
return
null
;
}
for
(
WhatStructData
whatStructData
:
equipList
)
{
pgField
=
pgField
+
","
+
whatStructData
.
getMonitorId
();
if
(
"equip_time"
.
equals
(
whatStructData
.
getEquipType
())){
timeList
.
add
(
whatStructData
);
}
}
Map
<
String
,
Object
>
monitorMap
=
new
HashMap
<>();
List
<
Map
<
String
,
Object
>>
monitorList
=
fmPgQueryService
.
queryFactoryMonitorFromRealTimeData
(
AT_ID
,
pgField
);
if
(
monitorList
.
size
()==
1
){
monitorMap
=
monitorList
.
get
(
0
);
}
for
(
WhatStructData
whatStructData:
timeList
)
{
List
<
Map
<
String
,
Object
>>
list1
=
new
ArrayList
<>();
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"id"
,
whatStructData
.
getEquipCode
());
map
.
put
(
"name"
,
whatStructData
.
getEquipCode
());
String
equipCode
=
whatStructData
.
getEquipCode
();
for
(
WhatStructData
whatStructData1
:
equipList
)
{
if
(
equipCode
.
equals
(
whatStructData1
.
getEquipCode
())){
Map
<
String
,
Object
>
statusMap
=
new
HashMap
<>();
statusMap
.
put
(
"name"
,
whatStructData1
.
getId
());
if
(
whatStructData1
.
getMonitorId
()!=
null
){
statusMap
.
put
(
"monitorid"
,
whatStructData1
.
getMonitorId
());
}
else
{
statusMap
.
put
(
"monitorid"
,
""
);
}
list1
.
add
(
statusMap
);
}
}
map
.
put
(
"status"
,
getStatus2
(
monitorMap
,
list1
,
equipCode
));
map
.
put
(
"signal"
,
"--"
);
if
(
whatStructData
.
getMonitorId
()!=
null
){
map
.
put
(
"runtime"
,
monitorMap
.
get
(
whatStructData
.
getMonitorId
()));
}
else
{
map
.
put
(
"runtime"
,
"--"
);
}
list
.
add
(
map
);
}
return
list
;
}
private
String
getStatus1
(
Map
<
String
,
Object
>
map
,
List
<
Map
<
String
,
Object
>>
list
,
String
pumpId
)
{
String
status
=
"停止"
;
Map
<
String
,
Object
>
bean
=
list
.
get
(
0
);
String
monitorStatus
=
map
.
get
(
bean
.
get
(
"monitorid"
).
toString
()).
toString
();
if
(
"2"
.
equals
(
monitorStatus
)){
status
=
"故障"
;
}
else
if
(
"1"
.
equals
(
monitorStatus
)){
status
=
"运行"
;
}
else
{
status
=
"停止"
;
}
return
status
;
}
private
String
getStatus2
(
Map
<
String
,
Object
>
map
,
List
<
Map
<
String
,
Object
>>
list
,
String
pumpId
)
{
String
status
=
"停止"
;
String
bpName
=
pumpId
+
"_BP"
;
String
gpName
=
pumpId
+
"_GP"
;
for
(
Map
<
String
,
Object
>
bean
:
list
)
{
if
(
bpName
.
equals
(
bean
.
get
(
"name"
))){
if
(
"1"
.
equals
(
map
.
get
(
bean
.
get
(
"monitorid"
).
toString
()))){
status
=
"变频运行"
;
}
}
if
(
gpName
.
equals
(
bean
.
get
(
"name"
))){
if
(
"1"
.
equals
(
map
.
get
(
bean
.
get
(
"monitorid"
).
toString
()))){
status
=
"工频运行"
;
}
}
}
return
status
;
}
private
List
<
Map
<
String
,
Object
>>
getMnData
(){
List
<
Map
<
String
,
Object
>>
list
=
new
ArrayList
<>();
Map
<
String
,
Object
>
flowMap
=
new
HashMap
<>();
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论