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
530baae6
Commit
530baae6
authored
Jun 12, 2019
by
周健威
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改热门检索
parent
1a93d8ac
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
62 additions
and
10 deletions
+62
-10
VehicleModel.java
...n/java/com/xxfc/platform/vehicle/entity/VehicleModel.java
+3
-1
HotVeicleDTO.java
...ain/java/com/xxfc/platform/vehicle/pojo/HotVeicleDTO.java
+25
-0
UsableVeicleDTO.java
.../java/com/xxfc/platform/vehicle/pojo/UsableVeicleDTO.java
+0
-3
VehicleBiz.java
...c/main/java/com/xxfc/platform/vehicle/biz/VehicleBiz.java
+17
-6
VehicleController.java
...ava/com/xxfc/platform/vehicle/rest/VehicleController.java
+14
-0
VehicleMapper.xml
...ehicle-server/src/main/resources/mapper/VehicleMapper.xml
+3
-0
No files found.
xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/entity/VehicleModel.java
View file @
530baae6
...
...
@@ -111,6 +111,8 @@ public class VehicleModel implements Serializable {
@Column
(
name
=
"score"
)
@ApiModelProperty
(
value
=
"评分"
)
private
Integer
score
;
@Column
(
name
=
"热度标记,1--热门;2--非热门"
)
@ApiModelProperty
(
value
=
"热度标记,1--热门;2--非热门"
)
Integer
hotSign
;
}
xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/pojo/HotVeicleDTO.java
0 → 100644
View file @
530baae6
package
com
.
xxfc
.
platform
.
vehicle
.
pojo
;
import
com.github.wxiaoqi.security.common.vo.PageParam
;
import
com.xxfc.platform.vehicle.entity.VehiclePlatCata
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.time.Instant
;
import
java.time.LocalDateTime
;
import
java.time.ZoneOffset
;
import
java.time.format.DateTimeFormatter
;
import
java.util.List
;
import
java.util.Map
;
@Data
public
class
HotVeicleDTO
extends
PageParam
{
@ApiModelProperty
(
"城市"
)
Integer
addrCity
;
@ApiModelProperty
(
"经度"
)
Double
lon
;
@ApiModelProperty
(
"纬度"
)
Double
lat
;
@ApiModelProperty
(
hidden
=
true
)
Integer
hotSign
;
}
\ No newline at end of file
xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/pojo/UsableVeicleDTO.java
View file @
530baae6
...
...
@@ -39,9 +39,6 @@ public class UsableVeicleDTO extends PageParam {
@ApiModelProperty
(
value
=
"分类列表"
,
hidden
=
true
)
Map
<
Integer
,
List
<
VehiclePlatCata
>>
catas
;
// @ApiModelProperty(value = "一级分类列表", hidden = true)
// Map<Integer, List<VehiclePlatCata>> pCatas;
public
void
setStartDateTamp
(
Long
startDateTamp
)
{
this
.
startDateTamp
=
startDateTamp
;
this
.
startDate
=
DEFAULT_DATE_TIME_FORMATTER
.
format
(
LocalDateTime
.
ofInstant
(
Instant
.
ofEpochMilli
(
startDateTamp
),
ZoneOffset
.
ofHours
(
8
)));
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/VehicleBiz.java
View file @
530baae6
package
com
.
xxfc
.
platform
.
vehicle
.
biz
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.util.StrUtil
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
...
...
@@ -838,6 +839,19 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> {
public
PageDataVO
<
UsableVehicleModelVO
>
searchUsableModel
(
UsableVeicleDTO
dto
){
Map
<
String
,
Object
>
params
=
BeanUtil
.
beanToMap
(
dto
);
if
(
StrUtil
.
isNotBlank
(
dto
.
getStartDate
())
&&
StrUtil
.
isNotBlank
(
dto
.
getEndDate
()))
{
initBookSearchParam
(
dto
,
params
);
}
return
PageDataVO
.
pageInfo
(
dto
.
getPage
(),
dto
.
getLimit
(),
()
->
mapper
.
searchUsableModel
(
params
));
}
public
PageDataVO
<
UsableVehicleModelVO
>
hotModel
(
HotVeicleDTO
dto
){
dto
.
setHotSign
(
1
);
Map
<
String
,
Object
>
params
=
BeanUtil
.
beanToMap
(
dto
);
return
PageDataVO
.
pageInfo
(
dto
.
getPage
(),
dto
.
getLimit
(),
()
->
mapper
.
searchUsableModel
(
params
));
}
private
void
initBookSearchParam
(
UsableVeicleDTO
dto
,
Map
<
String
,
Object
>
params
)
{
List
<
String
>
notBookedDates
=
Lists
.
newArrayList
();
if
(
StringUtils
.
isNotBlank
(
dto
.
getStartDate
())&&
StringUtils
.
isNotBlank
(
dto
.
getEndDate
()))
{
...
...
@@ -847,8 +861,9 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> {
//若传入预定信息查询条件,则查询对应月份预定信息查询条件(不超过3个月)
if
(
CollectionUtils
.
isEmpty
(
notBookedDates
)){
//return
;
throw
new
BaseException
(
ResultCode
.
NOTEXIST_CODE
)
;
}
//筛选出查询条件所在月份
Set
<
String
>
allYearMonth
=
new
HashSet
<>();
//记录所有年月
Map
<
String
,
List
<
String
>>
yearMonthAndDate
=
new
HashMap
<>();
//预定年月 - 预定日期列表
...
...
@@ -857,13 +872,9 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> {
if
(
allYearMonth
.
size
()>
MAX_MONTH_COUNT_BOOKED_INFO_QUERY
){
throw
new
CustomIllegalParamException
(
" only 3 month can be included <bookedInfo> param."
);
}
//加入预定信息查询条件
fillBookedDateSearchParam
(
params
,
yearMonthAndDate
,
yearMonthAndDateNotBooked
);
PageHelper
.
startPage
(
dto
.
getPage
(),
dto
.
getLimit
());
List
<
UsableVehicleModelVO
>
lists
=
mapper
.
searchUsableModel
(
params
);
PageInfo
<
UsableVehicleModelVO
>
usableVehicleInfo
=
new
PageInfo
<>(
lists
);
return
PageDataVO
.
pageInfo
(
usableVehicleInfo
);
}
public
PageDataVO
<
Vehicle
>
searchUsableVehicle
(
RentVehicleBookDTO
dto
){
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/rest/VehicleController.java
View file @
530baae6
...
...
@@ -299,6 +299,19 @@ public class VehicleController extends BaseController<VehicleBiz> {
return
new
ObjectRestResponse
<>().
data
(
vehicleBiz
.
searchUsableModel
(
dto
)).
rel
(
true
);
}
/**
* 热门车型
*
* @param dto
* @return
*/
@ApiOperation
(
"热门车型"
)
@RequestMapping
(
value
=
"/rent/hot-vehicle"
,
method
=
RequestMethod
.
GET
)
@IgnoreUserToken
public
ObjectRestResponse
<
PageDataVO
<
UsableVehicleModelVO
>>
hotVehicle
(
HotVeicleDTO
dto
)
throws
Exception
{
return
ObjectRestResponse
.
succ
(
vehicleBiz
.
hotModel
(
dto
));
}
/**
* 租车触发的申请预定车辆
*
...
...
@@ -329,4 +342,5 @@ public class VehicleController extends BaseController<VehicleBiz> {
return
ObjectRestResponse
.
succ
(
bookVehicleVo
.
getVehicle
());
}
}
xx-vehicle/xx-vehicle-server/src/main/resources/mapper/VehicleMapper.xml
View file @
530baae6
...
...
@@ -322,6 +322,9 @@
<if
test=
" addrCity != null "
>
and bc.addr_city = #{addrCity}
</if>
<if
test=
" hotSign != null "
>
and vm.hot_sign = #{hotSign}
</if>
</where>
</sql>
...
...
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