diff --git a/__pycache__/check_station.cpython-312.pyc b/__pycache__/check_station.cpython-312.pyc index 36d050e..845dd87 100644 Binary files a/__pycache__/check_station.cpython-312.pyc and b/__pycache__/check_station.cpython-312.pyc differ diff --git a/actions.py b/actions.py index 819219b..852e0a3 100644 --- a/actions.py +++ b/actions.py @@ -221,7 +221,7 @@ class DeviceAutomation: # task_data = apis.get_measurement_task() # logging.info(f"设备 {self.device_id} 获取到的测量任务: {task_data}") task_data = { - "id": 53, + "id": 21, "user_name": "czsczq115ykl", "name": "czsczq115ykl", "line_num": "L220076", @@ -236,8 +236,10 @@ class DeviceAutomation: # continue # 设置全局变量 + global_variable.GLOBAL_USERNAME = task_data.get('user_name', '') global_variable.GLOBAL_CURRENT_PROJECT_NAME = task_data.get('line_name', '') global_variable.GLOBAL_LINE_NUM = task_data.get('line_num', '') + global_variable.GLOBAL_ACCOUNT_ID = task_data.get('id', 0) logging.info(f"设备 {self.device_id} 当前要处理的项目名称:{global_variable.GLOBAL_CURRENT_PROJECT_NAME}") # 执行测量操作 @@ -263,12 +265,12 @@ class DeviceAutomation: logging.info(f"设备 {self.device_id} 第{task_count}个任务完成") task_count += 1 - # +++++++++++++white+++++++++++++++++ + # # +++++++++++++white+++++++++++++++++ - logging.info(f"设备 {self.device_id} 已完成{task_count}个任务,结束打数据流程") - if task_count == 0: - logging.error(f"没有完成打数据的线路,结束任务") - return False + # logging.info(f"设备 {self.device_id} 已完成{task_count}个任务,结束打数据流程") + # if task_count == 0: + # logging.error(f"没有完成打数据的线路,结束任务") + # return False # 执行打数据加转点 if not self.check_station.run(): diff --git a/globals/__pycache__/apis.cpython-312.pyc b/globals/__pycache__/apis.cpython-312.pyc index 6ddd0af..dd90e9f 100644 Binary files a/globals/__pycache__/apis.cpython-312.pyc and b/globals/__pycache__/apis.cpython-312.pyc differ diff --git a/globals/apis.py b/globals/apis.py index 1813f94..1ec7884 100644 --- a/globals/apis.py +++ b/globals/apis.py @@ -88,7 +88,7 @@ def get_breakpoint_list(): else: logging.info(f"接口返回错误: {result.get('code')}") return [{ - "id": 53, + "id": 21, "user_name": "czsczq115ykl", "name": "czsczq115ykl", "line_num": "L220076", @@ -434,7 +434,7 @@ def get_user_max_variation(username: str) -> Optional[int]: try: # 2. 发送POST请求 - logging.info(f"向接口 {api_url} 发送请求,查询用户名:{username}") + logging.info(f"向接口 {api_url} 发送请求,查询用户名:{username},账号ID:{account_id}") response = requests.post( url=api_url, json=payload, # 自动将字典转为JSON字符串,无需手动json.dumps() diff --git a/page_objects/__pycache__/section_mileage_config_page.cpython-312.pyc b/page_objects/__pycache__/section_mileage_config_page.cpython-312.pyc index 775c336..5f768ad 100644 Binary files a/page_objects/__pycache__/section_mileage_config_page.cpython-312.pyc and b/page_objects/__pycache__/section_mileage_config_page.cpython-312.pyc differ diff --git a/page_objects/__pycache__/upload_config_page.cpython-312.pyc b/page_objects/__pycache__/upload_config_page.cpython-312.pyc index 676fc3b..0bf606b 100644 Binary files a/page_objects/__pycache__/upload_config_page.cpython-312.pyc and b/page_objects/__pycache__/upload_config_page.cpython-312.pyc differ diff --git a/page_objects/upload_config_page.py b/page_objects/upload_config_page.py index faf178e..5405c51 100644 --- a/page_objects/upload_config_page.py +++ b/page_objects/upload_config_page.py @@ -2093,12 +2093,12 @@ class UploadConfigPage: else: self.logger.info("页面中包含变化量属性,继续执行后续操作") - user_id = global_variable.GLOBAL_USERNAME - if user_id is None: - self.logger.error("获取用户ID失败") + user_name = global_variable.GLOBAL_USERNAME + if user_name is None: + self.logger.error("获取用户名失败") return False - max_variation = apis.get_user_max_variation(user_id) + max_variation = apis.get_user_max_variation(user_name) if max_variation is None: self.logger.error("获取用户最大变化量失败") return False diff --git a/上传人员信息.xlsx b/上传人员信息.xlsx new file mode 100644 index 0000000..c867bc2 Binary files /dev/null and b/上传人员信息.xlsx differ