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
8e216fe3
Commit
8e216fe3
authored
Aug 20, 2019
by
jiaorz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改还车未取消预定数据bug
parent
62f4bd15
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
1 deletion
+20
-1
ResCode.java
...a/com/xxfc/platform/vehicle/constant/ResCode/ResCode.java
+1
-0
VehicleActiveService.java
...a/com/xxfc/platform/vehicle/biz/VehicleActiveService.java
+19
-1
No files found.
xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/constant/ResCode/ResCode.java
View file @
8e216fe3
...
...
@@ -29,6 +29,7 @@ public enum ResCode {
VEHICLE_DEPARTURE_VEHICLE_UNEXIST
(
104001
,
"车辆不存在"
),
VEHICLE_DEPARTURE_VEHICLE_DISABLE
(
104002
,
"车辆不可用"
),
VEHICLE_DEPARTURE_VEHICLE_UNDEPARTURE
(
104003
,
"车辆未出车"
),
VEHICLE_DEPARTURE_DATE_IS_NOT_ABLED
(
104006
,
"车辆不在出车范围内,请按照预定日期出车!"
),
VEHICLE_BOOK_RECORD_IS_NOT_EXIST
(
104004
,
"预约记录不存在"
),
VEHICLE_UNBOOK_FAIL
(
104005
,
"取消预定失败!"
),
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/VehicleActiveService.java
View file @
8e216fe3
...
...
@@ -76,6 +76,8 @@ public class VehicleActiveService {
throw
new
BaseException
(
ResCode
.
VEHICLE_DEPARTURE_VEHICLE_DISABLE
.
getDesc
()
+
", 车辆状态是:"
+
getVehicleStatus
(
vehicle
.
getStatus
(),
vehicle
.
getId
()),
ResCode
.
VEHICLE_DEPARTURE_VEHICLE_DISABLE
.
getCode
());
}
//添加出车时间过滤 再出车开始时间前一天至结束时间内可以出车,并且预定记录为已审核状态
checkDateInvalide
(
departureVo
);
Integer
MileageLift
=
vehicle
.
getMileageLastUpdate
();
Integer
MileageLift1
=
departureVo
.
getMileage
();
if
(
MileageLift1
==
null
){
...
...
@@ -241,7 +243,7 @@ public class VehicleActiveService {
departureLog
.
setArrivalPic
(
arrivalVo
.
getArrivalPic
());
departureLog
.
setArrivalRemark
(
arrivalVo
.
getRemark
());
if
(
vehicleBookRecord
!=
null
)
{
departureLog
.
set
Departure
BranchCompanyId
(
vehicleBookRecord
.
getRetCompany
());
departureLog
.
set
Arrival
BranchCompanyId
(
vehicleBookRecord
.
getRetCompany
());
}
vehicleDepartureLogMapper
.
updateByPrimaryKeySelective
(
departureLog
);
// 车辆活动日志
...
...
@@ -276,6 +278,22 @@ public class VehicleActiveService {
}
}
//添加出车时间过滤 再出车开始时间前一天至结束时间内可以出车,并且预定记录为已审核状态
public
void
checkDateInvalide
(
VehicleDepartureVo
arrivalVo
)
{
if
(
arrivalVo
.
getBookRecordId
()
!=
null
)
{
VehicleBookRecord
vehicleBookRecord
=
vehicleBookRecordBiz
.
selectById
(
arrivalVo
.
getBookRecordId
());
if
(
vehicleBookRecord
!=
null
)
{
DateTime
startDate
=
new
DateTime
(
vehicleBookRecord
.
getBookStartDate
());
DateTime
endDate
=
new
DateTime
(
vehicleBookRecord
.
getBookEndDate
());
if
(!
startDate
.
plusDays
(-
1
).
isBefore
(
DateTime
.
now
())
&&
DateTime
.
now
().
isBefore
(
endDate
)
&&
vehicleBookRecord
.
getStatus
()
==
VehicleBookRecordStatus
.
APPROVE
.
getCode
())
{
throw
new
BaseException
(
ResCode
.
VEHICLE_DEPARTURE_DATE_IS_NOT_ABLED
.
getDesc
(),
ResCode
.
VEHICLE_DEPARTURE_DATE_IS_NOT_ABLED
.
getCode
());
}
}
}
}
public
void
updateBookRecordStatus
(
VehicleBookRecord
vehicleBookRecord
,
Integer
type
)
{
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