Toggle navigation
Toggle navigation
This project
Loading...
Sign in
ufo
/
yohoufo-fore
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
chenchao
6 years ago
Commit
7eb12e7a0bc8538f3b121836755a9ce2656b24b4
1 parent
378cc20e
add rate
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletions
order/src/main/java/com/yohoufo/order/service/seller/SellerAdvanceOrderComputeHandler.java
order/src/main/java/com/yohoufo/order/service/seller/SellerAdvanceOrderComputeHandler.java
View file @
7eb12e7
package
com
.
yohoufo
.
order
.
service
.
seller
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yohoufo.order.model.dto.EarnestMoney
;
import
com.yohoufo.order.model.dto.ServiceFeeRate
;
import
org.springframework.stereotype.Component
;
...
...
@@ -18,16 +19,22 @@ public class SellerAdvanceOrderComputeHandler extends AbsSellerOrderComputeHandl
earnestMoney
.
setPrdSalePrice
(
prdPrice
);
//TODO earnestMoney.rate 需要调整为动态可配
BigDecimal
real
=
halfUp
(
prdPrice
.
multiply
(
new
BigDecimal
(
0.08
D
)));
final
BigDecimal
rate
=
new
BigDecimal
(
0.08
D
);
BigDecimal
real
=
halfUp
(
prdPrice
.
multiply
(
rate
));
final
BigDecimal
min
=
new
BigDecimal
(
56
);
final
BigDecimal
max
=
new
BigDecimal
(
438
);
real
=
calCrossWithThreshold
(
min
,
max
,
real
);
earnestMoney
.
setMin
(
min
);
earnestMoney
.
setMax
(
max
);
earnestMoney
.
setRate
(
rate
);
earnestMoney
.
setEarnestMoney
(
real
);
return
earnestMoney
;
}
public
static
void
main
(
String
[]
args
)
{
System
.
out
.
println
(
JSONObject
.
toJSONString
(
new
EarnestMoney
()));
}
@Override
protected
ServiceFeeRate
buildServiceFeeRate
()
{
ServiceFeeRate
serviceFeeRate
=
orderDynamicConfig
.
getServiceFeeRate
();
...
...
Please
register
or
login
to post a comment