|
@@ -210,6 +210,9 @@ public class UserManagementFacade {
|
|
|
//修改时判断
|
|
|
} else {
|
|
|
User userTemp = userFacade.getById(user.getId());
|
|
|
+ if (userTemp == null) {
|
|
|
+ Asserts.fail("用户不存,请刷新重试~");
|
|
|
+ }
|
|
|
//用户名没有变动
|
|
|
if (!user.getUsername().equals(userTemp.getUsername())) {
|
|
|
if (userFacade.list(new QueryWrapper<User>()
|
|
@@ -476,6 +479,9 @@ public class UserManagementFacade {
|
|
|
*/
|
|
|
public List<GetHospitalTreeDTO> getLoginUserHospitalTree() {
|
|
|
Hospital hospital = hospitalFacade.getById(SysUserUtils.getCurrentHospitalId());
|
|
|
+ if (hospital == null) {
|
|
|
+ Asserts.fail("登录用户组织不存在,请联系管理员~");
|
|
|
+ }
|
|
|
//获取当前医院的树状结构
|
|
|
List<GetHospitalTreeDTO> hospitalTrees = hospitalFacade.getBaseMapper()
|
|
|
.getHospitalTreeInfo(SysUserUtils.getCurrentHospitalId(), StatusEnum.Enable.getKey());
|
|
@@ -590,6 +596,9 @@ public class UserManagementFacade {
|
|
|
BeanUtils.copyProperties(user, getUserDTO);
|
|
|
//2.获取当前用户的组织类型
|
|
|
Hospital hospital = hospitalFacade.getById(SysUserUtils.getCurrentHospitalId());
|
|
|
+ if (hospital == null) {
|
|
|
+ Asserts.fail("该用户所属组织不存在请刷新重试~");
|
|
|
+ }
|
|
|
//3.获取查询用户的科室id列表、医院id列表
|
|
|
List<Long> hospitals = hospitalUserFacade.list(new QueryWrapper<HospitalUser>()
|
|
|
.eq("user_id", userId)
|
|
@@ -746,7 +755,11 @@ public class UserManagementFacade {
|
|
|
out.put("jump", jumpFlag);
|
|
|
out.put("software", userSoftwareHospitals);
|
|
|
UserInfoDTO userInfo = new UserInfoDTO();
|
|
|
- BeanUtils.copyProperties(userFacade.getById(SysUserUtils.getCurrentPrincipleId()), userInfo);
|
|
|
+ User user = userFacade.getById(SysUserUtils.getCurrentPrincipleId());
|
|
|
+ if (user == null) {
|
|
|
+ Asserts.fail("用户不存在,请联系管理员~");
|
|
|
+ }
|
|
|
+ BeanUtils.copyProperties(user, userInfo);
|
|
|
out.put("userInfo", userInfo);
|
|
|
return out;
|
|
|
}
|