From 4e4c53927bbd0faf12171477e693aba88770da79 Mon Sep 17 00:00:00 2001 From: "jinling.yang" Date: Wed, 16 Oct 2024 14:15:37 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8B=E5=8F=91=E7=BC=96=E7=A8=8B=E5=8D=95?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E6=B7=BB=E5=8A=A0=E8=BE=93=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_mrs_connect/controllers/controllers.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sf_mrs_connect/controllers/controllers.py b/sf_mrs_connect/controllers/controllers.py index c66b03bc..35a7d3a3 100644 --- a/sf_mrs_connect/controllers/controllers.py +++ b/sf_mrs_connect/controllers/controllers.py @@ -82,18 +82,22 @@ class Sf_Mrs_Connect(http.Controller, MultiInheritController): if files_panel: for file in files_panel: file_extension = os.path.splitext(file)[1] - logging.info('file_extension:%s' % file_extension) if file_extension.lower() == '.pdf': panel_file_path = os.path.join(program_path_tmp_panel, file) logging.info('panel_file_path:%s' % panel_file_path) + logging.info('更新工作指令:%s' % cnc_workorder) cnc_workorder.write({'cnc_worksheet': base64.b64encode(open(panel_file_path, 'rb').read())}) + logging.info('更新工作指令完成:%s' % cnc_workorder) pre_workorder = productions.workorder_ids.filtered( lambda ap: ap.routing_type == '装夹预调' and ap.state not in ['done', 'rework' 'cancel'] and ap.processing_panel == panel) if pre_workorder: + logging.info('更新加工图纸:%s' % pre_workorder) pre_workorder.write( {'processing_drawing': base64.b64encode(open(panel_file_path, 'rb').read())}) + logging.info('更新加工图纸完成:%s' % pre_workorder) productions.write({'programming_state': '已编程', 'work_state': '已编程'}) + logging.info('已更新制造订单编程状态:%s' % productions.ids) res.update({ 'production_ids': productions.ids }) @@ -111,5 +115,6 @@ class Sf_Mrs_Connect(http.Controller, MultiInheritController): return json.JSONEncoder().encode(res) except Exception as e: res = {'status': -1, 'message': '系统解析失败'} + request.cr.rollback() logging.info('get_cnc_processing_create error:%s' % e) return json.JSONEncoder().encode(res)