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("抄送任务失败"); }