Commit 778a5b29 by dong

fix20221223

parent c006660f
...@@ -1340,24 +1340,44 @@ def jc_data_detail(): ...@@ -1340,24 +1340,44 @@ def jc_data_detail():
year = req_dic["year"] year = req_dic["year"]
try: try:
target_obj_li = JcTarget.query.filter_by(year=year, is_delete=0).all() target_obj_li = JcTarget.query.filter_by(year=year, is_delete=0).all()
data = [{ if target_obj_li:
"id": target_obj.id, data = [{
"year": target_obj.year, "id": target_obj.id,
"upload_time": target_obj.upload_time, "year": target_obj.year,
"upload_unit": target_obj.upload_unit, "upload_time": target_obj.upload_time,
"upload_people": target_obj.upload_people, "upload_unit": target_obj.upload_unit,
"grade_sign": target_obj.grade_sign, "upload_people": target_obj.upload_people,
"grade_start": target_obj.grade_start, "grade_sign": 15,
"grade_plan_invest": target_obj.grade_plan_invest, "grade_start": 5,
"grade_arrive_target1": target_obj.grade_arrive_target1, "grade_plan_invest": 25,
"grade_arrive_target0": target_obj.grade_arrive_target0, "grade_arrive_target1": 25,
"district_name": target_obj.district_name, "grade_arrive_target0": 5,
"money_sign": target_obj.money_sign, "district_name": target_obj.district_name,
"rate_start": target_obj.rate_start, "money_sign": target_obj.money_sign,
"money_plan_invest": target_obj.money_plan_invest, "rate_start": target_obj.rate_start,
"money_arrive_target1": target_obj.money_arrive_target1, "money_plan_invest": target_obj.money_plan_invest,
"money_arrive_target0": target_obj.money_arrive_target0 "money_arrive_target1": target_obj.money_arrive_target1,
} for target_obj in target_obj_li] "money_arrive_target0": target_obj.money_arrive_target0
} for target_obj in target_obj_li]
else:
data = [{
"id": '',
"year": '',
"upload_time": '',
"upload_unit": '',
"upload_people": '',
"grade_sign": 15,
"grade_start": 5,
"grade_plan_invest": 25,
"grade_arrive_target1": 25,
"grade_arrive_target0": 5,
"district_name": '',
"money_sign": '',
"rate_start": '',
"money_plan_invest": '',
"money_arrive_target1": '',
"money_arrive_target0": ''
}]
return jsonify(code=RET.OK, data=data, msg="获取成功!") return jsonify(code=RET.OK, data=data, msg="获取成功!")
except Exception as e: except Exception as 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