修改接口
This commit is contained in:
@@ -143,15 +143,6 @@ class Manufacturing_Connect(http.Controller):
|
||||
res = {'Succeed': True, 'Datas': []}
|
||||
datas = request.httprequest.data
|
||||
ret = json.loads(datas)
|
||||
if not ret['BillId']:
|
||||
res = {'Succeed': False, 'ErrorCode': 202, 'Error': '未传制造订单号'}
|
||||
return json.JSONEncoder().encode(res)
|
||||
if not ret['CraftId']:
|
||||
res = {'Succeed': False, 'ErrorCode': 202, 'Error': '未传工序名称'}
|
||||
return json.JSONEncoder().encode(res)
|
||||
if not ret['DeviceId']:
|
||||
res = {'Succeed': False, 'ErrorCode': 202, 'Error': '未传设备号'}
|
||||
return json.JSONEncoder().encode(res)
|
||||
production_id = ret['BillId']
|
||||
routing_type = ret['CraftId']
|
||||
workorder = request.env['mrp.workorder'].sudo().search(
|
||||
@@ -178,15 +169,6 @@ class Manufacturing_Connect(http.Controller):
|
||||
res = {'Succeed': True, 'Datas': []}
|
||||
datas = request.httprequest.data
|
||||
ret = json.loads(datas)
|
||||
if not ret['BillId']:
|
||||
res = {'Succeed': False, 'ErrorCode': 202, 'Error': '未传制造订单号'}
|
||||
return json.JSONEncoder().encode(res)
|
||||
if not ret['CraftId']:
|
||||
res = {'Succeed': False, 'ErrorCode': 202, 'Error': '未传工序名称'}
|
||||
return json.JSONEncoder().encode(res)
|
||||
if not ret['DeviceId']:
|
||||
res = {'Succeed': False, 'ErrorCode': 202, 'Error': '未传设备号'}
|
||||
return json.JSONEncoder().encode(res)
|
||||
production_id = ret['BillId']
|
||||
routing_type = ret['CraftId']
|
||||
workorder = request.env['mrp.workorder'].sudo().search(
|
||||
@@ -276,6 +258,29 @@ class Manufacturing_Connect(http.Controller):
|
||||
logging.info('NCProgDolod error:%s' % e)
|
||||
return json.JSONEncoder().encode(res)
|
||||
|
||||
@http.route('/AutoDeviceApi/LocationChange', type='json', auth='none', methods=['GET', 'POST'], csrf=False,
|
||||
cors="*")
|
||||
def LocationChange(self, **kw):
|
||||
"""
|
||||
库位变更
|
||||
:param kw:
|
||||
:return:
|
||||
"""
|
||||
logging.info('NCProgDolod:%s' % kw)
|
||||
try:
|
||||
res = {'Succeed': True, 'Datas': []}
|
||||
datas = request.httprequest.data
|
||||
ret = json.loads(datas)
|
||||
if ret:
|
||||
print(ret)
|
||||
return json.JSONEncoder().encode(res)
|
||||
else:
|
||||
res = {'Succeed': False, 'ErrorCode': 201, 'Error': '未传RfidCode字段'}
|
||||
except Exception as e:
|
||||
res = {'Succeed': False, 'ErrorCode': 202, 'Error': e}
|
||||
logging.info('NCProgDolod error:%s' % e)
|
||||
return json.JSONEncoder().encode(res)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user