feat(hrm): 增加项目关联功能到各类申请模块

- 在请假申请、报销申请、用印申请和出差申请中添加项目ID字段
- 扩展VO类以包含完整的项目信息展示字段
- 新增带项目信息查询的数据库映射方法
- 更新MyBatis XML配置文件中的结果映射和SQL查询
- 修改服务层实现以支持关联项目信息的查询操作
- 为各种申请类型的列表和分页查询增加项目过滤条件
This commit is contained in:
2026-02-05 13:28:52 +08:00
parent a29415d9a0
commit 8628a2fb83
28 changed files with 807 additions and 20 deletions

View File

@@ -4,6 +4,7 @@
<resultMap id="BaseResultMap" type="com.ruoyi.hrm.domain.HrmLeaveReq">
<id column="biz_id" property="bizId"/>
<result column="emp_id" property="empId"/>
<result column="project_id" property="projectId"/>
<result column="leave_type" property="leaveType"/>
<result column="start_time" property="startTime"/>
<result column="end_time" property="endTime"/>
@@ -19,4 +20,134 @@
<result column="update_time" property="updateTime"/>
<result column="del_flag" property="delFlag"/>
</resultMap>
<resultMap id="VoResultMap" type="com.ruoyi.hrm.domain.vo.HrmLeaveReqVo" extends="BaseResultMap">
<result column="project_code" property="projectCode"/>
<result column="project_name" property="projectName"/>
<result column="project_num" property="projectNum"/>
<result column="project_type" property="projectType"/>
<result column="address" property="address"/>
<result column="funds" property="funds"/>
<result column="functionary" property="functionary"/>
<result column="begin_time" property="beginTime"/>
<result column="finish_time" property="finishTime"/>
<result column="delivery" property="delivery"/>
<result column="guarantee" property="guarantee"/>
<result column="project_grade" property="projectGrade"/>
<result column="project_status" property="projectStatus"/>
<result column="product_status" property="productStatus"/>
<result column="color" property="color"/>
<result column="customerId" property="customerId"/>
</resultMap>
<select id="selectVoWithProjectById" resultMap="VoResultMap">
SELECT
l.*,
p.project_code,
p.project_name,
p.project_num,
p.project_type,
p.address,
p.funds,
p.functionary,
p.begin_time,
p.finish_time,
p.delivery,
p.guarantee,
p.project_grade,
p.project_status,
p.product_status,
p.color,
p.customer_id AS customerId
FROM hrm_leave_req l
LEFT JOIN sys_oa_project p ON l.project_id = p.project_id
WHERE l.biz_id = #{bizId}
AND l.del_flag = 0
</select>
<select id="selectVoWithProjectByPage" resultMap="VoResultMap">
SELECT
l.*,
p.project_code,
p.project_name,
p.project_num,
p.project_type,
p.address,
p.funds,
p.functionary,
p.begin_time,
p.finish_time,
p.delivery,
p.guarantee,
p.project_grade,
p.project_status,
p.product_status,
p.color,
p.customer_id AS customerId
FROM hrm_leave_req l
LEFT JOIN sys_oa_project p ON l.project_id = p.project_id
WHERE l.del_flag = 0
<if test="bo.bizId != null">
AND l.biz_id = #{bo.bizId}
</if>
<if test="bo.empId != null">
AND l.emp_id = #{bo.empId}
</if>
<if test="bo.projectId != null">
AND l.project_id = #{bo.projectId}
</if>
<if test="bo.leaveType != null and bo.leaveType != ''">
AND l.leave_type = #{bo.leaveType}
</if>
<if test="bo.status != null and bo.status != ''">
AND l.status = #{bo.status}
</if>
<if test="bo.startTime != null">
AND l.start_time = #{bo.startTime}
</if>
ORDER BY l.create_time DESC
</select>
<select id="selectVoWithProjectList" resultMap="VoResultMap">
SELECT
l.*,
p.project_code,
p.project_name,
p.project_num,
p.project_type,
p.address,
p.funds,
p.functionary,
p.begin_time,
p.finish_time,
p.delivery,
p.guarantee,
p.project_grade,
p.project_status,
p.product_status,
p.color,
p.customer_id AS customerId
FROM hrm_leave_req l
LEFT JOIN sys_oa_project p ON l.project_id = p.project_id
WHERE l.del_flag = 0
<if test="bo.bizId != null">
AND l.biz_id = #{bo.bizId}
</if>
<if test="bo.empId != null">
AND l.emp_id = #{bo.empId}
</if>
<if test="bo.projectId != null">
AND l.project_id = #{bo.projectId}
</if>
<if test="bo.leaveType != null and bo.leaveType != ''">
AND l.leave_type = #{bo.leaveType}
</if>
<if test="bo.status != null and bo.status != ''">
AND l.status = #{bo.status}
</if>
<if test="bo.startTime != null">
AND l.start_time = #{bo.startTime}
</if>
ORDER BY l.create_time DESC
</select>
</mapper>

View File

@@ -0,0 +1,145 @@
<?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.hrm.mapper.HrmReimburseReqMapper">
<resultMap id="BaseResultMap" type="com.ruoyi.hrm.domain.HrmReimburseReq">
<id column="biz_id" property="bizId"/>
<result column="emp_id" property="empId"/>
<result column="project_id" property="projectId"/>
<result column="reimburse_type" property="reimburseType"/>
<result column="total_amount" property="totalAmount"/>
<result column="reason" property="reason"/>
<result column="status" property="status"/>
<result column="accessory_apply_ids" property="accessoryApplyIds"/>
<result column="accessory_receipt_ids" property="accessoryReceiptIds"/>
<result column="remark" property="remark"/>
<result column="create_by" property="createBy"/>
<result column="create_time" property="createTime"/>
<result column="update_by" property="updateBy"/>
<result column="update_time" property="updateTime"/>
<result column="del_flag" property="delFlag"/>
</resultMap>
<resultMap id="VoResultMap" type="com.ruoyi.hrm.domain.vo.HrmReimburseReqVo" extends="BaseResultMap">
<result column="project_code" property="projectCode"/>
<result column="project_name" property="projectName"/>
<result column="project_num" property="projectNum"/>
<result column="project_type" property="projectType"/>
<result column="address" property="address"/>
<result column="funds" property="funds"/>
<result column="functionary" property="functionary"/>
<result column="begin_time" property="beginTime"/>
<result column="finish_time" property="finishTime"/>
<result column="delivery" property="delivery"/>
<result column="guarantee" property="guarantee"/>
<result column="project_grade" property="projectGrade"/>
<result column="project_status" property="projectStatus"/>
<result column="product_status" property="productStatus"/>
<result column="color" property="color"/>
<result column="customerId" property="customerId"/>
</resultMap>
<select id="selectVoWithProjectById" resultMap="VoResultMap">
SELECT
r.*,
p.project_code,
p.project_name,
p.project_num,
p.project_type,
p.address,
p.funds,
p.functionary,
p.begin_time,
p.finish_time,
p.delivery,
p.guarantee,
p.project_grade,
p.project_status,
p.product_status,
p.color,
p.customer_id AS customerId
FROM hrm_reimburse_req r
LEFT JOIN sys_oa_project p ON r.project_id = p.project_id
WHERE r.biz_id = #{bizId}
AND r.del_flag = 0
</select>
<select id="selectVoWithProjectByPage" resultMap="VoResultMap">
SELECT
r.*,
p.project_code,
p.project_name,
p.project_num,
p.project_type,
p.address,
p.funds,
p.functionary,
p.begin_time,
p.finish_time,
p.delivery,
p.guarantee,
p.project_grade,
p.project_status,
p.product_status,
p.color,
p.customer_id AS customerId
FROM hrm_reimburse_req r
LEFT JOIN sys_oa_project p ON r.project_id = p.project_id
WHERE r.del_flag = 0
<if test="bo.bizId != null">
AND r.biz_id = #{bo.bizId}
</if>
<if test="bo.empId != null">
AND r.emp_id = #{bo.empId}
</if>
<if test="bo.projectId != null">
AND r.project_id = #{bo.projectId}
</if>
<if test="bo.reimburseType != null and bo.reimburseType != ''">
AND r.reimburse_type = #{bo.reimburseType}
</if>
<if test="bo.status != null and bo.status != ''">
AND r.status = #{bo.status}
</if>
ORDER BY r.create_time DESC
</select>
<select id="selectVoWithProjectList" resultMap="VoResultMap">
SELECT
r.*,
p.project_code,
p.project_name,
p.project_num,
p.project_type,
p.address,
p.funds,
p.functionary,
p.begin_time,
p.finish_time,
p.delivery,
p.guarantee,
p.project_grade,
p.project_status,
p.product_status,
p.color,
p.customer_id AS customerId
FROM hrm_reimburse_req r
LEFT JOIN sys_oa_project p ON r.project_id = p.project_id
WHERE r.del_flag = 0
<if test="bo.bizId != null">
AND r.biz_id = #{bo.bizId}
</if>
<if test="bo.empId != null">
AND r.emp_id = #{bo.empId}
</if>
<if test="bo.projectId != null">
AND r.project_id = #{bo.projectId}
</if>
<if test="bo.reimburseType != null and bo.reimburseType != ''">
AND r.reimburse_type = #{bo.reimburseType}
</if>
<if test="bo.status != null and bo.status != ''">
AND r.status = #{bo.status}
</if>
ORDER BY r.create_time DESC
</select>
</mapper>

View File

@@ -4,6 +4,7 @@
<resultMap id="BaseResultMap" type="com.ruoyi.hrm.domain.HrmSealReq">
<id column="biz_id" property="bizId"/>
<result column="emp_id" property="empId"/>
<result column="project_id" property="projectId"/>
<result column="seal_type" property="sealType"/>
<result column="purpose" property="purpose"/>
<result column="apply_file_ids" property="applyFileIds"/>
@@ -18,4 +19,128 @@
<result column="update_time" property="updateTime"/>
<result column="del_flag" property="delFlag"/>
</resultMap>
<resultMap id="VoResultMap" type="com.ruoyi.hrm.domain.vo.HrmSealReqVo" extends="BaseResultMap">
<result column="project_code" property="projectCode"/>
<result column="project_name" property="projectName"/>
<result column="project_num" property="projectNum"/>
<result column="project_type" property="projectType"/>
<result column="address" property="address"/>
<result column="funds" property="funds"/>
<result column="functionary" property="functionary"/>
<result column="begin_time" property="beginTime"/>
<result column="finish_time" property="finishTime"/>
<result column="delivery" property="delivery"/>
<result column="guarantee" property="guarantee"/>
<result column="project_grade" property="projectGrade"/>
<result column="project_status" property="projectStatus"/>
<result column="product_status" property="productStatus"/>
<result column="color" property="color"/>
<result column="customerId" property="customerId"/>
</resultMap>
<select id="selectVoWithProjectById" resultMap="VoResultMap">
SELECT
s.*,
p.project_code,
p.project_name,
p.project_num,
p.project_type,
p.address,
p.funds,
p.functionary,
p.begin_time,
p.finish_time,
p.delivery,
p.guarantee,
p.project_grade,
p.project_status,
p.product_status,
p.color,
p.customer_id AS customerId
FROM hrm_seal_req s
LEFT JOIN sys_oa_project p ON s.project_id = p.project_id
WHERE s.biz_id = #{bizId}
AND s.del_flag = 0
</select>
<select id="selectVoWithProjectByPage" resultMap="VoResultMap">
SELECT
s.*,
p.project_code,
p.project_name,
p.project_num,
p.project_type,
p.address,
p.funds,
p.functionary,
p.begin_time,
p.finish_time,
p.delivery,
p.guarantee,
p.project_grade,
p.project_status,
p.product_status,
p.color,
p.customer_id AS customerId
FROM hrm_seal_req s
LEFT JOIN sys_oa_project p ON s.project_id = p.project_id
WHERE s.del_flag = 0
<if test="bo.bizId != null">
AND s.biz_id = #{bo.bizId}
</if>
<if test="bo.empId != null">
AND s.emp_id = #{bo.empId}
</if>
<if test="bo.projectId != null">
AND s.project_id = #{bo.projectId}
</if>
<if test="bo.sealType != null and bo.sealType != ''">
AND s.seal_type = #{bo.sealType}
</if>
<if test="bo.status != null and bo.status != ''">
AND s.status = #{bo.status}
</if>
ORDER BY s.create_time DESC
</select>
<select id="selectVoWithProjectList" resultMap="VoResultMap">
SELECT
s.*,
p.project_code,
p.project_name,
p.project_num,
p.project_type,
p.address,
p.funds,
p.functionary,
p.begin_time,
p.finish_time,
p.delivery,
p.guarantee,
p.project_grade,
p.project_status,
p.product_status,
p.color,
p.customer_id AS customerId
FROM hrm_seal_req s
LEFT JOIN sys_oa_project p ON s.project_id = p.project_id
WHERE s.del_flag = 0
<if test="bo.bizId != null">
AND s.biz_id = #{bo.bizId}
</if>
<if test="bo.empId != null">
AND s.emp_id = #{bo.empId}
</if>
<if test="bo.projectId != null">
AND s.project_id = #{bo.projectId}
</if>
<if test="bo.sealType != null and bo.sealType != ''">
AND s.seal_type = #{bo.sealType}
</if>
<if test="bo.status != null and bo.status != ''">
AND s.status = #{bo.status}
</if>
ORDER BY s.create_time DESC
</select>
</mapper>

View File

@@ -4,6 +4,7 @@
<resultMap id="BaseResultMap" type="com.ruoyi.hrm.domain.HrmTravelReq">
<id column="biz_id" property="bizId"/>
<result column="emp_id" property="empId"/>
<result column="project_id" property="projectId"/>
<result column="start_time" property="startTime"/>
<result column="end_time" property="endTime"/>
<result column="travel_type" property="travelType"/>
@@ -23,4 +24,128 @@
<result column="update_time" property="updateTime"/>
<result column="del_flag" property="delFlag"/>
</resultMap>
<resultMap id="VoResultMap" type="com.ruoyi.hrm.domain.vo.HrmTravelReqVo" extends="BaseResultMap">
<result column="project_code" property="projectCode"/>
<result column="project_name" property="projectName"/>
<result column="project_num" property="projectNum"/>
<result column="project_type" property="projectType"/>
<result column="address" property="address"/>
<result column="funds" property="funds"/>
<result column="functionary" property="functionary"/>
<result column="begin_time" property="beginTime"/>
<result column="finish_time" property="finishTime"/>
<result column="delivery" property="delivery"/>
<result column="guarantee" property="guarantee"/>
<result column="project_grade" property="projectGrade"/>
<result column="project_status" property="projectStatus"/>
<result column="product_status" property="productStatus"/>
<result column="color" property="color"/>
<result column="customerId" property="customerId"/>
</resultMap>
<select id="selectVoWithProjectById" resultMap="VoResultMap">
SELECT
t.*,
p.project_code,
p.project_name,
p.project_num,
p.project_type,
p.address,
p.funds,
p.functionary,
p.begin_time,
p.finish_time,
p.delivery,
p.guarantee,
p.project_grade,
p.project_status,
p.product_status,
p.color,
p.customer_id AS customerId
FROM hrm_travel_req t
LEFT JOIN sys_oa_project p ON t.project_id = p.project_id
WHERE t.biz_id = #{bizId}
AND t.del_flag = 0
</select>
<select id="selectVoWithProjectByPage" resultMap="VoResultMap">
SELECT
t.*,
p.project_code,
p.project_name,
p.project_num,
p.project_type,
p.address,
p.funds,
p.functionary,
p.begin_time,
p.finish_time,
p.delivery,
p.guarantee,
p.project_grade,
p.project_status,
p.product_status,
p.color,
p.customer_id AS customerId
FROM hrm_travel_req t
LEFT JOIN sys_oa_project p ON t.project_id = p.project_id
WHERE t.del_flag = 0
<if test="bo.bizId != null">
AND t.biz_id = #{bo.bizId}
</if>
<if test="bo.empId != null">
AND t.emp_id = #{bo.empId}
</if>
<if test="bo.projectId != null">
AND t.project_id = #{bo.projectId}
</if>
<if test="bo.status != null and bo.status != ''">
AND t.status = #{bo.status}
</if>
<if test="bo.startTime != null">
AND t.start_time = #{bo.startTime}
</if>
ORDER BY t.create_time DESC
</select>
<select id="selectVoWithProjectList" resultMap="VoResultMap">
SELECT
t.*,
p.project_code,
p.project_name,
p.project_num,
p.project_type,
p.address,
p.funds,
p.functionary,
p.begin_time,
p.finish_time,
p.delivery,
p.guarantee,
p.project_grade,
p.project_status,
p.product_status,
p.color,
p.customer_id AS customerId
FROM hrm_travel_req t
LEFT JOIN sys_oa_project p ON t.project_id = p.project_id
WHERE t.del_flag = 0
<if test="bo.bizId != null">
AND t.biz_id = #{bo.bizId}
</if>
<if test="bo.empId != null">
AND t.emp_id = #{bo.empId}
</if>
<if test="bo.projectId != null">
AND t.project_id = #{bo.projectId}
</if>
<if test="bo.status != null and bo.status != ''">
AND t.status = #{bo.status}
</if>
<if test="bo.startTime != null">
AND t.start_time = #{bo.startTime}
</if>
ORDER BY t.create_time DESC
</select>
</mapper>