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
5eb2f0ae
Commit
5eb2f0ae
authored
Aug 16, 2024
by
李秀明
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: BUG#21612 设备管理>消防水池,正常占比数据应该保留2位小数
parent
c06d5df8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
2 deletions
+11
-2
PoolStatisticController.java
...ejoin/equipmanage/controller/PoolStatisticController.java
+11
-2
No files found.
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/controller/PoolStatisticController.java
View file @
5eb2f0ae
...
@@ -75,14 +75,14 @@ public class PoolStatisticController {
...
@@ -75,14 +75,14 @@ public class PoolStatisticController {
poolMap
.
put
(
"poolLow"
,
pool
.
get
(
"low"
).
size
());
poolMap
.
put
(
"poolLow"
,
pool
.
get
(
"low"
).
size
());
poolMap
.
put
(
"poolHigh"
,
pool
.
get
(
"high"
).
size
());
poolMap
.
put
(
"poolHigh"
,
pool
.
get
(
"high"
).
size
());
poolMap
.
put
(
"poolNormal"
,
pool
.
get
(
"normal"
).
size
());
poolMap
.
put
(
"poolNormal"
,
pool
.
get
(
"normal"
).
size
());
poolMap
.
put
(
"poolAbs"
,
new
BigDecimal
(
pool
.
get
(
"normal"
).
size
()).
divide
(
new
BigDecimal
(
poolList
.
size
()),
2
,
BigDecimal
.
ROUND_HALF_UP
).
movePointRight
(
2
));
poolMap
.
put
(
"poolAbs"
,
this
.
getPercent
(
new
BigDecimal
(
pool
.
get
(
"normal"
).
size
()),
new
BigDecimal
(
poolList
.
size
())
));
Map
<
String
,
List
<
Map
<
String
,
Object
>>>
industry
=
getPoolInfo
(
industryPoolList
);
Map
<
String
,
List
<
Map
<
String
,
Object
>>>
industry
=
getPoolInfo
(
industryPoolList
);
poolMap
.
put
(
"industryName"
,
"工业水池"
);
poolMap
.
put
(
"industryName"
,
"工业水池"
);
poolMap
.
put
(
"industryTotal"
,
industryPoolList
.
size
());
poolMap
.
put
(
"industryTotal"
,
industryPoolList
.
size
());
poolMap
.
put
(
"industryLow"
,
industry
.
get
(
"low"
).
size
());
poolMap
.
put
(
"industryLow"
,
industry
.
get
(
"low"
).
size
());
poolMap
.
put
(
"industryHigh"
,
industry
.
get
(
"high"
).
size
());
poolMap
.
put
(
"industryHigh"
,
industry
.
get
(
"high"
).
size
());
poolMap
.
put
(
"industryNormal"
,
industry
.
get
(
"normal"
).
size
());
poolMap
.
put
(
"industryNormal"
,
industry
.
get
(
"normal"
).
size
());
poolMap
.
put
(
"industryAbs"
,
new
BigDecimal
(
industry
.
get
(
"normal"
).
size
()).
divide
(
new
BigDecimal
(
industryPoolList
.
size
()),
2
,
BigDecimal
.
ROUND_HALF_UP
).
movePointRight
(
2
));
poolMap
.
put
(
"industryAbs"
,
this
.
getPercent
(
new
BigDecimal
(
industry
.
get
(
"normal"
).
size
()),
new
BigDecimal
(
industryPoolList
.
size
())
));
return
CommonResponseUtil
.
success
(
poolMap
);
return
CommonResponseUtil
.
success
(
poolMap
);
}
}
...
@@ -371,4 +371,13 @@ public class PoolStatisticController {
...
@@ -371,4 +371,13 @@ public class PoolStatisticController {
}
}
return
DateTimeUtil
.
format
(
date1
,
DateTimeUtil
.
ISO_DATE_HOUR24_MIN_SEC
);
return
DateTimeUtil
.
format
(
date1
,
DateTimeUtil
.
ISO_DATE_HOUR24_MIN_SEC
);
}
}
private
BigDecimal
getPercent
(
BigDecimal
num1
,
BigDecimal
num2
)
{
if
(
num2
.
compareTo
(
BigDecimal
.
ZERO
)
==
0
)
{
return
BigDecimal
.
ZERO
;
}
else
{
return
num1
.
divide
(
num2
,
4
,
RoundingMode
.
HALF_UP
).
multiply
(
new
BigDecimal
(
100
)).
setScale
(
2
,
RoundingMode
.
HALF_UP
);
}
}
}
}
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