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
01346728
Commit
01346728
authored
Oct 16, 2025
by
刘林
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(jg):处理管道计算总长度精度问题
parent
9a26c1af
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
+8
-5
CommonServiceImpl.java
...os/boot/module/jg/biz/service/impl/CommonServiceImpl.java
+8
-5
No files found.
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/service/impl/CommonServiceImpl.java
View file @
01346728
...
...
@@ -106,6 +106,7 @@ import java.io.*;
import
java.lang.reflect.Field
;
import
java.lang.reflect.Modifier
;
import
java.math.BigDecimal
;
import
java.math.RoundingMode
;
import
java.net.URLEncoder
;
import
java.nio.charset.StandardCharsets
;
import
java.nio.file.Files
;
...
...
@@ -2495,11 +2496,7 @@ public class CommonServiceImpl implements ICommonService {
if
(
manageType
.
equals
(
UNIT
)
&&
!
CollectionUtils
.
isEmpty
(
equips
))
{
//管道计算的是管道长度
if
(
"8000"
.
equals
(
formData
.
getString
(
"equListCode"
))
||
"8000"
.
equals
(
formData
.
getString
(
"EQU_LIST_CODE"
)))
{
double
pipeLength
=
equips
.
stream
().
filter
(
Objects:
:
nonNull
)
.
filter
(
map
->
map
.
containsKey
(
"pipeLength"
)
&&
StringUtils
.
isNotEmpty
((
String
)
map
.
get
(
"pipeLength"
)))
.
mapToDouble
(
map
->
Double
.
parseDouble
((
String
)
map
.
get
(
"pipeLength"
)))
.
sum
();
formData
.
put
(
"equNum"
,
pipeLength
+
"(m)"
);
formData
.
put
(
"equNum"
,
calTotalLength
(
equips
)
+
"(m)"
);
}
else
{
//设备数量
formData
.
put
(
"equNum"
,
equipmentLists
.
size
());
...
...
@@ -2599,6 +2596,12 @@ public class CommonServiceImpl implements ICommonService {
return
formData
;
}
public
static
String
calTotalLength
(
List
<
Map
<
String
,
Object
>>
equList
)
{
double
pipeLengthSum
=
equList
.
stream
().
map
(
r
->
r
.
get
(
"pipeLength"
)).
filter
(
Objects:
:
nonNull
).
mapToDouble
(
l
->
Double
.
parseDouble
(
String
.
valueOf
(
l
))).
sum
();
BigDecimal
pipeLengthSumBig
=
new
BigDecimal
(
String
.
valueOf
(
pipeLengthSum
)).
setScale
(
3
,
RoundingMode
.
HALF_UP
);
return
pipeLengthSumBig
.
toPlainString
();
}
public
List
<
JSONObject
>
buildFileForOverDesign
(
JSONObject
jsonObject
)
{
List
<
JSONObject
>
formDataList
=
new
ArrayList
<>();
if
(
jsonObject
.
containsKey
(
"equipmentLists"
))
{
...
...
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