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
c41f8c37
Commit
c41f8c37
authored
Jan 13, 2023
by
dong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix20230112
parent
2eb94017
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
31 additions
and
25 deletions
+31
-25
apps/inves_manage/siku_view.py
+11
-8
apps/view_360company/view.py
+1
-1
apps/view_choose/choose_view.py
+7
-6
apps/view_choose/fill_data.py
+6
-6
apps/view_choose/view.py
+2
-2
apps/view_map/view.py
+4
-2
No files found.
apps/inves_manage/siku_view.py
View file @
c41f8c37
...
@@ -19,6 +19,9 @@ from dateutil.relativedelta import relativedelta
...
@@ -19,6 +19,9 @@ from dateutil.relativedelta import relativedelta
# 构造项目编号序号
# 构造项目编号序号
from
apps
.
view_choose
.
choose_view
import
get_district_name
def
get_num
(
num
):
def
get_num
(
num
):
if
len
(
str
(
int
(
num
)))
==
1
:
if
len
(
str
(
int
(
num
)))
==
1
:
if
int
(
num
)
==
9
:
if
int
(
num
)
==
9
:
...
@@ -440,9 +443,6 @@ def write_dynamic(user_name, project_id, item, time):
...
@@ -440,9 +443,6 @@ def write_dynamic(user_name, project_id, item, time):
def
search_project
():
def
search_project
():
req_dic
=
request
.
get_json
()
req_dic
=
request
.
get_json
()
token
=
request
.
headers
[
'token'
]
token
=
request
.
headers
[
'token'
]
flag
=
req_dic
[
'flag'
]
# 1为线索库,2为对接库,3为签约库,4为开工库
flag
=
req_dic
[
'flag'
]
# 1为线索库,2为对接库,3为签约库,4为开工库
# 线索库
# 线索库
distribute_condition
=
req_dic
[
'distribute_condition'
]
# 分发情况
distribute_condition
=
req_dic
[
'distribute_condition'
]
# 分发情况
...
@@ -480,16 +480,19 @@ def search_project():
...
@@ -480,16 +480,19 @@ def search_project():
page
=
req_dic
[
'page'
]
page
=
req_dic
[
'page'
]
per_page
=
req_dic
[
'per_page'
]
per_page
=
req_dic
[
'per_page'
]
# try:
try
:
# user_obj = verify_token(token)
user_obj
=
verify_token
(
token
)
# except Exception as e:
user_district
=
get_district_name
(
token
)
# current_app.logger.error(e)
except
Exception
as
e
:
# return jsonify(code=RET.SESSIONERR, msg="进行操作时用户信息校验失败,请重新登陆后尝试!")
current_app
.
logger
.
error
(
e
)
return
jsonify
(
code
=
RET
.
SESSIONERR
,
msg
=
"进行操作时用户信息校验失败,请重新登陆后尝试!"
)
try
:
try
:
project_obj
=
SikuProject
.
query
.
filter
(
project_obj
=
SikuProject
.
query
.
filter
(
SikuProject
.
flag
>=
flag
if
flag
else
text
(
''
),
# 线索库包含所有阶段的项目
SikuProject
.
flag
>=
flag
if
flag
else
text
(
''
),
# 线索库包含所有阶段的项目
SikuProject
.
is_delete
==
0
,
SikuProject
.
is_delete
==
0
,
SikuProject
.
project_to_area
==
user_district
if
flag
==
2
else
text
(
''
),
SikuProject
.
project_to_area1
==
user_district
if
flag
in
[
3
,
4
]
else
text
(
''
),
SikuProject
.
distribute_condition
.
in_
(
distribute_condition_list
)
if
distribute_condition_list
else
SikuProject
.
distribute_condition
==
distribute_condition
if
distribute_condition
else
text
(
''
),
SikuProject
.
distribute_condition
.
in_
(
distribute_condition_list
)
if
distribute_condition_list
else
SikuProject
.
distribute_condition
==
distribute_condition
if
distribute_condition
else
text
(
''
),
SikuProject
.
project_name
.
like
(
'
%
{}
%
'
.
format
(
project_name
))
if
project_name
else
text
(
''
),
SikuProject
.
project_name
.
like
(
'
%
{}
%
'
.
format
(
project_name
))
if
project_name
else
text
(
''
),
SikuProject
.
investor_name
.
like
(
'
%
{}
%
'
.
format
(
investor_name
))
if
investor_name
else
text
(
''
),
SikuProject
.
investor_name
.
like
(
'
%
{}
%
'
.
format
(
investor_name
))
if
investor_name
else
text
(
''
),
...
...
apps/view_360company/view.py
View file @
c41f8c37
...
@@ -242,7 +242,7 @@ def search():
...
@@ -242,7 +242,7 @@ def search():
try
:
try
:
es
=
Elasticsearch
([{
'host'
:
'39.100.39.50'
,
'port'
:
9200
}])
es
=
Elasticsearch
([{
'host'
:
'39.100.39.50'
,
'port'
:
9200
}])
data
=
es
.
search
(
index
=
"jincheng_pictext_index_202
202221626_29780d68
"
,
body
=
body
)
data
=
es
.
search
(
index
=
"jincheng_pictext_index_202
301131004_a6181e52
"
,
body
=
body
)
data_list
=
[]
data_list
=
[]
# print(data_list)
# print(data_list)
size
=
data
[
"hits"
][
'total'
]
size
=
data
[
"hits"
][
'total'
]
...
...
apps/view_choose/choose_view.py
View file @
c41f8c37
...
@@ -223,13 +223,15 @@ def global_build(key_words, district_name, build_name, industry_name, build_type
...
@@ -223,13 +223,15 @@ def global_build(key_words, district_name, build_name, industry_name, build_type
return
data
return
data
def
get_district_name
(
token
,
industry_name
):
def
get_district_name
(
token
):
try
:
try
:
user
=
verify_token
(
token
)
user
=
verify_token
(
token
)
user_id
=
user
.
id
# 用户id
user_id
=
user
.
id
# 用户id
# 查出做此操作的用户名
# 查出做此操作的用户名
user_obj
=
User
.
query
.
get
(
user_id
)
user_obj
=
User
.
query
.
get
(
user_id
)
district_name1
=
user_obj
.
belong_organization
# 所属区县
district_name1
=
user_obj
.
belong_organization
# 所属区县
if
not
district_name1
:
return
jsonify
(
code
=
RET
.
NODATA
,
msg
=
"权限错误,请设置用户所属单位!"
)
if
'晋城市'
in
district_name1
:
if
'晋城市'
in
district_name1
:
return
"晋城市"
return
"晋城市"
else
:
else
:
...
@@ -247,7 +249,6 @@ def get_district_name(token, industry_name):
...
@@ -247,7 +249,6 @@ def get_district_name(token, industry_name):
return
'城区'
return
'城区'
if
'晋城经济技'
in
district_name1
:
if
'晋城经济技'
in
district_name1
:
return
'晋城经济技术开发区'
return
'晋城经济技术开发区'
except
Exception
as
e
:
except
Exception
as
e
:
current_app
.
logger
.
error
(
e
)
current_app
.
logger
.
error
(
e
)
return
jsonify
(
code
=
RET
.
SESSIONERR
,
msg
=
"token过期,请重新登录!"
)
return
jsonify
(
code
=
RET
.
SESSIONERR
,
msg
=
"token过期,请重新登录!"
)
...
@@ -268,7 +269,7 @@ def search_land():
...
@@ -268,7 +269,7 @@ def search_land():
per_page
=
int
(
req_dict
.
get
(
"per_page"
))
# 每页大小
per_page
=
int
(
req_dict
.
get
(
"per_page"
))
# 每页大小
token
=
request
.
headers
[
'token'
]
token
=
request
.
headers
[
'token'
]
district_name
=
get_district_name
(
token
,
district_name
)
district_name
=
get_district_name
(
token
)
data
=
global_land
(
key_words
,
district_name
,
land_name
,
land_nature
,
industry_name
,
page
,
per_page
)
data
=
global_land
(
key_words
,
district_name
,
land_name
,
land_nature
,
industry_name
,
page
,
per_page
)
return
jsonify
(
data
)
return
jsonify
(
data
)
...
@@ -285,7 +286,7 @@ def search_factory():
...
@@ -285,7 +286,7 @@ def search_factory():
per_page
=
int
(
req_dict
.
get
(
"per_page"
))
# 每页大小
per_page
=
int
(
req_dict
.
get
(
"per_page"
))
# 每页大小
token
=
request
.
headers
[
'token'
]
token
=
request
.
headers
[
'token'
]
district_name
=
get_district_name
(
token
,
district_name
)
district_name
=
get_district_name
(
token
)
data
=
global_factory
(
key_words
,
district_name
,
factory_name
,
industry_name
,
page
,
per_page
)
data
=
global_factory
(
key_words
,
district_name
,
factory_name
,
industry_name
,
page
,
per_page
)
return
jsonify
(
data
)
return
jsonify
(
data
)
...
@@ -304,7 +305,7 @@ def search_build():
...
@@ -304,7 +305,7 @@ def search_build():
per_page
=
int
(
req_dict
.
get
(
"per_page"
))
# 每页大小
per_page
=
int
(
req_dict
.
get
(
"per_page"
))
# 每页大小
token
=
request
.
headers
[
'token'
]
token
=
request
.
headers
[
'token'
]
district_name
=
get_district_name
(
token
,
district_name
)
district_name
=
get_district_name
(
token
)
data
=
global_build
(
key_words
,
district_name
,
build_name
,
industry_name
,
build_type
,
page
,
per_page
)
data
=
global_build
(
key_words
,
district_name
,
build_name
,
industry_name
,
build_type
,
page
,
per_page
)
return
jsonify
(
data
)
return
jsonify
(
data
)
...
@@ -321,7 +322,7 @@ def search_all():
...
@@ -321,7 +322,7 @@ def search_all():
per_page
=
int
(
req_dict
.
get
(
"per_page"
))
# 每页大小
per_page
=
int
(
req_dict
.
get
(
"per_page"
))
# 每页大小
token
=
request
.
headers
[
'token'
]
token
=
request
.
headers
[
'token'
]
district_name
=
get_district_name
(
token
,
district_name
)
district_name
=
get_district_name
(
token
)
data_list
=
[]
data_list
=
[]
if
carrier_type_id
==
0
:
if
carrier_type_id
==
0
:
...
...
apps/view_choose/fill_data.py
View file @
c41f8c37
...
@@ -1209,7 +1209,7 @@ def carrier_detail():
...
@@ -1209,7 +1209,7 @@ def carrier_detail():
return
jsonify
(
code
=
RET
.
PARAMERR
,
msg
=
"参数不能为空!"
)
return
jsonify
(
code
=
RET
.
PARAMERR
,
msg
=
"参数不能为空!"
)
try
:
try
:
if
carrier_type
==
1
:
if
carrier_type
==
1
:
carrier_obj
_list
=
CarrierBuild
.
query
.
filter_by
(
id
=
carrier_id
)
carrier_obj
=
CarrierBuild
.
query
.
filter_by
(
id
=
carrier_id
)
.
first
(
)
data
=
[{
"id"
:
carrier_obj
.
id
,
data
=
[{
"id"
:
carrier_obj
.
id
,
"construction_time"
:
carrier_obj
.
construction_time
,
"construction_time"
:
carrier_obj
.
construction_time
,
"district_name"
:
carrier_obj
.
district_name
,
"district_name"
:
carrier_obj
.
district_name
,
...
@@ -1240,11 +1240,11 @@ def carrier_detail():
...
@@ -1240,11 +1240,11 @@ def carrier_detail():
# 平面图url
# 平面图url
"price_url"
:
[
"price_url"
:
[
{
"url"
:
carrier_obj
.
price_url
}]
if
carrier_obj
.
price_url
else
[],
{
"url"
:
carrier_obj
.
price_url
}]
if
carrier_obj
.
price_url
else
[],
}
for
carrier_obj
in
carrier_obj_list
]
}]
return
jsonify
(
code
=
RET
.
OK
,
data
=
{
"data"
:
data
,
"msg"
:
"数据获取成功!"
})
return
jsonify
(
code
=
RET
.
OK
,
data
=
{
"data"
:
data
,
"msg"
:
"数据获取成功!"
})
if
carrier_type
==
2
:
if
carrier_type
==
2
:
carrier_obj
_list
=
CarrierLand
.
query
.
filter_by
(
id
=
carrier_id
)
carrier_obj
=
CarrierLand
.
query
.
filter_by
(
id
=
carrier_id
)
.
first
(
)
data
=
[{
"id"
:
carrier_obj
.
id
,
data
=
[{
"id"
:
carrier_obj
.
id
,
"district_name"
:
carrier_obj
.
district_name
,
"district_name"
:
carrier_obj
.
district_name
,
"land_name"
:
carrier_obj
.
land_name
,
"land_name"
:
carrier_obj
.
land_name
,
...
@@ -1265,11 +1265,11 @@ def carrier_detail():
...
@@ -1265,11 +1265,11 @@ def carrier_detail():
# "plan_target": carrier_obj.plan_target,
# "plan_target": carrier_obj.plan_target,
"price_url"
:
[
"price_url"
:
[
{
"url"
:
carrier_obj
.
price_url
}]
if
carrier_obj
.
price_url
else
[],
{
"url"
:
carrier_obj
.
price_url
}]
if
carrier_obj
.
price_url
else
[],
}
for
carrier_obj
in
carrier_obj_list
]
}]
return
jsonify
(
code
=
RET
.
OK
,
data
=
{
"data"
:
data
,
"msg"
:
"数据获取成功!"
})
return
jsonify
(
code
=
RET
.
OK
,
data
=
{
"data"
:
data
,
"msg"
:
"数据获取成功!"
})
if
carrier_type
==
3
:
if
carrier_type
==
3
:
carrier_obj
_list
=
CarrierFactory
.
query
.
filter_by
(
id
=
carrier_id
)
carrier_obj
=
CarrierFactory
.
query
.
filter_by
(
id
=
carrier_id
)
.
first
(
)
data
=
[{
"id"
:
carrier_obj
.
id
,
data
=
[{
"id"
:
carrier_obj
.
id
,
"district_name"
:
carrier_obj
.
district_name
,
"district_name"
:
carrier_obj
.
district_name
,
"factory_name"
:
carrier_obj
.
factory_name
,
"factory_name"
:
carrier_obj
.
factory_name
,
...
@@ -1306,7 +1306,7 @@ def carrier_detail():
...
@@ -1306,7 +1306,7 @@ def carrier_detail():
# 平面图
# 平面图
"price_url"
:
[
"price_url"
:
[
{
"url"
:
carrier_obj
.
price_url
}]
if
carrier_obj
.
price_url
else
[]
{
"url"
:
carrier_obj
.
price_url
}]
if
carrier_obj
.
price_url
else
[]
}
for
carrier_obj
in
carrier_obj_list
]
}]
return
jsonify
(
code
=
RET
.
OK
,
data
=
{
"data"
:
data
,
"msg"
:
"数据获取成功!"
})
return
jsonify
(
code
=
RET
.
OK
,
data
=
{
"data"
:
data
,
"msg"
:
"数据获取成功!"
})
except
Exception
as
e
:
except
Exception
as
e
:
...
...
apps/view_choose/view.py
View file @
c41f8c37
...
@@ -146,9 +146,9 @@ def advice():
...
@@ -146,9 +146,9 @@ def advice():
@api_address.route
(
"/DownList"
,
methods
=
[
"GET"
])
@api_address.route
(
"/DownList"
,
methods
=
[
"GET"
])
def
downlist
():
# 一级二级行业分类
def
downlist
():
# 一级二级行业分类
try
:
try
:
industry
=
IndustryChain
.
query
.
filter_by
(
statu
=
1
)
.
all
()
industry
=
IndustryChain
.
query
.
filter_by
(
statu
s
=
1
)
.
all
()
data
=
[{
data
=
[{
"name"
:
i
.
name
,
"name"
:
i
.
industry_
name
,
"id"
:
i
.
nid
,
"id"
:
i
.
nid
,
}
for
i
in
industry
]
}
for
i
in
industry
]
except
Exception
as
e
:
except
Exception
as
e
:
...
...
apps/view_map/view.py
View file @
c41f8c37
...
@@ -332,6 +332,7 @@ def attract_enterprise():
...
@@ -332,6 +332,7 @@ def attract_enterprise():
entype
=
req_dict
.
get
(
"entype"
)
# 企业类型id
entype
=
req_dict
.
get
(
"entype"
)
# 企业类型id
qualificat
=
req_dict
.
get
(
"qualificat"
)
# 企业资质id
qualificat
=
req_dict
.
get
(
"qualificat"
)
# 企业资质id
quoted
=
req_dict
.
get
(
"quoted"
)
# 上市板块(A股,1)(创业股,2)(港股,3)(新三股,4)(新四股,5)(中小板,6)
quoted
=
req_dict
.
get
(
"quoted"
)
# 上市板块(A股,1)(创业股,2)(港股,3)(新三股,4)(新四股,5)(中小板,6)
product
=
req_dict
.
get
(
"product"
)
# 产业产品选择
area
=
req_dict
.
get
(
"area"
)
# ["省","市","区"]
area
=
req_dict
.
get
(
"area"
)
# ["省","市","区"]
province
=
area
[
0
]
province
=
area
[
0
]
...
@@ -343,7 +344,8 @@ def attract_enterprise():
...
@@ -343,7 +344,8 @@ def attract_enterprise():
return
jsonify
(
code
=
RET
.
PARAMERR
,
msg
=
"参数不完整"
)
return
jsonify
(
code
=
RET
.
PARAMERR
,
msg
=
"参数不完整"
)
try
:
try
:
enterprise_obj
=
Enterprise
.
query
.
filter
(
and_
(
enterprise_obj
=
Enterprise
.
query
.
filter
(
Enterprise
.
product_all
.
like
(
"
%
{}
%
"
.
format
(
product
))
if
product
else
text
(
''
),
Enterprise
.
entype
.
like
(
'
%
{}
%
'
.
format
(
entype
))
if
entype
else
text
(
''
),
Enterprise
.
entype
.
like
(
'
%
{}
%
'
.
format
(
entype
))
if
entype
else
text
(
''
),
Enterprise
.
company_name
.
like
(
'
%
{}
%
'
.
format
(
company_name
))
if
company_name
else
text
(
''
),
Enterprise
.
company_name
.
like
(
'
%
{}
%
'
.
format
(
company_name
))
if
company_name
else
text
(
''
),
Enterprise
.
c_type
==
inid
if
inid
else
text
(
''
),
Enterprise
.
c_type
==
inid
if
inid
else
text
(
''
),
...
@@ -361,7 +363,7 @@ def attract_enterprise():
...
@@ -361,7 +363,7 @@ def attract_enterprise():
Enterprise
.
isfive
==
'1'
if
qualificat
==
'中国500强企业'
else
text
(
''
),
Enterprise
.
isfive
==
'1'
if
qualificat
==
'中国500强企业'
else
text
(
''
),
Enterprise
.
scale
==
'1'
if
qualificat
==
'规模以上企业'
else
text
(
''
),
Enterprise
.
scale
==
'1'
if
qualificat
==
'规模以上企业'
else
text
(
''
),
Enterprise
.
serve
==
'1'
if
qualificat
==
'限额以上服务业企业'
else
text
(
''
),
Enterprise
.
serve
==
'1'
if
qualificat
==
'限额以上服务业企业'
else
text
(
''
),
)
)
)
size
=
enterprise_obj
.
count
()
size
=
enterprise_obj
.
count
()
enterprise_obj_list
=
enterprise_obj
.
paginate
(
page
,
perpage
)
.
items
enterprise_obj_list
=
enterprise_obj
.
paginate
(
page
,
perpage
)
.
items
...
...
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