73 门诊医生排班管理
This commit is contained in:
@@ -3,6 +3,7 @@ package com.openhis.web.basedatamanage.appservice;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.web.basedatamanage.dto.OrganizationDto;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.List;
|
||||
@@ -67,4 +68,12 @@ public interface IOrganizationAppService {
|
||||
*/
|
||||
R<?> inactiveOrg(Long orgId);
|
||||
|
||||
/**
|
||||
* 获取挂号科室列表
|
||||
*
|
||||
* @return 挂号科室列表
|
||||
*/
|
||||
R<?> getRegisterOrganizations(@RequestParam(required = false) String name,
|
||||
@RequestParam(required = false) String orgName);
|
||||
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@ import com.openhis.web.basedatamanage.appservice.IOrganizationAppService;
|
||||
import com.openhis.web.basedatamanage.dto.OrganizationDto;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
@@ -285,6 +286,41 @@ public class OrganizationAppServiceImpl implements IOrganizationAppService {
|
||||
return String.join(",", dictTexts);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取挂号科室列表
|
||||
*
|
||||
* @param name 机构/科室名称
|
||||
* @param orgName 机构名称
|
||||
* @return 挂号科室列表
|
||||
*/
|
||||
@Override
|
||||
public R<?> getRegisterOrganizations(@RequestParam(required = false) String name,
|
||||
@RequestParam(required = false) String orgName) {
|
||||
// 创建查询条件,只查询register_flag为1的组织机构
|
||||
LambdaQueryWrapper<Organization> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(Organization::getRegisterFlag, 1); // 只获取挂号科室
|
||||
|
||||
// 添加名称过滤条件
|
||||
if (StringUtils.isNotEmpty(name)) {
|
||||
queryWrapper.like(Organization::getName, name);
|
||||
}
|
||||
|
||||
// 执行查询
|
||||
List<Organization> organizationList = organizationService.list(queryWrapper);
|
||||
|
||||
// 转换为DTO对象并设置字典文本
|
||||
List<OrganizationDto> organizationDtoList = organizationList.stream().map(org -> {
|
||||
OrganizationDto dto = new OrganizationDto();
|
||||
BeanUtils.copyProperties(org, dto);
|
||||
dto.setTypeEnum_dictText(EnumUtils.getInfoByValue(OrganizationType.class, dto.getTypeEnum()));
|
||||
dto.setClassEnum_dictText(formatClassEnumDictText(dto.getClassEnum()));
|
||||
dto.setActiveFlag_dictText(EnumUtils.getInfoByValue(AccountStatus.class, dto.getActiveFlag()));
|
||||
return dto;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
return R.ok(organizationDtoList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验字段是否为指定类中的有效属性
|
||||
*/
|
||||
|
||||
@@ -130,4 +130,17 @@ public class OrganizationController {
|
||||
return iOrganizationAppService.inactiveOrg(orgId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取挂号科室列表
|
||||
*
|
||||
* @param name 机构/科室名称
|
||||
* @param orgName 机构名称
|
||||
* @return 挂号科室列表
|
||||
*/
|
||||
@GetMapping("/register-organizations")
|
||||
public R<?> getRegisterOrganizations(@RequestParam(required = false) String name,
|
||||
@RequestParam(required = false) String orgName) {
|
||||
return iOrganizationAppService.getRegisterOrganizations(name, orgName);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user