Commit 28d84269 by dong

fix20230302

parent b5a22cbb
...@@ -628,7 +628,10 @@ def industry_policy(): ...@@ -628,7 +628,10 @@ def industry_policy():
policy_type = req_dict.get("policy_type") # 政策类型,全国、国务院 policy_type = req_dict.get("policy_type") # 政策类型,全国、国务院
policy_year = req_dict.get("policy_year") # 政策年份 policy_year = req_dict.get("policy_year") # 政策年份
policy_name = req_dict.get("policy_name") # 政策名称 policy_name = req_dict.get("policy_name") # 政策名称
token = request.headers["token"]
user_obj = verify_token(token)
if not user_obj:
return jsonify(code=RET.SESSIONERR, msg='用户未登录。')
# 校验参数完整性 # 校验参数完整性
if not all([page, perpage]): if not all([page, perpage]):
return jsonify(code=RET.PARAMERR, msg="参数不完整") return jsonify(code=RET.PARAMERR, msg="参数不完整")
...@@ -771,17 +774,25 @@ def industry_policy(): ...@@ -771,17 +774,25 @@ def industry_policy():
current_app.logger.error(e) current_app.logger.error(e)
return jsonify(code=RET.DBERR, msg="数据库查询错误") return jsonify(code=RET.DBERR, msg="数据库查询错误")
# 封装政策数据 # 封装政策数据
policy_data = { policy_data = []
"policy_data": [{ data = {}
for i in indu_policy:
if i in user_obj.industry_policy:
is_collect = 'True'
else:
is_collect = 'False'
policy_data.append({
"id": i.id, "id": i.id,
"name": i.name, "name": i.name,
"org": i.org, "org": i.org,
"file": i.file, "file": i.file,
"is_collect": is_collect,
"pubdate": (i.pubdate).strftime("%Y-%m-%d"), "pubdate": (i.pubdate).strftime("%Y-%m-%d"),
} for i in indu_policy], })
"size": size data.update({"size": size})
} data.update({"policy_data": policy_data})
return jsonify(code=RET.OK, msg="政策数据查询成功", data=policy_data) return jsonify(code=RET.OK, msg="政策数据查询成功", data=data)
# 产业政策详情信息-复用招商驾驶舱政策详情接口 # 产业政策详情信息-复用招商驾驶舱政策详情接口
...@@ -921,6 +932,7 @@ def get_zaiti_detail_data(): ...@@ -921,6 +932,7 @@ def get_zaiti_detail_data():
else: else:
pass pass
data = { data = {
"id": induzone.id,
"district": induzone.district, "district": induzone.district,
"cate": induzone.cate, "cate": induzone.cate,
"area": induzone.area, "area": induzone.area,
......
...@@ -523,7 +523,6 @@ def attract_video(): ...@@ -523,7 +523,6 @@ def attract_video():
return jsonify(code=RET.OK, msg="查询成功", data={"video_url": video_url, "image_url": image_url}) return jsonify(code=RET.OK, msg="查询成功", data={"video_url": video_url, "image_url": image_url})
else: else:
return jsonify(code=RET.DATAERR, msg="区县名称有误,没有相关视频") return jsonify(code=RET.DATAERR, msg="区县名称有误,没有相关视频")
return jsonify(code=RET.NODATA, msg="暂无视频", data={"url": ""}) return jsonify(code=RET.NODATA, msg="暂无视频", data={"url": ""})
...@@ -538,6 +537,7 @@ def keyproject(): ...@@ -538,6 +537,7 @@ def keyproject():
try: try:
project = Project.query.get(id) project = Project.query.get(id)
data = { data = {
"id": project.id, # 工程名
"name": project.name, # 工程名 "name": project.name, # 工程名
"district": project.district, # 区县名称 "district": project.district, # 区县名称
"type": project.type, # 工程类型 "type": project.type, # 工程类型
......
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