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
c1bf43fb
Commit
c1bf43fb
authored
Jul 18, 2023
by
caotao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
小数点问题修改
parent
79afe702
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
21 additions
and
21 deletions
+21
-21
MonitoringMapController.java
.../module/jxiop/biz/controller/MonitoringMapController.java
+2
-2
SocialContributionDto.java
...amos/boot/module/jxiop/biz/dto/SocialContributionDto.java
+1
-1
CommonServiceImpl.java
...boot/module/jxiop/biz/service/impl/CommonServiceImpl.java
+6
-6
MonitoringServiceIMQTTmpl.java
...ule/jxiop/biz/service/impl/MonitoringServiceIMQTTmpl.java
+9
-9
MonitoringServiceImpl.java
.../module/jxiop/biz/service/impl/MonitoringServiceImpl.java
+3
-3
No files found.
amos-boot-system-jxiop/amos-boot-module-jxiop-monitor-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/controller/MonitoringMapController.java
View file @
c1bf43fb
...
...
@@ -42,14 +42,14 @@ public class MonitoringMapController extends BaseController {
@Autowired
MonitoringServiceImpl
monitoringServiceImpl
;
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
value
=
"获取监盘全国地图数据"
)
@GetMapping
(
"/nationwide"
)
public
ResponseModel
<
List
<
RegionNationWideDto
>>
getNationWideInfo
(
@RequestParam
(
value
=
"provinceName"
,
required
=
false
)
String
provinceName
)
{
return
ResponseHelper
.
buildResponse
(
monitoringServiceImpl
.
getNationWideInfo
(
provinceName
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
value
=
"获取区域电量指标完成情况"
)
@GetMapping
(
"/getCompletionOfPowerIndicatorsByProvinceName"
)
public
ResponseModel
<
ResultsData
>
getCompletionOfPowerIndicatorsByProvinceName
(
@RequestParam
(
required
=
true
)
int
current
,
@RequestParam
(
required
=
true
)
int
size
,
@RequestParam
(
required
=
true
)
String
provinceName
)
{
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-monitor-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/dto/SocialContributionDto.java
View file @
c1bf43fb
...
...
@@ -7,7 +7,7 @@ public class SocialContributionDto {
/**
* 社会贡献值
*/
private
Double
title
;
private
String
title
;
/**
* 贡献单位
*/
...
...
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 @
c1bf43fb
...
...
@@ -36,7 +36,7 @@ public class CommonServiceImpl {
List
<
IndicatorsDto
>
indicatorsDtoList
=
influxDButils
.
getListData
(
sql
,
IndicatorsDto
.
class
);
List
<
Double
>
doubleList
=
indicatorsDtoList
.
stream
().
map
(
indicatorsDto
->
Double
.
parseDouble
(
indicatorsDto
.
getValue
())).
collect
(
Collectors
.
toList
());
totalvalue
=
doubleList
.
stream
().
mapToDouble
(
Double:
:
doubleValue
).
sum
();
return
Double
.
valueOf
(
String
.
format
(
"
.2f%
"
,
totalvalue
));
return
Double
.
valueOf
(
String
.
format
(
"
%.2f
"
,
totalvalue
));
}
/**
* @deprecated 获取指标值平均值
...
...
@@ -50,7 +50,7 @@ public class CommonServiceImpl {
List
<
IndicatorsDto
>
indicatorsDtoList
=
influxDButils
.
getListData
(
sql
,
IndicatorsDto
.
class
);
List
<
Double
>
doubleList
=
indicatorsDtoList
.
stream
().
map
(
indicatorsDto
->
Double
.
parseDouble
(
indicatorsDto
.
getValue
())).
collect
(
Collectors
.
toList
());
avageValue
=
doubleList
.
stream
().
mapToDouble
(
Double:
:
doubleValue
).
average
().
getAsDouble
();
return
Double
.
valueOf
(
String
.
format
(
"
.2f%
"
,
avageValue
));
return
Double
.
valueOf
(
String
.
format
(
"
%.2f
"
,
avageValue
));
}
public
Double
getStationCapactityByStationWerks
(
String
WERKS
){
...
...
@@ -77,16 +77,16 @@ public class CommonServiceImpl {
//二氧化硫计算公式 =A2*10000*0.16/1000/1000
*/
co2
.
setUnit
(
"二氧化碳减排量(万t)"
);
co2
.
setTitle
(
totalSocialContribution
*
0.000832
);
co2
.
setTitle
(
String
.
format
(
"%.2f"
,
totalSocialContribution
*
0.000832
)
);
socialContributionDtoList
.
add
(
co2
);
coal
.
setUnit
(
"节约标准煤(万t)"
);
coal
.
setTitle
(
totalSocialContribution
*
0.0003049
);
coal
.
setTitle
(
String
.
format
(
"%.2f"
,
totalSocialContribution
*
0.0003049
)
);
socialContributionDtoList
.
add
(
coal
);
toner
.
setUnit
(
"碳粉尘减排量(万t)"
);
toner
.
setTitle
(
totalSocialContribution
*
0.00032
);
toner
.
setTitle
(
String
.
format
(
"%.2f"
,
totalSocialContribution
*
0.00032
)
);
socialContributionDtoList
.
add
(
toner
);
so2
.
setUnit
(
"二氧化硫减排量(万t)"
);
so2
.
setTitle
(
totalSocialContribution
*
0.0016
);
so2
.
setTitle
(
String
.
format
(
"%.2f"
,
totalSocialContribution
*
0.0016
)
);
socialContributionDtoList
.
add
(
so2
);
socialContributionDtoPage
.
setRecords
(
socialContributionDtoList
);
socialContributionDtoPage
.
setTotal
(
100
);
...
...
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 @
c1bf43fb
...
...
@@ -104,16 +104,16 @@ public class MonitoringServiceIMQTTmpl {
//二氧化硫计算公式 =A2*10000*0.16/1000/1000
*/
co2
.
setUnit
(
"二氧化碳减排量(万t)"
);
co2
.
setTitle
(
totalSocialContribution
.
get
()
*
0.000832
);
co2
.
setTitle
(
String
.
format
(
"%.2f"
,
totalSocialContribution
.
get
()
*
0.000832
)
);
socialContributionDtoList
.
add
(
co2
);
coal
.
setUnit
(
"节约标准煤(万t)"
);
coal
.
setTitle
(
totalSocialContribution
.
get
()
*
0.0003049
);
coal
.
setTitle
(
String
.
format
(
"%.2f"
,
totalSocialContribution
.
get
()
*
0.0003049
)
);
socialContributionDtoList
.
add
(
coal
);
toner
.
setUnit
(
"碳粉尘减排量(万t)"
);
toner
.
setTitle
(
totalSocialContribution
.
get
()
*
0.00032
);
toner
.
setTitle
(
String
.
format
(
"%.2f"
,
totalSocialContribution
.
get
()
*
0.00032
)
);
socialContributionDtoList
.
add
(
toner
);
so2
.
setUnit
(
"二氧化硫减排量(万t)"
);
so2
.
setTitle
(
totalSocialContribution
.
get
()
*
0.0016
);
so2
.
setTitle
(
String
.
format
(
"%.2f"
,
totalSocialContribution
.
get
()
*
0.0016
)
);
socialContributionDtoList
.
add
(
so2
);
socialContributionDtoPage
.
setRecords
(
socialContributionDtoList
);
socialContributionDtoPage
.
setTotal
(
100
);
...
...
@@ -143,7 +143,7 @@ public class MonitoringServiceIMQTTmpl {
//年发电量
AtomicReference
<
Double
>
annualPower
=
new
AtomicReference
<>(
0.0
);
//年发电量完成比例
Double
completionRatio
=
23.11
;
String
completionRatio
=
"23.11"
;
//年利用小时数
AtomicReference
<
Double
>
useHours
=
new
AtomicReference
<>(
0.01
);
stationBasicList
.
forEach
(
stationBasic
->
{
...
...
@@ -153,19 +153,19 @@ public class MonitoringServiceIMQTTmpl {
useHours
.
updateAndGet
(
v
->
v
+
commonServiceImpl
.
getTotalByIndicatior
(
stationBasic
.
getFanGatewayId
(),
"日工作时间"
));
});
SocialContributionDto
dailyPowerdto
=
new
SocialContributionDto
();
dailyPowerdto
.
setTitle
(
dailyPower
.
get
(
));
dailyPowerdto
.
setTitle
(
String
.
format
(
"%.2f"
,
dailyPower
.
get
()
));
dailyPowerdto
.
setUnit
(
"万kWh"
);
SocialContributionDto
monthlyPowerdto
=
new
SocialContributionDto
();
monthlyPowerdto
.
setTitle
(
monthlyPower
.
get
(
));
monthlyPowerdto
.
setTitle
(
String
.
format
(
"%.2f"
,
monthlyPower
.
get
()
));
monthlyPowerdto
.
setUnit
(
"万kWh"
);
SocialContributionDto
annualPowerdto
=
new
SocialContributionDto
();
annualPowerdto
.
setTitle
(
annualPower
.
get
(
));
annualPowerdto
.
setTitle
(
String
.
format
(
"%.2f"
,
annualPower
.
get
()
));
annualPowerdto
.
setUnit
(
"万kWh"
);
SocialContributionDto
completionRatioDto
=
new
SocialContributionDto
();
completionRatioDto
.
setTitle
(
completionRatio
);
completionRatioDto
.
setUnit
(
"%"
);
SocialContributionDto
useHoursDto
=
new
SocialContributionDto
();
useHoursDto
.
setTitle
(
useHours
.
get
(
));
useHoursDto
.
setTitle
(
String
.
format
(
"%.2f"
,
useHours
.
get
()
));
useHoursDto
.
setUnit
(
"h"
);
socialContributionDtoList
.
add
(
dailyPowerdto
);
socialContributionDtoList
.
add
(
monthlyPowerdto
);
...
...
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 @
c1bf43fb
...
...
@@ -107,10 +107,10 @@ public class MonitoringServiceImpl {
regionNationWideDto
.
setGuangfuMW
(
"0"
);
regionNationWideDto
.
setFengdianMV
(
"0"
);
if
(!
ObjectUtils
.
isEmpty
(
guangfuMW
.
get
()))
{
regionNationWideDto
.
setGuangfuMW
(
guangfuMW
.
toString
(
));
regionNationWideDto
.
setGuangfuMW
(
String
.
format
(
"%.2f"
,
guangfuMW
.
get
()
));
}
if
(!
ObjectUtils
.
isEmpty
(
fengdianMW
.
get
()))
{
regionNationWideDto
.
setFengdianMV
(
fengdianMW
.
toString
(
));
regionNationWideDto
.
setFengdianMV
(
String
.
format
(
"%.2f"
,
fengdianMW
.
get
()
));
}
regionNationWideDto
.
setName
(
region
.
getRegionName
());
regionNationWideDtoList
.
add
(
regionNationWideDto
);
...
...
@@ -178,7 +178,7 @@ public class MonitoringServiceImpl {
completionOfPowerIndicatorsDto
.
setStationName
(
stationBasic
.
getStationName
());
completionOfPowerIndicatorsDto
.
setInstallCapactity
(
"0"
);
if
(
getStationCaPACITYL
(
stationBasic
.
getStationNumber
())
!=
null
)
{
completionOfPowerIndicatorsDto
.
setInstallCapactity
(
String
.
valueOf
(
getStationCaPACITYL
(
stationBasic
.
getStationNumber
())));
completionOfPowerIndicatorsDto
.
setInstallCapactity
(
String
.
format
(
"%.2f"
,
getStationCaPACITYL
(
stationBasic
.
getStationNumber
())));
}
try
{
completionOfPowerIndicatorsDto
.
setWindSpeedOrIrradiance
(
String
.
valueOf
(
commonServiceImpl
.
getAvgvalueByIndicatior
(
stationBasic
.
getFanGatewayId
(),
"30秒平均风速"
)));
...
...
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