feat(oa): 添加项目进度步骤负责人更新功能

- 引入 OaProjectScheduleStepMapper 依赖注入
- 新增 updateNodeHeaderByScheduleId 方法用于批量更新节点负责人
- 在修改项目进度时同步更新相关步骤的负责人信息
- 添加相应的 XML 映射配置实现条件更新逻辑
- 完善操作日志记录机制确保数据变更可追溯
This commit is contained in:
2026-05-16 14:29:40 +08:00
parent 47baa575df
commit 305d8524d1
3 changed files with 23 additions and 1 deletions

View File

@@ -50,4 +50,9 @@ public interface OaProjectScheduleStepMapper extends BaseMapperPlus<OaProjectSch
* 按项目汇总进度步骤:总数、已完成(2)、待验收(1) * 按项目汇总进度步骤:总数、已完成(2)、待验收(1)
*/ */
List<ProjectScheduleStepStatsDto> selectStepStatsGroupByProjectId(@Param("projectIds") Collection<Long> projectIds); List<ProjectScheduleStepStatsDto> selectStepStatsGroupByProjectId(@Param("projectIds") Collection<Long> projectIds);
/**
* 根据 schedule_id 批量更新节点负责人(仅更新 node_header 不为空的记录)
*/
int updateNodeHeaderByScheduleId(@Param("scheduleId") Long scheduleId, @Param("nodeHeader") String nodeHeader);
} }

View File

@@ -28,6 +28,7 @@ import com.ruoyi.oa.domain.bo.OaProjectScheduleBo;
import com.ruoyi.oa.domain.vo.OaProjectScheduleVo; import com.ruoyi.oa.domain.vo.OaProjectScheduleVo;
import com.ruoyi.oa.domain.OaProjectSchedule; import com.ruoyi.oa.domain.OaProjectSchedule;
import com.ruoyi.oa.mapper.OaProjectScheduleMapper; import com.ruoyi.oa.mapper.OaProjectScheduleMapper;
import com.ruoyi.oa.mapper.OaProjectScheduleStepMapper;
import com.ruoyi.oa.service.IOaProjectOperationLogService; import com.ruoyi.oa.service.IOaProjectOperationLogService;
import com.ruoyi.oa.service.IOaProjectScheduleService; import com.ruoyi.oa.service.IOaProjectScheduleService;
import org.springframework.context.annotation.Lazy; import org.springframework.context.annotation.Lazy;
@@ -51,6 +52,8 @@ public class OaProjectScheduleServiceImpl implements IOaProjectScheduleService {
private final OaProjectScheduleMapper baseMapper; private final OaProjectScheduleMapper baseMapper;
private final OaProjectScheduleStepMapper scheduleStepMapper;
private final OaScheduleTemplateMapper scheduleTemplateMapper; private final OaScheduleTemplateMapper scheduleTemplateMapper;
private final IOaScheduleTemplateStepService scheduleTemplateStepService; private final IOaScheduleTemplateStepService scheduleTemplateStepService;
@@ -221,7 +224,11 @@ public class OaProjectScheduleServiceImpl implements IOaProjectScheduleService {
OaProjectSchedule update = BeanUtil.toBean(bo, OaProjectSchedule.class); OaProjectSchedule update = BeanUtil.toBean(bo, OaProjectSchedule.class);
validEntityBeforeSave(update); validEntityBeforeSave(update);
boolean ok = baseMapper.updateById(update) > 0; boolean ok = baseMapper.updateById(update) > 0;
if (ok) { if (ok && bo.getSteward() != null) {
scheduleStepMapper.updateNodeHeaderByScheduleId(bo.getScheduleId(), bo.getSteward());
operationLogService.recordLog(bo.getProjectId(), 1, bo.getScheduleId(), "项目进度",
2, "修改项目进度", null, null);
} else if (ok) {
operationLogService.recordLog(bo.getProjectId(), 1, bo.getScheduleId(), "项目进度", operationLogService.recordLog(bo.getProjectId(), 1, bo.getScheduleId(), "项目进度",
2, "修改项目进度", null, null); 2, "修改项目进度", null, null);
} }

View File

@@ -300,4 +300,14 @@
GROUP BY sch.project_id GROUP BY sch.project_id
</select> </select>
<update id="updateNodeHeaderByScheduleId">
UPDATE oa_project_schedule_step
SET node_header = #{nodeHeader}
WHERE schedule_id = #{scheduleId}
AND del_flag = '0'
AND use_flag = '1'
AND node_header IS NOT NULL
AND node_header != ''
</update>
</mapper> </mapper>