|
@@ -9,6 +9,8 @@ import com.lantone.common.dto.GetDeptTreeDTO;
|
|
|
import com.lantone.common.dto.GetHospitalDeptDTO;
|
|
|
import com.lantone.common.dto.GetHospitalTreeDTO;
|
|
|
import com.lantone.common.dto.GetUserDTO;
|
|
|
+import com.lantone.common.enums.IsDeleteEnum;
|
|
|
+import com.lantone.common.enums.StatusEnum;
|
|
|
import com.lantone.common.exception.Asserts;
|
|
|
import com.lantone.common.util.DateUtil;
|
|
|
import com.lantone.common.util.EntityUtil;
|
|
@@ -21,6 +23,7 @@ import com.lantone.common.vo.UpdateUserVO;
|
|
|
import com.lantone.dblayermbg.entity.DeptUser;
|
|
|
import com.lantone.dblayermbg.entity.Hospital;
|
|
|
import com.lantone.dblayermbg.entity.HospitalUser;
|
|
|
+import com.lantone.dblayermbg.entity.Role;
|
|
|
import com.lantone.dblayermbg.entity.User;
|
|
|
import com.lantone.dblayermbg.entity.UserRole;
|
|
|
import com.lantone.dblayermbg.facade.DeptFacade;
|
|
@@ -31,7 +34,6 @@ import com.lantone.dblayermbg.facade.RoleFacade;
|
|
|
import com.lantone.dblayermbg.facade.UserFacade;
|
|
|
import com.lantone.dblayermbg.facade.UserRoleFacade;
|
|
|
import com.lantone.security.enums.HospitalTypeEnum;
|
|
|
-import com.lantone.common.enums.IsDeleteEnum;
|
|
|
import com.lantone.security.service.AuthService;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -90,6 +92,7 @@ public class UserManagementFacade {
|
|
|
if (userList.size() > 1) {
|
|
|
Asserts.fail("当前账号异常!");
|
|
|
}
|
|
|
+
|
|
|
UserDto userDTO = new UserDto();
|
|
|
User user = userList.get(0);
|
|
|
QueryWrapper<UserRole> userRoleQueryWrapper = new QueryWrapper<>();
|
|
@@ -99,8 +102,16 @@ public class UserManagementFacade {
|
|
|
.stream()
|
|
|
.map(i -> i.getRoleId())
|
|
|
.collect(Collectors.toList());
|
|
|
+
|
|
|
+ QueryWrapper<Role> roleQueryWrapper = new QueryWrapper<>();
|
|
|
+ roleQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey());
|
|
|
+ roleQueryWrapper.eq("status", StatusEnum.Enable.getKey());
|
|
|
+ roleQueryWrapper.in("id", roleIdList);
|
|
|
+ List<String> roleIdNames = roleFacade.list(roleQueryWrapper).stream().map(i -> i.getId() + "_" + i.getName()).collect(Collectors.toList());
|
|
|
+
|
|
|
BeanUtils.copyProperties(user, userDTO);
|
|
|
userDTO.setStatus(Integer.parseInt(user.getStatus()));
|
|
|
+ userDTO.setRoles(roleIdNames);
|
|
|
return userDTO;
|
|
|
}
|
|
|
|