优化agv相关页面及对应接口
This commit is contained in:
@@ -431,12 +431,12 @@ 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_destination', '=', ret['DeviceId'])])
|
||||
[('feeder_station_start_id.name', '=', ret['DeviceId']),
|
||||
('status', '=', '待配送')], limit=1, order='id asc')
|
||||
if workpiece_delivery:
|
||||
for wd in workpiece_delivery:
|
||||
logging.info('wd.workorder_id:%s' % wd.workorder_id.name)
|
||||
logging.info('wd.production_id:%s' % wd.production_id.name)
|
||||
if wd.workorder_id.state == 'done' and wd.production_id.production_line_state == '待上产线':
|
||||
logging.info('wd.production_id:%s' % wd.production_id.name)
|
||||
logging.info('wd.production_line_state:%s' % wd.production_id.production_line_state)
|
||||
wd.production_id.write({'production_line_state': '已上产线'})
|
||||
wd.write({'production_line_state': '已上产线'})
|
||||
@@ -466,20 +466,20 @@ 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_destination', '=', ret['DeviceId'])])
|
||||
[('feeder_station_destination_id.name', '=', ret['DeviceId']),
|
||||
('status', '=', '待配送')], limit=1, order='id asc')
|
||||
if workpiece_delivery:
|
||||
for wd in workpiece_delivery:
|
||||
logging.info('wd.workorder_id:%s' % wd.workorder_id.name)
|
||||
logging.info('wd.production_id:%s' % wd.production_id.name)
|
||||
if wd.workorder_id.state == 'done' and wd.production_id.production_line_state == '已上产线':
|
||||
logging.info('wd.production_id:%s' % wd.production_id.name)
|
||||
logging.info('wd.production_line_state:%s' % wd.production_id.production_line_state)
|
||||
workpiece_delivery_off=request.env['sf.workpiece.delivery'].create({
|
||||
workpiece_delivery_off = request.env['sf.workpiece.delivery'].sudo().create({
|
||||
'production_id': wd.production_id.id,
|
||||
'feeder_station_start': ret['DeviceId'],
|
||||
'feeder_station_destination': '',
|
||||
'workorder_id': workpiece_delivery.workorder_id,
|
||||
'feeder_station_start_id': workpiece_delivery.feeder_station_start_id.id,
|
||||
'feeder_station_destination_id': '',
|
||||
'workorder_id': workpiece_delivery.workorder_id.id,
|
||||
'workpiece_code': workpiece_delivery.workpiece_code,
|
||||
'production_line_id': workpiece_delivery.production_line_id,
|
||||
'production_line_id': workpiece_delivery.production_line_id.id,
|
||||
'task_delivery_time': datetime.now(),
|
||||
'production_line_state': '已下产线'
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user