修复接单部门负责人驳回任务时没有通知任务发起人的问题

- 接单部门负责人驳回时,首先通知任务发起人
- 如果需求部门负责人不是发起人,也通知需求部门负责人
- 添加日志记录通知发送情况
This commit is contained in:
Your Name 2026-01-14 19:40:11 +08:00
parent 06194088ac
commit b47e322870

View File

@ -446,16 +446,29 @@ public class TaskApprovalService {
logApproval(taskId, approverId, 2, "reject", reason);
// 通知需求部门负责人
// 1. 通知任务发起人
notificationService.sendNotification(
demandDept.getLeaderId(),
task.getPublisherId(),
"任务已被驳回",
String.format("任务【%s】被接单部门负责人驳回,原因:%s", task.getTitle(), reason),
String.format("您的任务【%s】被接单部门负责人驳回,原因:%s,请修改后重新提交", task.getTitle(), reason),
"task_reject",
taskId
);
log.info("已通知任务发起人: publisherId={}", task.getPublisherId());
// 如果任务有指定的处理人,发送群通知告知驳回
// 2. 如果需求部门负责人不是发起人,也通知需求部门负责人
if (!demandDept.getLeaderId().equals(task.getPublisherId())) {
notificationService.sendNotification(
demandDept.getLeaderId(),
"任务已被驳回",
String.format("任务【%s】被接单部门负责人驳回,原因:%s", task.getTitle(), reason),
"task_reject",
taskId
);
log.info("已通知需求部门负责人: leaderId={}", demandDept.getLeaderId());
}
// 3. 如果任务有指定的处理人,发送群通知告知驳回
if (task.getReceiverId() != null) {
try {
com.designhub.entity.User receiver = userMapper.selectById(task.getReceiverId());