|
|
@@ -247,7 +247,7 @@ public class AccountServiceImpl implements AccountService {
|
|
|
// 根据手机号、邮箱、用户名片段判断是否已注册
|
|
|
boolean checked = findByUsernameOrMobileOrEmail(accountAddDTO.getUsername(), accountAddDTO.getMobile(), accountAddDTO.getEmail());
|
|
|
//不存在 ——> 保存 , 存在 ——> 更新
|
|
|
- addOrUpdate(checked, accountAddDTO);
|
|
|
+ addOrUpdate(checked, accountAddDTO, BaseContextHolder.getCompanyId());
|
|
|
|
|
|
account = findByMobile(accountAddDTO.getMobile());
|
|
|
//绑定企业
|
|
|
@@ -263,7 +263,7 @@ public class AccountServiceImpl implements AccountService {
|
|
|
* @param checked
|
|
|
* @param accountAddDTO
|
|
|
*/
|
|
|
- private void addOrUpdate(boolean checked, AccountAddDTO accountAddDTO){
|
|
|
+ private void addOrUpdate(boolean checked, AccountAddDTO accountAddDTO, Long companyId){
|
|
|
Account account = new Account();
|
|
|
if (!checked) {
|
|
|
account = BeanMapper.map(accountAddDTO, Account.class);
|
|
|
@@ -271,7 +271,7 @@ public class AccountServiceImpl implements AccountService {
|
|
|
save(account);
|
|
|
if (!accountAddDTO.isHasRegister()) {
|
|
|
//用户未注册优软云
|
|
|
- registerAccount(accountAddDTO.getMobile(), accountAddDTO.getRealname());
|
|
|
+ registerAccount(accountAddDTO.getMobile(), accountAddDTO.getRealname(), companyId);
|
|
|
}
|
|
|
}else{
|
|
|
Account accountTemp = findByMobile(accountAddDTO.getMobile());
|
|
|
@@ -290,10 +290,10 @@ public class AccountServiceImpl implements AccountService {
|
|
|
* @param mobile
|
|
|
* @param realname
|
|
|
*/
|
|
|
- private void registerAccount(String mobile, String realname){
|
|
|
+ private void registerAccount(String mobile, String realname, Long companyId){
|
|
|
//1.添加至优软云
|
|
|
String password = StringUtils.createInitPassword(mobile.substring(mobile.length() - 3, mobile.length()));
|
|
|
- Company company = companyService.findByPrimaryKey(BaseContextHolder.getCompanyId());
|
|
|
+ Company company = companyService.findByPrimaryKey(companyId);
|
|
|
String companyName = company.getName();
|
|
|
|
|
|
//可能存在开通企业时UU号同步到优软云出错的情况,再重新同步一次
|
|
|
@@ -364,7 +364,7 @@ public class AccountServiceImpl implements AccountService {
|
|
|
}
|
|
|
|
|
|
//不存在 ——> 保存 , 存在 ——> 更新
|
|
|
- addOrUpdate(checked, accountAddDTO);
|
|
|
+ addOrUpdate(checked, accountAddDTO, companyId);
|
|
|
|
|
|
Account account = findByMobile(accountAddDTO.getMobile());
|
|
|
//绑定企业
|