|
@@ -9,6 +9,7 @@ import com.fjhx.constants.StatusConstant;
|
|
|
import com.fjhx.entity.example.ExampleDetails;
|
|
|
import com.fjhx.entity.example.ExampleInfo;
|
|
|
import com.fjhx.entity.process.ProcessInfo;
|
|
|
+import com.fjhx.entity.process.ProcessNode;
|
|
|
import com.fjhx.entity.process.ProcessNodeButton;
|
|
|
import com.fjhx.entity.process.ProcessTenant;
|
|
|
import com.fjhx.enums.ButtonNameEnum;
|
|
@@ -19,9 +20,9 @@ import com.fjhx.service.example.ExampleDetailsService;
|
|
|
import com.fjhx.service.example.ExampleInfoService;
|
|
|
import com.fjhx.service.process.ProcessInfoService;
|
|
|
import com.fjhx.service.process.ProcessNodeButtonService;
|
|
|
+import com.fjhx.service.process.ProcessNodeService;
|
|
|
import com.fjhx.service.process.ProcessTenantService;
|
|
|
import com.fjhx.utils.Assert;
|
|
|
-import org.springblade.core.log.exception.ServiceException;
|
|
|
import org.springblade.core.secure.utils.AuthUtil;
|
|
|
import org.springblade.core.tool.api.R;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -30,8 +31,8 @@ import org.springframework.web.bind.annotation.GetMapping;
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.Arrays;
|
|
|
-import java.util.Collections;
|
|
|
import java.util.List;
|
|
|
|
|
|
@RestController
|
|
@@ -47,6 +48,9 @@ public class FlowClient implements IFlowClient {
|
|
|
private ProcessTenantService processTenantService;
|
|
|
|
|
|
@Autowired
|
|
|
+ private ProcessNodeService processNodeService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
private ProcessNodeButtonService processNodeButtonService;
|
|
|
|
|
|
@Autowired
|
|
@@ -58,7 +62,6 @@ public class FlowClient implements IFlowClient {
|
|
|
public R<ExampleResult> create(Long flowLinkNo, String code, String nodeCode, String title, String remarks, String cacheData) {
|
|
|
|
|
|
ExampleResult exampleResult = new ExampleResult();
|
|
|
- exampleResult.setDeleteExample(true);
|
|
|
|
|
|
int count = exampleInfoService.count(Wrappers.<ExampleInfo>lambdaQuery()
|
|
|
.eq(ExampleInfo::getFlowLinkNo, flowLinkNo)
|
|
@@ -79,139 +82,75 @@ public class FlowClient implements IFlowClient {
|
|
|
// 创建流程实例
|
|
|
ExampleInfo exampleInfo = new ExampleInfo();
|
|
|
exampleInfo.setProcessInfoId(processInfo.getId());
|
|
|
+ exampleInfo.setTitle(title);
|
|
|
exampleInfo.setFlowLinkNo(flowLinkNo);
|
|
|
exampleInfo.setCacheData(cacheData);
|
|
|
- exampleInfo.setTitle(title);
|
|
|
|
|
|
- // 开始流程明细
|
|
|
- ExampleDetails startExampleDetails = createExampleDetails(
|
|
|
- exampleInfo.getId(), processInfo.getId(), null, ButtonNameEnum.START.getType());
|
|
|
- startExampleDetails.setHandleUserId(AuthUtil.getUserId());
|
|
|
- startExampleDetails.setRemarks(remarks);
|
|
|
|
|
|
// 走默认流程,直接完成
|
|
|
if (processTenant == null) {
|
|
|
- exampleInfoEnd(exampleInfo);
|
|
|
+ exampleInfo.setComplete(StatusConstant.YES);
|
|
|
+ exampleInfo.setProcessNodeId(FlowConstant.OVER_PROCESS_FLAG);
|
|
|
+ exampleInfo.setProcessNodeCode(FlowConstant.END_CODE);
|
|
|
exampleInfo.setFlowType(FlowConstant.FLOW_TYPE_DEFAULT);
|
|
|
- exampleInfo.setHandleResult(HandleResultEnum.ADOPT.getType());
|
|
|
+ exampleInfo.setHandleResult(HandleResultEnum.SUCCESS.getType());
|
|
|
exampleInfoService.save(exampleInfo);
|
|
|
|
|
|
+ // 开始流程明细
|
|
|
+ ExampleDetails startDetails = new ExampleDetails();
|
|
|
+ startDetails.setExampleInfoId(exampleInfo.getId());
|
|
|
+ startDetails.setProcessInfoId(processInfo.getId());
|
|
|
+ startDetails.setNameType(ButtonNameEnum.START.getType());
|
|
|
+ startDetails.setHandleUserId(AuthUtil.getUserId());
|
|
|
+ startDetails.setRemarks(remarks);
|
|
|
+
|
|
|
// 结束流程明细
|
|
|
- ExampleDetails endExampleDetails = createExampleDetails(
|
|
|
- exampleInfo.getId(), processInfo.getId(), null, ButtonNameEnum.END.getType());
|
|
|
+ ExampleDetails endDetails = new ExampleDetails();
|
|
|
+ endDetails.setExampleInfoId(exampleInfo.getId());
|
|
|
+ endDetails.setProcessInfoId(processInfo.getId());
|
|
|
+ endDetails.setNameType(ButtonNameEnum.END.getType());
|
|
|
|
|
|
// 封装返回值
|
|
|
exampleResult.setOldExampleInfo(exampleInfo);
|
|
|
- exampleResult.setExampleDetailsIdList(
|
|
|
- Arrays.asList(startExampleDetails.getId(), endExampleDetails.getId()));
|
|
|
+ exampleResult.setExampleInfo(exampleInfo);
|
|
|
+ exampleResult.setExampleDetailsIdList(Arrays.asList(startDetails.getId(), endDetails.getId()));
|
|
|
exampleResult.setHandleType(ButtonNameEnum.END.getType());
|
|
|
exampleResult.setCacheDataStr(cacheData);
|
|
|
return R.data(exampleResult);
|
|
|
}
|
|
|
|
|
|
- Long processTenantId = processTenant.getId();
|
|
|
- exampleInfo.setFlowType(FlowConstant.FLOW_TYPE_TENANT);
|
|
|
- exampleInfo.setProcessTenantId(processTenantId);
|
|
|
-
|
|
|
- // 开始节点明细赋值租户流程id
|
|
|
- startExampleDetails.setProcessTenantId(processTenant.getId());
|
|
|
-
|
|
|
- // 获取跳转节点
|
|
|
- nodeCode = ObjectUtil.isNotEmpty(nodeCode) ? nodeCode : FlowConstant.START_CODE;
|
|
|
-
|
|
|
- // 如果流程跳转到结束
|
|
|
- if (FlowConstant.END_CODE.equals(nodeCode)) {
|
|
|
- exampleInfoEnd(exampleInfo);
|
|
|
- exampleInfo.setHandleResult(HandleResultEnum.ADOPT.getType());
|
|
|
- exampleInfoService.save(exampleInfo);
|
|
|
-
|
|
|
- ExampleDetails endExampleDetails = createExampleDetails(exampleInfo, ButtonNameEnum.END.getType());
|
|
|
-
|
|
|
- startExampleDetails.setExampleInfoId(exampleInfo.getId());
|
|
|
- endExampleDetails.setExampleInfoId(exampleInfo.getId());
|
|
|
- saveExampleDetails(startExampleDetails, endExampleDetails);
|
|
|
-
|
|
|
- // 返回值
|
|
|
- exampleResult.setOldExampleInfo(exampleInfo);
|
|
|
- exampleResult.setCacheDataStr(cacheData);
|
|
|
- exampleResult.setExampleDetailsIdList(
|
|
|
- Arrays.asList(startExampleDetails.getId(), endExampleDetails.getId()));
|
|
|
- exampleResult.setHandleType(ButtonNameEnum.END.getType());
|
|
|
-
|
|
|
- return R.data(exampleResult);
|
|
|
- }
|
|
|
-
|
|
|
// 查询节点
|
|
|
- ProcessNodeButton processNodeButton = processNodeButtonService.getOne(
|
|
|
- Wrappers.<ProcessNodeButton>lambdaQuery()
|
|
|
- .eq(ProcessNodeButton::getProcessTenantId, processTenantId)
|
|
|
- .eq(ProcessNodeButton::getProcessNodeCode, nodeCode));
|
|
|
-
|
|
|
+ ProcessNodeButton processNodeButton = processNodeButtonService.getOne(Wrappers.<ProcessNodeButton>lambdaQuery()
|
|
|
+ .eq(ProcessNodeButton::getProcessTenantId, processTenant.getId())
|
|
|
+ .eq(ProcessNodeButton::getProcessNodeCode, FlowConstant.START_CODE));
|
|
|
Assert.notEmpty(processNodeButton, FlowExplainConstant.SPECIFY_BRANCH_EMPTY);
|
|
|
|
|
|
- // 赋值所在节点
|
|
|
- startExampleDetails.setProcessNodeId(processNodeButton.getProcessNodeId());
|
|
|
- startExampleDetails.setProcessNodeButtonId(processNodeButton.getId());
|
|
|
-
|
|
|
- // 如果所在节点是开始节点,流转到下一节点,否则所在节点是指定code的节点
|
|
|
- Long jumpNodeId;
|
|
|
- String jumpNodeCode;
|
|
|
- if (FlowConstant.START_CODE.equals(processNodeButton.getProcessNodeCode())) {
|
|
|
- jumpNodeId = processNodeButton.getJumpNodeId();
|
|
|
- jumpNodeCode = processNodeButton.getJumpNodeCode();
|
|
|
- } else {
|
|
|
- jumpNodeId = processNodeButton.getProcessNodeId();
|
|
|
- jumpNodeCode = processNodeButton.getProcessNodeCode();
|
|
|
- }
|
|
|
-
|
|
|
- // 如果流程跳转到结束
|
|
|
- if (FlowConstant.END_CODE.equals(jumpNodeCode)) {
|
|
|
-
|
|
|
- exampleInfoEnd(exampleInfo);
|
|
|
- exampleInfo.setHandleResult(HandleResultEnum.ADOPT.getType());
|
|
|
- exampleInfoService.save(exampleInfo);
|
|
|
-
|
|
|
- ExampleDetails endExampleDetails = createExampleDetails(exampleInfo, ButtonNameEnum.END.getType());
|
|
|
-
|
|
|
- startExampleDetails.setExampleInfoId(exampleInfo.getId());
|
|
|
-
|
|
|
- endExampleDetails.setExampleInfoId(exampleInfo.getId());
|
|
|
- endExampleDetails.setProcessNodeId(jumpNodeId);
|
|
|
-
|
|
|
- saveExampleDetails(startExampleDetails, endExampleDetails);
|
|
|
-
|
|
|
- // 返回值
|
|
|
- exampleResult.setExampleDetailsIdList(
|
|
|
- Arrays.asList(startExampleDetails.getId(), endExampleDetails.getId()));
|
|
|
- exampleResult.setHandleType(ButtonNameEnum.END.getType());
|
|
|
-
|
|
|
- } else {
|
|
|
- exampleInfo.setComplete(StatusConstant.NO);
|
|
|
- exampleInfo.setProcessNodeId(jumpNodeId);
|
|
|
- exampleInfo.setProcessNodeCode(jumpNodeCode);
|
|
|
- exampleInfo.setHandleResult(HandleResultEnum.NOT_START.getType());
|
|
|
- exampleInfoService.save(exampleInfo);
|
|
|
-
|
|
|
- startExampleDetails.setExampleInfoId(exampleInfo.getId());
|
|
|
- exampleDetailsService.save(startExampleDetails);
|
|
|
-
|
|
|
- // 返回值
|
|
|
- exampleResult.setExampleDetailsIdList(Collections.singletonList(startExampleDetails.getId()));
|
|
|
- }
|
|
|
+ exampleInfo.setFlowType(FlowConstant.FLOW_TYPE_TENANT);
|
|
|
+ exampleInfo.setProcessTenantId(processTenant.getId());
|
|
|
+ exampleInfo.setProcessNodeId(processNodeButton.getProcessNodeId());
|
|
|
+ exampleInfo.setProcessNodeCode(processNodeButton.getProcessNodeCode());
|
|
|
+ exampleInfo.setComplete(StatusConstant.NO);
|
|
|
+ exampleInfo.setHandleResult(HandleResultEnum.IN_PROGRESS.getType());
|
|
|
+ exampleInfoService.save(exampleInfo);
|
|
|
|
|
|
- exampleResult.setOldExampleInfo(exampleInfo);
|
|
|
- exampleResult.setCacheDataStr(cacheData);
|
|
|
+ JumpVo jumpVo = new JumpVo();
|
|
|
+ setJumpNode(jumpVo, processNodeButton, nodeCode);
|
|
|
+ exampleResult.setJumpVo(jumpVo);
|
|
|
|
|
|
return R.data(exampleResult);
|
|
|
}
|
|
|
|
|
|
- @GetMapping(GET_NODE_BUTTON_BY_ID)
|
|
|
+ @GetMapping(GET_JUMP_VO)
|
|
|
@Override
|
|
|
- public R<ProcessNodeButton> getNodeButtonById(Long buttonId) {
|
|
|
+ public R<JumpVo> getJumpVo(Long buttonId, String nodeCode) {
|
|
|
+ JumpVo jumpVo = new JumpVo();
|
|
|
+
|
|
|
ProcessNodeButton processNodeButton = processNodeButtonService.getById(buttonId);
|
|
|
Assert.notEmpty(processNodeButton, "nodeButton is null");
|
|
|
|
|
|
- return R.data(processNodeButton);
|
|
|
+ setJumpNode(jumpVo, processNodeButton, nodeCode);
|
|
|
+
|
|
|
+ return R.data(jumpVo);
|
|
|
}
|
|
|
|
|
|
|
|
@@ -222,13 +161,13 @@ public class FlowClient implements IFlowClient {
|
|
|
|
|
|
// 返回值
|
|
|
ExampleResult exampleResult = new ExampleResult();
|
|
|
- exampleResult.setDeleteExample(false);
|
|
|
|
|
|
// 创建流程实例
|
|
|
ExampleInfo oleExampleInfo = exampleInfoService.getOne(Wrappers.<ExampleInfo>lambdaQuery()
|
|
|
.eq(ExampleInfo::getFlowLinkNo, jumpVo.getFlowLinkNo())
|
|
|
.eq(ExampleInfo::getComplete, StatusConstant.NO));
|
|
|
|
|
|
+ // 复制除一个对象做修改
|
|
|
ExampleInfo exampleInfo = ObjectUtil.clone(oleExampleInfo);
|
|
|
Assert.notEmpty(exampleInfo, FlowExplainConstant.EXAMPLE_INFO_NULL);
|
|
|
|
|
@@ -239,99 +178,53 @@ public class FlowClient implements IFlowClient {
|
|
|
|
|
|
// 明细
|
|
|
ExampleDetails exampleDetails = createExampleDetails(exampleInfo, jumpVo.getNameType());
|
|
|
- exampleDetails.setProcessNodeId(exampleInfo.getProcessNodeId());
|
|
|
exampleDetails.setProcessNodeButtonId(jumpVo.getButtonId());
|
|
|
- exampleDetails.setRemarks(jumpVo.getRemarks());
|
|
|
exampleDetails.setHandleUserId(AuthUtil.getUserId());
|
|
|
+ exampleDetails.setRemarks(jumpVo.getRemarks());
|
|
|
|
|
|
- // 流程结束
|
|
|
- if (FlowConstant.END_CODE.equals(jumpVo.getJumpNodeCode())) {
|
|
|
-
|
|
|
- // 赋值流程结束
|
|
|
- exampleInfoEnd(exampleInfo);
|
|
|
- exampleInfo.setHandleResult(HandleResultEnum.ADOPT.getType());
|
|
|
- exampleInfoService.updateById(exampleInfo);
|
|
|
-
|
|
|
- // 结束明细
|
|
|
- ExampleDetails endExampleDetails = createExampleDetails(exampleInfo, ButtonNameEnum.END.getType());
|
|
|
+ // 赋值按钮处理方法
|
|
|
+ exampleResult.setHandleType(jumpVo.getNameType());
|
|
|
|
|
|
- exampleDetails.setExampleInfoId(exampleInfo.getId());
|
|
|
- endExampleDetails.setExampleInfoId(exampleInfo.getId());
|
|
|
- saveExampleDetails(exampleDetails, endExampleDetails);
|
|
|
+ if (ButtonNameEnum.REJECT.getType().equals(jumpVo.getNameType())) {
|
|
|
|
|
|
- exampleResult.setOldExampleInfo(oleExampleInfo);
|
|
|
- exampleResult.setCacheDataStr(exampleInfo.getCacheData());
|
|
|
- exampleResult.setExampleDetailsIdList(Arrays.asList(exampleDetails.getId(), endExampleDetails.getId()));
|
|
|
- exampleResult.setHandleType(ButtonNameEnum.END.getType());
|
|
|
- return R.data(exampleResult);
|
|
|
- }
|
|
|
+ exampleInfo.setHandleResult(HandleResultEnum.FAIL.getType());
|
|
|
|
|
|
- // 如果是自定义节点跳转
|
|
|
- if (jumpVo.isSpecifyJump()) {
|
|
|
- List<ProcessNodeButton> list = processNodeButtonService.list(Wrappers.<ProcessNodeButton>lambdaQuery()
|
|
|
- .eq(ProcessNodeButton::getProcessTenantId, exampleInfo.getProcessTenantId())
|
|
|
- .eq(ProcessNodeButton::getProcessNodeCode, jumpVo.getJumpNodeCode()));
|
|
|
+ } else if (FlowConstant.END_CODE.equals(jumpVo.getJumpNodeCode())) {
|
|
|
|
|
|
- if (list.size() == 0) {
|
|
|
- throw new ServiceException(FlowExplainConstant.NOT_CODE);
|
|
|
- }
|
|
|
+ exampleInfo.setHandleResult(HandleResultEnum.SUCCESS.getType());
|
|
|
|
|
|
- if (list.size() > 1) {
|
|
|
- throw new ServiceException(FlowExplainConstant.MULTIPLE_CODE);
|
|
|
- }
|
|
|
+ // 赋值结束处理方法
|
|
|
+ exampleResult.setHandleType(ButtonNameEnum.END.getType());
|
|
|
|
|
|
- ProcessNodeButton processNodeButton = list.get(0);
|
|
|
- jumpVo.setJumpNodeId(processNodeButton.getJumpNodeId());
|
|
|
- jumpVo.setJumpNodeCode(processNodeButton.getJumpNodeCode());
|
|
|
- jumpVo.setNameType(processNodeButton.getNameType());
|
|
|
}
|
|
|
|
|
|
- // 通过结束
|
|
|
- if (ButtonNameEnum.END.getType().equals(jumpVo.getNameType())) {
|
|
|
- exampleInfoEnd(exampleInfo);
|
|
|
- exampleInfo.setHandleResult(HandleResultEnum.ADOPT.getType());
|
|
|
+ exampleInfo.setProcessNodeId(jumpVo.getJumpNodeId());
|
|
|
+ exampleInfo.setProcessNodeCode(jumpVo.getJumpNodeCode());
|
|
|
|
|
|
- ExampleDetails endExampleDetails = createExampleDetails(exampleInfo, ButtonNameEnum.END.getType());
|
|
|
- endExampleDetails.setProcessNodeId(jumpVo.getJumpNodeId());
|
|
|
-
|
|
|
- exampleDetails.setExampleInfoId(exampleInfo.getId());
|
|
|
- endExampleDetails.setExampleInfoId(exampleInfo.getId());
|
|
|
- saveExampleDetails(exampleDetails, endExampleDetails);
|
|
|
- // 流程实例明细id
|
|
|
- exampleResult.setExampleDetailsIdList(Arrays.asList(exampleDetails.getId(), endExampleDetails.getId()));
|
|
|
- }
|
|
|
- // 驳回结束
|
|
|
- else if (ButtonNameEnum.REJECT.getType().equals(jumpVo.getNameType())) {
|
|
|
- exampleInfoEnd(exampleInfo);
|
|
|
- exampleInfo.setHandleResult(HandleResultEnum.FAIL.getType());
|
|
|
+ List<Long> exampleDetailsIdList = new ArrayList<>();
|
|
|
|
|
|
- ExampleDetails endExampleDetails = createExampleDetails(exampleInfo, ButtonNameEnum.END.getType());
|
|
|
- endExampleDetails.setProcessNodeId(jumpVo.getJumpNodeId());
|
|
|
+ // 流程结束
|
|
|
+ if (FlowConstant.END_CODE.equals(jumpVo.getJumpNodeCode())) {
|
|
|
|
|
|
- exampleDetails.setExampleInfoId(exampleInfo.getId());
|
|
|
- endExampleDetails.setExampleInfoId(exampleInfo.getId());
|
|
|
- saveExampleDetails(exampleDetails, exampleDetails);
|
|
|
+ exampleInfo.setComplete(StatusConstant.YES);
|
|
|
|
|
|
- // 流程实例明细id
|
|
|
- exampleResult.setExampleDetailsIdList(Arrays.asList(exampleDetails.getId(), endExampleDetails.getId()));
|
|
|
- }
|
|
|
- // 流程流转
|
|
|
- else {
|
|
|
- exampleInfo.setProcessNodeId(jumpVo.getJumpNodeId());
|
|
|
- exampleInfo.setProcessNodeCode(jumpVo.getJumpNodeCode());
|
|
|
- exampleInfo.setHandleResult(HandleResultEnum.START.getType());
|
|
|
+ // 结束明细
|
|
|
+ ExampleDetails endExampleDetails = createExampleDetails(exampleInfo, ButtonNameEnum.END.getType());
|
|
|
|
|
|
- exampleDetails.setExampleInfoId(exampleInfo.getId());
|
|
|
+ exampleDetailsService.saveBatch(Arrays.asList(exampleDetails, endExampleDetails));
|
|
|
+ exampleDetailsIdList.add(exampleDetails.getId());
|
|
|
+ exampleDetailsIdList.add(endExampleDetails.getId());
|
|
|
+ } else {
|
|
|
exampleDetailsService.save(exampleDetails);
|
|
|
-
|
|
|
- // 流程实例明细id
|
|
|
- exampleResult.setExampleDetailsIdList(Collections.singletonList(exampleDetails.getId()));
|
|
|
+ exampleDetailsIdList.add(exampleDetails.getId());
|
|
|
}
|
|
|
|
|
|
exampleInfoService.updateById(exampleInfo);
|
|
|
+
|
|
|
exampleResult.setOldExampleInfo(oleExampleInfo);
|
|
|
+ exampleResult.setExampleInfo(exampleInfo);
|
|
|
exampleResult.setCacheDataStr(exampleInfo.getCacheData());
|
|
|
- exampleResult.setHandleType(jumpVo.getNameType());
|
|
|
+ exampleResult.setExampleDetailsIdList(exampleDetailsIdList);
|
|
|
|
|
|
return R.data(exampleResult);
|
|
|
}
|
|
@@ -358,40 +251,45 @@ public class FlowClient implements IFlowClient {
|
|
|
);
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 创建流程实例明细
|
|
|
- */
|
|
|
- private ExampleDetails createExampleDetails(ExampleInfo exampleInfo, Integer nameType) {
|
|
|
- return createExampleDetails(
|
|
|
- exampleInfo.getId(), exampleInfo.getProcessInfoId(), exampleInfo.getProcessTenantId(), nameType);
|
|
|
- }
|
|
|
+ private void setJumpNode(JumpVo jumpVo, ProcessNodeButton processNodeButton, String nodeCode) {
|
|
|
+ // 赋值按钮名称类型
|
|
|
+ jumpVo.setNameType(processNodeButton.getNameType());
|
|
|
+ jumpVo.setButtonId(processNodeButton.getId());
|
|
|
|
|
|
- /**
|
|
|
- * 创建流程实例明细
|
|
|
- */
|
|
|
- private ExampleDetails createExampleDetails(Long exampleInfoId, Long processInfoId, Long processTenantId, Integer nameType) {
|
|
|
- ExampleDetails endExampleDetails = new ExampleDetails();
|
|
|
- endExampleDetails.setExampleInfoId(exampleInfoId);
|
|
|
- endExampleDetails.setProcessInfoId(processInfoId);
|
|
|
- endExampleDetails.setProcessTenantId(processTenantId);
|
|
|
- endExampleDetails.setNameType(nameType);
|
|
|
- return endExampleDetails;
|
|
|
- }
|
|
|
+ // 非分支跳转
|
|
|
+ if (ObjectUtil.isNotEmpty(processNodeButton.getJumpNodeId())) {
|
|
|
+ jumpVo.setJumpNodeId(processNodeButton.getJumpNodeId());
|
|
|
+ jumpVo.setJumpNodeCode(processNodeButton.getJumpNodeCode());
|
|
|
+ }
|
|
|
+ // 分支跳转
|
|
|
+ else {
|
|
|
+ // 跳转节点编码不为空
|
|
|
+ Assert.notEmpty(nodeCode, FlowExplainConstant.SPECIFY_BRANCH_EMPTY);
|
|
|
|
|
|
- /**
|
|
|
- * 赋值实例结束参数
|
|
|
- */
|
|
|
- private void exampleInfoEnd(ExampleInfo exampleInfo) {
|
|
|
- exampleInfo.setComplete(StatusConstant.YES);
|
|
|
- exampleInfo.setProcessNodeId(FlowConstant.OVER_PROCESS_FLAG);
|
|
|
- exampleInfo.setProcessNodeCode(FlowConstant.END_CODE);
|
|
|
+ // 查询跳转到哪个分支节点
|
|
|
+ ProcessNode processNode = processNodeService.getOne(Wrappers.<ProcessNode>lambdaQuery()
|
|
|
+ .eq(ProcessNode::getParentId, processNodeButton.getProcessNodeId())
|
|
|
+ .eq(ProcessNode::getCode, nodeCode));
|
|
|
+
|
|
|
+ // 分支节点不为空
|
|
|
+ Assert.notEmpty(processNode, FlowExplainConstant.SPECIFY_BRANCH_EMPTY);
|
|
|
+
|
|
|
+ jumpVo.setJumpNodeId(processNode.getId());
|
|
|
+ jumpVo.setJumpNodeCode(processNode.getCode());
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 保存流程明细
|
|
|
+ * 创建流程实例明细
|
|
|
*/
|
|
|
- private void saveExampleDetails(ExampleDetails... exampleDetails) {
|
|
|
- exampleDetailsService.saveBatch(Arrays.asList(exampleDetails));
|
|
|
+ private ExampleDetails createExampleDetails(ExampleInfo exampleInfo, Integer nameType) {
|
|
|
+ ExampleDetails exampleDetails = new ExampleDetails();
|
|
|
+ exampleDetails.setExampleInfoId(exampleInfo.getId());
|
|
|
+ exampleDetails.setProcessInfoId(exampleInfo.getProcessInfoId());
|
|
|
+ exampleDetails.setProcessTenantId(exampleInfo.getProcessTenantId());
|
|
|
+ exampleDetails.setProcessNodeId(exampleInfo.getProcessNodeId());
|
|
|
+ exampleDetails.setNameType(nameType);
|
|
|
+ return exampleDetails;
|
|
|
}
|
|
|
|
|
|
}
|