Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cloud-platform
Project
Project
Details
Activity
Releases
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
youjj
cloud-platform
Commits
9361ea8b
Commit
9361ea8b
authored
Sep 21, 2019
by
周健威
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复违约金读取问题
parent
3aa3ae66
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
13 deletions
+17
-13
OrderAccountBiz.java
...ain/java/com/xxfc/platform/order/biz/OrderAccountBiz.java
+1
-1
OrderCalculateBiz.java
.../com/xxfc/platform/order/biz/inner/OrderCalculateBiz.java
+14
-10
OrderCancelBiz.java
...ava/com/xxfc/platform/order/biz/inner/OrderCancelBiz.java
+2
-2
No files found.
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/OrderAccountBiz.java
View file @
9361ea8b
...
...
@@ -334,7 +334,7 @@ public class OrderAccountBiz extends BaseBiz<OrderAccountMapper,OrderAccount> {
}
OrderAccountDetail
oad
=
new
OrderAccountDetail
();
InProgressVO
inProgressVO
=
orderCalculateBiz
.
calculateOrderComplete
(
orderMQDTO
,
orderMQDTO
.
getOrderRentVehicleDetail
(),
oad
,
orderItem
,
orderMQDTO
.
getOrderRentVehicleDetail
().
getUsedDay
());
InProgressVO
inProgressVO
=
orderCalculateBiz
.
calculateOrderComplete
(
orderMQDTO
,
orderMQDTO
.
getOrderRentVehicleDetail
(),
oad
,
orderItem
,
orderMQDTO
.
getOrderRentVehicleDetail
().
getUsedDay
()
,
Boolean
.
FALSE
);
//还车扣除款 剩余的 钱,再减去违章预备金
oad
.
getDeductions
().
add
(
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/inner/OrderCalculateBiz.java
View file @
9361ea8b
...
...
@@ -58,7 +58,7 @@ public class OrderCalculateBiz {
@Autowired
OrderAccountBiz
orderAccountBiz
;
public
InProgressVO
inProgressCalculate
(
BaseOrder
baseOrder
,
OrderItem
orderItem
,
Integer
freeDays
,
Integer
useDays
,
OrderAccountDetail
oad
)
{
public
InProgressVO
inProgressCalculate
(
BaseOrder
baseOrder
,
OrderItem
orderItem
,
Integer
freeDays
,
Integer
useDays
,
OrderAccountDetail
oad
,
Boolean
isCancel
)
{
BigDecimal
refundAmount
=
BigDecimal
.
ZERO
;
BigDecimal
consumeAmount
=
BigDecimal
.
ZERO
;
//其他消费金额
...
...
@@ -144,24 +144,28 @@ public class OrderCalculateBiz {
//计算违约金
//residueDays * 身份价格
if
(
residueDays
>
0
)
{
String
violateDesc
=
StrUtil
.
format
(
"{}元/天 x{}天"
,
orderItem
.
getUnitPrice
().
toString
(),
residueDays
);
if
(
residueDays
>
2
)
{
residueDays
=
2
;
violateDesc
+=
StrUtil
.
format
(
"(封顶{}元)"
,
orderItem
.
getUnitPrice
().
multiply
(
new
BigDecimal
((
residueDays
+
""
))));
}
inProgressVO
.
setViolateAmount
(
orderItem
.
getUnitPrice
().
multiply
(
new
BigDecimal
((
residueDays
+
""
))));
OrderAccountDeduction
violateDeduction
=
orderAccountBiz
.
initDeduction
(
inProgressVO
.
getViolateAmount
(),
"违约金"
,
DeductionTypeEnum
.
VIOLATE_ADVANCE
,
OrderAccountDeduction
.
ORIGIN_DEPOSIT
);
OrderAccountDeduction
violateDeduction
=
orderAccountBiz
.
initDeduction
(
inProgressVO
.
getViolateAmount
(),
violateDesc
,
DeductionTypeEnum
.
VIOLATE_ADVANCE
,
OrderAccountDeduction
.
ORIGIN_DEPOSIT
);
oad
.
getDeductions
().
add
(
violateDeduction
);
}
else
if
(
residueDays
<
0
){
}
else
if
(
residueDays
<
0
&&
!
isCancel
){
//如果订单 出发中 或者 已完成 或者定损中
if
(
OrderStatusEnum
.
ORDER_WAIT
.
equals
(
baseOrder
.
getStatus
())
||
OrderStatusEnum
.
ORDER_FINISH
.
equals
(
baseOrder
.
getStatus
())
||
OrderStatusEnum
.
ORDER_FIXED_LOSS
.
equals
(
baseOrder
.
getStatus
()))
{
Integer
overDays
=
0
-
residueDays
;
if
(
overDays
>
2
)
{
overDays
=
2
;
}
String
violateDesc
=
StrUtil
.
format
(
"({}元/天 x200%) x{}天"
,
orderItem
.
getUnitPrice
().
toString
(),
overDays
);
// if(overDays > 2) {
// overDays = 2;
// violateDesc += StrUtil.format("(封顶{}元)", orderItem.getUnitPrice().multiply(new BigDecimal((residueDays + ""))));
// }
//超过的天数 * 200% * 单价
inProgressVO
.
setViolateAmount
(
orderItem
.
getUnitPrice
().
multiply
(
new
BigDecimal
(
2
+
""
)).
multiply
(
new
BigDecimal
((
overDays
+
""
))));
OrderAccountDeduction
violateDeduction
=
orderAccountBiz
.
initDeduction
(
inProgressVO
.
getViolateAmount
(),
"违约金"
,
DeductionTypeEnum
.
VIOLATE_DELAY
,
OrderAccountDeduction
.
ORIGIN_DEPOSIT
);
OrderAccountDeduction
violateDeduction
=
orderAccountBiz
.
initDeduction
(
inProgressVO
.
getViolateAmount
(),
violateDesc
,
DeductionTypeEnum
.
VIOLATE_DELAY
,
OrderAccountDeduction
.
ORIGIN_DEPOSIT
);
oad
.
getDeductions
().
add
(
violateDeduction
);
}
}
...
...
@@ -175,11 +179,11 @@ public class OrderCalculateBiz {
setOrderId
(
baseOrder
.
getId
());
}});
Integer
freeDays
=
(
null
==
orderItem
.
getCutNum
())?
0
:
orderItem
.
getCutNum
();
return
inProgressCalculate
(
baseOrder
,
orderItem
,
freeDays
,
useDays
,
new
OrderAccountDetail
());
return
inProgressCalculate
(
baseOrder
,
orderItem
,
freeDays
,
useDays
,
new
OrderAccountDetail
()
,
Boolean
.
FALSE
);
}
public
InProgressVO
calculateOrderComplete
(
BaseOrder
baseOrder
,
OrderRentVehicleDetail
orvd
,
OrderAccountDetail
oad
,
OrderItem
orderItem
,
Integer
useDays
)
{
InProgressVO
inProgressVO
=
inProgressCalculate
(
baseOrder
,
orderItem
,
orvd
.
getFreeDays
(),
useDays
,
oad
);
public
InProgressVO
calculateOrderComplete
(
BaseOrder
baseOrder
,
OrderRentVehicleDetail
orvd
,
OrderAccountDetail
oad
,
OrderItem
orderItem
,
Integer
useDays
,
Boolean
isCancel
)
{
InProgressVO
inProgressVO
=
inProgressCalculate
(
baseOrder
,
orderItem
,
orvd
.
getFreeDays
(),
useDays
,
oad
,
isCancel
);
//定金 - (额外消费金额 + 违约金)
oad
.
setDepositAmount
(
orvd
.
getDeposit
().
subtract
(
inProgressVO
.
getExtraAmount
().
add
(
inProgressVO
.
getViolateAmount
())));
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/inner/OrderCancelBiz.java
View file @
9361ea8b
...
...
@@ -164,7 +164,7 @@ public class OrderCancelBiz {
log
.
info
(
"useTimeLag {}"
,
new
BigDecimal
(
useTimeLag
+
""
));
log
.
info
(
"divide {}"
,
new
BigDecimal
((
24
*
60
*
60
*
1000
)+
""
));
Integer
useDays
=
new
BigDecimal
(
useTimeLag
+
""
).
divide
(
new
BigDecimal
((
24
*
60
*
60
*
1000
)+
""
),
0
,
RoundingMode
.
UP
).
intValue
();
inProgressVO
=
orderCalculateBiz
.
calculateOrderComplete
(
baseOrder
,
orvd
,
oad
,
orderItem
,
useDays
);
inProgressVO
=
orderCalculateBiz
.
calculateOrderComplete
(
baseOrder
,
orvd
,
oad
,
orderItem
,
useDays
,
Boolean
.
TRUE
);
//结合
//退款子流程: 订单基础,退款描述,退款金额
orderAccountBiz
.
refundSubProcess
(
baseOrder
,
""
,
baseOrder
.
getRealAmount
().
subtract
(
orvd
.
getDeposit
()),
oad
.
getDepositAmount
().
add
(
oad
.
getOrderAmount
()),
AccountTypeEnum
.
OUT_ORDER_FUND
.
getCode
(),
RefundStatusEnum
.
ALL
.
getCode
(),
oad
);
...
...
@@ -183,7 +183,7 @@ public class OrderCancelBiz {
//如果有扣款项,则生成额外的费用明细
if
(
oad
.
getDeductions
().
size
()
>
0
)
{
for
(
OrderAccountDeduction
deduction
:
oad
.
getDeductions
())
{
if
(
DeductionTypeEnum
.
VIOLATE_
CANCEL
.
getCode
().
equals
(
deduction
.
getType
()))
{
if
(
DeductionTypeEnum
.
VIOLATE_
ADVANCE
.
getCode
().
equals
(
deduction
.
getType
()))
{
csv
.
setViolateAmount
(
deduction
.
getAmount
());
csv
.
setViolateDesc
(
deduction
.
getName
());
}
...
...
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