Commit dcaace2d by dong

fix20230413

parent 5afc9e53
...@@ -38,30 +38,53 @@ def get_jjzb(): ...@@ -38,30 +38,53 @@ def get_jjzb():
return jsonify(code=RET.DBERR, msg="查询出错!") return jsonify(code=RET.DBERR, msg="查询出错!")
# @api_bigdata.route("/GetJjzb", methods=["GET"]) # 项目跟踪 @api_bigdata.route("/GetCyfb", methods=["POST"]) # 项目跟踪
# def get_jjzb(): def get_cyfb():
# try: req_dict = request.get_json()
# obj_li = City.query.all() district = req_dict.get("district") # 区县或者开发区名称
# data = [{
# "id": obj.id, try:
# "area": obj.area, # 3. 产业结构分布饼状图数据统计
# "size": obj.size, company = Company.query.filter(Company.district == district if district else text(''))
# "year": obj.year, count_all = company.count()
# "people": obj.people, if count_all == 0:
# "GDP": obj.GDP, count_all = 1
# "addscale": obj.addscale, count_gt = company.filter_by(f_type=1).count() # 钢铁
# "investment": obj.investment, count_gjd = company.filter_by(f_type=2).count() # 光机电
# "retail": obj.retail, count_mcq = company.filter_by(f_type=7).count() # 煤层气
# "in_out": obj.in_out, count_zbzz = company.filter_by(f_type=8).count() # 装备制造
# "public": obj.public, count_zz = company.filter_by(f_type=9).count() # 铸造
# "people_out": obj.people_out, count_mhg = company.filter_by(f_type=10).count() # 煤化工
# "people_per": obj.people_per, count_xcl = company.filter_by(f_type=11).count() # 新材料
# "public_in": obj.public_in, count_lsjc = company.filter_by(f_type=12).count() # 绿色建材
# "info": obj.info, count_yy = company.filter_by(f_type=13).count() # 医药
# "question": obj.question, count_smfz = company.filter_by(f_type=14).count() # 丝麻纺织服装
# "flag": obj.flag count_xdfwy = company.filter_by(f_type=15).count() # 现代服务业
# } for obj in obj_li] count_szjj = company.filter_by(f_type=16).count() # 数字经济
# return jsonify(code=RET.OK, data=data, msg="查询成功!") count_whly = company.filter_by(f_type=17).count() # 文化旅游
# except Exception as e:
# current_app.logger.error(e) count_qt = count_all - count_gt - count_gjd - count_mcq - count_zbzz - \
# return jsonify(code=RET.DBERR, msg="查询出错!") count_zz - count_mhg - count_xcl - count_lsjc - count_yy - \
\ No newline at end of file count_smfz - count_xdfwy - count_szjj - count_whly
# 产业结构分布
data = [
{"name": "钢铁", "value": count_gt}, # {百分比,value}
{"name": "光机电", "value": count_gjd},
{"name": "煤层气", "value": count_mcq},
{"name": "装备制造", "value": count_zbzz},
{"name": "铸造", "value": count_zz},
{"name": "煤化工", "value": count_mhg},
{"name": "新材料", "value": count_xcl},
{"name": "绿色建材", "value": count_lsjc},
{"name": "医药", "value": count_yy},
{"name": "丝麻纺织服装", "value": count_smfz},
{"name": "现代服务业", "value": count_xdfwy},
{"name": "数字经济", "value": count_szjj},
{"name": "文化旅游", "value": count_whly}
]
return jsonify(code=RET.OK, data=data, msg="查询成功!")
except Exception as e:
current_app.logger.error(e)
return jsonify(code=RET.DBERR, msg="查询出错!")
\ No newline at end of file
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