网友小郑 9 bulan lalu
induk
melakukan
a69e101f32
2 mengubah file dengan 40 tambahan dan 16 penghapusan
  1. 40 11
      app.py
  2. 0 5
      ceshi.py

+ 40 - 11
app.py

@@ -98,8 +98,9 @@ def inputMsg():
     其他公里、千米的单位转换为米
     输出的json格式数据如下:
     {{
-        "districtName": "抱坡区",
+        "districtName": "抱坡区",
         "landType": "耕地",
+<<<<<<< HEAD
         "area": {{
             "min": 30,
             "max": 50
@@ -134,6 +135,34 @@ def inputMsg():
     factors中type是因子名称,需与因子选择中的信息保持一致
     json中"condition"的值为"gt"、"lt"、"get"、"let"、"between","not_intersect"、"intersect"、"not_contain"、"contain"、"between"
     json中"type"的值如果为"医院"则需改为"医疗卫生设施"
+=======
+        "area": {{
+            "min": 30,
+            "max": 50
+        }},
+        "factors": [
+            {{
+                "type": "水库",
+                "condition": "大于",
+                "value": "100"
+            }},
+            {{
+                "type": "永久基本农田",
+                "condition": "不相交"
+            }},
+            {{
+                "type": "城镇开发边界内",
+                "condition": "包含"
+            }},
+            {{
+                "type": "医疗卫生设施",
+                "condition": "小于",
+                "value": "500"
+            }},
+        ]
+    }}
+    把json中"condition"的值改为"gt"、"lt"、"get"、"let"、"between","not_intersect"、"intersect"、"not_contain"、"contain"、"between"
+>>>>>>> 9c82d2f7fdcb99e45510a207fab90680cff9ce6a
     """
 
     try:                                                                                                             
@@ -181,8 +210,8 @@ def jsonResToDict(json_res):
         "xmmc": "规划选址项目_"+formatted_time,
         "jsdw": "建设单位",
         "ydxz_bsm": landType,
-        "ydmjbegin": json_res["ydmjbegin"],
-        "ydmjend":  json_res["ydmjend"],
+        "ydmjbegin": json_res["area"]["min"],
+        "ydmjend":  json_res["area"]["max"],
         "geomId": geomId,
         "yxyz": [],
         # TODO: 循环遍历
@@ -201,15 +230,15 @@ def jsonResToDict(json_res):
         #         }
         #     }
         # ],
-        "useMultiple": json_res["useMultiple"],
-        "useLandType": json_res["useLandType"],
-        "multipleDistance": json_res["multipleDistance"]
+        # "useMultiple": json_res["useMultiple"],
+        # "useLandType": json_res["useLandType"],
+        # "multipleDistance": json_res["multipleDistance"]
     }
     # 循环遍历输入因子
-    factors = json_res["yxyz"]
+    factors = json_res["factors"]
     input_factors = {}
     for factor in factors:
-        factorInfo = getFactorByName(factor["name"])
+        factorInfo = getFactorByName(factor["type"])
         if factorInfo == None:
             continue
         factorId = factorInfo["id"]
@@ -219,13 +248,13 @@ def jsonResToDict(json_res):
 
         factor_info = {
             "id": factorId,
-            "name": factor["name"],
+            "name": factor["type"],
             "bsm": factorBsm,
             "conditionInfo": {
                 "spatial_type": conditionObj["spatial_type"],
-                "default": factor["default"],
+                "default": factor["condition"],
                 "hasValue": conditionObj["hasValue"],
-                "defaultValue": factor["defaultValue"],
+                "defaultValue": factor["value"],
                 "unit": conditionObj["unit"],
                 "clip": conditionObj["clip"]
             }

File diff ditekan karena terlalu besar
+ 0 - 5
ceshi.py


Beberapa file tidak ditampilkan karena terlalu banyak file yang berubah dalam diff ini