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
e2274c43
Commit
e2274c43
authored
Mar 26, 2020
by
renjie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
企业认证
子用户密码显示
parent
aa06e733
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
420 additions
and
9 deletions
+420
-9
AccountController.java
.../browserbackend/account/controller/AccountController.java
+46
-4
Account.java
...java/com/edgec/browserbackend/account/domain/Account.java
+11
-0
CompanyAuthorize.java
...edgec/browserbackend/account/domain/CompanyAuthorize.java
+115
-3
CompanyAuthorizeDto.java
...edgec/browserbackend/account/dto/CompanyAuthorizeDto.java
+116
-0
SubUsersDto.java
...ava/com/edgec/browserbackend/account/dto/SubUsersDto.java
+1
-0
CompanyAuthorizeRepository.java
...ackend/account/repository/CompanyAuthorizeRepository.java
+9
-0
CompanyAuthorizeRepositoryCustom.java
.../account/repository/CompanyAuthorizeRepositoryCustom.java
+9
-0
CompanyAuthorizeRepositoryCustomImpl.java
...ount/repository/CompanyAuthorizeRepositoryCustomImpl.java
+57
-0
AccountService.java
.../edgec/browserbackend/account/service/AccountService.java
+2
-0
AccountServiceImpl.java
...owserbackend/account/service/impl/AccountServiceImpl.java
+51
-2
IpResourceServiceImpl.java
...erbackend/browser/service/Impl/IpResourceServiceImpl.java
+3
-0
No files found.
src/main/java/com/edgec/browserbackend/account/controller/AccountController.java
View file @
e2274c43
package
com
.
edgec
.
browserbackend
.
account
.
controller
;
import
com.edgec.browserbackend.account.domain.*
;
import
com.edgec.browserbackend.account.dto.MobileDto
;
import
com.edgec.browserbackend.account.dto.ResultDto
;
import
com.edgec.browserbackend.account.dto.BillQueryCriteriaDto
;
import
com.edgec.browserbackend.account.dto.UserPrePaidBillingRequestDto
;
import
com.edgec.browserbackend.account.dto.*
;
import
com.edgec.browserbackend.browser.ErrorCode.BrowserErrorCode
;
import
com.edgec.browserbackend.common.auth.Securitys
;
import
com.edgec.browserbackend.common.commons.error.ClientRequestException
;
import
com.edgec.browserbackend.common.commons.utils.DateConverter
;
...
...
@@ -21,6 +19,7 @@ import org.springframework.data.domain.PageRequest;
import
org.springframework.data.domain.Pageable
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.multipart.MultipartFile
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
...
...
@@ -397,4 +396,47 @@ public class AccountController {
return
accountService
.
deletePreOrder
(
username
);
}
@RequestMapping
(
path
=
"/authorize"
,
method
=
RequestMethod
.
POST
)
public
ResultDto
companyAuthorize
(
Principal
principal
,
@RequestParam
(
value
=
"type"
,
defaultValue
=
"0"
)
int
type
,
@RequestParam
(
value
=
"companyName"
)
String
companyName
,
@RequestParam
(
value
=
"registerNumber"
)
String
registerNumber
,
@RequestParam
(
value
=
"companyLicense"
)
MultipartFile
companyLicense
,
@RequestParam
(
value
=
"coporationPlace"
)
String
coporationPlace
,
@RequestParam
(
value
=
"coporationLicense"
)
MultipartFile
coporationLicense
,
@RequestParam
(
value
=
"realController"
,
defaultValue
=
"0"
)
int
realController
,
@RequestParam
(
value
=
"writePerson"
,
defaultValue
=
"0"
)
int
writePerson
,
@RequestParam
(
value
=
"agency"
,
required
=
false
)
MultipartFile
agency
)
{
ResultDto
resultDto
=
new
ResultDto
();
try
{
CompanyAuthorizeDto
companyAuthorizeDto
=
new
CompanyAuthorizeDto
();
companyAuthorizeDto
.
setUsername
(
principal
.
getName
());
companyAuthorizeDto
.
setType
(
type
);
companyAuthorizeDto
.
setCompanyName
(
companyName
);
companyAuthorizeDto
.
setRegisterNumber
(
registerNumber
);
if
(
companyLicense
==
null
)
throw
new
ClientRequestException
(
BrowserErrorCode
.
INFORMATIONNOTCOMPELETE
);
companyAuthorizeDto
.
setCompanyLicense
(
companyLicense
);
companyAuthorizeDto
.
setCoporationPlace
(
coporationPlace
);
if
(
coporationLicense
==
null
)
throw
new
ClientRequestException
(
BrowserErrorCode
.
INFORMATIONNOTCOMPELETE
);
companyAuthorizeDto
.
setCoporationLicense
(
coporationLicense
);
companyAuthorizeDto
.
setRealController
(
realController
);
companyAuthorizeDto
.
setWritePerson
(
writePerson
);
if
(
agency
!=
null
)
companyAuthorizeDto
.
setAgency
(
agency
);
if
(
writePerson
==
1
&&
agency
==
null
)
throw
new
ClientRequestException
(
BrowserErrorCode
.
INFORMATIONNOTCOMPELETE
);
accountService
.
authorizeCompany
(
principal
.
getName
(),
companyAuthorizeDto
);
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/account/domain/Account.java
View file @
e2274c43
...
...
@@ -19,6 +19,9 @@ public class Account {
private
String
parent
;
//子用户使用
private
String
password
;
private
Date
lastSeen
;
private
Date
signupDate
=
new
Date
();
...
...
@@ -264,4 +267,12 @@ public class Account {
public
void
setAuthorized
(
int
authorized
)
{
this
.
authorized
=
authorized
;
}
public
String
getPassword
()
{
return
password
;
}
public
void
setPassword
(
String
password
)
{
this
.
password
=
password
;
}
}
src/main/java/com/edgec/browserbackend/account/domain/CompanyAuthorize.java
View file @
e2274c43
package
com
.
edgec
.
browserbackend
.
account
.
domain
;
import
com.edgec.browserbackend.account.dto.CompanyAuthorizeDto
;
import
org.springframework.data.annotation.Id
;
import
org.springframework.data.mongodb.core.mapping.Document
;
...
...
@@ -7,9 +8,120 @@ import org.springframework.data.mongodb.core.mapping.Document;
public
class
CompanyAuthorize
{
@Id
private
String
id
;
private
String
username
;
private
int
type
;
//0 -- 企业, 1 -- 个体工商户
private
String
n
ame
;
private
String
signUp
Number
;
private
String
licensePhoto
Id
;
private
String
companyN
ame
;
private
String
register
Number
;
private
String
companyLicense
Id
;
private
String
coporationPlace
;
private
String
coporationLicenseId
;
private
int
realController
;
//0 -- 法定代表人, 1 -- 非法定代表人
private
int
writePerson
;
//0 -- 法定代表人, 1 -- 代理人
private
String
agencyId
;
public
CompanyAuthorize
()
{
}
public
CompanyAuthorize
(
CompanyAuthorizeDto
companyAuthorizeDto
)
{
if
(
companyAuthorizeDto
.
getUsername
()
!=
null
)
this
.
username
=
companyAuthorizeDto
.
getUsername
();
this
.
type
=
companyAuthorizeDto
.
getType
();
if
(
companyAuthorizeDto
.
getCompanyName
()
!=
null
)
this
.
companyName
=
companyAuthorizeDto
.
getCompanyName
();
if
(
companyAuthorizeDto
.
getRegisterNumber
()
!=
null
)
this
.
registerNumber
=
companyAuthorizeDto
.
getRegisterNumber
();
this
.
realController
=
companyAuthorizeDto
.
getRealController
();
this
.
writePerson
=
companyAuthorizeDto
.
getWritePerson
();
}
public
String
getId
()
{
return
id
;
}
public
void
setId
(
String
id
)
{
this
.
id
=
id
;
}
public
String
getUsername
()
{
return
username
;
}
public
void
setUsername
(
String
username
)
{
this
.
username
=
username
;
}
public
int
getType
()
{
return
type
;
}
public
void
setType
(
int
type
)
{
this
.
type
=
type
;
}
public
String
getCompanyName
()
{
return
companyName
;
}
public
void
setCompanyName
(
String
companyName
)
{
this
.
companyName
=
companyName
;
}
public
int
getRealController
()
{
return
realController
;
}
public
void
setAgencyId
(
String
agencyId
)
{
this
.
agencyId
=
agencyId
;
}
public
int
getWritePerson
()
{
return
writePerson
;
}
public
void
setCoporationLicenseId
(
String
coporationLicenseId
)
{
this
.
coporationLicenseId
=
coporationLicenseId
;
}
public
String
getAgencyId
()
{
return
agencyId
;
}
public
void
setCoporationPlace
(
String
coporationPlace
)
{
this
.
coporationPlace
=
coporationPlace
;
}
public
String
getCoporationLicenseId
()
{
return
coporationLicenseId
;
}
public
String
getCompanyLicenseId
()
{
return
companyLicenseId
;
}
public
String
getCoporationPlace
()
{
return
coporationPlace
;
}
public
void
setRealController
(
int
realController
)
{
this
.
realController
=
realController
;
}
public
void
setCompanyLicenseId
(
String
companyLicenseId
)
{
this
.
companyLicenseId
=
companyLicenseId
;
}
public
String
getRegisterNumber
()
{
return
registerNumber
;
}
public
void
setRegisterNumber
(
String
registerNumber
)
{
this
.
registerNumber
=
registerNumber
;
}
public
void
setWritePerson
(
int
writePerson
)
{
this
.
writePerson
=
writePerson
;
}
}
src/main/java/com/edgec/browserbackend/account/dto/CompanyAuthorizeDto.java
0 → 100644
View file @
e2274c43
package
com
.
edgec
.
browserbackend
.
account
.
dto
;
import
com.edgec.browserbackend.account.domain.CompanyAuthorize
;
import
org.springframework.data.annotation.Id
;
import
org.springframework.web.multipart.MultipartFile
;
public
class
CompanyAuthorizeDto
{
private
String
username
;
private
int
type
;
//0 -- 企业, 1 -- 个体工商户
private
String
companyName
;
private
String
registerNumber
;
private
MultipartFile
companyLicense
;
private
String
coporationPlace
;
private
MultipartFile
coporationLicense
;
private
int
realController
;
//0 -- 法定代表人, 1 -- 非法定代表人
private
int
writePerson
;
//0 -- 法定代表人, 1 -- 代理人
private
MultipartFile
agency
;
public
CompanyAuthorizeDto
()
{
}
public
CompanyAuthorizeDto
(
CompanyAuthorize
companyAuthorize
)
{
if
(
companyAuthorize
.
getUsername
()
!=
null
)
this
.
username
=
companyAuthorize
.
getUsername
();
this
.
type
=
companyAuthorize
.
getType
();
if
(
companyAuthorize
.
getCompanyName
()
!=
null
)
this
.
companyName
=
companyAuthorize
.
getCompanyName
();
if
(
companyAuthorize
.
getRegisterNumber
()
!=
null
)
this
.
registerNumber
=
companyAuthorize
.
getRegisterNumber
();
this
.
realController
=
companyAuthorize
.
getRealController
();
this
.
writePerson
=
companyAuthorize
.
getWritePerson
();
}
public
String
getCompanyName
()
{
return
companyName
;
}
public
void
setCompanyName
(
String
companyName
)
{
this
.
companyName
=
companyName
;
}
public
String
getUsername
()
{
return
username
;
}
public
void
setUsername
(
String
username
)
{
this
.
username
=
username
;
}
public
String
getRegisterNumber
()
{
return
registerNumber
;
}
public
void
setWritePerson
(
int
writePerson
)
{
this
.
writePerson
=
writePerson
;
}
public
void
setRegisterNumber
(
String
registerNumber
)
{
this
.
registerNumber
=
registerNumber
;
}
public
String
getCoporationPlace
()
{
return
coporationPlace
;
}
public
void
setRealController
(
int
realController
)
{
this
.
realController
=
realController
;
}
public
void
setCoporationPlace
(
String
coporationPlace
)
{
this
.
coporationPlace
=
coporationPlace
;
}
public
int
getWritePerson
()
{
return
writePerson
;
}
public
int
getRealController
()
{
return
realController
;
}
public
int
getType
()
{
return
type
;
}
public
void
setType
(
int
type
)
{
this
.
type
=
type
;
}
public
MultipartFile
getAgency
()
{
return
agency
;
}
public
void
setAgency
(
MultipartFile
agency
)
{
this
.
agency
=
agency
;
}
public
MultipartFile
getCoporationLicense
()
{
return
coporationLicense
;
}
public
void
setCoporationLicense
(
MultipartFile
coporationLicense
)
{
this
.
coporationLicense
=
coporationLicense
;
}
public
MultipartFile
getCompanyLicense
()
{
return
companyLicense
;
}
public
void
setCompanyLicense
(
MultipartFile
companyLicense
)
{
this
.
companyLicense
=
companyLicense
;
}
}
src/main/java/com/edgec/browserbackend/account/dto/SubUsersDto.java
View file @
e2274c43
...
...
@@ -19,6 +19,7 @@ public class SubUsersDto {
this
.
nickname
=
account
.
getNickname
();
this
.
username
=
account
.
getName
();
this
.
comment
=
account
.
getComment
();
if
(
password
!=
null
)
this
.
passoword
=
password
;
}
...
...
src/main/java/com/edgec/browserbackend/account/repository/CompanyAuthorizeRepository.java
0 → 100644
View file @
e2274c43
package
com
.
edgec
.
browserbackend
.
account
.
repository
;
import
com.edgec.browserbackend.account.domain.CompanyAuthorize
;
import
com.edgec.browserbackend.account.dto.CompanyAuthorizeDto
;
import
org.springframework.data.mongodb.repository.MongoRepository
;
public
interface
CompanyAuthorizeRepository
extends
MongoRepository
<
CompanyAuthorize
,
String
>,
CompanyAuthorizeRepositoryCustom
{
}
src/main/java/com/edgec/browserbackend/account/repository/CompanyAuthorizeRepositoryCustom.java
0 → 100644
View file @
e2274c43
package
com
.
edgec
.
browserbackend
.
account
.
repository
;
import
org.springframework.web.multipart.MultipartFile
;
import
java.io.File
;
public
interface
CompanyAuthorizeRepositoryCustom
{
String
saveFile
(
String
collectionName
,
MultipartFile
file
,
String
filename
);
}
src/main/java/com/edgec/browserbackend/account/repository/CompanyAuthorizeRepositoryCustomImpl.java
0 → 100644
View file @
e2274c43
package
com
.
edgec
.
browserbackend
.
account
.
repository
;
import
com.edgec.browserbackend.browser.ErrorCode.BrowserErrorCode
;
import
com.edgec.browserbackend.common.commons.error.ClientRequestException
;
import
com.mongodb.DB
;
import
com.mongodb.client.gridfs.GridFSBucket
;
import
com.mongodb.gridfs.GridFS
;
import
com.mongodb.gridfs.GridFSInputFile
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.mongodb.MongoDbFactory
;
import
org.springframework.data.mongodb.core.MongoTemplate
;
import
org.springframework.data.mongodb.gridfs.GridFsOperations
;
import
org.springframework.data.mongodb.gridfs.GridFsTemplate
;
import
org.springframework.web.multipart.MultipartFile
;
import
java.io.File
;
import
java.io.InputStream
;
public
class
CompanyAuthorizeRepositoryCustomImpl
implements
CompanyAuthorizeRepositoryCustom
{
private
final
Logger
logger
=
LoggerFactory
.
getLogger
(
CompanyAuthorizeRepositoryCustomImpl
.
class
);
@Autowired
private
GridFsTemplate
gridFsTemplate
;
@Autowired
private
GridFsOperations
operations
;
@Autowired
private
GridFSBucket
gridFSBucket
;
@Autowired
private
MongoTemplate
mongoTemplate
;
@Override
public
String
saveFile
(
String
collectionName
,
MultipartFile
file
,
String
filename
)
{
try
{
GridFS
gridFS
=
new
GridFS
((
DB
)
mongoTemplate
.
getDb
());
InputStream
in
=
file
.
getInputStream
();
GridFSInputFile
gridFSInputFile
=
gridFS
.
createFile
(
in
);
gridFSInputFile
.
setFilename
(
filename
);
gridFSInputFile
.
setContentType
(
file
.
getContentType
());
gridFSInputFile
.
save
();
return
(
String
)
gridFSInputFile
.
getId
();
}
catch
(
Exception
e
)
{
logger
.
error
(
"存储文件时发生错误!!!"
,
e
);
throw
new
ClientRequestException
(
BrowserErrorCode
.
UNKNOWN
);
}
}
}
src/main/java/com/edgec/browserbackend/account/service/AccountService.java
View file @
e2274c43
...
...
@@ -100,4 +100,6 @@ public interface AccountService {
void
updateUserToken
(
String
username
,
String
token
);
void
authorizeCompany
(
String
username
,
CompanyAuthorizeDto
companyAuthorizeDto
);
}
src/main/java/com/edgec/browserbackend/account/service/impl/AccountServiceImpl.java
View file @
e2274c43
...
...
@@ -22,6 +22,12 @@ import com.edgec.browserbackend.browser.service.IpResourceService;
import
com.edgec.browserbackend.browser.service.ShopService
;
import
com.edgec.browserbackend.common.commons.error.ClientRequestException
;
import
com.edgec.browserbackend.common.commons.utils.CommonStringUtils
;
import
com.mongodb.DB
;
import
com.mongodb.client.gridfs.GridFSBucket
;
import
com.mongodb.client.gridfs.GridFSDownloadStream
;
import
com.mongodb.client.gridfs.model.GridFSFile
;
import
com.mongodb.gridfs.GridFS
;
import
com.mongodb.gridfs.GridFSInputFile
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -30,12 +36,19 @@ import org.springframework.data.domain.Page;
import
org.springframework.data.domain.PageImpl
;
import
org.springframework.data.domain.PageRequest
;
import
org.springframework.data.domain.Pageable
;
import
org.springframework.data.mongodb.gridfs.GridFsOperations
;
import
org.springframework.data.mongodb.gridfs.GridFsResource
;
import
org.springframework.data.mongodb.gridfs.GridFsTemplate
;
import
org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.Assert
;
import
org.thymeleaf.util.StringUtils
;
import
java.io.ByteArrayOutputStream
;
import
java.io.File
;
import
java.io.FileOutputStream
;
import
java.io.InputStream
;
import
java.text.SimpleDateFormat
;
import
java.time.Instant
;
import
java.time.YearMonth
;
...
...
@@ -46,6 +59,9 @@ import java.util.concurrent.CompletableFuture;
import
java.util.regex.Pattern
;
import
java.util.stream.Collectors
;
import
static
org
.
springframework
.
data
.
mongodb
.
core
.
query
.
Query
.
query
;
import
static
org
.
springframework
.
data
.
mongodb
.
gridfs
.
GridFsCriteria
.
whereFilename
;
@Service
@Transactional
@ComponentScan
(
"com.edgec.browserbackend.account.repository"
)
...
...
@@ -97,6 +113,9 @@ public class AccountServiceImpl implements AccountService {
@Autowired
private
WhiteSiteRepository
whiteSiteRepository
;
@Autowired
private
CompanyAuthorizeRepository
companyAuthorizeRepository
;
@Override
public
List
<
UserBillList
>
getUserBills0
(
String
name
)
{
...
...
@@ -555,8 +574,7 @@ public class AccountServiceImpl implements AccountService {
List
<
SubUsersDto
>
subUsersDtoList
=
new
ArrayList
<>();
accounts
.
getContent
().
forEach
(
x
->
{
com
.
edgec
.
browserbackend
.
auth
.
domain
.
User
user
=
userRepository
.
findById
(
x
.
getName
()).
orElse
(
null
);
subUsersDtoList
.
add
(
new
SubUsersDto
(
x
,
user
.
getPassword
()));
subUsersDtoList
.
add
(
new
SubUsersDto
(
x
,
x
.
getPassword
()));
});
subUserPageResultDto
.
setUserList
(
subUsersDtoList
);
...
...
@@ -686,6 +704,10 @@ public class AccountServiceImpl implements AccountService {
if
(
user
.
getWhiteList
()
!=
null
&&
user
.
getWhiteList
().
size
()
>
0
)
whiteList
.
addAll
(
user
.
getWhiteList
());
account
.
setWhiteList
(
whiteList
);
if
(
org
.
apache
.
commons
.
lang3
.
StringUtils
.
isNotBlank
(
subUsersRequestDto
.
getPassword
()))
account
.
setPassword
(
subUsersRequestDto
.
getPassword
());
else
account
.
setPassword
(
makeRandomPassword
(
8
));
repository
.
save
(
account
);
// emailService.sendEmailVerification(user.getUsername(), user.getEmail(), user.getVerificationCode());
...
...
@@ -739,6 +761,10 @@ public class AccountServiceImpl implements AccountService {
if
(
subUsersRequestDto
.
getWhiteList
()
!=
null
&&
subUsersRequestDto
.
getWhiteList
().
size
()
>
0
)
whiteList
.
addAll
(
subUsersRequestDto
.
getWhiteList
());
childAccount
.
setWhiteList
(
whiteList
);
if
(
org
.
apache
.
commons
.
lang3
.
StringUtils
.
isNotBlank
(
subUsersRequestDto
.
getPassword
()))
childAccount
.
setPassword
(
subUsersRequestDto
.
getPassword
());
else
childAccount
.
setPassword
(
makeRandomPassword
(
8
));
repository
.
save
(
childAccount
);
}
...
...
@@ -981,4 +1007,27 @@ public class AccountServiceImpl implements AccountService {
repository
.
save
(
byName
);
}
@Override
public
void
authorizeCompany
(
String
username
,
CompanyAuthorizeDto
companyAuthorizeDto
)
{
Account
account
=
repository
.
findByName
(
username
);
if
(
account
==
null
)
throw
new
ClientRequestException
(
AccountErrorCode
.
NAMENOTEXIST
);
String
companyLicenseName
=
"companyLicense-"
+
username
;
String
companyLicenseId
=
companyAuthorizeRepository
.
saveFile
(
"companylicense"
,
companyAuthorizeDto
.
getCompanyLicense
(),
companyLicenseName
);
String
coporationLicenseName
=
"coporationLicense-"
+
username
;
String
coporationLicenseId
=
companyAuthorizeRepository
.
saveFile
(
"coporationlicense"
,
companyAuthorizeDto
.
getCoporationLicense
(),
companyLicenseName
);
String
agencyId
=
null
;
if
(
companyAuthorizeDto
.
getAgency
()
!=
null
)
{
String
agencyName
=
"agencyLicense-"
+
username
;
agencyId
=
companyAuthorizeRepository
.
saveFile
(
"coporationlicense"
,
companyAuthorizeDto
.
getAgency
(),
agencyName
);
}
CompanyAuthorize
companyAuthorize
=
new
CompanyAuthorize
(
companyAuthorizeDto
);
companyAuthorize
.
setUsername
(
username
);
companyAuthorize
.
setCompanyLicenseId
(
companyLicenseId
);
companyAuthorize
.
setCoporationLicenseId
(
coporationLicenseId
);
if
(
agencyId
!=
null
)
companyAuthorize
.
setAgencyId
(
agencyId
);
companyAuthorizeRepository
.
save
(
companyAuthorize
);
}
}
src/main/java/com/edgec/browserbackend/browser/service/Impl/IpResourceServiceImpl.java
View file @
e2274c43
...
...
@@ -17,6 +17,7 @@ import com.edgec.browserbackend.common.commons.error.ClientRequestException;
import
com.edgec.browserbackend.common.utils.FileUtil
;
import
com.edgec.browserbackend.common.utils.PollerUtils
;
import
com.edgec.browserbackend.common.utils.ThreadPoolUtils
;
import
com.sun.org.apache.bcel.internal.generic.IF_ACMPEQ
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
...
...
@@ -170,6 +171,8 @@ public class IpResourceServiceImpl implements IpResourceService {
throw
new
ClientRequestException
(
AccountErrorCode
.
NOPERMISSION
);
Map
<
String
,
List
<
String
>>
priceList
=
ipOptionsRepository
.
findAll
().
get
(
0
).
getIpPlatForm
();
if
(
ipResourceRequestDto
.
getRegion
()
==
null
)
throw
new
ClientRequestException
(
BrowserErrorCode
.
INFORMATIONNOTCOMPELETE
);
if
(
ipResourceRequestDto
.
getRegionCn
()
==
null
)
throw
new
ClientRequestException
(
BrowserErrorCode
.
INFORMATIONNOTCOMPELETE
);
List
<
String
>
vendorPrices
=
priceList
.
get
(
ipResourceRequestDto
.
getRegionCn
());
...
...
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