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
7b982fef
Commit
7b982fef
authored
Aug 28, 2019
by
hezhen
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' of
http://113.105.137.151:22280/youjj/cloud-platform
into dev
# Conflicts: # xx-uccn/xx-uccn-server/pom.xml
parents
c802500d
987a0e2c
Changes
21
Hide whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
369 additions
and
128 deletions
+369
-128
Banner.java
...pi/src/main/java/com/xxfc/platform/app/entity/Banner.java
+5
-0
BannerBiz.java
...er/src/main/java/com/xxfc/platform/app/biz/BannerBiz.java
+4
-31
BannerMapper.java
.../main/java/com/xxfc/platform/app/mapper/BannerMapper.java
+2
-2
BannerController.java
...ain/java/com/xxfc/platform/app/rest/BannerController.java
+10
-7
BannerAdminController.java
...m/xxfc/platform/app/rest/admin/BannerAdminController.java
+32
-25
BannerMapper.xml
.../xx-app-server/src/main/resources/mapper/BannerMapper.xml
+4
-0
CampsiteFeign.java
.../java/com/xxfc/platform/campsite/feign/CampsiteFeign.java
+27
-6
CampsiteShopBiz.java
.../java/com/xxfc/platform/campsite/biz/CampsiteShopBiz.java
+7
-5
CampsiteShopController.java
...m/xxfc/platform/campsite/rest/CampsiteShopController.java
+3
-1
RandomListDto.java
...c/main/java/com/xxfc/platform/uccn/dto/RandomListDto.java
+23
-0
SummitActivityDTO.java
...in/java/com/xxfc/platform/uccn/dto/SummitActivityDTO.java
+0
-15
TypeEnum.java
...api/src/main/java/com/xxfc/platform/uccn/vo/TypeEnum.java
+43
-0
pom.xml
xx-uccn/xx-uccn-server/pom.xml
+6
-0
RandomListBiz.java
...c/main/java/com/xxfc/platform/uccn/biz/RandomListBiz.java
+54
-0
SummitActivityBiz.java
...in/java/com/xxfc/platform/uccn/biz/SummitActivityBiz.java
+49
-9
CampsiteUccnController.java
...a/com/xxfc/platform/uccn/rest/CampsiteUccnController.java
+50
-0
SummitActivityController.java
...com/xxfc/platform/uccn/rest/SummitActivityController.java
+3
-3
VehicleModelController.java
...a/com/xxfc/platform/uccn/rest/VehicleModelController.java
+4
-2
VehicleActiveService.java
...a/com/xxfc/platform/vehicle/biz/VehicleActiveService.java
+14
-6
VehicleBiz.java
...c/main/java/com/xxfc/platform/vehicle/biz/VehicleBiz.java
+9
-1
VehicleMapper.xml
...ehicle-server/src/main/resources/mapper/VehicleMapper.xml
+20
-15
No files found.
xx-app/xx-app-api/src/main/java/com/xxfc/platform/app/entity/Banner.java
View file @
7b982fef
...
@@ -105,4 +105,9 @@ public class Banner {
...
@@ -105,4 +105,9 @@ public class Banner {
* 位置 banner位置0 所有 1:推荐 2:拍拍 3:短视频 4:问答
* 位置 banner位置0 所有 1:推荐 2:拍拍 3:短视频 4:问答
*/
*/
private
Integer
location
;
private
Integer
location
;
/**
* 平台 0:APP 1:欣欣房车官网 2:滴房车官网
*/
private
Integer
platform
;
}
}
xx-app/xx-app-server/src/main/java/com/xxfc/platform/app/biz/BannerBiz.java
View file @
7b982fef
...
@@ -21,20 +21,9 @@ import java.util.List;
...
@@ -21,20 +21,9 @@ import java.util.List;
@Service
@Service
public
class
BannerBiz
extends
BaseBiz
<
BannerMapper
,
Banner
>
{
public
class
BannerBiz
extends
BaseBiz
<
BannerMapper
,
Banner
>
{
/* @CacheClear(key = RedisKey.CONSTANT_CODE_PREFIX_BANNER)
public
List
<
BannerVo
>
findBannerList
(
Integer
type
,
Integer
location
,
Integer
platform
)
{
public void update(Banner banner) {
this.updateSelectiveById(banner);
}
@CacheClear(key = RedisKey.CONSTANT_CODE_PREFIX_BANNER)
public void remove(int id) {
this.deleteById(id);
}*/
public
List
<
BannerVo
>
findBannerList
(
Integer
type
,
Integer
location
)
{
List
<
BannerVo
>
bannerVos
=
new
ArrayList
<>();
List
<
BannerVo
>
bannerVos
=
new
ArrayList
<>();
List
<
Banner
>
banners
=
mapper
.
findBannerListByType
(
type
,
location
);
List
<
Banner
>
banners
=
mapper
.
findBannerListByType
(
type
,
location
,
platform
);
banners
.
forEach
(
banner
->
{
banners
.
forEach
(
banner
->
{
BannerVo
bannerVo
=
new
BannerVo
();
BannerVo
bannerVo
=
new
BannerVo
();
bannerVo
.
setCover
(
banner
.
getCover
());
bannerVo
.
setCover
(
banner
.
getCover
());
...
@@ -46,30 +35,14 @@ public class BannerBiz extends BaseBiz<BannerMapper,Banner> {
...
@@ -46,30 +35,14 @@ public class BannerBiz extends BaseBiz<BannerMapper,Banner> {
return
bannerVos
;
return
bannerVos
;
}
}
/*
*/
/**
* 更改banner信息
* @param banner
* @param userInfo
* @return
*//*
public int update(Banner banner, UserDTO userInfo) {
banner.setUpdName(userInfo.getUsername());
banner.setUpdTime(Instant.now().toEpochMilli());
return mapper.updateByPrimaryKeySelective(banner);
}
*/
/**
/**
* 分页查询banner
* 分页查询banner
* @param pageNo
* @param pageNo
* @param pageSize
* @param pageSize
* @return
* @return
*/
*/
public
PageDataVO
<
Banner
>
findBannePage
(
Integer
pageNo
,
Integer
pageSize
)
{
public
PageDataVO
<
Banner
>
findBannePage
(
Integer
pageNo
,
Integer
pageSize
,
Integer
platform
)
{
return
PageDataVO
.
pageInfo
(
pageNo
,
pageSize
,
()
->
mapper
.
findBannerListByisDelOrderByRank
(
Banner
.
builder
().
isDel
(
0
).
build
()));
return
PageDataVO
.
pageInfo
(
pageNo
,
pageSize
,
()
->
mapper
.
findBannerListByisDelOrderByRank
(
Banner
.
builder
().
isDel
(
0
).
platform
(
platform
).
build
()));
}
}
/**
/**
...
...
xx-app/xx-app-server/src/main/java/com/xxfc/platform/app/mapper/BannerMapper.java
View file @
7b982fef
...
@@ -19,10 +19,10 @@ import java.util.List;
...
@@ -19,10 +19,10 @@ import java.util.List;
@Repository
@Repository
public
interface
BannerMapper
extends
Mapper
<
Banner
>
{
public
interface
BannerMapper
extends
Mapper
<
Banner
>
{
@Select
(
"select * from `banner` where is_del=#{isDel} order by rank ASC"
)
@Select
(
"select * from `banner` where is_del=#{isDel}
and `platform`=#{platform}
order by rank ASC"
)
List
<
Banner
>
findBannerListByisDelOrderByRank
(
Banner
banner
);
List
<
Banner
>
findBannerListByisDelOrderByRank
(
Banner
banner
);
List
<
Banner
>
findBannerListByType
(
@Param
(
"type"
)
Integer
type
,
@Param
(
"location"
)
Integer
location
);
List
<
Banner
>
findBannerListByType
(
@Param
(
"type"
)
Integer
type
,
@Param
(
"location"
)
Integer
location
,
@Param
(
"platform"
)
Integer
platform
);
}
}
xx-app/xx-app-server/src/main/java/com/xxfc/platform/app/rest/BannerController.java
View file @
7b982fef
...
@@ -21,19 +21,22 @@ import java.util.List;
...
@@ -21,19 +21,22 @@ import java.util.List;
@RequestMapping
(
"/banner"
)
@RequestMapping
(
"/banner"
)
public
class
BannerController
{
public
class
BannerController
{
@Autowired
@Autowired
private
BannerBiz
bannerBiz
;
private
BannerBiz
bannerBiz
;
/**
/**
*查询banner图
* 查询banner图
*
* @return
* @return
*/
*/
@GetMapping
(
"/app/unauth/findBannerlist"
)
@GetMapping
(
"/app/unauth/findBannerlist"
)
public
ObjectRestResponse
findBannerlist
(
@RequestParam
(
"type"
)
Integer
type
,
@RequestParam
(
required
=
false
,
value
=
"location"
)
Integer
location
){
public
ObjectRestResponse
findBannerlist
(
@RequestParam
(
value
=
"type"
)
Integer
type
,
if
(
type
==
null
)
{
@RequestParam
(
required
=
false
,
value
=
"location"
)
Integer
location
,
@RequestParam
(
value
=
"platform"
,
required
=
false
,
defaultValue
=
"0"
)
Integer
platform
)
{
if
(
type
==
null
)
{
return
ObjectRestResponse
.
createDefaultFail
();
return
ObjectRestResponse
.
createDefaultFail
();
}
}
List
<
BannerVo
>
bannerList
=
bannerBiz
.
findBannerList
(
type
,
location
);
List
<
BannerVo
>
bannerList
=
bannerBiz
.
findBannerList
(
type
,
location
,
platform
);
return
ObjectRestResponse
.
succ
(
bannerList
);
return
ObjectRestResponse
.
succ
(
bannerList
);
}
}
}
}
xx-app/xx-app-server/src/main/java/com/xxfc/platform/app/rest/admin/BannerAdminController.java
View file @
7b982fef
...
@@ -21,22 +21,23 @@ import org.springframework.web.bind.annotation.*;
...
@@ -21,22 +21,23 @@ import org.springframework.web.bind.annotation.*;
*/
*/
@RestController
@RestController
@RequestMapping
(
"/admin/banner"
)
@RequestMapping
(
"/admin/banner"
)
@Api
(
value
=
"banner后台接口"
,
tags
=
"banner后台接口"
)
@Api
(
value
=
"banner后台接口"
,
tags
=
"banner后台接口"
)
public
class
BannerAdminController
{
public
class
BannerAdminController
{
@Autowired
@Autowired
private
BannerBiz
bannerBiz
;
private
BannerBiz
bannerBiz
;
/**
/**
* 修改
* 修改
*
* @param banner
* @param banner
* @return
* @return
*/
*/
@PutMapping
@PutMapping
@ApiOperation
(
value
=
"banner修改"
,
notes
=
"修改"
)
@ApiOperation
(
value
=
"banner修改"
,
notes
=
"修改"
)
public
ObjectRestResponse
<
Banner
>
update
(
@RequestBody
Banner
banner
,
UserDTO
userInfo
){
public
ObjectRestResponse
<
Banner
>
update
(
@RequestBody
Banner
banner
,
UserDTO
userInfo
)
{
int
effectRows
=
bannerBiz
.
save
(
banner
,
userInfo
);
int
effectRows
=
bannerBiz
.
save
(
banner
,
userInfo
);
if
(
effectRows
>
0
)
{
if
(
effectRows
>
0
)
{
return
ObjectRestResponse
.
succ
();
return
ObjectRestResponse
.
succ
();
}
}
return
ObjectRestResponse
.
createDefaultFail
();
return
ObjectRestResponse
.
createDefaultFail
();
...
@@ -44,47 +45,51 @@ public class BannerAdminController {
...
@@ -44,47 +45,51 @@ public class BannerAdminController {
/**
/**
* 根据id查询banner
* 根据id查询banner
*
* @param id
* @param id
* @return
* @return
*/
*/
@GetMapping
(
"/{id}"
)
@GetMapping
(
"/{id}"
)
@ApiOperation
(
value
=
"根据id查询banner图"
,
notes
=
"根据id查询banner图"
)
@ApiOperation
(
value
=
"根据id查询banner图"
,
notes
=
"根据id查询banner图"
)
public
ObjectRestResponse
<
Banner
>
findBannerById
(
@PathVariable
Integer
id
){
public
ObjectRestResponse
<
Banner
>
findBannerById
(
@PathVariable
Integer
id
)
{
Banner
Banner
=
bannerBiz
.
selectById
(
id
);
Banner
Banner
=
bannerBiz
.
selectById
(
id
);
return
ObjectRestResponse
.
succ
(
Banner
);
return
ObjectRestResponse
.
succ
(
Banner
);
}
}
/**
/**
* 分页查询banner
* 分页查询banner
*
* @param pageNo
* @param pageNo
* @param pageSize
* @param pageSize
* @return
* @return
*/
*/
@GetMapping
(
"/page"
)
@GetMapping
(
"/page"
)
@ApiOperation
(
value
=
"banner分页查询"
,
notes
=
"banner分页查询"
)
@ApiOperation
(
value
=
"banner分页查询"
,
notes
=
"banner分页查询"
)
@ApiImplicitParams
(
value
=
{
@ApiImplicitParams
(
value
=
{
@ApiImplicitParam
(
name
=
"pageNo"
,
paramType
=
"query"
,
required
=
false
,
dataType
=
"integer"
,
defaultValue
=
"0"
),
@ApiImplicitParam
(
name
=
"pageNo"
,
paramType
=
"query"
,
required
=
false
,
dataType
=
"integer"
,
defaultValue
=
"0"
),
@ApiImplicitParam
(
name
=
"pageSize"
,
paramType
=
"query"
,
required
=
false
,
dataType
=
"integer"
,
defaultValue
=
"10"
)
@ApiImplicitParam
(
name
=
"pageSize"
,
paramType
=
"query"
,
required
=
false
,
dataType
=
"integer"
,
defaultValue
=
"10"
)
})
})
public
ObjectRestResponse
<
PageDataVO
>
findBannerPage
(
@RequestParam
(
name
=
"pageNo"
,
defaultValue
=
"0"
,
required
=
false
)
Integer
pageNo
,
public
ObjectRestResponse
<
PageDataVO
>
findBannerPage
(
@RequestParam
(
name
=
"pageNo"
,
defaultValue
=
"0"
,
required
=
false
)
Integer
pageNo
,
@RequestParam
(
name
=
"pageSize"
,
defaultValue
=
"10"
,
required
=
false
)
Integer
pageSize
){
@RequestParam
(
name
=
"pageSize"
,
defaultValue
=
"10"
,
required
=
false
)
Integer
pageSize
,
@RequestParam
(
name
=
"platform"
,
defaultValue
=
"0"
,
required
=
false
)
Integer
platform
)
{
PageDataVO
<
Banner
>
pageDataVO
=
bannerBiz
.
findBannePage
(
pageNo
,
pageSize
);
PageDataVO
<
Banner
>
pageDataVO
=
bannerBiz
.
findBannePage
(
pageNo
,
pageSize
,
platform
);
return
ObjectRestResponse
.
succ
(
pageDataVO
);
return
ObjectRestResponse
.
succ
(
pageDataVO
);
}
}
/**
/**
* 保存banner
* 保存banner
*
* @param banner
* @param banner
* @return
* @return
*/
*/
@ApiOperation
(
value
=
"banner保存"
,
notes
=
"banner保存"
)
@ApiOperation
(
value
=
"banner保存"
,
notes
=
"banner保存"
)
@PostMapping
@PostMapping
public
ObjectRestResponse
<
Void
>
saveBanner
(
@RequestBody
Banner
banner
,
UserDTO
userDTO
)
{
public
ObjectRestResponse
<
Void
>
saveBanner
(
@RequestBody
Banner
banner
,
UserDTO
userDTO
)
{
banner
.
setIsDel
(
0
);
banner
.
setIsDel
(
0
);
int
effectRows
=
bannerBiz
.
save
(
banner
,
userDTO
);
int
effectRows
=
bannerBiz
.
save
(
banner
,
userDTO
);
if
(
effectRows
>
0
)
{
if
(
effectRows
>
0
)
{
return
ObjectRestResponse
.
succ
();
return
ObjectRestResponse
.
succ
();
}
}
return
ObjectRestResponse
.
createDefaultFail
();
return
ObjectRestResponse
.
createDefaultFail
();
...
@@ -93,14 +98,15 @@ public class BannerAdminController {
...
@@ -93,14 +98,15 @@ public class BannerAdminController {
/**
/**
* 逻辑删除
* 逻辑删除
*
* @param id
* @param id
* @return
* @return
*/
*/
@DeleteMapping
(
"/{id}"
)
@DeleteMapping
(
"/{id}"
)
@ApiOperation
(
value
=
"banner逻辑删除"
,
notes
=
"banner逻辑删除"
)
@ApiOperation
(
value
=
"banner逻辑删除"
,
notes
=
"banner逻辑删除"
)
public
ObjectRestResponse
<
Void
>
deleteBannerById
(
@PathVariable
Integer
id
,
UserDTO
userDTO
)
{
public
ObjectRestResponse
<
Void
>
deleteBannerById
(
@PathVariable
Integer
id
,
UserDTO
userDTO
)
{
int
effectRows
=
bannerBiz
.
updateBannerStatus
(
id
,
1
,
userDTO
);
int
effectRows
=
bannerBiz
.
updateBannerStatus
(
id
,
1
,
userDTO
);
if
(
effectRows
>
0
)
{
if
(
effectRows
>
0
)
{
return
ObjectRestResponse
.
succ
();
return
ObjectRestResponse
.
succ
();
}
}
return
ObjectRestResponse
.
createDefaultFail
();
return
ObjectRestResponse
.
createDefaultFail
();
...
@@ -108,11 +114,12 @@ public class BannerAdminController {
...
@@ -108,11 +114,12 @@ public class BannerAdminController {
/**
/**
* 真实删除
* 真实删除
*
* @param id
* @param id
* @return
* @return
*/
*/
@DeleteMapping
(
"/del/{id}"
)
@DeleteMapping
(
"/del/{id}"
)
public
ObjectRestResponse
<
Void
>
deleteReallyBannerById
(
@PathVariable
(
value
=
"id"
)
Integer
id
){
public
ObjectRestResponse
<
Void
>
deleteReallyBannerById
(
@PathVariable
(
value
=
"id"
)
Integer
id
)
{
bannerBiz
.
deleteById
(
id
);
bannerBiz
.
deleteById
(
id
);
return
ObjectRestResponse
.
succ
();
return
ObjectRestResponse
.
succ
();
}
}
...
...
xx-app/xx-app-server/src/main/resources/mapper/BannerMapper.xml
View file @
7b982fef
...
@@ -15,6 +15,7 @@
...
@@ -15,6 +15,7 @@
<result
property=
"url"
column=
"url"
/>
<result
property=
"url"
column=
"url"
/>
<result
property=
"isDel"
column=
"is_del"
/>
<result
property=
"isDel"
column=
"is_del"
/>
<result
property=
"location"
column=
"location"
/>
<result
property=
"location"
column=
"location"
/>
<result
property=
"platform"
column=
"platform"
/>
</resultMap>
</resultMap>
<select
id=
"findBannerListByType"
resultMap=
"bannerMap"
>
<select
id=
"findBannerListByType"
resultMap=
"bannerMap"
>
...
@@ -22,6 +23,9 @@
...
@@ -22,6 +23,9 @@
<if
test=
"location != null"
>
<if
test=
"location != null"
>
and `location`=#{location}
and `location`=#{location}
</if>
</if>
<if
test=
"platform != null"
>
and `platform`=#{platform}
</if>
order by rank asc
order by rank asc
</select>
</select>
</mapper>
</mapper>
\ No newline at end of file
xx-campsite/xx-campsite-api/src/main/java/com/xxfc/platform/campsite/feign/CampsiteFeign.java
View file @
7b982fef
...
@@ -3,6 +3,9 @@ package com.xxfc.platform.campsite.feign;
...
@@ -3,6 +3,9 @@ package com.xxfc.platform.campsite.feign;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.vo.GoodDataVO
;
import
com.github.wxiaoqi.security.common.vo.GoodDataVO
;
import
com.github.wxiaoqi.security.common.vo.PageDataVO
;
import
com.xxfc.platform.campsite.vo.CampsiteShopDetailVo
;
import
com.xxfc.platform.campsite.vo.CampsiteShopPageVo
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
...
@@ -14,13 +17,31 @@ import java.util.List;
...
@@ -14,13 +17,31 @@ import java.util.List;
* Created by ace on 2017/9/15.
* Created by ace on 2017/9/15.
*/
*/
//@FeignClient(value = "${auth.serviceId}",configuration = {})
//@FeignClient(value = "${auth.serviceId}",configuration = {})
@FeignClient
(
"xx-campsite
"
)
@FeignClient
(
name
=
"xx-campsite"
,
path
=
"/campsiteShop
"
)
public
interface
CampsiteFeign
{
public
interface
CampsiteFeign
{
@ApiOperation
(
"首页营地列表"
)
@ApiOperation
(
"首页营地列表"
)
@GetMapping
(
value
=
"/campsiteShop/app/shopList"
)
@GetMapping
(
value
=
"/app/shopList"
)
public
List
<
GoodDataVO
>
goodList
(
@RequestParam
(
value
=
"page"
,
defaultValue
=
"1"
)
Integer
page
,
List
<
GoodDataVO
>
goodList
(
@RequestParam
(
value
=
"page"
,
defaultValue
=
"1"
)
Integer
page
,
@RequestParam
(
value
=
"limit"
,
defaultValue
=
"4"
)
Integer
limit
);
@RequestParam
(
value
=
"limit"
,
defaultValue
=
"4"
)
Integer
limit
);
@GetMapping
(
value
=
"/campsiteShop/app/unauth/findRandomVehicle"
)
public
ObjectRestResponse
findRandomVehicle
(
@RequestParam
(
value
=
"number"
)
Integer
number
);
@GetMapping
(
value
=
"/app/unauth/findRandomVehicle"
)
ObjectRestResponse
findRandomVehicle
(
@RequestParam
(
value
=
"number"
)
Integer
number
);
@ApiOperation
(
"分页查询营地列表"
)
@GetMapping
(
"/app/unauth/shops"
)
ObjectRestResponse
<
PageDataVO
<
CampsiteShopPageVo
>>
findCampsiteShopPageByType
(
@RequestParam
(
value
=
"type"
,
required
=
false
)
Integer
type
,
@RequestParam
(
value
=
"pageNo"
,
required
=
false
,
defaultValue
=
"1"
)
Integer
pageNo
,
@RequestParam
(
value
=
"pageSize"
,
required
=
false
,
defaultValue
=
"6"
)
Integer
pageSize
);
/**
* @param longitude 经度
* @param latitude 纬度
* @return
*/
@ApiOperation
(
"查询营地详情"
)
@GetMapping
(
"/app/unauth/shop"
)
ObjectRestResponse
<
CampsiteShopDetailVo
>
findCampsiteShopDetailById
(
@RequestParam
(
value
=
"id"
)
Integer
id
,
@RequestParam
(
value
=
"longitude"
,
required
=
false
)
Double
longitude
,
@RequestParam
(
value
=
"latitude"
,
required
=
false
)
Double
latitude
);
}
}
xx-campsite/xx-campsite-server/src/main/java/com/xxfc/platform/campsite/biz/CampsiteShopBiz.java
View file @
7b982fef
...
@@ -164,12 +164,14 @@ public class CampsiteShopBiz extends BaseBiz<CampsiteShopMapper, CampsiteShop> {
...
@@ -164,12 +164,14 @@ public class CampsiteShopBiz extends BaseBiz<CampsiteShopMapper, CampsiteShop> {
}
}
campsiteShopDetailVo
.
setTypeNames
(
shopTagDTOS
==
null
?
Collections
.
EMPTY_LIST
:
shopTagDTOS
.
stream
().
map
(
CampsiteShopTagDTO:
:
getName
).
collect
(
Collectors
.
toList
()));
campsiteShopDetailVo
.
setTypeNames
(
shopTagDTOS
==
null
?
Collections
.
EMPTY_LIST
:
shopTagDTOS
.
stream
().
map
(
CampsiteShopTagDTO:
:
getName
).
collect
(
Collectors
.
toList
()));
//根据经纬度算距离
//根据经纬度算距离
if
(
campsiteShopDetailDTO
.
getLongitude
()
!=
null
&&
campsiteShopDetailDTO
.
getLatitude
()
!=
null
)
{
if
(
Objects
.
nonNull
(
latitude
)
&&
Objects
.
nonNull
(
longitude
))
{
double
distance
=
getDistance
(
campsiteShopDetailDTO
.
getLongitude
(),
campsiteShopDetailDTO
.
getLatitude
(),
longitude
,
latitude
);
if
(
campsiteShopDetailDTO
.
getLongitude
()
!=
null
&&
campsiteShopDetailDTO
.
getLatitude
()
!=
null
)
{
if
(
log
.
isDebugEnabled
())
{
double
distance
=
getDistance
(
campsiteShopDetailDTO
.
getLongitude
(),
campsiteShopDetailDTO
.
getLatitude
(),
longitude
,
latitude
);
log
.
debug
(
"根据店铺经度=【{}】,纬度=【{}】和自己所在位置的经度=【{}】,纬度=【{}】计算出的距离:【{}km】"
,
campsiteShopDetailDTO
.
getLongitude
(),
campsiteShopDetailDTO
.
getLatitude
(),
longitude
,
latitude
,
distance
);
if
(
log
.
isDebugEnabled
())
{
log
.
debug
(
"根据店铺经度=【{}】,纬度=【{}】和自己所在位置的经度=【{}】,纬度=【{}】计算出的距离:【{}km】"
,
campsiteShopDetailDTO
.
getLongitude
(),
campsiteShopDetailDTO
.
getLatitude
(),
longitude
,
latitude
,
distance
);
}
campsiteShopDetailVo
.
setDistance
(
String
.
format
(
"%.1f"
,
distance
));
}
}
campsiteShopDetailVo
.
setDistance
(
String
.
format
(
"%.1f"
,
distance
));
}
}
campsiteValueOperations
.
set
(
String
.
format
(
"%s%d"
,
CAMSITE_DETAIL_CACHE_PREKEY
,
id
),
JSONObject
.
toJSONString
(
campsiteShopDetailVo
));
campsiteValueOperations
.
set
(
String
.
format
(
"%s%d"
,
CAMSITE_DETAIL_CACHE_PREKEY
,
id
),
JSONObject
.
toJSONString
(
campsiteShopDetailVo
));
return
campsiteShopDetailVo
;
return
campsiteShopDetailVo
;
...
...
xx-campsite/xx-campsite-server/src/main/java/com/xxfc/platform/campsite/rest/CampsiteShopController.java
View file @
7b982fef
...
@@ -48,7 +48,9 @@ public class CampsiteShopController extends BaseController<CampsiteShopBiz, Camp
...
@@ -48,7 +48,9 @@ public class CampsiteShopController extends BaseController<CampsiteShopBiz, Camp
*/
*/
@ApiOperation
(
"查询营地详情"
)
@ApiOperation
(
"查询营地详情"
)
@GetMapping
(
"/app/unauth/shop"
)
@GetMapping
(
"/app/unauth/shop"
)
public
ObjectRestResponse
<
CampsiteShopDetailVo
>
findCampsiteShopDetailById
(
@RequestParam
(
"id"
)
Integer
id
,
@RequestParam
(
"longitude"
)
Double
longitude
,
@RequestParam
(
"latitude"
)
Double
latitude
)
{
public
ObjectRestResponse
<
CampsiteShopDetailVo
>
findCampsiteShopDetailById
(
@RequestParam
(
value
=
"id"
)
Integer
id
,
@RequestParam
(
value
=
"longitude"
,
required
=
false
)
Double
longitude
,
@RequestParam
(
value
=
"latitude"
,
required
=
false
)
Double
latitude
)
{
CampsiteShopDetailVo
campsiteShopDetailVo
=
getBaseBiz
().
findCampsiteShopDetailById
(
id
,
longitude
,
latitude
);
CampsiteShopDetailVo
campsiteShopDetailVo
=
getBaseBiz
().
findCampsiteShopDetailById
(
id
,
longitude
,
latitude
);
return
ObjectRestResponse
.
succ
(
campsiteShopDetailVo
);
return
ObjectRestResponse
.
succ
(
campsiteShopDetailVo
);
}
}
...
...
xx-uccn/xx-uccn-api/src/main/java/com/xxfc/platform/uccn/dto/RandomListDto.java
0 → 100644
View file @
7b982fef
package
com
.
xxfc
.
platform
.
uccn
.
dto
;
import
lombok.Data
;
@Data
public
class
RandomListDto
{
/**
* 列表类型 TypeEnum
*/
private
Integer
type
;
/**
* 随机数量
*/
private
Integer
number
;
/**
* 活动位置,1:欣欣官网 2:滴房车官网 0:无限制,
*/
private
Integer
location
;
}
xx-uccn/xx-uccn-api/src/main/java/com/xxfc/platform/uccn/dto/SummitActivityDTO.java
deleted
100644 → 0
View file @
c802500d
package
com
.
xxfc
.
platform
.
uccn
.
dto
;
import
lombok.Data
;
/**
* @author libin
* @version 1.0
* @description
* @data 2019/8/26 15:51
*/
@Data
public
class
SummitActivityDTO
{
}
xx-uccn/xx-uccn-api/src/main/java/com/xxfc/platform/uccn/vo/TypeEnum.java
0 → 100644
View file @
7b982fef
package
com
.
xxfc
.
platform
.
uccn
.
vo
;
import
lombok.Data
;
public
enum
TypeEnum
{
VEHICLE
(
1
,
"车型"
),
TOUR
(
2
,
"旅游"
),
CAMPSITE
(
3
,
"营地"
),
ACTIVITY
(
4
,
"活动"
);
private
Integer
code
;
private
String
msg
;
public
Integer
getCode
()
{
return
code
;
}
public
void
setCode
(
Integer
code
)
{
this
.
code
=
code
;
}
public
String
getMsg
()
{
return
msg
;
}
public
void
setMsg
(
String
msg
)
{
this
.
msg
=
msg
;
}
TypeEnum
(
Integer
code
,
String
msg
)
{
this
.
code
=
code
;
this
.
msg
=
msg
;
}
public
static
TypeEnum
getByValue
(
Integer
value
){
for
(
TypeEnum
typeEnum
:
values
()){
if
(
typeEnum
.
getCode
()
==
value
)
{
return
typeEnum
;
}
}
return
null
;
}
}
xx-uccn/xx-uccn-server/pom.xml
View file @
7b982fef
...
@@ -39,6 +39,12 @@
...
@@ -39,6 +39,12 @@
<version>
2.0-SNAPSHOT
</version>
<version>
2.0-SNAPSHOT
</version>
<scope>
compile
</scope>
<scope>
compile
</scope>
</dependency>
</dependency>
<dependency>
<groupId>
com.xxfc.platform
</groupId>
<artifactId>
xx-campsite-api
</artifactId>
<version>
2.0-SNAPSHOT
</version>
<scope>
compile
</scope>
</dependency>
</dependencies>
</dependencies>
<build>
<build>
<plugins>
<plugins>
...
...
xx-uccn/xx-uccn-server/src/main/java/com/xxfc/platform/uccn/biz/RandomListBiz.java
0 → 100644
View file @
7b982fef
package
com
.
xxfc
.
platform
.
uccn
.
biz
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.xxfc.platform.campsite.feign.CampsiteFeign
;
import
com.xxfc.platform.tour.feign.TourFeign
;
import
com.xxfc.platform.uccn.vo.TypeEnum
;
import
com.xxfc.platform.vehicle.feign.VehicleFeign
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
/**
* 获取随机数量的车型、旅游、营地、活动
*/
@Service
@Slf4j
public
class
RandomListBiz
{
@Autowired
VehicleFeign
vehicleFeign
;
@Autowired
TourFeign
tourFeign
;
@Autowired
CampsiteFeign
campsiteFeign
;
@Autowired
SummitActivityBiz
summitActivityBiz
;
/**
* @param type 类型
* @param number 随机数,默认是2
* @return
*/
public
ObjectRestResponse
getRandomList
(
Integer
type
,
Integer
number
,
Integer
location
)
{
if
(
type
!=
null
)
{
number
=
number
==
null
?
2
:
number
;
switch
(
TypeEnum
.
getByValue
(
type
))
{
case
VEHICLE:
return
vehicleFeign
.
findRandomVehicle
(
number
);
case
TOUR:
return
tourFeign
.
findRandomVehicle
(
number
);
case
CAMPSITE:
return
campsiteFeign
.
findRandomVehicle
(
number
);
case
ACTIVITY:
return
ObjectRestResponse
.
succ
(
summitActivityBiz
.
getHostWithSummitActivity
(
number
,
location
));
}
}
return
ObjectRestResponse
.
succ
();
}
}
xx-uccn/xx-uccn-server/src/main/java/com/xxfc/platform/uccn/biz/SummitActivityBiz.java
View file @
7b982fef
...
@@ -3,9 +3,13 @@ package com.xxfc.platform.uccn.biz;
...
@@ -3,9 +3,13 @@ package com.xxfc.platform.uccn.biz;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.TypeReference
;
import
com.alibaba.fastjson.TypeReference
;
import
com.github.wxiaoqi.security.admin.feign.dto.UserDTO
;
import
com.github.wxiaoqi.security.admin.feign.dto.UserDTO
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.github.wxiaoqi.security.common.util.RandomUtil
;
import
com.github.wxiaoqi.security.common.vo.PageDataVO
;
import
com.github.wxiaoqi.security.common.vo.PageDataVO
;
import
com.xxfc.platform.uccn.dto.SummitActivityFindDTO
;
import
com.xxfc.platform.uccn.dto.SummitActivityFindDTO
;
import
com.xxfc.platform.uccn.dto.SummitActivitySaveDTO
;
import
com.xxfc.platform.uccn.dto.SummitActivitySaveDTO
;
import
com.xxfc.platform.uccn.entity.SummitActivity
;
import
com.xxfc.platform.uccn.mapper.SummitActivityMapper
;
import
com.xxfc.platform.uccn.vo.SummitActivityAdminVo
;
import
com.xxfc.platform.uccn.vo.SummitActivityAdminVo
;
import
com.xxfc.platform.uccn.vo.SummitActivityDetailVo
;
import
com.xxfc.platform.uccn.vo.SummitActivityDetailVo
;
import
com.xxfc.platform.uccn.vo.SummitActivityVo
;
import
com.xxfc.platform.uccn.vo.SummitActivityVo
;
...
@@ -13,10 +17,6 @@ import org.apache.commons.collections.CollectionUtils;
...
@@ -13,10 +17,6 @@ import org.apache.commons.collections.CollectionUtils;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
com.xxfc.platform.uccn.entity.SummitActivity
;
import
com.xxfc.platform.uccn.mapper.SummitActivityMapper
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
tk.mybatis.mapper.entity.Example
;
import
tk.mybatis.mapper.entity.Example
;
import
java.time.Instant
;
import
java.time.Instant
;
...
@@ -33,7 +33,7 @@ import java.util.*;
...
@@ -33,7 +33,7 @@ import java.util.*;
public
class
SummitActivityBiz
extends
BaseBiz
<
SummitActivityMapper
,
SummitActivity
>
{
public
class
SummitActivityBiz
extends
BaseBiz
<
SummitActivityMapper
,
SummitActivity
>
{
public
List
<
SummitActivityVo
>
findSummitActivityForHomePage
(
Integer
limit
,
Integer
location
)
{
public
List
<
SummitActivityVo
>
findSummitActivityForHomePage
(
Integer
limit
,
Integer
location
)
{
Example
example
=
new
Example
(
SummitActivity
.
class
);
Example
example
=
new
Example
(
SummitActivity
.
class
);
example
.
setOrderByClause
(
"rank"
);
example
.
setOrderByClause
(
"rank"
);
Example
.
Criteria
criteria
=
example
.
createCriteria
();
Example
.
Criteria
criteria
=
example
.
createCriteria
();
...
@@ -46,7 +46,7 @@ public class SummitActivityBiz extends BaseBiz<SummitActivityMapper, SummitActiv
...
@@ -46,7 +46,7 @@ public class SummitActivityBiz extends BaseBiz<SummitActivityMapper, SummitActiv
//活动未下架
//活动未下架
criteria
.
andEqualTo
(
"isShow"
,
1
);
criteria
.
andEqualTo
(
"isShow"
,
1
);
//位置
//位置
criteria
.
andIn
(
"location"
,
Arrays
.
asList
(
location
,
0
));
criteria
.
andIn
(
"location"
,
Arrays
.
asList
(
location
,
0
));
PageDataVO
<
SummitActivity
>
dataVO
=
PageDataVO
.
pageInfo
(
1
,
limit
,
()
->
mapper
.
selectByExample
(
example
));
PageDataVO
<
SummitActivity
>
dataVO
=
PageDataVO
.
pageInfo
(
1
,
limit
,
()
->
mapper
.
selectByExample
(
example
));
List
<
SummitActivity
>
summitActivities
=
dataVO
.
getData
();
List
<
SummitActivity
>
summitActivities
=
dataVO
.
getData
();
...
@@ -73,9 +73,7 @@ public class SummitActivityBiz extends BaseBiz<SummitActivityMapper, SummitActiv
...
@@ -73,9 +73,7 @@ public class SummitActivityBiz extends BaseBiz<SummitActivityMapper, SummitActiv
criteria
.
andLike
(
"title"
,
String
.
format
(
"%%%s%%"
,
summitActivityFindDTO
.
getTitle
()));
criteria
.
andLike
(
"title"
,
String
.
format
(
"%%%s%%"
,
summitActivityFindDTO
.
getTitle
()));
}
}
criteria
.
andEqualTo
(
"isDel"
,
0
);
criteria
.
andEqualTo
(
"isDel"
,
0
);
/* if (Objects.nonNull(summitActivityFindDTO.getStartTime()) && Objects.nonNull(summitActivityFindDTO.getEndTime())){
criteria.andBetween("")
}*/
PageDataVO
<
SummitActivity
>
pageDataVO
=
PageDataVO
.
pageInfo
(
summitActivityFindDTO
.
getPage
(),
summitActivityFindDTO
.
getLimit
(),
()
->
mapper
.
selectByExample
(
example
));
PageDataVO
<
SummitActivity
>
pageDataVO
=
PageDataVO
.
pageInfo
(
summitActivityFindDTO
.
getPage
(),
summitActivityFindDTO
.
getLimit
(),
()
->
mapper
.
selectByExample
(
example
));
List
<
SummitActivity
>
data
=
pageDataVO
.
getData
();
List
<
SummitActivity
>
data
=
pageDataVO
.
getData
();
if
(
CollectionUtils
.
isEmpty
(
data
))
{
if
(
CollectionUtils
.
isEmpty
(
data
))
{
...
@@ -166,4 +164,46 @@ public class SummitActivityBiz extends BaseBiz<SummitActivityMapper, SummitActiv
...
@@ -166,4 +164,46 @@ public class SummitActivityBiz extends BaseBiz<SummitActivityMapper, SummitActiv
summitActivity
.
setRank
(
rank
);
summitActivity
.
setRank
(
rank
);
mapper
.
updateByPrimaryKeySelective
(
summitActivity
);
mapper
.
updateByPrimaryKeySelective
(
summitActivity
);
}
}
public
List
<
SummitActivityVo
>
getHostWithSummitActivity
(
Integer
num
,
Integer
location
)
{
List
<
SummitActivityVo
>
summitActivityVos
=
new
ArrayList
<>();
Example
example
=
new
Example
(
SummitActivity
.
class
);
Example
.
Criteria
criteria
=
example
.
createCriteria
();
//未删除
criteria
.
andEqualTo
(
"isDel"
,
0
);
//已发布
criteria
.
andEqualTo
(
"isPublish"
,
1
);
//活动未下架
criteria
.
andEqualTo
(
"isShow"
,
1
);
//位置
criteria
.
andIn
(
"location"
,
Arrays
.
asList
(
location
,
0
));
criteria
.
andGreaterThan
(
"endTime"
,
Instant
.
now
().
toEpochMilli
());
List
<
SummitActivity
>
summitActivities
=
mapper
.
selectByExample
(
example
);
if
(
CollectionUtils
.
isNotEmpty
(
summitActivities
))
{
SummitActivityVo
summitActivityVo
;
if
(
summitActivities
.
size
()
<=
num
)
{
for
(
SummitActivity
summitActivity
:
summitActivities
)
{
summitActivityVo
=
new
SummitActivityVo
();
summitActivityVo
.
setId
(
summitActivity
.
getId
());
summitActivityVo
.
setBanner
(
summitActivity
.
getBanner
());
summitActivityVo
.
setTitle
(
summitActivity
.
getTitle
());
summitActivityVos
.
add
(
summitActivityVo
);
}
}
else
{
Set
<
Integer
>
resultSet
=
new
HashSet
<>();
RandomUtil
.
randomSet
(
summitActivities
.
size
(),
num
,
resultSet
);
for
(
Integer
i
:
resultSet
)
{
summitActivityVo
=
new
SummitActivityVo
();
SummitActivity
summitActivity
=
summitActivities
.
get
(
i
);
summitActivityVo
.
setId
(
summitActivity
.
getId
());
summitActivityVo
.
setBanner
(
summitActivity
.
getBanner
());
summitActivityVo
.
setTitle
(
summitActivity
.
getTitle
());
summitActivityVos
.
add
(
summitActivityVo
);
}
}
}
return
summitActivityVos
;
}
}
}
\ No newline at end of file
xx-uccn/xx-uccn-server/src/main/java/com/xxfc/platform/uccn/rest/CampsiteUccnController.java
0 → 100644
View file @
7b982fef
package
com
.
xxfc
.
platform
.
uccn
.
rest
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.vo.PageDataVO
;
import
com.xxfc.platform.campsite.feign.CampsiteFeign
;
import
com.xxfc.platform.campsite.vo.CampsiteShopDetailVo
;
import
com.xxfc.platform.campsite.vo.CampsiteShopPageVo
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.RequiredArgsConstructor
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
/**
* @author libin
* @version 1.0
* @description
* @data 2019/8/28 10:05
*/
@RestController
@RequestMapping
(
"/app/unauth/campsite"
)
@RequiredArgsConstructor
(
onConstructor
=
@__
(
@Autowired
))
public
class
CampsiteUccnController
{
private
final
CampsiteFeign
campsiteFeign
;
@ApiOperation
(
"分页查询营地列表"
)
@GetMapping
(
"/shops"
)
public
ObjectRestResponse
<
PageDataVO
<
CampsiteShopPageVo
>>
findCampsiteShopPageByType
(
@RequestParam
(
value
=
"type"
,
required
=
false
)
Integer
type
,
@RequestParam
(
value
=
"pageNo"
,
required
=
false
,
defaultValue
=
"1"
)
Integer
pageNo
,
@RequestParam
(
value
=
"pageSize"
,
required
=
false
,
defaultValue
=
"6"
)
Integer
pageSize
)
{
return
campsiteFeign
.
findCampsiteShopPageByType
(
type
,
pageNo
,
pageSize
);
}
/**
* @param longitude 经度
* @param latitude 纬度
* @return
*/
@ApiOperation
(
"查询营地详情"
)
@GetMapping
(
"/shop"
)
public
ObjectRestResponse
<
CampsiteShopDetailVo
>
findCampsiteShopDetailById
(
@RequestParam
(
value
=
"id"
)
Integer
id
,
@RequestParam
(
value
=
"longitude"
,
required
=
false
)
Double
longitude
,
@RequestParam
(
value
=
"latitude"
,
required
=
false
)
Double
latitude
)
{
return
campsiteFeign
.
findCampsiteShopDetailById
(
id
,
longitude
,
latitude
);
}
}
xx-uccn/xx-uccn-server/src/main/java/com/xxfc/platform/uccn/rest/SummitActivityController.java
View file @
7b982fef
...
@@ -43,9 +43,9 @@ public class SummitActivityController{
...
@@ -43,9 +43,9 @@ public class SummitActivityController{
@ApiOperation
(
"热门推荐获取"
)
@ApiOperation
(
"热门推荐获取"
)
@GetMapping
(
"/hot"
)
@GetMapping
(
"/hot"
)
public
ObjectRestResponse
<
Void
>
findHotWithSummitActivity
(
@RequestParam
(
value
=
"num"
,
required
=
false
,
defaultValue
=
"3"
)
Integer
num
){
public
ObjectRestResponse
<
List
<
SummitActivityVo
>>
findHotWithSummitActivity
(
@RequestParam
(
value
=
"num"
,
required
=
false
,
defaultValue
=
"2"
)
Integer
num
,
@RequestParam
(
value
=
"location"
,
defaultValue
=
"1"
,
required
=
false
)
Integer
location
){
// List<> summitActivityBiz.getHostWithSummitActivity(num
);
List
<
SummitActivityVo
>
summitActivityVos
=
summitActivityBiz
.
getHostWithSummitActivity
(
num
,
location
);
return
ObjectRestResponse
.
succ
();
return
ObjectRestResponse
.
succ
(
summitActivityVos
);
}
}
}
}
\ No newline at end of file
xx-uccn/xx-uccn-server/src/main/java/com/xxfc/platform/uccn/rest/VehicleModelController.java
View file @
7b982fef
...
@@ -10,6 +10,7 @@ import com.xxfc.platform.vehicle.feign.VehicleFeign;
...
@@ -10,6 +10,7 @@ import com.xxfc.platform.vehicle.feign.VehicleFeign;
import
com.xxfc.platform.vehicle.pojo.VModelDetailVO
;
import
com.xxfc.platform.vehicle.pojo.VModelDetailVO
;
import
com.xxfc.platform.vehicle.pojo.VehicleModelQueryCondition
;
import
com.xxfc.platform.vehicle.pojo.VehicleModelQueryCondition
;
import
com.xxfc.platform.vehicle.pojo.VehicleModelVo
;
import
com.xxfc.platform.vehicle.pojo.VehicleModelVo
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiParam
;
import
io.swagger.annotations.ApiParam
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
...
@@ -20,9 +21,10 @@ import org.springframework.web.bind.annotation.*;
...
@@ -20,9 +21,10 @@ import org.springframework.web.bind.annotation.*;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
@RestController
@RestController
@RequestMapping
(
"/vehicleModel"
)
@RequestMapping
(
"/vehicleModel
/app/unauth
"
)
@Slf4j
@Slf4j
@IgnoreClientToken
@IgnoreClientToken
@Api
(
tags
=
"房车车型"
,
value
=
"房车车型"
)
public
class
VehicleModelController
extends
CommonBaseController
{
public
class
VehicleModelController
extends
CommonBaseController
{
@Autowired
@Autowired
...
@@ -50,7 +52,7 @@ public class VehicleModelController extends CommonBaseController {
...
@@ -50,7 +52,7 @@ public class VehicleModelController extends CommonBaseController {
* @return
* @return
*/
*/
@ApiOperation
(
"车型列表"
)
@ApiOperation
(
"车型列表"
)
@PostMapping
(
value
=
"/
app/unauth/
findVehicleModelPage"
)
@PostMapping
(
value
=
"/findVehicleModelPage"
)
@IgnoreUserToken
@IgnoreUserToken
public
ObjectRestResponse
<
VehicleModelVo
>
findVehicleModelPageUnauthfind
(
@RequestBody
VehicleModelQueryCondition
vmqc
)
{
public
ObjectRestResponse
<
VehicleModelVo
>
findVehicleModelPageUnauthfind
(
@RequestBody
VehicleModelQueryCondition
vmqc
)
{
return
vehicleFeign
.
findVehicleModelPageUnauthfind
(
vmqc
);
return
vehicleFeign
.
findVehicleModelPageUnauthfind
(
vmqc
);
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/VehicleActiveService.java
View file @
7b982fef
...
@@ -20,10 +20,7 @@ import org.springframework.stereotype.Service;
...
@@ -20,10 +20,7 @@ import org.springframework.stereotype.Service;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.interceptor.TransactionAspectSupport
;
import
org.springframework.transaction.interceptor.TransactionAspectSupport
;
import
java.util.Date
;
import
java.util.*
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
@Service
@Service
public
class
VehicleActiveService
{
public
class
VehicleActiveService
{
...
@@ -82,7 +79,7 @@ public class VehicleActiveService {
...
@@ -82,7 +79,7 @@ public class VehicleActiveService {
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
());
}
}
if
(
MileageLift
==
null
||
MileageLift1
>=
MileageLift
){
if
(
MileageLift
==
null
||
MileageLift1
>=
MileageLift
){
// 写入车辆公里数,预计目的地
// 写入车辆公里数,预计目的地
vehicle
.
setMileageLastUpdate
(
MileageLift1
);
vehicle
.
setMileageLastUpdate
(
MileageLift1
);
vehicle
.
setExpectDestinationBranchCompanyId
(
departureVo
.
getExpectArrivalBranchCompanyId
());
vehicle
.
setExpectDestinationBranchCompanyId
(
departureVo
.
getExpectArrivalBranchCompanyId
());
...
@@ -171,11 +168,13 @@ public class VehicleActiveService {
...
@@ -171,11 +168,13 @@ public class VehicleActiveService {
break
;
break
;
}
}
List
<
VehicleBookRecordVo
>
vehicleBookRecordVos
=
vehicleBookRecordBiz
.
selectByVehicleId
(
vehicleId
);
List
<
VehicleBookRecordVo
>
vehicleBookRecordVos
=
vehicleBookRecordBiz
.
selectByVehicleId
(
vehicleId
);
if
(
vehicleBookRecordVos
!=
null
&&
vehicleBookRecordVos
.
size
()
>
0
)
{
if
(
vehicleBookRecordVos
!=
null
&&
vehicleBookRecordVos
.
size
()
>
0
&&
vehicleBookRecordVos
.
get
(
0
).
getVehicleDepartureLogVo
()
!=
null
&&
vehicleBookRecordVos
.
get
(
0
).
getVehicleDepartureLogVo
().
getState
()
!=
1
)
{
stringBuilder
.
append
(
"中,使用人:"
);
stringBuilder
.
append
(
"中,使用人:"
);
stringBuilder
.
append
(
vehicleBookRecordVos
.
get
(
0
).
getVehicleUsername
());
stringBuilder
.
append
(
vehicleBookRecordVos
.
get
(
0
).
getVehicleUsername
());
stringBuilder
.
append
(
" 使用人电话:"
);
stringBuilder
.
append
(
" 使用人电话:"
);
stringBuilder
.
append
(
vehicleBookRecordVos
.
get
(
0
).
getVehicleUserPhone
());
stringBuilder
.
append
(
vehicleBookRecordVos
.
get
(
0
).
getVehicleUserPhone
());
}
else
{
stringBuilder
.
append
(
", 请联系管理员修改车辆状态为正常状态"
);
}
}
return
stringBuilder
.
toString
();
return
stringBuilder
.
toString
();
}
}
...
@@ -309,6 +308,15 @@ public class VehicleActiveService {
...
@@ -309,6 +308,15 @@ public class VehicleActiveService {
param
.
put
(
"vehicleId"
,
vehicleBookRecord
.
getVehicleId
());
param
.
put
(
"vehicleId"
,
vehicleBookRecord
.
getVehicleId
());
param
.
put
(
"bookedEndDate"
,
vehicleBookRecord
.
getBookStartDate
());
param
.
put
(
"bookedEndDate"
,
vehicleBookRecord
.
getBookStartDate
());
List
<
VehicleBookRecordVo
>
list
=
vehicleBookRecordBiz
.
selectByVehicleIdAndTime
(
param
);
List
<
VehicleBookRecordVo
>
list
=
vehicleBookRecordBiz
.
selectByVehicleIdAndTime
(
param
);
if
(
list
!=
null
&&
list
.
size
()
>
0
)
{
Iterator
<
VehicleBookRecordVo
>
iterator
=
list
.
iterator
();
while
(
iterator
.
hasNext
())
{
VehicleBookRecordVo
vehicleBookRecordVo
=
iterator
.
next
();
if
(
vehicleBookRecordVo
.
getVehicleDepartureLogVo
()
==
null
&&
(
vehicleBookRecordVo
.
getBookEndDate
().
getTime
()
-
new
Date
().
getTime
())
<
0
)
{
iterator
.
remove
();
}
}
}
if
(!(
startDate
.
minusDays
(
1
).
compareTo
(
DateTime
.
now
())
<=
0
&&
DateTime
.
now
().
compareTo
(
endDate
)
<=
0
&&
vehicleBookRecord
.
getStatus
()
==
VehicleBookRecordStatus
.
APPROVE
.
getCode
()
&&
(
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
());
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/VehicleBiz.java
View file @
7b982fef
...
@@ -816,11 +816,14 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR
...
@@ -816,11 +816,14 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR
break
;
break
;
}
}
List
<
VehicleBookRecordVo
>
vehicleBookRecordVos
=
vehicleBookRecordBiz
.
selectByVehicleId
(
vehicleId
);
List
<
VehicleBookRecordVo
>
vehicleBookRecordVos
=
vehicleBookRecordBiz
.
selectByVehicleId
(
vehicleId
);
if
(
vehicleBookRecordVos
!=
null
&&
vehicleBookRecordVos
.
size
()
>
0
)
{
vehicleBookRecordBiz
.
removeStatus2
(
vehicleBookRecordVos
);
if
(
vehicleBookRecordVos
!=
null
&&
vehicleBookRecordVos
.
size
()
>
0
&&
vehicleBookRecordVos
.
get
(
0
).
getBookEndDate
()
!=
null
&&
vehicleBookRecordVos
.
get
(
0
).
getBookEndDate
().
after
(
new
Date
()))
{
stringBuilder
.
append
(
"中,使用人:"
);
stringBuilder
.
append
(
"中,使用人:"
);
stringBuilder
.
append
(
vehicleBookRecordVos
.
get
(
0
).
getVehicleUsername
());
stringBuilder
.
append
(
vehicleBookRecordVos
.
get
(
0
).
getVehicleUsername
());
stringBuilder
.
append
(
" 使用人电话:"
);
stringBuilder
.
append
(
" 使用人电话:"
);
stringBuilder
.
append
(
vehicleBookRecordVos
.
get
(
0
).
getVehicleUserPhone
());
stringBuilder
.
append
(
vehicleBookRecordVos
.
get
(
0
).
getVehicleUserPhone
());
}
else
{
stringBuilder
.
append
(
", 请联系管理员修改车辆状态为正常状态"
);
}
}
return
stringBuilder
.
toString
();
return
stringBuilder
.
toString
();
}
}
...
@@ -1028,6 +1031,11 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR
...
@@ -1028,6 +1031,11 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR
}
}
if
(
MapUtils
.
isNotEmpty
(
yearMonthAndParam
)){
if
(
MapUtils
.
isNotEmpty
(
yearMonthAndParam
)){
params
.
put
(
"yearMonthAndParam"
,
yearMonthAndParam
);
params
.
put
(
"yearMonthAndParam"
,
yearMonthAndParam
);
String
bitStr
=
""
;
for
(
String
key
:
yearMonthAndParam
.
keySet
())
{
bitStr
+=
"1"
;
}
params
.
put
(
"yearMonthAndParamBitStr"
,
bitStr
);
}
}
}
}
...
...
xx-vehicle/xx-vehicle-server/src/main/resources/mapper/VehicleMapper.xml
View file @
7b982fef
...
@@ -344,7 +344,7 @@
...
@@ -344,7 +344,7 @@
</select>
</select>
<select
id=
"selectByNumberPlate"
resultType=
"com.xxfc.platform.vehicle.entity.Vehicle"
>
<select
id=
"selectByNumberPlate"
resultType=
"com.xxfc.platform.vehicle.entity.Vehicle"
>
select * from vehicle
select * from vehicle
where number_plate = #{numberPlate} and
is_del=0
where number_plate = #{numberPlate} and is_del=0
</select>
</select>
<select
id=
"selectById"
resultMap=
"searchModel"
>
<select
id=
"selectById"
resultMap=
"searchModel"
>
...
@@ -523,16 +523,14 @@
...
@@ -523,16 +523,14 @@
<!-- yearNo4Where 标识时间参数不用于where条件,用于select部分 -->
<!-- yearNo4Where 标识时间参数不用于where条件,用于select部分 -->
<if
test=
" yearMonthAndParam !=null and yearNo4Where != null and yearNo4Where == true"
>
<if
test=
" yearMonthAndParam !=null and yearNo4Where != null and yearNo4Where == true"
>
,(max(
,(max(
<foreach
collection=
"yearMonthAndParam"
index=
"yearMonth"
item=
"andOperation"
separator=
"and"
>
vbi.bit_str = #{yearMonthAndParamBitStr}
<include
refid=
"yearMonthAndParamSql"
></include>
</foreach>
<!-- 租车列表 不过滤前后预约记录不符的车辆 但是合并标示车型是否有车 即 hasVehicle-->
<!-- 租车列表 不过滤前后预约记录不符的车辆 但是合并标示车型是否有车 即 hasVehicle-->
<if
test=
"withoutRecordWhere != null and withoutRecordWhere = 1 and startCompanyId != null and endCompanyId != null "
>
<if
test=
"withoutRecordWhere != null and withoutRecordWhere = 1 and startCompanyId != null and endCompanyId != null "
>
and (abr.to_lift_company is null or abr.to_lift_company = #{startCompanyId})
and (abr.to_lift_company is null or abr.to_lift_company = #{startCompanyId})
and (abr.to_return_company is null or abr.to_return_company = #{endCompanyId})
and (abr.to_return_company is null or abr.to_return_company = #{endCompanyId})
</if>
</if>
)
)
)as hasVehicle
)
as hasVehicle
</if>
</if>
<if
test=
"lon != null and lat != null"
>
<if
test=
"lon != null and lat != null"
>
,st_distance_sphere(point(#{lon}, #{lat}), point(bc.longitude, bc.latitude)) as distance
,st_distance_sphere(point(#{lon}, #{lat}), point(bc.longitude, bc.latitude)) as distance
...
@@ -604,9 +602,9 @@
...
@@ -604,9 +602,9 @@
<if
test=
"lon != null and lat != null"
>
<if
test=
"lon != null and lat != null"
>
,st_distance_sphere(point(#{lon}, #{lat}), point(bc.longitude, bc.latitude)) as distance
,st_distance_sphere(point(#{lon}, #{lat}), point(bc.longitude, bc.latitude)) as distance
</if>
</if>
<if
test=
" yearMonthAndParam !=null "
>
<!-- <if test=" yearMonthAndParam !=null ">--
>
,ifnull(vbi.booked_date,0) as booked_date
<!-- ,ifnull(vbi.booked_date,0) as booked_date-->
</if
>
<!-- </if>--
>
<include
refid=
"searchUsableSql"
/>
<include
refid=
"searchUsableSql"
/>
<if
test=
"lon != null and lat != null"
>
<if
test=
"lon != null and lat != null"
>
order by
order by
...
@@ -618,8 +616,18 @@
...
@@ -618,8 +616,18 @@
<sql
id=
"searchUsableSql"
>
<sql
id=
"searchUsableSql"
>
from vehicle v
from vehicle v
<if
test=
" yearMonthAndParam !=null "
>
<if
test=
" yearMonthAndParam !=null "
>
left join
left join (
vehicle_book_info vbi on v.`id` = vbi.vehicle
select
vbi.vehicle,
BIT_OR(
CONCAT(
<foreach
collection=
"yearMonthAndParam"
index=
"yearMonth"
item=
"andOperation"
separator=
","
>
<include
refid=
"yearMonthAndParamSql"
></include>
</foreach>
)
) as bit_str
from vehicle_book_info vbi group by vbi.vehicle
) vbi on v.`id` = vbi.vehicle
</if>
</if>
left join vehicle_model vm on v.model_id = vm.id
left join vehicle_model vm on v.model_id = vm.id
left join branch_company bc on v.park_branch_company_id = bc.id
left join branch_company bc on v.park_branch_company_id = bc.id
...
@@ -634,11 +642,8 @@
...
@@ -634,11 +642,8 @@
<where>
<where>
<!-- 若需根据预定日期条件查询,针对换为位操作 -->
<!-- 若需根据预定日期条件查询,针对换为位操作 -->
<!-- yearNo4Where 标识时间参数是否用于where条件 -->
<!-- yearNo4Where 标识时间参数是否用于where条件 -->
<if
test=
" yearMonthAndParam !=null and yearNo4Where == null"
>
<if
test=
" yearMonthAndParam !=null and yearMonthAndParam != null and yearNo4Where == null"
>
<foreach
collection=
"yearMonthAndParam"
index=
"yearMonth"
item=
"andOperation"
>
vbi.bit_str = #{yearMonthAndParamBitStr}
and
<include
refid=
"yearMonthAndParamSql"
></include>
</foreach>
</if>
</if>
<!-- 根据前后record 过滤车辆 -->
<!-- 根据前后record 过滤车辆 -->
...
...
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