bug修复

release
周平 10 months ago
parent ab36c10046
commit 1421d52f3b

@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
import logging
from typing import List, Dict, Any, Union
from sqlalchemy import text
@ -71,15 +71,18 @@ class EnterpriseNodeRepository(object):
n.id, n.name, n.parent, p.name AS parent_name, n.suid
FROM enterprise_node n
LEFT JOIN enterprise_node p ON n.parent = p.id
WHERE n.entity_id=:entity_id AND n.del=0 and n.parent=0
WHERE n.entity_id=:entity_id AND n.del=0
"""
)
if name == "":
sql += " and n.parent=0"
param = {"entity_id": entity_id}
if name:
sql += " and n.name like :name"
param["name"] = f"%{name}%"
# logging.info(f"############################# sql: {sql}, param: {param}")
res = session.execute(text(sql), param)
node_list = to_json_list(res)
node_list = node_list and node_list or []
@ -115,9 +118,9 @@ class EnterpriseNodeRepository(object):
param = {"parent": node["id"]}
if name:
sql += " and n.name like :name"
param["name"] = f"%{name}%"
# if name:
# sql += " and n.name like :name"
# param["name"] = f"%{name}%"
res = session.execute(text(sql), param)
node_list = to_json_list(res)

@ -287,7 +287,7 @@ class DeviceListHandler(APIHandler):
"""
@authenticated
@operation_log("企业管理", "设备管理", consts.op_type_list, "企业节点,设备列表")
@operation_log("企业管理", "设备管理", consts.op_type_list_str, "企业节点,设备列表")
def post(self):
node_id = self.get_int_argument("node_id")
pageNo = self.get_int_argument("pageNo", 1)
@ -337,7 +337,7 @@ class DeviceInfoHandler(APIHandler):
```
"""
@authenticated
@operation_log("企业管理", "设备管理", consts.op_type_list, "企业节点,设备信息")
@operation_log("企业管理", "设备管理", consts.op_type_list_str, "企业节点,设备信息")
def post(self):
device_id = self.get_int_argument("device_id")
if not device_id:
@ -382,7 +382,7 @@ class DeviceBasemodelListHandler(APIHandler):
"""
@authenticated
@operation_log("企业管理", "节点设置", consts.op_type_list, "企业节点,节点信息 -> 设备列表 -> 基础模型配置 -> 模型列表")
@operation_log("企业管理", "节点设置", consts.op_type_list_str, "企业节点,节点信息 -> 设备列表 -> 基础模型配置 -> 模型列表")
def post(self):
device_id = self.get_int_argument("device_id")
if not device_id:

@ -298,7 +298,8 @@ class EntityInfoHandler(APIHandler):
"province": row["province"],
"city": row["city"],
"addr": row["addr"],
"industry": consts.industry_map[row["industry"]],
"industry": row["industry"],
"industry_name": consts.industry_map[row["industry"]],
"expire_at": "",
"contact": row["contact"],
"phone": row["phone"],

@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-
import json
import logging
from website import errors, consts
from website.db.enterprise_busi_model import enterprise_busi_model as DB_BusiModel
@ -157,6 +158,7 @@ class TreeHandler(APIHandler):
def post(self):
entity_id = self.get_escaped_argument("entity_id", "")
name = self.get_escaped_argument("name", "")
# logging.info(f"name is {name}")
if not entity_id:
raise errors.HTTPAPIError(errors.ERROR_BAD_REQUEST, "参数错误")

Loading…
Cancel
Save