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
7e11662a
Commit
7e11662a
authored
Sep 18, 2020
by
xuxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
管理员界面-推广码下线查询 调试
parent
14dc0779
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
2 deletions
+11
-2
AdministratorServiceImpl.java
...ackend/account/service/impl/AdministratorServiceImpl.java
+11
-2
No files found.
src/main/java/com/edgec/browserbackend/account/service/impl/AdministratorServiceImpl.java
View file @
7e11662a
...
@@ -511,9 +511,13 @@ public class AdministratorServiceImpl implements AdministratorService {
...
@@ -511,9 +511,13 @@ public class AdministratorServiceImpl implements AdministratorService {
@Override
@Override
public
PromotionInfoDto
countPromotionInfos
(
String
username
,
String
promotionCode
,
String
beginDate
,
String
endDate
)
{
public
PromotionInfoDto
countPromotionInfos
(
String
username
,
String
promotionCode
,
String
beginDate
,
String
endDate
)
{
// 1. 根据传入的 username 或者 推荐码 获取用户信息
// 1. 根据传入的 username 或者 推荐码 获取用户信息
long
start
=
System
.
currentTimeMillis
();
Account
account
=
getAccount
(
username
,
promotionCode
);
Account
account
=
getAccount
(
username
,
promotionCode
);
log
.
info
(
"===>countPromotionInfos step-1 consume time {}"
,
System
.
currentTimeMillis
()
-
start
);
// 2. 获取 该推荐码下所有的用户
// 2. 获取 该推荐码下所有的用户
start
=
System
.
currentTimeMillis
();
List
<
Account
>
accounts
=
accountRepository
.
findAllByPromotionCodeAndParentIsNull
(
account
.
getPromotion
().
getCode
());
List
<
Account
>
accounts
=
accountRepository
.
findAllByPromotionCodeAndParentIsNull
(
account
.
getPromotion
().
getCode
());
log
.
info
(
"===>countPromotionInfos step-2 consume time {}"
,
System
.
currentTimeMillis
()
-
start
);
// promotion 用来存储所有用户的消费信息
// promotion 用来存储所有用户的消费信息
PromotionInfoDto
promotionInfoDto
=
new
PromotionInfoDto
();
PromotionInfoDto
promotionInfoDto
=
new
PromotionInfoDto
();
...
@@ -527,12 +531,15 @@ public class AdministratorServiceImpl implements AdministratorService {
...
@@ -527,12 +531,15 @@ public class AdministratorServiceImpl implements AdministratorService {
Date
beginTime
=
formatter
.
parse
(
beginDate
);
Date
beginTime
=
formatter
.
parse
(
beginDate
);
Date
endTime
=
formatter
.
parse
(
endDate
);
Date
endTime
=
formatter
.
parse
(
endDate
);
start
=
System
.
currentTimeMillis
();
if
(
accounts
!=
null
&&
accounts
.
size
()
>
0
)
{
if
(
accounts
!=
null
&&
accounts
.
size
()
>
0
)
{
// 邀请的一级用户数
// 邀请的一级用户数
promotionInfoDto
.
setFirstLevelInvitedUsers
(
accounts
.
size
());
promotionInfoDto
.
setFirstLevelInvitedUsers
(
accounts
.
size
());
int
i
=
3
,
j
=
0
;
accounts
.
forEach
(
x
->
{
accounts
.
forEach
(
x
->
{
long
start2
=
System
.
currentTimeMillis
();
int
[]
arr1
=
getCommissionAndIps
(
beginTime
,
endTime
,
x
);
int
[]
arr1
=
getCommissionAndIps
(
beginTime
,
endTime
,
x
);
log
.
info
(
"===>countPromotionInfos step-3-{} consume time {}"
,
accounts
.
indexOf
(
x
)
+
1
,
(
System
.
currentTimeMillis
()
-
start2
));
promotionInfoDto
.
setFirstLevelCommission
(
promotionInfoDto
.
getFirstLevelCommission
()
+
arr1
[
0
]);
promotionInfoDto
.
setFirstLevelCommission
(
promotionInfoDto
.
getFirstLevelCommission
()
+
arr1
[
0
]);
promotionInfoDto
.
setFirstLevelIps
(
promotionInfoDto
.
getFirstLevelIps
()
+
arr1
[
1
]);
promotionInfoDto
.
setFirstLevelIps
(
promotionInfoDto
.
getFirstLevelIps
()
+
arr1
[
1
]);
...
@@ -543,7 +550,9 @@ public class AdministratorServiceImpl implements AdministratorService {
...
@@ -543,7 +550,9 @@ public class AdministratorServiceImpl implements AdministratorService {
if
(
secondPromotes
!=
null
&&
secondPromotes
.
size
()
>
0
)
{
if
(
secondPromotes
!=
null
&&
secondPromotes
.
size
()
>
0
)
{
for
(
Account
secondPromote
:
secondPromotes
)
{
for
(
Account
secondPromote
:
secondPromotes
)
{
// 将下级账户及下级账户的子账户中未过期的ip统计到 ipCount中
// 将下级账户及下级账户的子账户中未过期的ip统计到 ipCount中
long
start3
=
System
.
currentTimeMillis
();
int
[]
arr2
=
getCommissionAndIps
(
beginTime
,
endTime
,
secondPromote
);
int
[]
arr2
=
getCommissionAndIps
(
beginTime
,
endTime
,
secondPromote
);
log
.
info
(
"===>countPromotionInfos step-3-{}-{} consume time {}"
,
accounts
.
indexOf
(
x
)
+
1
,
secondPromotes
.
indexOf
(
secondPromote
)
+
1
,
(
System
.
currentTimeMillis
()
-
start3
));
promotionInfoDto
.
setSecondLevelCommission
(
promotionInfoDto
.
getSecondLevelCommission
()
+
arr2
[
0
]);
promotionInfoDto
.
setSecondLevelCommission
(
promotionInfoDto
.
getSecondLevelCommission
()
+
arr2
[
0
]);
promotionInfoDto
.
setSecondLevelIps
(
promotionInfoDto
.
getSecondLevelIps
()
+
arr2
[
1
]);
promotionInfoDto
.
setSecondLevelIps
(
promotionInfoDto
.
getSecondLevelIps
()
+
arr2
[
1
]);
}
}
...
@@ -551,7 +560,7 @@ public class AdministratorServiceImpl implements AdministratorService {
...
@@ -551,7 +560,7 @@ public class AdministratorServiceImpl implements AdministratorService {
}
}
});
});
}
}
log
.
info
(
"===>countPromotionInfos step-4 consume time {}"
,
System
.
currentTimeMillis
()
-
start
);
// 设置总ip
// 设置总ip
promotionInfoDto
.
setAllLevelIps
(
promotionInfoDto
.
getFirstLevelIps
()
+
promotionInfoDto
.
getSecondLevelIps
());
promotionInfoDto
.
setAllLevelIps
(
promotionInfoDto
.
getFirstLevelIps
()
+
promotionInfoDto
.
getSecondLevelIps
());
// 设置应当提现的礼物金额
// 设置应当提现的礼物金额
...
...
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