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
032ff3c5
Commit
032ff3c5
authored
Apr 13, 2020
by
renjie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
admin bug
http请求超时时间
parent
aa2969e1
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
14 deletions
+18
-14
UserPrePaidBillingRepository.java
...kend/account/repository/UserPrePaidBillingRepository.java
+6
-6
AccountServiceImpl.java
...owserbackend/account/service/impl/AccountServiceImpl.java
+6
-6
AdministratorServiceImpl.java
...ackend/account/service/impl/AdministratorServiceImpl.java
+1
-1
BrowserTask.java
...va/com/edgec/browserbackend/browser/task/BrowserTask.java
+5
-1
No files found.
src/main/java/com/edgec/browserbackend/account/repository/UserPrePaidBillingRepository.java
View file @
032ff3c5
...
@@ -35,15 +35,15 @@ public interface UserPrePaidBillingRepository extends MongoRepository<UserPrePai
...
@@ -35,15 +35,15 @@ public interface UserPrePaidBillingRepository extends MongoRepository<UserPrePai
List
<
UserPrePaidBilling
>
findByStatus
(
BillStatus
status
);
List
<
UserPrePaidBilling
>
findByStatus
(
BillStatus
status
);
Page
<
UserPrePaidBilling
>
findByUsernameAndTimestampGreaterThanOrderByTimestamp
(
String
username
,
long
time
,
Pageable
pageable
);
Page
<
UserPrePaidBilling
>
findByUsernameAndTimestampGreaterThanOrderByTimestamp
Desc
(
String
username
,
long
time
,
Pageable
pageable
);
Page
<
UserPrePaidBilling
>
findByAdministratorAndTimestampGreaterThanOrderByTimestamp
(
String
administrator
,
long
time
,
Pageable
pageable
);
Page
<
UserPrePaidBilling
>
findByAdministratorAndTimestampGreaterThanOrderByTimestamp
Desc
(
String
administrator
,
long
time
,
Pageable
pageable
);
Page
<
UserPrePaidBilling
>
findByUsernameAndTimestampGreaterThanAndChargeTypeOrderByTimestamp
(
String
username
,
long
time
,
int
chargeType
,
Pageable
pageable
);
Page
<
UserPrePaidBilling
>
findByUsernameAndTimestampGreaterThanAndChargeTypeOrderByTimestamp
Desc
(
String
username
,
long
time
,
int
chargeType
,
Pageable
pageable
);
Page
<
UserPrePaidBilling
>
findByAdministratorAndTimestampGreaterThanAndChargeTypeOrderByTimestamp
(
String
administrator
,
long
time
,
int
chargeType
,
Pageable
pageable
);
Page
<
UserPrePaidBilling
>
findByAdministratorAndTimestampGreaterThanAndChargeTypeOrderByTimestamp
Desc
(
String
administrator
,
long
time
,
int
chargeType
,
Pageable
pageable
);
Page
<
UserPrePaidBilling
>
findByUsernameAndTimestampGreaterThanAndChargeTypeIsNotAndPayMethodOrderByTimestamp
(
String
username
,
long
time
,
int
chargeType
,
int
payMethod
,
Pageable
pageable
);
Page
<
UserPrePaidBilling
>
findByUsernameAndTimestampGreaterThanAndChargeTypeIsNotAndPayMethodOrderByTimestamp
Desc
(
String
username
,
long
time
,
int
chargeType
,
int
payMethod
,
Pageable
pageable
);
Page
<
UserPrePaidBilling
>
findByAdministratorAndTimestampGreaterThanAndChargeTypeIsNotAndPayMethodOrderByTimestamp
(
String
administrator
,
long
time
,
int
chargeType
,
int
payMethod
,
Pageable
pageable
);
Page
<
UserPrePaidBilling
>
findByAdministratorAndTimestampGreaterThanAndChargeTypeIsNotAndPayMethodOrderByTimestamp
Desc
(
String
administrator
,
long
time
,
int
chargeType
,
int
payMethod
,
Pageable
pageable
);
}
}
src/main/java/com/edgec/browserbackend/account/service/impl/AccountServiceImpl.java
View file @
032ff3c5
...
@@ -187,19 +187,19 @@ public class AccountServiceImpl implements AccountService {
...
@@ -187,19 +187,19 @@ public class AccountServiceImpl implements AccountService {
Page
<
UserPrePaidBilling
>
userPrePaidBillings
;
Page
<
UserPrePaidBilling
>
userPrePaidBillings
;
if
(
userPrePaidBillingRequestDto
.
getTradeType
()
==
1
)
{
if
(
userPrePaidBillingRequestDto
.
getTradeType
()
==
1
)
{
if
(
account
.
getParent
()
!=
null
)
if
(
account
.
getParent
()
!=
null
)
userPrePaidBillings
=
prePaidBillingRepository
.
findByUsernameAndTimestampGreaterThanAndChargeTypeOrderByTimestamp
(
name
,
time
,
0
,
pageable
);
userPrePaidBillings
=
prePaidBillingRepository
.
findByUsernameAndTimestampGreaterThanAndChargeTypeOrderByTimestamp
Desc
(
name
,
time
,
0
,
pageable
);
else
else
userPrePaidBillings
=
prePaidBillingRepository
.
findByAdministratorAndTimestampGreaterThanAndChargeTypeOrderByTimestamp
(
name
,
time
,
0
,
pageable
);
userPrePaidBillings
=
prePaidBillingRepository
.
findByAdministratorAndTimestampGreaterThanAndChargeTypeOrderByTimestamp
Desc
(
name
,
time
,
0
,
pageable
);
}
else
if
(
userPrePaidBillingRequestDto
.
getTradeType
()
==
2
||
userPrePaidBillingRequestDto
.
getTradeType
()
==
3
||
userPrePaidBillingRequestDto
.
getTradeType
()
==
4
)
{
}
else
if
(
userPrePaidBillingRequestDto
.
getTradeType
()
==
2
||
userPrePaidBillingRequestDto
.
getTradeType
()
==
3
||
userPrePaidBillingRequestDto
.
getTradeType
()
==
4
)
{
if
(
account
.
getParent
()
!=
null
)
if
(
account
.
getParent
()
!=
null
)
userPrePaidBillings
=
prePaidBillingRepository
.
findByUsernameAndTimestampGreaterThanAndChargeTypeIsNotAndPayMethodOrderByTimestamp
(
name
,
time
,
0
,
userPrePaidBillingRequestDto
.
getTradeType
()
-
2
,
pageable
);
userPrePaidBillings
=
prePaidBillingRepository
.
findByUsernameAndTimestampGreaterThanAndChargeTypeIsNotAndPayMethodOrderByTimestamp
Desc
(
name
,
time
,
0
,
userPrePaidBillingRequestDto
.
getTradeType
()
-
2
,
pageable
);
else
else
userPrePaidBillings
=
prePaidBillingRepository
.
findByAdministratorAndTimestampGreaterThanAndChargeTypeIsNotAndPayMethodOrderByTimestamp
(
name
,
time
,
0
,
userPrePaidBillingRequestDto
.
getTradeType
()
-
2
,
pageable
);
userPrePaidBillings
=
prePaidBillingRepository
.
findByAdministratorAndTimestampGreaterThanAndChargeTypeIsNotAndPayMethodOrderByTimestamp
Desc
(
name
,
time
,
0
,
userPrePaidBillingRequestDto
.
getTradeType
()
-
2
,
pageable
);
}
else
{
}
else
{
if
(
account
.
getParent
()
!=
null
)
if
(
account
.
getParent
()
!=
null
)
userPrePaidBillings
=
prePaidBillingRepository
.
findByUsernameAndTimestampGreaterThanOrderByTimestamp
(
name
,
time
,
pageable
);
userPrePaidBillings
=
prePaidBillingRepository
.
findByUsernameAndTimestampGreaterThanOrderByTimestamp
Desc
(
name
,
time
,
pageable
);
else
else
userPrePaidBillings
=
prePaidBillingRepository
.
findByAdministratorAndTimestampGreaterThanOrderByTimestamp
(
name
,
time
,
pageable
);
userPrePaidBillings
=
prePaidBillingRepository
.
findByAdministratorAndTimestampGreaterThanOrderByTimestamp
Desc
(
name
,
time
,
pageable
);
}
}
PrePaidBillingPageResultDto
prePaidBillingPageResultDto
=
new
PrePaidBillingPageResultDto
();
PrePaidBillingPageResultDto
prePaidBillingPageResultDto
=
new
PrePaidBillingPageResultDto
();
...
...
src/main/java/com/edgec/browserbackend/account/service/impl/AdministratorServiceImpl.java
View file @
032ff3c5
...
@@ -144,7 +144,7 @@ public class AdministratorServiceImpl implements AdministratorService {
...
@@ -144,7 +144,7 @@ public class AdministratorServiceImpl implements AdministratorService {
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
();
List
<
UserPrePaidBilling
>
userPrePaidBillings1_child
=
userPrePaidBillingRepository
.
findByUsernameAndPayMethod
(
name
,
3
);
List
<
UserPrePaidBilling
>
userPrePaidBillings1_child
=
userPrePaidBillingRepository
.
findByUsernameAndPayMethod
(
child
.
getName
()
,
3
);
if
(
userPrePaidBillings1_child
!=
null
)
if
(
userPrePaidBillings1_child
!=
null
)
childbanktransfer
+=
userPrePaidBillings1_child
.
stream
().
mapToDouble
(
UserPrePaidBilling:
:
getTotal
).
sum
();
childbanktransfer
+=
userPrePaidBillings1_child
.
stream
().
mapToDouble
(
UserPrePaidBilling:
:
getTotal
).
sum
();
}
}
...
...
src/main/java/com/edgec/browserbackend/browser/task/BrowserTask.java
View file @
032ff3c5
...
@@ -13,6 +13,7 @@ import org.slf4j.LoggerFactory;
...
@@ -13,6 +13,7 @@ import org.slf4j.LoggerFactory;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.http.*
;
import
org.springframework.http.*
;
import
org.springframework.http.client.SimpleClientHttpRequestFactory
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
org.springframework.web.client.RestTemplate
;
import
org.springframework.web.client.RestTemplate
;
...
@@ -169,7 +170,10 @@ public class BrowserTask {
...
@@ -169,7 +170,10 @@ public class BrowserTask {
CompletableFuture
.
runAsync
(()
->
{
CompletableFuture
.
runAsync
(()
->
{
if
(
ipResourceRepository
.
lockTask
(
ipResource
))
{
if
(
ipResourceRepository
.
lockTask
(
ipResource
))
{
try
{
try
{
RestTemplate
restTemplate
=
new
RestTemplate
();
SimpleClientHttpRequestFactory
requestFactory
=
new
SimpleClientHttpRequestFactory
();
requestFactory
.
setConnectTimeout
(
10000
);
// 设置超时
requestFactory
.
setReadTimeout
(
10000
);
RestTemplate
restTemplate
=
new
RestTemplate
(
requestFactory
);
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
HttpHeaders
headers
=
buildGetHeader
();
HttpHeaders
headers
=
buildGetHeader
();
HttpEntity
<
Map
<
String
,
Object
>>
entity
=
new
HttpEntity
<>(
params
,
headers
);
HttpEntity
<
Map
<
String
,
Object
>>
entity
=
new
HttpEntity
<>(
params
,
headers
);
...
...
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