feat(oa): 增加项目ID和进度明细ID字段及相关查询功能

- 在 OaFileOperationRecord 实体类中新增 projectId 和 trackId 字段
- 在 OaFileOperationRecordBo 业务对象中新增 projectId 和 trackId 字段
- 在 OaFileOperationRecordMapper 中新增 selectVoPagePlus 方法用于分页查询
- 在 OaFileOperationRecordMapper.xml 中配置 selectVoPagePlus 的 SQL 映射
- 新增 buildQueryWrapperPlus 方法支持关联表的条件查询
- 在 OaFileOperationRecordVo 视图对象中新增项目及节点相关字段
- 更新 queryPageList 方法使用新的
This commit is contained in:
2025-12-04 09:43:23 +08:00
parent 432e75d641
commit 527457cf25
6 changed files with 72 additions and 2 deletions

View File

@@ -53,4 +53,10 @@ public class OaFileOperationRecord extends BaseEntity {
@TableLogic
private Long delFlag;
//项目id
private Long projectId;
//进度明细id
private Long trackId;
}

View File

@@ -51,5 +51,10 @@ public class OaFileOperationRecordBo extends BaseEntity {
*/
private String remark;
//项目id
private Long projectId;
//进度明细id
private Long trackId;
}

View File

@@ -59,4 +59,16 @@ public class OaFileOperationRecordVo {
private String remark;
//项目id
private Long projectId;
//进度明细id
private Long trackId;
private String projectName;
private String tabNode;
private String firstLevelNode;
private String secondLevelNode;
private String nodeHeader;
}

View File

@@ -1,8 +1,11 @@
package com.ruoyi.oa.mapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.oa.domain.OaFileOperationRecord;
import com.ruoyi.oa.domain.vo.OaFileOperationRecordVo;
import com.ruoyi.common.core.mapper.BaseMapperPlus;
import org.apache.ibatis.annotations.Param;
/**
* OA文件操作记录Mapper接口
@@ -12,4 +15,5 @@ import com.ruoyi.common.core.mapper.BaseMapperPlus;
*/
public interface OaFileOperationRecordMapper extends BaseMapperPlus<OaFileOperationRecordMapper, OaFileOperationRecord, OaFileOperationRecordVo> {
Page<OaFileOperationRecordVo> selectVoPagePlus(Page<Object> build,@Param("ew") QueryWrapper<OaFileOperationRecord> lqw);
}

View File

@@ -1,6 +1,7 @@
package com.ruoyi.oa.service.impl;
import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ruoyi.common.helper.LoginHelper;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.core.page.TableDataInfo;
@@ -45,11 +46,24 @@ public class OaFileOperationRecordServiceImpl implements IOaFileOperationRecordS
*/
@Override
public TableDataInfo<OaFileOperationRecordVo> queryPageList(OaFileOperationRecordBo bo, PageQuery pageQuery) {
LambdaQueryWrapper<OaFileOperationRecord> lqw = buildQueryWrapper(bo);
Page<OaFileOperationRecordVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
QueryWrapper<OaFileOperationRecord> lqw = buildQueryWrapperPlus(bo);
Page<OaFileOperationRecordVo> result = baseMapper.selectVoPagePlus(pageQuery.build(), lqw);
return TableDataInfo.build(result);
}
private QueryWrapper<OaFileOperationRecord> buildQueryWrapperPlus(OaFileOperationRecordBo bo) {
Map<String, Object> params = bo.getParams();
QueryWrapper<OaFileOperationRecord> qw = Wrappers.query();
qw.eq(StringUtils.isNotBlank(bo.getFileId()), "ofor.file_id", bo.getFileId());
qw.eq(bo.getProjectId() != null, "ofor.project_id", bo.getProjectId());
qw.eq(bo.getTrackId() != null, "ofor.track_id", bo.getTrackId());
qw.like(StringUtils.isNotBlank(bo.getFileName()), "ofor.file_name", bo.getFileName());
qw.like(StringUtils.isNotBlank(bo.getOperatorName()), "ofor.operator_name", bo.getOperatorName());
qw.eq(bo.getType() != null, "ofor.type", bo.getType());
qw.orderByDesc("ofor.create_time");
return qw;
}
/**
* 查询OA文件操作记录列表
*/
@@ -63,6 +77,8 @@ public class OaFileOperationRecordServiceImpl implements IOaFileOperationRecordS
Map<String, Object> params = bo.getParams();
LambdaQueryWrapper<OaFileOperationRecord> lqw = Wrappers.lambdaQuery();
lqw.eq(StringUtils.isNotBlank(bo.getFileId()), OaFileOperationRecord::getFileId, bo.getFileId());
lqw.eq(bo.getProjectId() != null, OaFileOperationRecord::getProjectId, bo.getProjectId());
lqw.eq(bo.getTrackId() != null, OaFileOperationRecord::getTrackId, bo.getTrackId());
lqw.like(StringUtils.isNotBlank(bo.getFileName()), OaFileOperationRecord::getFileName, bo.getFileName());
lqw.like(StringUtils.isNotBlank(bo.getOperatorName()), OaFileOperationRecord::getOperatorName, bo.getOperatorName());
lqw.eq(bo.getType() != null, OaFileOperationRecord::getType, bo.getType());

View File

@@ -7,6 +7,8 @@
<resultMap type="com.ruoyi.oa.domain.OaFileOperationRecord" id="OaFileOperationRecordResult">
<result property="recordId" column="record_id"/>
<result property="fileId" column="file_id"/>
<result property="projectId" column="project_id"/>
<result property="trackId" column="track_id"/>
<result property="fileName" column="file_name"/>
<result property="operatorName" column="operator_name"/>
<result property="type" column="type"/>
@@ -17,6 +19,31 @@
<result property="updateTime" column="update_time"/>
<result property="delFlag" column="del_flag"/>
</resultMap>
<select id="selectVoPagePlus" resultType="com.ruoyi.oa.domain.vo.OaFileOperationRecordVo">
SELECT
ofor.record_id,
ofor.file_id,
ofor.project_id,
ofor.track_id,
ofor.file_name,
ofor.operator_name,
ofor.type,
ofor.remark,
ofor.create_by,
ofor.create_time,
ofor.update_by,
ofor.update_time,
ofor.del_flag,
sop.project_name AS projectName,
opss.tab_node AS tabNode,
opss.first_level_node AS firstLevelNode,
opss.second_level_node AS secondLevelNode,
opss.node_header AS nodeHeader
FROM oa_file_operation_record ofor
LEFT JOIN sys_oa_project sop ON ofor.project_id = sop.project_id
LEFT JOIN oa_project_schedule_step opss ON ofor.track_id = opss.track_id
${ew.customSqlSegment}
</select>
</mapper>