From 8ff37f7d4f1e50a43ca26b0e0312cafaea12a277 Mon Sep 17 00:00:00 2001 From: zhangheng <3226558941@qq.com> Date: Mon, 26 Feb 2024 17:48:30 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=91=E5=AE=A4=E4=BF=A1=E6=81=AF=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../department/DepartmentController.java | 91 +++++ .../manage/domain/department/Department.java | 210 +++++++++++ .../mapper/department/DepartmentMapper.java | 62 ++++ .../department/IDepartmentService.java | 62 ++++ .../impl/DepartmentServiceImpl.java | 91 +++++ .../manage/department/DepartmentMapper.xml | 332 ++++++++++++++++++ 6 files changed, 848 insertions(+) create mode 100644 postdischarge-manage/src/main/java/com/xinelu/manage/controller/department/DepartmentController.java create mode 100644 postdischarge-manage/src/main/java/com/xinelu/manage/domain/department/Department.java create mode 100644 postdischarge-manage/src/main/java/com/xinelu/manage/mapper/department/DepartmentMapper.java create mode 100644 postdischarge-manage/src/main/java/com/xinelu/manage/service/department/IDepartmentService.java create mode 100644 postdischarge-manage/src/main/java/com/xinelu/manage/service/department/impl/DepartmentServiceImpl.java create mode 100644 postdischarge-manage/src/main/resources/mapper/manage/department/DepartmentMapper.xml diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/controller/department/DepartmentController.java b/postdischarge-manage/src/main/java/com/xinelu/manage/controller/department/DepartmentController.java new file mode 100644 index 00000000..3607758b --- /dev/null +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/controller/department/DepartmentController.java @@ -0,0 +1,91 @@ +package com.xinelu.manage.controller.department; + +import com.xinelu.common.annotation.Log; +import com.xinelu.common.core.controller.BaseController; +import com.xinelu.common.core.domain.AjaxResult; +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.department.Department; +import com.xinelu.manage.service.department.IDepartmentService; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletResponse; +import java.util.List; + +/** + * 科室信息Controller + * + * @author xinelu + * @date 2024-02-26 + */ +@RestController +@RequestMapping("/system/department") +public class DepartmentController extends BaseController { + @Resource + private IDepartmentService departmentService; + + /** + * 查询科室信息列表 + */ + @PreAuthorize("@ss.hasPermi('system:department:list')") + @GetMapping("/list") + public TableDataInfo list(Department department) { + startPage(); + List list = departmentService.selectDepartmentList(department); + return getDataTable(list); + } + + /** + * 导出科室信息列表 + */ + @PreAuthorize("@ss.hasPermi('system:department:export')") + @Log(title = "科室信息", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, Department department) { + List list = departmentService.selectDepartmentList(department); + ExcelUtil util = new ExcelUtil(Department.class); + util.exportExcel(response, list, "科室信息数据"); + } + + /** + * 获取科室信息详细信息 + */ + @PreAuthorize("@ss.hasPermi('system:department:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) { + return AjaxResult.success(departmentService.selectDepartmentById(id)); + } + + /** + * 新增科室信息 + */ + @PreAuthorize("@ss.hasPermi('system:department:add')") + @Log(title = "科室信息", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody Department department) { + return toAjax(departmentService.insertDepartment(department)); + } + + /** + * 修改科室信息 + */ + @PreAuthorize("@ss.hasPermi('system:department:edit')") + @Log(title = "科室信息", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody Department department) { + return toAjax(departmentService.updateDepartment(department)); + } + + /** + * 删除科室信息 + */ + @PreAuthorize("@ss.hasPermi('system:department:remove')") + @Log(title = "科室信息", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) { + return toAjax(departmentService.deleteDepartmentByIds(ids)); + } +} diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/domain/department/Department.java b/postdischarge-manage/src/main/java/com/xinelu/manage/domain/department/Department.java new file mode 100644 index 00000000..af3bae5d --- /dev/null +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/domain/department/Department.java @@ -0,0 +1,210 @@ +package com.xinelu.manage.domain.department; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.xinelu.common.annotation.Excel; +import com.xinelu.common.core.domain.BaseEntity; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +import java.util.Date; + +/** + * 科室信息对象 department + * + * @author xinelu + * @date 2024-02-26 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "科室信息对象", description = "department") +public class Department extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * 主键id + */ + private Long id; + + /** + * 上级科室id + */ + @ApiModelProperty(value = "上级科室id") + @Excel(name = "上级科室id") + private Long parentDepartmentId; + + /** + * 所属机构id + */ + @ApiModelProperty(value = "所属机构id") + @Excel(name = "所属机构id") + private Long agencyId; + + /** + * 所属机构名称 + */ + @ApiModelProperty(value = "所属机构名称") + @Excel(name = "所属机构名称") + private String agencyName; + + /** + * 科室名称 + */ + @ApiModelProperty(value = "科室名称") + @Excel(name = "科室名称") + private String departmentName; + + /** + * 科室代码 + */ + @ApiModelProperty(value = "科室代码") + @Excel(name = "科室代码") + private String departmentCode; + + /** + * 科室类型 + */ + @ApiModelProperty(value = "科室类型") + @Excel(name = "科室类型") + private String departmentType; + + /** + * 科室简称 + */ + @ApiModelProperty(value = "科室简称") + @Excel(name = "科室简称") + private String departmentAbbreviation; + + /** + * 科室负责人id + */ + @ApiModelProperty(value = "科室负责人id") + @Excel(name = "科室负责人id") + private Long departmentPersonId; + + /** + * 科室负责人姓名 + */ + @ApiModelProperty(value = "科室负责人姓名") + @Excel(name = "科室负责人姓名") + private String departmentPersonName; + + /** + * 节点类型,科室:DEPARTMENT,病区:WARD, + */ + @ApiModelProperty(value = "节点类型,科室:DEPARTMENT,病区:WARD,") + @Excel(name = "节点类型,科室:DEPARTMENT,病区:WARD,") + private String nodeType; + + /** + * 提供服务类别,门诊:OUTPATIENT_SERVICE,急诊:EMERGENCY_TREATMENT,住院:BE_HOSPITALIZED,病区:WARD,医技:MEDICAL_TECHNOLOGY, + * 药剂:DRUG,财务:FINANCE,行政:ADMINISTRATION,药房:PHARMACY,药库:DRUG_STORAGE,公卫:PUBLIC_HEALTH + */ + @ApiModelProperty(value = "提供服务类别,门诊:OUTPATIENT_SERVICE,急诊:EMERGENCY_TREATMENT,住院:BE_HOSPITALIZED,病区:WARD,医技:MEDICAL_TECHNOLOGY,药剂:DRUG,财务:FINANCE,行政:ADMINISTRATION,药房:PHARMACY,药库:DRUG_STORAGE,公卫:PUBLIC_HEALTH") + @Excel(name = "提供服务类别,门诊:OUTPATIENT_SERVICE,急诊:EMERGENCY_TREATMENT,住院:BE_HOSPITALIZED,病区:WARD,医技:MEDICAL_TECHNOLOGY, 药剂:DRUG,财务:FINANCE,行政:ADMINISTRATION,药房:PHARMACY,药库:DRUG_STORAGE,公卫:PUBLIC_HEALTH") + private String provideServiceCategory; + + /** + * 细分类别id + */ + @ApiModelProperty(value = "细分类别id") + @Excel(name = "细分类别id") + private Long subdivisionCategoryId; + + /** + * 细分类别名称 + */ + @ApiModelProperty(value = "细分类别名称") + @Excel(name = "细分类别名称") + private String subdivisionCategoryName; + + /** + * 标准科室对照id + */ + @ApiModelProperty(value = "标准科室对照id") + @Excel(name = "标准科室对照id") + private Long normDepartmentCompareId; + + /** + * 标准科室对照名称 + */ + @ApiModelProperty(value = "标准科室对照名称") + @Excel(name = "标准科室对照名称") + private String normDepartmentCompareName; + + /** + * 编制床位数 + */ + @ApiModelProperty(value = "编制床位数") + @Excel(name = "编制床位数") + private Integer prepareBedsCount; + + /** + * 科室电话 + */ + @ApiModelProperty(value = "科室电话") + @Excel(name = "科室电话") + private String departmentPhone; + + /** + * 科室邮箱 + */ + @ApiModelProperty(value = "科室邮箱") + @Excel(name = "科室邮箱") + private String departmentMail; + + /** + * 成立日期 + */ + @ApiModelProperty(value = "成立日期") + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "成立日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date establishDate; + + /** + * 撤销日期 + */ + @ApiModelProperty(value = "撤销日期") + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "撤销日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date revokeDate; + + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("parentDepartmentId", getParentDepartmentId()) + .append("agencyId", getAgencyId()) + .append("agencyName", getAgencyName()) + .append("departmentName", getDepartmentName()) + .append("departmentCode", getDepartmentCode()) + .append("departmentType", getDepartmentType()) + .append("departmentAbbreviation", getDepartmentAbbreviation()) + .append("departmentPersonId", getDepartmentPersonId()) + .append("departmentPersonName", getDepartmentPersonName()) + .append("nodeType", getNodeType()) + .append("provideServiceCategory", getProvideServiceCategory()) + .append("subdivisionCategoryId", getSubdivisionCategoryId()) + .append("subdivisionCategoryName", getSubdivisionCategoryName()) + .append("normDepartmentCompareId", getNormDepartmentCompareId()) + .append("normDepartmentCompareName", getNormDepartmentCompareName()) + .append("prepareBedsCount", getPrepareBedsCount()) + .append("departmentPhone", getDepartmentPhone()) + .append("departmentMail", getDepartmentMail()) + .append("establishDate", getEstablishDate()) + .append("revokeDate", getRevokeDate()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .toString(); + } +} diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/department/DepartmentMapper.java b/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/department/DepartmentMapper.java new file mode 100644 index 00000000..3c1f7eba --- /dev/null +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/department/DepartmentMapper.java @@ -0,0 +1,62 @@ +package com.xinelu.manage.mapper.department; + +import com.xinelu.manage.domain.department.Department; + +import java.util.List; + + +/** + * 科室信息Mapper接口 + * + * @author xinelu + * @date 2024-02-26 + */ +public interface DepartmentMapper { + /** + * 查询科室信息 + * + * @param id 科室信息主键 + * @return 科室信息 + */ + Department selectDepartmentById(Long id); + + /** + * 查询科室信息列表 + * + * @param department 科室信息 + * @return 科室信息集合 + */ + List selectDepartmentList(Department department); + + /** + * 新增科室信息 + * + * @param department 科室信息 + * @return 结果 + */ + int insertDepartment(Department department); + + /** + * 修改科室信息 + * + * @param department 科室信息 + * @return 结果 + */ + int updateDepartment(Department department); + + /** + * 删除科室信息 + * + * @param id 科室信息主键 + * @return 结果 + */ + int deleteDepartmentById(Long id); + + /** + * 批量删除科室信息 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + int deleteDepartmentByIds(Long[] ids); +} diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/department/IDepartmentService.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/department/IDepartmentService.java new file mode 100644 index 00000000..b71e53f1 --- /dev/null +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/department/IDepartmentService.java @@ -0,0 +1,62 @@ +package com.xinelu.manage.service.department; + +import com.xinelu.manage.domain.department.Department; + +import java.util.List; + + +/** + * 科室信息Service接口 + * + * @author xinelu + * @date 2024-02-26 + */ +public interface IDepartmentService { + /** + * 查询科室信息 + * + * @param id 科室信息主键 + * @return 科室信息 + */ + Department selectDepartmentById(Long id); + + /** + * 查询科室信息列表 + * + * @param department 科室信息 + * @return 科室信息集合 + */ + List selectDepartmentList(Department department); + + /** + * 新增科室信息 + * + * @param department 科室信息 + * @return 结果 + */ + int insertDepartment(Department department); + + /** + * 修改科室信息 + * + * @param department 科室信息 + * @return 结果 + */ + int updateDepartment(Department department); + + /** + * 批量删除科室信息 + * + * @param ids 需要删除的科室信息主键集合 + * @return 结果 + */ + int deleteDepartmentByIds(Long[] ids); + + /** + * 删除科室信息信息 + * + * @param id 科室信息主键 + * @return 结果 + */ + int deleteDepartmentById(Long id); +} diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/department/impl/DepartmentServiceImpl.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/department/impl/DepartmentServiceImpl.java new file mode 100644 index 00000000..1d082f87 --- /dev/null +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/department/impl/DepartmentServiceImpl.java @@ -0,0 +1,91 @@ +package com.xinelu.manage.service.department.impl; + +import com.xinelu.common.utils.DateUtils; +import com.xinelu.manage.domain.department.Department; +import com.xinelu.manage.mapper.department.DepartmentMapper; +import com.xinelu.manage.service.department.IDepartmentService; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.List; + + +/** + * 科室信息Service业务层处理 + * + * @author xinelu + * @date 2024-02-26 + */ +@Service +public class DepartmentServiceImpl implements IDepartmentService { + @Resource + private DepartmentMapper departmentMapper; + + /** + * 查询科室信息 + * + * @param id 科室信息主键 + * @return 科室信息 + */ + @Override + public Department selectDepartmentById(Long id) { + return departmentMapper.selectDepartmentById(id); + } + + /** + * 查询科室信息列表 + * + * @param department 科室信息 + * @return 科室信息 + */ + @Override + public List selectDepartmentList(Department department) { + return departmentMapper.selectDepartmentList(department); + } + + /** + * 新增科室信息 + * + * @param department 科室信息 + * @return 结果 + */ + @Override + public int insertDepartment(Department department) { + department.setCreateTime(DateUtils.getNowDate()); + return departmentMapper.insertDepartment(department); + } + + /** + * 修改科室信息 + * + * @param department 科室信息 + * @return 结果 + */ + @Override + public int updateDepartment(Department department) { + department.setUpdateTime(DateUtils.getNowDate()); + return departmentMapper.updateDepartment(department); + } + + /** + * 批量删除科室信息 + * + * @param ids 需要删除的科室信息主键 + * @return 结果 + */ + @Override + public int deleteDepartmentByIds(Long[] ids) { + return departmentMapper.deleteDepartmentByIds(ids); + } + + /** + * 删除科室信息信息 + * + * @param id 科室信息主键 + * @return 结果 + */ + @Override + public int deleteDepartmentById(Long id) { + return departmentMapper.deleteDepartmentById(id); + } +} diff --git a/postdischarge-manage/src/main/resources/mapper/manage/department/DepartmentMapper.xml b/postdischarge-manage/src/main/resources/mapper/manage/department/DepartmentMapper.xml new file mode 100644 index 00000000..dbb979c4 --- /dev/null +++ b/postdischarge-manage/src/main/resources/mapper/manage/department/DepartmentMapper.xml @@ -0,0 +1,332 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, + parent_department_id, + agency_id, + agency_name, + department_name, + department_code, + department_type, + department_abbreviation, + department_person_id, + department_person_name, + node_type, + provide_service_category, + subdivision_category_id, + subdivision_category_name, + norm_department_compare_id, + norm_department_compare_name, + prepare_beds_count, + department_phone, + department_mail, + establish_date, + revoke_date, + create_by, + create_time, + update_by, + update_time + from department + + + + + + + + insert into department + + parent_department_id, + + agency_id, + + agency_name, + + department_name, + + department_code, + + department_type, + + department_abbreviation, + + department_person_id, + + department_person_name, + + node_type, + + provide_service_category, + + subdivision_category_id, + + subdivision_category_name, + + norm_department_compare_id, + + norm_department_compare_name, + + prepare_beds_count, + + department_phone, + + department_mail, + + establish_date, + + revoke_date, + + create_by, + + create_time, + + update_by, + + update_time, + + + + #{parentDepartmentId}, + + #{agencyId}, + + #{agencyName}, + + #{departmentName}, + + #{departmentCode}, + + #{departmentType}, + + #{departmentAbbreviation}, + + #{departmentPersonId}, + + #{departmentPersonName}, + + #{nodeType}, + + #{provideServiceCategory}, + + #{subdivisionCategoryId}, + + #{subdivisionCategoryName}, + + #{normDepartmentCompareId}, + + #{normDepartmentCompareName}, + + #{prepareBedsCount}, + + #{departmentPhone}, + + #{departmentMail}, + + #{establishDate}, + + #{revokeDate}, + + #{createBy}, + + #{createTime}, + + #{updateBy}, + + #{updateTime}, + + + + + + update department + + parent_department_id = + #{parentDepartmentId}, + + agency_id = + #{agencyId}, + + agency_name = + #{agencyName}, + + department_name = + #{departmentName}, + + department_code = + #{departmentCode}, + + department_type = + #{departmentType}, + + department_abbreviation = + #{departmentAbbreviation}, + + department_person_id = + #{departmentPersonId}, + + department_person_name = + #{departmentPersonName}, + + node_type = + #{nodeType}, + + provide_service_category = + #{provideServiceCategory}, + + subdivision_category_id = + #{subdivisionCategoryId}, + + subdivision_category_name = + #{subdivisionCategoryName}, + + norm_department_compare_id = + #{normDepartmentCompareId}, + + norm_department_compare_name = + #{normDepartmentCompareName}, + + prepare_beds_count = + #{prepareBedsCount}, + + department_phone = + #{departmentPhone}, + + department_mail = + #{departmentMail}, + + establish_date = + #{establishDate}, + + revoke_date = + #{revokeDate}, + + create_by = + #{createBy}, + + create_time = + #{createTime}, + + update_by = + #{updateBy}, + + update_time = + #{updateTime}, + + + where id = #{id} + + + + delete + from department + where id = #{id} + + + + delete from department where id in + + #{id} + + + \ No newline at end of file