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
daea651f
Commit
daea651f
authored
Nov 12, 2019
by
周健威
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master-zjw' into dev
parents
69dbbab7
3b747bfc
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
66 additions
and
51 deletions
+66
-51
OrderAccountBiz.java
...ain/java/com/xxfc/platform/order/biz/OrderAccountBiz.java
+31
-0
RentDepositJobHandler.java
...xxfc/platform/order/jobhandler/RentDepositJobHandler.java
+1
-27
BaseOrderController.java
...ava/com/xxfc/platform/order/rest/BaseOrderController.java
+34
-24
No files found.
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/OrderAccountBiz.java
View file @
daea651f
...
@@ -78,6 +78,9 @@ public class OrderAccountBiz extends BaseBiz<OrderAccountMapper,OrderAccount> {
...
@@ -78,6 +78,9 @@ public class OrderAccountBiz extends BaseBiz<OrderAccountMapper,OrderAccount> {
@Autowired
@Autowired
OrderCalculateBiz
orderCalculateBiz
;
OrderCalculateBiz
orderCalculateBiz
;
@Autowired
OrderViolationBiz
orderViolationBiz
;
@Autowired
@Autowired
ThirdFeign
thirdFeign
;
ThirdFeign
thirdFeign
;
...
@@ -601,6 +604,34 @@ public class OrderAccountBiz extends BaseBiz<OrderAccountMapper,OrderAccount> {
...
@@ -601,6 +604,34 @@ public class OrderAccountBiz extends BaseBiz<OrderAccountMapper,OrderAccount> {
}
}
public
void
handleRentDepositMargin
(
BaseOrder
baseOrder
,
OrderRentVehicleDetail
orvd
,
OrderVehicleCrosstown
crosstown
)
{
OrderViolation
orderViolation
=
orderViolationBiz
.
selectOne
(
new
OrderViolation
(){{
setDetailId
(
orvd
.
getId
());
setIsDel
(
SYS_FALSE
);
}});
OrderAccountDetail
oad
=
new
OrderAccountDetail
();
String
refundDesc
=
"退还违章押金:"
;
BigDecimal
refundAmont
;
if
(
null
!=
orderViolation
)
{
//设置扣款项
oad
.
getDeductions
().
add
(
initDeduction
(
orderViolation
.
getPrice
(),
DeductionTypeEnum
.
VIOLATE_TRAFFIC_DEDUCT
.
getDesc
(),
DeductionTypeEnum
.
VIOLATE_TRAFFIC_DEDUCT
,
OrderAccountDeduction
.
ORIGIN_DEPOSIT
)
);
//还车扣除款 剩余的 钱,再减去违章预备金
refundAmont
=
orvd
.
getReturnPayResidue
().
subtract
(
orderViolation
.
getPrice
());
refundDesc
+=
refundAmont
.
toString
();
}
else
{
refundAmont
=
orvd
.
getReturnPayResidue
();
refundDesc
+=
refundAmont
.
toString
();
}
oad
.
setOriginDepositAmount
(
orvd
.
getReturnPayResidue
());
oad
.
setDepositAmount
(
refundAmont
);
refundTrigger
(
baseOrder
,
orvd
,
BigDecimal
.
ZERO
,
orvd
.
getReturnPayResidue
(),
refundAmont
,
refundDesc
,
RefundStatusEnum
.
REFUND_DEPOSIT
.
getCode
(),
AccountTypeEnum
.
OUT_RESIDUE_DEPOSIT
,
oad
);
orderDepositRefundRecordBiz
.
completeRecordStatus
(
crosstown
.
getId
(),
DepositRefundStatus
.
VIOLATIONARRIVAL
);
orderMsgBiz
.
handelMsgDeposit
(
orvd
,
baseOrder
,
userFeign
.
userDetailById
(
baseOrder
.
getUserId
()).
getData
());
}
}
}
\ No newline at end of file
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/jobhandler/RentDepositJobHandler.java
View file @
daea651f
...
@@ -103,33 +103,7 @@ public class RentDepositJobHandler extends IJobHandler {
...
@@ -103,33 +103,7 @@ public class RentDepositJobHandler extends IJobHandler {
}});
}});
if
(
crosstown
.
getCrtTime
().
compareTo
(
System
.
currentTimeMillis
()
-
(
rentDepositAutoRefundTime
*
60L
*
1000L
))
<
0
)
{
if
(
crosstown
.
getCrtTime
().
compareTo
(
System
.
currentTimeMillis
()
-
(
rentDepositAutoRefundTime
*
60L
*
1000L
))
<
0
)
{
OrderViolation
orderViolation
=
orderViolationBiz
.
selectOne
(
new
OrderViolation
(){{
orderAccountBiz
.
handleRentDepositMargin
(
baseOrder
,
orvd
,
crosstown
);
setDetailId
(
orvd
.
getId
());
setIsDel
(
SYS_FALSE
);
}});
OrderAccountDetail
oad
=
new
OrderAccountDetail
();
String
refundDesc
=
"退还违章押金:"
;
BigDecimal
refundAmont
;
if
(
null
!=
orderViolation
)
{
//设置扣款项
oad
.
getDeductions
().
add
(
orderAccountBiz
.
initDeduction
(
orderViolation
.
getPrice
(),
DeductionTypeEnum
.
VIOLATE_TRAFFIC_DEDUCT
.
getDesc
(),
DeductionTypeEnum
.
VIOLATE_TRAFFIC_DEDUCT
,
OrderAccountDeduction
.
ORIGIN_DEPOSIT
)
);
//还车扣除款 剩余的 钱,再减去违章预备金
refundAmont
=
orvd
.
getReturnPayResidue
().
subtract
(
orderViolation
.
getPrice
());
refundDesc
+=
refundAmont
.
toString
();
}
else
{
refundAmont
=
orvd
.
getReturnPayResidue
();
refundDesc
+=
refundAmont
.
toString
();
}
oad
.
setOriginDepositAmount
(
orvd
.
getReturnPayResidue
());
oad
.
setDepositAmount
(
refundAmont
);
orderAccountBiz
.
refundTrigger
(
baseOrder
,
orvd
,
BigDecimal
.
ZERO
,
orvd
.
getReturnPayResidue
(),
refundAmont
,
refundDesc
,
RefundStatusEnum
.
REFUND_DEPOSIT
.
getCode
(),
AccountTypeEnum
.
OUT_RESIDUE_DEPOSIT
,
oad
);
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/BaseOrderController.java
View file @
daea651f
...
@@ -24,6 +24,7 @@ import com.xxfc.platform.order.entity.*;
...
@@ -24,6 +24,7 @@ import com.xxfc.platform.order.entity.*;
import
com.xxfc.platform.order.mqhandler.RabbitProduct
;
import
com.xxfc.platform.order.mqhandler.RabbitProduct
;
import
com.xxfc.platform.order.pojo.account.OrderAccountDeduction
;
import
com.xxfc.platform.order.pojo.account.OrderAccountDeduction
;
import
com.xxfc.platform.order.pojo.account.OrderAccountDetail
;
import
com.xxfc.platform.order.pojo.account.OrderAccountDetail
;
import
com.xxfc.platform.order.pojo.mq.OrderMQDTO
;
import
com.xxfc.platform.order.pojo.order.CancelOrderDTO
;
import
com.xxfc.platform.order.pojo.order.CancelOrderDTO
;
import
com.xxfc.platform.order.pojo.order.OrderAboutParamDTO
;
import
com.xxfc.platform.order.pojo.order.OrderAboutParamDTO
;
import
com.xxfc.platform.order.pojo.order.OrderPageVO
;
import
com.xxfc.platform.order.pojo.order.OrderPageVO
;
...
@@ -407,6 +408,9 @@ public class BaseOrderController extends CommonBaseController implements UserRes
...
@@ -407,6 +408,9 @@ public class BaseOrderController extends CommonBaseController implements UserRes
@IgnoreClientToken
@IgnoreClientToken
@IgnoreUserToken
@IgnoreUserToken
public
ObjectRestResponse
refundDepositAmount
(
@PathVariable
(
"no"
)
String
no
)
{
public
ObjectRestResponse
refundDepositAmount
(
@PathVariable
(
"no"
)
String
no
)
{
if
(
StrUtil
.
isBlank
(
no
))
{
return
ObjectRestResponse
.
createDefaultFail
();
}
BaseOrder
baseOrder
=
baseOrderBiz
.
selectOne
(
new
BaseOrder
(){{
BaseOrder
baseOrder
=
baseOrderBiz
.
selectOne
(
new
BaseOrder
(){{
setNo
(
no
);
setNo
(
no
);
}});
}});
...
@@ -427,35 +431,41 @@ public class BaseOrderController extends CommonBaseController implements UserRes
...
@@ -427,35 +431,41 @@ public class BaseOrderController extends CommonBaseController implements UserRes
setType
(
crosstownTypeEnum
);
setType
(
crosstownTypeEnum
);
}});
}});
OrderViolation
orderViolation
=
orderViolationBiz
.
selectOne
(
new
OrderViolation
(){{
orderAccountBiz
.
handleRentDepositMargin
(
baseOrder
,
orvd
,
crosstown
);
setDetailId
(
orvd
.
getId
());
setIsDel
(
SYS_FALSE
);
return
ObjectRestResponse
.
succ
(
);
}});
}
OrderAccountDetail
oad
=
new
OrderAccountDetail
();
@RequestMapping
(
value
=
"/app/unauth/refundPartDeposit/{no}"
,
method
=
RequestMethod
.
POST
)
@ResponseBody
@ApiOperation
(
value
=
"退款第一部分证金"
)
@IgnoreClientToken
@IgnoreUserToken
public
ObjectRestResponse
refundPartDepositAmount
(
@PathVariable
(
"no"
)
String
no
)
{
if
(
StrUtil
.
isBlank
(
no
))
{
return
ObjectRestResponse
.
createDefaultFail
();
}
BaseOrder
baseOrder
=
baseOrderBiz
.
selectOne
(
new
BaseOrder
(){{
setNo
(
no
);
}});
//发送队列消息
OrderMQDTO
orderMQDTO
=
BeanUtil
.
toBean
(
baseOrder
,
OrderMQDTO
.
class
);
orderMQDTO
.
setOrderRentVehicleDetail
(
orderRentVehicleBiz
.
selectOne
(
new
OrderRentVehicleDetail
(){{
setOrderId
(
baseOrder
.
getId
());
}}));
orderMQDTO
.
setOrderTourDetail
(
new
OrderTourDetail
());
orderMQDTO
.
setOrderMemberDetail
(
new
OrderMemberDetail
());
String
refundDesc
=
"退还违章押金:"
;
//获取item
BigDecimal
refundAmont
;
orderMQDTO
.
setItems
(
orderItemBiz
.
selectList
(
new
OrderItem
()
{{
if
(
null
!=
orderViolation
)
{
setOrderId
(
baseOrder
.
getId
());
//设置扣款项
}}));
oad
.
getDeductions
().
add
(
orderAccountBiz
.
initDeduction
(
orderViolation
.
getPrice
(),
DeductionTypeEnum
.
VIOLATE_TRAFFIC_DEDUCT
.
getDesc
(),
DeductionTypeEnum
.
VIOLATE_TRAFFIC_DEDUCT
,
OrderAccountDeduction
.
ORIGIN_DEPOSIT
)
);
//还车扣除款 剩余的 钱,再减去违章预备金
//租车订单完成
refundAmont
=
orvd
.
getReturnPayResidue
().
subtract
(
orderViolation
.
getPrice
());
if
(
OrderTypeEnum
.
RENT_VEHICLE
.
getCode
().
equals
(
orderMQDTO
.
getType
()))
{
refundDesc
+=
refundAmont
.
toString
();
orderAccountBiz
.
refundPartDeposit
(
orderMQDTO
);
}
else
{
refundAmont
=
orvd
.
getReturnPayResidue
();
refundDesc
+=
refundAmont
.
toString
();
}
}
oad
.
setOriginDepositAmount
(
orvd
.
getReturnPayResidue
());
oad
.
setDepositAmount
(
refundAmont
);
orderAccountBiz
.
refundTrigger
(
baseOrder
,
orvd
,
BigDecimal
.
ZERO
,
orvd
.
getReturnPayResidue
(),
refundAmont
,
refundDesc
,
RefundStatusEnum
.
REFUND_DEPOSIT
.
getCode
(),
AccountTypeEnum
.
OUT_RESIDUE_DEPOSIT
,
oad
);
orderDepositRefundRecordBiz
.
completeRecordStatus
(
crosstown
.
getId
(),
DepositRefundStatus
.
VIOLATIONARRIVAL
);
orderMsgBiz
.
handelMsgDeposit
(
orvd
,
baseOrder
,
userFeign
.
userDetailById
(
baseOrder
.
getUserId
()).
getData
());
return
ObjectRestResponse
.
succ
();
return
ObjectRestResponse
.
succ
();
}
}
}
}
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