diff --git a/langguanApi.xml b/langguanApi.xml
index 72a4586..0d7dcb0 100644
--- a/langguanApi.xml
+++ b/langguanApi.xml
@@ -125,6 +125,16 @@
             
             
         
+        
+            
+            按设备类型取设备列表 //1 voc,2 cems,3,tsp,4 video
+            
+            key
+            
+            
+            
+            
+        
         
             
             获取指定设备的历史数据
@@ -195,6 +205,52 @@
             
             
         
+        
+            
+            角色 权限
+            
+        
+        
+            
+            获取角色详情
+            
+            
+            
+        
+        
+            
+            添加角色
+            
+            
+            
+        
+        
+            
+            update角色
+            
+            
+            
+        
+        
+            
+            删除角色
+            
+            
+            
+        
+        
+            
+            获取角色列表
+            
+            
+            
+        
+        
+            
+            获取所有角色
+            
+            
+        
         
             
             清洁运输
@@ -326,6 +382,21 @@
             
             
         
+        
+            
+            linq extension
+            
+        
+        
+            
+            合并表达式以及参数
+            
+            
+            
+            
+            
+            
+        
         
             
             日志
@@ -555,6 +626,11 @@
             设备类型,1 voc,2 cems,3,tsp,4 video
             
         
+        
+            
+            视频流地址
+            
+        
         
             
             HJ212_2017
@@ -684,6 +760,91 @@
             国几排放量
             
         
+        
+            
+            菜单实体类
+            
+        
+        
+            
+            菜单名称
+            
+        
+        
+            
+            菜单URL
+            
+        
+        
+            
+            排序
+            
+        
+        
+            
+            父菜单ID,一级菜单为null
+            
+        
+        
+            
+            菜单名称
+            
+        
+        
+            
+            菜单URL
+            
+        
+        
+            
+            排序
+            
+        
+        
+            
+            父菜单ID,一级菜单为null
+            
+        
+        
+            
+            角色名称
+            
+        
+        
+            
+            角色描述
+            
+        
+        
+            
+            角色名称
+            
+        
+        
+            
+            角色描述
+            
+        
+        
+            
+            更新角色DTO
+            
+        
+        
+            
+            角色ID
+            
+        
+        
+            
+            DTO for adding role menu
+            
+        
+        
+            
+            DTO for updating role menu
+            
+        
         
             
             用户实体
@@ -709,6 +870,46 @@
             邮箱
             
         
+        
+            
+            手机号
+            
+        
+        
+            
+            添加用户DTO
+            
+        
+        
+            
+            用户名
+            
+        
+        
+            
+            密码 md5加密
+            
+        
+        
+            
+             角色id
+            
+        
+        
+            
+            邮箱
+            
+        
+        
+            
+            更新用户DTO
+            
+        
+        
+            
+            用户id
+            
+        
         
             
             污染物因子编码
@@ -1253,6 +1454,20 @@
             
             
         
+        
+            
+            批量删除
+            
+            
+            
+        
+        
+            
+            批量删除
+            
+            
+            
+        
         
             
             表达式取数据
@@ -1344,6 +1559,16 @@
             
             
         
+        
+            
+            分页取设备
+            
+            
+            
+            
+            
+            
+        
         
             
             分页取数据
@@ -1574,6 +1799,62 @@
             
             
         
+        
+            
+            根据角色ID获取角色菜单
+            
+            
+            
+        
+        
+            
+            表中添加角色菜单
+            
+            
+            
+        
+        
+            
+            更新角色菜单
+            
+            
+            
+        
+        
+            
+            新增角色
+            
+            
+            
+        
+        
+            
+            获取角色及菜单
+            
+            
+            
+        
+        
+            
+            删除角色
+            
+            
+            
+        
+        
+            
+            更新角色
+            
+            
+            
+        
+        
+            
+            分页取数据
+            
+            
+            
+        
         
             
             TransportService 运输服务
diff --git a/langguanApi/Controllers/DeviceController.cs b/langguanApi/Controllers/DeviceController.cs
index 93f385b..166c2c9 100644
--- a/langguanApi/Controllers/DeviceController.cs
+++ b/langguanApi/Controllers/DeviceController.cs
@@ -1,4 +1,5 @@
-using langguanApi.Model;
+using Amazon.Runtime.Internal.Auth;
+using langguanApi.Model;
 using langguanApi.Model.Dto;
 using langguanApi.Service;
 using Microsoft.AspNetCore.Mvc;
@@ -80,8 +81,22 @@ namespace langguanApi.Controllers
         [HttpGet]
         public async Task GetDeviceTypes()
         {
-            var result=await _deviceService.GetDeviceTypes();
+            var result = await _deviceService.GetDeviceTypes();
             return Ok(new ApiResult() { code = 0, data = result });
         }
+        /// 
+        /// 按设备类型取设备列表 //1 voc,2 cems,3,tsp,4 video
+        /// 
+        /// key
+        /// 
+        /// 
+        /// 
+        /// 
+        [HttpGet]
+        public async Task GetListByDeviceType(string key="", int pageSize = 10, int current = 1, int deviceType = 1)
+        {
+            var result = await _deviceService.GetDeviceListByTypes(key, pageSize, current, deviceType);
+            return Ok(result);
+        }
     }
 }
diff --git a/langguanApi/Controllers/RoleController.cs b/langguanApi/Controllers/RoleController.cs
index 8feda65..2ee96d6 100644
--- a/langguanApi/Controllers/RoleController.cs
+++ b/langguanApi/Controllers/RoleController.cs
@@ -1,22 +1,96 @@
-using langguanApi.Model.Dto.SystemConfigurationDto;
+using langguanApi.Model;
+using langguanApi.Model.Entity;
+using langguanApi.Model.Dto.SystemConfigurationDto;
 using langguanApi.Service;
+using Microsoft.AspNetCore.Http;
 using Microsoft.AspNetCore.Mvc;
+using System.Threading.Tasks;
 
 namespace langguanApi.Controllers
 {
     /// 
-    /// 角色
+    /// 角色 权限
     /// 
     [Route("api/[controller]")]
     [ApiController]
     public class RoleController : ControllerBase
     {
-        private RoleService _roleService;
+        public readonly RoleService _roleService;
         public RoleController(RoleService roleService)
         {
             _roleService = roleService;
         }
         /// 
+        /// 获取角色详情
+        /// 
+        /// 
+        /// 
+        [HttpGet("get")]
+        public async Task Get(string id)
+        {
+            var role = await _roleService.GetRoleAndMenu(id);
+            return Ok(role);
+        }
+        /// 
+        /// 添加角色
+        /// 
+        /// 
+        /// 
+        [HttpPost("add")]
+        public async Task Add([FromBody] AddRoleDto role)
+        {
+            var result = await _roleService.Add(role);
+            return Ok(result);
+        }
+        /// 
+        /// update角色
+        /// 
+        /// 
+        /// 
+        [HttpPut("update")]
+        public async Task Update([FromBody] UpdateRoleDto role)
+        {
+            var result = await _roleService.update(role);
+            return Ok(result);
+        }
+        /// 
+        /// 删除角色
+        /// 
+        /// 
+        /// 
+        [HttpDelete("remove")]
+        public async Task Remove(IEnumerable ids)
+        {
+            var result = await _roleService.Remove(ids);
+            return Ok(result);
+        }
+        /// 
+        /// 获取角色列表
+        /// 
+        /// 
+        /// 
+        [HttpGet("list")]
+        public async Task List([FromQuery] reqpage input)
+        {
+            var roles = await _roleService.GetPager(input);
+            return Ok(roles);
+        }
+        /// 
+        /// 获取所有角色
+        /// 
+        /// 
+        [HttpGet("all")]
+        public async Task GetAllrole()
+        {
+            var roles = await _roleService.GetAsync();
+            return Ok(new ApiResult()
+            {
+                code = 0,
+                data = roles.
+                Select(s => new { s.Id, s.RoleName })
+            });
+        }
+        /// 
         ///新增角色
         /// 
         /// 
diff --git a/langguanApi/Extensions/WhereIfExtension.cs b/langguanApi/Extensions/WhereIfExtension.cs
new file mode 100644
index 0000000..fc79baf
--- /dev/null
+++ b/langguanApi/Extensions/WhereIfExtension.cs
@@ -0,0 +1,72 @@
+using System.Linq.Expressions;
+
+namespace langguanApi.Extensions
+{
+    /// 
+    /// linq extension
+    /// 
+    public static class WhereIfExtension
+    {
+        public static IQueryable WhereIf(this IQueryable source, bool condition, Expression> predicate)
+        {
+            return condition ? source.Where(predicate) : source;
+        }
+        public static IQueryable WhereIf(this IQueryable source, Expression> predicate, bool condition)
+        {
+            return condition ? source.Where(predicate) : source;
+        }
+        public static IEnumerable WhereIf(this IEnumerable source, bool condition, Func predicate)
+        {
+            return condition ? source.Where(predicate) : source;
+        }
+        public static Expression> And(
+        this Expression> first,
+        Expression> second)
+        {
+            return first.AndAlso(second, Expression.AndAlso);
+        }
+        /// 
+        /// 合并表达式以及参数
+        /// 
+        /// 
+        /// 
+        /// 
+        /// 
+        /// 
+        private static Expression> AndAlso(
+        this Expression> expr1,
+        Expression> expr2,
+        Func func)
+        {
+            var parameter = Expression.Parameter(typeof(T));
+
+            var leftVisitor = new ReplaceExpressionVisitor(expr1.Parameters[0], parameter);
+            var left = leftVisitor.Visit(expr1.Body);
+
+            var rightVisitor = new ReplaceExpressionVisitor(expr2.Parameters[0], parameter);
+            var right = rightVisitor.Visit(expr2.Body);
+
+            return Expression.Lambda>(
+                func(left, right), parameter);
+
+        }
+        private class ReplaceExpressionVisitor
+: ExpressionVisitor
+        {
+            private readonly Expression _oldValue;
+            private readonly Expression _newValue;
+
+            public ReplaceExpressionVisitor(Expression oldValue, Expression newValue)
+            {
+                _oldValue = oldValue;
+                _newValue = newValue;
+            }
+            public override Expression Visit(Expression node)
+            {
+                if (node == _oldValue)
+                    return _newValue;
+                return base.Visit(node);
+            }
+        }
+    }
+}
diff --git a/langguanApi/Model/Device.cs b/langguanApi/Model/Device.cs
index 8e8eccd..1c1e3c8 100644
--- a/langguanApi/Model/Device.cs
+++ b/langguanApi/Model/Device.cs
@@ -21,15 +21,20 @@
         /// 设备类型,1 voc,2 cems,3,tsp,4 video
         /// 
         public int DeviceType { get; set; }
+        /// 
+        /// 视频流地址
+        /// 
+        public string VideoUrl { get; set; }
     }
     public class DeviceAddDto
     {
-     
         public string deviceMN { get; set; }
         public string Ip { get; set; }
         public double lng { get; set; }
         public double lat { get; set; }
         public string NickName { get; set; }
+        public int DeviceType { get; set; }
+        public string VideoUrl { get; set; }
     }
     public class DeviceUpdateDto
     {
@@ -37,5 +42,6 @@
         public string NickName { get; set; }
         public string OrgId { get; set; }
         public int DeviceType { get; set; }
+        public string VideoUrl { get; set; }
     }
 }
diff --git a/langguanApi/Model/Dto/UserLogin.cs b/langguanApi/Model/Dto/UserLogin.cs
index bde8309..4bef7fd 100644
--- a/langguanApi/Model/Dto/UserLogin.cs
+++ b/langguanApi/Model/Dto/UserLogin.cs
@@ -18,11 +18,12 @@
         /// 
         ///  角色id
         /// 
-        public int roleId { get; set; }
+        public string roleId { get; set; }
         /// 
         /// 邮箱
         /// 
         public string Email { get; set; }
+        public string Phone { get; set; }
     }
     /// 
     /// 用户更新
diff --git a/langguanApi/Model/Entity/Menu.cs b/langguanApi/Model/Entity/Menu.cs
new file mode 100644
index 0000000..02ccc82
--- /dev/null
+++ b/langguanApi/Model/Entity/Menu.cs
@@ -0,0 +1,48 @@
+namespace langguanApi.Model.Entity
+{
+    /// 
+    /// 菜单实体类
+    /// 
+    public class Menu : BaseModel
+    {
+        /// 
+        /// 菜单名称
+        /// 
+        public string Name { get; set; }
+        /// 
+        /// 菜单URL
+        /// 
+        public string Url { get; set; }
+        /// 
+        /// 排序
+        /// 
+        public int Sort { get; set; }
+        /// 
+        /// 父菜单ID,一级菜单为null
+        /// 
+        public string ParentId { get; set; }
+    }
+    public class AddMenuDto
+    {
+        /// 
+        /// 菜单名称
+        /// 
+        public string Name { get; set; }
+        /// 
+        /// 菜单URL
+        /// 
+        public string Url { get; set; }
+        /// 
+        /// 排序
+        /// 
+        public int Sort { get; set; }
+        /// 
+        /// 父菜单ID,一级菜单为null
+        /// 
+        public string ParentId { get; set; }
+    }
+    public class UpdateMenuDto : AddMenuDto
+    {
+        public string Id { get; set; }
+    }
+}
diff --git a/langguanApi/Model/Entity/Role.cs b/langguanApi/Model/Entity/Role.cs
new file mode 100644
index 0000000..2b446ba
--- /dev/null
+++ b/langguanApi/Model/Entity/Role.cs
@@ -0,0 +1,35 @@
+namespace langguanApi.Model.Entity
+{
+    public class Role : BaseModel
+    {
+        /// 
+        /// 角色名称
+        /// 
+        public string RoleName { get; set; }
+        /// 
+        /// 角色描述
+        /// 
+        public string RoleDescription { get; set; }
+    }
+    public class AddRoleDto
+    {
+        /// 
+        /// 角色名称
+        /// 
+        public string RoleName { get; set; }
+        /// 
+        /// 角色描述
+        /// 
+        public string RoleDescription { get; set; }
+    }
+    /// 
+    /// 更新角色DTO
+    /// 
+    public class UpdateRoleDto: AddRoleDto
+    {
+        /// 
+        /// 角色ID
+        /// 
+        public int RoleId { get; set; }
+    }
+}
diff --git a/langguanApi/Model/Entity/RoleMenu.cs b/langguanApi/Model/Entity/RoleMenu.cs
new file mode 100644
index 0000000..bfed213
--- /dev/null
+++ b/langguanApi/Model/Entity/RoleMenu.cs
@@ -0,0 +1,24 @@
+namespace langguanApi.Model.Entity
+{
+    public class RoleMenu : BaseModel
+    {
+        public string RoleId { get; set; }
+        public string MenuId { get; set; }
+    }
+    /// 
+    /// DTO for adding role menu
+    /// 
+    public class AddRoleMenuDTO
+    {
+        public string RoleId { get; set; }
+        public List MenuIds { get; set; }
+    }
+    /// 
+    /// DTO for updating role menu
+    /// 
+    public class UpdateRoleMenuDTO
+    {
+        public string RoleId { get; set; }
+        public List MenuIds { get; set; }
+    }
+}
diff --git a/langguanApi/Model/Entity/UserEntity.cs b/langguanApi/Model/Entity/UserEntity.cs
index 4eb8056..7b681f7 100644
--- a/langguanApi/Model/Entity/UserEntity.cs
+++ b/langguanApi/Model/Entity/UserEntity.cs
@@ -19,7 +19,32 @@ namespace langguanApi.Model.Entity
         /// 
         ///  角色id
         /// 
-        [BsonRepresentation(BsonType.ObjectId)]
+        public string roleId { get; set; }
+        /// 
+        /// 邮箱
+        /// 
+        public string Email { get; set; }
+        /// 
+        /// 手机号
+        /// 
+        public string Phone { get; set; }
+    }
+    /// 
+    /// 添加用户DTO
+    /// 
+    public class AddDto
+    {
+        /// 
+        /// 用户名
+        /// 
+        public string Username { get; set; }
+        /// 
+        /// 密码 md5加密
+        /// 
+        public string Password { get; set; }
+        /// 
+        ///  角色id
+        /// 
         public string roleId { get; set; }
         /// 
         /// 邮箱
@@ -66,4 +91,15 @@ namespace langguanApi.Model.Entity
         /// 
         public byte IsEnable { get; set; }
     }
+    /// 
+    /// 更新用户DTO
+    /// 
+    public class UpdateDto:AddDto
+    {
+        /// 
+        /// 用户id
+        /// 
+        public string Id { get; set; }
+    }
+
 }
diff --git a/langguanApi/Service/BaseService.cs b/langguanApi/Service/BaseService.cs
index 4e5f677..a502ab3 100644
--- a/langguanApi/Service/BaseService.cs
+++ b/langguanApi/Service/BaseService.cs
@@ -136,7 +136,25 @@ namespace langguanApi.Service
         {
             await _collection.DeleteOneAsync(T => T.Id == id);
         }
-
+        /// 
+        /// 批量删除
+        /// 
+        /// 
+        /// 
+        public async Task BatchRemoveAsync(IEnumerable ids)
+        {
+            var filter = Builders.Filter.In(s => s.Id, ids);
+            await _collection.DeleteManyAsync(filter);
+        }
+        /// 
+        /// 批量删除
+        /// 
+        /// 
+        /// 
+        public async Task BatchRemoveAsync(Expression> expression)
+        {
+            await _collection.DeleteManyAsync(expression);
+        }
         #endregion
         /// 
         /// 表达式取数据
diff --git a/langguanApi/Service/DeviceService.cs b/langguanApi/Service/DeviceService.cs
index 5bc931d..fa61936 100644
--- a/langguanApi/Service/DeviceService.cs
+++ b/langguanApi/Service/DeviceService.cs
@@ -1,4 +1,5 @@
-using langguanApi.Extensions.AutoDI;
+using langguanApi.Extensions;
+using langguanApi.Extensions.AutoDI;
 using langguanApi.Model;
 using langguanApi.Model.Dto;
 using Mapster;
@@ -25,12 +26,8 @@ namespace langguanApi.Service
                 return new ApiResult { code = 1, msg = $"已经存在名称为:{input.NickName}" };
             }
             var entity = input.Adapt();
-            if (entity != null)
-            {
-                await base.CreateAsync(entity);
-                return new ApiResult { code = 0, msg = "" };
-            }
-            return new ApiResult { code = -1, msg = "" }; ;
+            await base.CreateAsync(entity);
+            return new ApiResult { code = 0, msg = "" };
         }
         /// 
         /// 是否存在
@@ -103,7 +100,7 @@ namespace langguanApi.Service
         /// 获取设备类型
         /// 
         /// 
-        public  Task> GetDeviceTypes()
+        public Task> GetDeviceTypes()
         {
             //1 voc,2 cems,3,tsp,4 video
             Dictionary dic = new Dictionary
@@ -115,19 +112,40 @@ namespace langguanApi.Service
             };
             return Task.FromResult(dic);
         }
-    /// 
-    /// 分页取数据
-    /// 
-    /// 
-    /// 
-    public async Task