|
@@ -1,6 +1,7 @@
|
|
|
package com.lantone.security.facade;
|
|
|
|
|
|
import cn.hutool.crypto.digest.BCrypt;
|
|
|
+import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
@@ -15,6 +16,7 @@ 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.util.SysUserUtils;
|
|
|
import com.lantone.common.vo.AddHospitalTreeVO;
|
|
|
import com.lantone.common.vo.AddHospitalVO;
|
|
@@ -190,7 +192,7 @@ public class HospitalManagementFacade {
|
|
|
public boolean deleteHospital(Long hospitalId) {
|
|
|
AtomicBoolean out = new AtomicBoolean(false);
|
|
|
//1.获取该组织及其子组织
|
|
|
- List<Long> hospitals = hospitalFacade.getBaseMapper().getHospitalTreeInfo(hospitalId,StatusEnum.Enable.getKey()).stream()
|
|
|
+ List<Long> hospitals = hospitalFacade.getBaseMapper().getHospitalTreeInfo(hospitalId,null).stream()
|
|
|
.map(GetHospitalTreeDTO::getHospitalId).collect(Collectors.toList());
|
|
|
//2.删除这些组织的用户、角色
|
|
|
if (ListUtil.isNotEmpty(hospitals)) {
|
|
@@ -220,6 +222,8 @@ public class HospitalManagementFacade {
|
|
|
}
|
|
|
|
|
|
});
|
|
|
+ }else {
|
|
|
+ Asserts.fail("要删除的组织不存在,请刷新重试~");
|
|
|
}
|
|
|
return out.get();
|
|
|
}
|
|
@@ -393,11 +397,15 @@ public class HospitalManagementFacade {
|
|
|
});
|
|
|
outMap.put(DictionaryEnum.REGION.getKey(), downBoxRegions);
|
|
|
} else {
|
|
|
- JSONObject Type = JSONObject.parseObject(dictionaryInfoFacade.getBaseMapper().getDictionaryInfoByType(DictionaryEnum.HOSPITAL_TYPE.getKey()).get(0).getVal());
|
|
|
- outMap.put(DictionaryEnum.HOSPITAL_TYPE.getKey(), Type.get(hospitalType));
|
|
|
+ String type = dictionaryInfoFacade.getBaseMapper().getDictionaryInfoByType(DictionaryEnum.HOSPITAL_TYPE.getKey()).get(hospitalType).getVal();
|
|
|
+ if(StringUtil.isNotEmpty(type)){
|
|
|
+ outMap.put(DictionaryEnum.HOSPITAL_TYPE.getKey(), JSONArray.parseArray(type));
|
|
|
+ }
|
|
|
}
|
|
|
//添加职称信息
|
|
|
outMap.put(DictionaryEnum.TITLE.getKey(), dictionaryInfoFacade.getBaseMapper().getDictionaryInfoByType(DictionaryEnum.TITLE.getKey()));
|
|
|
+ //添加status信息
|
|
|
+ outMap.put(DictionaryEnum.STATUS.getKey(), dictionaryInfoFacade.getBaseMapper().getDictionaryInfoByType(DictionaryEnum.STATUS.getKey()));
|
|
|
return outMap;
|
|
|
}
|
|
|
|
|
@@ -422,6 +430,12 @@ public class HospitalManagementFacade {
|
|
|
getHospitalListInfoDTO.setHospitalId(hospital.getId());
|
|
|
getHospitalListInfoDTO.setHospitalName(hospital.getName());
|
|
|
BeanUtils.copyProperties(hospital, getHospitalListInfoDTO);
|
|
|
+ //添加根目录标志
|
|
|
+ getHospitalListInfoDTO.setRootFlag(true);
|
|
|
+ getHospitalListInfoDTO.setTypeName(HospitalTypeEnum.getName(hospitalType));
|
|
|
+ if(StringUtil.isNotEmpty(getHospitalListInfoDTO.getStatus())){
|
|
|
+ getHospitalListInfoDTO.setStatusName(StatusEnum.getName(Integer.parseInt(getHospitalListInfoDTO.getStatus())));
|
|
|
+ }
|
|
|
getHospitalListInfoDTO.setDepts(deptFacade.getBaseMapper().getDeptRegion(getHospitalListInfoVO));
|
|
|
List<GetHospitalListInfoDTO> hospitalListInfos = new ArrayList<>();
|
|
|
if (ListUtil.isNotEmpty(getHospitalListInfoDTO.getDepts())) {
|
|
@@ -435,6 +449,8 @@ public class HospitalManagementFacade {
|
|
|
Map<Long, List<GetHospitalListInfoDTO>> hospitalMaps = EntityUtil.makeEntityListMap(hospitalListInfoDTOS, "parentId");
|
|
|
List<GetHospitalListInfoDTO> hospitalListInfos = hospitalMaps.get(hospital.getParentId());
|
|
|
for (GetHospitalListInfoDTO bean : hospitalListInfos) {
|
|
|
+ //设置根目录
|
|
|
+ bean.setRootFlag(true);
|
|
|
//获取该组织是否有子组织、用户
|
|
|
getHospitalSonORUser(bean);
|
|
|
getSonHospital(bean, hospitalMaps);
|