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
933d81b6
Commit
933d81b6
authored
May 12, 2020
by
renjie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
店铺bug
parent
fab91973
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
7 deletions
+28
-7
UserShopRepositoryCustom.java
...rbackend/browser/repository/UserShopRepositoryCustom.java
+2
-0
UserShopRepositoryCustomImpl.java
...kend/browser/repository/UserShopRepositoryCustomImpl.java
+12
-0
IpResourceServiceImpl.java
...erbackend/browser/service/Impl/IpResourceServiceImpl.java
+0
-5
ShopServiceImpl.java
.../browserbackend/browser/service/Impl/ShopServiceImpl.java
+14
-2
No files found.
src/main/java/com/edgec/browserbackend/browser/repository/UserShopRepositoryCustom.java
View file @
933d81b6
...
@@ -4,6 +4,8 @@ public interface UserShopRepositoryCustom {
...
@@ -4,6 +4,8 @@ public interface UserShopRepositoryCustom {
boolean
deleteByUsernameAndShopId
(
String
username
,
String
shopId
);
boolean
deleteByUsernameAndShopId
(
String
username
,
String
shopId
);
boolean
deleteByShopId
(
String
shopId
);
void
updateGroupId
(
String
groupId_old
,
String
groupId_new
);
void
updateGroupId
(
String
groupId_old
,
String
groupId_new
);
boolean
deleteByShopIdExceptOwner
(
String
shopId
,
String
owner
);
boolean
deleteByShopIdExceptOwner
(
String
shopId
,
String
owner
);
...
...
src/main/java/com/edgec/browserbackend/browser/repository/UserShopRepositoryCustomImpl.java
View file @
933d81b6
...
@@ -31,6 +31,18 @@ public class UserShopRepositoryCustomImpl implements UserShopRepositoryCustom {
...
@@ -31,6 +31,18 @@ public class UserShopRepositoryCustomImpl implements UserShopRepositoryCustom {
return
true
;
return
true
;
}
}
@Override
public
boolean
deleteByShopId
(
String
shopId
)
{
Document
doc
=
new
Document
();
BasicQuery
basicQuery
=
new
BasicQuery
(
doc
);
basicQuery
.
addCriteria
(
where
(
"shopId"
).
is
(
shopId
));
DeleteResult
operation
=
mongoTemplate
.
remove
(
basicQuery
,
UserShop
.
class
);
if
(
operation
.
getDeletedCount
()
<
1
)
return
false
;
else
return
true
;
}
@Override
@Override
public
void
updateGroupId
(
String
groupId_old
,
String
groupId_new
)
{
public
void
updateGroupId
(
String
groupId_old
,
String
groupId_new
)
{
Document
doc
=
new
Document
();
Document
doc
=
new
Document
();
...
...
src/main/java/com/edgec/browserbackend/browser/service/Impl/IpResourceServiceImpl.java
View file @
933d81b6
...
@@ -182,11 +182,6 @@ public class IpResourceServiceImpl implements IpResourceService {
...
@@ -182,11 +182,6 @@ public class IpResourceServiceImpl implements IpResourceService {
return
retStr
;
return
retStr
;
}
}
public
static
void
main
(
String
[]
args
)
{
String
password
=
genRandom
(
3
,
12
);
System
.
out
.
println
(
password
);
}
private
IpChargeRequestDto
buildIpChargeRequestDto
(
IpResourceRequestDto
request
,
int
chargeType
,
int
payMethod
)
{
private
IpChargeRequestDto
buildIpChargeRequestDto
(
IpResourceRequestDto
request
,
int
chargeType
,
int
payMethod
)
{
IpChargeRequestDto
ipChargeRequestDto
=
new
IpChargeRequestDto
();
IpChargeRequestDto
ipChargeRequestDto
=
new
IpChargeRequestDto
();
ipChargeRequestDto
.
setAmount
(
request
.
getAmount
());
ipChargeRequestDto
.
setAmount
(
request
.
getAmount
());
...
...
src/main/java/com/edgec/browserbackend/browser/service/Impl/ShopServiceImpl.java
View file @
933d81b6
...
@@ -99,6 +99,11 @@ public class ShopServiceImpl implements ShopService {
...
@@ -99,6 +99,11 @@ public class ShopServiceImpl implements ShopService {
userShop
.
setGroupId
(
shopResultDto
.
getGroup
());
userShop
.
setGroupId
(
shopResultDto
.
getGroup
());
}
}
userShopRepository
.
save
(
userShop
);
userShopRepository
.
save
(
userShop
);
if
(
StringUtils
.
isNotBlank
(
account
.
getParent
()))
{
userShop
.
setUsername
(
account
.
getParent
());
userShop
.
setGroupId
(
"-1"
);
userShopRepository
.
save
(
userShop
);
}
//可以优化
//可以优化
account
.
setShopCount
(
account
.
getShopCount
()
+
1
);
account
.
setShopCount
(
account
.
getShopCount
()
+
1
);
accountRepository
.
save
(
account
);
accountRepository
.
save
(
account
);
...
@@ -155,6 +160,11 @@ public class ShopServiceImpl implements ShopService {
...
@@ -155,6 +160,11 @@ public class ShopServiceImpl implements ShopService {
userShop
.
setGroupId
(
shopResultDto
.
getGroup
());
userShop
.
setGroupId
(
shopResultDto
.
getGroup
());
}
}
userShopRepository
.
save
(
userShop
);
userShopRepository
.
save
(
userShop
);
if
(
StringUtils
.
isNotBlank
(
account
.
getParent
()))
{
userShop
.
setUsername
(
account
.
getParent
());
userShop
.
setGroupId
(
"-1"
);
userShopRepository
.
save
(
userShop
);
}
//可以优化
//可以优化
account
.
setShopCount
(
account
.
getShopCount
()
+
1
);
account
.
setShopCount
(
account
.
getShopCount
()
+
1
);
accountRepository
.
save
(
account
);
accountRepository
.
save
(
account
);
...
@@ -215,7 +225,7 @@ public class ShopServiceImpl implements ShopService {
...
@@ -215,7 +225,7 @@ public class ShopServiceImpl implements ShopService {
ipResource
.
setShopId
(
null
);
ipResource
.
setShopId
(
null
);
ipResourceRepository
.
save
(
ipResource
);
ipResourceRepository
.
save
(
ipResource
);
}
}
boolean
result
=
userShopRepository
.
deleteBy
UsernameAndShopId
(
username
,
shopId
);
boolean
result
=
userShopRepository
.
deleteBy
ShopId
(
shopId
);
if
(
result
)
{
if
(
result
)
{
shopRepository
.
deleteById
(
shopId
);
shopRepository
.
deleteById
(
shopId
);
account
.
setShopCount
(
account
.
getShopCount
()
-
1
);
account
.
setShopCount
(
account
.
getShopCount
()
-
1
);
...
@@ -402,6 +412,8 @@ public class ShopServiceImpl implements ShopService {
...
@@ -402,6 +412,8 @@ public class ShopServiceImpl implements ShopService {
if
(
shops
==
null
||
shops
.
getNumberOfElements
()
<
1
)
if
(
shops
==
null
||
shops
.
getNumberOfElements
()
<
1
)
return
new
ShopPageResultDto
();
return
new
ShopPageResultDto
();
List
<
ShopResultDto
>
shopResultDtos
=
new
ArrayList
<>();
List
<
ShopResultDto
>
shopResultDtos
=
new
ArrayList
<>();
logger
.
error
(
"shops.size"
+
shops
.
getNumberOfElements
());
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
.
findByShopIdAndIsDeleted
(
x
.
getShopId
(),
false
);
if
(
ipResource
==
null
)
if
(
ipResource
==
null
)
...
@@ -450,7 +462,7 @@ public class ShopServiceImpl implements ShopService {
...
@@ -450,7 +462,7 @@ public class ShopServiceImpl implements ShopService {
int
willexpired
=
ipResourceRepository
.
countByStatusAndIdInAndIsDeleted
(
2
,
bind
,
false
);
int
willexpired
=
ipResourceRepository
.
countByStatusAndIdInAndIsDeleted
(
2
,
bind
,
false
);
shopSummary
.
setExpired
(
expired
);
shopSummary
.
setExpired
(
expired
);
shopSummary
.
setWillExpire
(
willexpired
);
shopSummary
.
setWillExpire
(
willexpired
);
shopSummary
.
setTotal
(
userShopRepository
.
countByUsername
(
username
));
shopSummary
.
setTotal
(
shopIds
.
size
(
));
return
shopSummary
;
return
shopSummary
;
}
}
...
...
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