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
d7e4ffcc
Commit
d7e4ffcc
authored
Feb 23, 2023
by
weijiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
下单时校验订单中sku数量
parent
872bc8e2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
23 deletions
+28
-23
soss-system/src/main/java/com/soss/system/domain/po/BannerListPo.java
+1
-1
soss-system/src/main/java/com/soss/system/service/impl/SysBannerServiceImpl.java
+27
-22
No files found.
soss-system/src/main/java/com/soss/system/domain/po/BannerListPo.java
View file @
d7e4ffcc
...
...
@@ -30,5 +30,5 @@ public class BannerListPo {
private
String
area
;
@ApiModelProperty
(
"店铺ID"
)
private
Lo
ng
shopId
;
private
Stri
ng
shopId
;
}
soss-system/src/main/java/com/soss/system/service/impl/SysBannerServiceImpl.java
View file @
d7e4ffcc
...
...
@@ -114,29 +114,20 @@ public class SysBannerServiceImpl implements ISysBannerService {
banner
.
setSort
(
bannerPo
.
getSort
());
banner
.
setState
(
bannerPo
.
getState
());
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
(
","
))
+
","
);
}
if
(
bannerPo
.
getCity
()
!=
null
&&
bannerPo
.
getCity
().
length
>
0
)
{
banner
.
setCity
(
Arrays
.
asList
(
bannerPo
.
getCity
()).
stream
().
collect
(
Collectors
.
joining
(
","
))
);
banner
.
setCity
(
","
+
Arrays
.
asList
(
bannerPo
.
getCity
()).
stream
().
collect
(
Collectors
.
joining
(
","
))
+
","
);
}
if
(
bannerPo
.
getArea
()
!=
null
&&
bannerPo
.
getArea
().
length
>
0
)
{
banner
.
setArea
(
Arrays
.
asList
(
bannerPo
.
getArea
()).
stream
().
collect
(
Collectors
.
joining
(
","
))
);
banner
.
setArea
(
","
+
Arrays
.
asList
(
bannerPo
.
getArea
()).
stream
().
collect
(
Collectors
.
joining
(
","
))
+
","
);
}
if
(
bannerPo
.
getShopIds
()
!=
null
&&
bannerPo
.
getShopIds
().
length
>
0
)
{
banner
.
setShopIds
(
Arrays
.
asList
(
bannerPo
.
getShopIds
()).
stream
().
map
(
x
->
String
.
valueOf
(
x
)).
collect
(
Collectors
.
joining
(
","
))
);
banner
.
setShopIds
(
","
+
Arrays
.
asList
(
bannerPo
.
getShopIds
()).
stream
().
map
(
x
->
String
.
valueOf
(
x
)).
collect
(
Collectors
.
joining
(
","
))
+
","
);
}
return
banner
;
}
public
List
<
BannerVo
>
copyBanner
(
List
<
SysBanner
>
banners
)
{
List
<
BannerVo
>
bannerVos
=
new
ArrayList
<>();
if
(
CollectionUtils
.
isEmpty
(
banners
))
{
return
bannerVos
;
}
banners
.
forEach
(
banner
->
bannerVos
.
add
(
copyBanner
(
banner
)));
return
bannerVos
;
}
private
BannerVo
copyBanner
(
SysBanner
banner
)
{
BannerVo
bannerVo
=
new
BannerVo
();
bannerVo
.
setId
(
banner
.
getId
());
...
...
@@ -146,21 +137,26 @@ public class SysBannerServiceImpl implements ISysBannerService {
bannerVo
.
setTarget
(
banner
.
getTarget
());
bannerVo
.
setSort
(
banner
.
getSort
());
bannerVo
.
setState
(
banner
.
getState
());
bannerVo
.
setProvinceStr
(
banner
.
getProvince
());
bannerVo
.
setCityStr
(
banner
.
getCity
());
bannerVo
.
setAreaStr
(
banner
.
getArea
());
bannerVo
.
setShopIdsStr
(
banner
.
getShopIds
());
if
(!
StringUtils
.
isEmpty
(
banner
.
getProvince
()))
{
bannerVo
.
setProvince
(
banner
.
getProvince
().
split
(
","
));
String
str
=
banner
.
getProvince
().
substring
(
1
,
banner
.
getProvince
().
length
()
-
1
);
bannerVo
.
setProvinceStr
(
str
);
bannerVo
.
setProvince
(
str
.
split
(
","
));
}
if
(!
StringUtils
.
isEmpty
(
banner
.
getCity
()))
{
bannerVo
.
setCity
(
banner
.
getCity
().
split
(
","
));
String
str
=
banner
.
getCity
().
substring
(
1
,
banner
.
getCity
().
length
()
-
1
);
bannerVo
.
setCityStr
(
str
);
bannerVo
.
setCity
(
str
.
split
(
","
));
}
if
(!
StringUtils
.
isEmpty
(
banner
.
getArea
()))
{
bannerVo
.
setArea
(
banner
.
getArea
().
split
(
","
));
String
str
=
banner
.
getArea
().
substring
(
1
,
banner
.
getArea
().
length
()
-
1
);
bannerVo
.
setAreaStr
(
str
);
bannerVo
.
setArea
(
str
.
split
(
","
));
}
if
(!
StringUtils
.
isEmpty
(
banner
.
getShopIds
()))
{
String
[]
shopIds
=
banner
.
getShopIds
().
split
(
","
);
String
str
=
banner
.
getShopIds
().
substring
(
1
,
banner
.
getShopIds
().
length
()
-
1
);
bannerVo
.
setShopIdsStr
(
str
);
String
[]
shopIds
=
str
.
split
(
","
);
Long
[]
ids
=
new
Long
[
shopIds
.
length
];
for
(
int
i
=
0
;
i
<
shopIds
.
length
;
i
++)
{
ids
[
i
]
=
Long
.
parseLong
(
shopIds
[
i
]);
...
...
@@ -170,6 +166,15 @@ public class SysBannerServiceImpl implements ISysBannerService {
return
bannerVo
;
}
public
List
<
BannerVo
>
copyBanner
(
List
<
SysBanner
>
banners
)
{
List
<
BannerVo
>
bannerVos
=
new
ArrayList
<>();
if
(
CollectionUtils
.
isEmpty
(
banners
))
{
return
bannerVos
;
}
banners
.
forEach
(
banner
->
bannerVos
.
add
(
copyBanner
(
banner
)));
return
bannerVos
;
}
@Override
public
Boolean
updateState
(
Long
bannerId
,
Integer
state
)
{
SysBanner
banner
=
new
SysBanner
();
...
...
@@ -295,7 +300,7 @@ public class SysBannerServiceImpl implements ISysBannerService {
}
public
void
translateArea
(
List
<
BannerVo
>
bannerVos
)
{
if
(
CollectionUtils
.
isEmpty
(
bannerVos
))
{
if
(
CollectionUtils
.
isEmpty
(
bannerVos
))
{
return
;
}
List
<
String
>
province
=
new
ArrayList
<>(
16
);
...
...
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