Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
usedCarAuction
/
aus
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 87d265ea
authored
May 22, 2026
by
章家宝
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
feat:合同佣金,车款计算,保留两位小数,向上取整
1 parent
6718593f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
3 deletions
aus-core/src/main/java/com/glsx/usedcar/esign/DocTemplateRequest.java
aus-core/src/main/java/com/glsx/usedcar/esign/DocTemplateRequest.java
View file @
87d265e
...
...
@@ -7,6 +7,7 @@ import com.glsx.usedcar.module.vehicle.entity.Vehicle;
import
com.glsx.usedcar.util.NumberToChinese
;
import
java.math.BigDecimal
;
import
java.math.RoundingMode
;
import
java.time.LocalDate
;
import
java.time.format.DateTimeFormatter
;
import
java.util.ArrayList
;
...
...
@@ -69,10 +70,20 @@ public record DocTemplateRequest(String docTemplateId, String fileName, List<Com
}
}
double
totalAmount
=
actualOrderPrice
+
actualCommissionPrice
;
// 1. 车款 - 两位小数+向上取整
String
hammerPrice
=
new
BigDecimal
(
String
.
valueOf
(
actualOrderPrice
)).
setScale
(
2
,
RoundingMode
.
CEILING
).
max
(
BigDecimal
.
ZERO
).
toString
();
// 2. 佣金 - 两位小数+向上取整
String
otherFees
=
new
BigDecimal
(
String
.
valueOf
(
actualCommissionPrice
)).
setScale
(
2
,
RoundingMode
.
CEILING
).
max
(
BigDecimal
.
ZERO
).
toString
();
components
.
add
(
new
Component
(
"hammerPrice"
,
actualOrderPrice
+
""
));
components
.
add
(
new
Component
(
"otherFees"
,
actualCommissionPrice
+
""
));
double
totalAmount
=
new
BigDecimal
(
hammerPrice
)
.
add
(
new
BigDecimal
(
otherFees
))
.
setScale
(
2
,
RoundingMode
.
DOWN
)
.
max
(
BigDecimal
.
ZERO
)
.
doubleValue
();
// 放入组件
components
.
add
(
new
Component
(
"hammerPrice"
,
hammerPrice
));
components
.
add
(
new
Component
(
"otherFees"
,
otherFees
));
components
.
add
(
new
Component
(
"totalAmount"
,
totalAmount
+
""
));
components
.
add
(
new
Component
(
"totalAmountInWords"
,
NumberToChinese
.
toChinese
(
totalAmount
)));
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment