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
35af08af
Commit
35af08af
authored
Oct 07, 2023
by
caotao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
BUG:14399 进入片区,江西区域电量指标完成情况>日月年发电量数据对不上
parent
43b30bf5
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
142 additions
and
77 deletions
+142
-77
MonitoringServiceIMQTTmpl.java
...ule/jxiop/biz/service/impl/MonitoringServiceIMQTTmpl.java
+1
-1
MonitoringServiceImpl.java
.../module/jxiop/biz/service/impl/MonitoringServiceImpl.java
+141
-76
No files found.
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 @
35af08af
...
...
@@ -190,7 +190,7 @@ public class MonitoringServiceIMQTTmpl {
socialContributionDtoPage
.
setTotal
(
100
);
socialContributionDtoPage
.
setCurrent
(
1
);
try
{
emqKeeper
.
getMqttClient
().
publish
(
"completionofpowerindicator_topic"
,
JSON
.
toJSON
(
socialContributionDtoPage
).
toString
().
getBytes
(
"UTF-8"
),
1
,
true
);
//
emqKeeper.getMqttClient().publish("completionofpowerindicator_topic", JSON.toJSON(socialContributionDtoPage).toString().getBytes("UTF-8"), 1, true);
logger
.
info
(
"-----------------发送区域实时生产数据消息=================== 成功!"
+
JSON
.
toJSONString
(
socialContributionDtoPage
));
}
catch
(
Exception
exception
)
{
logger
.
error
(
"-----------------发送区域实时生产数据消息=================== 失败!"
);
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-monitor-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/MonitoringServiceImpl.java
View file @
35af08af
...
...
@@ -172,7 +172,6 @@ public class MonitoringServiceImpl {
public
ResultsData
getCompletionOfPowerIndicatorsByProvinceName
(
int
current
,
int
size
,
String
provinceName
)
{
List
<
ColModel
>
colModels
=
new
ArrayList
<>();
List
<
CompletionOfPowerIndicatorsDto
>
completionOfPowerIndicatorsDtoList
=
new
ArrayList
<>();
ColModel
colModelStatitonName
=
new
ColModel
(
"stationName"
,
"stationName"
,
"场站"
,
"场站"
,
"dataGrid"
,
"stationName"
);
...
...
@@ -191,6 +190,30 @@ public class MonitoringServiceImpl {
colModels
.
add
(
colModelAnnualPower
);
List
<
StationCacheInfoDto
>
stationCacheInfoDtoList
=
commonServiceImpl
.
getListStationCacheInfoDto
();
List
<
StationCacheInfoDto
>
stationCacheInfoDtos
=
stationCacheInfoDtoList
.
stream
().
filter
(
stationCacheInfoDto
->
stationCacheInfoDto
.
getBelongProvince
().
equals
(
provinceName
)).
collect
(
Collectors
.
toList
());
//日发电量
AtomicReference
<
Double
>
dailyPower
=
new
AtomicReference
<>(
0.0
);
//月发电量
AtomicReference
<
Double
>
monthlyPower
=
new
AtomicReference
<>(
0.0
);
//年发电量
AtomicReference
<
Double
>
annualPower
=
new
AtomicReference
<>(
0.0
);
//年发电量完成比例
String
completionRatio
=
"0.00"
;
//年利用小时数
int
year
=
Calendar
.
getInstance
().
get
(
Calendar
.
YEAR
);
List
<
String
>
fdz
=
stationCacheInfoDtos
.
stream
().
map
(
StationCacheInfoDto:
:
getStationId
).
collect
(
Collectors
.
toList
());
LambdaQueryWrapper
<
StationPlan
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
queryWrapper
.
eq
(
StationPlan:
:
getYear
,
String
.
valueOf
(
year
));
queryWrapper
.
in
(
StationPlan:
:
getStationBasicId
,
fdz
);
List
<
StationPlan
>
fdzPlans
=
stationPlanMapper
.
selectList
(
queryWrapper
);
double
value
=
fdzPlans
.
stream
().
mapToDouble
(
StationPlan:
:
getValue
).
sum
();
AtomicReference
<
Double
>
useHours
=
new
AtomicReference
<>(
0.0
);
AtomicReference
<
Double
>
installCapacity
=
new
AtomicReference
<>(
0.0
);
AtomicReference
<
Double
>
fdzInstallCapacity
=
new
AtomicReference
<>(
0.0
);
AtomicReference
<
Double
>
gfzinstallCapacity
=
new
AtomicReference
<>(
0.0
);
//年发电量
AtomicReference
<
Double
>
fdzannualPower
=
new
AtomicReference
<>(
0.0
);
AtomicReference
<
Double
>
gfzannualPower
=
new
AtomicReference
<>(
0.0
);
//遍历列表
stationCacheInfoDtos
.
forEach
(
stationCacheInfoDto
->
{
CompletionOfPowerIndicatorsDto
completionOfPowerIndicatorsDto
=
new
CompletionOfPowerIndicatorsDto
();
...
...
@@ -213,6 +236,11 @@ public class MonitoringServiceImpl {
completionOfPowerIndicatorsDto
.
setDailyPower
(
String
.
format
(
CommonConstans
.
Fourdecimalplaces
,
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
"日发电量"
)));
completionOfPowerIndicatorsDto
.
setMonthlyPower
(
String
.
format
(
CommonConstans
.
Fourdecimalplaces
,
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
"月发电量"
)));
completionOfPowerIndicatorsDto
.
setAnnualPower
(
String
.
format
(
CommonConstans
.
Fourdecimalplaces
,
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
"年发电量"
)));
dailyPower
.
updateAndGet
(
v
->
v
+
keepFourdecimalPlaces
(
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
"日发电量"
)));
monthlyPower
.
updateAndGet
(
v
->
v
+
keepFourdecimalPlaces
(
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
"月发电量"
)));
annualPower
.
updateAndGet
(
v
->
v
+
keepFourdecimalPlaces
(
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
"年发电量"
)));
fdzannualPower
.
updateAndGet
(
v
->
v
+
keepFourdecimalPlaces
(
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
"年发电量"
)));
fdzInstallCapacity
.
updateAndGet
(
v
->
v
+
Double
.
parseDouble
(
stationCacheInfoDto
.
getInstalledCapacity
()));
}
else
{
Map
<
String
,
List
<
String
>>
queryCondtion
=
new
HashMap
<>();
queryCondtion
.
put
(
CommonConstans
.
QueryStringEquipmentIndexName
,
Arrays
.
asList
(
"日发电量"
,
"月发电量"
,
"年发电量"
));
...
...
@@ -229,6 +257,11 @@ public class MonitoringServiceImpl {
completionOfPowerIndicatorsDto
.
setDailyPower
(
String
.
format
(
CommonConstans
.
Fourdecimalplaces
,
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
"日发电量"
)
*
CommonConstans
.
pvGenPoweActor
*
CommonConstans
.
pvGenPoweActorDay
));
completionOfPowerIndicatorsDto
.
setMonthlyPower
(
String
.
format
(
CommonConstans
.
Fourdecimalplaces
,
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
"月发电量"
)
*
CommonConstans
.
pvGenPoweActor
));
completionOfPowerIndicatorsDto
.
setAnnualPower
(
String
.
format
(
CommonConstans
.
Fourdecimalplaces
,
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
"年发电量"
)
*
CommonConstans
.
pvGenPoweActor
));
dailyPower
.
updateAndGet
(
v
->
v
+
keepFourdecimalPlaces
(
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
"日发电量"
)
*
CommonConstans
.
pvGenPoweActor
*
CommonConstans
.
pvGenPoweActorDay
));
monthlyPower
.
updateAndGet
(
v
->
v
+
keepFourdecimalPlaces
(
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
"月发电量"
)
*
CommonConstans
.
pvGenPoweActor
));
annualPower
.
updateAndGet
(
v
->
v
+
keepFourdecimalPlaces
(
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
"年发电量"
)
*
CommonConstans
.
pvGenPoweActor
));
gfzannualPower
.
updateAndGet
(
v
->
v
+
keepFourdecimalPlaces
(
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
"年发电量"
)
*
CommonConstans
.
pvGenPoweActor
));
gfzinstallCapacity
.
updateAndGet
(
v
->
v
+
Double
.
parseDouble
(
stationCacheInfoDto
.
getInstalledCapacity
()));
}
}
catch
(
Exception
exception
)
{
completionOfPowerIndicatorsDto
.
setWindSpeedOrIrradiance
(
"0"
);
...
...
@@ -239,82 +272,8 @@ public class MonitoringServiceImpl {
}
completionOfPowerIndicatorsDtoList
.
add
(
completionOfPowerIndicatorsDto
);
});
Integer
allsize
=
completionOfPowerIndicatorsDtoList
.
size
();
DataGridMock
dataGridMock
=
new
DataGridMock
(
current
,
allsize
,
false
,
allsize
/
size
+
1
,
completionOfPowerIndicatorsDtoList
);
ResultsData
resultsData
=
new
ResultsData
(
dataGridMock
,
colModels
);
return
resultsData
;
}
public
void
getCompletionOfPowerIndicatorsByCurrentData
(
List
<
StationCacheInfoDto
>
stationBasicList
,
String
provinceName
)
{
String
provinceNameTopic
=
""
;
if
(
provinceName
.
contains
(
"黑龙江"
)
||
provinceName
.
contains
(
"内蒙古"
))
{
provinceNameTopic
=
provinceName
.
substring
(
0
,
3
);
}
else
{
provinceNameTopic
=
provinceName
.
substring
(
0
,
2
);
}
HashMap
<
String
,
String
>
stringHashMap
=
new
HashMap
<>();
stringHashMap
.
put
(
"title"
,
provinceNameTopic
+
"区域"
);
try
{
emqKeeper
.
getMqttClient
().
publish
(
"proviceName_topic"
,
JSON
.
toJSON
(
stringHashMap
).
toString
().
getBytes
(
"UTF-8"
),
1
,
true
);
logger
.
info
(
"----------------------------------推送省份名称消息成功败--------------------------------"
);
}
catch
(
Exception
e
)
{
logger
.
info
(
"----------------------------------推送省份名称消息失败--------------------------------"
);
}
Page
<
SocialContributionDto
>
socialContributionDtoPage
=
new
Page
<
SocialContributionDto
>();
logger
.
error
(
"--------------------------区域实时数据消息开始发送----------------------------------------------"
);
List
<
SocialContributionDto
>
socialContributionDtoList
=
new
ArrayList
<>();
//日发电量
AtomicReference
<
Double
>
dailyPower
=
new
AtomicReference
<>(
0.0
);
//月发电量
AtomicReference
<
Double
>
monthlyPower
=
new
AtomicReference
<>(
0.0
);
//年发电量
AtomicReference
<
Double
>
annualPower
=
new
AtomicReference
<>(
0.0
);
//年发电量完成比例
String
completionRatio
=
"0.00"
;
//年利用小时数
int
year
=
Calendar
.
getInstance
().
get
(
Calendar
.
YEAR
);
List
<
String
>
fdz
=
stationBasicList
.
stream
().
map
(
StationCacheInfoDto:
:
getStationId
).
collect
(
Collectors
.
toList
());
LambdaQueryWrapper
<
StationPlan
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
queryWrapper
.
eq
(
StationPlan:
:
getYear
,
String
.
valueOf
(
year
));
queryWrapper
.
in
(
StationPlan:
:
getStationBasicId
,
fdz
);
List
<
StationPlan
>
fdzPlans
=
stationPlanMapper
.
selectList
(
queryWrapper
);
double
value
=
fdzPlans
.
stream
().
mapToDouble
(
StationPlan:
:
getValue
).
sum
();
AtomicReference
<
Double
>
useHours
=
new
AtomicReference
<>(
0.0
);
AtomicReference
<
Double
>
installCapacity
=
new
AtomicReference
<>(
0.0
);
AtomicReference
<
Double
>
fdzInstallCapacity
=
new
AtomicReference
<>(
0.0
);
AtomicReference
<
Double
>
gfzinstallCapacity
=
new
AtomicReference
<>(
0.0
);
//年发电量
AtomicReference
<
Double
>
fdzannualPower
=
new
AtomicReference
<>(
0.0
);
AtomicReference
<
Double
>
gfzannualPower
=
new
AtomicReference
<>(
0.0
);
stationBasicList
.
forEach
(
stationCacheInfoDto
->
{
Map
<
String
,
List
<
String
>>
queryMap
=
new
HashMap
<>();
queryMap
.
put
(
"equipmentIndexName.keyword"
,
Arrays
.
asList
(
"日发电量"
,
"月发电量"
,
"年发电量"
));
queryMap
.
put
(
"gatewayId.keyword"
,
Arrays
.
asList
(
stationCacheInfoDto
.
getFanGatewayId
()));
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
);
dailyPower
.
updateAndGet
(
v
->
v
+
keepFourdecimalPlaces
(
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
"日发电量"
)));
monthlyPower
.
updateAndGet
(
v
->
v
+
keepFourdecimalPlaces
(
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
"月发电量"
)));
annualPower
.
updateAndGet
(
v
->
v
+
keepFourdecimalPlaces
(
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
"年发电量"
)));
fdzannualPower
.
updateAndGet
(
v
->
v
+
keepFourdecimalPlaces
(
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
"年发电量"
)));
fdzInstallCapacity
.
updateAndGet
(
v
->
v
+
Double
.
parseDouble
(
stationCacheInfoDto
.
getInstalledCapacity
()));
}
else
{
Map
<
String
,
List
<
String
>>
queryCondtion
=
new
HashMap
<>();
queryCondtion
.
put
(
CommonConstans
.
QueryStringEquipmentIndexName
,
Arrays
.
asList
(
"日发电量"
,
"月发电量"
,
"年发电量"
));
queryCondtion
.
put
(
CommonConstans
.
QueryStringGateWayId
,
Arrays
.
asList
(
stationCacheInfoDto
.
getFanGatewayId
()));
Map
<
String
,
String
>
likeQuerCondtion
=
new
HashMap
<>();
likeQuerCondtion
.
put
(
CommonConstans
.
QueryStringFrontMoudle
,
"逆变器"
);
List
<
ESEquipments
>
result
=
commonServiceImpl
.
getListDataByCondtions
(
queryCondtion
,
null
,
ESEquipments
.
class
,
likeQuerCondtion
);
dailyPower
.
updateAndGet
(
v
->
v
+
keepFourdecimalPlaces
(
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
"日发电量"
)
*
CommonConstans
.
pvGenPoweActor
*
CommonConstans
.
pvGenPoweActorDay
));
monthlyPower
.
updateAndGet
(
v
->
v
+
keepFourdecimalPlaces
(
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
"月发电量"
)
*
CommonConstans
.
pvGenPoweActor
));
annualPower
.
updateAndGet
(
v
->
v
+
keepFourdecimalPlaces
(
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
"年发电量"
)
*
CommonConstans
.
pvGenPoweActor
));
gfzannualPower
.
updateAndGet
(
v
->
v
+
keepFourdecimalPlaces
(
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
"年发电量"
)
*
CommonConstans
.
pvGenPoweActor
));
gfzinstallCapacity
.
updateAndGet
(
v
->
v
+
Double
.
parseDouble
(
stationCacheInfoDto
.
getInstalledCapacity
()));
}
});
completionRatio
=
String
.
format
(
"%.2f"
,
(
annualPower
.
get
()
*
100
)
/
value
);
SocialContributionDto
dailyPowerdto
=
new
SocialContributionDto
();
dailyPowerdto
.
setTitle
(
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
dailyPower
.
get
()));
...
...
@@ -340,11 +299,117 @@ public class MonitoringServiceImpl {
socialContributionDtoPage
.
setTotal
(
100
);
socialContributionDtoPage
.
setCurrent
(
1
);
try
{
emqKeeper
.
getMqttClient
().
publish
(
"completionofpowerindicator_topic"
,
JSON
.
toJSON
(
socialContributionDtoPage
).
toString
().
getBytes
(
"UTF-8"
),
1
,
tru
e
);
emqKeeper
.
getMqttClient
().
publish
(
"completionofpowerindicator_topic"
,
JSON
.
toJSON
(
socialContributionDtoPage
).
toString
().
getBytes
(
"UTF-8"
),
1
,
fals
e
);
logger
.
info
(
"-----------------发送区域实时生产数据消息=================== 成功!"
+
JSON
.
toJSONString
(
socialContributionDtoPage
));
}
catch
(
Exception
exception
)
{
logger
.
error
(
"-----------------发送区域实时生产数据消息=================== 失败!"
);
}
Integer
allsize
=
completionOfPowerIndicatorsDtoList
.
size
();
DataGridMock
dataGridMock
=
new
DataGridMock
(
current
,
allsize
,
false
,
allsize
/
size
+
1
,
completionOfPowerIndicatorsDtoList
);
ResultsData
resultsData
=
new
ResultsData
(
dataGridMock
,
colModels
);
return
resultsData
;
}
public
void
getCompletionOfPowerIndicatorsByCurrentData
(
List
<
StationCacheInfoDto
>
stationBasicList
,
String
provinceName
)
{
String
provinceNameTopic
=
""
;
if
(
provinceName
.
contains
(
"黑龙江"
)
||
provinceName
.
contains
(
"内蒙古"
))
{
provinceNameTopic
=
provinceName
.
substring
(
0
,
3
);
}
else
{
provinceNameTopic
=
provinceName
.
substring
(
0
,
2
);
}
HashMap
<
String
,
String
>
stringHashMap
=
new
HashMap
<>();
stringHashMap
.
put
(
"title"
,
provinceNameTopic
+
"区域"
);
try
{
emqKeeper
.
getMqttClient
().
publish
(
"proviceName_topic"
,
JSON
.
toJSON
(
stringHashMap
).
toString
().
getBytes
(
"UTF-8"
),
1
,
true
);
logger
.
info
(
"----------------------------------推送省份名称消息成功败--------------------------------"
);
}
catch
(
Exception
e
)
{
logger
.
info
(
"----------------------------------推送省份名称消息失败--------------------------------"
);
}
// Page<SocialContributionDto> socialContributionDtoPage = new Page<SocialContributionDto>();
// logger.error("--------------------------区域实时数据消息开始发送----------------------------------------------");
// List<SocialContributionDto> socialContributionDtoList = new ArrayList<>();
// //日发电量
// AtomicReference<Double> dailyPower = new AtomicReference<>(0.0);
// //月发电量
// AtomicReference<Double> monthlyPower = new AtomicReference<>(0.0);
// //年发电量
// AtomicReference<Double> annualPower = new AtomicReference<>(0.0);
// //年发电量完成比例
// String completionRatio = "0.00";
// //年利用小时数
// int year = Calendar.getInstance().get(Calendar.YEAR);
// List<String> fdz = stationBasicList.stream().map(StationCacheInfoDto::getStationId).collect(Collectors.toList());
// LambdaQueryWrapper<StationPlan> queryWrapper = new LambdaQueryWrapper<>();
// queryWrapper.eq(StationPlan::getYear, String.valueOf(year));
// queryWrapper.in(StationPlan::getStationBasicId, fdz);
// List<StationPlan> fdzPlans = stationPlanMapper.selectList(queryWrapper);
// double value = fdzPlans.stream().mapToDouble(StationPlan::getValue).sum();
//
// AtomicReference<Double> useHours = new AtomicReference<>(0.0);
// AtomicReference<Double> installCapacity = new AtomicReference<>(0.0);
// AtomicReference<Double> fdzInstallCapacity = new AtomicReference<>(0.0);
// AtomicReference<Double> gfzinstallCapacity = new AtomicReference<>(0.0);
// //年发电量
// AtomicReference<Double> fdzannualPower = new AtomicReference<>(0.0);
// AtomicReference<Double> gfzannualPower = new AtomicReference<>(0.0);
// stationBasicList.forEach(stationCacheInfoDto -> {
// Map<String, List<String>> queryMap = new HashMap<>();
// queryMap.put("equipmentIndexName.keyword", Arrays.asList("日发电量", "月发电量", "年发电量"));
// queryMap.put("gatewayId.keyword", Arrays.asList(stationCacheInfoDto.getFanGatewayId()));
// 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);
// dailyPower.updateAndGet(v -> v + keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, "日发电量")));
// monthlyPower.updateAndGet(v -> v + keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, "月发电量")));
// annualPower.updateAndGet(v -> v + keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, "年发电量")));
// fdzannualPower.updateAndGet(v -> v + keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, "年发电量")));
// fdzInstallCapacity.updateAndGet(v -> v + Double.parseDouble(stationCacheInfoDto.getInstalledCapacity()));
// } else {
// Map<String, List<String>> queryCondtion = new HashMap<>();
// queryCondtion.put(CommonConstans.QueryStringEquipmentIndexName, Arrays.asList("日发电量", "月发电量", "年发电量"));
// queryCondtion.put(CommonConstans.QueryStringGateWayId, Arrays.asList(stationCacheInfoDto.getFanGatewayId()));
// Map<String, String> likeQuerCondtion = new HashMap<>();
// likeQuerCondtion.put(CommonConstans.QueryStringFrontMoudle, "逆变器");
// List<ESEquipments> result = commonServiceImpl.getListDataByCondtions(queryCondtion, null, ESEquipments.class, likeQuerCondtion);
// dailyPower.updateAndGet(v -> v + keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, "日发电量") * CommonConstans.pvGenPoweActor * CommonConstans.pvGenPoweActorDay));
// monthlyPower.updateAndGet(v -> v + keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, "月发电量") * CommonConstans.pvGenPoweActor));
// annualPower.updateAndGet(v -> v + keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, "年发电量") * CommonConstans.pvGenPoweActor));
// gfzannualPower.updateAndGet(v -> v + keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, "年发电量") * CommonConstans.pvGenPoweActor));
// gfzinstallCapacity.updateAndGet(v -> v + Double.parseDouble(stationCacheInfoDto.getInstalledCapacity()));
// }
// });
// completionRatio = String.format("%.2f", (annualPower.get() * 100) / value);
// SocialContributionDto dailyPowerdto = new SocialContributionDto();
// dailyPowerdto.setTitle(String.format(CommonConstans.Twodecimalplaces, dailyPower.get()));
// dailyPowerdto.setUnit("万kWh");
// SocialContributionDto monthlyPowerdto = new SocialContributionDto();
// monthlyPowerdto.setTitle(String.format(CommonConstans.Twodecimalplaces, monthlyPower.get()));
// monthlyPowerdto.setUnit("万kWh");
// SocialContributionDto annualPowerdto = new SocialContributionDto();
// annualPowerdto.setTitle(String.format(CommonConstans.Twodecimalplaces, annualPower.get()));
// annualPowerdto.setUnit("万kWh");
// SocialContributionDto completionRatioDto = new SocialContributionDto();
// completionRatioDto.setTitle(completionRatio);
// completionRatioDto.setUnit("%");
// SocialContributionDto useHoursDto = new SocialContributionDto();
// useHoursDto.setTitle(String.format(CommonConstans.Twodecimalplaces, (fdzannualPower.get() * CommonConstans.wkwhToMv / fdzInstallCapacity.get() + gfzannualPower.get() * CommonConstans.wkwhToMv / gfzinstallCapacity.get())));
// useHoursDto.setUnit("h");
// socialContributionDtoList.add(dailyPowerdto);
// socialContributionDtoList.add(monthlyPowerdto);
// socialContributionDtoList.add(annualPowerdto);
// socialContributionDtoList.add(completionRatioDto);
// socialContributionDtoList.add(useHoursDto);
// socialContributionDtoPage.setRecords(socialContributionDtoList);
// socialContributionDtoPage.setTotal(100);
// socialContributionDtoPage.setCurrent(1);
// try {
// emqKeeper.getMqttClient().publish("completionofpowerindicator_topic", JSON.toJSON(socialContributionDtoPage).toString().getBytes("UTF-8"), 1, false);
// logger.info("-----------------发送区域实时生产数据消息=================== 成功!" + JSON.toJSONString(socialContributionDtoPage));
// } catch (Exception exception) {
// logger.error("-----------------发送区域实时生产数据消息=================== 失败!");
// }
}
public
List
<
TabDto
>
getTabsByStationBasicId
(
String
stationBasicId
)
{
...
...
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