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
a9095a7f
Commit
a9095a7f
authored
Nov 18, 2023
by
caotao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
分析模块需求变更
parent
06bbd582
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
177 additions
and
40 deletions
+177
-40
BigScreenAnalyseController.java
...dule/jxiop/biz/controller/BigScreenAnalyseController.java
+31
-11
TDBigScreenAnalyseController.java
...le/jxiop/biz/controller/TDBigScreenAnalyseController.java
+129
-26
IdxBizFanHealthIndexMapper.java
.../module/jxiop/biz/mapper2/IdxBizFanHealthIndexMapper.java
+2
-0
IdxBizFanHealthIndexMapper.xml
...n/resources/mapper/cluster/IdxBizFanHealthIndexMapper.xml
+15
-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 @
a9095a7f
...
@@ -618,26 +618,45 @@ private FanHealthIndexMapper fanHealthIndexMapper;
...
@@ -618,26 +618,45 @@ private FanHealthIndexMapper fanHealthIndexMapper;
@ApiOperation
(
value
=
"光伏 该装备下各指标预警 - 风站中间 下方列表"
)
@ApiOperation
(
value
=
"光伏 该装备下各指标预警 - 风站中间 下方列表"
)
@GetMapping
(
"/getPvSubSystemPointInfo"
)
@GetMapping
(
"/getPvSubSystemPointInfo"
)
public
ResponseModel
<
Page
<
Map
<
String
,
Object
>>>
getPvSubSystemPointInfo
(
@RequestParam
(
value
=
"equipmentName"
,
required
=
false
)
String
equipmentName
,
public
ResponseModel
<
Page
<
Map
<
String
,
Object
>>>
getPvSubSystemPointInfo
(
@RequestParam
(
value
=
"equipmentName"
,
required
=
false
)
String
equipmentName
,
@RequestParam
(
value
=
"stationId"
,
required
=
false
)
String
stationId
)
throws
UnsupportedEncodingException
{
@RequestParam
(
value
=
"stationId"
,
required
=
false
)
String
stationId
)
{
equipmentName
=
java
.
net
.
URLDecoder
.
decode
(
equipmentName
,
"UTF-8"
);
StationBasic
stationBasic
=
stationBasicMapper
.
selectById
(
stationId
);
StationBasic
stationBasic
=
stationBasicMapper
.
selectById
(
stationId
);
// List<Map<String, Object>> healthListInfo = idxBizFanHealthIndexMapper.getPvHealthInfoBySubSystem(equipmentName, stationBasic.getFanGatewayId());
List
<
Map
<
String
,
Object
>>
healthListInfo
=
idxBizFanHealthIndexMapper
.
getPvHealthInfoBySubSystem
(
equipmentName
,
stationBasic
.
getFanGatewayId
());
List
<
Map
<
String
,
Object
>>
healthListInfo
=
idxBizFanHealthIndexMapper
.
getPvWarningInfoBySubSystem
(
equipmentName
,
stationBasic
.
getFanGatewayId
());
Map
<
Object
,
String
>
equipmentHealthIndexMap
=
healthListInfo
.
stream
().
collect
(
Collectors
.
toMap
(
t
->
t
.
get
(
"pointName"
),
t
->
t
.
get
(
"warningName"
).
toString
()));
Map
<
Object
,
Double
>
equipmentHealthIndexMap
=
healthListInfo
.
stream
().
collect
(
Collectors
.
toMap
(
t
->
t
.
get
(
"pointName"
),
t
->
Double
.
parseDouble
(
t
.
get
(
"healthIndex"
).
toString
())));
List
<
Map
<
String
,
Object
>>
pointNameList
=
idxBizFanHealthIndexMapper
.
getPvPointNameListBySumSystem
(
stationBasic
.
getFanGatewayId
(),
equipmentName
);
List
<
Map
<
String
,
Object
>>
pointNameList
=
idxBizFanHealthIndexMapper
.
getPvPointNameListBySumSystem
(
stationBasic
.
getFanGatewayId
(),
equipmentName
);
pointNameList
.
forEach
(
item
->
{
pointNameList
.
forEach
(
item
->
{
String
equipmentHealthScore
=
equipmentHealthIndexMap
.
getOrDefault
(
item
.
get
(
"pointName"
),
"安全"
);
Double
equipmentHealthScore
=
equipmentHealthIndexMap
.
getOrDefault
(
item
.
get
(
"pointName"
),
100.0
);
if
(
100.0
==
equipmentHealthScore
)
{
item
.
put
(
"warningName"
,
"安全"
);
item
.
put
(
"status"
,
"安全"
);
}
else
{
LambdaQueryWrapper
<
IdxBizFanHealthLevel
>
query
=
new
LambdaQueryWrapper
<>();
query
.
eq
(
IdxBizFanHealthLevel:
:
getAnalysisObjType
,
"设备"
);
query
.
eq
(
IdxBizFanHealthLevel:
:
getStatus
,
stationBasic
.
getStationName
());
query
.
le
(
IdxBizFanHealthLevel:
:
getGroupLowerLimit
,
equipmentHealthScore
);
query
.
ge
(
IdxBizFanHealthLevel:
:
getGroupUpperLimit
,
equipmentHealthScore
);
IdxBizFanHealthLevel
idxBizFanHealthLevel
=
idxBizFanHealthLevelMapper
.
selectOne
(
query
);
if
(
ObjectUtils
.
isEmpty
(
idxBizFanHealthLevel
))
{
item
.
put
(
"warningName"
,
"安全"
);
item
.
put
(
"status"
,
"安全"
);
}
else
{
item
.
put
(
"warningName"
,
idxBizFanHealthLevel
.
getHealthLevel
());
item
.
put
(
"status"
,
idxBizFanHealthLevel
.
getHealthLevel
());
}
}
int
sort
=
4
;
int
sort
=
4
;
if
(
"注意"
.
equals
(
equipmentHealthScore
))
{
if
(
"注意"
.
equals
(
item
.
get
(
"warningName"
)
))
{
sort
=
3
;
sort
=
3
;
}
else
if
(
"警告"
.
equals
(
equipmentHealthScore
))
{
}
else
if
(
"警告"
.
equals
(
item
.
get
(
"warningName"
)
))
{
sort
=
2
;
sort
=
2
;
}
else
if
(
"危险"
.
equals
(
equipmentHealthScore
))
{
}
else
if
(
"危险"
.
equals
(
item
.
get
(
"warningName"
)
))
{
sort
=
1
;
sort
=
1
;
}
}
item
.
put
(
"sort"
,
sort
);
item
.
put
(
"sort"
,
sort
);
item
.
put
(
"warningName"
,
equipmentHealthScore
);
item
.
put
(
"healthIndex"
,
equipmentHealthScore
);
item
.
put
(
"status"
,
equipmentHealthScore
);
});
});
pointNameList
.
sort
(
Comparator
.
comparing
(
o
->
o
.
get
(
"sort"
).
toString
()));
pointNameList
.
sort
(
Comparator
.
comparing
(
o
->
o
.
get
(
"sort"
).
toString
()));
Page
<
Map
<
String
,
Object
>>
mapPage
=
new
Page
<>();
Page
<
Map
<
String
,
Object
>>
mapPage
=
new
Page
<>();
...
@@ -645,6 +664,7 @@ private FanHealthIndexMapper fanHealthIndexMapper;
...
@@ -645,6 +664,7 @@ private FanHealthIndexMapper fanHealthIndexMapper;
mapPage
.
setTotal
(
pointNameList
.
size
());
mapPage
.
setTotal
(
pointNameList
.
size
());
mapPage
.
setCurrent
(
1
);
mapPage
.
setCurrent
(
1
);
mapPage
.
setRecords
(
pointNameList
);
mapPage
.
setRecords
(
pointNameList
);
return
ResponseHelper
.
buildResponse
(
mapPage
);
return
ResponseHelper
.
buildResponse
(
mapPage
);
}
}
...
...
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 @
a9095a7f
...
@@ -18,7 +18,8 @@ import java.util.List;
...
@@ -18,7 +18,8 @@ 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
com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2.*
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdengine.*
;
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
;
...
@@ -58,14 +59,6 @@ import com.yeejoin.amos.boot.module.jxiop.biz.mapper2.IdxBizPvHealthLevelMapper;
...
@@ -58,14 +59,6 @@ import com.yeejoin.amos.boot.module.jxiop.biz.mapper2.IdxBizPvHealthLevelMapper;
import
com.yeejoin.amos.boot.module.jxiop.biz.service.impl.CommonServiceImpl
;
import
com.yeejoin.amos.boot.module.jxiop.biz.service.impl.CommonServiceImpl
;
import
com.yeejoin.amos.boot.module.jxiop.biz.service.impl.IdxBizFanWarningRuleSetServiceImpl
;
import
com.yeejoin.amos.boot.module.jxiop.biz.service.impl.IdxBizFanWarningRuleSetServiceImpl
;
import
com.yeejoin.amos.boot.module.jxiop.biz.service.impl.IdxBizPvWarningRuleSetServiceImpl
;
import
com.yeejoin.amos.boot.module.jxiop.biz.service.impl.IdxBizPvWarningRuleSetServiceImpl
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2.FanHealthIndexDayMapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2.FanHealthIndexMapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2.FanWaringRecordMapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2.PvHealthIndexMapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2.PvWaringRecordMapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdengine.FanHealthIndex
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdengine.FanWarningRecord
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdengine.PvHealthIndex
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdmapper.IndicatorDataMapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdmapper.IndicatorDataMapper
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
...
@@ -719,31 +712,46 @@ public class TDBigScreenAnalyseController extends BaseController {
...
@@ -719,31 +712,46 @@ public class TDBigScreenAnalyseController extends BaseController {
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"光伏 该装备下各指标预警 - 风站中间 下方列表"
)
@ApiOperation
(
value
=
"光伏 该装备下各指标预警 - 风站中间 下方列表"
)
@GetMapping
(
"/getPvSubSystemPointInfo"
)
@GetMapping
(
"/getPvSubSystemPointInfo"
)
public
ResponseModel
<
Page
<
Map
<
String
,
Object
>>>
getPvSubSystemPointInfo
(
public
ResponseModel
<
Page
<
Map
<
String
,
Object
>>>
getPvSubSystemPointInfo
(
@RequestParam
(
value
=
"equipmentName"
,
required
=
false
)
String
equipmentName
,
@RequestParam
(
value
=
"equipmentName"
,
required
=
false
)
String
equipmentName
,
@RequestParam
(
value
=
"stationId"
,
required
=
false
)
String
stationId
)
{
@RequestParam
(
value
=
"stationId"
,
required
=
false
)
String
stationId
)
throws
UnsupportedEncodingException
{
equipmentName
=
java
.
net
.
URLDecoder
.
decode
(
equipmentName
,
"UTF-8"
);
StationBasic
stationBasic
=
stationBasicMapper
.
selectById
(
stationId
);
StationBasic
stationBasic
=
stationBasicMapper
.
selectById
(
stationId
);
// List<Map<String, Object>> healthListInfo = idxBizFanHealthIndexMapper.getPvHealthInfoBySubSystem(equipmentName, stationBasic.getFanGatewayId());
List
<
Map
<
String
,
Object
>>
healthListInfo
=
idxBizFanHealthIndexMapper
.
getPvHealthInfoBySubSystem
(
equipmentName
,
stationBasic
.
getFanGatewayId
());
List
<
Map
<
String
,
Object
>>
healthListInfo
=
fanHealthIndexMapper
.
getPvWarningInfoBySubSystemTd
(
equipmentName
,
stationBasic
.
getFanGatewayId
());
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
.
getPvPointNameListBySumSystem
(
stationBasic
.
getFanGatewayId
(),
equipmentName
);
List
<
Map
<
String
,
Object
>>
pointNameList
=
idxBizFanHealthIndexMapper
.
getPvPointNameListBySumSystem
(
stationBasic
.
getFanGatewayId
(),
equipmentName
);
pointNameList
.
forEach
(
item
->
{
pointNameList
.
forEach
(
item
->
{
String
equipmentHealthScore
=
equipmentHealthIndexMap
.
getOrDefault
(
item
.
get
(
"pointName"
),
"安全"
);
Double
equipmentHealthScore
=
equipmentHealthIndexMap
.
getOrDefault
(
item
.
get
(
"pointName"
),
100.0
);
if
(
100.0
==
equipmentHealthScore
)
{
item
.
put
(
"warningName"
,
"安全"
);
item
.
put
(
"status"
,
"安全"
);
}
else
{
LambdaQueryWrapper
<
IdxBizPvHealthLevel
>
query
=
new
LambdaQueryWrapper
<>();
query
.
eq
(
IdxBizPvHealthLevel:
:
getAnalysisObjType
,
"设备"
);
query
.
eq
(
IdxBizPvHealthLevel:
:
getStatus
,
item
.
get
(
"station"
));
query
.
le
(
IdxBizPvHealthLevel:
:
getGroupLowerLimit
,
equipmentHealthScore
);
query
.
ge
(
IdxBizPvHealthLevel:
:
getGroupUpperLimit
,
equipmentHealthScore
);
IdxBizPvHealthLevel
idxBizFanHealthLevel
=
idxBizPvHealthLevelMapper
.
selectOne
(
query
);
if
(
ObjectUtils
.
isEmpty
(
idxBizFanHealthLevel
))
{
item
.
put
(
"warningName"
,
"安全"
);
item
.
put
(
"status"
,
"安全"
);
}
else
{
item
.
put
(
"warningName"
,
idxBizFanHealthLevel
.
getHealthLevel
());
item
.
put
(
"status"
,
idxBizFanHealthLevel
.
getHealthLevel
());
}
}
int
sort
=
4
;
int
sort
=
4
;
if
(
"注意"
.
equals
(
equipmentHealthScore
))
{
if
(
"注意"
.
equals
(
item
.
get
(
"warningName"
)
))
{
sort
=
3
;
sort
=
3
;
}
else
if
(
"警告"
.
equals
(
equipmentHealthScore
))
{
}
else
if
(
"警告"
.
equals
(
item
.
get
(
"warningName"
)
))
{
sort
=
2
;
sort
=
2
;
}
else
if
(
"危险"
.
equals
(
equipmentHealthScore
))
{
}
else
if
(
"危险"
.
equals
(
item
.
get
(
"warningName"
)
))
{
sort
=
1
;
sort
=
1
;
}
}
item
.
put
(
"sort"
,
sort
);
item
.
put
(
"sort"
,
sort
);
item
.
put
(
"warningName"
,
equipmentHealthScore
);
item
.
put
(
"healthIndex"
,
equipmentHealthScore
);
item
.
put
(
"status"
,
equipmentHealthScore
);
});
});
pointNameList
.
sort
(
Comparator
.
comparing
(
o
->
o
.
get
(
"sort"
).
toString
()));
pointNameList
.
sort
(
Comparator
.
comparing
(
o
->
o
.
get
(
"sort"
).
toString
()));
Page
<
Map
<
String
,
Object
>>
mapPage
=
new
Page
<>();
Page
<
Map
<
String
,
Object
>>
mapPage
=
new
Page
<>();
...
@@ -1311,6 +1319,49 @@ public class TDBigScreenAnalyseController extends BaseController {
...
@@ -1311,6 +1319,49 @@ public class TDBigScreenAnalyseController extends BaseController {
return
ResponseHelper
.
buildResponse
(
resultMap
);
return
ResponseHelper
.
buildResponse
(
resultMap
);
}
}
@Autowired
private
PvHealthIndexDayMapper
pvHealthIndexDayMapper
;
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"风站/光伏 右下实时趋势"
)
@GetMapping
(
"/getTrendInfoByAddressBy1118Pv"
)
public
ResponseModel
<
Map
<
String
,
Object
>>
getTrendInfoByAddressBy1118Pv
(
@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
<
PvHealthIndexDay
>
lambdaQueryWrapper
=
new
LambdaQueryWrapper
<>();
lambdaQueryWrapper
.
eq
(
PvHealthIndexDay:
:
getIndexAddress
,
indexAddress
);
lambdaQueryWrapper
.
eq
(
PvHealthIndexDay:
:
getGatewayId
,
stationBasic
.
getFanGatewayId
());
lambdaQueryWrapper
.
eq
(
PvHealthIndexDay:
:
getAnalysisObjType
,
"测点"
);
lambdaQueryWrapper
.
le
(
PvHealthIndexDay:
:
getRecDate
,
endTime
);
lambdaQueryWrapper
.
ge
(
PvHealthIndexDay:
:
getRecDate
,
startTime
);
List
<
PvHealthIndexDay
>
fanHealthIndexDayList
=
pvHealthIndexDayMapper
.
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
().
substring
(
0
,
10
));
String
format
=
df
.
format
(
item
.
getHealthIndex
());
valueList
.
add
(
format
);
});
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
);
}
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"风站/光伏 右下诊断分析"
)
@ApiOperation
(
value
=
"风站/光伏 右下诊断分析"
)
@GetMapping
(
"/getRiskHandleByVarDescBy1118"
)
@GetMapping
(
"/getRiskHandleByVarDescBy1118"
)
...
@@ -1361,4 +1412,56 @@ public class TDBigScreenAnalyseController extends BaseController {
...
@@ -1361,4 +1412,56 @@ public class TDBigScreenAnalyseController extends BaseController {
return
ResponseHelper
.
buildResponse
(
stringStringHashMap
);
return
ResponseHelper
.
buildResponse
(
stringStringHashMap
);
}
}
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"风站/光伏 右下诊断分析"
)
@GetMapping
(
"/getRiskHandleByVarDescBy1118Pv"
)
public
ResponseModel
<
Map
<
String
,
String
>>
getRiskHandleByVarDescBy1118Pv
(
@RequestParam
(
value
=
"varDesc"
,
required
=
false
)
String
varDesc
,
@RequestParam
(
value
=
"tableName"
,
required
=
true
)
String
tableName
,
@RequestParam
(
value
=
"stationId"
)
String
stationId
)
{
StationBasic
stationBasic
=
stationBasicMapper
.
selectById
(
stationId
);
Map
<
String
,
Object
>
healthIndexMap
=
idxBizFanHealthIndexMapper
.
getHealthIndexByIndexAddressPv
(
stationBasic
.
getFanGatewayId
(),
varDesc
);
if
(
ObjectUtils
.
isEmpty
(
healthIndexMap
))
{
HashMap
<
String
,
String
>
stringStringHashMap
=
new
HashMap
<>();
stringStringHashMap
.
put
(
"content"
,
"正常运行"
);
return
ResponseHelper
.
buildResponse
(
stringStringHashMap
);
}
LambdaQueryWrapper
<
IdxBizPvHealthLevel
>
query
=
new
LambdaQueryWrapper
<>();
query
.
eq
(
IdxBizPvHealthLevel:
:
getAnalysisObjType
,
"设备"
);
query
.
eq
(
IdxBizPvHealthLevel:
:
getStatus
,
healthIndexMap
.
get
(
"station"
));
query
.
le
(
IdxBizPvHealthLevel:
:
getGroupLowerLimit
,
healthIndexMap
.
get
(
"healthIndex"
));
query
.
ge
(
IdxBizPvHealthLevel:
:
getGroupUpperLimit
,
healthIndexMap
.
get
(
"healthIndex"
));
IdxBizPvHealthLevel
idxBizFanHealthLevel
=
idxBizPvHealthLevelMapper
.
selectOne
(
query
);
if
(
ObjectUtils
.
isNotEmpty
(
idxBizFanHealthLevel
)
&&
"安全"
.
equals
(
idxBizFanHealthLevel
.
getHealthLevel
()))
{
HashMap
<
String
,
String
>
stringStringHashMap
=
new
HashMap
<>();
stringStringHashMap
.
put
(
"content"
,
"正常运行"
);
return
ResponseHelper
.
buildResponse
(
stringStringHashMap
);
}
varDesc
=
idxBizFanHealthIndexMapper
.
getPointNameByIndexAddress
(
varDesc
,
tableName
,
stationBasic
.
getFanGatewayId
());
FeignClientResult
<
List
<
String
>>
sevenEntityMcb
=
null
;
try
{
sevenEntityMcb
=
riskWarningFeign
.
getRiskHandleByVarDesc
(
varDesc
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
if
(
ObjectUtils
.
isEmpty
(
sevenEntityMcb
)
||
sevenEntityMcb
.
getStatus
()
!=
200
)
{
HashMap
<
String
,
String
>
stringStringHashMap
=
new
HashMap
<>();
stringStringHashMap
.
put
(
"content"
,
"正常运行"
);
return
ResponseHelper
.
buildResponse
(
stringStringHashMap
);
}
StringBuilder
resultString
=
new
StringBuilder
();
List
<
String
>
result
=
sevenEntityMcb
.
getResult
();
for
(
String
s
:
result
)
{
resultString
.
append
(
s
);
}
HashMap
<
String
,
String
>
stringStringHashMap
=
new
HashMap
<>();
stringStringHashMap
.
put
(
"content"
,
resultString
.
toString
());
return
ResponseHelper
.
buildResponse
(
stringStringHashMap
);
}
}
}
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 @
a9095a7f
...
@@ -162,4 +162,6 @@ public interface IdxBizFanHealthIndexMapper extends BaseMapper<IdxBizFanHealthIn
...
@@ -162,4 +162,6 @@ public interface IdxBizFanHealthIndexMapper extends BaseMapper<IdxBizFanHealthIn
String
endTimeTop
);
String
endTimeTop
);
Map
<
String
,
Object
>
getHealthIndexByIndexAddress
(
@Param
(
"gatewayId"
)
String
gatewayId
,
@Param
(
"indexAddress"
)
String
indexAddress
);
Map
<
String
,
Object
>
getHealthIndexByIndexAddress
(
@Param
(
"gatewayId"
)
String
gatewayId
,
@Param
(
"indexAddress"
)
String
indexAddress
);
Map
<
String
,
Object
>
getHealthIndexByIndexAddressPv
(
@Param
(
"gatewayId"
)
String
gatewayId
,
@Param
(
"indexAddress"
)
String
indexAddress
);
}
}
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/resources/mapper/cluster/IdxBizFanHealthIndexMapper.xml
View file @
a9095a7f
...
@@ -644,14 +644,13 @@
...
@@ -644,14 +644,13 @@
</select>
</select>
<select
id=
"getPvHealthInfoBySubSystem"
resultType=
"java.util.Map"
>
<select
id=
"getPvHealthInfoBySubSystem"
resultType=
"java.util.Map"
>
SELECT
SELECT
IFNULL(
ROUND(avg( HEALTH_INDEX ), 2), 0
) AS healthIndex,
IFNULL(
HEALTH_INDEX, 100
) AS healthIndex,
POINT_NAME AS pointName
POINT_NAME AS pointName
FROM
FROM
idx_biz_pv_health_index
pv_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=
"equipmentName != null and equipmentName != ''"
>
<if
test=
"equipmentName != null and equipmentName != ''"
>
...
@@ -1643,5 +1642,18 @@
...
@@ -1643,5 +1642,18 @@
and GATEWAY_ID = #{gatewayId}
and GATEWAY_ID = #{gatewayId}
and ANALYSIS_OBJ_TYPE = '测点'
and ANALYSIS_OBJ_TYPE = '测点'
and ANALYSIS_TYPE = '按天'
and ANALYSIS_TYPE = '按天'
limit 1
</select>
<select
id=
"getHealthIndexByIndexAddressPv"
resultType=
"java.util.Map"
>
select ROUND(ifnull(HEALTH_INDEX, 100.0), 1) as healthIndex,
STATION as station
from pv_health_index_latest_data
where
INDEX_ADDRESS = #{indexAddress}
and GATEWAY_ID = #{gatewayId}
and ANALYSIS_OBJ_TYPE = '测点'
and ANALYSIS_TYPE = '按天'
limit 1
</select>
</select>
</mapper>
</mapper>
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