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)