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
42c4d9e2
Commit
42c4d9e2
authored
Aug 15, 2019
by
周健威
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改bug,修改接口
parent
447e3fcb
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
214 additions
and
103 deletions
+214
-103
UserRestInterface.java
.../wxiaoqi/security/admin/feign/rest/UserRestInterface.java
+6
-0
BaseOrderBiz.java
...c/main/java/com/xxfc/platform/order/biz/BaseOrderBiz.java
+1
-1
OrderCancelBiz.java
...ava/com/xxfc/platform/order/biz/inner/OrderCancelBiz.java
+2
-11
BackStageOrderController.java
...om/xxfc/platform/order/rest/BackStageOrderController.java
+15
-0
VehicleFeign.java
...in/java/com/xxfc/platform/vehicle/feign/VehicleFeign.java
+4
-4
RentVehicleController.java
...com/xxfc/platform/vehicle/rest/RentVehicleController.java
+186
-0
VehicleController.java
...ava/com/xxfc/platform/vehicle/rest/VehicleController.java
+0
-87
No files found.
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/feign/rest/UserRestInterface.java
View file @
42c4d9e2
...
@@ -35,4 +35,10 @@ public interface UserRestInterface {
...
@@ -35,4 +35,10 @@ public interface UserRestInterface {
return
null
;
return
null
;
}
}
}
}
default
void
checkAdminUser
(){
if
(
null
==
getAdminUserInfo
())
{
throw
new
BaseException
(
ResultCode
.
DB_OPERATION_FAIL_CODE
);
}
}
}
}
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/BaseOrderBiz.java
View file @
42c4d9e2
...
@@ -323,7 +323,7 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper, BaseOrder> {
...
@@ -323,7 +323,7 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper, BaseOrder> {
setOrderId
(
baseOrder
.
getId
());
setOrderId
(
baseOrder
.
getId
());
}});
}});
//车辆预定审核通过
//车辆预定审核通过
RestResponse
<
Integer
>
result
=
vehicleFeign
.
p
roveVehicleBooking
(
orvd
.
getBookRecordId
());
RestResponse
<
Integer
>
result
=
vehicleFeign
.
rentP
roveVehicleBooking
(
orvd
.
getBookRecordId
());
//确认免费天数
//确认免费天数
if
(
orvd
.
getFreeDays
()
>
0
)
{
if
(
orvd
.
getFreeDays
()
>
0
)
{
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/inner/OrderCancelBiz.java
View file @
42c4d9e2
package
com
.
xxfc
.
platform
.
order
.
biz
.
inner
;
package
com
.
xxfc
.
platform
.
order
.
biz
.
inner
;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.util.StrUtil
;
import
com.github.wxiaoqi.security.admin.feign.UserFeign
;
import
com.github.wxiaoqi.security.admin.feign.UserFeign
;
import
com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO
;
import
com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO
;
import
com.github.wxiaoqi.security.common.exception.BaseException
;
import
com.github.wxiaoqi.security.common.exception.BaseException
;
import
com.github.wxiaoqi.security.common.util.IntervalUtil
;
import
com.github.wxiaoqi.security.common.util.process.ResultCode
;
import
com.github.wxiaoqi.security.common.util.process.ResultCode
;
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.pojo.mq.OrderMQDTO
;
import
com.xxfc.platform.order.pojo.mq.OrderMQDTO
;
import
com.xxfc.platform.tour.feign.TourFeign
;
import
com.xxfc.platform.tour.feign.TourFeign
;
import
com.xxfc.platform.universal.dto.SmsTemplateDTO
;
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.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.CompanyDetail
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
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
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
...
@@ -28,7 +20,6 @@ import org.springframework.transaction.annotation.Transactional;
...
@@ -28,7 +20,6 @@ import org.springframework.transaction.annotation.Transactional;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
import
java.util.*
;
import
java.util.*
;
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
.
universal
.
constant
.
DictionaryKey
.*;
import
static
com
.
xxfc
.
platform
.
universal
.
constant
.
DictionaryKey
.*;
...
@@ -182,8 +173,8 @@ public class OrderCancelBiz {
...
@@ -182,8 +173,8 @@ public class OrderCancelBiz {
//取消租车预定
//取消租车预定
//已支付,并且是待出行状态,取消预约
//已支付,并且是待出行状态,取消预约
if
(
OrderStatusEnum
.
ORDER_TOSTART
.
equals
(
baseOrder
.
get
Type
())
&&
SYS_TRUE
.
equals
(
baseOrder
.
getHasPay
())){
if
(
OrderStatusEnum
.
ORDER_TOSTART
.
equals
(
baseOrder
.
get
Status
())
&&
SYS_TRUE
.
equals
(
baseOrder
.
getHasPay
())){
vehicleFeign
.
u
nbookVehicle
(
orvd
.
getBookRecordId
());
vehicleFeign
.
rentU
nbookVehicle
(
orvd
.
getBookRecordId
());
}
else
{
}
else
{
//未支付,拒绝之前的预约
//未支付,拒绝之前的预约
RestResponse
<
Integer
>
restResponse
=
vehicleFeign
.
rentRejectVehicleBooking
(
orvd
.
getBookRecordId
());
RestResponse
<
Integer
>
restResponse
=
vehicleFeign
.
rentRejectVehicleBooking
(
orvd
.
getBookRecordId
());
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/rest/BackStageOrderController.java
View file @
42c4d9e2
...
@@ -264,6 +264,21 @@ public class BackStageOrderController extends CommonBaseController implements Us
...
@@ -264,6 +264,21 @@ public class BackStageOrderController extends CommonBaseController implements Us
return
new
ObjectRestResponse
<>().
data
(
page
.
getData
().
get
(
0
));
return
new
ObjectRestResponse
<>().
data
(
page
.
getData
().
get
(
0
));
}
}
@ApiOperation
(
"更換車輛"
)
@RequestMapping
(
value
=
"/bg/change-vehicle"
,
method
=
RequestMethod
.
POST
)
@IgnoreClientToken
@ResponseBody
public
ObjectRestResponse
<
OrderPageVO
>
changeVehicle
(
@RequestBody
ChangeVehicleDTO
dto
)
{
checkAdminUser
();
return
ObjectRestResponse
.
succ
();
}
@Data
public
static
class
ChangeVehicleDTO
{
String
no
;
String
numberPlate
;
}
private
Query
initCompanyQuery
(
String
no
)
{
private
Query
initCompanyQuery
(
String
no
)
{
BackStageOrderController
.
QueryOrderDetailDTO
qodd
=
new
BackStageOrderController
.
QueryOrderDetailDTO
();
BackStageOrderController
.
QueryOrderDetailDTO
qodd
=
new
BackStageOrderController
.
QueryOrderDetailDTO
();
//查询公司id
//查询公司id
...
...
xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/feign/VehicleFeign.java
View file @
42c4d9e2
...
@@ -54,12 +54,12 @@ public interface VehicleFeign {
...
@@ -54,12 +54,12 @@ public interface VehicleFeign {
public
RestResponse
<
Integer
>
rentRejectVehicleBooking
(
@PathVariable
(
value
=
"bookRecordId"
)
Long
bookRecordId
);
public
RestResponse
<
Integer
>
rentRejectVehicleBooking
(
@PathVariable
(
value
=
"bookRecordId"
)
Long
bookRecordId
);
//取消预约
//取消预约
@RequestMapping
(
value
=
"/vehicleInfo/
unbook/4employee
/{bookRecordId}"
,
method
=
RequestMethod
.
DELETE
)
@RequestMapping
(
value
=
"/vehicleInfo/
rent/unbook
/{bookRecordId}"
,
method
=
RequestMethod
.
DELETE
)
public
RestResponse
<
Integer
>
u
nbookVehicle
(
@PathVariable
(
value
=
"bookRecordId"
)
Long
bookRecordId
);
public
RestResponse
<
Integer
>
rentU
nbookVehicle
(
@PathVariable
(
value
=
"bookRecordId"
)
Long
bookRecordId
);
//通过预约
//通过预约
@RequestMapping
(
value
=
"/vehicleInfo/
book/4employee
/prove/{bookRecordId}"
,
method
=
RequestMethod
.
PUT
)
@RequestMapping
(
value
=
"/vehicleInfo/
rent/book
/prove/{bookRecordId}"
,
method
=
RequestMethod
.
PUT
)
public
RestResponse
<
Integer
>
p
roveVehicleBooking
(
@PathVariable
(
value
=
"bookRecordId"
)
Long
bookRecordId
);
public
RestResponse
<
Integer
>
rentP
roveVehicleBooking
(
@PathVariable
(
value
=
"bookRecordId"
)
Long
bookRecordId
);
//获取分公司列表
//获取分公司列表
@GetMapping
(
"/branchCompany/all"
)
@GetMapping
(
"/branchCompany/all"
)
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/rest/RentVehicleController.java
0 → 100644
View file @
42c4d9e2
package
com
.
xxfc
.
platform
.
vehicle
.
rest
;
import
cn.hutool.core.bean.BeanUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONException
;
import
com.github.wxiaoqi.security.admin.feign.UserFeign
;
import
com.github.wxiaoqi.security.admin.feign.dto.UserDTO
;
import
com.github.wxiaoqi.security.admin.feign.rest.UserRestInterface
;
import
com.github.wxiaoqi.security.auth.client.annotation.IgnoreClientToken
;
import
com.github.wxiaoqi.security.auth.client.annotation.IgnoreUserToken
;
import
com.github.wxiaoqi.security.auth.client.config.UserAuthConfig
;
import
com.github.wxiaoqi.security.common.context.BaseContextHandler
;
import
com.github.wxiaoqi.security.common.exception.BaseException
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.util.process.ResultCode
;
import
com.github.wxiaoqi.security.common.vo.PageDataVO
;
import
com.google.common.collect.Lists
;
import
com.google.common.collect.Maps
;
import
com.xxfc.platform.vehicle.biz.*
;
import
com.xxfc.platform.vehicle.common.BaseController
;
import
com.xxfc.platform.vehicle.common.CustomIllegalParamException
;
import
com.xxfc.platform.vehicle.common.RestResponse
;
import
com.xxfc.platform.vehicle.constant.BookType
;
import
com.xxfc.platform.vehicle.constant.ResCode.ResCode
;
import
com.xxfc.platform.vehicle.constant.VehicleBookRecordStatus
;
import
com.xxfc.platform.vehicle.entity.BranchCompany
;
import
com.xxfc.platform.vehicle.entity.Vehicle
;
import
com.xxfc.platform.vehicle.entity.VehicleBookInfo
;
import
com.xxfc.platform.vehicle.entity.VehicleBookRecord
;
import
com.xxfc.platform.vehicle.jobhandler.VehicleJobHandler
;
import
com.xxfc.platform.vehicle.pojo.*
;
import
com.xxfc.platform.vehicle.pojo.dto.VehiclePlanDto
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.joda.time.DateTime
;
import
org.joda.time.format.DateTimeFormat
;
import
org.joda.time.format.DateTimeFormatter
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.multipart.MultipartFile
;
import
java.util.ArrayList
;
import
java.util.HashSet
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
import
static
com
.
xxfc
.
platform
.
vehicle
.
constant
.
VehicleConstant
.
USER_APP
;
import
static
com
.
xxfc
.
platform
.
vehicle
.
constant
.
VehicleConstant
.
USER_APP_NAME
;
@RestController
@RequestMapping
(
"/vehicleInfo"
)
@Slf4j
@IgnoreClientToken
@Api
(
value
=
"租车相关车辆管理controller"
,
tags
={
"租车相关车辆管理接口"
})
public
class
RentVehicleController
extends
BaseController
<
VehicleBiz
>
implements
UserRestInterface
{
@Autowired
private
VehiclePlatCataBiz
vehiclePlatCataBiz
;
@Autowired
UserFeign
userFeign
;
@Autowired
VehicleBiz
vehicleBiz
;
public
UserFeign
getUserFeign
()
{
return
userFeign
;
}
/**
* 租车拒绝预定车辆申请
*
* @param bookRecordId
* @return
*/
@RequestMapping
(
value
=
"/rent/book/reject/{bookRecordId}"
,
method
=
RequestMethod
.
PUT
)
@ApiOperation
(
value
=
"租车拒绝预定车辆"
)
@IgnoreUserToken
public
RestResponse
<
Integer
>
rentRejectVehicleBooking
(
@PathVariable
Long
bookRecordId
)
throws
Exception
{
//默认USER_APP 预约
Integer
operatorId
=
USER_APP
;
String
userName
=
USER_APP_NAME
;
return
baseBiz
.
reviewVehicleBooking
(
operatorId
,
bookRecordId
,
VehicleBookRecordStatus
.
REJECTED
.
getCode
(),
userName
);
}
/**
* 取消车辆预订
*
* @param bookRecordId
* @return
*/
@RequestMapping
(
value
=
"/rent/unbook/{bookRecordId}"
,
method
=
RequestMethod
.
DELETE
)
@ApiOperation
(
value
=
"取消预定车辆"
)
public
RestResponse
<
Integer
>
rentUnbookVehicle
(
@PathVariable
Long
bookRecordId
)
throws
Exception
{
//默认USER_APP 预约
Integer
operatorId
=
USER_APP
;
String
userName
=
USER_APP_NAME
;
return
baseBiz
.
unbookVehicle4Employee
(
operatorId
,
bookRecordId
,
userName
);
}
/**
* 批准预定车辆预定
*
* @param bookRecordId
* @return
*/
@RequestMapping
(
value
=
"/rent/book/prove/{bookRecordId}"
,
method
=
RequestMethod
.
PUT
)
@ApiOperation
(
value
=
"预定车辆审核通过"
)
public
RestResponse
<
Integer
>
rentProveVehicleBooking
(
@PathVariable
Long
bookRecordId
)
throws
Exception
{
//默认USER_APP 预约
Integer
operatorId
=
USER_APP
;
String
userName
=
USER_APP_NAME
;
return
baseBiz
.
reviewVehicleBooking
(
operatorId
,
bookRecordId
,
VehicleBookRecordStatus
.
APPROVE
.
getCode
(),
userName
);
}
/**
* 可用车辆查询
*
* @param dto
* @return
*/
@ApiOperation
(
"可用车辆查询"
)
@RequestMapping
(
value
=
"/rent/usable-vehicle"
,
method
=
RequestMethod
.
GET
)
@IgnoreUserToken
public
ObjectRestResponse
<
PageDataVO
<
UsableVehicleModelVO
>>
rentUsableVehicle
(
UsableVeicleDTO
dto
)
throws
Exception
{
//根据时间 获得 可用车辆
//结合车型
if
(
StringUtils
.
isNotBlank
(
dto
.
getCatasStr
()))
{
dto
.
setCatas
(
vehiclePlatCataBiz
.
groupCatasByParent
(
dto
.
getCatasStr
()));
}
//设置显示是否有车
dto
.
setYearNo4Where
(
Boolean
.
TRUE
);
return
ObjectRestResponse
.
succ
(
vehicleBiz
.
searchUsableModel
(
dto
));
}
/**
* 热门车型
*
* @param dto
* @return
*/
@ApiOperation
(
"热门车型"
)
@RequestMapping
(
value
=
"/rent/hot-vehicle"
,
method
=
RequestMethod
.
GET
)
@IgnoreUserToken
public
ObjectRestResponse
<
PageDataVO
<
UsableVehicleModelVO
>>
hotVehicle
(
HotVeicleDTO
dto
)
throws
Exception
{
return
ObjectRestResponse
.
succ
(
vehicleBiz
.
hotModel
(
dto
));
}
/**
* 租车触发的申请预定车辆
*
* @param dto
* @return
*/
@ApiOperation
(
"租车触发的申请预定车辆"
)
@RequestMapping
(
value
=
"/rent/book/vehicle"
,
method
=
RequestMethod
.
POST
)
@IgnoreClientToken
@IgnoreUserToken
public
ObjectRestResponse
<
VehicleBookRecord
>
rentApplyVehicle
(
@RequestBody
RentVehicleBookDTO
dto
)
throws
Exception
{
//默认USER_APP 预约
Integer
operatorId
=
USER_APP
;
String
userName
=
dto
.
getUserName
();
//BaseContextHandler.getName();
dto
.
setLimit
(
1
);
dto
.
setPage
(
1
);
//查询可车辆信息
PageDataVO
<
Vehicle
>
pageDataVO
=
vehicleBiz
.
searchUsableVehicle
(
dto
);
if
(
pageDataVO
.
getData
().
size
()
<=
0
)
{
throw
new
BaseException
(
ResultCode
.
NOTEXIST_CODE
,
new
HashSet
<
String
>(){{
add
(
"可用车辆不存在"
);
}});
}
dto
.
setBookStartDate
(
dto
.
getBookStartDate
()+
" 00:00:00"
);
dto
.
setBookEndDate
(
dto
.
getBookEndDate
()+
" 23:59:59"
);
BookVehicleVO
bookVehicleVo
=
BeanUtil
.
toBean
(
dto
,
BookVehicleVO
.
class
);
bookVehicleVo
.
setBookType
(
BookType
.
USER_RENT
.
getCode
());
bookVehicleVo
.
setVehicleId
(
pageDataVO
.
getData
().
get
(
0
).
getId
());
bookVehicleVo
.
setStatus
(
VehicleBookRecordStatus
.
APPLY
.
getCode
());
VehicleBookRecord
vehicleBookRecord
=
baseBiz
.
applyVehicle
(
operatorId
,
bookVehicleVo
,
userName
);
return
ObjectRestResponse
.
succ
(
vehicleBookRecord
);
}
}
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/rest/VehicleController.java
View file @
42c4d9e2
...
@@ -267,23 +267,6 @@ public class VehicleController extends BaseController<VehicleBiz> implements Use
...
@@ -267,23 +267,6 @@ public class VehicleController extends BaseController<VehicleBiz> implements Use
return
baseBiz
.
reviewVehicleBooking
(
operatorId
,
bookRecordId
,
VehicleBookRecordStatus
.
REJECTED
.
getCode
(),
userName
);
return
baseBiz
.
reviewVehicleBooking
(
operatorId
,
bookRecordId
,
VehicleBookRecordStatus
.
REJECTED
.
getCode
(),
userName
);
}
}
/**
* 租车拒绝预定车辆申请
*
* @param bookRecordId
* @return
*/
@RequestMapping
(
value
=
"/rent/book/reject/{bookRecordId}"
,
method
=
RequestMethod
.
PUT
)
@ApiOperation
(
value
=
"租车拒绝预定车辆"
)
@IgnoreUserToken
public
RestResponse
<
Integer
>
rentRejectVehicleBooking
(
@PathVariable
Long
bookRecordId
)
throws
Exception
{
//默认USER_APP 预约
Integer
operatorId
=
USER_APP
;
String
userName
=
USER_APP_NAME
;
return
baseBiz
.
reviewVehicleBooking
(
operatorId
,
bookRecordId
,
VehicleBookRecordStatus
.
REJECTED
.
getCode
(),
userName
);
}
// /**
// /**
// * 车辆归还
// * 车辆归还
// * @param bookRecordId
// * @param bookRecordId
...
@@ -377,82 +360,12 @@ public class VehicleController extends BaseController<VehicleBiz> implements Use
...
@@ -377,82 +360,12 @@ public class VehicleController extends BaseController<VehicleBiz> implements Use
return
vehicleBookRecordBiz
.
retVehicle
(
operatorId
,
userName
,
retVehicleVo
);
return
vehicleBookRecordBiz
.
retVehicle
(
operatorId
,
userName
,
retVehicleVo
);
}
}
/**
* 可用车辆查询
*
* @param dto
* @return
*/
@ApiOperation
(
"可用车辆查询"
)
@RequestMapping
(
value
=
"/rent/usable-vehicle"
,
method
=
RequestMethod
.
GET
)
@IgnoreUserToken
public
ObjectRestResponse
<
PageDataVO
<
UsableVehicleModelVO
>>
rentUsableVehicle
(
UsableVeicleDTO
dto
)
throws
Exception
{
//根据时间 获得 可用车辆
//结合车型
if
(
StringUtils
.
isNotBlank
(
dto
.
getCatasStr
()))
{
dto
.
setCatas
(
vehiclePlatCataBiz
.
groupCatasByParent
(
dto
.
getCatasStr
()));
}
//设置显示是否有车
dto
.
setYearNo4Where
(
Boolean
.
TRUE
);
return
ObjectRestResponse
.
succ
(
vehicleBiz
.
searchUsableModel
(
dto
));
}
@ApiOperation
(
"根据权限获取所有车辆"
)
@ApiOperation
(
"根据权限获取所有车辆"
)
@GetMapping
(
value
=
"/info/getVehicle"
)
@GetMapping
(
value
=
"/info/getVehicle"
)
public
ObjectRestResponse
<
PageDataVO
<
VehicleAndModelInfoVo
>>
getVehicle
(
VehiclePlanDto
vehiclePlanDto
)
{
public
ObjectRestResponse
<
PageDataVO
<
VehicleAndModelInfoVo
>>
getVehicle
(
VehiclePlanDto
vehiclePlanDto
)
{
return
vehicleBiz
.
getVehicle
(
vehiclePlanDto
);
return
vehicleBiz
.
getVehicle
(
vehiclePlanDto
);
}
}
/**
* 热门车型
*
* @param dto
* @return
*/
@ApiOperation
(
"热门车型"
)
@RequestMapping
(
value
=
"/rent/hot-vehicle"
,
method
=
RequestMethod
.
GET
)
@IgnoreUserToken
public
ObjectRestResponse
<
PageDataVO
<
UsableVehicleModelVO
>>
hotVehicle
(
HotVeicleDTO
dto
)
throws
Exception
{
return
ObjectRestResponse
.
succ
(
vehicleBiz
.
hotModel
(
dto
));
}
/**
* 租车触发的申请预定车辆
*
* @param dto
* @return
*/
@ApiOperation
(
"租车触发的申请预定车辆"
)
@RequestMapping
(
value
=
"/rent/book/vehicle"
,
method
=
RequestMethod
.
POST
)
@IgnoreClientToken
@IgnoreUserToken
public
ObjectRestResponse
<
VehicleBookRecord
>
rentApplyVehicle
(
@RequestBody
RentVehicleBookDTO
dto
)
throws
Exception
{
//默认USER_APP 预约
Integer
operatorId
=
USER_APP
;
String
userName
=
dto
.
getUserName
();
//BaseContextHandler.getName();
dto
.
setLimit
(
1
);
dto
.
setPage
(
1
);
//查询可车辆信息
PageDataVO
<
Vehicle
>
pageDataVO
=
vehicleBiz
.
searchUsableVehicle
(
dto
);
if
(
pageDataVO
.
getData
().
size
()
<=
0
)
{
throw
new
BaseException
(
ResultCode
.
NOTEXIST_CODE
,
new
HashSet
<
String
>(){{
add
(
"可用车辆不存在"
);
}});
}
dto
.
setBookStartDate
(
dto
.
getBookStartDate
()+
" 00:00:00"
);
dto
.
setBookEndDate
(
dto
.
getBookEndDate
()+
" 23:59:59"
);
BookVehicleVO
bookVehicleVo
=
BeanUtil
.
toBean
(
dto
,
BookVehicleVO
.
class
);
bookVehicleVo
.
setBookType
(
BookType
.
USER_RENT
.
getCode
());
bookVehicleVo
.
setVehicleId
(
pageDataVO
.
getData
().
get
(
0
).
getId
());
bookVehicleVo
.
setStatus
(
VehicleBookRecordStatus
.
APPLY
.
getCode
());
VehicleBookRecord
vehicleBookRecord
=
baseBiz
.
applyVehicle
(
operatorId
,
bookVehicleVo
,
userName
);
return
ObjectRestResponse
.
succ
(
vehicleBookRecord
);
}
@RequestMapping
(
value
=
"/app/unauth/getVehiclePlanList"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/app/unauth/getVehiclePlanList"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
value
=
"获取排车信息"
)
@ApiOperation
(
value
=
"获取排车信息"
)
@IgnoreClientToken
@IgnoreClientToken
...
...
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