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
e2c97f30
Commit
e2c97f30
authored
Aug 09, 2024
by
hezhuozhi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交大屏监控风机级别默认值
parent
2b30d5fd
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
165 additions
and
69 deletions
+165
-69
TDBigScreenAnalyseController.java
...le/jxiop/biz/controller/TDBigScreenAnalyseController.java
+132
-69
StationInfoDto.java
...eejoin/amos/boot/module/jxiop/api/dto/StationInfoDto.java
+6
-0
StationBasicMapper.java
...amos/boot/module/jxiop/api/mapper/StationBasicMapper.java
+1
-0
StationBasicMapper.xml
...xiop-api/src/main/resources/mapper/StationBasicMapper.xml
+8
-0
StationBasicServiceImpl.java
...odule/jxiop/biz/service/impl/StationBasicServiceImpl.java
+18
-0
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 @
e2c97f30
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
biz
.
controller
;
import
static
com
.
yeejoin
.
amos
.
boot
.
biz
.
common
.
utils
.
DateUtils
.
DATE_TIME_PATTERN
;
import
java.sql.Timestamp
;
import
java.text.DecimalFormat
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
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.function.Function
;
import
java.util.stream.Collectors
;
import
java.util.stream.Stream
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PutMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.hutool.core.text.CharSequenceUtil
;
import
cn.hutool.core.util.StrUtil
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
...
...
@@ -43,36 +12,21 @@ 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.utils.DateUtils
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.boot.module.jxiop.api.dto.StationBasicDto
;
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.mapper.StationBasicMapper
;
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.FullViewRecallInfoDTO
;
import
com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizFanHealthIndexLatest
;
import
com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizFanHealthLevel
;
import
com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizFanWarningRuleSet
;
import
com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizPvHealthIndexLatest
;
import
com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizPvHealthLevel
;
import
com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizPvWarningRuleSet
;
import
com.yeejoin.amos.boot.module.jxiop.biz.entity.IndicatorData
;
import
com.yeejoin.amos.boot.module.jxiop.biz.mapper2.IdxBizFanHealthIndexLatestMapper
;
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.IdxBizFanWarningRecordMapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.mapper2.IdxBizPvHealthIndexLatestMapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.mapper2.IdxBizPvHealthIndexMapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.mapper2.IdxBizPvHealthLevelMapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.entity.*
;
import
com.yeejoin.amos.boot.module.jxiop.biz.mapper2.*
;
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.IdxBizFanWarningRuleSetServiceImpl
;
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.PvHealthIndexDayMapper
;
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.*
;
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
;
...
...
@@ -82,16 +36,37 @@ import com.yeejoin.amos.boot.module.jxiop.biz.utils.TimeRangeUtil;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
com.yeejoin.amos.feign.privilege.model.CompanyModel
;
import
cn.hutool.core.text.CharSequenceUtil
;
import
cn.hutool.core.util.StrUtil
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.ApplicationArguments
;
import
org.springframework.boot.ApplicationRunner
;
import
org.springframework.web.bind.annotation.*
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
java.sql.Timestamp
;
import
java.text.DecimalFormat
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.util.*
;
import
java.util.function.Function
;
import
java.util.stream.Collectors
;
import
java.util.stream.Stream
;
import
static
com
.
yeejoin
.
amos
.
boot
.
biz
.
common
.
utils
.
DateUtils
.
DATE_TIME_PATTERN
;
@RestController
@Api
(
tags
=
"智能分析 - 大屏API"
)
@RequestMapping
(
value
=
"/bigScreenAnalyse"
)
public
class
TDBigScreenAnalyseController
extends
BaseController
{
public
class
TDBigScreenAnalyseController
extends
BaseController
implements
ApplicationRunner
{
public
final
DecimalFormat
df
=
new
DecimalFormat
(
"0.0"
);
@Autowired
...
...
@@ -134,7 +109,8 @@ public class TDBigScreenAnalyseController extends BaseController {
private
IdxBizPvWarningRuleSetServiceImpl
idxBizPvWarningRuleSetService
;
@Autowired
private
PvHealthIndexDayMapper
pvHealthIndexDayMapper
;
@Autowired
private
RedisUtils
redisUtils
;
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"场站设备健康状态指数与趋势 - 仪表盘"
,
notes
=
"场站设备健康状态指数与趋势 - 仪表盘"
)
@GetMapping
(
value
=
"/getHealthScoreInfo"
)
...
...
@@ -552,13 +528,13 @@ public class TDBigScreenAnalyseController extends BaseController {
// pvWrapper.eq(PvHealthIndex::getAnalysisTime, pvHealthIndex.getAnalysisTime());
// pvWrapper.last("limit 10");
// List<PvHealthIndex> pvHealthIndexList = pvHealthIndexMapper.selectList(pvWrapper);
LambdaQueryWrapper
<
IdxBizFanHealthIndexLatest
>
wrapperl
=
new
LambdaQueryWrapper
<
IdxBizFanHealthIndexLatest
>();
wrapperl
.
eq
(
IdxBizFanHealthIndexLatest:
:
getAnalysisType
,
"按10分钟"
);
wrapperl
.
eq
(
IdxBizFanHealthIndexLatest:
:
getAnalysisObjType
,
"场站"
);
wrapperl
.
eq
(
IdxBizFanHealthIndexLatest:
:
getArae
,
areaCode
+
"区域"
);
List
<
IdxBizFanHealthIndexLatest
>
fanHealthIndexList
=
idxBizFanHealthIndexLatestMapper
.
selectList
(
wrapperl
);
LambdaQueryWrapper
<
IdxBizPvHealthIndexLatest
>
wrapperp
=
new
LambdaQueryWrapper
<
IdxBizPvHealthIndexLatest
>();
wrapperp
.
eq
(
IdxBizPvHealthIndexLatest:
:
getAnalysisType
,
"按10分钟"
);
wrapperp
.
eq
(
IdxBizPvHealthIndexLatest:
:
getAnalysisObjType
,
"场站"
);
...
...
@@ -785,6 +761,10 @@ public class TDBigScreenAnalyseController extends BaseController {
@GetMapping
(
"/getFanInfoByPage"
)
public
ResponseModel
<
Page
<
Map
<
String
,
Object
>>>
getFanInfoByPage
(
@RequestParam
(
value
=
"stationId"
,
required
=
false
)
String
stationId
)
{
return
ResponseHelper
.
buildResponse
(
fanInfoByPage
(
stationId
));
}
private
Page
<
Map
<
String
,
Object
>>
fanInfoByPage
(
String
stationId
)
{
StationBasic
stationBasic
=
stationBasicMapper
.
selectById
(
stationId
);
List
<
Map
<
String
,
Object
>>
equipmentList
=
idxBizFanHealthIndexMapper
.
getFanInfoByPage
(
stationBasic
.
getFanGatewayId
());
...
...
@@ -827,7 +807,7 @@ public class TDBigScreenAnalyseController extends BaseController {
mapPage
.
setTotal
(
equipmentList
.
size
());
mapPage
.
setCurrent
(
1
);
mapPage
.
setRecords
(
equipmentList
);
return
ResponseHelper
.
buildResponse
(
mapPage
)
;
return
mapPage
;
}
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
...
...
@@ -836,7 +816,10 @@ public class TDBigScreenAnalyseController extends BaseController {
public
ResponseModel
<
Map
<
String
,
Object
>>
getSubSystemInfo
(
@RequestParam
(
value
=
"equipmentName"
,
required
=
false
)
String
equipmentName
,
@RequestParam
(
value
=
"stationId"
,
required
=
false
)
String
stationId
)
{
return
ResponseHelper
.
buildResponse
(
subSystemInfo
(
equipmentName
,
stationId
));
}
private
Map
<
String
,
Object
>
subSystemInfo
(
String
equipmentName
,
String
stationId
)
{
StationBasic
stationBasic
=
stationBasicMapper
.
selectById
(
stationId
);
Map
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
List
<
Map
<
String
,
Object
>>
healthListInfo
=
idxBizFanHealthIndexMapper
.
getSubSystemInfo
(
equipmentName
,
...
...
@@ -856,7 +839,7 @@ public class TDBigScreenAnalyseController extends BaseController {
});
resultMap
.
put
(
"axisData"
,
axisData
);
resultMap
.
put
(
"seriesData"
,
seriesData
);
return
ResponseHelper
.
buildResponse
(
resultMap
)
;
return
resultMap
;
}
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
...
...
@@ -866,7 +849,10 @@ public class TDBigScreenAnalyseController extends BaseController {
@RequestParam
(
value
=
"subSystem"
,
required
=
false
)
String
subSystem
,
@RequestParam
(
value
=
"stationId"
,
required
=
false
)
String
stationId
,
@RequestParam
(
value
=
"equipmentName"
,
required
=
false
)
String
equipmentName
)
{
return
ResponseHelper
.
buildResponse
(
subSystemPointInfo
(
subSystem
,
stationId
,
equipmentName
));
}
private
Page
<
Map
<
String
,
Object
>>
subSystemPointInfo
(
String
subSystem
,
String
stationId
,
String
equipmentName
)
{
StationBasic
stationBasic
=
stationBasicMapper
.
selectById
(
stationId
);
equipmentName
=
StrUtil
.
isNotEmpty
(
equipmentName
)
?
"%"
+
equipmentName
+
"风机%"
:
equipmentName
;
List
<
Map
<
String
,
Object
>>
healthListInfo
=
idxBizFanHealthIndexMapper
.
getHealthInfoBySubSystem
(
subSystem
,
...
...
@@ -918,7 +904,7 @@ public class TDBigScreenAnalyseController extends BaseController {
mapPage
.
setTotal
(
pointNameList
.
size
());
mapPage
.
setCurrent
(
1
);
mapPage
.
setRecords
(
pointNameList
);
return
ResponseHelper
.
buildResponse
(
mapPage
)
;
return
mapPage
;
}
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
...
...
@@ -926,6 +912,11 @@ public class TDBigScreenAnalyseController extends BaseController {
@GetMapping
(
"/getPvInfoByPage"
)
public
ResponseModel
<
Page
<
Map
<
String
,
Object
>>>
getPvInfoByPage
(
@RequestParam
(
value
=
"stationId"
,
required
=
false
)
String
stationId
)
{
return
ResponseHelper
.
buildResponse
(
pvInfoByPage
(
stationId
));
}
private
Page
<
Map
<
String
,
Object
>>
pvInfoByPage
(
String
stationId
)
{
StationBasic
stationBasic
=
stationBasicMapper
.
selectById
(
stationId
);
List
<
Map
<
String
,
Object
>>
equipmentList
=
idxBizFanHealthIndexMapper
.
getPvInfoByPage
(
stationBasic
.
getFanGatewayId
());
...
...
@@ -958,7 +949,7 @@ public class TDBigScreenAnalyseController extends BaseController {
mapPage
.
setTotal
(
equipmentList
.
size
());
mapPage
.
setCurrent
(
1
);
mapPage
.
setRecords
(
equipmentList
);
return
ResponseHelper
.
buildResponse
(
mapPage
)
;
return
mapPage
;
}
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
...
...
@@ -968,6 +959,10 @@ public class TDBigScreenAnalyseController extends BaseController {
@RequestParam
(
value
=
"subarray"
,
required
=
false
)
String
subarray
,
@RequestParam
(
value
=
"stationId"
,
required
=
false
)
String
stationId
)
{
return
ResponseHelper
.
buildResponse
(
pvSubSystemInfo
(
subarray
,
stationId
));
}
private
Map
<
String
,
Object
>
pvSubSystemInfo
(
String
subarray
,
String
stationId
)
{
StationBasic
stationBasic
=
stationBasicMapper
.
selectById
(
stationId
);
Map
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
List
<
Map
<
String
,
Object
>>
healthListInfo
=
idxBizFanHealthIndexMapper
.
getPvSubSystemInfo
(
subarray
,
...
...
@@ -987,7 +982,7 @@ public class TDBigScreenAnalyseController extends BaseController {
});
resultMap
.
put
(
"axisData"
,
axisData
);
resultMap
.
put
(
"seriesData"
,
seriesData
);
return
ResponseHelper
.
buildResponse
(
resultMap
)
;
return
resultMap
;
}
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
...
...
@@ -996,7 +991,10 @@ public class TDBigScreenAnalyseController extends BaseController {
public
ResponseModel
<
Page
<
Map
<
String
,
Object
>>>
getPvSubSystemPointInfo
(
@RequestParam
(
value
=
"equipmentName"
,
required
=
false
)
String
equipmentName
,
@RequestParam
(
value
=
"stationId"
,
required
=
false
)
String
stationId
)
{
return
ResponseHelper
.
buildResponse
(
pvSubSystemPointInfo
(
equipmentName
,
stationId
));
}
private
Page
<
Map
<
String
,
Object
>>
pvSubSystemPointInfo
(
String
equipmentName
,
String
stationId
)
{
StationBasic
stationBasic
=
stationBasicMapper
.
selectById
(
stationId
);
List
<
Map
<
String
,
Object
>>
healthListInfo
=
idxBizFanHealthIndexMapper
.
getPvHealthInfoBySubSystem
(
equipmentName
,
stationBasic
.
getFanGatewayId
());
...
...
@@ -1044,7 +1042,7 @@ public class TDBigScreenAnalyseController extends BaseController {
mapPage
.
setTotal
(
pointNameList
.
size
());
mapPage
.
setCurrent
(
1
);
mapPage
.
setRecords
(
pointNameList
);
return
ResponseHelper
.
buildResponse
(
mapPage
)
;
return
mapPage
;
}
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
...
...
@@ -1862,4 +1860,69 @@ public class TDBigScreenAnalyseController extends BaseController {
return
permissions
;
}
@Override
public
void
run
(
ApplicationArguments
args
)
throws
Exception
{
initStationFirstSelect
();
}
/**
* 初始化场站第一个选中
*/
private
void
initStationFirstSelect
()
{
List
<
StationBasicDto
>
stationBasicDtos
=
stationBasicMapper
.
getStationBasicList
();
if
(
CollectionUtil
.
isNotEmpty
(
stationBasicDtos
)){
JSONArray
resultArray
=
new
JSONArray
();
for
(
StationBasicDto
stationBasicDto
:
stationBasicDtos
)
{
JSONObject
jsonObject
=
new
JSONObject
();
Long
stationBasicId
=
stationBasicDto
.
getSequenceNbr
();
jsonObject
.
put
(
"stationBasicId"
,
stationBasicId
);
//此处获取大屏场站的状态3个图的第一个值 场站、子系统状态指数、子系统各变量健康状态指数
if
(
"FDZ"
.
equals
(
stationBasicDto
.
getStationType
())){
Page
<
Map
<
String
,
Object
>>
fanInfoByPage
=
fanInfoByPage
(
String
.
valueOf
(
stationBasicId
));
List
<
Map
<
String
,
Object
>>
records
=
fanInfoByPage
.
getRecords
();
if
(
CollectionUtil
.
isNotEmpty
(
records
)){
Map
<
String
,
Object
>
fanInfoMap
=
records
.
get
(
0
);
String
equipmentNameSimple
=
(
String
)
fanInfoMap
.
get
(
"equipmentNameSimple"
);
jsonObject
.
put
(
"equipmentNameDefault"
,
equipmentNameSimple
);
Map
<
String
,
Object
>
subSystemInfo
=
subSystemInfo
(
equipmentNameSimple
,
String
.
valueOf
(
stationBasicId
));
List
axisData
=
(
List
)
subSystemInfo
.
get
(
"axisData"
);
if
(
CollectionUtil
.
isNotEmpty
(
axisData
)){
String
subSystemDefault
=
(
String
)
axisData
.
get
(
0
);
jsonObject
.
put
(
"subSystemDefault"
,
subSystemDefault
);
Page
<
Map
<
String
,
Object
>>
subSystemPointInfo
=
subSystemPointInfo
(
subSystemDefault
,
String
.
valueOf
(
stationBasicId
),
equipmentNameSimple
);
List
<
Map
<
String
,
Object
>>
subSystemPointInfoList
=
subSystemPointInfo
.
getRecords
();
if
(
CollectionUtil
.
isNotEmpty
(
subSystemPointInfoList
)){
Map
<
String
,
Object
>
stringObjectMap
=
subSystemPointInfoList
.
get
(
0
);
String
indexAddressDefault
=
(
String
)
stringObjectMap
.
get
(
"indexAddress"
);
jsonObject
.
put
(
"indexAddressDefault"
,
indexAddressDefault
);
}
}
}
}
else
{
Page
<
Map
<
String
,
Object
>>
pvInfoByPage
=
pvInfoByPage
(
String
.
valueOf
(
stationBasicId
));
List
<
Map
<
String
,
Object
>>
records
=
pvInfoByPage
.
getRecords
();
if
(
CollectionUtil
.
isNotEmpty
(
records
)){
Map
<
String
,
Object
>
pvInfoMap
=
records
.
get
(
0
);
String
subarray
=
(
String
)
pvInfoMap
.
get
(
"subarray"
);
jsonObject
.
put
(
"equipmentNameDefault"
,
subarray
);
Map
<
String
,
Object
>
subSystemInfo
=
pvSubSystemInfo
(
subarray
,
String
.
valueOf
(
stationBasicId
));
List
axisData
=
(
List
)
subSystemInfo
.
get
(
"axisData"
);
if
(
CollectionUtil
.
isNotEmpty
(
axisData
)){
String
subSystemDefault
=
(
String
)
axisData
.
get
(
0
);
jsonObject
.
put
(
"subSystemDefault"
,
subSystemDefault
);
Page
<
Map
<
String
,
Object
>>
subSystemPointInfo
=
pvSubSystemPointInfo
(
subSystemDefault
,
String
.
valueOf
(
stationBasicId
));
List
<
Map
<
String
,
Object
>>
subSystemPointInfoList
=
subSystemPointInfo
.
getRecords
();
if
(
CollectionUtil
.
isNotEmpty
(
subSystemPointInfoList
)){
Map
<
String
,
Object
>
stringObjectMap
=
subSystemPointInfoList
.
get
(
0
);
String
indexAddressDefault
=
(
String
)
stringObjectMap
.
get
(
"indexAddress"
);
jsonObject
.
put
(
"indexAddressDefault"
,
indexAddressDefault
);
}
}
}
}
resultArray
.
add
(
jsonObject
);
}
redisUtils
.
set
(
"STATION_FIRST_SELECT"
,
resultArray
);
}
}
}
amos-boot-system-jxiop/amos-boot-module-jxiop-api/src/main/java/com/yeejoin/amos/boot/module/jxiop/api/dto/StationInfoDto.java
View file @
e2c97f30
...
...
@@ -56,4 +56,10 @@ public class StationInfoDto {
@ApiModelProperty
(
value
=
"风险等级"
)
private
String
riskLevel
;
@ApiModelProperty
(
value
=
"系统名称默认值"
)
private
String
equipmentNameDefault
;
@ApiModelProperty
(
value
=
"设备状态默认值"
)
private
String
subSystemDefault
;
@ApiModelProperty
(
value
=
"变量状态默认值"
)
private
String
indexAddressDefault
;
}
amos-boot-system-jxiop/amos-boot-module-jxiop-api/src/main/java/com/yeejoin/amos/boot/module/jxiop/api/mapper/StationBasicMapper.java
View file @
e2c97f30
...
...
@@ -72,5 +72,6 @@ public interface StationBasicMapper extends BaseMapper<StationBasic> {
StationBasicDto
getStationInfoByCode
(
@Param
(
"stationCode"
)
String
stationCode
);
List
<
StationBasicDto
>
getStationsByAreaCode
(
@Param
(
"areaCode"
)
String
stationCode
);
List
<
StationBasicDto
>
getStationBasicList
();
}
amos-boot-system-jxiop/amos-boot-module-jxiop-api/src/main/resources/mapper/StationBasicMapper.xml
View file @
e2c97f30
...
...
@@ -213,4 +213,12 @@
is_delete = 0
ORDER BY sequence_nbr ASC
</select>
<select
id=
"getStationBasicList"
resultType=
"com.yeejoin.amos.boot.module.jxiop.api.dto.StationBasicDto"
>
SELECT
sequence_nbr AS sequenceNbr,
station_type stationType
FROM
station_basic
</select>
</mapper>
amos-boot-system-jxiop/amos-boot-module-jxiop-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/StationBasicServiceImpl.java
View file @
e2c97f30
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
biz
.
service
.
impl
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.boot.module.jxiop.api.dto.StationCoordinateDto
;
import
com.yeejoin.amos.boot.module.jxiop.api.dto.StationInfoDto
;
import
com.yeejoin.amos.boot.module.jxiop.api.dto.StationRecordInfo
;
...
...
@@ -63,6 +65,8 @@ public class StationBasicServiceImpl extends BaseService<StationBasicDto, Statio
@Autowired
MapRegionServiceImpl
mapRegionServiceImpl
;
private
final
String
CZLX
=
"CZLX"
;
@Autowired
private
RedisUtils
redisUtils
;
/**
* 分页查询
...
...
@@ -279,6 +283,7 @@ public class StationBasicServiceImpl extends BaseService<StationBasicDto, Statio
}
public
List
<
StationInfoDto
>
getStationList
(
String
areaCode
,
String
type
)
{
JSONArray
stationSelectDefault
=(
JSONArray
)
redisUtils
.
get
(
"STATION_FIRST_SELECT"
);
// 场站信息列表 地图接口返回使用
List
<
StationInfoDto
>
stationInfoDtoList
=
new
LinkedList
<>();
//场站信息列表
...
...
@@ -338,6 +343,19 @@ public class StationBasicServiceImpl extends BaseService<StationBasicDto, Statio
stationInfoDto
.
setTitlePos
(
doubleList
);
stationInfoDto
.
setIndicatorData
(
indicatorList
);
stationInfoDto
.
setRiskLevel
(
stationRecordInfo
.
getRiskLevel
());
//添加默认场站选中的值
if
(!
CollectionUtils
.
isEmpty
(
stationSelectDefault
)){
for
(
Object
o
:
stationSelectDefault
)
{
if
(
o
instanceof
JSONObject
){
JSONObject
jsonObject
=(
JSONObject
)
o
;
if
(
stationRecordInfo
.
getStationId
().
equals
(
jsonObject
.
getLong
(
"stationBasicId"
))){
stationInfoDto
.
setEquipmentNameDefault
(
jsonObject
.
getString
(
"equipmentNameDefault"
));
stationInfoDto
.
setSubSystemDefault
(
jsonObject
.
getString
(
"subSystemDefault"
));
stationInfoDto
.
setIndexAddressDefault
(
jsonObject
.
getString
(
"indexAddressDefault"
));
}
}
}
}
stationInfoDtoList
.
add
(
stationInfoDto
);
});
...
...
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