From bd89422ed0663e2c6460d79812d87ce3f374459e Mon Sep 17 00:00:00 2001 From: dongchangxi <458593490@qq.com> Date: Fri, 27 Oct 2023 15:01:01 +0800 Subject: [PATCH] =?UTF-8?q?=E8=87=AA=E5=8A=A8=E7=82=B9=E5=87=BB=E7=9A=84?= =?UTF-8?q?=E5=AE=9A=E4=BD=8D=E4=BF=AE=E6=94=B9=20+=20=E5=88=86=E5=B8=83?= =?UTF-8?q?=E5=BC=8F=E4=BB=BB=E5=8A=A1=E7=9A=84bug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- logic/logic_main_service.py | 4 ++-- tools/auto_distance.py | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/logic/logic_main_service.py b/logic/logic_main_service.py index e28c395..24f2d10 100644 --- a/logic/logic_main_service.py +++ b/logic/logic_main_service.py @@ -101,8 +101,8 @@ def is_run_stepx_nums(step): def need_run_stepx(task_distributed_id): try: - #查询task_distributed_id 对应的子任务是否正在执行, - where = f'hostname = "{hostname}" and task_distributed_id = "{task_distributed_id}" order by id desc limit 1 for update' + #查询task_distributed_id 对应的子任务是否正在执行,hostname = "{hostname}" and + where = f'task_distributed_id = "{task_distributed_id}" order by id desc limit 1 for update' result = main_service_db.db_task_distributed_detail(where) #如果一个子任务都没有,说明该任务还没有开始执行,需要执行step1 if result is None: diff --git a/tools/auto_distance.py b/tools/auto_distance.py index 3cc6f44..d709300 100644 --- a/tools/auto_distance.py +++ b/tools/auto_distance.py @@ -51,6 +51,9 @@ def get_defineDistances(pid, left, top, right, bottom): distances = libs_db.get_floor_sticker_distances(psid) #config.ps_floor_sticker.get(psid, config.ps_floor_sticker['default']) time.sleep(5) y = 748 + yCreateDistance = 0 + if len(distances.split(';')) == 1: + yCreateDistance = 2 for index, d in enumerate(distances.split(';')): p1, p2, distance = d.split(' ') if index == 0: @@ -58,12 +61,12 @@ def get_defineDistances(pid, left, top, right, bottom): ag.moveTo(14, 191) else: #不是第一次就移动到 create distance - ag.moveTo(65, 300+30) # Create distance line height 15 + ag.moveTo(65, 300+yCreateDistance*15) # Create distance line height 15 time.sleep(0.5) ag.click() time.sleep(1.2) if index == 0: - ag.moveTo(65, 285+30) + ag.moveTo(65, 285+yCreateDistance*15) time.sleep(1) ag.click()