BUGFIX:试用订单邮件 订单更新时间判断;
This commit is contained in:
@@ -485,11 +485,16 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
|
||||
SendEmailUtil.CHANGE_MAILBOX_TEMPLATE_ID, randomVerifyCode);
|
||||
break;
|
||||
case UPDATE_USERINFO:
|
||||
if (!StringUtil.isNullOrEmpty(emailSendDTO.getCountry()) || !StringUtil.isNullOrEmpty(emailSendDTO.getOccupation())){
|
||||
if (!StringUtil.isNullOrEmpty(emailSendDTO.getCountry()) || !StringUtil.isNullOrEmpty(emailSendDTO.getOccupation())
|
||||
|| StringUtils.isEmpty(emailSendDTO.getSurname()) || StringUtils.isNotEmpty(emailSendDTO.getTitle())
|
||||
|| StringUtils.isNotEmpty(emailSendDTO.getGivenName())){
|
||||
Long accountId = UserContext.getUserHolder().getId();
|
||||
Account account = baseMapper.selectById(accountId);
|
||||
account.setCountry(emailSendDTO.getCountry());
|
||||
account.setOccupation(emailSendDTO.getOccupation());
|
||||
account.setTitle(emailSendDTO.getTitle());
|
||||
account.setSurname(emailSendDTO.getSurname());
|
||||
account.setGivenName(emailSendDTO.getGivenName());
|
||||
baseMapper.updateById(account);
|
||||
|
||||
String userEmail = account.getUserEmail();
|
||||
@@ -500,6 +505,9 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
|
||||
for (TrialOrder trialOrder : trialOrders) {
|
||||
trialOrder.setCountry(emailSendDTO.getCountry());
|
||||
trialOrder.setOccupation(emailSendDTO.getOccupation());
|
||||
trialOrder.setTitle(emailSendDTO.getTitle());
|
||||
trialOrder.setGivenName(emailSendDTO.getGivenName());
|
||||
trialOrder.setSurname(emailSendDTO.getSurname());
|
||||
trialOrderMapper.updateById(trialOrder);
|
||||
}
|
||||
}
|
||||
@@ -2805,18 +2813,25 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
|
||||
accountMapper.updateById(account);
|
||||
}
|
||||
|
||||
public void updateUserInfo(String country, String occupation){
|
||||
public Boolean updateUserInfo(UpdateUserInfoDTO updateUserInfoDTO){
|
||||
Long accountId = UserContext.getUserHolder().getId();
|
||||
Account account = accountMapper.selectById(accountId);
|
||||
boolean flag = false;
|
||||
if (!StringUtil.isNullOrEmpty(country) && !country.equals(account.getCountry())) {
|
||||
account.setCountry(country.trim());
|
||||
flag = true;
|
||||
if (StringUtils.isNotEmpty(updateUserInfoDTO.getOccupation()) && !account.getOccupation().equals(updateUserInfoDTO.getOccupation())) {
|
||||
account.setOccupation(updateUserInfoDTO.getOccupation());
|
||||
}
|
||||
if (!StringUtil.isNullOrEmpty(occupation) && !occupation.equals(account.getOccupation())) {
|
||||
account.setOccupation(occupation.trim());
|
||||
flag = true;
|
||||
if (StringUtils.isNotEmpty(updateUserInfoDTO.getCountry()) && !account.getCountry().equals(updateUserInfoDTO.getCountry())) {
|
||||
account.setCountry(updateUserInfoDTO.getCountry());
|
||||
}
|
||||
if(flag) accountMapper.updateById(account);
|
||||
if (StringUtils.isNotEmpty(updateUserInfoDTO.getTitle()) && !account.getTitle().equals(updateUserInfoDTO.getTitle())) {
|
||||
account.setTitle(updateUserInfoDTO.getTitle());
|
||||
}
|
||||
if (StringUtils.isNotEmpty(updateUserInfoDTO.getSurname()) && !account.getSurname().equals(updateUserInfoDTO.getSurname())) {
|
||||
account.setSurname(updateUserInfoDTO.getSurname());
|
||||
}
|
||||
if (StringUtils.isNotEmpty(updateUserInfoDTO.getGivenName()) && !account.getGivenName().equals(updateUserInfoDTO.getGivenName())) {
|
||||
account.setGivenName(updateUserInfoDTO.getGivenName());
|
||||
}
|
||||
accountMapper.updateById(account);
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user