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
20636c05
Commit
20636c05
authored
Aug 20, 2019
by
jiaorz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
核銷bug
parent
99b28109
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
14 deletions
+16
-14
VehicleActiveService.java
...a/com/xxfc/platform/vehicle/biz/VehicleActiveService.java
+15
-13
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 @
20636c05
...
@@ -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
());
...
@@ -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 @
20636c05
...
@@ -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