1
This commit is contained in:
@@ -8,6 +8,35 @@ from odoo.http import request
|
|||||||
|
|
||||||
class Manufacturing_Connect(http.Controller):
|
class Manufacturing_Connect(http.Controller):
|
||||||
|
|
||||||
|
@http.route('/AutoDeviceApi/ToolGroup', type='json', auth='sf_token', methods=['GET', 'POST'], csrf=False,
|
||||||
|
cors="*")
|
||||||
|
def get_functional_tool_groups_Info(self, **kw):
|
||||||
|
"""
|
||||||
|
刀具组接口
|
||||||
|
:param kw:
|
||||||
|
:return:
|
||||||
|
"""
|
||||||
|
logging.info('get_functional_tool_groups_Info:%s' % kw)
|
||||||
|
try:
|
||||||
|
datas = request.httprequest.data
|
||||||
|
ret = json.loads(datas)
|
||||||
|
# ret = json.loads(ret['result'])
|
||||||
|
logging.info('DeviceId:%s' % ret)
|
||||||
|
functional_tools = request.env['sf.tool.inventory'].sudo().search([])
|
||||||
|
|
||||||
|
res = {'Succeed': True, 'Datas': []}
|
||||||
|
if functional_tools:
|
||||||
|
for item in functional_tools:
|
||||||
|
res['Datas'].append({
|
||||||
|
'GroupName': item.tool_groups_id.name,
|
||||||
|
'ToolId': item.functional_cutting_tool_model_id.name,
|
||||||
|
'ToolName': item.name
|
||||||
|
})
|
||||||
|
except Exception as e:
|
||||||
|
res = {'Succeed': False, 'ErrorCode': 202, 'Error': e}
|
||||||
|
logging.info('get_functional_tool_groups_Info error:%s' % e)
|
||||||
|
return json.JSONEncoder().encode(res)
|
||||||
|
|
||||||
@http.route('/AutoDeviceApi/ToolInventory', type='json', auth='none', methods=['GET', 'POST'], csrf=False,
|
@http.route('/AutoDeviceApi/ToolInventory', type='json', auth='none', methods=['GET', 'POST'], csrf=False,
|
||||||
cors="*")
|
cors="*")
|
||||||
def get_functional_tool_inventory_Info(self, **kw):
|
def get_functional_tool_inventory_Info(self, **kw):
|
||||||
|
|||||||
Reference in New Issue
Block a user