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
5b39e643
Commit
5b39e643
authored
May 29, 2024
by
朱晨阳
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/developer' into developer
parents
cc688c20
d6f08601
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
148 additions
and
19 deletions
+148
-19
StationPlanMapper.java
.../amos/boot/module/jxiop/api/mapper/StationPlanMapper.java
+8
-0
EarningsForecastController.java
...dule/jxiop/biz/controller/EarningsForecastController.java
+10
-1
EarningsForecastImpl.java
...t/module/jxiop/biz/service/impl/EarningsForecastImpl.java
+99
-13
AppletMonitorController.java
.../module/jxiop/biz/controller/AppletMonitorController.java
+1
-1
AppletMonitorServiceImpl.java
...dule/jxiop/biz/service/impl/AppletMonitorServiceImpl.java
+30
-4
No files found.
amos-boot-system-jxiop/amos-boot-module-jxiop-api/src/main/java/com/yeejoin/amos/boot/module/jxiop/api/mapper/StationPlanMapper.java
View file @
5b39e643
...
@@ -27,5 +27,13 @@ public interface StationPlanMapper extends BaseMapper<StationPlan> {
...
@@ -27,5 +27,13 @@ public interface StationPlanMapper extends BaseMapper<StationPlan> {
@Select
(
"select value from station_plan where station_basic_id=#{stationBasicId} and year= #{year} and monthly= #{monthly}"
)
@Select
(
"select value from station_plan where station_basic_id=#{stationBasicId} and year= #{year} and monthly= #{monthly}"
)
Double
getPlanGenByStationIdAndMonth
(
@Param
(
"stationBasicId"
)
String
stationId
,
@Param
(
"year"
)
String
year
,
@Param
(
"monthly"
)
String
monthly
);
Double
getPlanGenByStationIdAndMonth
(
@Param
(
"stationBasicId"
)
String
stationId
,
@Param
(
"year"
)
String
year
,
@Param
(
"monthly"
)
String
monthly
);
@Select
(
"select value,monthly from station_plan where station_basic_id=#{stationBasicId} and year= #{year} "
)
List
<
StationPlan
>
getPlanGenByStationIdAndYear
(
@Param
(
"stationBasicId"
)
String
stationId
,
@Param
(
"year"
)
String
year
);
@Select
(
"select value,monthly from station_plan where station_basic_id in (${stationBasicId}) and year= #{year} "
)
List
<
StationPlan
>
getPlansGenByStationIdAndYear
(
@Param
(
"stationBasicId"
)
String
stationId
,
@Param
(
"year"
)
String
year
);
}
}
amos-boot-system-jxiop/amos-boot-module-jxiop-bigscreen-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/controller/EarningsForecastController.java
View file @
5b39e643
...
@@ -47,7 +47,16 @@ public class EarningsForecastController {
...
@@ -47,7 +47,16 @@ public class EarningsForecastController {
public
ResponseModel
<
Object
>
earningsForecast
(
@RequestParam
(
required
=
true
,
value
=
"stationId"
)
Long
stationId
,
public
ResponseModel
<
Object
>
earningsForecast
(
@RequestParam
(
required
=
true
,
value
=
"stationId"
)
Long
stationId
,
@RequestParam
(
required
=
true
,
value
=
"type"
)
String
type
){
@RequestParam
(
required
=
true
,
value
=
"type"
)
String
type
){
return
ResponseHelper
.
buildResponse
(
earningsForecast
.
earningsForecast
(
stationId
,
type
));
return
ResponseHelper
.
buildResponse
(
earningsForecast
.
earningsForecastZXT
(
stationId
,
type
));
}
@RequestMapping
(
value
=
"earningsForecastSJQXT"
,
method
=
RequestMethod
.
GET
)
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
public
ResponseModel
<
Object
>
earningsForecastSJQXT
(
@RequestParam
(
required
=
true
,
value
=
"stationId"
)
Long
stationId
,
@RequestParam
(
required
=
true
,
value
=
"type"
)
String
type
){
return
ResponseHelper
.
buildResponse
(
earningsForecast
.
earningsForecastSJQXT
(
stationId
,
type
));
}
}
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-bigscreen-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/EarningsForecastImpl.java
View file @
5b39e643
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
biz
.
service
.
impl
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
biz
.
service
.
impl
;
import
cn.hutool.core.map.MapBuilder
;
import
cn.hutool.http.HttpUtil
;
import
cn.hutool.http.HttpUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONArray
;
...
@@ -10,6 +11,7 @@ import com.yeejoin.amos.boot.module.jxiop.api.mapper.StationBasicMapper;
...
@@ -10,6 +11,7 @@ import com.yeejoin.amos.boot.module.jxiop.api.mapper.StationBasicMapper;
import
com.yeejoin.amos.boot.module.jxiop.biz.ESDto.ESMoonPowerGeneration
;
import
com.yeejoin.amos.boot.module.jxiop.biz.ESDto.ESMoonPowerGeneration
;
import
com.yeejoin.amos.boot.module.jxiop.biz.constants.CommonConstans
;
import
com.yeejoin.amos.boot.module.jxiop.biz.constants.CommonConstans
;
import
com.yeejoin.amos.boot.module.jxiop.biz.mapper2.CommonMapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.mapper2.CommonMapper
;
import
org.checkerframework.checker.units.qual.A
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
...
@@ -29,8 +31,8 @@ public class EarningsForecastImpl {
...
@@ -29,8 +31,8 @@ public class EarningsForecastImpl {
private
String
forecastUrl
;
private
String
forecastUrl
;
@Autowired
@Autowired
private
StationBasicMapper
stationBasicMapper
;
private
StationBasicMapper
stationBasicMapper
;
//收益 时间曲线图数据组装
public
Object
earningsForecast
(
Long
stationId
,
String
type
){
public
Object
earningsForecast
SJQXT
(
Long
stationId
,
String
type
){
List
<
Map
<
String
,
String
>>
list
=
commonMapper
.
selectAgo10Month
();
List
<
Map
<
String
,
String
>>
list
=
commonMapper
.
selectAgo10Month
();
List
<
Map
<
String
,
String
>>
lastThreeMonth
=
commonMapper
.
selectLast3Month
();
List
<
Map
<
String
,
String
>>
lastThreeMonth
=
commonMapper
.
selectLast3Month
();
...
@@ -54,17 +56,17 @@ public class EarningsForecastImpl {
...
@@ -54,17 +56,17 @@ public class EarningsForecastImpl {
});
});
TreeMap
<
String
,
Double
>
map
=
commonService
.
getListDataByCondtionsSum
(
queryCondtion1
,
objects
,
ESMoonPowerGeneration
.
class
,
null
);
TreeMap
<
String
,
Double
>
map
=
commonService
.
getListDataByCondtionsSum
(
queryCondtion1
,
objects
,
ESMoonPowerGeneration
.
class
,
null
);
TreeMap
<
String
,
Double
>
carbonDioxide
=
new
TreeMap
<>();
TreeMap
<
String
,
String
>
carbonDioxide
=
new
TreeMap
<>();
TreeMap
<
String
,
Double
>
standardCoal
=
new
TreeMap
<>();
TreeMap
<
String
,
String
>
standardCoal
=
new
TreeMap
<>();
TreeMap
<
String
,
Double
>
toner
=
new
TreeMap
<>();
TreeMap
<
String
,
String
>
toner
=
new
TreeMap
<>();
TreeMap
<
String
,
Double
>
sulfurDioxide
=
new
TreeMap
<>();
TreeMap
<
String
,
String
>
sulfurDioxide
=
new
TreeMap
<>();
//计算历史月发电量的收益
//计算历史月发电量的收益
map
.
keySet
().
forEach
(
e
->{
map
.
keySet
().
forEach
(
e
->{
carbonDioxide
.
put
(
months
.
get
(
e
),
Double
.
valueOf
(
String
.
format
(
"%.3f"
,
map
.
get
(
e
)
*
CommonConstans
.
carbonDioxide
)
));
carbonDioxide
.
put
(
months
.
get
(
e
),
String
.
format
(
"%.3f"
,
map
.
get
(
e
)
*
CommonConstans
.
carbonDioxide
));
standardCoal
.
put
(
months
.
get
(
e
),
Double
.
valueOf
(
String
.
format
(
"%.3f"
,
map
.
get
(
e
)
*
CommonConstans
.
standardCoal
)
));
standardCoal
.
put
(
months
.
get
(
e
),
String
.
format
(
"%.3f"
,
map
.
get
(
e
)
*
CommonConstans
.
standardCoal
));
toner
.
put
(
months
.
get
(
e
),
Double
.
valueOf
(
String
.
format
(
"%.3f"
,
map
.
get
(
e
)
*
CommonConstans
.
toner
)
));
toner
.
put
(
months
.
get
(
e
),
String
.
format
(
"%.3f"
,
map
.
get
(
e
)
*
CommonConstans
.
toner
));
sulfurDioxide
.
put
(
months
.
get
(
e
),
Double
.
valueOf
(
String
.
format
(
"%.3f"
,
map
.
get
(
e
)
*
CommonConstans
.
sulfurDioxide
)
));
sulfurDioxide
.
put
(
months
.
get
(
e
),
String
.
format
(
"%.3f"
,
map
.
get
(
e
)
*
CommonConstans
.
sulfurDioxide
));
});
});
...
@@ -120,8 +122,81 @@ public class EarningsForecastImpl {
...
@@ -120,8 +122,81 @@ public class EarningsForecastImpl {
}
}
//收益 折线图数据组装
public
Object
earningsForecastZXT
(
Long
stationId
,
String
type
){
List
<
Map
<
String
,
String
>>
list
=
commonMapper
.
selectAgo10Month
();
List
<
Map
<
String
,
String
>>
lastThreeMonth
=
commonMapper
.
selectLast3Month
();
Map
<
String
,
List
<
String
>>
queryCondtion1
=
new
HashMap
<>();
StationBasic
stationBasic
=
stationBasicMapper
.
selectById
(
stationId
);
if
(
type
.
equals
(
"FDZ"
)){
queryCondtion1
.
put
(
CommonConstans
.
QueryStringGateWayId
,
Arrays
.
asList
(
stationBasic
.
getFanGatewayId
()));
}
else
{
queryCondtion1
.
put
(
CommonConstans
.
QueryStringGateWayId
,
Arrays
.
asList
(
stationBasic
.
getBoosterGatewayId
()));
}
List
<
Map
<
String
,
String
>>
objects
=
new
ArrayList
<>();
TreeMap
<
String
,
String
>
months
=
new
TreeMap
<>();
list
.
forEach
(
e
->{
Map
<
String
,
String
>
likeQueryCondtion
=
new
HashMap
<>();
likeQueryCondtion
.
put
(
"id.keyword"
,
e
.
get
(
"MonthYear"
)+
"*"
);
objects
.
add
(
likeQueryCondtion
);
String
key
=
e
.
get
(
"MonthYear"
).
split
(
"-"
)[
1
];
months
.
put
(
String
.
valueOf
(
Integer
.
parseInt
(
key
)),
e
.
get
(
"MonthYear"
));
});
TreeMap
<
String
,
Double
>
map
=
commonService
.
getListDataByCondtionsSum
(
queryCondtion1
,
objects
,
ESMoonPowerGeneration
.
class
,
null
);
TreeMap
<
String
,
String
>
carbonDioxide
=
new
TreeMap
<>();
TreeMap
<
String
,
String
>
standardCoal
=
new
TreeMap
<>();
TreeMap
<
String
,
String
>
toner
=
new
TreeMap
<>();
TreeMap
<
String
,
String
>
sulfurDioxide
=
new
TreeMap
<>();
//计算历史月发电量的收益
map
.
keySet
().
forEach
(
e
->{
carbonDioxide
.
put
(
months
.
get
(
e
),
String
.
format
(
"%.3f"
,
map
.
get
(
e
)
*
CommonConstans
.
carbonDioxide
));
standardCoal
.
put
(
months
.
get
(
e
),
String
.
format
(
"%.3f"
,
map
.
get
(
e
)
*
CommonConstans
.
standardCoal
));
toner
.
put
(
months
.
get
(
e
),
String
.
format
(
"%.3f"
,
map
.
get
(
e
)
*
CommonConstans
.
toner
));
sulfurDioxide
.
put
(
months
.
get
(
e
),
String
.
format
(
"%.3f"
,
map
.
get
(
e
)
*
CommonConstans
.
sulfurDioxide
));
});
//查询预测收益接口
JSONObject
carbonDioxideData
=
getResponse
(
"二氧化碳减排量"
,
carbonDioxide
.
values
().
stream
().
collect
(
Collectors
.
toList
()));
JSONObject
standardCoalData
=
getResponse
(
"标准煤减排量"
,
standardCoal
.
values
().
stream
().
collect
(
Collectors
.
toList
()));
JSONObject
tonerData
=
getResponse
(
"炭粉尘减排量"
,
toner
.
values
().
stream
().
collect
(
Collectors
.
toList
()));
JSONObject
sulfurDioxideData
=
getResponse
(
"二氧化硫减排量"
,
sulfurDioxide
.
values
().
stream
().
collect
(
Collectors
.
toList
()));
Map
<
String
,
Object
>
carbonDioxideMap
=
this
.
buildDataNew
(
carbonDioxideData
);
Map
<
String
,
Object
>
standardCoalMap
=
this
.
buildDataNew
(
standardCoalData
);
Map
<
String
,
Object
>
tonerDataMap
=
this
.
buildDataNew
(
tonerData
);
Map
<
String
,
Object
>
sulfurDioxideMap
=
this
.
buildDataNew
(
sulfurDioxideData
);
List
<
Map
<
String
,
Object
>>
dataList
=
new
ArrayList
<>();
dataList
.
add
(
MapBuilder
.<
String
,
Object
>
create
().
put
(
"data"
,
carbonDioxide
.
values
()).
build
());
dataList
.
add
(
MapBuilder
.<
String
,
Object
>
create
().
put
(
"data"
,
standardCoal
.
values
()).
build
());
dataList
.
add
(
MapBuilder
.<
String
,
Object
>
create
().
put
(
"data"
,
toner
.
values
()).
build
());
dataList
.
add
(
MapBuilder
.<
String
,
Object
>
create
().
put
(
"data"
,
sulfurDioxide
.
values
()).
build
());
dataList
.
add
(
carbonDioxideMap
);
dataList
.
add
(
standardCoalMap
);
dataList
.
add
(
tonerDataMap
);
dataList
.
add
(
sulfurDioxideMap
);
List
<
String
>
axisData
=
new
ArrayList
<>();
lastThreeMonth
.
forEach
(
e
->{
axisData
.
add
(
e
.
get
(
"MonthYear"
))
;
});
List
<
String
>
data
=
new
ArrayList
<>(
carbonDioxide
.
keySet
());
data
.
addAll
(
axisData
);
return
MapBuilder
.<
String
,
Object
>
create
().
put
(
"axisData"
,
data
).
put
(
"seriesData"
,
dataList
).
build
();
}
List
<
List
<
String
>>
buildResultData
(
TreeMap
<
String
,
Double
>
map
){
List
<
List
<
String
>>
buildResultData
(
TreeMap
<
String
,
String
>
map
){
List
<
List
<
String
>>
lists
=
new
ArrayList
<>();
List
<
List
<
String
>>
lists
=
new
ArrayList
<>();
map
.
keySet
().
forEach
(
e
->{
map
.
keySet
().
forEach
(
e
->{
List
<
String
>
list
=
Arrays
.
asList
(
e
,
String
.
valueOf
(
map
.
get
(
e
)));
List
<
String
>
list
=
Arrays
.
asList
(
e
,
String
.
valueOf
(
map
.
get
(
e
)));
...
@@ -132,7 +207,7 @@ public class EarningsForecastImpl {
...
@@ -132,7 +207,7 @@ public class EarningsForecastImpl {
}
}
String
buildParams
(
String
name
,
List
<
Double
>
values
){
String
buildParams
(
String
name
,
List
<
String
>
values
){
HashMap
<
Object
,
Object
>
requestParams
=
new
HashMap
<>();
HashMap
<
Object
,
Object
>
requestParams
=
new
HashMap
<>();
HashMap
<
Object
,
Object
>
valueLabel
=
new
HashMap
<>();
HashMap
<
Object
,
Object
>
valueLabel
=
new
HashMap
<>();
...
@@ -158,7 +233,7 @@ public class EarningsForecastImpl {
...
@@ -158,7 +233,7 @@ public class EarningsForecastImpl {
}
}
JSONObject
getResponse
(
String
name
,
List
<
Double
>
values
){
JSONObject
getResponse
(
String
name
,
List
<
String
>
values
){
String
requestParam
=
buildParams
(
name
,
values
);
String
requestParam
=
buildParams
(
name
,
values
);
Map
<
String
,
String
>
hashMaphead
=
new
HashMap
<>();
Map
<
String
,
String
>
hashMaphead
=
new
HashMap
<>();
hashMaphead
.
put
(
"Content-Type"
,
"application/x-www-form-urlencoded;charset=utf-8"
);
hashMaphead
.
put
(
"Content-Type"
,
"application/x-www-form-urlencoded;charset=utf-8"
);
...
@@ -181,6 +256,17 @@ public class EarningsForecastImpl {
...
@@ -181,6 +256,17 @@ public class EarningsForecastImpl {
return
newList
;
return
newList
;
}
}
Map
<
String
,
Object
>
buildDataNew
(
JSONObject
forecastObj
){
JSONObject
dataObject
=
forecastObj
.
getJSONObject
(
"data"
);
// 从data对象中提取forecast和history数组
JSONArray
forecastArray
=
dataObject
.
getJSONArray
(
"forecast"
);
JSONArray
historyArray
=
dataObject
.
getJSONArray
(
"history"
);
forecastArray
.
addAll
(
historyArray
);
return
MapBuilder
.<
String
,
Object
>
create
().
put
(
"data"
,
forecastArray
).
build
();
}
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-monitor-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/controller/AppletMonitorController.java
View file @
5b39e643
...
@@ -7,6 +7,7 @@ import com.yeejoin.amos.boot.module.jxiop.api.dto.StationBasicDto;
...
@@ -7,6 +7,7 @@ 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.entity.StationBasic
;
import
com.yeejoin.amos.boot.module.jxiop.api.mapper.MonitorFanIndicatorMapper
;
import
com.yeejoin.amos.boot.module.jxiop.api.mapper.MonitorFanIndicatorMapper
;
import
com.yeejoin.amos.boot.module.jxiop.api.mapper.StationBasicMapper
;
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.api.util.CommonResponse
;
import
com.yeejoin.amos.boot.module.jxiop.api.util.CommonResponse
;
import
com.yeejoin.amos.boot.module.jxiop.biz.ESDto.ESEquipments
;
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.constants.CommonConstans
;
...
@@ -39,7 +40,6 @@ public class AppletMonitorController {
...
@@ -39,7 +40,6 @@ public class AppletMonitorController {
@Autowired
@Autowired
StationBasicMapper
stationBasicMapper
;
StationBasicMapper
stationBasicMapper
;
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"风机布置图-总概览"
)
@ApiOperation
(
value
=
"风机布置图-总概览"
)
@GetMapping
(
"/CockpitData"
)
@GetMapping
(
"/CockpitData"
)
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-monitor-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/AppletMonitorServiceImpl.java
View file @
5b39e643
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
biz
.
service
.
impl
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
biz
.
service
.
impl
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yeejoin.amos.boot.biz.common.dto.BaseDto
;
import
com.yeejoin.amos.boot.biz.common.utils.DateUtils
;
import
com.yeejoin.amos.boot.module.jxiop.api.dto.StationBasicDto
;
import
com.yeejoin.amos.boot.module.jxiop.api.dto.StationBasicDto
;
import
com.yeejoin.amos.boot.module.jxiop.api.entity.StationPlan
;
import
com.yeejoin.amos.boot.module.jxiop.api.feign.IdxFeign
;
import
com.yeejoin.amos.boot.module.jxiop.api.feign.IdxFeign
;
import
com.yeejoin.amos.boot.module.jxiop.api.amosprojectmapper.CompanyMapper
;
import
com.yeejoin.amos.boot.module.jxiop.api.amosprojectmapper.CompanyMapper
;
import
com.yeejoin.amos.boot.module.jxiop.api.mapper.StationBasicMapper
;
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.ESDto.ESEquipments
;
import
com.yeejoin.amos.boot.module.jxiop.biz.constants.CommonConstans
;
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.ESEquipmentsDTO
;
...
@@ -37,11 +41,14 @@ public class AppletMonitorServiceImpl {
...
@@ -37,11 +41,14 @@ public class AppletMonitorServiceImpl {
IdxFeign
idxFeign
;
IdxFeign
idxFeign
;
@Autowired
@Autowired
AmosRequestContext
requestContext
;
AmosRequestContext
requestContext
;
@Autowired
StationPlanMapper
stationPlanMapper
;
public
Map
<
String
,
Object
>
getFanStationInfo
(
StationBasicDto
stationBasic
){
public
Map
<
String
,
Object
>
getFanStationInfo
(
StationBasicDto
stationBasic
){
List
<
StationPlan
>
planPower
=
stationPlanMapper
.
getPlanGenByStationIdAndYear
(
String
.
valueOf
(
stationBasic
.
getSequenceNbr
()),
String
.
valueOf
(
DateUtils
.
getYear
(
new
Date
())));
String
gatewayId
=
stationBasic
.
getFanGatewayId
();
String
gatewayId
=
stationBasic
.
getFanGatewayId
();
Map
<
String
,
Object
>
columnMap
=
new
HashMap
<>();
Map
<
String
,
Object
>
columnMap
=
new
HashMap
<>();
Map
<
String
,
List
<
String
>>
queryCondtion
=
new
HashMap
<>();
Map
<
String
,
List
<
String
>>
queryCondtion
=
new
HashMap
<>();
...
@@ -87,6 +94,12 @@ public class AppletMonitorServiceImpl {
...
@@ -87,6 +94,12 @@ public class AppletMonitorServiceImpl {
});
});
data
.
put
(
"value"
,
stationMark
.
get
(
"value"
));
data
.
put
(
"value"
,
stationMark
.
get
(
"value"
));
double
yearPower
=
planPower
.
stream
().
mapToDouble
(
StationPlan:
:
getValue
).
sum
();
Double
monthPower
=
planPower
.
stream
().
filter
(
e
->
e
.
getMonthly
().
equals
(
DateUtils
.
getMonth
(
new
Date
()))).
findFirst
().
get
().
getValue
();
double
dayPower
=
monthPower
/
DateUtils
.
getDaysOfMonth
(
new
Date
());
data
.
put
(
"yearPower"
,
yearPower
);
data
.
put
(
"monthPower"
,
monthPower
);
data
.
put
(
"dayPower"
,
dayPower
);
return
data
;
return
data
;
}
}
...
@@ -146,7 +159,14 @@ public class AppletMonitorServiceImpl {
...
@@ -146,7 +159,14 @@ public class AppletMonitorServiceImpl {
data
.
put
(
e
,
stationMark
.
get
(
e
));
data
.
put
(
e
,
stationMark
.
get
(
e
));
});
});
data
.
put
(
"value"
,
stationMark
.
get
(
"value"
));
data
.
put
(
"value"
,
stationMark
.
get
(
"value"
));
//计划发电量
List
<
StationPlan
>
planPower
=
stationPlanMapper
.
getPlanGenByStationIdAndYear
(
String
.
valueOf
(
stationBasic
.
getSequenceNbr
()),
String
.
valueOf
(
DateUtils
.
getYear
(
new
Date
())));
double
yearPower
=
planPower
.
stream
().
mapToDouble
(
StationPlan:
:
getValue
).
sum
();
Double
monthPower
=
planPower
.
stream
().
filter
(
e
->
e
.
getMonthly
().
equals
(
DateUtils
.
getMonth
(
new
Date
()))).
findFirst
().
get
().
getValue
();
double
dayPower
=
monthPower
/
DateUtils
.
getDaysOfMonth
(
new
Date
());
data
.
put
(
"yearPower"
,
yearPower
);
data
.
put
(
"monthPower"
,
monthPower
);
data
.
put
(
"dayPower"
,
dayPower
);
return
data
;
return
data
;
}
}
...
@@ -158,8 +178,6 @@ public class AppletMonitorServiceImpl {
...
@@ -158,8 +178,6 @@ public class AppletMonitorServiceImpl {
double
installedCapacity
=
stations
.
stream
().
mapToDouble
(
StationBasicDto:
:
getInstalledCapacity
).
sum
();
double
installedCapacity
=
stations
.
stream
().
mapToDouble
(
StationBasicDto:
:
getInstalledCapacity
).
sum
();
result
.
put
(
"installedCapacity"
,
String
.
format
(
"%.2f"
,
installedCapacity
));
result
.
put
(
"installedCapacity"
,
String
.
format
(
"%.2f"
,
installedCapacity
));
Map
<
String
,
List
<
String
>>
queryCondtion
=
new
HashMap
<>();
Map
<
String
,
List
<
String
>>
queryCondtion
=
new
HashMap
<>();
queryCondtion
.
put
(
CommonConstans
.
QueryStringEquipmentIndexName
,
Arrays
.
asList
(
"南瑞光差保护_313P"
,
"WTX-801_25_WTX-801_总辐射累计"
,
"WTX-801_25_WTX-801_总辐射"
,
"313光差保护_总反向有功电度"
));
queryCondtion
.
put
(
CommonConstans
.
QueryStringEquipmentIndexName
,
Arrays
.
asList
(
"南瑞光差保护_313P"
,
"WTX-801_25_WTX-801_总辐射累计"
,
"WTX-801_25_WTX-801_总辐射"
,
"313光差保护_总反向有功电度"
));
queryCondtion
.
put
(
CommonConstans
.
QueryStringGateWayId
,
stations
.
stream
().
map
(
StationBasicDto:
:
getBoosterGatewayId
).
collect
(
Collectors
.
toList
()));
queryCondtion
.
put
(
CommonConstans
.
QueryStringGateWayId
,
stations
.
stream
().
map
(
StationBasicDto:
:
getBoosterGatewayId
).
collect
(
Collectors
.
toList
()));
...
@@ -230,7 +248,15 @@ public class AppletMonitorServiceImpl {
...
@@ -230,7 +248,15 @@ public class AppletMonitorServiceImpl {
result
.
put
(
"monthPowerGeneration"
,
String
.
format
(
"%.4f"
,
monthPowerGeneration
));
result
.
put
(
"monthPowerGeneration"
,
String
.
format
(
"%.4f"
,
monthPowerGeneration
));
result
.
put
(
"yearPowerGeneration"
,
String
.
format
(
"%.4f"
,
yearPowerGeneration
));
result
.
put
(
"yearPowerGeneration"
,
String
.
format
(
"%.4f"
,
yearPowerGeneration
));
List
<
String
>
collect1
=
stations
.
stream
().
map
(
BaseDto:
:
getSequenceNbr
).
map
(
String:
:
valueOf
).
collect
(
Collectors
.
toList
());
String
join
=
String
.
join
(
","
,
collect1
);
List
<
StationPlan
>
plansPower
=
stationPlanMapper
.
getPlansGenByStationIdAndYear
(
join
,
String
.
valueOf
(
DateUtils
.
getYear
(
new
Date
())));
double
yearPower
=
plansPower
.
stream
().
mapToDouble
(
StationPlan:
:
getValue
).
sum
();
Double
monthPower
=
plansPower
.
stream
().
filter
(
e
->
e
.
getMonthly
().
equals
(
DateUtils
.
getMonth
(
new
Date
()))).
mapToDouble
(
StationPlan:
:
getValue
).
sum
();
double
dayPower
=
monthPower
/
DateUtils
.
getDaysOfMonth
(
new
Date
());
result
.
put
(
"yearPower"
,
yearPower
);
result
.
put
(
"monthPower"
,
monthPower
);
result
.
put
(
"dayPower"
,
dayPower
);
return
result
;
return
result
;
}
}
...
...
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