From 8f7650b44debb2e26479c03995439013e150d1d5 Mon Sep 17 00:00:00 2001 From: 13507605001 Date: Tue, 29 Nov 2022 16:07:21 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=A2=84=E5=A4=87=E5=85=A5?= =?UTF-8?q?=E5=BA=93=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/drug_template/views.py | 6 +++++- db_logic/medicament.py | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/apps/drug_template/views.py b/apps/drug_template/views.py index f1e67c6..a64731c 100644 --- a/apps/drug_template/views.py +++ b/apps/drug_template/views.py @@ -126,10 +126,14 @@ def bind_tmp_input_db(): "put_in_date": Utils.get_str_datetime(), "put_in_user_id": user_info.user_id, "put_in_user_name": user_info.real_name, - "status":1, + # "status":1, "remain": remain_num, "func_type": func_type, } + if len(bar_code) > 10: + new_dict["status"] = 5 + else: + new_dict["status"] = 1 finds_list = dir(EntityMedicament()) for i in finds_list: if i in new_dict.keys(): diff --git a/db_logic/medicament.py b/db_logic/medicament.py index 7385fd0..176d108 100644 --- a/db_logic/medicament.py +++ b/db_logic/medicament.py @@ -219,7 +219,8 @@ class BllMedicament(Repository): # 创建事务 self.beginTrans() self.session.add(entityDrug) - self.session.add(entityDrugRecord) + if entityDrug.status == 1: + self.session.add(entityDrugRecord) boolean_ = self.commitTrans() if boolean_ is None: return True