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
9e4cf658
Commit
9e4cf658
authored
Sep 20, 2023
by
chenzhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
批量将valueDouble 修改成 valueF
parent
50a037b2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
18 additions
and
37 deletions
+18
-37
ESEquipments.java
...eejoin/amos/boot/module/jxiop/biz/ESDto/ESEquipments.java
+3
-4
MonitorFanIdxController.java
.../module/jxiop/biz/controller/MonitorFanIdxController.java
+3
-10
CommonServiceImpl.java
...boot/module/jxiop/biz/service/impl/CommonServiceImpl.java
+1
-2
MonitorFanIndicatorImpl.java
...odule/jxiop/biz/service/impl/MonitorFanIndicatorImpl.java
+1
-8
ESEquipments.java
...eejoin/amos/boot/module/jxiop/biz/ESDto/ESEquipments.java
+3
-3
MonitorFanIdxController.java
.../module/jxiop/biz/controller/MonitorFanIdxController.java
+2
-4
ESEquipmentsDTO.java
...ejoin/amos/boot/module/jxiop/biz/dto/ESEquipmentsDTO.java
+1
-1
CommonServiceImpl.java
...boot/module/jxiop/biz/service/impl/CommonServiceImpl.java
+4
-5
MonitorFanIndicatorImpl.java
...odule/jxiop/biz/service/impl/MonitorFanIndicatorImpl.java
+0
-0
No files found.
amos-boot-system-jxiop/amos-boot-module-jxiop-bigscreen-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/ESDto/ESEquipments.java
View file @
9e4cf658
...
...
@@ -3,7 +3,6 @@ package com.yeejoin.amos.boot.module.jxiop.biz.ESDto;
import
io.github.classgraph.json.Id
;
import
lombok.Data
;
import
lombok.experimental.Accessors
;
import
org.springframework.data.elasticsearch.annotations.DateFormat
;
import
org.springframework.data.elasticsearch.annotations.Document
;
import
org.springframework.data.elasticsearch.annotations.Field
;
import
org.springframework.data.elasticsearch.annotations.FieldType
;
...
...
@@ -43,7 +42,7 @@ public class ESEquipments {
@Field
(
type
=
FieldType
.
Text
,
index
=
false
)
private
String
value
;
@Field
(
type
=
FieldType
.
Float
,
index
=
false
)
private
Float
valueDouble
;
private
Float
valueF
;
@Field
(
type
=
FieldType
.
Text
,
index
=
false
)
private
String
valueLabel
;
@Field
(
type
=
FieldType
.
Text
,
index
=
false
)
...
...
@@ -62,9 +61,9 @@ public class ESEquipments {
private
String
displayName
;
public
ESEquipments
(
Float
value
Double
,
String
id
,
String
address
,
String
dataType
,
String
equipmentSpecificName
,
String
gatewayId
,
String
isAlarm
,
Date
createdTime
,
String
unit
,
String
value
,
String
valueLabel
,
String
traceId
,
String
equipmentIndexName
,
String
equipmentNumber
,
String
frontModule
,
String
systemType
,
String
pictureName
,
String
displayName
)
{
public
ESEquipments
(
Float
value
F
,
String
id
,
String
address
,
String
dataType
,
String
equipmentSpecificName
,
String
gatewayId
,
String
isAlarm
,
Date
createdTime
,
String
unit
,
String
value
,
String
valueLabel
,
String
traceId
,
String
equipmentIndexName
,
String
equipmentNumber
,
String
frontModule
,
String
systemType
,
String
pictureName
,
String
displayName
)
{
this
.
value
Double
=
valueDouble
;
this
.
value
F
=
valueF
;
this
.
id
=
id
;
this
.
address
=
address
;
this
.
dataType
=
dataType
;
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-bigscreen-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/controller/MonitorFanIdxController.java
View file @
9e4cf658
...
...
@@ -23,23 +23,16 @@ import io.swagger.annotations.Api;
import
io.swagger.annotations.ApiOperation
;
import
org.apache.commons.io.IOUtils
;
import
org.eclipse.paho.client.mqttv3.MqttException
;
import
org.elasticsearch.action.search.SearchRequest
;
import
org.elasticsearch.action.search.SearchResponse
;
import
org.elasticsearch.client.RequestOptions
;
import
org.elasticsearch.client.RestHighLevelClient
;
import
org.elasticsearch.index.query.BoolQueryBuilder
;
import
org.elasticsearch.index.query.QueryBuilder
;
import
org.elasticsearch.index.query.QueryBuilders
;
import
org.elasticsearch.rest.RestStatus
;
import
org.elasticsearch.search.aggregations.Aggregation
;
import
org.elasticsearch.search.aggregations.Aggregations
;
import
org.elasticsearch.search.aggregations.bucket.terms.Terms
;
import
org.elasticsearch.search.aggregations.metrics.ParsedSum
;
import
org.elasticsearch.search.builder.SearchSourceBuilder
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.core.io.Resource
;
import
org.springframework.data.domain.PageRequest
;
import
org.springframework.data.elasticsearch.core.ElasticsearchRestTemplate
;
import
org.springframework.data.elasticsearch.core.SearchHit
;
import
org.springframework.data.elasticsearch.core.SearchHits
;
...
...
@@ -1047,12 +1040,12 @@ public class MonitorFanIdxController extends BaseController {
map
.
put
(
"name"
,
key
);
for
(
ESEquipments
equip
:
resultMap
.
get
(
key
))
{
if
(!
stationBasic
.
getStationType
().
equals
(
"FDZ"
)){
float
value
=
equip
.
getValue
Double
();
float
value
=
equip
.
getValue
F
();
float
v
=
CommonConstans
.
pvGenPoweActor
.
floatValue
();
equip
.
setValue
Double
(
value
*
v
);
equip
.
setValue
F
(
value
*
v
);
}
String
value
=
String
.
format
(
"%.4f"
,
equip
.
getValue
Double
());
String
value
=
String
.
format
(
"%.4f"
,
equip
.
getValue
F
());
switch
(
equip
.
getEquipmentIndexName
()){
case
"日发电量"
:
map
.
put
(
"dayNum"
,
value
);
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-bigscreen-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/CommonServiceImpl.java
View file @
9e4cf658
...
...
@@ -9,7 +9,6 @@ import com.yeejoin.amos.boot.module.jxiop.api.mapper.MapRegionMapper;
import
com.yeejoin.amos.boot.module.jxiop.api.mapper.RegionMapper
;
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.dto.IndicatorsDto
;
import
com.yeejoin.amos.boot.module.jxiop.biz.dto.QueryDto
;
import
com.yeejoin.amos.boot.module.jxiop.biz.dto.SocialContributionDto
;
import
com.yeejoin.amos.boot.module.jxiop.biz.dto.StationCacheInfoDto
;
...
...
@@ -284,7 +283,7 @@ public class CommonServiceImpl {
public
Double
getSumByEquipmentIndxName
(
List
<
ESEquipments
>
equipments
,
String
indexName
)
{
Double
result
=
0.00
;
result
=
equipments
.
stream
().
filter
(
esEquipments
->
esEquipments
.
getEquipmentIndexName
().
equals
(
indexName
)).
mapToDouble
(
ESEquipments:
:
getValue
Double
).
sum
();
result
=
equipments
.
stream
().
filter
(
esEquipments
->
esEquipments
.
getEquipmentIndexName
().
equals
(
indexName
)).
mapToDouble
(
ESEquipments:
:
getValue
F
).
sum
();
return
result
;
}
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-bigscreen-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/MonitorFanIndicatorImpl.java
View file @
9e4cf658
...
...
@@ -10,12 +10,10 @@ import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.biz.common.utils.DateUtils
;
import
com.yeejoin.amos.boot.biz.common.entity.BaseEntity
;
import
com.yeejoin.amos.boot.biz.common.utils.DateUtils
;
import
com.yeejoin.amos.boot.module.jxiop.api.Enum.ElectricQuantity
;
import
com.yeejoin.amos.boot.module.jxiop.api.Enum.KGName
;
import
com.yeejoin.amos.boot.module.jxiop.api.dto.IndexDto
;
import
com.yeejoin.amos.boot.module.jxiop.api.dto.TreeDto
;
import
com.yeejoin.amos.boot.module.jxiop.api.entity.MonitorFanIndicator
;
import
com.yeejoin.amos.boot.module.jxiop.api.entity.Region
;
import
com.yeejoin.amos.boot.module.jxiop.api.entity.StationBasic
;
import
com.yeejoin.amos.boot.module.jxiop.api.mapper.MonitorFanIndicatorMapper
;
...
...
@@ -35,16 +33,11 @@ import com.yeejoin.amos.component.robot.BadRequest;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.io.IOUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.velocity.runtime.directive.Break
;
import
org.eclipse.paho.client.mqttv3.MqttException
;
import
org.elasticsearch.common.recycler.Recycler
;
import
org.elasticsearch.index.Index
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.core.io.Resource
;
import
org.springframework.scheduling.annotation.EnableScheduling
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.ObjectUtils
;
import
org.typroject.tyboot.component.emq.EmqKeeper
;
...
...
@@ -616,7 +609,7 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
}
queryCondtion
.
put
(
CommonConstans
.
QueryStringEquipmentIndexName
,
Arrays
.
asList
(
"220kV夏雩线212线路测控装置PCS-9705TA有功功率一次值"
,
"南瑞光差保护_313P"
));
List
<
ESEquipments
>
indicatorsDtoList
=
commonServiceImpl
.
getListDataByCondtions
(
queryCondtion
,
null
,
ESEquipments
.
class
);
double
sum
=
indicatorsDtoList
.
stream
().
mapToDouble
(
t
->
Double
.
parseDouble
(
t
.
getValue
Double
().
toString
())).
sum
();
double
sum
=
indicatorsDtoList
.
stream
().
mapToDouble
(
t
->
Double
.
parseDouble
(
t
.
getValue
F
().
toString
())).
sum
();
Double
format
=
Double
.
parseDouble
(
String
.
format
(
"%.2f"
,
sum
/
installedCapacity
));
List
<
Map
<
String
,
Object
>>
list
=
temporaryDataMapper
.
timingTemporarysSorageData
(
gatewayId
);
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-monitor-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/ESDto/ESEquipments.java
View file @
9e4cf658
...
...
@@ -40,7 +40,7 @@ public class ESEquipments {
@Field
(
type
=
FieldType
.
Text
)
private
String
value
;
@Field
(
type
=
FieldType
.
Float
,
index
=
false
)
private
Float
valueDouble
;
private
Float
valueF
;
@Field
(
type
=
FieldType
.
Text
)
private
String
valueLabel
;
@Field
(
type
=
FieldType
.
Text
,
index
=
false
)
...
...
@@ -59,9 +59,9 @@ public class ESEquipments {
private
String
displayName
;
public
ESEquipments
(
Float
value
Double
,
String
id
,
String
address
,
String
dataType
,
String
equipmentSpecificName
,
String
gatewayId
,
String
isAlarm
,
Date
createdTime
,
String
unit
,
String
value
,
String
valueLabel
,
String
traceId
,
String
equipmentIndexName
,
String
equipmentNumber
,
String
frontModule
,
String
systemType
,
String
pictureName
,
String
displayName
)
{
public
ESEquipments
(
Float
value
F
,
String
id
,
String
address
,
String
dataType
,
String
equipmentSpecificName
,
String
gatewayId
,
String
isAlarm
,
Date
createdTime
,
String
unit
,
String
value
,
String
valueLabel
,
String
traceId
,
String
equipmentIndexName
,
String
equipmentNumber
,
String
frontModule
,
String
systemType
,
String
pictureName
,
String
displayName
)
{
this
.
value
Double
=
valueDouble
;
this
.
value
F
=
valueF
;
this
.
id
=
id
;
this
.
address
=
address
;
this
.
dataType
=
dataType
;
...
...
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 @
9e4cf658
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
biz
.
controller
;
import
cn.hutool.extra.pinyin.PinyinUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.module.common.biz.utils.CommonResponseUtil
;
import
com.yeejoin.amos.boot.module.jxiop.api.Enum.GeneratingCapacity
;
import
com.yeejoin.amos.boot.module.jxiop.api.dto.IndexDto
;
import
com.yeejoin.amos.boot.module.jxiop.api.dto.TreeDto
;
import
com.yeejoin.amos.boot.module.jxiop.api.entity.StationBasic
;
...
...
@@ -225,7 +223,7 @@ public class MonitorFanIdxController extends BaseController {
queryCondtion1
.
put
(
CommonConstans
.
QueryStringEquipmentIndexName
,
Arrays
.
asList
(
"220kV夏雩线212线路测控装置PCS-9705TA有功功率一次值"
));
queryCondtion1
.
put
(
CommonConstans
.
QueryStringGateWayId
,
Arrays
.
asList
(
stationBasic
.
getBoosterGatewayId
()));
List
<
ESEquipments
>
result1
=
commonService
.
getListDataByCondtions
(
queryCondtion1
,
null
,
ESEquipments
.
class
);
columnMap
.
put
(
"有功功率"
,
String
.
format
(
"%.2f"
,
result1
.
get
(
0
).
getValue
Double
()));
columnMap
.
put
(
"有功功率"
,
String
.
format
(
"%.2f"
,
result1
.
get
(
0
).
getValue
F
()));
String
num
=
monitorFanIndicator
.
getEquipCount
(
gatewayId
,
"FDZ"
);
columnMap
.
put
(
"风机台数"
,
num
);
...
...
@@ -617,7 +615,7 @@ public class MonitorFanIdxController extends BaseController {
queryCondtion
.
put
(
CommonConstans
.
QueryStringEquipmentIndexName
,
Arrays
.
asList
(
"南瑞光差保护_313P"
));
queryCondtion
.
put
(
CommonConstans
.
QueryStringGateWayId
,
Arrays
.
asList
(
stationBasic
.
getBoosterGatewayId
()));
List
<
ESEquipments
>
result1
=
commonService
.
getListDataByCondtions
(
queryCondtion
,
null
,
ESEquipments
.
class
);
columnMap
.
put
(
"有功功率"
,
String
.
format
(
"%.2f"
,
result1
.
get
(
0
).
getValue
Double
()));
columnMap
.
put
(
"有功功率"
,
String
.
format
(
"%.2f"
,
result1
.
get
(
0
).
getValue
F
()));
mapList
=
influxdbUtil
.
query
(
"SELECT * FROM indicators_"
+
stationBasic
.
getFanGatewayId
()
+
" where frontModule=~/逆变器/ and(equipmentIndexName='日发电量' or equipmentIndexName='月发电量' or equipmentIndexName='年发电量' or equipmentIndexName='有功功率')"
);
//日-月-年-发电量需要保留四位小数问题修改
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-monitor-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/dto/ESEquipmentsDTO.java
View file @
9e4cf658
...
...
@@ -15,7 +15,7 @@ public class ESEquipmentsDTO {
private
Date
createdTime
;
private
String
unit
;
private
String
value
;
private
Float
valueDouble
;
private
Float
valueF
;
private
String
valueLabel
;
private
String
traceId
;
private
String
equipmentIndexName
;
...
...
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 @
9e4cf658
...
...
@@ -40,7 +40,6 @@ import org.springframework.stereotype.Service;
import
org.springframework.util.ObjectUtils
;
import
javax.annotation.Resource
;
import
javax.sql.rowset.serial.SerialJavaObject
;
import
java.util.*
;
import
java.util.stream.Collectors
;
...
...
@@ -226,7 +225,7 @@ public class CommonServiceImpl {
List
<
ESEquipments
>
result
=
getListDataByCondtions
(
queryCondtion
,
null
,
ESEquipments
.
class
);
Double
totalvalue
=
0.00
;
try
{
totalvalue
=
result
.
stream
().
filter
(
stringObjectMap
->
!
ObjectUtils
.
isEmpty
(
stringObjectMap
.
getValue
Double
())).
mapToDouble
(
l
->
Double
.
parseDouble
(
l
.
getValueDouble
().
toString
())).
sum
();
totalvalue
=
result
.
stream
().
filter
(
stringObjectMap
->
!
ObjectUtils
.
isEmpty
(
stringObjectMap
.
getValue
F
())).
mapToDouble
(
l
->
Double
.
parseDouble
(
l
.
getValueF
().
toString
())).
sum
();
}
catch
(
Exception
e
)
{
return
totalvalue
;
}
...
...
@@ -244,7 +243,7 @@ public class CommonServiceImpl {
List
<
ESEquipments
>
result
=
getListDataByCondtions
(
queryCondtion
,
null
,
ESEquipments
.
class
,
likeQuerCondtion
);
Double
totalvalue
=
0.00
;
try
{
totalvalue
=
result
.
stream
().
filter
(
stringObjectMap
->
!
ObjectUtils
.
isEmpty
(
stringObjectMap
.
getValue
Double
())).
mapToDouble
(
l
->
Double
.
parseDouble
(
l
.
getValueDouble
().
toString
())).
sum
();
totalvalue
=
result
.
stream
().
filter
(
stringObjectMap
->
!
ObjectUtils
.
isEmpty
(
stringObjectMap
.
getValue
F
())).
mapToDouble
(
l
->
Double
.
parseDouble
(
l
.
getValueF
().
toString
())).
sum
();
}
catch
(
Exception
e
)
{
return
totalvalue
;
}
...
...
@@ -574,13 +573,13 @@ public class CommonServiceImpl {
}
public
Double
getAvagerByEquipmentIndxName
(
List
<
ESEquipments
>
equipments
,
String
indexName
)
{
Double
result
=
0.00
;
result
=
equipments
.
stream
().
filter
(
esEquipments
->
esEquipments
.
getEquipmentIndexName
().
equals
(
indexName
)).
mapToDouble
(
ESEquipments:
:
getValue
Double
).
average
().
getAsDouble
();
result
=
equipments
.
stream
().
filter
(
esEquipments
->
esEquipments
.
getEquipmentIndexName
().
equals
(
indexName
)).
mapToDouble
(
ESEquipments:
:
getValue
F
).
average
().
getAsDouble
();
return
result
;
}
public
Double
getSumByEquipmentIndxName
(
List
<
ESEquipments
>
equipments
,
String
indexName
)
{
Double
result
=
0.00
;
result
=
equipments
.
stream
().
filter
(
esEquipments
->
esEquipments
.
getEquipmentIndexName
().
equals
(
indexName
)).
mapToDouble
(
ESEquipments:
:
getValue
Double
).
sum
();
result
=
equipments
.
stream
().
filter
(
esEquipments
->
esEquipments
.
getEquipmentIndexName
().
equals
(
indexName
)).
mapToDouble
(
ESEquipments:
:
getValue
F
).
sum
();
return
result
;
}
...
...
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 @
9e4cf658
This diff is collapsed.
Click to expand it.
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