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
5976382e
Commit
5976382e
authored
Nov 15, 2023
by
zhangsen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
飞书 bug修改
parent
6c76c951
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
32 deletions
+30
-32
BigScreenAnalyseController.java
...dule/jxiop/biz/controller/BigScreenAnalyseController.java
+2
-2
TDBigScreenAnalyseController.java
...le/jxiop/biz/controller/TDBigScreenAnalyseController.java
+17
-19
IdxBizFanHealthIndexMapper.xml
...n/resources/mapper/cluster/IdxBizFanHealthIndexMapper.xml
+10
-10
FanHealthIndexDay.xml
...src/main/resources/mapper/tdengine2/FanHealthIndexDay.xml
+1
-1
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 @
5976382e
...
...
@@ -202,7 +202,7 @@ public class BigScreenAnalyseController extends BaseController {
public
ResponseModel
<
Map
<
String
,
Object
>>
getHealthInfoByArea
()
throws
Exception
{
Map
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
List
<
Map
<
String
,
Object
>>
healthListInfo
=
idxBizFanHealthIndexMapper
.
getHealthInfoByArea
();
Map
<
String
,
Integer
>
collect
=
healthListInfo
.
stream
().
collect
(
Collectors
.
toMap
(
t
->
t
.
get
(
"area"
).
toString
(),
t
->
Integer
.
valueOf
(
t
.
get
(
"healthIndex"
).
toString
().
replace
(
".0"
,
""
)
)));
Map
<
String
,
Object
>
collect
=
healthListInfo
.
stream
().
collect
(
Collectors
.
toMap
(
t
->
t
.
get
(
"area"
).
toString
(),
t
->
t
.
get
(
"healthIndex"
)));
// List<String> list = Arrays.asList("华中片区", "西北片区", "西南片区", "华南片区", "华东片区", "东北片区", "华北片区");
List
<
String
>
list
=
new
ArrayList
<>();
...
...
@@ -220,7 +220,7 @@ public class BigScreenAnalyseController extends BaseController {
}
list
=
companyModels
.
stream
().
map
(
CompanyModel:
:
getCompanyName
).
collect
(
Collectors
.
toList
());
List
<
Object
>
seriesData
=
new
ArrayList
<>();
list
.
forEach
(
item
->
seriesData
.
add
(
collect
.
getOrDefault
(
item
,
100
)));
list
.
forEach
(
item
->
seriesData
.
add
(
collect
.
getOrDefault
(
item
,
100
.0
)));
resultMap
.
put
(
"axisData"
,
list
);
resultMap
.
put
(
"seriesData"
,
seriesData
);
return
ResponseHelper
.
buildResponse
(
resultMap
);
...
...
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 @
5976382e
...
...
@@ -4,6 +4,7 @@ import static com.yeejoin.amos.boot.biz.common.utils.DateUtils.DATE_TIME_PATTERN
import
java.io.UnsupportedEncodingException
;
import
java.sql.Timestamp
;
import
java.text.DecimalFormat
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.util.ArrayList
;
...
...
@@ -121,22 +122,23 @@ public class TDBigScreenAnalyseController extends BaseController {
@Autowired
private
IdxBizPvWarningRuleSetServiceImpl
idxBizPvWarningRuleSetService
;
public
final
DecimalFormat
df
=
new
DecimalFormat
(
"#.0"
);
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"场站设备健康状态指数与趋势 - 仪表盘"
,
notes
=
"场站设备健康状态指数与趋势 - 仪表盘"
)
@GetMapping
(
value
=
"/getHealthScoreInfo"
)
public
ResponseModel
<
Map
<
String
,
Integer
>>
getHealthScoreInfo
(
@RequestParam
(
required
=
false
)
String
areaCode
,
public
ResponseModel
<
Map
<
String
,
Object
>>
getHealthScoreInfo
(
@RequestParam
(
required
=
false
)
String
areaCode
,
@RequestParam
(
required
=
false
)
String
stationCode
,
@RequestParam
(
required
=
false
)
String
tableName
)
{
HashMap
<
String
,
Integer
>
stringBigDecimalHashMap
=
new
HashMap
<>();
HashMap
<
String
,
Object
>
stringBigDecimalHashMap
=
new
HashMap
<>();
if
(
CharSequenceUtil
.
isNotEmpty
(
stationCode
))
{
StationBasic
stationBasic
=
stationBasicMapper
.
selectById
(
stationCode
);
stationCode
=
stationBasic
.
getFanGatewayId
();
stringBigDecimalHashMap
.
put
(
"value"
,
Integer
.
valueOf
(
idxBizFanHealthIndexMapper
.
getHealthScoreInfoByStation
(
stationCode
,
tableName
)
.
toString
().
replace
(
".0"
,
""
))
);
stringBigDecimalHashMap
.
put
(
"value"
,
idxBizFanHealthIndexMapper
.
getHealthScoreInfoByStation
(
stationCode
,
tableName
));
return
ResponseHelper
.
buildResponse
(
stringBigDecimalHashMap
);
}
stringBigDecimalHashMap
.
put
(
"value"
,
Integer
.
valueOf
(
idxBizFanHealthIndexMapper
.
getHealthScoreInfoByLatest
(
areaCode
,
stationCode
)
.
toString
().
replace
(
".0"
,
""
))
);
stringBigDecimalHashMap
.
put
(
"value"
,
idxBizFanHealthIndexMapper
.
getHealthScoreInfoByLatest
(
areaCode
,
stationCode
));
return
ResponseHelper
.
buildResponse
(
stringBigDecimalHashMap
);
}
...
...
@@ -300,12 +302,8 @@ public class TDBigScreenAnalyseController extends BaseController {
@GetMapping
(
value
=
"/getHealthInfoByArea"
)
public
ResponseModel
<
Map
<
String
,
Object
>>
getHealthInfoByArea
()
throws
Exception
{
Map
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
// List<Map<String, Object>> healthListInfo =
// idxBizFanHealthIndexMapper.getHealthInfoByArea();
List
<
Map
<
String
,
Object
>>
healthListInfo
=
fanHealthIndexDayMapper
.
getHealthInfoByArea
();
Map
<
String
,
Integer
>
collect
=
healthListInfo
.
stream
().
collect
(
Collectors
.
toMap
(
t
->
t
.
get
(
"area"
).
toString
(),
t
->
Integer
.
valueOf
(
t
.
get
(
"healthIndex"
).
toString
().
replace
(
".0"
,
""
))));
// List<String> list = Arrays.asList("华中片区", "西北片区", "西南片区", "华南片区", "华东片区", "东北片区", "华北片区");
List
<
Map
<
String
,
Object
>>
healthListInfo
=
idxBizFanHealthIndexMapper
.
getHealthInfoByArea
();
Map
<
String
,
Object
>
collect
=
healthListInfo
.
stream
().
collect
(
Collectors
.
toMap
(
t
->
t
.
get
(
"area"
).
toString
(),
t
->
t
.
get
(
"healthIndex"
)));
List
<
String
>
list
=
new
ArrayList
<>();
...
...
@@ -322,7 +320,7 @@ public class TDBigScreenAnalyseController extends BaseController {
}
list
=
companyModels
.
stream
().
map
(
CompanyModel:
:
getCompanyName
).
collect
(
Collectors
.
toList
());
List
<
Object
>
seriesData
=
new
ArrayList
<>();
list
.
forEach
(
item
->
seriesData
.
add
(
collect
.
getOrDefault
(
item
,
100
)));
list
.
forEach
(
item
->
seriesData
.
add
(
collect
.
getOrDefault
(
item
,
100
.0
)));
resultMap
.
put
(
"axisData"
,
list
);
resultMap
.
put
(
"seriesData"
,
seriesData
);
return
ResponseHelper
.
buildResponse
(
resultMap
);
...
...
@@ -431,7 +429,7 @@ public class TDBigScreenAnalyseController extends BaseController {
List
<
Object
>
seriesData
=
new
ArrayList
<>();
healthListInfo
.
forEach
(
item
->
{
list
.
add
(
item
.
get
(
"station"
).
toString
());
seriesData
.
add
(
item
.
get
(
"healthIndex"
)
.
toString
().
replace
(
".0"
,
""
)
);
seriesData
.
add
(
item
.
get
(
"healthIndex"
));
});
resultMap
.
put
(
"axisData"
,
list
);
resultMap
.
put
(
"seriesData"
,
seriesData
);
...
...
@@ -570,8 +568,8 @@ public class TDBigScreenAnalyseController extends BaseController {
Map
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
List
<
Map
<
String
,
Object
>>
healthListInfo
=
idxBizFanHealthIndexMapper
.
getSubSystemInfo
(
equipmentName
,
stationBasic
.
getFanGatewayId
());
Map
<
Object
,
Integer
>
equipmentHealthIndexMap
=
healthListInfo
.
stream
().
collect
(
Collectors
.
toMap
(
t
->
t
.
get
(
"subSystem"
),
t
->
Integer
.
valueOf
(
t
.
get
(
"healthIndex"
).
toString
().
replace
(
".0"
,
""
)
)));
Map
<
Object
,
Object
>
equipmentHealthIndexMap
=
healthListInfo
.
stream
().
collect
(
Collectors
.
toMap
(
t
->
t
.
get
(
"subSystem"
),
t
->
t
.
get
(
"healthIndex"
)));
List
<
Object
>
seriesData
=
new
ArrayList
<>();
List
<
Object
>
axisData
=
new
ArrayList
<>();
...
...
@@ -579,7 +577,7 @@ public class TDBigScreenAnalyseController extends BaseController {
List
<
Map
<
String
,
Object
>>
equipmentList
=
idxBizFanHealthIndexMapper
.
getSumSystemListByEquipment
(
stationBasic
.
getFanGatewayId
(),
equipmentName
);
equipmentList
.
forEach
(
item
->
{
Integer
equipmentHealthScore
=
equipmentHealthIndexMap
.
getOrDefault
(
item
.
get
(
"subSystem"
),
10
0
);
Object
equipmentHealthScore
=
equipmentHealthIndexMap
.
getOrDefault
(
item
.
get
(
"subSystem"
),
100.
0
);
seriesData
.
add
(
equipmentHealthScore
);
axisData
.
add
(
item
.
get
(
"subSystem"
));
});
...
...
@@ -678,7 +676,7 @@ public class TDBigScreenAnalyseController extends BaseController {
List
<
Map
<
String
,
Object
>>
healthListInfo
=
idxBizFanHealthIndexMapper
.
getPvSubSystemInfo
(
subarray
,
stationBasic
.
getFanGatewayId
());
Map
<
Object
,
Object
>
equipmentHealthIndexMap
=
healthListInfo
.
stream
().
collect
(
Collectors
.
toMap
(
t
->
t
.
get
(
"equipmentName"
),
t
->
t
.
get
(
"avgHealthIndex"
)
.
toString
().
replace
(
".0"
,
""
)
));
.
toMap
(
t
->
t
.
get
(
"equipmentName"
),
t
->
t
.
get
(
"avgHealthIndex"
)));
List
<
Object
>
seriesData
=
new
ArrayList
<>();
List
<
Object
>
axisData
=
new
ArrayList
<>();
...
...
@@ -686,7 +684,7 @@ public class TDBigScreenAnalyseController extends BaseController {
List
<
Map
<
String
,
Object
>>
equipmentList
=
idxBizFanHealthIndexMapper
.
getPvSumSystemListByEquipment
(
stationBasic
.
getFanGatewayId
(),
subarray
);
equipmentList
.
forEach
(
item
->
{
Object
equipmentHealthScore
=
equipmentHealthIndexMap
.
getOrDefault
(
item
.
get
(
"equipmentName"
),
100
);
Object
equipmentHealthScore
=
equipmentHealthIndexMap
.
getOrDefault
(
item
.
get
(
"equipmentName"
),
100
.0
);
seriesData
.
add
(
equipmentHealthScore
);
axisData
.
add
(
item
.
get
(
"equipmentName"
));
});
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/resources/mapper/cluster/IdxBizFanHealthIndexMapper.xml
View file @
5976382e
...
...
@@ -119,7 +119,7 @@
</select>
<select
id=
"getHealthScoreInfoByStation"
resultType=
"java.math.BigDecimal"
>
SELECT
CEILING(IFNULL( HEALTH_INDEX , 100 )
) AS healthIndex
round(IFNULL( HEALTH_INDEX , 100 ), 1
) AS healthIndex
FROM
${tableName}
<where>
...
...
@@ -205,11 +205,11 @@
</select>
<select
id=
"getHealthInfoByArea"
resultType=
"java.util.Map"
>
SELECT ARAE as area,
CEILING(avg(a.avgHealthIndex)
) AS healthIndex
round(avg(a.avgHealthIndex), 1
) AS healthIndex
FROM (
SELECT IFNULL(AVG(HEALTH_INDEX), 100) AS avgHealthIndex,
ARAE
FROM
idx_biz_fan_health_index
FROM
fan_health_index_latest_data
WHERE ANALYSIS_OBJ_TYPE = '片区'
AND ANALYSIS_TYPE = '按天'
AND DATE_FORMAT(REC_DATE, "%Y-%m-%d") = CURRENT_DATE
...
...
@@ -218,7 +218,7 @@
(
SELECT IFNULL(AVG(HEALTH_INDEX), 100) AS avgHealthIndex,
ARAE
FROM
idx_biz_pv_health_index
FROM
pv_health_index_latest_data
WHERE ANALYSIS_OBJ_TYPE = '片区'
AND ANALYSIS_TYPE = '按天'
AND DATE_FORMAT(REC_DATE, "%Y-%m-%d") = CURRENT_DATE
...
...
@@ -267,14 +267,14 @@
<select
id=
"getHealthInfoByStation"
resultType=
"java.util.Map"
>
SELECT
a.STATION as station,
CEILING(avg( a.avgHealthIndex )
) AS healthIndex
round(avg( a.avgHealthIndex ), 1
) AS healthIndex
FROM
(
SELECT
IFNULL( AVG( HEALTH_INDEX ), 100 ) AS avgHealthIndex,
STATION
FROM
idx_biz_fan_health_index
fan_health_index_latest
<where>
ANALYSIS_OBJ_TYPE = '场站'
AND ANALYSIS_TYPE = '按天'
...
...
@@ -290,7 +290,7 @@
IFNULL( AVG( HEALTH_INDEX ), 100 ) AS avgHealthIndex,
STATION
FROM
idx_biz_pv_health_index
pv_health_index_latest
<where>
ANALYSIS_OBJ_TYPE = '场站'
AND ANALYSIS_TYPE = '按天'
...
...
@@ -434,7 +434,7 @@
</select>
<select
id=
"getSubSystemInfo"
resultType=
"java.util.Map"
>
SELECT
CEILING(IFNULL( HEALTH_INDEX, 100 )
) AS healthIndex,
round(IFNULL( HEALTH_INDEX, 100 ), 1
) AS healthIndex,
SUB_SYSTEM AS subSystem
FROM
fan_health_index_latest_data
...
...
@@ -599,7 +599,7 @@
</select>
<select
id=
"getPvSubSystemInfo"
resultType=
"java.util.Map"
>
SELECT
CEILING(IFNULL( AVG( HEALTH_INDEX ), 100 )
) AS avgHealthIndex,
round(IFNULL( AVG( HEALTH_INDEX ), 100 ), 1
) AS avgHealthIndex,
EQUIPMENT_NAME AS equipmentName
FROM
pv_health_index_latest_data
...
...
@@ -1538,7 +1538,7 @@
</select>
<select
id=
"getHealthScoreInfoByLatest"
resultType=
"java.math.BigDecimal"
>
SELECT
CEILING(avg( a.avgHealthIndex )
) AS healthIndex
round(avg( a.avgHealthIndex ), 1
) AS healthIndex
FROM
(
SELECT
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/resources/mapper/tdengine2/FanHealthIndexDay.xml
View file @
5976382e
...
...
@@ -4,7 +4,7 @@
<select
id=
"getHealthInfoByArea"
resultType=
"java.util.Map"
>
select area as area,
ceil(avg(a.avghealthindex)
) as healthIndex
avg(a.avghealthindex
) as healthIndex
from (
select avg(health_index) as avghealthindex,
area
...
...
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