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
86423b00
Commit
86423b00
authored
Aug 20, 2019
by
hanfeng
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' of
http://10.5.52.3/youjj/cloud-platform
into dev2
parents
e369ec69
51110dfb
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
29 deletions
+31
-29
VehicleActiveService.java
...a/com/xxfc/platform/vehicle/biz/VehicleActiveService.java
+30
-28
VehicleBookRecordMapper.xml
...ver/src/main/resources/mapper/VehicleBookRecordMapper.xml
+1
-1
No files found.
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/VehicleActiveService.java
View file @
86423b00
...
@@ -66,10 +66,6 @@ public class VehicleActiveService {
...
@@ -66,10 +66,6 @@ public class VehicleActiveService {
throw
new
BaseException
(
ResCode
.
VEHICLE_DEPARTURE_VEHICLE_UNEXIST
.
getDesc
(),
throw
new
BaseException
(
ResCode
.
VEHICLE_DEPARTURE_VEHICLE_UNEXIST
.
getDesc
(),
ResCode
.
VEHICLE_DEPARTURE_VEHICLE_UNEXIST
.
getCode
());
ResCode
.
VEHICLE_DEPARTURE_VEHICLE_UNEXIST
.
getCode
());
}
}
if
(
StringUtils
.
isBlank
(
departureVo
.
getUser
())
||
StringUtils
.
isBlank
(
departureVo
.
getUserTel
()))
{
throw
new
BaseException
(
ResCode
.
USERNAME_AND_TELE_NOT_NULL
.
getDesc
(),
ResCode
.
USERNAME_AND_TELE_NOT_NULL
.
getCode
());
}
if
(
StringUtils
.
isBlank
(
departureVo
.
getCheckMan
())
||
StringUtils
.
isBlank
(
departureVo
.
getCheckManTel
()))
{
if
(
StringUtils
.
isBlank
(
departureVo
.
getCheckMan
())
||
StringUtils
.
isBlank
(
departureVo
.
getCheckManTel
()))
{
throw
new
BaseException
(
ResCode
.
CHECKUSER_AND_PHONE_NOT_NULL
.
getDesc
(),
throw
new
BaseException
(
ResCode
.
CHECKUSER_AND_PHONE_NOT_NULL
.
getDesc
(),
ResCode
.
CHECKUSER_AND_PHONE_NOT_NULL
.
getCode
());
ResCode
.
CHECKUSER_AND_PHONE_NOT_NULL
.
getCode
());
...
@@ -261,21 +257,21 @@ public class VehicleActiveService {
...
@@ -261,21 +257,21 @@ public class VehicleActiveService {
vehicleActiveLogMapper
.
updateByPrimaryKeySelective
(
activeLog
);
vehicleActiveLogMapper
.
updateByPrimaryKeySelective
(
activeLog
);
//取消预定时间 bookInfo和bookRecord
//取消预定时间 bookInfo和bookRecord
BookVehicleVO
bookVehicleVo
=
new
BookVehicleVO
();
//
BookVehicleVO bookVehicleVo = new BookVehicleVO();
BeanUtils
.
copyProperties
(
vehicleBookRecord
,
bookVehicleVo
);
//
BeanUtils.copyProperties(vehicleBookRecord, bookVehicleVo);
bookVehicleVo
.
setNotCheckTimeLegal
(
Boolean
.
TRUE
);
//
bookVehicleVo.setNotCheckTimeLegal(Boolean.TRUE);
bookVehicleVo
.
setBookStartDate
(
null
);
//
bookVehicleVo.setBookStartDate(null);
bookVehicleVo
.
setBookEndDate
(
null
);
//
bookVehicleVo.setBookEndDate(null);
bookVehicleVo
.
setUnbookStartDate
(
new
DateTime
(
vehicleBookRecord
.
getBookStartDate
()).
toString
(
DATE_TIME_FORMATTER
));
//
bookVehicleVo.setUnbookStartDate(new DateTime(vehicleBookRecord.getBookStartDate()).toString(DATE_TIME_FORMATTER));
bookVehicleVo
.
setUnbookEndDate
(
new
DateTime
(
vehicleBookRecord
.
getBookEndDate
()).
toString
(
DATE_TIME_FORMATTER
));
//
bookVehicleVo.setUnbookEndDate(new DateTime(vehicleBookRecord.getBookEndDate()).toString(DATE_TIME_FORMATTER));
try
{
//
try {
Boolean
hasSuc
=
vehicleBiz
.
unbookVehicle
(
bookVehicleVo
);
//
Boolean hasSuc = vehicleBiz.unbookVehicle(bookVehicleVo);
if
(!
hasSuc
){
//
if(!hasSuc){
throw
new
BaseException
(
ResCode
.
VEHICLE_UNBOOK_FAIL
.
getDesc
(),
ResCode
.
VEHICLE_UNBOOK_FAIL
.
getCode
());
//
throw new BaseException(ResCode.VEHICLE_UNBOOK_FAIL.getDesc(), ResCode.VEHICLE_UNBOOK_FAIL.getCode());
}
//
}
}
catch
(
Exception
e
)
{
//
} catch ( Exception e) {
e
.
printStackTrace
();
//
e.printStackTrace();
}
//
}
}
else
{
}
else
{
throw
new
BaseException
(
ResCode
.
VEHICLE_BOOKED_RECORD_MILEAGE_CHANGED
.
getDesc
(),
throw
new
BaseException
(
ResCode
.
VEHICLE_BOOKED_RECORD_MILEAGE_CHANGED
.
getDesc
(),
ResCode
.
VEHICLE_BOOKED_RECORD_MILEAGE_CHANGED
.
getCode
());
ResCode
.
VEHICLE_BOOKED_RECORD_MILEAGE_CHANGED
.
getCode
());
...
@@ -289,19 +285,17 @@ public class VehicleActiveService {
...
@@ -289,19 +285,17 @@ public class VehicleActiveService {
if
(
vehicleBookRecord
!=
null
)
{
if
(
vehicleBookRecord
!=
null
)
{
DateTime
startDate
=
new
DateTime
(
vehicleBookRecord
.
getBookStartDate
());
DateTime
startDate
=
new
DateTime
(
vehicleBookRecord
.
getBookStartDate
());
DateTime
endDate
=
new
DateTime
(
vehicleBookRecord
.
getBookEndDate
());
DateTime
endDate
=
new
DateTime
(
vehicleBookRecord
.
getBookEndDate
());
if
(!(
startDate
.
minusDays
(
1
).
compareTo
(
DateTime
.
now
())
<=
0
&&
DateTime
.
now
().
compareTo
(
endDate
)
<=
0
&&
vehicleBookRecord
.
getStatus
()
==
VehicleBookRecordStatus
.
APPROVE
.
getCode
()))
{
Map
<
String
,
Object
>
param
=
new
HashMap
<>();
Map
<
String
,
Object
>
param
=
new
HashMap
<>();
param
.
put
(
"vehicleId"
,
vehicleBookRecord
.
getVehicleId
());
param
.
put
(
"vehicleId"
,
vehicleBookRecord
.
getVehicleId
());
param
.
put
(
"tim
e"
,
vehicleBookRecord
.
getBookStartDate
());
param
.
put
(
"bookedEndDat
e"
,
vehicleBookRecord
.
getBookStartDate
());
List
<
VehicleBookRecord
>
list
=
vehicleBookRecordBiz
.
selectByVehicleIdAndTime
(
param
);
List
<
VehicleBookRecord
>
list
=
vehicleBookRecordBiz
.
selectByVehicleIdAndTime
(
param
);
if
(
list
!=
null
&&
list
.
size
()
>
0
)
{
if
(!(
startDate
.
minusDays
(
1
).
compareTo
(
DateTime
.
now
())
<=
0
&&
DateTime
.
now
().
compareTo
(
endDate
)
<=
0
&&
vehicleBookRecord
.
getStatus
()
==
VehicleBookRecordStatus
.
APPROVE
.
getCode
()
&&
(
list
==
null
||
list
.
size
()
<=
0
))
)
{
throw
new
BaseException
(
ResCode
.
VEHICLE_DEPARTURE_DATE_IS_NOT_ABLED
.
getDesc
(),
throw
new
BaseException
(
ResCode
.
VEHICLE_DEPARTURE_DATE_IS_NOT_ABLED
.
getDesc
(),
ResCode
.
VEHICLE_DEPARTURE_DATE_IS_NOT_ABLED
.
getCode
());
ResCode
.
VEHICLE_DEPARTURE_DATE_IS_NOT_ABLED
.
getCode
());
}
}
}
}
}
}
}
}
}
public
void
updateBookRecordStatus
(
VehicleBookRecord
vehicleBookRecord
,
Integer
type
)
{
public
void
updateBookRecordStatus
(
VehicleBookRecord
vehicleBookRecord
,
Integer
type
)
{
...
@@ -416,4 +410,12 @@ public class VehicleActiveService {
...
@@ -416,4 +410,12 @@ public class VehicleActiveService {
}
}
public
static
void
main
(
String
[]
args
)
{
DateTime
startDate
=
DateTime
.
parse
(
"2019-08-21 17:00:00"
,
DATE_TIME_FORMATTER
);
DateTime
endDate
=
DateTime
.
parse
(
"2019-08-21 21:00:00"
,
DATE_TIME_FORMATTER
);
System
.
out
.
println
();
System
.
out
.
println
(!(
DateTime
.
now
().
compareTo
(
endDate
)
<=
0
)
&&
(
startDate
.
minusDays
(
1
).
compareTo
(
DateTime
.
now
())
<=
0
));
}
}
}
xx-vehicle/xx-vehicle-server/src/main/resources/mapper/VehicleBookRecordMapper.xml
View file @
86423b00
...
@@ -327,7 +327,7 @@
...
@@ -327,7 +327,7 @@
<select
id=
"selectByVehicleIdAndTime"
parameterType=
"java.util.Map"
resultType=
"com.xxfc.platform.vehicle.entity.VehicleBookRecord"
>
<select
id=
"selectByVehicleIdAndTime"
parameterType=
"java.util.Map"
resultType=
"com.xxfc.platform.vehicle.entity.VehicleBookRecord"
>
select v1.* from vehicle_book_record v1
select v1.* from vehicle_book_record v1
where v1.vehicle_id = #{vehicleId}
and v1.status BETWEEN 1 and 2 and v1.book_end_date >= #{time}
where v1.vehicle_id = #{vehicleId}
and v1.book_end_date
<
= #{bookedEndDate} and v1.status BETWEEN 1 and 2
</select>
</select>
<select
id=
"getById"
parameterType=
"java.util.Map"
resultType=
"com.xxfc.platform.vehicle.entity.VehicleBookRecord"
>
<select
id=
"getById"
parameterType=
"java.util.Map"
resultType=
"com.xxfc.platform.vehicle.entity.VehicleBookRecord"
>
...
...
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