Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
项目统一框架
amos-boot-biz
Commits
1344bc5d
Commit
1344bc5d
authored
Sep 19, 2024
by
张森
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
30546 运行趋势页签接口开发1
parent
2856d284
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
39 deletions
+19
-39
SupervisionConfigureController.java
...quipmanage/controller/SupervisionConfigureController.java
+1
-1
EquipmentSpecificSerivceImpl.java
...quipmanage/service/impl/EquipmentSpecificSerivceImpl.java
+14
-34
EquipmentSpecificMapper.xml
...uip/src/main/resources/mapper/EquipmentSpecificMapper.xml
+4
-4
No files found.
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/controller/SupervisionConfigureController.java
View file @
1344bc5d
...
@@ -852,7 +852,7 @@ public class SupervisionConfigureController extends AbstractBaseController {
...
@@ -852,7 +852,7 @@ public class SupervisionConfigureController extends AbstractBaseController {
}
}
@PersonIdentify
@PersonIdentify
@RequestMapping
(
value
=
"/operatingTrend
Water
"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/operatingTrend
PressurePump
"
,
method
=
RequestMethod
.
GET
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"设备平台运行趋势 稳压泵启动频次趋势API"
,
produces
=
"application/json;charset=UTF-8"
,
notes
=
"设备平台运行趋势 稳压泵启动频次趋势API"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"设备平台运行趋势 稳压泵启动频次趋势API"
,
produces
=
"application/json;charset=UTF-8"
,
notes
=
"设备平台运行趋势 稳压泵启动频次趋势API"
)
public
ResponseModel
operatingTrendPressurePump
(
@RequestParam
(
value
=
"startTime"
,
required
=
false
)
String
startTime
,
public
ResponseModel
operatingTrendPressurePump
(
@RequestParam
(
value
=
"startTime"
,
required
=
false
)
String
startTime
,
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/EquipmentSpecificSerivceImpl.java
View file @
1344bc5d
...
@@ -2345,16 +2345,22 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
...
@@ -2345,16 +2345,22 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
@Override
@Override
public
EquipTrendResultVo
operatingTrendPressurePump
(
String
startTime
,
String
endTime
,
String
bizOrgCode
,
String
equipCode
,
String
indexKey
)
{
public
EquipTrendResultVo
operatingTrendPressurePump
(
String
startTime
,
String
endTime
,
String
bizOrgCode
,
String
equipCode
,
String
indexKey
)
{
// 定义一个DateTimeFormatter来匹配时间字符串的格式
DateTimeFormatter
formatter
=
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd HH:mm:ss"
);
// 使用parse方法将字符串解析为LocalDateTime对象
LocalDateTime
startTimeLocal
=
LocalDateTime
.
parse
(
startTime
,
formatter
);
LocalDateTime
endTimeLocal
=
LocalDateTime
.
parse
(
endTime
,
formatter
);
//横坐标数据
List
<
String
>
allTimeList
=
getHourlyTimes
(
startTimeLocal
,
endTimeLocal
);
List
<
EquipTrendInfoVo
>
equipList
=
equipmentSpecificMapper
.
getEquipListByCode
(
equipCode
,
indexKey
,
bizOrgCode
);
List
<
EquipTrendInfoVo
>
equipList
=
equipmentSpecificMapper
.
getEquipListByCode
(
equipCode
,
indexKey
,
bizOrgCode
);
List
<
String
>
allTimeList
=
new
ArrayList
<>();
ResponseModel
entity
=
null
;
ResponseModel
entity
=
null
;
//返回数据组装定义
//返回数据组装定义
List
<
String
>
legends
=
new
ArrayList
<>();
List
<
String
>
legends
=
new
ArrayList
<>();
List
<
List
<
String
>>
threshold
=
new
ArrayList
<>();
List
<
List
<
String
>>
threshold
=
new
ArrayList
<>();
Map
<
String
,
Map
<
String
,
String
>>
dateValueMapInfo
=
new
HashMap
<>();
List
<
List
<
String
>>
yaxisList
=
new
ArrayList
<>();
EquipTrendResultVo
equipTrendResultVo
=
new
EquipTrendResultVo
();
EquipTrendResultVo
equipTrendResultVo
=
new
EquipTrendResultVo
();
for
(
EquipTrendInfoVo
equipInfo
:
equipList
)
{
for
(
EquipTrendInfoVo
equipInfo
:
equipList
)
{
//返回数据组装
//返回数据组装
...
@@ -2383,45 +2389,19 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
...
@@ -2383,45 +2389,19 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
if
(
200
==
entity
.
getStatus
()
&&
!
ObjectUtils
.
isEmpty
(
entity
.
getResult
()))
{
if
(
200
==
entity
.
getStatus
()
&&
!
ObjectUtils
.
isEmpty
(
entity
.
getResult
()))
{
String
json
=
JSON
.
toJSONString
(
entity
.
getResult
());
String
json
=
JSON
.
toJSONString
(
entity
.
getResult
());
List
<
Map
<
String
,
String
>>
listObject
=
(
List
<
Map
<
String
,
String
>>)
JSONArray
.
parse
(
json
);
List
<
Map
<
String
,
String
>>
listObject
=
(
List
<
Map
<
String
,
String
>>)
JSONArray
.
parse
(
json
);
List
<
String
>
values
=
new
ArrayList
<>();
Map
<
String
,
String
>
timeAndValue
=
new
HashMap
<>();
for
(
Map
<
String
,
String
>
mapList
:
listObject
)
{
for
(
Map
<
String
,
String
>
mapList
:
listObject
)
{
if
(
mapList
.
containsKey
(
indexKey
))
{
if
(
mapList
.
containsKey
(
indexKey
))
{
timeAndValue
.
put
(
mapList
.
get
(
"time"
),
mapList
.
get
(
indexKey
)
);
long
countNum
=
allTimeList
.
stream
().
filter
(
item
->
mapList
.
get
(
"time"
).
contains
(
item
)).
count
(
);
allTimeList
.
add
(
mapList
.
get
(
"time"
));
values
.
add
(
String
.
valueOf
(
countNum
));
}
}
}
}
dateValueMapInfo
.
put
(
equipInfo
.
getId
(),
timeAndValue
);
yaxisList
.
add
(
values
);
}
}
}
}
allTimeList
=
allTimeList
.
stream
().
distinct
().
collect
(
Collectors
.
toList
());
equipTrendResultVo
.
setXAxisData
(
allTimeList
);
equipTrendResultVo
.
setLegends
(
legends
);
equipTrendResultVo
.
setLegends
(
legends
);
equipTrendResultVo
.
setThreshold
(
threshold
);
equipTrendResultVo
.
setThreshold
(
threshold
);
List
<
List
<
String
>>
yaxisList
=
new
ArrayList
<>();
for
(
EquipTrendInfoVo
info
:
equipList
)
{
//key:时间 value:数值
Map
<
String
,
String
>
dateValueDataMap
=
dateValueMapInfo
.
get
(
info
.
getId
());
List
<
String
>
values
=
new
ArrayList
<>();
String
lastValue
=
"0"
;
List
<
String
>
allTimeListNew
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
allTimeList
.
size
();
i
++)
{
if
(!
ObjectUtils
.
isEmpty
(
dateValueDataMap
)
&&
dateValueDataMap
.
containsKey
(
allTimeList
.
get
(
i
)))
{
lastValue
=
dateValueDataMap
.
get
(
allTimeList
.
get
(
i
));
}
values
.
add
(
lastValue
);
try
{
allTimeListNew
.
add
(
change
(
allTimeList
.
get
(
i
)));
}
catch
(
ParseException
e
)
{
throw
new
RuntimeException
(
e
);
}
}
yaxisList
.
add
(
values
);
equipTrendResultVo
.
setXAxisData
(
allTimeListNew
);
}
equipTrendResultVo
.
setYAxisData
(
yaxisList
);
equipTrendResultVo
.
setYAxisData
(
yaxisList
);
return
equipTrendResultVo
;
return
equipTrendResultVo
;
}
}
...
...
amos-boot-system-equip/src/main/resources/mapper/EquipmentSpecificMapper.xml
View file @
1344bc5d
...
@@ -3002,22 +3002,22 @@
...
@@ -3002,22 +3002,22 @@
a.id,
a.id,
a.iot_code AS iotCode,
a.iot_code AS iotCode,
a.`name` AS `name`,
a.`name` AS `name`,
<if
test=
"
equipC
ode == '92011000'"
>
<if
test=
"
c
ode == '92011000'"
>
max( CASE WHEN b.field_name = 'maxPressure' THEN b.field_value END ) AS maxNum,
max( CASE WHEN b.field_name = 'maxPressure' THEN b.field_value END ) AS maxNum,
max( CASE WHEN b.field_name = 'minPressure' THEN b.field_value END ) AS minNum,
max( CASE WHEN b.field_name = 'minPressure' THEN b.field_value END ) AS minNum,
concat('压力(', ifnull(c.unit, 'Mpa'), ')') as unit
concat('压力(', ifnull(c.unit, 'Mpa'), ')') as unit
</if>
</if>
<if
test=
"(
equipCode == '92032000' and indexKey == 'CAFS_WaterTank_WaterTankLevel') or (equipC
ode == '92031900')"
>
<if
test=
"(
code == '92032000' and indexKey == 'CAFS_WaterTank_WaterTankLevel') or (c
ode == '92031900')"
>
max( CASE WHEN b.field_name = 'maxLevel' THEN b.field_value END ) AS maxNum,
max( CASE WHEN b.field_name = 'maxLevel' THEN b.field_value END ) AS maxNum,
max( CASE WHEN b.field_name = 'minLevel' THEN b.field_value END ) AS minNum,
max( CASE WHEN b.field_name = 'minLevel' THEN b.field_value END ) AS minNum,
concat('液位(', ifnull(c.unit, 'M'), ')') as unit
concat('液位(', ifnull(c.unit, 'M'), ')') as unit
</if>
</if>
<if
test=
"
equipC
ode == '92032000' and indexKey == 'CAFS_WaterTank_EffluentFlow'"
>
<if
test=
"
c
ode == '92032000' and indexKey == 'CAFS_WaterTank_EffluentFlow'"
>
max( CASE WHEN b.field_name = 'maxLevel' THEN b.field_value END ) AS maxNum,
max( CASE WHEN b.field_name = 'maxLevel' THEN b.field_value END ) AS maxNum,
max( CASE WHEN b.field_name = 'minLevel' THEN b.field_value END ) AS minNum,
max( CASE WHEN b.field_name = 'minLevel' THEN b.field_value END ) AS minNum,
concat('出口流量(', ifnull(c.unit, 'L/S'), ')') as unit
concat('出口流量(', ifnull(c.unit, 'L/S'), ')') as unit
</if>
</if>
<if
test=
"
equipC
ode == '92010800'"
>
<if
test=
"
c
ode == '92010800'"
>
'频次(次/小时)' as unit
'频次(次/小时)' as unit
</if>
</if>
FROM
FROM
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment