|
|
|
@ -85,12 +85,13 @@ public class SceneRoleServiceImpl implements ISceneRoleService { |
|
|
|
// 连线信息
|
|
|
|
String edgeStr = sceneRole.getContent(); |
|
|
|
JSONObject edgeObj = JSONObject.parseObject(edgeStr); |
|
|
|
if (null != edgeObj) { |
|
|
|
// 节点坐标, 类型信息 用于下方区分出 开始, 结束, 普通 三种节点类型
|
|
|
|
JSONArray nodeArray = JSONArray.parseArray(edgeObj.get("nodes").toString()); |
|
|
|
// 循环节点信息取出开始与结束的id
|
|
|
|
String startId = ""; |
|
|
|
String endId = ""; |
|
|
|
for (int j=0; j<nodeArray.size(); j++) { |
|
|
|
for (int j = 0; j < nodeArray.size(); j++) { |
|
|
|
JSONObject node = nodeArray.getJSONObject(j); |
|
|
|
if ("snaker:start".equals(node.get("type"))) { |
|
|
|
startId = node.get("id").toString(); |
|
|
|
@ -107,7 +108,7 @@ public class SceneRoleServiceImpl implements ISceneRoleService { |
|
|
|
|
|
|
|
List<Map<String, Object>> paramsList = new ArrayList<>(); |
|
|
|
// 在新增的时候进行数据拼装. 避免查询时拼接消耗时间 - 节点拼接
|
|
|
|
for (int i=0; i<nodeArray.size(); i++) { |
|
|
|
for (int i = 0; i < nodeArray.size(); i++) { |
|
|
|
Map<String, Object> tmp = new HashMap<>(); |
|
|
|
// 以节点做为基础进行拼装
|
|
|
|
JSONObject node = nodeArray.getJSONObject(i); |
|
|
|
@ -123,7 +124,7 @@ public class SceneRoleServiceImpl implements ISceneRoleService { |
|
|
|
|
|
|
|
// 循环线信息获取来源, 目标信息
|
|
|
|
Set tmpSet = new HashSet(); |
|
|
|
for (int j=0; j<edgeArray.size(); j++) { |
|
|
|
for (int j = 0; j < edgeArray.size(); j++) { |
|
|
|
JSONObject edge = edgeArray.getJSONObject(j); |
|
|
|
// 先通过来源id和节点进行匹配 , 匹配上后, 当前id便是节点需要钱我
|
|
|
|
// 作为 指向 -1 的倒数第二个节点需要单度处理下
|
|
|
|
@ -143,7 +144,7 @@ public class SceneRoleServiceImpl implements ISceneRoleService { |
|
|
|
} |
|
|
|
|
|
|
|
// 在新增的时候进行数据拼装. 避免查询时拼接消耗时间 - 线拼接
|
|
|
|
for (int i=0; i<edgeArray.size(); i++) { |
|
|
|
for (int i = 0; i < edgeArray.size(); i++) { |
|
|
|
Map<String, Object> tmp = new HashMap<>(); |
|
|
|
// 以线做为基础进行拼装
|
|
|
|
JSONObject edge = edgeArray.getJSONObject(i); |
|
|
|
@ -152,7 +153,7 @@ public class SceneRoleServiceImpl implements ISceneRoleService { |
|
|
|
|
|
|
|
// 循环线信息获取来源, 目标信息
|
|
|
|
Set tmpSet = new HashSet(); |
|
|
|
for (int j=0; j<edgeArray.size(); j++) { |
|
|
|
for (int j = 0; j < edgeArray.size(); j++) { |
|
|
|
JSONObject edge2 = edgeArray.getJSONObject(j); |
|
|
|
// 先通过来源id和节点进行匹配 , 匹配上后, 当前id便是节点需要钱我
|
|
|
|
// 作为 指向 -1 的倒数第二个节点需要单度处理下
|
|
|
|
@ -177,7 +178,7 @@ public class SceneRoleServiceImpl implements ISceneRoleService { |
|
|
|
for (Map<String, Object> m : paramsList) { |
|
|
|
if ("-1".equals(m.get("nodeId"))) { |
|
|
|
qId = m.get("questionId").toString(); // 07
|
|
|
|
for (int j=0; j<edgeArray.size(); j++) { |
|
|
|
for (int j = 0; j < edgeArray.size(); j++) { |
|
|
|
JSONObject edge = edgeArray.getJSONObject(j); |
|
|
|
if (edge.get("targetNodeId").equals(qId)) { |
|
|
|
// 找到指向结束节点的节点
|
|
|
|
@ -201,7 +202,7 @@ public class SceneRoleServiceImpl implements ISceneRoleService { |
|
|
|
} |
|
|
|
|
|
|
|
sceneRole.setResJson(JSON.toJSONString(paramsList)); |
|
|
|
|
|
|
|
} |
|
|
|
UserBean userBean = userApi.getCurrentUser(); |
|
|
|
if (Objects.nonNull(userBean)) { |
|
|
|
sceneRole.setUpdateBy(userBean.getUserName()); |
|
|
|
|