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
707879fe
Commit
707879fe
authored
Nov 04, 2020
by
周健威
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改流程
parent
421b2809
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
65 additions
and
32 deletions
+65
-32
SpecialRentBiz.java
...main/java/com/xxfc/platform/order/biz/SpecialRentBiz.java
+8
-3
OrderCancelBiz.java
...ava/com/xxfc/platform/order/biz/inner/OrderCancelBiz.java
+23
-2
SpecialRentController.java
...a/com/xxfc/platform/order/rest/SpecialRentController.java
+8
-7
OrderRentVehicleService.java
.../xxfc/platform/order/service/OrderRentVehicleService.java
+25
-19
RentVehicleController.java
...com/xxfc/platform/vehicle/rest/RentVehicleController.java
+1
-1
No files found.
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/SpecialRentBiz.java
View file @
707879fe
...
@@ -154,6 +154,13 @@ public class SpecialRentBiz extends BaseBiz<SpecialRentMapper, SpecialRent> {
...
@@ -154,6 +154,13 @@ public class SpecialRentBiz extends BaseBiz<SpecialRentMapper, SpecialRent> {
specialRent
.
setUpdUser
(
userDTO
.
getId
().
toString
());
specialRent
.
setUpdUser
(
userDTO
.
getId
().
toString
());
specialRent
.
setStatus
(
STATUS_CRT
);
specialRent
.
setStatus
(
STATUS_CRT
);
Long
delayTime
=
handleRent
(
specialRent
,
vehicle
);
insertSelective
(
specialRent
);
// rabbitProduct.sendApplyRequireDelayMessage(baseBiz.selectById(shuntApply.getId()), delayTime);
rabbitProduct
.
sendSpecialDelayMessage
(
selectById
(
specialRent
.
getId
()),
delayTime
);
}
public
Long
handleRent
(
@RequestBody
SpecialRent
specialRent
,
VehicleVO
vehicle
)
{
RentVehicleBO
detail
=
new
RentVehicleBO
();
RentVehicleBO
detail
=
new
RentVehicleBO
();
detail
.
setStartTime
(
specialRent
.
getStartTime
());
detail
.
setStartTime
(
specialRent
.
getStartTime
());
detail
.
setEndTime
(
specialRent
.
getEndTime
());
detail
.
setEndTime
(
specialRent
.
getEndTime
());
...
@@ -188,8 +195,6 @@ public class SpecialRentBiz extends BaseBiz<SpecialRentMapper, SpecialRent> {
...
@@ -188,8 +195,6 @@ public class SpecialRentBiz extends BaseBiz<SpecialRentMapper, SpecialRent> {
Date
endDateTime
=
DateUtil
.
date
(
specialRent
.
getEndTime
());
Date
endDateTime
=
DateUtil
.
date
(
specialRent
.
getEndTime
());
Long
delayTime
=
DateUtil
.
offsetHour
(
endDateTime
,
-
1
).
getTime
()
-
DateUtil
.
date
().
getTime
();
Long
delayTime
=
DateUtil
.
offsetHour
(
endDateTime
,
-
1
).
getTime
()
-
DateUtil
.
date
().
getTime
();
specialRent
.
setOverTime
(
DateUtil
.
offsetHour
(
endDateTime
,
-
1
).
getTime
());
specialRent
.
setOverTime
(
DateUtil
.
offsetHour
(
endDateTime
,
-
1
).
getTime
());
insertSelective
(
specialRent
);
return
delayTime
;
// rabbitProduct.sendApplyRequireDelayMessage(baseBiz.selectById(shuntApply.getId()), delayTime);
rabbitProduct
.
sendSpecialDelayMessage
(
selectById
(
specialRent
.
getId
()),
delayTime
);
}
}
}
}
\ No newline at end of file
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/inner/OrderCancelBiz.java
View file @
707879fe
...
@@ -14,6 +14,7 @@ import com.xxfc.platform.activity.feign.ActivityFeign;
...
@@ -14,6 +14,7 @@ import com.xxfc.platform.activity.feign.ActivityFeign;
import
com.xxfc.platform.order.biz.*
;
import
com.xxfc.platform.order.biz.*
;
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.*
;
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.calculate.InProgressVO
;
import
com.xxfc.platform.order.pojo.calculate.InProgressVO
;
...
@@ -28,6 +29,7 @@ import com.xxfc.platform.universal.entity.Dictionary;
...
@@ -28,6 +29,7 @@ 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.vehicle.common.RestResponse
;
import
com.xxfc.platform.vehicle.common.RestResponse
;
import
com.xxfc.platform.vehicle.feign.VehicleFeign
;
import
com.xxfc.platform.vehicle.feign.VehicleFeign
;
import
com.xxfc.platform.vehicle.pojo.vo.VehicleVO
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -90,6 +92,9 @@ public class OrderCancelBiz {
...
@@ -90,6 +92,9 @@ public class OrderCancelBiz {
@Autowired
@Autowired
SpecialRentBiz
specialRentBiz
;
SpecialRentBiz
specialRentBiz
;
@Autowired
RabbitProduct
rabbitProduct
;
@Autowired
@Autowired
UserFeign
userFeign
;
UserFeign
userFeign
;
...
@@ -366,9 +371,24 @@ public class OrderCancelBiz {
...
@@ -366,9 +371,24 @@ public class OrderCancelBiz {
if
(
OrderStatusEnum
.
ORDER_CANCEL
.
getCode
().
equals
(
baseOrder
.
getStatus
())
&&
SYS_TRUE
.
equals
(
baseOrder
.
getHasPay
())){
if
(
OrderStatusEnum
.
ORDER_CANCEL
.
getCode
().
equals
(
baseOrder
.
getStatus
())
&&
SYS_TRUE
.
equals
(
baseOrder
.
getHasPay
())){
vehicleFeign
.
rentUnbookVehicle
(
orvd
.
getBookRecordId
());
vehicleFeign
.
rentUnbookVehicle
(
orvd
.
getBookRecordId
());
//特惠租车 恢复排班记录
if
(
BaseOrder
.
ORDER_SIGN_SPECIAL
==
baseOrder
.
getOrderSign
())
{
SpecialRent
specialRent
=
specialRentBiz
.
selectOne
(
new
SpecialRent
(){{
setOrderNo
(
baseOrder
.
getNo
());
}});
VehicleVO
vehicle
=
vehicleFeign
.
getVehicleDetail
(
specialRent
.
getVehicleId
()).
getData
();
Long
delayTime
=
specialRentBiz
.
handleRent
(
specialRent
,
vehicle
);
specialRent
.
setUpdTime
(
null
);
specialRentBiz
.
updateSelectiveById
(
specialRent
);
rabbitProduct
.
sendSpecialDelayMessage
(
specialRentBiz
.
selectById
(
specialRent
.
getId
()),
delayTime
);
}
}
else
{
}
else
{
//未支付,拒绝之前的预约
//非特惠租车 拒绝之前预约
RestResponse
<
Integer
>
restResponse
=
vehicleFeign
.
rentRejectVehicleBooking
(
orvd
.
getBookRecordId
());
if
(
BaseOrder
.
ORDER_SIGN_SPECIAL
!=
baseOrder
.
getOrderSign
())
{
//未支付,拒绝之前的预约
RestResponse
<
Integer
>
restResponse
=
vehicleFeign
.
rentRejectVehicleBooking
(
orvd
.
getBookRecordId
());
}
}
}
//取消租车免费天数使用
//取消租车免费天数使用
...
@@ -411,6 +431,7 @@ public class OrderCancelBiz {
...
@@ -411,6 +431,7 @@ public class OrderCancelBiz {
if
(
null
!=
specialRent
)
{
if
(
null
!=
specialRent
)
{
Integer
status
=
SpecialRent
.
STATUS_AUTOCNL_TOPAY
;
Integer
status
=
SpecialRent
.
STATUS_AUTOCNL_TOPAY
;
if
(
SYS_TRUE
.
equals
(
baseOrder
.
getHasPay
()))
{
if
(
SYS_TRUE
.
equals
(
baseOrder
.
getHasPay
()))
{
//
status
=
SpecialRent
.
STATUS_AUTOCNL_PAYED
;
status
=
SpecialRent
.
STATUS_AUTOCNL_PAYED
;
}
}
Integer
finalStatus
=
status
;
Integer
finalStatus
=
status
;
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/rest/SpecialRentController.java
View file @
707879fe
package
com
.
xxfc
.
platform
.
order
.
rest
;
package
com
.
xxfc
.
platform
.
order
.
rest
;
import
cn.hutool.core.collection.CollUtil
;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.util.StrUtil
;
import
cn.hutool.core.util.StrUtil
;
import
cn.hutool.json.JSONUtil
;
import
cn.hutool.json.JSONUtil
;
...
@@ -32,7 +33,7 @@ import org.springframework.web.bind.annotation.*;
...
@@ -32,7 +33,7 @@ import org.springframework.web.bind.annotation.*;
import
static
com
.
github
.
wxiaoqi
.
security
.
common
.
constant
.
CommonConstants
.
SYS_FALSE
;
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
.
github
.
wxiaoqi
.
security
.
common
.
constant
.
CommonConstants
.
SYS_TRUE
;
import
static
com
.
xxfc
.
platform
.
order
.
entity
.
SpecialRent
.
STATUS_CRT
;
import
static
com
.
xxfc
.
platform
.
order
.
entity
.
SpecialRent
.
*
;
@RestController
@RestController
@RequestMapping
(
"/chw/specialRent"
)
@RequestMapping
(
"/chw/specialRent"
)
...
@@ -115,7 +116,7 @@ public class SpecialRentController extends BaseController<SpecialRentBiz, Specia
...
@@ -115,7 +116,7 @@ public class SpecialRentController extends BaseController<SpecialRentBiz, Specia
}
}
Query
query
=
new
Query
(
dto
);
Query
query
=
new
Query
(
dto
);
PageDataVO
<
SpecialRentVO
>
pages
=
PageDataVO
.
pageInfo
(
query
,
()
->
baseBiz
.
selectByWeekend
(
w
->
{
PageDataVO
<
SpecialRentVO
>
pages
=
PageDataVO
.
pageInfo
(
query
,
()
->
baseBiz
.
selectByWeekend
(
w
->
{
w
.
and
EqualTo
(
SpecialRent:
:
getStatus
,
STATUS_CRT
);
w
.
and
In
(
SpecialRent:
:
getStatus
,
CollUtil
.
newArrayList
(
STATUS_CRT
,
STATUS_AUTOCNL_ORDER
,
STATUS_AUTOCNL_TOPAY
,
STATUS_AUTOCNL_PAYED
)
);
return
w
;
return
w
;
},
" crt_time desc "
),
SpecialRentVO
.
class
);
},
" crt_time desc "
),
SpecialRentVO
.
class
);
...
@@ -170,10 +171,10 @@ public class SpecialRentController extends BaseController<SpecialRentBiz, Specia
...
@@ -170,10 +171,10 @@ public class SpecialRentController extends BaseController<SpecialRentBiz, Specia
throw
new
BaseException
(
"该特惠租车已下单"
,
ResultCode
.
PARAM_ILLEGAL_CODE
);
throw
new
BaseException
(
"该特惠租车已下单"
,
ResultCode
.
PARAM_ILLEGAL_CODE
);
}
}
//拒绝原来的预约
//
//拒绝原来的预约
orderRentVehicleService
.
errorRejectVehicle
(
new
RentVehicleBO
(){{
//
orderRentVehicleService.errorRejectVehicle(new RentVehicleBO(){{
setBookRecordId
(
specialRent
.
getBookRecordId
());
//
setBookRecordId(specialRent.getBookRecordId());
}});
//
}});
//正式下单
//正式下单
dto
.
setVehicleId
(
specialRent
.
getVehicleId
());
dto
.
setVehicleId
(
specialRent
.
getVehicleId
());
...
@@ -182,7 +183,7 @@ public class SpecialRentController extends BaseController<SpecialRentBiz, Specia
...
@@ -182,7 +183,7 @@ public class SpecialRentController extends BaseController<SpecialRentBiz, Specia
RentVehicleBO
bo
=
orderRentVehicleBiz
.
initRentVehicleBO
(
dto
);
RentVehicleBO
bo
=
orderRentVehicleBiz
.
initRentVehicleBO
(
dto
);
bo
.
setOrderSign
(
BaseOrder
.
ORDER_SIGN_SPECIAL
);
bo
.
setOrderSign
(
BaseOrder
.
ORDER_SIGN_SPECIAL
);
bo
.
setAppUserDTO
(
getAppUser
());
bo
.
setAppUserDTO
(
getAppUser
());
orderRentVehicleService
.
createOrder
(
bo
);
orderRentVehicleService
.
specialCreateOrder
(
bo
,
specialRent
.
getOrderNo
()
);
baseBiz
.
updateSelectiveById
(
new
SpecialRent
(){{
baseBiz
.
updateSelectiveById
(
new
SpecialRent
(){{
setId
(
specialRent
.
getId
());
setId
(
specialRent
.
getId
());
setStatus
(
SpecialRent
.
STATUS_ORDER
);
setStatus
(
SpecialRent
.
STATUS_ORDER
);
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/service/OrderRentVehicleService.java
View file @
707879fe
...
@@ -110,20 +110,20 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
...
@@ -110,20 +110,20 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
handleDetail
(
detail
);
handleDetail
(
detail
);
}
}
//
/**
/**
//
* 创建订单及其子项(特惠租车)
* 创建订单及其子项(特惠租车)
//
* @param detail
* @param detail
//
*/
*/
//
public void specialCreateOrder(RentVehicleBO detail, String orderNo) {
public
void
specialCreateOrder
(
RentVehicleBO
detail
,
String
orderNo
)
{
//
//初始化
//初始化
// apply
InitDetail(detail, orderNo);
special
InitDetail
(
detail
,
orderNo
);
//
//计算价格
//计算价格
//
handleCalculate(detail);
handleCalculate
(
detail
);
//
//插入baseOrder
//插入baseOrder
//
baseOrderBiz.insertSelective(detail.getOrder());
baseOrderBiz
.
insertSelective
(
detail
.
getOrder
());
//
//处理detail
//处理detail
//
handleDetail(detail);
handleDetail
(
detail
);
//
}
}
public
void
applyInitDetail
(
RentVehicleBO
bo
,
String
orderNo
)
{
public
void
applyInitDetail
(
RentVehicleBO
bo
,
String
orderNo
)
{
BaseOrder
order
=
createBaseOrder
(
bo
.
getOrderOrigin
(),
bo
.
getFacilitatePhone
(),
bo
.
getAppUserDTO
(),
orderNo
);
BaseOrder
order
=
createBaseOrder
(
bo
.
getOrderOrigin
(),
bo
.
getFacilitatePhone
(),
bo
.
getAppUserDTO
(),
orderNo
);
...
@@ -131,6 +131,12 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
...
@@ -131,6 +131,12 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
initDetailSecond
(
bo
);
initDetailSecond
(
bo
);
}
}
public
void
specialInitDetail
(
RentVehicleBO
bo
,
String
orderNo
)
{
BaseOrder
order
=
createBaseOrder
(
bo
.
getOrderOrigin
(),
bo
.
getFacilitatePhone
(),
bo
.
getAppUserDTO
(),
orderNo
);
bo
.
setOrder
(
order
);
initDetailSecond
(
bo
);
}
// public void specialInitDetail(RentVehicleBO bo, String orderNo) {
// public void specialInitDetail(RentVehicleBO bo, String orderNo) {
// BaseOrder order = createBaseOrder(bo.getOrderOrigin(), bo.getFacilitatePhone(), bo.getAppUserDTO(), orderNo);
// BaseOrder order = createBaseOrder(bo.getOrderOrigin(), bo.getFacilitatePhone(), bo.getAppUserDTO(), orderNo);
// bo.setOrder(order);
// bo.setOrder(order);
...
@@ -283,8 +289,8 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
...
@@ -283,8 +289,8 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
}
}
bo
.
setAccompanyItems
(
oads
);
bo
.
setAccompanyItems
(
oads
);
if
(
BaseOrder
.
ORDER_SIGN_
APPLY
!
=
bo
.
getOrderSign
())
{
if
(
BaseOrder
.
ORDER_SIGN_
NORMAL
=
=
bo
.
getOrderSign
())
{
//获取可用车辆
//获取可用车辆
(创建排班记录)
acquireVehicle
(
bo
,
null
,
null
);
acquireVehicle
(
bo
,
null
,
null
);
cloudTransact
=
1
;
cloudTransact
=
1
;
}
}
...
@@ -326,7 +332,7 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
...
@@ -326,7 +332,7 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
//判断分布式事务执行到哪里
//判断分布式事务执行到哪里
switch
(
cloudTransact
)
{
switch
(
cloudTransact
)
{
case
1
:
case
1
:
if
(
!
SYS_TRUE
.
equals
(
bo
.
getOrderSign
()
))
{
if
(
BaseOrder
.
ORDER_SIGN_NORMAL
==
bo
.
getOrderSign
(
))
{
//取消车辆预定
//取消车辆预定
//未支付,拒绝之前的预约
//未支付,拒绝之前的预约
errorRejectVehicle
(
bo
);
errorRejectVehicle
(
bo
);
...
@@ -334,7 +340,7 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
...
@@ -334,7 +340,7 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
break
;
break
;
case
2
:
case
2
:
if
(
!
SYS_TRUE
.
equals
(
bo
.
getOrderSign
()
))
{
if
(
BaseOrder
.
ORDER_SIGN_NORMAL
==
bo
.
getOrderSign
(
))
{
//取消车辆预定
//取消车辆预定
//未支付,拒绝之前的预约
//未支付,拒绝之前的预约
errorRejectVehicle
(
bo
);
errorRejectVehicle
(
bo
);
...
@@ -343,7 +349,7 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
...
@@ -343,7 +349,7 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
break
;
break
;
case
3
:
case
3
:
if
(
!
SYS_TRUE
.
equals
(
bo
.
getOrderSign
()
))
{
if
(
BaseOrder
.
ORDER_SIGN_NORMAL
==
bo
.
getOrderSign
(
))
{
//取消车辆预定
//取消车辆预定
//未支付,拒绝之前的预约
//未支付,拒绝之前的预约
errorRejectVehicle
(
bo
);
errorRejectVehicle
(
bo
);
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/rest/RentVehicleController.java
View file @
707879fe
...
@@ -291,7 +291,7 @@ public class RentVehicleController extends BaseController<VehicleBiz> implements
...
@@ -291,7 +291,7 @@ public class RentVehicleController extends BaseController<VehicleBiz> implements
rbd
.
setRecordIntersection
(
Boolean
.
FALSE
);
rbd
.
setRecordIntersection
(
Boolean
.
FALSE
);
rbd
.
setLimit
(
100
);
rbd
.
setLimit
(
100
);
rbd
.
setPage
(
1
);
rbd
.
setPage
(
1
);
//
rbd.setYearNo4Where(Boolean.TRUE);
rbd
.
setYearNo4Where
(
Boolean
.
TRUE
);
//查询可车辆信息
//查询可车辆信息
PageDataVO
<
UsableVeicleVO
>
pageDataVO
=
vehicleBiz
.
searchUsableVehicle
(
rbd
);
PageDataVO
<
UsableVeicleVO
>
pageDataVO
=
vehicleBiz
.
searchUsableVehicle
(
rbd
);
...
...
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