diff --git a/BPA.SAAS.Manage.Application/Device/Dtos/ProductTopics/ProductTopicsQueryInputDto.cs b/BPA.SAAS.Manage.Application/Device/Dtos/ProductTopics/ProductTopicsQueryInputDto.cs index f203efb..0cffdf5 100644 --- a/BPA.SAAS.Manage.Application/Device/Dtos/ProductTopics/ProductTopicsQueryInputDto.cs +++ b/BPA.SAAS.Manage.Application/Device/Dtos/ProductTopics/ProductTopicsQueryInputDto.cs @@ -15,4 +15,11 @@ namespace BPA.SAAS.Manage.Application.Device.Dtos.ProductTopics public string ProductVesionId { get; set; } public bool IsDefault { get; set; } } + public class ProductTopicsQueryDto + { + + public string ProductId { get; set; } + public string ProductVesionId { get; set; } + public bool IsDefault { get; set; } + } } diff --git a/BPA.SAAS.Manage.Application/Device/Interface/IProductTopicsService.cs b/BPA.SAAS.Manage.Application/Device/Interface/IProductTopicsService.cs index cbb6579..b0c1cd9 100644 --- a/BPA.SAAS.Manage.Application/Device/Interface/IProductTopicsService.cs +++ b/BPA.SAAS.Manage.Application/Device/Interface/IProductTopicsService.cs @@ -1,6 +1,7 @@ using BPA.SAAS.Manage.Application.Device.Dtos.Device; using BPA.SAAS.Manage.Application.Device.Dtos.ProductTopics; using BPA.SAAS.Manage.Core.Base; +using BPA.SAAS.Manage.Core.Product; using System; using System.Collections.Generic; using System.Linq; @@ -17,6 +18,12 @@ namespace BPA.SAAS.Manage.Application.Device.Interface /// /// Task GetProductTopicsPage(ProductTopicsQueryInputDto inputDto); + /// + /// 查询topics列表 + /// + /// + /// + Task> GetProductTopicList(ProductTopicsQueryDto inputDto); /// /// 添加 /// diff --git a/BPA.SAAS.Manage.Application/Device/ProductTopicsServices.cs b/BPA.SAAS.Manage.Application/Device/ProductTopicsServices.cs index c15ff01..8399ef3 100644 --- a/BPA.SAAS.Manage.Application/Device/ProductTopicsServices.cs +++ b/BPA.SAAS.Manage.Application/Device/ProductTopicsServices.cs @@ -2,6 +2,7 @@ using BPA.SAAS.Manage.Application.Device.Dtos.ProductTopics; using BPA.SAAS.Manage.Application.Device.Interface; using BPA.SAAS.Manage.Core.Base; +using BPA.SAAS.Manage.Core.Product; using Microsoft.AspNetCore.Components.Forms; using System; using System.Collections.Generic; @@ -30,6 +31,16 @@ namespace BPA.SAAS.Manage.Application.Device return await _productTopicsService.GetProductTopicsPage(inputDto); } /// + /// 查询topics列表 + /// + /// + /// + [HttpPost("/api/producttopics/list")] + public async Task> GetProductTopicList(ProductTopicsQueryDto inputDto) + { + return await _productTopicsService.GetProductTopicList(inputDto); + } + /// /// 添加 /// /// diff --git a/BPA.SAAS.Manage.Application/Device/Services/DeviceService.cs b/BPA.SAAS.Manage.Application/Device/Services/DeviceService.cs index f142c4f..470f54f 100644 --- a/BPA.SAAS.Manage.Application/Device/Services/DeviceService.cs +++ b/BPA.SAAS.Manage.Application/Device/Services/DeviceService.cs @@ -71,9 +71,14 @@ namespace BPA.SAAS.Manage.Application.Device.Services Id = a.Id, Name = a.DeviceName, AutoKey=a.AutoKey.ToString(), - Vesion=SqlFunc.Subqueryable().Where(x=>x.Id==a.ProductVersionId).First().Vesion, - PrductKey = SqlFunc.Subqueryable().Where(x => x.Id == a.ProductId).First().Key, + ProductVersionId=a.ProductVersionId, + ProductId=a.ProductId, }) .ToListAsync(); + data.ForEach(x => + { + x.Vesion = _db.Queryable().Where(s => s.Id == x.ProductVersionId).First()?.Vesion; + x.PrductKey = _db.Queryable().Where(s => s.Id == x.ProductId).First()?.Key; + }); return data; } public async Task GetDevice(string productId) diff --git a/BPA.SAAS.Manage.Application/Device/Services/ProductTopicsService.cs b/BPA.SAAS.Manage.Application/Device/Services/ProductTopicsService.cs index baf1846..2d43ded 100644 --- a/BPA.SAAS.Manage.Application/Device/Services/ProductTopicsService.cs +++ b/BPA.SAAS.Manage.Application/Device/Services/ProductTopicsService.cs @@ -42,6 +42,16 @@ namespace BPA.SAAS.Manage.Application.Device.Services }; } + public async Task> GetProductTopicList(ProductTopicsQueryDto inputDto) + { + var total = new RefAsync(); + var data = await _db.Queryable().Where(x => x.ProductId == inputDto.ProductId && x.ProductVesionId == inputDto.ProductVesionId && x.IsDefault == inputDto.IsDefault) + + .OrderBy(x => x.CreateAt, OrderByType.Desc) + .ToListAsync(); + + return data; + } /// /// 添加 /// diff --git a/BPA.SAAS.Manage.Application/System/Services/MenuService.cs b/BPA.SAAS.Manage.Application/System/Services/MenuService.cs index 48aadf4..4ce0f7c 100644 --- a/BPA.SAAS.Manage.Application/System/Services/MenuService.cs +++ b/BPA.SAAS.Manage.Application/System/Services/MenuService.cs @@ -347,15 +347,15 @@ namespace BPA.SAAS.Manage.Application.System.Services }).ToList() }).ToList(); var da = new List(); - data.ForEach(x => - { - if (x.Children.Count() > 0 || x.type== type) - { - da.Add(x); - } + //data.ForEach(x => + //{ + // if (x.Children.Count() > 0 || x.type== type) + // { + // da.Add(x); + // } - }); - return da; + //}); + return data; } } diff --git a/BPA.SAAS.Manage.Comm/Model/ListSelectQuery.cs b/BPA.SAAS.Manage.Comm/Model/ListSelectQuery.cs index 9de669b..7f5c8f1 100644 --- a/BPA.SAAS.Manage.Comm/Model/ListSelectQuery.cs +++ b/BPA.SAAS.Manage.Comm/Model/ListSelectQuery.cs @@ -17,6 +17,8 @@ namespace BPA.SAAS.Manage.Comm.Model public string Id { get; set; } public string Name { get; set; } public string AutoKey { get; set; } + public string ProductVersionId { get; set; } + public string ProductId { get; set; } public string Vesion { get; set; } public string PrductKey { get; set; } }