工件装夹岗扫描托盘RFID,识别校验并带出【同运工件】名称,并自动校验【目的生产线】一致

【同运工件】校验目的生产线不一致,则弹窗提示:工件生产线不一致,请重新确认;
This commit is contained in:
jinling.yang
2024-04-24 14:20:26 +08:00
parent 1344bd7219
commit 231536089d
4 changed files with 35 additions and 54 deletions

View File

@@ -431,7 +431,7 @@ class Manufacturing_Connect(http.Controller):
if 'DeviceId' in ret:
logging.info('DeviceId:%s' % ret['DeviceId'])
workpiece_delivery = request.env['sf.workpiece.delivery'].sudo().search(
[('feeder_station_start_id.name', '=', ret['DeviceId']),
[('feeder_station_destination_id.name', '=', ret['DeviceId']),
('status', '=', '已配送'), ('type', '=', '上产线')], order='id asc')
if workpiece_delivery:
for wd in workpiece_delivery:
@@ -466,7 +466,7 @@ class Manufacturing_Connect(http.Controller):
if 'DeviceId' in ret:
logging.info('DeviceId:%s' % ret['DeviceId'])
workpiece_delivery = request.env['sf.workpiece.delivery'].sudo().search(
[('feeder_station_start_id.name', '=', ret['DeviceId']),
[('feeder_station_destination_id.name', '=', ret['DeviceId']),
('status', '=', '已配送'), ('type', '=', '下产线')], order='id asc')
if workpiece_delivery:
for wd in workpiece_delivery:

View File

@@ -26,15 +26,10 @@ class Workpiece(http.Controller):
if ret['method'] == 'end':
logging.info('backfeed-ret:%s' % ret['reqCode'].rsplit('-', 1)[0])
workpiece_delivery = request.env['sf.workpiece.delivery'].sudo().search(
[('production_id.name', '=', ret['reqCode'].rsplit('-', 1)[0]), ('agv_task_code'), '=',
ret['taskCode']])
[('production_id.name', '=', ret['reqCode'].rsplit('-', 1)[0]), ('delivery_num', '=',
ret['reqCode'])])
if workpiece_delivery:
workpiece_delivery.write({'status': '已配送', 'task_completion_time': ret['reqTime']})
if workpiece_delivery.type == '下产线':
workpiece_delivery_clear = request.env['sf.workpiece.delivery'].sudo().search(
[('production_id.name', '=', ret['reqCode']), ('type', '=', '运送空料架')])
if workpiece_delivery_clear:
workpiece_delivery_clear._delivery_avg()
else:
res = {'Succeed': False, 'ErrorCode': 203, 'Error': '该reqCode暂未查到对应的工件配送记录'}
else: