Commit f93df474 by dong

fix20230412

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