提交 169cc246 编写于 作者: rushui.chen's avatar rushui.chen

20191024 添加非空判断

上级 753091e7
流水线 #16227 已失败 于阶段
in 1 second
...@@ -32,6 +32,7 @@ public class ModifyMobileServiceImpl implements ModifyMobileService { ...@@ -32,6 +32,7 @@ public class ModifyMobileServiceImpl implements ModifyMobileService {
@Transactional @Transactional
public void modify(Integer acctId, String mobile) { public void modify(Integer acctId, String mobile) {
AccountInfoEntity entity = accountInfoDetailMapper.selectByPrimaryKey(acctId); AccountInfoEntity entity = accountInfoDetailMapper.selectByPrimaryKey(acctId);
if (entity != null) {
String mobilePhone = entity.getMobilePhone(); String mobilePhone = entity.getMobilePhone();
if (StringUtils.isNotEmpty(mobilePhone) && AESUtil.decryptV0(mobilePhone).equals(mobile)) { if (StringUtils.isNotEmpty(mobilePhone) && AESUtil.decryptV0(mobilePhone).equals(mobile)) {
throw new AccountException(AccountExceptionEnum.PICA_MOBILE_SAME); throw new AccountException(AccountExceptionEnum.PICA_MOBILE_SAME);
...@@ -52,5 +53,9 @@ public class ModifyMobileServiceImpl implements ModifyMobileService { ...@@ -52,5 +53,9 @@ public class ModifyMobileServiceImpl implements ModifyMobileService {
doctor.setMobilePhone(AESUtil.encryptV0(mobile)); doctor.setMobilePhone(AESUtil.encryptV0(mobile));
doctorMapper.updateByAcctId(doctor); doctorMapper.updateByAcctId(doctor);
} }
} else {
throw new AccountException(AccountExceptionEnum.PICA_NOT_EXIST);
}
} }
} }
...@@ -39,6 +39,7 @@ public class PasswordServiceImpl implements PasswordService { ...@@ -39,6 +39,7 @@ public class PasswordServiceImpl implements PasswordService {
@Transactional @Transactional
public void modifyPassword(Integer acctId, String oldPwd, String pwd) { public void modifyPassword(Integer acctId, String oldPwd, String pwd) {
AccountInfoEntity entity = accountInfoDetailMapper.selectByPrimaryKey(acctId); AccountInfoEntity entity = accountInfoDetailMapper.selectByPrimaryKey(acctId);
if (entity != null) {
if (entity.getPassword().equals(oldPwd)) { if (entity.getPassword().equals(oldPwd)) {
Date currentTime = new Date(); Date currentTime = new Date();
AccountInfoEntity accountInfoEntity = new AccountInfoEntity(); AccountInfoEntity accountInfoEntity = new AccountInfoEntity();
...@@ -57,6 +58,9 @@ public class PasswordServiceImpl implements PasswordService { ...@@ -57,6 +58,9 @@ public class PasswordServiceImpl implements PasswordService {
} else { } else {
throw new AccountException(AccountExceptionEnum.PICA_PASSWORD_ERROR); throw new AccountException(AccountExceptionEnum.PICA_PASSWORD_ERROR);
} }
} else {
throw new AccountException(AccountExceptionEnum.PICA_NOT_EXIST);
}
} }
@Override @Override
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册