diff --git a/projects/IoT.Shared/Application/Models/EditDataModel.cs b/projects/IoT.Shared/Application/Models/EditIoTDataModel.cs similarity index 87% rename from projects/IoT.Shared/Application/Models/EditDataModel.cs rename to projects/IoT.Shared/Application/Models/EditIoTDataModel.cs index e76f5f5d..ab4dcb4b 100644 --- a/projects/IoT.Shared/Application/Models/EditDataModel.cs +++ b/projects/IoT.Shared/Application/Models/EditIoTDataModel.cs @@ -1,18 +1,22 @@ using Infrastructure.Application; using IoT.Shared.Application.Domain.Entities; using System; -using System.ComponentModel; using System.ComponentModel.DataAnnotations; namespace IoT.Shared.Application.Models { [Display(Name = "数据")] - public class EditDataModel : EditModel + public class EditIoTDataModel : EditModel { + [ReadOnlyForEdit] + [Display(Name = "产品")] + [SelectList] + public Guid? ProductId { get; set; } + [Display(Name = "网关")] [ReadOnlyForEdit] [SelectList(nameof(DeviceId), "GetIoTDevice")] - public Guid? IoTGatewayId { get; set; } + public Guid? NodeId { get; set; } [Display(Name = "设备")] [ReadOnlyForEdit] diff --git a/projects/IoT.Shared/Application/Models/SearchDataModel.cs b/projects/IoT.Shared/Application/Models/SearchDataModel.cs index 8320850e..1fb4e267 100644 --- a/projects/IoT.Shared/Application/Models/SearchDataModel.cs +++ b/projects/IoT.Shared/Application/Models/SearchDataModel.cs @@ -4,7 +4,7 @@ using System.ComponentModel.DataAnnotations; namespace IoT.Shared.Application.Models { - public class SearchDataModel : PagedListModel + public class SearchDataModel : PagedListModel { [SelectList] [Display(Name = "网关")] diff --git a/projects/IoTNode/Areas/IoTCenter/Controllers/IoTDataController.cs b/projects/IoTNode/Areas/IoTCenter/Controllers/IoTDataController.cs index 341c6200..d4fb3f8f 100644 --- a/projects/IoTNode/Areas/IoTCenter/Controllers/IoTDataController.cs +++ b/projects/IoTNode/Areas/IoTCenter/Controllers/IoTDataController.cs @@ -17,23 +17,27 @@ namespace IoT.Shared.Areas.IoTCenter.Controlls [Route("IoTCenter/[controller]/[action]")] [Area("IoTCenter")] [ControllerScope(ControllerScopeType.Platform)] - public class IoTDataController : CrudController + public class IoTDataController : CrudController { private readonly AjaxBaseController _ajax; - public IoTDataController(IRepository repo, AjaxBaseController ajax) : base(repo) + public IoTDataController(IRepository repo, + AjaxBaseController ajax) : base(repo) { this._ajax = ajax; } public override IQueryable Include(IQueryable query) { - return query.Include(o => o.Device).ThenInclude(o => o.Node); + return query.Include(o => o.Device).ThenInclude(o => o.Node) + .Include(o=>o.Device).ThenInclude(o=>o.Product); } - public override IQueryable Query(PagedListModel model, IQueryable query) + public override IQueryable Query(PagedListModel model, IQueryable query) { - return query.WhereIf(model.Query.IoTGatewayId.HasValue, o => o.Device.NodeId == model.Query.IoTGatewayId.Value) + return query + .WhereIf(model.Query.ProductId.HasValue, o => o.Device.ProductId == model.Query.ProductId.Value) + .WhereIf(model.Query.NodeId.HasValue, o => o.Device.NodeId == model.Query.NodeId.Value) .WhereIf(model.Query.DeviceId.HasValue, o => o.DeviceId == model.Query.DeviceId.Value) .WhereIf(!string.IsNullOrEmpty(model.Query.Name), o => o.Name.Contains(model.Query.Name)) .WhereIf(!string.IsNullOrEmpty(model.Query.Key), o => o.Key.Contains(model.Query.Key)) @@ -46,20 +50,35 @@ namespace IoT.Shared.Areas.IoTCenter.Controlls .OrderBy(o => o.Device.ProductId).ThenBy(o => o.Device.NodeId).ThenBy(o => o.DeviceId); } - public override void ToDisplayModel(IoTData entity, EditDataModel model) + public override void ToDisplayModel(IoTData entity, EditIoTDataModel model) { - model.IoTGatewayId = entity?.Device?.NodeId; - ViewData.Add(model.DeviceId, entity?.Device?.Name); - ViewData.Add(model.IoTGatewayId, entity?.Device?.Node?.Name); + if(entity!=null) + { + model.ProductId = entity.Device.ProductId; + model.NodeId = entity.Device.NodeId; + } + if(model.ProductId.HasValue) + { + ViewData.Add(model.ProductId, entity.Device.Product.Name); + } + if(model.DeviceId.HasValue) + { + ViewData.Add(model.DeviceId, entity.Device.Name); + } + if(model.NodeId.HasValue) + { + ViewData.Add(model.NodeId, entity.Device.Node.Name); + } } - public override void ToEditModel(IoTData entity, EditDataModel model) + public override void ToEditModel(IoTData entity, EditIoTDataModel model) { - model.IoTGatewayId = entity?.Device?.NodeId; - ViewData.SelectList(o => model.IoTGatewayId, () => this._ajax.GetIoTGateway(model.IoTGatewayId).SelectList()); - if (model.IoTGatewayId.HasValue) + model.NodeId = entity?.Device?.NodeId; + ViewData.SelectList(o => model.ProductId, () => this._ajax.GetIoTProduct(model.ProductId).SelectList()); + ViewData.SelectList(o => model.NodeId, () => this._ajax.GetIoTGateway(model.NodeId).SelectList()); + if (model.NodeId.HasValue) { - ViewData.SelectList(o => model.DeviceId, () => this._ajax.GetIoTDevice(model.IoTGatewayId.Value, model.DeviceId).SelectList()); + ViewData.SelectList(o => model.DeviceId, () => this._ajax.GetIoTDevice(model.NodeId.Value, model.DeviceId).SelectList()); } } } diff --git a/projects/IoTNode/Areas/IoTCenter/Views/IoTData/_Script.cshtml b/projects/IoTNode/Areas/IoTCenter/Views/IoTData/_Script.cshtml deleted file mode 100644 index 2eff98e4..00000000 --- a/projects/IoTNode/Areas/IoTCenter/Views/IoTData/_Script.cshtml +++ /dev/null @@ -1,10 +0,0 @@ - \ No newline at end of file diff --git a/projects/IoTNode/Areas/IoTCenter/Views/IoTParameter/_Script.cshtml b/projects/IoTNode/Areas/IoTCenter/Views/IoTParameter/_Script.cshtml deleted file mode 100644 index 69b6e0cf..00000000 --- a/projects/IoTNode/Areas/IoTCenter/Views/IoTParameter/_Script.cshtml +++ /dev/null @@ -1,10 +0,0 @@ - \ No newline at end of file diff --git a/projects/IoTNode/Controllers/AjaxController.cs b/projects/IoTNode/Controllers/AjaxController.cs new file mode 100644 index 00000000..3991f61d --- /dev/null +++ b/projects/IoTNode/Controllers/AjaxController.cs @@ -0,0 +1,13 @@ +using IoT.Shared.Areas.IoTCenter.Controlls; +using Microsoft.Extensions.Logging; +using System; + +namespace IoTNode.Controllers +{ + public class AjaxController : AjaxBaseController + { + public AjaxController(IServiceProvider services, ILogger logger) : base(services, logger) + { + } + } +} \ No newline at end of file diff --git a/projects/IoTNode/DeviceServices/BaseDeviceService.cs b/projects/IoTNode/DeviceServices/BaseDeviceService.cs index 299f1d47..846dbd74 100644 --- a/projects/IoTNode/DeviceServices/BaseDeviceService.cs +++ b/projects/IoTNode/DeviceServices/BaseDeviceService.cs @@ -73,7 +73,7 @@ namespace IoTNode.DeviceServices { using var scope = _applicationServices.CreateScope(); var iotNodeClient = scope.ServiceProvider.GetService(); - iotNodeClient.ClientToServer($"Edit{typeof(IoTData).Name}", data.To(), null); + iotNodeClient.ClientToServer($"Edit{typeof(IoTData).Name}", data.To(), null); } public void UpdateDevice(IRepository repo, IoTDevice device) diff --git a/projects/IoTNode/Services/IoTNodeClient.cs b/projects/IoTNode/Services/IoTNodeClient.cs index 0cdcd2e9..91d26cea 100644 --- a/projects/IoTNode/Services/IoTNodeClient.cs +++ b/projects/IoTNode/Services/IoTNodeClient.cs @@ -284,14 +284,14 @@ namespace IoT.Shared.Services } else if (method == $"Edit{nameof(IoTData)}")//服务端编辑数据 { - var model = message.FromJson(); - dataService.Edit(model); + var model = message.FromJson(); + dataService.Edit(model); this.ClientToServer(method, model, null); } else if (method == $"Delete{nameof(IoTData)}")//服务端删除数据 { - var model = message.FromJson(); - dataService.Delete(model); + var model = message.FromJson(); + dataService.Delete(model); this.ClientToServer(method, model, null); } //else if (method == $"Edit{nameof(IoTCommand)}")//服务端编辑命令 @@ -384,8 +384,8 @@ namespace IoT.Shared.Services //} else if (method == Methods.UpdateCamera) { - var model = message.FromJson(); - dataService.Edit(model); + var model = message.FromJson(); + dataService.Edit(model); this.ClientToServer("EditData", model, null); } } diff --git a/projects/Platform/Application/Models/IoTCenter/EditPlatformIoTDataModel.cs b/projects/Platform/Application/Models/IoTCenter/EditPlatformIoTDataModel.cs new file mode 100644 index 00000000..f3a205ba --- /dev/null +++ b/projects/Platform/Application/Models/IoTCenter/EditPlatformIoTDataModel.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 EditPlatformIoTDataModel : EditIoTDataModel + { + [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/EditPlatformIoTDeviceModel.cs b/projects/Platform/Application/Models/IoTCenter/EditPlatformIoTDeviceModel.cs index 582120d2..f39d0594 100644 --- a/projects/Platform/Application/Models/IoTCenter/EditPlatformIoTDeviceModel.cs +++ b/projects/Platform/Application/Models/IoTCenter/EditPlatformIoTDeviceModel.cs @@ -4,7 +4,7 @@ using System.ComponentModel.DataAnnotations; namespace Platform.Application.Models.IoTCenter { - [Display(Name = "网关")] + [Display(Name = "设备")] public class EditPlatformIoTDeviceModel : EditIoTDeviceModel { [Display(Name = "机构")] diff --git a/projects/Platform/Areas/IoTCenter/Controllers/IoTDataController.cs b/projects/Platform/Areas/IoTCenter/Controllers/IoTDataController.cs index ac50abce..94826b25 100644 --- a/projects/Platform/Areas/IoTCenter/Controllers/IoTDataController.cs +++ b/projects/Platform/Areas/IoTCenter/Controllers/IoTDataController.cs @@ -8,7 +8,8 @@ using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.Primitives; +using Platform.Application.Models.IoTCenter; +using Platform.Areas.IoTCenter.Controllers; using System; using System.Linq; using Vibrant.InfluxDB.Client; @@ -21,27 +22,46 @@ namespace IoT.Shared.Areas.IoTCenter.Controlls [Route("IoTCenter/[controller]/[action]")] [Area("IoTCenter")] [ControllerScope(ControllerScopeType.Platform)] - public class IoTDataController : IoTSharedController + public class IoTDataController : IoTSharedController { private readonly IConfiguration _configuration; private readonly IRepository _nodeRepo; - private readonly AjaxBaseController _ajax; + private readonly AjaxController _ajax; + private readonly IRepository _categoryRepo; + private readonly IRepository _organRepo; + private readonly IRepository _buildingRepo; - public IoTDataController(IConfiguration configuration, IRepository nodeRepo, IRepository repo, AjaxBaseController ajax, IServiceProvider sp) : base(repo, sp) + public IoTDataController(IConfiguration configuration, + IRepository nodeRepo, + IRepository repo, + AjaxController ajax, + IRepository categoryRepo, + IRepository organRepo, + IRepository buildingRepo, + IServiceProvider sp) : base(repo, sp) { this._configuration = configuration; this._nodeRepo = nodeRepo; this._ajax = ajax; + this._categoryRepo = categoryRepo; + this._organRepo = organRepo; + this._buildingRepo = buildingRepo; } public override IQueryable Include(IQueryable query) { - return query.Include(o => o.Device).ThenInclude(o => o.Node); + return query.Include(o => o.Device).ThenInclude(o => o.Node).ThenInclude(o => o.Building).ThenInclude(o => o.Organ) + .Include(o => o.Device).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 query.WhereIf(model.Query.IoTGatewayId.HasValue, o => o.Device.NodeId == model.Query.IoTGatewayId.Value) + return query.WhereIf(model.Query.NodeId.HasValue, o => o.Device.NodeId == model.Query.NodeId.Value) + .WhereIf(model.Query.OrganId.HasValue, o => o.Device.Node.Building.OrganId == model.Query.OrganId.Value) + .WhereIf(model.Query.BuildingId.HasValue, o => o.Device.Node.BuildingId == model.Query.BuildingId.Value) + .WhereIf(model.Query.NodeId.HasValue, o => o.Device.NodeId == model.Query.NodeId.Value) + .WhereIf(model.Query.CategoryId.HasValue, o => o.Device.Product.CategoryId == model.Query.CategoryId.Value) + .WhereIf(model.Query.ProductId.HasValue, o => o.Device.ProductId == model.Query.ProductId.Value) .WhereIf(model.Query.DeviceId.HasValue, o => o.DeviceId == model.Query.DeviceId.Value) .WhereIf(!string.IsNullOrEmpty(model.Query.Name), o => o.Name.Contains(model.Query.Name)) .WhereIf(!string.IsNullOrEmpty(model.Query.Key), o => o.Key.Contains(model.Query.Key)) @@ -51,29 +71,84 @@ namespace IoT.Shared.Areas.IoTCenter.Controlls .WhereIf(!string.IsNullOrEmpty(model.Query.Description), o => o.Description.Contains(model.Query.Description)) .WhereIf(model.Query.Timestamp.HasValue, o => o.Timestamp == model.Query.Timestamp.Value) .WhereIf(model.Query.Hidden.HasValue, o => o.Hidden == model.Query.Hidden.Value) - .OrderBy(o => o.Device.ProductId).ThenBy(o=>o.Device.NodeId).ThenBy(o => o.DeviceId); + .OrderBy(o => o.Device.ProductId).ThenBy(o => o.Device.NodeId).ThenBy(o => o.DeviceId); } - public override void ToDisplayModel(IoTData entity, EditDataModel model) + public override void ToDisplayModel(IoTData entity, EditPlatformIoTDataModel model) { - model.IoTGatewayId = entity?.Device?.NodeId; - ViewData.Add(model.DeviceId, entity?.Device?.Name); - ViewData.Add(model.IoTGatewayId, entity?.Device?.Node?.Name); + if (entity != null) + { + model.ProductId = entity.Device.ProductId; + model.CategoryId = entity.Device.Product.CategoryId; + model.NodeId = entity.Device.NodeId; + model.BuildingId = entity.Device.Node.BuildingId; + model.OrganId = entity.Device.Node.Building.OrganId; + } + if (model.BuildingId.HasValue) + { + var name = this._buildingRepo.ReadOnlyTable() + .Where(o => o.ParentId != null) + .Where(o => o.Left <= entity.Device.Node.Building.Left && o.Right >= entity.Device.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.Device.Node.Building.Organ.Left && o.Right >= entity.Device.Node.Building.Organ.Right) + .ToList() + .ToTree() + .FirstOrDefault(o => o.Id == entity.Device.Node.Building.OrganId)?.GetDisplayName(); + ViewData.Add(model.OrganId, name); + } + if (model.ProductId.HasValue) + { + ViewData.Add(model.ProductId, entity.Device.Product.Name); + } + if (model.CategoryId.HasValue) + { + var name = this._categoryRepo.ReadOnlyTable() + .Where(o => o.ParentId != null) + .Where(o => o.Left <= entity.Device.Product.Category.Left && o.Right >= entity.Device.Product.Category.Right) + .ToList() + .ToTree() + .FirstOrDefault(o => o.Id == model.CategoryId.Value)?.GetDisplayName(); + ViewData.Add(model.CategoryId, name); + } + if (model.DeviceId.HasValue) + { + ViewData.Add(model.DeviceId, entity.Device.Name); + } + if (model.NodeId.HasValue) + { + ViewData.Add(model.NodeId, entity.Device.Node.Name); + } } - public override void ToEditModel(IoTData entity, EditDataModel model) + public override void ToEditModel(IoTData entity, EditPlatformIoTDataModel model) { - model.IoTGatewayId = entity?.Device?.NodeId; - ViewData.SelectList(o => model.IoTGatewayId, () => this._ajax.GetIoTGateway(model.IoTGatewayId).SelectList()); - if(model.IoTGatewayId.HasValue) + if (entity != null) { - ViewData.SelectList(o => model.DeviceId, () => this._ajax.GetIoTDevice(model.IoTGatewayId.Value, model.DeviceId).SelectList()); + model.BuildingId = entity.Device.Node.BuildingId; + model.OrganId = entity.Device.Node.Building.OrganId; + model.CategoryId = entity.Device.Product.CategoryId; + model.BuildingId = entity.Device.Node.BuildingId; + model.OrganId = entity.Device.Node.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); + ViewData.SelectList(o => model.NodeId, () => this._ajax.GetIoTGatewayByBuilding(model.BuildingId.Value, model.NodeId).SelectList(), model.BuildingId.HasValue); + ViewData.SelectList(o => model.DeviceId, () => this._ajax.GetIoTDevice(model.NodeId.Value, model.DeviceId).SelectList(), model.NodeId.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(EditDataModel model) + public override string GetNodeNumber(EditPlatformIoTDataModel model) { - return this._nodeRepo.ReadOnlyTable().Where(o => o.Id == model.IoTGatewayId).Select(o => o.Number).FirstOrDefault(); + return this._nodeRepo.ReadOnlyTable().Where(o => o.Id == model.NodeId).Select(o => o.Number).FirstOrDefault(); } [HttpGet] diff --git a/projects/Platform/Areas/IoTCenter/Views/IoTData/Details.cshtml b/projects/Platform/Areas/IoTCenter/Views/IoTData/Details.cshtml index 32920405..77d37bea 100644 --- a/projects/Platform/Areas/IoTCenter/Views/IoTData/Details.cshtml +++ b/projects/Platform/Areas/IoTCenter/Views/IoTData/Details.cshtml @@ -1,4 +1,4 @@ -@model EditDataModel +@model EditIoTDataModel @{ HtmlTitle = "查看" + ViewContext.ViewData.ModelMetadata.ModelType.GetDisplayName(); } diff --git a/projects/Platform/Controllers/AjaxController.cs b/projects/Platform/Controllers/AjaxController.cs index 6d382d44..118e1bde 100644 --- a/projects/Platform/Controllers/AjaxController.cs +++ b/projects/Platform/Controllers/AjaxController.cs @@ -17,7 +17,7 @@ namespace Platform.Areas.IoTCenter.Controllers { public class AjaxController : AjaxBaseController { - public AjaxController(IServiceProvider services,ILogger logger): base(services, logger) + public AjaxController(IServiceProvider services, ILogger logger) : base(services, logger) { } @@ -35,6 +35,7 @@ namespace Platform.Areas.IoTCenter.Controllers .ToList(); return new JsonResult(new SelectList(list, "Id", "Name", selected)); } + public JsonResult GetOrgan(Guid? selected) { using var serviceScope = this._services.CreateScope(); @@ -49,6 +50,7 @@ namespace Platform.Areas.IoTCenter.Controllers .ToList(); return new JsonResult(new SelectList(list, "Id", "Name", selected)); } + public JsonResult GetBuilding(Guid parentId, Guid? selected) { using var serviceScope = this._services.CreateScope(); @@ -131,7 +133,6 @@ namespace Platform.Areas.IoTCenter.Controllers return new JsonResult(new SelectList(list, "Id", "Name", selected)); } - public JsonResult GetIoTProductCategory(Guid? selected) { using var scope = this._services.CreateScope(); @@ -145,18 +146,28 @@ namespace Platform.Areas.IoTCenter.Controllers .Select(o => new IoTProductCategory { Id = o.Id, Name = o.GetDisplayName() }) .ToList(); return new JsonResult(new SelectList(list, "Id", "Name", selected)); - } + } - public JsonResult GetIoTProductByCategory(Guid parentId,Guid? selected=null) + public JsonResult GetIoTProductByCategory(Guid parentId, Guid? selected = null) { using var scope = this._services.CreateScope(); var repo = scope.ServiceProvider.GetRequiredService>(); var list = repo.ReadOnlyTable() - .Where(o=>o.CategoryId==parentId) + .Where(o => o.CategoryId == parentId) .Select(o => new { o.Id, o.Name }) .ToList(); return new JsonResult(new SelectList(list, "Id", "Name", selected)); + } + public JsonResult GetIoTGatewayByBuilding(Guid parentId, Guid? selected = null) + { + using var scope = this._services.CreateScope(); + var repo = scope.ServiceProvider.GetRequiredService>(); + var list = repo.ReadOnlyTable() + .Where(o => o.BuildingId == parentId) + .Select(o => new { o.Id, Name = $"[{o.Number}]{o.Name}" }) + .ToList(); + return new JsonResult(new SelectList(list, "Id", "Name", selected)); } public SelectList GetOrganNodeSelectList(Guid parentId, Guid? selected = null) @@ -170,6 +181,7 @@ namespace Platform.Areas.IoTCenter.Controllers .ToList(); return new SelectList(list, "Id", "Name", selected); } + public SelectList GetOrganSceneSelectList(Guid parentId, Guid? selected = null) { using var scope = this._services.CreateScope(); @@ -180,9 +192,10 @@ namespace Platform.Areas.IoTCenter.Controllers .ToList(); return new SelectList(list, "Id", "Name", selected); } + public JsonResult GetOrganSceneJson(Guid parentId, Guid? selected) { return new JsonResult(this.GetOrganSceneSelectList(parentId, selected)); } } -} \ No newline at end of file +} diff --git a/projects/Platform/Services/IoTCenterHub.cs b/projects/Platform/Services/IoTCenterHub.cs index 302ab4d4..26f22298 100644 --- a/projects/Platform/Services/IoTCenterHub.cs +++ b/projects/Platform/Services/IoTCenterHub.cs @@ -224,8 +224,8 @@ namespace Platform.Services } else if (method == $"Edit{nameof(IoTData)}")//编辑数据或设备上报数据 { - var model = message.FromJson(); - this._dataService.Edit(model); + var model = message.FromJson(); + this._dataService.Edit(model); } //else if (method == $"Edit{nameof(Data)}List") //{ @@ -237,8 +237,8 @@ namespace Platform.Services //} else if (method == $"Delete{nameof(IoTData)}")//删除数据返回 { - var model = message.FromJson(); - this._dataService.Delete(model); + var model = message.FromJson(); + this._dataService.Delete(model); } //else if (method == $"Edit{nameof(IoTCommand)}")//编辑命令返回 //{