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
c7735370
Commit
c7735370
authored
Mar 30, 2020
by
renjie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
企业认证 bug
parent
46bf893f
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
48 deletions
+22
-48
AccountController.java
.../browserbackend/account/controller/AccountController.java
+3
-5
CompanyAuthorize.java
...edgec/browserbackend/account/domain/CompanyAuthorize.java
+5
-14
CompanyAuthorizeDto.java
...edgec/browserbackend/account/dto/CompanyAuthorizeDto.java
+5
-14
AccountServiceImpl.java
...owserbackend/account/service/impl/AccountServiceImpl.java
+9
-15
No files found.
src/main/java/com/edgec/browserbackend/account/controller/AccountController.java
View file @
c7735370
...
...
@@ -408,8 +408,7 @@ public class AccountController {
@RequestParam
(
value
=
"type"
,
defaultValue
=
"0"
)
int
type
,
@RequestParam
(
value
=
"companyName"
)
String
companyName
,
@RequestParam
(
value
=
"registerNumber"
)
String
registerNumber
,
@RequestParam
(
value
=
"companyLicense_front"
)
MultipartFile
companyLicense_front
,
@RequestParam
(
value
=
"companyLicense_back"
)
MultipartFile
companyLicense_back
,
@RequestParam
(
value
=
"companyLicense"
)
MultipartFile
companyLicense
,
@RequestParam
(
value
=
"coporationPlace"
)
String
coporationPlace
,
@RequestParam
(
value
=
"coporationLicense_front"
)
MultipartFile
coporationLicense_front
,
@RequestParam
(
value
=
"coporationLicense_back"
)
MultipartFile
coporationLicense_back
,
...
...
@@ -424,10 +423,9 @@ public class AccountController {
companyAuthorizeDto
.
setType
(
type
);
companyAuthorizeDto
.
setCompanyName
(
companyName
);
companyAuthorizeDto
.
setRegisterNumber
(
registerNumber
);
if
(
companyLicense
_front
==
null
||
companyLicense_back
==
null
)
if
(
companyLicense
==
null
)
throw
new
ClientRequestException
(
BrowserErrorCode
.
INFORMATIONNOTCOMPELETE
);
companyAuthorizeDto
.
setCompanyLicense_front
(
companyLicense_front
);
companyAuthorizeDto
.
setCompanyLicense_back
(
companyLicense_back
);
companyAuthorizeDto
.
setCompanyLicense
(
companyLicense
);
companyAuthorizeDto
.
setCoporationPlace
(
coporationPlace
);
if
(
coporationLicense_front
==
null
||
coporationLicense_back
==
null
)
throw
new
ClientRequestException
(
BrowserErrorCode
.
INFORMATIONNOTCOMPELETE
);
...
...
src/main/java/com/edgec/browserbackend/account/domain/CompanyAuthorize.java
View file @
c7735370
...
...
@@ -12,8 +12,7 @@ public class CompanyAuthorize {
private
int
type
;
//0 -- 企业, 1 -- 个体工商户
private
String
companyName
;
private
String
registerNumber
;
private
String
companyLicenseFront
;
private
String
companyLicenseBack
;
private
String
companyLicenseId
;
private
String
coporationPlace
;
private
String
coporationLicenseFront
;
...
...
@@ -123,20 +122,12 @@ public class CompanyAuthorize {
this
.
agencyFront
=
agencyFront
;
}
public
String
getCompanyLicense
Back
()
{
return
companyLicense
Back
;
public
String
getCompanyLicense
Id
()
{
return
companyLicense
Id
;
}
public
void
setCompanyLicenseBack
(
String
companyLicenseBack
)
{
this
.
companyLicenseBack
=
companyLicenseBack
;
}
public
String
getCompanyLicenseFront
()
{
return
companyLicenseFront
;
}
public
void
setCompanyLicenseFront
(
String
companyLicenseFront
)
{
this
.
companyLicenseFront
=
companyLicenseFront
;
public
void
setCompanyLicenseId
(
String
companyLicenseId
)
{
this
.
companyLicenseId
=
companyLicenseId
;
}
public
String
getCoporationLicenseBack
()
{
...
...
src/main/java/com/edgec/browserbackend/account/dto/CompanyAuthorizeDto.java
View file @
c7735370
...
...
@@ -11,8 +11,7 @@ public class CompanyAuthorizeDto {
private
int
type
;
//0 -- 企业, 1 -- 个体工商户
private
String
companyName
;
private
String
registerNumber
;
private
MultipartFile
companyLicense_front
;
private
MultipartFile
companyLicense_back
;
private
MultipartFile
companyLicense
;
private
String
coporationPlace
;
private
MultipartFile
coporationLicense_front
;
...
...
@@ -111,20 +110,12 @@ public class CompanyAuthorizeDto {
this
.
agency_front
=
agency_front
;
}
public
MultipartFile
getCompanyLicense
_back
()
{
return
companyLicense
_back
;
public
MultipartFile
getCompanyLicense
()
{
return
companyLicense
;
}
public
void
setCompanyLicense_back
(
MultipartFile
companyLicense_back
)
{
this
.
companyLicense_back
=
companyLicense_back
;
}
public
MultipartFile
getCompanyLicense_front
()
{
return
companyLicense_front
;
}
public
void
setCompanyLicense_front
(
MultipartFile
companyLicense_front
)
{
this
.
companyLicense_front
=
companyLicense_front
;
public
void
setCompanyLicense
(
MultipartFile
companyLicense
)
{
this
.
companyLicense
=
companyLicense
;
}
public
MultipartFile
getCoporationLicense_front
()
{
...
...
src/main/java/com/edgec/browserbackend/account/service/impl/AccountServiceImpl.java
View file @
c7735370
...
...
@@ -1047,8 +1047,7 @@ public class AccountServiceImpl implements AccountService {
@Override
public
void
authorizeCompany
(
String
username
,
CompanyAuthorizeDto
companyAuthorizeDto
)
{
String
companyLicenseFront
=
null
;
String
companyLicenseBack
=
null
;
String
companyLicenseId
=
null
;
String
coporationLicenseFront
=
null
;
String
coporationLicenseBack
=
null
;
String
agencyFront
=
null
;
...
...
@@ -1061,11 +1060,10 @@ public class AccountServiceImpl implements AccountService {
Account
account
=
repository
.
findByName
(
username
);
if
(
account
==
null
)
throw
new
ClientRequestException
(
AccountErrorCode
.
NAMENOTEXIST
);
companyLicenseFront
=
companyAuthorizeRepository
.
saveFile
(
companyAuthorizeDto
.
getCompanyLicense_front
(),
"companyLicense-front-"
+
username
);
companyLicenseBack
=
companyAuthorizeRepository
.
saveFile
(
companyAuthorizeDto
.
getCompanyLicense_back
(),
"companyLicense-back-"
+
username
);
companyLicenseId
=
companyAuthorizeRepository
.
saveFile
(
companyAuthorizeDto
.
getCompanyLicense
(),
"companyLicense-"
+
username
);
co
mpany
LicenseFront
=
companyAuthorizeRepository
.
saveFile
(
companyAuthorizeDto
.
getCoporationLicense_front
(),
"coporationLicense-front-"
+
username
);
co
mpany
LicenseBack
=
companyAuthorizeRepository
.
saveFile
(
companyAuthorizeDto
.
getCoporationLicense_back
(),
"coporationLicense-back-"
+
username
);
co
poration
LicenseFront
=
companyAuthorizeRepository
.
saveFile
(
companyAuthorizeDto
.
getCoporationLicense_front
(),
"coporationLicense-front-"
+
username
);
co
poration
LicenseBack
=
companyAuthorizeRepository
.
saveFile
(
companyAuthorizeDto
.
getCoporationLicense_back
(),
"coporationLicense-back-"
+
username
);
if
(
companyAuthorizeDto
.
getAgency_front
()
!=
null
&&
companyAuthorizeDto
.
getAgency_back
()
!=
null
)
{
agencyFront
=
companyAuthorizeRepository
.
saveFile
(
companyAuthorizeDto
.
getAgency_front
(),
"agency-front-"
+
username
);
...
...
@@ -1074,8 +1072,7 @@ public class AccountServiceImpl implements AccountService {
throw
new
ClientRequestException
(
BrowserErrorCode
.
INFORMATIONNOTCOMPELETE
);
CompanyAuthorize
companyAuthorize
=
new
CompanyAuthorize
(
companyAuthorizeDto
);
companyAuthorize
.
setUsername
(
username
);
companyAuthorize
.
setCompanyLicenseFront
(
companyLicenseFront
);
companyAuthorize
.
setCompanyLicenseBack
(
companyLicenseBack
);
companyAuthorize
.
setCompanyLicenseId
(
companyLicenseId
);
companyAuthorize
.
setCoporationLicenseFront
(
coporationLicenseFront
);
companyAuthorize
.
setCoporationLicenseBack
(
coporationLicenseBack
);
if
(
agencyFront
!=
null
&&
agencyBack
!=
null
)
{
...
...
@@ -1092,10 +1089,8 @@ public class AccountServiceImpl implements AccountService {
companyAuthorizeRepository
.
deleteFile
(
coporationLicenseBack
);
if
(
coporationLicenseFront
!=
null
)
companyAuthorizeRepository
.
deleteFile
(
coporationLicenseFront
);
if
(
companyLicenseBack
!=
null
)
companyAuthorizeRepository
.
deleteFile
(
companyLicenseBack
);
if
(
companyLicenseFront
!=
null
)
companyAuthorizeRepository
.
deleteFile
(
companyLicenseFront
);
if
(
companyLicenseId
!=
null
)
companyAuthorizeRepository
.
deleteFile
(
companyLicenseId
);
throw
new
ClientRequestException
(
BrowserErrorCode
.
UNKNOWN
);
}
...
...
@@ -1115,8 +1110,7 @@ public class AccountServiceImpl implements AccountService {
CompanyAuthorize
companyAuthorize
=
companyAuthorizeRepository
.
findByUsername
(
username
);
if
(
companyAuthorize
==
null
)
return
null
;
File
companyLicense_Front
=
companyAuthorizeRepository
.
getFile
(
companyAuthorize
.
getCompanyLicenseFront
());
File
companyLicense_Back
=
companyAuthorizeRepository
.
getFile
(
companyAuthorize
.
getCompanyLicenseBack
());
File
companyLicense
=
companyAuthorizeRepository
.
getFile
(
companyAuthorize
.
getCompanyLicenseId
());
log
.
error
(
"3"
);
File
coporationLicense_Front
=
companyAuthorizeRepository
.
getFile
(
companyAuthorize
.
getCoporationLicenseFront
());
File
coporationLicense_Back
=
companyAuthorizeRepository
.
getFile
(
companyAuthorize
.
getCoporationLicenseBack
());
...
...
@@ -1128,7 +1122,7 @@ public class AccountServiceImpl implements AccountService {
agencyLicense_Back
=
companyAuthorizeRepository
.
getFile
(
companyAuthorize
.
getAgencyBack
());
try
{
File
tempFile
=
File
.
createTempFile
(
"tempFile"
,
"zip"
);
List
<
File
>
files
=
Arrays
.
asList
(
companyLicense
_Front
,
companyLicense_Back
,
coporationLicense_Front
,
coporationLicense_Back
);
List
<
File
>
files
=
Arrays
.
asList
(
companyLicense
,
coporationLicense_Front
,
coporationLicense_Back
);
if
(
agencyLicense_Front
!=
null
)
files
.
add
(
agencyLicense_Front
);
if
(
agencyLicense_Back
!=
null
)
...
...
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