From 589a24f595c7542734c8b2fa1a31d91910076fb0 Mon Sep 17 00:00:00 2001 From: mgw <1392924357@qq.com> Date: Sat, 14 Sep 2024 14:32:40 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=8B=89=E5=8F=96=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E4=B9=8B=E5=89=8D=E7=9A=84=E6=A3=80=E6=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_manufacturing/models/mrp_workorder.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/sf_manufacturing/models/mrp_workorder.py b/sf_manufacturing/models/mrp_workorder.py index 9e1d5632..51fa9f27 100644 --- a/sf_manufacturing/models/mrp_workorder.py +++ b/sf_manufacturing/models/mrp_workorder.py @@ -426,17 +426,17 @@ class ResMrpWorkOrder(models.Model): logging.info('local_file_path:%s' % local_file_path) remote_path = '/home/ftp/ftp_root/ThreeTest/XT/Before/' + local_filename logging.info('remote_path:%s' % remote_path) - # if not ftp.file_exists(remote_path): - paload_data = { - "filename": local_filename - } - if not ftp_resconfig['get_check_file_path']: - raise UserError('请先配置获取检测报告地址') - url = ftp_resconfig['get_check_file_path'] + '/get/check/report' - response = requests.post(url, json=paload_data) - logging.info('response:%s' % response.json()) - if response.json().get('detail'): - raise UserError(response.json().get('detail')) + if not ftp.file_exists(remote_path): + paload_data = { + "filename": local_filename + } + if not ftp_resconfig['get_check_file_path']: + raise UserError('请先配置获取检测报告地址') + url = ftp_resconfig['get_check_file_path'] + '/get/check/report' + response = requests.post(url, json=paload_data) + logging.info('response:%s' % response.json()) + if response.json().get('detail'): + raise UserError(response.json().get('detail')) if not ftp.file_exists(remote_path): raise UserError(f"文件不存在: {remote_path}")