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
ae656f5b
Commit
ae656f5b
authored
Sep 20, 2019
by
周健威
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master-modify-cutAmount' into master-modify-cutAmount
parents
89d12970
4ee5c2a8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
12 deletions
+17
-12
VehicleActiveService.java
...a/com/xxfc/platform/vehicle/biz/VehicleActiveService.java
+17
-12
No files found.
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/VehicleActiveService.java
View file @
ae656f5b
...
...
@@ -3,7 +3,6 @@ package com.xxfc.platform.vehicle.biz;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.bean.copier.CopyOptions
;
import
com.github.wxiaoqi.security.common.exception.BaseException
;
import
com.xxfc.platform.vehicle.common.RestResponse
;
import
com.xxfc.platform.vehicle.constant.*
;
import
com.xxfc.platform.vehicle.constant.ResCode.ResCode
;
import
com.xxfc.platform.vehicle.entity.*
;
...
...
@@ -74,7 +73,7 @@ public class VehicleActiveService {
ResCode
.
VEHICLE_DEPARTURE_VEHICLE_DISABLE
.
getCode
());
}
//添加出车时间过滤 再出车开始时间前一天至结束时间内可以出车,并且预定记录为已审核状态
checkDateInvalid
e
(
departureVo
);
checkDateInvalid
(
departureVo
);
Integer
MileageLift
=
vehicle
.
getMileageLastUpdate
();
Integer
MileageLift1
=
departureVo
.
getMileage
();
if
(
MileageLift1
==
null
)
{
...
...
@@ -181,6 +180,7 @@ public class VehicleActiveService {
}
public
void
arrival
(
VehicleArrivalVo
arrivalVo
)
{
log
.
info
(
"用户还车操作:arrivalVo = {}"
,
arrivalVo
.
toString
());
Vehicle
vehicle
=
vehicleMapper
.
selectByPrimaryKey
(
arrivalVo
.
getVehicleId
());
if
(
vehicle
==
null
)
{
throw
new
BaseException
(
ResCode
.
VEHICLE_DEPARTURE_VEHICLE_UNEXIST
.
getDesc
(),
...
...
@@ -194,21 +194,17 @@ public class VehicleActiveService {
// throw new BaseException(ResCode.VEHICLE_DEPARTURE_VEHICLE_UNDEPARTURE.getDesc() + ", 车辆状态是:" + getVehicleStatus(vehicle.getStatus(), vehicle.getId()),
// ResCode.VEHICLE_DEPARTURE_VEHICLE_UNDEPARTURE.getCode());
// }
Integer
Mileage
r
est
=
vehicle
.
getMileageLastUpdate
();
Integer
Mileage
r
est1
=
arrivalVo
.
getMileage
();
if
(
Mileage
r
est1
==
null
)
{
Integer
Mileage
R
est
=
vehicle
.
getMileageLastUpdate
();
Integer
Mileage
R
est1
=
arrivalVo
.
getMileage
();
if
(
Mileage
R
est1
==
null
)
{
throw
new
BaseException
(
ResCode
.
VEHICLE_BOOKED_RECORD_MILEAGE_CHANGED
.
getDesc
(),
ResCode
.
VEHICLE_BOOKED_RECORD_MILEAGE_CHANGED
.
getCode
());
}
if
(
Mileage
rest
!=
null
&&
Mileagerest1
>=
Mileager
est
)
{
if
(
Mileage
Rest
!=
null
&&
MileageRest1
>=
MileageR
est
)
{
VehicleBookRecord
vehicleBookRecord
=
null
;
if
(
arrivalVo
.
getBookRecordId
()
!=
null
)
{
vehicleBookRecord
=
vehicleBookRecordBiz
.
selectById
(
arrivalVo
.
getBookRecordId
());
updateBookRecordStatus
(
vehicleBookRecord
,
2
);
}
// 写入车辆公里数,还车分公司id
vehicle
.
setMileageLastUpdate
(
Mileage
r
est1
);
vehicle
.
setMileageLastUpdate
(
Mileage
R
est1
);
if
(
vehicleBookRecord
!=
null
)
{
vehicle
.
setParkBranchCompanyId
(
vehicleBookRecord
.
getRetCompany
());
}
...
...
@@ -250,14 +246,23 @@ public class VehicleActiveService {
bookVehicleVo
.
setBookEndDate
(
null
);
bookVehicleVo
.
setUnbookStartDate
(
actualArrivalDate
.
toString
(
DATE_TIME_FORMATTER
));
bookVehicleVo
.
setUnbookEndDate
(
arrivalDate
.
toString
(
DATE_TIME_FORMATTER
));
bookVehicleVo
.
setRemark
(
bookVehicleVo
.
getRemark
()
+
" 用户提前还车,取消剩余天数, 初始预定结束时间是,"
+
new
DateTime
(
vehicleBookRecord
.
getBookEndDate
()).
toString
(
DATE_TIME_FORMATTER
));
vehicleBookRecord
.
setRemark
(
bookVehicleVo
.
getRemark
());
try
{
Boolean
hasSuc
=
vehicleBiz
.
unbookVehicle
(
bookVehicleVo
);
if
(!
hasSuc
)
{
throw
new
BaseException
(
ResCode
.
VEHICLE_UNBOOK_FAIL
.
getDesc
(),
ResCode
.
VEHICLE_UNBOOK_FAIL
.
getCode
());
}
}
catch
(
Exception
e
)
{
log
.
info
(
"提前还车失败,bookVehicleVo = {}"
,
bookVehicleVo
.
toString
());
e
.
printStackTrace
();
}
}
else
if
(
actualArrivalDate
.
compareTo
(
arrivalDate
)
>
0
)
{
//实际还车时间大于预计还车时间
vehicleBookRecord
.
setRemark
(
vehicleBookRecord
.
getRemark
()
+
" 用户延期还车,实际占用日期"
);
}
if
(
arrivalVo
.
getBookRecordId
()
!=
null
)
{
vehicleBookRecord
=
vehicleBookRecordBiz
.
selectById
(
arrivalVo
.
getBookRecordId
());
updateBookRecordStatus
(
vehicleBookRecord
,
2
);
}
departureLog
.
setMileageEnd
(
arrivalVo
.
getMileage
());
departureLog
.
setRecycleMan
(
arrivalVo
.
getRecycleMan
());
...
...
@@ -307,7 +312,7 @@ public class VehicleActiveService {
}
//添加出车时间过滤 再出车开始时间前一天至结束时间内可以出车,并且预定记录为已审核状态
public
void
checkDateInvalid
e
(
VehicleDepartureVo
arrivalVo
)
{
public
void
checkDateInvalid
(
VehicleDepartureVo
arrivalVo
)
{
if
(
arrivalVo
.
getBookRecordId
()
!=
null
)
{
VehicleBookRecord
vehicleBookRecord
=
vehicleBookRecordBiz
.
selectById
(
arrivalVo
.
getBookRecordId
());
if
(
vehicleBookRecord
!=
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