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
ad8e7b93
Commit
ad8e7b93
authored
Nov 09, 2023
by
chenzhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
健康划分 片区TD接口
parent
844adc48
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
9 deletions
+42
-9
AnalyseController.java
...s/boot/module/jxiop/biz/controller/AnalyseController.java
+40
-7
FanHealthIndexMapper.java
...boot/module/jxiop/biz/tdMapper2/FanHealthIndexMapper.java
+1
-1
PvHealthIndexMapper.java
.../boot/module/jxiop/biz/tdMapper2/PvHealthIndexMapper.java
+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/AnalyseController.java
View file @
ad8e7b93
...
...
@@ -11,9 +11,15 @@ import com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizPvPointProcessVariabl
import
com.yeejoin.amos.boot.module.jxiop.biz.mapper2.IdxBizFanHealthIndexMapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.service.IAlarmInfoDetailService
;
import
com.yeejoin.amos.boot.module.jxiop.biz.service.impl.CommonServiceImpl
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2.FanHealthIndexMapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2.PvHealthIndexMapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdengine.FanHealthIndex
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdengine.FanHealthIndexDay
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdengine.PvHealthIndex
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
...
...
@@ -22,7 +28,9 @@ import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.util.*
;
import
java.util.stream.Collectors
;
/**
* @author system_generator
...
...
@@ -41,6 +49,11 @@ public class AnalyseController extends BaseController {
@Autowired
IAlarmInfoDetailService
iAlarmInfoDetailService
;
@Autowired
FanHealthIndexMapper
fanHealthIndexMapper
;
@Autowired
PvHealthIndexMapper
pvHealthIndexMapper
;
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"工况测点区间划分-风机"
,
notes
=
"工况测点区间划分-风机"
)
@GetMapping
(
value
=
"/getFanConditionVariablesByTime"
)
...
...
@@ -252,15 +265,35 @@ public class AnalyseController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"预警详情信息-光伏"
,
notes
=
"预警详情信息-光伏"
)
@GetMapping
(
value
=
"/queryIndexByArae"
)
public
ResponseModel
<
Map
<
String
,
Object
>>
queryIndexByArae
(
String
ARAE
,
String
ANALYSISTYPE
,
String
startTimeTop
,
String
endTimeTop
)
{
List
<
Map
<
String
,
Object
>>
maps
=
idxBizFanHealthIndexMapper
.
queryIndexByArae
(
ARAE
,
ANALYSISTYPE
,
startTimeTop
,
endTimeTop
);
List
<
String
>
axisData
=
new
ArrayList
<>();
List
<
String
>
seriesData
=
new
ArrayList
<>();
public
ResponseModel
<
Map
<
String
,
Object
>>
queryIndexByArae
(
String
area
,
String
analysisType
,
String
startTimeTop
,
String
endTimeTop
)
{
SimpleDateFormat
formatter
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
if
(
null
!=
endTimeTop
){
Date
endDate
=
DateUtils
.
dateAddHours
(
DateUtils
.
longStr2Date
(
endTimeTop
),
-
8
);
endTimeTop
=
formatter
.
format
(
endDate
);
}
Date
startDate
=
DateUtils
.
dateAddHours
(
DateUtils
.
longStr2Date
(
startTimeTop
),
-
8
);
startTimeTop
=
formatter
.
format
(
startDate
);
List
<
FanHealthIndex
>
fanHealthIndices
=
fanHealthIndexMapper
.
selectData
(
null
,
area
,
null
,
null
,
analysisType
,
"片区"
,
null
,
null
,
null
,
startTimeTop
,
endTimeTop
);
List
<
PvHealthIndex
>
pvHealthIndices
=
pvHealthIndexMapper
.
selectData
(
null
,
area
,
null
,
null
,
analysisType
,
"片区"
,
null
,
null
,
null
,
startTimeTop
,
endTimeTop
);
for
(
PvHealthIndex
pvHealthIndex
:
pvHealthIndices
)
{
FanHealthIndex
fanHealthIndex
=
new
FanHealthIndex
();
BeanUtils
.
copyProperties
(
pvHealthIndex
,
fanHealthIndex
);
fanHealthIndices
.
add
(
fanHealthIndex
);
}
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
for
(
Map
<
String
,
Object
>
obj
:
maps
)
{
axisData
.
add
(
obj
.
get
(
"HEALTHINDEX"
).
toString
());
seriesData
.
add
(
obj
.
get
(
"ANALYSISTIME"
).
toString
());
List
<
Object
>
axisData
=
new
ArrayList
<>();
List
<
Object
>
seriesData
=
new
ArrayList
<>();
Map
<
String
,
List
<
FanHealthIndex
>>
mapList
=
fanHealthIndices
.
stream
().
collect
(
Collectors
.
groupingBy
(
FanHealthIndex:
:
getAnalysisTime
));
for
(
String
s
:
mapList
.
keySet
())
{
List
<
FanHealthIndex
>
fanHealthIndices1
=
mapList
.
get
(
s
);
Double
healtnIndex
=
fanHealthIndices1
.
stream
().
collect
(
Collectors
.
averagingDouble
(
FanHealthIndex:
:
getHealthIndex
));
seriesData
.
add
(
healtnIndex
.
intValue
());
axisData
.
add
(
s
);
}
map
.
put
(
"axisData"
,
axisData
);
map
.
put
(
"seriesData"
,
seriesData
);
return
ResponseHelper
.
buildResponse
(
map
);
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/tdMapper2/FanHealthIndexMapper.java
View file @
ad8e7b93
...
...
@@ -23,7 +23,7 @@ public interface FanHealthIndexMapper extends BaseMapper<FanHealthIndex> {
"<if test='subSystem!= null'>AND sub_system = #{subSystem} </if> "
+
"<if test='equipmentName!= null'>AND equipment_name = #{equipmentName} </if>"
+
"</script>"
)
List
<
FanHealthIndex
Day
>
selectData
(
@Param
(
"healthLevel"
)
String
healthLevel
,
@Param
(
"area"
)
String
area
,
@Param
(
"equipmentName"
)
String
equipmentName
,
@Param
(
"subSystem"
)
String
subSystem
,
@Param
(
"analysisType"
)
String
analysisType
,
@Param
(
"analysisObjType"
)
String
analysisObjType
,
@Param
(
"station"
)
String
station
,
@Param
(
"pointName"
)
String
pointName
,
@Param
(
"indexAddress"
)
String
indexAddress
,
@Param
(
"startTimeTop"
)
String
startTimeTop
,
@Param
(
"endTimeTop"
)
String
endTimeTop
);
List
<
FanHealthIndex
>
selectData
(
@Param
(
"healthLevel"
)
String
healthLevel
,
@Param
(
"area"
)
String
area
,
@Param
(
"equipmentName"
)
String
equipmentName
,
@Param
(
"subSystem"
)
String
subSystem
,
@Param
(
"analysisType"
)
String
analysisType
,
@Param
(
"analysisObjType"
)
String
analysisObjType
,
@Param
(
"station"
)
String
station
,
@Param
(
"pointName"
)
String
pointName
,
@Param
(
"indexAddress"
)
String
indexAddress
,
@Param
(
"startTimeTop"
)
String
startTimeTop
,
@Param
(
"endTimeTop"
)
String
endTimeTop
);
int
saveBatchHealthIndexList
(
@Param
(
"list"
)
List
<
FanHealthIndex
>
list
,
@Param
(
"tableName"
)
String
tableName
,
@Param
(
"analysisType"
)
String
analysisType
);
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/tdMapper2/PvHealthIndexMapper.java
View file @
ad8e7b93
...
...
@@ -27,7 +27,7 @@ public interface PvHealthIndexMapper extends BaseMapper<PvHealthIndex> {
"<if test='subarray!= null'>AND subarray = #{subarray} </if> "
+
"<if test='equipmentName!= null'>AND equipment_name = #{equipmentName} </if>"
+
"</script>"
)
List
<
FanHealthIndexDay
>
selectData
(
@Param
(
"healthLevel"
)
String
healthLevel
,
@Param
(
"area"
)
String
area
,
@Param
(
"equipmentName"
)
String
equipmentName
,
@Param
(
"subSystem"
)
String
subSystem
,
@Param
(
"analysisType"
)
String
analysisType
,
@Param
(
"analysisObjType"
)
String
analysisObjType
,
@Param
(
"station"
)
String
station
,
@Param
(
"pointName"
)
String
pointName
,
@Param
(
"indexAddress"
)
String
indexAddress
,
@Param
(
"startTimeTop"
)
String
startTimeTop
,
@Param
(
"endTimeTop"
)
String
endTimeTop
);
List
<
PvHealthIndex
>
selectData
(
@Param
(
"healthLevel"
)
String
healthLevel
,
@Param
(
"area"
)
String
area
,
@Param
(
"equipmentName"
)
String
equipmentName
,
@Param
(
"subarray"
)
String
subarray
,
@Param
(
"analysisType"
)
String
analysisType
,
@Param
(
"analysisObjType"
)
String
analysisObjType
,
@Param
(
"station"
)
String
station
,
@Param
(
"pointName"
)
String
pointName
,
@Param
(
"indexAddress"
)
String
indexAddress
,
@Param
(
"startTimeTop"
)
String
startTimeTop
,
@Param
(
"endTimeTop"
)
String
endTimeTop
);
int
saveBatchHealthIndexList
(
@Param
(
"list"
)
List
<
PvHealthIndex
>
list
,
@Param
(
"tableName"
)
String
tableName
,
@Param
(
"analysisType"
)
String
analysisType
);
...
...
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