Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
张雷
/
fmboot
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
构建
提交
问题看板
文件
提交
网络
比较
分支
标签
31ce05c6
由
张雷
编写于
2023-09-11 11:14:27 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
奥体项目接口修改
1 个父辈
b3aadc7d
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
53 行增加
和
27 行删除
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
查看文件 @
31ce05c
package
com
.
skua
.
modules
.
business
.
controller
;
import
com.skua.core.api.vo.Result
;
import
com.skua.modules.business.entity.WhatStructData
;
import
com.skua.modules.business.service.IOlympicCenterService
;
import
com.skua.modules.business.service.ISynthesizeService
;
import
com.skua.modules.business.vo.*
;
...
...
@@ -205,10 +206,10 @@ public class OlympicCenterController {
@ApiOperation
(
value
=
"获取历史报表数据"
,
notes
=
"获取历史报表数据"
)
@GetMapping
(
value
=
"/getHistoryReportData"
)
public
Result
<
List
<
Map
<
String
,
Object
>>>
getHistoryReportData
(
String
dataType
,
String
loction
){
public
Result
<
List
<
Map
<
String
,
Object
>>>
getHistoryReportData
(
ReportParamsVO
reportParamsVO
){
Result
<
List
<
Map
<
String
,
Object
>>>
result
=
new
Result
<
List
<
Map
<
String
,
Object
>>>();
List
<
Map
<
String
,
Object
>>
list
=
new
ArrayList
<>();
list
=
olympicCenterService
.
getHistoryReportData
(
dataType
,
loction
);
list
=
olympicCenterService
.
getHistoryReportData
(
reportParamsVO
);
result
.
setResult
(
list
);
result
.
setSuccess
(
true
);
return
result
;
...
...
@@ -226,11 +227,20 @@ public class OlympicCenterController {
@ApiOperation
(
value
=
"获取趋势图"
,
notes
=
"获取趋势图"
)
@GetMapping
(
value
=
"/getHistoryTrendsByDate"
)
public
Result
<
List
<
EchartResult
>>
getHistoryTrendsByDate
(
InputQueryParams
inputQueryParams
){
Result
<
List
<
EchartResult
>>
result
=
new
Result
<
List
<
EchartResult
>>();
List
<
EchartResult
>
list
=
new
ArrayList
<
EchartResult
>();
list
=
olympicCenterService
.
getHistoryTrendsByDate
(
inputQueryParams
);
result
.
setResult
(
list
);
public
Result
<
Map
<
String
,
Object
>>
getHistoryTrendsByDate
(
InputQueryParams
inputQueryParams
){
Result
<
Map
<
String
,
Object
>>
result
=
new
Result
<
Map
<
String
,
Object
>>();
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"list"
,
new
ArrayList
<
EchartResult
>());
map
.
put
(
"name"
,
"--"
);
List
<
EchartResult
>
list
=
olympicCenterService
.
getHistoryTrendsByDate
(
inputQueryParams
);
if
(
list
.
size
()>
0
){
map
.
put
(
"list"
,
list
);
}
WhatStructData
whatStructData
=
olympicCenterService
.
getFieldNameById
(
inputQueryParams
.
getEquipId
());
if
(
whatStructData
!=
null
){
map
.
put
(
"name"
,
whatStructData
.
getMonitorName
());
}
result
.
setResult
(
map
);
result
.
setSuccess
(
true
);
return
result
;
}
...
...
fm-product/src/main/java/com/skua/modules/business/service/IOlympicCenterService.java
查看文件 @
31ce05c
package
com
.
skua
.
modules
.
business
.
service
;
import
com.skua.modules.business.entity.WhatStructData
;
import
com.skua.modules.business.vo.*
;
import
java.util.List
;
...
...
@@ -40,7 +41,7 @@ public interface IOlympicCenterService {
List
<
Map
<
String
,
Object
>>
getHistoryReportClos
(
String
dataType
,
String
loction
);
List
<
Map
<
String
,
Object
>>
getHistoryReportData
(
String
dataType
,
String
loction
);
List
<
Map
<
String
,
Object
>>
getHistoryReportData
(
ReportParamsVO
reportParamsVO
);
Map
<
String
,
Object
>
getPumpOrFlowChart
(
InputQueryParams
inputQueryParams
);
...
...
@@ -57,4 +58,6 @@ public interface IOlympicCenterService {
Map
<
String
,
Object
>
getYearMonthSumFlowGroup
(
SumFlowParams
sumFlowParams
);
Map
<
String
,
Object
>
getYearSumFlowGroup
(
SumFlowParams
sumFlowParams
);
WhatStructData
getFieldNameById
(
String
equipId
);
}
...
...
fm-product/src/main/java/com/skua/modules/business/service/impl/OlympicCenterServiceImpl.java
查看文件 @
31ce05c
...
...
@@ -1544,17 +1544,11 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService {
for
(
WhatStructData
whatStructData
:
closList
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"field"
,
whatStructData
.
getId
());
String
str
=
""
;
if
(
"flow"
.
equals
(
whatStructData
.
getEquipType
())){
str
=
"瞬时流量"
;
}
else
if
(
"flow_ljll"
.
equals
(
whatStructData
.
getEquipType
())){
str
=
"正向累计"
;
}
else
if
(
"flow_rljll"
.
equals
(
whatStructData
.
getEquipType
())){
str
=
"反向累计"
;
}
else
{
str
=
""
;
if
(
whatStructData
.
getMonitorName
()==
null
){
map
.
put
(
"title"
,
whatStructData
.
getId
().
replaceFirst
(
"_RLJLL"
,
""
).
replaceFirst
(
"_LJLL"
,
""
));
}
else
{
map
.
put
(
"title"
,
whatStructData
.
getMonitorName
()
+
"("
+
whatStructData
.
getId
().
replaceFirst
(
"_RLJLL"
,
""
).
replaceFirst
(
"_LJLL"
,
""
)
+
")"
);
}
map
.
put
(
"title"
,
whatStructData
.
getId
().
replaceFirst
(
"_RLJLL"
,
""
).
replaceFirst
(
"_LJLL"
,
""
)+
str
);
list
.
add
(
map
);
}
}
else
if
(
"pressure"
.
equals
(
dataType
)){
...
...
@@ -1562,7 +1556,11 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService {
for
(
WhatStructData
whatStructData
:
closList
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"field"
,
whatStructData
.
getId
());
map
.
put
(
"title"
,
whatStructData
.
getId
());
if
(
whatStructData
.
getMonitorName
()==
null
){
map
.
put
(
"title"
,
whatStructData
.
getId
());
}
else
{
map
.
put
(
"title"
,
whatStructData
.
getMonitorName
()
+
"("
+
whatStructData
.
getId
()
+
")"
);
}
list
.
add
(
map
);
}
}
else
if
(
"temperature"
.
equals
(
dataType
)){
...
...
@@ -1570,7 +1568,11 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService {
for
(
WhatStructData
whatStructData
:
closList
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"field"
,
whatStructData
.
getId
());
map
.
put
(
"title"
,
whatStructData
.
getId
());
if
(
whatStructData
.
getMonitorName
()==
null
){
map
.
put
(
"title"
,
whatStructData
.
getId
());
}
else
{
map
.
put
(
"title"
,
whatStructData
.
getMonitorName
()+
"("
+
whatStructData
.
getId
()+
")"
);
}
list
.
add
(
map
);
}
}
else
{
...
...
@@ -1580,10 +1582,13 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService {
}
@Override
public
List
<
Map
<
String
,
Object
>>
getHistoryReportData
(
String
dataType
,
String
loction
)
{
public
List
<
Map
<
String
,
Object
>>
getHistoryReportData
(
ReportParamsVO
reportParamsVO
)
{
List
<
Map
<
String
,
Object
>>
list
=
new
ArrayList
<>();
List
<
WhatStructData
>
closList
=
new
ArrayList
<>();
Map
<
String
,
Object
>
monitorMap
=
new
HashMap
<>();
String
dataType
=
reportParamsVO
.
getDataType
();
String
loction
=
reportParamsVO
.
getLoction
();
String
dataDate
=
""
;
if
(
"flow"
.
equals
(
dataType
)){
closList
=
whatStructDataMapper
.
getFlowList
(
loction
);
}
else
if
(
"pressure"
.
equals
(
dataType
)){
...
...
@@ -1604,12 +1609,13 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService {
}
}
}
Calendar
cal
=
Calendar
.
getInstance
();
cal
.
add
(
Calendar
.
DATE
,
-
30
);
String
startDate
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
).
format
(
cal
.
getTime
());
String
start
=
startDate
+
" 00:00:00"
;
String
endDate
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
).
format
(
new
Date
());
String
end
=
endDate
+
" 23:59:59"
;
if
(
reportParamsVO
.
getDataDate
()==
null
||
""
.
equals
(
reportParamsVO
.
getDataDate
())){
dataDate
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
).
format
(
new
Date
());
}
else
{
dataDate
=
reportParamsVO
.
getDataDate
();
}
String
start
=
dataDate
+
" 00:00:00"
;
String
end
=
dataDate
+
" 23:59:59"
;
List
<
Map
<
String
,
Object
>>
dataList
=
factoryInfoService
.
queryReportData
(
AT_ID
,
pgField
,
start
,
end
,
"hour"
);
for
(
Map
<
String
,
Object
>
map
:
dataList
)
{
Map
<
String
,
Object
>
newMap
=
new
HashMap
<>();
...
...
@@ -2830,6 +2836,13 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService {
return
map
;
}
@Override
public
WhatStructData
getFieldNameById
(
String
equipId
)
{
WhatStructData
whatStructData
=
new
WhatStructData
();
whatStructData
=
whatStructDataMapper
.
getOneById
(
equipId
);
return
whatStructData
;
}
//遍历两个年份之间的年份
private
static
String
[]
getYearsArray
(
String
startYear
,
String
endYear
)
{
int
length
=
Integer
.
parseInt
(
endYear
)
-
Integer
.
parseInt
(
startYear
)
+
1
;
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论