|
@@ -1,13 +1,47 @@
|
|
|
package com.lantone.security.facade;
|
|
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
|
import com.lantone.common.api.CommonResult;
|
|
|
import com.lantone.common.constant.AuthConstant;
|
|
|
+import com.lantone.common.dto.GetDeptTreeDTO;
|
|
|
+import com.lantone.common.dto.GetHospitalDeptDTO;
|
|
|
+import com.lantone.common.dto.GetHospitalTreeDTO;
|
|
|
+import com.lantone.common.dto.GetMenusTreeDTO;
|
|
|
+import com.lantone.common.dto.GetUserDTO;
|
|
|
+import com.lantone.common.dto.HospitalDTO;
|
|
|
+import com.lantone.common.dto.UserMenuResourceTreeDTO;
|
|
|
+import com.lantone.common.dto.UserRoleDTO;
|
|
|
+import com.lantone.common.exception.Asserts;
|
|
|
+import com.lantone.common.util.DateUtil;
|
|
|
+import com.lantone.common.util.EntityUtil;
|
|
|
+import com.lantone.common.util.ListUtil;
|
|
|
+import com.lantone.common.util.StringUtil;
|
|
|
+import com.lantone.common.vo.AddHospitalTreeVO;
|
|
|
+import com.lantone.common.vo.AddUserVO;
|
|
|
import com.lantone.common.vo.LoginVO;
|
|
|
+import com.lantone.common.vo.UpdateUserVO;
|
|
|
+import com.lantone.dblayermbg.entity.Hospital;
|
|
|
+import com.lantone.dblayermbg.entity.HospitalUser;
|
|
|
+import com.lantone.dblayermbg.entity.User;
|
|
|
+import com.lantone.dblayermbg.entity.DeptUser;
|
|
|
+import com.lantone.dblayermbg.entity.UserRole;
|
|
|
+import com.lantone.dblayermbg.facade.DeptFacade;
|
|
|
+import com.lantone.dblayermbg.facade.HospitalFacade;
|
|
|
+import com.lantone.dblayermbg.facade.HospitalUserFacade;
|
|
|
+import com.lantone.dblayermbg.facade.DeptUserFacade;
|
|
|
+import com.lantone.dblayermbg.facade.UserFacade;
|
|
|
+import com.lantone.dblayermbg.facade.UserRoleFacade;
|
|
|
+import com.lantone.security.enums.HospitalTypeEnum;
|
|
|
+import com.lantone.security.enums.IsDeleteEnum;
|
|
|
import com.lantone.security.service.AuthService;
|
|
|
+import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.HashMap;
|
|
|
+import java.util.List;
|
|
|
import java.util.Map;
|
|
|
|
|
|
/**
|
|
@@ -20,6 +54,18 @@ public class UserAdminFacade {
|
|
|
|
|
|
@Autowired
|
|
|
private AuthService authService;
|
|
|
+ @Autowired
|
|
|
+ private HospitalFacade hospitalFacade;
|
|
|
+ @Autowired
|
|
|
+ private HospitalUserFacade hospitalUserFacade;
|
|
|
+ @Autowired
|
|
|
+ private DeptFacade deptFacade;
|
|
|
+ @Autowired
|
|
|
+ private UserFacade userFacade;
|
|
|
+ @Autowired
|
|
|
+ private DeptUserFacade userDeptFacade;
|
|
|
+ @Autowired
|
|
|
+ private UserRoleFacade userRoleFacade;
|
|
|
|
|
|
public CommonResult login(LoginVO loginVO) {
|
|
|
Map<String, String> params = new HashMap<>();
|
|
@@ -32,4 +78,371 @@ public class UserAdminFacade {
|
|
|
return restResult;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * @param addUserVO
|
|
|
+ * @Description添加用户
|
|
|
+ * @Return boolean
|
|
|
+ */
|
|
|
+ public boolean addUser(AddUserVO addUserVO) {
|
|
|
+ //1.新增用户基本信息
|
|
|
+ User user = new User();
|
|
|
+ BeanUtils.copyProperties(addUserVO, user);
|
|
|
+ user.setGmtCreate(DateUtil.now());
|
|
|
+ if (userFacade.save(user)) {
|
|
|
+ Long userId = userFacade.list(new QueryWrapper<User>().eq("username", user.getUsername())).get(0).getId();
|
|
|
+ //2.插入用户所属组织
|
|
|
+ return saveUserHospital(addUserVO.getAddHospitalTreeVO(), userId, addUserVO.getRoles());
|
|
|
+ } else {
|
|
|
+ Asserts.fail("用户添加失败");
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @param addHospitalTreeVO
|
|
|
+ * @param userId
|
|
|
+ * @Description保存用户关联的医院、科室
|
|
|
+ * @Return boolean
|
|
|
+ */
|
|
|
+ private boolean saveUserHospital(AddHospitalTreeVO addHospitalTreeVO, Long userId, List<Long> roles) {
|
|
|
+
|
|
|
+ //1.获取组织类型
|
|
|
+ //1.1单家医院
|
|
|
+ if (HospitalTypeEnum.SINGLE_HOSPITAL.getKey() == Integer.parseInt(addHospitalTreeVO.getType())) {
|
|
|
+ //插入用户和医院的关系
|
|
|
+ if (ListUtil.isNotEmpty(addHospitalTreeVO.getHospitals())) {
|
|
|
+ addHospitalTreeVO.getHospitals().stream().forEach(hospitalId -> {
|
|
|
+ HospitalUser hospitalUser = new HospitalUser();
|
|
|
+ hospitalUser.setUserId(userId);
|
|
|
+ hospitalUser.setHospitalId(hospitalId);
|
|
|
+ hospitalUserFacade.save(hospitalUser);
|
|
|
+ });
|
|
|
+ //插入用户和科室的关系
|
|
|
+ if (ListUtil.isNotEmpty(addHospitalTreeVO.getDepts())) {
|
|
|
+ addHospitalTreeVO.getDepts().stream().forEach(deptID -> {
|
|
|
+ DeptUser userDept = new DeptUser();
|
|
|
+ userDept.setDeptId(deptID);
|
|
|
+ userDept.setUserId(userId);
|
|
|
+ userDeptFacade.save(userDept);
|
|
|
+ });
|
|
|
+ //插入用户和角色的关系
|
|
|
+ return saveUserRole(userId, roles);
|
|
|
+ } else {
|
|
|
+ Asserts.fail("添加用户的科室为空");
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ Asserts.fail("用户所属组织为空");
|
|
|
+ }
|
|
|
+ //非单家医院用户
|
|
|
+ } else {
|
|
|
+ //插入用户和医院的关系
|
|
|
+ if (ListUtil.isNotEmpty(addHospitalTreeVO.getHospitals())) {
|
|
|
+ addHospitalTreeVO.getHospitals().stream().forEach(hospitalId -> {
|
|
|
+ HospitalUser hospitalUser = new HospitalUser();
|
|
|
+ hospitalUser.setUserId(userId);
|
|
|
+ hospitalUser.setHospitalId(hospitalId);
|
|
|
+ hospitalUserFacade.save(hospitalUser);
|
|
|
+ });
|
|
|
+ //插入用户和角色的关系
|
|
|
+ return saveUserRole(userId, roles);
|
|
|
+ } else {
|
|
|
+ Asserts.fail("用户所属组织为空");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @param userId
|
|
|
+ * @param roles
|
|
|
+ * @Description插入用户和角色的关系
|
|
|
+ * @Return boolean
|
|
|
+ */
|
|
|
+ private boolean saveUserRole(Long userId, List<Long> roles) {
|
|
|
+ if (ListUtil.isNotEmpty(roles)) {
|
|
|
+ roles.stream().forEach(roleId -> {
|
|
|
+ UserRole userRole = new UserRole();
|
|
|
+ userRole.setRoleId(roleId);
|
|
|
+ userRole.setUserId(userId);
|
|
|
+ userRoleFacade.save(userRole);
|
|
|
+ });
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @param
|
|
|
+ * @Description获取当前用户的组织机构树
|
|
|
+ * @Return java.util.List<com.lantone.common.dto.GetHospitalTreeDTO>
|
|
|
+ */
|
|
|
+ public List<GetHospitalTreeDTO> getLoginUserHospitalTree() {
|
|
|
+ List<GetHospitalTreeDTO> outTree = new ArrayList<>();
|
|
|
+ //1.获取当前用户的组织类型
|
|
|
+ int hospitalType = -1;
|
|
|
+ Hospital hospital = getLocalHospital(1l);//###当前登录用户的医院id
|
|
|
+ if (hospital != null) {
|
|
|
+ hospitalType = Integer.parseInt(hospital.getType());
|
|
|
+ }
|
|
|
+ //单家医院
|
|
|
+ if (HospitalTypeEnum.SINGLE_HOSPITAL.getKey() == hospitalType) {
|
|
|
+ //获取医院的科室信息
|
|
|
+ List<GetDeptTreeDTO> deptTreeDTOS = deptFacade.getBaseMapper().getDeptInfo(1l);//###当前登录用户的医院id
|
|
|
+ GetHospitalTreeDTO getHospitalTreeDTO = new GetHospitalTreeDTO();
|
|
|
+ getHospitalTreeDTO.setDepts(deptTreeDTOS);
|
|
|
+ BeanUtils.copyProperties(hospital, getHospitalTreeDTO);
|
|
|
+ outTree.add(getHospitalTreeDTO);
|
|
|
+ return outTree;
|
|
|
+
|
|
|
+ //虚拟医院
|
|
|
+ } else if (hospitalType >= 0) {
|
|
|
+ //获取医院信息
|
|
|
+ GetHospitalTreeDTO getHospitalTreeDTO = new GetHospitalTreeDTO();
|
|
|
+ getHospitalTreeDTO.setHospitalId(hospital.getId());
|
|
|
+ getHospitalTreeDTO.setHospitalName(hospital.getName());
|
|
|
+ BeanUtils.copyProperties(hospital, getHospitalTreeDTO);
|
|
|
+ List<GetHospitalTreeDTO> hospitalTrees = getSonHospital(getHospitalTreeDTO);
|
|
|
+ getAllHospitalDTO(hospitalTrees);
|
|
|
+ getHospitalTreeDTO.setHospitalDTOS(hospitalTrees);
|
|
|
+ outTree.add(getHospitalTreeDTO);
|
|
|
+ return outTree;
|
|
|
+ }
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @param hospitalTrees
|
|
|
+ * @Description 获取医院对应的子医院信息
|
|
|
+ * @Return void
|
|
|
+ */
|
|
|
+ private void getAllHospitalDTO(List<GetHospitalTreeDTO> hospitalTrees) {
|
|
|
+ if (ListUtil.isNotEmpty(hospitalTrees)) {
|
|
|
+ for (GetHospitalTreeDTO tempHospitalDTO : hospitalTrees) {
|
|
|
+ getAllHospitalDTO(getSonHospital(tempHospitalDTO));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @param getHospitalTreeDTO
|
|
|
+ * @Description获取医院信息
|
|
|
+ * @Return java.util.List<com.lantone.common.dto.HospitalDTO>
|
|
|
+ */
|
|
|
+ private List<GetHospitalTreeDTO> getSonHospital(GetHospitalTreeDTO getHospitalTreeDTO) {
|
|
|
+ if (getHospitalTreeDTO.getHospitalId() != null) {
|
|
|
+ List<GetHospitalTreeDTO> sonHospitals = hospitalFacade.getBaseMapper().getHospitalTreeInfo(getHospitalTreeDTO.getHospitalId());
|
|
|
+ getHospitalTreeDTO.setHospitalDTOS(sonHospitals);
|
|
|
+ return sonHospitals;
|
|
|
+ }
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
+ private Hospital getLocalHospital(Long hospitalId) {
|
|
|
+ List<Hospital> hospitals = hospitalFacade.list(new QueryWrapper<Hospital>()
|
|
|
+ .eq("id", hospitalId)
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N.getKey()));
|
|
|
+ if (ListUtil.isNotEmpty(hospitals)) {
|
|
|
+ return hospitals.get(0);
|
|
|
+ } else {
|
|
|
+ Asserts.fail("当前登录用户的医院信息不存在");
|
|
|
+ }
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @param updateUserVO
|
|
|
+ * @Description修改用户
|
|
|
+ * @Return boolean
|
|
|
+ */
|
|
|
+ public boolean updateUser(UpdateUserVO updateUserVO) {
|
|
|
+ //1.删除该用户关联的科室、医院
|
|
|
+ if (delUserHospitalORDept(updateUserVO.getId())) {
|
|
|
+ if (userFacade.update(new UpdateWrapper<User>()
|
|
|
+ .set("username", updateUserVO.getUsername())
|
|
|
+ .set("password", updateUserVO.getPassword())
|
|
|
+ .set("name", updateUserVO.getName())
|
|
|
+ .set("status", updateUserVO.getStatus())
|
|
|
+ .set(StringUtil.isNotEmpty(updateUserVO.getMobilePhone()), "mobile_phone", updateUserVO.getMobilePhone())
|
|
|
+ .set(StringUtil.isNotEmpty(updateUserVO.getIdcard()), "idcard", updateUserVO.getIdcard())
|
|
|
+ .set(StringUtil.isNotEmpty(updateUserVO.getTitleId()), "title_id", updateUserVO.getTitleId())
|
|
|
+ .set(updateUserVO.getJobNo() != null, "job_no", updateUserVO.getJobNo())
|
|
|
+ .set(updateUserVO.getOrderNo() != null, "order_no", updateUserVO.getOrderNo())
|
|
|
+ .eq("id", updateUserVO.getId())
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N.getKey()))) {
|
|
|
+ //2.插入用户新关联的医院、科室
|
|
|
+ return saveUserHospital(updateUserVO.getAddHospitalTreeVO(), updateUserVO.getId(), updateUserVO.getRoles());
|
|
|
+ } else {
|
|
|
+ Asserts.fail("用户基本信息修改失败");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @param id
|
|
|
+ * @Description删除用户与医院、科室的关联关系
|
|
|
+ * @Return boolean
|
|
|
+ */
|
|
|
+ private boolean delUserHospitalORDept(Long id) {
|
|
|
+ if (hospitalUserFacade.remove(new UpdateWrapper<HospitalUser>()
|
|
|
+ .eq("user_id", id)
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N.getKey()))) {
|
|
|
+ if (userRoleFacade.remove(new UpdateWrapper<UserRole>()
|
|
|
+ .eq("user_id", id)
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N.getKey()))) {
|
|
|
+ if (userDeptFacade.list(new QueryWrapper<DeptUser>()
|
|
|
+ .eq("user_id", id)
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N.getKey())).size() > 0) {
|
|
|
+ return userDeptFacade.remove(new UpdateWrapper<DeptUser>()
|
|
|
+ .eq("user_id", id)
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N.getKey()));
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ } else {
|
|
|
+ Asserts.fail("用户和角色的关联关系删除失败");
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ Asserts.fail("用户和医院的关联关系删除失败");
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @param userId
|
|
|
+ * @Description删除用户
|
|
|
+ * @Return boolean
|
|
|
+ */
|
|
|
+ public boolean deleteUser(Long userId) {
|
|
|
+
|
|
|
+ if (delUserHospitalORDept(userId)) {
|
|
|
+ return userFacade.removeById(userId);
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @param userId
|
|
|
+ * @param status
|
|
|
+ * @Description启用禁用用户
|
|
|
+ * @Return boolean
|
|
|
+ */
|
|
|
+ public boolean disableUser(Long userId, String status) {
|
|
|
+
|
|
|
+ return userFacade.update(new UpdateWrapper<User>()
|
|
|
+ .set("status", status)
|
|
|
+ .eq("id", userId)
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N.getKey()));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @param userId
|
|
|
+ * @Description获取用户详情
|
|
|
+ * @Return com.lantone.common.dto.GetUserDTO
|
|
|
+ */
|
|
|
+ public GetUserDTO getUserById(Long userId, Long local) {
|
|
|
+ GetUserDTO getUserDTO = new GetUserDTO();
|
|
|
+ //1.获取用户的基本信息
|
|
|
+ BeanUtils.copyProperties(userFacade.getById(userId), getUserDTO);
|
|
|
+ //2.获取当前用户的组织类型
|
|
|
+ int hospitalType = -1;
|
|
|
+ Hospital hospital = getLocalHospital(local);//###当前登录用户的医院id
|
|
|
+ if (hospital != null) {
|
|
|
+ hospitalType = Integer.parseInt(hospital.getType());
|
|
|
+ }
|
|
|
+
|
|
|
+ //###通过职称id获取用户的职称
|
|
|
+
|
|
|
+ //3.1如果是单家医院
|
|
|
+ if (HospitalTypeEnum.SINGLE_HOSPITAL.getKey() == hospitalType) {
|
|
|
+ List<GetHospitalDeptDTO> hospitalDepts = hospitalFacade.getBaseMapper().getUserHospitalDept(hospital.getId(), userId);
|
|
|
+ getUserRelation(getUserDTO, hospitalDepts, hospitalType);
|
|
|
+ //3.2虚拟医院
|
|
|
+ } else if (hospitalType >= 0) {
|
|
|
+ List<GetHospitalDeptDTO> hospitals = hospitalFacade.getBaseMapper().getUserHospital(hospital.getId(), userId);
|
|
|
+ getUserRelation(getUserDTO, hospitals, hospitalType);
|
|
|
+ }
|
|
|
+ //4.获取用户的角色
|
|
|
+ getUserDTO.setRoles(userRoleFacade.getBaseMapper().getUserRoles(userId));
|
|
|
+ return getUserDTO;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @param getUserDTO
|
|
|
+ * @param hospitalDepts
|
|
|
+ * @param hospitalType
|
|
|
+ * @Description 获取当前用户组织机构树以及查询用户对应组织关联关系
|
|
|
+ * @Return void
|
|
|
+ */
|
|
|
+ private void getUserRelation(GetUserDTO getUserDTO, List<GetHospitalDeptDTO> hospitalDepts, int hospitalType) {
|
|
|
+
|
|
|
+ //单家医院
|
|
|
+ if (HospitalTypeEnum.SINGLE_HOSPITAL.getKey() == hospitalType) {
|
|
|
+ if (ListUtil.isNotEmpty(hospitalDepts)) {
|
|
|
+ Map<Long, List<GetHospitalDeptDTO>> hospitalDeptMap = EntityUtil.makeEntityListMap(hospitalDepts, "hospitalId");
|
|
|
+ hospitalDeptMap.keySet().stream().forEach(hospitalId -> {
|
|
|
+ if (ListUtil.isEmpty(getUserDTO.getHospitalDTOS())) {
|
|
|
+ getUserDTO.setHospitalDTOS(new ArrayList<>());
|
|
|
+ }
|
|
|
+ if (ListUtil.isNotEmpty(hospitalDeptMap.get(hospitalId))) {
|
|
|
+ GetHospitalTreeDTO oneGetHospitalTreeDTO = new GetHospitalTreeDTO();
|
|
|
+ BeanUtils.copyProperties(hospitalDeptMap.get(hospitalId).get(0), oneGetHospitalTreeDTO);
|
|
|
+ hospitalDeptMap.get(hospitalId).stream().forEach(getHospitalDeptDTO -> {
|
|
|
+ if (ListUtil.isEmpty(oneGetHospitalTreeDTO.getDepts())) {
|
|
|
+ oneGetHospitalTreeDTO.setDepts(new ArrayList<>());
|
|
|
+ }
|
|
|
+ GetDeptTreeDTO oneGetDeptTreeDTO = new GetDeptTreeDTO();
|
|
|
+ BeanUtils.copyProperties(getHospitalDeptDTO, oneGetDeptTreeDTO);
|
|
|
+ oneGetHospitalTreeDTO.getDepts().add(oneGetDeptTreeDTO);
|
|
|
+ });
|
|
|
+ getUserDTO.getHospitalDTOS().add(oneGetHospitalTreeDTO);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ //虚拟医院
|
|
|
+ } else if (hospitalType >= 0) {
|
|
|
+ if (ListUtil.isNotEmpty(hospitalDepts)) {
|
|
|
+ Map<Long, List<GetHospitalDeptDTO>> hospitalDeptMap = EntityUtil.makeEntityListMap(hospitalDepts, "parentId");
|
|
|
+ hospitalDeptMap.keySet().stream().forEach(hospitalId -> {
|
|
|
+ if (ListUtil.isEmpty(getUserDTO.getHospitalDTOS())) {
|
|
|
+ getUserDTO.setHospitalDTOS(new ArrayList<>());
|
|
|
+ }
|
|
|
+ if (ListUtil.isNotEmpty(hospitalDeptMap.get(hospitalId))) {
|
|
|
+ hospitalDeptMap.get(hospitalId).stream().forEach(getHospitalDeptDTO -> {
|
|
|
+ GetHospitalTreeDTO oneGetHospitalTreeDTO = new GetHospitalTreeDTO();
|
|
|
+ BeanUtils.copyProperties(getHospitalDeptDTO, oneGetHospitalTreeDTO);
|
|
|
+ getUserDTO.getHospitalDTOS().add(oneGetHospitalTreeDTO);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ //转成树装结构
|
|
|
+ Map<Long, List<GetHospitalTreeDTO>> tempHospitalDeptMap = EntityUtil.makeEntityListMap(getUserDTO.getHospitalDTOS(), "parentId");
|
|
|
+ List<GetHospitalTreeDTO> HospitalTreeRes = tempHospitalDeptMap.get(1L);
|
|
|
+ for (GetHospitalTreeDTO bean : HospitalTreeRes) {
|
|
|
+ getSonHospital(bean, tempHospitalDeptMap);
|
|
|
+ }
|
|
|
+ getUserDTO.setHospitalDTOS(HospitalTreeRes);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 递归获取医院结构
|
|
|
+ *
|
|
|
+ * @param hospital 当前医院
|
|
|
+ * @param hospitalMap 医院集
|
|
|
+ * @return 菜单结构
|
|
|
+ */
|
|
|
+ public List<GetHospitalTreeDTO> getSonHospital(GetHospitalTreeDTO hospital, Map<Long, List<GetHospitalTreeDTO>> hospitalMap) {
|
|
|
+ List<GetHospitalTreeDTO> sonMenu = new ArrayList<>();
|
|
|
+ List<GetHospitalTreeDTO> menuList = hospitalMap.get(hospital.getHospitalId());
|
|
|
+ if (ListUtil.isNotEmpty(menuList)) {
|
|
|
+ hospital.setHospitalDTOS(menuList);
|
|
|
+ for (GetHospitalTreeDTO bean : menuList) {
|
|
|
+ getSonHospital(bean, hospitalMap);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return sonMenu;
|
|
|
+ }
|
|
|
}
|