diff --git a/.github/instructions/ai.instructions.md b/.github/instructions/ai.instructions.md index 5dc9f79..7e1100a 100644 --- a/.github/instructions/ai.instructions.md +++ b/.github/instructions/ai.instructions.md @@ -101,7 +101,8 @@ Driven by: - ListForm - ListFormFields - ListFormCustomization (UserUiFilter, GridState, ServerJoin, ServerWhere) -- ListFormImport and ListFormImportExecute +- ListFormImport and ListFormImportLog +- ListFormWorkflow and ListFormWorkflowCriteria - ListFormJsonRow operations Capabilities: diff --git a/api/src/Sozsoft.Platform.Application.Contracts/ListForms/Dto/ListFormImportExecuteDto.cs b/api/src/Sozsoft.Platform.Application.Contracts/ListForms/Dto/ListFormImportLogDto.cs similarity index 86% rename from api/src/Sozsoft.Platform.Application.Contracts/ListForms/Dto/ListFormImportExecuteDto.cs rename to api/src/Sozsoft.Platform.Application.Contracts/ListForms/Dto/ListFormImportLogDto.cs index 9b126d8..e0879fa 100644 --- a/api/src/Sozsoft.Platform.Application.Contracts/ListForms/Dto/ListFormImportExecuteDto.cs +++ b/api/src/Sozsoft.Platform.Application.Contracts/ListForms/Dto/ListFormImportLogDto.cs @@ -3,7 +3,7 @@ using Volo.Abp.Application.Dtos; namespace Sozsoft.Platform.ListForms; -public class ListFormImportExecuteDto : AuditedEntityDto +public class ListFormImportLogDto : AuditedEntityDto { public Guid ImportId { get; set; } public string BlobName { get; set; } diff --git a/api/src/Sozsoft.Platform.Application.Contracts/ListForms/ImportManager/IImportAppService.cs b/api/src/Sozsoft.Platform.Application.Contracts/ListForms/ImportManager/IImportAppService.cs index 1eb60c5..6797f06 100644 --- a/api/src/Sozsoft.Platform.Application.Contracts/ListForms/ImportManager/IImportAppService.cs +++ b/api/src/Sozsoft.Platform.Application.Contracts/ListForms/ImportManager/IImportAppService.cs @@ -11,7 +11,7 @@ public interface IImportAppService Task GetAsync(Guid sessionId); Task> GetListByListFormCodeAsync(string name); Task UpdateAsync(Guid sessionId, ListFormsImportDto input); - Task ExecuteAsync(ExecuteImportRequest request); + Task ExecuteAsync(ImportExecuteRequest request); Task DeleteAsync(Guid id); } diff --git a/api/src/Sozsoft.Platform.Application.Contracts/ListForms/ImportManager/ExecuteImportRequest.cs b/api/src/Sozsoft.Platform.Application.Contracts/ListForms/ImportManager/ImportExecuteRequest.cs similarity index 90% rename from api/src/Sozsoft.Platform.Application.Contracts/ListForms/ImportManager/ExecuteImportRequest.cs rename to api/src/Sozsoft.Platform.Application.Contracts/ListForms/ImportManager/ImportExecuteRequest.cs index 1c3b509..d00bd30 100644 --- a/api/src/Sozsoft.Platform.Application.Contracts/ListForms/ImportManager/ExecuteImportRequest.cs +++ b/api/src/Sozsoft.Platform.Application.Contracts/ListForms/ImportManager/ImportExecuteRequest.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; namespace Sozsoft.Platform.ListForms.ImportManager; -public class ExecuteImportRequest +public class ImportExecuteRequest { public Guid SessionId { get; set; } public string ListFormCode { get; set; } diff --git a/api/src/Sozsoft.Platform.Application/ListForms/ListFormAutoMapperProfile.cs b/api/src/Sozsoft.Platform.Application/ListForms/ListFormAutoMapperProfile.cs index bdf298f..cd47dbb 100644 --- a/api/src/Sozsoft.Platform.Application/ListForms/ListFormAutoMapperProfile.cs +++ b/api/src/Sozsoft.Platform.Application/ListForms/ListFormAutoMapperProfile.cs @@ -43,7 +43,7 @@ public class ListFormAutoMapperProfile : Profile CreateMap(); CreateMap(); - CreateMap(); + CreateMap(); CreateMap(); } } diff --git a/api/src/Sozsoft.Platform.Application/ListForms/ListFormImportAppService.cs b/api/src/Sozsoft.Platform.Application/ListForms/ListFormImportAppService.cs index 01426ff..c393dbe 100644 --- a/api/src/Sozsoft.Platform.Application/ListForms/ListFormImportAppService.cs +++ b/api/src/Sozsoft.Platform.Application/ListForms/ListFormImportAppService.cs @@ -24,14 +24,14 @@ namespace Sozsoft.Platform.ListForms.ImportManager; public class ListFormImportAppService : PlatformAppService, IImportAppService { private readonly IRepository _importSessionRepository; - private readonly IRepository _importSessionExecuteRepository; + private readonly IRepository _importSessionExecuteRepository; private readonly IListFormAuthorizationManager _authManager; private readonly IQueryManager _qManager; private readonly BlobManager _blobContainer; public ListFormImportAppService( IRepository importSessionRepository, - IRepository importSessionExecuteRepository, + IRepository importSessionExecuteRepository, IListFormAuthorizationManager authManager, IQueryManager qManager, BlobManager blobContainer @@ -134,7 +134,7 @@ public class ListFormImportAppService : PlatformAppService, IImportAppService } [UnitOfWork] - public async Task ExecuteAsync([FromBody] ExecuteImportRequest request) + public async Task ExecuteAsync([FromBody] ImportExecuteRequest request) { var queryable = await _importSessionRepository.GetQueryableAsync(); var session = await AsyncExecuter.FirstOrDefaultAsync(queryable.Where(a => a.Id == request.SessionId)) @@ -144,7 +144,7 @@ public class ListFormImportAppService : PlatformAppService, IImportAppService if (!await _authManager.CanAccess(request.ListFormCode, AuthorizationTypeEnum.Import)) throw new Volo.Abp.UserFriendlyException(L[AppErrorCodes.NoAuth]); - var execute = new ListFormImportExecute + var execute = new ListFormImportLog { ImportId = request.SessionId, BlobName = session.BlobName, @@ -224,7 +224,7 @@ public class ListFormImportAppService : PlatformAppService, IImportAppService session.Status = errorCount > 0 ? "executed_with_errors" : "executed"; await _importSessionRepository.UpdateAsync(session, autoSave: true); - return ObjectMapper.Map(execute); + return ObjectMapper.Map(execute); } catch (Exception ex) { @@ -241,7 +241,7 @@ public class ListFormImportAppService : PlatformAppService, IImportAppService } } - public async Task> GetListExecutesAsync(Guid sessionId) + public async Task> GetListExecutesAsync(Guid sessionId) { var queryable = await _importSessionExecuteRepository.GetQueryableAsync(); var sessions = await AsyncExecuter.ToListAsync( @@ -250,7 +250,7 @@ public class ListFormImportAppService : PlatformAppService, IImportAppService .OrderByDescending(x => x.CreationTime) ); - return ObjectMapper.Map, List>(sessions); + return ObjectMapper.Map, List>(sessions); } public async Task DeleteAsync(Guid id) diff --git a/api/src/Sozsoft.Platform.Domain.Shared/Enums/TableNameEnum.cs b/api/src/Sozsoft.Platform.Domain.Shared/Enums/TableNameEnum.cs index 436e67e..513479a 100644 --- a/api/src/Sozsoft.Platform.Domain.Shared/Enums/TableNameEnum.cs +++ b/api/src/Sozsoft.Platform.Domain.Shared/Enums/TableNameEnum.cs @@ -27,7 +27,9 @@ public enum TableNameEnum ListFormField, ListFormCustomization, ListFormImport, - ListFormImportExecute, + ListFormImportLog, + ListFormWorkflow, + ListFormWorkflowCriteria, Note, ForumCategory, ForumTopic, diff --git a/api/src/Sozsoft.Platform.Domain.Shared/TableNameResolver.cs b/api/src/Sozsoft.Platform.Domain.Shared/TableNameResolver.cs index caf7a63..123a92f 100644 --- a/api/src/Sozsoft.Platform.Domain.Shared/TableNameResolver.cs +++ b/api/src/Sozsoft.Platform.Domain.Shared/TableNameResolver.cs @@ -37,7 +37,9 @@ public static class TableNameResolver { nameof(TableNameEnum.ListFormField), (TablePrefix.PlatformByName, MenuPrefix.Saas) }, { nameof(TableNameEnum.ListFormCustomization), (TablePrefix.PlatformByName, MenuPrefix.Saas) }, { nameof(TableNameEnum.ListFormImport), (TablePrefix.PlatformByName, MenuPrefix.Saas) }, - { nameof(TableNameEnum.ListFormImportExecute), (TablePrefix.PlatformByName, MenuPrefix.Saas) }, + { nameof(TableNameEnum.ListFormImportLog), (TablePrefix.PlatformByName, MenuPrefix.Saas) }, + { nameof(TableNameEnum.ListFormWorkflow), (TablePrefix.PlatformByName, MenuPrefix.Saas) }, + { nameof(TableNameEnum.ListFormWorkflowCriteria), (TablePrefix.PlatformByName, MenuPrefix.Saas) }, { nameof(TableNameEnum.Notification), (TablePrefix.PlatformByName, MenuPrefix.Saas) }, { nameof(TableNameEnum.NotificationRule), (TablePrefix.PlatformByName, MenuPrefix.Saas) }, { nameof(TableNameEnum.NotificationType), (TablePrefix.PlatformByName, MenuPrefix.Saas) }, diff --git a/api/src/Sozsoft.Platform.Domain/Entities/Tenant/ListForm/ListFormImportExecute.cs b/api/src/Sozsoft.Platform.Domain/Entities/Tenant/ListForm/ListFormImportLog.cs similarity index 87% rename from api/src/Sozsoft.Platform.Domain/Entities/Tenant/ListForm/ListFormImportExecute.cs rename to api/src/Sozsoft.Platform.Domain/Entities/Tenant/ListForm/ListFormImportLog.cs index e0f1b11..fa18e85 100644 --- a/api/src/Sozsoft.Platform.Domain/Entities/Tenant/ListForm/ListFormImportExecute.cs +++ b/api/src/Sozsoft.Platform.Domain/Entities/Tenant/ListForm/ListFormImportLog.cs @@ -3,7 +3,7 @@ using Volo.Abp.Domain.Entities.Auditing; namespace Sozsoft.Platform.Entities; -public class ListFormImportExecute : FullAuditedEntity +public class ListFormImportLog : FullAuditedEntity { public Guid ImportId { get; set; } public string BlobName { get; set; } diff --git a/api/src/Sozsoft.Platform.Domain/Entities/Tenant/ListForm/ListFormWorkflow.cs b/api/src/Sozsoft.Platform.Domain/Entities/Tenant/ListForm/ListFormWorkflow.cs new file mode 100644 index 0000000..002071e --- /dev/null +++ b/api/src/Sozsoft.Platform.Domain/Entities/Tenant/ListForm/ListFormWorkflow.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using Volo.Abp.Domain.Entities.Auditing; + +namespace Sozsoft.Platform.Entities; + +public class ListFormWorkflow : FullAuditedEntity +{ + public string ListFormCode { get; set; } + public int OrderNo { get; set; } + public string Title { get; set; } + public string Status { get; set; } + public decimal Amount { get; set; } + public string CurrentNodeId { get; set; } + public string AssignedApprover { get; set; } + public string InformedPerson { get; set; } + public string HistoryJson { get; set; } + + public ICollection Criteria { get; set; } +} \ No newline at end of file diff --git a/api/src/Sozsoft.Platform.Domain/Entities/Tenant/ListForm/ListFormWorkflowCriteria.cs b/api/src/Sozsoft.Platform.Domain/Entities/Tenant/ListForm/ListFormWorkflowCriteria.cs new file mode 100644 index 0000000..044914e --- /dev/null +++ b/api/src/Sozsoft.Platform.Domain/Entities/Tenant/ListForm/ListFormWorkflowCriteria.cs @@ -0,0 +1,27 @@ +using System; +using Volo.Abp.Domain.Entities.Auditing; + +namespace Sozsoft.Platform.Entities; + +public class ListFormWorkflowCriteria : FullAuditedEntity +{ + public string ListFormCode { get; set; } + public Guid WorkflowItemId { get; set; } + public ListFormWorkflow WorkflowItem { get; set; } + public string NodeId { get; set; } + public string Kind { get; set; } + public string Title { get; set; } + public string Column { get; set; } + public string Operator { get; set; } + public decimal CompareValue { get; set; } + public string Approver { get; set; } + public string InformPerson { get; set; } + public string NextOnStart { get; set; } + public string NextOnTrue { get; set; } + public string NextOnFalse { get; set; } + public string NextOnApprove { get; set; } + public string NextOnReject { get; set; } + public int PositionX { get; set; } + public int PositionY { get; set; } + public string CompareOutcomesJson { get; set; } +} \ No newline at end of file diff --git a/api/src/Sozsoft.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs b/api/src/Sozsoft.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs index 2ca802c..08f7285 100644 --- a/api/src/Sozsoft.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs +++ b/api/src/Sozsoft.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs @@ -54,7 +54,9 @@ public class PlatformDbContext : public DbSet ListFormFields { get; set; } public DbSet ListFormCustomization { get; set; } public DbSet ListFormImports { get; set; } - public DbSet ListFormImportExecutes { get; set; } + public DbSet ListFormImportLogs { get; set; } + public DbSet ListFormWorkflows { get; set; } + public DbSet ListFormWorkflowCriteria { get; set; } public DbSet BackgroundWorkers { get; set; } public DbSet ForumCategories { get; set; } public DbSet ForumTopics { get; set; } @@ -224,7 +226,7 @@ public class PlatformDbContext : b.Property(a => a.BranchId).IsRequired(); b.HasIndex(x => new { x.TenantId, x.BranchId, x.UserId }).IsUnique().HasFilter(null); - + b.HasOne(x => x.Branch) .WithMany(x => x.UserBranches) .HasForeignKey(x => x.BranchId) @@ -466,12 +468,12 @@ public class PlatformDbContext : b.Property(x => x.BlobName).IsRequired().HasMaxLength(256); b.Property(x => x.Status).IsRequired().HasMaxLength(64); - builder.Entity(b => { b.HasMany().WithOne().HasForeignKey(x => x.ImportId).OnDelete(DeleteBehavior.Cascade); }); + builder.Entity(b => { b.HasMany().WithOne().HasForeignKey(x => x.ImportId).OnDelete(DeleteBehavior.Cascade); }); }); - builder.Entity(b => + builder.Entity(b => { - b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.ListFormImportExecute)), Prefix.DbSchema); + b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.ListFormImportLog)), Prefix.DbSchema); b.ConfigureByConvention(); b.Property(x => x.ImportId).IsRequired(); @@ -480,6 +482,59 @@ public class PlatformDbContext : b.Property(x => x.ErrorsJson).HasColumnType("text"); }); + builder.Entity(b => + { + b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.ListFormWorkflow)), Prefix.DbSchema); + b.ConfigureByConvention(); + + b.Property(x => x.ListFormCode).IsRequired().HasMaxLength(64); + b.Property(x => x.OrderNo).IsRequired(); + b.Property(x => x.Title).IsRequired().HasMaxLength(150); + b.Property(x => x.Status).IsRequired().HasMaxLength(100); + b.Property(x => x.Amount).HasPrecision(18, 2); + b.Property(x => x.CurrentNodeId).IsRequired().HasMaxLength(50); + b.Property(x => x.AssignedApprover).IsRequired().HasMaxLength(250); + b.Property(x => x.InformedPerson).IsRequired().HasMaxLength(250); + b.Property(x => x.HistoryJson).HasColumnType("text"); + + b.HasMany(x => x.Criteria) + .WithOne(x => x.WorkflowItem) + .HasForeignKey(x => x.WorkflowItemId) + .OnDelete(DeleteBehavior.Cascade); + }); + + builder.Entity(b => + { + b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.ListFormWorkflowCriteria)), Prefix.DbSchema); + b.ConfigureByConvention(); + + b.Property(x => x.ListFormCode).IsRequired().HasMaxLength(64); + b.Property(x => x.WorkflowItemId).IsRequired(); + b.Property(x => x.NodeId).IsRequired().HasMaxLength(50); + b.Property(x => x.Kind).IsRequired().HasMaxLength(50); + b.Property(x => x.Title).IsRequired().HasMaxLength(250); + b.Property(x => x.Column).IsRequired().HasMaxLength(100); + b.Property(x => x.Operator).IsRequired().HasMaxLength(20); + b.Property(x => x.CompareValue).HasPrecision(18, 2); + b.Property(x => x.Approver).IsRequired().HasMaxLength(250); + b.Property(x => x.InformPerson).IsRequired().HasMaxLength(250); + b.Property(x => x.NextOnStart).IsRequired().HasMaxLength(50); + b.Property(x => x.NextOnTrue).IsRequired().HasMaxLength(50); + b.Property(x => x.NextOnFalse).IsRequired().HasMaxLength(50); + b.Property(x => x.NextOnApprove).IsRequired().HasMaxLength(50); + b.Property(x => x.NextOnReject).IsRequired().HasMaxLength(50); + b.Property(x => x.PositionX).IsRequired(); + b.Property(x => x.PositionY).IsRequired(); + b.Property(x => x.CompareOutcomesJson).HasColumnType("text"); + + b.HasIndex(x => new + { + x.ListFormCode, + x.WorkflowItemId, + x.NodeId + }); + }); + builder.Entity(b => { b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.Note)), Prefix.DbSchema); @@ -685,7 +740,7 @@ public class PlatformDbContext : b.Property(x => x.Rate).HasPrecision(18, 6); b.Property(x => x.IsActive).HasDefaultValue(true); - b.HasIndex(x => new {x.Id, x.Name }).IsUnique().HasFilter("[IsDeleted] = 0"); + b.HasIndex(x => new { x.Id, x.Name }).IsUnique().HasFilter("[IsDeleted] = 0"); }); builder.Entity(b => @@ -1129,7 +1184,7 @@ public class PlatformDbContext : b.Property(x => x.Responses).HasDefaultValue(0); b.Property(x => x.Status).IsRequired().HasMaxLength(10); - b.HasIndex(x => new { x.TenantId, x.Title }).IsUnique().HasFilter("[IsDeleted] = 0"); + b.HasIndex(x => new { x.TenantId, x.Title }).IsUnique().HasFilter("[IsDeleted] = 0"); }); builder.Entity(b => @@ -1351,7 +1406,7 @@ public class PlatformDbContext : b.Property(x => x.Subject).HasMaxLength(128); b.Property(x => x.TeacherName).IsRequired().HasMaxLength(128); - b.HasIndex(x => new { x.TenantId, x.BranchId, x.Name }).IsUnique().HasFilter("[IsDeleted] = 0"); + b.HasIndex(x => new { x.TenantId, x.BranchId, x.Name }).IsUnique().HasFilter("[IsDeleted] = 0"); b.HasMany(x => x.Participants) .WithOne(x => x.Session) @@ -1420,7 +1475,7 @@ public class PlatformDbContext : b.Property(x => x.IsActive).IsRequired().HasDefaultValue(true); - b.HasIndex(x => new { x.TenantId, x.Name }).IsUnique().HasFilter("[IsDeleted] = 0"); + b.HasIndex(x => new { x.TenantId, x.Name }).IsUnique().HasFilter("[IsDeleted] = 0"); }); } } diff --git a/api/src/Sozsoft.Platform.EntityFrameworkCore/Migrations/20260517100701_Initial.Designer.cs b/api/src/Sozsoft.Platform.EntityFrameworkCore/Migrations/20260522085648_Initial.Designer.cs similarity index 97% rename from api/src/Sozsoft.Platform.EntityFrameworkCore/Migrations/20260517100701_Initial.Designer.cs rename to api/src/Sozsoft.Platform.EntityFrameworkCore/Migrations/20260522085648_Initial.Designer.cs index ae9804f..77293d5 100644 --- a/api/src/Sozsoft.Platform.EntityFrameworkCore/Migrations/20260517100701_Initial.Designer.cs +++ b/api/src/Sozsoft.Platform.EntityFrameworkCore/Migrations/20260522085648_Initial.Designer.cs @@ -13,7 +13,7 @@ using Volo.Abp.EntityFrameworkCore; namespace Sozsoft.Platform.Migrations { [DbContext(typeof(PlatformDbContext))] - [Migration("20260517100701_Initial")] + [Migration("20260522085648_Initial")] partial class Initial { /// @@ -3339,7 +3339,7 @@ namespace Sozsoft.Platform.Migrations b.ToTable("Sas_H_ListFormImport", (string)null); }); - modelBuilder.Entity("Sozsoft.Platform.Entities.ListFormImportExecute", b => + modelBuilder.Entity("Sozsoft.Platform.Entities.ListFormImportLog", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -3406,7 +3406,212 @@ namespace Sozsoft.Platform.Migrations b.HasIndex("ImportId"); - b.ToTable("Sas_H_ListFormImportExecute", (string)null); + b.ToTable("Sas_H_ListFormImportLog", (string)null); + }); + + modelBuilder.Entity("Sozsoft.Platform.Entities.ListFormWorkflow", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Amount") + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)"); + + b.Property("AssignedApprover") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("nvarchar(250)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CurrentNodeId") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("HistoryJson") + .HasColumnType("text"); + + b.Property("InformedPerson") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("nvarchar(250)"); + + 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("ListFormCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("OrderNo") + .HasColumnType("int"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("Title") + .IsRequired() + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.HasKey("Id"); + + b.ToTable("Sas_H_ListFormWorkflow", (string)null); + }); + + modelBuilder.Entity("Sozsoft.Platform.Entities.ListFormWorkflowCriteria", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Approver") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("nvarchar(250)"); + + b.Property("Column") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("CompareOutcomesJson") + .HasColumnType("text"); + + b.Property("CompareValue") + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)"); + + 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("InformPerson") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("nvarchar(250)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("Kind") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("ListFormCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("NextOnApprove") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("NextOnFalse") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("NextOnReject") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("NextOnStart") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("NextOnTrue") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("NodeId") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Operator") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("nvarchar(20)"); + + b.Property("PositionX") + .HasColumnType("int"); + + b.Property("PositionY") + .HasColumnType("int"); + + b.Property("Title") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("nvarchar(250)"); + + b.Property("WorkflowItemId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("WorkflowItemId"); + + b.HasIndex("ListFormCode", "WorkflowItemId", "NodeId"); + + b.ToTable("Sas_H_ListFormWorkflowCriteria", (string)null); }); modelBuilder.Entity("Sozsoft.Platform.Entities.LogEntry", b => @@ -8130,7 +8335,7 @@ namespace Sozsoft.Platform.Migrations .IsRequired(); }); - modelBuilder.Entity("Sozsoft.Platform.Entities.ListFormImportExecute", b => + modelBuilder.Entity("Sozsoft.Platform.Entities.ListFormImportLog", b => { b.HasOne("Sozsoft.Platform.Entities.ListFormImport", null) .WithMany() @@ -8139,6 +8344,17 @@ namespace Sozsoft.Platform.Migrations .IsRequired(); }); + modelBuilder.Entity("Sozsoft.Platform.Entities.ListFormWorkflowCriteria", b => + { + b.HasOne("Sozsoft.Platform.Entities.ListFormWorkflow", "WorkflowItem") + .WithMany("Criteria") + .HasForeignKey("WorkflowItemId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("WorkflowItem"); + }); + modelBuilder.Entity("Sozsoft.Platform.Entities.OrderItem", b => { b.HasOne("Sozsoft.Platform.Entities.Order", "Order") @@ -8574,6 +8790,11 @@ namespace Sozsoft.Platform.Migrations b.Navigation("Events"); }); + modelBuilder.Entity("Sozsoft.Platform.Entities.ListFormWorkflow", b => + { + b.Navigation("Criteria"); + }); + modelBuilder.Entity("Sozsoft.Platform.Entities.Order", b => { b.Navigation("Items"); diff --git a/api/src/Sozsoft.Platform.EntityFrameworkCore/Migrations/20260517100701_Initial.cs b/api/src/Sozsoft.Platform.EntityFrameworkCore/Migrations/20260522085648_Initial.cs similarity index 97% rename from api/src/Sozsoft.Platform.EntityFrameworkCore/Migrations/20260517100701_Initial.cs rename to api/src/Sozsoft.Platform.EntityFrameworkCore/Migrations/20260522085648_Initial.cs index ada6360..2fc8753 100644 --- a/api/src/Sozsoft.Platform.EntityFrameworkCore/Migrations/20260517100701_Initial.cs +++ b/api/src/Sozsoft.Platform.EntityFrameworkCore/Migrations/20260522085648_Initial.cs @@ -1388,6 +1388,33 @@ namespace Sozsoft.Platform.Migrations table.UniqueConstraint("AK_Sas_H_ListForm_ListFormCode", x => x.ListFormCode); }); + migrationBuilder.CreateTable( + name: "Sas_H_ListFormWorkflow", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + ListFormCode = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), + OrderNo = table.Column(type: "int", nullable: false), + Title = table.Column(type: "nvarchar(150)", maxLength: 150, nullable: false), + Status = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), + Amount = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false), + CurrentNodeId = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false), + AssignedApprover = table.Column(type: "nvarchar(250)", maxLength: 250, nullable: false), + InformedPerson = table.Column(type: "nvarchar(250)", maxLength: 250, nullable: false), + HistoryJson = table.Column(type: "text", nullable: true), + 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_Sas_H_ListFormWorkflow", x => x.Id); + }); + migrationBuilder.CreateTable( name: "Sas_H_LogEntry", columns: table => new @@ -2634,6 +2661,48 @@ namespace Sozsoft.Platform.Migrations onDelete: ReferentialAction.Cascade); }); + migrationBuilder.CreateTable( + name: "Sas_H_ListFormWorkflowCriteria", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + ListFormCode = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), + WorkflowItemId = table.Column(type: "uniqueidentifier", nullable: false), + NodeId = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false), + Kind = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false), + Title = table.Column(type: "nvarchar(250)", maxLength: 250, nullable: false), + Column = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), + Operator = table.Column(type: "nvarchar(20)", maxLength: 20, nullable: false), + CompareValue = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false), + Approver = table.Column(type: "nvarchar(250)", maxLength: 250, nullable: false), + InformPerson = table.Column(type: "nvarchar(250)", maxLength: 250, nullable: false), + NextOnStart = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false), + NextOnTrue = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false), + NextOnFalse = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false), + NextOnApprove = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false), + NextOnReject = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false), + PositionX = table.Column(type: "int", nullable: false), + PositionY = table.Column(type: "int", nullable: false), + CompareOutcomesJson = table.Column(type: "text", nullable: true), + 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_Sas_H_ListFormWorkflowCriteria", x => x.Id); + table.ForeignKey( + name: "FK_Sas_H_ListFormWorkflowCriteria_Sas_H_ListFormWorkflow_WorkflowItemId", + column: x => x.WorkflowItemId, + principalTable: "Sas_H_ListFormWorkflow", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + migrationBuilder.CreateTable( name: "Sas_H_NotificationRule", columns: table => new @@ -3100,7 +3169,7 @@ namespace Sozsoft.Platform.Migrations }); migrationBuilder.CreateTable( - name: "Sas_H_ListFormImportExecute", + name: "Sas_H_ListFormImportLog", columns: table => new { Id = table.Column(type: "uniqueidentifier", nullable: false), @@ -3122,9 +3191,9 @@ namespace Sozsoft.Platform.Migrations }, constraints: table => { - table.PrimaryKey("PK_Sas_H_ListFormImportExecute", x => x.Id); + table.PrimaryKey("PK_Sas_H_ListFormImportLog", x => x.Id); table.ForeignKey( - name: "FK_Sas_H_ListFormImportExecute_Sas_H_ListFormImport_ImportId", + name: "FK_Sas_H_ListFormImportLog_Sas_H_ListFormImport_ImportId", column: x => x.ImportId, principalTable: "Sas_H_ListFormImport", principalColumn: "Id", @@ -3860,10 +3929,20 @@ namespace Sozsoft.Platform.Migrations column: "ListFormCode"); migrationBuilder.CreateIndex( - name: "IX_Sas_H_ListFormImportExecute_ImportId", - table: "Sas_H_ListFormImportExecute", + name: "IX_Sas_H_ListFormImportLog_ImportId", + table: "Sas_H_ListFormImportLog", column: "ImportId"); + migrationBuilder.CreateIndex( + name: "IX_Sas_H_ListFormWorkflowCriteria_ListFormCode_WorkflowItemId_NodeId", + table: "Sas_H_ListFormWorkflowCriteria", + columns: new[] { "ListFormCode", "WorkflowItemId", "NodeId" }); + + migrationBuilder.CreateIndex( + name: "IX_Sas_H_ListFormWorkflowCriteria_WorkflowItemId", + table: "Sas_H_ListFormWorkflowCriteria", + column: "WorkflowItemId"); + migrationBuilder.CreateIndex( name: "IX_Sas_H_Menu_Code", table: "Sas_H_Menu", @@ -4211,7 +4290,10 @@ namespace Sozsoft.Platform.Migrations name: "Sas_H_ListFormField"); migrationBuilder.DropTable( - name: "Sas_H_ListFormImportExecute"); + name: "Sas_H_ListFormImportLog"); + + migrationBuilder.DropTable( + name: "Sas_H_ListFormWorkflowCriteria"); migrationBuilder.DropTable( name: "Sas_H_LogEntry"); @@ -4318,6 +4400,9 @@ namespace Sozsoft.Platform.Migrations migrationBuilder.DropTable( name: "Sas_H_ListFormImport"); + migrationBuilder.DropTable( + name: "Sas_H_ListFormWorkflow"); + migrationBuilder.DropTable( name: "Sas_H_NotificationRule"); diff --git a/api/src/Sozsoft.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs b/api/src/Sozsoft.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs index 87c577e..43fa9b3 100644 --- a/api/src/Sozsoft.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs +++ b/api/src/Sozsoft.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs @@ -3336,7 +3336,7 @@ namespace Sozsoft.Platform.Migrations b.ToTable("Sas_H_ListFormImport", (string)null); }); - modelBuilder.Entity("Sozsoft.Platform.Entities.ListFormImportExecute", b => + modelBuilder.Entity("Sozsoft.Platform.Entities.ListFormImportLog", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -3403,7 +3403,212 @@ namespace Sozsoft.Platform.Migrations b.HasIndex("ImportId"); - b.ToTable("Sas_H_ListFormImportExecute", (string)null); + b.ToTable("Sas_H_ListFormImportLog", (string)null); + }); + + modelBuilder.Entity("Sozsoft.Platform.Entities.ListFormWorkflow", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Amount") + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)"); + + b.Property("AssignedApprover") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("nvarchar(250)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CurrentNodeId") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("HistoryJson") + .HasColumnType("text"); + + b.Property("InformedPerson") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("nvarchar(250)"); + + 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("ListFormCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("OrderNo") + .HasColumnType("int"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("Title") + .IsRequired() + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.HasKey("Id"); + + b.ToTable("Sas_H_ListFormWorkflow", (string)null); + }); + + modelBuilder.Entity("Sozsoft.Platform.Entities.ListFormWorkflowCriteria", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Approver") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("nvarchar(250)"); + + b.Property("Column") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("CompareOutcomesJson") + .HasColumnType("text"); + + b.Property("CompareValue") + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)"); + + 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("InformPerson") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("nvarchar(250)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("Kind") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("ListFormCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("NextOnApprove") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("NextOnFalse") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("NextOnReject") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("NextOnStart") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("NextOnTrue") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("NodeId") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Operator") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("nvarchar(20)"); + + b.Property("PositionX") + .HasColumnType("int"); + + b.Property("PositionY") + .HasColumnType("int"); + + b.Property("Title") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("nvarchar(250)"); + + b.Property("WorkflowItemId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("WorkflowItemId"); + + b.HasIndex("ListFormCode", "WorkflowItemId", "NodeId"); + + b.ToTable("Sas_H_ListFormWorkflowCriteria", (string)null); }); modelBuilder.Entity("Sozsoft.Platform.Entities.LogEntry", b => @@ -8127,7 +8332,7 @@ namespace Sozsoft.Platform.Migrations .IsRequired(); }); - modelBuilder.Entity("Sozsoft.Platform.Entities.ListFormImportExecute", b => + modelBuilder.Entity("Sozsoft.Platform.Entities.ListFormImportLog", b => { b.HasOne("Sozsoft.Platform.Entities.ListFormImport", null) .WithMany() @@ -8136,6 +8341,17 @@ namespace Sozsoft.Platform.Migrations .IsRequired(); }); + modelBuilder.Entity("Sozsoft.Platform.Entities.ListFormWorkflowCriteria", b => + { + b.HasOne("Sozsoft.Platform.Entities.ListFormWorkflow", "WorkflowItem") + .WithMany("Criteria") + .HasForeignKey("WorkflowItemId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("WorkflowItem"); + }); + modelBuilder.Entity("Sozsoft.Platform.Entities.OrderItem", b => { b.HasOne("Sozsoft.Platform.Entities.Order", "Order") @@ -8571,6 +8787,11 @@ namespace Sozsoft.Platform.Migrations b.Navigation("Events"); }); + modelBuilder.Entity("Sozsoft.Platform.Entities.ListFormWorkflow", b => + { + b.Navigation("Criteria"); + }); + modelBuilder.Entity("Sozsoft.Platform.Entities.Order", b => { b.Navigation("Items"); diff --git a/ui/src/components/importManager/ImportDashboard.tsx b/ui/src/components/importManager/ImportDashboard.tsx index ff610b8..4b0c9f9 100644 --- a/ui/src/components/importManager/ImportDashboard.tsx +++ b/ui/src/components/importManager/ImportDashboard.tsx @@ -18,7 +18,7 @@ import { import { FileUploadArea } from './FileUploadArea' import { ImportPreview } from './ImportPreview' import { ImportProgress } from './ImportProgress' -import { ListFormImportDto, ListFormImportExecuteDto } from '@/proxy/imports/models' +import { ListFormImportDto, ListFormImportLogDto } from '@/proxy/imports/models' import { ImportService } from '@/services/import.service' import { GridDto } from '@/proxy/form/models' import { useLocalization } from '@/utils/hooks/useLocalization' @@ -41,7 +41,7 @@ export const ImportDashboard: React.FC = ({ gridDto }) => const [generating, setGenerating] = useState(false) const [expandedSessions, setExpandedSessions] = useState>(new Set()) const [sessionExecutes, setSessionExecutes] = useState< - Record + Record >({}) const [loadingExecutes, setLoadingExecutes] = useState>(new Set()) @@ -77,7 +77,7 @@ export const ImportDashboard: React.FC = ({ gridDto }) => // Her zaman fresh data çek - cache'e güvenme setLoadingExecutes((prev) => new Set([...prev, sessionId])) try { - const executes = await importService.getListFormImportExecutes(sessionId) + const executes = await importService.getListFormImportLogs(sessionId) setSessionExecutes((prev) => ({ ...prev, [sessionId]: executes, @@ -153,7 +153,7 @@ export const ImportDashboard: React.FC = ({ gridDto }) => } } - const handleImportExecute = async ( + const handleImportLog = async ( sessionId: string, listFormCode: string, selectedRows?: number[], @@ -497,7 +497,7 @@ export const ImportDashboard: React.FC = ({ gridDto }) => = ({ gridDto }) => if (sessionExecutes[session.id]) { setLoadingExecutes((prev) => new Set([...prev, session.id])) try { - const executes = await importService.getListFormImportExecutes( + const executes = await importService.getListFormImportLogs( session.id, ) setSessionExecutes((prev) => ({ diff --git a/ui/src/proxy/imports/models.ts b/ui/src/proxy/imports/models.ts index dc0b0fc..d487c18 100644 --- a/ui/src/proxy/imports/models.ts +++ b/ui/src/proxy/imports/models.ts @@ -9,7 +9,7 @@ export interface ListFormImportDto { creationTime: string } -export interface ListFormImportExecuteDto { +export interface ListFormImportLogDto { id: string importId: string blobName: string diff --git a/ui/src/services/import.service.ts b/ui/src/services/import.service.ts index a434efe..80f4a2c 100644 --- a/ui/src/services/import.service.ts +++ b/ui/src/services/import.service.ts @@ -2,7 +2,7 @@ import { GridDto } from '@/proxy/form/models' import { ImportPreviewData, ListFormImportDto, - ListFormImportExecuteDto, + ListFormImportLogDto, } from '@/proxy/imports/models' import apiService from './api.service' @@ -196,7 +196,7 @@ ${headers sessionId: string, listFormCode: string, selectedRows?: number[], - ): Promise { + ): Promise { // Get the uploaded file data const uploadedFile = this._uploadedFiles.get(sessionId) if (!uploadedFile) { @@ -217,7 +217,7 @@ ${headers } // Call backend API to execute import with selected rows data - const response = await apiService.fetchData({ + const response = await apiService.fetchData({ url: `/api/app/list-form-import/execute`, method: 'POST', data: { @@ -249,8 +249,8 @@ ${headers return response.data } - async getListFormImportExecutes(sessionId: string): Promise { - const response = await apiService.fetchData({ + async getListFormImportLogs(sessionId: string): Promise { + const response = await apiService.fetchData({ url: `/api/app/list-form-import/executes/${sessionId}`, method: 'GET', })