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

20191024 添加非空判断

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