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
2009486c
Commit
2009486c
authored
Sep 25, 2019
by
周健威
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master-modify-cutAmount' into dev
parents
39eb1eab
6969ee68
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
14 deletions
+33
-14
OrderCalculateBiz.java
.../com/xxfc/platform/order/biz/inner/OrderCalculateBiz.java
+31
-14
OrderRefundController.java
...a/com/xxfc/platform/order/rest/OrderRefundController.java
+2
-0
No files found.
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/inner/OrderCalculateBiz.java
View file @
2009486c
...
@@ -115,20 +115,7 @@ public class OrderCalculateBiz {
...
@@ -115,20 +115,7 @@ public class OrderCalculateBiz {
consumeAmount
=
consumeAmount
.
add
(
otherItemRealAmount
);
consumeAmount
=
consumeAmount
.
add
(
otherItemRealAmount
);
inProgressVO
.
setConsumeAmount
(
consumeAmount
);
inProgressVO
.
setConsumeAmount
(
consumeAmount
);
if
(
consumeAmount
.
compareTo
(
BigDecimal
.
ZERO
)
>
0
)
{
refundAmount
=
handleConsumeAmount
(
oad
,
refundAmount
,
consumeAmount
,
goodsRealAmount
,
inProgressVO
);
//消费金额 大于0 增加额外费用
OrderAccountDeduction
extraDeduction
=
orderAccountBiz
.
initDeduction
(
consumeAmount
,
"消费金额"
,
DeductionTypeEnum
.
CONSUME
,
OrderAccountDeduction
.
ORIGIN_ORDER_DEPOSIT
);
oad
.
getDeductions
().
add
(
extraDeduction
);
}
//消费金额 小于商品真实的金额 返回钱
if
(
consumeAmount
.
compareTo
(
goodsRealAmount
)
<=
0
)
{
//设置返回钱
refundAmount
=
refundAmount
.
add
(
goodsRealAmount
.
subtract
(
consumeAmount
));
}
else
{
//设置额外扣减(押金里面扣)
inProgressVO
.
setExtraAmount
(
consumeAmount
.
subtract
(
goodsRealAmount
));
}
}
else
{
}
else
{
//设置免费天数
//设置免费天数
inProgressVO
.
setUsedfreeDays
(
useDays
);
inProgressVO
.
setUsedfreeDays
(
useDays
);
...
@@ -138,6 +125,18 @@ public class OrderCalculateBiz {
...
@@ -138,6 +125,18 @@ public class OrderCalculateBiz {
refundAmount
=
refundAmount
.
add
(
goodsRealAmount
);
refundAmount
=
refundAmount
.
add
(
goodsRealAmount
);
inProgressVO
.
setBackFreeDays
(
backFreeDays
);
inProgressVO
.
setBackFreeDays
(
backFreeDays
);
//返回优惠券
if
(
StrUtil
.
isNotBlank
(
baseOrder
.
getCouponTickerNos
()))
{
//返回所有优惠券
inProgressVO
.
setBackCoupons
(
StrUtil
.
split
(
baseOrder
.
getCouponTickerNos
(),
','
));
}
//设置消费金额 由于返回了优惠券,所以添加优惠券之前减免的金额
consumeAmount
=
consumeAmount
.
add
(
otherItemRealAmount
).
add
(
baseOrder
.
getCouponAmount
());
inProgressVO
.
setConsumeAmount
(
consumeAmount
);
refundAmount
=
handleConsumeAmount
(
oad
,
refundAmount
,
consumeAmount
,
goodsRealAmount
,
inProgressVO
);
}
}
inProgressVO
.
setRefundOrderAmount
(
refundAmount
);
inProgressVO
.
setRefundOrderAmount
(
refundAmount
);
...
@@ -177,6 +176,24 @@ public class OrderCalculateBiz {
...
@@ -177,6 +176,24 @@ public class OrderCalculateBiz {
return
inProgressVO
;
return
inProgressVO
;
}
}
private
BigDecimal
handleConsumeAmount
(
OrderAccountDetail
oad
,
BigDecimal
refundAmount
,
BigDecimal
consumeAmount
,
BigDecimal
goodsRealAmount
,
InProgressVO
inProgressVO
)
{
if
(
consumeAmount
.
compareTo
(
BigDecimal
.
ZERO
)
>
0
)
{
//消费金额 大于0 增加额外费用
OrderAccountDeduction
consumeDeduction
=
orderAccountBiz
.
initDeduction
(
consumeAmount
,
"消费金额"
,
DeductionTypeEnum
.
CONSUME
,
OrderAccountDeduction
.
ORIGIN_ORDER_DEPOSIT
);
oad
.
getDeductions
().
add
(
consumeDeduction
);
}
//消费金额 小于商品真实的金额 返回钱
if
(
consumeAmount
.
compareTo
(
goodsRealAmount
)
<=
0
)
{
//设置返回钱
refundAmount
=
refundAmount
.
add
(
goodsRealAmount
.
subtract
(
consumeAmount
));
}
else
{
//设置额外扣减(押金里面扣)
inProgressVO
.
setExtraAmount
(
consumeAmount
.
subtract
(
goodsRealAmount
));
}
return
refundAmount
;
}
public
InProgressVO
inProgressCalculate
(
BaseOrder
baseOrder
,
Integer
useDays
)
{
public
InProgressVO
inProgressCalculate
(
BaseOrder
baseOrder
,
Integer
useDays
)
{
OrderItem
orderItem
=
orderItemBiz
.
selectOne
(
new
OrderItem
(){{
OrderItem
orderItem
=
orderItemBiz
.
selectOne
(
new
OrderItem
(){{
setType
(
ItemTypeEnum
.
VEHICLE_MODEL
.
getCode
());
setType
(
ItemTypeEnum
.
VEHICLE_MODEL
.
getCode
());
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/rest/OrderRefundController.java
View file @
2009486c
...
@@ -143,6 +143,8 @@ public class OrderRefundController extends BaseController<OrderRefundBiz,OrderRe
...
@@ -143,6 +143,8 @@ public class OrderRefundController extends BaseController<OrderRefundBiz,OrderRe
,
orderPageVO
.
getOrderTourDetail
().
getStartTime
()
-
System
.
currentTimeMillis
()
,
orderPageVO
.
getOrderTourDetail
().
getStartTime
()
-
System
.
currentTimeMillis
()
,
DictionaryKey
.
APP_ORDER
+
"_"
+
key
,
DictionaryKey
.
APP_ORDER
+
"_"
+
key
,
refundDescBuilder
);
,
refundDescBuilder
);
totalDeductAmount
=
deductionAmount
;
totalRefundAmount
=
orderPageVO
.
getRealAmount
().
subtract
(
deductionAmount
);
totalRefundAmount
=
orderPageVO
.
getRealAmount
().
subtract
(
deductionAmount
);
refundDesc
=
refundDescBuilder
.
toString
();
refundDesc
=
refundDescBuilder
.
toString
();
break
;
break
;
...
...
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