Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
B
browser-backend
Project
Project
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
Administrator
browser-backend
Commits
e9069583
Commit
e9069583
authored
May 12, 2020
by
renjie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
店铺bug
parent
14d216cd
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
ShopServiceImpl.java
.../browserbackend/browser/service/Impl/ShopServiceImpl.java
+6
-6
No files found.
src/main/java/com/edgec/browserbackend/browser/service/Impl/ShopServiceImpl.java
View file @
e9069583
...
@@ -223,7 +223,7 @@ public class ShopServiceImpl implements ShopService {
...
@@ -223,7 +223,7 @@ public class ShopServiceImpl implements ShopService {
Shop
shop
=
shopRepository
.
findById
(
shopId
).
orElse
(
null
);
Shop
shop
=
shopRepository
.
findById
(
shopId
).
orElse
(
null
);
if
(
shop
==
null
)
if
(
shop
==
null
)
throw
new
ClientRequestException
(
BrowserErrorCode
.
SHOPNOTEXIST
);
throw
new
ClientRequestException
(
BrowserErrorCode
.
SHOPNOTEXIST
);
IpResource
ipResource
=
ipResourceRepository
.
findByShopIdAndIsDeleted
(
shop
.
getShopId
(),
false
);
IpResource
ipResource
=
ipResourceRepository
.
find
First
ByShopIdAndIsDeleted
(
shop
.
getShopId
(),
false
);
if
(
ipResource
!=
null
)
{
if
(
ipResource
!=
null
)
{
ipResource
.
setShopName
(
null
);
ipResource
.
setShopName
(
null
);
ipResource
.
setShopId
(
null
);
ipResource
.
setShopId
(
null
);
...
@@ -330,7 +330,7 @@ public class ShopServiceImpl implements ShopService {
...
@@ -330,7 +330,7 @@ public class ShopServiceImpl implements ShopService {
if
(
shop
==
null
)
{
if
(
shop
==
null
)
{
throw
new
ClientRequestException
(
BrowserErrorCode
.
SHOPNOTEXIST
);
throw
new
ClientRequestException
(
BrowserErrorCode
.
SHOPNOTEXIST
);
}
}
IpResource
ipResource
=
ipResourceRepository
.
findByShopIdAndIsDeleted
(
shopId
,
false
);
IpResource
ipResource
=
ipResourceRepository
.
find
First
ByShopIdAndIsDeleted
(
shopId
,
false
);
if
(
ipResource
==
null
)
if
(
ipResource
==
null
)
throw
new
ClientRequestException
(
BrowserErrorCode
.
IPNOTEXIST
);
throw
new
ClientRequestException
(
BrowserErrorCode
.
IPNOTEXIST
);
String
group
=
userShopRepository
.
findByUsernameAndShopId
(
username
,
shop
.
getShopId
()).
getGroupId
();
String
group
=
userShopRepository
.
findByUsernameAndShopId
(
username
,
shop
.
getShopId
()).
getGroupId
();
...
@@ -376,7 +376,7 @@ public class ShopServiceImpl implements ShopService {
...
@@ -376,7 +376,7 @@ public class ShopServiceImpl implements ShopService {
List
<
String
>
allIds
=
userShopRepository
.
findByUsername
(
username
).
stream
()
List
<
String
>
allIds
=
userShopRepository
.
findByUsername
(
username
).
stream
()
.
map
(
x
->
x
.
getShopId
()).
collect
(
Collectors
.
toList
());
.
map
(
x
->
x
.
getShopId
()).
collect
(
Collectors
.
toList
());
for
(
String
id:
allIds
)
{
for
(
String
id:
allIds
)
{
IpResource
ipResource
=
ipResourceRepository
.
findByShopIdAndIsDeleted
(
id
,
false
);
IpResource
ipResource
=
ipResourceRepository
.
find
First
ByShopIdAndIsDeleted
(
id
,
false
);
if
(
ipResource
==
null
)
if
(
ipResource
==
null
)
shopIds
.
add
(
id
);
shopIds
.
add
(
id
);
}
}
...
@@ -395,7 +395,7 @@ public class ShopServiceImpl implements ShopService {
...
@@ -395,7 +395,7 @@ public class ShopServiceImpl implements ShopService {
List
<
String
>
allIds
=
userShopRepository
.
findByUsernameAndGroupId
(
username
,
groupId
).
stream
()
List
<
String
>
allIds
=
userShopRepository
.
findByUsernameAndGroupId
(
username
,
groupId
).
stream
()
.
map
(
x
->
x
.
getShopId
()).
collect
(
Collectors
.
toList
());
.
map
(
x
->
x
.
getShopId
()).
collect
(
Collectors
.
toList
());
for
(
String
id:
allIds
)
{
for
(
String
id:
allIds
)
{
IpResource
ipResource
=
ipResourceRepository
.
findByShopIdAndIsDeleted
(
id
,
false
);
IpResource
ipResource
=
ipResourceRepository
.
find
First
ByShopIdAndIsDeleted
(
id
,
false
);
if
(
ipResource
==
null
)
if
(
ipResource
==
null
)
shopIds
.
add
(
id
);
shopIds
.
add
(
id
);
}
}
...
@@ -419,7 +419,7 @@ public class ShopServiceImpl implements ShopService {
...
@@ -419,7 +419,7 @@ public class ShopServiceImpl implements ShopService {
logger
.
error
(
"shops.size"
+
shops
.
getNumberOfElements
());
logger
.
error
(
"shops.size"
+
shops
.
getNumberOfElements
());
logger
.
error
(
"shops.content.size "
+
shops
.
getContent
().
size
());
logger
.
error
(
"shops.content.size "
+
shops
.
getContent
().
size
());
shops
.
getContent
().
stream
().
forEach
(
x
->
{
shops
.
getContent
().
stream
().
forEach
(
x
->
{
IpResource
ipResource
=
ipResourceRepository
.
findByShopIdAndIsDeleted
(
x
.
getShopId
(),
false
);
IpResource
ipResource
=
ipResourceRepository
.
find
First
ByShopIdAndIsDeleted
(
x
.
getShopId
(),
false
);
if
(
ipResource
==
null
)
if
(
ipResource
==
null
)
ipResource
=
new
IpResource
();
ipResource
=
new
IpResource
();
String
group1
=
userShopRepository
.
findByUsernameAndShopId
(
username
,
x
.
getShopId
()).
getGroupId
();
String
group1
=
userShopRepository
.
findByUsernameAndShopId
(
username
,
x
.
getShopId
()).
getGroupId
();
...
@@ -453,7 +453,7 @@ public class ShopServiceImpl implements ShopService {
...
@@ -453,7 +453,7 @@ public class ShopServiceImpl implements ShopService {
List
<
String
>
unbind
=
new
ArrayList
<>();
List
<
String
>
unbind
=
new
ArrayList
<>();
if
(
allShopIds
!=
null
&&
allShopIds
.
size
()
>
0
)
{
if
(
allShopIds
!=
null
&&
allShopIds
.
size
()
>
0
)
{
for
(
String
id:
allShopIds
)
{
for
(
String
id:
allShopIds
)
{
IpResource
ipResource
=
ipResourceRepository
.
findByShopIdAndIsDeleted
(
id
,
false
);
IpResource
ipResource
=
ipResourceRepository
.
find
First
ByShopIdAndIsDeleted
(
id
,
false
);
if
(
ipResource
==
null
)
{
if
(
ipResource
==
null
)
{
unbind
.
add
(
id
);
unbind
.
add
(
id
);
}
}
...
...
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