医护人员信息修改

This commit is contained in:
zhangheng 2023-12-18 11:26:32 +08:00
parent 7d34eb30ba
commit 64e302d8b9

View File

@ -196,6 +196,10 @@ public class HospitalPersonInfoServiceImpl implements IHospitalPersonInfoService
if (count > 0) {
throw new ServiceException("已存在用户名为" + hospitalPersonInfo.getPersonAccount() + "的用户,请重新输入用户名");
}
int nurseStationUserCount = nurseStationPersonMapper.getNurseStationUserCount(StringUtils.isBlank(hospitalPersonInfo.getPersonPhone()) ? "" : hospitalPersonInfo.getPersonPhone());
if (nurseStationUserCount > 0) {
throw new ServiceException("您输入的联系电话" + hospitalPersonInfo.getPersonPhone() + "重复!");
}
SysUser newUser = new SysUser();
newUser.setUserName(hospitalPersonInfo.getPersonAccount());
newUser.setPassword(SecurityUtils.encryptPassword(hospitalPersonInfo.getPersonPassword()));
@ -209,6 +213,10 @@ public class HospitalPersonInfoServiceImpl implements IHospitalPersonInfoService
} else {
// 修改用户信息
SysUser updUser = userList.get(0);
int nurseStationUserCount = nurseStationPersonMapper.getNurseStationUserCount(updUser.getPhonenumber());
if (nurseStationUserCount > 0) {
throw new ServiceException("您输入的联系电话" + hospitalPersonInfo.getPersonPhone() + "重复!");
}
sysUser.setHospitalPersonId(hospitalPersonInfo.getId());
updUser.setPassword(SecurityUtils.encryptPassword(hospitalPersonInfo.getPersonPassword()));
updUser.setNickName(hospitalPersonInfo.getPersonName());