Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
soss
Overview
Overview
Details
Activity
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
hooloo
ms
soss
Commits
b7bfea54
Commit
b7bfea54
authored
Mar 02, 2023
by
weijiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化店铺距离限制
parent
19552d0b
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
36 additions
and
10 deletions
+36
-10
soss-system/src/main/java/com/soss/system/domain/SysBanner.java
+1
-1
soss-system/src/main/java/com/soss/system/domain/po/BannerListPo.java
+1
-1
soss-system/src/main/java/com/soss/system/domain/po/BannerPo.java
+1
-1
soss-system/src/main/java/com/soss/system/domain/vo/BannerVo.java
+2
-1
soss-system/src/main/java/com/soss/system/service/impl/SysBannerServiceImpl.java
+25
-4
soss-system/src/main/resources/mapper/system/SysBannerMapper.xml
+6
-2
No files found.
soss-system/src/main/java/com/soss/system/domain/SysBanner.java
View file @
b7bfea54
...
@@ -33,7 +33,7 @@ public class SysBanner extends BaseEntity {
...
@@ -33,7 +33,7 @@ public class SysBanner extends BaseEntity {
/**
/**
* 目标:1-小程序首页,2-小程序我的,0-其它
* 目标:1-小程序首页,2-小程序我的,0-其它
*/
*/
private
Integer
target
;
private
String
target
;
/**
/**
* 省份列表
* 省份列表
*/
*/
...
...
soss-system/src/main/java/com/soss/system/domain/po/BannerListPo.java
View file @
b7bfea54
...
@@ -14,7 +14,7 @@ public class BannerListPo {
...
@@ -14,7 +14,7 @@ public class BannerListPo {
/**
/**
* 目标:1-小程序首页,2-小程序我的,0-其它
* 目标:1-小程序首页,2-小程序我的,0-其它
*/
*/
private
Integer
target
;
private
String
target
;
/**
/**
* 状态
* 状态
*/
*/
...
...
soss-system/src/main/java/com/soss/system/domain/po/BannerPo.java
View file @
b7bfea54
...
@@ -24,7 +24,7 @@ public class BannerPo {
...
@@ -24,7 +24,7 @@ public class BannerPo {
/**
/**
* 目标:1-小程序首页,2-小程序我的,0-其它
* 目标:1-小程序首页,2-小程序我的,0-其它
*/
*/
private
Integer
target
;
private
String
[]
target
;
/**
/**
* 排序
* 排序
*/
*/
...
...
soss-system/src/main/java/com/soss/system/domain/vo/BannerVo.java
View file @
b7bfea54
...
@@ -27,7 +27,8 @@ public class BannerVo {
...
@@ -27,7 +27,8 @@ public class BannerVo {
/**
/**
* 目标:1-小程序首页,2-小程序我的,0-其它
* 目标:1-小程序首页,2-小程序我的,0-其它
*/
*/
private
Integer
target
;
private
String
[]
target
;
private
String
targetStr
;
/**
/**
* 排序
* 排序
*/
*/
...
...
soss-system/src/main/java/com/soss/system/service/impl/SysBannerServiceImpl.java
View file @
b7bfea54
...
@@ -56,7 +56,7 @@ public class SysBannerServiceImpl implements ISysBannerService {
...
@@ -56,7 +56,7 @@ public class SysBannerServiceImpl implements ISysBannerService {
if
(
banner
.
getType
()
==
null
||
banner
.
getType
()
<
1
||
banner
.
getType
()
>
3
)
{
if
(
banner
.
getType
()
==
null
||
banner
.
getType
()
<
1
||
banner
.
getType
()
>
3
)
{
throw
new
ServiceException
(
"类型不正确,1-小程序,2-KDS,3-点单屏"
);
throw
new
ServiceException
(
"类型不正确,1-小程序,2-KDS,3-点单屏"
);
}
}
if
(
banner
.
getTarget
()
==
null
||
banner
.
getTarget
()
<
0
||
banner
.
getTarget
()
>
2
)
{
if
(
StringUtils
.
isEmpty
(
banner
.
getTarget
())
)
{
throw
new
ServiceException
(
"轮播位置不正确,1-小程序首页,2-小程序我的,0-其它"
);
throw
new
ServiceException
(
"轮播位置不正确,1-小程序首页,2-小程序我的,0-其它"
);
}
}
if
(
banner
.
getSort
()
==
null
)
{
if
(
banner
.
getSort
()
==
null
)
{
...
@@ -88,7 +88,7 @@ public class SysBannerServiceImpl implements ISysBannerService {
...
@@ -88,7 +88,7 @@ public class SysBannerServiceImpl implements ISysBannerService {
if
(
banner
.
getType
()
==
null
||
banner
.
getType
()
<
1
||
banner
.
getType
()
>
3
)
{
if
(
banner
.
getType
()
==
null
||
banner
.
getType
()
<
1
||
banner
.
getType
()
>
3
)
{
throw
new
ServiceException
(
"类型不正确,1-小程序,2-KDS,3-点单屏"
);
throw
new
ServiceException
(
"类型不正确,1-小程序,2-KDS,3-点单屏"
);
}
}
if
(
banner
.
getTarget
()
==
null
||
banner
.
getTarget
()
<
0
||
banner
.
getTarget
()
>
2
)
{
if
(
StringUtils
.
isEmpty
(
banner
.
getTarget
())
)
{
throw
new
ServiceException
(
"轮播位置不正确,1-小程序首页,2-小程序我的,0-其它"
);
throw
new
ServiceException
(
"轮播位置不正确,1-小程序首页,2-小程序我的,0-其它"
);
}
}
if
(
banner
.
getSort
()
==
null
)
{
if
(
banner
.
getSort
()
==
null
)
{
...
@@ -110,9 +110,12 @@ public class SysBannerServiceImpl implements ISysBannerService {
...
@@ -110,9 +110,12 @@ public class SysBannerServiceImpl implements ISysBannerService {
banner
.
setImage
(
bannerPo
.
getImage
());
banner
.
setImage
(
bannerPo
.
getImage
());
banner
.
setPage
(
bannerPo
.
getPage
());
banner
.
setPage
(
bannerPo
.
getPage
());
banner
.
setType
(
bannerPo
.
getType
());
banner
.
setType
(
bannerPo
.
getType
());
banner
.
setTarget
(
bannerPo
.
getTarget
());
banner
.
setSort
(
bannerPo
.
getSort
());
banner
.
setSort
(
bannerPo
.
getSort
());
banner
.
setState
(
bannerPo
.
getState
());
banner
.
setState
(
bannerPo
.
getState
());
// banner.setTarget(bannerPo.getTarget());
if
(
bannerPo
.
getTarget
()
!=
null
&&
bannerPo
.
getTarget
().
length
>
0
)
{
banner
.
setTarget
(
","
+
Arrays
.
asList
(
bannerPo
.
getTarget
()).
stream
().
collect
(
Collectors
.
joining
(
","
))
+
","
);
}
if
(
bannerPo
.
getProvince
()
!=
null
&&
bannerPo
.
getProvince
().
length
>
0
)
{
if
(
bannerPo
.
getProvince
()
!=
null
&&
bannerPo
.
getProvince
().
length
>
0
)
{
banner
.
setProvince
(
","
+
Arrays
.
asList
(
bannerPo
.
getProvince
()).
stream
().
collect
(
Collectors
.
joining
(
","
))
+
","
);
banner
.
setProvince
(
","
+
Arrays
.
asList
(
bannerPo
.
getProvince
()).
stream
().
collect
(
Collectors
.
joining
(
","
))
+
","
);
}
}
...
@@ -134,10 +137,28 @@ public class SysBannerServiceImpl implements ISysBannerService {
...
@@ -134,10 +137,28 @@ public class SysBannerServiceImpl implements ISysBannerService {
bannerVo
.
setImage
(
banner
.
getImage
());
bannerVo
.
setImage
(
banner
.
getImage
());
bannerVo
.
setPage
(
banner
.
getPage
());
bannerVo
.
setPage
(
banner
.
getPage
());
bannerVo
.
setType
(
banner
.
getType
());
bannerVo
.
setType
(
banner
.
getType
());
bannerVo
.
setTarget
(
banner
.
getTarget
());
bannerVo
.
setSort
(
banner
.
getSort
());
bannerVo
.
setSort
(
banner
.
getSort
());
bannerVo
.
setState
(
banner
.
getState
());
bannerVo
.
setState
(
banner
.
getState
());
// bannerVo.setTarget(banner.getTarget());
if
(!
StringUtils
.
isEmpty
(
banner
.
getTarget
()))
{
String
str
=
trim
(
banner
.
getTarget
());
bannerVo
.
setTarget
(
str
.
split
(
","
));
String
targetStr
=
""
;
for
(
String
s
:
bannerVo
.
getTarget
())
{
if
(!
StringUtils
.
isEmpty
(
targetStr
))
{
targetStr
+=
","
;
}
if
(
s
.
equals
(
"1"
))
{
targetStr
+=
"菜单页顶部"
;
}
else
if
(
s
.
equals
(
"2"
))
{
targetStr
+=
"我的页banner"
;
}
else
if
(
s
.
equals
(
"0"
))
{
targetStr
+=
"菜单轮播"
;
}
}
bannerVo
.
setTargetStr
(
targetStr
);
}
if
(!
StringUtils
.
isEmpty
(
banner
.
getProvince
()))
{
if
(!
StringUtils
.
isEmpty
(
banner
.
getProvince
()))
{
String
str
=
trim
(
banner
.
getProvince
());
String
str
=
trim
(
banner
.
getProvince
());
bannerVo
.
setProvinceStr
(
str
);
bannerVo
.
setProvinceStr
(
str
);
...
...
soss-system/src/main/resources/mapper/system/SysBannerMapper.xml
View file @
b7bfea54
...
@@ -23,7 +23,7 @@
...
@@ -23,7 +23,7 @@
select * from sys_banner
select * from sys_banner
<where>
<where>
<if
test=
"type != null "
>
type = #{type}
</if>
<if
test=
"type != null "
>
type = #{type}
</if>
<if
test=
"target != null
"
>
and target = #{target}
</if>
<if
test=
"target != null
and target != ''"
>
and target like concat('%,', #{target}, ',%')
</if>
<if
test=
"province != null and province != ''"
>
and province like concat('%,', #{province}, ',%')
</if>
<if
test=
"province != null and province != ''"
>
and province like concat('%,', #{province}, ',%')
</if>
<if
test=
"city != null and city != ''"
>
and city like concat('%,', #{city}, ',%')
</if>
<if
test=
"city != null and city != ''"
>
and city like concat('%,', #{city}, ',%')
</if>
<if
test=
"area != null and area != ''"
>
and area like concat('%,', #{area}, ',%')
</if>
<if
test=
"area != null and area != ''"
>
and area like concat('%,', #{area}, ',%')
</if>
...
@@ -62,6 +62,9 @@
...
@@ -62,6 +62,9 @@
</insert>
</insert>
<select
id=
"selectBanners"
resultMap=
"BannerResult"
>
<select
id=
"selectBanners"
resultMap=
"BannerResult"
>
select * from sys_banner where `type` = #{type} and `target` = #{target} and `state` = 0 order by sort, created_at
select * from sys_banner
where `type` = #{type}
<if
test=
"target != null and target != ''"
>
and target like concat('%,', #{target}, ',%')
</if>
and `state` = 0 order by sort, created_at
</select>
</select>
</mapper>
</mapper>
\ No newline at end of file
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