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
b586b3b8
Commit
b586b3b8
authored
Mar 10, 2020
by
renjie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shop接口bug修改
parent
10cd257b
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
15 deletions
+12
-15
ShopRepository.java
...gec/browserbackend/browser/repository/ShopRepository.java
+4
-4
ShopServiceImpl.java
.../browserbackend/browser/service/Impl/ShopServiceImpl.java
+8
-11
No files found.
src/main/java/com/edgec/browserbackend/browser/repository/ShopRepository.java
View file @
b586b3b8
...
@@ -8,8 +8,8 @@ import org.springframework.data.mongodb.repository.MongoRepository;
...
@@ -8,8 +8,8 @@ import org.springframework.data.mongodb.repository.MongoRepository;
import
java.util.List
;
import
java.util.List
;
public
interface
ShopRepository
extends
MongoRepository
<
Shop
,
String
>
{
public
interface
ShopRepository
extends
MongoRepository
<
Shop
,
String
>
{
Page
<
Shop
>
findByShopIdInAndIpRegionLike
(
List
<
String
>
shopIds
,
String
ipRegion
,
Pageable
pageable
);
List
<
Shop
>
findByShopIdInAndIpRegionLike
(
List
<
String
>
shopIds
,
String
ipRegion
);
Page
<
Shop
>
findByShopIdInAndShopAccountLike
(
List
<
String
>
shopIds
,
String
shopAccount
,
Pageable
pageable
);
List
<
Shop
>
findByShopIdInAndShopAccountLike
(
List
<
String
>
shopIds
,
String
shopAccount
);
Page
<
Shop
>
findByShopIdInAndShopNameLike
(
List
<
String
>
shopIds
,
String
shopName
,
Pageable
pageabl
e
);
List
<
Shop
>
findByShopIdInAndShopNameLike
(
List
<
String
>
shopIds
,
String
shopNam
e
);
Page
<
Shop
>
findByShopIdIn
(
List
<
String
>
shopIds
,
Pageable
pageable
);
List
<
Shop
>
findByShopIdIn
(
List
<
String
>
shopIds
);
}
}
src/main/java/com/edgec/browserbackend/browser/service/Impl/ShopServiceImpl.java
View file @
b586b3b8
...
@@ -250,7 +250,7 @@ public class ShopServiceImpl implements ShopService {
...
@@ -250,7 +250,7 @@ public class ShopServiceImpl implements ShopService {
throw
new
ClientRequestException
(
AccountErrorCode
.
NOPERMISSION
);
throw
new
ClientRequestException
(
AccountErrorCode
.
NOPERMISSION
);
}
}
Pageable
pageable
=
PageRequest
.
of
(
0
,
100
);
Pageable
pageable
=
PageRequest
.
of
(
0
,
100
);
List
<
Shop
>
shops
=
shopRepository
.
findByShopIdIn
(
shopIds
,
pageable
).
getContent
(
);
List
<
Shop
>
shops
=
shopRepository
.
findByShopIdIn
(
shopIds
);
if
(
shops
==
null
||
shops
.
size
()
<
1
)
if
(
shops
==
null
||
shops
.
size
()
<
1
)
throw
new
ClientRequestException
(
BrowserErrorCode
.
SHOPNOTEXIST
);
throw
new
ClientRequestException
(
BrowserErrorCode
.
SHOPNOTEXIST
);
List
<
Account
>
accounts
=
accountRepository
.
findByNameIn
(
users
);
List
<
Account
>
accounts
=
accountRepository
.
findByNameIn
(
users
);
...
@@ -296,22 +296,19 @@ public class ShopServiceImpl implements ShopService {
...
@@ -296,22 +296,19 @@ public class ShopServiceImpl implements ShopService {
shopIds
=
userShopRepository
.
findByUsernameAndGroupId
(
username
,
groupId
).
stream
().
shopIds
=
userShopRepository
.
findByUsernameAndGroupId
(
username
,
groupId
).
stream
().
map
(
x
->
x
.
getShopId
()).
collect
(
Collectors
.
toList
());
map
(
x
->
x
.
getShopId
()).
collect
(
Collectors
.
toList
());
}
}
logger
.
error
(
"shopIds.size "
+
shopIds
.
size
());
List
<
Shop
>
shops
;
Page
<
Shop
>
shops
;
if
(
filterDto
!=
null
&&
StringUtils
.
isNotBlank
(
filterDto
.
getIpRegion
()))
if
(
filterDto
!=
null
&&
StringUtils
.
isNotBlank
(
filterDto
.
getIpRegion
()))
shops
=
shopRepository
.
findByShopIdInAndIpRegionLike
(
shopIds
,
filterDto
.
getIpRegion
()
,
pageable
);
shops
=
shopRepository
.
findByShopIdInAndIpRegionLike
(
shopIds
,
filterDto
.
getIpRegion
());
else
if
(
filterDto
!=
null
&&
StringUtils
.
isNotBlank
(
filterDto
.
getShopAccount
()))
else
if
(
filterDto
!=
null
&&
StringUtils
.
isNotBlank
(
filterDto
.
getShopAccount
()))
shops
=
shopRepository
.
findByShopIdInAndShopAccountLike
(
shopIds
,
filterDto
.
getShopAccount
()
,
pageable
);
shops
=
shopRepository
.
findByShopIdInAndShopAccountLike
(
shopIds
,
filterDto
.
getShopAccount
());
else
if
(
filterDto
!=
null
&&
StringUtils
.
isNotBlank
(
filterDto
.
getShopName
()))
else
if
(
filterDto
!=
null
&&
StringUtils
.
isNotBlank
(
filterDto
.
getShopName
()))
shops
=
shopRepository
.
findByShopIdInAndShopNameLike
(
shopIds
,
filterDto
.
getShopName
()
,
pageable
);
shops
=
shopRepository
.
findByShopIdInAndShopNameLike
(
shopIds
,
filterDto
.
getShopName
());
else
else
shops
=
shopRepository
.
findByShopIdIn
(
shopIds
,
pageable
);
shops
=
shopRepository
.
findByShopIdIn
(
shopIds
);
if
(
shops
==
null
||
shops
.
getNumberOfElements
()
<
1
)
if
(
shops
==
null
||
shops
.
size
()
<
1
)
return
new
ShopPageResultDto
();
return
new
ShopPageResultDto
();
List
<
ShopDto
>
shopDtos
=
new
ArrayList
<>();
List
<
ShopDto
>
shopDtos
=
new
ArrayList
<>();
logger
.
error
(
"numberofelem "
+
shops
.
getNumberOfElements
());
shops
.
stream
().
forEach
(
x
->
{
logger
.
error
(
"totalelements "
+
shops
.
getTotalElements
());
shops
.
getContent
().
stream
().
forEach
(
x
->
{
IpResource
ipResource
=
ipResourceRepository
.
findByAddrAndIsDeleted
(
x
.
getIp
(),
false
);
IpResource
ipResource
=
ipResourceRepository
.
findByAddrAndIsDeleted
(
x
.
getIp
(),
false
);
if
(
ipResource
==
null
)
if
(
ipResource
==
null
)
ipResource
=
new
IpResource
();
ipResource
=
new
IpResource
();
...
...
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