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
20eb3f2a
Commit
20eb3f2a
authored
Mar 18, 2020
by
renjie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
过滤bug
parent
77dba7c2
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
5 deletions
+12
-5
ShopFilterDto.java
...a/com/edgec/browserbackend/browser/dto/ShopFilterDto.java
+3
-3
UserShopRepository.java
...browserbackend/browser/repository/UserShopRepository.java
+1
-0
ShopServiceImpl.java
.../browserbackend/browser/service/Impl/ShopServiceImpl.java
+8
-2
No files found.
src/main/java/com/edgec/browserbackend/browser/dto/ShopFilterDto.java
View file @
20eb3f2a
...
@@ -7,7 +7,7 @@ public class ShopFilterDto {
...
@@ -7,7 +7,7 @@ public class ShopFilterDto {
private
String
shopName
;
private
String
shopName
;
private
String
IpRegion
;
private
String
IpRegion
;
private
String
shopAccount
;
private
String
shopAccount
;
private
boolean
bindIp
;
private
int
bindIp
;
public
String
getShopAccount
()
{
public
String
getShopAccount
()
{
return
shopAccount
;
return
shopAccount
;
...
@@ -33,11 +33,11 @@ public class ShopFilterDto {
...
@@ -33,11 +33,11 @@ public class ShopFilterDto {
this
.
shopName
=
shopName
;
this
.
shopName
=
shopName
;
}
}
public
boolean
is
BindIp
()
{
public
int
get
BindIp
()
{
return
bindIp
;
return
bindIp
;
}
}
public
void
setBindIp
(
boolean
bindIp
)
{
public
void
setBindIp
(
int
bindIp
)
{
this
.
bindIp
=
bindIp
;
this
.
bindIp
=
bindIp
;
}
}
}
}
src/main/java/com/edgec/browserbackend/browser/repository/UserShopRepository.java
View file @
20eb3f2a
...
@@ -10,6 +10,7 @@ public interface UserShopRepository extends MongoRepository<UserShop, String>, U
...
@@ -10,6 +10,7 @@ public interface UserShopRepository extends MongoRepository<UserShop, String>, U
List
<
UserShop
>
findByUsernameAndIpIdIsNull
(
String
username
);
List
<
UserShop
>
findByUsernameAndIpIdIsNull
(
String
username
);
UserShop
findByUsernameAndShopId
(
String
username
,
String
shopId
);
UserShop
findByUsernameAndShopId
(
String
username
,
String
shopId
);
UserShop
findByShopId
(
String
shopId
);
UserShop
findByShopId
(
String
shopId
);
List
<
UserShop
>
findByUsernameAndGroupId
(
String
username
,
String
groupId
);
List
<
UserShop
>
findByUsernameAndGroupIdAndIpIdIsNull
(
String
username
,
String
groupId
);
List
<
UserShop
>
findByUsernameAndGroupIdAndIpIdIsNull
(
String
username
,
String
groupId
);
List
<
UserShop
>
findByUsernameAndGroupIdAndIpIdIsNotNull
(
String
username
,
String
groupId
);
List
<
UserShop
>
findByUsernameAndGroupIdAndIpIdIsNotNull
(
String
username
,
String
groupId
);
List
<
UserShop
>
findByUsernameAndShopIdIn
(
String
username
,
List
<
String
>
shopIds
);
List
<
UserShop
>
findByUsernameAndShopIdIn
(
String
username
,
List
<
String
>
shopIds
);
...
...
src/main/java/com/edgec/browserbackend/browser/service/Impl/ShopServiceImpl.java
View file @
20eb3f2a
...
@@ -359,14 +359,20 @@ public class ShopServiceImpl implements ShopService {
...
@@ -359,14 +359,20 @@ public class ShopServiceImpl implements ShopService {
}
}
List
<
String
>
shopIds
=
new
ArrayList
<>();
List
<
String
>
shopIds
=
new
ArrayList
<>();
if
(
groupId
.
equals
(
"-1"
))
{
if
(
groupId
.
equals
(
"-1"
))
{
if
(
shopFilterDto
.
isBindIp
())
if
(
shopFilterDto
.
getBindIp
()
==
0
)
shopIds
=
userShopRepository
.
findByUsername
(
username
).
stream
().
map
(
x
->
x
.
getShopId
()).
collect
(
Collectors
.
toList
());
else
if
(
shopFilterDto
.
getBindIp
()
==
1
)
shopIds
=
userShopRepository
.
findByUsernameAndIpIdIsNotNull
(
username
).
stream
().
shopIds
=
userShopRepository
.
findByUsernameAndIpIdIsNotNull
(
username
).
stream
().
map
(
x
->
x
.
getShopId
()).
collect
(
Collectors
.
toList
());
map
(
x
->
x
.
getShopId
()).
collect
(
Collectors
.
toList
());
else
else
shopIds
=
userShopRepository
.
findByUsernameAndIpIdIsNull
(
username
).
stream
().
shopIds
=
userShopRepository
.
findByUsernameAndIpIdIsNull
(
username
).
stream
().
map
(
x
->
x
.
getShopId
()).
collect
(
Collectors
.
toList
());
map
(
x
->
x
.
getShopId
()).
collect
(
Collectors
.
toList
());
}
else
{
}
else
{
if
(
shopFilterDto
.
isBindIp
())
if
(
shopFilterDto
.
getBindIp
()
==
0
)
shopIds
=
userShopRepository
.
findByUsernameAndGroupId
(
username
,
groupId
).
stream
().
map
(
x
->
x
.
getShopId
()).
collect
(
Collectors
.
toList
());
else
if
(
shopFilterDto
.
getBindIp
()
==
1
)
shopIds
=
userShopRepository
.
findByUsernameAndGroupIdAndIpIdIsNotNull
(
username
,
groupId
).
stream
().
shopIds
=
userShopRepository
.
findByUsernameAndGroupIdAndIpIdIsNotNull
(
username
,
groupId
).
stream
().
map
(
x
->
x
.
getShopId
()).
collect
(
Collectors
.
toList
());
map
(
x
->
x
.
getShopId
()).
collect
(
Collectors
.
toList
());
else
else
...
...
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