工具发布流程和使用申请流程细节优化

This commit is contained in:
liukang
2024-08-28 14:50:05 +08:00
parent 0e18f96534
commit a230a1c2d8
16 changed files with 222 additions and 132 deletions

View File

@@ -6,14 +6,14 @@ import com.rzdata.common.core.domain.entity.SysDept;
/**
* 部门管理 数据层
*
*
* @author jian
*/
public interface SysDeptMapper
{
/**
* 查询部门管理数据
*
*
* @param dept 部门信息
* @return 部门信息集合
*/
@@ -21,7 +21,7 @@ public interface SysDeptMapper
/**
* 根据角色ID查询部门树信息
*
*
* @param roleId 角色ID
* @param deptCheckStrictly 部门树选择项是否关联显示
* @return 选中部门列表
@@ -30,7 +30,7 @@ public interface SysDeptMapper
/**
* 根据部门ID查询信息
*
*
* @param deptId 部门ID
* @return 部门信息
*/
@@ -38,7 +38,7 @@ public interface SysDeptMapper
/**
* 根据ID查询所有子部门
*
*
* @param deptId 部门ID
* @return 部门列表
*/
@@ -46,7 +46,7 @@ public interface SysDeptMapper
/**
* 根据ID查询所有子部门正常状态
*
*
* @param deptId 部门ID
* @return 子部门数
*/
@@ -54,7 +54,7 @@ public interface SysDeptMapper
/**
* 是否存在子节点
*
*
* @param deptId 部门ID
* @return 结果
*/
@@ -62,7 +62,7 @@ public interface SysDeptMapper
/**
* 查询部门是否存在用户
*
*
* @param deptId 部门ID
* @return 结果
*/
@@ -70,7 +70,7 @@ public interface SysDeptMapper
/**
* 校验部门名称是否唯一
*
*
* @param deptName 部门名称
* @param parentId 父部门ID
* @return 结果
@@ -79,7 +79,7 @@ public interface SysDeptMapper
/**
* 新增部门信息
*
*
* @param dept 部门信息
* @return 结果
*/
@@ -87,7 +87,7 @@ public interface SysDeptMapper
/**
* 修改部门信息
*
*
* @param dept 部门信息
* @return 结果
*/
@@ -95,14 +95,14 @@ public interface SysDeptMapper
/**
* 修改所在部门正常状态
*
*
* @param deptIds 部门ID组
*/
public void updateDeptStatusNormal(Long[] deptIds);
/**
* 修改子元素关系
*
*
* @param depts 子元素
* @return 结果
*/
@@ -110,9 +110,11 @@ public interface SysDeptMapper
/**
* 删除部门管理信息
*
*
* @param deptId 部门ID
* @return 结果
*/
public int deleteDeptById(Long deptId);
String getDeptNameByDeptId(String deptId);
}

View File

@@ -6,14 +6,14 @@ import com.rzdata.common.core.domain.entity.SysDept;
/**
* 部门管理 服务层
*
*
* @author jian
*/
public interface ISysDeptService
{
/**
* 查询部门管理数据
*
*
* @param dept 部门信息
* @return 部门信息集合
*/
@@ -21,7 +21,7 @@ public interface ISysDeptService
/**
* 查询部门树结构信息
*
*
* @param dept 部门信息
* @return 部门树信息集合
*/
@@ -29,7 +29,7 @@ public interface ISysDeptService
/**
* 构建前端所需要树结构
*
*
* @param depts 部门列表
* @return 树结构列表
*/
@@ -37,7 +37,7 @@ public interface ISysDeptService
/**
* 构建前端所需要下拉树结构
*
*
* @param depts 部门列表
* @return 下拉树结构列表
*/
@@ -45,7 +45,7 @@ public interface ISysDeptService
/**
* 根据角色ID查询部门树信息
*
*
* @param roleId 角色ID
* @return 选中部门列表
*/
@@ -53,7 +53,7 @@ public interface ISysDeptService
/**
* 根据部门ID查询信息
*
*
* @param deptId 部门ID
* @return 部门信息
*/
@@ -61,7 +61,7 @@ public interface ISysDeptService
/**
* 根据ID查询所有子部门正常状态
*
*
* @param deptId 部门ID
* @return 子部门数
*/
@@ -69,7 +69,7 @@ public interface ISysDeptService
/**
* 是否存在部门子节点
*
*
* @param deptId 部门ID
* @return 结果
*/
@@ -77,7 +77,7 @@ public interface ISysDeptService
/**
* 查询部门是否存在用户
*
*
* @param deptId 部门ID
* @return 结果 true 存在 false 不存在
*/
@@ -85,7 +85,7 @@ public interface ISysDeptService
/**
* 校验部门名称是否唯一
*
*
* @param dept 部门信息
* @return 结果
*/
@@ -93,14 +93,14 @@ public interface ISysDeptService
/**
* 校验部门是否有数据权限
*
*
* @param deptId 部门id
*/
public void checkDeptDataScope(Long deptId);
/**
* 新增保存部门信息
*
*
* @param dept 部门信息
* @return 结果
*/
@@ -108,7 +108,7 @@ public interface ISysDeptService
/**
* 修改保存部门信息
*
*
* @param dept 部门信息
* @return 结果
*/
@@ -116,9 +116,11 @@ public interface ISysDeptService
/**
* 删除部门管理信息
*
*
* @param deptId 部门ID
* @return 结果
*/
public int deleteDeptById(Long deptId);
String getDeptName(String deptId);
}

View File

@@ -23,7 +23,7 @@ import com.rzdata.system.service.ISysDeptService;
/**
* 部门管理 服务实现
*
*
* @author ruoyi
*/
@Service
@@ -37,7 +37,7 @@ public class SysDeptServiceImpl implements ISysDeptService
/**
* 查询部门管理数据
*
*
* @param dept 部门信息
* @return 部门信息集合
*/
@@ -50,7 +50,7 @@ public class SysDeptServiceImpl implements ISysDeptService
/**
* 查询部门树结构信息
*
*
* @param dept 部门信息
* @return 部门树信息集合
*/
@@ -63,7 +63,7 @@ public class SysDeptServiceImpl implements ISysDeptService
/**
* 构建前端所需要树结构
*
*
* @param depts 部门列表
* @return 树结构列表
*/
@@ -90,7 +90,7 @@ public class SysDeptServiceImpl implements ISysDeptService
/**
* 构建前端所需要下拉树结构
*
*
* @param depts 部门列表
* @return 下拉树结构列表
*/
@@ -103,7 +103,7 @@ public class SysDeptServiceImpl implements ISysDeptService
/**
* 根据角色ID查询部门树信息
*
*
* @param roleId 角色ID
* @return 选中部门列表
*/
@@ -116,7 +116,7 @@ public class SysDeptServiceImpl implements ISysDeptService
/**
* 根据部门ID查询信息
*
*
* @param deptId 部门ID
* @return 部门信息
*/
@@ -128,7 +128,7 @@ public class SysDeptServiceImpl implements ISysDeptService
/**
* 根据ID查询所有子部门正常状态
*
*
* @param deptId 部门ID
* @return 子部门数
*/
@@ -140,7 +140,7 @@ public class SysDeptServiceImpl implements ISysDeptService
/**
* 是否存在子节点
*
*
* @param deptId 部门ID
* @return 结果
*/
@@ -153,7 +153,7 @@ public class SysDeptServiceImpl implements ISysDeptService
/**
* 查询部门是否存在用户
*
*
* @param deptId 部门ID
* @return 结果 true 存在 false 不存在
*/
@@ -166,7 +166,7 @@ public class SysDeptServiceImpl implements ISysDeptService
/**
* 校验部门名称是否唯一
*
*
* @param dept 部门信息
* @return 结果
*/
@@ -184,7 +184,7 @@ public class SysDeptServiceImpl implements ISysDeptService
/**
* 校验部门是否有数据权限
*
*
* @param deptId 部门id
*/
@Override
@@ -204,7 +204,7 @@ public class SysDeptServiceImpl implements ISysDeptService
/**
* 新增保存部门信息
*
*
* @param dept 部门信息
* @return 结果
*/
@@ -223,7 +223,7 @@ public class SysDeptServiceImpl implements ISysDeptService
/**
* 修改保存部门信息
*
*
* @param dept 部门信息
* @return 结果
*/
@@ -251,7 +251,7 @@ public class SysDeptServiceImpl implements ISysDeptService
/**
* 修改该部门的父级部门状态
*
*
* @param dept 当前部门
*/
private void updateParentDeptStatusNormal(SysDept dept)
@@ -263,7 +263,7 @@ public class SysDeptServiceImpl implements ISysDeptService
/**
* 修改子元素关系
*
*
* @param deptId 被修改的部门ID
* @param newAncestors 新的父ID集合
* @param oldAncestors 旧的父ID集合
@@ -283,7 +283,7 @@ public class SysDeptServiceImpl implements ISysDeptService
/**
* 删除部门管理信息
*
*
* @param deptId 部门ID
* @return 结果
*/
@@ -335,4 +335,9 @@ public class SysDeptServiceImpl implements ISysDeptService
{
return getChildList(list, t).size() > 0;
}
@Override
public String getDeptName(String deptId){
return deptMapper.getDeptNameByDeptId(deptId);
}
}

View File

@@ -21,12 +21,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectDeptVo">
select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.phone, d.email, d.status, d.del_flag, d.create_by, d.create_time
select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.phone, d.email, d.status, d.del_flag, d.create_by, d.create_time
from sys_dept d
</sql>
<select id="selectDeptList" parameterType="SysDept" resultMap="SysDeptResult">
<include refid="selectDeptVo"/>
where d.del_flag = '0'
@@ -46,7 +46,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
${params.dataScope}
order by d.parent_id, d.order_num
</select>
<select id="selectDeptListByRoleId" resultType="Long">
select d.dept_id
from sys_dept d
@@ -57,36 +57,36 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</if>
order by d.parent_id, d.order_num
</select>
<select id="selectDeptById" parameterType="Long" resultMap="SysDeptResult">
select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.phone, d.email, d.status,
(select dept_name from sys_dept where dept_id = d.parent_id) parent_name
from sys_dept d
where d.dept_id = #{deptId}
</select>
<select id="checkDeptExistUser" parameterType="Long" resultType="int">
select count(1) from sys_user where dept_id = #{deptId} and del_flag = '0'
</select>
<select id="hasChildByDeptId" parameterType="Long" resultType="int">
select count(1) from sys_dept
where del_flag = '0' and parent_id = #{deptId} limit 1
</select>
<select id="selectChildrenDeptById" parameterType="Long" resultMap="SysDeptResult">
select * from sys_dept where find_in_set(#{deptId}, ancestors)
</select>
<select id="selectNormalChildrenDeptById" parameterType="Long" resultType="int">
select count(*) from sys_dept where status = 0 and del_flag = '0' and find_in_set(#{deptId}, ancestors)
</select>
<select id="checkDeptNameUnique" resultMap="SysDeptResult">
<include refid="selectDeptVo"/>
where dept_name=#{deptName} and parent_id = #{parentId} and del_flag = '0' limit 1
</select>
<insert id="insertDept" parameterType="SysDept">
insert into sys_dept(
<if test="deptId != null and deptId != 0">dept_id,</if>
@@ -114,7 +114,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
sysdate()
)
</insert>
<update id="updateDept" parameterType="SysDept">
update sys_dept
<set>
@@ -131,7 +131,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</set>
where dept_id = #{deptId}
</update>
<update id="updateDeptChildren" parameterType="java.util.List">
update sys_dept set ancestors =
<foreach collection="depts" item="item" index="index"
@@ -144,16 +144,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{item.deptId}
</foreach>
</update>
<update id="updateDeptStatusNormal" parameterType="Long">
update sys_dept set status = '0' where dept_id in
update sys_dept set status = '0' where dept_id in
<foreach collection="array" item="deptId" open="(" separator="," close=")">
#{deptId}
</foreach>
</update>
<delete id="deleteDeptById" parameterType="Long">
update sys_dept set del_flag = '2' where dept_id = #{deptId}
</delete>
</mapper>
<select id="getDeptNameByDeptId" resultType="string" >
select dept_name from sys_dept where dept_id = #{deptId}
</select>
</mapper>