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
f183208d
Commit
f183208d
authored
Nov 03, 2020
by
周健威
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加特惠租车定时
parent
39b9c460
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
87 additions
and
37 deletions
+87
-37
BaseOrder.java
...c/main/java/com/xxfc/platform/order/entity/BaseOrder.java
+6
-0
RentVehicleBO.java
...ava/com/xxfc/platform/order/pojo/order/RentVehicleBO.java
+9
-6
BaseOrderBiz.java
...c/main/java/com/xxfc/platform/order/biz/BaseOrderBiz.java
+29
-9
OrderCancelBiz.java
...ava/com/xxfc/platform/order/biz/inner/OrderCancelBiz.java
+38
-13
ShuntApplyController.java
...va/com/xxfc/platform/order/rest/ShuntApplyController.java
+1
-3
OrderRentVehicleService.java
.../xxfc/platform/order/service/OrderRentVehicleService.java
+4
-6
No files found.
xx-order/xx-order-api/src/main/java/com/xxfc/platform/order/entity/BaseOrder.java
View file @
f183208d
...
...
@@ -24,6 +24,9 @@ import java.util.Date;
@Table
(
name
=
"base_order"
)
public
class
BaseOrder
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
public
static
final
int
ORDER_SIGN_NORMAL
=
1
;
public
static
final
int
ORDER_SIGN_APPLY
=
2
;
public
static
final
int
ORDER_SIGN_SPECIAL
=
3
;
/**
* 主键
...
...
@@ -355,4 +358,7 @@ public class BaseOrder implements Serializable {
@Column
(
name
=
"realname"
)
private
String
realname
;
@Column
(
name
=
"order_sign"
)
private
Integer
orderSign
;
}
xx-order/xx-order-api/src/main/java/com/xxfc/platform/order/pojo/order/RentVehicleBO.java
View file @
f183208d
...
...
@@ -25,14 +25,17 @@ public class RentVehicleBO extends OrderRentVehicleDetail implements OrderDetail
private
Vehicle
vehicle
;
/**
*
是否调车申请下
订单
*
订单标记 1--普通订单;2--需求预定申请订单;3--特惠租车
订单
*/
private
Integer
applyO
rderSign
=
0
;
private
Integer
o
rderSign
=
0
;
/**
* 是否特惠租车下订单
*/
private
Integer
specialOrderSign
=
0
;
public
Integer
getOrderSign
()
{
return
orderSign
;
}
public
void
setOrderSign
(
Integer
orderSign
)
{
this
.
orderSign
=
orderSign
;
}
/**
* 是否使用出租免费天数
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/BaseOrderBiz.java
View file @
f183208d
...
...
@@ -150,6 +150,9 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper, BaseOrder> implements
@Autowired
ShuntApplyBiz
shuntApplyBiz
;
@Autowired
SpecialRentBiz
specialRentBiz
;
public
static
final
DateTimeFormatter
DEFAULT_DATE_TIME_FORMATTER
=
DateTimeFormat
.
forPattern
(
"yyyy-MM-dd HH:mm:ss"
);
...
...
@@ -802,17 +805,34 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper, BaseOrder> implements
//记录订单账款记录
Integer
flag
=
orderAccountBiz
.
addOrderAccount
(
baseOrder
.
getId
(),
"订单支付"
,
oad
.
getOriginOrderAmount
().
add
(
oad
.
getOriginDepositAmount
()),
oad
.
getOrderAmount
().
add
(
oad
.
getDepositAmount
()),
tradeNo
,
AccountTypeEnum
.
IN_ORDER_PAY
.
getCode
(),
JSONUtil
.
toJsonStr
(
oad
));
//更新 申请状态
ShuntApply
shuntApply
=
shuntApplyBiz
.
selectOne
(
new
ShuntApply
(){{
setOrderNo
(
baseOrder
.
getNo
());
}});
if
(
BaseOrder
.
ORDER_SIGN_APPLY
==
baseOrder
.
getOrderOrigin
())
{
//更新 申请状态
ShuntApply
shuntApply
=
shuntApplyBiz
.
selectOne
(
new
ShuntApply
(){{
setOrderNo
(
baseOrder
.
getNo
());
}});
if
(
null
!=
shuntApply
&&
shuntApply
.
getStatus
()
==
ShuntApply
.
STATUS_ORDER
)
{
shuntApplyBiz
.
updateSelectiveById
(
new
ShuntApply
(){{
setId
(
shuntApply
.
getId
());
setStatus
(
ShuntApply
.
STATUS_SUCC
);
setOrderStatus
(
ShuntApply
.
ORDER_STATUS_PAY
);
if
(
null
!=
shuntApply
&&
shuntApply
.
getStatus
()
==
ShuntApply
.
STATUS_ORDER
)
{
shuntApplyBiz
.
updateSelectiveById
(
new
ShuntApply
(){{
setId
(
shuntApply
.
getId
());
setStatus
(
ShuntApply
.
STATUS_SUCC
);
setOrderStatus
(
ShuntApply
.
ORDER_STATUS_PAY
);
}});
}
}
if
(
BaseOrder
.
ORDER_SIGN_SPECIAL
==
baseOrder
.
getOrderOrigin
())
{
//更新 申请状态
SpecialRent
specialRent
=
specialRentBiz
.
selectOne
(
new
SpecialRent
(){{
setOrderNo
(
baseOrder
.
getNo
());
}});
if
(
null
!=
specialRent
&&
specialRent
.
getStatus
()
==
SpecialRent
.
STATUS_ORDER
)
{
specialRentBiz
.
updateSelectiveById
(
new
SpecialRent
(){{
setId
(
specialRent
.
getId
());
setStatus
(
SpecialRent
.
STATUS_SUCC
);
setOrderStatus
(
SpecialRent
.
ORDER_STATUS_PAY
);
}});
}
}
}
finally
{
AppUserDTO
appUserDTO
=
userFeign
.
userDetailById
(
baseOrder
.
getUserId
()).
getData
();
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/inner/OrderCancelBiz.java
View file @
f183208d
...
...
@@ -87,6 +87,9 @@ public class OrderCancelBiz {
@Autowired
ShuntApplyBiz
shuntApplyBiz
;
@Autowired
SpecialRentBiz
specialRentBiz
;
@Autowired
UserFeign
userFeign
;
...
...
@@ -379,22 +382,44 @@ public class OrderCancelBiz {
orderRentVehicleBiz
.
updateSelectiveById
(
orvd
);
}
//更新 申请状态
ShuntApply
shuntApply
=
shuntApplyBiz
.
selectOne
(
new
ShuntApply
(){{
setOrderNo
(
baseOrder
.
getNo
());
}});
if
(
BaseOrder
.
ORDER_SIGN_APPLY
==
baseOrder
.
getOrderOrigin
())
{
//更新 申请状态
ShuntApply
shuntApply
=
shuntApplyBiz
.
selectOne
(
new
ShuntApply
(){{
setOrderNo
(
baseOrder
.
getNo
());
}});
if
(
null
!=
shuntApply
)
{
Integer
status
=
ShuntApply
.
STATUS_AUTOCNL_TOPAY
;
if
(
SYS_TRUE
.
equals
(
baseOrder
.
getHasPay
()))
{
status
=
ShuntApply
.
STATUS_AUTOCNL_PAYED
;
if
(
null
!=
shuntApply
)
{
Integer
status
=
ShuntApply
.
STATUS_AUTOCNL_TOPAY
;
if
(
SYS_TRUE
.
equals
(
baseOrder
.
getHasPay
()))
{
status
=
ShuntApply
.
STATUS_AUTOCNL_PAYED
;
}
Integer
finalStatus
=
status
;
shuntApplyBiz
.
updateSelectiveById
(
new
ShuntApply
(){{
setId
(
shuntApply
.
getId
());
setStatus
(
finalStatus
);
setOrderStatus
(
ShuntApply
.
ORDER_STATUS_CANCEL
);
}});
}
Integer
finalStatus
=
status
;
shuntApplyBiz
.
updateSelectiveById
(
new
ShuntApply
(){{
setId
(
shuntApply
.
getId
());
setStatus
(
finalStatus
);
setOrderStatus
(
ShuntApply
.
ORDER_STATUS_CANCEL
);
}
if
(
BaseOrder
.
ORDER_SIGN_SPECIAL
==
baseOrder
.
getOrderOrigin
())
{
//更新 申请状态
SpecialRent
specialRent
=
specialRentBiz
.
selectOne
(
new
SpecialRent
(){{
setOrderNo
(
baseOrder
.
getNo
());
}});
if
(
null
!=
specialRent
)
{
Integer
status
=
SpecialRent
.
STATUS_AUTOCNL_TOPAY
;
if
(
SYS_TRUE
.
equals
(
baseOrder
.
getHasPay
()))
{
status
=
SpecialRent
.
STATUS_AUTOCNL_PAYED
;
}
Integer
finalStatus
=
status
;
specialRentBiz
.
updateSelectiveById
(
new
SpecialRent
(){{
setId
(
specialRent
.
getId
());
setStatus
(
finalStatus
);
setOrderStatus
(
SpecialRent
.
ORDER_STATUS_CANCEL
);
}});
}
}
}
else
if
(
OrderTypeEnum
.
TOUR
.
getCode
().
equals
(
baseOrder
.
getType
()))
{
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/rest/ShuntApplyController.java
View file @
f183208d
...
...
@@ -30,10 +30,8 @@ import com.xxfc.platform.order.pojo.order.OrderPageVO;
import
com.xxfc.platform.order.pojo.order.RentVehicleBO
;
import
com.xxfc.platform.order.pojo.order.add.AddRentVehicleDTO
;
import
com.xxfc.platform.order.service.OrderRentVehicleService
;
import
com.xxfc.platform.vehicle.entity.Vehicle
;
import
com.xxfc.platform.vehicle.entity.VehicleBrand
;
import
com.xxfc.platform.vehicle.entity.VehicleCategory
;
import
com.xxfc.platform.vehicle.entity.VehicleModel
;
import
com.xxfc.platform.vehicle.feign.VehicleFeign
;
import
com.xxfc.platform.vehicle.pojo.BookVehicleVO
;
import
com.xxfc.platform.vehicle.pojo.RentVehicleBookDTO
;
...
...
@@ -218,7 +216,7 @@ public class ShuntApplyController extends BaseController<ShuntApplyBiz, ShuntApp
dto
.
setStartCompanyId
(
shuntApply
.
getStartCompanyId
());
dto
.
setEndCompanyId
(
shuntApply
.
getEndCompanyId
());
RentVehicleBO
bo
=
orderRentVehicleBiz
.
initRentVehicleBO
(
dto
);
bo
.
set
ApplyOrderSign
(
SYS_TRUE
);
bo
.
set
OrderSign
(
BaseOrder
.
ORDER_SIGN_APPLY
);
bo
.
setAppUserDTO
(
userFeign
.
userDetailByToken
(
BaseContextHandler
.
getToken
()).
getData
());
orderRentVehicleService
.
applyCreateOrder
(
bo
,
shuntApply
.
getOrderNo
());
baseBiz
.
updateSelectiveById
(
new
ShuntApply
(){{
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/service/OrderRentVehicleService.java
View file @
f183208d
...
...
@@ -4,7 +4,6 @@ import cn.hutool.core.bean.BeanUtil;
import
cn.hutool.core.collection.CollUtil
;
import
cn.hutool.core.convert.Convert
;
import
cn.hutool.core.lang.Dict
;
import
cn.hutool.core.util.NumberUtil
;
import
cn.hutool.core.util.StrUtil
;
import
cn.hutool.json.JSONObject
;
import
cn.hutool.json.JSONUtil
;
...
...
@@ -55,7 +54,6 @@ import java.util.List;
import
java.util.Map
;
import
java.util.stream.Collectors
;
import
static
com
.
github
.
wxiaoqi
.
security
.
admin
.
constant
.
enumerate
.
MemberEnum
.
NONE
;
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
.
order
.
contant
.
enumerate
.
ItemTypeEnum
.
ACCOMPANY
;
...
...
@@ -285,7 +283,7 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
}
bo
.
setAccompanyItems
(
oads
);
if
(
!
SYS_TRUE
.
equals
(
bo
.
getApplyOrderSign
()
))
{
if
(
BaseOrder
.
ORDER_SIGN_APPLY
!=
bo
.
getOrderSign
(
))
{
//获取可用车辆
acquireVehicle
(
bo
,
null
,
null
);
cloudTransact
=
1
;
...
...
@@ -328,7 +326,7 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
//判断分布式事务执行到哪里
switch
(
cloudTransact
)
{
case
1
:
if
(!
SYS_TRUE
.
equals
(
bo
.
get
Apply
OrderSign
()))
{
if
(!
SYS_TRUE
.
equals
(
bo
.
getOrderSign
()))
{
//取消车辆预定
//未支付,拒绝之前的预约
errorRejectVehicle
(
bo
);
...
...
@@ -336,7 +334,7 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
break
;
case
2
:
if
(!
SYS_TRUE
.
equals
(
bo
.
get
Apply
OrderSign
()))
{
if
(!
SYS_TRUE
.
equals
(
bo
.
getOrderSign
()))
{
//取消车辆预定
//未支付,拒绝之前的预约
errorRejectVehicle
(
bo
);
...
...
@@ -345,7 +343,7 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
break
;
case
3
:
if
(!
SYS_TRUE
.
equals
(
bo
.
get
Apply
OrderSign
()))
{
if
(!
SYS_TRUE
.
equals
(
bo
.
getOrderSign
()))
{
//取消车辆预定
//未支付,拒绝之前的预约
errorRejectVehicle
(
bo
);
...
...
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