Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
张雷
/
fmboot
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
构建
提交
问题看板
文件
提交
网络
比较
分支
标签
2018bbf1
由
张雷
编写于
2023-08-24 14:02:44 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
奥体项目接口修改(添加曲线最大最小值)
1 个父辈
f8d3f276
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
123 行增加
和
15 行删除
fm-product/src/main/java/com/skua/modules/business/service/impl/OlympicCenterServiceImpl.java
fm-product/src/main/java/com/skua/modules/business/service/impl/OlympicCenterServiceImpl.java
查看文件 @
2018bbf
...
...
@@ -1976,11 +1976,18 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService {
@Override
public
Map
<
String
,
Object
>
getSumFlowData
(
SumFlowParams
sumFlowParams
)
{
//定义返回的结果
List
<
EchartResult
>
f1List
=
new
ArrayList
<>();
List
<
EchartResult
>
f2List
=
new
ArrayList
<>();
List
<
EchartResult
>
f3List
=
new
ArrayList
<>();
List
<
EchartResult
>
f4List
=
new
ArrayList
<>();
List
<
EchartResult
>
f5List
=
new
ArrayList
<>();
//定义返回的结构MAP
Map
<
String
,
Object
>
f1Map
=
new
HashMap
<>();
Map
<
String
,
Object
>
f2Map
=
new
HashMap
<>();
Map
<
String
,
Object
>
f3Map
=
new
HashMap
<>();
Map
<
String
,
Object
>
f4Map
=
new
HashMap
<>();
Map
<
String
,
Object
>
f5Map
=
new
HashMap
<>();
String
startTime
=
""
;
//开始时间
String
endTime
=
""
;
//结束时间
int
strCount
=
10
;
...
...
@@ -2321,11 +2328,60 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService {
f5List
.
add
(
echartResult5
);
}
}
map
.
put
(
"F0001"
,
f1List
);
map
.
put
(
"F0002"
,
f2List
);
map
.
put
(
"F0003"
,
f3List
);
map
.
put
(
"F0004"
,
f4List
);
map
.
put
(
"F0005"
,
f5List
);
f1Map
.
put
(
"data"
,
f1List
);
Map
<
String
,
Object
>
map1
=
getMaxAndMin
(
f1List
);
f1Map
.
put
(
"max"
,
map1
.
get
(
"max"
));
f1Map
.
put
(
"min"
,
map1
.
get
(
"min"
));
f2Map
.
put
(
"data"
,
f2List
);
Map
<
String
,
Object
>
map2
=
getMaxAndMin
(
f2List
);
f2Map
.
put
(
"max"
,
map2
.
get
(
"max"
));
f2Map
.
put
(
"min"
,
map2
.
get
(
"min"
));
f3Map
.
put
(
"data"
,
f3List
);
Map
<
String
,
Object
>
map3
=
getMaxAndMin
(
f3List
);
f3Map
.
put
(
"max"
,
map3
.
get
(
"max"
));
f3Map
.
put
(
"min"
,
map3
.
get
(
"min"
));
f4Map
.
put
(
"data"
,
f4List
);
Map
<
String
,
Object
>
map4
=
getMaxAndMin
(
f4List
);
f4Map
.
put
(
"max"
,
map4
.
get
(
"max"
));
f4Map
.
put
(
"min"
,
map4
.
get
(
"min"
));
f5Map
.
put
(
"data"
,
f5List
);
Map
<
String
,
Object
>
map5
=
getMaxAndMin
(
f5List
);
f5Map
.
put
(
"max"
,
map5
.
get
(
"max"
));
f5Map
.
put
(
"min"
,
map5
.
get
(
"min"
));
map
.
put
(
"F0001"
,
f1Map
);
map
.
put
(
"F0002"
,
f2Map
);
map
.
put
(
"F0003"
,
f3Map
);
map
.
put
(
"F0004"
,
f4Map
);
map
.
put
(
"F0005"
,
f5Map
);
return
map
;
}
//查询出List中最大最小值
public
Map
<
String
,
Object
>
getMaxAndMin
(
List
<
EchartResult
>
list
){
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"max"
,
"0"
);
map
.
put
(
"min"
,
"0"
);
if
(
list
.
size
()
>
0
){
String
maxValue
=
list
.
stream
()
.
max
(
Comparator
.
comparing
(
EchartResult:
:
getValue
))
.
map
(
EchartResult:
:
getValue
)
.
orElse
(
""
);
if
(
""
.
equals
(
maxValue
)||
"--"
.
equals
(
maxValue
)){
maxValue
=
"1000"
;
}
else
{
maxValue
=
String
.
valueOf
(
Double
.
valueOf
(
Double
.
parseDouble
(
maxValue
)*
1.2
).
intValue
());
}
String
minValue
=
list
.
stream
()
.
min
(
Comparator
.
comparing
(
EchartResult:
:
getValue
))
.
map
(
EchartResult:
:
getValue
)
.
orElse
(
""
);
if
(
""
.
equals
(
minValue
)||
"--"
.
equals
(
minValue
)){
minValue
=
"0"
;
}
map
.
put
(
"max"
,
maxValue
);
map
.
put
(
"min"
,
minValue
);
}
return
map
;
}
...
...
@@ -2337,6 +2393,12 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService {
List
<
EchartResult
>
f3List
=
new
ArrayList
<>();
List
<
EchartResult
>
f4List
=
new
ArrayList
<>();
List
<
EchartResult
>
f5List
=
new
ArrayList
<>();
//定义返回的结构MAP
Map
<
String
,
Object
>
f1Map
=
new
HashMap
<>();
Map
<
String
,
Object
>
f2Map
=
new
HashMap
<>();
Map
<
String
,
Object
>
f3Map
=
new
HashMap
<>();
Map
<
String
,
Object
>
f4Map
=
new
HashMap
<>();
Map
<
String
,
Object
>
f5Map
=
new
HashMap
<>();
if
(!
""
.
equals
(
sumFlowParams
.
getYearMonth
())&&
sumFlowParams
.
getYearMonth
()!=
null
){
List
<
Map
<
String
,
Object
>>
monitorList
=
new
ArrayList
<>();
int
currentYear
=
LocalDate
.
now
().
getYear
();
// 获取当前年份 currentYear
...
...
@@ -2396,11 +2458,31 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService {
f5List
.
add
(
echartResult5
);
}
}
map
.
put
(
"F0001"
,
f1List
);
map
.
put
(
"F0002"
,
f2List
);
map
.
put
(
"F0003"
,
f3List
);
map
.
put
(
"F0004"
,
f4List
);
map
.
put
(
"F0005"
,
f5List
);
f1Map
.
put
(
"data"
,
f1List
);
Map
<
String
,
Object
>
map1
=
getMaxAndMin
(
f1List
);
f1Map
.
put
(
"max"
,
map1
.
get
(
"max"
));
f1Map
.
put
(
"min"
,
map1
.
get
(
"min"
));
f2Map
.
put
(
"data"
,
f2List
);
Map
<
String
,
Object
>
map2
=
getMaxAndMin
(
f2List
);
f2Map
.
put
(
"max"
,
map2
.
get
(
"max"
));
f2Map
.
put
(
"min"
,
map2
.
get
(
"min"
));
f3Map
.
put
(
"data"
,
f3List
);
Map
<
String
,
Object
>
map3
=
getMaxAndMin
(
f3List
);
f3Map
.
put
(
"max"
,
map3
.
get
(
"max"
));
f3Map
.
put
(
"min"
,
map3
.
get
(
"min"
));
f4Map
.
put
(
"data"
,
f4List
);
Map
<
String
,
Object
>
map4
=
getMaxAndMin
(
f4List
);
f4Map
.
put
(
"max"
,
map4
.
get
(
"max"
));
f4Map
.
put
(
"min"
,
map4
.
get
(
"min"
));
f5Map
.
put
(
"data"
,
f5List
);
Map
<
String
,
Object
>
map5
=
getMaxAndMin
(
f5List
);
f5Map
.
put
(
"max"
,
map5
.
get
(
"max"
));
f5Map
.
put
(
"min"
,
map5
.
get
(
"min"
));
map
.
put
(
"F0001"
,
f1Map
);
map
.
put
(
"F0002"
,
f2Map
);
map
.
put
(
"F0003"
,
f3Map
);
map
.
put
(
"F0004"
,
f4Map
);
map
.
put
(
"F0005"
,
f5Map
);
return
map
;
}
...
...
@@ -2412,6 +2494,12 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService {
List
<
EchartResult
>
f3List
=
new
ArrayList
<>();
List
<
EchartResult
>
f4List
=
new
ArrayList
<>();
List
<
EchartResult
>
f5List
=
new
ArrayList
<>();
//定义返回的结构MAP
Map
<
String
,
Object
>
f1Map
=
new
HashMap
<>();
Map
<
String
,
Object
>
f2Map
=
new
HashMap
<>();
Map
<
String
,
Object
>
f3Map
=
new
HashMap
<>();
Map
<
String
,
Object
>
f4Map
=
new
HashMap
<>();
Map
<
String
,
Object
>
f5Map
=
new
HashMap
<>();
if
(!
""
.
equals
(
sumFlowParams
.
getYear
())&&
sumFlowParams
.
getYear
()!=
null
){
List
<
Map
<
String
,
Object
>>
monitorList
=
new
ArrayList
<>();
int
currentYear
=
LocalDate
.
now
().
getYear
();
// 获取当前年份 currentYear
...
...
@@ -2469,11 +2557,31 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService {
f5List
.
add
(
echartResult5
);
}
}
map
.
put
(
"F0001"
,
f1List
);
map
.
put
(
"F0002"
,
f2List
);
map
.
put
(
"F0003"
,
f3List
);
map
.
put
(
"F0004"
,
f4List
);
map
.
put
(
"F0005"
,
f5List
);
f1Map
.
put
(
"data"
,
f1List
);
Map
<
String
,
Object
>
map1
=
getMaxAndMin
(
f1List
);
f1Map
.
put
(
"max"
,
map1
.
get
(
"max"
));
f1Map
.
put
(
"min"
,
map1
.
get
(
"min"
));
f2Map
.
put
(
"data"
,
f2List
);
Map
<
String
,
Object
>
map2
=
getMaxAndMin
(
f2List
);
f2Map
.
put
(
"max"
,
map2
.
get
(
"max"
));
f2Map
.
put
(
"min"
,
map2
.
get
(
"min"
));
f3Map
.
put
(
"data"
,
f3List
);
Map
<
String
,
Object
>
map3
=
getMaxAndMin
(
f3List
);
f3Map
.
put
(
"max"
,
map3
.
get
(
"max"
));
f3Map
.
put
(
"min"
,
map3
.
get
(
"min"
));
f4Map
.
put
(
"data"
,
f4List
);
Map
<
String
,
Object
>
map4
=
getMaxAndMin
(
f4List
);
f4Map
.
put
(
"max"
,
map4
.
get
(
"max"
));
f4Map
.
put
(
"min"
,
map4
.
get
(
"min"
));
f5Map
.
put
(
"data"
,
f5List
);
Map
<
String
,
Object
>
map5
=
getMaxAndMin
(
f5List
);
f5Map
.
put
(
"max"
,
map5
.
get
(
"max"
));
f5Map
.
put
(
"min"
,
map5
.
get
(
"min"
));
map
.
put
(
"F0001"
,
f1Map
);
map
.
put
(
"F0002"
,
f2Map
);
map
.
put
(
"F0003"
,
f3Map
);
map
.
put
(
"F0004"
,
f4Map
);
map
.
put
(
"F0005"
,
f5Map
);
return
map
;
}
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论