|
|
@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.fs.common.constant.Constants;
|
|
|
import com.fs.common.core.redis.RedisCacheT;
|
|
|
+import com.fs.common.exception.CustomException;
|
|
|
import com.fs.common.utils.StringUtils;
|
|
|
import com.fs.common.utils.spring.SpringUtils;
|
|
|
import com.fs.company.domain.*;
|
|
|
@@ -81,23 +82,24 @@ public class AiAddWxTaskNode extends AbstractWorkflowNode {
|
|
|
// super.asyncWorkflowForBlockingNode(context.getWorkflowInstanceId(), context.getCurrentNodeKey(),
|
|
|
// context, ExecutionStatusEnum.WAITING);
|
|
|
// return ExecutionResult.waiting().nextNodeKey("").build();
|
|
|
- } else {
|
|
|
- List<CompanyWorkflowEdge> cList = edges.stream().filter(a ->
|
|
|
- StringUtils.isNotBlank(a.getConditionExpr()) && !JSONObject.parseArray(a.getConditionExpr(), AiCallWorkflowConditionVo.class).get(0).isAdd())
|
|
|
- .collect(Collectors.toList());
|
|
|
- // 加微失败,根据条件判断走哪条边
|
|
|
- CompanyWorkflowEdge edge = cList.get(0);
|
|
|
- AiCallWorkflowConditionVo condition = JSONObject.parseObject(edge.getConditionExpr(), AiCallWorkflowConditionVo.class);
|
|
|
- // 匹配失败条件
|
|
|
- if (!condition.isAdd()) {
|
|
|
- log.info("加微失败,执行失败分支 - workflowInstanceId: {}", context.getWorkflowInstanceId());
|
|
|
- super.runNextNode(context, edge);
|
|
|
- return null;
|
|
|
- }
|
|
|
-
|
|
|
- log.error("加微失败但未找到失败分支 - workflowInstanceId: {}", context.getWorkflowInstanceId());
|
|
|
- return null;
|
|
|
}
|
|
|
+// else {
|
|
|
+// List<CompanyWorkflowEdge> cList = edges.stream().filter(a ->
|
|
|
+// StringUtils.isNotBlank(a.getConditionExpr()) && !JSONObject.parseArray(a.getConditionExpr(), AiCallWorkflowConditionVo.class).get(0).isAdd())
|
|
|
+// .collect(Collectors.toList());
|
|
|
+// // 加微失败,根据条件判断走哪条边
|
|
|
+// CompanyWorkflowEdge edge = cList.get(0);
|
|
|
+// AiCallWorkflowConditionVo condition = JSONObject.parseObject(edge.getConditionExpr(), AiCallWorkflowConditionVo.class);
|
|
|
+// // 匹配失败条件
|
|
|
+// if (!condition.isAdd()) {
|
|
|
+// log.info("加微失败,执行失败分支 - workflowInstanceId: {}", context.getWorkflowInstanceId());
|
|
|
+// super.runNextNode(context, edge);
|
|
|
+// return null;
|
|
|
+// }
|
|
|
+//
|
|
|
+// log.error("加微失败但未找到失败分支 - workflowInstanceId: {}", context.getWorkflowInstanceId());
|
|
|
+// return null;
|
|
|
+// }
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
@@ -117,6 +119,10 @@ public class AiAddWxTaskNode extends AbstractWorkflowNode {
|
|
|
CompanyWorkflowNode node = context.getVariable("currentNode", CompanyWorkflowNode.class)==null? getNodeByKey(nodeKey):context.getVariable("currentNode", CompanyWorkflowNode.class);
|
|
|
String nodeConfig = node.getNodeConfig();
|
|
|
AiAddWxConfigVO addWxConfig = JSONObject.parseObject(nodeConfig, AiAddWxConfigVO.class);
|
|
|
+
|
|
|
+ if(null == addWxConfig.getDialogId()){
|
|
|
+ throw new CustomException("加微节点未配置加微话术,执行失败");
|
|
|
+ }
|
|
|
CompanyVoiceRoboticBusiness roboticBusiness = getRoboticBusiness(context.getWorkflowInstanceId());
|
|
|
CompanyWxClient update = new CompanyWxClient();
|
|
|
update.setDialogId(addWxConfig.getDialogId());
|