|
@@ -23,7 +23,6 @@ import com.persagy.ibms.core.data.SceneDataObject;
|
|
|
import com.persagy.ibms.core.data.SceneDataPrimitive;
|
|
|
import com.persagy.ibms.core.data.SceneDataSet;
|
|
|
import com.persagy.ibms.core.data.SceneDataValue;
|
|
|
-import com.persagy.ibms.core.data.SceneProperty;
|
|
|
import com.persagy.ibms.core.util.ComputeUtil;
|
|
|
import com.persagy.ibms.core.util.ExamineUtil;
|
|
|
import com.persagy.ibms.core.util.ExceptionItem;
|
|
@@ -139,118 +138,6 @@ public class RestUtil {
|
|
|
return JSONObject.toJSONString(JSON, SerializerFeature.WriteMapNullValue);
|
|
|
}
|
|
|
|
|
|
- public static String check() {
|
|
|
- RepositoryImpl Repository = RepositoryContainer.instance;
|
|
|
- for (String key : Repository.objectData.keySet()) {
|
|
|
- SceneDataValue sdv = Repository.objectData.get(key);
|
|
|
- SceneProperty rel_sp = null;
|
|
|
- for (SceneProperty sp : Repository.objectData.rel_object.getPropertyList()) {
|
|
|
- if (sp.propertyName.equals(key)) {
|
|
|
- rel_sp = sp;
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- checkProperty(key, Repository.objectData, key, rel_sp, sdv);
|
|
|
- }
|
|
|
- return null;
|
|
|
- }
|
|
|
-
|
|
|
- private static void checkProperty(String path, SceneDataObject parentObjectData, String myPropertyName, SceneProperty rel_sp,
|
|
|
- SceneDataValue sdv) {
|
|
|
- // log.info("begin checkProperty:" + path);
|
|
|
- if (parentObjectData != null && myPropertyName != null && sdv.parentObjectData != null && sdv.myPropertyName != null
|
|
|
- && parentObjectData.equals(sdv.parentObjectData) && myPropertyName.equals(sdv.myPropertyName)) {
|
|
|
-
|
|
|
- } else if (parentObjectData == null && myPropertyName == null && sdv.parentObjectData == null && sdv.myPropertyName == null) {
|
|
|
-
|
|
|
- } else {
|
|
|
- log.info("checkProperty:a " + path);
|
|
|
- }
|
|
|
-
|
|
|
- if (rel_sp != null && sdv.rel_property != null && rel_sp.equals(sdv.rel_property)) {
|
|
|
-
|
|
|
- } else if (rel_sp == null && sdv.rel_property == null) {
|
|
|
-
|
|
|
- } else {
|
|
|
- log.info("checkProperty:b " + path);
|
|
|
- }
|
|
|
-
|
|
|
- if (sdv.rel_property != null) {
|
|
|
- if (sdv.rel_property.propertyValueSchema.equals("JSONObject") && sdv.value_object != null) {
|
|
|
-
|
|
|
- } else if (sdv.rel_property.propertyValueSchema.equals("JSONArray") && sdv.value_array != null) {
|
|
|
-
|
|
|
- } else if (!sdv.rel_property.propertyValueSchema.equals("JSONObject") && !sdv.rel_property.propertyValueSchema.equals("JSONArray")
|
|
|
- && sdv.value_object == null && sdv.value_array == null) {
|
|
|
-
|
|
|
- } else {
|
|
|
- log.info("checkProperty:c " + path);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- if (sdv.rel_property != null && !sdv.rel_property.propertyValueType.equals("custom") && !sdv.finish) {
|
|
|
- log.info("checkProperty:d " + path);
|
|
|
- }
|
|
|
-
|
|
|
- if (sdv.rel_property != null) {
|
|
|
- if (sdv.value_object != null) {
|
|
|
- checkObject(path, parentObjectData, myPropertyName, null, sdv.value_object);
|
|
|
- } else if (sdv.value_array != null) {
|
|
|
- for (int i = 0; i < sdv.value_array.set.size(); i++) {
|
|
|
- SceneDataObject sdb = sdv.value_array.set.get(i);
|
|
|
- if (sdb instanceof SceneDataObject) {
|
|
|
- SceneDataObject sod = (SceneDataObject) sdb;
|
|
|
- checkObject(path + "[" + i + "]", null, null, sdv, sod);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- private static void checkObject(String path, SceneDataObject parentObjectData, String myPropertyName, SceneDataValue parentArrayData,
|
|
|
- SceneDataObject sdo) {
|
|
|
- // log.info("begin checkObject:" + path);
|
|
|
- if (parentObjectData != null && sdo.parentObjectData != null && myPropertyName != null && sdo.myPropertyName != null
|
|
|
- && parentArrayData == null && sdo.parentArrayData == null && parentObjectData.equals(sdo.parentObjectData)
|
|
|
- && myPropertyName.equals(sdo.myPropertyName)) {
|
|
|
-
|
|
|
- } else if (parentObjectData == null && sdo.parentObjectData == null && myPropertyName == null && sdo.myPropertyName == null
|
|
|
- && parentArrayData != null && sdo.parentArrayData != null && parentArrayData.equals(sdo.parentArrayData)) {
|
|
|
-
|
|
|
- } else if (parentObjectData == null && sdo.parentObjectData == null && myPropertyName == null && sdo.myPropertyName == null
|
|
|
- && parentArrayData == null && sdo.parentArrayData == null) {
|
|
|
-
|
|
|
- } else {
|
|
|
- log.info("checkObject:" + path);
|
|
|
- }
|
|
|
-
|
|
|
- for (String key : sdo.keySet()) {
|
|
|
- SceneProperty rel_sp = null;
|
|
|
- if (sdo.rel_object != null) {
|
|
|
- for (SceneProperty sp : sdo.rel_object.getPropertyList()) {
|
|
|
- if (sp.propertyName.equals(key)) {
|
|
|
- rel_sp = sp;
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- if (rel_sp == null) {
|
|
|
- if (sdo.query_attached != null) {
|
|
|
- for (SceneProperty sp : sdo.query_attached) {
|
|
|
- if (sp.propertyName.equals(key)) {
|
|
|
- rel_sp = sp;
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- if (rel_sp != null) {
|
|
|
- SceneDataValue sdv = sdo.get(key);
|
|
|
- checkProperty(path + "." + key, sdo, key, rel_sp, sdv);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
public static String desc(String param) {
|
|
|
JSONArray path = JSON.parseArray(param);
|
|
|
String[] valuePath = new String[path.size()];
|