修改科室病种查询。

This commit is contained in:
haown 2024-07-12 13:49:29 +08:00
parent c33bf19c68
commit 71d6ddbb38
7 changed files with 84 additions and 46 deletions

View File

@ -7,6 +7,8 @@ import com.xinelu.common.core.page.TableDataInfo;
import com.xinelu.common.enums.BusinessType;
import com.xinelu.common.utils.poi.ExcelUtil;
import com.xinelu.manage.domain.departmentdiseasetype.DepartmentDiseaseType;
import com.xinelu.manage.dto.department.DepartmentDTO;
import com.xinelu.manage.dto.departmentdiseasetype.DepartmentDiseaseTypeDto;
import com.xinelu.manage.service.departmentdiseasetype.IDepartmentDiseaseTypeService;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
@ -32,7 +34,7 @@ public class DepartmentDiseaseTypeController extends BaseController {
*/
@PreAuthorize("@ss.hasPermi('system:departmentDisease:list')")
@GetMapping("/list")
public TableDataInfo list(DepartmentDiseaseType departmentDiseaseType) {
public TableDataInfo list(DepartmentDiseaseTypeDto departmentDiseaseType) {
startPage();
List<DepartmentDiseaseType> list = departmentDiseaseTypeService.selectDepartmentDiseaseTypeList(departmentDiseaseType);
return getDataTable(list);
@ -42,7 +44,7 @@ public class DepartmentDiseaseTypeController extends BaseController {
* 查询科室病种信息列表 不分页 问卷使用
*/
@GetMapping("/diseaseList")
public AjaxResult diseaseList(DepartmentDiseaseType departmentDiseaseType) {
public AjaxResult diseaseList(DepartmentDiseaseTypeDto departmentDiseaseType) {
return AjaxResult.success(departmentDiseaseTypeService.selectDepartmentDiseaseTypeList(departmentDiseaseType));
}
@ -52,7 +54,7 @@ public class DepartmentDiseaseTypeController extends BaseController {
@PreAuthorize("@ss.hasPermi('system:departmentDisease:export')")
@Log(title = "科室病种信息", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, DepartmentDiseaseType departmentDiseaseType) {
public void export(HttpServletResponse response, DepartmentDiseaseTypeDto departmentDiseaseType) {
List<DepartmentDiseaseType> list = departmentDiseaseTypeService.selectDepartmentDiseaseTypeList(departmentDiseaseType);
ExcelUtil<DepartmentDiseaseType> util = new ExcelUtil<DepartmentDiseaseType>(DepartmentDiseaseType.class);
util.exportExcel(response, list, "科室病种信息数据");
@ -101,7 +103,7 @@ public class DepartmentDiseaseTypeController extends BaseController {
* 科室病种数量
*/
@GetMapping("/selectDiseaseCount")
public AjaxResult selectDiseaseTypeCount(String departmentName) {
return departmentDiseaseTypeService.selectDiseaseTypeCount(departmentName);
public AjaxResult selectDiseaseTypeCount(DepartmentDTO departmentDto) {
return departmentDiseaseTypeService.selectDiseaseTypeCount(departmentDto);
}
}

View File

@ -0,0 +1,18 @@
package com.xinelu.manage.dto.departmentdiseasetype;
import com.xinelu.manage.domain.departmentdiseasetype.DepartmentDiseaseType;
import lombok.Data;
/**
* @description: 科室病种查询传输对象
* @author: haown
* @create: 2024-07-12 13:34
**/
@Data
public class DepartmentDiseaseTypeDto extends DepartmentDiseaseType {
/**
* 所属机构id
*/
private Long hospitalAgencyId;
}

View File

@ -1,8 +1,9 @@
package com.xinelu.manage.mapper.departmentdiseasetype;
import com.xinelu.manage.domain.departmentdiseasetype.DepartmentDiseaseType;
import com.xinelu.manage.dto.department.DepartmentDTO;
import com.xinelu.manage.dto.departmentdiseasetype.DepartmentDiseaseTypeDto;
import com.xinelu.manage.vo.department.DepartmentVO;
import java.util.List;
@ -27,7 +28,7 @@ public interface DepartmentDiseaseTypeMapper {
* @param departmentDiseaseType 科室病种信息
* @return 科室病种信息集合
*/
List<DepartmentDiseaseType> selectDepartmentDiseaseTypeList(DepartmentDiseaseType departmentDiseaseType);
List<DepartmentDiseaseType> selectDepartmentDiseaseTypeList(DepartmentDiseaseTypeDto departmentDiseaseType);
/**
* 新增科室病种信息
@ -64,8 +65,8 @@ public interface DepartmentDiseaseTypeMapper {
/**
* 科室病种数量
*
* @param departmentName 科室名称
* @param departmentDto 查询条件
* @return DepartmentVO
*/
List<DepartmentVO> selectDiseaseTypeCount(String departmentName);
List<DepartmentVO> selectDiseaseTypeCount(DepartmentDTO departmentDto);
}

View File

@ -2,7 +2,8 @@ package com.xinelu.manage.service.departmentdiseasetype;
import com.xinelu.common.core.domain.AjaxResult;
import com.xinelu.manage.domain.departmentdiseasetype.DepartmentDiseaseType;
import com.xinelu.manage.dto.department.DepartmentDTO;
import com.xinelu.manage.dto.departmentdiseasetype.DepartmentDiseaseTypeDto;
import java.util.List;
@ -27,7 +28,7 @@ public interface IDepartmentDiseaseTypeService {
* @param departmentDiseaseType 科室病种信息
* @return 科室病种信息集合
*/
List<DepartmentDiseaseType> selectDepartmentDiseaseTypeList(DepartmentDiseaseType departmentDiseaseType);
List<DepartmentDiseaseType> selectDepartmentDiseaseTypeList(DepartmentDiseaseTypeDto departmentDiseaseType);
/**
* 新增科室病种信息
@ -64,8 +65,8 @@ public interface IDepartmentDiseaseTypeService {
/**
* 科室病种信息信息
*
* @param departmentName 科室信息
* @param departmentDto 科室信息
* @return 结果
*/
AjaxResult selectDiseaseTypeCount(String departmentName);
AjaxResult selectDiseaseTypeCount(DepartmentDTO departmentDto);
}

View File

@ -3,17 +3,20 @@ package com.xinelu.manage.service.departmentdiseasetype.impl;
import com.xinelu.common.constant.Constants;
import com.xinelu.common.core.domain.AjaxResult;
import com.xinelu.common.utils.codes.GenerateSystemCodeUtil;
import com.xinelu.manage.domain.agency.Agency;
import com.xinelu.manage.domain.departmentdiseasetype.DepartmentDiseaseType;
import com.xinelu.manage.dto.department.DepartmentDTO;
import com.xinelu.manage.dto.departmentdiseasetype.DepartmentDiseaseTypeDto;
import com.xinelu.manage.mapper.agency.AgencyMapper;
import com.xinelu.manage.mapper.departmentdiseasetype.DepartmentDiseaseTypeMapper;
import com.xinelu.manage.service.departmentdiseasetype.IDepartmentDiseaseTypeService;
import com.xinelu.manage.vo.department.DepartmentBaseVo;
import com.xinelu.manage.vo.department.DepartmentVO;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Resource;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.stereotype.Service;
/**
@ -28,6 +31,8 @@ public class DepartmentDiseaseTypeServiceImpl implements IDepartmentDiseaseTypeS
private DepartmentDiseaseTypeMapper departmentDiseaseTypeMapper;
@Resource
private GenerateSystemCodeUtil generateSystemCodeUtil;
@Resource
private AgencyMapper agencyMapper;
/**
* 查询科室病种信息
@ -47,7 +52,7 @@ public class DepartmentDiseaseTypeServiceImpl implements IDepartmentDiseaseTypeS
* @return 科室病种信息
*/
@Override
public List<DepartmentDiseaseType> selectDepartmentDiseaseTypeList(DepartmentDiseaseType departmentDiseaseType) {
public List<DepartmentDiseaseType> selectDepartmentDiseaseTypeList(DepartmentDiseaseTypeDto departmentDiseaseType) {
return departmentDiseaseTypeMapper.selectDepartmentDiseaseTypeList(departmentDiseaseType);
}
@ -101,22 +106,14 @@ public class DepartmentDiseaseTypeServiceImpl implements IDepartmentDiseaseTypeS
/**
* 科室病种数量
*
* @param departmentName 科室名称
* @param departmentDto 科室名称
* @return DepartmentVO
*/
@Override
public AjaxResult selectDiseaseTypeCount(String departmentName) {
DepartmentVO departmentVO = new DepartmentVO();
List<DepartmentVO> department = new ArrayList<>();
departmentVO.setDepartmentName("全部");
departmentVO.setCountNum(0);
List<DepartmentVO> departmentVOS = departmentDiseaseTypeMapper.selectDiseaseTypeCount(departmentName);
if (CollectionUtils.isNotEmpty(departmentVOS)) {
Integer result = departmentVOS.stream().mapToInt(DepartmentVO::getCountNum).sum();
departmentVO.setCountNum(result);
department.add(departmentVO);
department.addAll(departmentVOS);
}
return AjaxResult.success(department);
public AjaxResult selectDiseaseTypeCount(DepartmentDTO departmentDto) {
Agency agency = agencyMapper.selectAgencyById(departmentDto.getHospitalAgencyId());
List<DepartmentVO> departmentVOS = departmentDiseaseTypeMapper.selectDiseaseTypeCount(departmentDto);
return AjaxResult.success(DepartmentBaseVo.builder().hospitalAgencyName(ObjectUtils.isEmpty(agency) ? "" : agency.getAgencyName())
.deptNumList(departmentVOS).build());
}
}

View File

@ -25,6 +25,7 @@ import com.xinelu.manage.domain.textmessage.TextMessage;
import com.xinelu.manage.domain.textmessagesuittask.TextMessageSuitTask;
import com.xinelu.manage.domain.wechattemplate.WechatTemplate;
import com.xinelu.manage.domain.wechattemplatesuittask.WechatTemplateSuitTask;
import com.xinelu.manage.dto.departmentdiseasetype.DepartmentDiseaseTypeDto;
import com.xinelu.manage.dto.knowledgebase.KnowledgeBaseSaveDto;
import com.xinelu.manage.dto.operationinfo.BaseInfoQueryDto;
import com.xinelu.manage.dto.operationinfo.OperationInfoDto;
@ -297,7 +298,7 @@ public class KnowledgeBaseServiceImpl implements IKnowledgeBaseService {
scriptInfo.setSourceTemplateId(sourceId);
// 判断病种是否存在不存在则要先增加病种
if (scriptInfo.getDiseaseTypeId() != null) {
DepartmentDiseaseType departmentDiseaseType = new DepartmentDiseaseType();
DepartmentDiseaseTypeDto departmentDiseaseType = new DepartmentDiseaseTypeDto();
departmentDiseaseType.setDepartmentId(knowledgeBaseSaveDto.getDepartmentId());
departmentDiseaseType.setDiseaseTypeName(scriptInfo.getDiseaseTypeName());
List<DepartmentDiseaseType> diseaseTypeList = departmentDiseaseTypeService.selectDepartmentDiseaseTypeList(departmentDiseaseType);
@ -328,7 +329,7 @@ public class KnowledgeBaseServiceImpl implements IKnowledgeBaseService {
wechatTemplateTaskDTO.setSourceTemplateId(sourceId);
// 判断病种是否存在不存在则要先增加病种
if (wechatTemplate.getDiseaseTypeId() != null) {
DepartmentDiseaseType departmentDiseaseType = new DepartmentDiseaseType();
DepartmentDiseaseTypeDto departmentDiseaseType = new DepartmentDiseaseTypeDto();
departmentDiseaseType.setDepartmentId(knowledgeBaseSaveDto.getDepartmentId());
departmentDiseaseType.setDiseaseTypeName(wechatTemplate.getDiseaseTypeName());
List<DepartmentDiseaseType> diseaseTypeList = departmentDiseaseTypeService.selectDepartmentDiseaseTypeList(departmentDiseaseType);
@ -369,7 +370,7 @@ public class KnowledgeBaseServiceImpl implements IKnowledgeBaseService {
textMessageTaskDTO.setSourceTemplateId(sourceId);
// 判断病种是否存在不存在则要先增加病种
if (textMessage.getDiseaseTypeId() != null) {
DepartmentDiseaseType departmentDiseaseType = new DepartmentDiseaseType();
DepartmentDiseaseTypeDto departmentDiseaseType = new DepartmentDiseaseTypeDto();
departmentDiseaseType.setDepartmentId(knowledgeBaseSaveDto.getDepartmentId());
departmentDiseaseType.setDiseaseTypeName(textMessage.getDiseaseTypeName());
List<DepartmentDiseaseType> diseaseTypeList = departmentDiseaseTypeService.selectDepartmentDiseaseTypeList(departmentDiseaseType);
@ -453,7 +454,7 @@ public class KnowledgeBaseServiceImpl implements IKnowledgeBaseService {
servicePackageAddDTO.setDepartmentName(knowledgeBaseSaveDto.getDepartmentName());
if (servicePackage.getDiseaseTypeId() != null) {
DepartmentDiseaseType departmentDiseaseType = new DepartmentDiseaseType();
DepartmentDiseaseTypeDto departmentDiseaseType = new DepartmentDiseaseTypeDto();
departmentDiseaseType.setDepartmentId(knowledgeBaseSaveDto.getDepartmentId());
departmentDiseaseType.setDiseaseTypeName(servicePackage.getDiseaseTypeName());
List<DepartmentDiseaseType> diseaseTypeList = departmentDiseaseTypeService.selectDepartmentDiseaseTypeList(departmentDiseaseType);
@ -496,7 +497,7 @@ public class KnowledgeBaseServiceImpl implements IKnowledgeBaseService {
saveObj.setDepartmentName(knowledgeBaseSaveDto.getDepartmentName());
saveObj.setSourceTemplateId(sourceId);
if (questionVO.getDiseaseTypeId() != null) {
DepartmentDiseaseType departmentDiseaseType = new DepartmentDiseaseType();
DepartmentDiseaseTypeDto departmentDiseaseType = new DepartmentDiseaseTypeDto();
departmentDiseaseType.setDepartmentId(knowledgeBaseSaveDto.getDepartmentId());
departmentDiseaseType.setDiseaseTypeName(questionVO.getDiseaseTypeName());
List<DepartmentDiseaseType> diseaseTypeList = departmentDiseaseTypeService.selectDepartmentDiseaseTypeList(departmentDiseaseType);

View File

@ -33,27 +33,42 @@
from department_disease_type
</sql>
<select id="selectDepartmentDiseaseTypeList" parameterType="DepartmentDiseaseType"
<select id="selectDepartmentDiseaseTypeList" parameterType="com.xinelu.manage.dto.departmentdiseasetype.DepartmentDiseaseTypeDto"
resultMap="DepartmentDiseaseTypeResult">
<include refid="selectDepartmentDiseaseTypeVo"/>
select dt.id,
dt.department_id,
dt.department_name,
dt.disease_type_name,
dt.disease_type_code,
dt.diagnosis_info,
dt.disease_type_remark,
dt.create_by,
dt.create_time,
dt.update_by,
dt.update_time
from department_disease_type dt
left join department d on d.id = dt.department_id
<where>
<if test="hospitalAgencyId != null ">
and d.hospital_agency_id = #{hospitalAgencyId}
</if>
<if test="departmentId != null ">
and department_id = #{departmentId}
and dt.department_id = #{departmentId}
</if>
<if test="departmentName != null and departmentName != ''">
and department_name like concat('%', #{departmentName}, '%')
and dt.department_name like concat('%', #{departmentName}, '%')
</if>
<if test="diseaseTypeName != null and diseaseTypeName != ''">
and disease_type_name like concat('%', #{diseaseTypeName}, '%')
and dt.disease_type_name like concat('%', #{diseaseTypeName}, '%')
</if>
<if test="diseaseTypeCode != null and diseaseTypeCode != ''">
and disease_type_code = #{diseaseTypeCode}
and dt.disease_type_code = #{diseaseTypeCode}
</if>
<if test="diagnosisInfo != null and diagnosisInfo != ''">
and diagnosis_info = #{diagnosisInfo}
and dt.diagnosis_info = #{diagnosisInfo}
</if>
<if test="diseaseTypeRemark != null and diseaseTypeRemark != ''">
and disease_type_remark = #{diseaseTypeRemark}
and dt.disease_type_remark = #{diseaseTypeRemark}
</if>
</where>
</select>
@ -170,6 +185,9 @@
count(ddt.id) AS countNum
from department dt left join department_disease_type ddt on dt.id = ddt.department_id
<where>
<if test="hospitalAgencyId != null and hospitalAgencyId != ''">
dt.hospital_agency_id = #{hospitalAgencyId}
</if>
<if test="departmentName != null and departmentName != ''">
dt.department_name like concat('%',#{departmentName},'%')
</if>