vaining01 2 years ago
parent
commit
e726f65a50
  1. 19
      src/Shentun.Peis.Application/PageHelper.cs
  2. 22
      src/Shentun.Peis.Application/PeisApplicationAutoMapperProfile.cs
  3. 55
      src/Shentun.Peis.EntityFrameworkCore/EntityFrameworkCore/PeisDbContext.cs

19
src/Shentun.Peis.Application/PageHelper.cs

@ -101,7 +101,26 @@ namespace Shentun.Peis
}
public static async Task<List<TEntity>> GetPageListInFitlerNotOrder<TEntity, TKey>
(IRepository<TEntity, TKey> repository,
IRepository<IdentityUser, Guid> userrepository,
GetListInFilterDto input)
where TEntity : class, IEntity<TKey>, IDisplayName
{
List<TEntity> entlist = new List<TEntity>();
if (!string.IsNullOrEmpty(input.Filter))
entlist = (await repository.GetListAsync()).Where(m => m.DisplayName.Contains(input.Filter)).ToList();
else
entlist = await repository.GetListAsync();
//分页
entlist = entlist.Skip(input.SkipCount * input.MaxResultCount).Take(input.MaxResultCount).ToList();
return entlist;
}
public static DateOnly? ConvertDate(string? dateTime)
{

22
src/Shentun.Peis.Application/PeisApplicationAutoMapperProfile.cs

@ -49,6 +49,10 @@ using Shentun.Peis.RegisterCheckItems;
using Shentun.Peis.RegisterChecks;
using Shentun.Peis.RegisterCheckSuggestions;
using Shentun.Peis.RegisterCheckSummarys;
using Shentun.Peis.ReportFormats;
using Shentun.Peis.ReportFormatTemplates;
using Shentun.Peis.ReportPrinters;
using Shentun.Peis.Reports;
using Shentun.Peis.ResultStatuses;
using Shentun.Peis.SampleContainers;
using Shentun.Peis.SampleGroupDetails;
@ -377,5 +381,23 @@ public class PeisApplicationAutoMapperProfile : Profile
CreateMap<HorizontalComparisonListEntity, HorizontalComparisonListDto>();
CreateMap<Report, ReportDto>();
CreateMap<CreateReportDto, Report>();
CreateMap<UpdateReportDto, Report>();
CreateMap<ReportFormat, ReportFormatDto>();
CreateMap<CreateReportFormatDto, ReportFormat>();
CreateMap<UpdateReportFormatDto, ReportFormat>();
CreateMap<ReportFormatTemplate, ReportFormatTemplateDto>();
CreateMap<CreateReportFormatTemplateDto, ReportFormatTemplate>();
CreateMap<UpdateReportFormatTemplateDto, ReportFormatTemplate>();
CreateMap<ReportPrinter, ReportPrinterDto>();
CreateMap<CreateReportPrinterDto, ReportPrinter>();
CreateMap<UpdateReportPrinterDto, ReportPrinter>();
}
}

55
src/Shentun.Peis.EntityFrameworkCore/EntityFrameworkCore/PeisDbContext.cs

@ -218,7 +218,10 @@ public class PeisDbContext :
public DbSet<UserGrouping> UserGroupings { get; set; } = null!;
public DbSet<UserItemType> UserItemTypes { get; set; } = null!;
public DbSet<UserRight> UserRights { get; set; } = null!;
public DbSet<Report> Reports { get; set; } = null!;
public DbSet<ReportFormat> ReportFormats { get; set; } = null!;
public DbSet<ReportFormatTemplate> ReportFormatTemplates { get; set; } = null!;
public DbSet<ReportPrinter> ReportPrinters { get; set; } = null!;
#endregion
@ -2640,8 +2643,58 @@ public class PeisDbContext :
#endregion
#region 自定义报表
builder.Entity<Report>(entity =>
{
entity.HasComment("自定义报表主表");
entity.Property(e => e.IsActive).HasDefaultValueSql("N");
entity.Property(e => e.CreationTime).HasDefaultValueSql("(date(timezone('UTC-8'::text, now())) - 1)");
entity.ConfigureByConvention();
});
builder.Entity<ReportFormat>(entity =>
{
entity.HasComment("自定义报表格式表");
entity.Property(e => e.IsDefault).HasDefaultValueSql("N");
entity.Property(e => e.ReportId).IsFixedLength();
entity.Property(e => e.CreationTime).HasDefaultValueSql("(date(timezone('UTC-8'::text, now())) - 1)");
entity.ConfigureByConvention();
});
builder.Entity<ReportFormatTemplate>(entity =>
{
entity.HasComment("自定义报表格式模板表");
entity.Property(e => e.IsDefault).HasDefaultValueSql("N");
entity.Property(e => e.IsSystem).HasDefaultValueSql("N");
entity.Property(e => e.TemplateFileType).HasDefaultValueSql("1");
entity.Property(e => e.CreationTime).HasDefaultValueSql("(date(timezone('UTC-8'::text, now())) - 1)");
entity.ConfigureByConvention();
});
builder.Entity<ReportPrinter>(entity =>
{
entity.HasComment("自定义报表客户端打印机设置表");
entity.Property(e => e.CreationTime).HasDefaultValueSql("(date(timezone('UTC-8'::text, now())) - 1)");
entity.ConfigureByConvention();
});
#endregion
#region New 待处理

Loading…
Cancel
Save