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
ab1455b1
Commit
ab1455b1
authored
Oct 08, 2020
by
周健威
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master-vehicle-price' into dev-tiande
parents
d514f71c
81005ecd
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
16 deletions
+25
-16
RentVehicleController.java
...com/xxfc/platform/vehicle/rest/RentVehicleController.java
+4
-3
VehicleMapper.xml
...ehicle-server/src/main/resources/mapper/VehicleMapper.xml
+21
-13
No files found.
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/rest/RentVehicleController.java
View file @
ab1455b1
...
@@ -38,6 +38,7 @@ import java.time.Instant;
...
@@ -38,6 +38,7 @@ import java.time.Instant;
import
java.time.LocalDateTime
;
import
java.time.LocalDateTime
;
import
java.time.ZoneOffset
;
import
java.time.ZoneOffset
;
import
java.time.format.DateTimeFormatter
;
import
java.time.format.DateTimeFormatter
;
import
java.util.Comparator
;
import
java.util.HashSet
;
import
java.util.HashSet
;
import
java.util.List
;
import
java.util.List
;
...
@@ -166,7 +167,7 @@ public class RentVehicleController extends BaseController<VehicleBiz> implements
...
@@ -166,7 +167,7 @@ public class RentVehicleController extends BaseController<VehicleBiz> implements
//查询可车辆信息
//查询可车辆信息
PageDataVO
<
UsableVeicleVO
>
pageDataVO
=
vehicleBiz
.
searchUsableVehicle
(
rbd
);
PageDataVO
<
UsableVeicleVO
>
pageDataVO
=
vehicleBiz
.
searchUsableVehicle
(
rbd
);
if
(
CollUtil
.
isNotEmpty
(
pageDataVO
.
getData
()))
{
if
(
CollUtil
.
isNotEmpty
(
pageDataVO
.
getData
()))
{
data
.
setHasVehicle
(
SYS_TRUE
);
for
(
UsableVeicleVO
usableVeicleVO
:
pageDataVO
.
getData
())
{
for
(
UsableVeicleVO
usableVeicleVO
:
pageDataVO
.
getData
())
{
//判断是否预定时间内可租
//判断是否预定时间内可租
...
@@ -179,8 +180,6 @@ public class RentVehicleController extends BaseController<VehicleBiz> implements
...
@@ -179,8 +180,6 @@ public class RentVehicleController extends BaseController<VehicleBiz> implements
//如果"必须在这时间前预定" 存在 并且 比预定结束时间 要早,那么不允许预定
//如果"必须在这时间前预定" 存在 并且 比预定结束时间 要早,那么不允许预定
if
(
null
!=
usableVeicleVO
.
getToReturnMustBeforeDate
()
&&
DateUtil
.
date
(
dto
.
getEndDateTamp
()).
isAfterOrEquals
(
usableVeicleVO
.
getToReturnMustBeforeDate
()))
{
if
(
null
!=
usableVeicleVO
.
getToReturnMustBeforeDate
()
&&
DateUtil
.
date
(
dto
.
getEndDateTamp
()).
isAfterOrEquals
(
usableVeicleVO
.
getToReturnMustBeforeDate
()))
{
usableVeicleVO
.
setAllowRent
(
SYS_FALSE
);
usableVeicleVO
.
setAllowRent
(
SYS_FALSE
);
}
else
{
data
.
setHasVehicle
(
SYS_TRUE
);
}
}
String
priceStartDateStr
=
StrUtil
.
isNotBlank
(
dto
.
getPriceStartDate
())?
dto
.
getPriceStartDate
():
dto
.
getStartDate
();
String
priceStartDateStr
=
StrUtil
.
isNotBlank
(
dto
.
getPriceStartDate
())?
dto
.
getPriceStartDate
():
dto
.
getStartDate
();
...
@@ -191,6 +190,8 @@ public class RentVehicleController extends BaseController<VehicleBiz> implements
...
@@ -191,6 +190,8 @@ public class RentVehicleController extends BaseController<VehicleBiz> implements
data
.
setUsableVeicleVOList
(
pageDataVO
.
getData
());
data
.
setUsableVeicleVOList
(
pageDataVO
.
getData
());
}
}
});
});
//车型排序
//uvmvpdvs.getData().parallelStream().sorted(Comparator.comparing(UsableVehicleModelVO::getHasVehicle).reversed());
}
}
return
ObjectRestResponse
.
succ
(
uvmvpdvs
);
return
ObjectRestResponse
.
succ
(
uvmvpdvs
);
}
}
...
...
xx-vehicle/xx-vehicle-server/src/main/resources/mapper/VehicleMapper.xml
View file @
ab1455b1
...
@@ -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 and 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
...
...
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