Commit f898d867 by dong

fix20230112

parent 9c7c75a1
...@@ -346,38 +346,38 @@ def get_jwd(address): ...@@ -346,38 +346,38 @@ def get_jwd(address):
return lng, lat, code, msg return lng, lat, code, msg
def get_district(district_name): # def get_district(district_name):
district_name1 = '' # district_name1 = ''
if '小店' in district_name: # if '小店' in district_name:
district_name1 = '小店区' # district_name1 = '小店区'
elif '迎泽' in district_name: # elif '迎泽' in district_name:
district_name1 = '迎泽区' # district_name1 = '迎泽区'
elif '杏花岭' in district_name: # elif '杏花岭' in district_name:
district_name1 = '杏花岭区' # district_name1 = '杏花岭区'
elif '尖草坪' in district_name: # elif '尖草坪' in district_name:
district_name1 = '尖草坪区' # district_name1 = '尖草坪区'
elif '万柏林' in district_name: # elif '万柏林' in district_name:
district_name1 = '万柏林区' # district_name1 = '万柏林区'
elif '晋源' in district_name: # elif '晋源' in district_name:
district_name1 = '晋源区' # district_name1 = '晋源区'
elif '古交' in district_name: # elif '古交' in district_name:
district_name1 = '古交市' # district_name1 = '古交市'
#
elif '娄烦' in district_name: # elif '娄烦' in district_name:
district_name1 = '娄烦县' # district_name1 = '娄烦县'
elif '中北高新' in district_name: # elif '中北高新' in district_name:
district_name1 = '中北高新区' # district_name1 = '中北高新区'
elif '清徐开发' in district_name: # elif '清徐开发' in district_name:
district_name1 = '清徐开发区' # district_name1 = '清徐开发区'
elif '清徐' in district_name: # elif '清徐' in district_name:
district_name1 = '清徐县' # district_name1 = '清徐县'
elif '阳曲示范' in district_name: # elif '阳曲示范' in district_name:
district_name1 = '阳曲示范区' # district_name1 = '阳曲示范区'
elif '阳曲' in district_name: # elif '阳曲' in district_name:
district_name1 = '阳曲县' # district_name1 = '阳曲县'
elif '西山示范' in district_name: # elif '西山示范' in district_name:
district_name1 = '西山示范区' # district_name1 = '西山示范区'
return district_name1 # return district_name1
# 三载体批量导入(读取模板数据,保存到数据库) # 三载体批量导入(读取模板数据,保存到数据库)
...@@ -439,7 +439,7 @@ def read_template(): ...@@ -439,7 +439,7 @@ def read_template():
district_name = row_content[1] district_name = row_content[1]
if not any([district_name, carrier_name]): if not any([district_name, carrier_name]):
return jsonify(code=RET.DATAERR, msg='上传失败!所属区域或者楼宇名称不能为空。') return jsonify(code=RET.DATAERR, msg='上传失败!所属区域或者楼宇名称不能为空。')
district_name = get_district(district_name) # district_name = get_district(district_name)
# 判断该楼宇是否已经存在 # 判断该楼宇是否已经存在
build_obj = CarrierBuild.query.filter_by(build_name=carrier_name).first() build_obj = CarrierBuild.query.filter_by(build_name=carrier_name).first()
...@@ -501,7 +501,7 @@ def read_template(): ...@@ -501,7 +501,7 @@ def read_template():
district_name = row_content[2] district_name = row_content[2]
if not any([district_name, carrier_name]): if not any([district_name, carrier_name]):
return jsonify(code=RET.DATAERR, msg='上传失败!所属区域或者土地名称不能为空。') return jsonify(code=RET.DATAERR, msg='上传失败!所属区域或者土地名称不能为空。')
district_name = get_district(district_name) # district_name = get_district(district_name)
land_nature = row_content[3] land_nature = row_content[3]
total_area = row_content[4] total_area = row_content[4]
...@@ -526,7 +526,7 @@ def read_template(): ...@@ -526,7 +526,7 @@ def read_template():
district_name = row_content[1] district_name = row_content[1]
if not any([district_name, carrier_name]): if not any([district_name, carrier_name]):
return jsonify(code=RET.DATAERR, msg='上传失败!所属区域或者厂房名称不能为空。') return jsonify(code=RET.DATAERR, msg='上传失败!所属区域或者厂房名称不能为空。')
district_name = get_district(district_name) # district_name = get_district(district_name)
# 判断该厂房是否已经存在 # 判断该厂房是否已经存在
factory_obj = CarrierFactory.query.filter_by(factory_name=carrier_name).first() factory_obj = CarrierFactory.query.filter_by(factory_name=carrier_name).first()
...@@ -1341,7 +1341,7 @@ def carrier_edit_build(): ...@@ -1341,7 +1341,7 @@ def carrier_edit_build():
build_name = req_dic['build_name'] build_name = req_dic['build_name']
detail_address = req_dic['detail_address'] detail_address = req_dic['detail_address']
if not all([district_name, build_name, detail_address]): if not all([district_name, build_name, detail_address]):
return jsonify(code=RET.PARAMERR, msg="区域名称、载体名称、信息地址不能为空!") return jsonify(code=RET.PARAMERR, msg="所属区县、载体名称、详细地址不能为空!")
# district_name = get_district(district_name) # district_name = get_district(district_name)
# lng = '' # lng = ''
...@@ -1460,7 +1460,7 @@ def carrier_edit_land(): ...@@ -1460,7 +1460,7 @@ def carrier_edit_land():
land_name = req_dic['land_name'] land_name = req_dic['land_name']
detail_address = req_dic['detail_address'] detail_address = req_dic['detail_address']
if not all([district_name, land_name, detail_address]): if not all([district_name, land_name, detail_address]):
return jsonify(code=RET.PARAMERR, msg="区域名称、载体名称、信息地址不能为空!") return jsonify(code=RET.PARAMERR, msg="所属区县、载体名称、详细地址不能为空!")
# district_name = get_district(district_name) # district_name = get_district(district_name)
lng, lat, code, msg = get_jwd(detail_address) lng, lat, code, msg = get_jwd(detail_address)
...@@ -1570,7 +1570,7 @@ def carrier_edit_factory(): ...@@ -1570,7 +1570,7 @@ def carrier_edit_factory():
factory_name = req_dic['factory_name'] factory_name = req_dic['factory_name']
detail_address = req_dic['detail_address'] detail_address = req_dic['detail_address']
if not all([district_name, factory_name, detail_address]): if not all([district_name, factory_name, detail_address]):
return jsonify(code=RET.PARAMERR, msg="区域名称、载体名称、信息地址不能为空!") return jsonify(code=RET.PARAMERR, msg="所属区县、载体名称、详细地址不能为空!")
# district_name = get_district(district_name) # district_name = get_district(district_name)
is_standard = req_dic['is_standard'] is_standard = req_dic['is_standard']
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment