From f82adb6ade8c0d97db5e9817ffaaf30d0b34e1e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=80=C3=AE=C3=97=C3=9A=C3=95=C3=B1?= Date: Wed, 21 Sep 2022 10:30:00 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=962?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/api_v1/endpoints/forms.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/api/api_v1/endpoints/forms.py b/api/api_v1/endpoints/forms.py index 5da5345..a09df79 100644 --- a/api/api_v1/endpoints/forms.py +++ b/api/api_v1/endpoints/forms.py @@ -22,6 +22,25 @@ from utils import get_time, qujian_time, Download_xlsx, send_str_mail router = APIRouter() +# 修改报表参数 +@router.post("/set_form_setting") +async def man_mass_form( + request: Request, + interview: InterviewDo = Depends(InterviewDo), + db: AsyncIOMotorDatabase = Depends(get_database), + current_user: schemas.UserDB = Depends(deps.get_current_user) +) -> schemas.Msg: + """修改报表参数""" + await interview.init() + table_id = interview.where.get('table_id', '') + update_data = interview.data_in + # 更新报表参数 + if not table_id or not update_data: + return schemas.Msg(code=-9, msg='参数有误', data='') + await crud.api_interview_tables.update_tables(db, {'table_id': table_id, 'update_data': update_data}) + return schemas.Msg(code=200, msg='ok', data='') + + # 候选人质量报表 @router.post("/man_mass_form") async def man_mass_form(