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
cc93604f
Commit
cc93604f
authored
Apr 15, 2020
by
renjie
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev-zrj' into 'staging'
bug修改 See merge request
!10
parents
3a8148c6
fe8008da
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
13 deletions
+17
-13
UserPrePaidBillingRepository.java
...kend/account/repository/UserPrePaidBillingRepository.java
+3
-3
AccountServiceImpl.java
...owserbackend/account/service/impl/AccountServiceImpl.java
+1
-1
AdministratorServiceImpl.java
...ackend/account/service/impl/AdministratorServiceImpl.java
+9
-5
PromotionTask.java
.../com/edgec/browserbackend/browser/task/PromotionTask.java
+4
-4
No files found.
src/main/java/com/edgec/browserbackend/account/repository/UserPrePaidBillingRepository.java
View file @
cc93604f
...
...
@@ -24,7 +24,7 @@ public interface UserPrePaidBillingRepository extends MongoRepository<UserPrePai
Page
<
UserPrePaidBilling
>
findAllByYearBetweenAndMonthBetween
(
Pageable
pageable
,
int
year1
,
int
year2
,
int
month1
,
int
month2
);
List
<
UserPrePaidBilling
>
findBy
Username
AndYearAndMonthAndPayMethodIn
(
String
username
,
int
year
,
int
month
,
List
<
Integer
>
payMethod
);
List
<
UserPrePaidBilling
>
findBy
Administrator
AndYearAndMonthAndPayMethodIn
(
String
username
,
int
year
,
int
month
,
List
<
Integer
>
payMethod
);
List
<
UserPrePaidBilling
>
findByUsernameAndPayMethodIn
(
String
username
,
List
<
Integer
>
payMethod
);
...
...
@@ -36,9 +36,9 @@ public interface UserPrePaidBillingRepository extends MongoRepository<UserPrePai
List
<
UserPrePaidBilling
>
findByStatus
(
BillStatus
status
);
List
<
UserPrePaidBilling
>
findBy
Username
AndPayMethodInAndTimestampBetween
(
String
username
,
List
<
Integer
>
payMehtods
,
long
time1
,
long
time2
);
List
<
UserPrePaidBilling
>
findBy
Administrator
AndPayMethodInAndTimestampBetween
(
String
username
,
List
<
Integer
>
payMehtods
,
long
time1
,
long
time2
);
List
<
UserPrePaidBilling
>
findBy
Username
AndChargeTypeAndTimestampBetween
(
String
username
,
int
chargeType
,
long
time1
,
long
time2
);
List
<
UserPrePaidBilling
>
findBy
Administrator
AndChargeTypeAndTimestampBetween
(
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/AccountServiceImpl.java
View file @
cc93604f
...
...
@@ -400,7 +400,7 @@ public class AccountServiceImpl implements AccountService {
double
totalCommission
=
0
;
totalCommission
=
0
;
for
(
Account
promote
:
promotes
)
{
List
<
UserPrePaidBilling
>
userPrePaidBillings
=
prePaidBillingRepository
.
findBy
Username
AndYearAndMonthAndPayMethodIn
(
promote
.
getName
(),
List
<
UserPrePaidBilling
>
userPrePaidBillings
=
prePaidBillingRepository
.
findBy
Administrator
AndYearAndMonthAndPayMethodIn
(
promote
.
getName
(),
YearMonth
.
now
().
getYear
(),
YearMonth
.
now
().
getMonthValue
(),
Arrays
.
asList
(
1
,
2
,
3
));
totalCommission
+=
userPrePaidBillings
.
stream
().
mapToDouble
(
UserPrePaidBilling:
:
getTotal
).
sum
();
...
...
src/main/java/com/edgec/browserbackend/account/service/impl/AdministratorServiceImpl.java
View file @
cc93604f
...
...
@@ -406,19 +406,23 @@ public class AdministratorServiceImpl implements AdministratorService {
Account
finalAccount
=
account
;
accounts
.
forEach
(
x
->
{
promotion
.
setInvitedUsers
(
promotion
.
getInvitedUsers
()
+
1
);
double
totalCommission
=
userPrePaidBillingRepository
.
findByUsernameAndPayMethodInAndTimestampBetween
(
x
.
getName
(),
Arrays
.
asList
(
1
,
2
,
3
),
dateTime1
.
getTime
(),
dateTime2
.
getTime
())
.
stream
().
mapToDouble
(
UserPrePaidBilling:
:
getTotal
).
sum
();
List
<
UserPrePaidBilling
>
userPrePaidBillings
=
userPrePaidBillingRepository
.
findByAdministratorAndPayMethodInAndTimestampBetween
(
x
.
getName
(),
Arrays
.
asList
(
1
,
2
,
3
),
dateTime1
.
getTime
(),
dateTime2
.
getTime
());
double
totalCommission
=
0
;
if
(
userPrePaidBillings
!=
null
)
totalCommission
=
userPrePaidBillings
.
stream
().
mapToDouble
(
UserPrePaidBilling:
:
getTotal
).
sum
();
promotion
.
setTotalCommission
(
promotion
.
getTotalCommission
()
+
(
int
)
totalCommission
);
promotion
.
setCommission
(
promotion
.
getCommission
()
+
x
.
getPromotion
().
getCommission
());
double
totalwithdrawn
=
userPrePaidBillingRepository
.
findByUsernameAndChargeTypeAndTimestampBetween
(
x
.
getName
(),
ChargeType
.
gift
,
dateTime1
.
getTime
(),
dateTime2
.
getTime
())
.
stream
().
mapToDouble
(
UserPrePaidBilling:
:
getTotal
).
sum
();
double
totalwithdrawn
=
0
;
userPrePaidBillings
=
userPrePaidBillingRepository
.
findByAdministratorAndChargeTypeAndTimestampBetween
(
x
.
getName
(),
ChargeType
.
gift
,
dateTime1
.
getTime
(),
dateTime2
.
getTime
());
if
(
userPrePaidBillings
!=
null
&&
userPrePaidBillings
.
size
()
>
0
)
totalwithdrawn
=
userPrePaidBillings
.
stream
().
mapToDouble
(
UserPrePaidBilling:
:
getTotal
).
sum
();
promotion
.
setWithdrawn
(
promotion
.
getWithdrawn
()
+
totalwithdrawn
);
double
secondCommission
=
0
;
if
(
finalAccount
.
getPromotion
().
isSale
()
&&
x
.
getParent
()
==
null
)
{
List
<
Account
>
secondPromotes
=
accountRepository
.
findByPromotionCode
(
x
.
getPromotion
().
getCode
());
if
(
secondPromotes
!=
null
&&
secondPromotes
.
size
()
>
0
)
{
for
(
Account
secondPromote
:
secondPromotes
)
{
List
<
UserPrePaidBilling
>
userPrePaidBillings1
=
userPrePaidBillingRepository
.
findBy
Username
AndYearAndMonthAndPayMethodIn
(
secondPromote
.
getName
(),
List
<
UserPrePaidBilling
>
userPrePaidBillings1
=
userPrePaidBillingRepository
.
findBy
Administrator
AndYearAndMonthAndPayMethodIn
(
secondPromote
.
getName
(),
YearMonth
.
now
().
minusMonths
(
1
).
getYear
(),
YearMonth
.
now
().
minusMonths
(
1
).
getMonthValue
(),
Arrays
.
asList
(
1
,
2
,
3
));
secondCommission
+=
userPrePaidBillings1
.
stream
().
mapToDouble
(
UserPrePaidBilling:
:
getTotal
).
sum
();
...
...
src/main/java/com/edgec/browserbackend/browser/task/PromotionTask.java
View file @
cc93604f
...
...
@@ -39,7 +39,7 @@ public class PromotionTask {
double
totalCommission
=
0
;
double
secondCommission
=
0
;
for
(
Account
promote
:
promotes
)
{
List
<
UserPrePaidBilling
>
userPrePaidBillings
=
userPrePaidBillingRepository
.
findBy
Username
AndYearAndMonthAndPayMethodIn
(
promote
.
getName
(),
List
<
UserPrePaidBilling
>
userPrePaidBillings
=
userPrePaidBillingRepository
.
findBy
Administrator
AndYearAndMonthAndPayMethodIn
(
promote
.
getName
(),
YearMonth
.
now
().
minusMonths
(
1
).
getYear
(),
YearMonth
.
now
().
minusMonths
(
1
).
getMonthValue
(),
Arrays
.
asList
(
1
,
2
,
3
));
totalCommission
+=
userPrePaidBillings
.
stream
().
mapToDouble
(
UserPrePaidBilling:
:
getTotal
).
sum
();
...
...
@@ -47,7 +47,7 @@ public class PromotionTask {
List
<
Account
>
secondPromotes
=
accountRepository
.
findByPromotionCode
(
promote
.
getPromotion
().
getCode
());
if
(
secondPromotes
!=
null
&&
secondPromotes
.
size
()
>
0
)
{
for
(
Account
secondPromote
:
secondPromotes
)
{
List
<
UserPrePaidBilling
>
userPrePaidBillings1
=
userPrePaidBillingRepository
.
findBy
Username
AndYearAndMonthAndPayMethodIn
(
secondPromote
.
getName
(),
List
<
UserPrePaidBilling
>
userPrePaidBillings1
=
userPrePaidBillingRepository
.
findBy
Administrator
AndYearAndMonthAndPayMethodIn
(
secondPromote
.
getName
(),
YearMonth
.
now
().
minusMonths
(
1
).
getYear
(),
YearMonth
.
now
().
minusMonths
(
1
).
getMonthValue
(),
Arrays
.
asList
(
1
,
2
,
3
));
secondCommission
+=
userPrePaidBillings1
.
stream
().
mapToDouble
(
UserPrePaidBilling:
:
getTotal
).
sum
();
...
...
@@ -77,7 +77,7 @@ public class PromotionTask {
double
totalCommission
=
0
;
double
secondCommission
=
0
;
for
(
Account
promote
:
promotes
)
{
List
<
UserPrePaidBilling
>
userPrePaidBillings
=
userPrePaidBillingRepository
.
findBy
Username
AndYearAndMonthAndPayMethodIn
(
promote
.
getName
(),
List
<
UserPrePaidBilling
>
userPrePaidBillings
=
userPrePaidBillingRepository
.
findBy
Administrator
AndYearAndMonthAndPayMethodIn
(
promote
.
getName
(),
YearMonth
.
now
().
getYear
(),
YearMonth
.
now
().
getMonthValue
(),
Arrays
.
asList
(
1
,
2
,
3
));
totalCommission
+=
userPrePaidBillings
.
stream
().
mapToDouble
(
UserPrePaidBilling:
:
getTotal
).
sum
();
...
...
@@ -85,7 +85,7 @@ public class PromotionTask {
List
<
Account
>
secondPromotes
=
accountRepository
.
findByPromotionCode
(
promote
.
getPromotion
().
getCode
());
if
(
secondPromotes
!=
null
&&
secondPromotes
.
size
()
>
0
)
{
for
(
Account
secondPromote
:
secondPromotes
)
{
List
<
UserPrePaidBilling
>
userPrePaidBillings1
=
userPrePaidBillingRepository
.
findBy
Username
AndYearAndMonthAndPayMethodIn
(
secondPromote
.
getName
(),
List
<
UserPrePaidBilling
>
userPrePaidBillings1
=
userPrePaidBillingRepository
.
findBy
Administrator
AndYearAndMonthAndPayMethodIn
(
secondPromote
.
getName
(),
YearMonth
.
now
().
getYear
(),
YearMonth
.
now
().
getMonthValue
(),
Arrays
.
asList
(
1
,
2
,
3
));
secondCommission
+=
userPrePaidBillings1
.
stream
().
mapToDouble
(
UserPrePaidBilling:
:
getTotal
).
sum
();
...
...
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