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
02a0acbe
Commit
02a0acbe
authored
Dec 04, 2019
by
周健威
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature-delay-add' into dev
parents
336bdd96
66473170
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
6 deletions
+36
-6
OrderAccountBiz.java
...ain/java/com/xxfc/platform/order/biz/OrderAccountBiz.java
+14
-2
OrderCancelBiz.java
...ava/com/xxfc/platform/order/biz/inner/OrderCancelBiz.java
+16
-3
DictionaryKey.java
...a/com/xxfc/platform/universal/constant/DictionaryKey.java
+6
-1
No files found.
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/OrderAccountBiz.java
View file @
02a0acbe
...
...
@@ -106,8 +106,10 @@ public class OrderAccountBiz extends BaseBiz<OrderAccountMapper,OrderAccount> {
* @param orderViolateCoverAmount 订单违约金覆盖值
* @param depositViolateCoverAmount 押金违约金覆盖值
*/
public
BigDecimal
rentRefundProcessCancel
(
BaseOrder
baseOrder
,
BigDecimal
orderDeductSource
,
Long
timeLag
,
String
dicParentKey
,
BigDecimal
depositAmount
,
BigDecimal
depositDeductSource
,
OrderAccountDetail
oad
,
BigDecimal
topAmount
,
BigDecimal
orderViolateCoverAmount
,
BigDecimal
depositViolateCoverAmount
)
{
public
BigDecimal
rentRefundProcessCancel
(
BaseOrder
baseOrder
,
BigDecimal
orderDeductSource
,
Long
timeLag
,
String
dicParentKey
,
BigDecimal
depositAmount
,
BigDecimal
depositDeductSource
,
OrderAccountDetail
oad
,
BigDecimal
topAmount
,
BigDecimal
orderViolateCoverAmount
,
BigDecimal
depositViolateCoverAmount
,
Boolean
noDeduct
)
{
//原来退款 和 最终退款
BigDecimal
originalRefundAmount
=
BigDecimal
.
ZERO
;
BigDecimal
refundAmount
=
BigDecimal
.
ZERO
;
...
...
@@ -124,6 +126,11 @@ public class OrderAccountBiz extends BaseBiz<OrderAccountMapper,OrderAccount> {
if
(
null
!=
orderDeductSource
&&
BigDecimal
.
ZERO
.
compareTo
(
orderDeductSource
)
<
0
)
{
BigDecimal
orderDeductAmount
=
calculateDeduction
(
orderDeductSource
,
timeLag
,
dicParentKey
,
orderRefundDescBuilder
);
//如果属于免扣费情况
if
(
noDeduct
)
{
orderDeductAmount
=
BigDecimal
.
ZERO
;
orderRefundDescBuilder
=
new
StringBuilder
(
""
);
}
orderDeductAmount
=
orderDeductAmount
.
setScale
(
2
,
RoundingMode
.
HALF_UP
);
if
(
null
!=
orderViolateCoverAmount
)
{
orderDeductAmount
=
orderViolateCoverAmount
;
...
...
@@ -157,6 +164,11 @@ public class OrderAccountBiz extends BaseBiz<OrderAccountMapper,OrderAccount> {
if
(
null
!=
depositDeductSource
&&
BigDecimal
.
ZERO
.
compareTo
(
depositDeductSource
)
<
0
)
{
//通过原扣除款 计算剩余款
BigDecimal
depositDeductAmount
=
calculateDeduction
(
depositDeductSource
,
timeLag
,
dicParentKey
,
depositRefundDescBuilder
);
//如果属于免扣费情况
if
(
noDeduct
)
{
depositDeductAmount
=
BigDecimal
.
ZERO
;
depositRefundDescBuilder
=
new
StringBuilder
(
""
);
}
depositDeductAmount
=
depositDeductAmount
.
setScale
(
2
,
RoundingMode
.
HALF_UP
);
if
(
null
!=
orderViolateCoverAmount
)
{
depositDeductAmount
=
orderViolateCoverAmount
;
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/inner/OrderCancelBiz.java
View file @
02a0acbe
...
...
@@ -21,6 +21,8 @@ import com.xxfc.platform.order.pojo.price.CancelNoStartVO;
import
com.xxfc.platform.order.pojo.price.CancelStartedVO
;
import
com.xxfc.platform.order.pojo.price.CostDetailExtend
;
import
com.xxfc.platform.tour.feign.TourFeign
;
import
com.xxfc.platform.universal.constant.DictionaryKey
;
import
com.xxfc.platform.universal.entity.Dictionary
;
import
com.xxfc.platform.universal.feign.ThirdFeign
;
import
com.xxfc.platform.vehicle.common.RestResponse
;
import
com.xxfc.platform.vehicle.feign.VehicleFeign
;
...
...
@@ -131,6 +133,15 @@ public class OrderCancelBiz {
//触发退款流程
//判断是否已支付
if
(
SYS_TRUE
.
equals
(
baseOrder
.
getHasPay
()))
{
//缓冲取消时间(一个小时)
Map
<
String
,
Dictionary
>
dictionaryMap
=
thirdFeign
.
dictionaryGetAll4Map
().
getData
();
Long
autoCancelTime
=
Long
.
valueOf
(
dictionaryMap
.
get
(
APP_ORDER
+
"_"
+
DictionaryKey
.
CANCEL_TIME_BUFFER
).
getDetail
());
//判断是否支付超过缓冲取消时间(一个小时)
Long
orderCrtLag
=
System
.
currentTimeMillis
()
-
baseOrder
.
getPayTime
();
Boolean
overCancelBuffer
=
(
orderCrtLag
>
autoCancelTime
)?
Boolean
.
TRUE
:
Boolean
.
FALSE
;
//判断订单类型
if
(
OrderTypeEnum
.
RENT_VEHICLE
.
getCode
().
equals
(
baseOrder
.
getType
()))
{
orvd
=
orderRentVehicleBiz
.
selectOne
(
new
OrderRentVehicleDetail
(){{
...
...
@@ -146,7 +157,8 @@ public class OrderCancelBiz {
//根据时间处理goodsAmount
//获取出发时间 到现在 距离时间
Long
timeLag
=
orvd
.
getStartTime
()
-
System
.
currentTimeMillis
();
if
(
timeLag
<
0
)
{
if
(
timeLag
<
0
&&
overCancelBuffer
)
{
Integer
useDays
=
orderCalculateBiz
.
getIncludeDays
(
orvd
.
getStartTime
(),
System
.
currentTimeMillis
());
if
(
useDays
>
orvd
.
obtainRealDayNum
())
{
useDays
=
orvd
.
obtainRealDayNum
();
...
...
@@ -221,7 +233,7 @@ public class OrderCancelBiz {
//退款流程
//违约金封顶 租车身份价 * 2天
orderAccountBiz
.
rentRefundProcessCancel
(
baseOrder
,
BigDecimal
.
ZERO
,
timeLag
,
APP_ORDER
+
"_"
+
RENT_REFUND
,
orvd
.
getDeposit
(),
vehicleItemDTO
.
getBuyAmount
(),
oad
,
vehicleItemDTO
.
getTopAmount
(
0
),
null
,
changeViolateAmount
);
orderAccountBiz
.
rentRefundProcessCancel
(
baseOrder
,
BigDecimal
.
ZERO
,
timeLag
,
APP_ORDER
+
"_"
+
RENT_REFUND
,
orvd
.
getDeposit
(),
vehicleItemDTO
.
getBuyAmount
(),
oad
,
vehicleItemDTO
.
getTopAmount
(
0
),
null
,
changeViolateAmount
,
(!
overCancelBuffer
)
);
//设置订单数据
//baseOrder.setDamagesAmount(csv.getDamagesAmount());
...
...
@@ -264,6 +276,7 @@ public class OrderCancelBiz {
}
}
else
if
(
OrderTypeEnum
.
TOUR
.
getCode
().
equals
(
baseOrder
.
getType
()))
{
otd
=
orderTourDetailBiz
.
selectOne
(
new
OrderTourDetail
(){{
setOrderId
(
baseOrder
.
getId
());
}});
...
...
@@ -290,7 +303,7 @@ public class OrderCancelBiz {
}
//退款流程
orderAccountBiz
.
rentRefundProcessCancel
(
baseOrder
,
adultItemAmount
.
add
(
childItemAmount
),
timeLag
,
APP_ORDER
+
"_"
+
key
,
BigDecimal
.
ZERO
,
BigDecimal
.
ZERO
,
oad
,
adultItemAmount
.
add
(
childItemAmount
),
changeViolateAmount
,
null
);
orderAccountBiz
.
rentRefundProcessCancel
(
baseOrder
,
adultItemAmount
.
add
(
childItemAmount
),
timeLag
,
APP_ORDER
+
"_"
+
key
,
BigDecimal
.
ZERO
,
BigDecimal
.
ZERO
,
oad
,
adultItemAmount
.
add
(
childItemAmount
),
changeViolateAmount
,
null
,
(!
overCancelBuffer
)
);
//如果有扣款项,则生成额外的费用明细
if
(
oad
.
getDeductions
().
size
()
>
0
)
{
...
...
xx-universal/xx-universal-api/src/main/java/com/xxfc/platform/universal/constant/DictionaryKey.java
View file @
02a0acbe
...
...
@@ -50,7 +50,7 @@ public class DictionaryKey {
public
static
final
String
TOUR_IN_REFUND
=
"TOUR_IN_REFUND"
;
/**
* 租车:公司司机租金、免赔费用、违章预备金
* 租车:公司司机租金、免赔费用、违章预备金
、租车时间缓冲(小时)
*/
public
static
final
String
DRIVER_PRICE
=
"DRIVER_PRICE"
;
public
static
final
String
DAMAGE_SAFE
=
"DAMAGE_SAFE"
;
...
...
@@ -78,4 +78,9 @@ public class DictionaryKey {
* 自动退款保留押金的时间(小时)
*/
public
static
final
String
RENT_DEPOSIT_AUTO_REFUND_TIME
=
"RENT_DEPOSIT_AUTO_REFUND_TIME"
;
/**
* 取消时间缓冲(分钟)
*/
public
static
final
String
CANCEL_TIME_BUFFER
=
"CANCEL_TIME_BUFFER"
;
}
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