From 71d6ddbb380aa22b60905ce6e70c0343e224acd4 Mon Sep 17 00:00:00 2001 From: haown <454902499@qq.com> Date: Fri, 12 Jul 2024 13:49:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=A7=91=E5=AE=A4=E7=97=85?= =?UTF-8?q?=E7=A7=8D=E6=9F=A5=E8=AF=A2=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DepartmentDiseaseTypeController.java | 12 +++--- .../DepartmentDiseaseTypeDto.java | 18 +++++++++ .../DepartmentDiseaseTypeMapper.java | 9 +++-- .../IDepartmentDiseaseTypeService.java | 9 +++-- .../DepartmentDiseaseTypeServiceImpl.java | 37 +++++++++---------- .../impl/KnowledgeBaseServiceImpl.java | 11 +++--- .../DepartmentDiseaseTypeMapper.xml | 34 +++++++++++++---- 7 files changed, 84 insertions(+), 46 deletions(-) create mode 100644 postdischarge-manage/src/main/java/com/xinelu/manage/dto/departmentdiseasetype/DepartmentDiseaseTypeDto.java diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/controller/departmentdiseasetype/DepartmentDiseaseTypeController.java b/postdischarge-manage/src/main/java/com/xinelu/manage/controller/departmentdiseasetype/DepartmentDiseaseTypeController.java index 2f1ace6e..c7278c5f 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/controller/departmentdiseasetype/DepartmentDiseaseTypeController.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/controller/departmentdiseasetype/DepartmentDiseaseTypeController.java @@ -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 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 list = departmentDiseaseTypeService.selectDepartmentDiseaseTypeList(departmentDiseaseType); ExcelUtil util = new ExcelUtil(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); } } \ No newline at end of file diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/dto/departmentdiseasetype/DepartmentDiseaseTypeDto.java b/postdischarge-manage/src/main/java/com/xinelu/manage/dto/departmentdiseasetype/DepartmentDiseaseTypeDto.java new file mode 100644 index 00000000..851d63f8 --- /dev/null +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/dto/departmentdiseasetype/DepartmentDiseaseTypeDto.java @@ -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; +} diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/departmentdiseasetype/DepartmentDiseaseTypeMapper.java b/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/departmentdiseasetype/DepartmentDiseaseTypeMapper.java index 54856699..40d04acd 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/departmentdiseasetype/DepartmentDiseaseTypeMapper.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/departmentdiseasetype/DepartmentDiseaseTypeMapper.java @@ -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 selectDepartmentDiseaseTypeList(DepartmentDiseaseType departmentDiseaseType); + List selectDepartmentDiseaseTypeList(DepartmentDiseaseTypeDto departmentDiseaseType); /** * 新增科室病种信息 @@ -64,8 +65,8 @@ public interface DepartmentDiseaseTypeMapper { /** * 科室病种数量 * - * @param departmentName 科室名称 + * @param departmentDto 查询条件 * @return DepartmentVO */ - List selectDiseaseTypeCount(String departmentName); + List selectDiseaseTypeCount(DepartmentDTO departmentDto); } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/departmentdiseasetype/IDepartmentDiseaseTypeService.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/departmentdiseasetype/IDepartmentDiseaseTypeService.java index eee70ec3..987f5b85 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/departmentdiseasetype/IDepartmentDiseaseTypeService.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/departmentdiseasetype/IDepartmentDiseaseTypeService.java @@ -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 selectDepartmentDiseaseTypeList(DepartmentDiseaseType departmentDiseaseType); + List selectDepartmentDiseaseTypeList(DepartmentDiseaseTypeDto departmentDiseaseType); /** * 新增科室病种信息 @@ -64,8 +65,8 @@ public interface IDepartmentDiseaseTypeService { /** * 科室病种信息信息 * - * @param departmentName 科室信息 + * @param departmentDto 科室信息 * @return 结果 */ - AjaxResult selectDiseaseTypeCount(String departmentName); + AjaxResult selectDiseaseTypeCount(DepartmentDTO departmentDto); } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/departmentdiseasetype/impl/DepartmentDiseaseTypeServiceImpl.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/departmentdiseasetype/impl/DepartmentDiseaseTypeServiceImpl.java index 15b46175..52100907 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/departmentdiseasetype/impl/DepartmentDiseaseTypeServiceImpl.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/departmentdiseasetype/impl/DepartmentDiseaseTypeServiceImpl.java @@ -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 selectDepartmentDiseaseTypeList(DepartmentDiseaseType departmentDiseaseType) { + public List 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 department = new ArrayList<>(); - departmentVO.setDepartmentName("全部"); - departmentVO.setCountNum(0); - List 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 departmentVOS = departmentDiseaseTypeMapper.selectDiseaseTypeCount(departmentDto); + return AjaxResult.success(DepartmentBaseVo.builder().hospitalAgencyName(ObjectUtils.isEmpty(agency) ? "" : agency.getAgencyName()) + .deptNumList(departmentVOS).build()); } } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/knowledgebase/impl/KnowledgeBaseServiceImpl.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/knowledgebase/impl/KnowledgeBaseServiceImpl.java index dc3ebf4f..81ac7343 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/knowledgebase/impl/KnowledgeBaseServiceImpl.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/knowledgebase/impl/KnowledgeBaseServiceImpl.java @@ -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 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 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 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 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 diseaseTypeList = departmentDiseaseTypeService.selectDepartmentDiseaseTypeList(departmentDiseaseType); diff --git a/postdischarge-manage/src/main/resources/mapper/manage/departmentdiseasetype/DepartmentDiseaseTypeMapper.xml b/postdischarge-manage/src/main/resources/mapper/manage/departmentdiseasetype/DepartmentDiseaseTypeMapper.xml index f2d35fbe..6be49655 100644 --- a/postdischarge-manage/src/main/resources/mapper/manage/departmentdiseasetype/DepartmentDiseaseTypeMapper.xml +++ b/postdischarge-manage/src/main/resources/mapper/manage/departmentdiseasetype/DepartmentDiseaseTypeMapper.xml @@ -33,27 +33,42 @@ from department_disease_type - @@ -170,6 +185,9 @@ count(ddt.id) AS countNum from department dt left join department_disease_type ddt on dt.id = ddt.department_id + + dt.hospital_agency_id = #{hospitalAgencyId} + dt.department_name like concat('%',#{departmentName},'%')