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
f423ad8b
Commit
f423ad8b
authored
May 19, 2020
by
renjie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
admin接口bug
parent
63d370b3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
AdministratorServiceImpl.java
...ackend/account/service/impl/AdministratorServiceImpl.java
+4
-4
IpResourceRepository.java
...owserbackend/browser/repository/IpResourceRepository.java
+2
-2
No files found.
src/main/java/com/edgec/browserbackend/account/service/impl/AdministratorServiceImpl.java
View file @
f423ad8b
...
...
@@ -382,7 +382,7 @@ public class AdministratorServiceImpl implements AdministratorService {
public
IpCountQueryResultDto
queyrIpCount
(
String
username
)
{
IpCountQueryResultDto
ipCountQueryResultDto
=
new
IpCountQueryResultDto
();
if
(
StringUtils
.
isBlank
(
username
))
{
long
ipcount_using
=
ipResourceRepository
.
countAllByIsDeleted
(
false
);
long
ipcount_using
=
ipResourceRepository
.
countAllByIsDeleted
AndValidTimeGreaterThan
(
false
,
Instant
.
now
().
toEpochMilli
()
);
long
ipcount_all
=
ipResourceRepository
.
count
();
ipCountQueryResultDto
.
setIpCount_using
(
ipcount_using
);
ipCountQueryResultDto
.
setIpCount_all
(
ipcount_all
);
...
...
@@ -394,7 +394,7 @@ public class AdministratorServiceImpl implements AdministratorService {
ipCountQueryResultDto
.
setIpCount_using
(
ipCountRecord
.
getIp_using
());
}
}
else
{
long
ipcount_using
=
ipResourceRepository
.
countAllByOwnerAndIsDeleted
(
username
,
false
);
long
ipcount_using
=
ipResourceRepository
.
countAllByOwnerAndIsDeleted
AndValidTimeGreaterThan
(
username
,
false
,
Instant
.
now
().
toEpochMilli
()
);
long
ipcount_all
=
ipResourceRepository
.
countAllByOwner
(
username
);
ipCountQueryResultDto
.
setIpCount_using
(
ipcount_using
);
ipCountQueryResultDto
.
setIpCount_all
(
ipcount_all
);
...
...
@@ -453,12 +453,12 @@ public class AdministratorServiceImpl implements AdministratorService {
promotion
.
setTotalCommission
(
promotion
.
getTotalCommission
()
+
(
int
)
totalCommission
);
promotion
.
setCommission
(
promotion
.
getCommission
()
+
x
.
getPromotion
().
getCommission
());
double
secondCommission
=
0
;
ipCount
.
addAndGet
(
ipResourceRepository
.
countAllByOwnerAndIsDeleted
(
x
.
getName
(),
false
));
ipCount
.
addAndGet
(
ipResourceRepository
.
countAllByOwnerAndIsDeleted
AndValidTimeGreaterThan
(
x
.
getName
(),
false
,
Instant
.
now
().
toEpochMilli
()
));
if
(
finalAccount
.
getPromotion
().
isSale
()
&&
x
.
getParent
()
==
null
)
{
List
<
Account
>
secondPromotes
=
accountRepository
.
findByPromotionCodeAndParentIsNull
(
x
.
getPromotion
().
getCode
());
if
(
secondPromotes
!=
null
&&
secondPromotes
.
size
()
>
0
)
{
for
(
Account
secondPromote
:
secondPromotes
)
{
ipCount
.
addAndGet
(
ipResourceRepository
.
countAllByOwnerAndIsDeleted
(
secondPromote
.
getName
(),
false
));
ipCount
.
addAndGet
(
ipResourceRepository
.
countAllByOwnerAndIsDeleted
AndValidTimeGreaterThan
(
secondPromote
.
getName
(),
false
,
Instant
.
now
().
toEpochMilli
()
));
List
<
UserPrePaidBilling
>
userPrePaidBillings1
=
userPrePaidBillingRepository
.
findByAdministratorAndPayMethodInAndTimestampBetween
(
secondPromote
.
getName
(),
Arrays
.
asList
(
1
,
2
,
3
),
dateTime1
.
getTime
(),
dateTime2
.
getTime
());
if
(
userPrePaidBillings1
!=
null
&&
userPrePaidBillings1
.
size
()
>
0
)
secondCommission
+=
userPrePaidBillings1
.
stream
().
mapToDouble
(
UserPrePaidBilling:
:
getTotal
).
sum
();
...
...
src/main/java/com/edgec/browserbackend/browser/repository/IpResourceRepository.java
View file @
f423ad8b
...
...
@@ -44,8 +44,8 @@ public interface IpResourceRepository extends MongoRepository<IpResource, String
int
countByStatusAndIdInAndIsDeleted
(
int
status
,
List
<
String
>
ipIds
,
boolean
isDeleted
);
long
countAllByIsDeleted
(
boolean
isDeleted
);
long
countAllByIsDeleted
AndValidTimeGreaterThan
(
boolean
isDeleted
,
long
time
);
long
countAllByOwnerAndIsDeleted
(
String
username
,
boolean
isDeleted
);
long
countAllByOwnerAndIsDeleted
AndValidTimeGreaterThan
(
String
username
,
boolean
isDeleted
,
long
time
);
long
countAllByOwner
(
String
username
);
}
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