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
d44b90ac
Commit
d44b90ac
authored
Aug 28, 2019
by
jiaorz
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/dev' into jrz_dev
parents
8bb649df
74099990
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
61 additions
and
73 deletions
+61
-73
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
SummitActivityBiz.java
...in/java/com/xxfc/platform/uccn/biz/SummitActivityBiz.java
+4
-8
No files found.
xx-app/xx-app-api/src/main/java/com/xxfc/platform/app/entity/Banner.java
View file @
d44b90ac
...
@@ -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 @
d44b90ac
...
@@ -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 @
d44b90ac
...
@@ -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 @
d44b90ac
...
@@ -25,15 +25,18 @@ public class BannerController {
...
@@ -25,15 +25,18 @@ public class BannerController {
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 @
d44b90ac
...
@@ -21,7 +21,7 @@ import org.springframework.web.bind.annotation.*;
...
@@ -21,7 +21,7 @@ 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
...
@@ -29,14 +29,15 @@ public class BannerAdminController {
...
@@ -29,14 +29,15 @@ public class BannerAdminController {
/**
/**
* 修改
* 修改
*
* @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 @
d44b90ac
...
@@ -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-uccn/xx-uccn-server/src/main/java/com/xxfc/platform/uccn/biz/SummitActivityBiz.java
View file @
d44b90ac
...
@@ -3,11 +3,13 @@ package com.xxfc.platform.uccn.biz;
...
@@ -3,11 +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.
msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.
biz.BaseBiz
;
import
com.github.wxiaoqi.security.common.util.RandomUtil
;
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
;
...
@@ -15,10 +17,6 @@ import org.apache.commons.collections.CollectionUtils;
...
@@ -15,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
;
...
@@ -75,9 +73,7 @@ public class SummitActivityBiz extends BaseBiz<SummitActivityMapper, SummitActiv
...
@@ -75,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
))
{
...
...
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