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
62f4bd15
Commit
62f4bd15
authored
Aug 20, 2019
by
jiaorz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改还车未取消预定数据bug
parent
8bbe8e7c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
0 deletions
+26
-0
VehicleActiveService.java
...a/com/xxfc/platform/vehicle/biz/VehicleActiveService.java
+26
-0
No files found.
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/VehicleActiveService.java
View file @
62f4bd15
...
...
@@ -3,12 +3,16 @@ 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.*
;
import
com.xxfc.platform.vehicle.mapper.*
;
import
com.xxfc.platform.vehicle.pojo.*
;
import
org.apache.commons.lang3.StringUtils
;
import
org.joda.time.DateTime
;
import
org.joda.time.format.DateTimeFormat
;
import
org.joda.time.format.DateTimeFormatter
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
...
...
@@ -39,6 +43,12 @@ public class VehicleActiveService {
@Autowired
VehicleBookRecordBiz
vehicleBookRecordBiz
;
@Autowired
VehicleBiz
vehicleBiz
;
public
static
final
DateTimeFormatter
DATE_TIME_FORMATTER
=
DateTimeFormat
.
forPattern
(
"yyyy-MM-dd HH:mm:ss"
);
@Value
(
"${vehicle.mileage}"
)
private
Integer
Mileage
;
...
...
@@ -244,6 +254,22 @@ public class VehicleActiveService {
activeLog
.
setUpdateTime
(
new
Date
());
vehicleActiveLogMapper
.
updateByPrimaryKeySelective
(
activeLog
);
//取消预定时间 bookInfo和bookRecord
BookVehicleVO
bookVehicleVo
=
new
BookVehicleVO
();
BeanUtils
.
copyProperties
(
vehicleBookRecord
,
bookVehicleVo
);
bookVehicleVo
.
setNotCheckTimeLegal
(
Boolean
.
TRUE
);
bookVehicleVo
.
setBookStartDate
(
null
);
bookVehicleVo
.
setBookEndDate
(
null
);
bookVehicleVo
.
setUnbookStartDate
(
new
DateTime
(
vehicleBookRecord
.
getBookStartDate
()).
toString
(
DATE_TIME_FORMATTER
));
bookVehicleVo
.
setUnbookEndDate
(
new
DateTime
(
vehicleBookRecord
.
getBookEndDate
()).
toString
(
DATE_TIME_FORMATTER
));
try
{
Boolean
hasSuc
=
vehicleBiz
.
unbookVehicle
(
bookVehicleVo
);
if
(!
hasSuc
){
throw
new
BaseException
(
ResCode
.
VEHICLE_UNBOOK_FAIL
.
getDesc
(),
ResCode
.
VEHICLE_UNBOOK_FAIL
.
getCode
());
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
else
{
throw
new
BaseException
(
ResCode
.
VEHICLE_BOOKED_RECORD_MILEAGE_CHANGED
.
getDesc
(),
ResCode
.
VEHICLE_BOOKED_RECORD_MILEAGE_CHANGED
.
getCode
());
...
...
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