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
7be3c65d
Commit
7be3c65d
authored
Oct 16, 2019
by
libin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提现账号
parent
447bf340
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
114 additions
and
136 deletions
+114
-136
VehicleModelCalendarPrice.java
...fc/platform/vehicle/entity/VehicleModelCalendarPrice.java
+5
-0
VehicleModelCalendarPriceDTO.java
...atform/vehicle/pojo/dto/VehicleModelCalendarPriceDTO.java
+2
-1
VehicleModelCalendarPriceSaveDTO.java
...rm/vehicle/pojo/dto/VehicleModelCalendarPriceSaveDTO.java
+4
-0
VehicleModelCalendarPriceVo.java
...platform/vehicle/pojo/vo/VehicleModelCalendarPriceVo.java
+0
-29
VehicleModelCalendarPriceBiz.java
...fc/platform/vehicle/biz/VehicleModelCalendarPriceBiz.java
+100
-103
VehicleModelCalendarPriceController.java
...orm/vehicle/rest/VehicleModelCalendarPriceController.java
+3
-3
No files found.
xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/entity/VehicleModelCalendarPrice.java
View file @
7be3c65d
...
...
@@ -84,4 +84,9 @@ public class VehicleModelCalendarPrice implements Serializable {
@Column
(
name
=
"is_del"
)
private
Integer
isDel
;
/**
* 会员等级 1:普通 2:黄金 3:钻石
*/
private
Integer
level
;
}
xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/pojo/dto/VehicleModelCalendarPriceDTO.java
View file @
7be3c65d
...
...
@@ -22,7 +22,8 @@ import java.util.Date;
public
class
VehicleModelCalendarPriceDTO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
private
Date
date
;
private
BigDecimal
price
;
private
Date
bookDate
;
private
Integer
freeDays
;
private
Boolean
isSelect
;
}
xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/pojo/dto/VehicleModelCalendarPriceSaveDTO.java
View file @
7be3c65d
...
...
@@ -51,4 +51,8 @@ public class VehicleModelCalendarPriceSaveDTO implements Serializable {
*/
private
BigDecimal
price
;
/**
* 会员等级 1:普通 2:黄金 3:钻石
*/
private
Integer
level
;
}
xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/pojo/vo/VehicleModelCalendarPriceVo.java
deleted
100644 → 0
View file @
447bf340
package
com
.
xxfc
.
platform
.
vehicle
.
pojo
.
vo
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
import
java.util.Date
;
/**
* @author libin
* @version 1.0
* @description
* @data 2019/10/15 9:43
*/
@Data
@Builder
(
toBuilder
=
true
)
@NoArgsConstructor
@AllArgsConstructor
public
class
VehicleModelCalendarPriceVo
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
private
Date
date
;
private
BigDecimal
price
;
private
Integer
days
;
private
Boolean
isSelect
;
}
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/VehicleModelCalendarPriceBiz.java
View file @
7be3c65d
package
com
.
xxfc
.
platform
.
vehicle
.
biz
;
import
com.github.wxiaoqi.security.admin.entity.BaseUserMember
;
import
com.github.wxiaoqi.security.admin.entity.BaseUserMemberLevel
;
import
com.github.wxiaoqi.security.admin.feign.UserFeign
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.xxfc.platform.vehicle.entity.VehicleModelCalendarPrice
;
...
...
@@ -9,7 +10,6 @@ import com.xxfc.platform.vehicle.pojo.dto.VehicleModelCalendarPriceDTO;
import
com.xxfc.platform.vehicle.pojo.dto.VehicleModelCalendarPriceSaveDTO
;
import
com.xxfc.platform.vehicle.pojo.dto.VehicleModelDTO
;
import
com.xxfc.platform.vehicle.pojo.dto.VehicleModelHolidayPriceDTO
;
import
com.xxfc.platform.vehicle.pojo.vo.VehicleModelCalendarPriceVo
;
import
com.xxfc.platform.vehicle.pojo.vo.VehicleModelDayPriceVo
;
import
lombok.RequiredArgsConstructor
;
import
org.apache.commons.collections.CollectionUtils
;
...
...
@@ -46,20 +46,18 @@ public class VehicleModelCalendarPriceBiz extends BaseBiz<VehicleModelCalendarPr
* 一个星期的最后一天
*/
private
static
final
int
END_OF_WEEK
=
7
;
/**
* 价格类型查询
*/
private
static
final
int
PRICE_OF_TYPE
=
0
;
/**
* 天数类型查询
*/
private
static
final
int
DAYS_OF_TYPE
=
1
;
private
final
VehicleModelHolidayPriceBiz
vehicleModelHolidayPriceBiz
;
private
final
VehicleModelBiz
vehicleModelBiz
;
private
final
UserFeign
userFeign
;
/**
* 保存
*
* @param vehicleModelCalendarPrices
* @param userId
*/
public
void
addVehicleModelCalendarPrice
(
List
<
VehicleModelCalendarPriceSaveDTO
>
vehicleModelCalendarPrices
,
Integer
userId
)
{
if
(
CollectionUtils
.
isNotEmpty
(
vehicleModelCalendarPrices
))
{
List
<
VehicleModelCalendarPrice
>
vehicleModelCalendarPriceList
=
new
ArrayList
<>();
...
...
@@ -86,6 +84,11 @@ public class VehicleModelCalendarPriceBiz extends BaseBiz<VehicleModelCalendarPr
}
/**
* 查询全部车型
*
* @return
*/
public
List
<
VehicleModelDayPriceVo
>
listVehicleModelPrice
()
{
List
<
VehicleModelDayPriceVo
>
vehicleModelDayPriceVos
=
new
ArrayList
<>();
List
<
VehicleModelDTO
>
vehicleModelDTOS
=
vehicleModelBiz
.
findAllVehicleModel
();
...
...
@@ -98,6 +101,12 @@ public class VehicleModelCalendarPriceBiz extends BaseBiz<VehicleModelCalendarPr
return
vehicleModelDayPriceVos
;
}
/**
* 根据俱体日期查询
*
* @param currentDate
* @return
*/
public
List
<
VehicleModelDayPriceVo
>
findVehicleModelcalendarPriceByDateWithDay
(
Date
currentDate
)
{
List
<
VehicleModelDayPriceVo
>
vehicleModelDayPriceVos
=
new
ArrayList
<>();
Map
<
Integer
,
VehicleModelCalendarPrice
>
vehicleModelCalendarPriceMap
=
null
;
...
...
@@ -124,7 +133,12 @@ public class VehicleModelCalendarPriceBiz extends BaseBiz<VehicleModelCalendarPr
return
vehicleModelDayPriceVos
;
}
/**
* 根据月份查询
*
* @param currentDate
* @return
*/
public
List
<
VehicleModelCalendarPriceSaveDTO
>
findVehicleModelCalendarPricesByDateWithMonth
(
Date
currentDate
)
{
List
<
VehicleModelCalendarPriceSaveDTO
>
vehicleModelCalendarPriceSaveDTOS
=
new
ArrayList
<>();
Example
example
=
new
Example
(
VehicleModelCalendarPrice
.
class
);
...
...
@@ -149,121 +163,88 @@ public class VehicleModelCalendarPriceBiz extends BaseBiz<VehicleModelCalendarPr
return
vehicleModelCalendarPriceSaveDTOS
;
}
/**
* 根据下单时间查询
*
* @param startDate
* @param endDate
* @param vehicleModelId
* @param userId
* @return
*/
public
List
<
VehicleModelCalendarPriceDTO
>
findVehicleModelCalendarPriceByDateAndVehilceIdAndUserId
(
Date
startDate
,
Date
endDate
,
Integer
vehicleModelId
,
Integer
userId
)
{
List
<
VehicleModelCalendarPriceDTO
>
vehicleModelCalendarPriceDTOS
=
new
ArrayList
<>();
//车型的原价
BigDecimal
vehicle_price
=
new
BigDecimal
(
0
);
Integer
discount
=
100
;
int
free_days
=
1
;
//日历价格转map
List
<
VehicleModelCalendarPrice
>
vehicleModelCalendarPrices
=
getVehicleModelCalendarPricesByVehicleModelIdAndDate
(
vehicleModelId
,
startDate
,
endDate
);
Map
<
Date
,
VehicleModelCalendarPrice
>
calendarPriceMap
=
vehicleModelCalendarPrices
.
stream
().
collect
(
Collectors
.
toMap
(
VehicleModelCalendarPrice:
:
getVehicleModelDay
,
Function
.
identity
()));
//节假日转map
List
<
VehicleModelHolidayPriceDTO
>
vehicleModelHolidayPrices
=
vehicleModelHolidayPriceBiz
.
findVehicleModelHolidayPriceByMonth
(
startDate
,
endDate
);
Map
<
Date
,
VehicleModelHolidayPriceDTO
>
festivalDayMap
=
vehicleModelHolidayPrices
.
stream
().
collect
(
Collectors
.
toMap
(
VehicleModelHolidayPriceDTO:
:
getFestivalDay
,
Function
.
identity
()));
vehicle_price
=
vehicleModelBiz
.
findVehicleModelPriceByVehicleModelId
(
vehicleModelId
);
if
(
Objects
.
nonNull
(
userId
))
{
BaseUserMember
baseUserMember
=
userFeign
.
findBaseUserMemberByUserId
(
userId
);
discount
=
baseUserMember
==
null
?
discount
:
baseUserMember
.
getDiscount
();
return
findVehicleModelCalendarPrice
(
startDate
,
endDate
,
vehicleModelId
,
userId
);
}
VehicleModelCalendarPriceVo
vehicleModelCalendarPriceVo
;
LocalDate
final_startLocalDate
=
startDate
.
toInstant
().
atZone
(
ZoneId
.
systemDefault
()).
toLocalDate
();
LocalDate
final_endLocalDate
=
endDate
.
toInstant
().
atZone
(
ZoneId
.
systemDefault
()).
toLocalDate
();
VehicleModelCalendarPriceDTO
vehicleModelCalendarPriceDTO
;
while
(
final_startLocalDate
.
isBefore
(
final_endLocalDate
)
||
final_startLocalDate
.
isEqual
(
final_endLocalDate
))
{
vehicleModelCalendarPriceDTO
=
new
VehicleModelCalendarPriceDTO
();
Date
current_date
=
Date
.
from
(
final_startLocalDate
.
atStartOfDay
(
ZoneId
.
systemDefault
()).
toInstant
());
vehicleModelCalendarPriceDTO
.
setBookDate
(
current_date
);
/**
* 日历展示车型价格
*
* @param startDate
* @param endDate
* @param vehicleModelId
* @param userId
* @return
*/
public
List
<
VehicleModelCalendarPriceDTO
>
listVehicleModelCalendarPriceByDateAndVehicleModelIdAndUserId
(
Date
startDate
,
Date
endDate
,
Integer
vehicleModelId
,
Integer
userId
)
{
LocalDate
startLocalDate
=
startDate
.
toInstant
().
atZone
(
ZoneId
.
systemDefault
()).
toLocalDate
();
LocalDate
endLocalDate
=
endDate
.
toInstant
().
atZone
(
ZoneId
.
systemDefault
()).
toLocalDate
();
if
(
calendarPriceMap
!=
null
&&
!
calendarPriceMap
.
isEmpty
())
{
VehicleModelCalendarPrice
vehicleModelCalendarPrice
=
calendarPriceMap
.
get
(
Date
.
from
(
final_startLocalDate
.
atStartOfDay
(
ZoneId
.
systemDefault
()).
toInstant
()));
if
(
Objects
.
isNull
(
vehicleModelCalendarPrice
))
{
if
(
festivalDayMap
!=
null
&&
!
festivalDayMap
.
isEmpty
())
{
VehicleModelHolidayPriceDTO
vehicleModelHolidayPriceDTO
=
festivalDayMap
.
get
(
current_date
);
if
(
Objects
.
nonNull
(
vehicleModelHolidayPriceDTO
))
{
vehicle_price
=
vehicle_price
.
multiply
(
new
BigDecimal
(
vehicleModelHolidayPriceDTO
.
getMultiple
().
doubleValue
()
*
(
discount
/
100
)));
free_days
=
vehicleModelHolidayPriceDTO
.
getFreeDays
();
}
}
//处理后延伸的开始时间
AtomicReference
<
Date
>
startReference
=
new
AtomicReference
<>(
startDate
);
//处理后延伸的结束时间
AtomicReference
<
Date
>
endReference
=
new
AtomicReference
<>(
endDate
);
transformStartDateAndEndDate
(
startReference
,
endReference
);
List
<
VehicleModelCalendarPriceDTO
>
vehicleModelCalendarPrice
=
findVehicleModelCalendarPrice
(
startReference
.
get
(),
endReference
.
get
(),
vehicleModelId
,
userId
);
for
(
VehicleModelCalendarPriceDTO
vehicleModelCalendarPriceDTO
:
vehicleModelCalendarPrice
)
{
LocalDate
current_date
=
vehicleModelCalendarPriceDTO
.
getDate
().
toInstant
().
atZone
(
ZoneId
.
systemDefault
()).
toLocalDate
();
boolean
isSelect
=
(
current_date
.
isAfter
(
startLocalDate
)
&&
current_date
.
isBefore
(
endLocalDate
))
||
current_date
.
isEqual
(
startLocalDate
)
||
current_date
.
isEqual
(
endLocalDate
);
if
(
isSelect
)
{
vehicleModelCalendarPriceDTO
.
setIsSelect
(
true
);
}
else
{
switch
(
vehicleModelCalendarPrice
.
getType
())
{
case
VehicleModelPriceType
.
MULTIPLE
:
vehicle_price
=
vehicle_price
.
multiply
(
new
BigDecimal
(
vehicleModelCalendarPrice
.
getMultiple
().
doubleValue
()
*
(
discount
/
100
)));
break
;
case
VehicleModelPriceType
.
ABS
:
vehicle_price
=
vehicleModelCalendarPrice
.
getPrice
().
multiply
(
new
BigDecimal
(
discount
/
100
));
break
;
case
VehicleModelPriceType
.
MEMBER
:
//todo
break
;
default
:
break
;
vehicleModelCalendarPriceDTO
.
setIsSelect
(
false
);
}
free_days
=
vehicleModelCalendarPrice
.
getFreeDays
();
}
}
vehicleModelCalendarPriceDTO
.
setFreeDays
(
free_days
);
vehicleModelCalendarPriceDTO
.
setPrice
(
vehicle_price
);
final_startLocalDate
=
final_startLocalDate
.
plusDays
(
1
);
vehicleModelCalendarPriceDTOS
.
add
(
vehicleModelCalendarPriceDTO
);
}
return
vehicleModelCalendarPriceDTOS
;
return
vehicleModelCalendarPrice
;
}
/**
* 日历价格查询
*
* @param startDate
* @param endDate
* @param vehicleModelId
* @return
*/
public
List
<
VehicleModelCalendarPriceVo
>
listVehicleModelCalendarPriceByDateAndVehicleModelIdAndUserId
(
Date
startDate
,
Date
endDate
,
Integer
vehicleModelId
,
Integer
userId
)
{
List
<
VehicleModelCalendarPriceVo
>
vehicleModelCalendarPriceVos
=
new
ArrayList
<>();
//车型的原价
BigDecimal
vehicle_price
=
new
BigDecimal
(
0
);
public
List
<
VehicleModelCalendarPriceDTO
>
findVehicleModelCalendarPrice
(
Date
startDate
,
Date
endDate
,
Integer
vehicleModelId
,
Integer
userId
)
{
List
<
VehicleModelCalendarPriceDTO
>
vehicleModelCalendarPriceVos
=
new
ArrayList
<>();
//默认折扣
Integer
discount
=
100
;
//默认免费天数
int
free_days
=
1
;
AtomicReference
<
Date
>
startReference
=
new
AtomicReference
<>(
startDate
);
AtomicReference
<
Date
>
endReference
=
new
AtomicReference
<>(
endDate
);
transformStartDateAndEndDate
(
startReference
,
endReference
);
//处理后延伸的开始时间
Date
final_startDate
=
startReference
.
get
();
//处理后延伸的结束时间
Date
final_endDate
=
endReference
.
get
();
//会员默认等级
Integer
memberLevel
=
0
;
//日历价格转map
List
<
VehicleModelCalendarPrice
>
vehicleModelCalendarPrices
=
getVehicleModelCalendarPricesByVehicleModelIdAndDate
(
vehicleModelId
,
final_startDate
,
final_
endDate
);
List
<
VehicleModelCalendarPrice
>
vehicleModelCalendarPrices
=
getVehicleModelCalendarPricesByVehicleModelIdAndDate
(
vehicleModelId
,
startDate
,
endDate
);
Map
<
Date
,
VehicleModelCalendarPrice
>
calendarPriceMap
=
vehicleModelCalendarPrices
.
stream
().
collect
(
Collectors
.
toMap
(
VehicleModelCalendarPrice:
:
getVehicleModelDay
,
Function
.
identity
()));
//节假日转map
List
<
VehicleModelHolidayPriceDTO
>
vehicleModelHolidayPrices
=
vehicleModelHolidayPriceBiz
.
findVehicleModelHolidayPriceByMonth
(
final_startDate
,
final_
endDate
);
List
<
VehicleModelHolidayPriceDTO
>
vehicleModelHolidayPrices
=
vehicleModelHolidayPriceBiz
.
findVehicleModelHolidayPriceByMonth
(
startDate
,
endDate
);
Map
<
Date
,
VehicleModelHolidayPriceDTO
>
festivalDayMap
=
vehicleModelHolidayPrices
.
stream
().
collect
(
Collectors
.
toMap
(
VehicleModelHolidayPriceDTO:
:
getFestivalDay
,
Function
.
identity
()));
Map
<
Integer
,
Integer
>
levelAndDiscountMap
=
userFeign
.
levels
().
stream
().
collect
(
Collectors
.
toMap
(
BaseUserMemberLevel:
:
getLevel
,
BaseUserMemberLevel:
:
getDiscount
));
vehicle_price
=
vehicleModelBiz
.
findVehicleModelPriceByVehicleModelId
(
vehicleModelId
);
//车型的原价
BigDecimal
vehicle_price
=
vehicleModelBiz
.
findVehicleModelPriceByVehicleModelId
(
vehicleModelId
);
if
(
Objects
.
nonNull
(
userId
))
{
BaseUserMember
baseUserMember
=
userFeign
.
findBaseUserMemberByUserId
(
userId
);
discount
=
baseUserMember
==
null
?
discount
:
baseUserMember
.
getDiscount
();
memberLevel
=
baseUserMember
==
null
?
memberLevel
:
baseUserMember
.
getMemberLevel
();
}
VehicleModelCalendarPriceVo
vehicleModelCalendarPriceVo
;
LocalDate
startLocalDate
=
startDate
.
toInstant
().
atZone
(
ZoneId
.
systemDefault
()).
toLocalDate
();
LocalDate
endLocalDate
=
endDate
.
toInstant
().
atZone
(
ZoneId
.
systemDefault
()).
toLocalDate
();
LocalDate
final_startLocalDate
=
final_startDate
.
toInstant
().
atZone
(
ZoneId
.
systemDefault
()).
toLocalDate
();
LocalDate
final_endLocalDate
=
final_endDate
.
toInstant
().
atZone
(
ZoneId
.
systemDefault
()).
toLocalDate
();
VehicleModelCalendarPriceDTO
vehicleModelCalendarPriceDTO
;
LocalDate
final_startLocalDate
=
startDate
.
toInstant
().
atZone
(
ZoneId
.
systemDefault
()).
toLocalDate
();
LocalDate
final_endLocalDate
=
endDate
.
toInstant
().
atZone
(
ZoneId
.
systemDefault
()).
toLocalDate
();
while
(
final_startLocalDate
.
isBefore
(
final_endLocalDate
)
||
final_startLocalDate
.
isEqual
(
final_endLocalDate
))
{
vehicleModelCalendarPrice
Vo
=
new
VehicleModelCalendarPriceVo
();
vehicleModelCalendarPrice
DTO
=
new
VehicleModelCalendarPriceDTO
();
Date
current_date
=
Date
.
from
(
final_startLocalDate
.
atStartOfDay
(
ZoneId
.
systemDefault
()).
toInstant
());
vehicleModelCalendarPriceVo
.
setDate
(
current_date
);
if
(
final_startLocalDate
.
isAfter
(
startLocalDate
)
||
final_startLocalDate
.
isEqual
(
startLocalDate
)
||
final_startLocalDate
.
isEqual
(
endLocalDate
))
{
vehicleModelCalendarPriceVo
.
setIsSelect
(
true
);
}
else
{
vehicleModelCalendarPriceVo
.
setIsSelect
(
false
);
}
vehicleModelCalendarPriceDTO
.
setDate
(
current_date
);
if
(
calendarPriceMap
!=
null
&&
!
calendarPriceMap
.
isEmpty
())
{
VehicleModelCalendarPrice
vehicleModelCalendarPrice
=
calendarPriceMap
.
get
(
current_date
);
if
(
Objects
.
isNull
(
vehicleModelCalendarPrice
))
{
...
...
@@ -283,22 +264,32 @@ public class VehicleModelCalendarPriceBiz extends BaseBiz<VehicleModelCalendarPr
vehicle_price
=
vehicleModelCalendarPrice
.
getPrice
().
multiply
(
new
BigDecimal
(
discount
/
100
));
break
;
case
VehicleModelPriceType
.
MEMBER
:
//todo
memberLevel
=
vehicleModelCalendarPrice
.
getLevel
()
>
memberLevel
?
vehicleModelCalendarPrice
.
getLevel
()
:
memberLevel
;
Integer
level_discount
=
levelAndDiscountMap
.
get
(
memberLevel
);
vehicle_price
=
level_discount
==
null
?
vehicleModelCalendarPrice
.
getPrice
()
:
vehicleModelCalendarPrice
.
getPrice
().
multiply
(
new
BigDecimal
(
level_discount
/
100
));
break
;
default
:
break
;
}
free_days
=
vehicleModelCalendarPrice
.
getFreeDays
();
}
vehicleModelCalendarPrice
Vo
.
setPrice
(
vehicle_price
);
vehicleModelCalendarPrice
Vo
.
set
Days
(
free_days
);
vehicleModelCalendarPrice
DTO
.
setPrice
(
vehicle_price
);
vehicleModelCalendarPrice
DTO
.
setFree
Days
(
free_days
);
}
final_startLocalDate
=
final_startLocalDate
.
plusDays
(
1
);
vehicleModelCalendarPriceVos
.
add
(
vehicleModelCalendarPrice
Vo
);
vehicleModelCalendarPriceVos
.
add
(
vehicleModelCalendarPrice
DTO
);
}
return
vehicleModelCalendarPriceVos
;
}
/**
* 根据时间范围查询
*
* @param vehicleModelId
* @param final_startDate
* @param final_endDate
* @return
*/
private
List
<
VehicleModelCalendarPrice
>
getVehicleModelCalendarPricesByVehicleModelIdAndDate
(
Integer
vehicleModelId
,
Date
final_startDate
,
Date
final_endDate
)
{
Example
example
=
new
Example
(
VehicleModelCalendarPrice
.
class
);
Example
.
Criteria
criteria
=
example
.
createCriteria
();
...
...
@@ -309,6 +300,12 @@ public class VehicleModelCalendarPriceBiz extends BaseBiz<VehicleModelCalendarPr
return
CollectionUtils
.
isEmpty
(
vehicleModelCalendarPrices
)
?
Collections
.
EMPTY_LIST
:
vehicleModelCalendarPrices
;
}
/**
* 时间处理
*
* @param startDatee
* @param endDatee
*/
public
static
void
transformStartDateAndEndDate
(
AtomicReference
<
Date
>
startDatee
,
AtomicReference
<
Date
>
endDatee
)
{
Date
startDate
=
startDatee
.
get
();
Date
endDate
=
endDatee
.
get
();
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/rest/VehicleModelCalendarPriceController.java
View file @
7be3c65d
...
...
@@ -3,7 +3,7 @@ package com.xxfc.platform.vehicle.rest;
import
com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.xxfc.platform.vehicle.biz.VehicleModelCalendarPriceBiz
;
import
com.xxfc.platform.vehicle.pojo.
vo.VehicleModelCalendarPriceVo
;
import
com.xxfc.platform.vehicle.pojo.
dto.VehicleModelCalendarPriceDTO
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.RequiredArgsConstructor
;
...
...
@@ -30,11 +30,11 @@ public class VehicleModelCalendarPriceController {
@ApiOperation
(
"返回车型日历价格"
)
@GetMapping
(
"/list/vehicle_model/calendar_price/{vehicleModelId}/{type}"
)
public
ObjectRestResponse
<
VehicleModelCalendarPrice
Vo
>
listVehicleModelCalendarPriceByDateAndVehicleModelId
(
@RequestParam
(
value
=
"start"
,
required
=
false
)
Date
startDate
,
public
ObjectRestResponse
<
VehicleModelCalendarPrice
DTO
>
listVehicleModelCalendarPriceByDateAndVehicleModelId
(
@RequestParam
(
value
=
"start"
,
required
=
false
)
Date
startDate
,
@RequestParam
(
value
=
"end"
,
required
=
false
)
Date
endDate
,
@PathVariable
(
value
=
"vehicleModelId"
)
Integer
vehicleModelId
,
AppUserDTO
appUserDTO
){
List
<
VehicleModelCalendarPrice
Vo
>
vehicleModelCalendarPriceVos
=
vehicleModelCalendarPriceBiz
.
listVehicleModelCalendarPriceByDateAndVehicleModelIdAndUserId
(
startDate
,
endDate
,
vehicleModelId
,
appUserDTO
.
getUserid
());
List
<
VehicleModelCalendarPrice
DTO
>
vehicleModelCalendarPriceVos
=
vehicleModelCalendarPriceBiz
.
listVehicleModelCalendarPriceByDateAndVehicleModelIdAndUserId
(
startDate
,
endDate
,
vehicleModelId
,
appUserDTO
.
getUserid
());
return
ObjectRestResponse
.
succ
(
vehicleModelCalendarPriceVos
);
}
}
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