|
@@ -1,5 +1,6 @@
|
|
|
package com.fjhx.utils;
|
|
|
|
|
|
+import cn.hutool.core.bean.BeanUtil;
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
import cn.hutool.extra.spring.SpringUtil;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
@@ -14,6 +15,7 @@ import com.fjhx.enums.ButtonNameEnum;
|
|
|
import com.fjhx.feign.IFlowClient;
|
|
|
import com.fjhx.params.ExampleInfoEx;
|
|
|
import com.fjhx.params.FlowInfo;
|
|
|
+import com.fjhx.params.GetNodeButtonVo;
|
|
|
import org.springblade.core.tool.api.R;
|
|
|
|
|
|
public class FlowConstructor {
|
|
@@ -66,9 +68,9 @@ public class FlowConstructor {
|
|
|
if (ObjectUtil.isEmpty(processTenant)) {
|
|
|
exampleInfo.setProcessNodeId(FlowConstant.OVER_PROCESS_FLAG);
|
|
|
exampleInfo.setComplete(StatusConstant.YES);
|
|
|
+ exampleInfo.setProcessNodeCode(FlowConstant.END_CODE);
|
|
|
|
|
|
startExampleDetails.setNameType(ButtonNameEnum.START.getType());
|
|
|
-
|
|
|
|
|
|
exampleAbstract.end();
|
|
|
}
|
|
@@ -81,8 +83,13 @@ public class FlowConstructor {
|
|
|
|
|
|
|
|
|
String circulation = exampleAbstract.circulation(FlowConstant.START_CODE);
|
|
|
- R<ProcessNodeButton> nodeButtonResult = flowClient.getNodeButton(processTenantId, circulation);
|
|
|
- Assert.eqTrue(r.isSuccess(), r.getMsg());
|
|
|
+
|
|
|
+ GetNodeButtonVo getNodeButtonVo = new GetNodeButtonVo();
|
|
|
+ getNodeButtonVo.setProcessTenantId(processTenantId);
|
|
|
+ getNodeButtonVo.setNodeCode(ObjectUtil.isEmpty(circulation) ? FlowConstant.START_CODE : circulation);
|
|
|
+
|
|
|
+ R<ProcessNodeButton> nodeButtonResult = flowClient.getNodeButton(getNodeButtonVo);
|
|
|
+ Assert.eqTrue(nodeButtonResult.isSuccess(), nodeButtonResult.getMsg());
|
|
|
|
|
|
ProcessNodeButton processNodeButton = nodeButtonResult.getData();
|
|
|
startExampleDetails.setProcessNodeId(processNodeButton.getProcessNodeId());
|
|
@@ -95,6 +102,7 @@ public class FlowConstructor {
|
|
|
|
|
|
if (jumpNodeId.equals(FlowConstant.OVER_PROCESS_FLAG)) {
|
|
|
exampleInfo.setComplete(StatusConstant.YES);
|
|
|
+ exampleInfo.setProcessNodeCode(FlowConstant.END_CODE);
|
|
|
exampleAbstract.end();
|
|
|
}
|
|
|
|
|
@@ -104,15 +112,77 @@ public class FlowConstructor {
|
|
|
|
|
|
|
|
|
exampleInfo.setProcessNodeId(jumpNodeId);
|
|
|
+ exampleInfo.setProcessNodeCode(processNodeButton.getProcessNodeCode());
|
|
|
}
|
|
|
exampleInfo.setExampleDetails(startExampleDetails);
|
|
|
|
|
|
|
|
|
- R<ExampleInfo> exampleInfoResult = flowClient.exampleInfoSave(exampleInfo);
|
|
|
- Assert.eqTrue(r.isSuccess(), r.getMsg());
|
|
|
+ R<ExampleInfo> exampleInfoSaveResult = flowClient.exampleInfoSave(exampleInfo);
|
|
|
+ Assert.eqTrue(exampleInfoSaveResult.isSuccess(), exampleInfoSaveResult.getMsg());
|
|
|
|
|
|
- return exampleInfoResult.getData();
|
|
|
+ return exampleInfoSaveResult.getData();
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ * 流程跳转
|
|
|
+ *
|
|
|
+ * @param businessId 业务id
|
|
|
+ * @param buttonId 按钮id
|
|
|
+ * @param remarks 审批意见
|
|
|
+ */
|
|
|
+ public void jump(Long businessId, Long buttonId, String remarks) {
|
|
|
+
|
|
|
+ R<ExampleInfo> exampleInfoResult = flowClient.getExampleInfo(businessId);
|
|
|
+ Assert.eqTrue(exampleInfoResult.isSuccess(), exampleInfoResult.getMsg());
|
|
|
+
|
|
|
+ ExampleInfo exampleInfo = exampleInfoResult.getData();
|
|
|
+
|
|
|
+
|
|
|
+ GetNodeButtonVo getNodeButtonVo = new GetNodeButtonVo();
|
|
|
+ getNodeButtonVo.setProcessTenantId(exampleInfo.getProcessTenantId());
|
|
|
+ getNodeButtonVo.setNodeCode(exampleAbstract.circulation(exampleInfo.getProcessNodeCode()));
|
|
|
+ getNodeButtonVo.setButtonId(buttonId);
|
|
|
+
|
|
|
+ R<ProcessNodeButton> nodeButtonResult = flowClient.getNodeButton(getNodeButtonVo);
|
|
|
+ Assert.eqTrue(nodeButtonResult.isSuccess(), nodeButtonResult.getMsg());
|
|
|
+
|
|
|
+ ProcessNodeButton processNodeButton = nodeButtonResult.getData();
|
|
|
+
|
|
|
+
|
|
|
+ exampleInfo.setProcessNodeId(processNodeButton.getJumpNodeId());
|
|
|
+ exampleInfo.setProcessNodeCode(processNodeButton.getProcessNodeCode());
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ if (processNodeButton.getJumpNodeId().equals(FlowConstant.OVER_PROCESS_FLAG)) {
|
|
|
+ exampleInfo.setComplete(StatusConstant.YES);
|
|
|
+ exampleInfo.setProcessNodeCode(FlowConstant.END_CODE);
|
|
|
+ exampleAbstract.end();
|
|
|
+ }
|
|
|
+
|
|
|
+ else if (ButtonNameEnum.REJECT.getType().equals(processNodeButton.getNameType())) {
|
|
|
+ exampleInfo.setComplete(StatusConstant.YES);
|
|
|
+ exampleInfo.setProcessNodeCode(FlowConstant.END_CODE);
|
|
|
+ exampleAbstract.fail(processNodeButton.getProcessNodeCode());
|
|
|
+ }
|
|
|
+
|
|
|
+ else {
|
|
|
+ exampleInfo.setComplete(StatusConstant.No);
|
|
|
+ }
|
|
|
+
|
|
|
+ ExampleDetails startExampleDetails = new ExampleDetails();
|
|
|
+ startExampleDetails.setRemarks(remarks);
|
|
|
+ startExampleDetails.setProcessNodeId(processNodeButton.getProcessNodeId());
|
|
|
+ startExampleDetails.setProcessNodeButtonId(processNodeButton.getId());
|
|
|
+ startExampleDetails.setNameType(processNodeButton.getNameType());
|
|
|
+
|
|
|
+ ExampleInfoEx exampleInfoEx = BeanUtil.toBean(exampleInfo, ExampleInfoEx.class);
|
|
|
+ exampleInfoEx.setExampleDetails(startExampleDetails);
|
|
|
+
|
|
|
+
|
|
|
+ R<ExampleInfo> exampleInfoSaveResult = flowClient.exampleInfoSave(exampleInfoEx);
|
|
|
+ Assert.eqTrue(exampleInfoSaveResult.isSuccess(), exampleInfoSaveResult.getMsg());
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
}
|