@@ -1,7 +1,7 @@ | |||||
using BPA.SAAS.Manage.Application.Device.Dtos.DeviceVesion; | using BPA.SAAS.Manage.Application.Device.Dtos.DeviceVesion; | ||||
using BPA.SAAS.Manage.Application.Device.Interface; | using BPA.SAAS.Manage.Application.Device.Interface; | ||||
using BPA.SAAS.Manage.Core.Base; | using BPA.SAAS.Manage.Core.Base; | ||||
using BPA.SAAS.Manage.Core.Device; | |||||
using BPA.SAAS.Manage.Core.Product; | |||||
using Microsoft.AspNetCore.Components.Forms; | using Microsoft.AspNetCore.Components.Forms; | ||||
using System; | using System; | ||||
using System.Collections.Generic; | using System.Collections.Generic; | ||||
@@ -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 | |||||
{ | |||||
} | |||||
} |
@@ -1,6 +1,6 @@ | |||||
using BPA.SAAS.Manage.Application.Device.Dtos.DeviceVesion; | using BPA.SAAS.Manage.Application.Device.Dtos.DeviceVesion; | ||||
using BPA.SAAS.Manage.Core.Base; | using BPA.SAAS.Manage.Core.Base; | ||||
using BPA.SAAS.Manage.Core.Device; | |||||
using BPA.SAAS.Manage.Core.Product; | |||||
using System; | using System; | ||||
using System.Collections.Generic; | using System.Collections.Generic; | ||||
using System.Linq; | using System.Linq; | ||||
@@ -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<PageUtil> GetTechnologyPage(TechnologyQueryInputDto inputDto); | |||||
} | |||||
} |
@@ -3,7 +3,6 @@ using BPA.SAAS.Manage.Application.Device.Interface; | |||||
using BPA.SAAS.Manage.Comm.Const; | using BPA.SAAS.Manage.Comm.Const; | ||||
using BPA.SAAS.Manage.Comm.Enum; | using BPA.SAAS.Manage.Comm.Enum; | ||||
using BPA.SAAS.Manage.Core.Base; | using BPA.SAAS.Manage.Core.Base; | ||||
using BPA.SAAS.Manage.Core.Device; | |||||
using BPA.SAAS.Manage.Core.Product; | using BPA.SAAS.Manage.Core.Product; | ||||
using NPOI.POIFS.Crypt.Dsig; | using NPOI.POIFS.Crypt.Dsig; | ||||
using NPOI.Util; | using NPOI.Util; | ||||
@@ -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; | |||||
} | |||||
/// <summary> | |||||
/// 分页查询 | |||||
/// </summary> | |||||
/// <param name="inputDto"></param> | |||||
/// <returns></returns> | |||||
public async Task<PageUtil> GetTechnologyPage(TechnologyQueryInputDto inputDto) | |||||
{ | |||||
var total = new RefAsync<int>(); | |||||
var data = await _db.Queryable<BPA_ProductVesion,BPA_Technology, BPA_Product>((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 | |||||
}; | |||||
} | |||||
} | |||||
} |
@@ -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<PageUtil> GetTechnologyPage(TechnologyQueryInputDto inputDto) | |||||
{ | |||||
return await _technologyService.GetTechnologyPage(inputDto); | |||||
} | |||||
} | |||||
} |
@@ -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 | |||||
{ | |||||
/// <summary> | |||||
/// 主键 Guid | |||||
/// </summary> | |||||
[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; } | |||||
} | |||||
} |
@@ -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 | |||||
{ | |||||
/// <summary> | |||||
/// 主键 Guid | |||||
/// </summary> | |||||
[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; } | |||||
} | |||||
} |
@@ -7,7 +7,7 @@ using System.Linq; | |||||
using System.Text; | using System.Text; | ||||
using System.Threading.Tasks; | using System.Threading.Tasks; | ||||
namespace BPA.SAAS.Manage.Core.Device | |||||
namespace BPA.SAAS.Manage.Core.Product | |||||
{ | { | ||||
[SugarTable("bpa_productvesion")] | [SugarTable("bpa_productvesion")] | ||||
public class BPA_ProductVesion : IBaseEntity | public class BPA_ProductVesion : IBaseEntity |