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
a176be33
Commit
a176be33
authored
Nov 11, 2019
by
周健威
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加接口
parent
b7233ef0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
82 additions
and
24 deletions
+82
-24
BaseOrderController.java
...ava/com/xxfc/platform/order/rest/BaseOrderController.java
+82
-24
No files found.
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/rest/BaseOrderController.java
View file @
a176be33
...
...
@@ -16,15 +16,14 @@ import com.github.wxiaoqi.security.common.util.ClientUtil;
import
com.github.wxiaoqi.security.common.util.Query
;
import
com.github.wxiaoqi.security.common.util.process.ResultCode
;
import
com.github.wxiaoqi.security.common.vo.PageDataVO
;
import
com.xxfc.platform.order.biz.BaseOrderBiz
;
import
com.xxfc.platform.order.biz.OrderItemBiz
;
import
com.xxfc.platform.order.biz.OrderMemberDetailBiz
;
import
com.xxfc.platform.order.biz.OrderUserLicenseBiz
;
import
com.xxfc.platform.order.biz.*
;
import
com.xxfc.platform.order.biz.inner.OrderCancelBiz
;
import
com.xxfc.platform.order.
contant.enumerate.OrderStatusEnum
;
import
com.xxfc.platform.order.
entity.BaseOrder
;
import
com.xxfc.platform.order.entity.
OrderItem
;
import
com.xxfc.platform.order.
biz.inner.OrderMsgBiz
;
import
com.xxfc.platform.order.
contant.enumerate.*
;
import
com.xxfc.platform.order.entity.
*
;
import
com.xxfc.platform.order.mqhandler.RabbitProduct
;
import
com.xxfc.platform.order.pojo.account.OrderAccountDeduction
;
import
com.xxfc.platform.order.pojo.account.OrderAccountDetail
;
import
com.xxfc.platform.order.pojo.order.CancelOrderDTO
;
import
com.xxfc.platform.order.pojo.order.OrderAboutParamDTO
;
import
com.xxfc.platform.order.pojo.order.OrderPageVO
;
...
...
@@ -57,6 +56,8 @@ import java.util.List;
import
java.util.Map
;
import
java.util.stream.Collectors
;
import
static
com
.
github
.
wxiaoqi
.
security
.
common
.
constant
.
CommonConstants
.
SYS_FALSE
;
import
static
com
.
github
.
wxiaoqi
.
security
.
common
.
constant
.
CommonConstants
.
SYS_TRUE
;
import
static
com
.
xxfc
.
platform
.
universal
.
constant
.
DictionaryKey
.
APP_ORDER
;
@Controller
...
...
@@ -90,6 +91,24 @@ public class BaseOrderController extends CommonBaseController implements UserRes
@Autowired
OrderItemBiz
orderItemBiz
;
@Autowired
OrderRentVehicleBiz
orderRentVehicleBiz
;
@Autowired
OrderVehicleCrosstownBiz
crosstownBiz
;
@Autowired
OrderViolationBiz
orderViolationBiz
;
@Autowired
OrderAccountBiz
orderAccountBiz
;
@Autowired
OrderMsgBiz
orderMsgBiz
;
@Autowired
OrderDepositRefundRecordBiz
orderDepositRefundRecordBiz
;
@Override
public
UserFeign
getUserFeign
()
{
return
userFeign
;
...
...
@@ -382,22 +401,61 @@ public class BaseOrderController extends CommonBaseController implements UserRes
return
ObjectRestResponse
.
succ
(
result
);
}
// @RequestMapping(value = "/app/unauth/refundDeposit/{no}/{refundAmount}", method = RequestMethod.POST)
// @ResponseBody
// @ApiOperation(value = "退款违章保证金")
// @IgnoreClientToken
// @IgnoreUserToken
// public ObjectRestResponse refundDepositAmount(@PathVariable("no") String no, @PathVariable("refundAmount") BigDecimal refundAmount) {
// OrderRefundVo orv = new OrderRefundVo();
// BaseOrder baseOrder = baseOrderBiz.selectOne(new BaseOrder(){{
// setNo(no);
// }});
// orv.setAmount(baseOrder.getRealAmount().multiply(new BigDecimal("100")).intValue());
// orv.setOrderNo(baseOrder.getNo());
// orv.setRefundDesc("");
// orv.setRefundAmount(refundAmount.multiply(new BigDecimal("100")).intValue());
// ObjectRestResponse<String> result = thirdFeign.refund(orv);
// return ObjectRestResponse.succ(result);
// }
@RequestMapping
(
value
=
"/app/unauth/refundDeposit/{no}/{refundAmount}"
,
method
=
RequestMethod
.
POST
)
@ResponseBody
@ApiOperation
(
value
=
"退款违章保证金"
)
@IgnoreClientToken
@IgnoreUserToken
public
ObjectRestResponse
refundDepositAmount
(
@PathVariable
(
"no"
)
String
no
)
{
BaseOrder
baseOrder
=
baseOrderBiz
.
selectOne
(
new
BaseOrder
(){{
setNo
(
no
);
}});
OrderRentVehicleDetail
orvd
=
orderRentVehicleBiz
.
selectOne
(
new
OrderRentVehicleDetail
()
{{
setOrderId
(
baseOrder
.
getId
());
}});
Integer
crosstownTypeEnum
;
//判断是否定损过
if
(
SYS_TRUE
.
equals
(
orvd
.
getFixedLossStatus
()))
{
crosstownTypeEnum
=
CrosstownTypeEnum
.
FIXED_LOSS
.
getCode
();
}
else
{
crosstownTypeEnum
=
CrosstownTypeEnum
.
ARRIVE
.
getCode
();
}
OrderVehicleCrosstown
crosstown
=
crosstownBiz
.
selectOne
(
new
OrderVehicleCrosstown
(){{
setOrderId
(
baseOrder
.
getId
());
setType
(
crosstownTypeEnum
);
}});
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
(
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
());
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