|
@@ -1945,10 +1945,6 @@ public class Neo4jAPI {
|
|
|
}
|
|
|
if (groupList.size() == 0 || existGroup == false) {
|
|
|
groupItem.put("groupName", group);
|
|
|
- // if (group.equals("感觉损伤")) {
|
|
|
- // titleJson.put("isShow", Integer.valueOf(isShow));
|
|
|
- // }
|
|
|
- // groupItem.put("title", titleJson);
|
|
|
groupItem.put("groupCalculate", groupCalcJson);
|
|
|
}
|
|
|
|
|
@@ -1961,6 +1957,7 @@ public class Neo4jAPI {
|
|
|
|
|
|
|
|
|
Boolean existRow = false;
|
|
|
+
|
|
|
for (int j = 0; j < rowsList.size(); j++) {
|
|
|
JSONObject rowJson = rowsList.getJSONObject(j);
|
|
|
JSONArray rowList = new JSONArray();
|
|
@@ -1973,6 +1970,7 @@ public class Neo4jAPI {
|
|
|
rowJson.put("row", rowList);
|
|
|
}
|
|
|
for (int i = 0; i < rowList.size(); i++) {
|
|
|
+
|
|
|
JSONObject row = rowList.getJSONObject(i);
|
|
|
if (row.containsKey("name") && row.get("name").equals(index)) {
|
|
|
JSONArray details = JSON.parseArray(row.get("details").toString());
|
|
@@ -1998,25 +1996,60 @@ public class Neo4jAPI {
|
|
|
}
|
|
|
details.add(rowDetail);
|
|
|
row.put("details", details);
|
|
|
+ //row.put("indexId", Integer.valueOf(indexId));
|
|
|
}
|
|
|
rowsList.remove(j);
|
|
|
- // if (Integer.valueOf(mutex) == 0 && Integer.valueOf(rowJson.get("indexId").toString()) == Integer.valueOf(indexId)) {
|
|
|
- // rowJson.getJSONArray("row").add(row);
|
|
|
- // } else {
|
|
|
- // rowJson.put("row", rowList);
|
|
|
- // }
|
|
|
rowJson.put("row", rowList);
|
|
|
rowsList.add(rowJson);
|
|
|
existRow = true;
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
+ if (indexId.equals(rowJson.get("indexId").toString()) && existRow == false) {
|
|
|
+ JSONObject row = new JSONObject();
|
|
|
+ row.put("name", index);
|
|
|
+ row.put("coefficient", Integer.valueOf(coefficient));
|
|
|
+ row.put("constant", Integer.valueOf(constant));
|
|
|
+ row.put("controlType", Integer.valueOf(controlType));
|
|
|
+ if (!"NULL".equals(option)) {
|
|
|
+ JSONObject rowDetail = new JSONObject();
|
|
|
+ rowDetail.put("detailName", option);
|
|
|
+ rowDetail.put("score", Integer.valueOf(score));
|
|
|
+ if (scaleItems.length > 0) {
|
|
|
+ JSONArray scaleItem = (JSONArray) JSONArray.toJSON(scaleItems);
|
|
|
+ for (int k = 0; k < scaleItem.size(); k++) {
|
|
|
+ if (scaleItem.get(k).toString().contains(row.getString("name"))) {
|
|
|
+ if (scaleItem.get(k).toString().contains(option)) {
|
|
|
+ rowDetail.put("state", 1);
|
|
|
+ scaleItem.remove(k);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ rowDetail.put("state", 0);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ rowDetail.put("state", 0);
|
|
|
+ }
|
|
|
+ // rowDetail.put("state", 0);
|
|
|
+ JSONArray details = new JSONArray();
|
|
|
+ details.add(rowDetail);
|
|
|
+ row.put("details", details);
|
|
|
+ }
|
|
|
+ rowList.add(row);
|
|
|
+ rowsList.remove(j);
|
|
|
+ rowJson.put("row", rowList);
|
|
|
+ rowsList.add(rowJson);
|
|
|
+ existRow = true;
|
|
|
+ break;
|
|
|
+ }
|
|
|
}
|
|
|
if (rowsList.size() == 0 || existRow == false) {
|
|
|
JSONObject rowJson = new JSONObject();
|
|
|
rowJson.put("metux", Integer.valueOf(mutex));
|
|
|
rowJson.put("required", Integer.valueOf(required));
|
|
|
rowJson.put("indexId", Integer.valueOf(indexId));
|
|
|
+
|
|
|
JSONArray rowList = new JSONArray();
|
|
|
JSONObject row = new JSONObject();
|
|
|
row.put("name", index);
|
|
@@ -2049,7 +2082,6 @@ public class Neo4jAPI {
|
|
|
row.put("details", details);
|
|
|
}
|
|
|
rowList.add(row);
|
|
|
-
|
|
|
rowJson.put("row", rowList);
|
|
|
rowsList.add(rowJson);
|
|
|
}
|