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
dc53301b
Commit
dc53301b
authored
Apr 15, 2020
by
renjie
Committed by
Administrator
Apr 15, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Staging
parent
1cf6fd96
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
52 additions
and
39 deletions
+52
-39
AccountRepository.java
.../browserbackend/account/repository/AccountRepository.java
+1
-1
UserPrePaidBillingRepository.java
...kend/account/repository/UserPrePaidBillingRepository.java
+3
-3
AccountServiceImpl.java
...owserbackend/account/service/impl/AccountServiceImpl.java
+6
-2
AdministratorServiceImpl.java
...ackend/account/service/impl/AdministratorServiceImpl.java
+38
-29
PromotionTask.java
.../com/edgec/browserbackend/browser/task/PromotionTask.java
+4
-4
No files found.
src/main/java/com/edgec/browserbackend/account/repository/AccountRepository.java
View file @
dc53301b
...
@@ -29,7 +29,7 @@ public interface AccountRepository extends MongoRepository<Account, String>, Acc
...
@@ -29,7 +29,7 @@ public interface AccountRepository extends MongoRepository<Account, String>, Acc
Page
<
Account
>
findAllBySignupDateBetween
(
Pageable
pageable
,
Date
startDate
,
Date
endDate
);
Page
<
Account
>
findAllBySignupDateBetween
(
Pageable
pageable
,
Date
startDate
,
Date
endDate
);
List
<
Account
>
findAllBySignupDateBetweenAndPromotionCode
(
Date
startDate
,
Date
endDate
,
String
promotionCode
);
List
<
Account
>
findAllBySignupDateBetweenAndPromotionCode
AndParentIsNull
(
Date
startDate
,
Date
endDate
,
String
promotionCode
);
Page
<
Account
>
findAllBySignupDateBetweenAndPromotionCodeAndParentIsNull
(
Pageable
pageable
,
Date
startDate
,
Date
endDate
,
String
promotionCode
);
Page
<
Account
>
findAllBySignupDateBetweenAndPromotionCodeAndParentIsNull
(
Pageable
pageable
,
Date
startDate
,
Date
endDate
,
String
promotionCode
);
...
...
src/main/java/com/edgec/browserbackend/account/repository/UserPrePaidBillingRepository.java
View file @
dc53301b
...
@@ -24,7 +24,7 @@ public interface UserPrePaidBillingRepository extends MongoRepository<UserPrePai
...
@@ -24,7 +24,7 @@ public interface UserPrePaidBillingRepository extends MongoRepository<UserPrePai
Page
<
UserPrePaidBilling
>
findAllByYearBetweenAndMonthBetween
(
Pageable
pageable
,
int
year1
,
int
year2
,
int
month1
,
int
month2
);
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
);
List
<
UserPrePaidBilling
>
findByUsernameAndPayMethodIn
(
String
username
,
List
<
Integer
>
payMethod
);
...
@@ -36,9 +36,9 @@ public interface UserPrePaidBillingRepository extends MongoRepository<UserPrePai
...
@@ -36,9 +36,9 @@ public interface UserPrePaidBillingRepository extends MongoRepository<UserPrePai
List
<
UserPrePaidBilling
>
findByStatus
(
BillStatus
status
);
List
<
UserPrePaidBilling
>
findByStatus
(
BillStatus
status
);
List
<
UserPrePaidBilling
>
findBy
UsernameAndPayMethodInAndTimestampGreaterThanAndTimestampLessTha
n
(
String
username
,
List
<
Integer
>
payMehtods
,
long
time1
,
long
time2
);
List
<
UserPrePaidBilling
>
findBy
AdministratorAndPayMethodInAndTimestampBetwee
n
(
String
username
,
List
<
Integer
>
payMehtods
,
long
time1
,
long
time2
);
List
<
UserPrePaidBilling
>
findBy
UsernameAndChargeTypeAndTimestampGreaterThanAndTimestampLessTha
n
(
String
username
,
int
chargeType
,
long
time1
,
long
time2
);
List
<
UserPrePaidBilling
>
findBy
AdministratorAndChargeTypeAndTimestampBetwee
n
(
String
username
,
int
chargeType
,
long
time1
,
long
time2
);
Page
<
UserPrePaidBilling
>
findByUsernameAndTimestampGreaterThanOrderByTimestampDesc
(
String
username
,
long
time
,
Pageable
pageable
);
Page
<
UserPrePaidBilling
>
findByUsernameAndTimestampGreaterThanOrderByTimestampDesc
(
String
username
,
long
time
,
Pageable
pageable
);
...
...
src/main/java/com/edgec/browserbackend/account/service/impl/AccountServiceImpl.java
View file @
dc53301b
...
@@ -400,7 +400,7 @@ public class AccountServiceImpl implements AccountService {
...
@@ -400,7 +400,7 @@ public class AccountServiceImpl implements AccountService {
double
totalCommission
=
0
;
double
totalCommission
=
0
;
totalCommission
=
0
;
totalCommission
=
0
;
for
(
Account
promote
:
promotes
)
{
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
().
getYear
(),
YearMonth
.
now
().
getMonthValue
(),
Arrays
.
asList
(
1
,
2
,
3
));
YearMonth
.
now
().
getMonthValue
(),
Arrays
.
asList
(
1
,
2
,
3
));
totalCommission
+=
userPrePaidBillings
.
stream
().
mapToDouble
(
UserPrePaidBilling:
:
getTotal
).
sum
();
totalCommission
+=
userPrePaidBillings
.
stream
().
mapToDouble
(
UserPrePaidBilling:
:
getTotal
).
sum
();
...
@@ -529,7 +529,7 @@ public class AccountServiceImpl implements AccountService {
...
@@ -529,7 +529,7 @@ public class AccountServiceImpl implements AccountService {
if
(
inviter
!=
null
)
if
(
inviter
!=
null
)
param
.
put
(
"referral"
,
inviter
.
getName
()
+
"("
+
user
.
getPromotionCode
()
+
")"
);
param
.
put
(
"referral"
,
inviter
.
getName
()
+
"("
+
user
.
getPromotionCode
()
+
")"
);
else
else
param
.
put
(
"referral"
,
""
);
param
.
put
(
"referral"
,
"
123456
"
);
com
.
edgec
.
browserbackend
.
common
.
commons
.
utils
.
SmsUtils
.
sendNewAccountSms
(
"15919921106"
,
com
.
edgec
.
browserbackend
.
common
.
commons
.
utils
.
SmsUtils
.
SmsTemplateCode
.
NEWACCOUNT
,
param
);
com
.
edgec
.
browserbackend
.
common
.
commons
.
utils
.
SmsUtils
.
sendNewAccountSms
(
"15919921106"
,
com
.
edgec
.
browserbackend
.
common
.
commons
.
utils
.
SmsUtils
.
SmsTemplateCode
.
NEWACCOUNT
,
param
);
if
(
inviter
!=
null
)
{
if
(
inviter
!=
null
)
{
...
@@ -1201,11 +1201,15 @@ public class AccountServiceImpl implements AccountService {
...
@@ -1201,11 +1201,15 @@ public class AccountServiceImpl implements AccountService {
throw
new
ClientRequestException
(
AccountErrorCode
.
NAMENOTEXIST
);
throw
new
ClientRequestException
(
AccountErrorCode
.
NAMENOTEXIST
);
if
(
isAgree
)
{
if
(
isAgree
)
{
account
.
setAuthorized
(
2
);
account
.
setAuthorized
(
2
);
CompanyAuthorize
companyAuthorize
=
companyAuthorizeRepository
.
findByUsername
(
username
);
account
.
setCompanyName
(
companyAuthorize
.
getCompanyName
());
repository
.
save
(
account
);
repository
.
save
(
account
);
}
}
else
{
else
{
account
.
setAuthorized
(
3
);
account
.
setAuthorized
(
3
);
account
.
setCompanyName
(
null
);
repository
.
save
(
account
);
repository
.
save
(
account
);
CompanyAuthorize
companyAuthorize
=
companyAuthorizeRepository
.
findByUsername
(
username
);
CompanyAuthorize
companyAuthorize
=
companyAuthorizeRepository
.
findByUsername
(
username
);
if
(
companyAuthorize
!=
null
)
{
if
(
companyAuthorize
!=
null
)
{
if
(
companyAuthorize
.
getCompanyLicenseId
()
!=
null
)
if
(
companyAuthorize
.
getCompanyLicenseId
()
!=
null
)
...
...
src/main/java/com/edgec/browserbackend/account/service/impl/AdministratorServiceImpl.java
View file @
dc53301b
...
@@ -147,7 +147,6 @@ public class AdministratorServiceImpl implements AdministratorService {
...
@@ -147,7 +147,6 @@ public class AdministratorServiceImpl implements AdministratorService {
List
<
UserPrePaidBilling
>
userPrePaidBillings_child
=
userPrePaidBillingRepository
.
findByUsernameAndPayMethodIn
(
child
.
getName
(),
Arrays
.
asList
(
1
,
2
));
List
<
UserPrePaidBilling
>
userPrePaidBillings_child
=
userPrePaidBillingRepository
.
findByUsernameAndPayMethodIn
(
child
.
getName
(),
Arrays
.
asList
(
1
,
2
));
if
(
userPrePaidBillings_child
!=
null
)
if
(
userPrePaidBillings_child
!=
null
)
childexpense
+=
userPrePaidBillings_child
.
stream
().
mapToDouble
(
UserPrePaidBilling:
:
getTotal
).
sum
();
childexpense
+=
userPrePaidBillings_child
.
stream
().
mapToDouble
(
UserPrePaidBilling:
:
getTotal
).
sum
();
childwithdrawn
+=
child
.
getPromotion
().
getWithdrawn
();
UserBalance
userBalance_child
=
userBalanceRepository
.
findById
(
child
.
getName
()).
orElse
(
null
);
UserBalance
userBalance_child
=
userBalanceRepository
.
findById
(
child
.
getName
()).
orElse
(
null
);
if
(
userBalance_child
!=
null
)
{
if
(
userBalance_child
!=
null
)
{
childbalanced
+=
userBalance_child
.
getBalanced
();
childbalanced
+=
userBalance_child
.
getBalanced
();
...
@@ -396,45 +395,55 @@ public class AdministratorServiceImpl implements AdministratorService {
...
@@ -396,45 +395,55 @@ public class AdministratorServiceImpl implements AdministratorService {
Date
dateTime2
=
formatter
.
parse
(
strDate2
);
Date
dateTime2
=
formatter
.
parse
(
strDate2
);
Page
<
Account
>
accountPage
=
accountRepository
.
findAllBySignupDateBetweenAndPromotionCodeAndParentIsNull
(
pageable
,
dateTime1
,
dateTime2
,
account
.
getPromotion
().
getCode
());
Page
<
Account
>
accountPage
=
accountRepository
.
findAllBySignupDateBetweenAndPromotionCodeAndParentIsNull
(
pageable
,
dateTime1
,
dateTime2
,
account
.
getPromotion
().
getCode
());
List
<
AccountPromotionDto
>
accountPromotionDtos
=
new
ArrayList
<>();
List
<
AccountPromotionDto
>
accountPromotionDtos
=
new
ArrayList
<>();
accountPage
.
get
().
forEach
(
account1
->
{
if
(
accountPage
.
getNumberOfElements
()
>
0
)
{
accountPromotionDtos
.
add
(
new
AccountPromotionDto
(
account1
));
accountPage
.
get
().
forEach
(
account1
->
{
});
accountPromotionDtos
.
add
(
new
AccountPromotionDto
(
account1
));
});
}
Page
<
AccountPromotionDto
>
accountPromotionDtoPage
=
new
PageImpl
<
AccountPromotionDto
>(
accountPromotionDtos
);
Page
<
AccountPromotionDto
>
accountPromotionDtoPage
=
new
PageImpl
<
AccountPromotionDto
>(
accountPromotionDtos
);
promotionQueryResultDto
.
setUsers
(
accountPromotionDtoPage
);
promotionQueryResultDto
.
setUsers
(
accountPromotionDtoPage
);
List
<
Account
>
accounts
=
accountRepository
.
findAllBySignupDateBetweenAndPromotionCode
(
dateTime1
,
dateTime2
,
account
.
getPromotion
().
getCode
());
List
<
Account
>
accounts
=
accountRepository
.
findAllBySignupDateBetweenAndPromotionCode
AndParentIsNull
(
dateTime1
,
dateTime2
,
account
.
getPromotion
().
getCode
());
Promotion
promotion
=
new
Promotion
();
Promotion
promotion
=
new
Promotion
();
Account
finalAccount
=
account
;
Account
finalAccount
=
account
;
accounts
.
forEach
(
x
->
{
if
(
accounts
!=
null
&&
accounts
.
size
()
>
0
)
{
promotion
.
setInvitedUsers
(
promotion
.
getInvitedUsers
()
+
1
);
accounts
.
forEach
(
x
->
{
double
totalCommission
=
userPrePaidBillingRepository
.
findByUsernameAndPayMethodInAndTimestampGreaterThanAndTimestampLessThan
(
x
.
getName
(),
Arrays
.
asList
(
1
,
2
,
3
),
dateTime1
.
getTime
(),
dateTime2
.
getTime
())
promotion
.
setInvitedUsers
(
promotion
.
getInvitedUsers
()
+
1
);
.
stream
().
mapToDouble
(
UserPrePaidBilling:
:
getTotal
).
sum
();
List
<
UserPrePaidBilling
>
userPrePaidBillings
=
userPrePaidBillingRepository
.
findByAdministratorAndPayMethodInAndTimestampBetween
(
x
.
getName
(),
Arrays
.
asList
(
1
,
2
,
3
),
dateTime1
.
getTime
(),
dateTime2
.
getTime
());
promotion
.
setTotalCommission
(
promotion
.
getTotalCommission
()
+
(
int
)
totalCommission
);
double
totalCommission
=
0
;
promotion
.
setCommission
(
promotion
.
getCommission
()
+
x
.
getPromotion
().
getCommission
());
if
(
userPrePaidBillings
!=
null
&&
userPrePaidBillings
.
size
()
>
0
)
double
totalwithdrawn
=
userPrePaidBillingRepository
.
findByUsernameAndChargeTypeAndTimestampGreaterThanAndTimestampLessThan
(
x
.
getName
(),
ChargeType
.
gift
,
dateTime1
.
getTime
(),
dateTime2
.
getTime
())
totalCommission
=
userPrePaidBillings
.
stream
().
mapToDouble
(
UserPrePaidBilling:
:
getTotal
).
sum
();
.
stream
().
mapToDouble
(
UserPrePaidBilling:
:
getTotal
).
sum
();
promotion
.
setTotalCommission
(
promotion
.
getTotalCommission
()
+
(
int
)
totalCommission
);
promotion
.
setWithdrawn
(
promotion
.
getWithdrawn
()
+
totalwithdrawn
);
promotion
.
setCommission
(
promotion
.
getCommission
()
+
x
.
getPromotion
().
getCommission
());
double
secondCommission
=
0
;
double
totalwithdrawn
=
0
;
if
(
finalAccount
.
getPromotion
().
isSale
()
&&
x
.
getParent
()
==
null
)
{
userPrePaidBillings
=
userPrePaidBillingRepository
.
findByAdministratorAndChargeTypeAndTimestampBetween
(
x
.
getName
(),
ChargeType
.
gift
,
dateTime1
.
getTime
(),
dateTime2
.
getTime
());
List
<
Account
>
secondPromotes
=
accountRepository
.
findByPromotionCode
(
x
.
getPromotion
().
getCode
());
if
(
userPrePaidBillings
!=
null
&&
userPrePaidBillings
.
size
()
>
0
)
if
(
secondPromotes
!=
null
&&
secondPromotes
.
size
()
>
0
)
{
totalwithdrawn
=
userPrePaidBillings
.
stream
().
mapToDouble
(
UserPrePaidBilling:
:
getTotal
).
sum
();
for
(
Account
secondPromote
:
secondPromotes
)
{
promotion
.
setWithdrawn
(
promotion
.
getWithdrawn
()
+
totalwithdrawn
);
List
<
UserPrePaidBilling
>
userPrePaidBillings1
=
userPrePaidBillingRepository
.
findByUsernameAndYearAndMonthAndPayMethodIn
(
secondPromote
.
getName
(),
double
secondCommission
=
0
;
YearMonth
.
now
().
minusMonths
(
1
).
getYear
(),
if
(
finalAccount
.
getPromotion
().
isSale
()
&&
x
.
getParent
()
==
null
)
{
YearMonth
.
now
().
minusMonths
(
1
).
getMonthValue
(),
Arrays
.
asList
(
1
,
2
,
3
));
List
<
Account
>
secondPromotes
=
accountRepository
.
findByPromotionCode
(
x
.
getPromotion
().
getCode
());
secondCommission
+=
userPrePaidBillings1
.
stream
().
mapToDouble
(
UserPrePaidBilling:
:
getTotal
).
sum
();
if
(
secondPromotes
!=
null
&&
secondPromotes
.
size
()
>
0
)
{
for
(
Account
secondPromote
:
secondPromotes
)
{
List
<
UserPrePaidBilling
>
userPrePaidBillings1
=
userPrePaidBillingRepository
.
findByAdministratorAndYearAndMonthAndPayMethodIn
(
secondPromote
.
getName
(),
YearMonth
.
now
().
minusMonths
(
1
).
getYear
(),
YearMonth
.
now
().
minusMonths
(
1
).
getMonthValue
(),
Arrays
.
asList
(
1
,
2
,
3
));
if
(
userPrePaidBillings1
!=
null
&&
userPrePaidBillings1
.
size
()
>
0
)
secondCommission
+=
userPrePaidBillings1
.
stream
().
mapToDouble
(
UserPrePaidBilling:
:
getTotal
).
sum
();
}
}
}
}
}
}
promotion
.
setAllGift
(
promotion
.
getAllGift
()
+
totalCommission
*
0.1
+
secondCommission
*
0.02
);
promotion
.
setAllGift
(
promotion
.
getAllGift
()
+
totalCommission
*
0.1
+
secondCommission
*
0.02
);
promotion
.
setGift
(
promotion
.
getGift
()
+
x
.
getPromotion
().
getGift
()
);
promotion
.
setGift
(
promotion
.
getGift
()
+
x
.
getPromotion
().
getGift
());
promotion
.
setCommissionLastMonth
(
promotion
.
getCommissionLastMonth
()
+
x
.
getPromotion
().
getCommissionLastMonth
());
promotion
.
setCommissionLastMonth
(
promotion
.
getCommissionLastMonth
()
+
x
.
getPromotion
().
getCommissionLastMonth
()
);
}
);
}
);
}
promotionQueryResultDto
.
setPromotion
(
promotion
);
promotionQueryResultDto
.
setPromotion
(
promotion
);
return
promotionQueryResultDto
;
return
promotionQueryResultDto
;
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
());
log
.
error
(
e
.
getMessage
()
,
e
);
throw
new
ClientRequestException
(
BrowserErrorCode
.
UNKNOWN
);
throw
new
ClientRequestException
(
BrowserErrorCode
.
UNKNOWN
);
}
}
}
}
...
...
src/main/java/com/edgec/browserbackend/browser/task/PromotionTask.java
View file @
dc53301b
...
@@ -39,7 +39,7 @@ public class PromotionTask {
...
@@ -39,7 +39,7 @@ public class PromotionTask {
double
totalCommission
=
0
;
double
totalCommission
=
0
;
double
secondCommission
=
0
;
double
secondCommission
=
0
;
for
(
Account
promote
:
promotes
)
{
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
).
getYear
(),
YearMonth
.
now
().
minusMonths
(
1
).
getMonthValue
(),
Arrays
.
asList
(
1
,
2
,
3
));
YearMonth
.
now
().
minusMonths
(
1
).
getMonthValue
(),
Arrays
.
asList
(
1
,
2
,
3
));
totalCommission
+=
userPrePaidBillings
.
stream
().
mapToDouble
(
UserPrePaidBilling:
:
getTotal
).
sum
();
totalCommission
+=
userPrePaidBillings
.
stream
().
mapToDouble
(
UserPrePaidBilling:
:
getTotal
).
sum
();
...
@@ -47,7 +47,7 @@ public class PromotionTask {
...
@@ -47,7 +47,7 @@ public class PromotionTask {
List
<
Account
>
secondPromotes
=
accountRepository
.
findByPromotionCode
(
promote
.
getPromotion
().
getCode
());
List
<
Account
>
secondPromotes
=
accountRepository
.
findByPromotionCode
(
promote
.
getPromotion
().
getCode
());
if
(
secondPromotes
!=
null
&&
secondPromotes
.
size
()
>
0
)
{
if
(
secondPromotes
!=
null
&&
secondPromotes
.
size
()
>
0
)
{
for
(
Account
secondPromote
:
secondPromotes
)
{
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
).
getYear
(),
YearMonth
.
now
().
minusMonths
(
1
).
getMonthValue
(),
Arrays
.
asList
(
1
,
2
,
3
));
YearMonth
.
now
().
minusMonths
(
1
).
getMonthValue
(),
Arrays
.
asList
(
1
,
2
,
3
));
secondCommission
+=
userPrePaidBillings1
.
stream
().
mapToDouble
(
UserPrePaidBilling:
:
getTotal
).
sum
();
secondCommission
+=
userPrePaidBillings1
.
stream
().
mapToDouble
(
UserPrePaidBilling:
:
getTotal
).
sum
();
...
@@ -77,7 +77,7 @@ public class PromotionTask {
...
@@ -77,7 +77,7 @@ public class PromotionTask {
double
totalCommission
=
0
;
double
totalCommission
=
0
;
double
secondCommission
=
0
;
double
secondCommission
=
0
;
for
(
Account
promote
:
promotes
)
{
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
().
getYear
(),
YearMonth
.
now
().
getMonthValue
(),
Arrays
.
asList
(
1
,
2
,
3
));
YearMonth
.
now
().
getMonthValue
(),
Arrays
.
asList
(
1
,
2
,
3
));
totalCommission
+=
userPrePaidBillings
.
stream
().
mapToDouble
(
UserPrePaidBilling:
:
getTotal
).
sum
();
totalCommission
+=
userPrePaidBillings
.
stream
().
mapToDouble
(
UserPrePaidBilling:
:
getTotal
).
sum
();
...
@@ -85,7 +85,7 @@ public class PromotionTask {
...
@@ -85,7 +85,7 @@ public class PromotionTask {
List
<
Account
>
secondPromotes
=
accountRepository
.
findByPromotionCode
(
promote
.
getPromotion
().
getCode
());
List
<
Account
>
secondPromotes
=
accountRepository
.
findByPromotionCode
(
promote
.
getPromotion
().
getCode
());
if
(
secondPromotes
!=
null
&&
secondPromotes
.
size
()
>
0
)
{
if
(
secondPromotes
!=
null
&&
secondPromotes
.
size
()
>
0
)
{
for
(
Account
secondPromote
:
secondPromotes
)
{
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
().
getYear
(),
YearMonth
.
now
().
getMonthValue
(),
Arrays
.
asList
(
1
,
2
,
3
));
YearMonth
.
now
().
getMonthValue
(),
Arrays
.
asList
(
1
,
2
,
3
));
secondCommission
+=
userPrePaidBillings1
.
stream
().
mapToDouble
(
UserPrePaidBilling:
:
getTotal
).
sum
();
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