优化工件配送

This commit is contained in:
jinling.yang
2024-04-26 13:57:47 +08:00
parent 1293c327c6
commit 41e551fe48
6 changed files with 24 additions and 26 deletions

View File

@@ -446,9 +446,6 @@ class Manufacturing_Connect(http.Controller):
if next_workpiece:
logging.info('next_workpiece:%s' % next_workpiece.delivery_num)
next_workpiece.write({'status': '待下发'})
else:
res = {'Succeed': False, 'ErrorCode': 203, 'Error': '该DeviceId没有对应的已配送工件数据'}
else:
@@ -507,7 +504,7 @@ class Manufacturing_Connect(http.Controller):
if delivery_workpiece:
logging.info('开始向agv下发下产线任务')
delivery_workpiece._delivery_avg()
logging.info('agv下发下产线任务已配送')
logging.info('agv下发下产线任务下发完成')
except Exception as e:
res = {'Succeed': False, 'ErrorCode': 202, 'Error': e}
logging.info('AGVDownProduct error:%s' % e)

View File

@@ -25,12 +25,11 @@ class Workpiece(http.Controller):
if 'reqCode' in ret:
if 'method' in ret:
if ret['method'] == 'end':
logging.info('backfeed-ret:%s' % ret['reqCode'].rsplit('-', 1)[0])
req_codes = ret['reqCode'].split(',')
for req_code in req_codes:
workpiece_delivery = request.env['sf.workpiece.delivery'].sudo().search(
[('production_id.name', '=', ret['reqCode'].rsplit('-', 1)[0]),
('delivery_num', '=', req_code)])
[('production_id.name', '=', req_code.rsplit('-', 1)[0]),
('delivery_num', '=', req_code.strip())])
if workpiece_delivery:
workpiece_delivery.write({'status': '已配送', 'task_completion_time': ret['reqTime']})
else: