Commit c7735370 authored by renjie's avatar renjie

企业认证 bug

parent 46bf893f
......@@ -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);
......
......@@ -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 getCompanyLicenseBack() {
return companyLicenseBack;
public String getCompanyLicenseId() {
return companyLicenseId;
}
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() {
......
......@@ -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() {
......
......@@ -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);
companyLicenseFront = companyAuthorizeRepository.saveFile(companyAuthorizeDto.getCoporationLicense_front(), "coporationLicense-front-" + username);
companyLicenseBack = companyAuthorizeRepository.saveFile(companyAuthorizeDto.getCoporationLicense_back(), "coporationLicense-back-" + username);
coporationLicenseFront = companyAuthorizeRepository.saveFile(companyAuthorizeDto.getCoporationLicense_front(), "coporationLicense-front-" + username);
coporationLicenseBack = 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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment