6-25 - bug修复
parent
b643471948
commit
3eb365e299
|
|
@ -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<FeedbackE> 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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue