Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mancheng
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
mancheng
Commits
f898d867
Commit
f898d867
authored
Jan 12, 2023
by
dong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix20230112
parent
9c7c75a1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
38 deletions
+38
-38
apps/view_choose/fill_data.py
+38
-38
No files found.
apps/view_choose/fill_data.py
View file @
f898d867
...
@@ -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'
]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment