Commit f93df474 by dong

fix20230412

parent 948d3cb4
...@@ -9,60 +9,29 @@ from apps.big_data import api_bigdata ...@@ -9,60 +9,29 @@ from apps.big_data import api_bigdata
"""项目总览""" """项目总览"""
@api_bigdata.route("/ProjectStalker", methods=["POST"]) # 项目跟踪 @api_bigdata.route("/GetJjzb", methods=["GET"]) # 项目跟踪
def project_stalker(): def get_jjzb():
req_dic = request.get_json()
district = req_dic['district']
stalker_num1 = 0
stalker_num2 = 0
stalker_num3 = 0
sign_num = 0
start_num = 0
end_num = 0
job_num = 0
new_value_num = 0
revenue_num = 0
try: try:
project_obj_list = ProjectManagement.query.filter( obj_li = City.query.all()
ProjectManagement.district == district if district else text(''), data = [{
ProjectManagement.is_delete == 0 "id": obj.id,
).all() "area": obj.area,
for project_obj in project_obj_list: "size": obj.size,
if project_obj.sign_time and project_obj.project_stalker == '进展顺利项目': "year": obj.year,
stalker_num1 += 1 "people": obj.people,
if project_obj.sign_time and project_obj.project_stalker == '进展难点项目': "GDP": obj.GDP,
stalker_num2 += 1 "addscale": obj.addscale,
if project_obj.sign_time and project_obj.project_stalker == '进展难点项目': "investment": obj.investment,
stalker_num3 += 1 "retail": obj.retail,
if project_obj.sign_time and project_obj.investment_volume >= 100000: "in_out": obj.in_out,
stalker_num3 += 1 "public": obj.public,
if project_obj.sign_time: "people_out": obj.people_out,
sign_num += 1 "people_per": obj.people_per,
if project_obj.start_time: "public_in": obj.public_in,
start_num += 1 "info": obj.info,
if project_obj.end_time: "question": obj.question,
end_num += 1 "flag": obj.flag
if project_obj.job_num: } for obj in obj_li]
job_num += project_obj.job_num
if project_obj.new_value:
new_value_num += project_obj.new_value
if project_obj.revenue:
revenue_num += project_obj.revenue
data = {
"stalker_num1": stalker_num1,
"stalker_num2": stalker_num2,
"stalker_num3": stalker_num3,
"sign_num": sign_num,
"start_num": start_num,
"end_num": end_num,
"job_num": job_num,
"new_value_num": new_value_num,
"revenue_num": revenue_num
}
return jsonify(code=RET.OK, data=data, msg="查询成功!") return jsonify(code=RET.OK, data=data, msg="查询成功!")
except Exception as e: except Exception as e:
current_app.logger.error(e) current_app.logger.error(e)
......
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