Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-zx-biz
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
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
Jobs
Commits
Open sidebar
项目统一框架
一体化_户用光伏项目代码
amos-boot-zx-biz
Commits
13077bd1
Commit
13077bd1
authored
Jul 18, 2024
by
wujiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交全域接口
parent
d2d4a00b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
80 additions
and
47 deletions
+80
-47
TDBigScreenAnalyseController.java
...le/jxiop/biz/controller/TDBigScreenAnalyseController.java
+80
-47
No files found.
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 @
13077bd1
...
@@ -6,17 +6,23 @@ import java.sql.Timestamp;
...
@@ -6,17 +6,23 @@ import java.sql.Timestamp;
import
java.text.DecimalFormat
;
import
java.text.DecimalFormat
;
import
java.text.ParseException
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.text.SimpleDateFormat
;
import
java.util.*
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Calendar
;
import
java.util.Collections
;
import
java.util.Comparator
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.LinkedHashSet
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Objects
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
import
com.yeejoin.amos.boot.module.jxiop.biz.Enum.WarningPeriodEnum
;
import
com.yeejoin.amos.boot.module.jxiop.biz.service.IPermissionService
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdengine.*
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.format.annotation.DateTimeFormat
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PutMapping
;
import
org.springframework.web.bind.annotation.PutMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestBody
;
...
@@ -33,12 +39,13 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
...
@@ -33,12 +39,13 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import
com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.ibm.icu.math.BigDecimal
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.biz.common.utils.DateUtils
;
import
com.yeejoin.amos.boot.biz.common.utils.DateUtils
;
import
com.yeejoin.amos.boot.module.jxiop.api.entity.StationBasic
;
import
com.yeejoin.amos.boot.module.jxiop.api.entity.StationBasic
;
import
com.yeejoin.amos.boot.module.jxiop.api.feign.RiskWarningFeign
;
import
com.yeejoin.amos.boot.module.jxiop.api.feign.RiskWarningFeign
;
import
com.yeejoin.amos.boot.module.jxiop.api.mapper.StationBasicMapper
;
import
com.yeejoin.amos.boot.module.jxiop.api.mapper.StationBasicMapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.
constants.CommonConstans
;
import
com.yeejoin.amos.boot.module.jxiop.biz.
Enum.WarningPeriodEnum
;
import
com.yeejoin.amos.boot.module.jxiop.biz.dto.FullViewRecallDataDTO
;
import
com.yeejoin.amos.boot.module.jxiop.biz.dto.FullViewRecallDataDTO
;
import
com.yeejoin.amos.boot.module.jxiop.biz.dto.FullViewRecallInfoDTO
;
import
com.yeejoin.amos.boot.module.jxiop.biz.dto.FullViewRecallInfoDTO
;
import
com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizFanHealthLevel
;
import
com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizFanHealthLevel
;
...
@@ -50,6 +57,7 @@ import com.yeejoin.amos.boot.module.jxiop.biz.mapper2.IdxBizFanHealthIndexMapper
...
@@ -50,6 +57,7 @@ import com.yeejoin.amos.boot.module.jxiop.biz.mapper2.IdxBizFanHealthIndexMapper
import
com.yeejoin.amos.boot.module.jxiop.biz.mapper2.IdxBizFanHealthLevelMapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.mapper2.IdxBizFanHealthLevelMapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.mapper2.IdxBizFanWarningRecordMapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.mapper2.IdxBizFanWarningRecordMapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.mapper2.IdxBizPvHealthLevelMapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.mapper2.IdxBizPvHealthLevelMapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.service.IPermissionService
;
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
;
...
@@ -59,6 +67,12 @@ import com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2.FanWaringRecordMapper;
...
@@ -59,6 +67,12 @@ import com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2.FanWaringRecordMapper;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2.PvHealthIndexDayMapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2.PvHealthIndexDayMapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2.PvHealthIndexMapper
;
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.tdMapper2.PvWaringRecordMapper
;
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.FanWarningRecord
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdengine.PvHealthIndex
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdengine.PvHealthIndexDay
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdengine.PvWarningRecord
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdmapper.IndicatorDataMapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdmapper.IndicatorDataMapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.utils.TimeRangeUtil
;
import
com.yeejoin.amos.boot.module.jxiop.biz.utils.TimeRangeUtil
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
...
@@ -132,37 +146,58 @@ public class TDBigScreenAnalyseController extends BaseController {
...
@@ -132,37 +146,58 @@ public class TDBigScreenAnalyseController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"场站设备健康状态指数与趋势 - 仪表盘-10分钟"
,
notes
=
"场站设备健康状态指数与趋势 - 仪表盘-10分钟"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"场站设备健康状态指数与趋势 - 仪表盘-10分钟"
,
notes
=
"场站设备健康状态指数与趋势 - 仪表盘-10分钟"
)
@GetMapping
(
value
=
"/getHealthScoreInfoByMinute"
)
@GetMapping
(
value
=
"/getHealthScoreInfoByMinute"
)
public
ResponseModel
<
Map
<
String
,
Object
>>
getHealthScoreInfoByMinute
(
@RequestParam
(
required
=
false
)
String
areaCode
,
public
ResponseModel
<
Map
<
String
,
Object
>>
getHealthScoreInfoByMinute
(
@RequestParam
(
required
=
false
)
String
stationCode
,
@RequestParam
(
required
=
false
)
String
areaCode
,
@RequestParam
(
required
=
false
)
String
stationCode
,
@RequestParam
(
required
=
false
)
String
tableName
)
{
@RequestParam
(
required
=
false
)
String
tableName
)
{
HashMap
<
String
,
Object
>
stringBigDecimalHashMap
=
new
HashMap
<>();
HashMap
<
String
,
Object
>
stringBigDecimalHashMap
=
new
HashMap
<>();
LambdaQueryWrapper
<
FanHealthIndex
>
wrapper
=
new
LambdaQueryWrapper
<
FanHealthIndex
>();
wrapper
.
orderByDesc
(
FanHealthIndex:
:
getTs
);
wrapper
.
last
(
"limit 1"
);
if
(
CharSequenceUtil
.
isNotEmpty
(
stationCode
))
{
if
(
CharSequenceUtil
.
isNotEmpty
(
stationCode
))
{
StationBasic
stationBasic
=
stationBasicMapper
.
selectById
(
stationCode
);
StationBasic
stationBasic
=
stationBasicMapper
.
selectById
(
stationCode
);
if
(
"FDZ"
.
equals
(
stationBasic
.
getStationType
()))
{
stationCode
=
stationBasic
.
getFanGatewayId
();
stationCode
=
stationBasic
.
getFanGatewayId
();
stringBigDecimalHashMap
.
put
(
"value"
,
idxBizFanHealthIndexMapper
.
getHealthScoreInfoByStationByMinute
(
stationCode
,
tableName
));
wrapper
.
eq
(
FanHealthIndex:
:
getAnalysisObjType
,
"场站"
);
wrapper
.
eq
(
FanHealthIndex:
:
getGatewayId
,
stationCode
);
FanHealthIndex
fanHealthIndex
=
fanHealthIndexMapper
.
selectOne
(
wrapper
);
stringBigDecimalHashMap
.
put
(
"value"
,
BigDecimal
.
valueOf
(
fanHealthIndex
.
getHealthIndex
()).
setScale
(
1
,
BigDecimal
.
ROUND_HALF_UP
));
}
else
{
LambdaQueryWrapper
<
PvHealthIndex
>
pvwrapper
=
new
LambdaQueryWrapper
<
PvHealthIndex
>();
pvwrapper
.
eq
(
PvHealthIndex:
:
getAnalysisObjType
,
"场站"
);
pvwrapper
.
eq
(
PvHealthIndex:
:
getGatewayId
,
stationCode
);
pvwrapper
.
orderByDesc
(
PvHealthIndex:
:
getTs
);
pvwrapper
.
last
(
"limit 1"
);
PvHealthIndex
pvHealthIndex
=
pvHealthIndexMapper
.
selectOne
(
pvwrapper
);
stringBigDecimalHashMap
.
put
(
"value"
,
BigDecimal
.
valueOf
(
pvHealthIndex
.
getHealthIndex
()).
setScale
(
1
,
BigDecimal
.
ROUND_HALF_UP
));
}
return
ResponseHelper
.
buildResponse
(
stringBigDecimalHashMap
);
return
ResponseHelper
.
buildResponse
(
stringBigDecimalHashMap
);
}
}
stringBigDecimalHashMap
.
put
(
"value"
,
wrapper
.
eq
(
FanHealthIndex:
:
getAnalysisType
,
"按10分钟"
);
idxBizFanHealthIndexMapper
.
getHealthScoreInfoByLatest
(
areaCode
,
stationCode
));
wrapper
.
eq
(
FanHealthIndex:
:
getAnalysisObjType
,
"全域"
);
FanHealthIndex
fanHealthIndex
=
fanHealthIndexMapper
.
selectOne
(
wrapper
);
stringBigDecimalHashMap
.
put
(
"value"
,
BigDecimal
.
valueOf
(
fanHealthIndex
.
getHealthIndex
()).
setScale
(
1
,
BigDecimal
.
ROUND_HALF_UP
));
return
ResponseHelper
.
buildResponse
(
stringBigDecimalHashMap
);
return
ResponseHelper
.
buildResponse
(
stringBigDecimalHashMap
);
}
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"场站设备健康状态指数与趋势 - 折线图"
,
notes
=
"场站设备健康状态指数与趋势 - 折线图"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"场站设备健康状态指数与趋势 - 折线图"
,
notes
=
"场站设备健康状态指数与趋势 - 折线图"
)
@GetMapping
(
value
=
"/getHealthListInfo"
)
@GetMapping
(
value
=
"/getHealthListInfo"
)
public
ResponseModel
<
Map
<
String
,
Object
>>
getHealthListInfo
(
@RequestParam
(
required
=
false
)
String
areaCode
,
public
ResponseModel
<
Map
<
String
,
Object
>>
getHealthListInfo
(
@RequestParam
(
required
=
false
)
String
areaCode
,
@RequestParam
(
required
=
false
)
String
stationCode
,
@RequestParam
(
required
=
false
)
String
area
,
@RequestParam
(
required
=
false
)
String
stationCode
,
@RequestParam
(
required
=
false
)
String
area
,
@RequestParam
(
required
=
false
)
String
station
,
@RequestParam
(
required
=
false
)
String
analysisType
,
@RequestParam
(
required
=
false
)
String
station
,
@RequestParam
(
required
=
false
)
String
analysisType
,
@RequestParam
(
required
=
false
)
Date
startTime
,
@RequestParam
(
required
=
false
)
Date
startTime
,
@RequestParam
(
required
=
false
)
Date
endTime
)
{
@RequestParam
(
required
=
false
)
Date
endTime
)
{
if
(
StrUtil
.
isNotEmpty
(
stationCode
))
{
if
(
StrUtil
.
isNotEmpty
(
stationCode
))
{
StationBasic
stationBasic
=
stationBasicMapper
.
selectById
(
stationCode
);
StationBasic
stationBasic
=
stationBasicMapper
.
selectById
(
stationCode
);
stationCode
=
stationBasic
.
getFanGatewayId
();
stationCode
=
stationBasic
.
getFanGatewayId
();
}
else
if
(
StrUtil
.
isNotEmpty
(
station
))
{
}
else
if
(
StrUtil
.
isNotEmpty
(
station
))
{
//
由于命名不统一
//
由于命名不统一
StationBasic
stationBasic
=
stationBasicMapper
.
selectOne
(
new
LambdaQueryWrapper
<
StationBasic
>()
StationBasic
stationBasic
=
stationBasicMapper
.
selectOne
(
new
LambdaQueryWrapper
<
StationBasic
>()
.
eq
(
StationBasic:
:
getStationName
,
station
.
substring
(
0
,
station
.
length
()
-
1
)+
'场'
)
.
eq
(
StationBasic:
:
getStationName
,
station
.
substring
(
0
,
station
.
length
()
-
1
)
+
'场'
).
or
(
)
.
or
().
eq
(
StationBasic:
:
getStationName
,
station
.
substring
(
0
,
station
.
length
()
-
1
)+
'站'
));
.
eq
(
StationBasic:
:
getStationName
,
station
.
substring
(
0
,
station
.
length
()
-
1
)
+
'站'
));
stationCode
=
stationBasic
.
getFanGatewayId
();
stationCode
=
stationBasic
.
getFanGatewayId
();
}
}
if
(
StrUtil
.
isNotEmpty
(
areaCode
))
{
if
(
StrUtil
.
isNotEmpty
(
areaCode
))
{
...
@@ -172,26 +207,26 @@ public class TDBigScreenAnalyseController extends BaseController {
...
@@ -172,26 +207,26 @@ public class TDBigScreenAnalyseController extends BaseController {
}
}
HashMap
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
HashMap
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
//
List<Map<String, String>> dateInfoBy15 = new ArrayList<>();
//
List<Map<String, String>> dateInfoBy15 = new ArrayList<>();
List
<
String
>
dateList
=
new
ArrayList
<>();
List
<
String
>
dateList
=
new
ArrayList
<>();
if
(
startTime
!=
null
&&
endTime
!=
null
)
{
if
(
startTime
!=
null
&&
endTime
!=
null
)
{
if
(
WarningPeriodEnum
.
DAY
.
getName
().
equals
(
analysisType
))
{
if
(
WarningPeriodEnum
.
DAY
.
getName
().
equals
(
analysisType
))
{
//
dateInfoBy15 = idxBizFanHealthIndexMapper.getDateInfo(startTime, endTime);
//
dateInfoBy15 = idxBizFanHealthIndexMapper.getDateInfo(startTime, endTime);
dateList
=
TimeRangeUtil
.
getDateInfo
(
startTime
,
endTime
);
dateList
=
TimeRangeUtil
.
getDateInfo
(
startTime
,
endTime
);
}
else
if
(
WarningPeriodEnum
.
HOUR
.
getName
().
equals
(
analysisType
))
{
}
else
if
(
WarningPeriodEnum
.
HOUR
.
getName
().
equals
(
analysisType
))
{
//
dateInfoBy15 = idxBizFanHealthIndexMapper.getHourInfo(startTime, endTime);
//
dateInfoBy15 = idxBizFanHealthIndexMapper.getHourInfo(startTime, endTime);
dateList
=
TimeRangeUtil
.
getHourInfo
(
startTime
,
endTime
);
dateList
=
TimeRangeUtil
.
getHourInfo
(
startTime
,
endTime
);
}
else
if
(
WarningPeriodEnum
.
MINUTES
.
getName
().
equals
(
analysisType
))
{
}
else
if
(
WarningPeriodEnum
.
MINUTES
.
getName
().
equals
(
analysisType
))
{
//
dateInfoBy15 = idxBizFanHealthIndexMapper.getMomentInfo(startTime, endTime);
//
dateInfoBy15 = idxBizFanHealthIndexMapper.getMomentInfo(startTime, endTime);
dateList
=
TimeRangeUtil
.
getMomentInfo
(
startTime
,
endTime
);
dateList
=
TimeRangeUtil
.
getMomentInfo
(
startTime
,
endTime
);
}
}
}
else
{
}
else
{
//dateInfoBy15 = idxBizFanHealthIndexMapper.getDateInfoBy15();
dateList
=
TimeRangeUtil
.
getDateInfoBy15
();
dateList
=
TimeRangeUtil
.
getDateInfoBy15
();
}
}
List
<
String
>
valueList
=
new
ArrayList
<>();
List
<
String
>
valueList
=
new
ArrayList
<>();
String
finalStationCode
=
stationCode
;
String
finalStationCode
=
stationCode
;
// List<String> dateList = dateInfoBy15.stream().map(i -> i.get("date")).collect(Collectors.toList());
// List<String> dateList = dateInfoBy15.stream().map(i ->
// i.get("date")).collect(Collectors.toList());
String
finalAreaCode
=
areaCode
;
String
finalAreaCode
=
areaCode
;
if
((
WarningPeriodEnum
.
DAY
.
getName
().
equals
(
analysisType
)))
{
if
((
WarningPeriodEnum
.
DAY
.
getName
().
equals
(
analysisType
)))
{
List
<
String
>
fullDateList
=
dateList
.
stream
().
map
(
s
->
{
List
<
String
>
fullDateList
=
dateList
.
stream
().
map
(
s
->
{
...
@@ -202,8 +237,7 @@ public class TDBigScreenAnalyseController extends BaseController {
...
@@ -202,8 +237,7 @@ public class TDBigScreenAnalyseController extends BaseController {
Map
<
String
,
Object
>
map
=
healthListInfo
.
stream
().
collect
(
Collectors
Map
<
String
,
Object
>
map
=
healthListInfo
.
stream
().
collect
(
Collectors
.
toMap
(
i
->
String
.
valueOf
(
i
.
get
(
"recdate"
)),
i
->
i
.
get
(
"healthindex"
),
(
key1
,
key2
)
->
key2
));
.
toMap
(
i
->
String
.
valueOf
(
i
.
get
(
"recdate"
)),
i
->
i
.
get
(
"healthindex"
),
(
key1
,
key2
)
->
key2
));
for
(
String
date
:
dateList
)
{
for
(
String
date
:
dateList
)
{
String
value
=
map
.
get
(
date
)
!=
null
?
String
.
valueOf
(
map
.
get
(
date
))
String
value
=
map
.
get
(
date
)
!=
null
?
String
.
valueOf
(
map
.
get
(
date
))
:
"100"
;
:
"100"
;
valueList
.
add
(
String
.
valueOf
(
Math
.
round
(
Double
.
valueOf
(
value
)
*
10.0
)
/
10.0
));
valueList
.
add
(
String
.
valueOf
(
Math
.
round
(
Double
.
valueOf
(
value
)
*
10.0
)
/
10.0
));
}
}
}
else
if
(
WarningPeriodEnum
.
HOUR
.
getName
().
equals
(
analysisType
))
{
}
else
if
(
WarningPeriodEnum
.
HOUR
.
getName
().
equals
(
analysisType
))
{
...
@@ -364,8 +398,8 @@ public class TDBigScreenAnalyseController extends BaseController {
...
@@ -364,8 +398,8 @@ public class TDBigScreenAnalyseController extends BaseController {
}
}
Integer
count
=
fanWaringRecordMapper
.
getEquipWarningInfoByPageCount
(
arae
,
station
,
stationType
,
warningName
,
Integer
count
=
fanWaringRecordMapper
.
getEquipWarningInfoByPageCount
(
arae
,
station
,
stationType
,
warningName
,
stationId
,
startDate
,
endDate
);
stationId
,
startDate
,
endDate
);
//
前端存在分页bug 此处限制分页后筛选导致页面超出问题
//
前端存在分页bug 此处限制分页后筛选导致页面超出问题
if
(
count
>
0
&&
current
>
(
count
/
10
+
1
))
{
if
(
count
>
0
&&
current
>
(
count
/
10
+
1
))
{
current
=
1
;
current
=
1
;
}
}
// List<IdxBizFanWarningRecord> idxBizFanWarningRecordIPage =
// List<IdxBizFanWarningRecord> idxBizFanWarningRecordIPage =
...
@@ -850,12 +884,12 @@ public class TDBigScreenAnalyseController extends BaseController {
...
@@ -850,12 +884,12 @@ public class TDBigScreenAnalyseController extends BaseController {
StationBasic
stationBasic
=
stationBasicMapper
.
selectById
(
stationId
);
StationBasic
stationBasic
=
stationBasicMapper
.
selectById
(
stationId
);
String
nameByIndexAddress
=
idxBizFanHealthIndexMapper
.
getPointNameByIndexAddress
(
indexAddress
,
tableName
,
String
nameByIndexAddress
=
idxBizFanHealthIndexMapper
.
getPointNameByIndexAddress
(
indexAddress
,
tableName
,
stationBasic
.
getFanGatewayId
());
stationBasic
.
getFanGatewayId
());
int
num
=
0
;
int
num
=
0
;
if
(
StringUtils
.
isNotEmpty
(
tableName2
)){
if
(
StringUtils
.
isNotEmpty
(
tableName2
))
{
num
=
idxBizFanHealthIndexMapper
.
getIsWarningByPointId
(
indexAddress
,
stationBasic
.
getFanGatewayId
(),
tableName2
);
num
=
idxBizFanHealthIndexMapper
.
getIsWarningByPointId
(
indexAddress
,
stationBasic
.
getFanGatewayId
(),
tableName2
);
}
}
HashMap
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
HashMap
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
resultMap
.
put
(
"text"
,
nameByIndexAddress
);
resultMap
.
put
(
"text"
,
nameByIndexAddress
);
resultMap
.
put
(
"warningNum"
,
num
);
resultMap
.
put
(
"warningNum"
,
num
);
...
@@ -1576,16 +1610,15 @@ public class TDBigScreenAnalyseController extends BaseController {
...
@@ -1576,16 +1610,15 @@ public class TDBigScreenAnalyseController extends BaseController {
ArrayList
<
FanWarningRecord
>
newList
=
new
ArrayList
<>();
ArrayList
<
FanWarningRecord
>
newList
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
list
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
list
.
size
();
i
++)
{
//
分批次处理
//
分批次处理
newList
.
add
(
list
.
get
(
i
));
//
循环将数据填入载体list
newList
.
add
(
list
.
get
(
i
));
//
循环将数据填入载体list
if
(
500
==
newList
.
size
()
||
i
==
list
.
size
()
-
1
)
{
//
载体list达到要求,进行批量操作
if
(
500
==
newList
.
size
()
||
i
==
list
.
size
()
-
1
)
{
//
载体list达到要求,进行批量操作
//
调用批量插入
//
调用批量插入
fanWaringRecordMapper
.
saveBatchWarningRecords
(
newList
);
fanWaringRecordMapper
.
saveBatchWarningRecords
(
newList
);
newList
.
clear
();
//
每次批量操作后,清空载体list,等待下次的数据填入
newList
.
clear
();
//
每次批量操作后,清空载体list,等待下次的数据填入
}
}
}
}
List
<
PvWarningRecord
>
list2
=
pvWaringRecordMapper
.
selectList
(
null
);
List
<
PvWarningRecord
>
list2
=
pvWaringRecordMapper
.
selectList
(
null
);
list2
.
forEach
(
item
->
{
list2
.
forEach
(
item
->
{
if
(
"未处置"
.
equals
(
item
.
getDisposotionState
()))
{
if
(
"未处置"
.
equals
(
item
.
getDisposotionState
()))
{
...
@@ -1597,12 +1630,12 @@ public class TDBigScreenAnalyseController extends BaseController {
...
@@ -1597,12 +1630,12 @@ public class TDBigScreenAnalyseController extends BaseController {
ArrayList
<
PvWarningRecord
>
newList2
=
new
ArrayList
<>();
ArrayList
<
PvWarningRecord
>
newList2
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
list2
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
list2
.
size
();
i
++)
{
//
分批次处理
//
分批次处理
newList2
.
add
(
list2
.
get
(
i
));
//
循环将数据填入载体list
newList2
.
add
(
list2
.
get
(
i
));
//
循环将数据填入载体list
if
(
500
==
newList2
.
size
()
||
i
==
list2
.
size
()
-
1
)
{
//
载体list达到要求,进行批量操作
if
(
500
==
newList2
.
size
()
||
i
==
list2
.
size
()
-
1
)
{
//
载体list达到要求,进行批量操作
//
调用批量插入
//
调用批量插入
pvWaringRecordMapper
.
saveBatchWarningRecords
(
newList2
);
pvWaringRecordMapper
.
saveBatchWarningRecords
(
newList2
);
newList2
.
clear
();
//
每次批量操作后,清空载体list,等待下次的数据填入
newList2
.
clear
();
//
每次批量操作后,清空载体list,等待下次的数据填入
}
}
}
}
...
...
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