Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
张雷
/
fmboot
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
构建
提交
问题看板
文件
提交
网络
比较
分支
标签
ebb278a6
由
张雷
编写于
2023-05-30 12:16:05 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
奥体项目数据报表接口修改
1 个父辈
a30d7c24
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
102 行增加
和
4 行删除
fm-product/src/main/java/com/skua/modules/business/controller/OlympicCenterController.java
fm-product/src/main/java/com/skua/modules/business/entity/WhatStructData.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/monitor/service/IFmPgQueryService.java
fm-product/src/main/java/com/skua/modules/monitor/service/impl/FmPgQueryServiceImpl.java
fm-product/src/main/java/com/skua/modules/business/controller/OlympicCenterController.java
查看文件 @
ebb278a
...
...
@@ -39,7 +39,7 @@ public class OlympicCenterController {
return
result
;
}
@ApiOperation
(
value
=
"获取整体实时数据
"
,
notes
=
"获取整体实时数据
"
)
@ApiOperation
(
value
=
"获取整体实时数据
new"
,
notes
=
"获取整体实时数据new
"
)
@GetMapping
(
value
=
"/getRealTimeDataNew"
)
public
Result
<
Map
<
String
,
Object
>>
getRealTimeDataNew
(
String
sourceType
){
Result
<
Map
<
String
,
Object
>>
result
=
new
Result
<
Map
<
String
,
Object
>>();
...
...
@@ -59,7 +59,7 @@ public class OlympicCenterController {
return
result
;
}
@ApiOperation
(
value
=
"
获取整体实时数据给UE"
,
notes
=
"
获取整体实时数据给UE"
)
@ApiOperation
(
value
=
"
新获取整体实时数据给UE"
,
notes
=
"新
获取整体实时数据给UE"
)
@GetMapping
(
value
=
"/getRealTimeDataToUENew"
)
public
Result
<
Map
<
String
,
Object
>>
getRealTimeDataToUENew
(){
Result
<
Map
<
String
,
Object
>>
result
=
new
Result
<
Map
<
String
,
Object
>>();
...
...
@@ -128,7 +128,7 @@ public class OlympicCenterController {
return
result
;
}
@ApiOperation
(
value
=
"获取趋势图
"
,
notes
=
"获取趋势图
"
)
@ApiOperation
(
value
=
"获取趋势图
new"
,
notes
=
"获取趋势图new
"
)
@GetMapping
(
value
=
"/getPressureChartNew"
)
public
Result
<
List
<
EchartResult
>>
getPressureChartNew
(
String
equipId
,
String
type
){
Result
<
List
<
EchartResult
>>
result
=
new
Result
<
List
<
EchartResult
>>();
...
...
@@ -139,4 +139,26 @@ public class OlympicCenterController {
return
result
;
}
@ApiOperation
(
value
=
"获取流量计详细数据"
,
notes
=
"获取流量计详细数据"
)
@GetMapping
(
value
=
"/getFlowData"
)
public
Result
<
List
<
Map
<
String
,
Object
>>>
getFlowData
(
String
equipId
){
Result
<
List
<
Map
<
String
,
Object
>>>
result
=
new
Result
<
List
<
Map
<
String
,
Object
>>>();
List
<
Map
<
String
,
Object
>>
list
=
new
ArrayList
<
Map
<
String
,
Object
>>();
list
=
olympicCenterService
.
getFlowData
(
equipId
);
result
.
setResult
(
list
);
result
.
setSuccess
(
true
);
return
result
;
}
@ApiOperation
(
value
=
"获取实时数据报表"
,
notes
=
"获取实时数据报表"
)
@GetMapping
(
value
=
"/getRealTimeReport"
)
public
Result
<
List
<
Map
<
String
,
Object
>>>
getRealTimeReport
(
String
dataType
,
String
loction
){
Result
<
List
<
Map
<
String
,
Object
>>>
result
=
new
Result
<
List
<
Map
<
String
,
Object
>>>();
List
<
Map
<
String
,
Object
>>
list
=
new
ArrayList
<>();
list
=
olympicCenterService
.
getRealTimeReport
(
dataType
,
loction
);
result
.
setResult
(
list
);
result
.
setSuccess
(
true
);
return
result
;
}
}
...
...
fm-product/src/main/java/com/skua/modules/business/entity/WhatStructData.java
查看文件 @
ebb278a
...
...
@@ -44,6 +44,9 @@ public class WhatStructData {
/**点实时值*/
@ApiModelProperty
(
value
=
"点实时值"
)
private
String
monitorValue
;
/**缩放倍数*/
@ApiModelProperty
(
value
=
"缩放倍数"
)
private
String
monitorZoom
;
/**所属泵站*/
@ApiModelProperty
(
value
=
"所属泵站"
)
private
String
pumpCode
;
...
...
fm-product/src/main/java/com/skua/modules/business/mapper/WhatStructDataMapper.java
查看文件 @
ebb278a
...
...
@@ -21,4 +21,10 @@ public interface WhatStructDataMapper {
List
<
WhatStructData
>
getDataList
(
@Param
(
"equipId"
)
String
equipId
);
List
<
WhatStructData
>
getListForUENew
();
List
<
WhatStructData
>
getFlowList
(
@Param
(
"loction"
)
String
loction
);
List
<
WhatStructData
>
getPressureList
(
@Param
(
"loction"
)
String
loction
);
List
<
WhatStructData
>
getTemperatureList
(
@Param
(
"loction"
)
String
loction
);
}
...
...
fm-product/src/main/java/com/skua/modules/business/mapper/xml/WhatStructDataMapper.xml
查看文件 @
ebb278a
...
...
@@ -33,4 +33,25 @@
select * from what_struct_data_bak order by monitor_sort
</select>
<select
id=
"getFlowList"
resultType=
"com.skua.modules.business.entity.WhatStructData"
>
select * from what_struct_data_bak where equip_type like CONCAT('flow','%')
<if
test=
"loction!=null and loction!=''"
>
and pump_code = #{loction}
</if>
</select>
<select
id=
"getPressureList"
resultType=
"com.skua.modules.business.entity.WhatStructData"
>
select * from what_struct_data_bak where equip_type like CONCAT('pressure','%')
<if
test=
"loction!=null and loction!=''"
>
and pump_code = #{loction}
</if>
</select>
<select
id=
"getTemperatureList"
resultType=
"com.skua.modules.business.entity.WhatStructData"
>
select * from what_struct_data_bak where equip_type like CONCAT('temperature','%')
<if
test=
"loction!=null and loction!=''"
>
and pump_code = #{loction}
</if>
</select>
</mapper>
\ No newline at end of file
...
...
fm-product/src/main/java/com/skua/modules/business/service/IOlympicCenterService.java
查看文件 @
ebb278a
...
...
@@ -27,4 +27,8 @@ public interface IOlympicCenterService {
List
<
EchartResult
>
getPressureChartNew
(
String
equipId
,
String
type
);
Map
<
String
,
Object
>
getRealTimeDataToUENew
();
List
<
Map
<
String
,
Object
>>
getFlowData
(
String
equipId
);
List
<
Map
<
String
,
Object
>>
getRealTimeReport
(
String
dataType
,
String
loction
);
}
...
...
fm-product/src/main/java/com/skua/modules/business/service/impl/OlympicCenterServiceImpl.java
查看文件 @
ebb278a
此文件的差异被折叠,
点击展开。
fm-product/src/main/java/com/skua/modules/monitor/service/IFmPgQueryService.java
查看文件 @
ebb278a
...
...
@@ -10,4 +10,6 @@ public interface IFmPgQueryService {
List
<
Map
<
String
,
Object
>>
queryFactoryMonitorFromRealTimeData
(
String
factoryId
,
String
fields
);
List
<
Map
<
String
,
Object
>>
queryMonitorForReport
(
String
factoryId
,
String
fields
);
}
...
...
fm-product/src/main/java/com/skua/modules/monitor/service/impl/FmPgQueryServiceImpl.java
查看文件 @
ebb278a
...
...
@@ -11,7 +11,7 @@ import java.text.SimpleDateFormat;
import
java.util.*
;
/**
*
数据指标信息表
*
实时数据查询
*/
@Service
public
class
FmPgQueryServiceImpl
implements
IFmPgQueryService
{
...
...
@@ -94,4 +94,44 @@ public class FmPgQueryServiceImpl implements IFmPgQueryService {
}
return
timeStemp
/
1000
;
}
@Override
public
List
<
Map
<
String
,
Object
>>
queryMonitorForReport
(
String
factoryId
,
String
fields
)
{
String
[]
factoryIdArray
=
factoryId
.
split
(
","
);
String
sqlPart
=
""
;
for
(
String
id
:
factoryIdArray
)
{
sqlPart
=
sqlPart
+
",'"
+
id
+
"'"
;
}
sqlPart
=
sqlPart
.
substring
(
1
);
JdbcTemplate
pgDb
=
(
JdbcTemplate
)
SpringContextUtils
.
getBean
(
"pg-db"
);
List
<
Map
<
String
,
Object
>>
result
=
new
ArrayList
<
Map
<
String
,
Object
>>();
JdbcTemplate
masterDB
=
(
JdbcTemplate
)
SpringContextUtils
.
getBean
(
"master"
);
List
<
Map
<
String
,
Object
>>
factoryDesign
=
masterDB
.
queryForList
(
"select * from sys_factory_device where factory_id in ("
+
sqlPart
+
")"
);
if
(
factoryDesign
==
null
||
factoryDesign
.
size
()==
0
)
{
return
result
;
}
StringBuilder
str
=
new
StringBuilder
();
String
[]
fieldsArr
=
fields
.
split
(
","
);
for
(
int
i
=
0
;
i
<
fieldsArr
.
length
;
++
i
){
if
(!
StringUtils
.
isEmpty
(
fieldsArr
[
i
])&&!
fieldsArr
[
i
].
equals
(
"null"
))
{
str
.
append
(
"'"
+
fieldsArr
[
i
]+
"'"
).
append
(
","
);
}
}
if
(
fieldsArr
.
length
>
0
){
str
.
append
(
"''"
);
}
else
{
return
result
;
}
String
deviceIds
=
""
;
for
(
Map
<
String
,
Object
>
map:
factoryDesign
)
{
deviceIds
=
deviceIds
+
",'"
+
map
.
get
(
"device_id"
)+
"'"
;
}
deviceIds
=
deviceIds
.
substring
(
1
);
//获取pg数据库时间,向前推采集频率的三倍时间,做数据容错
String
sql
=
"select ts as time,nm as monitorId,v as monitorValue from realtimedata where nm in("
+
str
.
toString
()+
") and factoryname in ("
+
deviceIds
+
")"
;
result
=
pgDb
.
queryForList
(
sql
);
return
result
;
}
}
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论