feat(oa): 添加项目进度步骤负责人更新功能
- 引入 OaProjectScheduleStepMapper 依赖注入 - 新增 updateNodeHeaderByScheduleId 方法用于批量更新节点负责人 - 在修改项目进度时同步更新相关步骤的负责人信息 - 添加相应的 XML 映射配置实现条件更新逻辑 - 完善操作日志记录机制确保数据变更可追溯
This commit is contained in:
@@ -50,4 +50,9 @@ public interface OaProjectScheduleStepMapper extends BaseMapperPlus<OaProjectSch
|
||||
* 按项目汇总进度步骤:总数、已完成(2)、待验收(1)
|
||||
*/
|
||||
List<ProjectScheduleStepStatsDto> selectStepStatsGroupByProjectId(@Param("projectIds") Collection<Long> projectIds);
|
||||
|
||||
/**
|
||||
* 根据 schedule_id 批量更新节点负责人(仅更新 node_header 不为空的记录)
|
||||
*/
|
||||
int updateNodeHeaderByScheduleId(@Param("scheduleId") Long scheduleId, @Param("nodeHeader") String nodeHeader);
|
||||
}
|
||||
|
||||
@@ -28,6 +28,7 @@ import com.ruoyi.oa.domain.bo.OaProjectScheduleBo;
|
||||
import com.ruoyi.oa.domain.vo.OaProjectScheduleVo;
|
||||
import com.ruoyi.oa.domain.OaProjectSchedule;
|
||||
import com.ruoyi.oa.mapper.OaProjectScheduleMapper;
|
||||
import com.ruoyi.oa.mapper.OaProjectScheduleStepMapper;
|
||||
import com.ruoyi.oa.service.IOaProjectOperationLogService;
|
||||
import com.ruoyi.oa.service.IOaProjectScheduleService;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
@@ -51,6 +52,8 @@ public class OaProjectScheduleServiceImpl implements IOaProjectScheduleService {
|
||||
|
||||
private final OaProjectScheduleMapper baseMapper;
|
||||
|
||||
private final OaProjectScheduleStepMapper scheduleStepMapper;
|
||||
|
||||
private final OaScheduleTemplateMapper scheduleTemplateMapper;
|
||||
|
||||
private final IOaScheduleTemplateStepService scheduleTemplateStepService;
|
||||
@@ -221,7 +224,11 @@ public class OaProjectScheduleServiceImpl implements IOaProjectScheduleService {
|
||||
OaProjectSchedule update = BeanUtil.toBean(bo, OaProjectSchedule.class);
|
||||
validEntityBeforeSave(update);
|
||||
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(), "项目进度",
|
||||
2, "修改项目进度", null, null);
|
||||
}
|
||||
|
||||
@@ -300,4 +300,14 @@
|
||||
GROUP BY sch.project_id
|
||||
</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>
|
||||
|
||||
Reference in New Issue
Block a user