Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/制造代码优化

This commit is contained in:
mgw
2024-04-24 14:24:59 +08:00
4 changed files with 35 additions and 54 deletions

View File

@@ -422,7 +422,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:
@@ -457,7 +457,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: