BUGFIX: bindEmail;

This commit is contained in:
shahaibo
2025-02-14 11:49:37 +08:00
parent 52e5f246ce
commit 6d3253aed3
2 changed files with 21 additions and 20 deletions

View File

@@ -318,7 +318,7 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
accountExtendQW.lambda().eq(AccountExtend::getAccountId, userHolder.getId());
accountExtendQW.lambda().eq(AccountExtend::getAuthType, "Wechat");
List<AccountExtend> accountExtends = accountExtendMapper.selectList(accountExtendQW);
if (CollectionUtil.isNotEmpty(accountExtends)) {
if (CollectionUtil.isNotEmpty(accountExtends) && !Objects.equals(accountExtends.get(0).getAccountId(), accountOld.getId())) {
AccountExtend accountExtend = accountExtends.get(0);
accountExtend.setAccountId(accountOld.getId());
accountExtendMapper.updateById(accountExtend);
@@ -336,25 +336,23 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
}
}
Account accountNew = accountMapper.selectById(userHolder.getId());
if (StringUtils.isEmpty(accountNew.getUserEmail())) {
TrialOrder trialOrder = CopyUtil.copyObject(accountNew, TrialOrder.class);
trialOrder.setEmail(accountBindEmailDTO.getUserEmail());
trialOrder.setCreateTime(LocalDateTime.now());
trialOrder.setUpdateTime(LocalDateTime.now());
trialOrder.setStatus(1);
// 获取用户申请试用IP
String ipAddress = RequestInfoUtil.getIpAddress(request);
trialOrder.setIp(ipAddress);
trialOrderMapper.insert(trialOrder);
}
accountNew.setUserEmail(accountBindEmailDTO.getUserEmail());
// accountNew.setOccupation(accountBindEmailDTO.getOccupation());
// accountNew.setCountry(accountBindEmailDTO.getCountry());
// accountNew.setTitle(accountBindEmailDTO.getTitle());
// accountNew.setSurname(accountBindEmailDTO.getSurname());
// accountNew.setGivenName(accountBindEmailDTO.getGivenName());
accountMapper.updateById(accountNew);
TrialOrder trialOrder = CopyUtil.copyObject(accountNew, TrialOrder.class);
trialOrder.setEmail(accountNew.getUserEmail());
trialOrder.setCreateTime(LocalDateTime.now());
trialOrder.setUpdateTime(LocalDateTime.now());
trialOrder.setStatus(1);
// 获取用户申请试用IP
String ipAddress = RequestInfoUtil.getIpAddress(request);
trialOrder.setIp(ipAddress);
trialOrderMapper.insert(trialOrder);
return result;
}

View File

@@ -529,11 +529,14 @@ public class PortfolioServiceImpl extends ServiceImpl<PortfolioMapper, Portfolio
vo.setLikeNum(redisUtil.getLikeCount(vo.getId()));
vo.setViewNums(redisUtil.getViewCount(vo.getId()));
Long accountId = vo.getAccountId();
vo.setUserName(accountMapper.selectById(accountId).getUserName());
if (vo.getOriginal() == 0) {
vo.setOriginalUserName(accountMapper.selectById(vo.getOriginalAccountId()).getUserName());
Account account = accountMapper.selectById(accountId);
if (!Objects.isNull(account)) {
vo.setUserName(account.getUserName());
if (vo.getOriginal() == 0) {
vo.setOriginalUserName(accountMapper.selectById(vo.getOriginalAccountId()).getUserName());
}
return vo;
}
return vo;
}
return null;
});