|
@@ -280,10 +280,19 @@ public class RegionManagementFacade {
|
|
|
*/
|
|
|
public List<DeptListDTO> getDept(GetDeptListVO getDeptListVO){
|
|
|
getDeptListVO.setHospitalId(SysUserUtils.getCurrentHospitalId());
|
|
|
+ getDeptListVO.setUserId(SysUserUtils.getCurrentPrincipleId());
|
|
|
List<DeptListDTO> deptListDTOS = new ArrayList<>();
|
|
|
+ List<Long> depts = regionDeptService.lambdaQuery()
|
|
|
+ .eq(RegionDept::getHospitalId, getDeptListVO.getHospitalId())
|
|
|
+ .eq(RegionDept::getIsDeleted,IsDeleteEnum.N.getKey())
|
|
|
+ .eq(RegionDept::getCreator, getDeptListVO.getUserId())
|
|
|
+ .list().stream().map(RegionDept::getDeptId).collect(Collectors.toList());
|
|
|
LambdaQueryChainWrapper<Dept> lambdaQueryChainWrapper = deptFacade.lambdaQuery();
|
|
|
lambdaQueryChainWrapper.eq(Dept::getHospitalId,getDeptListVO.getHospitalId());
|
|
|
lambdaQueryChainWrapper.eq(Dept::getIsDeleted,IsDeleteEnum.N.getKey());
|
|
|
+ if(ListUtil.isNotEmpty(depts)){
|
|
|
+ lambdaQueryChainWrapper.in(Dept::getId,depts);
|
|
|
+ }
|
|
|
if(StringUtil.isNotEmpty(getDeptListVO.getDeptName())){
|
|
|
lambdaQueryChainWrapper.like(Dept::getName,getDeptListVO.getDeptName());
|
|
|
}
|