diff --git a/api/Erp.Platform.DbMigrator.Dockerfile b/api/Erp.Platform.DbMigrator.Dockerfile index 5199ff70..5c16008d 100644 --- a/api/Erp.Platform.DbMigrator.Dockerfile +++ b/api/Erp.Platform.DbMigrator.Dockerfile @@ -20,10 +20,6 @@ COPY "modules/Erp.SqlQueryManager/Erp.SqlQueryManager.Application.Contracts/Erp. COPY "modules/Erp.SqlQueryManager/Erp.SqlQueryManager.Domain/Erp.SqlQueryManager.Domain.csproj" "modules/Erp.SqlQueryManager/Erp.SqlQueryManager.Domain/" COPY "modules/Erp.SqlQueryManager/Erp.SqlQueryManager.Domain.Shared/Erp.SqlQueryManager.Domain.Shared.csproj" "modules/Erp.SqlQueryManager/Erp.SqlQueryManager.Domain.Shared/" COPY "modules/Erp.SqlQueryManager/Erp.SqlQueryManager.EntityFrameworkCore/Erp.SqlQueryManager.EntityFrameworkCore.csproj" "modules/Erp.SqlQueryManager/Erp.SqlQueryManager.EntityFrameworkCore/" -COPY "modules/Erp.Reports/Erp.Reports.Application.Contracts/Erp.Reports.Application.Contracts.csproj" "modules/Erp.Reports/Erp.Reports.Application.Contracts/" -COPY "modules/Erp.Reports/Erp.Reports.Domain/Erp.Reports.Domain.csproj" "modules/Erp.Reports/Erp.Reports.Domain/" -COPY "modules/Erp.Reports/Erp.Reports.Domain.Shared/Erp.Reports.Domain.Shared.csproj" "modules/Erp.Reports/Erp.Reports.Domain.Shared/" -COPY "modules/Erp.Reports/Erp.Reports.EntityFrameworkCore/Erp.Reports.EntityFrameworkCore.csproj" "modules/Erp.Reports/Erp.Reports.EntityFrameworkCore/" COPY "src/Erp.Platform.Application.Contracts/Erp.Platform.Application.Contracts.csproj" "src/Erp.Platform.Application.Contracts/" COPY "src/Erp.Platform.DbMigrator/Erp.Platform.DbMigrator.csproj" "src/Erp.Platform.DbMigrator/" COPY "src/Erp.Platform.Domain/Erp.Platform.Domain.csproj" "src/Erp.Platform.Domain/" diff --git a/api/Erp.Platform.HttpApi.Host.Dockerfile b/api/Erp.Platform.HttpApi.Host.Dockerfile index 2bc44a2f..b769133f 100644 --- a/api/Erp.Platform.HttpApi.Host.Dockerfile +++ b/api/Erp.Platform.HttpApi.Host.Dockerfile @@ -36,11 +36,6 @@ COPY "modules/Erp.SqlQueryManager/Erp.SqlQueryManager.Application.Contracts/Erp. COPY "modules/Erp.SqlQueryManager/Erp.SqlQueryManager.Domain/Erp.SqlQueryManager.Domain.csproj" "modules/Erp.SqlQueryManager/Erp.SqlQueryManager.Domain/" COPY "modules/Erp.SqlQueryManager/Erp.SqlQueryManager.Domain.Shared/Erp.SqlQueryManager.Domain.Shared.csproj" "modules/Erp.SqlQueryManager/Erp.SqlQueryManager.Domain.Shared/" COPY "modules/Erp.SqlQueryManager/Erp.SqlQueryManager.EntityFrameworkCore/Erp.SqlQueryManager.EntityFrameworkCore.csproj" "modules/Erp.SqlQueryManager/Erp.SqlQueryManager.EntityFrameworkCore/" -COPY "modules/Erp.Reports/Erp.Reports.Application/Erp.Reports.Application.csproj" "modules/Erp.Reports/Erp.Reports.Application/" -COPY "modules/Erp.Reports/Erp.Reports.Application.Contracts/Erp.Reports.Application.Contracts.csproj" "modules/Erp.Reports/Erp.Reports.Application.Contracts/" -COPY "modules/Erp.Reports/Erp.Reports.Domain/Erp.Reports.Domain.csproj" "modules/Erp.Reports/Erp.Reports.Domain/" -COPY "modules/Erp.Reports/Erp.Reports.Domain.Shared/Erp.Reports.Domain.Shared.csproj" "modules/Erp.Reports/Erp.Reports.Domain.Shared/" -COPY "modules/Erp.Reports/Erp.Reports.EntityFrameworkCore/Erp.Reports.EntityFrameworkCore.csproj" "modules/Erp.Reports/Erp.Reports.EntityFrameworkCore/" COPY "src/Erp.Platform.Application/Erp.Platform.Application.csproj" "src/Erp.Platform.Application/" COPY "src/Erp.Platform.Application.Contracts/Erp.Platform.Application.Contracts.csproj" "src/Erp.Platform.Application.Contracts/" COPY "src/Erp.Platform.Domain/Erp.Platform.Domain.csproj" "src/Erp.Platform.Domain/" diff --git a/api/Erp.Platform.sln b/api/Erp.Platform.sln index a9b23d0d..e8dba0e3 100644 --- a/api/Erp.Platform.sln +++ b/api/Erp.Platform.sln @@ -92,18 +92,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Erp.SqlQueryManager.Applica EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Erp.SqlQueryManager.EntityFrameworkCore", "modules\Erp.SqlQueryManager\Erp.SqlQueryManager.EntityFrameworkCore\Erp.SqlQueryManager.EntityFrameworkCore.csproj", "{1DA666D8-DBFE-40F7-8EBF-95CC892E4EB6}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Erp.Reports", "Erp.Reports", "{02EA681E-C7D8-13C7-8484-4AC65E1B71E8}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Erp.Reports.Application", "modules\Erp.Reports\Erp.Reports.Application\Erp.Reports.Application.csproj", "{3E1C9BC6-90C2-20F1-567F-2BA043D81721}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Erp.Reports.Application.Contracts", "modules\Erp.Reports\Erp.Reports.Application.Contracts\Erp.Reports.Application.Contracts.csproj", "{6E1A7691-CD09-860C-C6B3-86FDFDD3E372}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Erp.Reports.Domain", "modules\Erp.Reports\Erp.Reports.Domain\Erp.Reports.Domain.csproj", "{0924ACE7-6A32-F683-9F4D-A15B07D14A5E}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Erp.Reports.Domain.Shared", "modules\Erp.Reports\Erp.Reports.Domain.Shared\Erp.Reports.Domain.Shared.csproj", "{E65E10EE-41CC-B0E2-1004-E40D0CD26011}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Erp.Reports.EntityFrameworkCore", "modules\Erp.Reports\Erp.Reports.EntityFrameworkCore\Erp.Reports.EntityFrameworkCore.csproj", "{02E91CDA-E54C-9D5C-76AB-B07BE6D3E7FF}" -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -242,26 +230,6 @@ Global {1DA666D8-DBFE-40F7-8EBF-95CC892E4EB6}.Debug|Any CPU.Build.0 = Debug|Any CPU {1DA666D8-DBFE-40F7-8EBF-95CC892E4EB6}.Release|Any CPU.ActiveCfg = Release|Any CPU {1DA666D8-DBFE-40F7-8EBF-95CC892E4EB6}.Release|Any CPU.Build.0 = Release|Any CPU - {3E1C9BC6-90C2-20F1-567F-2BA043D81721}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3E1C9BC6-90C2-20F1-567F-2BA043D81721}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3E1C9BC6-90C2-20F1-567F-2BA043D81721}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3E1C9BC6-90C2-20F1-567F-2BA043D81721}.Release|Any CPU.Build.0 = Release|Any CPU - {6E1A7691-CD09-860C-C6B3-86FDFDD3E372}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6E1A7691-CD09-860C-C6B3-86FDFDD3E372}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6E1A7691-CD09-860C-C6B3-86FDFDD3E372}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6E1A7691-CD09-860C-C6B3-86FDFDD3E372}.Release|Any CPU.Build.0 = Release|Any CPU - {0924ACE7-6A32-F683-9F4D-A15B07D14A5E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0924ACE7-6A32-F683-9F4D-A15B07D14A5E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0924ACE7-6A32-F683-9F4D-A15B07D14A5E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0924ACE7-6A32-F683-9F4D-A15B07D14A5E}.Release|Any CPU.Build.0 = Release|Any CPU - {E65E10EE-41CC-B0E2-1004-E40D0CD26011}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E65E10EE-41CC-B0E2-1004-E40D0CD26011}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E65E10EE-41CC-B0E2-1004-E40D0CD26011}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E65E10EE-41CC-B0E2-1004-E40D0CD26011}.Release|Any CPU.Build.0 = Release|Any CPU - {02E91CDA-E54C-9D5C-76AB-B07BE6D3E7FF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {02E91CDA-E54C-9D5C-76AB-B07BE6D3E7FF}.Debug|Any CPU.Build.0 = Debug|Any CPU - {02E91CDA-E54C-9D5C-76AB-B07BE6D3E7FF}.Release|Any CPU.ActiveCfg = Release|Any CPU - {02E91CDA-E54C-9D5C-76AB-B07BE6D3E7FF}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -306,12 +274,6 @@ Global {B45A3E8B-286B-4A74-9602-FC192ACEE8C4} = {2889482E-64CA-4A25-91D8-5B963D83681B} {ED9C639A-A706-4ECB-9638-A15B3681BDEC} = {2889482E-64CA-4A25-91D8-5B963D83681B} {1DA666D8-DBFE-40F7-8EBF-95CC892E4EB6} = {2889482E-64CA-4A25-91D8-5B963D83681B} - {02EA681E-C7D8-13C7-8484-4AC65E1B71E8} = {03E1C8DA-035E-4882-AF81-F392139FCF38} - {3E1C9BC6-90C2-20F1-567F-2BA043D81721} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8} - {6E1A7691-CD09-860C-C6B3-86FDFDD3E372} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8} - {0924ACE7-6A32-F683-9F4D-A15B07D14A5E} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8} - {E65E10EE-41CC-B0E2-1004-E40D0CD26011} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8} - {02E91CDA-E54C-9D5C-76AB-B07BE6D3E7FF} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {28315BFD-90E7-4E14-A2EA-F3D23AF4126F} diff --git a/api/modules/Erp.Reports/Erp.Reports.Application.Contracts/Erp.Reports.Application.Contracts.csproj b/api/modules/Erp.Reports/Erp.Reports.Application.Contracts/Erp.Reports.Application.Contracts.csproj deleted file mode 100644 index 7f8c933e..00000000 --- a/api/modules/Erp.Reports/Erp.Reports.Application.Contracts/Erp.Reports.Application.Contracts.csproj +++ /dev/null @@ -1,18 +0,0 @@ - - - - net9.0 - enable - enable - Erp.Reports - - - - - - - - - - - diff --git a/api/modules/Erp.Reports/Erp.Reports.Application.Contracts/ErpReportsApplicationContractsModule.cs b/api/modules/Erp.Reports/Erp.Reports.Application.Contracts/ErpReportsApplicationContractsModule.cs deleted file mode 100644 index ee72d765..00000000 --- a/api/modules/Erp.Reports/Erp.Reports.Application.Contracts/ErpReportsApplicationContractsModule.cs +++ /dev/null @@ -1,12 +0,0 @@ -using Volo.Abp.Application; -using Volo.Abp.Modularity; - -namespace Erp.Reports; - -[DependsOn( - typeof(ErpReportsDomainSharedModule), - typeof(AbpDddApplicationContractsModule) -)] -public class ErpReportsApplicationContractsModule : AbpModule -{ -} diff --git a/api/modules/Erp.Reports/Erp.Reports.Application.Contracts/ReportDefinitions/CreateReportDefinitionDto.cs b/api/modules/Erp.Reports/Erp.Reports.Application.Contracts/ReportDefinitions/CreateReportDefinitionDto.cs deleted file mode 100644 index 96bc1e89..00000000 --- a/api/modules/Erp.Reports/Erp.Reports.Application.Contracts/ReportDefinitions/CreateReportDefinitionDto.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System.ComponentModel.DataAnnotations; - -namespace Erp.Reports.ReportDefinitions; - -public class CreateReportDefinitionDto -{ - [Required] - [StringLength(256)] - public string Name { get; set; } - - [Required] - [StringLength(512)] - public string DisplayName { get; set; } - - [Required] - public byte[] Content { get; set; } -} diff --git a/api/modules/Erp.Reports/Erp.Reports.Application.Contracts/ReportDefinitions/IReportDefinitionAppService.cs b/api/modules/Erp.Reports/Erp.Reports.Application.Contracts/ReportDefinitions/IReportDefinitionAppService.cs deleted file mode 100644 index 51134e24..00000000 --- a/api/modules/Erp.Reports/Erp.Reports.Application.Contracts/ReportDefinitions/IReportDefinitionAppService.cs +++ /dev/null @@ -1,13 +0,0 @@ -using Volo.Abp.Application.Services; - -namespace Erp.Reports.ReportDefinitions; - -public interface IReportDefinitionAppService : IApplicationService -{ - Task GetAsync(Guid id); - Task GetByNameAsync(string name); - Task GetContentAsync(string name); - Task CreateAsync(CreateReportDefinitionDto input); - Task UpdateAsync(Guid id, UpdateReportDefinitionDto input); - Task DeleteAsync(Guid id); -} diff --git a/api/modules/Erp.Reports/Erp.Reports.Application.Contracts/ReportDefinitions/ReportDefinitionDto.cs b/api/modules/Erp.Reports/Erp.Reports.Application.Contracts/ReportDefinitions/ReportDefinitionDto.cs deleted file mode 100644 index 6ad8a60b..00000000 --- a/api/modules/Erp.Reports/Erp.Reports.Application.Contracts/ReportDefinitions/ReportDefinitionDto.cs +++ /dev/null @@ -1,9 +0,0 @@ -using Volo.Abp.Application.Dtos; - -namespace Erp.Reports.ReportDefinitions; - -public class ReportDefinitionDto : FullAuditedEntityDto -{ - public string Name { get; set; } - public string DisplayName { get; set; } -} diff --git a/api/modules/Erp.Reports/Erp.Reports.Application.Contracts/ReportDefinitions/UpdateReportDefinitionDto.cs b/api/modules/Erp.Reports/Erp.Reports.Application.Contracts/ReportDefinitions/UpdateReportDefinitionDto.cs deleted file mode 100644 index 73d71594..00000000 --- a/api/modules/Erp.Reports/Erp.Reports.Application.Contracts/ReportDefinitions/UpdateReportDefinitionDto.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System.ComponentModel.DataAnnotations; - -namespace Erp.Reports.ReportDefinitions; - -public class UpdateReportDefinitionDto -{ - [StringLength(512)] - public string DisplayName { get; set; } - - public byte[] Content { get; set; } -} diff --git a/api/modules/Erp.Reports/Erp.Reports.Application/Erp.Reports.Application.csproj b/api/modules/Erp.Reports/Erp.Reports.Application/Erp.Reports.Application.csproj deleted file mode 100644 index 9002073a..00000000 --- a/api/modules/Erp.Reports/Erp.Reports.Application/Erp.Reports.Application.csproj +++ /dev/null @@ -1,20 +0,0 @@ - - - - net9.0 - enable - enable - Erp.Reports - - - - - - - - - - - - - diff --git a/api/modules/Erp.Reports/Erp.Reports.Application/ErpReportsApplicationAutoMapperProfile.cs b/api/modules/Erp.Reports/Erp.Reports.Application/ErpReportsApplicationAutoMapperProfile.cs deleted file mode 100644 index 42530c50..00000000 --- a/api/modules/Erp.Reports/Erp.Reports.Application/ErpReportsApplicationAutoMapperProfile.cs +++ /dev/null @@ -1,12 +0,0 @@ -using AutoMapper; -using Erp.Reports.ReportDefinitions; - -namespace Erp.Reports; - -public class ErpReportsApplicationAutoMapperProfile : Profile -{ - public ErpReportsApplicationAutoMapperProfile() - { - CreateMap(); - } -} diff --git a/api/modules/Erp.Reports/Erp.Reports.Application/ErpReportsApplicationModule.cs b/api/modules/Erp.Reports/Erp.Reports.Application/ErpReportsApplicationModule.cs deleted file mode 100644 index c2e49c3f..00000000 --- a/api/modules/Erp.Reports/Erp.Reports.Application/ErpReportsApplicationModule.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Volo.Abp.Application; -using Volo.Abp.AutoMapper; -using Volo.Abp.Modularity; - -namespace Erp.Reports; - -[DependsOn( - typeof(ErpReportsDomainModule), - typeof(ErpReportsApplicationContractsModule), - typeof(AbpDddApplicationModule), - typeof(AbpAutoMapperModule) -)] -public class ErpReportsApplicationModule : AbpModule -{ - public override void ConfigureServices(ServiceConfigurationContext context) - { - Configure(options => - { - options.AddMaps(); - }); - } -} diff --git a/api/modules/Erp.Reports/Erp.Reports.Application/ReportDefinitionAppService.cs b/api/modules/Erp.Reports/Erp.Reports.Application/ReportDefinitionAppService.cs deleted file mode 100644 index 3eb4b023..00000000 --- a/api/modules/Erp.Reports/Erp.Reports.Application/ReportDefinitionAppService.cs +++ /dev/null @@ -1,76 +0,0 @@ -using Volo.Abp.Application.Services; -using Volo.Abp.Domain.Repositories; - -namespace Erp.Reports.ReportDefinitions; - -public class ReportDefinitionAppService : ApplicationService, IReportDefinitionAppService -{ - private readonly IRepository _reportDefinitionRepository; - - public ReportDefinitionAppService(IRepository reportDefinitionRepository) - { - _reportDefinitionRepository = reportDefinitionRepository; - } - - public async Task GetAsync(Guid id) - { - var report = await _reportDefinitionRepository.GetAsync(id); - return ObjectMapper.Map(report); - } - - public async Task GetByNameAsync(string name) - { - var report = await _reportDefinitionRepository.FirstOrDefaultAsync(x => x.Name == name); - if (report == null) - { - throw new Volo.Abp.UserFriendlyException($"Report '{name}' not found"); - } - return ObjectMapper.Map(report); - } - - public async Task GetContentAsync(string name) - { - var report = await _reportDefinitionRepository.FirstOrDefaultAsync(x => x.Name == name); - if (report == null) - { - throw new Volo.Abp.UserFriendlyException($"Report '{name}' not found"); - } - return report.Content; - } - - public async Task CreateAsync(CreateReportDefinitionDto input) - { - var report = new ReportDefinition( - GuidGenerator.Create(), - input.Name, - input.DisplayName, - input.Content - ); - - await _reportDefinitionRepository.InsertAsync(report); - return ObjectMapper.Map(report); - } - - public async Task UpdateAsync(Guid id, UpdateReportDefinitionDto input) - { - var report = await _reportDefinitionRepository.GetAsync(id); - - if (!string.IsNullOrEmpty(input.DisplayName)) - { - report.DisplayName = input.DisplayName; - } - - if (input.Content != null && input.Content.Length > 0) - { - report.UpdateContent(input.Content); - } - - await _reportDefinitionRepository.UpdateAsync(report); - return ObjectMapper.Map(report); - } - - public async Task DeleteAsync(Guid id) - { - await _reportDefinitionRepository.DeleteAsync(id); - } -} diff --git a/api/modules/Erp.Reports/Erp.Reports.Domain.Shared/Erp.Reports.Domain.Shared.csproj b/api/modules/Erp.Reports/Erp.Reports.Domain.Shared/Erp.Reports.Domain.Shared.csproj deleted file mode 100644 index da280b1c..00000000 --- a/api/modules/Erp.Reports/Erp.Reports.Domain.Shared/Erp.Reports.Domain.Shared.csproj +++ /dev/null @@ -1,15 +0,0 @@ - - - - net9.0 - enable - enable - Erp.Reports - - - - - - - - diff --git a/api/modules/Erp.Reports/Erp.Reports.Domain.Shared/ErpReportsDomainSharedModule.cs b/api/modules/Erp.Reports/Erp.Reports.Domain.Shared/ErpReportsDomainSharedModule.cs deleted file mode 100644 index bbfa9a6e..00000000 --- a/api/modules/Erp.Reports/Erp.Reports.Domain.Shared/ErpReportsDomainSharedModule.cs +++ /dev/null @@ -1,15 +0,0 @@ -using Volo.Abp.Modularity; -using Volo.Abp.VirtualFileSystem; - -namespace Erp.Reports; - -public class ErpReportsDomainSharedModule : AbpModule -{ - public override void ConfigureServices(ServiceConfigurationContext context) - { - Configure(options => - { - options.FileSets.AddEmbedded(); - }); - } -} diff --git a/api/modules/Erp.Reports/Erp.Reports.Domain.Shared/ReportsConsts.cs b/api/modules/Erp.Reports/Erp.Reports.Domain.Shared/ReportsConsts.cs deleted file mode 100644 index f1ccb381..00000000 --- a/api/modules/Erp.Reports/Erp.Reports.Domain.Shared/ReportsConsts.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace Erp.Reports; - -public static class ReportsConsts -{ - public const string DbTablePrefix = "Erp"; - public const string DbSchema = null; -} diff --git a/api/modules/Erp.Reports/Erp.Reports.Domain/Erp.Reports.Domain.csproj b/api/modules/Erp.Reports/Erp.Reports.Domain/Erp.Reports.Domain.csproj deleted file mode 100644 index 5e0b875c..00000000 --- a/api/modules/Erp.Reports/Erp.Reports.Domain/Erp.Reports.Domain.csproj +++ /dev/null @@ -1,18 +0,0 @@ - - - - net9.0 - enable - enable - Erp.Reports - - - - - - - - - - - diff --git a/api/modules/Erp.Reports/Erp.Reports.Domain/ErpReportsDbProperties.cs b/api/modules/Erp.Reports/Erp.Reports.Domain/ErpReportsDbProperties.cs deleted file mode 100644 index d6b7d72e..00000000 --- a/api/modules/Erp.Reports/Erp.Reports.Domain/ErpReportsDbProperties.cs +++ /dev/null @@ -1,18 +0,0 @@ -namespace Erp.Reports.Domain; - -public static class Prefix -{ - public static string MenuPrefix { get; set; } = "Plat"; - public static string HostPrefix { get; set; } = "H"; - public static string? DbSchema { get; set; } = null; - - public const string ConnectionStringName = "Reports"; -} - -public static class TablePrefix -{ - public static string ByName(string tableName) - { - return $"{Prefix.MenuPrefix}_{Prefix.HostPrefix}_{tableName}"; - } -} diff --git a/api/modules/Erp.Reports/Erp.Reports.Domain/ErpReportsDomainModule.cs b/api/modules/Erp.Reports/Erp.Reports.Domain/ErpReportsDomainModule.cs deleted file mode 100644 index 0d0f349a..00000000 --- a/api/modules/Erp.Reports/Erp.Reports.Domain/ErpReportsDomainModule.cs +++ /dev/null @@ -1,16 +0,0 @@ -using Volo.Abp.Domain; -using Volo.Abp.Modularity; - -namespace Erp.Reports; - -[DependsOn( - typeof(AbpDddDomainModule), - typeof(ErpReportsDomainSharedModule) -)] -public class ErpReportsDomainModule : AbpModule -{ - public override void ConfigureServices(ServiceConfigurationContext context) - { - // Domain services configuration can be added here - } -} diff --git a/api/modules/Erp.Reports/Erp.Reports.Domain/ReportDefinitions/ReportDefinition.cs b/api/modules/Erp.Reports/Erp.Reports.Domain/ReportDefinitions/ReportDefinition.cs deleted file mode 100644 index 9378362b..00000000 --- a/api/modules/Erp.Reports/Erp.Reports.Domain/ReportDefinitions/ReportDefinition.cs +++ /dev/null @@ -1,23 +0,0 @@ -using Volo.Abp.Domain.Entities.Auditing; - -namespace Erp.Reports.ReportDefinitions; - -public class ReportDefinition : FullAuditedEntity -{ - public string Name { get; set; } - public string DisplayName { get; set; } - public byte[] Content { get; set; } - - public ReportDefinition(Guid id, string name, string displayName, byte[] content) - : base(id) - { - Name = name; - DisplayName = displayName; - Content = content; - } - - public void UpdateContent(byte[] content) - { - Content = content; - } -} diff --git a/api/modules/Erp.Reports/Erp.Reports.EntityFrameworkCore/Erp.Reports.EntityFrameworkCore.csproj b/api/modules/Erp.Reports/Erp.Reports.EntityFrameworkCore/Erp.Reports.EntityFrameworkCore.csproj deleted file mode 100644 index 4b56e317..00000000 --- a/api/modules/Erp.Reports/Erp.Reports.EntityFrameworkCore/Erp.Reports.EntityFrameworkCore.csproj +++ /dev/null @@ -1,24 +0,0 @@ - - - - net9.0 - enable - enable - Erp.Reports.EntityFrameworkCore - - - - - - - - all - runtime; build; native; contentfiles; analyzers - - - - - - - - diff --git a/api/modules/Erp.Reports/Erp.Reports.EntityFrameworkCore/ErpReportsDbContext.cs b/api/modules/Erp.Reports/Erp.Reports.EntityFrameworkCore/ErpReportsDbContext.cs deleted file mode 100644 index f8455934..00000000 --- a/api/modules/Erp.Reports/Erp.Reports.EntityFrameworkCore/ErpReportsDbContext.cs +++ /dev/null @@ -1,25 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Volo.Abp.Data; -using Volo.Abp.EntityFrameworkCore; -using Erp.Reports.ReportDefinitions; -using Erp.Reports.Domain; - -namespace Erp.Reports.EntityFrameworkCore; - -[ConnectionStringName(Prefix.ConnectionStringName)] -public class ErpReportsDbContext : AbpDbContext -{ - public DbSet ReportDefinitions { get; set; } - - public ErpReportsDbContext(DbContextOptions options) - : base(options) - { - } - - protected override void OnModelCreating(ModelBuilder builder) - { - base.OnModelCreating(builder); - - builder.ConfigureReports(); - } -} diff --git a/api/modules/Erp.Reports/Erp.Reports.EntityFrameworkCore/ErpReportsDbContextFactory.cs b/api/modules/Erp.Reports/Erp.Reports.EntityFrameworkCore/ErpReportsDbContextFactory.cs deleted file mode 100644 index 8d110fae..00000000 --- a/api/modules/Erp.Reports/Erp.Reports.EntityFrameworkCore/ErpReportsDbContextFactory.cs +++ /dev/null @@ -1,27 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Design; -using Microsoft.Extensions.Configuration; - -namespace Erp.Reports.EntityFrameworkCore; - -public class ErpReportsDbContextFactory : IDesignTimeDbContextFactory -{ - public ErpReportsDbContext CreateDbContext(string[] args) - { - var configuration = BuildConfiguration(); - - var builder = new DbContextOptionsBuilder() - .UseSqlServer(configuration.GetConnectionString("SqlServer")); - - return new ErpReportsDbContext(builder.Options); - } - - private static IConfigurationRoot BuildConfiguration() - { - var builder = new ConfigurationBuilder() - .SetBasePath(Path.Combine(Directory.GetCurrentDirectory(), "../Erp.Reports.HttpApi.Host/")) - .AddJsonFile("appsettings.json", optional: false); - - return builder.Build(); - } -} diff --git a/api/modules/Erp.Reports/Erp.Reports.EntityFrameworkCore/ErpReportsDbContextModelCreatingExtensions.cs b/api/modules/Erp.Reports/Erp.Reports.EntityFrameworkCore/ErpReportsDbContextModelCreatingExtensions.cs deleted file mode 100644 index 2338aeaa..00000000 --- a/api/modules/Erp.Reports/Erp.Reports.EntityFrameworkCore/ErpReportsDbContextModelCreatingExtensions.cs +++ /dev/null @@ -1,28 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Volo.Abp; -using Volo.Abp.EntityFrameworkCore.Modeling; -using Erp.Reports.ReportDefinitions; -using Erp.Reports.Domain; - -namespace Erp.Reports.EntityFrameworkCore; - -public static class ErpReportsDbContextModelCreatingExtensions -{ - public static void ConfigureReports( - this ModelBuilder builder) - { - Check.NotNull(builder, nameof(builder)); - - builder.Entity(b => - { - b.ToTable(TablePrefix.ByName(nameof(ReportDefinition)), Prefix.DbSchema); - b.ConfigureByConvention(); - - b.Property(x => x.Name).IsRequired().HasMaxLength(256); - b.Property(x => x.DisplayName).IsRequired().HasMaxLength(512); - b.Property(x => x.Content).IsRequired(); - - b.HasIndex(x => x.Name); - }); - } -} diff --git a/api/modules/Erp.Reports/Erp.Reports.EntityFrameworkCore/ErpReportsEntityFrameworkCoreModule.cs b/api/modules/Erp.Reports/Erp.Reports.EntityFrameworkCore/ErpReportsEntityFrameworkCoreModule.cs deleted file mode 100644 index 6b6189ee..00000000 --- a/api/modules/Erp.Reports/Erp.Reports.EntityFrameworkCore/ErpReportsEntityFrameworkCoreModule.cs +++ /dev/null @@ -1,26 +0,0 @@ -using Microsoft.Extensions.DependencyInjection; -using Volo.Abp.EntityFrameworkCore; -using Volo.Abp.EntityFrameworkCore.SqlServer; -using Volo.Abp.Modularity; - -namespace Erp.Reports.EntityFrameworkCore; - -[DependsOn( - typeof(ErpReportsDomainModule), - typeof(AbpEntityFrameworkCoreSqlServerModule) -)] -public class ErpReportsEntityFrameworkCoreModule : AbpModule -{ - public override void ConfigureServices(ServiceConfigurationContext context) - { - context.Services.AddAbpDbContext(options => - { - options.AddDefaultRepositories(includeAllEntities: true); - }); - - Configure(options => - { - options.UseSqlServer(); - }); - } -} diff --git a/api/src/Erp.Platform.Application.Contracts/Erp.Platform.Application.Contracts.csproj b/api/src/Erp.Platform.Application.Contracts/Erp.Platform.Application.Contracts.csproj index 421309b8..67f11d41 100644 --- a/api/src/Erp.Platform.Application.Contracts/Erp.Platform.Application.Contracts.csproj +++ b/api/src/Erp.Platform.Application.Contracts/Erp.Platform.Application.Contracts.csproj @@ -11,7 +11,6 @@ - diff --git a/api/src/Erp.Platform.Application.Contracts/PlatformApplicationContractsModule.cs b/api/src/Erp.Platform.Application.Contracts/PlatformApplicationContractsModule.cs index 83caab29..7700a58e 100644 --- a/api/src/Erp.Platform.Application.Contracts/PlatformApplicationContractsModule.cs +++ b/api/src/Erp.Platform.Application.Contracts/PlatformApplicationContractsModule.cs @@ -1,6 +1,5 @@ using Erp.Languages; using Erp.Notifications.Application; -using Erp.Reports; using Erp.Settings; using Volo.Abp.Account; using Volo.Abp.FeatureManagement; @@ -22,8 +21,7 @@ namespace Erp.Platform; typeof(AbpObjectExtendingModule), typeof(LanguagesApplicationContractsModule), typeof(SettingsApplicationContractsModule), - typeof(NotificationApplicationContractsModule), - typeof(ErpReportsApplicationContractsModule) + typeof(NotificationApplicationContractsModule) )] public class PlatformApplicationContractsModule : AbpModule { diff --git a/api/src/Erp.Platform.Application/Erp.Platform.Application.csproj b/api/src/Erp.Platform.Application/Erp.Platform.Application.csproj index 197aadae..c5557c5b 100644 --- a/api/src/Erp.Platform.Application/Erp.Platform.Application.csproj +++ b/api/src/Erp.Platform.Application/Erp.Platform.Application.csproj @@ -15,7 +15,6 @@ - diff --git a/api/src/Erp.Platform.Application/PlatformApplicationModule.cs b/api/src/Erp.Platform.Application/PlatformApplicationModule.cs index 224c6d7d..5121c36f 100644 --- a/api/src/Erp.Platform.Application/PlatformApplicationModule.cs +++ b/api/src/Erp.Platform.Application/PlatformApplicationModule.cs @@ -1,6 +1,5 @@ using Erp.Languages; using Erp.Notifications.Application; -using Erp.Reports; using Erp.Settings; using Microsoft.Extensions.DependencyInjection; using Volo.Abp.Account; @@ -24,8 +23,7 @@ namespace Erp.Platform; typeof(AbpFeatureManagementApplicationModule), typeof(LanguagesApplicationModule), typeof(SettingsApplicationModule), - typeof(NotificationApplicationModule), - typeof(ErpReportsApplicationModule) + typeof(NotificationApplicationModule) )] public class PlatformApplicationModule : AbpModule { diff --git a/api/src/Erp.Platform.Domain.Shared/Erp.Platform.Domain.Shared.csproj b/api/src/Erp.Platform.Domain.Shared/Erp.Platform.Domain.Shared.csproj index b7868197..9a635bdc 100644 --- a/api/src/Erp.Platform.Domain.Shared/Erp.Platform.Domain.Shared.csproj +++ b/api/src/Erp.Platform.Domain.Shared/Erp.Platform.Domain.Shared.csproj @@ -30,7 +30,6 @@ - diff --git a/api/src/Erp.Platform.Domain.Shared/PlatformDomainSharedModule.cs b/api/src/Erp.Platform.Domain.Shared/PlatformDomainSharedModule.cs index ca0d3cd4..01d4db7a 100644 --- a/api/src/Erp.Platform.Domain.Shared/PlatformDomainSharedModule.cs +++ b/api/src/Erp.Platform.Domain.Shared/PlatformDomainSharedModule.cs @@ -1,6 +1,5 @@ using Erp.Languages; using Erp.Notifications.Domain; -using Erp.Reports; using Erp.Platform.Localization; using Erp.Settings; using Volo.Abp.AuditLogging; @@ -28,8 +27,7 @@ namespace Erp.Platform; typeof(AbpTenantManagementDomainSharedModule), typeof(LanguagesDomainSharedModule), typeof(SettingsDomainSharedModule), - typeof(NotificationDomainSharedModule), - typeof(ErpReportsDomainSharedModule) + typeof(NotificationDomainSharedModule) )] public class PlatformDomainSharedModule : AbpModule { diff --git a/api/src/Erp.Platform.Domain/Erp.Platform.Domain.csproj b/api/src/Erp.Platform.Domain/Erp.Platform.Domain.csproj index a53f8293..c12cf031 100644 --- a/api/src/Erp.Platform.Domain/Erp.Platform.Domain.csproj +++ b/api/src/Erp.Platform.Domain/Erp.Platform.Domain.csproj @@ -13,7 +13,6 @@ - diff --git a/api/src/Erp.Platform.Domain/PlatformDomainModule.cs b/api/src/Erp.Platform.Domain/PlatformDomainModule.cs index 68d200a7..1218f1fd 100644 --- a/api/src/Erp.Platform.Domain/PlatformDomainModule.cs +++ b/api/src/Erp.Platform.Domain/PlatformDomainModule.cs @@ -17,7 +17,6 @@ using Volo.Abp.TenantManagement; using Volo.Abp.BlobStoring; using Volo.Abp.BlobStoring.FileSystem; using Volo.Abp.Timing; -using Erp.Reports; namespace Erp.Platform; @@ -36,7 +35,6 @@ namespace Erp.Platform; typeof(SettingsDomainModule), typeof(ErpMailQueueModule), typeof(NotificationDomainModule), - typeof(ErpReportsDomainModule), typeof(AbpBlobStoringModule), typeof(AbpBlobStoringFileSystemModule) )] diff --git a/api/src/Erp.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs b/api/src/Erp.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs index 68ee5350..98bef288 100644 --- a/api/src/Erp.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs +++ b/api/src/Erp.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs @@ -27,7 +27,6 @@ using static Erp.Platform.PlatformConsts; using static Erp.Settings.SettingsConsts; using Erp.Platform.Enums; using Erp.SqlQueryManager.EntityFrameworkCore; -using Erp.Reports.EntityFrameworkCore; namespace Erp.Platform.EntityFrameworkCore; @@ -352,7 +351,6 @@ public class PlatformDbContext : builder.ConfigureMailQueue(); builder.ConfigureNotification(); builder.ConfigureSqlQueryManager(); - builder.ConfigureReports(); //Saas builder.Entity(b => @@ -4522,4 +4520,4 @@ public class PlatformDbContext : .OnDelete(DeleteBehavior.Restrict); }); } -} \ No newline at end of file +} diff --git a/api/src/Erp.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformEntityFrameworkCoreModule.cs b/api/src/Erp.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformEntityFrameworkCoreModule.cs index 15925cd9..725e2d7c 100644 --- a/api/src/Erp.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformEntityFrameworkCoreModule.cs +++ b/api/src/Erp.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformEntityFrameworkCoreModule.cs @@ -1,7 +1,6 @@ using System; using Erp.Languages.EntityFrameworkCore; using Erp.Notifications.EntityFrameworkCore; -using Erp.Reports.EntityFrameworkCore; using Erp.Settings.EntityFrameworkCore; using Erp.SqlQueryManager.EntityFrameworkCore; using Microsoft.Extensions.DependencyInjection; @@ -37,8 +36,7 @@ namespace Erp.Platform.EntityFrameworkCore; typeof(LanguagesEntityFrameworkCoreModule), typeof(SettingsEntityFrameworkCoreModule), typeof(NotificationEntityFrameworkCoreModule), - typeof(SqlQueryManagerEntityFrameworkCoreModule), - typeof(ErpReportsEntityFrameworkCoreModule) + typeof(SqlQueryManagerEntityFrameworkCoreModule) )] public class PlatformEntityFrameworkCoreModule : AbpModule { diff --git a/api/src/Erp.Platform.EntityFrameworkCore/Erp.Platform.EntityFrameworkCore.csproj b/api/src/Erp.Platform.EntityFrameworkCore/Erp.Platform.EntityFrameworkCore.csproj index 7676d08f..36f011bf 100644 --- a/api/src/Erp.Platform.EntityFrameworkCore/Erp.Platform.EntityFrameworkCore.csproj +++ b/api/src/Erp.Platform.EntityFrameworkCore/Erp.Platform.EntityFrameworkCore.csproj @@ -27,7 +27,6 @@ - diff --git a/api/src/Erp.Platform.EntityFrameworkCore/Migrations/20260106110136_Initial.Designer.cs b/api/src/Erp.Platform.EntityFrameworkCore/Migrations/20260107073550_Initial.Designer.cs similarity index 99% rename from api/src/Erp.Platform.EntityFrameworkCore/Migrations/20260106110136_Initial.Designer.cs rename to api/src/Erp.Platform.EntityFrameworkCore/Migrations/20260107073550_Initial.Designer.cs index 6beac0df..165a0e2c 100644 --- a/api/src/Erp.Platform.EntityFrameworkCore/Migrations/20260106110136_Initial.Designer.cs +++ b/api/src/Erp.Platform.EntityFrameworkCore/Migrations/20260107073550_Initial.Designer.cs @@ -13,7 +13,7 @@ using Volo.Abp.EntityFrameworkCore; namespace Erp.Platform.Migrations { [DbContext(typeof(PlatformDbContext))] - [Migration("20260106110136_Initial")] + [Migration("20260107073550_Initial")] partial class Initial { /// @@ -17773,63 +17773,6 @@ namespace Erp.Platform.Migrations b.ToTable("Sas_H_ForumTopic", (string)null); }); - modelBuilder.Entity("Erp.Reports.ReportDefinitions.ReportDefinition", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Content") - .IsRequired() - .HasColumnType("varbinary(max)"); - - b.Property("CreationTime") - .HasColumnType("datetime2") - .HasColumnName("CreationTime"); - - b.Property("CreatorId") - .HasColumnType("uniqueidentifier") - .HasColumnName("CreatorId"); - - b.Property("DeleterId") - .HasColumnType("uniqueidentifier") - .HasColumnName("DeleterId"); - - b.Property("DeletionTime") - .HasColumnType("datetime2") - .HasColumnName("DeletionTime"); - - b.Property("DisplayName") - .IsRequired() - .HasMaxLength(512) - .HasColumnType("nvarchar(512)"); - - b.Property("IsDeleted") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false) - .HasColumnName("IsDeleted"); - - b.Property("LastModificationTime") - .HasColumnType("datetime2") - .HasColumnName("LastModificationTime"); - - b.Property("LastModifierId") - .HasColumnType("uniqueidentifier") - .HasColumnName("LastModifierId"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("Name"); - - b.ToTable("Plat_H_ReportDefinition", (string)null); - }); - modelBuilder.Entity("Erp.Settings.Entities.SettingDefinition", b => { b.Property("Id") diff --git a/api/src/Erp.Platform.EntityFrameworkCore/Migrations/20260106110136_Initial.cs b/api/src/Erp.Platform.EntityFrameworkCore/Migrations/20260107073550_Initial.cs similarity index 99% rename from api/src/Erp.Platform.EntityFrameworkCore/Migrations/20260106110136_Initial.cs rename to api/src/Erp.Platform.EntityFrameworkCore/Migrations/20260107073550_Initial.cs index a3f2e145..5a6e10e3 100644 --- a/api/src/Erp.Platform.EntityFrameworkCore/Migrations/20260106110136_Initial.cs +++ b/api/src/Erp.Platform.EntityFrameworkCore/Migrations/20260107073550_Initial.cs @@ -2009,27 +2009,6 @@ namespace Erp.Platform.Migrations table.PrimaryKey("PK_Plat_H_NotificationRule", x => x.Id); }); - migrationBuilder.CreateTable( - name: "Plat_H_ReportDefinition", - columns: table => new - { - Id = table.Column(type: "uniqueidentifier", nullable: false), - Name = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false), - DisplayName = table.Column(type: "nvarchar(512)", maxLength: 512, nullable: false), - Content = table.Column(type: "varbinary(max)", nullable: false), - CreationTime = table.Column(type: "datetime2", nullable: false), - CreatorId = table.Column(type: "uniqueidentifier", nullable: true), - LastModificationTime = table.Column(type: "datetime2", nullable: true), - LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), - IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), - DeleterId = table.Column(type: "uniqueidentifier", nullable: true), - DeletionTime = table.Column(type: "datetime2", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Plat_H_ReportDefinition", x => x.Id); - }); - migrationBuilder.CreateTable( name: "Plat_H_SettingDefinition", columns: table => new @@ -9526,11 +9505,6 @@ namespace Erp.Platform.Migrations table: "Plat_H_Notification", column: "NotificationRuleId"); - migrationBuilder.CreateIndex( - name: "IX_Plat_H_ReportDefinition_Name", - table: "Plat_H_ReportDefinition", - column: "Name"); - migrationBuilder.CreateIndex( name: "IX_Prj_T_ProjectPhase_CategoryId", table: "Prj_T_ProjectPhase", @@ -10701,9 +10675,6 @@ namespace Erp.Platform.Migrations migrationBuilder.DropTable( name: "Plat_H_Notification"); - migrationBuilder.DropTable( - name: "Plat_H_ReportDefinition"); - migrationBuilder.DropTable( name: "Plat_H_SettingDefinition"); diff --git a/api/src/Erp.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs b/api/src/Erp.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs index 047d0422..f8f86f8b 100644 --- a/api/src/Erp.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs +++ b/api/src/Erp.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs @@ -17770,63 +17770,6 @@ namespace Erp.Platform.Migrations b.ToTable("Sas_H_ForumTopic", (string)null); }); - modelBuilder.Entity("Erp.Reports.ReportDefinitions.ReportDefinition", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Content") - .IsRequired() - .HasColumnType("varbinary(max)"); - - b.Property("CreationTime") - .HasColumnType("datetime2") - .HasColumnName("CreationTime"); - - b.Property("CreatorId") - .HasColumnType("uniqueidentifier") - .HasColumnName("CreatorId"); - - b.Property("DeleterId") - .HasColumnType("uniqueidentifier") - .HasColumnName("DeleterId"); - - b.Property("DeletionTime") - .HasColumnType("datetime2") - .HasColumnName("DeletionTime"); - - b.Property("DisplayName") - .IsRequired() - .HasMaxLength(512) - .HasColumnType("nvarchar(512)"); - - b.Property("IsDeleted") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false) - .HasColumnName("IsDeleted"); - - b.Property("LastModificationTime") - .HasColumnType("datetime2") - .HasColumnName("LastModificationTime"); - - b.Property("LastModifierId") - .HasColumnType("uniqueidentifier") - .HasColumnName("LastModifierId"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("Name"); - - b.ToTable("Plat_H_ReportDefinition", (string)null); - }); - modelBuilder.Entity("Erp.Settings.Entities.SettingDefinition", b => { b.Property("Id") diff --git a/api/src/Erp.Platform.HttpApi.Host/PlatformHttpApiHostModule.cs b/api/src/Erp.Platform.HttpApi.Host/PlatformHttpApiHostModule.cs index da46ee2e..5811d539 100644 --- a/api/src/Erp.Platform.HttpApi.Host/PlatformHttpApiHostModule.cs +++ b/api/src/Erp.Platform.HttpApi.Host/PlatformHttpApiHostModule.cs @@ -74,8 +74,7 @@ namespace Erp.Platform; typeof(AbpAspNetCoreSerilogModule), typeof(AbpSwashbuckleModule), typeof(AbpBackgroundWorkersHangfireModule), - typeof(SqlQueryManagerApplicationModule), - typeof(ErpReportsApplicationModule) + typeof(SqlQueryManagerApplicationModule) )] public class PlatformHttpApiHostModule : AbpModule { @@ -214,7 +213,6 @@ public class PlatformHttpApiHostModule : AbpModule options.ConventionalControllers.Create(typeof(ErpMailQueueModule).Assembly); options.ConventionalControllers.Create(typeof(NotificationApplicationModule).Assembly); options.ConventionalControllers.Create(typeof(SqlQueryManagerApplicationModule).Assembly); - options.ConventionalControllers.Create(typeof(ErpReportsApplicationModule).Assembly); options.ChangeControllerModelApiExplorerGroupName = false; options.ConventionalControllers.FormBodyBindingIgnoredTypes.Add(typeof(PlatformUpdateProfileDto)); options.ConventionalControllers.FormBodyBindingIgnoredTypes.Add(typeof(UploadFileDto)); @@ -423,10 +421,6 @@ public class PlatformHttpApiHostModule : AbpModule // Register report storage extension context.Services.AddScoped(); - - // Register custom SQL data connection provider - context.Services.AddScoped(); - context.Services.AddScoped(); } public override void OnApplicationInitialization(ApplicationInitializationContext context) diff --git a/api/src/Erp.Platform.HttpApi.Host/Program.cs b/api/src/Erp.Platform.HttpApi.Host/Program.cs index 841e40b8..ed712bc8 100644 --- a/api/src/Erp.Platform.HttpApi.Host/Program.cs +++ b/api/src/Erp.Platform.HttpApi.Host/Program.cs @@ -13,6 +13,7 @@ using Microsoft.Extensions.Hosting; using Serilog; using Serilog.Sinks.PostgreSQL; using static Erp.Settings.SettingsConsts; +using DevExpress.AspNetCore; namespace Erp.Platform; @@ -151,6 +152,7 @@ public class Program builder.Services.AddSingleton(); var app = builder.Build(); + app.UseDevExpressControls(); app.UseCors("Dynamic"); // Dynamic Assembly Registration Delegate Setup diff --git a/api/src/Erp.Platform.HttpApi.Host/ReportServices/CustomReportStorageWebExtension.cs b/api/src/Erp.Platform.HttpApi.Host/ReportServices/CustomReportStorageWebExtension.cs index 7ee5a2b1..322c8532 100644 --- a/api/src/Erp.Platform.HttpApi.Host/ReportServices/CustomReportStorageWebExtension.cs +++ b/api/src/Erp.Platform.HttpApi.Host/ReportServices/CustomReportStorageWebExtension.cs @@ -1,83 +1,115 @@ using System.Collections.Generic; using System.IO; using System.Linq; -using DevExpress.XtraReports.UI; -using Erp.Reports.EntityFrameworkCore; using System; using Erp.Reports.PredefinedReports; namespace Erp.Platform.ReportServices; +using System.ServiceModel; +using DevExpress.XtraReports.UI; public class CustomReportStorageWebExtension : DevExpress.XtraReports.Web.Extensions.ReportStorageWebExtension { - protected ErpReportsDbContext DbContext { get; set; } - - public CustomReportStorageWebExtension(ErpReportsDbContext dbContext) + readonly string reportDirectory = "Reports"; + const string FileExtension = ".repx"; + + public CustomReportStorageWebExtension() { - this.DbContext = dbContext; + if (!Directory.Exists(reportDirectory)) + { + Directory.CreateDirectory(reportDirectory); + } + } + public CustomReportStorageWebExtension(string reportDirectory) + { + if (!Directory.Exists(reportDirectory)) + { + Directory.CreateDirectory(reportDirectory); + } + this.reportDirectory = reportDirectory; + } + + private bool IsWithinReportsFolder(string url, string folder) + { + var rootDirectory = new DirectoryInfo(folder); + var fileInfo = new FileInfo(Path.Combine(folder, url)); + return fileInfo.Directory.FullName.ToLower().StartsWith(rootDirectory.FullName.ToLower()); } public override bool CanSetData(string url) { + // Determines whether a report with the specified URL can be saved. + // Add custom logic that returns **false** for reports that should be read-only. + // Return **true** if no valdation is required. + // This method is called only for valid URLs (if the **IsValidUrl** method returns **true**). + return true; } public override bool IsValidUrl(string url) { - return true; + // Determines whether the URL passed to the current report storage is valid. + // Implement your own logic to prohibit URLs that contain spaces or other specific characters. + // Return **true** if no validation is required. + + return Path.GetFileName(url) == url; } public override byte[] GetData(string url) { - var reportData = DbContext.ReportDefinitions.FirstOrDefault(x => x.Name == url); - if (reportData != null) - return reportData.Content; - - if (ReportsFactory.Reports.ContainsKey(url)) + // Uses a specified URL to return report layout data stored within a report storage medium. + // This method is called if the **IsValidUrl** method returns **true**. + // You can use the **GetData** method to process report parameters sent from the client + // if the parameters are included in the report URL's query string. + try { - using var ms = new MemoryStream(); - using XtraReport report = ReportsFactory.Reports[url](); - report.SaveLayoutToXml(ms); - return ms.ToArray(); + if (Directory.EnumerateFiles(reportDirectory).Select(Path.GetFileNameWithoutExtension).Contains(url)) + { + return File.ReadAllBytes(Path.Combine(reportDirectory, url + FileExtension)); + } + if (ReportsFactory.Reports.ContainsKey(url)) + { + using (MemoryStream ms = new MemoryStream()) + { + ReportsFactory.Reports[url]().SaveLayoutToXml(ms); + return ms.ToArray(); + } + } } - throw new DevExpress.XtraReports.Web.ClientControls.FaultException($"Could not find report '{url}'."); + catch (Exception) + { + throw new FaultException(new FaultReason("Could not get report data."), new FaultCode("Server"), "GetData"); + } + throw new FaultException(new FaultReason(string.Format("Could not find report '{0}'.", url)), new FaultCode("Server"), "GetData"); } public override Dictionary GetUrls() { - return DbContext.ReportDefinitions - .ToList() - .Select(x => x.Name) - .Union(ReportsFactory.Reports.Select(x => x.Key)) - .ToDictionary(x => x); + // Returns a dictionary that contains the report names (URLs) and display names. + // The Report Designer uses this method to populate the Open Report and Save Report dialogs. + + return Directory.GetFiles(reportDirectory, "*" + FileExtension) + .Select(Path.GetFileNameWithoutExtension) + .Union(ReportsFactory.Reports.Select(x => x.Key)) + .ToDictionary(x => x); } public override void SetData(XtraReport report, string url) { - using var stream = new MemoryStream(); - report.SaveLayoutToXml(stream); - - var reportData = DbContext.ReportDefinitions.FirstOrDefault(x => x.Name == url); - if (reportData == null) - { - var newReport = new Erp.Reports.ReportDefinitions.ReportDefinition( - Guid.NewGuid(), - url, - url, - stream.ToArray() - ); - DbContext.ReportDefinitions.Add(newReport); - } - else - { - reportData.UpdateContent(stream.ToArray()); - } - DbContext.SaveChanges(); + // Saves the specified report to the report storage with the specified name + // (saves existing reports only). + if (!IsWithinReportsFolder(url, reportDirectory)) + throw new FaultException(new FaultReason("Invalid report name."), new FaultCode("Server"), "GetData"); + report.SaveLayoutToXml(Path.Combine(reportDirectory, url + FileExtension)); } public override string SetNewData(XtraReport report, string defaultUrl) { + // Allows you to validate and correct the specified name (URL). + // This method also allows you to return the resulting name (URL), + // and to save your report to a storage. The method is called only for new reports. SetData(report, defaultUrl); return defaultUrl; } } + diff --git a/api/src/Erp.Platform.HttpApi.Host/ReportServices/CustomSqlDataConnectionProviderFactory.cs b/api/src/Erp.Platform.HttpApi.Host/ReportServices/CustomSqlDataConnectionProviderFactory.cs deleted file mode 100644 index d053e8ac..00000000 --- a/api/src/Erp.Platform.HttpApi.Host/ReportServices/CustomSqlDataConnectionProviderFactory.cs +++ /dev/null @@ -1,47 +0,0 @@ -using System; -using Microsoft.Extensions.Configuration; -using DevExpress.DataAccess.ConnectionParameters; -using DevExpress.DataAccess.Sql; -using DevExpress.DataAccess.Web; -using static Erp.Settings.SettingsConsts; -using DevExpress.DataAccess.Wizard.Services; - -namespace Erp.Platform.ReportServices; - -public class CustomSqlDataConnectionProviderFactory : IConnectionProviderFactory -{ - private readonly IConfiguration _configuration; - - public CustomSqlDataConnectionProviderFactory(IConfiguration configuration) - { - _configuration = configuration; - } - - public IConnectionProviderService Create() - { - return new CustomSqlConnectionProviderService(_configuration); - } -} - -public class CustomSqlConnectionProviderService : IConnectionProviderService -{ - private readonly IConfiguration _configuration; - - public CustomSqlConnectionProviderService(IConfiguration configuration) - { - _configuration = configuration; - } - - public SqlDataConnection LoadConnection(string connectionName) - { - // appsettings.json'dan SQL Server connection string'ini al - var connectionString = _configuration.GetConnectionString(DefaultDatabaseProvider); - - if (string.IsNullOrEmpty(connectionString)) - throw new InvalidOperationException($"Connection string for '{DefaultDatabaseProvider}' not found in configuration."); - - // SQL Server için CustomStringConnectionParameters kullan - var connectionParameters = new CustomStringConnectionParameters(connectionString); - return new SqlDataConnection(connectionName, connectionParameters); - } -} diff --git a/api/src/Erp.Platform.HttpApi.Host/ReportServices/CustomSqlDataSourceWizardConnectionStringsProvider.cs b/api/src/Erp.Platform.HttpApi.Host/ReportServices/CustomSqlDataSourceWizardConnectionStringsProvider.cs deleted file mode 100644 index 2851353b..00000000 --- a/api/src/Erp.Platform.HttpApi.Host/ReportServices/CustomSqlDataSourceWizardConnectionStringsProvider.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; -using System.Collections.Generic; -using Microsoft.Extensions.Configuration; -using DevExpress.DataAccess.ConnectionParameters; -using DevExpress.DataAccess.Web; -using static Erp.Settings.SettingsConsts; - -namespace Erp.Platform.ReportServices; - -public class CustomSqlDataSourceWizardConnectionStringsProvider : IDataSourceWizardConnectionStringsProvider -{ - private readonly IConfiguration _configuration; - - public CustomSqlDataSourceWizardConnectionStringsProvider(IConfiguration configuration) - { - _configuration = configuration; - } - - Dictionary IDataSourceWizardConnectionStringsProvider.GetConnectionDescriptions() - { - // SqlServer adında bir bağlantı tanımla - return new Dictionary - { - { "SqlServer", "SQL Server Database Connection" } - }; - } - - DataConnectionParametersBase IDataSourceWizardConnectionStringsProvider.GetDataConnectionParameters(string name) - { - var connectionString = _configuration.GetConnectionString(DefaultDatabaseProvider); - - if (string.IsNullOrEmpty(connectionString)) - return null; - - return new CustomStringConnectionParameters(connectionString); - } -} diff --git a/api/src/Erp.Platform.HttpApi.Host/Reports/TestReport.repx b/api/src/Erp.Platform.HttpApi.Host/Reports/TestReport.repx new file mode 100644 index 00000000..386d757d --- /dev/null +++ b/api/src/Erp.Platform.HttpApi.Host/Reports/TestReport.repx @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file