Accept Merge Request #1111: (feature/修复cmm程序接口 -> develop)

Merge Request: 修复cmm程序接口

Created By: @杨金灵
Reviewed By: @马广威
Approved By: @马广威 
Accepted By: @杨金灵
URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/1111?initial=true
This commit is contained in:
杨金灵
2024-06-28 14:24:23 +08:00
committed by Coding

View File

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