修复cmm程序接口

This commit is contained in:
jinling.yang
2024-06-28 14:23:03 +08:00
parent 14355606c7
commit d281026086

View File

@@ -318,15 +318,15 @@ class Manufacturing_Connect(http.Controller):
[('rfid_code', '=', ret['RfidCode']), ('routing_type', '=', 'CNC加工')]) [('rfid_code', '=', ret['RfidCode']), ('routing_type', '=', 'CNC加工')])
if workorder: if workorder:
for item in workorder.cmm_ids: for item in workorder.cmm_ids:
if item.program_date is not False: if item.program_create_date is not False:
program_date = item.program_date.strftime("%Y-%m-%d %H:%M:%S") program_create_date = item.program_create_date.strftime("%Y-%m-%d %H:%M:%S")
program_date_str = request.env['sf.sync.common'].sudo().get_add_time(program_date) program_date_str = request.env['sf.sync.common'].sudo().get_add_time(program_create_date)
res['Datas'].append({ res['Datas'].append({
'CraftId': workorder.id, 'CraftId': workorder.id,
'CraftKey': workorder.name, 'CraftKey': workorder.name,
'ProgramDate': '' if not item.program_date else program_date_str, 'ProgramDate': '' if not item.program_create_date else program_date_str,
'ProgramPath': item.program_path, 'ProgramPath': item.program_path,
'PostProcessing': item.post_processing_name, 'PostProcessing': item.program_name,
}) })
else: else:
res = {'Succeed': False, 'ErrorCode': 203, 'Error': '暂无工单及对应的CNC程序数据'} res = {'Succeed': False, 'ErrorCode': 203, 'Error': '暂无工单及对应的CNC程序数据'}