Accept Merge Request #1401: (feature/下发编程单接口添加输出 -> develop)
Merge Request: 下发编程单接口添加输出 Created By: @杨金灵 Reviewed By: @马广威 Approved By: @马广威 Accepted By: @杨金灵 URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/1401?initial=true
This commit is contained in:
@@ -82,18 +82,22 @@ class Sf_Mrs_Connect(http.Controller, MultiInheritController):
|
|||||||
if files_panel:
|
if files_panel:
|
||||||
for file in files_panel:
|
for file in files_panel:
|
||||||
file_extension = os.path.splitext(file)[1]
|
file_extension = os.path.splitext(file)[1]
|
||||||
logging.info('file_extension:%s' % file_extension)
|
|
||||||
if file_extension.lower() == '.pdf':
|
if file_extension.lower() == '.pdf':
|
||||||
panel_file_path = os.path.join(program_path_tmp_panel, file)
|
panel_file_path = os.path.join(program_path_tmp_panel, file)
|
||||||
logging.info('panel_file_path:%s' % panel_file_path)
|
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())})
|
cnc_workorder.write({'cnc_worksheet': base64.b64encode(open(panel_file_path, 'rb').read())})
|
||||||
|
logging.info('更新工作指令完成:%s' % cnc_workorder)
|
||||||
pre_workorder = productions.workorder_ids.filtered(
|
pre_workorder = productions.workorder_ids.filtered(
|
||||||
lambda ap: ap.routing_type == '装夹预调' and ap.state not in ['done', 'rework'
|
lambda ap: ap.routing_type == '装夹预调' and ap.state not in ['done', 'rework'
|
||||||
'cancel'] and ap.processing_panel == panel)
|
'cancel'] and ap.processing_panel == panel)
|
||||||
if pre_workorder:
|
if pre_workorder:
|
||||||
|
logging.info('更新加工图纸:%s' % pre_workorder)
|
||||||
pre_workorder.write(
|
pre_workorder.write(
|
||||||
{'processing_drawing': base64.b64encode(open(panel_file_path, 'rb').read())})
|
{'processing_drawing': base64.b64encode(open(panel_file_path, 'rb').read())})
|
||||||
|
logging.info('更新加工图纸完成:%s' % pre_workorder)
|
||||||
productions.write({'programming_state': '已编程', 'work_state': '已编程'})
|
productions.write({'programming_state': '已编程', 'work_state': '已编程'})
|
||||||
|
logging.info('已更新制造订单编程状态:%s' % productions.ids)
|
||||||
res.update({
|
res.update({
|
||||||
'production_ids': productions.ids
|
'production_ids': productions.ids
|
||||||
})
|
})
|
||||||
@@ -111,5 +115,6 @@ class Sf_Mrs_Connect(http.Controller, MultiInheritController):
|
|||||||
return json.JSONEncoder().encode(res)
|
return json.JSONEncoder().encode(res)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
res = {'status': -1, 'message': '系统解析失败'}
|
res = {'status': -1, 'message': '系统解析失败'}
|
||||||
|
request.cr.rollback()
|
||||||
logging.info('get_cnc_processing_create error:%s' % e)
|
logging.info('get_cnc_processing_create error:%s' % e)
|
||||||
return json.JSONEncoder().encode(res)
|
return json.JSONEncoder().encode(res)
|
||||||
|
|||||||
Reference in New Issue
Block a user