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
288fc5a9
Commit
288fc5a9
authored
Sep 18, 2023
by
tangwei
Browse files
Options
Browse Files
Download
Plain Diff
解决冲突
parents
18e2fd0f
c56be71a
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
119 additions
and
18 deletions
+119
-18
CommonConstans.java
.../amos/boot/module/jxiop/biz/constants/CommonConstans.java
+3
-0
MonitorFanIdxController.java
.../module/jxiop/biz/controller/MonitorFanIdxController.java
+16
-12
ESEquipmentsDTO.java
...ejoin/amos/boot/module/jxiop/biz/dto/ESEquipmentsDTO.java
+29
-0
TemporaryDataMapper.java
...os/boot/module/jxiop/biz/mapper2/TemporaryDataMapper.java
+4
-1
CommonServiceImpl.java
...boot/module/jxiop/biz/service/impl/CommonServiceImpl.java
+44
-4
MonitorFanIndicatorImpl.java
...odule/jxiop/biz/service/impl/MonitorFanIndicatorImpl.java
+0
-0
MonitoringServiceIMQTTmpl.java
...ule/jxiop/biz/service/impl/MonitoringServiceIMQTTmpl.java
+2
-1
TemporaryDataMapper.xml
...src/main/resources/mapper/cluster/TemporaryDataMapper.xml
+21
-0
No files found.
amos-boot-system-jxiop/amos-boot-module-jxiop-monitor-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/constants/CommonConstans.java
View file @
288fc5a9
...
...
@@ -90,6 +90,9 @@ public class CommonConstans {
public
static
final
String
QueryStringEquipmentNumberKeyword
=
"equipmentNumber.keyword"
;
public
static
final
String
QueryStringValue
=
"value"
;
public
static
final
String
QueryStringValueKeyword
=
"value.keyword"
;
public
static
final
String
QueryStringValueLabel
=
"valueLabel"
;
public
static
final
String
QueryStringValueLabelKeyword
=
"valueLabel.keyword"
;
public
static
final
String
QueryStringDataType
=
"dataType"
;
public
static
final
String
QueryStringDisplayName
=
"displayName"
;
public
static
final
String
QueryStringDisplayNameKeyword
=
"displayName.keyword"
;
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-monitor-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/controller/MonitorFanIdxController.java
View file @
288fc5a9
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
biz
.
controller
;
import
cn.hutool.core.util.StrUtil
;
import
cn.hutool.extra.pinyin.PinyinUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
...
...
@@ -16,6 +17,7 @@ import com.yeejoin.amos.boot.module.jxiop.api.mapper.StationBasicMapper;
import
com.yeejoin.amos.boot.module.jxiop.biz.ESDto.ESEquipments
;
import
com.yeejoin.amos.boot.module.jxiop.biz.constants.CommonConstans
;
import
com.yeejoin.amos.boot.module.jxiop.biz.dto.DeaviationRateDto
;
import
com.yeejoin.amos.boot.module.jxiop.biz.dto.ESEquipmentsDTO
;
import
com.yeejoin.amos.boot.module.jxiop.biz.dto.ResultsData
;
import
com.yeejoin.amos.boot.module.jxiop.biz.service.impl.CommonServiceImpl
;
import
com.yeejoin.amos.boot.module.jxiop.biz.service.impl.EquipAlarmEventServiceImpl
;
...
...
@@ -99,12 +101,13 @@ public class MonitorFanIdxController extends BaseController {
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"风机布置图 - 风机状态列表"
)
@GetMapping
(
"/getFanStatusList"
)
public
ResponseModel
<
IPage
<
ESEquipments
>>
getFanStatusList
(
@RequestParam
(
value
=
"stationId"
,
required
=
false
)
String
stationId
,
public
ResponseModel
<
IPage
<
ESEquipments
DTO
>>
getFanStatusList
(
@RequestParam
(
value
=
"stationId"
,
required
=
false
)
String
stationId
,
@RequestParam
(
value
=
"current"
,
required
=
false
)
int
current
,
@RequestParam
(
value
=
"size"
,
required
=
false
)
int
size
)
{
List
<
ESEquipments
>
fanStatusList
=
monitorFanIndicator
.
getFanStatusList
(
stationId
);
Page
<
ESEquipments
>
page
=
new
Page
<>(
current
,
size
);
List
<
ESEquipments
>
collect
=
fanStatusList
.
stream
()
List
<
ESEquipmentsDTO
>
fanStatusList
=
monitorFanIndicator
.
getFanStatusList
(
stationId
);
Page
<
ESEquipmentsDTO
>
page
=
new
Page
<>(
current
,
size
);
List
<
ESEquipmentsDTO
>
collect
=
fanStatusList
.
stream
()
.
sorted
(
Comparator
.
comparing
(
t
->
Integer
.
parseInt
(
t
.
getEquipmentNumber
())))
.
skip
((
long
)
(
current
-
1
)
*
size
)
.
limit
(
size
)
.
collect
(
Collectors
.
toList
());
...
...
@@ -117,17 +120,17 @@ public class MonitorFanIdxController extends BaseController {
@ApiOperation
(
value
=
"风机布置图 - 风机状态图片"
)
@GetMapping
(
"/getFanStatusListImage"
)
public
ResponseModel
<
IPage
<
HashMap
<
String
,
String
>>>
getFanStatusListImages
(
@RequestParam
(
value
=
"stationId"
,
required
=
false
)
String
stationId
){
List
<
ESEquipments
>
fanStatusList
=
monitorFanIndicator
.
getFanStatusList
(
stationId
);
List
<
ESEquipments
>
collect
=
fanStatusList
.
stream
()
List
<
ESEquipments
DTO
>
fanStatusList
=
monitorFanIndicator
.
getFanStatusList
(
stationId
);
List
<
ESEquipments
DTO
>
collect
=
fanStatusList
.
stream
()
.
limit
(
999
)
.
collect
(
Collectors
.
toList
());
IPage
<
HashMap
<
String
,
String
>>
page
=
new
Page
<>();
HashMap
<
String
,
String
>
hashMap
=
new
HashMap
<>();
List
<
ESEquipments
>
indexDtoList
=
collect
.
stream
().
sorted
(
Comparator
.
comparing
(
ESEquipments
:
:
getEquipmentNumber
)).
collect
(
Collectors
.
toList
());
List
<
ESEquipments
DTO
>
indexDtoList
=
collect
.
stream
().
sorted
(
Comparator
.
comparing
(
ESEquipmentsDTO
:
:
getEquipmentNumber
)).
collect
(
Collectors
.
toList
());
//获取拼音首字母
String
prefix
=
commonService
.
getFanDevicePrefix
(
stationId
);
for
(
int
i
=
1
;
i
<=
indexDtoList
.
size
();
i
++)
{
ESEquipments
ESEquipments
=
indexDtoList
.
get
(
i
-
1
);
ESEquipments
DTO
ESEquipments
=
indexDtoList
.
get
(
i
-
1
);
hashMap
.
put
(
"url"
+
i
,
fanStatusImagePathPrefix
+
"/"
+
"风机-"
+
ESEquipments
.
getAddress
()+
".gif"
);
hashMap
.
put
(
"name"
+
i
,
prefix
+
ESEquipments
.
getEquipmentNumber
());
//用于参数传递
...
...
@@ -491,9 +494,10 @@ public class MonitorFanIdxController extends BaseController {
@ApiOperation
(
value
=
"故障记录API"
)
@GetMapping
(
"/alarmEventtList"
)
public
ResponseModel
<
ResultsData
>
getAlarmEventList
(
@RequestParam
(
value
=
"current"
)
int
current
,
@RequestParam
(
value
=
"size"
)
int
size
,
@RequestParam
(
value
=
"stationId"
)
String
stationId
,
@RequestParam
(
value
=
"type"
)
String
type
)
{
@RequestParam
(
value
=
"size"
)
int
size
,
@RequestParam
(
value
=
"stationId"
)
String
stationId
,
@RequestParam
(
value
=
"type"
,
required
=
false
)
String
type
)
{
type
=
StrUtil
.
isEmpty
(
type
)
?
"0"
:
type
;
ResultsData
resultsData
=
new
ResultsData
();
if
(
type
.
equals
(
"0"
)){
resultsData
=
monitorFanIndicatorImpl
.
getAlarmEventList
(
current
,
size
,
stationId
);
...
...
@@ -695,7 +699,7 @@ public class MonitorFanIdxController extends BaseController {
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"详情基础信息"
)
@GetMapping
(
"/getStatisticsInfo"
)
public
ResponseModel
<
Map
<
String
,
String
>>
getStatisticsInfo
(
@RequestParam
(
value
=
"equipmentIndexName"
,
required
=
false
)
String
equipmentIndexName
,
public
ResponseModel
<
Map
<
String
,
Object
>>
getStatisticsInfo
(
@RequestParam
(
value
=
"equipmentIndexName"
,
required
=
false
)
String
equipmentIndexName
,
@RequestParam
(
value
=
"stationId"
,
required
=
false
)
String
stationId
,
@RequestParam
(
value
=
"stationType"
,
required
=
false
)
String
stationType
)
{
// StationBasic stationBasic = stationBasicMapper.selectById(stationId);
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-monitor-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/dto/ESEquipmentsDTO.java
0 → 100644
View file @
288fc5a9
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
biz
.
dto
;
import
lombok.Data
;
import
java.util.Date
;
@Data
public
class
ESEquipmentsDTO
{
private
String
id
;
private
String
address
;
private
String
dataType
;
private
String
equipmentSpecificName
;
private
String
gatewayId
;
private
String
isAlarm
;
private
Date
createdTime
;
private
String
unit
;
private
String
value
;
private
Float
valueDouble
;
private
String
valueLabel
;
private
String
traceId
;
private
String
equipmentIndexName
;
private
String
equipmentNumber
;
private
String
frontModule
;
private
String
systemType
;
private
String
pictureName
;
private
String
displayName
;
private
String
state
;
private
String
color
;
}
amos-boot-system-jxiop/amos-boot-module-jxiop-monitor-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/mapper2/TemporaryDataMapper.java
View file @
288fc5a9
...
...
@@ -12,7 +12,10 @@ import java.util.Map;
public
interface
TemporaryDataMapper
extends
BaseMapper
<
TemporaryData
>
{
List
<
Map
<
String
,
String
>>
timingTemporarysSorageData
(
@RequestParam
(
value
=
"gatewayId"
)
String
gatewayId
);
List
<
Map
<
String
,
Object
>>
timingTemporarysSorageData
(
@RequestParam
(
value
=
"gatewayId"
)
String
gatewayId
);
List
<
Map
<
String
,
Object
>>
timingTemporarysSorageDataByIndexName
(
@RequestParam
(
value
=
"gatewayId"
)
String
gatewayId
,
@RequestParam
(
value
=
"equipmentIndexName"
)
String
equipmentIndexName
);
Map
<
String
,
String
>
getStatisticsInfo
(
@RequestParam
(
value
=
"gatewayId"
)
String
gatewayId
,
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-monitor-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/CommonServiceImpl.java
View file @
288fc5a9
...
...
@@ -18,10 +18,9 @@ import com.yeejoin.amos.boot.module.jxiop.biz.initdata.StationCacheDataInit;
import
com.yeejoin.amos.boot.module.jxiop.biz.mapper2.SjglZsjZsbtzMapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.repository.ESEquipmentsRepository
;
import
com.yeejoin.amos.component.influxdb.InfluxdbUtil
;
import
org.elasticsearch.index.query.BoolQueryBuilder
;
import
org.elasticsearch.index.query.MatchPhraseQueryBuilder
;
import
org.elasticsearch.index.query.QueryBuilders
;
import
org.elasticsearch.index.query.WildcardQueryBuilder
;
import
org.elasticsearch.index.query.*
;
import
org.elasticsearch.script.Script
;
import
org.elasticsearch.script.ScriptType
;
import
org.elasticsearch.search.aggregations.Aggregation
;
import
org.elasticsearch.search.aggregations.AggregationBuilders
;
import
org.elasticsearch.search.aggregations.Aggregations
;
...
...
@@ -598,4 +597,45 @@ public class CommonServiceImpl {
}
return
null
;
}
public
<
T
>
List
<
T
>
getListDataByCondtionsByValueNotEqValueLabel
(
Map
<
String
,
List
<
String
>>
mustQuerCondtion
,
Map
<
String
,
String
>
shouldQuerCondtion
,
Map
<
String
,
String
>
notMustQuerCondtion
,
Class
<
T
>
tClass
)
{
BoolQueryBuilder
queryBuilder
=
QueryBuilders
.
boolQuery
();
if
(!
ObjectUtils
.
isEmpty
(
mustQuerCondtion
))
{
for
(
String
key
:
mustQuerCondtion
.
keySet
())
{
List
<
String
>
va
=
mustQuerCondtion
.
get
(
key
);
queryBuilder
.
must
(
QueryBuilders
.
termsQuery
(
key
,
va
));
}
}
if
(!
ObjectUtils
.
isEmpty
(
shouldQuerCondtion
))
{
for
(
String
key
:
shouldQuerCondtion
.
keySet
())
{
queryBuilder
.
should
(
QueryBuilders
.
wildcardQuery
(
key
,
shouldQuerCondtion
.
get
(
key
)));
}
}
if
(!
ObjectUtils
.
isEmpty
(
notMustQuerCondtion
))
{
for
(
String
key
:
notMustQuerCondtion
.
keySet
())
{
queryBuilder
.
mustNot
(
QueryBuilders
.
termsQuery
(
key
,
notMustQuerCondtion
.
get
(
key
)));
}
}
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"param1"
,
""
);
Script
script
=
new
Script
(
ScriptType
.
INLINE
,
Script
.
DEFAULT_SCRIPT_LANG
,
"doc['value.keyword'].value != doc['valueLabel.keyword'].value + params.param1"
,
params
);
ScriptQueryBuilder
scriptQueryBuilder
=
QueryBuilders
.
scriptQuery
(
script
);
queryBuilder
.
filter
(
scriptQueryBuilder
);
Query
query
=
new
NativeSearchQueryBuilder
()
.
withQuery
(
queryBuilder
)
.
build
();
query
.
setTrackTotalHits
(
true
);
SearchHits
search
=
elasticsearchTemplate
.
search
(
query
,
tClass
);
if
(
search
.
hasSearchHits
())
{
List
<
SearchHit
<
T
>>
searchHitList
=
search
.
getSearchHits
();
List
<
T
>
list
=
searchHitList
.
stream
().
map
(
hit
->
hit
.
getContent
()).
collect
(
Collectors
.
toList
());
return
list
;
}
return
null
;
}
}
amos-boot-system-jxiop/amos-boot-module-jxiop-monitor-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/MonitorFanIndicatorImpl.java
View file @
288fc5a9
This diff is collapsed.
Click to expand it.
amos-boot-system-jxiop/amos-boot-module-jxiop-monitor-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/MonitoringServiceIMQTTmpl.java
View file @
288fc5a9
...
...
@@ -16,6 +16,7 @@ import com.yeejoin.amos.boot.module.jxiop.api.mapper.StationBasicMapper;
import
com.yeejoin.amos.boot.module.jxiop.api.mapper.StationPlanMapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.ESDto.ESEquipments
;
import
com.yeejoin.amos.boot.module.jxiop.biz.constants.CommonConstans
;
import
com.yeejoin.amos.boot.module.jxiop.biz.dto.ESEquipmentsDTO
;
import
com.yeejoin.amos.boot.module.jxiop.biz.dto.IndicatorsDto
;
import
com.yeejoin.amos.boot.module.jxiop.biz.dto.SocialContributionDto
;
import
com.yeejoin.amos.boot.module.jxiop.biz.utils.InfluxDButils
;
...
...
@@ -336,7 +337,7 @@ public class MonitoringServiceIMQTTmpl {
Integer
size
=
99
;
List
<
StationBasic
>
stationBasicList
=
stationBasicMapper
.
selectList
(
new
QueryWrapper
<
StationBasic
>().
isNotNull
(
"sequence_nbr"
).
eq
(
"station_type"
,
"FDZ"
));
stationBasicList
.
forEach
(
stationBasic
->
{
List
<
ESEquipments
>
fanStatusList
=
monitorFanIndicator
.
getFanStatusList
(
String
.
valueOf
(
stationBasic
.
getSequenceNbr
()));
List
<
ESEquipments
DTO
>
fanStatusList
=
monitorFanIndicator
.
getFanStatusList
(
String
.
valueOf
(
stationBasic
.
getSequenceNbr
()));
fanStatusList
.
forEach
(
indexDto
->
{
String
stationBasicId
=
String
.
valueOf
(
stationBasic
.
getSequenceNbr
());
String
equipmentNumber
=
indexDto
.
getEquipmentNumber
();
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-monitor-biz/src/main/resources/mapper/cluster/TemporaryDataMapper.xml
View file @
288fc5a9
...
...
@@ -19,6 +19,27 @@
</if>
</where>
GROUP BY batch_no ,equipmentIndexName;
</select>
<select
id=
"timingTemporarysSorageDataByIndexName"
resultType=
"map"
>
SELECT avg(value) as value ,
created_time as createdTime ,
equipmentIndexName
FROM
`temporary_data`
<where>
<if
test=
"gatewayId != null and gatewayId != ''"
>
gatewayId = #{gatewayId}
</if>
<if
test=
"gatewayId == null and gatewayId == ''"
>
equipmentNumber is not null and equipmentIndexName is not null
</if>
<if
test=
"equipmentIndexName != null and equipmentIndexName != ''"
>
and equipmentIndexName =#{equipmentIndexName}
</if>
</where>
GROUP BY batch_no ,equipmentIndexName;
</select>
...
...
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