diff --git a/BPA.SAAS.Manage.Application/Device/DeviceVesionServices.cs b/BPA.SAAS.Manage.Application/Device/DeviceVesionServices.cs index e7613ca..699f09c 100644 --- a/BPA.SAAS.Manage.Application/Device/DeviceVesionServices.cs +++ b/BPA.SAAS.Manage.Application/Device/DeviceVesionServices.cs @@ -1,7 +1,7 @@ using BPA.SAAS.Manage.Application.Device.Dtos.DeviceVesion; using BPA.SAAS.Manage.Application.Device.Interface; using BPA.SAAS.Manage.Core.Base; -using BPA.SAAS.Manage.Core.Device; +using BPA.SAAS.Manage.Core.Product; using Microsoft.AspNetCore.Components.Forms; using System; using System.Collections.Generic; diff --git a/BPA.SAAS.Manage.Application/Device/Dtos/Device/TechnologyQueryInputDto.cs b/BPA.SAAS.Manage.Application/Device/Dtos/Device/TechnologyQueryInputDto.cs new file mode 100644 index 0000000..cb1961f --- /dev/null +++ b/BPA.SAAS.Manage.Application/Device/Dtos/Device/TechnologyQueryInputDto.cs @@ -0,0 +1,13 @@ +using BPA.SAAS.Manage.Core.Base; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BPA.SAAS.Manage.Application.Device.Dtos.Device +{ + public class TechnologyQueryInputDto: PageInputBase + { + } +} diff --git a/BPA.SAAS.Manage.Application/Device/Interface/IDeviceVesionService.cs b/BPA.SAAS.Manage.Application/Device/Interface/IDeviceVesionService.cs index 5d27a9a..6748beb 100644 --- a/BPA.SAAS.Manage.Application/Device/Interface/IDeviceVesionService.cs +++ b/BPA.SAAS.Manage.Application/Device/Interface/IDeviceVesionService.cs @@ -1,6 +1,6 @@ using BPA.SAAS.Manage.Application.Device.Dtos.DeviceVesion; using BPA.SAAS.Manage.Core.Base; -using BPA.SAAS.Manage.Core.Device; +using BPA.SAAS.Manage.Core.Product; using System; using System.Collections.Generic; using System.Linq; diff --git a/BPA.SAAS.Manage.Application/Device/Interface/ITechnologyService.cs b/BPA.SAAS.Manage.Application/Device/Interface/ITechnologyService.cs new file mode 100644 index 0000000..7923cc7 --- /dev/null +++ b/BPA.SAAS.Manage.Application/Device/Interface/ITechnologyService.cs @@ -0,0 +1,15 @@ +using BPA.SAAS.Manage.Application.Device.Dtos.Device; +using BPA.SAAS.Manage.Core.Base; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BPA.SAAS.Manage.Application.Device.Interface +{ + public interface ITechnologyService + { + Task GetTechnologyPage(TechnologyQueryInputDto inputDto); + } +} diff --git a/BPA.SAAS.Manage.Application/Device/Services/ProductFunctionService.cs b/BPA.SAAS.Manage.Application/Device/Services/ProductFunctionService.cs index 74e537d..ad21bff 100644 --- a/BPA.SAAS.Manage.Application/Device/Services/ProductFunctionService.cs +++ b/BPA.SAAS.Manage.Application/Device/Services/ProductFunctionService.cs @@ -3,7 +3,6 @@ using BPA.SAAS.Manage.Application.Device.Interface; using BPA.SAAS.Manage.Comm.Const; using BPA.SAAS.Manage.Comm.Enum; using BPA.SAAS.Manage.Core.Base; -using BPA.SAAS.Manage.Core.Device; using BPA.SAAS.Manage.Core.Product; using NPOI.POIFS.Crypt.Dsig; using NPOI.Util; diff --git a/BPA.SAAS.Manage.Application/Device/Services/TechnologyService.cs b/BPA.SAAS.Manage.Application/Device/Services/TechnologyService.cs new file mode 100644 index 0000000..c7a67aa --- /dev/null +++ b/BPA.SAAS.Manage.Application/Device/Services/TechnologyService.cs @@ -0,0 +1,50 @@ +using BPA.SAAS.Manage.Application.Device.Dtos.Device; +using BPA.SAAS.Manage.Application.Device.Interface; +using BPA.SAAS.Manage.Core.Base; +using BPA.SAAS.Manage.Core.Device; +using BPA.SAAS.Manage.Core.Product; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BPA.SAAS.Manage.Application.Device.Services +{ + public class TechnologyService : ITechnologyService, ITransient + { + private readonly ISqlSugarClient _db; + public TechnologyService(ISqlSugarClient db) + { + _db=db; + } + /// + /// 分页查询 + /// + /// + /// + public async Task GetTechnologyPage(TechnologyQueryInputDto inputDto) + { + var total = new RefAsync(); + var data = await _db.Queryable((a, b,c) => new JoinQueryInfos( + JoinType.Left, a.Id == b.DeviceVersionId, + JoinType.Left, a.ProductId == c.Id + )).Select((a, b, c) => new + { + Id=b.Id, + Vesion=a.Vesion, + ProductName=c.Name, + CreateAt=b.CreateAt, + }) + .OrderBy(x => x.CreateAt, OrderByType.Desc) + .ToPageListAsync(inputDto.Current, inputDto.PageSize, total); + + return new PageUtil() + { + Data = data, + Total = total + + }; + } + } +} diff --git a/BPA.SAAS.Manage.Application/Device/TechnologyServices.cs b/BPA.SAAS.Manage.Application/Device/TechnologyServices.cs new file mode 100644 index 0000000..0bbf71b --- /dev/null +++ b/BPA.SAAS.Manage.Application/Device/TechnologyServices.cs @@ -0,0 +1,26 @@ +using BPA.SAAS.Manage.Application.Device.Dtos.Device; +using BPA.SAAS.Manage.Application.Device.Interface; +using BPA.SAAS.Manage.Core.Base; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BPA.SAAS.Manage.Application.Device +{ + [ApiDescriptionSettings("Technology", Tag = "设备工艺")] + public class TechnologyServices: IDynamicApiController, ITransient + { + ITechnologyService _technologyService; + public TechnologyServices(ITechnologyService technologyService) + { + _technologyService= technologyService; + } + [HttpPost("/api/technology/page")] + public async Task GetTechnologyPage(TechnologyQueryInputDto inputDto) + { + return await _technologyService.GetTechnologyPage(inputDto); + } + } +} diff --git a/BPA.SAAS.Manage.Core/Device/BPA_Technology.cs b/BPA.SAAS.Manage.Core/Device/BPA_Technology.cs new file mode 100644 index 0000000..c36ca1a --- /dev/null +++ b/BPA.SAAS.Manage.Core/Device/BPA_Technology.cs @@ -0,0 +1,23 @@ +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BPA.SAAS.Manage.Core.Device +{ + [SugarTable("bpa_technology")] + public class BPA_Technology + { + /// + /// 主键 Guid + /// + [SugarColumn(IsPrimaryKey = true, ColumnDataType = "Nvarchar(64)", IsNullable = false)] + public string Id { get; set; } + public string Name { get; set; } + public string DeviceVersionId { get; set; } + public string ForeignKeyRe { get; set; } + public DateTime CreateAt { get; set; } + } +} diff --git a/BPA.SAAS.Manage.Core/Device/BPA_TechnologyAction.cs b/BPA.SAAS.Manage.Core/Device/BPA_TechnologyAction.cs new file mode 100644 index 0000000..6449dbe --- /dev/null +++ b/BPA.SAAS.Manage.Core/Device/BPA_TechnologyAction.cs @@ -0,0 +1,27 @@ +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BPA.SAAS.Manage.Core.Device +{ + [SugarTable("bpa_technologyaction")] + public class BPA_TechnologyAction + { + /// + /// 主键 Guid + /// + [SugarColumn(IsPrimaryKey = true, ColumnDataType = "Nvarchar(64)", IsNullable = false)] + public string Id { get; set; } + public string TechnologyId { get; set; } + public string ActionName { get; set; } + public string ActionValue { get; set; } + public string ActionType { get; set; } + public string Unit { get; set; } + public bool IsBatch { get; set; } + public DateTime CreateAt { get; set; } + public int Sort { get; set; } + } +} diff --git a/BPA.SAAS.Manage.Core/Device/BPA_ProductVesion.cs b/BPA.SAAS.Manage.Core/Product/BPA_ProductVesion.cs similarity index 94% rename from BPA.SAAS.Manage.Core/Device/BPA_ProductVesion.cs rename to BPA.SAAS.Manage.Core/Product/BPA_ProductVesion.cs index 731c394..cf04d80 100644 --- a/BPA.SAAS.Manage.Core/Device/BPA_ProductVesion.cs +++ b/BPA.SAAS.Manage.Core/Product/BPA_ProductVesion.cs @@ -7,7 +7,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace BPA.SAAS.Manage.Core.Device +namespace BPA.SAAS.Manage.Core.Product { [SugarTable("bpa_productvesion")] public class BPA_ProductVesion : IBaseEntity