diff --git a/.vs/Win.Sfs.SmartSettlementSystem.PG/v16/.suo b/.vs/Win.Sfs.SmartSettlementSystem.PG/v16/.suo index 84ff1702..e3209a30 100644 Binary files a/.vs/Win.Sfs.SmartSettlementSystem.PG/v16/.suo and b/.vs/Win.Sfs.SmartSettlementSystem.PG/v16/.suo differ diff --git a/src/Gateways/InternalGateway/InternalGateway.Host/appsettings.Development.json b/src/Gateways/InternalGateway/InternalGateway.Host/appsettings.Development.json index 8983e0fc..64c7cff5 100644 --- a/src/Gateways/InternalGateway/InternalGateway.Host/appsettings.Development.json +++ b/src/Gateways/InternalGateway/InternalGateway.Host/appsettings.Development.json @@ -1,9 +1,127 @@ { + "App": { + "CorsOrigins": "https://*.abc.com,http://localhost:9528,http://149.223.116.5:8088" + }, + //"ConnectionStrings": { + // "Default": "Server=LAPTOP-V3U07C2O;Database=ABP;user id=sa;Password=1q2w!@#", + // "SettleAccountService": "Server=LAPTOP-V3U07C2O;Database=SettleAccountService;user id=sa;Password=1q2w!@#;" + //}, + "ConnectionStrings": { + //"Default": "Server=127.0.0.1;Database=ABP;user id=sa;Password=1", + //"SettleAccountService": "Server=127.0.0.1;Database=SettleAccountService;user id=sa;Password=1;" + "Default": "Server=192.168.0.140;Database=ABP;User ID=sa;Password=Microsoft2008;", + "SettleAccountService": "Server=192.168.0.140;Database=SettleAccountService;user id=sa;password=Microsoft2008;", + "Wms": "Server=192.168.0.63;Database=CPAT_WMS;user id=sa;password=Microsoft2008;" + + }, "Logging": { "LogLevel": { "Default": "Information", "Microsoft": "Warning", "Microsoft.Hosting.Lifetime": "Information" } + }, + + + "Serilog": { + "Using": [], + "MinumumLevel": { + "Default": "Information", + "Override": { + "Microsoft": "Warning", + "System": "Warning" + } + }, + + "Settings": { + "Abp.Mailing.Smtp.Host": "149.223.116.5", + "Abp.Mailing.Smtp.Port": "25", + "Abp.Mailing.Smtp.UserName": "", + "Abp.Mailing.Smtp.Password": "", + "Abp.Mailing.Smtp.Domain": "", + "Abp.Mailing.Smtp.EnableSsl": "false", + "Abp.Mailing.Smtp.UseDefaultCredentials": "true", + "Abp.Mailing.DefaultFromAddress": "noreply@abp.io", + "Abp.Mailing.DefaultFromDisplayName": "ABP application" + }, + + "WriteTo": [ + { "Name": "Console" }, + { + "Name": "File", + "Args": { + "path": ".\\Logs\\log-.txt", + "rollingInterval": "Day", // Not currently in use. + "rollOnFileSizeLimit": true, + "fileSizeLimitBytes": 10000000, + "outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss.fff G} {Message}{NewLine:1}{Exception:1}" + } + }, + { + "Name": "MSSqlServer", + "Args": { + "connectionString": "Default", + "tableName": "Logs", + "autoCreateSqlTable": true, + "restrictedToMinimumLevel": "Information", + "batchPostingLimit": 1000, + "period": "0.00:00:30" + } + } + ] + }, + + "RabbitMQ": { + "Connections": { + "Default": { + "HostName": "149.223.116.5" + } + }, + "EventBus": { + "ClientName": "MyClientName", + "ExchangeName": "MyExchangeName" + } + }, + + + + + + + + + "AuthServer": { + "Authority": "http://149.223.116.5:8066", + "AlwaysAllowAuthorization": false + }, + + "Redis": { + "Configuration": "127.0.0.1" + }, + + "DefaultBranchId": "3FA85F64-5717-4562-B3FC-2C963F66AFA6", + "AllowedHosts": "*", + + "ElasticSearch": { + "Url": "http://localhost:9200" + }, + + "RemoteServices": { + "Default": { + "BaseUrl": "http://149.223.116.5:8091/", + "UseCurrentAccessToken": "true" + } + }, + "IdentityClients": { + "Default": { + "GrantType": "client_credentials", + "ClientId": "business-app", + "ClientSecret": "1q2w3e*", + "Authority": "http://149.223.116.5:8066", + "Scope": "InternalGateway IdentityService SettleAccount" + } } -} + + + +} \ No newline at end of file diff --git a/src/Gateways/InternalGateway/InternalGateway.Host/appsettings.json b/src/Gateways/InternalGateway/InternalGateway.Host/appsettings.json index 31731b03..7f7de9a0 100644 --- a/src/Gateways/InternalGateway/InternalGateway.Host/appsettings.json +++ b/src/Gateways/InternalGateway/InternalGateway.Host/appsettings.json @@ -1,38 +1,129 @@ -{ - "AuthServer": { - "Authority": "http://localhost:10100", - "ApiName": "InternalGateway" +{ + "App": { + "CorsOrigins": "https://*.abc.com,http://localhost:9528,http://149.223.116.5:8088" }, + //"ConnectionStrings": { + // "Default": "Server=LAPTOP-V3U07C2O;Database=ABP;user id=sa;Password=1q2w!@#", + // "SettleAccountService": "Server=LAPTOP-V3U07C2O;Database=SettleAccountService1;user id=sa;Password=1q2w!@#;" + //}, "ConnectionStrings": { - "Default": "Server=localhost;Database=ABP;Trusted_Connection=True;" + //"Default": "Server=127.0.0.1;Database=ABP;user id=sa;Password=1", + //"SettleAccountService": "Server=127.0.0.1;Database=SettleAccountService;user id=sa;Password=1;" + "Default": "Server=192.168.0.140;Database=ABP;User ID=sa;Password=Microsoft2008;", + "SettleAccountService": "Server=192.168.0.140;Database=SettleAccountService;user id=sa;password=Microsoft2008;", + "Wms": "Server=192.168.0.63;Database=CPAT_WMS;user id=sa;password=Microsoft2008;" + }, - "ElasticSearch": { - "Url": "http://localhost:9200" + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft": "Warning", + "Microsoft.Hosting.Lifetime": "Information" + } + }, + + + + + "Serilog": { + "Using": [], + "MinumumLevel": { + "Default": "Information", + "Override": { + "Microsoft": "Warning", + "System": "Warning" + } + }, + + "Settings": { + "Abp.Mailing.Smtp.Host": "149.223.116.5", + "Abp.Mailing.Smtp.Port": "25", + "Abp.Mailing.Smtp.UserName": "", + "Abp.Mailing.Smtp.Password": "", + "Abp.Mailing.Smtp.Domain": "", + "Abp.Mailing.Smtp.EnableSsl": "false", + "Abp.Mailing.Smtp.UseDefaultCredentials": "true", + "Abp.Mailing.DefaultFromAddress": "noreply@abp.io", + "Abp.Mailing.DefaultFromDisplayName": "ABP application" + }, + + "WriteTo": [ + { "Name": "Console" }, + { + "Name": "File", + "Args": { + "path": ".\\Logs\\log-.txt", + "rollingInterval": "Day", // Not currently in use. + "rollOnFileSizeLimit": true, + "fileSizeLimitBytes": 10000000, + "outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss.fff G} {Message}{NewLine:1}{Exception:1}" + } + }, + { + "Name": "MSSqlServer", + "Args": { + "connectionString": "Default", + "tableName": "Logs", + "autoCreateSqlTable": true, + "restrictedToMinimumLevel": "Information", + "batchPostingLimit": 1000, + "period": "0.00:00:30" + } + } + ] + }, + + "RabbitMQ": { + "Connections": { + "Default": { + "HostName": "149.223.116.5" + } + }, + "EventBus": { + "ClientName": "MyClientName", + "ExchangeName": "MyExchangeName" + } + }, + + + + + + + + + "AuthServer": { + "Authority": "http://149.223.116.5:8066", + "AlwaysAllowAuthorization": false }, + "Redis": { "Configuration": "127.0.0.1" }, - "ReRoutes": [ - { - "DownstreamPathTemplate": "/api/identity/{everything}", - "DownstreamScheme": "http", - "DownstreamHostAndPorts": [ - { - "Host": "localhost", - "Port": 10130 - } - ], - "UpstreamPathTemplate": "/api/identity/{everything}", - "UpstreamHttpMethod": [ "Put", "Delete", "Get", "Post" ] - } - ], - "GlobalConfiguration": { - "BaseUrl": "http://localhost:10110" + + "DefaultBranchId": "3FA85F64-5717-4562-B3FC-2C963F66AFA6", + "AllowedHosts": "*", + + "ElasticSearch": { + "Url": "http://localhost:9200" }, - "Logging": { - "LogLevel": { - "Default": "Warning" + + "RemoteServices": { + "Default": { + "BaseUrl": "http://149.223.116.5:8091/", + "UseCurrentAccessToken": "true" } }, - "AllowedHosts": "*" -} + "IdentityClients": { + "Default": { + "GrantType": "client_credentials", + "ClientId": "business-app", + "ClientSecret": "1q2w3e*", + "Authority": "http://149.223.116.5:8066", + "Scope": "InternalGateway IdentityService SettleAccount" + } + } + + + +} \ No newline at end of file diff --git a/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/SettleAccountHttpApiHostMigrationsDbContextModelSnapshot.cs b/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/SettleAccountHttpApiHostMigrationsDbContextModelSnapshot.cs index 7d623205..e234a994 100644 --- a/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/SettleAccountHttpApiHostMigrationsDbContextModelSnapshot.cs +++ b/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/SettleAccountHttpApiHostMigrationsDbContextModelSnapshot.cs @@ -7889,7 +7889,6 @@ namespace Win.Sfs.SettleAccount.Migrations .HasColumnType("nvarchar(50)"); b.Property("DeliveryOrderNo") - .IsRequired() .HasMaxLength(50) .HasColumnType("nvarchar(50)"); @@ -8086,7 +8085,7 @@ namespace Win.Sfs.SettleAccount.Migrations .IsUnique() .HasFilter("IsDeleted=0"); - b.ToTable("Set_WMSSparePart_Version"); + b.ToTable("Set_SparePart_Version"); }); modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.WMS.WmsHQCarOutPut", b => @@ -8170,6 +8169,9 @@ namespace Win.Sfs.SettleAccount.Migrations .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); + b.Property("Amt") + .HasColumnType("decimal(18,2)"); + b.Property("BillNum") .IsRequired() .HasMaxLength(36) @@ -8225,6 +8227,9 @@ namespace Win.Sfs.SettleAccount.Migrations .HasDefaultValue(false) .HasColumnName("IsDeleted"); + b.Property("IsSparePart") + .HasColumnType("nvarchar(max)"); + b.Property("LastModificationTime") .HasColumnType("datetime2") .HasColumnName("LastModificationTime"); @@ -8250,10 +8255,16 @@ namespace Win.Sfs.SettleAccount.Migrations .HasMaxLength(36) .HasColumnType("nvarchar(36)"); + b.Property("OutPutQty") + .HasColumnType("decimal(18,2)"); + b.Property("ParentMaterialCode") .HasMaxLength(36) .HasColumnType("nvarchar(36)"); + b.Property("Price") + .HasColumnType("decimal(18,2)"); + b.Property("Qty") .HasColumnType("decimal(18,2)"); @@ -8771,6 +8782,9 @@ namespace Win.Sfs.SettleAccount.Migrations .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); + b.Property("Amt") + .HasColumnType("decimal(18,2)"); + b.Property("BillNum") .IsRequired() .HasMaxLength(36) @@ -8860,6 +8874,9 @@ namespace Win.Sfs.SettleAccount.Migrations .HasMaxLength(36) .HasColumnType("nvarchar(36)"); + b.Property("Price") + .HasColumnType("decimal(18,2)"); + b.Property("Qty") .HasColumnType("decimal(18,2)"); @@ -9575,6 +9592,9 @@ namespace Win.Sfs.SettleAccount.Migrations .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); + b.Property("Amt") + .HasColumnType("decimal(18,2)"); + b.Property("BillNum") .IsRequired() .HasMaxLength(36) @@ -9668,6 +9688,9 @@ namespace Win.Sfs.SettleAccount.Migrations .HasMaxLength(36) .HasColumnType("nvarchar(36)"); + b.Property("Price") + .HasColumnType("decimal(18,2)"); + b.Property("Qty") .HasColumnType("decimal(18,2)"); @@ -9782,6 +9805,9 @@ namespace Win.Sfs.SettleAccount.Migrations .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); + b.Property("Amt") + .HasColumnType("decimal(18,2)"); + b.Property("BillNum") .IsRequired() .HasMaxLength(36) @@ -9867,6 +9893,9 @@ namespace Win.Sfs.SettleAccount.Migrations .HasMaxLength(36) .HasColumnType("nvarchar(36)"); + b.Property("Price") + .HasColumnType("decimal(18,2)"); + b.Property("Qty") .HasColumnType("decimal(18,2)"); @@ -9896,6 +9925,213 @@ namespace Win.Sfs.SettleAccount.Migrations b.ToTable("Set_WmsKanbanOutPutDetial"); }); + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.WMS.WmsSharePart90OutPut", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BillNum") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("Creator") + .HasColumnType("nvarchar(max)"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + 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("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.HasIndex("BillNum"); + + b.ToTable("Set_WmsSharePart90OutPut"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.WMS.WmsSharePart90OutPutDetial", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Amt") + .HasColumnType("decimal(18,2)"); + + b.Property("BillNum") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + 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("Enabled") + .HasColumnType("bit"); + + b.Property("Extend1") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Extend2") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("InPut") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + 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("MaterialCode") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("MaterialDesc") + .HasColumnType("nvarchar(max)"); + + b.Property("MaterialGroup") + .HasColumnType("nvarchar(max)"); + + b.Property("OrderBillNum") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("OutPut") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("OutPutQty") + .HasColumnType("decimal(18,2)"); + + b.Property("ParentMaterialCode") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Price") + .HasColumnType("decimal(18,2)"); + + b.Property("Qty") + .HasColumnType("decimal(18,2)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("State") + .HasColumnType("int"); + + b.Property("StockQty") + .HasColumnType("decimal(18,2)"); + + b.Property("TaskId") + .HasColumnType("uniqueidentifier"); + + b.Property("Version") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("WmsBillNum") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.HasIndex("BillNum"); + + b.ToTable("Set_WmsSharePart90OutPutDetial"); + }); + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.WMS.WmsSharePartOutPut", b => { b.Property("Id") @@ -9977,6 +10213,9 @@ namespace Win.Sfs.SettleAccount.Migrations .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); + b.Property("Amt") + .HasColumnType("decimal(18,2)"); + b.Property("BillNum") .IsRequired() .HasMaxLength(36) @@ -10058,10 +10297,16 @@ namespace Win.Sfs.SettleAccount.Migrations .HasMaxLength(36) .HasColumnType("nvarchar(36)"); + b.Property("OutPutQty") + .HasColumnType("decimal(18,2)"); + b.Property("ParentMaterialCode") .HasMaxLength(36) .HasColumnType("nvarchar(36)"); + b.Property("Price") + .HasColumnType("decimal(18,2)"); + b.Property("Qty") .HasColumnType("decimal(18,2)"); @@ -10071,6 +10316,9 @@ namespace Win.Sfs.SettleAccount.Migrations b.Property("State") .HasColumnType("int"); + b.Property("StockQty") + .HasColumnType("decimal(18,2)"); + b.Property("TaskId") .HasColumnType("uniqueidentifier"); @@ -10091,6 +10339,189 @@ namespace Win.Sfs.SettleAccount.Migrations b.ToTable("Set_WmsSharePartOutPutDetial"); }); + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.WMS.WmsWithOutKanbanOutPut", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BillNum") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("Creator") + .HasColumnType("nvarchar(max)"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + 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("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.HasIndex("BillNum"); + + b.ToTable("Set_WmsWithOutKanbanOutPut"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.WMS.WmsWithOutKanbanOutPutDetial", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Amt") + .HasColumnType("decimal(18,2)"); + + b.Property("BillNum") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + 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("Enabled") + .HasColumnType("bit"); + + b.Property("Extend") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsBack") + .HasColumnType("nvarchar(max)"); + + 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("MaterialDesc") + .HasColumnType("nvarchar(max)"); + + b.Property("OutputQty") + .HasColumnType("decimal(18,2)"); + + b.Property("Price") + .HasColumnType("decimal(18,2)"); + + b.Property("Qty") + .HasColumnType("decimal(18,2)"); + + b.Property("RealityNumber") + .HasColumnType("decimal(18,2)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("SapMaterialCode") + .HasColumnType("nvarchar(max)"); + + b.Property("SockQty") + .HasColumnType("decimal(18,2)"); + + b.Property("State") + .HasColumnType("int"); + + b.Property("Type") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.HasIndex("BillNum"); + + b.ToTable("Set_WmsWithOutKanbanOutPutDetial"); + }); + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.WMS_KanBan.WMSKanBanSettle", b => { b.Property("Id") diff --git a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/UnSettledDetailDapperRepository.cs b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/UnSettledDetailDapperRepository.cs index df346579..ab703b23 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/UnSettledDetailDapperRepository.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/UnSettledDetailDapperRepository.cs @@ -33,11 +33,11 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report string str = " "; if (!string.IsNullOrEmpty(begin)) { - str += string.Format(" and beginTime>'{0}' ", begin); + str += string.Format(" and beginTime>='{0}' ", begin); } if (!string.IsNullOrEmpty(end)) { - str += string.Format(" and beginTime<'{0}' ", end); + str += string.Format(" and beginTime<='{0}' ", end); } //if (!string.IsNullOrEmpty(materialCode)) //{ diff --git a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/WmsOutputSumDapperRepository.cs b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/WmsOutputSumDapperRepository.cs index 78bb404f..54b9ef7d 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/WmsOutputSumDapperRepository.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/WmsOutputSumDapperRepository.cs @@ -33,6 +33,30 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report } + public class WmsOutPutSumExtend + { + [ExporterHeader(DisplayName = "客户 ")] + public string 客户 {set;get;} + [ExporterHeader(DisplayName = "出库类型")] + public string 出库类型 {set;get;} + [ExporterHeader(DisplayName = "出库单")] + public string 出库单 {set;get;} + [ExporterHeader(DisplayName = "物料号")] + public string 物料号 {set;get;} + [ExporterHeader(DisplayName = "物料描述")] + public string 物料描述 {set;get;} + [ExporterHeader(DisplayName = "出库单号")] + public string 出库单号 {set;get;} + [ExporterHeader(DisplayName = "物料组")] + public string 物料组 {set;get;} + [ExporterHeader(DisplayName = "待出库")] + public string 待出库 {set;get;} + [ExporterHeader(DisplayName = "已出库")] + public string 已出库 { set; get; } + + } + + public class WmsOutputSumDapperRepository: DapperRepository, ITransientDependency { @@ -40,6 +64,320 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report : base(dbContextProvider) { } + + public virtual List GetWmsSumExtendList(string version) + { + + var str = "SELECT\n" + + " Client 客户,\n" + + " [Type] 出库类型,\n" + + " BillNum 出库单,\n" + + " MaterialCode 物料号,\n" + + " MaterialDesc 物料描述,\n" + + " BillNum 出库单号,\n" + + " MaterialGroup 物料组,\n" + + " [1] 待出库,\n" + + " ISNULL([2], 0 ) 已出库 \n" + + "FROM\n" + + " (\n" + + " SELECT\n" + + " * \n" + + " FROM\n" + + " (\n" + + " SELECT\n" + + " temp.Client,\n" + + " temp.Type,\n" + + " temp.BillNum,\n" + + " temp.MaterialCode,\n" + + " temp2.MaterialDesc,\n" + + " temp.Qty,\n" + + " 1 STATE,\n" + + " EstimateTypeDesc MaterialGroup,\n" + + " EstimateType \n" + + " FROM\n" + + " (\n" + + " SELECT\n" + + " '大众准时化出库' AS Type,\n" + + " '大众' Client,\n" + + " BillNum,\n" + + " MaterialCode,\n" + + " SUM( Qty ) Qty \n" + + " FROM\n" + + " Set_WmsJitOutPutDetial \n" + + " WHERE\n" + + " State = 1 \n" + + " AND VERSION = '{0}' \n" + + " GROUP BY\n" + + " BillNum,\n" + + " MaterialCode UNION ALL\n" + + " SELECT\n" + + " '大众看板出库' AS Type,\n" + + " '大众' Client,\n" + + " BillNum,\n" + + " MaterialCode,\n" + + " SUM( Qty ) Qty \n" + + " FROM\n" + + " Set_WmsKanbanOutPutDetial \n" + + " WHERE\n" + + " State = 1 \n" + + " AND VERSION = '{0}' \n" + + " GROUP BY\n" + + " BillNum,\n" + + " MaterialCode UNION ALL\n" + + " SELECT\n" + + " '大众无看板出库' AS Type,\n" + + " '大众' Client,\n" + + " BillNum,\n" + + " SapMaterialCode MaterialCode,\n" + + " SUM( Qty ) Qty \n" + + " FROM\n" + + " Set_WmsWithOutKanbanOutPutDetial \n" + + " WHERE\n" + + " State = 1 \n" + + " AND VERSION = '{0}' \n" + + " GROUP BY\n" + + " BillNum,\n" + + " SapMaterialCode UNION ALL\n" + + " SELECT\n" + + " '大众备件汇总出库' AS Type,\n" + + " '大众' Client,\n" + + " BillNum,\n" + + " MaterialCode,\n" + + " SUM( Qty ) Qty \n" + + " FROM\n" + + " Set_WmsSharePartOutPutDetial \n" + + " WHERE\n" + + " State = 1 \n" + + " AND VERSION = '{0}' \n" + + " GROUP BY\n" + + " BillNum,\n" + + " MaterialCode UNION ALL\n" + + " SELECT\n" + + " '大众备件条码出库' AS Type,\n" + + " '大众' Client,\n" + + " BillNum,\n" + + " MaterialCode,\n" + + " SUM( Qty ) Qty \n" + + " FROM\n" + + " Set_WmsSharePart90OutPutDetial \n" + + " WHERE\n" + + " State = 1 \n" + + " AND VERSION = '{0}' \n" + + " GROUP BY\n" + + " BillNum,\n" + + " MaterialCode UNION ALL\n" + + " SELECT\n" + + " '红旗看板出库' AS Type,\n" + + " '红旗' Client,\n" + + " BillNum,\n" + + " MaterialCode,\n" + + " SUM( Qty ) Qty \n" + + " FROM\n" + + " Set_WmsHQHKanbanOutPutDetial \n" + + " WHERE\n" + + " State = 1 \n" + + " AND VERSION = '{0}' \n" + + " GROUP BY\n" + + " BillNum,\n" + + " MaterialCode UNION ALL\n" + + " SELECT\n" + + " '红旗看板出库' AS Type,\n" + + " '红旗' Client,\n" + + " BillNum,\n" + + " MaterialCode,\n" + + " SUM( Qty ) Qty \n" + + " FROM\n" + + " Set_WmsHQHKanbanOutPutDetial \n" + + " WHERE\n" + + " State = 1 \n" + + " AND VERSION = '{0}' \n" + + " GROUP BY\n" + + " BillNum,\n" + + " MaterialCode UNION ALL\n" + + " SELECT\n" + + " '红旗一轿手工出库' AS Type,\n" + + " '红旗' Client,\n" + + " BillNum,\n" + + " SapMaterialCode,\n" + + " SUM( Qty ) Qty \n" + + " FROM\n" + + " Set_WmsHQWithOutKanbanOutPutDetial \n" + + " WHERE\n" + + " State = 1 \n" + + " AND VERSION = '{0}' \n" + + " GROUP BY\n" + + " BillNum,\n" + + " SapMaterialCode UNION ALL\n" + + " SELECT\n" + + " '一汽奔腾轿车出库' AS Type,\n" + + " '奔腾' Client,\n" + + " BillNum,\n" + + " SapMaterialCode,\n" + + " SUM( Qty ) Qty \n" + + " FROM\n" + + " Set_WmsHQWithOutKanbanOutPutDetial \n" + + " WHERE\n" + + " State = 1 \n" + + " AND VERSION = '{0}' \n" + + " GROUP BY\n" + + " BillNum,\n" + + " SapMaterialCode \n" + + " ) temp\n" + + " LEFT JOIN ( SELECT max( Id ) Id, MaterialCode, MaterialDesc, EstimateType, EstimateTypeDesc FROM Set_material GROUP BY MaterialCode, MaterialDesc, EstimateTypeDesc, EstimateType ) temp2 ON temp.MaterialCode = temp2.MaterialCode \n" + + " ) t1 UNION ALL\n" + + " SELECT\n" + + " * \n" + + " FROM\n" + + " (\n" + + " SELECT\n" + + " temp.Client ,\n" + + " temp.Type,\n" + + " temp.BillNum,\n" + + " temp.MaterialCode,\n" + + " temp2.MaterialDesc,\n" + + " temp.Qty,\n" + + " 2 STATE,\n" + + " EstimateTypeDesc MaterialGroup,\n" + + " EstimateType \n" + + " FROM\n" + + " (\n" + + " SELECT\n" + + " '大众准时化出库' AS Type,\n" + + " '大众' Client,\n" + + " BillNum,\n" + + " MaterialCode,\n" + + " SUM( Qty ) Qty \n" + + " FROM\n" + + " Set_WmsJitOutPutDetial \n" + + " WHERE\n" + + " State = 2 \n" + + " AND VERSION = '{0}' \n" + + " GROUP BY\n" + + " BillNum,\n" + + " MaterialCode UNION ALL\n" + + " SELECT\n" + + " '大众看板出库' AS Type,\n" + + " '大众' Client,\n" + + " BillNum,\n" + + " MaterialCode,\n" + + " SUM( Qty ) Qty \n" + + " FROM\n" + + " Set_WmsKanbanOutPutDetial \n" + + " WHERE\n" + + " State = 2 \n" + + " AND VERSION = '{0}' \n" + + " GROUP BY\n" + + " BillNum,\n" + + " MaterialCode UNION ALL\n" + + " SELECT\n" + + " '大众无看板出库' AS Type,\n" + + " '大众' Client,\n" + + " BillNum,\n" + + " SapMaterialCode MaterialCode,\n" + + " SUM( Qty ) Qty \n" + + " FROM\n" + + " Set_WmsWithOutKanbanOutPutDetial \n" + + " WHERE\n" + + " State = 2 \n" + + " AND VERSION = '{0}' \n" + + " GROUP BY\n" + + " BillNum,\n" + + " SapMaterialCode UNION ALL\n" + + " SELECT\n" + + " '大众备件汇总出库' AS Type,\n" + + " '大众' Client,\n" + + " BillNum,\n" + + " MaterialCode,\n" + + " SUM( Qty ) Qty \n" + + " FROM\n" + + " Set_WmsSharePartOutPutDetial \n" + + " WHERE\n" + + " State = 2 \n" + + " AND VERSION = '{0}' \n" + + " GROUP BY\n" + + " BillNum,\n" + + " MaterialCode UNION ALL\n" + + " SELECT\n" + + " '大众备件条码出库' AS Type,\n" + + " '大众' Client,\n" + + " BillNum,\n" + + " MaterialCode,\n" + + " SUM( Qty ) Qty \n" + + " FROM\n" + + " Set_WmsSharePart90OutPutDetial \n" + + " WHERE\n" + + " State = 2 \n" + + " AND VERSION = '{0}' \n" + + " GROUP BY\n" + + " BillNum,\n" + + " MaterialCode UNION ALL\n" + + " SELECT\n" + + " '红旗看板出库' AS Type,\n" + + " '红旗' Client,\n" + + " BillNum,\n" + + " MaterialCode,\n" + + " SUM( Qty ) Qty \n" + + " FROM\n" + + " Set_WmsHQHKanbanOutPutDetial \n" + + " WHERE\n" + + " State = 2 \n" + + " AND VERSION = '{0}' \n" + + " GROUP BY\n" + + " BillNum,\n" + + " MaterialCode UNION ALL\n" + + " SELECT\n" + + " '红旗看板出库' AS Type,\n" + + " '红旗' Client,\n" + + " BillNum,\n" + + " MaterialCode,\n" + + " SUM( Qty ) Qty \n" + + " FROM\n" + + " Set_WmsHQHKanbanOutPutDetial \n" + + " WHERE\n" + + " State = 2 \n" + + " AND VERSION = '{0}' \n" + + " GROUP BY\n" + + " BillNum,\n" + + " MaterialCode UNION ALL\n" + + " SELECT\n" + + " '红旗一轿手工出库' AS Type,\n" + + " '红旗' Client,\n" + + " BillNum,\n" + + " SapMaterialCode,\n" + + " SUM( Qty ) Qty \n" + + " FROM\n" + + " Set_WmsHQWithOutKanbanOutPutDetial \n" + + " WHERE\n" + + " State = 2 \n" + + " AND VERSION = '{0}' \n" + + " GROUP BY\n" + + " BillNum,\n" + + " SapMaterialCode UNION ALL\n" + + " SELECT\n" + + " '一汽奔腾轿车出库' AS Type,\n" + + " '奔腾' Client,\n" + + " BillNum,\n" + + " SapMaterialCode,\n" + + " SUM( Qty ) Qty \n" + + " FROM\n" + + " Set_WmsHQWithOutKanbanOutPutDetial \n" + + " WHERE\n" + + " State = 2 \n" + + " AND VERSION = '{0}' \n" + + " GROUP BY\n" + + " BillNum,\n" + + " SapMaterialCode \n" + + " ) temp\n" + + " LEFT JOIN ( SELECT max( Id ) Id, MaterialCode, MaterialDesc, EstimateType, EstimateTypeDesc FROM Set_material GROUP BY MaterialCode, MaterialDesc, EstimateTypeDesc, EstimateType ) temp2 ON temp.MaterialCode = temp2.MaterialCode \n" + + " ) t2 \n" + + " ) TEMP PIVOT ( SUM( QTY ) FOR STATE IN ([1],[2]) ) A order by 客户,出库类型,出库单"; + + string _sql = string.Format(str, version); + var _query = DbConnection.Query(_sql, null, null, true, 1200, null); + return _query.ToList(); + + } + public virtual List GetWmsSumReportList(string version,string state) { diff --git a/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/UnInvoiceSettledDetailDiffExportService.cs b/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/UnInvoiceSettledDetailDiffExportService.cs index 1c03117d..5d3dffd2 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/UnInvoiceSettledDetailDiffExportService.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/UnInvoiceSettledDetailDiffExportService.cs @@ -46,6 +46,9 @@ namespace SettleAccount.Job.Services private readonly UnInvoiceSettledDetailDiffDapperRepository _dapperRepository; private readonly InvoiceSettledDetailDiffDapperRepository _dapperRepository1; + private readonly UnSettledDetailDapperRepository _dapperRepository2; + + private readonly ErpPartDapperRepository _erpdapperRepository; private readonly IBlobContainer _fileContainer; @@ -59,7 +62,8 @@ namespace SettleAccount.Job.Services UnInvoiceSettledDetailDiffDapperRepository dapperRepository, InvoiceSettledDetailDiffDapperRepository dapperRepository1, OutputService outputService, - InputService inputService + InputService inputService, + UnSettledDetailDapperRepository dapperRepository2 ) { _fileContainer = fileContainer; @@ -70,6 +74,7 @@ namespace SettleAccount.Job.Services //_versionRepository = versionRepository; _dapperRepository =dapperRepository; _dapperRepository1 = dapperRepository1; + _dapperRepository2 = dapperRepository2; } public string ExportFile(Guid id, List exportName, List p_list) @@ -174,11 +179,12 @@ namespace SettleAccount.Job.Services - var report2List = _ls1.Where(p => p.DiffPrice != 0).Select(p => new { p.MaterialGroup, DiffAmt = p.DiffPrice * p.Qty }).GroupBy(p => new { p.MaterialGroup }).Select(p => new SettleDoorPanelSumExport { MaterialGroup = p.Key.MaterialGroup, InvoiceDiffPrice = p.Sum(itm => itm.DiffAmt), Version = version }); ; - - + var report2List = _ls1.Where(p => p.DiffPrice != 0).Select(p => new { p.MaterialGroup, DiffAmt = p.DiffPrice * p.Qty }).GroupBy(p => new { p.MaterialGroup }).Select(p => new SettleDoorPanelSumExport { MaterialGroup = p.Key.MaterialGroup, InvoiceDiffPrice = p.Sum(itm => itm.DiffAmt), Version = version }); + var list1= LSettleSum(id, exportName, p_list); + var report1 = report2List.ToList(); + report1.AddRange(list1); ExcelExporter _exporter = new ExcelExporter();//导出Excel @@ -189,7 +195,7 @@ namespace SettleAccount.Job.Services .SeparateBySheet() .Append(report1List, "按物料价格差异明细表") .SeparateBySheet() - .Append(report2List.ToList(), "差异汇总验证表") + .Append(report1, "差异汇总验证表") .ExportAppendDataAsByteArray(); result.ShouldNotBeNull(); _fileContainer.SaveAsync(_filename, result.Result, true); @@ -319,20 +325,87 @@ namespace SettleAccount.Job.Services _ls = _ls.OrderBy(p => p.ChassisNumber).ThenBy(p => p.KENNCode).ThenBy(p => p.SapMaterialCode).ToList(); } - return _ls; - - //ExcelExporter _exporter = new ExcelExporter();//导出Excel - //var result = _exporter.Append(report1List.ToList(), "按物料价格差异明细表") - //.SeparateBySheet() - //.Append(report2List.ToList(), "差异汇总验证表") - //.ExportAppendDataAsByteArray(); - //result.ShouldNotBeNull(); - //_fileContainer.SaveAsync(_filename, result.Result, true); + } + public List LSettleSum(Guid id, List exportName, List p_list) + { + var _first = exportName.FirstOrDefault(); + var version = p_list.Where(p => p.Name == "Version").FirstOrDefault().Value; + var customerCode = p_list.Where(p => p.Name == "CustomerCode").FirstOrDefault().Value; + var materailCode = p_list.Where(p => p.Name == "MaterialCode").FirstOrDefault().Value; + var materialGroup = p_list.Where(p => p.Name == "MaterialGroup").FirstOrDefault().Value; + var sapcode = p_list.Where(p => p.Name == "SapMaterialCode").FirstOrDefault().Value; + var begin = p_list.Where(p => p.Name == "Begin").FirstOrDefault().Value; + var end = p_list.Where(p => p.Name == "End").FirstOrDefault().Value; + var kenncode = p_list.Where(p => p.Name == "KennCode").FirstOrDefault().Value; + var chassisNumber = p_list.Where(p => p.Name == "ChassisNumber").FirstOrDefault().Value; + var sapCode = p_list.Where(p => p.Name == "SapCode").FirstOrDefault().Value; - // _outputService.Export(id, string.Format("大众准时化结算门板价格差异比对报表_{0}.xlsx", Guid.NewGuid().ToString()), _list); + //var cp7begin = p_list.Where(p => p.Name == "CP7Begin").FirstOrDefault().Value; + //var cp7end = p_list.Where(p => p.Name == "CP7End").FirstOrDefault().Value; + + begin = version.Substring(0, 4) + "-" + version.Substring(version.Length - 2) + "-01 00:00:00"; + var _beginstr = version.Substring(0, 4) + "-" + version.Substring(version.Length - 2) + "-01"; + var _end = DateTime.Parse(_beginstr).AddMonths(1).AddDays(-1); + end=_end.ToString("yyyy-MM-dd")+" 23:59:59"; + + var _list = _dapperRepository2.GetDiffReport(DateTime.Now.Year.ToString(), begin, end, customerCode, version, materailCode, materialGroup, sapcode); + var _ls = _list.Where(p => p.Flag == "L").Where(p => p.ParentSapMaterialCode != p.SapMaterialCode).GroupBy(p => new { p.KENNCode, p.ChassisNumber, p.ParentSapMaterialCode }).Select(p => p.FirstOrDefault()).ToList(); + //var _lst = _erpDapper.GetSapList(_ls, version, false); + //_lst.ForEach(p => + //{ + + // p.Qty = 1; + // p.DiffAMT = Math.Round(p.Qty * p.Price, 2); + // p.DiffQty = 1; + //} + //); + //_list.AddRange(_lst); + if (!string.IsNullOrEmpty(materialGroup)) + { + var _groupList = materialGroup.Split(new char[] { ',' }).Distinct().ToList(); + if (_groupList.Count() > 0) + { + _list = _list.Where(p => _groupList.Contains(p.MaterialGroup)).ToList(); + } + } + if (!string.IsNullOrEmpty(kenncode)) + { + var _groupList = kenncode.Split(new char[] { '\n' }).Distinct().ToList(); + if (_groupList.Count() > 0) + { + _list = _list.Where(p => _groupList.Contains(p.KENNCode)).ToList(); + } + } + if (!string.IsNullOrEmpty(chassisNumber)) + { + var _groupList = chassisNumber.Split(new char[] { '\n' }).Distinct().ToList(); + if (_groupList.Count() > 0) + { + _list = _list.Where(p => _groupList.Contains(p.ChassisNumber)).ToList(); + } + } + if (!string.IsNullOrEmpty(sapCode)) + { + var _groupList = sapCode.Split(new char[] { '\n' }).Distinct().ToList(); + if (_groupList.Count() > 0) + { + _list = _list.Where(p => _groupList.Contains(p.SapMaterialCode)).ToList(); + } + } + if (!string.IsNullOrEmpty(materailCode)) + { + var _groupList = materailCode.Split(new char[] { '\n' }).Distinct().ToList(); + if (_groupList.Count() > 0) + { + _list = _list.Where(p => _groupList.Contains(p.SapMaterialCode)).ToList(); + } + } + _list = _list.OrderBy(p => p.ChassisNumber).ThenBy(p => p.SapMaterialCode).ThenBy(p => p.Flag).ToList(); + var report2List = _list.Select(p => new { p.MaterialGroup, DiffAmt = p.Price * p.Qty }).GroupBy(p => new { p.MaterialGroup }).Select(p => new SettleDoorPanelSumExport { MaterialGroup = p.Key.MaterialGroup, InvoiceDiffPrice = p.Sum(itm => itm.DiffAmt), Version = version }); + return report2List.ToList(); } diff --git a/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/WmsOutputSumExportService.cs b/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/WmsOutputSumExportService.cs index 9e4d2160..b733e542 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/WmsOutputSumExportService.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/WmsOutputSumExportService.cs @@ -1,4 +1,6 @@ using Magicodes.ExporterAndImporter.Core; +using Magicodes.ExporterAndImporter.Excel; +using Shouldly; using System; using System.Collections.Generic; using System.Linq; @@ -6,7 +8,9 @@ using System.Text; using System.Threading.Tasks; using TaskJob.EventArgs; using TaskJob.Interfaces; +using Volo.Abp.BlobStoring; using Volo.Abp.DependencyInjection; +using Win.Sfs.BaseData.ImportExcelCommon; using Win.Sfs.SettleAccount.Reports.InvoiceSettledDiffs; using Win.Sfs.SettleAccount.Repository.SettleAccount; using Win.Sfs.SettleAccount.Repository.SettleAccountJob; @@ -39,15 +43,19 @@ namespace SettleAccount.Job.Services.Report private readonly WmsOutputSumDapperRepository _dapperRepository; private readonly OutputService _outputService; private readonly InputService _inputService; + private readonly IBlobContainer _fileContainer; public WmsOutputSumExportService( WmsOutputSumDapperRepository dapperRepository, OutputService outputService, - InputService inputService + InputService inputService, + IBlobContainer fileContainer + ) { _inputService = inputService; _outputService = outputService; _dapperRepository = dapperRepository; + _fileContainer = fileContainer; } @@ -58,6 +66,9 @@ namespace SettleAccount.Job.Services.Report var materialGroup = p_list.Where(p => p.Name == "MaterialGroup").FirstOrDefault().Value; var state = p_list.Where(p => p.Name == "State").FirstOrDefault().Value; var _ls= _dapperRepository.GetWmsSumReportList(version, state); + + var _lst = _dapperRepository.GetWmsSumExtendList(version); + if (!string.IsNullOrEmpty(materialGroup)) { var _groupList = materialGroup.Split(new char[] { ',' }).Distinct().ToList(); @@ -74,8 +85,16 @@ namespace SettleAccount.Job.Services.Report _ls = _ls.Where(p => _groupList.Contains(p.MaterialCode)).ToList(); } } + var _first = exportName.FirstOrDefault(); - _outputService.Export(id,_first, _ls); + ExcelExporter _exporter = new ExcelExporter();//导出Excel + var result = _exporter.Append(_ls.ToList(), "汇总表") + .SeparateBySheet() + .Append(_lst.ToList(), "完成清单表") + .ExportAppendDataAsByteArray(); + result.ShouldNotBeNull(); + _fileContainer.SaveAsync(_first, result.Result, true); + return id.ToString(); ; }