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
59a63bb4
Commit
59a63bb4
authored
Nov 06, 2019
by
libin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
租车日历价格
parent
a889bf19
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
3 deletions
+22
-3
VehicleModelCalendarPriceBiz.java
...fc/platform/vehicle/biz/VehicleModelCalendarPriceBiz.java
+20
-1
VehicleModelCalendarPriceController.java
...orm/vehicle/rest/VehicleModelCalendarPriceController.java
+2
-2
No files found.
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/VehicleModelCalendarPriceBiz.java
View file @
59a63bb4
...
@@ -196,7 +196,26 @@ public class VehicleModelCalendarPriceBiz extends BaseBiz<VehicleModelCalendarPr
...
@@ -196,7 +196,26 @@ public class VehicleModelCalendarPriceBiz extends BaseBiz<VehicleModelCalendarPr
* @return
* @return
*/
*/
public
List
<
VehicleModelCalendarPriceDTO
>
findVehicleModelCalendarPriceByDateAndVehilceIdAndUserId
(
Date
startDate
,
Date
endDate
,
Integer
vehicleModelId
,
Integer
userId
)
{
public
List
<
VehicleModelCalendarPriceDTO
>
findVehicleModelCalendarPriceByDateAndVehilceIdAndUserId
(
Date
startDate
,
Date
endDate
,
Integer
vehicleModelId
,
Integer
userId
)
{
return
findVehicleModelCalendarPrice
(
startDate
,
endDate
,
vehicleModelId
,
userId
);
LocalDate
startLocalDate
=
DateUtils
.
dateToLocalDate
(
startDate
);
LocalDate
endLocalDate
=
DateUtils
.
dateToLocalDate
(
endDate
);
Integer
days
=
getIncludeDays
(
startDate
.
getTime
(),
endDate
.
getTime
());
boolean
isSelect
=
false
;
List
<
VehicleModelCalendarPriceDTO
>
vehicleModelCalendarPrice
=
findVehicleModelCalendarPrice
(
startDate
,
endDate
,
vehicleModelId
,
userId
);
for
(
int
i
=
0
,
y
=
0
;
i
<
vehicleModelCalendarPrice
.
size
();
i
++)
{
VehicleModelCalendarPriceDTO
vehicleModelCalendarPriceDTO
=
vehicleModelCalendarPrice
.
get
(
i
);
LocalDate
current_date
=
DateUtils
.
dateToLocalDate
(
vehicleModelCalendarPriceDTO
.
getDate
());
if
(
y
==
0
)
{
isSelect
=
(
current_date
.
isAfter
(
startLocalDate
)
&&
current_date
.
isBefore
(
endLocalDate
))
||
current_date
.
isEqual
(
startLocalDate
)
||
current_date
.
isEqual
(
endLocalDate
);
}
if
(
isSelect
)
{
if
(
y
<
days
)
{
vehicleModelCalendarPriceDTO
.
setIsSelect
(
isSelect
?
true
:
false
);
y
++;
}
}
}
return
vehicleModelCalendarPrice
.
stream
().
filter
(
x
->
Objects
.
nonNull
(
x
.
getIsSelect
())).
collect
(
Collectors
.
toList
());
}
}
/**
/**
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/rest/VehicleModelCalendarPriceController.java
View file @
59a63bb4
...
@@ -73,8 +73,8 @@ public class VehicleModelCalendarPriceController {
...
@@ -73,8 +73,8 @@ public class VehicleModelCalendarPriceController {
@RequestParam
(
value
=
"vehicleModelId"
)
Integer
vehicleModelId
,
@RequestParam
(
value
=
"vehicleModelId"
)
Integer
vehicleModelId
,
AppUserDTO
appUserDTO
)
{
AppUserDTO
appUserDTO
)
{
Date
startDateDay
=
DateUtil
.
beginOfDay
(
DateUtil
.
date
(
startDate
)
);
Date
startDateDay
=
new
Date
(
startDate
);
Date
endDateDay
=
DateUtil
.
beginOfDay
(
DateUtil
.
date
(
endDate
)
);
Date
endDateDay
=
new
Date
(
endDate
);
return
ObjectRestResponse
.
succ
(
vehicleModelCalendarPriceBiz
.
findVehicleModelCalendarPriceByDateAndVehilceIdAndUserId
(
startDateDay
,
endDateDay
,
vehicleModelId
,
appUserDTO
.
getUserid
()));
return
ObjectRestResponse
.
succ
(
vehicleModelCalendarPriceBiz
.
findVehicleModelCalendarPriceByDateAndVehilceIdAndUserId
(
startDateDay
,
endDateDay
,
vehicleModelId
,
appUserDTO
.
getUserid
()));
}
}
...
...
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