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
0e138be9
Commit
0e138be9
authored
Feb 23, 2023
by
weijiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
下单时校验订单中sku数量
parent
8a8223ea
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
11 deletions
+34
-11
soss-system/src/main/java/com/soss/system/service/impl/SysBannerServiceImpl.java
+34
-11
No files found.
soss-system/src/main/java/com/soss/system/service/impl/SysBannerServiceImpl.java
View file @
0e138be9
...
@@ -139,22 +139,22 @@ public class SysBannerServiceImpl implements ISysBannerService {
...
@@ -139,22 +139,22 @@ public class SysBannerServiceImpl implements ISysBannerService {
bannerVo
.
setState
(
banner
.
getState
());
bannerVo
.
setState
(
banner
.
getState
());
if
(!
StringUtils
.
isEmpty
(
banner
.
getProvince
()))
{
if
(!
StringUtils
.
isEmpty
(
banner
.
getProvince
()))
{
String
str
=
banner
.
getProvince
().
substring
(
1
,
banner
.
getProvince
().
length
()
-
1
);
String
str
=
trim
(
banner
.
getProvince
()
);
bannerVo
.
setProvinceStr
(
str
);
bannerVo
.
setProvinceStr
(
str
);
bannerVo
.
setProvince
(
str
.
split
(
","
));
bannerVo
.
setProvince
(
str
.
split
(
","
));
}
}
if
(!
StringUtils
.
isEmpty
(
banner
.
getCity
()))
{
if
(!
StringUtils
.
isEmpty
(
banner
.
getCity
()))
{
String
str
=
banner
.
getCity
().
substring
(
1
,
banner
.
getCity
().
length
()
-
1
);
String
str
=
trim
(
banner
.
getCity
()
);
bannerVo
.
setCityStr
(
str
);
bannerVo
.
setCityStr
(
str
);
bannerVo
.
setCity
(
str
.
split
(
","
));
bannerVo
.
setCity
(
str
.
split
(
","
));
}
}
if
(!
StringUtils
.
isEmpty
(
banner
.
getArea
()))
{
if
(!
StringUtils
.
isEmpty
(
banner
.
getArea
()))
{
String
str
=
banner
.
getArea
().
substring
(
1
,
banner
.
getArea
().
length
()
-
1
);
String
str
=
trim
(
banner
.
getArea
()
);
bannerVo
.
setAreaStr
(
str
);
bannerVo
.
setAreaStr
(
str
);
bannerVo
.
setArea
(
str
.
split
(
","
));
bannerVo
.
setArea
(
str
.
split
(
","
));
}
}
if
(!
StringUtils
.
isEmpty
(
banner
.
getShopIds
()))
{
if
(!
StringUtils
.
isEmpty
(
banner
.
getShopIds
()))
{
String
str
=
banner
.
getShopIds
().
substring
(
1
,
banner
.
getShopIds
().
length
()
-
1
);
String
str
=
trim
(
banner
.
getShopIds
()
);
bannerVo
.
setShopIdsStr
(
str
);
bannerVo
.
setShopIdsStr
(
str
);
String
[]
shopIds
=
str
.
split
(
","
);
String
[]
shopIds
=
str
.
split
(
","
);
Long
[]
ids
=
new
Long
[
shopIds
.
length
];
Long
[]
ids
=
new
Long
[
shopIds
.
length
];
...
@@ -166,6 +166,13 @@ public class SysBannerServiceImpl implements ISysBannerService {
...
@@ -166,6 +166,13 @@ public class SysBannerServiceImpl implements ISysBannerService {
return
bannerVo
;
return
bannerVo
;
}
}
private
String
trim
(
String
str
)
{
if
(
StringUtils
.
isEmpty
(
str
))
{
return
str
;
}
return
str
.
substring
(
1
,
str
.
length
()
-
1
);
}
public
List
<
BannerVo
>
copyBanner
(
List
<
SysBanner
>
banners
)
{
public
List
<
BannerVo
>
copyBanner
(
List
<
SysBanner
>
banners
)
{
List
<
BannerVo
>
bannerVos
=
new
ArrayList
<>();
List
<
BannerVo
>
bannerVos
=
new
ArrayList
<>();
if
(
CollectionUtils
.
isEmpty
(
banners
))
{
if
(
CollectionUtils
.
isEmpty
(
banners
))
{
...
@@ -214,7 +221,12 @@ public class SysBannerServiceImpl implements ISysBannerService {
...
@@ -214,7 +221,12 @@ public class SysBannerServiceImpl implements ISysBannerService {
List
<
SysBanner
>
list
=
new
ArrayList
<>();
List
<
SysBanner
>
list
=
new
ArrayList
<>();
banners
.
forEach
(
banner
->
{
banners
.
forEach
(
banner
->
{
if
(!
StringUtils
.
isEmpty
(
banner
.
getProvince
()))
{
if
(!
StringUtils
.
isEmpty
(
banner
.
getProvince
()))
{
Arrays
.
stream
(
banner
.
getProvince
().
split
(
","
)).
forEach
(
p
->
{
String
province
=
trim
(
banner
.
getProvince
());
if
(
province
.
equals
(
"0"
))
{
list
.
add
(
banner
);
return
;
}
Arrays
.
stream
(
province
.
split
(
","
)).
forEach
(
p
->
{
if
(
p
.
equals
(
shop
.
getProvince
()))
{
if
(
p
.
equals
(
shop
.
getProvince
()))
{
list
.
add
(
banner
);
list
.
add
(
banner
);
return
;
return
;
...
@@ -222,7 +234,8 @@ public class SysBannerServiceImpl implements ISysBannerService {
...
@@ -222,7 +234,8 @@ public class SysBannerServiceImpl implements ISysBannerService {
});
});
}
}
if
(!
StringUtils
.
isEmpty
(
banner
.
getCity
()))
{
if
(!
StringUtils
.
isEmpty
(
banner
.
getCity
()))
{
Arrays
.
stream
(
banner
.
getCity
().
split
(
","
)).
forEach
(
p
->
{
String
city
=
trim
(
banner
.
getCity
());
Arrays
.
stream
(
city
.
split
(
","
)).
forEach
(
p
->
{
if
(
p
.
equals
(
shop
.
getCity
()))
{
if
(
p
.
equals
(
shop
.
getCity
()))
{
list
.
add
(
banner
);
list
.
add
(
banner
);
return
;
return
;
...
@@ -230,7 +243,8 @@ public class SysBannerServiceImpl implements ISysBannerService {
...
@@ -230,7 +243,8 @@ public class SysBannerServiceImpl implements ISysBannerService {
});
});
}
}
if
(!
StringUtils
.
isEmpty
(
banner
.
getArea
()))
{
if
(!
StringUtils
.
isEmpty
(
banner
.
getArea
()))
{
Arrays
.
stream
(
banner
.
getArea
().
split
(
","
)).
forEach
(
p
->
{
String
area
=
trim
(
banner
.
getArea
());
Arrays
.
stream
(
area
.
split
(
","
)).
forEach
(
p
->
{
if
(
p
.
equals
(
shop
.
getZone
()))
{
if
(
p
.
equals
(
shop
.
getZone
()))
{
list
.
add
(
banner
);
list
.
add
(
banner
);
return
;
return
;
...
@@ -238,7 +252,8 @@ public class SysBannerServiceImpl implements ISysBannerService {
...
@@ -238,7 +252,8 @@ public class SysBannerServiceImpl implements ISysBannerService {
});
});
}
}
if
(!
StringUtils
.
isEmpty
(
banner
.
getShopIds
()))
{
if
(!
StringUtils
.
isEmpty
(
banner
.
getShopIds
()))
{
Arrays
.
stream
(
banner
.
getShopIds
().
split
(
","
)).
forEach
(
p
->
{
String
shopIds
=
trim
(
banner
.
getShopIds
());
Arrays
.
stream
(
shopIds
.
split
(
","
)).
forEach
(
p
->
{
if
(
p
.
equals
(
String
.
valueOf
(
shop
.
getId
())))
{
if
(
p
.
equals
(
String
.
valueOf
(
shop
.
getId
())))
{
list
.
add
(
banner
);
list
.
add
(
banner
);
return
;
return
;
...
@@ -264,6 +279,11 @@ public class SysBannerServiceImpl implements ISysBannerService {
...
@@ -264,6 +279,11 @@ public class SysBannerServiceImpl implements ISysBannerService {
List
<
String
>
list
=
new
ArrayList
<>();
List
<
String
>
list
=
new
ArrayList
<>();
banners
.
forEach
(
banner
->
{
banners
.
forEach
(
banner
->
{
if
(!
StringUtils
.
isEmpty
(
banner
.
getProvince
()))
{
if
(!
StringUtils
.
isEmpty
(
banner
.
getProvince
()))
{
String
province
=
trim
(
banner
.
getProvince
());
if
(
province
.
equals
(
"0"
))
{
list
.
add
(
banner
.
getImage
());
return
;
}
Arrays
.
stream
(
banner
.
getProvince
().
split
(
","
)).
forEach
(
p
->
{
Arrays
.
stream
(
banner
.
getProvince
().
split
(
","
)).
forEach
(
p
->
{
if
(
p
.
equals
(
shop
.
getProvince
()))
{
if
(
p
.
equals
(
shop
.
getProvince
()))
{
list
.
add
(
banner
.
getImage
());
list
.
add
(
banner
.
getImage
());
...
@@ -272,7 +292,8 @@ public class SysBannerServiceImpl implements ISysBannerService {
...
@@ -272,7 +292,8 @@ public class SysBannerServiceImpl implements ISysBannerService {
});
});
}
}
if
(!
StringUtils
.
isEmpty
(
banner
.
getCity
()))
{
if
(!
StringUtils
.
isEmpty
(
banner
.
getCity
()))
{
Arrays
.
stream
(
banner
.
getCity
().
split
(
","
)).
forEach
(
p
->
{
String
city
=
trim
(
banner
.
getCity
());
Arrays
.
stream
(
city
.
split
(
","
)).
forEach
(
p
->
{
if
(
p
.
equals
(
shop
.
getCity
()))
{
if
(
p
.
equals
(
shop
.
getCity
()))
{
list
.
add
(
banner
.
getImage
());
list
.
add
(
banner
.
getImage
());
return
;
return
;
...
@@ -280,7 +301,8 @@ public class SysBannerServiceImpl implements ISysBannerService {
...
@@ -280,7 +301,8 @@ public class SysBannerServiceImpl implements ISysBannerService {
});
});
}
}
if
(!
StringUtils
.
isEmpty
(
banner
.
getArea
()))
{
if
(!
StringUtils
.
isEmpty
(
banner
.
getArea
()))
{
Arrays
.
stream
(
banner
.
getArea
().
split
(
","
)).
forEach
(
p
->
{
String
area
=
trim
(
banner
.
getArea
());
Arrays
.
stream
(
area
.
split
(
","
)).
forEach
(
p
->
{
if
(
p
.
equals
(
shop
.
getZone
()))
{
if
(
p
.
equals
(
shop
.
getZone
()))
{
list
.
add
(
banner
.
getImage
());
list
.
add
(
banner
.
getImage
());
return
;
return
;
...
@@ -288,7 +310,8 @@ public class SysBannerServiceImpl implements ISysBannerService {
...
@@ -288,7 +310,8 @@ public class SysBannerServiceImpl implements ISysBannerService {
});
});
}
}
if
(!
StringUtils
.
isEmpty
(
banner
.
getShopIds
()))
{
if
(!
StringUtils
.
isEmpty
(
banner
.
getShopIds
()))
{
Arrays
.
stream
(
banner
.
getShopIds
().
split
(
","
)).
forEach
(
p
->
{
String
shopIds
=
trim
(
banner
.
getShopIds
());
Arrays
.
stream
(
shopIds
.
split
(
","
)).
forEach
(
p
->
{
if
(
p
.
equals
(
String
.
valueOf
(
shop
.
getId
())))
{
if
(
p
.
equals
(
String
.
valueOf
(
shop
.
getId
())))
{
list
.
add
(
banner
.
getImage
());
list
.
add
(
banner
.
getImage
());
return
;
return
;
...
...
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