update - 完善创建工作流的异常日志打印

This commit is contained in:
wangli 2024-04-01 19:54:11 +08:00
parent 20e2cf8166
commit 4e0a668651
2 changed files with 3 additions and 2 deletions

View File

@ -7,6 +7,7 @@ import cn.hutool.core.collection.CollUtil;
import org.flowable.bpmn.model.FlowElement;
import org.flowable.engine.delegate.DelegateExecution;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;
import java.util.Collections;
import java.util.List;
@ -27,7 +28,7 @@ public class ProjectWorkspaceProcessor implements ApproverScopeProcessor {
public ApproverScopeDTO build(FlowElement flowElement, DelegateExecution execution) {
// 发起项目部
CooperationOrgDTO orgDTO =(CooperationOrgDTO) execution.getVariables().get(BIZ_ORG_RELATION);
if (Objects.isNull(orgDTO)) {
if (Objects.isNull(orgDTO) || CollectionUtils.isEmpty(orgDTO.getOrgScopes())) {
return ApproverScopeDTO.builder().build();
}
List<OrgScope> orgScopes = orgDTO.getOrgScopes().stream()

View File

@ -106,7 +106,7 @@ public class BpmnProcessInstanceController implements ProcessInstanceApi {
result = bpmnProcessInstanceService.createProcessInstance(dto);
} catch (Exception e) {
String errorMsg = Objects.nonNull(e.getCause()) ? e.getCause().getMessage() : e.getMessage();
LogUtil.error(LogUtil.ErrorType.ERROR_BUSINESS, "发起审核createProcessInstance===>>>异常:{}", errorMsg);
LogUtil.error(LogUtil.ErrorType.ERROR_BUSINESS, "发起审核createProcessInstance===>>>异常:{}", errorMsg, e);
if (sendDingTalk) {
DingTalkUtils.sendDingTalk(profile, dto, e);
}