Commit 241f0be1 by Aeolus

update

parent a35819f1
...@@ -110,7 +110,7 @@ def run_create_machine_no(): ...@@ -110,7 +110,7 @@ def run_create_machine_no():
date_str = datetime.datetime.now().date().strftime("%Y%m%d")[2:] date_str = datetime.datetime.now().date().strftime("%Y%m%d")[2:]
sql = "SELECT max(machine_no) as machine_no FROM machine where machine_no like '{}%'".format(date_str) sql = "SELECT max(machine_no) as machine_no FROM machine where machine_no like '{}%'".format(date_str)
result = db.session.execute(sql).fetchone() result = db.session.execute(sql).fetchone()
if result: if result and result["machine_no"]:
max_machine_no = int(result["machine_no"]) max_machine_no = int(result["machine_no"])
machine_no = str(max_machine_no + 1) machine_no = str(max_machine_no + 1)
else: else:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment