From 6402af2477e6c4185d8aae774081b8fafd8d3f55 Mon Sep 17 00:00:00 2001 From: 13507605001 Date: Mon, 12 Dec 2022 09:03:51 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=A5=E5=BA=93=E6=A8=A1=E6=9D=BF=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/drug_template/views.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/apps/drug_template/views.py b/apps/drug_template/views.py index 7cec796..3bf372b 100644 --- a/apps/drug_template/views.py +++ b/apps/drug_template/views.py @@ -174,9 +174,7 @@ def add_tmp_info(): # 获取最大的条形码和条形码数量 tmp_obj = BllMedicamentTemplate().execute(sql_all).fetchone() if tmp_obj: - max_barcode = tmp_obj.start_bar_code - bar_code_count = tmp_obj.bar_code_count - max_barcode = int(max_barcode) + int(bar_code_count) + max_barcode = int(tmp_obj.start_bar_code) + int(tmp_obj.bar_code_count) else: max_barcode = 100001 start_bar_code = max_barcode @@ -189,9 +187,9 @@ def add_tmp_info(): if isinstance(tmp_content, str): # tmp_content = eval(tmp_content) tmp_content = json.loads(tmp_content) - # total_count = 0 - # for i in tmp_content: - # total_count += int(i['export_count']) + bar_code_count = 0 + for i in tmp_content: + bar_code_count += int(i['export_count']) obj = EntityMedicamentTemplate( customer_id=client.customer_id,