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
e4cd2247
Commit
e4cd2247
authored
Sep 20, 2019
by
hezhen
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' of
http://113.105.137.151:22280/youjj/cloud-platform
into dev
parents
10d1f84f
7b2c365f
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
113 additions
and
52 deletions
+113
-52
CostDetailExtend.java
.../com/xxfc/platform/order/pojo/price/CostDetailExtend.java
+1
-1
OrderAccountBiz.java
...ain/java/com/xxfc/platform/order/biz/OrderAccountBiz.java
+62
-20
OrderRefundBiz.java
...main/java/com/xxfc/platform/order/biz/OrderRefundBiz.java
+3
-3
OrderCancelBiz.java
...ava/com/xxfc/platform/order/biz/inner/OrderCancelBiz.java
+20
-10
RentDepositJobHandler.java
...xxfc/platform/order/jobhandler/RentDepositJobHandler.java
+0
-1
OrderRefundController.java
...a/com/xxfc/platform/order/rest/OrderRefundController.java
+3
-3
OrderTourService.java
...ava/com/xxfc/platform/order/service/OrderTourService.java
+7
-2
VehicleActiveService.java
...a/com/xxfc/platform/vehicle/biz/VehicleActiveService.java
+17
-12
No files found.
xx-order/xx-order-api/src/main/java/com/xxfc/platform/order/pojo/price/CostDetailExtend.java
View file @
e4cd2247
...
...
@@ -17,7 +17,7 @@ public class CostDetailExtend {
private
String
costDetail
=
""
;
/**
* type:1--取消违约金;2--取消费用明细;3--提前还车费用明细;4--延期还车费用明细
* type:1--取消违约金;2--取消费用明细;3--提前还车费用明细;4--延期还车费用明细
5--订单按时还车
*/
protected
Integer
type
;
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/OrderAccountBiz.java
View file @
e4cd2247
...
...
@@ -88,15 +88,27 @@ public class OrderAccountBiz extends BaseBiz<OrderAccountMapper,OrderAccount> {
* @param timeLag 与开始时间的时间差
* @param dicParentKey
*/
public
BigDecimal
rentRefundProcessCancel
(
BaseOrder
baseOrder
,
BigDecimal
mainItemRealAmount
,
Long
timeLag
,
String
dicParentKey
,
BigDecimal
depositAmount
,
BigDecimal
originalDeductAmount
,
OrderAccountDetail
oad
)
{
public
BigDecimal
rentRefundProcessCancel
(
BaseOrder
baseOrder
,
BigDecimal
mainItemRealAmount
,
Long
timeLag
,
String
dicParentKey
,
BigDecimal
depositAmount
,
BigDecimal
originalDeductAmount
,
OrderAccountDetail
oad
,
BigDecimal
topAmount
)
{
//计算退款金额
//商品价格 - 优惠券减免的价格
BigDecimal
originalRefundAmount
=
BigDecimal
.
ZERO
.
add
(
mainItemRealAmount
);
StringBuilder
refundDescBuilder
=
new
StringBuilder
(
"取消订单退款:"
);
StringBuilder
orderRefundDescBuilder
=
new
StringBuilder
(
""
);
StringBuilder
depositRefundDescBuilder
=
new
StringBuilder
(
""
);
BigDecimal
totalDeductAmount
=
BigDecimal
.
ZERO
;
if
(
null
==
oad
)
{
oad
=
new
OrderAccountDetail
();
}
BigDecimal
refundMainGoodsAmount
=
calculateRefund
(
originalRefundAmount
,
timeLag
,
dicParentKey
,
refundDescBuilder
,
oad
);
BigDecimal
orderDeductAmount
=
calculateDeduction
(
originalRefundAmount
,
timeLag
,
dicParentKey
,
orderRefundDescBuilder
);
orderDeductAmount
=
orderDeductAmount
.
setScale
(
2
,
RoundingMode
.
HALF_UP
);
if
(
topAmount
.
compareTo
(
orderDeductAmount
)
>
0
)
{
totalDeductAmount
=
totalDeductAmount
.
add
(
orderDeductAmount
);
topAmount
=
topAmount
.
subtract
(
orderDeductAmount
);
}
else
{
totalDeductAmount
=
totalDeductAmount
.
add
(
topAmount
);
orderDeductAmount
=
topAmount
;
topAmount
=
BigDecimal
.
ZERO
;
}
BigDecimal
refundMainGoodsAmount
=
originalRefundAmount
.
subtract
(
orderDeductAmount
);
refundMainGoodsAmount
=
refundMainGoodsAmount
.
setScale
(
2
,
RoundingMode
.
HALF_UP
);
//退款金额 = 主要商品退款 + (其他商品退款) 即--> 主要商品退款 + (总商品款 - 主要商品款)
...
...
@@ -106,22 +118,41 @@ public class OrderAccountBiz extends BaseBiz<OrderAccountMapper,OrderAccount> {
// 押金
BigDecimal
originalRefundAmountDeposit
=
BigDecimal
.
ZERO
.
add
(
depositAmount
);
BigDecimal
refundAmountDeposit
=
BigDecimal
.
ZERO
.
add
(
depositAmount
);
refundDescBuilder
=
refundDescBuilder
.
append
(
",押金退款:"
);
if
(
null
!=
originalDeductAmount
&&
BigDecimal
.
ZERO
.
compareTo
(
originalDeductAmount
)
<
0
)
{
//通过原扣除款 计算剩余款
BigDecimal
residueAmount
=
calculateRefund
(
originalDeductAmount
,
timeLag
,
dicParentKey
,
refundDescBuilder
,
oad
);
residueAmount
=
residueAmount
.
setScale
(
2
,
RoundingMode
.
HALF_UP
);
BigDecimal
depositDeductAmount
=
calculateDeduction
(
originalDeductAmount
,
timeLag
,
dicParentKey
,
depositRefundDescBuilder
);
depositDeductAmount
=
depositDeductAmount
.
setScale
(
2
,
RoundingMode
.
HALF_UP
);
if
(
topAmount
.
compareTo
(
depositDeductAmount
)
>
0
)
{
totalDeductAmount
=
totalDeductAmount
.
add
(
depositDeductAmount
);
topAmount
=
topAmount
.
subtract
(
depositDeductAmount
);
}
else
{
totalDeductAmount
=
totalDeductAmount
.
add
(
topAmount
);
depositDeductAmount
=
topAmount
;
topAmount
=
BigDecimal
.
ZERO
;
}
//退款金额 :押金 - (原扣除款 - 剩余款) 即: 押金 - (免费天数对应的钱 - 剩余款)
refundAmountDeposit
=
originalRefundAmountDeposit
.
subtract
(
originalDeductAmount
.
subtract
(
residueAmount
));
//返回押金
refundAmountDeposit
=
originalRefundAmount
.
subtract
(
orderDeductAmount
);
}
//设置违章款账单
StringBuilder
stringBuilder
=
new
StringBuilder
(
""
);
if
(
totalDeductAmount
.
compareTo
(
BigDecimal
.
ZERO
)
>
0
)
{
if
(
orderRefundDescBuilder
.
length
()
>
0
)
{
stringBuilder
=
orderRefundDescBuilder
;
}
else
{
stringBuilder
=
depositRefundDescBuilder
;
}
oad
.
getDeductions
().
add
(
initDeduction
(
totalDeductAmount
,
stringBuilder
.
toString
(),
DeductionTypeEnum
.
VIOLATE_CANCEL
,
OrderAccountDeduction
.
ORIGIN_DEPOSIT
));
}
//设置订单押金金额
originalRefundAmount
=
originalRefundAmount
.
add
(
originalRefundAmountDeposit
);
oad
.
setDepositAmount
(
refundAmountDeposit
);
refundAmount
=
refundAmount
.
add
(
refundAmountDeposit
);
//退款子流程: 订单基础,退款描述, 款金额
refundSubProcess
(
baseOrder
,
refundDesc
Builder
.
toString
(),
originalRefundAmount
,
refundAmount
,
AccountTypeEnum
.
OUT_ORDER_FUND
.
getCode
(),
RefundStatusEnum
.
ALL
.
getCode
(),
oad
);
refundSubProcess
(
baseOrder
,
string
Builder
.
toString
(),
originalRefundAmount
,
refundAmount
,
AccountTypeEnum
.
OUT_ORDER_FUND
.
getCode
(),
RefundStatusEnum
.
ALL
.
getCode
(),
oad
);
return
refundAmount
;
}
...
...
@@ -163,11 +194,12 @@ public class OrderAccountBiz extends BaseBiz<OrderAccountMapper,OrderAccount> {
}
}
public
BigDecimal
calculate
Refund
(
BigDecimal
goodsAmount
,
Long
timeLag
,
String
dicParentKey
,
StringBuilder
refundDescBuilder
,
OrderAccountDetail
orderAccountDetail
)
{
public
BigDecimal
calculate
Deduction
(
BigDecimal
goodsAmount
,
Long
timeLag
,
String
dicParentKey
,
StringBuilder
refundDescBuilder
)
{
BigDecimal
refundGoodsAmount
=
goodsAmount
;
if
(
null
==
orderAccountDetail
)
{
orderAccountDetail
=
new
OrderAccountDetail
();
}
BigDecimal
deductGoodsAmount
=
goodsAmount
;
// if(null == orderAccountDetail) {
// orderAccountDetail = new OrderAccountDetail();
// }
//根据时间处理goodsAmount
//获取出发时间 到现在 距离时间
...
...
@@ -193,13 +225,14 @@ public class OrderAccountBiz extends BaseBiz<OrderAccountMapper,OrderAccount> {
}})+
""
).
toString
());
refundDescBuilder
=
refundDescBuilder
.
insert
(
0
,
names
[
1
]+
","
);
if
(
goodsAmount
.
subtract
(
refundGoodsAmount
).
compareTo
(
BigDecimal
.
ZERO
)
>
0
)
{
orderAccountDetail
.
getDeductions
().
add
(
initDeduction
(
goodsAmount
.
subtract
(
refundGoodsAmount
),
names
[
1
],
DeductionTypeEnum
.
VIOLATE_CANCEL
,
OrderAccountDeduction
.
ORIGIN_DEPOSIT
));
deductGoodsAmount
=
goodsAmount
.
subtract
(
refundGoodsAmount
);
//orderAccountDetail.getDeductions().add(initDeduction(goodsAmount.subtract(refundGoodsAmount), names[1], DeductionTypeEnum.VIOLATE_CANCEL, OrderAccountDeduction.ORIGIN_DEPOSIT));
}
break
;
}
}
return
refund
GoodsAmount
;
return
deduct
GoodsAmount
;
}
/**
...
...
@@ -273,6 +306,9 @@ public class OrderAccountBiz extends BaseBiz<OrderAccountMapper,OrderAccount> {
if
(
RefundStatusEnum
.
NONE
.
getCode
().
equals
(
orderMQDTO
.
getRefundStatus
()))
{
Integer
crosstownTypeEnum
;
DepositRefundStatus
depositRefundRecordStatus
;
//生成额外的费用明细
CancelStartedVO
csv
=
new
CancelStartedVO
();
//判断是否定损过
if
(
SYS_TRUE
.
equals
(
orderMQDTO
.
getOrderRentVehicleDetail
().
getFixedLossStatus
()))
{
crosstownTypeEnum
=
CrosstownTypeEnum
.
FIXED_LOSS
.
getCode
();
...
...
@@ -307,10 +343,16 @@ public class OrderAccountBiz extends BaseBiz<OrderAccountMapper,OrderAccount> {
oad
.
getDeductions
().
add
(
initDeduction
(
illegalReserve
,
"违章保证金"
,
DeductionTypeEnum
.
VIOLATE_TRAFFIC_KEEP
,
OrderAccountDeduction
.
ORIGIN_DEPOSIT
)
);
//设置定损金额
csv
.
setDamagesAmount
(
crosstown
.
getDeductionCost
());
if
(
crosstown
.
getDeductionCost
().
compareTo
(
BigDecimal
.
ZERO
)
>
0
)
{
oad
.
getDeductions
().
add
(
initDeduction
(
crosstown
.
getDeductionCost
(),
"定损赔偿金"
,
DeductionTypeEnum
.
DAMAGES
,
OrderAccountDeduction
.
ORIGIN_DEPOSIT
)
);
//剩余押金 -
}
//剩余押金 = 押金 - 违章保证金 - 定损金额
oad
.
setDepositAmount
(
oad
.
getDepositAmount
().
subtract
(
illegalReserve
).
subtract
(
crosstown
.
getDeductionCost
()));
handleCrosstownDetail
(
crosstown
,
oad
);
BigDecimal
refundAmont
=
crosstown
.
getRestDeposit
().
subtract
(
illegalReserve
);
...
...
@@ -323,11 +365,11 @@ public class OrderAccountBiz extends BaseBiz<OrderAccountMapper,OrderAccount> {
orderDepositRefundRecordBiz
.
completeRecordStatus
(
crosstown
.
getId
(),
depositRefundRecordStatus
);
//生成额外的费用明细
CancelStartedVO
csv
=
new
CancelStartedVO
();
csv
.
setConsumeAmount
(
inProgressVO
.
getConsumeAmount
());
csv
.
setModelAmount
(
orderItem
.
getUnitPrice
());
csv
.
setUsedAmount
(
inProgressVO
.
getUsedAmount
());
csv
.
setUsedDayNum
(
inProgressVO
.
getUsedDays
());
csv
.
setUsedfreeDayNum
(
inProgressVO
.
getUsedfreeDays
());
csv
.
setUsedFreeAmount
(
inProgressVO
.
getUsedFreeDaysAmount
());
csv
.
setHadConpon
((
StrUtil
.
isNotBlank
(
orderMQDTO
.
getCouponTickerNos
())?
Boolean
.
TRUE
:
Boolean
.
FALSE
));
if
(
csv
.
getUsedDayNum
()
==
orderMQDTO
.
getOrderRentVehicleDetail
().
getDayNum
())
{
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/OrderRefundBiz.java
View file @
e4cd2247
...
...
@@ -150,7 +150,7 @@ public class OrderRefundBiz extends BaseBiz<OrderRefundMapper,OrderRefund> {
// //商品价格 - 优惠券减免的价格
// BigDecimal originalRefundAmount = BigDecimal.ZERO.add(baseOrder.getGoodsAmount().subtract(baseOrder.getCouponAmount()));
// StringBuilder refundDescBuilder = new StringBuilder("取消订单退款:");
// BigDecimal refundGoodsAmount = calculate
Refund
(originalRefundAmount, timeLag, dicParentKey, refundDescBuilder);
// BigDecimal refundGoodsAmount = calculate
Deduction
(originalRefundAmount, timeLag, dicParentKey, refundDescBuilder);
// refundGoodsAmount = refundGoodsAmount.setScale(2, RoundingMode.HALF_UP);
//
// //退款金额
...
...
@@ -176,7 +176,7 @@ public class OrderRefundBiz extends BaseBiz<OrderRefundMapper,OrderRefund> {
// StringBuilder refundDescBuilder = new StringBuilder("取消订单押金退款:");
// if(null != originalDeductAmount && BigDecimal.ZERO.compareTo(originalDeductAmount) < 0) {
// //通过原扣除款 计算剩余款
// BigDecimal residueAmount = calculate
Refund
(originalDeductAmount, timeLag, dicParentKey, refundDescBuilder);
// BigDecimal residueAmount = calculate
Deduction
(originalDeductAmount, timeLag, dicParentKey, refundDescBuilder);
// residueAmount = residueAmount.setScale(2, RoundingMode.HALF_UP);
//
// //退款金额 :押金 - (原扣除款 - 剩余款) 即: 押金 - (免费天数对应的钱 - 剩余款)
...
...
@@ -188,7 +188,7 @@ public class OrderRefundBiz extends BaseBiz<OrderRefundMapper,OrderRefund> {
// return refundAmount;
// }
//
// public BigDecimal calculate
Refund
(BigDecimal goodsAmount, Long timeLag, String dicParentKey, StringBuilder refundDescBuilder) {
// public BigDecimal calculate
Deduction
(BigDecimal goodsAmount, Long timeLag, String dicParentKey, StringBuilder refundDescBuilder) {
// BigDecimal refundGoodsAmount = goodsAmount;
//
// //根据时间处理goodsAmount
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/inner/OrderCancelBiz.java
View file @
e4cd2247
...
...
@@ -17,11 +17,13 @@ import com.xxfc.platform.order.pojo.calculate.InProgressVO;
import
com.xxfc.platform.order.pojo.mq.OrderMQDTO
;
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.feign.ThirdFeign
;
import
com.xxfc.platform.vehicle.common.RestResponse
;
import
com.xxfc.platform.vehicle.feign.VehicleFeign
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
...
...
@@ -29,6 +31,7 @@ import tk.mybatis.mapper.entity.Example;
import
tk.mybatis.mapper.weekend.WeekendSqls
;
import
java.math.BigDecimal
;
import
java.math.RoundingMode
;
import
java.util.*
;
import
static
com
.
github
.
wxiaoqi
.
security
.
common
.
constant
.
CommonConstants
.
SYS_TRUE
;
...
...
@@ -122,7 +125,7 @@ public class OrderCancelBiz {
setCancelReason
(
baseOrder
.
getCancelReason
());
setVersion
(
baseOrder
.
getVersion
());
}};
B
aseOrder
hasUpdateOrder
=
baseOrderBiz
.
updateSelectiveByIdReT
(
updateOrder
)
;
B
eanUtils
.
copyProperties
(
baseOrderBiz
.
updateSelectiveByIdReT
(
updateOrder
),
baseOrder
);
;
InProgressVO
inProgressVO
=
null
;
OrderAccountDetail
oad
=
new
OrderAccountDetail
();
...
...
@@ -158,7 +161,9 @@ public class OrderCancelBiz {
Long
beginOfStartDay
=
DateUtil
.
beginOfDay
(
DateUtil
.
date
(
orvd
.
getStartTime
())).
getTime
();
//计算:使用天数 当前时间 - 开始时间的0时0分0秒
Long
useTimeLag
=
System
.
currentTimeMillis
()
-
beginOfStartDay
;
Integer
useDays
=
new
BigDecimal
(
useTimeLag
+
""
).
divide
(
new
BigDecimal
((
24
*
60
*
60
*
1000
)+
""
)).
setScale
(
0
,
BigDecimal
.
ROUND_UP
).
intValue
();
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
);
//结合
//退款子流程: 订单基础,退款描述,退款金额
...
...
@@ -167,10 +172,12 @@ public class OrderCancelBiz {
//生成额外的费用明细
CancelStartedVO
csv
=
new
CancelStartedVO
();
csv
.
setType
(
CostDetailExtend
.
CANCEL_STARTED
);
csv
.
setConsumeAmount
(
inProgressVO
.
getConsumeAmount
());
csv
.
setModelAmount
(
orderItem
.
getUnitPrice
());
csv
.
setUsedAmount
(
inProgressVO
.
getUsedAmount
());
csv
.
setUsedDayNum
(
inProgressVO
.
getUsedDays
());
csv
.
setUsedfreeDayNum
(
inProgressVO
.
getUsedfreeDays
());
csv
.
setUsedFreeAmount
(
inProgressVO
.
getUsedFreeDaysAmount
());
csv
.
setHadConpon
((
StrUtil
.
isNotBlank
(
baseOrder
.
getCouponTickerNos
())?
Boolean
.
TRUE
:
Boolean
.
FALSE
));
//如果有扣款项,则生成额外的费用明细
...
...
@@ -192,15 +199,13 @@ public class OrderCancelBiz {
//判断是否使用免费天数,并且进行扣款
if
(
freeDays
>
0
)
{
freeDayAmount
=
orderItem
.
getUnitPrice
().
multiply
(
new
BigDecimal
(
orvd
.
getFreeDays
()+
""
));
}
//违约金封顶 租车身份价 * 2天
BigDecimal
topAmount
=
orderItem
.
getUnitPrice
().
multiply
(
new
BigDecimal
(
2
+
""
));
if
(
freeDayAmount
.
compareTo
(
topAmount
)
>
0
)
{
freeDayAmount
=
topAmount
;
}
}
//退款流程
orderAccountBiz
.
rentRefundProcessCancel
(
hasUpdateOrder
,
orderItem
.
getRealAmount
(),
timeLag
,
APP_ORDER
+
"_"
+
RENT_REFUND
,
orvd
.
getDeposit
(),
freeDayAmount
,
oad
);
orderAccountBiz
.
rentRefundProcessCancel
(
baseOrder
,
orderItem
.
getRealAmount
(),
timeLag
,
APP_ORDER
+
"_"
+
RENT_REFUND
,
orvd
.
getDeposit
(),
freeDayAmount
,
oad
,
topAmount
);
//如果有扣款项,则生成额外的费用明细
if
(
oad
.
getDeductions
().
size
()
>
0
)
{
...
...
@@ -253,7 +258,7 @@ public class OrderCancelBiz {
}
//退款流程
orderAccountBiz
.
rentRefundProcessCancel
(
hasUpdateOrder
,
adultItem
.
getRealAmount
().
add
(
childItem
.
getRealAmount
()),
timeLag
,
APP_ORDER
+
"_"
+
key
,
BigDecimal
.
ZERO
,
BigDecimal
.
ZERO
,
oad
);
orderAccountBiz
.
rentRefundProcessCancel
(
baseOrder
,
adultItem
.
getRealAmount
().
add
(
childItem
.
getRealAmount
()),
timeLag
,
APP_ORDER
+
"_"
+
key
,
BigDecimal
.
ZERO
,
BigDecimal
.
ZERO
,
oad
,
BigDecimal
.
ZERO
);
//如果有扣款项,则生成额外的费用明细
if
(
oad
.
getDeductions
().
size
()
>
0
)
{
...
...
@@ -324,4 +329,9 @@ public class OrderCancelBiz {
throw
new
BaseException
(
ResultCode
.
FAILED_CODE
);
}
}
// public static void main(String[] args) {
// Integer aaa = new BigDecimal(140119562.00 + "").divide(new BigDecimal((24 * 60 * 60 * 1000)+ ""), 0, RoundingMode.UP).intValue();
// System.out.println(aaa);
// }
}
\ No newline at end of file
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/jobhandler/RentDepositJobHandler.java
View file @
e4cd2247
...
...
@@ -126,7 +126,6 @@ public class RentDepositJobHandler extends IJobHandler {
}
OrderAccountDetail
oad
=
new
OrderAccountDetail
();
orderAccountBiz
.
refundTrigger
(
baseOrder
,
orvd
,
BigDecimal
.
ZERO
,
orvd
.
getReturnPayResidue
(),
refundAmont
,
refundDesc
,
RefundStatusEnum
.
REFUND_DEPOSIT
.
getCode
(),
AccountTypeEnum
.
OUT_RESIDUE_DEPOSIT
,
oad
);
//orderRefundBiz.refundTrigger(baseOrder, orvd, BigDecimal.ZERO, orvd.getReturnPayResidue(), refundAmont, refundDesc, RefundStatusEnum.REFUND_DEPOSIT.getCode(), RefundTypeEnum.RESIDUE_DEPOSIT);
orderDepositRefundRecordBiz
.
completeRecordStatus
(
crosstown
.
getId
(),
DepositRefundStatus
.
VIOLATIONARRIVAL
);
orderMsgBiz
.
handelMsgDeposit
(
orvd
,
baseOrder
,
userFeign
.
userDetailById
(
baseOrder
.
getUserId
()).
getData
());
}
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/rest/OrderRefundController.java
View file @
e4cd2247
...
...
@@ -84,7 +84,7 @@ public class OrderRefundController extends BaseController<OrderRefundBiz,OrderRe
DateTime
startTime
=
DateTime
.
parse
(
new
DateTime
(
orderPageVO
.
getOrderRentVehicleDetail
().
getStartTime
()).
toString
(
CommonConstants
.
YMR_SLASH_FORMATTER_JODA
),
CommonConstants
.
YMR_SLASH_FORMATTER_JODA
);
InProgressVO
inProgressVO
=
orderCalculateBiz
.
inProgressCalculate
(
orderPageVO
,
baseOrderBiz
.
getDaysBetweenDateTime
(
startTime
,
nowTime
));
// orderRefundAmount = orderAccountBiz.calculate
Refund
(orderPageVO.getGoodsAmount().subtract(orderPageVO.getCouponAmount())
// orderRefundAmount = orderAccountBiz.calculate
Deduction
(orderPageVO.getGoodsAmount().subtract(orderPageVO.getCouponAmount())
// , orderPageVO.getOrderRentVehicleDetail().getStartTime() - System.currentTimeMillis()
// , DictionaryKey.APP_ORDER+ "_"+ RENT_REFUND
// , refundDescBuilder);
...
...
@@ -102,7 +102,7 @@ public class OrderRefundController extends BaseController<OrderRefundBiz,OrderRe
// }});
// originalDeductAmount = orderItem.getUnitPrice().multiply(new BigDecimal(orvd.getFreeDays()+ ""));
// }
// BigDecimal residueAmount = orderRefundBiz.calculate
Refund
(originalDeductAmount, timeLag, APP_ORDER+ "_"+ RENT_REFUND, refundDescBuilder);
// BigDecimal residueAmount = orderRefundBiz.calculate
Deduction
(originalDeductAmount, timeLag, APP_ORDER+ "_"+ RENT_REFUND, refundDescBuilder);
//扣款 = 违约金 + 消费金额
BigDecimal
residueAmount
=
BigDecimal
.
ZERO
;
//inProgressVO.get
...
...
@@ -119,7 +119,7 @@ public class OrderRefundController extends BaseController<OrderRefundBiz,OrderRe
// if(SYS_TRUE.equals(orderPageVO.getOrderTourDetail().getIsOutside())) {
// key = TOUR_REFUND;
// }
// orderRefundAmount = orderRefundBiz.calculate
Refund
(orderPageVO.getGoodsAmount().subtract(orderPageVO.getCouponAmount())
// orderRefundAmount = orderRefundBiz.calculate
Deduction
(orderPageVO.getGoodsAmount().subtract(orderPageVO.getCouponAmount())
// , orderPageVO.getOrderTourDetail().getStartTime() - System.currentTimeMillis()
// , DictionaryKey.APP_ORDER+ "_"+ key
// , refundDescBuilder);
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/service/OrderTourService.java
View file @
e4cd2247
...
...
@@ -3,6 +3,8 @@ package com.xxfc.platform.order.service;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.lang.Dict
;
import
cn.hutool.core.util.StrUtil
;
import
cn.hutool.json.JSONObject
;
import
cn.hutool.json.JSONUtil
;
import
com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO
;
import
com.github.wxiaoqi.security.auth.client.config.UserAuthConfig
;
import
com.github.wxiaoqi.security.common.exception.BaseException
;
...
...
@@ -311,12 +313,15 @@ public class OrderTourService extends AbstractOrderHandle<OrderTourDetailBiz, To
* @return
*/
private
void
costDetail
(
TourPriceVO
vo
,
String
children
)
{
OrderTemplate
template
=
orderTemplateBiz
.
selectByCode
(
OrderCostEnum
.
RENT_VEHICLE
.
getCode
());
OrderTemplate
template
=
orderTemplateBiz
.
selectByCode
(
OrderCostEnum
.
TOUR
.
getCode
());
template
.
setTemplate
(
orderTemplateBiz
.
result
(
template
.
getTemplate
(),
new
HashMap
(){{
put
(
"children"
,
children
);
put
(
"paramJson"
,
vo
.
getParamJson
()
);
put
(
"paramJson"
,
""
);
}}));
String
result
=
orderTemplateBiz
.
result
(
template
,
Dict
.
parse
(
vo
));
JSONObject
jsonObject
=
JSONUtil
.
parseObj
(
result
);
jsonObject
.
put
(
"paramJson"
,
vo
.
getParamJson
());
result
=
JSONUtil
.
toJsonStr
(
jsonObject
);
vo
.
setCostDetail
(
result
);
}
}
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/VehicleActiveService.java
View file @
e4cd2247
...
...
@@ -3,7 +3,6 @@ package com.xxfc.platform.vehicle.biz;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.bean.copier.CopyOptions
;
import
com.github.wxiaoqi.security.common.exception.BaseException
;
import
com.xxfc.platform.vehicle.common.RestResponse
;
import
com.xxfc.platform.vehicle.constant.*
;
import
com.xxfc.platform.vehicle.constant.ResCode.ResCode
;
import
com.xxfc.platform.vehicle.entity.*
;
...
...
@@ -74,7 +73,7 @@ public class VehicleActiveService {
ResCode
.
VEHICLE_DEPARTURE_VEHICLE_DISABLE
.
getCode
());
}
//添加出车时间过滤 再出车开始时间前一天至结束时间内可以出车,并且预定记录为已审核状态
checkDateInvalid
e
(
departureVo
);
checkDateInvalid
(
departureVo
);
Integer
MileageLift
=
vehicle
.
getMileageLastUpdate
();
Integer
MileageLift1
=
departureVo
.
getMileage
();
if
(
MileageLift1
==
null
)
{
...
...
@@ -181,6 +180,7 @@ public class VehicleActiveService {
}
public
void
arrival
(
VehicleArrivalVo
arrivalVo
)
{
log
.
info
(
"用户还车操作:arrivalVo = {}"
,
arrivalVo
.
toString
());
Vehicle
vehicle
=
vehicleMapper
.
selectByPrimaryKey
(
arrivalVo
.
getVehicleId
());
if
(
vehicle
==
null
)
{
throw
new
BaseException
(
ResCode
.
VEHICLE_DEPARTURE_VEHICLE_UNEXIST
.
getDesc
(),
...
...
@@ -194,21 +194,17 @@ public class VehicleActiveService {
// throw new BaseException(ResCode.VEHICLE_DEPARTURE_VEHICLE_UNDEPARTURE.getDesc() + ", 车辆状态是:" + getVehicleStatus(vehicle.getStatus(), vehicle.getId()),
// ResCode.VEHICLE_DEPARTURE_VEHICLE_UNDEPARTURE.getCode());
// }
Integer
Mileage
r
est
=
vehicle
.
getMileageLastUpdate
();
Integer
Mileage
r
est1
=
arrivalVo
.
getMileage
();
if
(
Mileage
r
est1
==
null
)
{
Integer
Mileage
R
est
=
vehicle
.
getMileageLastUpdate
();
Integer
Mileage
R
est1
=
arrivalVo
.
getMileage
();
if
(
Mileage
R
est1
==
null
)
{
throw
new
BaseException
(
ResCode
.
VEHICLE_BOOKED_RECORD_MILEAGE_CHANGED
.
getDesc
(),
ResCode
.
VEHICLE_BOOKED_RECORD_MILEAGE_CHANGED
.
getCode
());
}
if
(
Mileage
rest
!=
null
&&
Mileagerest1
>=
Mileager
est
)
{
if
(
Mileage
Rest
!=
null
&&
MileageRest1
>=
MileageR
est
)
{
VehicleBookRecord
vehicleBookRecord
=
null
;
if
(
arrivalVo
.
getBookRecordId
()
!=
null
)
{
vehicleBookRecord
=
vehicleBookRecordBiz
.
selectById
(
arrivalVo
.
getBookRecordId
());
updateBookRecordStatus
(
vehicleBookRecord
,
2
);
}
// 写入车辆公里数,还车分公司id
vehicle
.
setMileageLastUpdate
(
Mileage
r
est1
);
vehicle
.
setMileageLastUpdate
(
Mileage
R
est1
);
if
(
vehicleBookRecord
!=
null
)
{
vehicle
.
setParkBranchCompanyId
(
vehicleBookRecord
.
getRetCompany
());
}
...
...
@@ -250,14 +246,23 @@ public class VehicleActiveService {
bookVehicleVo
.
setBookEndDate
(
null
);
bookVehicleVo
.
setUnbookStartDate
(
actualArrivalDate
.
toString
(
DATE_TIME_FORMATTER
));
bookVehicleVo
.
setUnbookEndDate
(
arrivalDate
.
toString
(
DATE_TIME_FORMATTER
));
bookVehicleVo
.
setRemark
(
bookVehicleVo
.
getRemark
()
+
" 用户提前还车,取消剩余天数, 初始预定结束时间是,"
+
new
DateTime
(
vehicleBookRecord
.
getBookEndDate
()).
toString
(
DATE_TIME_FORMATTER
));
vehicleBookRecord
.
setRemark
(
bookVehicleVo
.
getRemark
());
try
{
Boolean
hasSuc
=
vehicleBiz
.
unbookVehicle
(
bookVehicleVo
);
if
(!
hasSuc
)
{
throw
new
BaseException
(
ResCode
.
VEHICLE_UNBOOK_FAIL
.
getDesc
(),
ResCode
.
VEHICLE_UNBOOK_FAIL
.
getCode
());
}
}
catch
(
Exception
e
)
{
log
.
info
(
"提前还车失败,bookVehicleVo = {}"
,
bookVehicleVo
.
toString
());
e
.
printStackTrace
();
}
}
else
if
(
actualArrivalDate
.
compareTo
(
arrivalDate
)
>
0
)
{
//实际还车时间大于预计还车时间
vehicleBookRecord
.
setRemark
(
vehicleBookRecord
.
getRemark
()
+
" 用户延期还车,实际占用日期"
);
}
if
(
arrivalVo
.
getBookRecordId
()
!=
null
)
{
vehicleBookRecord
=
vehicleBookRecordBiz
.
selectById
(
arrivalVo
.
getBookRecordId
());
updateBookRecordStatus
(
vehicleBookRecord
,
2
);
}
departureLog
.
setMileageEnd
(
arrivalVo
.
getMileage
());
departureLog
.
setRecycleMan
(
arrivalVo
.
getRecycleMan
());
...
...
@@ -307,7 +312,7 @@ public class VehicleActiveService {
}
//添加出车时间过滤 再出车开始时间前一天至结束时间内可以出车,并且预定记录为已审核状态
public
void
checkDateInvalid
e
(
VehicleDepartureVo
arrivalVo
)
{
public
void
checkDateInvalid
(
VehicleDepartureVo
arrivalVo
)
{
if
(
arrivalVo
.
getBookRecordId
()
!=
null
)
{
VehicleBookRecord
vehicleBookRecord
=
vehicleBookRecordBiz
.
selectById
(
arrivalVo
.
getBookRecordId
());
if
(
vehicleBookRecord
!=
null
)
{
...
...
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