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
37e63ed8
Commit
37e63ed8
authored
Oct 13, 2020
by
hezhen
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev-chw' of
http://113.105.137.151:22280/youjj/cloud-platform
into dev-chw
parents
54e8ab85
8826c862
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
114 additions
and
9 deletions
+114
-9
RentVehicleBookDTO.java
...va/com/xxfc/platform/vehicle/pojo/RentVehicleBookDTO.java
+16
-0
UsableVeicleDTO.java
.../java/com/xxfc/platform/vehicle/pojo/UsableVeicleDTO.java
+3
-0
UsableVeicleVO.java
...ava/com/xxfc/platform/vehicle/pojo/vo/UsableVeicleVO.java
+6
-0
RentVehicleController.java
...com/xxfc/platform/vehicle/rest/RentVehicleController.java
+61
-0
VehicleMapper.xml
...ehicle-server/src/main/resources/mapper/VehicleMapper.xml
+28
-9
No files found.
xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/pojo/RentVehicleBookDTO.java
View file @
37e63ed8
package
com
.
xxfc
.
platform
.
vehicle
.
pojo
;
package
com
.
xxfc
.
platform
.
vehicle
.
pojo
;
import
com.github.wxiaoqi.security.common.vo.PageParam
;
import
com.github.wxiaoqi.security.common.vo.PageParam
;
import
com.xxfc.platform.vehicle.entity.VehiclePlatCata
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.Data
;
import
java.time.LocalDate
;
import
java.time.LocalDate
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
static
com
.
github
.
wxiaoqi
.
security
.
common
.
constant
.
CommonConstants
.
YMR_SLASH_FORMATTER
;
import
static
com
.
github
.
wxiaoqi
.
security
.
common
.
constant
.
CommonConstants
.
YMR_SLASH_FORMATTER
;
...
@@ -130,6 +132,20 @@ public class RentVehicleBookDTO extends PageParam {
...
@@ -130,6 +132,20 @@ public class RentVehicleBookDTO extends PageParam {
@ApiModelProperty
(
hidden
=
true
)
@ApiModelProperty
(
hidden
=
true
)
Boolean
recordIntersection
;
Boolean
recordIntersection
;
@ApiModelProperty
(
"城市"
)
Integer
addrCity
;
@ApiModelProperty
(
"经度"
)
Double
lon
;
@ApiModelProperty
(
"纬度"
)
Double
lat
;
@ApiModelProperty
(
"商品类型 1--房车;2--机车;3--游艇"
)
Integer
goodsType
;
@ApiModelProperty
(
"分类逗号分割"
)
String
catasStr
;
@ApiModelProperty
(
value
=
"分类列表"
,
hidden
=
true
)
Map
<
Integer
,
List
<
VehiclePlatCata
>>
catas
;
public
void
setBookStartDate
(
String
bookStartDate
)
{
public
void
setBookStartDate
(
String
bookStartDate
)
{
this
.
bookStartDate
=
bookStartDate
;
this
.
bookStartDate
=
bookStartDate
;
//首次设置
//首次设置
...
...
xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/pojo/UsableVeicleDTO.java
View file @
37e63ed8
...
@@ -80,6 +80,9 @@ public class UsableVeicleDTO extends PageParam {
...
@@ -80,6 +80,9 @@ public class UsableVeicleDTO extends PageParam {
*/
*/
String
priceEndDate
;
String
priceEndDate
;
@ApiModelProperty
(
"商品类型 1--房车;2--机车;3--游艇"
)
Integer
goodsType
;
// @ApiModelProperty(hidden = true)
// @ApiModelProperty(hidden = true)
// Integer withoutRecordWhere = 1;
// Integer withoutRecordWhere = 1;
...
...
xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/pojo/vo/UsableVeicleVO.java
View file @
37e63ed8
...
@@ -2,9 +2,11 @@ package com.xxfc.platform.vehicle.pojo.vo;
...
@@ -2,9 +2,11 @@ package com.xxfc.platform.vehicle.pojo.vo;
import
com.xxfc.platform.vehicle.entity.Vehicle
;
import
com.xxfc.platform.vehicle.entity.Vehicle
;
import
com.xxfc.platform.vehicle.pojo.dto.VehicleModelCalendarPriceDTO
;
import
com.xxfc.platform.vehicle.pojo.dto.VehicleModelCalendarPriceDTO
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.Data
;
import
javax.persistence.Column
;
import
javax.persistence.Column
;
import
java.math.BigDecimal
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
...
@@ -23,4 +25,8 @@ public class UsableVeicleVO extends Vehicle {
...
@@ -23,4 +25,8 @@ public class UsableVeicleVO extends Vehicle {
private
Integer
allowRent
;
private
Integer
allowRent
;
private
List
<
VehicleModelCalendarPriceDTO
>
priceDTOS
;
private
List
<
VehicleModelCalendarPriceDTO
>
priceDTOS
;
@ApiModelProperty
(
value
=
"公里数"
)
BigDecimal
distance
;
}
}
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/rest/RentVehicleController.java
View file @
37e63ed8
...
@@ -195,6 +195,67 @@ public class RentVehicleController extends BaseController<VehicleBiz> implements
...
@@ -195,6 +195,67 @@ public class RentVehicleController extends BaseController<VehicleBiz> implements
return
ObjectRestResponse
.
succ
(
uvmvpdvs
);
return
ObjectRestResponse
.
succ
(
uvmvpdvs
);
}
}
/**
* 可用车辆查询
*
* @param dto
* @return
*/
@ApiOperation
(
"可用车辆查询"
)
@RequestMapping
(
value
=
"/rent/usable-vehicle/v2"
,
method
=
RequestMethod
.
GET
)
@IgnoreUserToken
public
ObjectRestResponse
<
PageDataVO
<
UsableVeicleVO
>>
rentUsableVehicleV2
(
UsableVeicleDTO
dto
)
throws
Exception
{
//根据时间 获得 可用车辆
//结合车型
if
(
StringUtils
.
isNotBlank
(
dto
.
getCatasStr
()))
{
dto
.
setCatas
(
vehiclePlatCataBiz
.
groupCatasByParent
(
dto
.
getCatasStr
()));
}
RentVehicleBookDTO
rbd
=
new
RentVehicleBookDTO
();
rbd
.
setLimit
(
dto
.
getLimit
());
rbd
.
setPage
(
dto
.
getPage
());
rbd
.
setLon
(
dto
.
getLon
());
rbd
.
setLat
(
dto
.
getLat
());
rbd
.
setAddrCity
(
dto
.
getAddrCity
());
rbd
.
setParkBranchCompanyId
(
dto
.
getStartCompanyId
());
rbd
.
setStartCompanyId
(
dto
.
getStartCompanyId
());
rbd
.
setEndCompanyId
(
dto
.
getEndCompanyId
());
rbd
.
setBookStartDate
(
dto
.
getStartDate
());
rbd
.
setBookEndDate
(
dto
.
getEndDate
());
rbd
.
setBookStartDateTime
(
dto
.
getStartDateTime
());
rbd
.
setBookEndDateTime
(
dto
.
getEndDateTime
());
rbd
.
setCatas
(
dto
.
getCatas
());
rbd
.
setGoodsType
(
dto
.
getGoodsType
());
rbd
.
setRecordIntersection
(
Boolean
.
TRUE
);
rbd
.
setYearNo4Where
(
Boolean
.
TRUE
);
//查询可车辆信息
PageDataVO
<
UsableVeicleVO
>
pageDataVO
=
vehicleBiz
.
searchUsableVehicle
(
rbd
);
if
(
CollUtil
.
isNotEmpty
(
pageDataVO
.
getData
()))
{
for
(
UsableVeicleVO
usableVeicleVO
:
pageDataVO
.
getData
())
{
//判断是否预定时间内可租
usableVeicleVO
.
setAllowRent
(
SYS_TRUE
);
//如果"必须在这时间后预定" 存在 并且 比预定开始时间 要晚,那么不允许预定
if
(
null
!=
usableVeicleVO
.
getToLiftMustAfterDate
()
&&
DateUtil
.
date
(
dto
.
getStartDateTamp
()).
isBeforeOrEquals
(
usableVeicleVO
.
getToLiftMustAfterDate
()))
{
usableVeicleVO
.
setAllowRent
(
SYS_FALSE
);
}
//如果"必须在这时间前预定" 存在 并且 比预定结束时间 要早,那么不允许预定
if
(
null
!=
usableVeicleVO
.
getToReturnMustBeforeDate
()
&&
DateUtil
.
date
(
dto
.
getEndDateTamp
()).
isAfterOrEquals
(
usableVeicleVO
.
getToReturnMustBeforeDate
()))
{
usableVeicleVO
.
setAllowRent
(
SYS_FALSE
);
}
String
priceStartDateStr
=
StrUtil
.
isNotBlank
(
dto
.
getPriceStartDate
())?
dto
.
getPriceStartDate
():
dto
.
getStartDate
();
String
priceEndDateStr
=
StrUtil
.
isNotBlank
(
dto
.
getPriceEndDate
())?
dto
.
getPriceEndDate
():
dto
.
getEndDate
();
usableVeicleVO
.
setPriceDTOS
(
vehicleHolidayPriceInfoBiz
.
getSynthesizePrice
(
usableVeicleVO
.
getId
(),
priceStartDateStr
,
priceEndDateStr
,
null
,
usableVeicleVO
.
getSubordinateBranch
()));
}
}
return
ObjectRestResponse
.
succ
(
pageDataVO
);
}
/**
/**
* 后台查询可用车辆(车型)
* 后台查询可用车辆(车型)
*
*
...
...
xx-vehicle/xx-vehicle-server/src/main/resources/mapper/VehicleMapper.xml
View file @
37e63ed8
...
@@ -1025,13 +1025,15 @@
...
@@ -1025,13 +1025,15 @@
,GROUP_CONCAT(vc.cata_id) as catas
,GROUP_CONCAT(vc.cata_id) as catas
</if>
</if>
<!-- yearNo4Where 标识时间参数不用于where条件,用于select部分 -->
<!-- yearNo4Where 标识时间参数不用于where条件,用于select部分 -->
<if
test=
" yearMonthAndParam !=null and yearNo4Where != null and yearNo4Where == true"
>
<if
test=
" yearMonthAndParam !=null "
>
,(max(
,
<if
test=
"yearNo4Where != null and yearNo4Where == true"
>
(max(
ifnull(vbi.bit_str = #{yearMonthAndParamBitStr}, false)
ifnull(vbi.bit_str = #{yearMonthAndParamBitStr}, false)
<!-- 租车列表 不过滤前后预约记录不符的车辆 但是合并标示车型是否有车 即 hasVehicle-->
<!-- 租车列表 不过滤前后预约记录不符的车辆 但是合并标示车型是否有车 即 hasVehicle-->
<if
test=
"withoutRecordWhere != null and withoutRecordWhere = 1 and startCompanyId != null and endCompanyId != null "
>
<if
test=
"withoutRecordWhere != null and withoutRecordWhere = 1 and startCompanyId != null and endCompanyId != null "
>
<!-- and (abr.to_lift_company is null or abr.to_lift_company = #{startCompanyId})-->
<!-- and (abr.to_lift_company is null or abr.to_lift_company = #{startCompanyId})-->
<!-- and (abr.to_return_company is null or abr.to_return_company = #{endCompanyId})-->
<!-- and (abr.to_return_company is null or abr.to_return_company = #{endCompanyId})-->
and (
and (
(IFNULL(abr.to_lift_company, v.park_branch_company_id) = #{startCompanyId})
(IFNULL(abr.to_lift_company, v.park_branch_company_id) = #{startCompanyId})
and
and
...
@@ -1039,7 +1041,13 @@
...
@@ -1039,7 +1041,13 @@
)
)
</if>
</if>
)
)
) as hasVehicle
)
</if>
<if
test=
"yearNo4Where == null or yearNo4Where != true"
>
(if(count(*) > 1, 1 , 0))
</if>
as hasVehicle
</if>
</if>
<if
test=
"lon != null and lat != null"
>
<if
test=
"lon != null and lat != null"
>
,st_distance_sphere(point(#{lon}, #{lat}), point(bc.longitude, bc.latitude)) as distance
,st_distance_sphere(point(#{lon}, #{lat}), point(bc.longitude, bc.latitude)) as distance
...
@@ -1079,7 +1087,7 @@
...
@@ -1079,7 +1087,7 @@
<if
test=
" catas != null "
>
<if
test=
" catas != null "
>
,null as catas
,null as catas
</if>
</if>
<if
test=
" yearMonthAndParam !=null
and yearNo4Where != null and yearNo4Where == true
"
>
<if
test=
" yearMonthAndParam !=null "
>
,0 as hasVehicle
,0 as hasVehicle
</if>
</if>
<if
test=
"lon != null and lat != null"
>
<if
test=
"lon != null and lat != null"
>
...
@@ -1100,7 +1108,7 @@
...
@@ -1100,7 +1108,7 @@
</if>
</if>
<if
test=
"lon != null and lat != null"
>
<if
test=
"lon != null and lat != null"
>
order by
order by
<if
test=
" yearMonthAndParam !=null
and yearNo4Where != null and yearNo4Where == true
"
>
<if
test=
" yearMonthAndParam !=null "
>
hasVehicle desc,
hasVehicle desc,
</if>
</if>
distance asc, model_id asc
distance asc, model_id asc
...
@@ -1153,7 +1161,7 @@
...
@@ -1153,7 +1161,7 @@
</if>
</if>
left join vehicle_model vm on v.model_id = vm.id
left join vehicle_model vm on v.model_id = vm.id
left join branch_company bc on v.park_branch_company_id = bc.id
left join branch_company bc on v.park_branch_company_id = bc.id
<if
test=
"startCompanyId != null and endCompanyId != null "
>
<!-- <if test="startCompanyId != null and endCompanyId != null ">--
>
<!--
<!--
* 原(大于预约结束时间,小于预约开始时间的预约记录)
* 原(大于预约结束时间,小于预约开始时间的预约记录)
* 相交叉(大于预约开始时间,小于预约结束时间的预约记录)
* 相交叉(大于预约开始时间,小于预约结束时间的预约记录)
...
@@ -1168,7 +1176,7 @@
...
@@ -1168,7 +1176,7 @@
<include
refid=
"aroundBookRecordIntersection"
></include>
<include
refid=
"aroundBookRecordIntersection"
></include>
) abr on v.`id` = abr.vehicle_id
) abr on v.`id` = abr.vehicle_id
</if>
</if>
</if
>
<!-- </if>--
>
<if
test=
" catas != null "
>
<if
test=
" catas != null "
>
left join vehicle_cata vc on vm.id = vc.vehicle_model_id
left join vehicle_cata vc on vm.id = vc.vehicle_model_id
</if>
</if>
...
@@ -1179,6 +1187,14 @@
...
@@ -1179,6 +1187,14 @@
vbi.bit_str = #{yearMonthAndParamBitStr}
vbi.bit_str = #{yearMonthAndParamBitStr}
</if>
</if>
<if
test=
" yearNo4Where != null and recordIntersection != null and recordIntersection == true"
>
<!-- 1、最后还车时间(天) 大于 最早提车时间(天) 并且多于一天-->
and if((abr.to_lift_must_after_date is null or abr.to_return_must_before_date is null), true
, (str_to_date(DATE_FORMAT(abr.to_return_must_before_date,'%Y-%m-%d'),'%Y-%m-%d %H:%i:%s')
> DATE_ADD(DATE_ADD(str_to_date(DATE_FORMAT(abr.to_lift_must_after_date,'%Y-%m-%d'),'%Y-%m-%d %H:%i:%s'),INTERVAL 2 DAY),INTERVAL -1 SECOND))
)
</if>
<!-- 根据前后record 过滤车辆 -->
<!-- 根据前后record 过滤车辆 -->
<if
test=
"startCompanyId != null and endCompanyId != null "
>
<if
test=
"startCompanyId != null and endCompanyId != null "
>
<if
test=
"withoutRecordWhere == null"
>
<if
test=
"withoutRecordWhere == null"
>
...
@@ -1201,6 +1217,9 @@
...
@@ -1201,6 +1217,9 @@
<if
test=
" parkBranchCompanyId != null "
>
<if
test=
" parkBranchCompanyId != null "
>
and v.park_branch_company_id = #{parkBranchCompanyId}
and v.park_branch_company_id = #{parkBranchCompanyId}
</if>
</if>
<if
test=
" goodsType != null "
>
and v.goods_type = #{goodsType}
</if>
and v.is_del = 0
and v.is_del = 0
and v.status != 3
and v.status != 3
<if
test=
"useType != null"
>
<if
test=
"useType != null"
>
...
...
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