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
8e6bf3f4
Commit
8e6bf3f4
authored
Sep 16, 2020
by
xuxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
管理员界面-推广码下线查询
parent
f3bc8799
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
174 additions
and
8 deletions
+174
-8
AdministratorController.java
...erbackend/account/controller/AdministratorController.java
+50
-1
AccountPromotionDto.java
...edgec/browserbackend/account/dto/AccountPromotionDto.java
+38
-3
PromotionInfoDto.java
...om/edgec/browserbackend/account/dto/PromotionInfoDto.java
+79
-0
AccountRepository.java
.../browserbackend/account/repository/AccountRepository.java
+2
-0
AdministratorService.java
.../browserbackend/account/service/AdministratorService.java
+5
-4
AdministratorServiceImpl.java
...ackend/account/service/impl/AdministratorServiceImpl.java
+0
-0
No files found.
src/main/java/com/edgec/browserbackend/account/controller/AdministratorController.java
View file @
8e6bf3f4
...
@@ -451,16 +451,65 @@ public class AdministratorController {
...
@@ -451,16 +451,65 @@ public class AdministratorController {
}
}
//统计推广码下消费
//统计推广码下消费
@PreAuthorize
(
Securitys
.
ADMIN_EL
)
//
@PreAuthorize(Securitys.ADMIN_EL)
@RequestMapping
(
path
=
"/0xadministrator/promotioncode/query"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
path
=
"/0xadministrator/promotioncode/query"
,
method
=
RequestMethod
.
GET
)
public
ResultDto
queryPromotion
(
Principal
principal
,
@RequestParam
(
value
=
"page"
)
int
page
,
@RequestParam
(
value
=
"size"
)
int
size
,
public
ResultDto
queryPromotion
(
Principal
principal
,
@RequestParam
(
value
=
"page"
)
int
page
,
@RequestParam
(
value
=
"size"
)
int
size
,
@RequestParam
(
value
=
"strDate1"
)
String
strDate1
,
@RequestParam
(
value
=
"strDate2"
)
String
strDate2
,
@RequestParam
(
value
=
"strDate1"
)
String
strDate1
,
@RequestParam
(
value
=
"strDate2"
)
String
strDate2
,
@RequestParam
(
value
=
"username"
,
required
=
false
)
String
username
,
@RequestParam
(
value
=
"promotionCode"
,
required
=
false
)
String
promotionCode
)
{
@RequestParam
(
value
=
"username"
,
required
=
false
)
String
username
,
@RequestParam
(
value
=
"promotionCode"
,
required
=
false
)
String
promotionCode
)
{
ResultDto
resultDto
=
new
ResultDto
();
ResultDto
resultDto
=
new
ResultDto
();
try
{
try
{
long
begin
=
System
.
currentTimeMillis
();
Pageable
pageable
=
PageRequest
.
of
(
page
,
size
);
Pageable
pageable
=
PageRequest
.
of
(
page
,
size
);
resultDto
.
setData
(
administratorService
.
queryPromotion
(
pageable
,
username
,
promotionCode
,
strDate1
,
strDate2
));
resultDto
.
setData
(
administratorService
.
queryPromotion
(
pageable
,
username
,
promotionCode
,
strDate1
,
strDate2
));
resultDto
.
setStatus
(
0
);
resultDto
.
setStatus
(
0
);
long
end
=
System
.
currentTimeMillis
();
System
.
out
.
println
(
"=======>"
+
(
end
-
begin
)
+
"ms"
);
}
catch
(
ClientRequestException
e
)
{
resultDto
.
setStatus
(-
1
);
Map
<
String
,
Object
>
statusInfo
=
new
HashMap
<>();
statusInfo
.
put
(
"code"
,
e
.
getErrorCode
());
statusInfo
.
put
(
"message"
,
e
.
getMessage
());
resultDto
.
setStatusInfo
(
statusInfo
);
}
return
resultDto
;
}
//统计推广码下消费
//@PreAuthorize(Securitys.ADMIN_EL)
@GetMapping
(
"/0xadministrator/promotioncode/queryinfo"
)
public
ResultDto
queryCountPromotionInfo
(
@RequestParam
(
value
=
"strDate1"
)
String
strDate1
,
@RequestParam
(
value
=
"strDate2"
)
String
strDate2
,
@RequestParam
(
value
=
"username"
,
required
=
false
)
String
username
,
@RequestParam
(
value
=
"promotionCode"
,
required
=
false
)
String
promotionCode
)
{
ResultDto
resultDto
=
new
ResultDto
();
try
{
long
begin
=
System
.
currentTimeMillis
();
resultDto
.
setData
(
administratorService
.
countPromotionInfos
(
username
,
promotionCode
,
strDate1
,
strDate2
));
resultDto
.
setStatus
(
0
);
long
end
=
System
.
currentTimeMillis
();
System
.
out
.
println
(
"=======>"
+
(
end
-
begin
)
+
"ms"
);
}
catch
(
ClientRequestException
e
)
{
resultDto
.
setStatus
(-
1
);
Map
<
String
,
Object
>
statusInfo
=
new
HashMap
<>();
statusInfo
.
put
(
"code"
,
e
.
getErrorCode
());
statusInfo
.
put
(
"message"
,
e
.
getMessage
());
resultDto
.
setStatusInfo
(
statusInfo
);
}
return
resultDto
;
}
//统计推广码下消费
//@PreAuthorize(Securitys.ADMIN_EL)
@GetMapping
(
"/0xadministrator/promotioncode/querypage"
)
public
ResultDto
queryPagePromotionInfos
(
@RequestParam
(
value
=
"page"
)
int
page
,
@RequestParam
(
value
=
"size"
)
int
size
,
@RequestParam
(
value
=
"strDate1"
)
String
strDate1
,
@RequestParam
(
value
=
"strDate2"
)
String
strDate2
,
@RequestParam
(
value
=
"username"
,
required
=
false
)
String
username
,
@RequestParam
(
value
=
"promotionCode"
,
required
=
false
)
String
promotionCode
)
{
ResultDto
resultDto
=
new
ResultDto
();
try
{
long
begin
=
System
.
currentTimeMillis
();
Pageable
pageable
=
PageRequest
.
of
(
page
,
size
);
resultDto
.
setData
(
administratorService
.
pagePromotionInfos
(
pageable
,
username
,
promotionCode
,
strDate1
,
strDate2
));
resultDto
.
setStatus
(
0
);
long
end
=
System
.
currentTimeMillis
();
System
.
out
.
println
(
"=======>"
+
(
end
-
begin
)
+
"ms"
);
}
catch
(
ClientRequestException
e
)
{
}
catch
(
ClientRequestException
e
)
{
resultDto
.
setStatus
(-
1
);
resultDto
.
setStatus
(-
1
);
Map
<
String
,
Object
>
statusInfo
=
new
HashMap
<>();
Map
<
String
,
Object
>
statusInfo
=
new
HashMap
<>();
...
...
src/main/java/com/edgec/browserbackend/account/dto/AccountPromotionDto.java
View file @
8e6bf3f4
package
com
.
edgec
.
browserbackend
.
account
.
dto
;
package
com
.
edgec
.
browserbackend
.
account
.
dto
;
import
com.edgec.browserbackend.account.domain.Account
;
import
com.edgec.browserbackend.account.domain.Account
;
import
com.edgec.browserbackend.account.domain.Promotion
;
import
com.fasterxml.jackson.annotation.JsonIgnoreProperties
;
import
com.fasterxml.jackson.annotation.JsonIgnoreProperties
;
import
java.util.Date
;
import
java.util.Date
;
...
@@ -10,7 +9,12 @@ import java.util.Date;
...
@@ -10,7 +9,12 @@ import java.util.Date;
public
class
AccountPromotionDto
{
public
class
AccountPromotionDto
{
private
String
username
;
private
String
username
;
private
Date
signupDate
;
private
Date
signupDate
;
private
Promotion
promotion
;
//private Promotion promotion;
private
Integer
firstLevelIps
;
private
Integer
secondLevelIps
;
private
Integer
firstLevelCommission
;
private
Integer
secondLevelCommission
;
public
AccountPromotionDto
()
{
public
AccountPromotionDto
()
{
...
@@ -19,7 +23,6 @@ public class AccountPromotionDto {
...
@@ -19,7 +23,6 @@ public class AccountPromotionDto {
public
AccountPromotionDto
(
Account
account
)
{
public
AccountPromotionDto
(
Account
account
)
{
this
.
username
=
account
.
getName
();
this
.
username
=
account
.
getName
();
this
.
signupDate
=
account
.
getSignupDate
();
this
.
signupDate
=
account
.
getSignupDate
();
this
.
promotion
=
account
.
getPromotion
();
}
}
public
String
getUsername
()
{
public
String
getUsername
()
{
...
@@ -37,4 +40,36 @@ public class AccountPromotionDto {
...
@@ -37,4 +40,36 @@ public class AccountPromotionDto {
public
void
setSignupDate
(
Date
signupDate
)
{
public
void
setSignupDate
(
Date
signupDate
)
{
this
.
signupDate
=
signupDate
;
this
.
signupDate
=
signupDate
;
}
}
public
Integer
getFirstLevelIps
()
{
return
firstLevelIps
;
}
public
void
setFirstLevelIps
(
Integer
firstLevelIps
)
{
this
.
firstLevelIps
=
firstLevelIps
;
}
public
Integer
getSecondLevelIps
()
{
return
secondLevelIps
;
}
public
void
setSecondLevelIps
(
Integer
secondLevelIps
)
{
this
.
secondLevelIps
=
secondLevelIps
;
}
public
Integer
getFirstLevelCommission
()
{
return
firstLevelCommission
;
}
public
void
setFirstLevelCommission
(
Integer
firstLevelCommission
)
{
this
.
firstLevelCommission
=
firstLevelCommission
;
}
public
Integer
getSecondLevelCommission
()
{
return
secondLevelCommission
;
}
public
void
setSecondLevelCommission
(
Integer
secondLevelCommission
)
{
this
.
secondLevelCommission
=
secondLevelCommission
;
}
}
}
src/main/java/com/edgec/browserbackend/account/dto/PromotionInfoDto.java
0 → 100644
View file @
8e6bf3f4
package
com
.
edgec
.
browserbackend
.
account
.
dto
;
/**
* @author xuxin
* @date 2020/9/15 17:22
* @description
*/
public
class
PromotionInfoDto
{
private
Integer
firstLevelInvitedUsers
;
private
Integer
firstLevelIps
;
private
Integer
secondLevelIps
;
private
Integer
allLevelIps
;
/**
* 当前推荐码用户应当获取的礼金
*/
private
Double
gift
;
private
Integer
firstLevelCommission
;
private
Integer
secondLevelCommission
;
public
Integer
getFirstLevelInvitedUsers
()
{
return
firstLevelInvitedUsers
;
}
public
void
setFirstLevelInvitedUsers
(
Integer
firstLevelInvitedUsers
)
{
this
.
firstLevelInvitedUsers
=
firstLevelInvitedUsers
;
}
public
Integer
getFirstLevelIps
()
{
return
firstLevelIps
;
}
public
void
setFirstLevelIps
(
Integer
firstLevelIps
)
{
this
.
firstLevelIps
=
firstLevelIps
;
}
public
Integer
getSecondLevelIps
()
{
return
secondLevelIps
;
}
public
void
setSecondLevelIps
(
Integer
secondLevelIps
)
{
this
.
secondLevelIps
=
secondLevelIps
;
}
public
Integer
getAllLevelIps
()
{
return
allLevelIps
;
}
public
void
setAllLevelIps
(
Integer
allLevelIps
)
{
this
.
allLevelIps
=
allLevelIps
;
}
public
Double
getGift
()
{
return
gift
;
}
public
void
setGift
(
Double
gift
)
{
this
.
gift
=
gift
;
}
public
Integer
getFirstLevelCommission
()
{
return
firstLevelCommission
;
}
public
void
setFirstLevelCommission
(
Integer
firstLevelCommission
)
{
this
.
firstLevelCommission
=
firstLevelCommission
;
}
public
Integer
getSecondLevelCommission
()
{
return
secondLevelCommission
;
}
public
void
setSecondLevelCommission
(
Integer
secondLevelCommission
)
{
this
.
secondLevelCommission
=
secondLevelCommission
;
}
}
src/main/java/com/edgec/browserbackend/account/repository/AccountRepository.java
View file @
8e6bf3f4
...
@@ -33,6 +33,8 @@ public interface AccountRepository extends MongoRepository<Account, String>, Acc
...
@@ -33,6 +33,8 @@ public interface AccountRepository extends MongoRepository<Account, String>, Acc
List
<
Account
>
findAllByPromotionCodeAndParentIsNull
(
String
code
);
List
<
Account
>
findAllByPromotionCodeAndParentIsNull
(
String
code
);
Page
<
Account
>
findAllByPromotionCodeAndParentIsNull
(
Pageable
pageable
,
String
code
);
Page
<
Account
>
findAllBySignupDateBetweenAndPromotionCodeAndParentIsNull
(
Pageable
pageable
,
Date
startDate
,
Date
endDate
,
String
promotionCode
);
Page
<
Account
>
findAllBySignupDateBetweenAndPromotionCodeAndParentIsNull
(
Pageable
pageable
,
Date
startDate
,
Date
endDate
,
String
promotionCode
);
Page
<
Account
>
findAllBySignupDateBetweenAndParentIsNull
(
Pageable
pageable
,
Date
startDate
,
Date
endDate
);
Page
<
Account
>
findAllBySignupDateBetweenAndParentIsNull
(
Pageable
pageable
,
Date
startDate
,
Date
endDate
);
...
...
src/main/java/com/edgec/browserbackend/account/service/AdministratorService.java
View file @
8e6bf3f4
package
com
.
edgec
.
browserbackend
.
account
.
service
;
package
com
.
edgec
.
browserbackend
.
account
.
service
;
import
com.edgec.browserbackend.account.domain.*
;
import
com.edgec.browserbackend.account.domain.*
;
import
com.edgec.browserbackend.account.dto.BillQueryResultDto
;
import
com.edgec.browserbackend.account.dto.*
;
import
com.edgec.browserbackend.account.dto.IpCountQueryResultDto
;
import
com.edgec.browserbackend.account.dto.PromotionQueryResultDto
;
import
com.edgec.browserbackend.account.dto.UserUsedDto
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.Pageable
;
import
org.springframework.data.domain.Pageable
;
...
@@ -58,6 +55,10 @@ public interface AdministratorService {
...
@@ -58,6 +55,10 @@ public interface AdministratorService {
PromotionQueryResultDto
queryPromotion
(
Pageable
pageable
,
String
username
,
String
promotionCode
,
String
strDate1
,
String
strDate2
);
PromotionQueryResultDto
queryPromotion
(
Pageable
pageable
,
String
username
,
String
promotionCode
,
String
strDate1
,
String
strDate2
);
PromotionInfoDto
countPromotionInfos
(
String
username
,
String
promotionCode
,
String
beginDate
,
String
endDate
);
Page
<
AccountPromotionDto
>
pagePromotionInfos
(
Pageable
pageable
,
String
username
,
String
promotionCode
,
String
beginDate
,
String
endDate
);
void
addWhiteList
(
String
website
);
void
addWhiteList
(
String
website
);
void
addUserWhiteList
(
String
username
,
String
website
);
void
addUserWhiteList
(
String
username
,
String
website
);
...
...
src/main/java/com/edgec/browserbackend/account/service/impl/AdministratorServiceImpl.java
View file @
8e6bf3f4
This diff is collapsed.
Click to expand it.
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