From 3eb365e299b9db75155eaaf3687d298d057e8ce3 Mon Sep 17 00:00:00 2001 From: tianxinlei Date: Thu, 25 Jun 2026 12:18:52 +0800 Subject: [PATCH] =?UTF-8?q?6-25=20-=20bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../command/tasklist/FeedbackAddExe.java | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/web-app/src/main/java/com/zcloud/safetyDutyList/command/tasklist/FeedbackAddExe.java b/web-app/src/main/java/com/zcloud/safetyDutyList/command/tasklist/FeedbackAddExe.java index e5d0fd2..590f846 100644 --- a/web-app/src/main/java/com/zcloud/safetyDutyList/command/tasklist/FeedbackAddExe.java +++ b/web-app/src/main/java/com/zcloud/safetyDutyList/command/tasklist/FeedbackAddExe.java @@ -3,12 +3,12 @@ package com.zcloud.safetyDutyList.command.tasklist; import com.alibaba.cola.exception.BizException; import com.jjb.saas.framework.auth.model.SSOUser; import com.jjb.saas.framework.auth.utils.AuthContext; -import com.zcloud.safetyDutyList.domain.gateway.tasklist.FeedbackGateway; -import com.zcloud.safetyDutyList.domain.gateway.tasklist.TaskDetailGateway; -import com.zcloud.safetyDutyList.domain.gateway.tasklist.TaskExecutionGateway; +import com.zcloud.safetyDutyList.command.query.tasklist.MessageNoticeExe; +import com.zcloud.safetyDutyList.domain.gateway.tasklist.*; import com.zcloud.safetyDutyList.domain.model.tasklist.FeedbackE; import com.zcloud.safetyDutyList.domain.model.tasklist.TaskDetailE; import com.zcloud.safetyDutyList.domain.model.tasklist.TaskExecutionE; +import com.zcloud.safetyDutyList.domain.model.tasklist.TaskListIssueE; import com.zcloud.safetyDutyList.domain.util.FeedbackCycleUtil; import com.zcloud.safetyDutyList.dto.clientobject.tasklist.FeedbackCO; import com.zcloud.safetyDutyList.dto.tasklist.FeedbackAddCmd; @@ -18,6 +18,7 @@ import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Component; import java.time.LocalDateTime; +import java.util.List; /** * 反馈新增执行器 @@ -34,6 +35,8 @@ public class FeedbackAddExe { private final FeedbackGateway feedbackGateway; private final TaskDetailGateway taskDetailGateway; private final TaskExecutionGateway taskExecutionGateway; + private final TaskListIssueGateway taskListIssueGateway; + private final MessageNoticeExe messageNoticeExe; public FeedbackCO execute(FeedbackAddCmd cmd) { @@ -51,6 +54,11 @@ public class FeedbackAddExe { throw new BizException("任务模板不存在"); } + TaskListIssueE issueE = taskListIssueGateway.getByTaskIssueId(executionE.getTaskIssueId()); + if (issueE == null) { + throw new BizException("清单下发记录不存在"); + } + FeedbackE feedbackE = new FeedbackE(); if (StringUtil.isNotBlank(cmd.getFeedbackId())) { feedbackE.setFeedbackId(cmd.getFeedbackId()); @@ -78,6 +86,13 @@ public class FeedbackAddExe { throw new BizException("反馈保存失败"); } + // 如果是当前周期第一次反馈,则更新待办为完成 + List existingFeedbacks = feedbackGateway.listByTaskExecutionIdAndPeriodFlag( + executionE.getTaskExecutionId(), periodFlag); + if (existingFeedbacks != null && existingFeedbacks.size() == 1) { + messageNoticeExe.sendMessageCompleteEvent(issueE.getId()); + } + FeedbackCO co = new FeedbackCO(); BeanUtils.copyProperties(feedbackE, co); return co;