1
0
Pārlūkot izejas kodu

初始化-医院介绍、科室介绍

高大威猛帅气的Sanmu8 9 mēneši atpakaļ
vecāks
revīzija
58685455c8

+ 60 - 0
admin-ui/src/api/work/dept.js

@@ -0,0 +1,60 @@
+import request from '@/utils/request'
+
+// 查询菜单列表
+export function listDept(query) {
+  return request({
+    url: '/work/dept/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询菜单详细
+export function getDept(deptId) {
+  return request({
+    url: '/work/dept/detail/' + deptId,
+    method: 'get'
+  })
+}
+
+// 查询菜单下拉树结构
+export function treeselect() {
+  return request({
+    url: '/work/dept/treeselect',
+    method: 'get'
+  })
+}
+
+// 根据角色ID查询菜单下拉树结构
+export function roleMenuTreeselect(roleId) {
+  return request({
+    url: '/work/dept/roleMenuTreeselect/' + roleId,
+    method: 'get'
+  })
+}
+
+// 新增菜单
+export function addDept(data) {
+  return request({
+    url: '/work/dept/add',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改菜单
+export function updateDept(data) {
+  return request({
+    url: '/work/dept/edit',
+    method: 'post',
+    data: data
+  })
+}
+
+// 删除菜单
+export function delDept(deptId) {
+  return request({
+    url: '/work/dept/remove/' + deptId,
+    method: 'get'
+  })
+}

+ 108 - 0
admin-ui/src/views/work/dept/edit.vue

@@ -0,0 +1,108 @@
+<template>
+  <div class="cmain">
+    <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+      <el-form-item label="父级科室" prop="parentId">
+        <treeselect v-model="form.parentId" :options="deptOptions" :normalizer="normalizer" placeholder="请选择父级科室" />
+      </el-form-item>
+      <el-form-item label="科室名称" prop="deptname">
+        <el-input v-model="form.deptname" placeholder="请输入科室名称" />
+      </el-form-item>
+      <el-form-item label="科室描述">
+        <editor v-model="form.deptdesc" :min-height="192"/>
+      </el-form-item>
+    </el-form>
+    <div class="mfooter">
+      <el-button type="primary" @click="submitForm">确 定</el-button>
+      <el-button @click="$layer.close(layerid)">取 消</el-button>
+    </div>
+  </div>
+</template>
+
+<script>
+import Treeselect from "@riophae/vue-treeselect";
+export default {
+  components: {
+    Treeselect
+  },
+  data() {
+    return {
+      // 医院科室树选项
+      deptOptions: [],
+      form: { orderNum: 0, state: 0 },
+      // 表单校验
+      rules: {
+        parentId: [
+          { required: true, message: "父级科室不能为空", trigger: "blur" }
+        ],
+        deptname: [
+          { required: true, message: "科室名称不能为空", trigger: "blur" }
+        ],
+        deptdesc: [
+          { required: true, message: "科室描述不能为空", trigger: "blur" }
+        ]
+      }
+    };
+  },
+  props: {
+    param: {
+      type: Object,
+      default: () => {
+        return {};
+      }
+    },
+    layerid: {
+      type: String
+    }
+  },
+  mounted() {
+    this.getTreeselect()
+    if (this.param.id) {
+      this.ajax({ url: '/work/dept/detail/' + this.param.id }).then((response) => {
+        this.form = response.data;
+      });
+    }else{
+      this.form.parentId = this.param.parentId
+    }
+  },
+  methods: {
+    getTreeselect() {
+      this.ajax({ url: '/work/dept/list' }).then((response) => {
+        this.deptOptions = [];
+        const data = { id: 0, deptname: '全科科室', children: [] };
+        data.children = this.handleTree(response.rows, "id", "parentId");
+        this.deptOptions.push(data);
+      });
+    },
+    /** 转换医院科室数据结构 */
+    normalizer(node) {
+      if (node.children && !node.children.length) {
+        delete node.children;
+      }
+      return {
+        id: node.id,
+        label: node.deptname,
+        children: node.children
+      };
+    },
+    submitForm() {
+      this.$refs['form'].validate((valid) => {
+        if (valid) {
+          if (this.form.id) {
+            this.ajax({ method: 'post', url: '/work/dept/edit', data: this.form }).then((response) => {
+              this.$modal.msgSuccess('修改成功');
+              this.$layer.close(this.layerid);
+              this.$parent.getList();
+            });
+          } else {
+            this.ajax({ method: 'post', url: '/work/dept/add', data: this.form }).then((response) => {
+              this.$modal.msgSuccess('新增成功');
+              this.$layer.close(this.layerid);
+              this.$parent.getList();
+            });
+          }
+        }
+      });
+    }
+  }
+};
+</script>

+ 260 - 0
admin-ui/src/views/work/dept/index.vue

@@ -0,0 +1,260 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="auto">
+      <el-form-item label="科室名称" prop="deptname">
+        <el-input
+          v-model="queryParams.deptname"
+          placeholder="请输入科室名称"
+          clearable
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item>
+	    <el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          plain
+          icon="el-icon-plus"
+          @click="op('add')"
+          v-hasPermi="['work:dept:add']"
+        >新增</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="info"
+          plain
+          icon="el-icon-sort"
+          @click="toggleExpandAll"
+        >展开/折叠</el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table
+      v-if="refreshTable"
+      border
+      :data="deptList"
+      row-key="id"
+      :default-expand-all="isExpandAll"
+      @selection-change="selects"
+      :tree-props="{children: 'children', hasChildren: 'hasChildren'}"
+      height="calc(100vh - 270px)"
+    >
+      <el-table-column label="科室名称" align="center" prop="deptname" />
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <el-button
+            type="text"
+            icon="el-icon-edit"
+            @click="op('edit', scope.row)"
+            v-hasPermi="['work:dept:edit']"
+          >修改</el-button>
+          <el-button
+            type="text"
+            icon="el-icon-plus"
+            @click="op('add', scope.row)"
+            v-hasPermi="['work:dept:add']"
+          >新增</el-button>
+          <el-button
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['work:dept:remove']"
+          >删除</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+  </div>
+</template>
+
+<script>
+import { listDept, getDept, delDept, addDept, updateDept } from "@/api/work/dept";
+import Treeselect from "@riophae/vue-treeselect";
+import "@riophae/vue-treeselect/dist/vue-treeselect.css";
+import edit from './edit';
+
+export default {
+  name: "Dept",
+  components: {
+    Treeselect
+  },
+  data() {
+    return {
+      ids: [],
+      // 显示搜索条件
+      showSearch: true,
+      // 医院科室表格数据
+      deptList: [],
+      // 医院科室树选项
+      deptOptions: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 是否展开,默认全部展开
+      isExpandAll: false,
+      // 重新渲染表格状态
+      refreshTable: true,
+      // 查询参数
+      queryParams: {
+        deptname: null,
+        deptdesc: null,
+        parentId: 0,
+        pageNum: 1,
+        pageSize: 10,
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+        parentId: [
+          { required: true, message: "父级ID不能为空", trigger: "blur" }
+        ],
+        deptname: [
+          { required: true, message: "科室名称不能为空", trigger: "blur" }
+        ],
+        deptdesc: [
+          { required: true, message: "科室描述不能为空", trigger: "blur" }
+        ]
+      }
+    };
+  },
+  created() {
+    this.getList();
+  },
+  methods: {
+    selects(rows) {
+      this.ids = rows.map((item) => item.id);
+    },
+    op(tag, row) {
+      if (tag == 'add') {
+        const parentId = row != null && row.id ? row.id : 0;
+        this.iframe({ obj: edit, param: { parentId: parentId}, title: '新增科室', width: '1000px', height: '700px' });
+      }
+      if (tag == 'edit') {
+        const id = row.id || this.ids[0];
+        this.iframe({ obj: edit, param: { id: id}, title: '编辑科室', width: '1000px', height: '700px' });
+      }
+    },
+    /** 查询医院科室列表 */
+    getList() {
+      this.ajax({ url: '/work/dept/list', data: this.queryParams }).then((response) => {
+        this.deptList = this.handleTree(response.rows, "id", "parentId");
+      });
+    },
+    /** 转换医院科室数据结构 */
+    normalizer(node) {
+      if (node.children && !node.children.length) {
+        delete node.children;
+      }
+      return {
+        id: node.id,
+        label: node.deptname,
+        children: node.children
+      };
+    },
+	/** 查询医院科室下拉树结构 */
+    getTreeselect() {
+      listDept().then(response => {
+        this.deptOptions = [];
+        const data = { id: 0, deptname: '顶级节点', children: [] };
+        data.children = this.handleTree(response.rows, "id", "parentId");
+        this.deptOptions.push(data);
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        parentId: null,
+        deptname: null,
+        deptdesc: null
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    /** 新增按钮操作 */
+    handleAdd(row) {
+      this.reset();
+      this.getTreeselect();
+      if (row != null && row.id) {
+        this.form.parentId = row.id;
+      } else {
+        this.form.parentId = 0;
+      }
+      this.open = true;
+      this.title = "添加医院科室";
+    },
+    /** 展开/折叠操作 */
+    toggleExpandAll() {
+      this.refreshTable = false;
+      this.isExpandAll = !this.isExpandAll;
+      this.$nextTick(() => {
+        this.refreshTable = true;
+      });
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      this.getTreeselect();
+      if (row != null) {
+        this.form.parentId = row.id;
+      }
+      this.ajax({ url: '/work/dept/detail/' + row.id }).then((response) => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改医院科室";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.id != null) {
+            this.ajax({ method: 'post',url: '/work/dept/edit', data: this.form }).then((response) => {
+              this.$modal.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            this.ajax({ method: 'post',url: '/work/dept/add', data: this.form }).then((response) => {
+                this.$modal.msgSuccess("新增成功");
+                this.open = false;
+                this.getList();
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      this.$modal.confirm('是否确认删除医院科室编号为"' + row.id + '"的数据项?').then(function() {
+        return delDept(row.id);
+      }).then(() => {
+        this.getList();
+        this.$modal.msgSuccess("删除成功");
+      }).catch(() => {});
+    }
+  }
+};
+</script>

+ 67 - 0
admin-ui/src/views/work/introduction/edit.vue

@@ -0,0 +1,67 @@
+<template>
+  <div class="cmain">
+      <el-form ref="form" :model="form" :rules="rules" label-width="100px">
+        <el-form-item label="标题" prop="title">
+          <el-input v-model="form.title" placeholder="请输入标题" clearable/>
+        </el-form-item>
+        <el-form-item label="介绍" prop="context">
+          <editor v-model="form.context" :min-height="192"/>
+        </el-form-item>
+      </el-form>
+    <div class="mfooter">
+      <el-button type="primary" @click="submitForm">确 定</el-button>
+      <el-button @click="$layer.close(layerid)">取 消</el-button>
+    </div>
+  </div>
+</template>
+
+<script>
+export default {
+  data() {
+    return {
+      form: {},
+      rules: {
+      }
+    };
+  },
+  props: {
+    param: {
+      type: Object,
+      default: () => {
+        return {};
+      }
+    },
+    layerid: {
+      type: String
+    }
+  },
+  mounted() {
+    if (this.param.id) {
+      this.ajax({ url: '/work/introduction/detail/' + this.param.id }).then(response => {
+        this.form = response.data;
+      });
+    }
+  },
+  methods: {
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.id) {
+              this.ajax({method: 'post',url: '/work/introduction/edit', data: this.form }).then(response => {
+                  this.$modal.msgSuccess("修改成功");
+                  this.$layer.close(this.layerid);
+                  this.$parent.getList();
+              });
+          } else {
+              this.ajax({method: 'post',url: '/work/introduction/add', data: this.form }).then(response => {
+                  this.$modal.msgSuccess("新增成功");
+                  this.$layer.close(this.layerid);
+                  this.$parent.getList();
+               });
+          }
+        }
+      });
+    }
+  }
+};
+</script>

+ 115 - 0
admin-ui/src/views/work/introduction/index.vue

@@ -0,0 +1,115 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" @submit.native.prevent v-show="showSearch">
+      <el-form-item label="标题" prop="title">
+        <el-input v-model="queryParams.title" placeholder="请输入标题"  @keyup.enter.native="handleQuery" clearable class="inp"/>
+      </el-form-item>
+      <el-form-item>
+        <el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+    <el-row :gutter="10" class="mb8">
+        <el-button type="primary" icon="el-icon-plus" :disabled="ids.length > 0" @click="op('add')" v-hasPermi="['work:introduction:add']">新增</el-button>
+        <el-button type="success" icon="el-icon-edit" :disabled="ids.length != 1" @click="op('edit',ids)" v-hasPermi="['work:introduction:edit']">修改</el-button>
+        <el-button type="danger" icon="el-icon-delete" :disabled="ids.length == 0" @click="del" v-hasPermi="['work:introduction:remove']">删除{{ids.length>0?'('+ids.length+')':''}}</el-button>
+        <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table :data="response.rows" border @selection-change="selects" height="calc(100vh - 270px)">
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="标题" align="center" prop="title" />
+<!--      <el-table-column label="介绍" align="center" prop="context" />-->
+      <el-table-column label="状态" align="center" prop="status" >
+        <template slot-scope="scope">
+          <dict-tag :options="dict.type.work_status" :value="scope.row.status"/>
+        </template>
+      </el-table-column>
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-refresh-left"
+            @click="updateStatus(scope.row)"
+            v-hasPermi="['work:introduction:updateStatus']"
+          >更改状态</el-button>
+          <el-button size="mini" type="text" icon="el-icon-edit" @click="op('edit',scope.row)" v-hasPermi="['work:introduction:edit']">修改</el-button>
+          <el-button size="mini" type="text" icon="el-icon-delete" @click="del(scope.row)" v-hasPermi="['work:introduction:remove']">删除</el-button>
+        </template>
+      </el-table-column>
+      <template slot="empty">
+          <el-empty></el-empty>
+      </template>
+    </el-table>
+    <pagination v-if="response.total>0" :total="response.total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList"/>
+  </div>
+</template>
+
+<script>
+import edit from './edit'
+export default {
+  dicts: ['work_status'],
+  name: "Introduction",
+  data() {
+    return {
+      ids: [],
+      showSearch:true,
+      response: {},
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+                      title: null,
+                      context: null,
+                      status: null,
+                orderByColumn:'id', //排序字段
+                isAsc: 'desc' //排序方式
+      }
+    };
+  },
+  created() {
+    this.getList();
+  },
+  methods: {
+    updateStatus(row){
+      this.ajax({method: 'post',url: '/work/introduction/updateStatus', data: row }).then(response => {
+        this.$modal.msgSuccess(response.msg);
+        this.getList()
+      });
+    },
+    getList() {
+      this.ajax({ url: '/work/introduction/list', data: this.queryParams }).then(response => {
+            this.response = response;
+      });
+    },
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    selects(rows) {
+      this.ids = rows.map(item => item.id)
+    },
+    op(tag, row) {
+          if (tag == 'add') {
+            this.iframe({ obj: edit, param: {}, title:'新增',width: '1000px', height: '700px'});
+          }
+          if (tag == 'edit') {
+              const id = row.id || this.ids[0];
+              this.iframe({ obj: edit, param: {id: id}, title:'编辑',width: '1000px', height: '700px'});
+          }
+    },
+    del(row) {
+        this.$confirm('是否确认删除选中数据?', '警告', { type: 'warning' }).then(() => {
+        this.get({ url: '/work/introduction/remove/' + (row.id || this.ids) }).then(response => {
+                this.$modal.msgSuccess('删除成功');
+                this.getList();
+            });
+        });
+    }
+  }
+};
+</script>

+ 66 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/work/controller/HospitalDeptController.java

@@ -0,0 +1,66 @@
+package com.ruoyi.web.work.controller;
+
+import java.util.Arrays;
+import java.util.List;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.web.work.domain.HospitalDept;
+import com.ruoyi.web.work.service.IHospitalDeptService;
+import com.ruoyi.common.core.page.TableDataInfo;
+
+/**
+ * 医院科室
+ * @author lsw
+ * @date 2024-07-09
+ */
+@RestController
+@RequestMapping("/work/dept")
+public class HospitalDeptController extends BaseController {
+    @Autowired
+    private IHospitalDeptService hospitalDeptService;
+
+    @PreAuthorize("@ss.hasPermi('work:dept:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(HospitalDept hospitalDept){
+        startPage();
+        List<HospitalDept> list = hospitalDeptService.selectList(hospitalDept);
+        return getDataTable(list);
+    }
+
+    @PreAuthorize("@ss.hasPermi('work:dept:query')")
+    @GetMapping(value = "/detail/{id}")
+    public AjaxResult detail(@PathVariable("id") Long id){
+        return AjaxResult.success(hospitalDeptService.getById(id));
+    }
+
+    @PreAuthorize("@ss.hasPermi('work:dept:add')")
+    @Log(title = "医院科室", businessType = BusinessType.INSERT)
+    @PostMapping("/add")
+    public AjaxResult add(@RequestBody HospitalDept hospitalDept){
+        return toAjax(hospitalDeptService.save(hospitalDept));
+    }
+
+    @PreAuthorize("@ss.hasPermi('work:dept:edit')")
+    @Log(title = "医院科室", businessType = BusinessType.UPDATE)
+    @PostMapping("/edit")
+    public AjaxResult edit(@RequestBody HospitalDept hospitalDept){
+        return toAjax(hospitalDeptService.updateById(hospitalDept));
+    }
+
+    @PreAuthorize("@ss.hasPermi('work:dept:remove')")
+    @Log(title = "医院科室", businessType = BusinessType.DELETE)
+    @GetMapping("/remove/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids){
+        return toAjax(hospitalDeptService.removeByIds(Arrays.asList(ids)));
+    }
+}

+ 102 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/work/controller/IntroductionController.java

@@ -0,0 +1,102 @@
+package com.ruoyi.web.work.controller;
+
+import java.util.Arrays;
+import java.util.List;
+
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.web.work.domain.Introduction;
+import com.ruoyi.web.work.service.IIntroductionService;
+import com.ruoyi.common.core.page.TableDataInfo;
+
+/**
+ * 医院介绍
+ *
+ * @author lsw
+ * @date 2024-07-10
+ */
+@RestController
+@RequestMapping("/work/introduction")
+public class IntroductionController extends BaseController {
+    @Autowired
+    private IIntroductionService introductionService;
+
+    @PreAuthorize("@ss.hasPermi('work:introduction:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(Introduction introduction) {
+        startPage();
+        List<Introduction> list = introductionService.selectList(introduction);
+        return getDataTable(list);
+    }
+
+    @PreAuthorize("@ss.hasPermi('work:introduction:query')")
+    @GetMapping(value = "/detail/{id}")
+    public AjaxResult detail(@PathVariable("id") Long id) {
+        return AjaxResult.success(introductionService.getById(id));
+    }
+
+    @PreAuthorize("@ss.hasPermi('work:introduction:add')")
+    @Log(title = "医院介绍", businessType = BusinessType.INSERT)
+    @PostMapping("/add")
+    public AjaxResult add(@RequestBody Introduction introduction) {
+        return toAjax(introductionService.save(introduction));
+    }
+
+    @PreAuthorize("@ss.hasPermi('work:introduction:edit')")
+    @Log(title = "医院介绍", businessType = BusinessType.UPDATE)
+    @PostMapping("/edit")
+    public AjaxResult edit(@RequestBody Introduction introduction) {
+        return toAjax(introductionService.updateById(introduction));
+    }
+
+    @PreAuthorize("@ss.hasPermi('work:introduction:remove')")
+    @Log(title = "医院介绍", businessType = BusinessType.DELETE)
+    @GetMapping("/remove/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids) {
+        return toAjax(introductionService.removeByIds(Arrays.asList(ids)));
+    }
+
+    @PreAuthorize("@ss.hasPermi('work:introduction:updateStatus')")
+    @Log(title = "医院介绍更新状态", businessType = BusinessType.UPDATE)
+    @PostMapping("/updateStatus")
+    public AjaxResult updateStatusedit(@RequestBody Introduction introduction) {
+
+
+        //记录id
+        String titles = "";
+        if (introduction.getStatus() == 0) {
+            //查出所有的状态为启用然后设为停用
+            for (Introduction introduct : introductionService.selectList(new Introduction())) {
+                if (introduct.getStatus() == 1) {
+                    titles = titles.concat(introduct.getTitle());
+                    introduct.setStatus(0);
+                    introductionService.updateStatus(introduct);
+                }
+            }
+        }
+
+
+        Introduction intro = new Introduction();
+        intro.setId(introduction.getId());
+        intro.setStatus(introduction.getStatus() == 1 ? 0 : 1);
+        introductionService.updateById(intro);
+
+
+        if (!titles.isEmpty()) {
+            return AjaxResult.success("已将" + titles + "设置为停用," + introduction.getTitle() + "已设置为启用!");
+        } else {
+            return AjaxResult.success(introduction.getTitle() + "已" + (introduction.getStatus().equals(1) ? "停用" : "启用"));
+        }
+
+    }
+}

+ 29 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/work/domain/HospitalDept.java

@@ -0,0 +1,29 @@
+package com.ruoyi.web.work.domain;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import jdk.nashorn.internal.objects.annotations.Property;
+import lombok.Data;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.experimental.Accessors;
+/**
+ * @author lsw
+ * @date 2024-07-09
+ */
+@Data
+@TableName(value = "tb_hospital_dept")
+@Accessors(chain = true)
+public class HospitalDept{
+    private static final long serialVersionUID = 1L;
+
+    private Long id;
+
+    private Long parentId;
+
+    @ApiModelProperty(value = "科室名称")
+    private String deptname;
+
+    @ApiModelProperty(value = "科室描述")
+    private String deptdesc;
+
+}

+ 29 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/work/domain/Introduction.java

@@ -0,0 +1,29 @@
+package com.ruoyi.web.work.domain;
+
+import lombok.Data;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.experimental.Accessors;
+/**
+ * @author lsw
+ * @date 2024-07-10
+ */
+@Data
+@TableName(value = "tb_introduction")
+@Accessors(chain = true)
+public class Introduction{
+    private static final long serialVersionUID = 1L;
+
+    private Long id;
+
+    @ApiModelProperty(value = "标题")
+    private String title;
+
+    @ApiModelProperty(value = "介绍")
+    private String context;
+
+    @ApiModelProperty(value = "状态 ( 1:是 ,0:否 )")
+    private Integer status;
+
+
+}

+ 13 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/work/mapper/HospitalDeptMapper.java

@@ -0,0 +1,13 @@
+package com.ruoyi.web.work.mapper;
+
+import java.util.List;
+import com.ruoyi.web.work.domain.HospitalDept;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * @author lsw
+ * @date 2024-07-09
+ */
+public interface HospitalDeptMapper extends BaseMapper<HospitalDept> {
+    List<HospitalDept> selectList(HospitalDept hospitalDept);
+}

+ 15 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/work/mapper/IntroductionMapper.java

@@ -0,0 +1,15 @@
+package com.ruoyi.web.work.mapper;
+
+import java.util.List;
+import com.ruoyi.web.work.domain.Introduction;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * @author lsw
+ * @date 2024-07-10
+ */
+public interface IntroductionMapper extends BaseMapper<Introduction> {
+    List<Introduction> selectList(Introduction introduction);
+
+    int updateStatus(Introduction introduction);
+}

+ 13 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/work/service/IHospitalDeptService.java

@@ -0,0 +1,13 @@
+package com.ruoyi.web.work.service;
+
+import java.util.List;
+import com.ruoyi.web.work.domain.HospitalDept;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * @author lsw
+ * @date 2024-07-09
+ */
+public interface IHospitalDeptService extends IService<HospitalDept>{
+    List<HospitalDept> selectList(HospitalDept hospitalDept);
+}

+ 15 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/work/service/IIntroductionService.java

@@ -0,0 +1,15 @@
+package com.ruoyi.web.work.service;
+
+import java.util.List;
+import com.ruoyi.web.work.domain.Introduction;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * @author lsw
+ * @date 2024-07-10
+ */
+public interface IIntroductionService extends IService<Introduction>{
+    List<Introduction> selectList(Introduction introduction);
+
+    int updateStatus(Introduction introduction);
+}

+ 24 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/work/service/impl/HospitalDeptServiceImpl.java

@@ -0,0 +1,24 @@
+package com.ruoyi.web.work.service.impl;
+
+import java.util.List;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.ruoyi.web.work.mapper.HospitalDeptMapper;
+import com.ruoyi.web.work.domain.HospitalDept;
+import com.ruoyi.web.work.service.IHospitalDeptService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+
+/**
+ * @author lsw
+ * @date 2024-07-09
+ */
+@Service
+public class HospitalDeptServiceImpl extends ServiceImpl<HospitalDeptMapper, HospitalDept> implements IHospitalDeptService {
+    @Autowired
+    private HospitalDeptMapper hospitalDeptMapper;
+
+    @Override
+    public List<HospitalDept> selectList(HospitalDept hospitalDept) {
+        return hospitalDeptMapper.selectList(hospitalDept);
+    }
+}

+ 29 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/work/service/impl/IntroductionServiceImpl.java

@@ -0,0 +1,29 @@
+package com.ruoyi.web.work.service.impl;
+
+import java.util.List;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.ruoyi.web.work.mapper.IntroductionMapper;
+import com.ruoyi.web.work.domain.Introduction;
+import com.ruoyi.web.work.service.IIntroductionService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+
+/**
+ * @author lsw
+ * @date 2024-07-10
+ */
+@Service
+public class IntroductionServiceImpl extends ServiceImpl<IntroductionMapper, Introduction> implements IIntroductionService {
+    @Autowired
+    private IntroductionMapper introductionMapper;
+
+    @Override
+    public List<Introduction> selectList(Introduction introduction) {
+        return introductionMapper.selectList(introduction);
+    }
+
+    @Override
+    public int updateStatus(Introduction introduction) {
+        return introductionMapper.updateStatus(introduction);
+    }
+}

+ 16 - 0
ruoyi-admin/src/main/resources/mapper/work/HospitalDeptMapper.xml

@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.ruoyi.web.work.mapper.HospitalDeptMapper">
+    
+    <select id="selectList" resultType="com.ruoyi.web.work.domain.HospitalDept">
+        select * from tb_hospital_dept
+        <where>  
+            <if test="deptname != null  and deptname != ''"> and deptName like concat('%', #{deptname}, '%')</if>
+            <if test="deptdesc != null  and deptdesc != ''"> and deptDesc like concat('%', #{deptdesc}, '%')</if>
+            <if test="parentId != null  and parentId != ''"> and parent_id = #{parentId}</if>
+        </where>
+    </select>
+
+</mapper>

+ 24 - 0
ruoyi-admin/src/main/resources/mapper/work/IntroductionMapper.xml

@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.ruoyi.web.work.mapper.IntroductionMapper">
+
+    <select id="selectList" resultType="com.ruoyi.web.work.domain.Introduction">
+        select * from tb_introduction
+        <where>
+            <if test="title != null  and title != ''">and title like concat('%', #{title}, '%')</if>
+            <if test="context != null  and context != ''">and context like concat('%', #{context}, '%')</if>
+            <if test="status != null  and status != ''">and status = #{status}</if>
+        </where>
+    </select>
+
+    <update id="updateStatus" parameterType="com.ruoyi.web.work.domain.Introduction">
+        update tb_introduction
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="status != null">status = #{status},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+</mapper>