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
b442f72d
Commit
b442f72d
authored
Aug 24, 2019
by
libin
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' into lb_dev
parents
4e23d593
abd5649a
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
45 additions
and
10 deletions
+45
-10
UsableVeicleDTO.java
.../java/com/xxfc/platform/vehicle/pojo/UsableVeicleDTO.java
+3
-0
VehicleBiz.java
...c/main/java/com/xxfc/platform/vehicle/biz/VehicleBiz.java
+9
-0
VehicleBookRecordBiz.java
...a/com/xxfc/platform/vehicle/biz/VehicleBookRecordBiz.java
+6
-0
VehicleBookRecordMapper.java
...xxfc/platform/vehicle/mapper/VehicleBookRecordMapper.java
+3
-0
VehicleBookRecordMapper.xml
...ver/src/main/resources/mapper/VehicleBookRecordMapper.xml
+7
-0
VehicleMapper.xml
...ehicle-server/src/main/resources/mapper/VehicleMapper.xml
+17
-10
No files found.
xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/pojo/UsableVeicleDTO.java
View file @
b442f72d
...
...
@@ -54,6 +54,9 @@ public class UsableVeicleDTO extends PageParam {
@ApiModelProperty
(
hidden
=
true
)
Boolean
yearNo4Where
;
@ApiModelProperty
(
hidden
=
true
)
Integer
withoutRecordWhere
=
1
;
public
void
setStartDateTamp
(
Long
startDateTamp
)
{
this
.
startDateTamp
=
startDateTamp
;
this
.
startDate
=
DEFAULT_DATE_TIME_FORMATTER
.
format
(
LocalDateTime
.
ofInstant
(
Instant
.
ofEpochMilli
(
startDateTamp
),
ZoneOffset
.
ofHours
(
8
)));
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/VehicleBiz.java
View file @
b442f72d
...
...
@@ -542,6 +542,15 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR
VehicleBookHourInfoDto
vehicleBookHourInfoDto
=
new
VehicleBookHourInfoDto
();
vehicleBookHourInfoDto
.
setYearMonthDay
(
entry
.
getKey
());
vehicleBookHourInfoDto
.
setVehicleId
(
vehicleId
);
if
(
entry
.
getValue
()
==
0
)
{
//0点 查询是否有已经预约的记录
Map
<
String
,
Object
>
param
=
new
HashMap
<>();
param
.
put
(
"vehicleId"
,
vehicleId
);
param
.
put
(
"bookedEndDate"
,
DateTime
.
parse
(
entry
.
getKey
()
+
" 00:00:00"
,
DATE_TIME_FORMATTER
));
List
<
VehicleBookRecordVo
>
vehicleBookRecordVos
=
vehicleBookRecordBiz
.
selectZeroHourRecord
(
param
);
if
(
vehicleBookRecordVos
!=
null
&&
vehicleBookRecordVos
.
size
()
>
0
)
{
return
false
;
}
}
List
<
VehicleBookHourInfo
>
vehicleBookHourInfos
=
vehicleBookHourInfoBiz
.
selectByVehicleAndDate
(
vehicleBookHourInfoDto
);
if
(
vehicleBookHourInfos
!=
null
&&
vehicleBookHourInfos
.
size
()
>
0
)
{
if
((
vehicleBookHourInfos
.
get
(
0
).
getBookedHour
()
&
entry
.
getValue
())
!=
0
)
{
// 已经被预定
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/VehicleBookRecordBiz.java
View file @
b442f72d
...
...
@@ -93,6 +93,12 @@ public class VehicleBookRecordBiz extends BaseBiz<VehicleBookRecordMapper, Vehic
return
list
;
}
public
List
<
VehicleBookRecordVo
>
selectZeroHourRecord
(
Map
<
String
,
Object
>
param
)
{
List
<
VehicleBookRecordVo
>
list
=
mapper
.
selectZeroHourRecord
(
param
);
removeStatus2
(
list
);
return
list
;
}
public
int
changeRecordStatus
(
Map
<
String
,
Object
>
updateParam
)
{
return
mapper
.
changeRecordStatus
(
updateParam
);
}
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/mapper/VehicleBookRecordMapper.java
View file @
b442f72d
...
...
@@ -37,4 +37,7 @@ public interface VehicleBookRecordMapper extends Mapper<VehicleBookRecord> {
public
List
<
VehicleBookRecordVo
>
getBookRecordInfo
(
Map
<
String
,
Object
>
param
);
public
List
<
VehicleBookRecordVo
>
selectByVehicleIdAndTime
(
Map
<
String
,
Object
>
param
);
public
List
<
VehicleBookRecordVo
>
selectZeroHourRecord
(
Map
<
String
,
Object
>
param
);
}
\ No newline at end of file
xx-vehicle/xx-vehicle-server/src/main/resources/mapper/VehicleBookRecordMapper.xml
View file @
b442f72d
...
...
@@ -330,6 +330,13 @@
where v1.vehicle_id = #{vehicleId} and v1.book_end_date
<
= #{bookedEndDate} and v1.status BETWEEN 1 and 2
</select>
<select
id=
"selectZeroHourRecord"
resultMap=
"searchBookRecord"
parameterType=
"java.util.Map"
>
select v1.* from vehicle_book_record v1
where v1.vehicle_id = #{vehicleId}
and (v1.book_end_date = #{bookedEndDate} or v1.book_start_date = #{bookedEndDate})
and v1.status BETWEEN 1 and 2
</select>
<select
id=
"getById"
parameterType=
"java.util.Map"
resultType=
"com.xxfc.platform.vehicle.entity.VehicleBookRecord"
>
select
vbr.`id`,
...
...
xx-vehicle/xx-vehicle-server/src/main/resources/mapper/VehicleMapper.xml
View file @
b442f72d
...
...
@@ -522,11 +522,17 @@
</if>
<!-- yearNo4Where 标识时间参数不用于where条件,用于select部分 -->
<if
test=
" yearMonthAndParam !=null and yearNo4Where != null and yearNo4Where == true"
>
,max(
,
(
max(
<foreach
collection=
"yearMonthAndParam"
index=
"yearMonth"
item=
"andOperation"
separator=
"and"
>
<include
refid=
"yearMonthAndParamSql"
></include>
</foreach>
) as hasVehicle
<!-- 租车列表 不过滤前后预约记录不符的车辆 但是合并标示车型是否有车 即 hasVehicle-->
<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_return_company is null or abr.to_return_company = #{endCompanyId})
</if>
)
)as hasVehicle
</if>
<if
test=
"lon != null and lat != null"
>
,st_distance_sphere(point(#{lon}, #{lat}), point(bc.longitude, bc.latitude)) as distance
...
...
@@ -557,7 +563,7 @@
) > 0
</if>
)
<!-- union 所有车型 -->
<!-- union 所有
下架
车型 -->
<if
test=
"startCompanyId != null or parkBranchCompanyId != null "
>
union
(select vm.id as model_id, bc.id as company_id
...
...
@@ -635,15 +641,16 @@
</foreach>
</if>
<!-- 若需根据预定日期条件查询,针对换为位操作 -->
<!-- yearNo4Where 标识时间参数是否用于where条件 -->
<!-- 根据前后record 过滤车辆 -->
<if
test=
"startCompanyId != null and endCompanyId != null "
>
<if
test=
"withoutRecordWhere == null"
>
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})
)
</if>
</if>
<if
test=
" modelId != null "
>
and v.model_id = #{modelId}
</if>
...
...
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