feat: 添加创建人以及创建事件

This commit is contained in:
kyle 2024-01-10 08:57:46 +08:00
parent 555bac151d
commit 1bc472b528
3 changed files with 7 additions and 0 deletions

View File

@ -33,6 +33,9 @@ public class BpmCandidateSourceInfo {
@NotEmpty(message = "不允许空规则")
private Set<BpmTaskCandidateRuleVO> rules;
@Schema(description = "发起抄送的用户")
private String creator;
public void addRule(BpmTaskCandidateRuleVO vo) {
assert vo != null;
if (rules == null) {

View File

@ -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<BpmProcessInstanceCopyDO> copyList = new ArrayList<>(ccCandidates.size());
for (Long userId : ccCandidates) {
BpmProcessInstanceCopyDO copy = BpmProcessInstanceCopyConvert.INSTANCE.copy(copyDO);

View File

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