Commit 1bce4436 authored by renjie's avatar renjie

子用户bug

parent 31ca06df
...@@ -431,7 +431,6 @@ public class AccountController { ...@@ -431,7 +431,6 @@ public class AccountController {
throw new ClientRequestException(BrowserErrorCode.INFORMATIONNOTCOMPELETE); throw new ClientRequestException(BrowserErrorCode.INFORMATIONNOTCOMPELETE);
companyAuthorizeDto.setCoporationLicense_front(coporationLicense_front); companyAuthorizeDto.setCoporationLicense_front(coporationLicense_front);
companyAuthorizeDto.setCoporationLicense_back(coporationLicense_back); companyAuthorizeDto.setCoporationLicense_back(coporationLicense_back);
companyAuthorizeDto.setRealController(realController);
companyAuthorizeDto.setWritePerson(writePerson); companyAuthorizeDto.setWritePerson(writePerson);
if (writePerson == 1 && (agency_back == null || agency_back == null)) if (writePerson == 1 && (agency_back == null || agency_back == null))
throw new ClientRequestException(BrowserErrorCode.INFORMATIONNOTCOMPELETE); throw new ClientRequestException(BrowserErrorCode.INFORMATIONNOTCOMPELETE);
......
...@@ -17,7 +17,6 @@ public class CompanyAuthorize { ...@@ -17,7 +17,6 @@ public class CompanyAuthorize {
private String coporationPlace; private String coporationPlace;
private String coporationLicenseFront; private String coporationLicenseFront;
private String coporationLicenseBack; private String coporationLicenseBack;
private int realController;//0 -- 法定代表人, 1 -- 非法定代表人
private int writePerson; //0 -- 法定代表人, 1 -- 代理人 private int writePerson; //0 -- 法定代表人, 1 -- 代理人
private String agencyFront; private String agencyFront;
...@@ -35,7 +34,6 @@ public class CompanyAuthorize { ...@@ -35,7 +34,6 @@ public class CompanyAuthorize {
this.companyName = companyAuthorizeDto.getCompanyName(); this.companyName = companyAuthorizeDto.getCompanyName();
if (companyAuthorizeDto.getRegisterNumber() != null) if (companyAuthorizeDto.getRegisterNumber() != null)
this.registerNumber = companyAuthorizeDto.getRegisterNumber(); this.registerNumber = companyAuthorizeDto.getRegisterNumber();
this.realController = companyAuthorizeDto.getRealController();
this.writePerson = companyAuthorizeDto.getWritePerson(); this.writePerson = companyAuthorizeDto.getWritePerson();
} }
...@@ -71,11 +69,6 @@ public class CompanyAuthorize { ...@@ -71,11 +69,6 @@ public class CompanyAuthorize {
this.companyName = companyName; this.companyName = companyName;
} }
public int getRealController() {
return realController;
}
public int getWritePerson() { public int getWritePerson() {
return writePerson; return writePerson;
} }
...@@ -89,9 +82,6 @@ public class CompanyAuthorize { ...@@ -89,9 +82,6 @@ public class CompanyAuthorize {
return coporationPlace; return coporationPlace;
} }
public void setRealController(int realController) {
this.realController = realController;
}
public void setRegisterNumber(String registerNumber) { public void setRegisterNumber(String registerNumber) {
this.registerNumber = registerNumber; this.registerNumber = registerNumber;
......
...@@ -16,7 +16,6 @@ public class CompanyAuthorizeDto { ...@@ -16,7 +16,6 @@ public class CompanyAuthorizeDto {
private String coporationPlace; private String coporationPlace;
private MultipartFile coporationLicense_front; private MultipartFile coporationLicense_front;
private MultipartFile coporationLicense_back; private MultipartFile coporationLicense_back;
private int realController;//0 -- 法定代表人, 1 -- 非法定代表人
private int writePerson; //0 -- 法定代表人, 1 -- 代理人 private int writePerson; //0 -- 法定代表人, 1 -- 代理人
private MultipartFile agency_front; private MultipartFile agency_front;
...@@ -34,7 +33,6 @@ public class CompanyAuthorizeDto { ...@@ -34,7 +33,6 @@ public class CompanyAuthorizeDto {
this.companyName = companyAuthorize.getCompanyName(); this.companyName = companyAuthorize.getCompanyName();
if (companyAuthorize.getRegisterNumber() != null) if (companyAuthorize.getRegisterNumber() != null)
this.registerNumber = companyAuthorize.getRegisterNumber(); this.registerNumber = companyAuthorize.getRegisterNumber();
this.realController = companyAuthorize.getRealController();
this.writePerson = companyAuthorize.getWritePerson(); this.writePerson = companyAuthorize.getWritePerson();
} }
...@@ -70,10 +68,6 @@ public class CompanyAuthorizeDto { ...@@ -70,10 +68,6 @@ public class CompanyAuthorizeDto {
return coporationPlace; return coporationPlace;
} }
public void setRealController(int realController) {
this.realController = realController;
}
public void setCoporationPlace(String coporationPlace) { public void setCoporationPlace(String coporationPlace) {
this.coporationPlace = coporationPlace; this.coporationPlace = coporationPlace;
} }
...@@ -82,10 +76,6 @@ public class CompanyAuthorizeDto { ...@@ -82,10 +76,6 @@ public class CompanyAuthorizeDto {
return writePerson; return writePerson;
} }
public int getRealController() {
return realController;
}
public int getType() { public int getType() {
return type; return type;
} }
......
...@@ -712,10 +712,12 @@ public class AccountServiceImpl implements AccountService { ...@@ -712,10 +712,12 @@ public class AccountServiceImpl implements AccountService {
User authUser = new User(); User authUser = new User();
authUser.setUsername(user.getName()); authUser.setUsername(user.getName());
String password;
if (org.apache.commons.lang3.StringUtils.isNotBlank(subUsersRequestDto.getPassword())) if (org.apache.commons.lang3.StringUtils.isNotBlank(subUsersRequestDto.getPassword()))
authUser.setPassword(subUsersRequestDto.getPassword()); password = subUsersRequestDto.getPassword();
else else
authUser.setPassword(makeRandomPassword(8)); password = makeRandomPassword(8);
authUser.setPassword(password);
authUser.setPhone(existing.getPhoneNumber()); authUser.setPhone(existing.getPhoneNumber());
authUser.setEnabled(true); authUser.setEnabled(true);
if (subUsersRequestDto.getPermission() != -1) if (subUsersRequestDto.getPermission() != -1)
...@@ -738,10 +740,7 @@ public class AccountServiceImpl implements AccountService { ...@@ -738,10 +740,7 @@ public class AccountServiceImpl implements AccountService {
if (user.getWhiteList() != null && user.getWhiteList().size() > 0) if (user.getWhiteList() != null && user.getWhiteList().size() > 0)
whiteList.addAll(user.getWhiteList()); whiteList.addAll(user.getWhiteList());
account.setWhiteList(whiteList); account.setWhiteList(whiteList);
if (org.apache.commons.lang3.StringUtils.isNotBlank(subUsersRequestDto.getPassword())) account.setPassword(password);
account.setPassword(subUsersRequestDto.getPassword());
else
account.setPassword(makeRandomPassword(8));
repository.save(account); repository.save(account);
// emailService.sendEmailVerification(user.getUsername(), user.getEmail(), user.getVerificationCode()); // emailService.sendEmailVerification(user.getUsername(), user.getEmail(), user.getVerificationCode());
......
...@@ -121,6 +121,7 @@ public class BrowserTask { ...@@ -121,6 +121,7 @@ public class BrowserTask {
if (StringUtils.isNotBlank(ipBuyResultDto.getErrorCode())) { if (StringUtils.isNotBlank(ipBuyResultDto.getErrorCode())) {
log.error("fail to buy ip"); log.error("fail to buy ip");
log.error(ipBuyResultDto.getErrorCode()); log.error(ipBuyResultDto.getErrorCode());
result.set(false);
} }
if (ipBuyResultDto != null && ipBuyResultDto.getIplist() != null && ipBuyResultDto.getIplist().size() >= 1) { if (ipBuyResultDto != null && ipBuyResultDto.getIplist() != null && ipBuyResultDto.getIplist().size() >= 1) {
AtomicInteger index = new AtomicInteger(); AtomicInteger index = new AtomicInteger();
...@@ -132,6 +133,7 @@ public class BrowserTask { ...@@ -132,6 +133,7 @@ public class BrowserTask {
ipResourceRepository.save(ipResource); ipResourceRepository.save(ipResource);
} else { } else {
log.error("no ipResource"); log.error("no ipResource");
result.set(false);
} }
index.getAndIncrement(); index.getAndIncrement();
}); });
...@@ -141,6 +143,7 @@ public class BrowserTask { ...@@ -141,6 +143,7 @@ public class BrowserTask {
result.set(true); result.set(true);
} catch (Exception e) { } catch (Exception e) {
log.error(e.getMessage()); log.error(e.getMessage());
result.set(false);
} }
if (result.get() == false && (ipResource.getPurchasedTime() < Instant.now().minusSeconds(7200).toEpochMilli())) { if (result.get() == false && (ipResource.getPurchasedTime() < Instant.now().minusSeconds(7200).toEpochMilli())) {
IpChargeRequestDto ipChargeRequestDto = buildIpChargeRequestDto(ipResource, 3, 0); IpChargeRequestDto ipChargeRequestDto = buildIpChargeRequestDto(ipResource, 3, 0);
......
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