diff --git a/projects/IoT.Shared/Application/Models/EditDeviceModel.cs b/projects/IoT.Shared/Application/Models/EditIoTDeviceModel.cs similarity index 79% rename from projects/IoT.Shared/Application/Models/EditDeviceModel.cs rename to projects/IoT.Shared/Application/Models/EditIoTDeviceModel.cs index 0731d56b..c9b79f1f 100644 --- a/projects/IoT.Shared/Application/Models/EditDeviceModel.cs +++ b/projects/IoT.Shared/Application/Models/EditIoTDeviceModel.cs @@ -5,26 +5,13 @@ using System.ComponentModel.DataAnnotations; namespace IoT.Shared.Application.Models { [Display(Name = "设备")] - public class EditDeviceModel : EditModel + public class EditIoTDeviceModel : EditModel { - [ReadOnlyForEdit] - [Display(Name = "产品分类")] - [SelectList(nameof(ProductId), "GetIoTProduct")] - public Guid? ProductCategoryId { get; set; } - [ReadOnlyForEdit] [Display(Name = "产品")] [SelectList] public Guid? ProductId { get; set; } - [Display(Name = "机构")] - [SelectList(nameof(BuildingId), "GetBuilding")] - public Guid? OrganId { get; set; } - - [Display(Name = "建筑")] - [SelectList(nameof(NodeId), "GetIoTGateway")] - public Guid? BuildingId { get; set; } - [ReadOnlyForEdit] [SelectList] [Display(Name = "网关")] diff --git a/projects/IoT.Shared/Application/Models/EditParameterModel.cs b/projects/IoT.Shared/Application/Models/EditIoTParameterModel.cs similarity index 96% rename from projects/IoT.Shared/Application/Models/EditParameterModel.cs rename to projects/IoT.Shared/Application/Models/EditIoTParameterModel.cs index defb4a0c..236a2030 100644 --- a/projects/IoT.Shared/Application/Models/EditParameterModel.cs +++ b/projects/IoT.Shared/Application/Models/EditIoTParameterModel.cs @@ -5,7 +5,7 @@ using System.ComponentModel.DataAnnotations; namespace IoT.Shared.Application.Models { [Display(Name = "参数")] - public class EditParameterModel : EditModel + public class EditIoTParameterModel : EditModel { [Display(Name = "产品")] [SelectList(nameof(ApiId),"GetIoTApi")] diff --git a/projects/IoT.Shared/Application/Models/SearchDeviceMode.cs b/projects/IoT.Shared/Application/Models/SearchDeviceMode.cs index 5dfbef7b..13a9ecba 100644 --- a/projects/IoT.Shared/Application/Models/SearchDeviceMode.cs +++ b/projects/IoT.Shared/Application/Models/SearchDeviceMode.cs @@ -4,7 +4,7 @@ using System.ComponentModel.DataAnnotations; namespace IoT.Shared.Application.Models { - public class SearchDeviceMode : PagedListModel + public class SearchDeviceMode : PagedListModel { [SelectList] [Display(Name = "网关")] diff --git a/projects/IoTNode/Areas/IoTCenter/Controllers/IoTDeviceController.cs b/projects/IoTNode/Areas/IoTCenter/Controllers/IoTDeviceController.cs index 5a813303..6c35e094 100644 --- a/projects/IoTNode/Areas/IoTCenter/Controllers/IoTDeviceController.cs +++ b/projects/IoTNode/Areas/IoTCenter/Controllers/IoTDeviceController.cs @@ -17,7 +17,7 @@ namespace IoT.Shared.Areas.IoTCenter.Controlls [Route("IoTCenter/[controller]/[action]")] [Area("IoTCenter")] [ControllerScope(ControllerScopeType.Platform)] - public class IoTDeviceController : CrudController + public class IoTDeviceController : CrudController { private readonly AjaxBaseController _ajax; @@ -31,7 +31,7 @@ namespace IoT.Shared.Areas.IoTCenter.Controlls return query.Include(o => o.Product).Include(o => o.Node); } - public override IQueryable Query(PagedListModel model, IQueryable query) + public override IQueryable Query(PagedListModel model, IQueryable query) { return query .WhereIf(model.Query.NodeId.HasValue, o => o.NodeId == model.Query.NodeId.Value) @@ -50,13 +50,13 @@ namespace IoT.Shared.Areas.IoTCenter.Controlls .WhereIf(model.Query.Disabled.HasValue, o => o.Disabled == model.Query.Disabled.Value); } - public override void ToDisplayModel(IoTDevice entity, EditDeviceModel model) + public override void ToDisplayModel(IoTDevice entity, EditIoTDeviceModel model) { ViewData.Add(model.NodeId, entity?.Node?.Name); ViewData.Add(model.ProductId, entity?.Product?.Name); } - public override void ToEditModel(IoTDevice entity, EditDeviceModel model) + public override void ToEditModel(IoTDevice entity, EditIoTDeviceModel model) { ViewData.SelectList(o => model.NodeId, () => this._ajax.GetIoTGateway(model.NodeId).SelectList()); ViewData.SelectList(o => model.ProductId, () => this._ajax.GetIoTProduct(model.ProductId).SelectList()); diff --git a/projects/IoTNode/Areas/IoTCenter/Controllers/IoTParameterController.cs b/projects/IoTNode/Areas/IoTCenter/Controllers/IoTParameterController.cs index c20ebf50..f1f4d3f3 100644 --- a/projects/IoTNode/Areas/IoTCenter/Controllers/IoTParameterController.cs +++ b/projects/IoTNode/Areas/IoTCenter/Controllers/IoTParameterController.cs @@ -17,7 +17,7 @@ namespace IoT.Shared.Areas.IoTCenter.Controlls [Route("IoTCenter/[controller]/[action]")] [Area("IoTCenter")] [ControllerScope(ControllerScopeType.Platform)] - public class IoTParameterController : CrudController + public class IoTParameterController : CrudController { private readonly AjaxBaseController _ajax; @@ -31,7 +31,7 @@ namespace IoT.Shared.Areas.IoTCenter.Controlls return query.Include(o => o.Api).ThenInclude(o => o.Product); } - public override IQueryable Query(PagedListModel model, IQueryable query) + public override IQueryable Query(PagedListModel model, IQueryable query) { return base.Query(model, query) .WhereIf(model.Query.Required.HasValue, o => o.Required == model.Query.Required.Value) @@ -44,14 +44,14 @@ namespace IoT.Shared.Areas.IoTCenter.Controlls .WhereIf(!string.IsNullOrEmpty(model.Query.Maxinum), o => o.Maxinum == model.Query.Maxinum); } - public override void ToDisplayModel(IoTParameter entity, EditParameterModel model) + public override void ToDisplayModel(IoTParameter entity, EditIoTParameterModel model) { model.ProductId = entity?.Api.ProductId; ViewData.Add(model.ProductId, entity?.Api?.Product?.Name); ViewData.Add(model.ApiId, entity?.Api?.Name); } - public override void ToEditModel(IoTParameter entity, EditParameterModel model) + public override void ToEditModel(IoTParameter entity, EditIoTParameterModel model) { model.ProductId = entity?.Api?.ProductId; ViewData.SelectList(o => model.ProductId, () => this._ajax.GetIoTProduct(model.ProductId).SelectList()); diff --git a/projects/IoTNode/DeviceServices/FBee/FBeeService.cs b/projects/IoTNode/DeviceServices/FBee/FBeeService.cs index 011e6b82..a7ca66c0 100644 --- a/projects/IoTNode/DeviceServices/FBee/FBeeService.cs +++ b/projects/IoTNode/DeviceServices/FBee/FBeeService.cs @@ -1587,7 +1587,7 @@ namespace IoTNode.DeviceServices.FBee { try { - var model = device.To(); + var model = device.To(); deviceRepo.Delete(device); deviceRepo.SaveChanges(); } diff --git a/projects/IoTNode/Services/IoTNodeClient.cs b/projects/IoTNode/Services/IoTNodeClient.cs index 50f4214d..0cdcd2e9 100644 --- a/projects/IoTNode/Services/IoTNodeClient.cs +++ b/projects/IoTNode/Services/IoTNodeClient.cs @@ -271,15 +271,15 @@ namespace IoT.Shared.Services } else if (method == $"Edit{nameof(IoTDevice)}")//服务端编辑设备 { - var model = message.FromJson(); + var model = message.FromJson(); //if node category not had,get category from serever by http sync - dataService.Edit(model); + dataService.Edit(model); this.ClientToServer(method, model, null); } else if (method == $"Delete{nameof(IoTDevice)}")//服务端删除设备 { - var model = message.FromJson(); - dataService.Delete(model); + var model = message.FromJson(); + dataService.Delete(model); this.ClientToServer(method, model, null); } else if (method == $"Edit{nameof(IoTData)}")//服务端编辑数据 diff --git a/projects/Platform/Application/Models/IoTCenter/EditPlatformIoTDeviceModel.cs b/projects/Platform/Application/Models/IoTCenter/EditPlatformIoTDeviceModel.cs new file mode 100644 index 00000000..582120d2 --- /dev/null +++ b/projects/Platform/Application/Models/IoTCenter/EditPlatformIoTDeviceModel.cs @@ -0,0 +1,25 @@ +using IoT.Shared.Application.Models; +using System; +using System.ComponentModel.DataAnnotations; + +namespace Platform.Application.Models.IoTCenter +{ + [Display(Name = "网关")] + public class EditPlatformIoTDeviceModel : EditIoTDeviceModel + { + [Display(Name = "机构")] + [SelectList(nameof(BuildingId), "GetBuilding")] + [ReadOnlyForEdit] + public Guid? OrganId { get; set; } + + [Display(Name = "建筑")] + [SelectList(nameof(NodeId), "GetIoTGateway")] + [ReadOnlyForEdit] + public Guid? BuildingId { get; set; } + + [Display(Name = "分类")] + [ReadOnlyForEdit] + [SelectList(nameof(ProductId), "GetIoTProductByCategory")] + public Guid? CategoryId { get; set; } + } +} diff --git a/projects/Platform/Application/Models/IoTCenter/EditPlatformIoTParameterModel.cs b/projects/Platform/Application/Models/IoTCenter/EditPlatformIoTParameterModel.cs new file mode 100644 index 00000000..cf07ff2d --- /dev/null +++ b/projects/Platform/Application/Models/IoTCenter/EditPlatformIoTParameterModel.cs @@ -0,0 +1,15 @@ +using System; +using IoT.Shared.Application.Models; +using System.ComponentModel.DataAnnotations; + +namespace Platform.Application.Models.IoTCenter +{ + [Display(Name = "参数")] + public class EditPlatformIoTParameterModel : EditIoTParameterModel + { + [Display(Name = "分类")] + [ReadOnlyForEdit] + [SelectList(nameof(ProductId),"GetIoTProductByCategory")] + public Guid? CategoryId { get; set; } + } +} diff --git a/projects/Platform/Areas/IoTCenter/Controllers/IoTDeviceController.cs b/projects/Platform/Areas/IoTCenter/Controllers/IoTDeviceController.cs index cb80ce6b..fea95a4f 100644 --- a/projects/Platform/Areas/IoTCenter/Controllers/IoTDeviceController.cs +++ b/projects/Platform/Areas/IoTCenter/Controllers/IoTDeviceController.cs @@ -7,6 +7,7 @@ using IoT.Shared.Application.Models; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; +using Platform.Application.Models.IoTCenter; using Platform.Areas.IoTCenter.Controllers; using System; using System.Linq; @@ -18,27 +19,39 @@ namespace IoT.Shared.Areas.IoTCenter.Controlls [Route("IoTCenter/[controller]/[action]")] [Area("IoTCenter")] [ControllerScope(ControllerScopeType.Platform)] - public class IoTDeviceController : IoTSharedController + public class IoTDeviceController : IoTSharedController { private readonly AjaxController _ajax; + private readonly IRepository _categoryRepo; + private readonly IRepository _organRepo; + private readonly IRepository _buildingRepo; - public IoTDeviceController(IRepository repo, AjaxController ajax, IServiceProvider sp) : base(repo, sp) + public IoTDeviceController(IRepository repo, + AjaxController ajax, + IRepository categoryRepo, + IRepository organRepo, + IRepository buildingRepo, + IServiceProvider sp) : base(repo, sp) { this._ajax = ajax; + this._categoryRepo = categoryRepo; + this._organRepo = organRepo; + this._buildingRepo = buildingRepo; } public override IQueryable Include(IQueryable query) { - return query.Include(o => o.Product) + return query.Include(o => o.Product).ThenInclude(o=>o.Category) .Include(o => o.Node).ThenInclude(o=>o.Building).ThenInclude(o=>o.Organ); } - public override IQueryable Query(PagedListModel model, IQueryable query) + public override IQueryable Query(PagedListModel model, IQueryable query) { return query .WhereIf(model.Query.OrganId.HasValue, o => o.Node.Building.OrganId == model.Query.OrganId.Value) .WhereIf(model.Query.BuildingId.HasValue, o => o.Node.BuildingId == model.Query.BuildingId.Value) .WhereIf(model.Query.NodeId.HasValue, o => o.NodeId == model.Query.NodeId.Value) + .WhereIf(model.Query.CategoryId.HasValue, o => o.Product.CategoryId == model.Query.CategoryId.Value) .WhereIf(model.Query.ProductId.HasValue, o => o.ProductId == model.Query.ProductId.Value) .WhereIf(!string.IsNullOrEmpty(model.Query.Name), o => o.Name.Contains(model.Query.Name)) .WhereIf(!string.IsNullOrEmpty(model.Query.DisplayName), o => o.DisplayName.Contains(model.Query.DisplayName)) @@ -54,21 +67,69 @@ namespace IoT.Shared.Areas.IoTCenter.Controlls .WhereIf(model.Query.Disabled.HasValue, o => o.Disabled == model.Query.Disabled.Value); } - public override void ToDisplayModel(IoTDevice entity, EditDeviceModel model) + public override void ToDisplayModel(IoTDevice entity, EditPlatformIoTDeviceModel model) { - ViewData.Add(model.NodeId, entity?.Node?.Name); - ViewData.Add(model.ProductId, entity?.Product?.Name); + if(entity!=null) + { + model.BuildingId = entity.Node.BuildingId; + model.OrganId = entity.Node.Building.OrganId; + model.CategoryId = entity.Product.CategoryId; + } + if(model.BuildingId.HasValue) + { + var name = this._buildingRepo.ReadOnlyTable() + .Where(o => o.ParentId != null) + .Where(o => o.Left <= entity.Node.Building.Left && o.Right >= entity.Node.Building.Right) + .ToList() + .ToTree() + .FirstOrDefault(o => o.Id == model.BuildingId.Value)?.GetDisplayName(); + ViewData.Add(model.BuildingId.Value, name); + } + if (model.OrganId.HasValue) + { + var name = this._organRepo.ReadOnlyTable() + .Where(o => o.ParentId != null) + .Where(o => o.Left <= entity.Node.Building.Organ.Left && o.Right >= entity.Node.Building.Organ.Right) + .ToList() + .ToTree() + .FirstOrDefault(o => o.Id == entity.Node.Building.OrganId)?.GetDisplayName(); + ViewData.Add(model.OrganId, name); + } + if (model.CategoryId.HasValue) + { + var name = this._categoryRepo.ReadOnlyTable() + .Where(o => o.ParentId != null) + .Where(o => o.Left <= entity.Product.Category.Left && o.Right >= entity.Product.Category.Right) + .ToList() + .ToTree() + .FirstOrDefault(o => o.Id == model.CategoryId.Value)?.GetDisplayName(); + ViewData.Add(model.CategoryId, name); + } + if (model.ProductId.HasValue) + { + ViewData.Add(model.ProductId, entity.Product.Name); + } + if(model.NodeId.HasValue) + { + ViewData.Add(model.NodeId, entity.Node.Name); + } } - public override void ToEditModel(IoTDevice entity, EditDeviceModel model) + public override void ToEditModel(IoTDevice entity, EditPlatformIoTDeviceModel model) { - ViewData.SelectList(o => model.ProductCategoryId, () => this._ajax.GetIoTProductCategory(model.ProductCategoryId).SelectList()); - ViewData.SelectList(o => model.ProductId, () => this._ajax.GetIoTProduct(model.ProductCategoryId).SelectList()); - //ViewData.SelectList(o => model.NodeId, () => this._ajax.GetIoTGateway(model.NodeId).SelectList()); - //ViewData.SelectList(o => model.ProductId, () => this._ajax.GetIoTProduct(model.ProductId).SelectList()); + if (entity != null) + { + model.BuildingId = entity.Node.BuildingId; + model.OrganId = entity.Node.Building.OrganId; + model.CategoryId = entity.Product.CategoryId; + } + ViewData.SelectList(o => model.OrganId, () => this._ajax.GetOrgan(model.OrganId).SelectList()); + ViewData.SelectList(o => model.BuildingId, () => this._ajax.GetBuilding(model.OrganId.Value, model.BuildingId).SelectList(), model.OrganId.HasValue); + ViewData.SelectList(o => model.CategoryId, () => this._ajax.GetIoTProductCategory(model.CategoryId).SelectList()); + ViewData.SelectList(o => model.ProductId, () => this._ajax.GetIoTProductByCategory(model.CategoryId.Value, model.ProductId).SelectList(), model.CategoryId.HasValue); } - public override string GetNodeNumber(EditDeviceModel model) + public override string GetNodeNumber(EditPlatformIoTDeviceModel model) { return this.Repo.ReadOnlyTable().Where(o => o.NodeId == model.NodeId).Select(o => o.Node.Number).FirstOrDefault(); } diff --git a/projects/Platform/Areas/IoTCenter/Controllers/IoTGatewayController.cs b/projects/Platform/Areas/IoTCenter/Controllers/IoTGatewayController.cs index c754a8f2..799742f3 100644 --- a/projects/Platform/Areas/IoTCenter/Controllers/IoTGatewayController.cs +++ b/projects/Platform/Areas/IoTCenter/Controllers/IoTGatewayController.cs @@ -27,7 +27,8 @@ namespace IoT.Shared.Areas.IoTCenter.Controlls private readonly AjaxController _ajax; public IoTGatewayController(IRepository repo, - IServiceProvider sp, IRepository organRepo, + IServiceProvider sp, + IRepository organRepo, IRepository buildingRepo, AjaxController ajax) : base(repo, sp) { @@ -55,7 +56,10 @@ namespace IoT.Shared.Areas.IoTCenter.Controlls public override void ToDisplayModel(IoTGateway entity, EditPlatformIoTGatewayModel model) { - model.OrganId = entity.Building?.OrganId; + if(entity!=null) + { + model.OrganId = entity.Building.OrganId; + } if (model.BuildingId.HasValue) { var name = this._buildingRepo.ReadOnlyTable() @@ -80,12 +84,12 @@ namespace IoT.Shared.Areas.IoTCenter.Controlls public override void ToEditModel(IoTGateway entity, EditPlatformIoTGatewayModel model) { - model.OrganId = entity?.Building?.OrganId; - ViewData.SelectList(o => model.OrganId, () => this._ajax.GetOrgan(model.OrganId).SelectList()); - if (model.OrganId.HasValue) + if(entity!=null) { - ViewData.SelectList(o => model.BuildingId, () => this._ajax.GetBuilding(model.OrganId.Value, model.BuildingId).SelectList()); + model.OrganId = entity.Building.OrganId; } + ViewData.SelectList(o => model.OrganId, () => this._ajax.GetOrgan(model.OrganId).SelectList()); + ViewData.SelectList(o => model.BuildingId, () => this._ajax.GetBuilding(model.OrganId.Value, model.BuildingId).SelectList(),model.OrganId.HasValue); } public override void ToEntity(EditPlatformIoTGatewayModel model, IoTGateway entity) { diff --git a/projects/Platform/Areas/IoTCenter/Controllers/IoTParameterController.cs b/projects/Platform/Areas/IoTCenter/Controllers/IoTParameterController.cs index c20ebf50..ca155333 100644 --- a/projects/Platform/Areas/IoTCenter/Controllers/IoTParameterController.cs +++ b/projects/Platform/Areas/IoTCenter/Controllers/IoTParameterController.cs @@ -7,6 +7,8 @@ using IoT.Shared.Application.Models; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; +using Platform.Application.Models.IoTCenter; +using Platform.Areas.IoTCenter.Controllers; using System; using System.Linq; @@ -17,26 +19,29 @@ namespace IoT.Shared.Areas.IoTCenter.Controlls [Route("IoTCenter/[controller]/[action]")] [Area("IoTCenter")] [ControllerScope(ControllerScopeType.Platform)] - public class IoTParameterController : CrudController + public class IoTParameterController : CrudController { - private readonly AjaxBaseController _ajax; + private readonly AjaxController _ajax; + private readonly IRepository _categoryRepo; - public IoTParameterController(IRepository repo, AjaxBaseController ajax) : base(repo) + public IoTParameterController(IRepository repo, AjaxController ajax, IRepository categoryRepo) : base(repo) { this._ajax = ajax; + this._categoryRepo = categoryRepo; } public override IQueryable Include(IQueryable query) { - return query.Include(o => o.Api).ThenInclude(o => o.Product); + return query.Include(o => o.Api).ThenInclude(o => o.Product).ThenInclude(o => o.Category); } - public override IQueryable Query(PagedListModel model, IQueryable query) + public override IQueryable Query(PagedListModel model, IQueryable query) { return base.Query(model, query) - .WhereIf(model.Query.Required.HasValue, o => o.Required == model.Query.Required.Value) + .WhereIf(model.Query.CategoryId.HasValue, o => o.Api.Product.CategoryId == model.Query.CategoryId.Value) .WhereIf(model.Query.ProductId.HasValue, o => o.Api.ProductId == model.Query.ProductId.Value) .WhereIf(model.Query.ApiId.HasValue, o => o.ApiId == model.Query.ApiId.Value) + .WhereIf(model.Query.Required.HasValue, o => o.Required == model.Query.Required.Value) .WhereIf(!string.IsNullOrEmpty(model.Query.Type), o => o.Type.Contains(model.Query.Type)) .WhereIf(!string.IsNullOrEmpty(model.Query.Name), o => o.Name.Contains(model.Query.Name)) .WhereIf(!string.IsNullOrEmpty(model.Query.Description), o => o.Description.Contains(model.Query.Description)) @@ -44,21 +49,40 @@ namespace IoT.Shared.Areas.IoTCenter.Controlls .WhereIf(!string.IsNullOrEmpty(model.Query.Maxinum), o => o.Maxinum == model.Query.Maxinum); } - public override void ToDisplayModel(IoTParameter entity, EditParameterModel model) + public override void ToDisplayModel(IoTParameter entity, EditPlatformIoTParameterModel model) { - model.ProductId = entity?.Api.ProductId; - ViewData.Add(model.ProductId, entity?.Api?.Product?.Name); - ViewData.Add(model.ApiId, entity?.Api?.Name); + if (entity != null) + { + model.ProductId = entity.Api.ProductId; + model.CategoryId = entity.Api.Product.CategoryId; + ViewData.Add(model.ApiId, entity.Api.Name); + } + if (model.CategoryId.HasValue) + { + var name = this._categoryRepo.ReadOnlyTable() + .Where(o => o.ParentId != null) + .Where(o => o.Left <= entity.Api.Product.Category.Left && o.Right >= entity.Api.Product.Category.Right) + .ToList() + .ToTree() + .FirstOrDefault(o => o.Id == model.CategoryId.Value)?.GetDisplayName(); + ViewData.Add(model.CategoryId, name); + } + if(model.ProductId.HasValue) + { + ViewData.Add(model.ProductId, entity.Api.Product.Name); + } } - public override void ToEditModel(IoTParameter entity, EditParameterModel model) + public override void ToEditModel(IoTParameter entity, EditPlatformIoTParameterModel model) { - model.ProductId = entity?.Api?.ProductId; - ViewData.SelectList(o => model.ProductId, () => this._ajax.GetIoTProduct(model.ProductId).SelectList()); - if(model.ProductId.HasValue) + if(entity!=null) { - ViewData.SelectList(o => model.ApiId, () => this._ajax.GetIoTApi(model.ProductId.Value, model.ApiId).SelectList()); + model.ProductId = entity.Api.ProductId; + model.CategoryId = entity.Api.Product.CategoryId; } + ViewData.SelectList(o => model.CategoryId, () => this._ajax.GetIoTProductCategory(model.CategoryId).SelectList()); + ViewData.SelectList(o => model.ProductId, () => this._ajax.GetIoTProductByCategory(model.CategoryId.Value, model.ProductId).SelectList(), model.CategoryId.HasValue); + ViewData.SelectList(o => model.ApiId, () => this._ajax.GetIoTApi(model.ProductId.Value, model.ApiId).SelectList(), model.ProductId.HasValue); } } } diff --git a/projects/Platform/Services/IoTCenterHub.cs b/projects/Platform/Services/IoTCenterHub.cs index f36f29b3..302ab4d4 100644 --- a/projects/Platform/Services/IoTCenterHub.cs +++ b/projects/Platform/Services/IoTCenterHub.cs @@ -214,13 +214,13 @@ namespace Platform.Services } else if (method == $"Edit{nameof(IoTDevice)}")//编辑设备返回 { - var model = message.FromJson(); - this._dataService.Edit(model); + var model = message.FromJson(); + this._dataService.Edit(model); } else if (method == $"Delete{nameof(IoTDevice)}")//删除设备返回 { - var model = message.FromJson(); - this._dataService.Delete(model); + var model = message.FromJson(); + this._dataService.Delete(model); } else if (method == $"Edit{nameof(IoTData)}")//编辑数据或设备上报数据 {