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
3a8148c6
Commit
3a8148c6
authored
Apr 15, 2020
by
renjie
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev-zrj' into 'staging'
bug修改 See merge request
!9
parents
daa7c1bf
ab16a2c2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
5 deletions
+4
-5
UserPrePaidBillingRepository.java
...kend/account/repository/UserPrePaidBillingRepository.java
+2
-2
AdministratorServiceImpl.java
...ackend/account/service/impl/AdministratorServiceImpl.java
+2
-3
No files found.
src/main/java/com/edgec/browserbackend/account/repository/UserPrePaidBillingRepository.java
View file @
3a8148c6
...
...
@@ -36,9 +36,9 @@ public interface UserPrePaidBillingRepository extends MongoRepository<UserPrePai
List
<
UserPrePaidBilling
>
findByStatus
(
BillStatus
status
);
List
<
UserPrePaidBilling
>
findByUsernameAndPayMethodInAndTimestamp
GreaterThanAndTimestampLessTha
n
(
String
username
,
List
<
Integer
>
payMehtods
,
long
time1
,
long
time2
);
List
<
UserPrePaidBilling
>
findByUsernameAndPayMethodInAndTimestamp
Betwee
n
(
String
username
,
List
<
Integer
>
payMehtods
,
long
time1
,
long
time2
);
List
<
UserPrePaidBilling
>
findByUsernameAndChargeTypeAndTimestamp
GreaterThanAndTimestampLessTha
n
(
String
username
,
int
chargeType
,
long
time1
,
long
time2
);
List
<
UserPrePaidBilling
>
findByUsernameAndChargeTypeAndTimestamp
Betwee
n
(
String
username
,
int
chargeType
,
long
time1
,
long
time2
);
Page
<
UserPrePaidBilling
>
findByUsernameAndTimestampGreaterThanOrderByTimestampDesc
(
String
username
,
long
time
,
Pageable
pageable
);
...
...
src/main/java/com/edgec/browserbackend/account/service/impl/AdministratorServiceImpl.java
View file @
3a8148c6
...
...
@@ -147,7 +147,6 @@ public class AdministratorServiceImpl implements AdministratorService {
List
<
UserPrePaidBilling
>
userPrePaidBillings_child
=
userPrePaidBillingRepository
.
findByUsernameAndPayMethodIn
(
child
.
getName
(),
Arrays
.
asList
(
1
,
2
));
if
(
userPrePaidBillings_child
!=
null
)
childexpense
+=
userPrePaidBillings_child
.
stream
().
mapToDouble
(
UserPrePaidBilling:
:
getTotal
).
sum
();
childwithdrawn
+=
child
.
getPromotion
().
getWithdrawn
();
UserBalance
userBalance_child
=
userBalanceRepository
.
findById
(
child
.
getName
()).
orElse
(
null
);
if
(
userBalance_child
!=
null
)
{
childbalanced
+=
userBalance_child
.
getBalanced
();
...
...
@@ -407,11 +406,11 @@ public class AdministratorServiceImpl implements AdministratorService {
Account
finalAccount
=
account
;
accounts
.
forEach
(
x
->
{
promotion
.
setInvitedUsers
(
promotion
.
getInvitedUsers
()
+
1
);
double
totalCommission
=
userPrePaidBillingRepository
.
findByUsernameAndPayMethodInAndTimestamp
GreaterThanAndTimestampLessTha
n
(
x
.
getName
(),
Arrays
.
asList
(
1
,
2
,
3
),
dateTime1
.
getTime
(),
dateTime2
.
getTime
())
double
totalCommission
=
userPrePaidBillingRepository
.
findByUsernameAndPayMethodInAndTimestamp
Betwee
n
(
x
.
getName
(),
Arrays
.
asList
(
1
,
2
,
3
),
dateTime1
.
getTime
(),
dateTime2
.
getTime
())
.
stream
().
mapToDouble
(
UserPrePaidBilling:
:
getTotal
).
sum
();
promotion
.
setTotalCommission
(
promotion
.
getTotalCommission
()
+
(
int
)
totalCommission
);
promotion
.
setCommission
(
promotion
.
getCommission
()
+
x
.
getPromotion
().
getCommission
());
double
totalwithdrawn
=
userPrePaidBillingRepository
.
findByUsernameAndChargeTypeAndTimestamp
GreaterThanAndTimestampLessTha
n
(
x
.
getName
(),
ChargeType
.
gift
,
dateTime1
.
getTime
(),
dateTime2
.
getTime
())
double
totalwithdrawn
=
userPrePaidBillingRepository
.
findByUsernameAndChargeTypeAndTimestamp
Betwee
n
(
x
.
getName
(),
ChargeType
.
gift
,
dateTime1
.
getTime
(),
dateTime2
.
getTime
())
.
stream
().
mapToDouble
(
UserPrePaidBilling:
:
getTotal
).
sum
();
promotion
.
setWithdrawn
(
promotion
.
getWithdrawn
()
+
totalwithdrawn
);
double
secondCommission
=
0
;
...
...
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