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
d01a5d7b
Commit
d01a5d7b
authored
Aug 05, 2019
by
jiaorz
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/base-modify' into base-modify
parents
02cd467c
bbdbfb62
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
1 deletion
+27
-1
OrderRefundBiz.java
...main/java/com/xxfc/platform/order/biz/OrderRefundBiz.java
+27
-1
No files found.
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/OrderRefundBiz.java
View file @
d01a5d7b
...
@@ -4,7 +4,10 @@ import cn.hutool.core.bean.BeanUtil;
...
@@ -4,7 +4,10 @@ import cn.hutool.core.bean.BeanUtil;
import
cn.hutool.core.util.StrUtil
;
import
cn.hutool.core.util.StrUtil
;
import
cn.hutool.json.JSONUtil
;
import
cn.hutool.json.JSONUtil
;
import
com.github.wxiaoqi.security.admin.feign.UserFeign
;
import
com.github.wxiaoqi.security.admin.feign.UserFeign
;
import
com.github.wxiaoqi.security.common.exception.BaseException
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.util.IntervalUtil
;
import
com.github.wxiaoqi.security.common.util.IntervalUtil
;
import
com.github.wxiaoqi.security.common.util.process.ResultCode
;
import
com.xxfc.platform.order.biz.inner.OrderMsgBiz
;
import
com.xxfc.platform.order.biz.inner.OrderMsgBiz
;
import
com.xxfc.platform.order.contant.enumerate.*
;
import
com.xxfc.platform.order.contant.enumerate.*
;
import
com.xxfc.platform.order.entity.*
;
import
com.xxfc.platform.order.entity.*
;
...
@@ -14,6 +17,7 @@ import com.xxfc.platform.universal.constant.DictionaryKey;
...
@@ -14,6 +17,7 @@ import com.xxfc.platform.universal.constant.DictionaryKey;
import
com.xxfc.platform.universal.entity.Dictionary
;
import
com.xxfc.platform.universal.entity.Dictionary
;
import
com.xxfc.platform.universal.feign.ThirdFeign
;
import
com.xxfc.platform.universal.feign.ThirdFeign
;
import
com.xxfc.platform.universal.vo.OrderRefundVo
;
import
com.xxfc.platform.universal.vo.OrderRefundVo
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.jexl2.MapContext
;
import
org.apache.commons.jexl2.MapContext
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
...
@@ -23,6 +27,7 @@ import com.github.wxiaoqi.security.common.biz.BaseBiz;
...
@@ -23,6 +27,7 @@ import com.github.wxiaoqi.security.common.biz.BaseBiz;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
import
java.math.RoundingMode
;
import
java.math.RoundingMode
;
import
java.util.HashSet
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.Set
;
import
java.util.Set
;
...
@@ -39,6 +44,7 @@ import static com.xxfc.platform.universal.constant.DictionaryKey.APP_ORDER;
...
@@ -39,6 +44,7 @@ import static com.xxfc.platform.universal.constant.DictionaryKey.APP_ORDER;
* @date 2019-06-18 11:08:09
* @date 2019-06-18 11:08:09
*/
*/
@Service
@Service
@Slf4j
public
class
OrderRefundBiz
extends
BaseBiz
<
OrderRefundMapper
,
OrderRefund
>
{
public
class
OrderRefundBiz
extends
BaseBiz
<
OrderRefundMapper
,
OrderRefund
>
{
@Autowired
@Autowired
ThirdFeign
thirdFeign
;
ThirdFeign
thirdFeign
;
...
@@ -61,6 +67,9 @@ public class OrderRefundBiz extends BaseBiz<OrderRefundMapper,OrderRefund> {
...
@@ -61,6 +67,9 @@ public class OrderRefundBiz extends BaseBiz<OrderRefundMapper,OrderRefund> {
@Autowired
@Autowired
UserFeign
userFeign
;
UserFeign
userFeign
;
@Autowired
OrderDepositRefundRecordBiz
orderDepositRefundRecordBiz
;
/**
/**
* 退还部分押金
* 退还部分押金
* @param orderMQDTO
* @param orderMQDTO
...
@@ -72,16 +81,25 @@ public class OrderRefundBiz extends BaseBiz<OrderRefundMapper,OrderRefund> {
...
@@ -72,16 +81,25 @@ public class OrderRefundBiz extends BaseBiz<OrderRefundMapper,OrderRefund> {
//未退还, 进行挂起保留违章预备金 的退还
//未退还, 进行挂起保留违章预备金 的退还
if
(
RefundStatusEnum
.
NONE
.
getCode
().
equals
(
orderMQDTO
.
getRefundStatus
()))
{
if
(
RefundStatusEnum
.
NONE
.
getCode
().
equals
(
orderMQDTO
.
getRefundStatus
()))
{
Integer
crosstownTypeEnum
;
Integer
crosstownTypeEnum
;
Integer
depositRefundRecordStatus
;
//判断是否定损过
//判断是否定损过
if
(
SYS_TRUE
.
equals
(
orderMQDTO
.
getOrderRentVehicleDetail
().
getFixedLossStatus
()))
{
if
(
SYS_TRUE
.
equals
(
orderMQDTO
.
getOrderRentVehicleDetail
().
getFixedLossStatus
()))
{
crosstownTypeEnum
=
CrosstownTypeEnum
.
FIXED_LOSS
.
getCode
();
crosstownTypeEnum
=
CrosstownTypeEnum
.
FIXED_LOSS
.
getCode
();
depositRefundRecordStatus
=
DepositRefundStatus
.
FIXLOSSREFUND
.
getCode
();
}
else
{
}
else
{
crosstownTypeEnum
=
CrosstownTypeEnum
.
ARRIVE
.
getCode
();
crosstownTypeEnum
=
CrosstownTypeEnum
.
ARRIVE
.
getCode
();
depositRefundRecordStatus
=
DepositRefundStatus
.
REFUNDARRIVAL
.
getCode
();
}
}
OrderVehicleCrosstown
crosstown
=
crosstownBiz
.
selectOne
(
new
OrderVehicleCrosstown
(){{
OrderVehicleCrosstown
crosstown
=
crosstownBiz
.
selectOne
(
new
OrderVehicleCrosstown
(){{
setOrderId
(
orderMQDTO
.
getId
());
setOrderId
(
orderMQDTO
.
getId
());
setType
(
crosstownTypeEnum
);
setType
(
crosstownTypeEnum
);
}});
}});
if
(
null
==
crosstown
)
{
throw
new
BaseException
(
ResultCode
.
PARAM_ILLEGAL_CODE
,
new
HashSet
<
String
>(){{
add
(
"退款第一部分押金失败,获取不了还车/定损记录,订单号:"
+
orderMQDTO
.
getId
());
}});
}
//还车扣除款 剩余的 钱,再减去违章预备金
//还车扣除款 剩余的 钱,再减去违章预备金
BigDecimal
refundAmont
=
crosstown
.
getRestDeposit
().
subtract
(
illegalReserve
);
BigDecimal
refundAmont
=
crosstown
.
getRestDeposit
().
subtract
(
illegalReserve
);
BigDecimal
originalRefundAmount
=
crosstown
.
getRestDeposit
().
add
(
crosstown
.
getDeductionCost
()).
subtract
(
illegalReserve
);
BigDecimal
originalRefundAmount
=
crosstown
.
getRestDeposit
().
add
(
crosstown
.
getDeductionCost
()).
subtract
(
illegalReserve
);
...
@@ -93,6 +111,10 @@ public class OrderRefundBiz extends BaseBiz<OrderRefundMapper,OrderRefund> {
...
@@ -93,6 +111,10 @@ public class OrderRefundBiz extends BaseBiz<OrderRefundMapper,OrderRefund> {
refundDesc
+=
")"
;
refundDesc
+=
")"
;
refundTrigger
(
orderMQDTO
,
orderMQDTO
.
getOrderRentVehicleDetail
(),
illegalReserve
,
originalRefundAmount
,
refundAmont
,
refundDesc
,
RefundStatusEnum
.
RESIDUE_ILLEGAL
.
getCode
(),
RefundTypeEnum
.
PART_DEPOSIT
);
refundTrigger
(
orderMQDTO
,
orderMQDTO
.
getOrderRentVehicleDetail
(),
illegalReserve
,
originalRefundAmount
,
refundAmont
,
refundDesc
,
RefundStatusEnum
.
RESIDUE_ILLEGAL
.
getCode
(),
RefundTypeEnum
.
PART_DEPOSIT
);
DepositRefundRecord
depositRefundRecord
=
orderDepositRefundRecordBiz
.
findByCrossIdAndStatus
(
crosstown
.
getId
(),
depositRefundRecordStatus
);
depositRefundRecord
.
setIscomplete
(
Boolean
.
TRUE
);
orderDepositRefundRecordBiz
.
updateSelectiveById
(
depositRefundRecord
);
orderMsgBiz
.
handelMsgDeposit
(
orderMQDTO
.
getOrderRentVehicleDetail
(),
orderMQDTO
,
userFeign
.
userDetailById
(
orderMQDTO
.
getUserId
()).
getData
());
orderMsgBiz
.
handelMsgDeposit
(
orderMQDTO
.
getOrderRentVehicleDetail
(),
orderMQDTO
,
userFeign
.
userDetailById
(
orderMQDTO
.
getUserId
()).
getData
());
}
}
// else {
// else {
...
@@ -220,7 +242,11 @@ public class OrderRefundBiz extends BaseBiz<OrderRefundMapper,OrderRefund> {
...
@@ -220,7 +242,11 @@ public class OrderRefundBiz extends BaseBiz<OrderRefundMapper,OrderRefund> {
orv
.
setOrderNo
(
baseOrder
.
getNo
());
orv
.
setOrderNo
(
baseOrder
.
getNo
());
orv
.
setRefundDesc
(
refundDesc
+
refundAmount
.
toString
());
orv
.
setRefundDesc
(
refundDesc
+
refundAmount
.
toString
());
orv
.
setRefundAmount
(
refundAmount
.
multiply
(
new
BigDecimal
(
"100"
)).
intValue
());
orv
.
setRefundAmount
(
refundAmount
.
multiply
(
new
BigDecimal
(
"100"
)).
intValue
());
refundTradeNo
=
thirdFeign
.
refund
(
orv
).
getData
();
ObjectRestResponse
<
String
>
result
=
thirdFeign
.
refund
(
orv
);
refundTradeNo
=
result
.
getData
();
if
(
null
==
refundTradeNo
)
{
log
.
error
(
"退款没有refundTradeNo,订单号为:"
+
baseOrder
.
getNo
()+
", 微服务调用结果为"
+
JSONUtil
.
toJsonStr
(
result
));
}
}
}
//记录订单退款记录
//记录订单退款记录
...
...
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