From 1bc472b528a300bc4a3521561eb8aa6541b65d16 Mon Sep 17 00:00:00 2001 From: kyle <573984425@qq.com> Date: Wed, 10 Jan 2024 08:57:46 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E5=88=9B=E5=BB=BA?= =?UTF-8?q?=E4=BA=BA=E4=BB=A5=E5=8F=8A=E5=88=9B=E5=BB=BA=E4=BA=8B=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../module/bpm/service/candidate/BpmCandidateSourceInfo.java | 3 +++ .../bpm/service/cc/BpmProcessInstanceCopyServiceImpl.java | 3 +++ .../yudao/module/bpm/service/task/BpmTaskServiceImpl.java | 1 + 3 files changed, 7 insertions(+) diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/candidate/BpmCandidateSourceInfo.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/candidate/BpmCandidateSourceInfo.java index 5970a012e..52ef13ffd 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/candidate/BpmCandidateSourceInfo.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/candidate/BpmCandidateSourceInfo.java @@ -33,6 +33,9 @@ public class BpmCandidateSourceInfo { @NotEmpty(message = "不允许空规则") private Set rules; + @Schema(description = "发起抄送的用户") + private String creator; + public void addRule(BpmTaskCandidateRuleVO vo) { assert vo != null; if (rules == null) { diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/cc/BpmProcessInstanceCopyServiceImpl.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/cc/BpmProcessInstanceCopyServiceImpl.java index b285d6189..4f074472a 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/cc/BpmProcessInstanceCopyServiceImpl.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/cc/BpmProcessInstanceCopyServiceImpl.java @@ -16,6 +16,7 @@ import org.springframework.stereotype.Service; import org.springframework.validation.annotation.Validated; import javax.annotation.Resource; +import java.time.LocalDateTime; import java.util.ArrayList; import java.util.List; import java.util.Set; @@ -71,6 +72,8 @@ public class BpmProcessInstanceCopyServiceImpl implements BpmProcessInstanceCopy } copyDO.setStartUserId(FlowableUtils.getStartUserIdFromProcessInstance(processInstance)); copyDO.setName(FlowableUtils.getFlowName(processInstance.getProcessDefinitionId())); + copyDO.setCreator(sourceInfo.getCreator()); + copyDO.setCreateTime(LocalDateTime.now()); List copyList = new ArrayList<>(ccCandidates.size()); for (Long userId : ccCandidates) { BpmProcessInstanceCopyDO copy = BpmProcessInstanceCopyConvert.INSTANCE.copy(copyDO); diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/task/BpmTaskServiceImpl.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/task/BpmTaskServiceImpl.java index f58679317..416d31645 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/task/BpmTaskServiceImpl.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/task/BpmTaskServiceImpl.java @@ -249,6 +249,7 @@ public class BpmTaskServiceImpl implements BpmTaskService { sourceInfo.setTaskId(reqVO.getId()); sourceInfo.setProcessInstanceId(instance.getId()); sourceInfo.addRule(reqVO.getCcCandidateRule()); + sourceInfo.setCreator(String.valueOf(userId)); if (!processInstanceCopyService.makeCopy(sourceInfo)) { throw new RuntimeException("抄送任务失败"); }