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