From 89152fcd84cc9684c9816c65df1b826657cb90ea Mon Sep 17 00:00:00 2001 From: "apan_youxiang@163.com" Date: Mon, 29 Aug 2022 18:44:45 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=BA=93=E5=AD=98=E4=BD=99?= =?UTF-8?q?=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/drug/views.py | 19 ++++++++++++++++++- config/system.conf | 4 ++-- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/apps/drug/views.py b/apps/drug/views.py index f4e3b10..b443e13 100644 --- a/apps/drug/views.py +++ b/apps/drug/views.py @@ -206,7 +206,7 @@ def get_durg_record(): # 设置空瓶 @drug_router.route("/set_drug_empty_bottle", methods=["GET", "POST"]) -# @token_auth.login_required +@token_auth.login_required def drug_set_empty_bottle(): drug_id = request.values.get("medicament_id") obj = BllMedicament() @@ -222,6 +222,23 @@ def drug_set_empty_bottle(): return jsonify(Utils.false_return(msg="试剂id有误")) +@drug_router.route("/update_drug_remain", methods=["GET", "POST"]) +@token_auth.login_required +def update_drug_remain(): + drug_id = request.values.get("medicament_id") + remain = request.values.get("reain") + obj = BllMedicament().findEntity(EntityMedicament.medicament_id==drug_id) + if obj: + if not obj.remain: + setattr(obj, "status", "3") + else: + setattr(obj, "remain", remain) + BllMedicament().update(obj) + return jsonify(Utils.true_return()) + else: + return jsonify(Utils.false_return()) + + ################################# ##验证通过后需要添加至试剂领用处。## ################################# diff --git a/config/system.conf b/config/system.conf index a692134..c661f0f 100644 --- a/config/system.conf +++ b/config/system.conf @@ -4,5 +4,5 @@ customer_id = 1 serverip = 0.0.0.0 port = 9001 # dbconntion = mysql+pymysql://root:123456@127.0.0.1/local_rms_db?charset=utf8 -# dbconntion = mysql+pymysql://yanyi:tangyan86910282@111.231.67.55/yy_rms_multiple?charset=utf8 -dbconntion = mysql+pymysql://root:123456@127.0.0.1/yy_rms_multiple?charset=utf8 \ No newline at end of file +dbconntion = mysql+pymysql://yanyi:tangyan86910282@111.231.67.55/yy_rms_multiple?charset=utf8 +# dbconntion = mysql+pymysql://root:123456@127.0.0.1/yy_rms_multiple?charset=utf8 \ No newline at end of file