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
844adc48
Commit
844adc48
authored
Nov 08, 2023
by
caotao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.为部盾提供全国、区域、场站发电量完成率接口
parent
763e71db
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
122 additions
and
58 deletions
+122
-58
MonitorFanIdxController.java
.../module/jxiop/biz/controller/MonitorFanIdxController.java
+6
-0
MonitoringServiceImpl.java
.../module/jxiop/biz/service/impl/MonitoringServiceImpl.java
+116
-58
No files found.
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 @
844adc48
...
...
@@ -1515,4 +1515,10 @@ public class MonitorFanIdxController extends BaseController {
// return ResponseHelper.buildResponse(hashMap);
// }
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"给部盾提供的发电率完成情况接口"
)
@GetMapping
(
"/getGenPowerInfoForBuDun"
)
public
ResponseModel
<
Map
<
String
,
String
>>
getGenPowerInfoForBuDun
(
@RequestParam
(
required
=
false
)
String
areaCode
,
@RequestParam
(
required
=
false
)
String
stationId
)
{
return
ResponseHelper
.
buildResponse
(
monitoringService
.
getGenPowerInfoForBuDun
(
areaCode
,
stationId
));
}
}
amos-boot-system-jxiop/amos-boot-module-jxiop-bigscreen-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/MonitoringServiceImpl.java
View file @
844adc48
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
biz
.
service
.
impl
;
import
cn.hutool.core.date.DatePattern
;
import
cn.hutool.core.date.DateUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
...
...
@@ -13,6 +14,7 @@ import com.yeejoin.amos.boot.module.jxiop.biz.dto.*;
import
com.yeejoin.amos.boot.module.jxiop.biz.entity.IndicatorData
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdmapper.IndicatorDataMapper
;
import
lombok.Data
;
import
org.apache.commons.lang.StringUtils
;
import
org.checkerframework.checker.units.qual.min
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
...
...
@@ -23,6 +25,7 @@ import org.springframework.stereotype.Service;
import
org.springframework.util.ObjectUtils
;
import
org.typroject.tyboot.component.emq.EmqKeeper
;
import
com.yeejoin.amos.boot.biz.common.utils.DateUtils
;
import
java.math.BigDecimal
;
import
java.net.URLDecoder
;
import
java.text.SimpleDateFormat
;
...
...
@@ -93,40 +96,41 @@ public class MonitoringServiceImpl {
* 获取风站场站
*
* */
public
Map
<
String
,
String
>
getStationfs
(
StationBasic
stationBasic
)
{
String
value
=
"0"
;
Map
<
String
,
String
>
map
=
new
HashMap
<>();
public
Map
<
String
,
String
>
getStationfs
(
StationBasic
stationBasic
)
{
String
value
=
"0"
;
Map
<
String
,
String
>
map
=
new
HashMap
<>();
Map
<
String
,
List
<
String
>>
queryCondtion
=
new
HashMap
<>();
if
(
stationBasic
.
getStationType
().
equals
(
"FDZ"
))
{
if
(
stationBasic
.
getStationType
().
equals
(
"FDZ"
))
{
String
gatewayId
=
stationBasic
.
getFanGatewayId
();
queryCondtion
.
put
(
CommonConstans
.
QueryStringEquipmentIndexName
,
Arrays
.
asList
(
"30秒平均风速"
));
queryCondtion
.
put
(
CommonConstans
.
QueryStringGateWayId
,
Arrays
.
asList
(
gatewayId
));
List
<
ESEquipments
>
result2
=
commonServiceImpl
.
getListDataByCondtions
(
queryCondtion
,
null
,
ESEquipments
.
class
);
value
=
String
.
format
(
"%.2f"
,
commonServiceImpl
.
getAvagerByEquipmentIndxName
(
result2
,
"30秒平均风速"
));
map
.
put
(
"name"
,
"风速/辐照度"
);
map
.
put
(
"value"
,
value
+
"m/s"
);
}
else
{
value
=
String
.
format
(
"%.2f"
,
commonServiceImpl
.
getAvagerByEquipmentIndxName
(
result2
,
"30秒平均风速"
));
map
.
put
(
"name"
,
"风速/辐照度"
);
map
.
put
(
"value"
,
value
+
"m/s"
);
}
else
{
queryCondtion
.
put
(
CommonConstans
.
QueryStringEquipmentIndexName
,
Arrays
.
asList
(
"WTX-801_25_WTX-801_总辐射"
));
queryCondtion
.
put
(
CommonConstans
.
QueryStringGateWayId
,
Arrays
.
asList
(
stationBasic
.
getBoosterGatewayId
()));
List
<
ESEquipments
>
result1
=
commonServiceImpl
.
getListDataByCondtions
(
queryCondtion
,
null
,
ESEquipments
.
class
);
value
=
String
.
format
(
"%.2f"
,
commonServiceImpl
.
getSumByEquipmentIndxName
(
result1
,
"WTX-801_25_WTX-801_总辐射"
));
map
.
put
(
"name"
,
"风速/辐照度"
);
map
.
put
(
"value"
,
value
+
"W/㎡"
);
value
=
String
.
format
(
"%.2f"
,
commonServiceImpl
.
getSumByEquipmentIndxName
(
result1
,
"WTX-801_25_WTX-801_总辐射"
));
map
.
put
(
"name"
,
"风速/辐照度"
);
map
.
put
(
"value"
,
value
+
"W/㎡"
);
}
return
map
;
}
/***
* 电站容量
* */
public
Map
<
String
,
String
>
getStationrl
(
StationBasic
stationBasic
)
{
public
Map
<
String
,
String
>
getStationrl
(
StationBasic
stationBasic
)
{
Double
installCapacity
=
0.0
;
installCapacity
=
this
.
SjglZsjZsbtzServiceImpl
.
getStationCapactityByStationWerks
(
stationBasic
.
getStationNumber
());
String
value
=
ObjectUtils
.
isEmpty
(
installCapacity
)
?
"0.00"
:
String
.
format
(
"%.2f"
,
installCapacity
);
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"name"
,
"容量"
);
map
.
put
(
"value"
,
value
+
"MW"
);
String
value
=
ObjectUtils
.
isEmpty
(
installCapacity
)
?
"0.00"
:
String
.
format
(
"%.2f"
,
installCapacity
);
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"name"
,
"容量"
);
map
.
put
(
"value"
,
value
+
"MW"
);
return
map
;
}
...
...
@@ -367,7 +371,6 @@ public class MonitoringServiceImpl {
// logger.error("-----------------发送区域实时生产数据消息=================== 失败!");
// }
// }
public
List
<
TabDto
>
getTabsByStationBasicId
(
String
stationBasicId
)
{
StationBasic
stationBasic
=
stationBasicMapper
.
selectById
(
stationBasicId
);
List
<
TabDto
>
tabDtoList
=
new
ArrayList
<>();
...
...
@@ -489,8 +492,7 @@ public class MonitoringServiceImpl {
// }
public
Map
<
String
,
Object
>
getDetailsWindSpeedAlldata
(
StationBasic
stationBasic
)
{
public
Map
<
String
,
Object
>
getDetailsWindSpeedAlldata
(
StationBasic
stationBasic
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
List
<
String
>
values
=
new
ArrayList
<>();
Map
<
Date
,
Double
>
groupMap
=
new
HashMap
<>();
...
...
@@ -506,7 +508,7 @@ public class MonitoringServiceImpl {
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd'T'HH:mm:ss'Z'"
);
sdf
.
setTimeZone
(
TimeZone
.
getTimeZone
(
"UTC"
));
String
startTime
=
sdf
.
format
(
currentDayStartTime
);
String
endTime
=
sdf
.
format
(
currentDayEndTime
);
String
endTime
=
sdf
.
format
(
currentDayEndTime
);
Double
installedCapacity
=
commonServiceImpl
.
getStationCapactityByStationWerks
(
stationBasic
.
getStationNumber
());
if
(
"FDZ"
.
equals
(
stationBasic
.
getStationType
()))
{
...
...
@@ -548,11 +550,10 @@ public class MonitoringServiceImpl {
}
catch
(
Exception
exception
)
{
exception
.
printStackTrace
();
}
return
map
;
return
map
;
}
public
String
getInstallCapity
(
List
<
StationBasic
>
stationBasicList
)
{
AtomicReference
<
Double
>
total
=
new
AtomicReference
<>(
0.0
);
stationBasicList
.
forEach
(
stationBasic
->
{
...
...
@@ -733,7 +734,6 @@ public class MonitoringServiceImpl {
// hashMapPage.setRecords(hashMapList);
// return hashMapPage;
// }
public
List
<
StationBasic
>
getListOfStationBasicByAreaName
(
String
areaName
)
{
List
<
StationBasic
>
stationBasicListAll
=
new
ArrayList
<>();
MapRegion
mapRegion
=
mapRegionMapper
.
selectOne
(
new
QueryWrapper
<
MapRegion
>().
eq
(
"name"
,
areaName
));
...
...
@@ -900,15 +900,15 @@ public class MonitoringServiceImpl {
public
void
getTotalData
()
{
//计算所有场站年计划完成量
int
year
=
Calendar
.
getInstance
().
get
(
Calendar
.
YEAR
);
int
Moon
=
Calendar
.
getInstance
().
get
(
Calendar
.
MONTH
)
+
1
;
LambdaQueryWrapper
<
StationPlan
>
query
=
new
LambdaQueryWrapper
<>();
query
.
eq
(
StationPlan:
:
getYear
,
String
.
valueOf
(
year
));
int
Moon
=
Calendar
.
getInstance
().
get
(
Calendar
.
MONTH
)
+
1
;
LambdaQueryWrapper
<
StationPlan
>
query
=
new
LambdaQueryWrapper
<>();
query
.
eq
(
StationPlan:
:
getYear
,
String
.
valueOf
(
year
));
List
<
StationPlan
>
stationPlans
=
stationPlanMapper
.
selectList
(
query
);
double
yearValue
=
stationPlans
.
stream
().
mapToDouble
(
StationPlan:
:
getValue
).
sum
();
double
fdzValue
=
stationPlans
.
stream
().
filter
(
e
->
e
.
getStationType
().
equals
(
"FDZ"
)).
mapToDouble
(
StationPlan:
:
getValue
).
sum
();
double
gfvalue
=
yearValue
-
fdzValue
;
double
moonValue
=
stationPlans
.
stream
().
filter
(
e
->
e
.
getMonthly
().
equals
(
String
.
valueOf
(
Moon
))).
mapToDouble
(
StationPlan:
:
getValue
).
sum
();
double
moonValue
=
stationPlans
.
stream
().
filter
(
e
->
e
.
getMonthly
().
equals
(
String
.
valueOf
(
Moon
))).
mapToDouble
(
StationPlan:
:
getValue
).
sum
();
//查询风电站年计划完成量
//
...
...
@@ -935,9 +935,9 @@ public class MonitoringServiceImpl {
//装机容量
HashMap
<
String
,
String
>
stringHashMap
=
new
HashMap
<>();
BigDecimal
totalInstall
=
new
BigDecimal
(
getInstallCapity
(
stationBasicListAll
));
// stringHashMap.put("title", totalInstall.toString());
// stringHashMap.put("title", totalInstall.toString());
//stringHashMap.put("data", "");
// list.add(stringHashMap);
// list.add(stringHashMap);
//风电站
HashMap
<
String
,
String
>
stringHashMap1
=
new
HashMap
<>();
BigDecimal
fdzInstall
=
new
BigDecimal
(
getInstallCapity
(
fdzList
));
...
...
@@ -970,10 +970,10 @@ public class MonitoringServiceImpl {
AtomicReference
<
Double
>
powerOfMonthGF
=
new
AtomicReference
<>(
new
Double
(
0.00
));
AtomicReference
<
Double
>
powerOfAnnualGF
=
new
AtomicReference
<>(
new
Double
(
0.00
));
fdzList
.
forEach
(
stationBasic
->
{
Map
<
String
,
List
<
String
>>
queryCondtion
=
new
HashMap
<>();
queryCondtion
.
put
(
CommonConstans
.
QueryStringEquipmentIndexName
,
Arrays
.
asList
(
"日发电量"
,
"月发电量"
,
"年发电量"
));
queryCondtion
.
put
(
CommonConstans
.
QueryStringGateWayId
,
Arrays
.
asList
(
stationBasic
.
getFanGatewayId
()));
List
<
ESEquipments
>
result
=
commonServiceImpl
.
getListDataByCondtions
(
queryCondtion
,
null
,
ESEquipments
.
class
);
Map
<
String
,
List
<
String
>>
queryCondtion
=
new
HashMap
<>();
queryCondtion
.
put
(
CommonConstans
.
QueryStringEquipmentIndexName
,
Arrays
.
asList
(
"日发电量"
,
"月发电量"
,
"年发电量"
));
queryCondtion
.
put
(
CommonConstans
.
QueryStringGateWayId
,
Arrays
.
asList
(
stationBasic
.
getFanGatewayId
()));
List
<
ESEquipments
>
result
=
commonServiceImpl
.
getListDataByCondtions
(
queryCondtion
,
null
,
ESEquipments
.
class
);
// powerOfDayFD.updateAndGet(v -> v + commonServiceImpl.getSumByEquipmentIndxName(result, "日发电量"));
// powerOfMonthFD.updateAndGet(v -> v + commonServiceImpl.getSumByEquipmentIndxName(result, "月发电量"));
// powerOfAnnualFD.updateAndGet(v -> v + commonServiceImpl.getSumByEquipmentIndxName(result, "年发电量"));
...
...
@@ -985,9 +985,9 @@ public class MonitoringServiceImpl {
});
gfList
.
forEach
(
stationBasic
->
{
Map
<
String
,
List
<
String
>>
queryCondtion
=
new
HashMap
<>();
queryCondtion
.
put
(
CommonConstans
.
QueryStringEquipmentIndexName
,
CommonConstans
.
taiHeGenIndicator
);
queryCondtion
.
put
(
CommonConstans
.
QueryStringGateWayId
,
Arrays
.
asList
(
stationBasic
.
getBoosterGatewayId
()));
Map
<
String
,
List
<
String
>>
queryCondtion
=
new
HashMap
<>();
queryCondtion
.
put
(
CommonConstans
.
QueryStringEquipmentIndexName
,
CommonConstans
.
taiHeGenIndicator
);
queryCondtion
.
put
(
CommonConstans
.
QueryStringGateWayId
,
Arrays
.
asList
(
stationBasic
.
getBoosterGatewayId
()));
List
<
ESEquipments
>
result
=
commonServiceImpl
.
getListDataByCondtions
(
queryCondtion
,
null
,
ESEquipments
.
class
);
powerOfDayGF
.
updateAndGet
(
v
->
v
+
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
CommonConstans
.
taiHeGenIndicatorDay
));
powerOfMonthGF
.
updateAndGet
(
v
->
v
+
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
CommonConstans
.
taiHeGenIndicatorMonth
));
...
...
@@ -997,35 +997,35 @@ public class MonitoringServiceImpl {
stringHashMap4
.
put
(
"title"
,
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
powerOfDayFD
.
get
())
+
"/"
+
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
powerOfDayGF
.
get
()));
list1
.
add
(
stringHashMap4
);
HashMap
<
String
,
String
>
stringHashMap5
=
new
HashMap
<>();
stringHashMap5
.
put
(
"title"
,
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
powerOfMonthFD
.
get
())
+
"/"
+
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
powerOfMonthGF
.
get
()
));
stringHashMap5
.
put
(
"title"
,
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
powerOfMonthFD
.
get
())
+
"/"
+
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
powerOfMonthGF
.
get
()));
list1
.
add
(
stringHashMap5
);
HashMap
<
String
,
String
>
stringHashMap6
=
new
HashMap
<>();
stringHashMap6
.
put
(
"title"
,
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
powerOfAnnualFD
.
get
())
+
"/"
+
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
powerOfAnnualGF
.
get
()
));
stringHashMap6
.
put
(
"title"
,
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
powerOfAnnualFD
.
get
())
+
"/"
+
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
powerOfAnnualGF
.
get
()));
list1
.
add
(
stringHashMap6
);
HashMap
<
String
,
String
>
stringHashMap7
=
new
HashMap
<>();
stringHashMap7
.
put
(
"title"
,
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
powerOfAnnualFD
.
get
()
/
fdzValue
)
+
"/"
+
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
powerOfAnnualGF
.
get
()/
gfvalue
));
stringHashMap7
.
put
(
"title"
,
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
powerOfAnnualFD
.
get
()
/
fdzValue
)
+
"/"
+
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
powerOfAnnualGF
.
get
()
/
gfvalue
));
list1
.
add
(
stringHashMap7
);
HashMap
<
String
,
String
>
stringHashMap8
=
new
HashMap
<>();
stringHashMap8
.
put
(
"title"
,
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
(
powerOfAnnualFD
.
get
()
*
CommonConstans
.
wkwhToMv
)
/
fdzInstall
.
doubleValue
())
+
"/"
+
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
(
powerOfAnnualGF
.
get
()
*
CommonConstans
.
wkwhToMv
)
/
gfInstall
.
doubleValue
()));
list1
.
add
(
stringHashMap8
);
page1
.
setRecords
(
list1
);
HashMap
<
String
,
String
>
stringHashMap9
=
new
HashMap
<>();
stringHashMap9
.
put
(
"title"
,
String
.
format
(
CommonConstans
.
Fourdecimalplaces
,
powerOfDayFD
.
get
()
+
powerOfDayGF
.
get
()
));
stringHashMap9
.
put
(
"title"
,
String
.
format
(
CommonConstans
.
Fourdecimalplaces
,
powerOfDayFD
.
get
()
+
powerOfDayGF
.
get
()));
HashMap
<
String
,
String
>
resultMap
=
new
HashMap
<>();
resultMap
.
put
(
"Day"
,
String
.
format
(
CommonConstans
.
Fourdecimalplaces
,
powerOfDayFD
.
get
()
+
powerOfDayGF
.
get
()));
list2
.
add
(
stringHashMap9
);
HashMap
<
String
,
String
>
stringHashMap10
=
new
HashMap
<>();
stringHashMap10
.
put
(
"title"
,
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
powerOfMonthFD
.
get
()
+
powerOfMonthGF
.
get
()));
resultMap
.
put
(
"Moon"
,
String
.
format
(
CommonConstans
.
Fourdecimalplaces
,
powerOfMonthFD
.
get
()
+
powerOfMonthGF
.
get
()
));
resultMap
.
put
(
"YJHWC"
,
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
(
powerOfMonthFD
.
get
()
+
powerOfMonthGF
.
get
())
/
moonValue
*
100
));
resultMap
.
put
(
"Moon"
,
String
.
format
(
CommonConstans
.
Fourdecimalplaces
,
powerOfMonthFD
.
get
()
+
powerOfMonthGF
.
get
()));
resultMap
.
put
(
"YJHWC"
,
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
(
powerOfMonthFD
.
get
()
+
powerOfMonthGF
.
get
())
/
moonValue
*
100
));
list2
.
add
(
stringHashMap10
);
HashMap
<
String
,
String
>
stringHashMap11
=
new
HashMap
<>();
stringHashMap11
.
put
(
"title"
,
String
.
format
(
CommonConstans
.
Fourdecimalplaces
,
powerOfAnnualFD
.
get
()
+
powerOfAnnualGF
.
get
()));
resultMap
.
put
(
"Year"
,
String
.
format
(
CommonConstans
.
Fourdecimalplaces
,
powerOfAnnualFD
.
get
()
+
powerOfAnnualGF
.
get
()));
resultMap
.
put
(
"Year"
,
String
.
format
(
CommonConstans
.
Fourdecimalplaces
,
powerOfAnnualFD
.
get
()
+
powerOfAnnualGF
.
get
()));
list2
.
add
(
stringHashMap11
);
HashMap
<
String
,
String
>
stringHashMap12
=
new
HashMap
<>();
stringHashMap12
.
put
(
"title"
,
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
(
powerOfAnnualFD
.
get
()
+
powerOfAnnualGF
.
get
())
/
yearValue
*
100
));
resultMap
.
put
(
"NJHWC"
,
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
(
powerOfAnnualFD
.
get
()
+
powerOfAnnualGF
.
get
())
/
yearValue
*
100
));
stringHashMap12
.
put
(
"title"
,
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
(
powerOfAnnualFD
.
get
()
+
powerOfAnnualGF
.
get
())
/
yearValue
*
100
));
resultMap
.
put
(
"NJHWC"
,
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
(
powerOfAnnualFD
.
get
()
+
powerOfAnnualGF
.
get
())
/
yearValue
*
100
));
list2
.
add
(
stringHashMap12
);
page2
.
setRecords
(
list2
);
Double
totalAnnual
=
(
powerOfAnnualFD
.
get
()
+
powerOfAnnualGF
.
get
());
...
...
@@ -1038,13 +1038,13 @@ public class MonitoringServiceImpl {
stringHashMap14
.
put
(
"unit"
,
"节约标准煤(t)"
);
list3
.
add
(
stringHashMap14
);
HashMap
<
String
,
String
>
stringHashMap15
=
new
HashMap
<>();
stringHashMap15
.
put
(
"title"
,
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
(
totalAnnual
*
CommonConstans
.
toner
)));
stringHashMap15
.
put
(
"title"
,
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
(
totalAnnual
*
CommonConstans
.
toner
)));
stringHashMap15
.
put
(
"unit"
,
"碳粉尘减排量(t)"
);
list3
.
add
(
stringHashMap15
);
HashMap
<
String
,
String
>
stringHashMap16
=
new
HashMap
<>();
stringHashMap16
.
put
(
"title"
,
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
(
totalAnnual
*
CommonConstans
.
sulfurDioxide
)));
stringHashMap16
.
put
(
"title"
,
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
(
totalAnnual
*
CommonConstans
.
sulfurDioxide
)));
stringHashMap16
.
put
(
"unit"
,
"二氧化硫减排量(t)"
);
list3
.
add
(
stringHashMap16
);
list3
.
add
(
stringHashMap16
);
page3
.
setRecords
(
list3
);
try
{
emqKeeper
.
getMqttClient
().
publish
(
"bigscreen_zjrl_topic"
,
JSON
.
toJSON
(
page
).
toString
().
getBytes
(
"UTF-8"
),
1
,
true
);
...
...
@@ -1130,7 +1130,7 @@ public class MonitoringServiceImpl {
// ]
// };
public
HashMap
<
String
,
Object
>
getTheStationPowerCurve
(
String
stationId
,
String
date
)
{
public
HashMap
<
String
,
Object
>
getTheStationPowerCurve
(
String
stationId
,
String
date
)
{
HashMap
<
String
,
Object
>
result
=
new
HashMap
<>();
List
<
HashMap
<
String
,
Object
>>
hashMapList
=
new
ArrayList
<>();
StationBasic
stationBasic
=
stationBasicMapper
.
selectById
(
stationId
);
...
...
@@ -1150,21 +1150,21 @@ public class MonitoringServiceImpl {
}
result
.
put
(
"xData"
,
xdata
);
HashMap
<
String
,
Object
>
currentPowerHashMap
=
new
HashMap
<>();
currentPowerHashMap
.
put
(
"title"
,
"实时有功 "
+
date
);
currentPowerHashMap
.
put
(
"title"
,
"实时有功 "
+
date
);
currentPowerHashMap
.
put
(
"yData"
,
currentPowerYdata
);
result
.
put
(
"currentPower"
,
currentPowerHashMap
);
HashMap
<
String
,
Object
>
shortPowerHashMap
=
new
HashMap
<>();
shortPowerHashMap
.
put
(
"title"
,
"短期功率预测 "
+
date
);
shortPowerHashMap
.
put
(
"title"
,
"短期功率预测 "
+
date
);
shortPowerHashMap
.
put
(
"yData"
,
currentPowerYdata
);
result
.
put
(
"shortPower"
,
shortPowerHashMap
);
HashMap
<
String
,
Object
>
superShortPowerHashMap
=
new
HashMap
<>();
superShortPowerHashMap
.
put
(
"title"
,
"超短期功率预测 "
+
date
);
superShortPowerHashMap
.
put
(
"title"
,
"超短期功率预测 "
+
date
);
superShortPowerHashMap
.
put
(
"yData"
,
currentPowerYdata
);
result
.
put
(
"superShortPower"
,
superShortPowerHashMap
);
HashMap
<
String
,
Object
>
footerList
=
new
HashMap
<>();
String
currentMin
=
String
.
format
(
"%.2f"
,
currentPowerYdata
.
stream
().
mapToDouble
(
Double:
:
parseDouble
).
min
().
getAsDouble
());
String
shortMin
=
String
.
format
(
"%.2f"
,
shortPowerYdata
.
stream
().
mapToDouble
(
Double:
:
parseDouble
).
min
().
getAsDouble
());
String
supreMin
=
String
.
format
(
"%.2f"
,
superPowerShortYdata
.
stream
().
mapToDouble
(
Double:
:
parseDouble
).
min
().
getAsDouble
());
String
currentMin
=
String
.
format
(
"%.2f"
,
currentPowerYdata
.
stream
().
mapToDouble
(
Double:
:
parseDouble
).
min
().
getAsDouble
());
String
shortMin
=
String
.
format
(
"%.2f"
,
shortPowerYdata
.
stream
().
mapToDouble
(
Double:
:
parseDouble
).
min
().
getAsDouble
());
String
supreMin
=
String
.
format
(
"%.2f"
,
superPowerShortYdata
.
stream
().
mapToDouble
(
Double:
:
parseDouble
).
min
().
getAsDouble
());
List
<
String
>
gz
=
new
ArrayList
<>();
List
<
String
>
sj1
=
new
ArrayList
<>();
gz
.
add
(
currentMin
);
...
...
@@ -1174,9 +1174,9 @@ public class MonitoringServiceImpl {
gz
.
add
(
supreMin
);
sj1
.
add
(
xdata
.
get
(
superPowerShortYdata
.
indexOf
(
supreMin
)));
String
currentMax
=
String
.
format
(
"%.2f"
,
currentPowerYdata
.
stream
().
mapToDouble
(
Double:
:
parseDouble
).
max
().
getAsDouble
());
String
shortMax
=
String
.
format
(
"%.2f"
,
shortPowerYdata
.
stream
().
mapToDouble
(
Double:
:
parseDouble
).
max
().
getAsDouble
());
String
supreMax
=
String
.
format
(
"%.2f"
,
superPowerShortYdata
.
stream
().
mapToDouble
(
Double:
:
parseDouble
).
max
().
getAsDouble
());
String
currentMax
=
String
.
format
(
"%.2f"
,
currentPowerYdata
.
stream
().
mapToDouble
(
Double:
:
parseDouble
).
max
().
getAsDouble
());
String
shortMax
=
String
.
format
(
"%.2f"
,
shortPowerYdata
.
stream
().
mapToDouble
(
Double:
:
parseDouble
).
max
().
getAsDouble
());
String
supreMax
=
String
.
format
(
"%.2f"
,
superPowerShortYdata
.
stream
().
mapToDouble
(
Double:
:
parseDouble
).
max
().
getAsDouble
());
List
<
String
>
zdz
=
new
ArrayList
<>();
List
<
String
>
sj2
=
new
ArrayList
<>();
zdz
.
add
(
currentMax
);
...
...
@@ -1208,4 +1208,62 @@ public class MonitoringServiceImpl {
public
Double
keepFourdecimalPlaces
(
Double
param
)
{
return
Double
.
valueOf
(
String
.
format
(
"%.4f"
,
param
));
}
public
Map
<
String
,
String
>
getGenPowerInfoForBuDun
(
String
areaCode
,
String
stationId
)
{
HashMap
<
String
,
String
>
returnResult
=
new
HashMap
<>();
returnResult
.
put
(
"monthCompleteRate"
,
"0.00%"
);
returnResult
.
put
(
"monthValue"
,
"0.0000"
);
returnResult
.
put
(
"monthPlanValue"
,
"0.0000"
);
returnResult
.
put
(
"yearCompleteRate"
,
"0.00%"
);
returnResult
.
put
(
"yearValue"
,
"0.0000"
);
returnResult
.
put
(
"yearPlanValue"
,
"0.0000"
);
List
<
StationCacheInfoDto
>
stationCacheInfoDtos
=
commonServiceImpl
.
getListStationCacheInfoDto
();
if
(
StringUtils
.
isNotBlank
(
areaCode
))
{
stationCacheInfoDtos
=
stationCacheInfoDtos
.
stream
().
filter
(
stationCacheInfoDto
->
stationCacheInfoDto
.
getAreaCode
().
equals
(
areaCode
)).
collect
(
Collectors
.
toList
());
}
if
(
StringUtils
.
isNotBlank
(
stationId
))
{
stationCacheInfoDtos
=
stationCacheInfoDtos
.
stream
().
filter
(
stationCacheInfoDto
->
stationCacheInfoDto
.
getStationId
().
equals
(
stationId
)).
collect
(
Collectors
.
toList
());
}
//月发电量
AtomicReference
<
Double
>
monthlyPower
=
new
AtomicReference
<>(
0.0
);
//年发电量
AtomicReference
<
Double
>
annualPower
=
new
AtomicReference
<>(
0.0
);
for
(
StationCacheInfoDto
stationCacheInfoDto
:
stationCacheInfoDtos
)
{
if
(
"FDZ"
.
equals
(
stationCacheInfoDto
.
getStationType
()))
{
Map
<
String
,
List
<
String
>>
queryCondtion
=
new
HashMap
<>();
queryCondtion
.
put
(
CommonConstans
.
QueryStringEquipmentIndexName
,
Arrays
.
asList
(
"月发电量"
,
"年发电量"
));
queryCondtion
.
put
(
CommonConstans
.
QueryStringGateWayId
,
Arrays
.
asList
(
stationCacheInfoDto
.
getFanGatewayId
()));
List
<
ESEquipments
>
result
=
commonServiceImpl
.
getListDataByCondtions
(
queryCondtion
,
null
,
ESEquipments
.
class
);
monthlyPower
.
updateAndGet
(
v
->
v
+
keepFourdecimalPlaces
(
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
"月发电量"
)));
annualPower
.
updateAndGet
(
v
->
v
+
keepFourdecimalPlaces
(
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
"年发电量"
)));
}
else
{
Map
<
String
,
List
<
String
>>
queryCondtion
=
new
HashMap
<>();
queryCondtion
.
put
(
CommonConstans
.
QueryStringEquipmentIndexName
,
CommonConstans
.
taiHeGenIndicator
);
queryCondtion
.
put
(
CommonConstans
.
QueryStringGateWayId
,
Arrays
.
asList
(
stationCacheInfoDto
.
getBoosterGatewayId
()));
List
<
ESEquipments
>
result
=
commonServiceImpl
.
getListDataByCondtions
(
queryCondtion
,
null
,
ESEquipments
.
class
);
monthlyPower
.
updateAndGet
(
v
->
v
+
keepFourdecimalPlaces
(
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
CommonConstans
.
taiHeGenIndicatorMonth
)));
annualPower
.
updateAndGet
(
v
->
v
+
keepFourdecimalPlaces
(
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
CommonConstans
.
taiHeGenIndicatorYear
)));
}
}
List
<
String
>
stationIds
=
stationCacheInfoDtos
.
stream
().
map
(
StationCacheInfoDto:
:
getStationId
).
collect
(
Collectors
.
toList
());
List
<
StationPlan
>
stationPlans
=
stationPlanMapper
.
selectList
(
new
QueryWrapper
<
StationPlan
>().
in
(
"station_basic_id"
,
stationIds
));
String
currentYearAndMonth
=
DateUtil
.
format
(
new
Date
(),
DatePattern
.
NORM_MONTH_PATTERN
);
String
currentYear
=
currentYearAndMonth
.
split
(
"-"
)[
0
];
Integer
currentMonth
=
Integer
.
valueOf
(
currentYearAndMonth
.
split
(
"-"
)[
1
]);
Double
yearPlanValue
=
stationPlans
.
stream
().
filter
(
stationPlan
->
stationPlan
.
getYear
().
equals
(
currentYear
)).
mapToDouble
(
i
->
i
.
getValue
()).
sum
();
Double
monthPlanValue
=
stationPlans
.
stream
().
filter
(
stationPlan
->
currentMonth
==
Integer
.
valueOf
(
stationPlan
.
getMonthly
())).
mapToDouble
(
i
->
i
.
getValue
()).
sum
();
if
(
monthlyPower
.
get
()
>
0
&&
monthPlanValue
>
0
)
{
returnResult
.
put
(
"monthCompleteRate"
,
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
(
monthlyPower
.
get
()
/
monthPlanValue
)
*
100
)
+
"%"
);
returnResult
.
put
(
"monthValue"
,
String
.
format
(
CommonConstans
.
Fourdecimalplaces
,
monthlyPower
.
get
()));
returnResult
.
put
(
"monthPlanValue"
,
String
.
format
(
CommonConstans
.
Fourdecimalplaces
,
monthPlanValue
));
}
if
(
annualPower
.
get
()
>
0
&&
yearPlanValue
>
0
)
{
returnResult
.
put
(
"yearCompleteRate"
,
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
(
annualPower
.
get
()
/
yearPlanValue
)
*
100
)
+
"%"
);
returnResult
.
put
(
"yearValue"
,
String
.
format
(
CommonConstans
.
Fourdecimalplaces
,
annualPower
.
get
()));
returnResult
.
put
(
"yearPlanValue"
,
String
.
format
(
CommonConstans
.
Fourdecimalplaces
,
yearPlanValue
));
}
return
returnResult
;
}
}
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