update - 调转评论时,如果没有传入任何字符,则不记录评论内容

This commit is contained in:
wangli 2024-04-02 13:45:30 +08:00
parent 3b35b831e3
commit f408a6827e

View File

@ -21,6 +21,7 @@ import org.flowable.task.service.impl.persistence.entity.TaskEntity;
import org.flowable.variable.service.HistoricVariableService;
import org.flowable.variable.service.impl.persistence.entity.HistoricVariableInstanceEntity;
import org.flowable.variable.service.impl.types.SerializableType;
import org.springframework.util.StringUtils;
import java.io.ByteArrayOutputStream;
import java.io.ObjectOutputStream;
@ -101,8 +102,12 @@ public class CustomCommentTaskCmd implements Command<Void>, Serializable {
// 新增评论
Authentication.setAuthenticatedUserId(operator.buildAssigneeId());
CustomTaskHelper.addComment(commandContext, task, COMMENT_TYPE_ADVICE, comment);
CustomTaskHelper.addComment(commandContext, task, COMMENT_TYPE_COMMENT_EXT, JSON.toJSONString(commentExt));
if (StringUtils.hasText(comment)) {
CustomTaskHelper.addComment(commandContext, task, COMMENT_TYPE_ADVICE, comment);
}
if (Objects.nonNull(commentExt)) {
CustomTaskHelper.addComment(commandContext, task, COMMENT_TYPE_COMMENT_EXT, JSON.toJSONString(commentExt));
}
Authentication.setAuthenticatedUserId(null);
// 处理附件