1.补充agv优化代码
2.修复刀具物料同步
This commit is contained in:
@@ -974,16 +974,24 @@ class WorkPieceDelivery(models.Model):
|
||||
|
||||
# 配送至avg小车
|
||||
def _delivery_avg(self):
|
||||
res = {'reqCode': urllib.parse.quote(self.production_id.name), 'reqTime': '', 'clientCode': '', 'tokenCode': '',
|
||||
'taskTyp': 'F01', 'ctnrTyp': '', 'ctnrCode': '', 'wbCode': '006848AB006774', 'positionCodePath': [],
|
||||
config = self.env['res.config.settings'].get_values()
|
||||
agv_site = self.env['res.agv.site'].search([])
|
||||
positionCode_Arr = []
|
||||
if agv_site:
|
||||
for item in agv_site:
|
||||
positionCode_Arr.append({
|
||||
'positionCode': item.content,
|
||||
'code': item.type
|
||||
})
|
||||
res = {'reqCode': self.production_id.name, 'reqTime': '', 'clientCode': '', 'tokenCode': '',
|
||||
'taskTyp': config['task_type_no'], 'ctnrTyp': '', 'ctnrCode': '', 'wbCode': config['wbcode'],
|
||||
'positionCodePath': positionCode_Arr,
|
||||
'podCode': '',
|
||||
'podDir': '', 'materialLot': '', 'priority': '', 'taskCode': '', 'agvCode': '', 'materialLot': '',
|
||||
'data': ''}
|
||||
config = self.env['res.config.settings'].get_values()
|
||||
try:
|
||||
logging.info('AGV请求路径:%s' % config['agv_rcs_url'])
|
||||
logging.info('AGV-json:%s' % res)
|
||||
|
||||
headers = {'Content-Type': 'application/json'}
|
||||
ret = requests.post((config['agv_rcs_url']), json=res, headers=headers)
|
||||
ret = ret.json()
|
||||
|
||||
Reference in New Issue
Block a user