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
59684e63
Commit
59684e63
authored
Nov 18, 2023
by
caotao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
分析模块需求变更
parent
f5e651f0
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
144 additions
and
77 deletions
+144
-77
BigScreenAnalyseController.java
...dule/jxiop/biz/controller/BigScreenAnalyseController.java
+69
-50
TDBigScreenAnalyseController.java
...le/jxiop/biz/controller/TDBigScreenAnalyseController.java
+68
-23
IdxBizFanHealthIndexMapper.java
.../module/jxiop/biz/mapper2/IdxBizFanHealthIndexMapper.java
+2
-1
IdxBizFanHealthIndexMapper.xml
...n/resources/mapper/cluster/IdxBizFanHealthIndexMapper.xml
+5
-3
No files found.
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/controller/BigScreenAnalyseController.java
View file @
59684e63
This diff is collapsed.
Click to expand it.
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/controller/TDBigScreenAnalyseController.java
View file @
59684e63
...
@@ -18,6 +18,7 @@ import java.util.List;
...
@@ -18,6 +18,7 @@ import java.util.List;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdengine.FanHealthIndexDay
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -586,38 +587,38 @@ public class TDBigScreenAnalyseController extends BaseController {
...
@@ -586,38 +587,38 @@ public class TDBigScreenAnalyseController extends BaseController {
return
ResponseHelper
.
buildResponse
(
resultMap
);
return
ResponseHelper
.
buildResponse
(
resultMap
);
}
}
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"该子系统各指标预警 - 风站中间 下方列表"
)
@ApiOperation
(
value
=
"该子系统各指标预警 - 风站中间 下方列表"
)
@GetMapping
(
"/getSubSystemPointInfo"
)
@GetMapping
(
"/getSubSystemPointInfo"
)
public
ResponseModel
<
Page
<
Map
<
String
,
Object
>>>
getSubSystemPointInfo
(
public
ResponseModel
<
Page
<
Map
<
String
,
Object
>>>
getSubSystemPointInfo
(
@RequestParam
(
value
=
"subSystem"
,
required
=
false
)
String
subSystem
,
@RequestParam
(
value
=
"subSystem"
,
required
=
false
)
String
subSystem
,
@RequestParam
(
value
=
"stationId"
,
required
=
false
)
String
stationId
,
@RequestParam
(
value
=
"stationId"
,
required
=
false
)
String
stationId
,
@RequestParam
(
value
=
"equipmentName"
,
required
=
false
)
String
equipmentName
)
throws
UnsupportedEncodingException
{
@RequestParam
(
value
=
"equipmentName"
,
required
=
false
)
String
equipmentName
)
{
subSystem
=
java
.
net
.
URLDecoder
.
decode
(
subSystem
,
"UTF-8"
);
StationBasic
stationBasic
=
stationBasicMapper
.
selectById
(
stationId
);
StationBasic
stationBasic
=
stationBasicMapper
.
selectById
(
stationId
);
equipmentName
=
StrUtil
.
isNotEmpty
(
equipmentName
)
?
"%"
+
equipmentName
+
"风机%"
:
equipmentName
;
equipmentName
=
StrUtil
.
isNotEmpty
(
equipmentName
)
?
"%"
+
equipmentName
+
"风机%"
:
equipmentName
;
// List<Map<String, Object>> healthListInfo = idxBizFanHealthIndexMapper.getHealthInfoBySubSystem(subSystem, stationBasic.getFanGatewayId());
List
<
Map
<
String
,
Object
>>
healthListInfo
=
idxBizFanHealthIndexMapper
.
getHealthInfoBySubSystem
(
subSystem
,
stationBasic
.
getFanGatewayId
(),
equipmentName
);
List
<
Map
<
String
,
Object
>>
healthListInfo
=
fanHealthIndexMapper
.
getWarningInfoBySubSystemTd
(
subSystem
,
stationBasic
.
getFanGatewayId
(),
equipmentName
);
Map
<
Object
,
Double
>
equipmentHealthIndexMap
=
healthListInfo
.
stream
().
collect
(
Collectors
.
toMap
(
t
->
t
.
get
(
"pointName"
),
t
->
Double
.
parseDouble
(
t
.
get
(
"healthIndex"
).
toString
())));
Map
<
Object
,
String
>
equipmentHealthIndexMap
=
healthListInfo
.
stream
()
.
collect
(
Collectors
.
toMap
(
t
->
t
.
get
(
"pointname"
),
t
->
t
.
get
(
"warningname"
).
toString
()));
List
<
Map
<
String
,
Object
>>
pointNameList
=
idxBizFanHealthIndexMapper
.
getPointNameListBySumSystem
(
stationBasic
.
getFanGatewayId
(),
subSystem
,
equipmentName
);
List
<
Map
<
String
,
Object
>>
pointNameList
=
idxBizFanHealthIndexMapper
.
getPointNameListBySumSystem
(
stationBasic
.
getFanGatewayId
(),
subSystem
,
equipmentName
);
pointNameList
.
forEach
(
item
->
{
pointNameList
.
forEach
(
item
->
{
String
warningName
=
equipmentHealthIndexMap
.
getOrDefault
(
item
.
get
(
"pointName"
),
"安全"
);
Double
equipmentHealthScore
=
equipmentHealthIndexMap
.
getOrDefault
(
item
.
get
(
"pointName"
),
100.0
);
int
sort
=
4
;
if
(
100.0
==
equipmentHealthScore
)
{
item
.
put
(
"warningName"
,
warningName
);
item
.
put
(
"warningName"
,
"安全"
);
item
.
put
(
"status"
,
warningName
);
}
else
{
if
(
"注意"
.
equals
(
warningName
))
{
LambdaQueryWrapper
<
IdxBizFanHealthLevel
>
query
=
new
LambdaQueryWrapper
<>();
sort
=
3
;
query
.
eq
(
IdxBizFanHealthLevel:
:
getAnalysisObjType
,
"设备"
);
}
else
if
(
"警告"
.
equals
(
warningName
))
{
query
.
eq
(
IdxBizFanHealthLevel:
:
getStatus
,
stationBasic
.
getStationName
());
sort
=
2
;
query
.
le
(
IdxBizFanHealthLevel:
:
getGroupLowerLimit
,
equipmentHealthScore
);
}
else
if
(
"危险"
.
equals
(
warningName
))
{
query
.
ge
(
IdxBizFanHealthLevel:
:
getGroupUpperLimit
,
equipmentHealthScore
);
sort
=
1
;
IdxBizFanHealthLevel
idxBizFanHealthLevel
=
idxBizFanHealthLevelMapper
.
selectOne
(
query
);
item
.
put
(
"warningName"
,
idxBizFanHealthLevel
.
getHealthLevel
());
}
}
item
.
put
(
"
sort"
,
sort
);
item
.
put
(
"
healthIndex"
,
equipmentHealthScore
);
});
});
pointNameList
.
sort
(
Comparator
.
comparing
(
o
->
o
.
get
(
"sort"
).
toString
()));
Page
<
Map
<
String
,
Object
>>
mapPage
=
new
Page
<>();
Page
<
Map
<
String
,
Object
>>
mapPage
=
new
Page
<>();
mapPage
.
setSize
(
pointNameList
.
size
());
mapPage
.
setSize
(
pointNameList
.
size
());
mapPage
.
setTotal
(
pointNameList
.
size
());
mapPage
.
setTotal
(
pointNameList
.
size
());
...
@@ -626,6 +627,8 @@ public class TDBigScreenAnalyseController extends BaseController {
...
@@ -626,6 +627,8 @@ public class TDBigScreenAnalyseController extends BaseController {
return
ResponseHelper
.
buildResponse
(
mapPage
);
return
ResponseHelper
.
buildResponse
(
mapPage
);
}
}
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"光伏 左侧风机信息列表"
)
@ApiOperation
(
value
=
"光伏 左侧风机信息列表"
)
@GetMapping
(
"/getPvInfoByPage"
)
@GetMapping
(
"/getPvInfoByPage"
)
...
@@ -1248,4 +1251,46 @@ public class TDBigScreenAnalyseController extends BaseController {
...
@@ -1248,4 +1251,46 @@ public class TDBigScreenAnalyseController extends BaseController {
map
.
put
(
"seriesData"
,
seriesData
);
map
.
put
(
"seriesData"
,
seriesData
);
return
ResponseHelper
.
buildResponse
(
map
);
return
ResponseHelper
.
buildResponse
(
map
);
}
}
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"风站/光伏 右下实时趋势"
)
@GetMapping
(
"/getTrendInfoByAddressBy1118"
)
public
ResponseModel
<
Map
<
String
,
Object
>>
getTrendInfoByAddressBy1118
(
@RequestParam
(
value
=
"indexAddress"
,
required
=
false
)
String
indexAddress
,
@RequestParam
(
value
=
"stationId"
,
required
=
false
)
String
stationId
)
{
StationBasic
stationBasic
=
stationBasicMapper
.
selectById
(
stationId
);
Date
currentDayStartTime
=
DateUtils
.
getCurrentDayStartTime
(
DateUtils
.
dateAddDays
(
new
Date
(),
-
15
));
Date
currentDayEndTime
=
DateUtils
.
getCurrentDayEndTime
(
new
Date
());
String
startTime
=
DateUtils
.
convertDateToString
(
currentDayStartTime
,
DateUtils
.
DATE_TIME_PATTERN
);
String
endTime
=
DateUtils
.
convertDateToString
(
currentDayEndTime
,
DateUtils
.
DATE_TIME_PATTERN
);
LambdaQueryWrapper
<
FanHealthIndexDay
>
lambdaQueryWrapper
=
new
LambdaQueryWrapper
<>();
lambdaQueryWrapper
.
eq
(
FanHealthIndexDay:
:
getIndexAddress
,
indexAddress
);
lambdaQueryWrapper
.
eq
(
FanHealthIndexDay:
:
getGatewayId
,
stationBasic
.
getFanGatewayId
());
lambdaQueryWrapper
.
eq
(
FanHealthIndexDay:
:
getAnalysisObjType
,
"测点"
);
lambdaQueryWrapper
.
le
(
FanHealthIndexDay:
:
getRecDate
,
endTime
);
lambdaQueryWrapper
.
ge
(
FanHealthIndexDay:
:
getRecDate
,
startTime
);
List
<
FanHealthIndexDay
>
fanHealthIndexDayList
=
fanHealthIndexDayMapper
.
selectList
(
lambdaQueryWrapper
);
// List<IndicatorData> indicatorData = indicatorDataMapper.selectDataByAddressAndtime(indexAddress, startTime, endTime, stationBasic.getFanGatewayId());
HashMap
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
List
<
String
>
time
=
new
ArrayList
<>();
List
<
Object
>
valueList
=
new
ArrayList
<>();
fanHealthIndexDayList
.
forEach
(
item
->
{
time
.
add
(
item
.
getRecDate
());
valueList
.
add
(
item
.
getHealthIndex
());
});
List
<
Map
<
String
,
Object
>>
arrayList
=
new
ArrayList
<>();
HashMap
<
String
,
Object
>
stringStringHashMap
=
new
HashMap
<>();
stringStringHashMap
.
put
(
"data"
,
valueList
);
arrayList
.
add
(
stringStringHashMap
);
resultMap
.
put
(
"axisData"
,
time
);
resultMap
.
put
(
"seriesData"
,
arrayList
);
return
ResponseHelper
.
buildResponse
(
resultMap
);
}
}
}
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/mapper2/IdxBizFanHealthIndexMapper.java
View file @
59684e63
...
@@ -72,7 +72,8 @@ public interface IdxBizFanHealthIndexMapper extends BaseMapper<IdxBizFanHealthIn
...
@@ -72,7 +72,8 @@ public interface IdxBizFanHealthIndexMapper extends BaseMapper<IdxBizFanHealthIn
@Param
(
"equipmentName"
)
String
equipmentName
);
@Param
(
"equipmentName"
)
String
equipmentName
);
List
<
Map
<
String
,
Object
>>
getHealthInfoBySubSystem
(
@Param
(
"subSystem"
)
String
subSystem
,
List
<
Map
<
String
,
Object
>>
getHealthInfoBySubSystem
(
@Param
(
"subSystem"
)
String
subSystem
,
@Param
(
"gatewayId"
)
String
gatewayId
);
@Param
(
"gatewayId"
)
String
gatewayId
,
@Param
(
"equipmentName"
)
String
equipmentName
);
List
<
Map
<
String
,
Object
>>
getWarningInfoBySubSystem
(
@Param
(
"subSystem"
)
String
subSystem
,
List
<
Map
<
String
,
Object
>>
getWarningInfoBySubSystem
(
@Param
(
"subSystem"
)
String
subSystem
,
@Param
(
"gatewayId"
)
String
gatewayId
);
@Param
(
"gatewayId"
)
String
gatewayId
);
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/resources/mapper/cluster/IdxBizFanHealthIndexMapper.xml
View file @
59684e63
...
@@ -529,14 +529,13 @@
...
@@ -529,14 +529,13 @@
</select>
</select>
<select
id=
"getHealthInfoBySubSystem"
resultType=
"java.util.Map"
>
<select
id=
"getHealthInfoBySubSystem"
resultType=
"java.util.Map"
>
SELECT
SELECT
IFNULL(
avg( HEALTH_INDEX ), 100
) AS healthIndex,
IFNULL(
HEALTH_INDEX, 100
) AS healthIndex,
POINT_NAME AS pointName
POINT_NAME AS pointName
FROM
FROM
idx_biz_fan_health_index
fan_health_index_latest_data
<where>
<where>
ANALYSIS_OBJ_TYPE= '测点'
ANALYSIS_OBJ_TYPE= '测点'
AND ANALYSIS_TYPE = '按天'
AND ANALYSIS_TYPE = '按天'
AND DATE_FORMAT( REC_DATE, "%Y-%m-%d" ) = CURRENT_DATE
AND POINT_NAME IS NOT NULL
AND POINT_NAME IS NOT NULL
AND POINT_NAME != ''
AND POINT_NAME != ''
<if
test=
"subSystem != null and subSystem != ''"
>
<if
test=
"subSystem != null and subSystem != ''"
>
...
@@ -545,6 +544,9 @@
...
@@ -545,6 +544,9 @@
<if
test=
"gatewayId != null and gatewayId != ''"
>
<if
test=
"gatewayId != null and gatewayId != ''"
>
AND GATEWAY_ID = #{gatewayId}
AND GATEWAY_ID = #{gatewayId}
</if>
</if>
<if
test=
"equipmentName != null and equipmentName != ''"
>
AND EQUIPMENT_NAME like #{equipmentName}
</if>
</where>
</where>
GROUP BY
GROUP BY
POINT_NAME
POINT_NAME
...
...
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