fix: 修复指派任务和子任务组审核时未设置deadline的问题
This commit is contained in:
parent
7f698455eb
commit
369456a6c6
@ -824,12 +824,20 @@ public class TaskItemService {
|
||||
throw new BusinessException(ResultCode.PARAM_ERROR, "指定的接收人不存在");
|
||||
}
|
||||
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
|
||||
// 批量分配给指定设计师
|
||||
for (TaskItem item : groupItems) {
|
||||
item.setStatus("in_progress");
|
||||
item.setReceiverId(assignedReceiverId);
|
||||
item.setReceiverDeptId(receiver.getDeptId()); // 设置接单部门ID
|
||||
item.setUpdateTime(LocalDateTime.now());
|
||||
item.setUpdateTime(now);
|
||||
// 计算并设置deadline(使用工作时间计算)
|
||||
if (item.getEstimatedHours() != null && item.getEstimatedHours().compareTo(java.math.BigDecimal.ZERO) > 0) {
|
||||
LocalDateTime deadline = workHoursCalculator.calculateDeadline(now, item.getEstimatedHours());
|
||||
item.setDeadline(deadline);
|
||||
log.info("子任务组审核通过,子任务 {} 设置deadline: {}", item.getId(), deadline);
|
||||
}
|
||||
taskItemMapper.updateById(item);
|
||||
}
|
||||
|
||||
|
||||
@ -3231,6 +3231,8 @@ public class TaskService {
|
||||
return;
|
||||
}
|
||||
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
|
||||
if ("parallel".equals(pipelineMode)) {
|
||||
// 并行模式:所有子任务都进入in_progress状态,并设置接收人
|
||||
for (TaskItem item : taskItems) {
|
||||
@ -3245,6 +3247,12 @@ public class TaskService {
|
||||
log.info("并行流水线子任务 {} 已设置/更新接收人: receiverId={}, deptId={}",
|
||||
item.getId(), receiverId, receiverDeptId);
|
||||
}
|
||||
// 计算并设置deadline(使用工作时间计算)
|
||||
if (item.getEstimatedHours() != null && item.getEstimatedHours().compareTo(BigDecimal.ZERO) > 0) {
|
||||
LocalDateTime deadline = workHoursCalculator.calculateDeadline(now, item.getEstimatedHours());
|
||||
item.setDeadline(deadline);
|
||||
log.info("并行流水线子任务 {} 设置deadline: {}", item.getId(), deadline);
|
||||
}
|
||||
taskItemMapper.updateById(item);
|
||||
}
|
||||
log.info("并行流水线任务的所有子任务已更新为in_progress:count={}", taskItems.size());
|
||||
@ -3278,6 +3286,12 @@ public class TaskService {
|
||||
log.info("顺序流水线第一部门子任务 {} 保留预先指定的接收人: receiverId={}",
|
||||
item.getId(), item.getReceiverId());
|
||||
}
|
||||
// 计算并设置deadline(使用工作时间计算)
|
||||
if (item.getEstimatedHours() != null && item.getEstimatedHours().compareTo(BigDecimal.ZERO) > 0) {
|
||||
LocalDateTime deadline = workHoursCalculator.calculateDeadline(now, item.getEstimatedHours());
|
||||
item.setDeadline(deadline);
|
||||
log.info("顺序流水线第一部门子任务 {} 设置deadline: {}", item.getId(), deadline);
|
||||
}
|
||||
taskItemMapper.updateById(item);
|
||||
log.info("顺序流水线任务第一部门子任务已更新为in_progress:itemId={}, itemNo={}",
|
||||
item.getId(), item.getItemNo());
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user