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
843caafd
Commit
843caafd
authored
Jul 04, 2024
by
hezhuozhi
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/developer' into developer
parents
f35e8410
17cfda8c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
3 deletions
+25
-3
EnergyAccessServiceImpl.java
...odule/jxiop/biz/service/impl/EnergyAccessServiceImpl.java
+25
-3
No files found.
amos-boot-system-jxiop/amos-boot-module-jxiop-bigscreen-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/EnergyAccessServiceImpl.java
View file @
843caafd
...
...
@@ -12,6 +12,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.CollectionUtils
;
import
java.math.BigDecimal
;
import
java.time.LocalDate
;
import
java.time.format.DateTimeFormatter
;
import
java.util.Arrays
;
...
...
@@ -47,7 +48,14 @@ public class EnergyAccessServiceImpl implements EnergyAccessService {
List
returnList
=
data
.
getJSONArray
(
"data"
);
logger
.
info
(
"获取并网容量接口调用对端返回结果:{}"
,
returnList
.
toString
());
Page
<
Map
<
String
,
Object
>>
pageIPage
;
returnList
.
forEach
(
result
->
{
JSONObject
jsonObject
=
(
JSONObject
)
result
;
String
actualInstalledCapacity
=
jsonObject
.
getString
(
"actual_installed_capacity"
);
if
(
StringUtils
.
isNotEmpty
(
actualInstalledCapacity
))
{
BigDecimal
bd
=
new
BigDecimal
(
actualInstalledCapacity
);
jsonObject
.
put
(
"actual_installed_capacity"
,
bd
.
setScale
(
4
,
BigDecimal
.
ROUND_HALF_UP
));
}
});
int
newCurrent
=
Integer
.
parseInt
(
current
);
int
newPageSize
=
Integer
.
parseInt
(
pageSize
);
if
(
StringUtils
.
isBlank
(
pageSize
)
||
StringUtils
.
isBlank
(
pageSize
))
{
...
...
@@ -114,9 +122,23 @@ public class EnergyAccessServiceImpl implements EnergyAccessService {
String
newRate
=
""
;
if
(
StringUtils
.
isNotEmpty
(
rate
))
{
newRate
=
rate
.
replace
(
"%"
,
""
);
jsonObject
.
put
(
"rate"
,
newRate
);
BigDecimal
bd
=
new
BigDecimal
(
newRate
);
jsonObject
.
put
(
"rate"
,
bd
.
setScale
(
4
,
BigDecimal
.
ROUND_HALF_UP
));
}
jsonObject
.
put
(
"seriesData"
,
StringUtils
.
isNotEmpty
(
newRate
)
?
Arrays
.
asList
(
Double
.
parseDouble
(
newRate
))
:
0
D
);
String
quota
=
jsonObject
.
getString
(
"quota"
);
if
(
StringUtils
.
isNotEmpty
(
quota
))
{
BigDecimal
bd
=
new
BigDecimal
(
quota
);
jsonObject
.
put
(
"quota"
,
bd
.
setScale
(
4
,
BigDecimal
.
ROUND_HALF_UP
));
}
String
generatingCapacity
=
jsonObject
.
getString
(
"generating_capacity"
);
if
(
StringUtils
.
isNotEmpty
(
generatingCapacity
))
{
BigDecimal
bd
=
new
BigDecimal
(
generatingCapacity
);
jsonObject
.
put
(
"generating_capacity"
,
bd
.
setScale
(
4
,
BigDecimal
.
ROUND_HALF_UP
));
}
jsonObject
.
put
(
"seriesData"
,
StringUtils
.
isNotEmpty
(
newRate
)
?
Arrays
.
asList
(
new
BigDecimal
(
newRate
).
setScale
(
4
,
BigDecimal
.
ROUND_HALF_UP
))
:
0
D
);
jsonObject
.
put
(
"axisData"
,
Arrays
.
asList
(
"RATE"
));
if
(
"1"
.
equals
(
tp
))
{
oldName
=
jsonObject
.
getString
(
"station_name"
);
...
...
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