mojinxia пре 1 месец
родитељ
комит
878a549a3b

+ 35 - 7
back-ui/src/views/dz/agent/index.vue

@@ -76,7 +76,8 @@
                           <el-table-column label="归属机构" align="center" key="deptName" prop="dept.deptName" :show-overflow-tooltip="true" />
                           <el-table-column label="联系电话" align="center" prop="phonenumber" />
                           <!--      <el-table-column label="上级代理商ID" align="center" prop="parentId" />-->
-                          <el-table-column label="学校/校区" align="center" prop="schools" />
+<!--                          <el-table-column label="学校/校区" align="center" prop="schools" />-->
+                          <el-table-column label="学校/校区" align="center" prop="schoolName" />
                           <el-table-column label="备注" align="center" prop="remark" />
                           <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
                               <template #default="scope">
@@ -95,7 +96,7 @@
     <el-dialog :title="title" v-model="open" width="500px" append-to-body>
       <el-form ref="agentRef" :model="form" :rules="rules" label-width="80px">
         <el-form-item label="用户ID" prop="userId">
-          <el-input v-model="form.userId" placeholder="请输入用户ID" />
+          <el-input v-model="form.userId" placeholder="请输入用户ID" disabled/>
         </el-form-item>
           <el-form-item label="代理商" prop="name">
               <el-input v-model="form.name" placeholder="请输入代理商" />
@@ -117,9 +118,20 @@
             check-strictly
           />
         </el-form-item>
-        <el-form-item label="负责校区" prop="schools">
-          <el-input v-model="form.schools" placeholder="请输入负责校区" />
-        </el-form-item>
+<!--        <el-form-item label="负责校区" prop="schools">-->
+<!--          <el-input v-model="form.schools" placeholder="请输入负责校区" />-->
+<!--        </el-form-item>-->
+
+          <el-form-item label="关联校区" prop="classIds">
+              <el-select v-model="form.schoolIds" multiple placeholder="请选择校区" style="width: 100%">
+                  <el-option
+                          v-for="item in schoolOptions"
+                          :key="item.id"
+                          :label="item.name"
+                          :value="item.id"
+                  />
+              </el-select>
+          </el-form-item>
         <el-form-item label="备注" prop="remark">
           <el-input v-model="form.remark" placeholder="请输入备注" />
         </el-form-item>
@@ -156,6 +168,7 @@ const refreshTable = ref(true)
 const deptName = ref("")
 const deptOptions = ref(undefined)
 const enabledDeptOptions = ref(undefined)
+const schoolOptions = ref(undefined)
 
 const data = reactive({
   form: {},
@@ -165,7 +178,8 @@ const data = reactive({
     deptId: null,
     phonenumber: null,
     parentId: null,
-    schools: null,
+    // schools: null,
+    schoolIds: []
   },
   rules: {
   }
@@ -245,7 +259,8 @@ function reset() {
     name: null,
     phonenumber: null,
     parentId: null,
-    schools: null,
+    // schools: null,
+    schoolIds: [],
     remark: null
   }
   proxy.resetForm("agentRef")
@@ -272,6 +287,8 @@ function resetQuery() {
 function handleAdd(row) {
   reset()
   getTreeselect()
+  //处理学校
+  getSchools(row)
   if (row != null && row.agentId) {
     form.value.parentId = row.agentId
   } else {
@@ -299,11 +316,22 @@ async function handleUpdate(row) {
   }
   getAgent(row.agentId).then(response => {
     form.value = response.data
+    //处理学校
+    getSchools(row)
+
     open.value = true
     title.value = "修改机构代理"
   })
 }
 
+function getSchools(row){
+    //处理学校
+    const deptId = row.deptId;
+    listAllSchool(deptId).then(response => {
+        schoolOptions.value= response.data
+    })
+}
+
 /** 提交按钮 */
 function submitForm() {
   proxy.$refs["agentRef"].validate(valid => {

+ 50 - 2
ie-admin/src/main/java/com/ruoyi/web/controller/dz/DzAgentController.java

@@ -1,7 +1,16 @@
 package com.ruoyi.web.controller.dz;
 
+import java.util.Arrays;
 import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.stream.Collectors;
 import javax.servlet.http.HttpServletResponse;
+
+import cn.hutool.core.collection.CollectionUtil;
+import com.ruoyi.common.utils.StringUtils;
+import com.ruoyi.dz.domain.DzSchool;
+import com.ruoyi.dz.service.IDzSchoolService;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -22,7 +31,7 @@ import com.ruoyi.common.utils.poi.ExcelUtil;
 
 /**
  * 机构代理Controller
- * 
+ *
  * @author ruoyi
  * @date 2025-09-12
  */
@@ -32,6 +41,8 @@ public class DzAgentController extends BaseController
 {
     @Autowired
     private IDzAgentService dzAgentService;
+    @Autowired
+    private IDzSchoolService schoolService;
 
     /**
      * 查询机构代理列表
@@ -41,6 +52,32 @@ public class DzAgentController extends BaseController
     public AjaxResult list(DzAgent dzAgent)
     {
         List<DzAgent> list = dzAgentService.selectDzAgentList(dzAgent);
+        //处理关联学校的显示
+        List<Long> distinctSchoolIds = list.stream()
+                .map(DzAgent::getSchoolIds)
+                .filter(Objects::nonNull)        // 过滤null数组
+                .filter(array -> array.length > 0) // 过滤空数组
+                .flatMap(Arrays::stream).filter(Objects::nonNull)        // 过滤数组中的null元素
+                .distinct()
+                .collect(Collectors.toList());
+        //查询学校名称
+        if (CollectionUtil.isNotEmpty(distinctSchoolIds)){
+            Map<Long, DzSchool> schoolMap = schoolService.selectDzSchoolListByIds(distinctSchoolIds).stream().collect(Collectors.toMap(DzSchool::getId, school -> school));
+            for (DzAgent agent : list) {
+                if (agent.getSchoolIds() != null&&agent.getSchoolIds().length>0) {
+                    String schoolName = Arrays.stream(agent.getSchoolIds())
+                            .filter(Objects::nonNull)  // 过滤null值
+                            .map(schoolId -> schoolMap.get(schoolId))  // 根据ID获取学校对象
+                            .filter(Objects::nonNull)  // 过滤map中不存在的学校
+                            .map(DzSchool::getName)    // 获取学校名称
+                            .filter(name -> name != null && !name.trim().isEmpty())  // 过滤空名称
+                            .collect(Collectors.joining(", "));  // 用逗号连接
+
+                    agent.setSchoolName(schoolName);
+                }
+            }
+        }
+
         return success(list);
     }
 
@@ -75,6 +112,7 @@ public class DzAgentController extends BaseController
     @PostMapping
     public AjaxResult add(@RequestBody DzAgent dzAgent)
     {
+        setSchools(dzAgent);
         return toAjax(dzAgentService.insertDzAgent(dzAgent));
     }
 
@@ -86,15 +124,25 @@ public class DzAgentController extends BaseController
     @PutMapping
     public AjaxResult edit(@RequestBody DzAgent dzAgent)
     {
+        setSchools(dzAgent);
         return toAjax(dzAgentService.updateDzAgent(dzAgent));
     }
 
+    private void setSchools(DzAgent dzAgent){
+        String schools = dzAgent.getSchools();
+        Long[] schoolIds = dzAgent.getSchoolIds();
+        if (null!=schoolIds&&schoolIds.length>0){
+            schools = Arrays.stream(schoolIds).filter(Objects::nonNull).map(String::valueOf) .collect(Collectors.joining(","));
+            dzAgent.setSchools(schools);
+        }
+    }
+
     /**
      * 删除机构代理
      */
     @PreAuthorize("@ss.hasPermi('dz:agent:remove')")
     @Log(title = "机构代理", businessType = BusinessType.DELETE)
-	@DeleteMapping("/{agentIds}")
+    @DeleteMapping("/{agentIds}")
     public AjaxResult remove(@PathVariable Long[] agentIds)
     {
         return toAjax(dzAgentService.deleteDzAgentByAgentIds(agentIds));

+ 24 - 0
ie-system/src/main/java/com/ruoyi/dz/domain/DzAgent.java

@@ -1,11 +1,16 @@
 package com.ruoyi.dz.domain;
 
 import com.ruoyi.common.core.domain.entity.SysDept;
+import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 import org.apache.commons.lang3.builder.ToStringStyle;
 import com.ruoyi.common.annotation.Excel;
 import com.ruoyi.common.core.domain.TreeEntity;
 
+import java.util.Arrays;
+import java.util.Objects;
+import java.util.stream.Collectors;
+
 /**
  * 机构代理对象 dz_agent
  *
@@ -40,11 +45,30 @@ public class DzAgent extends TreeEntity
     /** 负责校区列表 */
     @Excel(name = "负责校区列表")
     private String schools;
+    private Long[] schoolIds;
+    private String schoolName;
 
     private String username;
 
     private SysDept dept;
 
+    public String getSchoolName() {
+        return schoolName;
+    }
+
+    public void setSchoolName(String schoolName) {
+        this.schoolName = schoolName;
+    }
+
+    public Long[] getSchoolIds() {
+        return (null==schoolIds||schoolIds.length==0)?(StringUtils.isNotEmpty(schools)?
+                Arrays.stream(schools.split(",")).map(String::trim).filter(s -> !s.isEmpty()).map(Long::valueOf).toArray(Long[]::new):new Long[0]):schoolIds;
+    }
+
+    public void setSchoolIds(Long[] schoolIds) {
+        this.schoolIds = schoolIds;
+    }
+
     public SysDept getDept() {
         return dept;
     }

+ 9 - 9
ie-system/src/main/java/com/ruoyi/dz/mapper/DzSchoolMapper.java

@@ -5,15 +5,15 @@ import com.ruoyi.dz.domain.DzSchool;
 
 /**
  * 机构校区Mapper接口
- * 
+ *
  * @author ruoyi
  * @date 2025-09-12
  */
-public interface DzSchoolMapper 
+public interface DzSchoolMapper
 {
     /**
      * 查询机构校区
-     * 
+     *
      * @param id 机构校区主键
      * @return 机构校区
      */
@@ -21,15 +21,15 @@ public interface DzSchoolMapper
 
     /**
      * 查询机构校区列表
-     * 
+     *
      * @param dzSchool 机构校区
      * @return 机构校区集合
      */
     public List<DzSchool> selectDzSchoolList(DzSchool dzSchool);
-
+    public List<DzSchool> selectDzSchoolListByIds(List<Long> schoolIds);
     /**
      * 新增机构校区
-     * 
+     *
      * @param dzSchool 机构校区
      * @return 结果
      */
@@ -37,7 +37,7 @@ public interface DzSchoolMapper
 
     /**
      * 修改机构校区
-     * 
+     *
      * @param dzSchool 机构校区
      * @return 结果
      */
@@ -45,7 +45,7 @@ public interface DzSchoolMapper
 
     /**
      * 删除机构校区
-     * 
+     *
      * @param id 机构校区主键
      * @return 结果
      */
@@ -53,7 +53,7 @@ public interface DzSchoolMapper
 
     /**
      * 批量删除机构校区
-     * 
+     *
      * @param ids 需要删除的数据主键集合
      * @return 结果
      */

+ 9 - 9
ie-system/src/main/java/com/ruoyi/dz/service/IDzSchoolService.java

@@ -5,15 +5,15 @@ import com.ruoyi.dz.domain.DzSchool;
 
 /**
  * 机构校区Service接口
- * 
+ *
  * @author ruoyi
  * @date 2025-09-12
  */
-public interface IDzSchoolService 
+public interface IDzSchoolService
 {
     /**
      * 查询机构校区
-     * 
+     *
      * @param id 机构校区主键
      * @return 机构校区
      */
@@ -21,15 +21,15 @@ public interface IDzSchoolService
 
     /**
      * 查询机构校区列表
-     * 
+     *
      * @param dzSchool 机构校区
      * @return 机构校区集合
      */
     public List<DzSchool> selectDzSchoolList(DzSchool dzSchool);
-
+    public List<DzSchool> selectDzSchoolListByIds(List<Long> schoolIds);
     /**
      * 新增机构校区
-     * 
+     *
      * @param dzSchool 机构校区
      * @return 结果
      */
@@ -37,7 +37,7 @@ public interface IDzSchoolService
 
     /**
      * 修改机构校区
-     * 
+     *
      * @param dzSchool 机构校区
      * @return 结果
      */
@@ -45,7 +45,7 @@ public interface IDzSchoolService
 
     /**
      * 批量删除机构校区
-     * 
+     *
      * @param ids 需要删除的机构校区主键集合
      * @return 结果
      */
@@ -53,7 +53,7 @@ public interface IDzSchoolService
 
     /**
      * 删除机构校区信息
-     * 
+     *
      * @param id 机构校区主键
      * @return 结果
      */

+ 14 - 8
ie-system/src/main/java/com/ruoyi/dz/service/impl/DzSchoolServiceImpl.java

@@ -10,19 +10,19 @@ import com.ruoyi.dz.service.IDzSchoolService;
 
 /**
  * 机构校区Service业务层处理
- * 
+ *
  * @author ruoyi
  * @date 2025-09-12
  */
 @Service
-public class DzSchoolServiceImpl implements IDzSchoolService 
+public class DzSchoolServiceImpl implements IDzSchoolService
 {
     @Autowired
     private DzSchoolMapper dzSchoolMapper;
 
     /**
      * 查询机构校区
-     * 
+     *
      * @param id 机构校区主键
      * @return 机构校区
      */
@@ -34,7 +34,7 @@ public class DzSchoolServiceImpl implements IDzSchoolService
 
     /**
      * 查询机构校区列表
-     * 
+     *
      * @param dzSchool 机构校区
      * @return 机构校区
      */
@@ -44,9 +44,15 @@ public class DzSchoolServiceImpl implements IDzSchoolService
         return dzSchoolMapper.selectDzSchoolList(dzSchool);
     }
 
+    @Override
+    public List<DzSchool> selectDzSchoolListByIds(List<Long> schoolIds)
+    {
+        return dzSchoolMapper.selectDzSchoolListByIds(schoolIds);
+    }
+
     /**
      * 新增机构校区
-     * 
+     *
      * @param dzSchool 机构校区
      * @return 结果
      */
@@ -59,7 +65,7 @@ public class DzSchoolServiceImpl implements IDzSchoolService
 
     /**
      * 修改机构校区
-     * 
+     *
      * @param dzSchool 机构校区
      * @return 结果
      */
@@ -72,7 +78,7 @@ public class DzSchoolServiceImpl implements IDzSchoolService
 
     /**
      * 批量删除机构校区
-     * 
+     *
      * @param ids 需要删除的机构校区主键
      * @return 结果
      */
@@ -84,7 +90,7 @@ public class DzSchoolServiceImpl implements IDzSchoolService
 
     /**
      * 删除机构校区信息
-     * 
+     *
      * @param id 机构校区主键
      * @return 结果
      */

+ 1 - 1
ie-system/src/main/resources/mapper/dz/DzAgentMapper.xml

@@ -53,7 +53,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         where t1.agent_id = #{agentId}
     </select>
 
-    <insert id="insertDzAgent" parameterType="DzAgent" useGeneratedKeys="true" keyProperty="agent_id">
+    <insert id="insertDzAgent" parameterType="DzAgent" useGeneratedKeys="true" keyProperty="agentId">
         insert into dz_agent
         <trim prefix="(" suffix=")" suffixOverrides=",">
             <if test="deptId != null">dept_id,</if>

+ 10 - 0
ie-system/src/main/resources/mapper/dz/DzSchoolMapper.xml

@@ -52,6 +52,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </where>
     </select>
 
+    <select id="selectDzSchoolListByIds" parameterType="list" resultMap="DzSchoolResult">
+        <include refid="selectDzSchoolVo"/>
+        WHERE 1=1
+        AND t1.id IN
+        <foreach collection="list" item="id" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+        ORDER BY t1.id ASC
+    </select>
+
     <select id="selectDzSchoolById" parameterType="Long" resultMap="DzSchoolResult">
         <include refid="selectDzSchoolVo"/>
         where t1.id = #{id}

+ 29 - 29
sql/v_0.2_base.sql

@@ -1,38 +1,38 @@
 -- ----------------------------
--- 1、部门
+-- 1、机构
 -- ----------------------------
 drop table if exists sys_dept;
 create table sys_dept (
-  dept_id           bigint(20)      not null auto_increment    comment '部门id',
-  parent_id         bigint(20)      default 0                  comment '父部门id',
+  dept_id           bigint(20)      not null auto_increment    comment '机构id',
+  parent_id         bigint(20)      default 0                  comment '父机构id',
   ancestors         varchar(50)     default ''                 comment '祖级列表',
-  dept_name         varchar(30)     default ''                 comment '部门名称',
+  dept_name         varchar(30)     default ''                 comment '机构名称',
   order_num         int(4)          default 0                  comment '显示顺序',
   leader            varchar(20)     default null               comment '负责人',
   phone             varchar(11)     default null               comment '联系电话',
   email             varchar(50)     default null               comment '邮箱',
-  status            char(1)         default '0'                comment '部门状态(0正常 1停用)',
+  status            char(1)         default '0'                comment '机构状态(0正常 1停用)',
   del_flag          char(1)         default '0'                comment '删除标志(0代表存在 2代表删除)',
   create_by         varchar(64)     default ''                 comment '创建者',
   create_time 	    datetime                                   comment '创建时间',
   update_by         varchar(64)     default ''                 comment '更新者',
   update_time       datetime                                   comment '更新时间',
   primary key (dept_id)
-) engine=innodb auto_increment=200 comment = '部门表';
+) engine=innodb auto_increment=200 comment = '机构表';
 
 -- ----------------------------
--- 初始化-部门表数据
+-- 初始化-机构表数据
 -- ----------------------------
 insert into sys_dept values(100,  0,   '0',          '若依科技',   0, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', sysdate(), '', null);
 insert into sys_dept values(101,  100, '0,100',      '深圳总公司', 1, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', sysdate(), '', null);
 insert into sys_dept values(102,  100, '0,100',      '长沙分公司', 2, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', sysdate(), '', null);
-insert into sys_dept values(103,  101, '0,100,101',  '研发部门',   1, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', sysdate(), '', null);
-insert into sys_dept values(104,  101, '0,100,101',  '市场部门',   2, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', sysdate(), '', null);
-insert into sys_dept values(105,  101, '0,100,101',  '测试部门',   3, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', sysdate(), '', null);
-insert into sys_dept values(106,  101, '0,100,101',  '财务部门',   4, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', sysdate(), '', null);
-insert into sys_dept values(107,  101, '0,100,101',  '运维部门',   5, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', sysdate(), '', null);
-insert into sys_dept values(108,  102, '0,100,102',  '市场部门',   1, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', sysdate(), '', null);
-insert into sys_dept values(109,  102, '0,100,102',  '财务部门',   2, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', sysdate(), '', null);
+insert into sys_dept values(103,  101, '0,100,101',  '研发机构',   1, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', sysdate(), '', null);
+insert into sys_dept values(104,  101, '0,100,101',  '市场机构',   2, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', sysdate(), '', null);
+insert into sys_dept values(105,  101, '0,100,101',  '测试机构',   3, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', sysdate(), '', null);
+insert into sys_dept values(106,  101, '0,100,101',  '财务机构',   4, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', sysdate(), '', null);
+insert into sys_dept values(107,  101, '0,100,101',  '运维机构',   5, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', sysdate(), '', null);
+insert into sys_dept values(108,  102, '0,100,102',  '市场机构',   1, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', sysdate(), '', null);
+insert into sys_dept values(109,  102, '0,100,102',  '财务机构',   2, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', sysdate(), '', null);
 
 
 -- ----------------------------
@@ -41,7 +41,7 @@ insert into sys_dept values(109,  102, '0,100,102',  '财务部门',   2, '若
 drop table if exists sys_user;
 create table sys_user (
   user_id           bigint(20)      not null auto_increment    comment '用户ID',
-  dept_id           bigint(20)      default null               comment '部门ID',
+  dept_id           bigint(20)      default null               comment '机构ID',
   user_name         varchar(30)     not null                   comment '用户账号',
   nick_name         varchar(30)     not null                   comment '用户昵称',
   user_type         varchar(2)      default '00'               comment '用户类型(00系统用户)',
@@ -107,9 +107,9 @@ create table sys_role (
   role_name            varchar(30)     not null                   comment '角色名称',
   role_key             varchar(100)    not null                   comment '角色权限字符串',
   role_sort            int(4)          not null                   comment '显示顺序',
-  data_scope           char(1)         default '1'                comment '数据范围(1:全部数据权限 2:自定数据权限 3:本部门数据权限 4:本部门及以下数据权限)',
+  data_scope           char(1)         default '1'                comment '数据范围(1:全部数据权限 2:自定数据权限 3:本机构数据权限 4:本机构及以下数据权限)',
   menu_check_strictly  tinyint(1)      default 1                  comment '菜单树选择项是否关联显示',
-  dept_check_strictly  tinyint(1)      default 1                  comment '部门树选择项是否关联显示',
+  dept_check_strictly  tinyint(1)      default 1                  comment '机构树选择项是否关联显示',
   status               char(1)         not null                   comment '角色状态(0正常 1停用)',
   del_flag             char(1)         default '0'                comment '删除标志(0代表存在 2代表删除)',
   create_by            varchar(64)     default ''                 comment '创建者',
@@ -167,7 +167,7 @@ insert into sys_menu values('4', '若依官网', '0', '4', 'http://ruoyi.vip', n
 insert into sys_menu values('100',  '用户管理', '1',   '1', 'user',       'system/user/index',        '', '', 1, 0, 'C', '0', '0', 'system:user:list',        'user',          'admin', sysdate(), '', null, '用户管理菜单');
 insert into sys_menu values('101',  '角色管理', '1',   '2', 'role',       'system/role/index',        '', '', 1, 0, 'C', '0', '0', 'system:role:list',        'peoples',       'admin', sysdate(), '', null, '角色管理菜单');
 insert into sys_menu values('102',  '菜单管理', '1',   '3', 'menu',       'system/menu/index',        '', '', 1, 0, 'C', '0', '0', 'system:menu:list',        'tree-table',    'admin', sysdate(), '', null, '菜单管理菜单');
-insert into sys_menu values('103',  '部门管理', '1',   '4', 'dept',       'system/dept/index',        '', '', 1, 0, 'C', '0', '0', 'system:dept:list',        'tree',          'admin', sysdate(), '', null, '部门管理菜单');
+insert into sys_menu values('103',  '机构管理', '1',   '4', 'dept',       'system/dept/index',        '', '', 1, 0, 'C', '0', '0', 'system:dept:list',        'tree',          'admin', sysdate(), '', null, '机构管理菜单');
 insert into sys_menu values('104',  '岗位管理', '1',   '5', 'post',       'system/post/index',        '', '', 1, 0, 'C', '0', '0', 'system:post:list',        'post',          'admin', sysdate(), '', null, '岗位管理菜单');
 insert into sys_menu values('105',  '字典管理', '1',   '6', 'dict',       'system/dict/index',        '', '', 1, 0, 'C', '0', '0', 'system:dict:list',        'dict',          'admin', sysdate(), '', null, '字典管理菜单');
 insert into sys_menu values('106',  '参数设置', '1',   '7', 'config',     'system/config/index',      '', '', 1, 0, 'C', '0', '0', 'system:config:list',      'edit',          'admin', sysdate(), '', null, '参数设置菜单');
@@ -204,11 +204,11 @@ insert into sys_menu values('1012', '菜单查询', '102', '1',  '', '', '', '',
 insert into sys_menu values('1013', '菜单新增', '102', '2',  '', '', '', '', 1, 0, 'F', '0', '0', 'system:menu:add',            '#', 'admin', sysdate(), '', null, '');
 insert into sys_menu values('1014', '菜单修改', '102', '3',  '', '', '', '', 1, 0, 'F', '0', '0', 'system:menu:edit',           '#', 'admin', sysdate(), '', null, '');
 insert into sys_menu values('1015', '菜单删除', '102', '4',  '', '', '', '', 1, 0, 'F', '0', '0', 'system:menu:remove',         '#', 'admin', sysdate(), '', null, '');
--- 部门管理按钮
-insert into sys_menu values('1016', '部门查询', '103', '1',  '', '', '', '', 1, 0, 'F', '0', '0', 'system:dept:query',          '#', 'admin', sysdate(), '', null, '');
-insert into sys_menu values('1017', '部门新增', '103', '2',  '', '', '', '', 1, 0, 'F', '0', '0', 'system:dept:add',            '#', 'admin', sysdate(), '', null, '');
-insert into sys_menu values('1018', '部门修改', '103', '3',  '', '', '', '', 1, 0, 'F', '0', '0', 'system:dept:edit',           '#', 'admin', sysdate(), '', null, '');
-insert into sys_menu values('1019', '部门删除', '103', '4',  '', '', '', '', 1, 0, 'F', '0', '0', 'system:dept:remove',         '#', 'admin', sysdate(), '', null, '');
+-- 机构管理按钮
+insert into sys_menu values('1016', '机构查询', '103', '1',  '', '', '', '', 1, 0, 'F', '0', '0', 'system:dept:query',          '#', 'admin', sysdate(), '', null, '');
+insert into sys_menu values('1017', '机构新增', '103', '2',  '', '', '', '', 1, 0, 'F', '0', '0', 'system:dept:add',            '#', 'admin', sysdate(), '', null, '');
+insert into sys_menu values('1018', '机构修改', '103', '3',  '', '', '', '', 1, 0, 'F', '0', '0', 'system:dept:edit',           '#', 'admin', sysdate(), '', null, '');
+insert into sys_menu values('1019', '机构删除', '103', '4',  '', '', '', '', 1, 0, 'F', '0', '0', 'system:dept:remove',         '#', 'admin', sysdate(), '', null, '');
 -- 岗位管理按钮
 insert into sys_menu values('1020', '岗位查询', '104', '1',  '', '', '', '', 1, 0, 'F', '0', '0', 'system:post:query',          '#', 'admin', sysdate(), '', null, '');
 insert into sys_menu values('1021', '岗位新增', '104', '2',  '', '', '', '', 1, 0, 'F', '0', '0', 'system:post:add',            '#', 'admin', sysdate(), '', null, '');
@@ -378,17 +378,17 @@ insert into sys_role_menu values ('2', '1059');
 insert into sys_role_menu values ('2', '1060');
 
 -- ----------------------------
--- 8、角色和部门关联表  角色1-N部门
+-- 8、角色和机构关联表  角色1-N机构
 -- ----------------------------
 drop table if exists sys_role_dept;
 create table sys_role_dept (
   role_id   bigint(20) not null comment '角色ID',
-  dept_id   bigint(20) not null comment '部门ID',
+  dept_id   bigint(20) not null comment '机构ID',
   primary key(role_id, dept_id)
-) engine=innodb comment = '角色和部门关联表';
+) engine=innodb comment = '角色和机构关联表';
 
 -- ----------------------------
--- 初始化-角色和部门关联表数据
+-- 初始化-角色和机构关联表数据
 -- ----------------------------
 insert into sys_role_dept values ('2', '100');
 insert into sys_role_dept values ('2', '101');
@@ -425,7 +425,7 @@ create table sys_oper_log (
   request_method    varchar(10)     default ''                 comment '请求方式',
   operator_type     int(1)          default 0                  comment '操作类别(0其它 1后台用户 2手机端用户)',
   oper_name         varchar(50)     default ''                 comment '操作人员',
-  dept_name         varchar(50)     default ''                 comment '部门名称',
+  dept_name         varchar(50)     default ''                 comment '机构名称',
   oper_url          varchar(255)    default ''                 comment '请求URL',
   oper_ip           varchar(128)    default ''                 comment '主机地址',
   oper_location     varchar(255)    default ''                 comment '操作地点',
@@ -701,4 +701,4 @@ create table gen_table_column (
   update_by         varchar(64)     default ''                 comment '更新者',
   update_time       datetime                                   comment '更新时间',
   primary key (column_id)
-) engine=innodb auto_increment=1 comment = '代码生成业务表字段';
+) engine=innodb auto_increment=1 comment = '代码生成业务表字段';