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
5036f086
Commit
5036f086
authored
Mar 19, 2020
by
renjie
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://120.77.149.83/root/browser-backend
parents
1a0b79dc
20eb3f2a
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
282 additions
and
13 deletions
+282
-13
PaymentServiceImpl.java
...owserbackend/account/service/impl/PaymentServiceImpl.java
+12
-1
WebSecurityConfig.java
...m/edgec/browserbackend/auth/config/WebSecurityConfig.java
+1
-1
BrowserErrorCode.java
...ec/browserbackend/browser/ErrorCode/BrowserErrorCode.java
+4
-1
IpControlloer.java
...dgec/browserbackend/browser/controller/IpControlloer.java
+19
-1
ShopController.java
...gec/browserbackend/browser/controller/ShopController.java
+7
-3
IpTransaction.java
...om/edgec/browserbackend/browser/domain/IpTransaction.java
+65
-0
IpTransactionDto.java
...om/edgec/browserbackend/browser/dto/IpTransactionDto.java
+53
-0
ShopFilterDto.java
...a/com/edgec/browserbackend/browser/dto/ShopFilterDto.java
+9
-0
IpTransactionRepository.java
...erbackend/browser/repository/IpTransactionRepository.java
+13
-0
UserShopRepository.java
...browserbackend/browser/repository/UserShopRepository.java
+3
-0
IpResourceServiceImpl.java
...erbackend/browser/service/Impl/IpResourceServiceImpl.java
+0
-0
ShopServiceImpl.java
.../browserbackend/browser/service/Impl/ShopServiceImpl.java
+14
-0
IpResourceService.java
...gec/browserbackend/browser/service/IpResourceService.java
+4
-5
FileUtil.java
.../java/com/edgec/browserbackend/common/utils/FileUtil.java
+2
-1
PollerUtils.java
...va/com/edgec/browserbackend/common/utils/PollerUtils.java
+30
-0
ThreadPoolUtils.java
...om/edgec/browserbackend/common/utils/ThreadPoolUtils.java
+46
-0
batchAdd.xlsx
src/main/resources/static/batchAdd.xlsx
+0
-0
~$batchAdd.xlsx
src/main/resources/static/~$batchAdd.xlsx
+0
-0
No files found.
src/main/java/com/edgec/browserbackend/account/service/impl/PaymentServiceImpl.java
View file @
5036f086
...
@@ -169,6 +169,17 @@ public class PaymentServiceImpl implements PaymentService {
...
@@ -169,6 +169,17 @@ public class PaymentServiceImpl implements PaymentService {
userPrePaidBillingRepository
.
save
(
bill
);
userPrePaidBillingRepository
.
save
(
bill
);
if
(
more
!=
20
&&
more
!=
45
&&
more
!=
125
&&
more
!=
300
)
more
=
0
;
if
((
more
==
20
&&
byTradeNo
.
getAmount
()
!=
100
)
||
(
more
!=
20
&&
byTradeNo
.
getAmount
()
==
100
))
more
=
0
;
if
((
more
==
45
&&
byTradeNo
.
getAmount
()
!=
200
)
||
(
more
!=
45
&&
byTradeNo
.
getAmount
()
==
200
))
more
=
0
;
if
((
more
==
125
&&
byTradeNo
.
getAmount
()
!=
500
)
||
(
more
!=
125
&&
byTradeNo
.
getAmount
()
==
500
))
more
=
0
;
if
((
more
==
300
&&
byTradeNo
.
getAmount
()
!=
1000
)
||
(
more
!=
300
&&
byTradeNo
.
getAmount
()
==
1000
))
more
=
0
;
balance
.
setBalanced
(
balance
.
getBalanced
()
+
byTradeNo
.
getAmount
()
+
more
);
balance
.
setBalanced
(
balance
.
getBalanced
()
+
byTradeNo
.
getAmount
()
+
more
);
userBalanceRepository
.
save
(
balance
);
userBalanceRepository
.
save
(
balance
);
}
}
...
@@ -272,7 +283,7 @@ public class PaymentServiceImpl implements PaymentService {
...
@@ -272,7 +283,7 @@ public class PaymentServiceImpl implements PaymentService {
bill
.
setMonth
(
monthValue
);
bill
.
setMonth
(
monthValue
);
if
(
more
!=
20
||
more
!=
45
||
more
!=
125
||
more
!=
300
)
if
(
more
!=
20
&&
more
!=
45
&&
more
!=
125
&&
more
!=
300
)
more
=
0
;
more
=
0
;
if
((
more
==
20
&&
byTradeNo
.
getAmount
()
!=
100
)
||
(
more
!=
20
&&
byTradeNo
.
getAmount
()
==
100
))
if
((
more
==
20
&&
byTradeNo
.
getAmount
()
!=
100
)
||
(
more
!=
20
&&
byTradeNo
.
getAmount
()
==
100
))
more
=
0
;
more
=
0
;
...
...
src/main/java/com/edgec/browserbackend/auth/config/WebSecurityConfig.java
View file @
5036f086
...
@@ -32,7 +32,7 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
...
@@ -32,7 +32,7 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
public
void
configure
(
WebSecurity
web
)
throws
Exception
{
public
void
configure
(
WebSecurity
web
)
throws
Exception
{
web
.
ignoring
()
web
.
ignoring
()
.
antMatchers
(
"/user/authCode"
,
"/user/signUp"
,
"/shop/multiadd"
,
.
antMatchers
(
"/user/authCode"
,
"/user/signUp"
,
"/user/reset*"
);
"/user/reset*"
);
}
}
...
...
src/main/java/com/edgec/browserbackend/browser/ErrorCode/BrowserErrorCode.java
View file @
5036f086
package
com
.
edgec
.
browserbackend
.
browser
.
ErrorCode
;
package
com
.
edgec
.
browserbackend
.
browser
.
ErrorCode
;
import
com.edgec.browserbackend.browser.domain.IpTransaction
;
import
com.edgec.browserbackend.common.commons.error.ErrorCode
;
import
com.edgec.browserbackend.common.commons.error.ErrorCode
;
import
com.fasterxml.jackson.annotation.JsonValue
;
import
com.fasterxml.jackson.annotation.JsonValue
;
...
@@ -14,7 +15,9 @@ public enum BrowserErrorCode implements ErrorCode {
...
@@ -14,7 +15,9 @@ public enum BrowserErrorCode implements ErrorCode {
IPNOTEXIST
(
BROWSER_BASE
+
201
,
"The ip do not exist"
),
IPNOTEXIST
(
BROWSER_BASE
+
201
,
"The ip do not exist"
),
IPNOTBINDTOSHOP
(
BROWSER_BASE
+
202
,
"The ip do not bind this shop."
),
IPNOTBINDTOSHOP
(
BROWSER_BASE
+
202
,
"The ip do not bind this shop."
),
GROUPNOTEXIST
(
BROWSER_BASE
+
301
,
"The group do not exist"
);
GROUPNOTEXIST
(
BROWSER_BASE
+
301
,
"The group do not exist"
),
IPTRANSACTIONNOTEXIST
(
BROWSER_BASE
+
401
,
"The ipTransaction do not exist"
);
...
...
src/main/java/com/edgec/browserbackend/browser/controller/IpControlloer.java
View file @
5036f086
...
@@ -26,7 +26,7 @@ public class IpControlloer {
...
@@ -26,7 +26,7 @@ public class IpControlloer {
public
ResultDto
buyIp
(
Principal
principal
,
@RequestBody
IpResourceRequestDto
ipResourceRequestDto
){
public
ResultDto
buyIp
(
Principal
principal
,
@RequestBody
IpResourceRequestDto
ipResourceRequestDto
){
ResultDto
resultDto
=
new
ResultDto
();
ResultDto
resultDto
=
new
ResultDto
();
try
{
try
{
List
<
IpResourceDto
>
ipResourceDto
=
ipResourceService
.
buyIp
(
principal
.
getName
(),
ipResourceRequestDto
);
IpTransactionDto
ipResourceDto
=
ipResourceService
.
buyIp
(
principal
.
getName
(),
ipResourceRequestDto
);
resultDto
.
setData
(
ipResourceDto
);
resultDto
.
setData
(
ipResourceDto
);
resultDto
.
setStatus
(
0
);
resultDto
.
setStatus
(
0
);
}
catch
(
ClientRequestException
e
)
{
}
catch
(
ClientRequestException
e
)
{
...
@@ -100,4 +100,22 @@ public class IpControlloer {
...
@@ -100,4 +100,22 @@ public class IpControlloer {
}
}
return
resultDto
;
return
resultDto
;
}
}
@RequestMapping
(
value
=
"/queryTransaction"
,
method
=
RequestMethod
.
POST
)
public
ResultDto
queryTransaction
(
Principal
principal
,
@RequestBody
IpTransactionDto
ipTransactionDto
)
{
ResultDto
resultDto
=
new
ResultDto
();
try
{
IpTransactionDto
ipTransactionDto1
=
ipResourceService
.
queryTransaction
(
principal
.
getName
(),
ipTransactionDto
.
getTid
());
resultDto
.
setData
(
ipTransactionDto1
);
resultDto
.
setStatus
(
0
);
}
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
;
}
}
}
src/main/java/com/edgec/browserbackend/browser/controller/ShopController.java
View file @
5036f086
...
@@ -10,6 +10,8 @@ import com.edgec.browserbackend.browser.dto.ShopStringResultDto;
...
@@ -10,6 +10,8 @@ import com.edgec.browserbackend.browser.dto.ShopStringResultDto;
import
com.edgec.browserbackend.browser.service.ShopService
;
import
com.edgec.browserbackend.browser.service.ShopService
;
import
com.edgec.browserbackend.common.commons.error.ClientRequestException
;
import
com.edgec.browserbackend.common.commons.error.ClientRequestException
;
import
com.edgec.browserbackend.common.utils.FileUtil
;
import
com.edgec.browserbackend.common.utils.FileUtil
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.multipart.MultipartFile
;
import
org.springframework.web.multipart.MultipartFile
;
...
@@ -25,6 +27,8 @@ import java.util.Map;
...
@@ -25,6 +27,8 @@ import java.util.Map;
@RequestMapping
(
"/shop"
)
@RequestMapping
(
"/shop"
)
public
class
ShopController
{
public
class
ShopController
{
private
final
Logger
logger
=
LoggerFactory
.
getLogger
(
ShopController
.
class
);
@Autowired
@Autowired
private
ShopService
shopService
;
private
ShopService
shopService
;
...
@@ -47,8 +51,7 @@ public class ShopController {
...
@@ -47,8 +51,7 @@ public class ShopController {
}
}
@RequestMapping
(
value
=
"/multiadd"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/multiadd"
,
method
=
RequestMethod
.
POST
)
@ResponseBody
public
ResultDto
addShops
(
Principal
principal
,
@RequestParam
(
"file"
)
MultipartFile
file
)
{
public
List
<
String
>
addShops
(
Principal
principal
,
@RequestParam
(
"file"
)
MultipartFile
file
)
{
ResultDto
resultDto
=
new
ResultDto
();
ResultDto
resultDto
=
new
ResultDto
();
String
name
=
file
.
getOriginalFilename
();
String
name
=
file
.
getOriginalFilename
();
if
(
name
.
length
()<
6
||
!
name
.
substring
(
name
.
length
()-
5
).
equals
(
".xlsx"
)){
if
(
name
.
length
()<
6
||
!
name
.
substring
(
name
.
length
()-
5
).
equals
(
".xlsx"
)){
...
@@ -60,6 +63,7 @@ public class ShopController {
...
@@ -60,6 +63,7 @@ public class ShopController {
}
}
try
{
try
{
shopService
.
addShops
(
principal
.
getName
(),
file
);
shopService
.
addShops
(
principal
.
getName
(),
file
);
resultDto
.
setStatus
(
0
);
}
catch
(
ClientRequestException
|
IOException
e
)
{
}
catch
(
ClientRequestException
|
IOException
e
)
{
resultDto
.
setStatus
(-
1
);
resultDto
.
setStatus
(-
1
);
Map
<
String
,
Object
>
statusInfo
=
new
HashMap
<>();
Map
<
String
,
Object
>
statusInfo
=
new
HashMap
<>();
...
@@ -69,7 +73,7 @@ public class ShopController {
...
@@ -69,7 +73,7 @@ public class ShopController {
}
}
return
null
;
return
resultDto
;
}
}
...
...
src/main/java/com/edgec/browserbackend/browser/domain/IpTransaction.java
0 → 100644
View file @
5036f086
package
com
.
edgec
.
browserbackend
.
browser
.
domain
;
import
org.springframework.data.annotation.Id
;
import
org.springframework.data.mongodb.core.mapping.Document
;
import
java.util.List
;
/**
* @Desc
* @Author jason
* @CreateTime 2020/3/18 9:42 上午
**/
@Document
(
"iptransaction"
)
public
class
IpTransaction
{
@Id
private
String
tid
;
private
String
username
;
private
long
createTime
;
private
int
status
;
private
List
<
String
>
ipIds
;
public
String
getUsername
()
{
return
username
;
}
public
void
setUsername
(
String
username
)
{
this
.
username
=
username
;
}
public
int
getStatus
()
{
return
status
;
}
public
void
setStatus
(
int
status
)
{
this
.
status
=
status
;
}
public
String
getTid
()
{
return
tid
;
}
public
void
setCreateTime
(
long
createTime
)
{
this
.
createTime
=
createTime
;
}
public
long
getCreateTime
()
{
return
createTime
;
}
public
void
setTid
(
String
tid
)
{
this
.
tid
=
tid
;
}
public
List
<
String
>
getIpIds
()
{
return
ipIds
;
}
public
void
setIpIds
(
List
<
String
>
ipIds
)
{
this
.
ipIds
=
ipIds
;
}
}
src/main/java/com/edgec/browserbackend/browser/dto/IpTransactionDto.java
0 → 100644
View file @
5036f086
package
com
.
edgec
.
browserbackend
.
browser
.
dto
;
import
com.edgec.browserbackend.browser.domain.IpTransaction
;
import
com.fasterxml.jackson.annotation.JsonIgnoreProperties
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
* @Desc
* @Author jason
* @CreateTime 2020/3/18 9:57 上午
**/
@JsonIgnoreProperties
(
ignoreUnknown
=
true
)
public
class
IpTransactionDto
{
private
String
tid
;
private
int
status
;
private
List
<
IpResourceDto
>
ipResourceDtos
;
public
IpTransactionDto
(){
}
public
IpTransactionDto
(
IpTransaction
ipTransaction
)
{
this
.
tid
=
ipTransaction
.
getTid
();
this
.
status
=
ipTransaction
.
getStatus
();
ipResourceDtos
=
new
ArrayList
<>();
}
public
String
getTid
()
{
return
tid
;
}
public
void
setTid
(
String
tid
)
{
this
.
tid
=
tid
;
}
public
int
getStatus
()
{
return
status
;
}
public
void
setStatus
(
int
status
)
{
this
.
status
=
status
;
}
public
List
<
IpResourceDto
>
getIpResourceDtos
()
{
return
ipResourceDtos
;
}
public
void
setIpResourceDtos
(
List
<
IpResourceDto
>
ipResourceDtos
)
{
this
.
ipResourceDtos
=
ipResourceDtos
;
}
}
src/main/java/com/edgec/browserbackend/browser/dto/ShopFilterDto.java
View file @
5036f086
...
@@ -7,6 +7,7 @@ public class ShopFilterDto {
...
@@ -7,6 +7,7 @@ public class ShopFilterDto {
private
String
shopName
;
private
String
shopName
;
private
String
IpRegion
;
private
String
IpRegion
;
private
String
shopAccount
;
private
String
shopAccount
;
private
int
bindIp
;
public
String
getShopAccount
()
{
public
String
getShopAccount
()
{
return
shopAccount
;
return
shopAccount
;
...
@@ -31,4 +32,12 @@ public class ShopFilterDto {
...
@@ -31,4 +32,12 @@ public class ShopFilterDto {
public
void
setShopName
(
String
shopName
)
{
public
void
setShopName
(
String
shopName
)
{
this
.
shopName
=
shopName
;
this
.
shopName
=
shopName
;
}
}
public
int
getBindIp
()
{
return
bindIp
;
}
public
void
setBindIp
(
int
bindIp
)
{
this
.
bindIp
=
bindIp
;
}
}
}
src/main/java/com/edgec/browserbackend/browser/repository/IpTransactionRepository.java
0 → 100644
View file @
5036f086
package
com
.
edgec
.
browserbackend
.
browser
.
repository
;
import
com.edgec.browserbackend.browser.domain.IpTransaction
;
import
org.springframework.data.mongodb.repository.MongoRepository
;
/**
* @Desc
* @Author jason
* @CreateTime 2020/3/18 5:21 下午
**/
public
interface
IpTransactionRepository
extends
MongoRepository
<
IpTransaction
,
String
>
{
}
src/main/java/com/edgec/browserbackend/browser/repository/UserShopRepository.java
View file @
5036f086
...
@@ -7,9 +7,12 @@ import java.util.List;
...
@@ -7,9 +7,12 @@ import java.util.List;
public
interface
UserShopRepository
extends
MongoRepository
<
UserShop
,
String
>,
UserShopRepositoryCustom
{
public
interface
UserShopRepository
extends
MongoRepository
<
UserShop
,
String
>,
UserShopRepositoryCustom
{
List
<
UserShop
>
findByUsername
(
String
username
);
List
<
UserShop
>
findByUsername
(
String
username
);
List
<
UserShop
>
findByUsernameAndIpIdIsNull
(
String
username
);
UserShop
findByUsernameAndShopId
(
String
username
,
String
shopId
);
UserShop
findByUsernameAndShopId
(
String
username
,
String
shopId
);
UserShop
findByShopId
(
String
shopId
);
UserShop
findByShopId
(
String
shopId
);
List
<
UserShop
>
findByUsernameAndGroupId
(
String
username
,
String
groupId
);
List
<
UserShop
>
findByUsernameAndGroupId
(
String
username
,
String
groupId
);
List
<
UserShop
>
findByUsernameAndGroupIdAndIpIdIsNull
(
String
username
,
String
groupId
);
List
<
UserShop
>
findByUsernameAndGroupIdAndIpIdIsNotNull
(
String
username
,
String
groupId
);
List
<
UserShop
>
findByUsernameAndShopIdIn
(
String
username
,
List
<
String
>
shopIds
);
List
<
UserShop
>
findByUsernameAndShopIdIn
(
String
username
,
List
<
String
>
shopIds
);
List
<
UserShop
>
findByUsernameAndIpIdIsNotNull
(
String
username
);
List
<
UserShop
>
findByUsernameAndIpIdIsNotNull
(
String
username
);
int
countByUsernameAndIpIdIsNull
(
String
username
);
int
countByUsernameAndIpIdIsNull
(
String
username
);
...
...
src/main/java/com/edgec/browserbackend/browser/service/Impl/IpResourceServiceImpl.java
View file @
5036f086
This diff is collapsed.
Click to expand it.
src/main/java/com/edgec/browserbackend/browser/service/Impl/ShopServiceImpl.java
View file @
5036f086
...
@@ -359,11 +359,25 @@ public class ShopServiceImpl implements ShopService {
...
@@ -359,11 +359,25 @@ public class ShopServiceImpl implements ShopService {
}
}
List
<
String
>
shopIds
=
new
ArrayList
<>();
List
<
String
>
shopIds
=
new
ArrayList
<>();
if
(
groupId
.
equals
(
"-1"
))
{
if
(
groupId
.
equals
(
"-1"
))
{
if
(
shopFilterDto
.
getBindIp
()
==
0
)
shopIds
=
userShopRepository
.
findByUsername
(
username
).
stream
().
shopIds
=
userShopRepository
.
findByUsername
(
username
).
stream
().
map
(
x
->
x
.
getShopId
()).
collect
(
Collectors
.
toList
());
map
(
x
->
x
.
getShopId
()).
collect
(
Collectors
.
toList
());
else
if
(
shopFilterDto
.
getBindIp
()
==
1
)
shopIds
=
userShopRepository
.
findByUsernameAndIpIdIsNotNull
(
username
).
stream
().
map
(
x
->
x
.
getShopId
()).
collect
(
Collectors
.
toList
());
else
shopIds
=
userShopRepository
.
findByUsernameAndIpIdIsNull
(
username
).
stream
().
map
(
x
->
x
.
getShopId
()).
collect
(
Collectors
.
toList
());
}
else
{
}
else
{
if
(
shopFilterDto
.
getBindIp
()
==
0
)
shopIds
=
userShopRepository
.
findByUsernameAndGroupId
(
username
,
groupId
).
stream
().
shopIds
=
userShopRepository
.
findByUsernameAndGroupId
(
username
,
groupId
).
stream
().
map
(
x
->
x
.
getShopId
()).
collect
(
Collectors
.
toList
());
map
(
x
->
x
.
getShopId
()).
collect
(
Collectors
.
toList
());
else
if
(
shopFilterDto
.
getBindIp
()
==
1
)
shopIds
=
userShopRepository
.
findByUsernameAndGroupIdAndIpIdIsNotNull
(
username
,
groupId
).
stream
().
map
(
x
->
x
.
getShopId
()).
collect
(
Collectors
.
toList
());
else
shopIds
=
userShopRepository
.
findByUsernameAndGroupIdAndIpIdIsNull
(
username
,
groupId
).
stream
().
map
(
x
->
x
.
getShopId
()).
collect
(
Collectors
.
toList
());
}
}
Page
<
Shop
>
shops
;
Page
<
Shop
>
shops
;
if
(
shopFilterDto
!=
null
&&
StringUtils
.
isNotBlank
(
shopFilterDto
.
getIpRegion
()))
if
(
shopFilterDto
!=
null
&&
StringUtils
.
isNotBlank
(
shopFilterDto
.
getIpRegion
()))
...
...
src/main/java/com/edgec/browserbackend/browser/service/IpResourceService.java
View file @
5036f086
package
com
.
edgec
.
browserbackend
.
browser
.
service
;
package
com
.
edgec
.
browserbackend
.
browser
.
service
;
import
com.edgec.browserbackend.browser.domain.IpOptions
;
import
com.edgec.browserbackend.browser.domain.*
;
import
com.edgec.browserbackend.browser.domain.Platform
;
import
com.edgec.browserbackend.browser.domain.PlatformOptions
;
import
com.edgec.browserbackend.browser.domain.ShopSummary
;
import
com.edgec.browserbackend.browser.dto.*
;
import
com.edgec.browserbackend.browser.dto.*
;
import
java.util.List
;
import
java.util.List
;
public
interface
IpResourceService
{
public
interface
IpResourceService
{
List
<
IpResourceDto
>
buyIp
(
String
username
,
IpResourceRequestDto
ipResourceRequestDto
)
throws
Exception
;
IpTransactionDto
buyIp
(
String
username
,
IpResourceRequestDto
ipResourceRequestDto
)
throws
Exception
;
IpOperationResultDto
renewIp
(
String
username
,
IpResourceRequestDto
ipResourceRequestDto
)
throws
Exception
;
IpOperationResultDto
renewIp
(
String
username
,
IpResourceRequestDto
ipResourceRequestDto
)
throws
Exception
;
...
@@ -23,4 +20,6 @@ public interface IpResourceService {
...
@@ -23,4 +20,6 @@ public interface IpResourceService {
IpOptions
getIpOptions
();
IpOptions
getIpOptions
();
List
<
PlatformOptions
>
getPlatformOptions
();
List
<
PlatformOptions
>
getPlatformOptions
();
IpTransactionDto
queryTransaction
(
String
username
,
String
transactionId
);
}
}
src/main/java/com/edgec/browserbackend/common/utils/FileUtil.java
View file @
5036f086
...
@@ -77,6 +77,7 @@ public class FileUtil {
...
@@ -77,6 +77,7 @@ public class FileUtil {
inputStream
.
close
();
inputStream
.
close
();
//工作表对象
//工作表对象
Sheet
sheet
=
workbook
.
getSheetAt
(
0
);
Sheet
sheet
=
workbook
.
getSheetAt
(
0
);
//总行数
//总行数
int
rowLength
=
sheet
.
getLastRowNum
()
-
1
;
int
rowLength
=
sheet
.
getLastRowNum
()
-
1
;
//工作表的列
//工作表的列
...
@@ -87,7 +88,7 @@ public class FileUtil {
...
@@ -87,7 +88,7 @@ public class FileUtil {
//得到指定的单元格
//得到指定的单元格
Cell
cell
=
row
.
getCell
(
0
);;
Cell
cell
=
row
.
getCell
(
0
);;
int
size
=
1
;
int
size
=
1
;
for
(
int
i
=
2
;
i
<
rowLength
;
i
++)
{
for
(
int
i
=
1
;
i
<
rowLength
+
2
;
i
++)
{
row
=
sheet
.
getRow
(
i
);
row
=
sheet
.
getRow
(
i
);
List
<
Object
>
rowvalue
=
new
ArrayList
<>();
List
<
Object
>
rowvalue
=
new
ArrayList
<>();
size
=
0
;
size
=
0
;
...
...
src/main/java/com/edgec/browserbackend/common/utils/PollerUtils.java
0 → 100644
View file @
5036f086
package
com
.
edgec
.
browserbackend
.
common
.
utils
;
import
java.time.Instant
;
public
class
PollerUtils
{
public
static
void
poll
(
int
timeoutInSeconds
,
int
intervalInSeconds
,
Evaluator
evaluator
)
{
boolean
result
=
evaluator
.
eval
();
long
start
=
Instant
.
now
().
toEpochMilli
();
while
(!
result
)
{
long
end
=
Instant
.
now
().
toEpochMilli
();
if
((
end
-
start
)
>
timeoutInSeconds
*
1000
)
return
;
try
{
Thread
.
sleep
(
intervalInSeconds
*
1000
);
}
catch
(
InterruptedException
e
)
{
}
result
=
evaluator
.
eval
();
}
}
public
static
interface
Evaluator
{
boolean
eval
();
}
}
src/main/java/com/edgec/browserbackend/common/utils/ThreadPoolUtils.java
0 → 100644
View file @
5036f086
package
com
.
edgec
.
browserbackend
.
common
.
utils
;
import
com.edgec.browserbackend.common.commons.utils.PriorityThreadPoolExecutor
;
import
com.edgec.browserbackend.common.commons.utils.UniquePriorityBlockingQueue
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
java.util.concurrent.*
;
public
abstract
class
ThreadPoolUtils
{
private
static
final
Logger
log
=
LoggerFactory
.
getLogger
(
ThreadPoolUtils
.
class
);
private
static
final
int
SCHEDULER_POOL_COUNT
=
50
;
public
static
final
int
MAX_WAITING_TASKS
=
10
;
public
static
final
BlockingQueue
<
Runnable
>
schedulerQueue
=
new
UniquePriorityBlockingQueue
<>(
50
);
private
static
final
int
TASK_POOL_COUNT
=
80
;
public
static
final
ExecutorService
taskExecutorPool
=
Executors
.
newFixedThreadPool
(
TASK_POOL_COUNT
,
new
ThreadFactory
()
{
int
count
=
1
;
@Override
public
Thread
newThread
(
Runnable
runnable
)
{
return
new
Thread
(
runnable
,
"intelligroup-taskexec-"
+
count
++);
}
});
private
static
final
int
TIME_SCHEDULER_POOL_COUNT
=
10
;
public
static
final
ScheduledExecutorService
timeSchedulerPool
=
Executors
.
newScheduledThreadPool
(
TIME_SCHEDULER_POOL_COUNT
,
new
ThreadFactory
()
{
int
count
=
1
;
@Override
public
Thread
newThread
(
Runnable
runnable
)
{
return
new
Thread
(
runnable
,
"intelligroup-time-scheduler-"
+
count
++);
}
});
}
src/main/resources/batchAdd.xlsx
→
src/main/resources/
static/
batchAdd.xlsx
View file @
5036f086
File moved
src/main/resources/static/~$batchAdd.xlsx
0 → 100644
View file @
5036f086
File added
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