Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
张雷
/
fmboot
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
构建
提交
问题看板
文件
提交
网络
比较
分支
标签
2aa800a1
由
张雷
编写于
2023-06-01 16:45:22 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
奥体项目数据报表时间修改
1 个父辈
d07e8068
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
88 行增加
和
18 行删除
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
查看文件 @
2aa800a
...
...
@@ -182,4 +182,15 @@ public class OlympicCenterController {
return
result
;
}
@ApiOperation
(
value
=
"获取历史数据表头"
,
notes
=
"获取历史数据表头"
)
@GetMapping
(
value
=
"/getHistoryReportClos"
)
public
Result
<
List
<
Map
<
String
,
Object
>>>
getHistoryReportClos
(
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
.
getHistoryReportClos
(
dataType
,
loction
);
result
.
setResult
(
list
);
result
.
setSuccess
(
true
);
return
result
;
}
}
...
...
fm-product/src/main/java/com/skua/modules/business/service/IOlympicCenterService.java
查看文件 @
2aa800a
...
...
@@ -35,4 +35,6 @@ public interface IOlympicCenterService {
Map
<
String
,
Object
>
getPumpRealTimeData
(
String
sourceType
,
String
pumpId
);
List
<
Map
<
String
,
Object
>>
getPumpRealTimeReport
(
String
sourceType
);
List
<
Map
<
String
,
Object
>>
getHistoryReportClos
(
String
dataType
,
String
loction
);
}
...
...
fm-product/src/main/java/com/skua/modules/business/service/impl/OlympicCenterServiceImpl.java
查看文件 @
2aa800a
...
...
@@ -425,22 +425,22 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService {
return
list
;
}
public
static
void
main
(
String
[]
args
)
throws
ParseException
{
DateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
String
start
=
"2023-04-01"
;
String
end
=
"2023-04-24"
;
Long
startTime
=
df
.
parse
(
start
).
getTime
();
Long
endTime
=
df
.
parse
(
end
).
getTime
();
Long
oneDay
=
1000
*
60
*
60
*
24
l
;
Long
time
=
startTime
;
while
(
time
<=
endTime
)
{
Date
d
=
new
Date
(
time
);
System
.
out
.
println
(
df
.
format
(
d
));
time
+=
oneDay
;
}
}
//
public static void main(String[] args) throws ParseException {
//
DateFormat df = new SimpleDateFormat("yyyy-MM-dd");
//
String start = "2023-04-01";
//
String end = "2023-04-24";
//
//
Long startTime = df.parse(start).getTime();
//
Long endTime = df.parse(end).getTime();
//
Long oneDay = 1000 * 60 * 60 * 24l;
//
//
Long time = startTime;
//
while (time <= endTime) {
//
Date d = new Date(time);
//
System.out.println(df.format(d));
//
time += oneDay;
//
}
//
}
@Override
public
Map
<
String
,
Object
>
getBzRealTimeData
(
String
sourceType
)
{
...
...
@@ -1047,6 +1047,19 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService {
return
list
;
}
//时间戳转时间字符串
private
String
timeStampToDateStr
(
Object
time
)
{
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"MM-dd HH:mm"
);
if
(
time
==
null
){
return
""
;
}
else
{
long
timeStamp
=
Long
.
parseLong
(
time
.
toString
()+
"000"
);
// 时间戳转换成时间
String
sd
=
sdf
.
format
(
new
Date
(
timeStamp
));
return
sd
;
}
}
@Override
public
List
<
Map
<
String
,
Object
>>
getRealTimeReport
(
String
dataType
,
String
loction
)
{
List
<
Map
<
String
,
Object
>>
list
=
new
ArrayList
<>();
...
...
@@ -1101,7 +1114,7 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService {
map
.
put
(
"flow_rljll"
,
""
);
for
(
Map
<
String
,
Object
>
mMap
:
monitorList
)
{
if
(
whatStructData
.
getId
().
equals
(
mMap
.
get
(
"equipId"
))){
map
.
put
(
"time"
,
mMap
.
get
(
"time"
));
map
.
put
(
"time"
,
timeStampToDateStr
(
mMap
.
get
(
"time"
)
));
if
(
"flow"
.
equals
(
mMap
.
get
(
"equipType"
))){
map
.
put
(
"flow"
,
mMap
.
get
(
"monitorvalue"
));
}
else
if
(
"flow_ljll"
.
equals
(
mMap
.
get
(
"equipType"
))){
...
...
@@ -1125,7 +1138,7 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService {
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
(
"time"
,
timeStampToDateStr
(
mMap
.
get
(
"time"
)
));
map
.
put
(
"value"
,
formatDouble
(
Double
.
parseDouble
(
mMap
.
get
(
"monitorvalue"
).
toString
())*
Double
.
parseDouble
(
whatStructData
.
getMonitorZoom
())));
}
}
else
{
...
...
@@ -1249,6 +1262,50 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService {
return
list
;
}
@Override
public
List
<
Map
<
String
,
Object
>>
getHistoryReportClos
(
String
dataType
,
String
loction
)
{
List
<
Map
<
String
,
Object
>>
list
=
new
ArrayList
<>();
List
<
WhatStructData
>
closList
=
new
ArrayList
<>();
if
(
"flow"
.
equals
(
dataType
)){
closList
=
whatStructDataMapper
.
getFlowList
(
loction
);
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
=
""
;
}
map
.
put
(
"title"
,
whatStructData
.
getId
().
replaceFirst
(
"_RLJLL"
,
""
).
replaceFirst
(
"_LJLL"
,
""
)+
str
);
list
.
add
(
map
);
}
}
else
if
(
"pressure"
.
equals
(
dataType
)){
closList
=
whatStructDataMapper
.
getPressureList
(
loction
);
for
(
WhatStructData
whatStructData
:
closList
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"field"
,
whatStructData
.
getId
());
map
.
put
(
"title"
,
whatStructData
.
getId
());
list
.
add
(
map
);
}
}
else
if
(
"temperature"
.
equals
(
dataType
)){
closList
=
whatStructDataMapper
.
getTemperatureList
(
loction
);
for
(
WhatStructData
whatStructData
:
closList
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"field"
,
whatStructData
.
getId
());
map
.
put
(
"title"
,
whatStructData
.
getId
());
list
.
add
(
map
);
}
}
else
{
return
list
;
}
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
);
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论