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
281f6731
Commit
281f6731
authored
Jul 13, 2019
by
libin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
banner
parent
1e5cdaaa
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
41 additions
and
9 deletions
+41
-9
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
+2
-2
BannerMapper.java
.../main/java/com/xxfc/platform/app/mapper/BannerMapper.java
+3
-2
BannerController.java
...ain/java/com/xxfc/platform/app/rest/BannerController.java
+2
-2
BannerMapper.xml
.../xx-app-server/src/main/resources/mapper/BannerMapper.xml
+9
-1
CampsiteShopTagBiz.java
...va/com/xxfc/platform/campsite/biz/CampsiteShopTagBiz.java
+9
-0
CampsiteTagBiz.java
...n/java/com/xxfc/platform/campsite/biz/CampsiteTagBiz.java
+11
-2
No files found.
xx-app/xx-app-api/src/main/java/com/xxfc/platform/app/entity/Banner.java
View file @
281f6731
...
@@ -100,4 +100,9 @@ public class Banner {
...
@@ -100,4 +100,9 @@ public class Banner {
@Column
(
name
=
"type"
)
@Column
(
name
=
"type"
)
@ApiModelProperty
(
value
=
"banner类型"
)
@ApiModelProperty
(
value
=
"banner类型"
)
private
Integer
type
;
private
Integer
type
;
/**
* 位置 banner位置0 所有 1:推荐 2:拍拍 3:短视频 4:问答
*/
private
Integer
location
;
}
}
xx-app/xx-app-server/src/main/java/com/xxfc/platform/app/biz/BannerBiz.java
View file @
281f6731
...
@@ -32,9 +32,9 @@ public class BannerBiz extends BaseBiz<BannerMapper,Banner> {
...
@@ -32,9 +32,9 @@ public class BannerBiz extends BaseBiz<BannerMapper,Banner> {
this.deleteById(id);
this.deleteById(id);
}*/
}*/
public
List
<
BannerVo
>
findBannerList
(
Integer
type
)
{
public
List
<
BannerVo
>
findBannerList
(
Integer
type
,
Integer
location
)
{
List
<
BannerVo
>
bannerVos
=
new
ArrayList
<>();
List
<
BannerVo
>
bannerVos
=
new
ArrayList
<>();
List
<
Banner
>
banners
=
mapper
.
findBannerListByType
(
type
);
List
<
Banner
>
banners
=
mapper
.
findBannerListByType
(
type
,
location
);
banners
.
forEach
(
banner
->
{
banners
.
forEach
(
banner
->
{
BannerVo
bannerVo
=
new
BannerVo
();
BannerVo
bannerVo
=
new
BannerVo
();
bannerVo
.
setCover
(
banner
.
getCover
());
bannerVo
.
setCover
(
banner
.
getCover
());
...
...
xx-app/xx-app-server/src/main/java/com/xxfc/platform/app/mapper/BannerMapper.java
View file @
281f6731
package
com
.
xxfc
.
platform
.
app
.
mapper
;
package
com
.
xxfc
.
platform
.
app
.
mapper
;
import
com.xxfc.platform.app.entity.Banner
;
import
com.xxfc.platform.app.entity.Banner
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Select
;
import
org.apache.ibatis.annotations.Select
;
import
org.springframework.stereotype.Repository
;
import
org.springframework.stereotype.Repository
;
import
tk.mybatis.mapper.common.Mapper
;
import
tk.mybatis.mapper.common.Mapper
;
...
@@ -22,6 +23,6 @@ public interface BannerMapper extends Mapper<Banner> {
...
@@ -22,6 +23,6 @@ public interface BannerMapper extends Mapper<Banner> {
List
<
Banner
>
findBannerListByisDelOrderByRank
(
Banner
banner
);
List
<
Banner
>
findBannerListByisDelOrderByRank
(
Banner
banner
);
@Select
(
"select * from `banner` where `is_del`=0 and `type`=#{type} order by rank asc "
)
List
<
Banner
>
findBannerListByType
(
Integer
type
);
List
<
Banner
>
findBannerListByType
(
@Param
(
"type"
)
Integer
type
,
@Param
(
"location"
)
Integer
location
);
}
}
xx-app/xx-app-server/src/main/java/com/xxfc/platform/app/rest/BannerController.java
View file @
281f6731
...
@@ -29,11 +29,11 @@ public class BannerController {
...
@@ -29,11 +29,11 @@ public class BannerController {
* @return
* @return
*/
*/
@GetMapping
(
"/app/unauth/findBannerlist"
)
@GetMapping
(
"/app/unauth/findBannerlist"
)
public
ObjectRestResponse
findBannerlist
(
@RequestParam
(
"type"
)
Integer
type
){
public
ObjectRestResponse
findBannerlist
(
@RequestParam
(
"type"
)
Integer
type
,
@RequestParam
(
required
=
false
,
value
=
"location"
)
Integer
location
){
if
(
type
==
null
)
{
if
(
type
==
null
)
{
return
ObjectRestResponse
.
createDefaultFail
();
return
ObjectRestResponse
.
createDefaultFail
();
}
}
List
<
BannerVo
>
bannerList
=
bannerBiz
.
findBannerList
(
type
);
List
<
BannerVo
>
bannerList
=
bannerBiz
.
findBannerList
(
type
,
location
);
return
ObjectRestResponse
.
succ
(
bannerList
);
return
ObjectRestResponse
.
succ
(
bannerList
);
}
}
}
}
xx-app/xx-app-server/src/main/resources/mapper/BannerMapper.xml
View file @
281f6731
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.xxfc.platform.
tour.mapper.Tour
BannerMapper"
>
<mapper
namespace=
"com.xxfc.platform.
app.mapper.
BannerMapper"
>
<!-- 可根据自己的需求,是否要使用 -->
<!-- 可根据自己的需求,是否要使用 -->
<resultMap
type=
"com.xxfc.platform.app.entity.Banner"
id=
"bannerMap"
>
<resultMap
type=
"com.xxfc.platform.app.entity.Banner"
id=
"bannerMap"
>
...
@@ -14,6 +14,14 @@
...
@@ -14,6 +14,14 @@
<result
property=
"updTime"
column=
"upd_time"
/>
<result
property=
"updTime"
column=
"upd_time"
/>
<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"
/>
</resultMap>
</resultMap>
<select
id=
"findBannerListByType"
>
select * from `banner` where `is_del`=0 and `type`=#{type}
<if
test=
"location != null"
>
and `location`=#{location}
</if>
order by rank asc
</select>
</mapper>
</mapper>
\ No newline at end of file
xx-campsite/xx-campsite-server/src/main/java/com/xxfc/platform/campsite/biz/CampsiteShopTagBiz.java
View file @
281f6731
...
@@ -12,6 +12,7 @@ import com.xxfc.platform.campsite.mapper.CampsiteShopTagMapper;
...
@@ -12,6 +12,7 @@ import com.xxfc.platform.campsite.mapper.CampsiteShopTagMapper;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
org.springframework.transaction.annotation.Propagation
;
import
org.springframework.transaction.annotation.Propagation
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
tk.mybatis.mapper.entity.Example
;
import
java.time.Instant
;
import
java.time.Instant
;
import
java.util.List
;
import
java.util.List
;
...
@@ -76,4 +77,12 @@ public class CampsiteShopTagBiz extends BaseBiz<CampsiteShopTagMapper,CampsiteSh
...
@@ -76,4 +77,12 @@ public class CampsiteShopTagBiz extends BaseBiz<CampsiteShopTagMapper,CampsiteSh
}
}
return
effectRows
;
return
effectRows
;
}
}
public
boolean
checkTagHashBindByTagId
(
Integer
tagId
){
Example
example
=
new
Example
(
CampsiteShopTag
.
class
);
Example
.
Criteria
criteria
=
example
.
createCriteria
();
criteria
.
andEqualTo
(
""
,
tagId
);
List
<
CampsiteShopTag
>
shopTags
=
mapper
.
selectByExample
(
example
);
return
shopTags
==
null
?
false
:
shopTags
.
size
()>
0
?
true
:
false
;
}
}
}
\ No newline at end of file
xx-campsite/xx-campsite-server/src/main/java/com/xxfc/platform/campsite/biz/CampsiteTagBiz.java
View file @
281f6731
...
@@ -2,12 +2,13 @@ package com.xxfc.platform.campsite.biz;
...
@@ -2,12 +2,13 @@ package com.xxfc.platform.campsite.biz;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.TypeReference
;
import
com.alibaba.fastjson.TypeReference
;
import
com.github.wxiaoqi.security.common.exception.BaseException
;
import
com.github.wxiaoqi.security.common.vo.PageDataVO
;
import
com.github.wxiaoqi.security.common.vo.PageDataVO
;
import
com.sun.org.apache.regexp.internal.RE
;
import
com.xxfc.platform.campsite.dto.CampsiteTagListDTO
;
import
com.xxfc.platform.campsite.dto.CampsiteTagListDTO
;
import
com.xxfc.platform.campsite.vo.CampsiteTagListVo
;
import
com.xxfc.platform.campsite.vo.CampsiteTagListVo
;
import
com.xxfc.platform.campsite.vo.CampsiteTagVo
;
import
com.xxfc.platform.campsite.vo.CampsiteTagVo
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
com.xxfc.platform.campsite.entity.CampsiteTag
;
import
com.xxfc.platform.campsite.entity.CampsiteTag
;
...
@@ -26,6 +27,9 @@ import java.util.List;
...
@@ -26,6 +27,9 @@ import java.util.List;
*/
*/
@Service
@Service
public
class
CampsiteTagBiz
extends
BaseBiz
<
CampsiteTagMapper
,
CampsiteTag
>
{
public
class
CampsiteTagBiz
extends
BaseBiz
<
CampsiteTagMapper
,
CampsiteTag
>
{
@Autowired
private
CampsiteShopTagBiz
campsiteShopTagBiz
;
/**
/**
* 查询营地列表
* 查询营地列表
...
@@ -46,7 +50,11 @@ public class CampsiteTagBiz extends BaseBiz<CampsiteTagMapper,CampsiteTag> {
...
@@ -46,7 +50,11 @@ public class CampsiteTagBiz extends BaseBiz<CampsiteTagMapper,CampsiteTag> {
* @return
* @return
*/
*/
public
int
updateCampsiteTagStatus
(
Integer
tagId
)
{
public
int
updateCampsiteTagStatus
(
Integer
tagId
)
{
return
mapper
.
updateCampsiteTagStatusById
(
tagId
,
1
);
boolean
isBinding
=
campsiteShopTagBiz
.
checkTagHashBindByTagId
(
tagId
);
if
(
isBinding
){
throw
new
BaseException
(
"该类型标签已经被占用"
,
400
);
}
return
mapper
.
updateCampsiteTagStatusById
(
tagId
,
1
);
}
}
/**
/**
...
@@ -74,6 +82,7 @@ public class CampsiteTagBiz extends BaseBiz<CampsiteTagMapper,CampsiteTag> {
...
@@ -74,6 +82,7 @@ public class CampsiteTagBiz extends BaseBiz<CampsiteTagMapper,CampsiteTag> {
* @return
* @return
*/
*/
public
int
updateCampsiteTagIsSearchStatus
(
Integer
id
,
Integer
status
)
{
public
int
updateCampsiteTagIsSearchStatus
(
Integer
id
,
Integer
status
)
{
return
mapper
.
updateCampsiteTagIsearchStatusById
(
id
,
status
);
return
mapper
.
updateCampsiteTagIsearchStatusById
(
id
,
status
);
}
}
...
...
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