修复:撤回任务时使用LambdaUpdateWrapper确保null值能正确更新到数据库

This commit is contained in:
Your Name 2026-01-23 13:09:53 +08:00
parent d5f8835745
commit e9a27cae8a

View File

@ -2466,15 +2466,17 @@ public class TaskService {
taskId, task.getPublisherDeptId(), scoreToRefund);
}
// 更新任务状态为草稿
task.setStatus("draft");
task.setApprovalStatus(null); // 清除审批状态
task.setCurrentApproverId(null);
task.setCurrentApproverRole(null);
task.setAuditStatus("draft"); // 重置审核状态
task.setUpdateTime(LocalDateTime.now());
taskMapper.updateById(task);
// 更新任务状态为草稿(使用 LambdaUpdateWrapper 确保 null 值也能更新)
taskMapper.update(null,
new LambdaUpdateWrapper<Task>()
.eq(Task::getId, taskId)
.set(Task::getStatus, "draft")
.set(Task::getApprovalStatus, null) // 清除审批状态
.set(Task::getCurrentApproverId, null)
.set(Task::getCurrentApproverRole, null)
.set(Task::getAuditStatus, "draft") // 重置审核状态
.set(Task::getUpdateTime, LocalDateTime.now())
);
// 如果是流水线任务,也需要重置子任务状态
if (task.getIsPipeline() != null && task.getIsPipeline() == 1) {