yunfeng.liu
2 years ago
127 changed files with 19698 additions and 2604 deletions
@ -0,0 +1,523 @@ |
|||
2022-04-24 16:20:13.897 G Starting web host. |
|||
2022-04-24 16:20:23.904 G User profile is available. Using '"C:\Users\Administrator\AppData\Local\ASP.NET\DataProtection-Keys"' as key repository and Windows DPAPI to encrypt keys at rest. |
|||
2022-04-24 16:20:24.032 G Loaded ABP modules: |
|||
2022-04-24 16:20:24.035 G - Win.Sfs.SettleAccount.SettleAccountHttpApiHostModule |
|||
2022-04-24 16:20:24.035 G - Win.Sfs.SettleAccount.SettleAccountApplicationModule |
|||
2022-04-24 16:20:24.036 G - Win.Sfs.SettleAccount.SettleAccountJobModule |
|||
2022-04-24 16:20:24.037 G - Win.Sfs.SettleAccount.SettleAccountDomainModule |
|||
2022-04-24 16:20:24.038 G - Volo.Abp.Domain.AbpDddDomainModule |
|||
2022-04-24 16:20:24.038 G - Volo.Abp.Auditing.AbpAuditingModule |
|||
2022-04-24 16:20:24.039 G - Volo.Abp.Data.AbpDataModule |
|||
2022-04-24 16:20:24.040 G - Volo.Abp.ObjectExtending.AbpObjectExtendingModule |
|||
2022-04-24 16:20:24.040 G - Volo.Abp.Localization.AbpLocalizationAbstractionsModule |
|||
2022-04-24 16:20:24.041 G - Volo.Abp.Validation.AbpValidationAbstractionsModule |
|||
2022-04-24 16:20:24.041 G - Volo.Abp.Uow.AbpUnitOfWorkModule |
|||
2022-04-24 16:20:24.042 G - Volo.Abp.EventBus.Abstractions.AbpEventBusAbstractionsModule |
|||
2022-04-24 16:20:24.043 G - Volo.Abp.Json.AbpJsonModule |
|||
2022-04-24 16:20:24.044 G - Volo.Abp.Timing.AbpTimingModule |
|||
2022-04-24 16:20:24.044 G - Volo.Abp.Localization.AbpLocalizationModule |
|||
2022-04-24 16:20:24.045 G - Volo.Abp.VirtualFileSystem.AbpVirtualFileSystemModule |
|||
2022-04-24 16:20:24.046 G - Volo.Abp.Settings.AbpSettingsModule |
|||
2022-04-24 16:20:24.046 G - Volo.Abp.Security.AbpSecurityModule |
|||
2022-04-24 16:20:24.047 G - Volo.Abp.MultiTenancy.AbpMultiTenancyModule |
|||
2022-04-24 16:20:24.048 G - Volo.Abp.Threading.AbpThreadingModule |
|||
2022-04-24 16:20:24.048 G - Volo.Abp.EventBus.AbpEventBusModule |
|||
2022-04-24 16:20:24.049 G - Volo.Abp.Guids.AbpGuidsModule |
|||
2022-04-24 16:20:24.050 G - Volo.Abp.ObjectMapping.AbpObjectMappingModule |
|||
2022-04-24 16:20:24.051 G - Volo.Abp.ExceptionHandling.AbpExceptionHandlingModule |
|||
2022-04-24 16:20:24.052 G - Volo.Abp.Specifications.AbpSpecificationsModule |
|||
2022-04-24 16:20:24.052 G - Win.Sfs.SettleAccount.SettleAccountDomainSharedModule |
|||
2022-04-24 16:20:24.053 G - Volo.Abp.Validation.AbpValidationModule |
|||
2022-04-24 16:20:24.054 G - Win.Sfs.SettleAccount.SettleAccountApplicationContractsModule |
|||
2022-04-24 16:20:24.055 G - Volo.Abp.Application.AbpDddApplicationContractsModule |
|||
2022-04-24 16:20:24.056 G - Volo.Abp.Authorization.AbpAuthorizationModule |
|||
2022-04-24 16:20:24.056 G - Volo.Abp.Authorization.AbpAuthorizationAbstractionsModule |
|||
2022-04-24 16:20:24.057 G - Volo.Abp.AutoMapper.AbpAutoMapperModule |
|||
2022-04-24 16:20:24.058 G - Volo.Abp.Dapper.AbpDapperModule |
|||
2022-04-24 16:20:24.058 G - Volo.Abp.EntityFrameworkCore.AbpEntityFrameworkCoreModule |
|||
2022-04-24 16:20:24.059 G - Win.Abp.Snowflakes.AbpSnowflakeGeneratorModule |
|||
2022-04-24 16:20:24.060 G - Volo.Abp.Http.Client.IdentityModel.AbpHttpClientIdentityModelModule |
|||
2022-04-24 16:20:24.061 G - Volo.Abp.Http.Client.AbpHttpClientModule |
|||
2022-04-24 16:20:24.062 G - Volo.Abp.Http.AbpHttpModule |
|||
2022-04-24 16:20:24.062 G - Volo.Abp.Http.AbpHttpAbstractionsModule |
|||
2022-04-24 16:20:24.063 G - Volo.Abp.Minify.AbpMinifyModule |
|||
2022-04-24 16:20:24.064 G - Volo.Abp.Castle.AbpCastleCoreModule |
|||
2022-04-24 16:20:24.064 G - Volo.Abp.IdentityModel.AbpIdentityModelModule |
|||
2022-04-24 16:20:24.066 G - Volo.Abp.Caching.AbpCachingModule |
|||
2022-04-24 16:20:24.067 G - Volo.Abp.Serialization.AbpSerializationModule |
|||
2022-04-24 16:20:24.068 G - Volo.Abp.Identity.AbpIdentityHttpApiClientModule |
|||
2022-04-24 16:20:24.068 G - Volo.Abp.Identity.AbpIdentityApplicationContractsModule |
|||
2022-04-24 16:20:24.069 G - Volo.Abp.Identity.AbpIdentityDomainSharedModule |
|||
2022-04-24 16:20:24.070 G - Volo.Abp.Users.AbpUsersDomainSharedModule |
|||
2022-04-24 16:20:24.071 G - Volo.Abp.Features.AbpFeaturesModule |
|||
2022-04-24 16:20:24.072 G - Volo.Abp.Users.AbpUsersAbstractionModule |
|||
2022-04-24 16:20:24.073 G - Volo.Abp.Application.AbpDddApplicationModule |
|||
2022-04-24 16:20:24.073 G - Volo.Abp.GlobalFeatures.AbpGlobalFeaturesModule |
|||
2022-04-24 16:20:24.074 G - Volo.Abp.PermissionManagement.AbpPermissionManagementApplicationContractsModule |
|||
2022-04-24 16:20:24.075 G - Volo.Abp.PermissionManagement.AbpPermissionManagementDomainSharedModule |
|||
2022-04-24 16:20:24.076 G - Volo.Abp.AspNetCore.Mvc.AbpAspNetCoreMvcModule |
|||
2022-04-24 16:20:24.076 G - Volo.Abp.AspNetCore.AbpAspNetCoreModule |
|||
2022-04-24 16:20:24.077 G - Volo.Abp.ApiVersioning.AbpApiVersioningAbstractionsModule |
|||
2022-04-24 16:20:24.078 G - Volo.Abp.AspNetCore.Mvc.AbpAspNetCoreMvcContractsModule |
|||
2022-04-24 16:20:24.079 G - Volo.Abp.UI.Navigation.AbpUiNavigationModule |
|||
2022-04-24 16:20:24.079 G - Volo.Abp.UI.AbpUiModule |
|||
2022-04-24 16:20:24.080 G - Win.Sfs.SettleAccount.SettleAccountEntityFrameworkCoreModule |
|||
2022-04-24 16:20:24.081 G - Volo.Abp.PermissionManagement.EntityFrameworkCore.AbpPermissionManagementEntityFrameworkCoreModule |
|||
2022-04-24 16:20:24.082 G - Volo.Abp.PermissionManagement.AbpPermissionManagementDomainModule |
|||
2022-04-24 16:20:24.083 G - Volo.Abp.SettingManagement.EntityFrameworkCore.AbpSettingManagementEntityFrameworkCoreModule |
|||
2022-04-24 16:20:24.084 G - Volo.Abp.SettingManagement.AbpSettingManagementDomainModule |
|||
2022-04-24 16:20:24.084 G - Volo.Abp.SettingManagement.AbpSettingManagementDomainSharedModule |
|||
2022-04-24 16:20:24.085 G - Volo.Abp.AuditLogging.EntityFrameworkCore.AbpAuditLoggingEntityFrameworkCoreModule |
|||
2022-04-24 16:20:24.086 G - Volo.Abp.AuditLogging.AbpAuditLoggingDomainModule |
|||
2022-04-24 16:20:24.087 G - Volo.Abp.AuditLogging.AbpAuditLoggingDomainSharedModule |
|||
2022-04-24 16:20:24.088 G - Volo.Abp.TenantManagement.EntityFrameworkCore.AbpTenantManagementEntityFrameworkCoreModule |
|||
2022-04-24 16:20:24.088 G - Volo.Abp.TenantManagement.AbpTenantManagementDomainModule |
|||
2022-04-24 16:20:24.089 G - Volo.Abp.TenantManagement.AbpTenantManagementDomainSharedModule |
|||
2022-04-24 16:20:24.090 G - Win.Sfs.SettleAccount.SettleAccountHttpApiModule |
|||
2022-04-24 16:20:24.091 G - Volo.Abp.Autofac.AbpAutofacModule |
|||
2022-04-24 16:20:24.091 G - Volo.Abp.EntityFrameworkCore.SqlServer.AbpEntityFrameworkCoreSqlServerModule |
|||
2022-04-24 16:20:24.092 G - Volo.Abp.AspNetCore.Serilog.AbpAspNetCoreSerilogModule |
|||
2022-04-24 16:20:24.093 G - Volo.Abp.BlobStoring.AbpBlobStoringModule |
|||
2022-04-24 16:20:24.094 G - Volo.Abp.BlobStoring.FileSystem.AbpBlobStoringFileSystemModule |
|||
2022-04-24 16:20:24.095 G - Volo.Abp.BackgroundJobs.Hangfire.AbpBackgroundJobsHangfireModule |
|||
2022-04-24 16:20:24.095 G - Volo.Abp.BackgroundJobs.AbpBackgroundJobsAbstractionsModule |
|||
2022-04-24 16:20:24.096 G - Volo.Abp.Hangfire.AbpHangfireModule |
|||
2022-04-24 16:20:24.176 G Start installing Hangfire SQL objects... |
|||
2022-04-24 16:20:24.424 G Hangfire SQL objects installed. |
|||
2022-04-24 16:20:24.441 G Starting Hangfire Server using job storage: 'SQL Server: 127.0.0.1@SettleAccountService' |
|||
2022-04-24 16:20:24.442 G Using the following options for SQL Server job storage: Queue poll interval: 00:00:15. |
|||
2022-04-24 16:20:24.443 G Using the following options for Hangfire Server: |
|||
Worker count: 20 |
|||
Listening queues: 'default' |
|||
Shutdown timeout: 00:00:15 |
|||
Schedule polling interval: 00:00:15 |
|||
2022-04-24 16:20:24.493 G Starting Hangfire Server using job storage: 'SQL Server: 127.0.0.1@SettleAccountService' |
|||
2022-04-24 16:20:24.494 G Using the following options for SQL Server job storage: Queue poll interval: 00:00:15. |
|||
2022-04-24 16:20:24.495 G Using the following options for Hangfire Server: |
|||
Worker count: 20 |
|||
Listening queues: 'default' |
|||
Shutdown timeout: 00:00:15 |
|||
Schedule polling interval: 00:00:15 |
|||
2022-04-24 16:20:24.758 G Server win102022ptzdgh:26740:9f92a7a1 successfully announced in 288.749 ms |
|||
2022-04-24 16:20:24.758 G Server win102022ptzdgh:26740:03c52206 successfully announced in 257.985 ms |
|||
2022-04-24 16:20:24.775 G Server win102022ptzdgh:26740:9f92a7a1 is starting the registered dispatchers: ServerWatchdog, ServerJobCancellationWatcher, ExpirationManager, CountersAggregator, Worker, DelayedJobScheduler, RecurringJobScheduler... |
|||
2022-04-24 16:20:24.775 G Server win102022ptzdgh:26740:03c52206 is starting the registered dispatchers: ServerWatchdog, ServerJobCancellationWatcher, ExpirationManager, CountersAggregator, Worker, DelayedJobScheduler, RecurringJobScheduler... |
|||
2022-04-24 16:20:24.800 G 2 servers were removed due to timeout |
|||
2022-04-24 16:20:24.995 G Server win102022ptzdgh:26740:9f92a7a1 all the dispatchers started |
|||
2022-04-24 16:20:25.037 G Server win102022ptzdgh:26740:03c52206 all the dispatchers started |
|||
2022-04-24 16:20:26.694 G Entity Framework Core "5.0.8" initialized '"PermissionManagementDbContext"' using provider '"Microsoft.EntityFrameworkCore.SqlServer"' with options: "QuerySplittingBehavior=SplitQuery " |
|||
2022-04-24 16:20:27.118 G Executed DbCommand ("53"ms) [Parameters=["@__ef_filter__p_0='?' (DbType = Boolean), @__name_0='?' (Size = 128), @__providerName_1='?' (Size = 64), @__providerKey_2='?' (Size = 64)"], CommandType='Text', CommandTimeout='30']" |
|||
""SELECT TOP(1) [a].[Id], [a].[Name], [a].[ProviderKey], [a].[ProviderName], [a].[TenantId] |
|||
FROM [AbpPermissionGrants] AS [a] |
|||
WHERE ((@__ef_filter__p_0 = CAST(1 AS bit)) OR [a].[TenantId] IS NULL) AND ((([a].[Name] = @__name_0) AND ([a].[ProviderName] = @__providerName_1)) AND ([a].[ProviderKey] = @__providerKey_2)) |
|||
ORDER BY [a].[Id]" |
|||
2022-04-24 16:20:27.234 G Executed DbCommand ("3"ms) [Parameters=["@__ef_filter__p_0='?' (DbType = Boolean), @__name_0='?' (Size = 128), @__providerName_1='?' (Size = 64), @__providerKey_2='?' (Size = 64)"], CommandType='Text', CommandTimeout='30']" |
|||
""SELECT TOP(1) [a].[Id], [a].[Name], [a].[ProviderKey], [a].[ProviderName], [a].[TenantId] |
|||
FROM [AbpPermissionGrants] AS [a] |
|||
WHERE ((@__ef_filter__p_0 = CAST(1 AS bit)) OR [a].[TenantId] IS NULL) AND ((([a].[Name] = @__name_0) AND ([a].[ProviderName] = @__providerName_1)) AND ([a].[ProviderKey] = @__providerKey_2)) |
|||
ORDER BY [a].[Id]" |
|||
2022-04-24 16:20:27.239 G Executed DbCommand ("1"ms) [Parameters=["@__ef_filter__p_0='?' (DbType = Boolean), @__name_0='?' (Size = 128), @__providerName_1='?' (Size = 64), @__providerKey_2='?' (Size = 64)"], CommandType='Text', CommandTimeout='30']" |
|||
""SELECT TOP(1) [a].[Id], [a].[Name], [a].[ProviderKey], [a].[ProviderName], [a].[TenantId] |
|||
FROM [AbpPermissionGrants] AS [a] |
|||
WHERE ((@__ef_filter__p_0 = CAST(1 AS bit)) OR [a].[TenantId] IS NULL) AND ((([a].[Name] = @__name_0) AND ([a].[ProviderName] = @__providerName_1)) AND ([a].[ProviderKey] = @__providerKey_2)) |
|||
ORDER BY [a].[Id]" |
|||
2022-04-24 16:20:27.243 G Executed DbCommand ("1"ms) [Parameters=["@__ef_filter__p_0='?' (DbType = Boolean), @__name_0='?' (Size = 128), @__providerName_1='?' (Size = 64), @__providerKey_2='?' (Size = 64)"], CommandType='Text', CommandTimeout='30']" |
|||
""SELECT TOP(1) [a].[Id], [a].[Name], [a].[ProviderKey], [a].[ProviderName], [a].[TenantId] |
|||
FROM [AbpPermissionGrants] AS [a] |
|||
WHERE ((@__ef_filter__p_0 = CAST(1 AS bit)) OR [a].[TenantId] IS NULL) AND ((([a].[Name] = @__name_0) AND ([a].[ProviderName] = @__providerName_1)) AND ([a].[ProviderKey] = @__providerKey_2)) |
|||
ORDER BY [a].[Id]" |
|||
2022-04-24 16:20:27.248 G Executed DbCommand ("1"ms) [Parameters=["@__ef_filter__p_0='?' (DbType = Boolean), @__name_0='?' (Size = 128), @__providerName_1='?' (Size = 64), @__providerKey_2='?' (Size = 64)"], CommandType='Text', CommandTimeout='30']" |
|||
""SELECT TOP(1) [a].[Id], [a].[Name], [a].[ProviderKey], [a].[ProviderName], [a].[TenantId] |
|||
FROM [AbpPermissionGrants] AS [a] |
|||
WHERE ((@__ef_filter__p_0 = CAST(1 AS bit)) OR [a].[TenantId] IS NULL) AND ((([a].[Name] = @__name_0) AND ([a].[ProviderName] = @__providerName_1)) AND ([a].[ProviderKey] = @__providerKey_2)) |
|||
ORDER BY [a].[Id]" |
|||
2022-04-24 16:20:27.252 G Executed DbCommand ("1"ms) [Parameters=["@__ef_filter__p_0='?' (DbType = Boolean), @__name_0='?' (Size = 128), @__providerName_1='?' (Size = 64), @__providerKey_2='?' (Size = 64)"], CommandType='Text', CommandTimeout='30']" |
|||
""SELECT TOP(1) [a].[Id], [a].[Name], [a].[ProviderKey], [a].[ProviderName], [a].[TenantId] |
|||
FROM [AbpPermissionGrants] AS [a] |
|||
WHERE ((@__ef_filter__p_0 = CAST(1 AS bit)) OR [a].[TenantId] IS NULL) AND ((([a].[Name] = @__name_0) AND ([a].[ProviderName] = @__providerName_1)) AND ([a].[ProviderKey] = @__providerKey_2)) |
|||
ORDER BY [a].[Id]" |
|||
2022-04-24 16:20:27.256 G Executed DbCommand ("1"ms) [Parameters=["@__ef_filter__p_0='?' (DbType = Boolean), @__name_0='?' (Size = 128), @__providerName_1='?' (Size = 64), @__providerKey_2='?' (Size = 64)"], CommandType='Text', CommandTimeout='30']" |
|||
""SELECT TOP(1) [a].[Id], [a].[Name], [a].[ProviderKey], [a].[ProviderName], [a].[TenantId] |
|||
FROM [AbpPermissionGrants] AS [a] |
|||
WHERE ((@__ef_filter__p_0 = CAST(1 AS bit)) OR [a].[TenantId] IS NULL) AND ((([a].[Name] = @__name_0) AND ([a].[ProviderName] = @__providerName_1)) AND ([a].[ProviderKey] = @__providerKey_2)) |
|||
ORDER BY [a].[Id]" |
|||
2022-04-24 16:20:27.260 G Executed DbCommand ("1"ms) [Parameters=["@__ef_filter__p_0='?' (DbType = Boolean), @__name_0='?' (Size = 128), @__providerName_1='?' (Size = 64), @__providerKey_2='?' (Size = 64)"], CommandType='Text', CommandTimeout='30']" |
|||
""SELECT TOP(1) [a].[Id], [a].[Name], [a].[ProviderKey], [a].[ProviderName], [a].[TenantId] |
|||
FROM [AbpPermissionGrants] AS [a] |
|||
WHERE ((@__ef_filter__p_0 = CAST(1 AS bit)) OR [a].[TenantId] IS NULL) AND ((([a].[Name] = @__name_0) AND ([a].[ProviderName] = @__providerName_1)) AND ([a].[ProviderKey] = @__providerKey_2)) |
|||
ORDER BY [a].[Id]" |
|||
2022-04-24 16:20:27.264 G Executed DbCommand ("1"ms) [Parameters=["@__ef_filter__p_0='?' (DbType = Boolean), @__name_0='?' (Size = 128), @__providerName_1='?' (Size = 64), @__providerKey_2='?' (Size = 64)"], CommandType='Text', CommandTimeout='30']" |
|||
""SELECT TOP(1) [a].[Id], [a].[Name], [a].[ProviderKey], [a].[ProviderName], [a].[TenantId] |
|||
FROM [AbpPermissionGrants] AS [a] |
|||
WHERE ((@__ef_filter__p_0 = CAST(1 AS bit)) OR [a].[TenantId] IS NULL) AND ((([a].[Name] = @__name_0) AND ([a].[ProviderName] = @__providerName_1)) AND ([a].[ProviderKey] = @__providerKey_2)) |
|||
ORDER BY [a].[Id]" |
|||
2022-04-24 16:20:27.268 G Executed DbCommand ("1"ms) [Parameters=["@__ef_filter__p_0='?' (DbType = Boolean), @__name_0='?' (Size = 128), @__providerName_1='?' (Size = 64), @__providerKey_2='?' (Size = 64)"], CommandType='Text', CommandTimeout='30']" |
|||
""SELECT TOP(1) [a].[Id], [a].[Name], [a].[ProviderKey], [a].[ProviderName], [a].[TenantId] |
|||
FROM [AbpPermissionGrants] AS [a] |
|||
WHERE ((@__ef_filter__p_0 = CAST(1 AS bit)) OR [a].[TenantId] IS NULL) AND ((([a].[Name] = @__name_0) AND ([a].[ProviderName] = @__providerName_1)) AND ([a].[ProviderKey] = @__providerKey_2)) |
|||
ORDER BY [a].[Id]" |
|||
2022-04-24 16:20:27.273 G Executed DbCommand ("1"ms) [Parameters=["@__ef_filter__p_0='?' (DbType = Boolean), @__name_0='?' (Size = 128), @__providerName_1='?' (Size = 64), @__providerKey_2='?' (Size = 64)"], CommandType='Text', CommandTimeout='30']" |
|||
""SELECT TOP(1) [a].[Id], [a].[Name], [a].[ProviderKey], [a].[ProviderName], [a].[TenantId] |
|||
FROM [AbpPermissionGrants] AS [a] |
|||
WHERE ((@__ef_filter__p_0 = CAST(1 AS bit)) OR [a].[TenantId] IS NULL) AND ((([a].[Name] = @__name_0) AND ([a].[ProviderName] = @__providerName_1)) AND ([a].[ProviderKey] = @__providerKey_2)) |
|||
ORDER BY [a].[Id]" |
|||
2022-04-24 16:20:27.276 G Executed DbCommand ("1"ms) [Parameters=["@__ef_filter__p_0='?' (DbType = Boolean), @__name_0='?' (Size = 128), @__providerName_1='?' (Size = 64), @__providerKey_2='?' (Size = 64)"], CommandType='Text', CommandTimeout='30']" |
|||
""SELECT TOP(1) [a].[Id], [a].[Name], [a].[ProviderKey], [a].[ProviderName], [a].[TenantId] |
|||
FROM [AbpPermissionGrants] AS [a] |
|||
WHERE ((@__ef_filter__p_0 = CAST(1 AS bit)) OR [a].[TenantId] IS NULL) AND ((([a].[Name] = @__name_0) AND ([a].[ProviderName] = @__providerName_1)) AND ([a].[ProviderKey] = @__providerKey_2)) |
|||
ORDER BY [a].[Id]" |
|||
2022-04-24 16:20:27.281 G Executed DbCommand ("2"ms) [Parameters=["@__ef_filter__p_0='?' (DbType = Boolean), @__name_0='?' (Size = 128), @__providerName_1='?' (Size = 64), @__providerKey_2='?' (Size = 64)"], CommandType='Text', CommandTimeout='30']" |
|||
""SELECT TOP(1) [a].[Id], [a].[Name], [a].[ProviderKey], [a].[ProviderName], [a].[TenantId] |
|||
FROM [AbpPermissionGrants] AS [a] |
|||
WHERE ((@__ef_filter__p_0 = CAST(1 AS bit)) OR [a].[TenantId] IS NULL) AND ((([a].[Name] = @__name_0) AND ([a].[ProviderName] = @__providerName_1)) AND ([a].[ProviderKey] = @__providerKey_2)) |
|||
ORDER BY [a].[Id]" |
|||
2022-04-24 16:20:27.287 G Executed DbCommand ("2"ms) [Parameters=["@__ef_filter__p_0='?' (DbType = Boolean), @__name_0='?' (Size = 128), @__providerName_1='?' (Size = 64), @__providerKey_2='?' (Size = 64)"], CommandType='Text', CommandTimeout='30']" |
|||
""SELECT TOP(1) [a].[Id], [a].[Name], [a].[ProviderKey], [a].[ProviderName], [a].[TenantId] |
|||
FROM [AbpPermissionGrants] AS [a] |
|||
WHERE ((@__ef_filter__p_0 = CAST(1 AS bit)) OR [a].[TenantId] IS NULL) AND ((([a].[Name] = @__name_0) AND ([a].[ProviderName] = @__providerName_1)) AND ([a].[ProviderKey] = @__providerKey_2)) |
|||
ORDER BY [a].[Id]" |
|||
2022-04-24 16:20:27.294 G Executed DbCommand ("2"ms) [Parameters=["@__ef_filter__p_0='?' (DbType = Boolean), @__name_0='?' (Size = 128), @__providerName_1='?' (Size = 64), @__providerKey_2='?' (Size = 64)"], CommandType='Text', CommandTimeout='30']" |
|||
""SELECT TOP(1) [a].[Id], [a].[Name], [a].[ProviderKey], [a].[ProviderName], [a].[TenantId] |
|||
FROM [AbpPermissionGrants] AS [a] |
|||
WHERE ((@__ef_filter__p_0 = CAST(1 AS bit)) OR [a].[TenantId] IS NULL) AND ((([a].[Name] = @__name_0) AND ([a].[ProviderName] = @__providerName_1)) AND ([a].[ProviderKey] = @__providerKey_2)) |
|||
ORDER BY [a].[Id]" |
|||
2022-04-24 16:20:27.301 G Executed DbCommand ("2"ms) [Parameters=["@__ef_filter__p_0='?' (DbType = Boolean), @__name_0='?' (Size = 128), @__providerName_1='?' (Size = 64), @__providerKey_2='?' (Size = 64)"], CommandType='Text', CommandTimeout='30']" |
|||
""SELECT TOP(1) [a].[Id], [a].[Name], [a].[ProviderKey], [a].[ProviderName], [a].[TenantId] |
|||
FROM [AbpPermissionGrants] AS [a] |
|||
WHERE ((@__ef_filter__p_0 = CAST(1 AS bit)) OR [a].[TenantId] IS NULL) AND ((([a].[Name] = @__name_0) AND ([a].[ProviderName] = @__providerName_1)) AND ([a].[ProviderKey] = @__providerKey_2)) |
|||
ORDER BY [a].[Id]" |
|||
2022-04-24 16:20:27.314 G Executed DbCommand ("2"ms) [Parameters=["@__ef_filter__p_0='?' (DbType = Boolean), @__name_0='?' (Size = 128), @__providerName_1='?' (Size = 64), @__providerKey_2='?' (Size = 64)"], CommandType='Text', CommandTimeout='30']" |
|||
""SELECT TOP(1) [a].[Id], [a].[Name], [a].[ProviderKey], [a].[ProviderName], [a].[TenantId] |
|||
FROM [AbpPermissionGrants] AS [a] |
|||
WHERE ((@__ef_filter__p_0 = CAST(1 AS bit)) OR [a].[TenantId] IS NULL) AND ((([a].[Name] = @__name_0) AND ([a].[ProviderName] = @__providerName_1)) AND ([a].[ProviderKey] = @__providerKey_2)) |
|||
ORDER BY [a].[Id]" |
|||
2022-04-24 16:20:27.323 G Executed DbCommand ("2"ms) [Parameters=["@__ef_filter__p_0='?' (DbType = Boolean), @__name_0='?' (Size = 128), @__providerName_1='?' (Size = 64), @__providerKey_2='?' (Size = 64)"], CommandType='Text', CommandTimeout='30']" |
|||
""SELECT TOP(1) [a].[Id], [a].[Name], [a].[ProviderKey], [a].[ProviderName], [a].[TenantId] |
|||
FROM [AbpPermissionGrants] AS [a] |
|||
WHERE ((@__ef_filter__p_0 = CAST(1 AS bit)) OR [a].[TenantId] IS NULL) AND ((([a].[Name] = @__name_0) AND ([a].[ProviderName] = @__providerName_1)) AND ([a].[ProviderKey] = @__providerKey_2)) |
|||
ORDER BY [a].[Id]" |
|||
2022-04-24 16:20:27.336 G Executed DbCommand ("2"ms) [Parameters=["@__ef_filter__p_0='?' (DbType = Boolean), @__name_0='?' (Size = 128), @__providerName_1='?' (Size = 64), @__providerKey_2='?' (Size = 64)"], CommandType='Text', CommandTimeout='30']" |
|||
""SELECT TOP(1) [a].[Id], [a].[Name], [a].[ProviderKey], [a].[ProviderName], [a].[TenantId] |
|||
FROM [AbpPermissionGrants] AS [a] |
|||
WHERE ((@__ef_filter__p_0 = CAST(1 AS bit)) OR [a].[TenantId] IS NULL) AND ((([a].[Name] = @__name_0) AND ([a].[ProviderName] = @__providerName_1)) AND ([a].[ProviderKey] = @__providerKey_2)) |
|||
ORDER BY [a].[Id]" |
|||
2022-04-24 16:20:27.342 G Executed DbCommand ("2"ms) [Parameters=["@__ef_filter__p_0='?' (DbType = Boolean), @__name_0='?' (Size = 128), @__providerName_1='?' (Size = 64), @__providerKey_2='?' (Size = 64)"], CommandType='Text', CommandTimeout='30']" |
|||
""SELECT TOP(1) [a].[Id], [a].[Name], [a].[ProviderKey], [a].[ProviderName], [a].[TenantId] |
|||
FROM [AbpPermissionGrants] AS [a] |
|||
WHERE ((@__ef_filter__p_0 = CAST(1 AS bit)) OR [a].[TenantId] IS NULL) AND ((([a].[Name] = @__name_0) AND ([a].[ProviderName] = @__providerName_1)) AND ([a].[ProviderKey] = @__providerKey_2)) |
|||
ORDER BY [a].[Id]" |
|||
2022-04-24 16:20:27.349 G Executed DbCommand ("2"ms) [Parameters=["@__ef_filter__p_0='?' (DbType = Boolean), @__name_0='?' (Size = 128), @__providerName_1='?' (Size = 64), @__providerKey_2='?' (Size = 64)"], CommandType='Text', CommandTimeout='30']" |
|||
""SELECT TOP(1) [a].[Id], [a].[Name], [a].[ProviderKey], [a].[ProviderName], [a].[TenantId] |
|||
FROM [AbpPermissionGrants] AS [a] |
|||
WHERE ((@__ef_filter__p_0 = CAST(1 AS bit)) OR [a].[TenantId] IS NULL) AND ((([a].[Name] = @__name_0) AND ([a].[ProviderName] = @__providerName_1)) AND ([a].[ProviderKey] = @__providerKey_2)) |
|||
ORDER BY [a].[Id]" |
|||
2022-04-24 16:20:27.354 G Executed DbCommand ("1"ms) [Parameters=["@__ef_filter__p_0='?' (DbType = Boolean), @__name_0='?' (Size = 128), @__providerName_1='?' (Size = 64), @__providerKey_2='?' (Size = 64)"], CommandType='Text', CommandTimeout='30']" |
|||
""SELECT TOP(1) [a].[Id], [a].[Name], [a].[ProviderKey], [a].[ProviderName], [a].[TenantId] |
|||
FROM [AbpPermissionGrants] AS [a] |
|||
WHERE ((@__ef_filter__p_0 = CAST(1 AS bit)) OR [a].[TenantId] IS NULL) AND ((([a].[Name] = @__name_0) AND ([a].[ProviderName] = @__providerName_1)) AND ([a].[ProviderKey] = @__providerKey_2)) |
|||
ORDER BY [a].[Id]" |
|||
2022-04-24 16:20:27.362 G Executed DbCommand ("1"ms) [Parameters=["@__ef_filter__p_0='?' (DbType = Boolean), @__name_0='?' (Size = 128), @__providerName_1='?' (Size = 64), @__providerKey_2='?' (Size = 64)"], CommandType='Text', CommandTimeout='30']" |
|||
""SELECT TOP(1) [a].[Id], [a].[Name], [a].[ProviderKey], [a].[ProviderName], [a].[TenantId] |
|||
FROM [AbpPermissionGrants] AS [a] |
|||
WHERE ((@__ef_filter__p_0 = CAST(1 AS bit)) OR [a].[TenantId] IS NULL) AND ((([a].[Name] = @__name_0) AND ([a].[ProviderName] = @__providerName_1)) AND ([a].[ProviderKey] = @__providerKey_2)) |
|||
ORDER BY [a].[Id]" |
|||
2022-04-24 16:20:27.367 G Executed DbCommand ("1"ms) [Parameters=["@__ef_filter__p_0='?' (DbType = Boolean), @__name_0='?' (Size = 128), @__providerName_1='?' (Size = 64), @__providerKey_2='?' (Size = 64)"], CommandType='Text', CommandTimeout='30']" |
|||
""SELECT TOP(1) [a].[Id], [a].[Name], [a].[ProviderKey], [a].[ProviderName], [a].[TenantId] |
|||
FROM [AbpPermissionGrants] AS [a] |
|||
WHERE ((@__ef_filter__p_0 = CAST(1 AS bit)) OR [a].[TenantId] IS NULL) AND ((([a].[Name] = @__name_0) AND ([a].[ProviderName] = @__providerName_1)) AND ([a].[ProviderKey] = @__providerKey_2)) |
|||
ORDER BY [a].[Id]" |
|||
2022-04-24 16:20:27.372 G Executed DbCommand ("1"ms) [Parameters=["@__ef_filter__p_0='?' (DbType = Boolean), @__name_0='?' (Size = 128), @__providerName_1='?' (Size = 64), @__providerKey_2='?' (Size = 64)"], CommandType='Text', CommandTimeout='30']" |
|||
""SELECT TOP(1) [a].[Id], [a].[Name], [a].[ProviderKey], [a].[ProviderName], [a].[TenantId] |
|||
FROM [AbpPermissionGrants] AS [a] |
|||
WHERE ((@__ef_filter__p_0 = CAST(1 AS bit)) OR [a].[TenantId] IS NULL) AND ((([a].[Name] = @__name_0) AND ([a].[ProviderName] = @__providerName_1)) AND ([a].[ProviderKey] = @__providerKey_2)) |
|||
ORDER BY [a].[Id]" |
|||
2022-04-24 16:20:27.377 G Executed DbCommand ("1"ms) [Parameters=["@__ef_filter__p_0='?' (DbType = Boolean), @__name_0='?' (Size = 128), @__providerName_1='?' (Size = 64), @__providerKey_2='?' (Size = 64)"], CommandType='Text', CommandTimeout='30']" |
|||
""SELECT TOP(1) [a].[Id], [a].[Name], [a].[ProviderKey], [a].[ProviderName], [a].[TenantId] |
|||
FROM [AbpPermissionGrants] AS [a] |
|||
WHERE ((@__ef_filter__p_0 = CAST(1 AS bit)) OR [a].[TenantId] IS NULL) AND ((([a].[Name] = @__name_0) AND ([a].[ProviderName] = @__providerName_1)) AND ([a].[ProviderKey] = @__providerKey_2)) |
|||
ORDER BY [a].[Id]" |
|||
2022-04-24 16:20:27.382 G Executed DbCommand ("1"ms) [Parameters=["@__ef_filter__p_0='?' (DbType = Boolean), @__name_0='?' (Size = 128), @__providerName_1='?' (Size = 64), @__providerKey_2='?' (Size = 64)"], CommandType='Text', CommandTimeout='30']" |
|||
""SELECT TOP(1) [a].[Id], [a].[Name], [a].[ProviderKey], [a].[ProviderName], [a].[TenantId] |
|||
FROM [AbpPermissionGrants] AS [a] |
|||
WHERE ((@__ef_filter__p_0 = CAST(1 AS bit)) OR [a].[TenantId] IS NULL) AND ((([a].[Name] = @__name_0) AND ([a].[ProviderName] = @__providerName_1)) AND ([a].[ProviderKey] = @__providerKey_2)) |
|||
ORDER BY [a].[Id]" |
|||
2022-04-24 16:20:27.387 G Executed DbCommand ("1"ms) [Parameters=["@__ef_filter__p_0='?' (DbType = Boolean), @__name_0='?' (Size = 128), @__providerName_1='?' (Size = 64), @__providerKey_2='?' (Size = 64)"], CommandType='Text', CommandTimeout='30']" |
|||
""SELECT TOP(1) [a].[Id], [a].[Name], [a].[ProviderKey], [a].[ProviderName], [a].[TenantId] |
|||
FROM [AbpPermissionGrants] AS [a] |
|||
WHERE ((@__ef_filter__p_0 = CAST(1 AS bit)) OR [a].[TenantId] IS NULL) AND ((([a].[Name] = @__name_0) AND ([a].[ProviderName] = @__providerName_1)) AND ([a].[ProviderKey] = @__providerKey_2)) |
|||
ORDER BY [a].[Id]" |
|||
2022-04-24 16:20:27.393 G Executed DbCommand ("1"ms) [Parameters=["@__ef_filter__p_0='?' (DbType = Boolean), @__name_0='?' (Size = 128), @__providerName_1='?' (Size = 64), @__providerKey_2='?' (Size = 64)"], CommandType='Text', CommandTimeout='30']" |
|||
""SELECT TOP(1) [a].[Id], [a].[Name], [a].[ProviderKey], [a].[ProviderName], [a].[TenantId] |
|||
FROM [AbpPermissionGrants] AS [a] |
|||
WHERE ((@__ef_filter__p_0 = CAST(1 AS bit)) OR [a].[TenantId] IS NULL) AND ((([a].[Name] = @__name_0) AND ([a].[ProviderName] = @__providerName_1)) AND ([a].[ProviderKey] = @__providerKey_2)) |
|||
ORDER BY [a].[Id]" |
|||
2022-04-24 16:20:27.398 G Executed DbCommand ("1"ms) [Parameters=["@__ef_filter__p_0='?' (DbType = Boolean), @__name_0='?' (Size = 128), @__providerName_1='?' (Size = 64), @__providerKey_2='?' (Size = 64)"], CommandType='Text', CommandTimeout='30']" |
|||
""SELECT TOP(1) [a].[Id], [a].[Name], [a].[ProviderKey], [a].[ProviderName], [a].[TenantId] |
|||
FROM [AbpPermissionGrants] AS [a] |
|||
WHERE ((@__ef_filter__p_0 = CAST(1 AS bit)) OR [a].[TenantId] IS NULL) AND ((([a].[Name] = @__name_0) AND ([a].[ProviderName] = @__providerName_1)) AND ([a].[ProviderKey] = @__providerKey_2)) |
|||
ORDER BY [a].[Id]" |
|||
2022-04-24 16:20:27.403 G Executed DbCommand ("2"ms) [Parameters=["@__ef_filter__p_0='?' (DbType = Boolean), @__name_0='?' (Size = 128), @__providerName_1='?' (Size = 64), @__providerKey_2='?' (Size = 64)"], CommandType='Text', CommandTimeout='30']" |
|||
""SELECT TOP(1) [a].[Id], [a].[Name], [a].[ProviderKey], [a].[ProviderName], [a].[TenantId] |
|||
FROM [AbpPermissionGrants] AS [a] |
|||
WHERE ((@__ef_filter__p_0 = CAST(1 AS bit)) OR [a].[TenantId] IS NULL) AND ((([a].[Name] = @__name_0) AND ([a].[ProviderName] = @__providerName_1)) AND ([a].[ProviderKey] = @__providerKey_2)) |
|||
ORDER BY [a].[Id]" |
|||
2022-04-24 16:20:27.410 G Executed DbCommand ("1"ms) [Parameters=["@__ef_filter__p_0='?' (DbType = Boolean), @__name_0='?' (Size = 128), @__providerName_1='?' (Size = 64), @__providerKey_2='?' (Size = 64)"], CommandType='Text', CommandTimeout='30']" |
|||
""SELECT TOP(1) [a].[Id], [a].[Name], [a].[ProviderKey], [a].[ProviderName], [a].[TenantId] |
|||
FROM [AbpPermissionGrants] AS [a] |
|||
WHERE ((@__ef_filter__p_0 = CAST(1 AS bit)) OR [a].[TenantId] IS NULL) AND ((([a].[Name] = @__name_0) AND ([a].[ProviderName] = @__providerName_1)) AND ([a].[ProviderKey] = @__providerKey_2)) |
|||
ORDER BY [a].[Id]" |
|||
2022-04-24 16:20:27.415 G Executed DbCommand ("1"ms) [Parameters=["@__ef_filter__p_0='?' (DbType = Boolean), @__name_0='?' (Size = 128), @__providerName_1='?' (Size = 64), @__providerKey_2='?' (Size = 64)"], CommandType='Text', CommandTimeout='30']" |
|||
""SELECT TOP(1) [a].[Id], [a].[Name], [a].[ProviderKey], [a].[ProviderName], [a].[TenantId] |
|||
FROM [AbpPermissionGrants] AS [a] |
|||
WHERE ((@__ef_filter__p_0 = CAST(1 AS bit)) OR [a].[TenantId] IS NULL) AND ((([a].[Name] = @__name_0) AND ([a].[ProviderName] = @__providerName_1)) AND ([a].[ProviderKey] = @__providerKey_2)) |
|||
ORDER BY [a].[Id]" |
|||
2022-04-24 16:20:27.420 G Executed DbCommand ("1"ms) [Parameters=["@__ef_filter__p_0='?' (DbType = Boolean), @__name_0='?' (Size = 128), @__providerName_1='?' (Size = 64), @__providerKey_2='?' (Size = 64)"], CommandType='Text', CommandTimeout='30']" |
|||
""SELECT TOP(1) [a].[Id], [a].[Name], [a].[ProviderKey], [a].[ProviderName], [a].[TenantId] |
|||
FROM [AbpPermissionGrants] AS [a] |
|||
WHERE ((@__ef_filter__p_0 = CAST(1 AS bit)) OR [a].[TenantId] IS NULL) AND ((([a].[Name] = @__name_0) AND ([a].[ProviderName] = @__providerName_1)) AND ([a].[ProviderKey] = @__providerKey_2)) |
|||
ORDER BY [a].[Id]" |
|||
2022-04-24 16:20:27.425 G Executed DbCommand ("2"ms) [Parameters=["@__ef_filter__p_0='?' (DbType = Boolean), @__name_0='?' (Size = 128), @__providerName_1='?' (Size = 64), @__providerKey_2='?' (Size = 64)"], CommandType='Text', CommandTimeout='30']" |
|||
""SELECT TOP(1) [a].[Id], [a].[Name], [a].[ProviderKey], [a].[ProviderName], [a].[TenantId] |
|||
FROM [AbpPermissionGrants] AS [a] |
|||
WHERE ((@__ef_filter__p_0 = CAST(1 AS bit)) OR [a].[TenantId] IS NULL) AND ((([a].[Name] = @__name_0) AND ([a].[ProviderName] = @__providerName_1)) AND ([a].[ProviderKey] = @__providerKey_2)) |
|||
ORDER BY [a].[Id]" |
|||
2022-04-24 16:20:27.431 G Executed DbCommand ("2"ms) [Parameters=["@__ef_filter__p_0='?' (DbType = Boolean), @__name_0='?' (Size = 128), @__providerName_1='?' (Size = 64), @__providerKey_2='?' (Size = 64)"], CommandType='Text', CommandTimeout='30']" |
|||
""SELECT TOP(1) [a].[Id], [a].[Name], [a].[ProviderKey], [a].[ProviderName], [a].[TenantId] |
|||
FROM [AbpPermissionGrants] AS [a] |
|||
WHERE ((@__ef_filter__p_0 = CAST(1 AS bit)) OR [a].[TenantId] IS NULL) AND ((([a].[Name] = @__name_0) AND ([a].[ProviderName] = @__providerName_1)) AND ([a].[ProviderKey] = @__providerKey_2)) |
|||
ORDER BY [a].[Id]" |
|||
2022-04-24 16:20:27.442 G Executed DbCommand ("7"ms) [Parameters=["@__ef_filter__p_0='?' (DbType = Boolean), @__name_0='?' (Size = 128), @__providerName_1='?' (Size = 64), @__providerKey_2='?' (Size = 64)"], CommandType='Text', CommandTimeout='30']" |
|||
""SELECT TOP(1) [a].[Id], [a].[Name], [a].[ProviderKey], [a].[ProviderName], [a].[TenantId] |
|||
FROM [AbpPermissionGrants] AS [a] |
|||
WHERE ((@__ef_filter__p_0 = CAST(1 AS bit)) OR [a].[TenantId] IS NULL) AND ((([a].[Name] = @__name_0) AND ([a].[ProviderName] = @__providerName_1)) AND ([a].[ProviderKey] = @__providerKey_2)) |
|||
ORDER BY [a].[Id]" |
|||
2022-04-24 16:20:27.447 G Executed DbCommand ("1"ms) [Parameters=["@__ef_filter__p_0='?' (DbType = Boolean), @__name_0='?' (Size = 128), @__providerName_1='?' (Size = 64), @__providerKey_2='?' (Size = 64)"], CommandType='Text', CommandTimeout='30']" |
|||
""SELECT TOP(1) [a].[Id], [a].[Name], [a].[ProviderKey], [a].[ProviderName], [a].[TenantId] |
|||
FROM [AbpPermissionGrants] AS [a] |
|||
WHERE ((@__ef_filter__p_0 = CAST(1 AS bit)) OR [a].[TenantId] IS NULL) AND ((([a].[Name] = @__name_0) AND ([a].[ProviderName] = @__providerName_1)) AND ([a].[ProviderKey] = @__providerKey_2)) |
|||
ORDER BY [a].[Id]" |
|||
2022-04-24 16:20:27.452 G Executed DbCommand ("1"ms) [Parameters=["@__ef_filter__p_0='?' (DbType = Boolean), @__name_0='?' (Size = 128), @__providerName_1='?' (Size = 64), @__providerKey_2='?' (Size = 64)"], CommandType='Text', CommandTimeout='30']" |
|||
""SELECT TOP(1) [a].[Id], [a].[Name], [a].[ProviderKey], [a].[ProviderName], [a].[TenantId] |
|||
FROM [AbpPermissionGrants] AS [a] |
|||
WHERE ((@__ef_filter__p_0 = CAST(1 AS bit)) OR [a].[TenantId] IS NULL) AND ((([a].[Name] = @__name_0) AND ([a].[ProviderName] = @__providerName_1)) AND ([a].[ProviderKey] = @__providerKey_2)) |
|||
ORDER BY [a].[Id]" |
|||
2022-04-24 16:20:27.457 G Executed DbCommand ("1"ms) [Parameters=["@__ef_filter__p_0='?' (DbType = Boolean), @__name_0='?' (Size = 128), @__providerName_1='?' (Size = 64), @__providerKey_2='?' (Size = 64)"], CommandType='Text', CommandTimeout='30']" |
|||
""SELECT TOP(1) [a].[Id], [a].[Name], [a].[ProviderKey], [a].[ProviderName], [a].[TenantId] |
|||
FROM [AbpPermissionGrants] AS [a] |
|||
WHERE ((@__ef_filter__p_0 = CAST(1 AS bit)) OR [a].[TenantId] IS NULL) AND ((([a].[Name] = @__name_0) AND ([a].[ProviderName] = @__providerName_1)) AND ([a].[ProviderKey] = @__providerKey_2)) |
|||
ORDER BY [a].[Id]" |
|||
2022-04-24 16:20:27.462 G Executed DbCommand ("1"ms) [Parameters=["@__ef_filter__p_0='?' (DbType = Boolean), @__name_0='?' (Size = 128), @__providerName_1='?' (Size = 64), @__providerKey_2='?' (Size = 64)"], CommandType='Text', CommandTimeout='30']" |
|||
""SELECT TOP(1) [a].[Id], [a].[Name], [a].[ProviderKey], [a].[ProviderName], [a].[TenantId] |
|||
FROM [AbpPermissionGrants] AS [a] |
|||
WHERE ((@__ef_filter__p_0 = CAST(1 AS bit)) OR [a].[TenantId] IS NULL) AND ((([a].[Name] = @__name_0) AND ([a].[ProviderName] = @__providerName_1)) AND ([a].[ProviderKey] = @__providerKey_2)) |
|||
ORDER BY [a].[Id]" |
|||
2022-04-24 16:20:27.467 G Executed DbCommand ("1"ms) [Parameters=["@__ef_filter__p_0='?' (DbType = Boolean), @__name_0='?' (Size = 128), @__providerName_1='?' (Size = 64), @__providerKey_2='?' (Size = 64)"], CommandType='Text', CommandTimeout='30']" |
|||
""SELECT TOP(1) [a].[Id], [a].[Name], [a].[ProviderKey], [a].[ProviderName], [a].[TenantId] |
|||
FROM [AbpPermissionGrants] AS [a] |
|||
WHERE ((@__ef_filter__p_0 = CAST(1 AS bit)) OR [a].[TenantId] IS NULL) AND ((([a].[Name] = @__name_0) AND ([a].[ProviderName] = @__providerName_1)) AND ([a].[ProviderKey] = @__providerKey_2)) |
|||
ORDER BY [a].[Id]" |
|||
2022-04-24 16:20:27.472 G Executed DbCommand ("1"ms) [Parameters=["@__ef_filter__p_0='?' (DbType = Boolean), @__name_0='?' (Size = 128), @__providerName_1='?' (Size = 64), @__providerKey_2='?' (Size = 64)"], CommandType='Text', CommandTimeout='30']" |
|||
""SELECT TOP(1) [a].[Id], [a].[Name], [a].[ProviderKey], [a].[ProviderName], [a].[TenantId] |
|||
FROM [AbpPermissionGrants] AS [a] |
|||
WHERE ((@__ef_filter__p_0 = CAST(1 AS bit)) OR [a].[TenantId] IS NULL) AND ((([a].[Name] = @__name_0) AND ([a].[ProviderName] = @__providerName_1)) AND ([a].[ProviderKey] = @__providerKey_2)) |
|||
ORDER BY [a].[Id]" |
|||
2022-04-24 16:20:27.476 G Executed DbCommand ("1"ms) [Parameters=["@__ef_filter__p_0='?' (DbType = Boolean), @__name_0='?' (Size = 128), @__providerName_1='?' (Size = 64), @__providerKey_2='?' (Size = 64)"], CommandType='Text', CommandTimeout='30']" |
|||
""SELECT TOP(1) [a].[Id], [a].[Name], [a].[ProviderKey], [a].[ProviderName], [a].[TenantId] |
|||
FROM [AbpPermissionGrants] AS [a] |
|||
WHERE ((@__ef_filter__p_0 = CAST(1 AS bit)) OR [a].[TenantId] IS NULL) AND ((([a].[Name] = @__name_0) AND ([a].[ProviderName] = @__providerName_1)) AND ([a].[ProviderKey] = @__providerKey_2)) |
|||
ORDER BY [a].[Id]" |
|||
2022-04-24 16:20:27.480 G Executed DbCommand ("1"ms) [Parameters=["@__ef_filter__p_0='?' (DbType = Boolean), @__name_0='?' (Size = 128), @__providerName_1='?' (Size = 64), @__providerKey_2='?' (Size = 64)"], CommandType='Text', CommandTimeout='30']" |
|||
""SELECT TOP(1) [a].[Id], [a].[Name], [a].[ProviderKey], [a].[ProviderName], [a].[TenantId] |
|||
FROM [AbpPermissionGrants] AS [a] |
|||
WHERE ((@__ef_filter__p_0 = CAST(1 AS bit)) OR [a].[TenantId] IS NULL) AND ((([a].[Name] = @__name_0) AND ([a].[ProviderName] = @__providerName_1)) AND ([a].[ProviderKey] = @__providerKey_2)) |
|||
ORDER BY [a].[Id]" |
|||
2022-04-24 16:20:27.488 G Executed DbCommand ("1"ms) [Parameters=["@__ef_filter__p_0='?' (DbType = Boolean), @__name_0='?' (Size = 128), @__providerName_1='?' (Size = 64), @__providerKey_2='?' (Size = 64)"], CommandType='Text', CommandTimeout='30']" |
|||
""SELECT TOP(1) [a].[Id], [a].[Name], [a].[ProviderKey], [a].[ProviderName], [a].[TenantId] |
|||
FROM [AbpPermissionGrants] AS [a] |
|||
WHERE ((@__ef_filter__p_0 = CAST(1 AS bit)) OR [a].[TenantId] IS NULL) AND ((([a].[Name] = @__name_0) AND ([a].[ProviderName] = @__providerName_1)) AND ([a].[ProviderKey] = @__providerKey_2)) |
|||
ORDER BY [a].[Id]" |
|||
2022-04-24 16:20:27.492 G Executed DbCommand ("1"ms) [Parameters=["@__ef_filter__p_0='?' (DbType = Boolean), @__name_0='?' (Size = 128), @__providerName_1='?' (Size = 64), @__providerKey_2='?' (Size = 64)"], CommandType='Text', CommandTimeout='30']" |
|||
""SELECT TOP(1) [a].[Id], [a].[Name], [a].[ProviderKey], [a].[ProviderName], [a].[TenantId] |
|||
FROM [AbpPermissionGrants] AS [a] |
|||
WHERE ((@__ef_filter__p_0 = CAST(1 AS bit)) OR [a].[TenantId] IS NULL) AND ((([a].[Name] = @__name_0) AND ([a].[ProviderName] = @__providerName_1)) AND ([a].[ProviderKey] = @__providerKey_2)) |
|||
ORDER BY [a].[Id]" |
|||
2022-04-24 16:20:27.496 G Executed DbCommand ("1"ms) [Parameters=["@__ef_filter__p_0='?' (DbType = Boolean), @__name_0='?' (Size = 128), @__providerName_1='?' (Size = 64), @__providerKey_2='?' (Size = 64)"], CommandType='Text', CommandTimeout='30']" |
|||
""SELECT TOP(1) [a].[Id], [a].[Name], [a].[ProviderKey], [a].[ProviderName], [a].[TenantId] |
|||
FROM [AbpPermissionGrants] AS [a] |
|||
WHERE ((@__ef_filter__p_0 = CAST(1 AS bit)) OR [a].[TenantId] IS NULL) AND ((([a].[Name] = @__name_0) AND ([a].[ProviderName] = @__providerName_1)) AND ([a].[ProviderKey] = @__providerKey_2)) |
|||
ORDER BY [a].[Id]" |
|||
2022-04-24 16:20:27.502 G Executed DbCommand ("1"ms) [Parameters=["@__ef_filter__p_0='?' (DbType = Boolean), @__name_0='?' (Size = 128), @__providerName_1='?' (Size = 64), @__providerKey_2='?' (Size = 64)"], CommandType='Text', CommandTimeout='30']" |
|||
""SELECT TOP(1) [a].[Id], [a].[Name], [a].[ProviderKey], [a].[ProviderName], [a].[TenantId] |
|||
FROM [AbpPermissionGrants] AS [a] |
|||
WHERE ((@__ef_filter__p_0 = CAST(1 AS bit)) OR [a].[TenantId] IS NULL) AND ((([a].[Name] = @__name_0) AND ([a].[ProviderName] = @__providerName_1)) AND ([a].[ProviderKey] = @__providerKey_2)) |
|||
ORDER BY [a].[Id]" |
|||
2022-04-24 16:20:27.506 G Executed DbCommand ("1"ms) [Parameters=["@__ef_filter__p_0='?' (DbType = Boolean), @__name_0='?' (Size = 128), @__providerName_1='?' (Size = 64), @__providerKey_2='?' (Size = 64)"], CommandType='Text', CommandTimeout='30']" |
|||
""SELECT TOP(1) [a].[Id], [a].[Name], [a].[ProviderKey], [a].[ProviderName], [a].[TenantId] |
|||
FROM [AbpPermissionGrants] AS [a] |
|||
WHERE ((@__ef_filter__p_0 = CAST(1 AS bit)) OR [a].[TenantId] IS NULL) AND ((([a].[Name] = @__name_0) AND ([a].[ProviderName] = @__providerName_1)) AND ([a].[ProviderKey] = @__providerKey_2)) |
|||
ORDER BY [a].[Id]" |
|||
2022-04-24 16:20:27.511 G Executed DbCommand ("1"ms) [Parameters=["@__ef_filter__p_0='?' (DbType = Boolean), @__name_0='?' (Size = 128), @__providerName_1='?' (Size = 64), @__providerKey_2='?' (Size = 64)"], CommandType='Text', CommandTimeout='30']" |
|||
""SELECT TOP(1) [a].[Id], [a].[Name], [a].[ProviderKey], [a].[ProviderName], [a].[TenantId] |
|||
FROM [AbpPermissionGrants] AS [a] |
|||
WHERE ((@__ef_filter__p_0 = CAST(1 AS bit)) OR [a].[TenantId] IS NULL) AND ((([a].[Name] = @__name_0) AND ([a].[ProviderName] = @__providerName_1)) AND ([a].[ProviderKey] = @__providerKey_2)) |
|||
ORDER BY [a].[Id]" |
|||
2022-04-24 16:20:27.515 G Executed DbCommand ("1"ms) [Parameters=["@__ef_filter__p_0='?' (DbType = Boolean), @__name_0='?' (Size = 128), @__providerName_1='?' (Size = 64), @__providerKey_2='?' (Size = 64)"], CommandType='Text', CommandTimeout='30']" |
|||
""SELECT TOP(1) [a].[Id], [a].[Name], [a].[ProviderKey], [a].[ProviderName], [a].[TenantId] |
|||
FROM [AbpPermissionGrants] AS [a] |
|||
WHERE ((@__ef_filter__p_0 = CAST(1 AS bit)) OR [a].[TenantId] IS NULL) AND ((([a].[Name] = @__name_0) AND ([a].[ProviderName] = @__providerName_1)) AND ([a].[ProviderKey] = @__providerKey_2)) |
|||
ORDER BY [a].[Id]" |
|||
2022-04-24 16:20:27.520 G Executed DbCommand ("1"ms) [Parameters=["@__ef_filter__p_0='?' (DbType = Boolean), @__name_0='?' (Size = 128), @__providerName_1='?' (Size = 64), @__providerKey_2='?' (Size = 64)"], CommandType='Text', CommandTimeout='30']" |
|||
""SELECT TOP(1) [a].[Id], [a].[Name], [a].[ProviderKey], [a].[ProviderName], [a].[TenantId] |
|||
FROM [AbpPermissionGrants] AS [a] |
|||
WHERE ((@__ef_filter__p_0 = CAST(1 AS bit)) OR [a].[TenantId] IS NULL) AND ((([a].[Name] = @__name_0) AND ([a].[ProviderName] = @__providerName_1)) AND ([a].[ProviderKey] = @__providerKey_2)) |
|||
ORDER BY [a].[Id]" |
|||
2022-04-24 16:20:27.525 G Executed DbCommand ("1"ms) [Parameters=["@__ef_filter__p_0='?' (DbType = Boolean), @__name_0='?' (Size = 128), @__providerName_1='?' (Size = 64), @__providerKey_2='?' (Size = 64)"], CommandType='Text', CommandTimeout='30']" |
|||
""SELECT TOP(1) [a].[Id], [a].[Name], [a].[ProviderKey], [a].[ProviderName], [a].[TenantId] |
|||
FROM [AbpPermissionGrants] AS [a] |
|||
WHERE ((@__ef_filter__p_0 = CAST(1 AS bit)) OR [a].[TenantId] IS NULL) AND ((([a].[Name] = @__name_0) AND ([a].[ProviderName] = @__providerName_1)) AND ([a].[ProviderKey] = @__providerKey_2)) |
|||
ORDER BY [a].[Id]" |
|||
2022-04-24 16:20:27.536 G Executed DbCommand ("3"ms) [Parameters=["@__ef_filter__p_0='?' (DbType = Boolean), @__name_0='?' (Size = 128), @__providerName_1='?' (Size = 64), @__providerKey_2='?' (Size = 64)"], CommandType='Text', CommandTimeout='30']" |
|||
""SELECT TOP(1) [a].[Id], [a].[Name], [a].[ProviderKey], [a].[ProviderName], [a].[TenantId] |
|||
FROM [AbpPermissionGrants] AS [a] |
|||
WHERE ((@__ef_filter__p_0 = CAST(1 AS bit)) OR [a].[TenantId] IS NULL) AND ((([a].[Name] = @__name_0) AND ([a].[ProviderName] = @__providerName_1)) AND ([a].[ProviderKey] = @__providerKey_2)) |
|||
ORDER BY [a].[Id]" |
|||
2022-04-24 16:20:27.549 G Executed DbCommand ("2"ms) [Parameters=["@__ef_filter__p_0='?' (DbType = Boolean), @__name_0='?' (Size = 128), @__providerName_1='?' (Size = 64), @__providerKey_2='?' (Size = 64)"], CommandType='Text', CommandTimeout='30']" |
|||
""SELECT TOP(1) [a].[Id], [a].[Name], [a].[ProviderKey], [a].[ProviderName], [a].[TenantId] |
|||
FROM [AbpPermissionGrants] AS [a] |
|||
WHERE ((@__ef_filter__p_0 = CAST(1 AS bit)) OR [a].[TenantId] IS NULL) AND ((([a].[Name] = @__name_0) AND ([a].[ProviderName] = @__providerName_1)) AND ([a].[ProviderKey] = @__providerKey_2)) |
|||
ORDER BY [a].[Id]" |
|||
2022-04-24 16:20:27.556 G Executed DbCommand ("2"ms) [Parameters=["@__ef_filter__p_0='?' (DbType = Boolean), @__name_0='?' (Size = 128), @__providerName_1='?' (Size = 64), @__providerKey_2='?' (Size = 64)"], CommandType='Text', CommandTimeout='30']" |
|||
""SELECT TOP(1) [a].[Id], [a].[Name], [a].[ProviderKey], [a].[ProviderName], [a].[TenantId] |
|||
FROM [AbpPermissionGrants] AS [a] |
|||
WHERE ((@__ef_filter__p_0 = CAST(1 AS bit)) OR [a].[TenantId] IS NULL) AND ((([a].[Name] = @__name_0) AND ([a].[ProviderName] = @__providerName_1)) AND ([a].[ProviderKey] = @__providerKey_2)) |
|||
ORDER BY [a].[Id]" |
|||
2022-04-24 16:20:27.569 G Executed DbCommand ("9"ms) [Parameters=["@__ef_filter__p_0='?' (DbType = Boolean), @__name_0='?' (Size = 128), @__providerName_1='?' (Size = 64), @__providerKey_2='?' (Size = 64)"], CommandType='Text', CommandTimeout='30']" |
|||
""SELECT TOP(1) [a].[Id], [a].[Name], [a].[ProviderKey], [a].[ProviderName], [a].[TenantId] |
|||
FROM [AbpPermissionGrants] AS [a] |
|||
WHERE ((@__ef_filter__p_0 = CAST(1 AS bit)) OR [a].[TenantId] IS NULL) AND ((([a].[Name] = @__name_0) AND ([a].[ProviderName] = @__providerName_1)) AND ([a].[ProviderKey] = @__providerKey_2)) |
|||
ORDER BY [a].[Id]" |
|||
2022-04-24 16:20:27.576 G Executed DbCommand ("2"ms) [Parameters=["@__ef_filter__p_0='?' (DbType = Boolean), @__name_0='?' (Size = 128), @__providerName_1='?' (Size = 64), @__providerKey_2='?' (Size = 64)"], CommandType='Text', CommandTimeout='30']" |
|||
""SELECT TOP(1) [a].[Id], [a].[Name], [a].[ProviderKey], [a].[ProviderName], [a].[TenantId] |
|||
FROM [AbpPermissionGrants] AS [a] |
|||
WHERE ((@__ef_filter__p_0 = CAST(1 AS bit)) OR [a].[TenantId] IS NULL) AND ((([a].[Name] = @__name_0) AND ([a].[ProviderName] = @__providerName_1)) AND ([a].[ProviderKey] = @__providerKey_2)) |
|||
ORDER BY [a].[Id]" |
|||
2022-04-24 16:20:27.582 G Executed DbCommand ("1"ms) [Parameters=["@__ef_filter__p_0='?' (DbType = Boolean), @__name_0='?' (Size = 128), @__providerName_1='?' (Size = 64), @__providerKey_2='?' (Size = 64)"], CommandType='Text', CommandTimeout='30']" |
|||
""SELECT TOP(1) [a].[Id], [a].[Name], [a].[ProviderKey], [a].[ProviderName], [a].[TenantId] |
|||
FROM [AbpPermissionGrants] AS [a] |
|||
WHERE ((@__ef_filter__p_0 = CAST(1 AS bit)) OR [a].[TenantId] IS NULL) AND ((([a].[Name] = @__name_0) AND ([a].[ProviderName] = @__providerName_1)) AND ([a].[ProviderKey] = @__providerKey_2)) |
|||
ORDER BY [a].[Id]" |
|||
2022-04-24 16:20:27.587 G Executed DbCommand ("2"ms) [Parameters=["@__ef_filter__p_0='?' (DbType = Boolean), @__name_0='?' (Size = 128), @__providerName_1='?' (Size = 64), @__providerKey_2='?' (Size = 64)"], CommandType='Text', CommandTimeout='30']" |
|||
""SELECT TOP(1) [a].[Id], [a].[Name], [a].[ProviderKey], [a].[ProviderName], [a].[TenantId] |
|||
FROM [AbpPermissionGrants] AS [a] |
|||
WHERE ((@__ef_filter__p_0 = CAST(1 AS bit)) OR [a].[TenantId] IS NULL) AND ((([a].[Name] = @__name_0) AND ([a].[ProviderName] = @__providerName_1)) AND ([a].[ProviderKey] = @__providerKey_2)) |
|||
ORDER BY [a].[Id]" |
|||
2022-04-24 16:20:27.593 G Executed DbCommand ("2"ms) [Parameters=["@__ef_filter__p_0='?' (DbType = Boolean), @__name_0='?' (Size = 128), @__providerName_1='?' (Size = 64), @__providerKey_2='?' (Size = 64)"], CommandType='Text', CommandTimeout='30']" |
|||
""SELECT TOP(1) [a].[Id], [a].[Name], [a].[ProviderKey], [a].[ProviderName], [a].[TenantId] |
|||
FROM [AbpPermissionGrants] AS [a] |
|||
WHERE ((@__ef_filter__p_0 = CAST(1 AS bit)) OR [a].[TenantId] IS NULL) AND ((([a].[Name] = @__name_0) AND ([a].[ProviderName] = @__providerName_1)) AND ([a].[ProviderKey] = @__providerKey_2)) |
|||
ORDER BY [a].[Id]" |
|||
2022-04-24 16:20:27.599 G Executed DbCommand ("2"ms) [Parameters=["@__ef_filter__p_0='?' (DbType = Boolean), @__name_0='?' (Size = 128), @__providerName_1='?' (Size = 64), @__providerKey_2='?' (Size = 64)"], CommandType='Text', CommandTimeout='30']" |
|||
""SELECT TOP(1) [a].[Id], [a].[Name], [a].[ProviderKey], [a].[ProviderName], [a].[TenantId] |
|||
FROM [AbpPermissionGrants] AS [a] |
|||
WHERE ((@__ef_filter__p_0 = CAST(1 AS bit)) OR [a].[TenantId] IS NULL) AND ((([a].[Name] = @__name_0) AND ([a].[ProviderName] = @__providerName_1)) AND ([a].[ProviderKey] = @__providerKey_2)) |
|||
ORDER BY [a].[Id]" |
|||
2022-04-24 16:20:27.604 G Executed DbCommand ("2"ms) [Parameters=["@__ef_filter__p_0='?' (DbType = Boolean), @__name_0='?' (Size = 128), @__providerName_1='?' (Size = 64), @__providerKey_2='?' (Size = 64)"], CommandType='Text', CommandTimeout='30']" |
|||
""SELECT TOP(1) [a].[Id], [a].[Name], [a].[ProviderKey], [a].[ProviderName], [a].[TenantId] |
|||
FROM [AbpPermissionGrants] AS [a] |
|||
WHERE ((@__ef_filter__p_0 = CAST(1 AS bit)) OR [a].[TenantId] IS NULL) AND ((([a].[Name] = @__name_0) AND ([a].[ProviderName] = @__providerName_1)) AND ([a].[ProviderKey] = @__providerKey_2)) |
|||
ORDER BY [a].[Id]" |
|||
2022-04-24 16:20:27.627 G Executed DbCommand ("2"ms) [Parameters=["@__ef_filter__p_0='?' (DbType = Boolean), @__name_0='?' (Size = 128), @__providerName_1='?' (Size = 64), @__providerKey_2='?' (Size = 64)"], CommandType='Text', CommandTimeout='30']" |
|||
""SELECT TOP(1) [a].[Id], [a].[Name], [a].[ProviderKey], [a].[ProviderName], [a].[TenantId] |
|||
FROM [AbpPermissionGrants] AS [a] |
|||
WHERE ((@__ef_filter__p_0 = CAST(1 AS bit)) OR [a].[TenantId] IS NULL) AND ((([a].[Name] = @__name_0) AND ([a].[ProviderName] = @__providerName_1)) AND ([a].[ProviderKey] = @__providerKey_2)) |
|||
ORDER BY [a].[Id]" |
|||
2022-04-24 16:20:27.634 G Executed DbCommand ("2"ms) [Parameters=["@__ef_filter__p_0='?' (DbType = Boolean), @__name_0='?' (Size = 128), @__providerName_1='?' (Size = 64), @__providerKey_2='?' (Size = 64)"], CommandType='Text', CommandTimeout='30']" |
|||
""SELECT TOP(1) [a].[Id], [a].[Name], [a].[ProviderKey], [a].[ProviderName], [a].[TenantId] |
|||
FROM [AbpPermissionGrants] AS [a] |
|||
WHERE ((@__ef_filter__p_0 = CAST(1 AS bit)) OR [a].[TenantId] IS NULL) AND ((([a].[Name] = @__name_0) AND ([a].[ProviderName] = @__providerName_1)) AND ([a].[ProviderKey] = @__providerKey_2)) |
|||
ORDER BY [a].[Id]" |
|||
2022-04-24 16:20:27.643 G Executed DbCommand ("2"ms) [Parameters=["@__ef_filter__p_0='?' (DbType = Boolean), @__name_0='?' (Size = 128), @__providerName_1='?' (Size = 64), @__providerKey_2='?' (Size = 64)"], CommandType='Text', CommandTimeout='30']" |
|||
""SELECT TOP(1) [a].[Id], [a].[Name], [a].[ProviderKey], [a].[ProviderName], [a].[TenantId] |
|||
FROM [AbpPermissionGrants] AS [a] |
|||
WHERE ((@__ef_filter__p_0 = CAST(1 AS bit)) OR [a].[TenantId] IS NULL) AND ((([a].[Name] = @__name_0) AND ([a].[ProviderName] = @__providerName_1)) AND ([a].[ProviderKey] = @__providerKey_2)) |
|||
ORDER BY [a].[Id]" |
|||
2022-04-24 16:20:27.648 G Executed DbCommand ("2"ms) [Parameters=["@__ef_filter__p_0='?' (DbType = Boolean), @__name_0='?' (Size = 128), @__providerName_1='?' (Size = 64), @__providerKey_2='?' (Size = 64)"], CommandType='Text', CommandTimeout='30']" |
|||
""SELECT TOP(1) [a].[Id], [a].[Name], [a].[ProviderKey], [a].[ProviderName], [a].[TenantId] |
|||
FROM [AbpPermissionGrants] AS [a] |
|||
WHERE ((@__ef_filter__p_0 = CAST(1 AS bit)) OR [a].[TenantId] IS NULL) AND ((([a].[Name] = @__name_0) AND ([a].[ProviderName] = @__providerName_1)) AND ([a].[ProviderKey] = @__providerKey_2)) |
|||
ORDER BY [a].[Id]" |
|||
2022-04-24 16:20:27.655 G Executed DbCommand ("3"ms) [Parameters=["@__ef_filter__p_0='?' (DbType = Boolean), @__name_0='?' (Size = 128), @__providerName_1='?' (Size = 64), @__providerKey_2='?' (Size = 64)"], CommandType='Text', CommandTimeout='30']" |
|||
""SELECT TOP(1) [a].[Id], [a].[Name], [a].[ProviderKey], [a].[ProviderName], [a].[TenantId] |
|||
FROM [AbpPermissionGrants] AS [a] |
|||
WHERE ((@__ef_filter__p_0 = CAST(1 AS bit)) OR [a].[TenantId] IS NULL) AND ((([a].[Name] = @__name_0) AND ([a].[ProviderName] = @__providerName_1)) AND ([a].[ProviderKey] = @__providerKey_2)) |
|||
ORDER BY [a].[Id]" |
|||
2022-04-24 16:20:27.661 G Executed DbCommand ("2"ms) [Parameters=["@__ef_filter__p_0='?' (DbType = Boolean), @__name_0='?' (Size = 128), @__providerName_1='?' (Size = 64), @__providerKey_2='?' (Size = 64)"], CommandType='Text', CommandTimeout='30']" |
|||
""SELECT TOP(1) [a].[Id], [a].[Name], [a].[ProviderKey], [a].[ProviderName], [a].[TenantId] |
|||
FROM [AbpPermissionGrants] AS [a] |
|||
WHERE ((@__ef_filter__p_0 = CAST(1 AS bit)) OR [a].[TenantId] IS NULL) AND ((([a].[Name] = @__name_0) AND ([a].[ProviderName] = @__providerName_1)) AND ([a].[ProviderKey] = @__providerKey_2)) |
|||
ORDER BY [a].[Id]" |
|||
2022-04-24 16:20:27.666 G Executed DbCommand ("2"ms) [Parameters=["@__ef_filter__p_0='?' (DbType = Boolean), @__name_0='?' (Size = 128), @__providerName_1='?' (Size = 64), @__providerKey_2='?' (Size = 64)"], CommandType='Text', CommandTimeout='30']" |
|||
""SELECT TOP(1) [a].[Id], [a].[Name], [a].[ProviderKey], [a].[ProviderName], [a].[TenantId] |
|||
FROM [AbpPermissionGrants] AS [a] |
|||
WHERE ((@__ef_filter__p_0 = CAST(1 AS bit)) OR [a].[TenantId] IS NULL) AND ((([a].[Name] = @__name_0) AND ([a].[ProviderName] = @__providerName_1)) AND ([a].[ProviderKey] = @__providerKey_2)) |
|||
ORDER BY [a].[Id]" |
|||
2022-04-24 16:20:27.673 G Executed DbCommand ("2"ms) [Parameters=["@__ef_filter__p_0='?' (DbType = Boolean), @__name_0='?' (Size = 128), @__providerName_1='?' (Size = 64), @__providerKey_2='?' (Size = 64)"], CommandType='Text', CommandTimeout='30']" |
|||
""SELECT TOP(1) [a].[Id], [a].[Name], [a].[ProviderKey], [a].[ProviderName], [a].[TenantId] |
|||
FROM [AbpPermissionGrants] AS [a] |
|||
WHERE ((@__ef_filter__p_0 = CAST(1 AS bit)) OR [a].[TenantId] IS NULL) AND ((([a].[Name] = @__name_0) AND ([a].[ProviderName] = @__providerName_1)) AND ([a].[ProviderKey] = @__providerKey_2)) |
|||
ORDER BY [a].[Id]" |
|||
2022-04-24 16:20:27.679 G Executed DbCommand ("2"ms) [Parameters=["@__ef_filter__p_0='?' (DbType = Boolean), @__name_0='?' (Size = 128), @__providerName_1='?' (Size = 64), @__providerKey_2='?' (Size = 64)"], CommandType='Text', CommandTimeout='30']" |
|||
""SELECT TOP(1) [a].[Id], [a].[Name], [a].[ProviderKey], [a].[ProviderName], [a].[TenantId] |
|||
FROM [AbpPermissionGrants] AS [a] |
|||
WHERE ((@__ef_filter__p_0 = CAST(1 AS bit)) OR [a].[TenantId] IS NULL) AND ((([a].[Name] = @__name_0) AND ([a].[ProviderName] = @__providerName_1)) AND ([a].[ProviderKey] = @__providerKey_2)) |
|||
ORDER BY [a].[Id]" |
|||
2022-04-24 16:20:27.684 G Executed DbCommand ("1"ms) [Parameters=["@__ef_filter__p_0='?' (DbType = Boolean), @__name_0='?' (Size = 128), @__providerName_1='?' (Size = 64), @__providerKey_2='?' (Size = 64)"], CommandType='Text', CommandTimeout='30']" |
|||
""SELECT TOP(1) [a].[Id], [a].[Name], [a].[ProviderKey], [a].[ProviderName], [a].[TenantId] |
|||
FROM [AbpPermissionGrants] AS [a] |
|||
WHERE ((@__ef_filter__p_0 = CAST(1 AS bit)) OR [a].[TenantId] IS NULL) AND ((([a].[Name] = @__name_0) AND ([a].[ProviderName] = @__providerName_1)) AND ([a].[ProviderKey] = @__providerKey_2)) |
|||
ORDER BY [a].[Id]" |
|||
2022-04-24 16:20:27.690 G Executed DbCommand ("2"ms) [Parameters=["@__ef_filter__p_0='?' (DbType = Boolean), @__name_0='?' (Size = 128), @__providerName_1='?' (Size = 64), @__providerKey_2='?' (Size = 64)"], CommandType='Text', CommandTimeout='30']" |
|||
""SELECT TOP(1) [a].[Id], [a].[Name], [a].[ProviderKey], [a].[ProviderName], [a].[TenantId] |
|||
FROM [AbpPermissionGrants] AS [a] |
|||
WHERE ((@__ef_filter__p_0 = CAST(1 AS bit)) OR [a].[TenantId] IS NULL) AND ((([a].[Name] = @__name_0) AND ([a].[ProviderName] = @__providerName_1)) AND ([a].[ProviderKey] = @__providerKey_2)) |
|||
ORDER BY [a].[Id]" |
|||
2022-04-24 16:20:27.696 G Executed DbCommand ("1"ms) [Parameters=["@__ef_filter__p_0='?' (DbType = Boolean), @__name_0='?' (Size = 128), @__providerName_1='?' (Size = 64), @__providerKey_2='?' (Size = 64)"], CommandType='Text', CommandTimeout='30']" |
|||
""SELECT TOP(1) [a].[Id], [a].[Name], [a].[ProviderKey], [a].[ProviderName], [a].[TenantId] |
|||
FROM [AbpPermissionGrants] AS [a] |
|||
WHERE ((@__ef_filter__p_0 = CAST(1 AS bit)) OR [a].[TenantId] IS NULL) AND ((([a].[Name] = @__name_0) AND ([a].[ProviderName] = @__providerName_1)) AND ([a].[ProviderKey] = @__providerKey_2)) |
|||
ORDER BY [a].[Id]" |
|||
2022-04-24 16:20:27.700 G Executed DbCommand ("1"ms) [Parameters=["@__ef_filter__p_0='?' (DbType = Boolean), @__name_0='?' (Size = 128), @__providerName_1='?' (Size = 64), @__providerKey_2='?' (Size = 64)"], CommandType='Text', CommandTimeout='30']" |
|||
""SELECT TOP(1) [a].[Id], [a].[Name], [a].[ProviderKey], [a].[ProviderName], [a].[TenantId] |
|||
FROM [AbpPermissionGrants] AS [a] |
|||
WHERE ((@__ef_filter__p_0 = CAST(1 AS bit)) OR [a].[TenantId] IS NULL) AND ((([a].[Name] = @__name_0) AND ([a].[ProviderName] = @__providerName_1)) AND ([a].[ProviderKey] = @__providerKey_2)) |
|||
ORDER BY [a].[Id]" |
|||
2022-04-24 16:20:27.705 G Executed DbCommand ("1"ms) [Parameters=["@__ef_filter__p_0='?' (DbType = Boolean), @__name_0='?' (Size = 128), @__providerName_1='?' (Size = 64), @__providerKey_2='?' (Size = 64)"], CommandType='Text', CommandTimeout='30']" |
|||
""SELECT TOP(1) [a].[Id], [a].[Name], [a].[ProviderKey], [a].[ProviderName], [a].[TenantId] |
|||
FROM [AbpPermissionGrants] AS [a] |
|||
WHERE ((@__ef_filter__p_0 = CAST(1 AS bit)) OR [a].[TenantId] IS NULL) AND ((([a].[Name] = @__name_0) AND ([a].[ProviderName] = @__providerName_1)) AND ([a].[ProviderKey] = @__providerKey_2)) |
|||
ORDER BY [a].[Id]" |
|||
2022-04-24 16:20:27.709 G Executed DbCommand ("1"ms) [Parameters=["@__ef_filter__p_0='?' (DbType = Boolean), @__name_0='?' (Size = 128), @__providerName_1='?' (Size = 64), @__providerKey_2='?' (Size = 64)"], CommandType='Text', CommandTimeout='30']" |
|||
""SELECT TOP(1) [a].[Id], [a].[Name], [a].[ProviderKey], [a].[ProviderName], [a].[TenantId] |
|||
FROM [AbpPermissionGrants] AS [a] |
|||
WHERE ((@__ef_filter__p_0 = CAST(1 AS bit)) OR [a].[TenantId] IS NULL) AND ((([a].[Name] = @__name_0) AND ([a].[ProviderName] = @__providerName_1)) AND ([a].[ProviderKey] = @__providerKey_2)) |
|||
ORDER BY [a].[Id]" |
|||
2022-04-24 16:20:27.714 G Executed DbCommand ("1"ms) [Parameters=["@__ef_filter__p_0='?' (DbType = Boolean), @__name_0='?' (Size = 128), @__providerName_1='?' (Size = 64), @__providerKey_2='?' (Size = 64)"], CommandType='Text', CommandTimeout='30']" |
|||
""SELECT TOP(1) [a].[Id], [a].[Name], [a].[ProviderKey], [a].[ProviderName], [a].[TenantId] |
|||
FROM [AbpPermissionGrants] AS [a] |
|||
WHERE ((@__ef_filter__p_0 = CAST(1 AS bit)) OR [a].[TenantId] IS NULL) AND ((([a].[Name] = @__name_0) AND ([a].[ProviderName] = @__providerName_1)) AND ([a].[ProviderKey] = @__providerKey_2)) |
|||
ORDER BY [a].[Id]" |
|||
2022-04-24 16:20:27.719 G Executed DbCommand ("1"ms) [Parameters=["@__ef_filter__p_0='?' (DbType = Boolean), @__name_0='?' (Size = 128), @__providerName_1='?' (Size = 64), @__providerKey_2='?' (Size = 64)"], CommandType='Text', CommandTimeout='30']" |
|||
""SELECT TOP(1) [a].[Id], [a].[Name], [a].[ProviderKey], [a].[ProviderName], [a].[TenantId] |
|||
FROM [AbpPermissionGrants] AS [a] |
|||
WHERE ((@__ef_filter__p_0 = CAST(1 AS bit)) OR [a].[TenantId] IS NULL) AND ((([a].[Name] = @__name_0) AND ([a].[ProviderName] = @__providerName_1)) AND ([a].[ProviderKey] = @__providerKey_2)) |
|||
ORDER BY [a].[Id]" |
|||
2022-04-24 16:20:27.724 G Executed DbCommand ("1"ms) [Parameters=["@__ef_filter__p_0='?' (DbType = Boolean), @__name_0='?' (Size = 128), @__providerName_1='?' (Size = 64), @__providerKey_2='?' (Size = 64)"], CommandType='Text', CommandTimeout='30']" |
|||
""SELECT TOP(1) [a].[Id], [a].[Name], [a].[ProviderKey], [a].[ProviderName], [a].[TenantId] |
|||
FROM [AbpPermissionGrants] AS [a] |
|||
WHERE ((@__ef_filter__p_0 = CAST(1 AS bit)) OR [a].[TenantId] IS NULL) AND ((([a].[Name] = @__name_0) AND ([a].[ProviderName] = @__providerName_1)) AND ([a].[ProviderKey] = @__providerKey_2)) |
|||
ORDER BY [a].[Id]" |
|||
2022-04-24 16:20:28.088 G Initialized all ABP modules. |
|||
2022-04-24 16:20:28.232 G Now listening on: "http://localhost:44378" |
|||
2022-04-24 16:20:28.234 G Application started. Press Ctrl+C to shut down. |
|||
2022-04-24 16:20:28.235 G Hosting environment: "Development" |
|||
2022-04-24 16:20:28.236 G Content root path: "C:\Users\Administrator\source\repos\Win.sfs.SmartSettlementSystem.PG\src\Modules\SettleAccount\host\SettleAccount.HttpApi.Host" |
File diff suppressed because it is too large
@ -0,0 +1,187 @@ |
|||
using Magicodes.ExporterAndImporter.Core; |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.ComponentModel.DataAnnotations; |
|||
using System.Linq; |
|||
using System.Text; |
|||
using System.Threading.Tasks; |
|||
using Win.Sfs.Shared; |
|||
using Win.Sfs.Shared.DtoBase; |
|||
|
|||
namespace Win.Sfs.SettleAccount.Entities.ERPShpping |
|||
{ |
|||
public class ERPShippingDetailDto |
|||
{ |
|||
|
|||
|
|||
[ImporterHeader(Name = "保管")] |
|||
public string Person { set; get; } |
|||
[ImporterHeader(Name = "成本")] |
|||
public decimal Cost { set; get; } |
|||
[ImporterHeader(Name = "单据编号")] |
|||
public string BillNum { set; get; } |
|||
|
|||
[ImporterHeader(Name = "单位")] |
|||
public string Unit { set; get; } |
|||
|
|||
[ImporterHeader(Name = "调拨数量")] |
|||
public decimal Qty { set; get; } |
|||
[ImporterHeader(Name = "调出仓库")] |
|||
public string Output { set; get; } |
|||
[ImporterHeader(Name = "调出仓库代码")] |
|||
public string OutputCode { set; get; } |
|||
[ImporterHeader(Name = "调入仓库")] |
|||
|
|||
public string Input { set; get; } |
|||
[ImporterHeader(Name = "调入仓库代码")] |
|||
public string InputCode { set; get; } |
|||
[ImporterHeader(Name = "辅助出库关联数量")] |
|||
public decimal OutputAssQty { set; get; } |
|||
[ImporterHeader(Name = "规格型号")] |
|||
public string Model { set; get; } |
|||
[ImporterHeader(Name = "基本出库关联数量")] |
|||
public decimal OutputQty { set; get; } |
|||
[ImporterHeader(Name = "批号")] |
|||
public string BatchNum { set; get; } |
|||
[ImporterHeader(Name = "日期")] |
|||
public DateTime BillDate { set; get; } |
|||
[ImporterHeader(Name = "审核标志")] |
|||
public string Flag { get; set; } |
|||
[ImporterHeader(Name = "物料长代码")] |
|||
public string ErpMaterialCode { set; get; } |
|||
[ImporterHeader(Name = "期间")] |
|||
public string Version { get; set; } |
|||
} |
|||
public class ERPShippingDetailRequestDto: RequestDtoBase, IBranch<Guid> |
|||
{ |
|||
|
|||
|
|||
[ImporterHeader(Name = "保管")] |
|||
public string Person { set; get; } |
|||
[ImporterHeader(Name = "成本")] |
|||
public decimal Cost { set; get; } |
|||
[ImporterHeader(Name = "单据编号")] |
|||
public string BillNum { set; get; } |
|||
|
|||
[ImporterHeader(Name = "单位")] |
|||
public string Unit { set; get; } |
|||
|
|||
[ImporterHeader(Name = "调拨数量")] |
|||
public decimal Qty { set; get; } |
|||
[ImporterHeader(Name = "调出仓库")] |
|||
public string Output { set; get; } |
|||
[ImporterHeader(Name = "调出仓库代码",IsIgnore =true)] |
|||
public string OutputCode { set; get; } |
|||
[ImporterHeader(Name = "调入仓库")] |
|||
|
|||
public string Input { set; get; } |
|||
[ImporterHeader(Name = "调入仓库代码",IsIgnore =true)] |
|||
public string InputCode { set; get; } |
|||
[ImporterHeader(Name = "辅助出库关联数量")] |
|||
public decimal OutputAssQty { set; get; } |
|||
[ImporterHeader(Name = "规格型号")] |
|||
public string Model { set; get; } |
|||
[ImporterHeader(Name = "基本出库关联数量")] |
|||
public decimal OutputQty { set; get; } |
|||
[ImporterHeader(Name = "批号")] |
|||
public string BatchNum { set; get; } |
|||
[ImporterHeader(Name = "日期")] |
|||
public DateTime BillDate { set; get; } |
|||
[ImporterHeader(Name = "审核标志")] |
|||
public string Flag { get; set; } |
|||
[ImporterHeader(Name = "物料长代码")] |
|||
public string ErpMaterialCode { set; get; } |
|||
[ImporterHeader(Name = "期间")] |
|||
public string Version { get; set; } |
|||
public Guid BranchId { get; set; } |
|||
} |
|||
public class ERPShippingDetailExportDto |
|||
{ |
|||
|
|||
|
|||
[Display(Name = "保管")] |
|||
public string Person { set; get; } |
|||
[Display(Name = "成本")] |
|||
public decimal Cost { set; get; } |
|||
[Display(Name = "单据编号")] |
|||
public string BillNum { set; get; } |
|||
|
|||
[Display(Name = "单位")] |
|||
public string Unit { set; get; } |
|||
|
|||
[Display(Name = "调拨数量")] |
|||
public decimal Qty { set; get; } |
|||
[Display(Name = "调出仓库")] |
|||
public string Output { set; get; } |
|||
[Display(Name = "调出仓库代码")] |
|||
public string OutputCode { set; get; } |
|||
[Display(Name = "调入仓库")] |
|||
|
|||
public string Input { set; get; } |
|||
[Display(Name = "调入仓库代码")] |
|||
public string InputCode { set; get; } |
|||
[Display(Name = "辅助出库关联数量")] |
|||
public decimal OutputAssQty { set; get; } |
|||
[Display(Name = "规格型号")] |
|||
public string Model { set; get; } |
|||
[Display(Name = "基本出库关联数量")] |
|||
public decimal OutputQty { set; get; } |
|||
[Display(Name = "批号")] |
|||
public string BatchNum { set; get; } |
|||
[Display(Name = "日期")] |
|||
public DateTime BillDate { set; get; } |
|||
[Display(Name = "审核标志")] |
|||
public string Flag { get; set; } |
|||
[Display(Name = "物料长代码")] |
|||
public string ErpMaterialCode { set; get; } |
|||
[Display(Name = "期间")] |
|||
public string Version { get; set; } |
|||
} |
|||
|
|||
|
|||
|
|||
public class ERPShippingVersionRequestDto : RequestDtoBase, IBranch<Guid> |
|||
{ |
|||
|
|||
public string Year { get; private set; } |
|||
/// <summary>
|
|||
/// 期间
|
|||
/// </summary>
|
|||
public string Period { get; private set; } |
|||
/// <summary>
|
|||
/// 版本号
|
|||
/// </summary>
|
|||
public string Version { get; private set; } |
|||
|
|||
/// <summary>
|
|||
/// 客户号
|
|||
/// </summary>
|
|||
public string CustomerCode { private set; get; } |
|||
public Guid BranchId { get; set; } |
|||
} |
|||
|
|||
|
|||
public class ERPShippingVersionDto |
|||
{ |
|||
public string Year { get; set; } |
|||
/// <summary>
|
|||
/// 期间
|
|||
/// </summary>
|
|||
public string Period { get; set; } |
|||
/// <summary>
|
|||
/// 版本号
|
|||
/// </summary>
|
|||
public string Version { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 客户号
|
|||
/// </summary>
|
|||
public string CustomerCode { set; get; } |
|||
|
|||
|
|||
public string Factory { set; get; } |
|||
|
|||
} |
|||
|
|||
|
|||
} |
@ -0,0 +1,273 @@ |
|||
using Magicodes.ExporterAndImporter.Core; |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Text; |
|||
using System.Threading.Tasks; |
|||
using Win.Sfs.Shared; |
|||
using Win.Sfs.Shared.DtoBase; |
|||
|
|||
namespace Win.Sfs.SettleAccount.Entities.HQExtend |
|||
{ |
|||
public class HQKBExtendDto |
|||
{ |
|||
|
|||
|
|||
[ImporterHeader(Name = "试制任务单编号")] |
|||
|
|||
public string TaskBillNum { get; set; } |
|||
[ImporterHeader(Name = "采购申请单号")] |
|||
public string BillNum { get; set; } |
|||
[ImporterHeader(Name = "零件名称")] |
|||
public string MaterialDesc { get; set; } |
|||
[ImporterHeader(Name = "零件号")] |
|||
public string MaterialCode { get; set; } |
|||
[ImporterHeader(Name = "数量")] |
|||
public decimal Qty { get; set; } |
|||
[ImporterHeader(Name = "无税单价")] |
|||
public decimal Price { get; set; } |
|||
|
|||
[ImporterHeader(Name = "无税金额")] |
|||
public decimal Amt { get; set; } |
|||
[ImporterHeader(Name = "税率")] |
|||
public decimal Tax { get; set; } |
|||
[ImporterHeader(Name = "税额合计")] |
|||
public decimal TaxAmt { get; set; } |
|||
[ImporterHeader(Name = "价税合计")] |
|||
public decimal TotalAmt { get; set; } |
|||
[ImporterHeader(Name = "版本号", IsIgnore = false)] |
|||
public string Version { get; set; } |
|||
} |
|||
|
|||
|
|||
public class HQKBExtendRequestDto : RequestDtoBase, IBranch<Guid> |
|||
{ |
|||
[ImporterHeader(Name = "试制任务单编号")] |
|||
|
|||
public string TaskBillNum { get; set; } |
|||
[ImporterHeader(Name = "采购申请单号")] |
|||
public string BillNum { get; set; } |
|||
[ImporterHeader(Name = "零件名称")] |
|||
public string MaterialDesc { get; set; } |
|||
[ImporterHeader(Name = "零件号")] |
|||
public string MaterialCode { get; set; } |
|||
[ImporterHeader(Name = "数量")] |
|||
public decimal Qty { get; set; } |
|||
[ImporterHeader(Name = "无税单价")] |
|||
public decimal Price { get; set; } |
|||
|
|||
[ImporterHeader(Name = "无税金额")] |
|||
public decimal Amt { get; set; } |
|||
[ImporterHeader(Name = "税率")] |
|||
public decimal Tax { get; set; } |
|||
[ImporterHeader(Name = "税额合计")] |
|||
public decimal TaxAmt { get; set; } |
|||
[ImporterHeader(Name = "价税合计")] |
|||
public decimal TotalAmt { get; set; } |
|||
[ImporterHeader(Name = "版本号", IsIgnore = false)] |
|||
public string Version { get; set; } |
|||
public Guid BranchId { get; set; } |
|||
} |
|||
|
|||
public class HQKBExtendExportDto |
|||
{ |
|||
[ExporterHeader(DisplayName = "试制任务单编号")] |
|||
|
|||
public string TaskBillNum { get; set; } |
|||
[ExporterHeader(DisplayName = "采购申请单号")] |
|||
public string BillNum { get; set; } |
|||
[ExporterHeader(DisplayName = "零件名称")] |
|||
public string MaterialDesc { get; set; } |
|||
[ExporterHeader(DisplayName = "零件号")] |
|||
public string MaterialCode { get; set; } |
|||
[ExporterHeader(DisplayName = "数量")] |
|||
public decimal Qty { get; set; } |
|||
[ExporterHeader(DisplayName = "无税单价")] |
|||
public decimal Price { get; set; } |
|||
|
|||
[ExporterHeader(DisplayName = "无税金额")] |
|||
public decimal Amt { get; set; } |
|||
[ExporterHeader(DisplayName = "税率")] |
|||
public decimal Tax { get; set; } |
|||
[ExporterHeader(DisplayName = "税额合计")] |
|||
public decimal TaxAmt { get; set; } |
|||
[ExporterHeader(DisplayName = "价税合计")] |
|||
public decimal TotalAmt { get; set; } |
|||
[ExporterHeader(DisplayName = "版本号")] |
|||
public string Version { get; set; } |
|||
} |
|||
public class HQKBExtendVersionRequestDto : RequestDtoBase, IBranch<Guid> |
|||
{ |
|||
|
|||
public string Year { get; private set; } |
|||
/// <summary>
|
|||
/// 期间
|
|||
/// </summary>
|
|||
public string Period { get; private set; } |
|||
/// <summary>
|
|||
/// 版本号
|
|||
/// </summary>
|
|||
public string Version { get; private set; } |
|||
|
|||
/// <summary>
|
|||
/// 客户号
|
|||
/// </summary>
|
|||
public string CustomerCode { private set; get; } |
|||
public Guid BranchId { get; set; } |
|||
} |
|||
|
|||
|
|||
public class HQKBExtendVersionDto |
|||
{ |
|||
public string Year { get; set; } |
|||
/// <summary>
|
|||
/// 期间
|
|||
/// </summary>
|
|||
public string Period { get; set; } |
|||
/// <summary>
|
|||
/// 版本号
|
|||
/// </summary>
|
|||
public string Version { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 客户号
|
|||
/// </summary>
|
|||
public string CustomerCode { set; get; } |
|||
|
|||
|
|||
public string Factory { set; get; } |
|||
|
|||
} |
|||
|
|||
public class HQKBSettleExtendDto |
|||
{ |
|||
|
|||
|
|||
[ImporterHeader(Name = "试制任务单编号")] |
|||
|
|||
public string TaskBillNum { get; set; } |
|||
[ImporterHeader(Name = "采购申请单号")] |
|||
public string BillNum { get; set; } |
|||
[ImporterHeader(Name = "零件名称")] |
|||
public string MaterialDesc { get; set; } |
|||
[ImporterHeader(Name = "零件号")] |
|||
public string MaterialCode { get; set; } |
|||
[ImporterHeader(Name = "数量")] |
|||
public decimal Qty { get; set; } |
|||
[ImporterHeader(Name = "无税单价")] |
|||
public decimal Price { get; set; } |
|||
|
|||
[ImporterHeader(Name = "无税金额")] |
|||
public decimal Amt { get; set; } |
|||
[ImporterHeader(Name = "税率")] |
|||
public decimal Tax { get; set; } |
|||
[ImporterHeader(Name = "税额合计")] |
|||
public decimal TaxAmt { get; set; } |
|||
[ImporterHeader(Name = "价税合计")] |
|||
public decimal TotalAmt { get; set; } |
|||
[ImporterHeader(Name = "版本号", IsIgnore = false)] |
|||
public string Version { get; set; } |
|||
} |
|||
|
|||
|
|||
public class HQKBSettleExtendRequestDto : RequestDtoBase, IBranch<Guid> |
|||
{ |
|||
[ImporterHeader(Name = "试制任务单编号")] |
|||
|
|||
public string TaskBillNum { get; set; } |
|||
[ImporterHeader(Name = "采购申请单号")] |
|||
public string BillNum { get; set; } |
|||
[ImporterHeader(Name = "零件名称")] |
|||
public string MaterialDesc { get; set; } |
|||
[ImporterHeader(Name = "零件号")] |
|||
public string MaterialCode { get; set; } |
|||
[ImporterHeader(Name = "数量")] |
|||
public decimal Qty { get; set; } |
|||
[ImporterHeader(Name = "无税单价")] |
|||
public decimal Price { get; set; } |
|||
|
|||
[ImporterHeader(Name = "无税金额")] |
|||
public decimal Amt { get; set; } |
|||
[ImporterHeader(Name = "税率")] |
|||
public decimal Tax { get; set; } |
|||
[ImporterHeader(Name = "税额合计")] |
|||
public decimal TaxAmt { get; set; } |
|||
[ImporterHeader(Name = "价税合计")] |
|||
public decimal TotalAmt { get; set; } |
|||
[ImporterHeader(Name = "版本号", IsIgnore = false)] |
|||
public string Version { get; set; } |
|||
public Guid BranchId { get; set; } |
|||
} |
|||
|
|||
public class HQKBSettleExtendExportDto |
|||
{ |
|||
[ExporterHeader(DisplayName = "试制任务单编号")] |
|||
|
|||
public string TaskBillNum { get; set; } |
|||
[ExporterHeader(DisplayName = "采购申请单号")] |
|||
public string BillNum { get; set; } |
|||
[ExporterHeader(DisplayName = "零件名称")] |
|||
public string MaterialDesc { get; set; } |
|||
[ExporterHeader(DisplayName = "零件号")] |
|||
public string MaterialCode { get; set; } |
|||
[ExporterHeader(DisplayName = "数量")] |
|||
public decimal Qty { get; set; } |
|||
[ExporterHeader(DisplayName = "无税单价")] |
|||
public decimal Price { get; set; } |
|||
|
|||
[ExporterHeader(DisplayName = "无税金额")] |
|||
public decimal Amt { get; set; } |
|||
[ExporterHeader(DisplayName = "税率")] |
|||
public decimal Tax { get; set; } |
|||
[ExporterHeader(DisplayName = "税额合计")] |
|||
public decimal TaxAmt { get; set; } |
|||
[ExporterHeader(DisplayName = "价税合计")] |
|||
public decimal TotalAmt { get; set; } |
|||
[ExporterHeader(DisplayName = "版本号")] |
|||
public string Version { get; set; } |
|||
} |
|||
public class HQKBSettleExtendVersionRequestDto : RequestDtoBase, IBranch<Guid> |
|||
{ |
|||
|
|||
public string Year { get; private set; } |
|||
/// <summary>
|
|||
/// 期间
|
|||
/// </summary>
|
|||
public string Period { get; private set; } |
|||
/// <summary>
|
|||
/// 版本号
|
|||
/// </summary>
|
|||
public string Version { get; private set; } |
|||
|
|||
/// <summary>
|
|||
/// 客户号
|
|||
/// </summary>
|
|||
public string CustomerCode { private set; get; } |
|||
public Guid BranchId { get; set; } |
|||
} |
|||
|
|||
|
|||
public class HQKBSettleExtendVersionDto |
|||
{ |
|||
public string Year { get; set; } |
|||
/// <summary>
|
|||
/// 期间
|
|||
/// </summary>
|
|||
public string Period { get; set; } |
|||
/// <summary>
|
|||
/// 版本号
|
|||
/// </summary>
|
|||
public string Version { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 客户号
|
|||
/// </summary>
|
|||
public string CustomerCode { set; get; } |
|||
|
|||
|
|||
public string Factory { set; get; } |
|||
|
|||
} |
|||
|
|||
|
|||
} |
@ -0,0 +1,334 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Diagnostics; |
|||
using System.Linq; |
|||
using System.Threading.Tasks; |
|||
using EFCore.BulkExtensions; |
|||
using Magicodes.ExporterAndImporter.Core; |
|||
using Magicodes.ExporterAndImporter.Csv; |
|||
using Magicodes.ExporterAndImporter.Excel; |
|||
using Microsoft.AspNetCore.Authorization; |
|||
using Microsoft.AspNetCore.Http; |
|||
using Microsoft.AspNetCore.Mvc; |
|||
using Microsoft.EntityFrameworkCore; |
|||
using Microsoft.Extensions.Caching.Distributed; |
|||
using Shouldly; |
|||
using Volo.Abp; |
|||
using Volo.Abp.Application.Dtos; |
|||
using Volo.Abp.Application.Services; |
|||
using Volo.Abp.Caching; |
|||
using Volo.Abp.Domain.Repositories; |
|||
using Volo.Abp.Guids; |
|||
using Volo.Abp.ObjectMapping; |
|||
using Volo.Abp.Uow; |
|||
using Win.Abp.Snowflakes; |
|||
using Win.Sfs.BaseData.ImportExcelCommon; |
|||
using Win.Sfs.SettleAccount.BTCarConsigns; |
|||
using Win.Sfs.SettleAccount.CommonManagers; |
|||
using Win.Sfs.SettleAccount.Constant; |
|||
using Win.Sfs.SettleAccount.Entities.BTCarConsigns; |
|||
using Win.Sfs.SettleAccount.ExcelImporter; |
|||
using Win.Sfs.Shared.CacheBase; |
|||
using Win.Sfs.Shared.Filter; |
|||
using Win.Utils; |
|||
|
|||
namespace Win.Sfs.SettleAccount.BTCarConsigns |
|||
{ |
|||
|
|||
/// <summary>
|
|||
/// 区域相关应用服务
|
|||
/// </summary>
|
|||
//[AuthorizeSettleAccountPermissions.BTCarConsigns.Default)]
|
|||
[Route("api/settleaccount/BTCarConsign")] |
|||
public class BTCarConsignAppService : SettleAccountApplicationBase<BTCarConsign>, IBTCarConsignAppService |
|||
{ |
|||
private readonly IGuidGenerator _guidGenerator; |
|||
|
|||
private readonly IObjectMapper _objectMapper; |
|||
|
|||
private readonly IExcelImportAppService _excelImportService; |
|||
|
|||
|
|||
private readonly ISettleAccountBranchEfCoreRepository<BTCarConsign, Guid> _repository; |
|||
|
|||
private readonly ISettleAccountBranchEfCoreRepository<BTCarConsignVersion, Guid> _versionRepository; |
|||
/// <summary>
|
|||
/// 构建方法
|
|||
/// </summary>
|
|||
/// <param name="guidGenerator">构建UID</param>
|
|||
/// <param name="objectMapper">自动map</param>
|
|||
/// <param name="repository">仓储接口</param>
|
|||
/// <param name="cache">缓存</param>
|
|||
public BTCarConsignAppService(IGuidGenerator guidGenerator, |
|||
IObjectMapper objectMapper, |
|||
IExcelImportAppService excelImportService, |
|||
ISnowflakeIdGenerator snowflakeIdGenerator, |
|||
ICommonManager commonManager, |
|||
ISettleAccountBranchEfCoreRepository<BTCarConsign, Guid> repository, |
|||
ISettleAccountBranchEfCoreRepository<BTCarConsignVersion, Guid> versionRepository, |
|||
IDistributedCache<BTCarConsign> cache |
|||
) : base(cache,excelImportService,snowflakeIdGenerator,commonManager) |
|||
{ |
|||
_guidGenerator = guidGenerator; |
|||
_objectMapper = objectMapper; |
|||
_repository = repository; |
|||
_excelImportService = excelImportService; |
|||
_versionRepository = versionRepository; |
|||
} |
|||
|
|||
#region 导入导出功能
|
|||
/// <summary>
|
|||
/// 导入功能
|
|||
/// </summary>
|
|||
/// <param name="files">上传的文件(前端已经限制只能上传一个附件)</param>
|
|||
/// <returns></returns>
|
|||
[HttpPost] |
|||
[Route("ExcelImport")] |
|||
[DisableRequestSizeLimit] |
|||
//[AuthorizeSettleAccountPermissions.BTCarConsigns.Default)]
|
|||
public async Task<string> BTCarConsignUploadExcelImport([FromForm] IFormFileCollection files, Guid branchId, string year, string period, string version, string customerCode,DateTime datetime) |
|||
{ |
|||
ExportImporter _exportImporter = new ExportImporter(); |
|||
var result = await _exportImporter.UploadExcelImport<ImportBTCarConsignDto>(files, _excelImportService); |
|||
var entityList = ObjectMapper.Map<List<ImportBTCarConsignDto>, List<BTCarConsign>>(result); |
|||
|
|||
|
|||
var _versionQuery = _versionRepository.Where(p => p.Version == version && p.CustomerCode==customerCode); |
|||
await _versionQuery.BatchDeleteAsync(); |
|||
var _query = _repository.Where(p => p.Version == version && p.CustomerCode==customerCode); |
|||
await _query.BatchDeleteAsync(); |
|||
var _id = GuidGenerator.Create(); |
|||
var _BTCarConsignList = new List<BTCarConsignVersion>(); |
|||
_BTCarConsignList.Add(new BTCarConsignVersion(_id, branchId, period, version, customerCode, datetime)); |
|||
foreach (var itm in entityList) |
|||
{ |
|||
itm.SetValue(GuidGenerator.Create(), branchId, period, version, customerCode, datetime, _id); |
|||
} |
|||
var bulkConfig = new BulkConfig { SetOutputIdentity = true, BatchSize = 10000 }; |
|||
await _repository.GetDbContext().BulkInsertAsync<BTCarConsign>(entityList); |
|||
await _versionRepository.GetDbContext().BulkInsertAsync(_BTCarConsignList); |
|||
return ApplicationConsts.SuccessStr; |
|||
} |
|||
|
|||
|
|||
#endregion
|
|||
|
|||
/// <summary>
|
|||
/// 按ID获取唯一实体
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 返回实体全部属性
|
|||
/// </remarks>
|
|||
/// <param name="id">ID</param>
|
|||
/// <returns>实体DTO</returns>
|
|||
[HttpGet] |
|||
[Route("{id}")] |
|||
//[AuthorizeSettleAccountPermissions.BTCarConsigns.Default)]
|
|||
virtual public async Task<BTCarConsignDto> GetAsync(Guid id) |
|||
{ |
|||
var result = await _repository.GetAsync(id); |
|||
var dto = _objectMapper.Map<BTCarConsign, BTCarConsignDto>(result); |
|||
return dto; |
|||
} |
|||
|
|||
|
|||
private async Task<BTCarConsign> GetFromCacheAsync(Guid id) |
|||
{ |
|||
var result = |
|||
await _repository.GetAsync(id) |
|||
; |
|||
|
|||
return result; |
|||
} |
|||
|
|||
private async Task<long> GetCountAsync(BTCarConsignRequestDto input) |
|||
{ |
|||
return await _repository.GetCountByFilterAsync(input.BranchId, input.Filters); |
|||
} |
|||
|
|||
private async Task<long> GetCountAsync(BTCarConsignVersionRequestDto input) |
|||
{ |
|||
return await _versionRepository.GetCountByFilterAsync(input.BranchId, input.Filters); |
|||
} |
|||
/// <summary>
|
|||
/// 获取实体总数
|
|||
/// </summary>
|
|||
/// <returns>实体总数</returns>
|
|||
[HttpGet] |
|||
[Route("count")] |
|||
//[AuthorizeSettleAccountPermissions.BTCarConsigns.Default)]
|
|||
virtual public async Task<long> GetTotalCountAsync(Guid branchId) |
|||
{ |
|||
return await _repository.GetCountAsync(branchId); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 删除实体
|
|||
/// </summary>
|
|||
/// <param name="id">ID</param>
|
|||
/// <returns>无</returns>
|
|||
[HttpDelete] |
|||
[Route("{id}")] |
|||
//[AuthorizeSettleAccountPermissions.BTCarConsigns.Delete)]
|
|||
virtual public async Task DeleteAsync(Guid id) |
|||
{ |
|||
//var entity = await GetFromCacheAsync(id);
|
|||
//await Cache.DeleteAsync<BTCarConsign>(id.ToString());
|
|||
await _repository.DeleteAsync(id); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 按IDs删除实体列表
|
|||
/// </summary>
|
|||
/// <param name="ids">IDs</param>
|
|||
/// <returns>是否执行成功</returns>
|
|||
[HttpPost] |
|||
[Route("delete")] |
|||
//[AuthorizeSettleAccountPermissions.BTCarConsigns.Delete)]
|
|||
virtual public async Task<bool> DeleteListAsync(List<Guid> ids) |
|||
{ |
|||
//foreach (var id in ids)
|
|||
//{
|
|||
// var entity = await GetFromCacheAsync(id);
|
|||
|
|||
//}
|
|||
|
|||
return await _repository.DeleteListAsync(ids); |
|||
} |
|||
|
|||
|
|||
///// <summary>
|
|||
|
|||
/// <summary>
|
|||
/// 根据筛选条件获取实体列表
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 请求条件包括:筛选条件列表,排序条件,数据数量,页码
|
|||
/// </remarks>
|
|||
/// <param name="input">请求条件</param>
|
|||
/// <returns>实体DTO列表</returns>
|
|||
[HttpPost] |
|||
[Route("list")] |
|||
//[AuthorizeSettleAccountPermissions.BTCarConsigns.Default)]
|
|||
|
|||
|
|||
public async Task<PagedResultDto<BTCarConsignDto>> GetListAsync(Guid parentId,BTCarConsignRequestDto input) |
|||
{ |
|||
if (input.ParentId != Guid.Empty) |
|||
{ |
|||
input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "ParentId", Logic = EnumFilterLogic.And, Value = input.ParentId.ToString() }); |
|||
} |
|||
else |
|||
{ |
|||
return new PagedResultDto<BTCarConsignDto>(0, new List<BTCarConsignDto>()); |
|||
} |
|||
|
|||
var entities = await _repository.GetListByFilterAsync(input.BranchId, input.Filters, input.Sorting, input.MaxResultCount, |
|||
input.SkipCount, true); |
|||
|
|||
var totalCount = await GetCountAsync(input); |
|||
var dtos = _objectMapper.Map<List<BTCarConsign>, List<BTCarConsignDto>>(entities); |
|||
|
|||
return new PagedResultDto<BTCarConsignDto>(totalCount, dtos); |
|||
} |
|||
|
|||
///// <summary>
|
|||
|
|||
/// <summary>
|
|||
/// 根据筛选条件获取实体列表
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 请求条件包括:筛选条件列表,排序条件,数据数量,页码
|
|||
/// </remarks>
|
|||
/// <param name="input">请求条件</param>
|
|||
/// <returns>实体DTO列表</returns>
|
|||
[HttpPost] |
|||
[Route("listVersion")] |
|||
//[AuthorizeSettleAccountPermissions.BTCarConsigns.Default)]
|
|||
public async Task<PagedResultDto<BTCarConsignVersionDto>> GetVersionListAsync(BTCarConsignVersionRequestDto input) |
|||
{ |
|||
var entities = await _versionRepository.GetListByFilterAsync(input.BranchId, input.Filters, input.Sorting, int.MaxValue, |
|||
input.SkipCount, true); |
|||
|
|||
var totalCount = await GetCountAsync(input); |
|||
var dtos = _objectMapper.Map<List<BTCarConsignVersion>, List<BTCarConsignVersionDto>>(entities); |
|||
foreach (var itm in dtos) |
|||
{ |
|||
itm.Version = itm.Version + string.Format("({0})", itm.CustomerCode); |
|||
} |
|||
return new PagedResultDto<BTCarConsignVersionDto>(totalCount, dtos); |
|||
} |
|||
/// <summary>
|
|||
/// 导出文件
|
|||
/// </summary>
|
|||
/// <param name="input"></param>
|
|||
/// <returns></returns>
|
|||
[HttpPost] |
|||
[Route("Export")] |
|||
//[AuthorizeSettleAccountPermissions.BTCarConsigns.Default)]
|
|||
virtual public async Task<string> ExportAsync(BTCarConsignRequestDto input) |
|||
{ |
|||
|
|||
IExporter _csv = new CsvExporter(); |
|||
|
|||
IExporter _excel = new ExcelExporter(); |
|||
|
|||
if (input.ParentId != Guid.Empty) |
|||
{ |
|||
input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "ParentId", Logic = EnumFilterLogic.And, Value = input.ParentId.ToString() }); |
|||
} |
|||
var entities = await _repository.GetListByFilterAsync(input.BranchId, input.Filters, input.Sorting, int.MaxValue, |
|||
0, true); |
|||
|
|||
var dtoDetails = ObjectMapper.Map<List<BTCarConsign>, List<ExportBTCarConsignDto>>(entities); |
|||
|
|||
string _fileName = string.Empty; |
|||
//声明导出容器
|
|||
|
|||
//byte[] result = null;
|
|||
//_fileName = CommonMethod.GetExcelFileNameByUserID(ApplicationConsts.Sec_BTCarConsignFileName, CurrentUser.Id?.ToString(), ApplicationConsts.FileExtension);
|
|||
|
|||
byte[] result = null; |
|||
switch (input.FileType) |
|||
{ |
|||
case 0: |
|||
_fileName = CommonMethod.GetExcelFileNameByUserID(ApplicationConsts.Sec_BTCarConsignFileName, CurrentUser.Id?.ToString(), ".csv"); |
|||
result = await _csv.ExportAsByteArray(dtoDetails); |
|||
break; |
|||
case 1: |
|||
_fileName = CommonMethod.GetExcelFileNameByUserID(ApplicationConsts.Sec_BTCarConsignFileName, CurrentUser.Id?.ToString(),ApplicationConsts.FileExtension); |
|||
result = await _excel.ExportAsByteArray(dtoDetails); |
|||
break; |
|||
} |
|||
|
|||
result.ShouldNotBeNull(); |
|||
|
|||
//保存导出文件到服务器存成二进制
|
|||
await _excelImportService.SaveBlobAsync( |
|||
new SaveExcelImportInputDto |
|||
{ |
|||
Name = _fileName, |
|||
Content = result |
|||
} |
|||
); |
|||
return _fileName; |
|||
} |
|||
[HttpPost] |
|||
[Route("btupdate")] |
|||
|
|||
[UnitOfWork(isTransactional: false)] |
|||
public async Task<bool> UPdateFisAsync() |
|||
{ |
|||
|
|||
await _repository.GetDbContext().Database.ExecuteSqlRawAsync( |
|||
"EXEC sp_bt_update" |
|||
); |
|||
return true; |
|||
|
|||
|
|||
|
|||
} |
|||
|
|||
|
|||
} |
|||
} |
@ -0,0 +1,369 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Diagnostics; |
|||
using System.Linq; |
|||
using System.Threading.Tasks; |
|||
using EFCore.BulkExtensions; |
|||
using Magicodes.ExporterAndImporter.Core; |
|||
using Magicodes.ExporterAndImporter.Csv; |
|||
using Magicodes.ExporterAndImporter.Excel; |
|||
using Microsoft.AspNetCore.Authorization; |
|||
using Microsoft.AspNetCore.Http; |
|||
using Microsoft.AspNetCore.Mvc; |
|||
using Microsoft.EntityFrameworkCore; |
|||
using Microsoft.Extensions.Caching.Distributed; |
|||
using Shouldly; |
|||
using Volo.Abp; |
|||
using Volo.Abp.Application.Dtos; |
|||
using Volo.Abp.Application.Services; |
|||
using Volo.Abp.Caching; |
|||
using Volo.Abp.Domain.Repositories; |
|||
using Volo.Abp.Guids; |
|||
using Volo.Abp.ObjectMapping; |
|||
using Volo.Abp.Uow; |
|||
using Win.Abp.Snowflakes; |
|||
using Win.Sfs.BaseData.ImportExcelCommon; |
|||
using Win.Sfs.SettleAccount.BTCarKBs; |
|||
using Win.Sfs.SettleAccount.CommonManagers; |
|||
using Win.Sfs.SettleAccount.Constant; |
|||
using Win.Sfs.SettleAccount.Entities.BTCarKBFirsts; |
|||
using Win.Sfs.SettleAccount.Entities.BTCarKBs; |
|||
using Win.Sfs.SettleAccount.Entities.Materials; |
|||
using Win.Sfs.SettleAccount.ExcelImporter; |
|||
using Win.Sfs.SettleAccount.ExportReports; |
|||
using Win.Sfs.SettleAccount.MaterialRelationships; |
|||
using Win.Sfs.Shared.CacheBase; |
|||
using Win.Sfs.Shared.Filter; |
|||
using Win.Utils; |
|||
|
|||
namespace Win.Sfs.SettleAccount.BTCarKBFirsts |
|||
{ |
|||
|
|||
/// <summary>
|
|||
/// 区域相关应用服务
|
|||
/// </summary>
|
|||
//[AuthorizeSettleAccountPermissions.BTCarKBFirsts.Default)]
|
|||
[Route("api/settleaccount/BTCarKBFirst")] |
|||
public class BTCarKBFirstAppService : SettleAccountApplicationBase<BTCarKB>, IBTCarKBFirstAppService |
|||
{ |
|||
private readonly IGuidGenerator _guidGenerator; |
|||
|
|||
private readonly IObjectMapper _objectMapper; |
|||
|
|||
private readonly IExcelImportAppService _excelImportService; |
|||
|
|||
|
|||
private readonly ISettleAccountBranchEfCoreRepository<BTCarKB, Guid> _repository; |
|||
|
|||
private readonly ISettleAccountBranchEfCoreRepository<BTCarKBVersion, Guid> _versionRepository; |
|||
private readonly ISettleAccountBranchEfCoreRepository<MaterialRelationship, Guid> _MaterialRepository; |
|||
/// <summary>
|
|||
/// 构建方法
|
|||
/// </summary>
|
|||
/// <param name="guidGenerator">构建UID</param>
|
|||
/// <param name="objectMapper">自动map</param>
|
|||
/// <param name="repository">仓储接口</param>
|
|||
/// <param name="cache">缓存</param>
|
|||
public BTCarKBFirstAppService(IGuidGenerator guidGenerator, |
|||
IObjectMapper objectMapper, |
|||
IExcelImportAppService excelImportService, |
|||
ISnowflakeIdGenerator snowflakeIdGenerator, |
|||
ICommonManager commonManager, |
|||
ISettleAccountBranchEfCoreRepository<BTCarKB, Guid> repository, |
|||
ISettleAccountBranchEfCoreRepository<BTCarKBVersion, Guid> versionRepository, |
|||
ISettleAccountBranchEfCoreRepository<MaterialRelationship, Guid> MaterialRepository, |
|||
IDistributedCache<BTCarKB> cache |
|||
) : base(cache,excelImportService,snowflakeIdGenerator,commonManager) |
|||
{ |
|||
_guidGenerator = guidGenerator; |
|||
_objectMapper = objectMapper; |
|||
_repository = repository; |
|||
_excelImportService = excelImportService; |
|||
_versionRepository = versionRepository; |
|||
_MaterialRepository = MaterialRepository; |
|||
} |
|||
|
|||
#region 导入导出功能
|
|||
/// <summary>
|
|||
/// 导入功能
|
|||
/// </summary>
|
|||
/// <param name="files">上传的文件(前端已经限制只能上传一个附件)</param>
|
|||
/// <returns></returns>
|
|||
[HttpPost] |
|||
[Route("ExcelImport")] |
|||
[DisableRequestSizeLimit] |
|||
//[AuthorizeSettleAccountPermissions.BTCarKBFirsts.Default)]
|
|||
|
|||
public async Task<string> BTCarKBFirstUploadExcelImport([FromForm] IFormFileCollection files, Guid branchId, string year, string period, string version, string customerCode) |
|||
{ |
|||
ExportImporter _exportImporter = new ExportImporter(); |
|||
var result = await _exportImporter.UploadExcelImport<ImportBTCarKBFirstDto>(files, _excelImportService); |
|||
var entityList = ObjectMapper.Map<List<ImportBTCarKBFirstDto>, List<BTCarKB>>(result); |
|||
|
|||
var checkList = new List<ErrorExportDto>(); |
|||
|
|||
bool _iscreate = false; |
|||
var _versionQuery = _versionRepository.FirstOrDefault(p => p.Version == version && p.CustomerCode == customerCode); |
|||
if (_versionQuery == null) |
|||
{ |
|||
_iscreate = true; |
|||
} |
|||
Guid _id = Guid.Empty; |
|||
if (_iscreate == true) |
|||
{ |
|||
_id = GuidGenerator.Create(); |
|||
} |
|||
else |
|||
{ |
|||
_id = _versionQuery.Id; |
|||
} |
|||
//List<String> errorList = new List<string>();
|
|||
DateTime datetime= entityList[0].DeliveryDateTime; |
|||
foreach (var itm in entityList) |
|||
{ |
|||
//通过《零件关系匹配设置表》验证物料号
|
|||
if (!_MaterialRepository.Any(p => p.ShipMaterailCode == itm.MaterialCode)) |
|||
{ |
|||
checkList.Add(new ErrorExportDto(version, customerCode, string.Empty, string.Empty, string.Empty, string.Empty, string.Format("发货看板物料号:{0}在《零件关系匹配设置表》中不存在!", itm.MaterialCode), string.Empty)); |
|||
//errorList.Add(string.Format("发货看板物料号:{0}在《零件关系匹配设置表》中不存在!", itm.MaterialCode));
|
|||
} |
|||
else |
|||
{ |
|||
datetime = itm.DeliveryDateTime; |
|||
var _entity = _repository.FirstOrDefault(p => p.CustomerCode == customerCode && p.Version == version && p.MaterialCode == itm.MaterialCode && p.OrderKBCode == itm.OrderKBCode); |
|||
if (_entity == null) |
|||
{ |
|||
_entity = new BTCarKB(GuidGenerator.Create(), GuidGenerator.Create(), period, customerCode, datetime, version, itm.MaterialCode, itm.MaterialDesc |
|||
, itm.NeedQty, itm.OrderKBCode, itm.ReceiveAreaCode, itm.ReceiveAreaName, itm.DeliveryDateTime, itm.ConsignQty, itm.State, _id); |
|||
await _repository.InsertAsync(_entity); |
|||
} |
|||
else |
|||
{ |
|||
_entity.SetValue(_entity.Id, branchId, period, version, customerCode, datetime, _id); |
|||
await _repository.UpdateAsync(_entity); |
|||
} |
|||
} |
|||
} |
|||
if (checkList.Count > 0) |
|||
{ |
|||
return await ExportErrorReportAsync(checkList); |
|||
} |
|||
//var bulkConfig = new BulkConfig { SetOutputIdentity = true, BatchSize = 10000 };
|
|||
// await _repository.GetDbContext().BulkInsertAsync<BTCarKB>(entityList);
|
|||
if (_iscreate == true) |
|||
{ |
|||
var _BTCarKBFirstList = new List<BTCarKBVersion>(); |
|||
_BTCarKBFirstList.Add(new BTCarKBVersion(_id, branchId, period, version, customerCode, datetime)); |
|||
await _versionRepository.GetDbContext().BulkInsertAsync(_BTCarKBFirstList); |
|||
} |
|||
//st.Stop();
|
|||
return ApplicationConsts.SuccessStr; |
|||
} |
|||
|
|||
|
|||
#endregion
|
|||
|
|||
/// <summary>
|
|||
/// 按ID获取唯一实体
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 返回实体全部属性
|
|||
/// </remarks>
|
|||
/// <param name="id">ID</param>
|
|||
/// <returns>实体DTO</returns>
|
|||
[HttpGet] |
|||
[Route("{id}")] |
|||
//[AuthorizeSettleAccountPermissions.BTCarKBFirsts.Default)]
|
|||
virtual public async Task<BTCarKBFirstDto> GetAsync(Guid id) |
|||
{ |
|||
var result = await _repository.GetAsync(id); |
|||
var dto = _objectMapper.Map<BTCarKB, BTCarKBFirstDto>(result); |
|||
return dto; |
|||
} |
|||
|
|||
|
|||
private async Task<BTCarKB> GetFromCacheAsync(Guid id) |
|||
{ |
|||
var result = |
|||
await _repository.GetAsync(id) |
|||
; |
|||
|
|||
return result; |
|||
} |
|||
|
|||
private async Task<long> GetCountAsync(BTCarKBRequestDto input) |
|||
{ |
|||
return await _repository.GetCountByFilterAsync(input.BranchId, input.Filters); |
|||
} |
|||
|
|||
private async Task<long> GetCountAsync(BTCarKBVersionRequestDto input) |
|||
{ |
|||
return await _versionRepository.GetCountByFilterAsync(input.BranchId, input.Filters); |
|||
} |
|||
/// <summary>
|
|||
/// 获取实体总数
|
|||
/// </summary>
|
|||
/// <returns>实体总数</returns>
|
|||
[HttpGet] |
|||
[Route("count")] |
|||
//[AuthorizeSettleAccountPermissions.BTCarKBFirsts.Default)]
|
|||
virtual public async Task<long> GetTotalCountAsync(Guid branchId) |
|||
{ |
|||
return await _repository.GetCountAsync(branchId); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 删除实体
|
|||
/// </summary>
|
|||
/// <param name="id">ID</param>
|
|||
/// <returns>无</returns>
|
|||
[HttpDelete] |
|||
[Route("{id}")] |
|||
//[AuthorizeSettleAccountPermissions.BTCarKBFirsts.Delete)]
|
|||
virtual public async Task DeleteAsync(Guid id) |
|||
{ |
|||
//var entity = await GetFromCacheAsync(id);
|
|||
//await Cache.DeleteAsync<BTCarKBFirst>(id.ToString());
|
|||
await _repository.DeleteAsync(id); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 按IDs删除实体列表
|
|||
/// </summary>
|
|||
/// <param name="ids">IDs</param>
|
|||
/// <returns>是否执行成功</returns>
|
|||
[HttpPost] |
|||
[Route("delete")] |
|||
//[AuthorizeSettleAccountPermissions.BTCarKBFirsts.Delete)]
|
|||
virtual public async Task<bool> DeleteListAsync(List<Guid> ids) |
|||
{ |
|||
//foreach (var id in ids)
|
|||
//{
|
|||
// var entity = await GetFromCacheAsync(id);
|
|||
|
|||
//}
|
|||
|
|||
return await _repository.DeleteListAsync(ids); |
|||
} |
|||
|
|||
|
|||
///// <summary>
|
|||
|
|||
/// <summary>
|
|||
/// 根据筛选条件获取实体列表
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 请求条件包括:筛选条件列表,排序条件,数据数量,页码
|
|||
/// </remarks>
|
|||
/// <param name="input">请求条件</param>
|
|||
/// <returns>实体DTO列表</returns>
|
|||
[HttpPost] |
|||
[Route("list")] |
|||
//[AuthorizeSettleAccountPermissions.BTCarKBFirsts.Default)]
|
|||
|
|||
|
|||
public async Task<PagedResultDto<BTCarKBDto>> GetListAsync(Guid parentId, BTCarKBRequestDto input) |
|||
{ |
|||
if (input.ParentId!=Guid.Empty) |
|||
{ |
|||
input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "ParentId", Logic = EnumFilterLogic.And, Value = input.ParentId.ToString() }); |
|||
} |
|||
else |
|||
{ |
|||
return new PagedResultDto<BTCarKBDto>(0, new List<BTCarKBDto>()); |
|||
} |
|||
|
|||
var entities = await _repository.GetListByFilterAsync(input.BranchId, input.Filters, input.Sorting, input.MaxResultCount, |
|||
input.SkipCount, true); |
|||
|
|||
var totalCount = await GetCountAsync(input); |
|||
var dtos = _objectMapper.Map<List<BTCarKB>, List<BTCarKBDto>>(entities); |
|||
|
|||
return new PagedResultDto<BTCarKBDto>(totalCount, dtos); |
|||
} |
|||
|
|||
///// <summary>
|
|||
|
|||
/// <summary>
|
|||
/// 根据筛选条件获取实体列表
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 请求条件包括:筛选条件列表,排序条件,数据数量,页码
|
|||
/// </remarks>
|
|||
/// <param name="input">请求条件</param>
|
|||
/// <returns>实体DTO列表</returns>
|
|||
[HttpPost] |
|||
[Route("listVersion")] |
|||
//[AuthorizeSettleAccountPermissions.BTCarKBFirsts.Default)]
|
|||
public async Task<PagedResultDto<BTCarKBVersionDto>> GetVersionListAsync(BTCarKBVersionRequestDto input) |
|||
{ |
|||
var entities = await _versionRepository.GetListByFilterAsync(input.BranchId, input.Filters, input.Sorting, int.MaxValue, |
|||
input.SkipCount, true); |
|||
|
|||
var totalCount = await GetCountAsync(input); |
|||
var dtos = _objectMapper.Map<List<BTCarKBVersion>, List<BTCarKBVersionDto>>(entities); |
|||
foreach (var itm in dtos) |
|||
{ |
|||
itm.Version = itm.Version + string.Format("({0})", itm.CustomerCode); |
|||
} |
|||
|
|||
return new PagedResultDto<BTCarKBVersionDto>(totalCount, dtos); |
|||
} |
|||
/// <summary>
|
|||
/// 导出文件
|
|||
/// </summary>
|
|||
/// <param name="input"></param>
|
|||
/// <returns></returns>
|
|||
[HttpPost] |
|||
[Route("Export")] |
|||
//[AuthorizeSettleAccountPermissions.BTCarKBFirsts.Default)]
|
|||
virtual public async Task<string> ExportAsync(BTCarKBRequestDto input) |
|||
{ |
|||
|
|||
IExporter _csv = new CsvExporter(); |
|||
|
|||
IExporter _excel = new ExcelExporter(); |
|||
if (input.ParentId != Guid.Empty) |
|||
{ |
|||
input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "ParentId", Logic = EnumFilterLogic.And, Value = input.ParentId.ToString() }); |
|||
} |
|||
|
|||
var entities = await _repository.GetListByFilterAsync(input.BranchId, input.Filters, input.Sorting, int.MaxValue, |
|||
0, true); |
|||
|
|||
var dtoDetails = ObjectMapper.Map<List<BTCarKB>, List<ExportBTCarKBFirstDto>>(entities); |
|||
|
|||
string _fileName = string.Empty; |
|||
//声明导出容器
|
|||
|
|||
|
|||
byte[] result = null; |
|||
switch (input.FileType) |
|||
{ |
|||
case 0: |
|||
_fileName = CommonMethod.GetExcelFileNameByUserID(ApplicationConsts.Sec_BTCarFirstKBFileName, CurrentUser.Id?.ToString(),".csv" ); |
|||
result = await _csv.ExportAsByteArray(dtoDetails); |
|||
break; |
|||
case 1: |
|||
_fileName = CommonMethod.GetExcelFileNameByUserID(ApplicationConsts.Sec_BTCarFirstKBFileName, CurrentUser.Id?.ToString(), ApplicationConsts.FileExtension); |
|||
result = await _excel.ExportAsByteArray(dtoDetails); |
|||
break; |
|||
} |
|||
|
|||
|
|||
//_fileName = CommonMethod.GetExcelFileNameByUserID(ApplicationConsts.Sec_BTCarFirstKBFileName, CurrentUser.Id?.ToString(), ApplicationConsts.FileExtension);
|
|||
//result = await _excel.ExportAsByteArray(dtoDetails);
|
|||
result.ShouldNotBeNull(); |
|||
|
|||
//保存导出文件到服务器存成二进制
|
|||
await _excelImportService.SaveBlobAsync( |
|||
new SaveExcelImportInputDto |
|||
{ |
|||
Name = _fileName, |
|||
Content = result |
|||
} |
|||
); |
|||
return _fileName; |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,398 @@ |
|||
|
|||
|
|||
|
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Diagnostics; |
|||
using System.Linq; |
|||
using System.Threading.Tasks; |
|||
using EFCore.BulkExtensions; |
|||
using Magicodes.ExporterAndImporter.Core; |
|||
using Magicodes.ExporterAndImporter.Csv; |
|||
using Magicodes.ExporterAndImporter.Excel; |
|||
using Microsoft.AspNetCore.Authorization; |
|||
using Microsoft.AspNetCore.Http; |
|||
using Microsoft.AspNetCore.Mvc; |
|||
using Microsoft.EntityFrameworkCore; |
|||
using Microsoft.Extensions.Caching.Distributed; |
|||
using Shouldly; |
|||
using Volo.Abp; |
|||
using Volo.Abp.Application.Dtos; |
|||
using Volo.Abp.Application.Services; |
|||
using Volo.Abp.Caching; |
|||
using Volo.Abp.Domain.Repositories; |
|||
using Volo.Abp.Guids; |
|||
using Volo.Abp.ObjectMapping; |
|||
using Volo.Abp.Uow; |
|||
using Win.Abp.Snowflakes; |
|||
using Win.Sfs.BaseData.ImportExcelCommon; |
|||
using Win.Sfs.SettleAccount.CommonManagers; |
|||
using Win.Sfs.SettleAccount.Constant; |
|||
using Win.Sfs.SettleAccount.Entities.ERPShipping; |
|||
using Win.Sfs.SettleAccount.Entities.ERPShpping; |
|||
using Win.Sfs.SettleAccount.Entities.ImportMap; |
|||
using Win.Sfs.SettleAccount.Entities.Materials; |
|||
using Win.Sfs.SettleAccount.ExcelImporter; |
|||
using Win.Sfs.SettleAccount.ExportReports; |
|||
using Win.Sfs.Shared.CacheBase; |
|||
using Win.Sfs.Shared.Filter; |
|||
using Win.Utils; |
|||
|
|||
namespace Win.Sfs.SettleAccount.ERPShippingDetails |
|||
{ |
|||
|
|||
/// <summary>
|
|||
/// 区域相关应用服务
|
|||
/// </summary>
|
|||
[Authorize(SettleAccountPermissions.Boms.Default)] |
|||
//[AllowAnonymous]
|
|||
[Route("api/settleaccount/ErpShipping")] |
|||
public class ErpShippingAppService : SettleAccountApplicationBase<ERPShippingDetail> |
|||
{ |
|||
private readonly IGuidGenerator _guidGenerator; |
|||
|
|||
private readonly IObjectMapper _objectMapper; |
|||
|
|||
private readonly IExcelImportAppService _excelImportService; |
|||
|
|||
|
|||
private readonly ISettleAccountBranchEfCoreRepository<ERPShippingDetail, Guid> _repository; |
|||
|
|||
|
|||
private readonly ISettleAccountBranchEfCoreRepository<Material, Guid> _materialRepository; |
|||
|
|||
private readonly ISettleAccountBranchEfCoreRepository<ImportColumnMap, Guid> _importColumnMapRepository; |
|||
|
|||
private readonly ISettleAccountBranchEfCoreRepository<ERPShippingVersion, Guid> _versionRepository; |
|||
/// <summary>
|
|||
/// 构建方法
|
|||
/// </summary>
|
|||
/// <param name="guidGenerator">构建UID</param>
|
|||
/// <param name="objectMapper">自动map</param>
|
|||
/// <param name="repository">仓储接口</param>
|
|||
/// <param name="cache">缓存</param>
|
|||
public ErpShippingAppService(IGuidGenerator guidGenerator, |
|||
IObjectMapper objectMapper, |
|||
IExcelImportAppService excelImportService, |
|||
ISnowflakeIdGenerator snowflakeIdGenerator, |
|||
ICommonManager commonManager, |
|||
ISettleAccountBranchEfCoreRepository<ERPShippingDetail, Guid> repository, |
|||
ISettleAccountBranchEfCoreRepository<ERPShippingVersion, Guid> versionRepository, |
|||
ISettleAccountBranchEfCoreRepository<Material, Guid> materialRepository, |
|||
ISettleAccountBranchEfCoreRepository<ImportColumnMap, Guid> importColumnMapRepository, |
|||
IDistributedCache<ERPShippingDetail> cache |
|||
) : base(cache,excelImportService,snowflakeIdGenerator,commonManager) |
|||
{ |
|||
_guidGenerator = guidGenerator; |
|||
_objectMapper = objectMapper; |
|||
_repository = repository; |
|||
_excelImportService = excelImportService; |
|||
_versionRepository = versionRepository; |
|||
_materialRepository = materialRepository; |
|||
_importColumnMapRepository = importColumnMapRepository; |
|||
} |
|||
|
|||
#region 导入导出功能
|
|||
|
|||
/// <summary>
|
|||
/// 导入功能
|
|||
/// </summary>
|
|||
/// <param name="files">上传的文件(前端已经限制只能上传一个附件)</param>
|
|||
/// <returns></returns>
|
|||
//[HttpPost]
|
|||
//[Route("ExcelImport-Map")]
|
|||
//[DisableRequestSizeLimit]
|
|||
//[Authorize(SettleAccountPermissions.ERPShippingDetails.Create)]
|
|||
|
|||
//public async Task<string> ERPShippingDetailUploadExcelImportMap([FromForm] IFormFileCollection files, Guid branchId, string year, string period, string version, string customerCode, string factory)
|
|||
//{
|
|||
// var _mapList=_importColumnMapRepository.Where(p => p.ProjectName ==SettleAccountModuleName.ERPShippingDetail ).ToList();
|
|||
|
|||
// ExportImporter _exportImporter = new ExportImporter();
|
|||
// var result = await _exportImporter.ExtendExcelImport<ImportERPShippingDetailDto>(files, _excelImportService,_mapList);
|
|||
// var entityList = ObjectMapper.Map<List<ImportERPShippingDetailDto>, List<ERPShippingDetail>>(result);
|
|||
// var _versionQuery = _versionRepository.Where(p => p.Version == version && p.Factory == factory);
|
|||
// await _versionQuery.BatchDeleteAsync();
|
|||
// var _query = _repository.Where(p => p.Version == version && p.Factory == factory);
|
|||
// await _query.BatchDeleteAsync();
|
|||
// var checkList = new List<ErrorExportDto>();
|
|||
// var _matList = await _materialRepository.GetAllAsync(GuidGenerator.Create());
|
|||
// var _group = entityList.GroupBy(x => new { x.ParentItemCode, x.ChildItemCode, x.Version }).Select(p => new { Count = p.Count(), ParentItmeCode = p.Key.ParentItemCode, ChildItemCode = p.Key.ChildItemCode });
|
|||
// foreach (var itm in _group)
|
|||
// {
|
|||
// if (itm.Count > 1)
|
|||
// {
|
|||
// checkList.Add(new ErrorExportDto(version, customerCode, string.Empty, string.Empty, string.Empty, string.Empty, string.Format("不能导入父编码{0},子编码{1}有重复数据", itm.ParentItmeCode, itm.ChildItemCode), string.Empty));
|
|||
// }
|
|||
// }
|
|||
// var _id = GuidGenerator.Create();
|
|||
// var _ERPShippingDetailList = new List<ERPShippingVersion>();
|
|||
// _ERPShippingDetailList.Add(new ERPShippingVersion(_id, branchId, year, period, version, customerCode, factory));
|
|||
// foreach (var itm in entityList)
|
|||
// {
|
|||
// if (!_matList.Any(p => p.MaterialCode == itm.ParentItemCode))
|
|||
// {
|
|||
// checkList.Add(new ErrorExportDto(version, customerCode, string.Empty, string.Empty, itm.ParentItemCode, string.Empty, string.Format("物料主数据不存在物料号{0}!", itm.ParentItemCode), string.Empty));
|
|||
// continue;
|
|||
// }
|
|||
// itm.SetValue(GuidGenerator.Create(), branchId, year, period, version, _id, factory);
|
|||
// }
|
|||
// if (checkList.Count > 0)
|
|||
// {
|
|||
// return await ExportErrorReportAsync(checkList);
|
|||
// }
|
|||
// await _repository.GetDbContext().BulkInsertAsync<ERPShippingDetail>(entityList);
|
|||
// await _versionRepository.GetDbContext().BulkInsertAsync(_ERPShippingDetailList);
|
|||
// //st.Stop();
|
|||
// return ApplicationConsts.SuccessStr;
|
|||
//}
|
|||
|
|||
|
|||
|
|||
|
|||
/// <summary>
|
|||
/// 导入功能
|
|||
/// </summary>
|
|||
/// <param name="files">上传的文件(前端已经限制只能上传一个附件)</param>
|
|||
/// <returns></returns>
|
|||
[HttpPost] |
|||
[Route("ExcelImport")] |
|||
[DisableRequestSizeLimit] |
|||
|
|||
|
|||
public async Task<string> ERPShippingDetailUploadExcelImport([FromForm] IFormFileCollection files, Guid branchId, string year, string period, string version, string customerCode,string factory) |
|||
{ |
|||
|
|||
ExportImporter _exportImporter = new ExportImporter(); |
|||
var result = await _exportImporter.UploadExcelImport<ERPShippingDetailDto>(files, _excelImportService); |
|||
var entityList = ObjectMapper.Map<List<ERPShippingDetailDto>, List<ERPShippingDetail>>(result); |
|||
var _versionQuery = _versionRepository.Where(p => p.Version == version ); |
|||
await _versionQuery.BatchDeleteAsync(); |
|||
var _query = _repository.Where(p => p.Version == version ); |
|||
await _query.BatchDeleteAsync(); |
|||
//var checkList = new List<ErrorExportDto>();
|
|||
//var _matList =await _materialRepository.GetAllAsync(GuidGenerator.Create());
|
|||
// var _group = entityList.GroupBy(x => new { x.ParentItemCode, x.ChildItemCode, x.Version }).Select(p => new { Count = p.Count(),ParentItmeCode=p.Key.ParentItemCode, ChildItemCode=p.Key.ChildItemCode });
|
|||
//foreach (var itm in _group)
|
|||
//{
|
|||
// if (itm.Count > 1)
|
|||
// {
|
|||
// checkList.Add(new ErrorExportDto(version, customerCode, string.Empty, string.Empty, string.Empty, string.Empty, string.Format("不能导入父编码{0},子编码{1}有重复数据", itm.ParentItmeCode, itm.ChildItemCode), string.Empty));
|
|||
// }
|
|||
//}
|
|||
//var _id = GuidGenerator.Create();
|
|||
//var _ERPShippingDetailList = new List<ERPShippingVersion>();
|
|||
//_ERPShippingDetailList.Add(new ERPShippingVersion(_id, branchId, year, period, version, customerCode,factory));
|
|||
//foreach (var itm in entityList)
|
|||
//{
|
|||
// if (!_matList.Any(p => p.MaterialCode == itm.ParentItemCode))
|
|||
// {
|
|||
// checkList.Add(new ErrorExportDto(version, customerCode, string.Empty, string.Empty, itm.ParentItemCode, string.Empty, string.Format("物料主数据不存在物料号{0}!", itm.ParentItemCode), string.Empty));
|
|||
// continue;
|
|||
// }
|
|||
// itm.SetValue(GuidGenerator.Create(),branchId,year,period,version,_id,factory);
|
|||
//}
|
|||
//if (checkList.Count > 0)
|
|||
//{
|
|||
// return await ExportErrorReportAsync(checkList);
|
|||
//}
|
|||
await _repository.GetDbContext().BulkInsertAsync<ERPShippingDetail>(entityList); |
|||
|
|||
await _versionRepository.GetDbContext().BulkInsertAsync(new List<ERPShippingVersion> { new ERPShippingVersion(Guid.NewGuid(), branchId, year, period, version, customerCode, factory) }); |
|||
|
|||
//st.Stop();
|
|||
return ApplicationConsts.SuccessStr; |
|||
} |
|||
/// <summary>
|
|||
/// 导出文件
|
|||
/// </summary>
|
|||
/// <param name="input"></param>
|
|||
/// <returns></returns>
|
|||
[HttpPost] |
|||
[Route("Export")] |
|||
|
|||
virtual public async Task<string> ExportAsync(ERPShippingDetailRequestDto input) |
|||
{ |
|||
IExporter _csv = new CsvExporter(); |
|||
IExporter _excel = new ExcelExporter(); |
|||
//导出加上版本过滤条件,不能全导出
|
|||
if (!string.IsNullOrEmpty(input.Version )) |
|||
{ |
|||
input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "Version", Logic = EnumFilterLogic.And, Value = input.Version.ToString() }); |
|||
} |
|||
//else
|
|||
//{
|
|||
// return new PagedResultDto<ERPShippingDetailDto>(0, new List<ERPShippingDetailDto>());
|
|||
//}
|
|||
var entities = await _repository.GetListByFilterAsync(input.BranchId, input.Filters, input.Sorting, int.MaxValue, |
|||
0, true); |
|||
var dtoDetails = ObjectMapper.Map<List<ERPShippingDetail>, List<ERPShippingDetailExportDto>>(entities); |
|||
string _fileName = string.Empty; |
|||
//声明导出容器
|
|||
|
|||
byte[] result = null; |
|||
|
|||
|
|||
|
|||
_fileName = string.Format("ERP调拨_{0}.xlsx", Guid.NewGuid().ToString("N")); |
|||
result = await _excel.ExportAsByteArray(dtoDetails); |
|||
|
|||
|
|||
result.ShouldNotBeNull(); |
|||
|
|||
//保存导出文件到服务器存成二进制
|
|||
await _excelImportService.SaveBlobAsync( |
|||
new SaveExcelImportInputDto |
|||
{ |
|||
Name = _fileName, |
|||
Content = result |
|||
} |
|||
); |
|||
return _fileName; |
|||
} |
|||
#endregion
|
|||
|
|||
/// <summary>
|
|||
/// 按ID获取唯一实体
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 返回实体全部属性
|
|||
/// </remarks>
|
|||
/// <param name="id">ID</param>
|
|||
/// <returns>实体DTO</returns>
|
|||
[HttpGet] |
|||
[Route("{id}")] |
|||
|
|||
virtual public async Task<ERPShippingDetailDto> GetAsync(Guid id) |
|||
{ |
|||
var result = await _repository.GetAsync(id); |
|||
var dto = _objectMapper.Map<ERPShippingDetail, ERPShippingDetailDto>(result); |
|||
return dto; |
|||
} |
|||
|
|||
|
|||
private async Task<ERPShippingDetail> GetFromCacheAsync(Guid id) |
|||
{ |
|||
var result = await _repository.GetAsync(id); |
|||
return result; |
|||
} |
|||
|
|||
|
|||
private async Task<long> GetCountAsync(ERPShippingDetailRequestDto input) |
|||
{ |
|||
return await _repository.GetCountByFilterAsync(input.BranchId, input.Filters); |
|||
} |
|||
|
|||
|
|||
private async Task<long> GetCountAsync(ERPShippingVersionRequestDto input) |
|||
{ |
|||
return await _versionRepository.GetCountByFilterAsync(input.BranchId, input.Filters); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 获取实体总数
|
|||
/// </summary>
|
|||
/// <returns>实体总数</returns>
|
|||
[HttpGet] |
|||
[Route("count")] |
|||
|
|||
virtual public async Task<long> GetTotalCountAsync(Guid branchId) |
|||
{ |
|||
return await _repository.GetCountAsync(branchId); |
|||
} |
|||
|
|||
|
|||
|
|||
/// <summary>
|
|||
/// 删除实体
|
|||
/// </summary>
|
|||
/// <param name="id">ID</param>
|
|||
/// <returns>无</returns>
|
|||
[HttpDelete] |
|||
[Route("{id}")] |
|||
|
|||
virtual public async Task DeleteAsync(Guid id) |
|||
{ |
|||
//var entity = await GetFromCacheAsync(id);
|
|||
//await Cache.DeleteAsync<ERPShippingDetail>(id.ToString());
|
|||
await _repository.DeleteAsync(id); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 按IDs删除实体列表
|
|||
/// </summary>
|
|||
/// <param name="ids">IDs</param>
|
|||
/// <returns>是否执行成功</returns>
|
|||
[HttpPost] |
|||
[Route("delete")] |
|||
|
|||
virtual public async Task<bool> DeleteListAsync(List<Guid> ids) |
|||
{ |
|||
//foreach (var id in ids)
|
|||
//{
|
|||
// var entity = await GetFromCacheAsync(id);
|
|||
|
|||
//}
|
|||
|
|||
return await _repository.DeleteListAsync(ids); |
|||
} |
|||
|
|||
|
|||
///// <summary>
|
|||
|
|||
/// <summary>
|
|||
/// 根据筛选条件获取实体列表
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 请求条件包括:筛选条件列表,排序条件,数据数量,页码
|
|||
/// </remarks>
|
|||
/// <param name="input">请求条件</param>
|
|||
/// <returns>实体DTO列表</returns>
|
|||
[HttpPost] |
|||
[Route("list")] |
|||
|
|||
public async Task<PagedResultDto<ERPShippingDetailDto>> GetListAsync(Guid parentId, ERPShippingDetailRequestDto input) |
|||
{ |
|||
if (!string.IsNullOrEmpty(input.Version) ) |
|||
{ |
|||
input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "Version", Logic = EnumFilterLogic.And, Value = input.Version }); |
|||
} |
|||
else |
|||
{ |
|||
return new PagedResultDto<ERPShippingDetailDto>(0,new List<ERPShippingDetailDto>()); |
|||
} |
|||
var entities = await _repository.GetListByFilterAsync(input.BranchId, input.Filters, input.Sorting, input.MaxResultCount, |
|||
input.SkipCount, true); |
|||
var totalCount = await GetCountAsync(input); |
|||
var dtos = _objectMapper.Map<List<ERPShippingDetail>, List<ERPShippingDetailDto>>(entities); |
|||
return new PagedResultDto<ERPShippingDetailDto>(totalCount, dtos); |
|||
} |
|||
|
|||
///// <summary>
|
|||
|
|||
/// <summary>
|
|||
/// 根据筛选条件获取实体列表
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 请求条件包括:筛选条件列表,排序条件,数据数量,页码
|
|||
/// </remarks>
|
|||
/// <param name="input">请求条件</param>
|
|||
/// <returns>实体DTO列表</returns>
|
|||
[HttpPost] |
|||
[Route("listVersion")] |
|||
|
|||
public async Task<PagedResultDto<ERPShippingVersionDto>> GetVersionListAsync(ERPShippingVersionRequestDto input) |
|||
{ |
|||
var entities = await _versionRepository.GetListByFilterAsync(input.BranchId, input.Filters, input.Sorting, int.MaxValue, |
|||
input.SkipCount, true); |
|||
|
|||
var totalCount = await GetCountAsync(input); |
|||
var dtos = _objectMapper.Map<List<ERPShippingVersion>, List<ERPShippingVersionDto>>(entities); |
|||
//foreach (var itm in dtos)
|
|||
//{
|
|||
// itm.Version = itm.Version + string.Format("({0})", itm.Factory);
|
|||
//}
|
|||
return new PagedResultDto<ERPShippingVersionDto>(totalCount, dtos); |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,347 @@ |
|||
|
|||
|
|||
|
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Diagnostics; |
|||
using System.Linq; |
|||
using System.Threading.Tasks; |
|||
using EFCore.BulkExtensions; |
|||
using Magicodes.ExporterAndImporter.Core; |
|||
using Magicodes.ExporterAndImporter.Csv; |
|||
using Magicodes.ExporterAndImporter.Excel; |
|||
using Microsoft.AspNetCore.Authorization; |
|||
using Microsoft.AspNetCore.Http; |
|||
using Microsoft.AspNetCore.Mvc; |
|||
using Microsoft.EntityFrameworkCore; |
|||
using Microsoft.Extensions.Caching.Distributed; |
|||
using Shouldly; |
|||
using Volo.Abp; |
|||
using Volo.Abp.Application.Dtos; |
|||
using Volo.Abp.Application.Services; |
|||
using Volo.Abp.Caching; |
|||
using Volo.Abp.Domain.Repositories; |
|||
using Volo.Abp.Guids; |
|||
using Volo.Abp.ObjectMapping; |
|||
using Volo.Abp.Uow; |
|||
using Win.Abp.Snowflakes; |
|||
using Win.Sfs.BaseData.ImportExcelCommon; |
|||
using Win.Sfs.SettleAccount.CommonManagers; |
|||
using Win.Sfs.SettleAccount.Constant; |
|||
using Win.Sfs.SettleAccount.Entities.ERPShipping; |
|||
using Win.Sfs.SettleAccount.Entities.ERPShpping; |
|||
using Win.Sfs.SettleAccount.Entities.HQExtend; |
|||
using Win.Sfs.SettleAccount.Entities.ImportMap; |
|||
using Win.Sfs.SettleAccount.Entities.Materials; |
|||
using Win.Sfs.SettleAccount.ExcelImporter; |
|||
using Win.Sfs.SettleAccount.ExportReports; |
|||
using Win.Sfs.Shared.CacheBase; |
|||
using Win.Sfs.Shared.Filter; |
|||
using Win.Utils; |
|||
|
|||
namespace Win.Sfs.SettleAccount.HQKBExtends |
|||
{ |
|||
|
|||
/// <summary>
|
|||
/// 区域相关应用服务
|
|||
/// </summary>
|
|||
[Authorize(SettleAccountPermissions.Boms.Default)] |
|||
//[AllowAnonymous]
|
|||
[Route("api/settleaccount/ErpShipping")] |
|||
public class HQKBExtendAppService : SettleAccountApplicationBase<HQKBExtend> |
|||
{ |
|||
private readonly IGuidGenerator _guidGenerator; |
|||
|
|||
private readonly IObjectMapper _objectMapper; |
|||
|
|||
private readonly IExcelImportAppService _excelImportService; |
|||
|
|||
|
|||
private readonly ISettleAccountBranchEfCoreRepository<HQKBExtend, Guid> _repository; |
|||
|
|||
|
|||
private readonly ISettleAccountBranchEfCoreRepository<Material, Guid> _materialRepository; |
|||
|
|||
private readonly ISettleAccountBranchEfCoreRepository<ImportColumnMap, Guid> _importColumnMapRepository; |
|||
|
|||
private readonly ISettleAccountBranchEfCoreRepository<HQKBExtendVersion, Guid> _versionRepository; |
|||
/// <summary>
|
|||
/// 构建方法
|
|||
/// </summary>
|
|||
/// <param name="guidGenerator">构建UID</param>
|
|||
/// <param name="objectMapper">自动map</param>
|
|||
/// <param name="repository">仓储接口</param>
|
|||
/// <param name="cache">缓存</param>
|
|||
public HQKBExtendAppService(IGuidGenerator guidGenerator, |
|||
IObjectMapper objectMapper, |
|||
IExcelImportAppService excelImportService, |
|||
ISnowflakeIdGenerator snowflakeIdGenerator, |
|||
ICommonManager commonManager, |
|||
ISettleAccountBranchEfCoreRepository<HQKBExtend, Guid> repository, |
|||
ISettleAccountBranchEfCoreRepository<HQKBExtendVersion, Guid> versionRepository, |
|||
ISettleAccountBranchEfCoreRepository<Material, Guid> materialRepository, |
|||
ISettleAccountBranchEfCoreRepository<ImportColumnMap, Guid> importColumnMapRepository, |
|||
IDistributedCache<HQKBExtend> cache |
|||
) : base(cache,excelImportService,snowflakeIdGenerator,commonManager) |
|||
{ |
|||
_guidGenerator = guidGenerator; |
|||
_objectMapper = objectMapper; |
|||
_repository = repository; |
|||
_excelImportService = excelImportService; |
|||
_versionRepository = versionRepository; |
|||
_materialRepository = materialRepository; |
|||
_importColumnMapRepository = importColumnMapRepository; |
|||
} |
|||
|
|||
#region 导入导出功能
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
/// <summary>
|
|||
/// 导入功能
|
|||
/// </summary>
|
|||
/// <param name="files">上传的文件(前端已经限制只能上传一个附件)</param>
|
|||
/// <returns></returns>
|
|||
[HttpPost] |
|||
[Route("ExcelImport")] |
|||
[DisableRequestSizeLimit] |
|||
|
|||
|
|||
public async Task<string> HQKBExtendUploadExcelImport([FromForm] IFormFileCollection files, Guid branchId, string year, string period, string version, string customerCode,string factory) |
|||
{ |
|||
|
|||
ExportImporter _exportImporter = new ExportImporter(); |
|||
var result = await _exportImporter.UploadExcelImport<HQKBExtendDto>(files, _excelImportService); |
|||
var entityList = ObjectMapper.Map<List<HQKBExtendDto>, List<HQKBExtend>>(result); |
|||
var _versionQuery = _versionRepository.Where(p => p.Version == version ); |
|||
await _versionQuery.BatchDeleteAsync(); |
|||
var _query = _repository.Where(p => p.Version == version ); |
|||
await _query.BatchDeleteAsync(); |
|||
//var checkList = new List<ErrorExportDto>();
|
|||
//var _matList =await _materialRepository.GetAllAsync(GuidGenerator.Create());
|
|||
// var _group = entityList.GroupBy(x => new { x.ParentItemCode, x.ChildItemCode, x.Version }).Select(p => new { Count = p.Count(),ParentItmeCode=p.Key.ParentItemCode, ChildItemCode=p.Key.ChildItemCode });
|
|||
//foreach (var itm in _group)
|
|||
//{
|
|||
// if (itm.Count > 1)
|
|||
// {
|
|||
// checkList.Add(new ErrorExportDto(version, customerCode, string.Empty, string.Empty, string.Empty, string.Empty, string.Format("不能导入父编码{0},子编码{1}有重复数据", itm.ParentItmeCode, itm.ChildItemCode), string.Empty));
|
|||
// }
|
|||
//}
|
|||
//var _id = GuidGenerator.Create();
|
|||
//var _HQKBExtendList = new List<HQKBExtendVersion>();
|
|||
//_HQKBExtendList.Add(new HQKBExtendVersion(_id, branchId, year, period, version, customerCode,factory));
|
|||
//foreach (var itm in entityList)
|
|||
//{
|
|||
// if (!_matList.Any(p => p.MaterialCode == itm.ParentItemCode))
|
|||
// {
|
|||
// checkList.Add(new ErrorExportDto(version, customerCode, string.Empty, string.Empty, itm.ParentItemCode, string.Empty, string.Format("物料主数据不存在物料号{0}!", itm.ParentItemCode), string.Empty));
|
|||
// continue;
|
|||
// }
|
|||
// itm.SetValue(GuidGenerator.Create(),branchId,year,period,version,_id,factory);
|
|||
//}
|
|||
//if (checkList.Count > 0)
|
|||
//{
|
|||
// return await ExportErrorReportAsync(checkList);
|
|||
//}
|
|||
await _repository.GetDbContext().BulkInsertAsync<HQKBExtend>(entityList); |
|||
|
|||
await _versionRepository.GetDbContext().BulkInsertAsync(new List<HQKBExtendVersion> { new HQKBExtendVersion(Guid.NewGuid(), branchId, year, period, version, customerCode, factory) }); |
|||
|
|||
//st.Stop();
|
|||
return ApplicationConsts.SuccessStr; |
|||
} |
|||
/// <summary>
|
|||
/// 导出文件
|
|||
/// </summary>
|
|||
/// <param name="input"></param>
|
|||
/// <returns></returns>
|
|||
[HttpPost] |
|||
[Route("Export")] |
|||
|
|||
virtual public async Task<string> ExportAsync(HQKBExtendRequestDto input) |
|||
{ |
|||
IExporter _csv = new CsvExporter(); |
|||
IExporter _excel = new ExcelExporter(); |
|||
//导出加上版本过滤条件,不能全导出
|
|||
if (!string.IsNullOrEmpty(input.Version )) |
|||
{ |
|||
input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "Version", Logic = EnumFilterLogic.And, Value = input.Version.ToString() }); |
|||
} |
|||
//else
|
|||
//{
|
|||
// return new PagedResultDto<HQKBExtendDto>(0, new List<HQKBExtendDto>());
|
|||
//}
|
|||
var entities = await _repository.GetListByFilterAsync(input.BranchId, input.Filters, input.Sorting, int.MaxValue, |
|||
0, true); |
|||
var dtoDetails = ObjectMapper.Map<List<HQKBExtend>, List<HQKBExtendExportDto>>(entities); |
|||
string _fileName = string.Empty; |
|||
//声明导出容器
|
|||
|
|||
byte[] result = null; |
|||
|
|||
|
|||
|
|||
_fileName = string.Format("ERP调拨_{0}.xlsx", Guid.NewGuid().ToString("N")); |
|||
result = await _excel.ExportAsByteArray(dtoDetails); |
|||
|
|||
|
|||
result.ShouldNotBeNull(); |
|||
|
|||
//保存导出文件到服务器存成二进制
|
|||
await _excelImportService.SaveBlobAsync( |
|||
new SaveExcelImportInputDto |
|||
{ |
|||
Name = _fileName, |
|||
Content = result |
|||
} |
|||
); |
|||
return _fileName; |
|||
} |
|||
#endregion
|
|||
|
|||
/// <summary>
|
|||
/// 按ID获取唯一实体
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 返回实体全部属性
|
|||
/// </remarks>
|
|||
/// <param name="id">ID</param>
|
|||
/// <returns>实体DTO</returns>
|
|||
[HttpGet] |
|||
[Route("{id}")] |
|||
|
|||
virtual public async Task<HQKBExtendDto> GetAsync(Guid id) |
|||
{ |
|||
var result = await _repository.GetAsync(id); |
|||
var dto = _objectMapper.Map<HQKBExtend, HQKBExtendDto>(result); |
|||
return dto; |
|||
} |
|||
|
|||
|
|||
private async Task<HQKBExtend> GetFromCacheAsync(Guid id) |
|||
{ |
|||
var result = await _repository.GetAsync(id); |
|||
return result; |
|||
} |
|||
|
|||
|
|||
private async Task<long> GetCountAsync(HQKBExtendRequestDto input) |
|||
{ |
|||
return await _repository.GetCountByFilterAsync(input.BranchId, input.Filters); |
|||
} |
|||
|
|||
|
|||
private async Task<long> GetCountAsync(HQKBExtendVersionRequestDto input) |
|||
{ |
|||
return await _versionRepository.GetCountByFilterAsync(input.BranchId, input.Filters); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 获取实体总数
|
|||
/// </summary>
|
|||
/// <returns>实体总数</returns>
|
|||
[HttpGet] |
|||
[Route("count")] |
|||
|
|||
virtual public async Task<long> GetTotalCountAsync(Guid branchId) |
|||
{ |
|||
return await _repository.GetCountAsync(branchId); |
|||
} |
|||
|
|||
|
|||
|
|||
/// <summary>
|
|||
/// 删除实体
|
|||
/// </summary>
|
|||
/// <param name="id">ID</param>
|
|||
/// <returns>无</returns>
|
|||
[HttpDelete] |
|||
[Route("{id}")] |
|||
|
|||
virtual public async Task DeleteAsync(Guid id) |
|||
{ |
|||
//var entity = await GetFromCacheAsync(id);
|
|||
//await Cache.DeleteAsync<HQKBExtend>(id.ToString());
|
|||
await _repository.DeleteAsync(id); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 按IDs删除实体列表
|
|||
/// </summary>
|
|||
/// <param name="ids">IDs</param>
|
|||
/// <returns>是否执行成功</returns>
|
|||
[HttpPost] |
|||
[Route("delete")] |
|||
|
|||
virtual public async Task<bool> DeleteListAsync(List<Guid> ids) |
|||
{ |
|||
//foreach (var id in ids)
|
|||
//{
|
|||
// var entity = await GetFromCacheAsync(id);
|
|||
|
|||
//}
|
|||
|
|||
return await _repository.DeleteListAsync(ids); |
|||
} |
|||
|
|||
|
|||
///// <summary>
|
|||
|
|||
/// <summary>
|
|||
/// 根据筛选条件获取实体列表
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 请求条件包括:筛选条件列表,排序条件,数据数量,页码
|
|||
/// </remarks>
|
|||
/// <param name="input">请求条件</param>
|
|||
/// <returns>实体DTO列表</returns>
|
|||
[HttpPost] |
|||
[Route("list")] |
|||
|
|||
public async Task<PagedResultDto<HQKBExtendDto>> GetListAsync(Guid parentId, HQKBExtendRequestDto input) |
|||
{ |
|||
if (!string.IsNullOrEmpty(input.Version) ) |
|||
{ |
|||
input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "Version", Logic = EnumFilterLogic.And, Value = input.Version }); |
|||
} |
|||
else |
|||
{ |
|||
return new PagedResultDto<HQKBExtendDto>(0,new List<HQKBExtendDto>()); |
|||
} |
|||
var entities = await _repository.GetListByFilterAsync(input.BranchId, input.Filters, input.Sorting, input.MaxResultCount, |
|||
input.SkipCount, true); |
|||
var totalCount = await GetCountAsync(input); |
|||
var dtos = _objectMapper.Map<List<HQKBExtend>, List<HQKBExtendDto>>(entities); |
|||
return new PagedResultDto<HQKBExtendDto>(totalCount, dtos); |
|||
} |
|||
|
|||
///// <summary>
|
|||
|
|||
/// <summary>
|
|||
/// 根据筛选条件获取实体列表
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 请求条件包括:筛选条件列表,排序条件,数据数量,页码
|
|||
/// </remarks>
|
|||
/// <param name="input">请求条件</param>
|
|||
/// <returns>实体DTO列表</returns>
|
|||
[HttpPost] |
|||
[Route("listVersion")] |
|||
|
|||
public async Task<PagedResultDto<HQKBExtendVersionDto>> GetVersionListAsync(HQKBExtendVersionRequestDto input) |
|||
{ |
|||
var entities = await _versionRepository.GetListByFilterAsync(input.BranchId, input.Filters, input.Sorting, int.MaxValue, |
|||
input.SkipCount, true); |
|||
|
|||
var totalCount = await GetCountAsync(input); |
|||
var dtos = _objectMapper.Map<List<HQKBExtendVersion>, List<HQKBExtendVersionDto>>(entities); |
|||
//foreach (var itm in dtos)
|
|||
//{
|
|||
// itm.Version = itm.Version + string.Format("({0})", itm.Factory);
|
|||
//}
|
|||
return new PagedResultDto<HQKBExtendVersionDto>(totalCount, dtos); |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,346 @@ |
|||
|
|||
|
|||
|
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Diagnostics; |
|||
using System.Linq; |
|||
using System.Threading.Tasks; |
|||
using EFCore.BulkExtensions; |
|||
using Magicodes.ExporterAndImporter.Core; |
|||
using Magicodes.ExporterAndImporter.Csv; |
|||
using Magicodes.ExporterAndImporter.Excel; |
|||
using Microsoft.AspNetCore.Authorization; |
|||
using Microsoft.AspNetCore.Http; |
|||
using Microsoft.AspNetCore.Mvc; |
|||
using Microsoft.EntityFrameworkCore; |
|||
using Microsoft.Extensions.Caching.Distributed; |
|||
using Shouldly; |
|||
using Volo.Abp; |
|||
using Volo.Abp.Application.Dtos; |
|||
using Volo.Abp.Application.Services; |
|||
using Volo.Abp.Caching; |
|||
using Volo.Abp.Domain.Repositories; |
|||
using Volo.Abp.Guids; |
|||
using Volo.Abp.ObjectMapping; |
|||
using Volo.Abp.Uow; |
|||
using Win.Abp.Snowflakes; |
|||
using Win.Sfs.BaseData.ImportExcelCommon; |
|||
using Win.Sfs.SettleAccount.CommonManagers; |
|||
using Win.Sfs.SettleAccount.Constant; |
|||
using Win.Sfs.SettleAccount.Entities.ERPShipping; |
|||
using Win.Sfs.SettleAccount.Entities.ERPShpping; |
|||
using Win.Sfs.SettleAccount.Entities.HQExtend; |
|||
using Win.Sfs.SettleAccount.Entities.ImportMap; |
|||
using Win.Sfs.SettleAccount.Entities.Materials; |
|||
using Win.Sfs.SettleAccount.ExcelImporter; |
|||
using Win.Sfs.SettleAccount.ExportReports; |
|||
using Win.Sfs.Shared.CacheBase; |
|||
using Win.Sfs.Shared.Filter; |
|||
using Win.Utils; |
|||
|
|||
namespace Win.Sfs.SettleAccount.HQKBExtends |
|||
{ |
|||
|
|||
/// <summary>
|
|||
/// 区域相关应用服务
|
|||
/// </summary>
|
|||
[Authorize(SettleAccountPermissions.Boms.Default)] |
|||
//[AllowAnonymous]
|
|||
[Route("api/settleaccount/ErpShipping")] |
|||
public class HQKBSettleExtendAppService : SettleAccountApplicationBase<HQKBSettleExtend> |
|||
{ |
|||
private readonly IGuidGenerator _guidGenerator; |
|||
|
|||
private readonly IObjectMapper _objectMapper; |
|||
|
|||
private readonly IExcelImportAppService _excelImportService; |
|||
|
|||
|
|||
private readonly ISettleAccountBranchEfCoreRepository<HQKBSettleExtend, Guid> _repository; |
|||
|
|||
|
|||
private readonly ISettleAccountBranchEfCoreRepository<Material, Guid> _materialRepository; |
|||
|
|||
private readonly ISettleAccountBranchEfCoreRepository<ImportColumnMap, Guid> _importColumnMapRepository; |
|||
|
|||
private readonly ISettleAccountBranchEfCoreRepository<HQKBSettleExtendVersion, Guid> _versionRepository; |
|||
/// <summary>
|
|||
/// 构建方法
|
|||
/// </summary>
|
|||
/// <param name="guidGenerator">构建UID</param>
|
|||
/// <param name="objectMapper">自动map</param>
|
|||
/// <param name="repository">仓储接口</param>
|
|||
/// <param name="cache">缓存</param>
|
|||
public HQKBSettleExtendAppService(IGuidGenerator guidGenerator, |
|||
IObjectMapper objectMapper, |
|||
IExcelImportAppService excelImportService, |
|||
ISnowflakeIdGenerator snowflakeIdGenerator, |
|||
ICommonManager commonManager, |
|||
ISettleAccountBranchEfCoreRepository<HQKBSettleExtend, Guid> repository, |
|||
ISettleAccountBranchEfCoreRepository<HQKBSettleExtendVersion, Guid> versionRepository, |
|||
ISettleAccountBranchEfCoreRepository<Material, Guid> materialRepository, |
|||
ISettleAccountBranchEfCoreRepository<ImportColumnMap, Guid> importColumnMapRepository, |
|||
IDistributedCache<HQKBSettleExtend> cache |
|||
) : base(cache,excelImportService,snowflakeIdGenerator,commonManager) |
|||
{ |
|||
_guidGenerator = guidGenerator; |
|||
_objectMapper = objectMapper; |
|||
_repository = repository; |
|||
_excelImportService = excelImportService; |
|||
_versionRepository = versionRepository; |
|||
_materialRepository = materialRepository; |
|||
_importColumnMapRepository = importColumnMapRepository; |
|||
} |
|||
|
|||
#region 导入导出功能
|
|||
|
|||
|
|||
|
|||
|
|||
/// <summary>
|
|||
/// 导入功能
|
|||
/// </summary>
|
|||
/// <param name="files">上传的文件(前端已经限制只能上传一个附件)</param>
|
|||
/// <returns></returns>
|
|||
[HttpPost] |
|||
[Route("ExcelImport")] |
|||
[DisableRequestSizeLimit] |
|||
|
|||
|
|||
public async Task<string> HQKBSettleExtendUploadExcelImport([FromForm] IFormFileCollection files, Guid branchId, string year, string period, string version, string customerCode,string factory) |
|||
{ |
|||
|
|||
ExportImporter _exportImporter = new ExportImporter(); |
|||
var result = await _exportImporter.UploadExcelImport<HQKBSettleExtendDto>(files, _excelImportService); |
|||
var entityList = ObjectMapper.Map<List<HQKBSettleExtendDto>, List<HQKBSettleExtend>>(result); |
|||
var _versionQuery = _versionRepository.Where(p => p.Version == version ); |
|||
await _versionQuery.BatchDeleteAsync(); |
|||
var _query = _repository.Where(p => p.Version == version ); |
|||
await _query.BatchDeleteAsync(); |
|||
//var checkList = new List<ErrorExportDto>();
|
|||
//var _matList =await _materialRepository.GetAllAsync(GuidGenerator.Create());
|
|||
// var _group = entityList.GroupBy(x => new { x.ParentItemCode, x.ChildItemCode, x.Version }).Select(p => new { Count = p.Count(),ParentItmeCode=p.Key.ParentItemCode, ChildItemCode=p.Key.ChildItemCode });
|
|||
//foreach (var itm in _group)
|
|||
//{
|
|||
// if (itm.Count > 1)
|
|||
// {
|
|||
// checkList.Add(new ErrorExportDto(version, customerCode, string.Empty, string.Empty, string.Empty, string.Empty, string.Format("不能导入父编码{0},子编码{1}有重复数据", itm.ParentItmeCode, itm.ChildItemCode), string.Empty));
|
|||
// }
|
|||
//}
|
|||
//var _id = GuidGenerator.Create();
|
|||
//var _HQKBSettleExtendList = new List<HQKBSettleExtendVersion>();
|
|||
//_HQKBSettleExtendList.Add(new HQKBSettleExtendVersion(_id, branchId, year, period, version, customerCode,factory));
|
|||
//foreach (var itm in entityList)
|
|||
//{
|
|||
// if (!_matList.Any(p => p.MaterialCode == itm.ParentItemCode))
|
|||
// {
|
|||
// checkList.Add(new ErrorExportDto(version, customerCode, string.Empty, string.Empty, itm.ParentItemCode, string.Empty, string.Format("物料主数据不存在物料号{0}!", itm.ParentItemCode), string.Empty));
|
|||
// continue;
|
|||
// }
|
|||
// itm.SetValue(GuidGenerator.Create(),branchId,year,period,version,_id,factory);
|
|||
//}
|
|||
//if (checkList.Count > 0)
|
|||
//{
|
|||
// return await ExportErrorReportAsync(checkList);
|
|||
//}
|
|||
await _repository.GetDbContext().BulkInsertAsync<HQKBSettleExtend>(entityList); |
|||
|
|||
await _versionRepository.GetDbContext().BulkInsertAsync(new List<HQKBSettleExtendVersion> { new HQKBSettleExtendVersion(Guid.NewGuid(), branchId, year, period, version, customerCode, factory) }); |
|||
|
|||
//st.Stop();
|
|||
return ApplicationConsts.SuccessStr; |
|||
} |
|||
/// <summary>
|
|||
/// 导出文件
|
|||
/// </summary>
|
|||
/// <param name="input"></param>
|
|||
/// <returns></returns>
|
|||
[HttpPost] |
|||
[Route("Export")] |
|||
|
|||
virtual public async Task<string> ExportAsync(HQKBSettleExtendRequestDto input) |
|||
{ |
|||
IExporter _csv = new CsvExporter(); |
|||
IExporter _excel = new ExcelExporter(); |
|||
//导出加上版本过滤条件,不能全导出
|
|||
if (!string.IsNullOrEmpty(input.Version )) |
|||
{ |
|||
input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "Version", Logic = EnumFilterLogic.And, Value = input.Version.ToString() }); |
|||
} |
|||
//else
|
|||
//{
|
|||
// return new PagedResultDto<HQKBSettleExtendDto>(0, new List<HQKBSettleExtendDto>());
|
|||
//}
|
|||
var entities = await _repository.GetListByFilterAsync(input.BranchId, input.Filters, input.Sorting, int.MaxValue, |
|||
0, true); |
|||
var dtoDetails = ObjectMapper.Map<List<HQKBSettleExtend>, List<HQKBSettleExtendExportDto>>(entities); |
|||
string _fileName = string.Empty; |
|||
//声明导出容器
|
|||
|
|||
byte[] result = null; |
|||
|
|||
|
|||
|
|||
_fileName = string.Format("ERP调拨_{0}.xlsx", Guid.NewGuid().ToString("N")); |
|||
result = await _excel.ExportAsByteArray(dtoDetails); |
|||
|
|||
|
|||
result.ShouldNotBeNull(); |
|||
|
|||
//保存导出文件到服务器存成二进制
|
|||
await _excelImportService.SaveBlobAsync( |
|||
new SaveExcelImportInputDto |
|||
{ |
|||
Name = _fileName, |
|||
Content = result |
|||
} |
|||
); |
|||
return _fileName; |
|||
} |
|||
#endregion
|
|||
|
|||
/// <summary>
|
|||
/// 按ID获取唯一实体
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 返回实体全部属性
|
|||
/// </remarks>
|
|||
/// <param name="id">ID</param>
|
|||
/// <returns>实体DTO</returns>
|
|||
[HttpGet] |
|||
[Route("{id}")] |
|||
|
|||
virtual public async Task<HQKBSettleExtendDto> GetAsync(Guid id) |
|||
{ |
|||
var result = await _repository.GetAsync(id); |
|||
var dto = _objectMapper.Map<HQKBSettleExtend, HQKBSettleExtendDto>(result); |
|||
return dto; |
|||
} |
|||
|
|||
|
|||
private async Task<HQKBSettleExtend> GetFromCacheAsync(Guid id) |
|||
{ |
|||
var result = await _repository.GetAsync(id); |
|||
return result; |
|||
} |
|||
|
|||
|
|||
private async Task<long> GetCountAsync(HQKBSettleExtendRequestDto input) |
|||
{ |
|||
return await _repository.GetCountByFilterAsync(input.BranchId, input.Filters); |
|||
} |
|||
|
|||
|
|||
private async Task<long> GetCountAsync(HQKBSettleExtendVersionRequestDto input) |
|||
{ |
|||
return await _versionRepository.GetCountByFilterAsync(input.BranchId, input.Filters); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 获取实体总数
|
|||
/// </summary>
|
|||
/// <returns>实体总数</returns>
|
|||
[HttpGet] |
|||
[Route("count")] |
|||
|
|||
virtual public async Task<long> GetTotalCountAsync(Guid branchId) |
|||
{ |
|||
return await _repository.GetCountAsync(branchId); |
|||
} |
|||
|
|||
|
|||
|
|||
/// <summary>
|
|||
/// 删除实体
|
|||
/// </summary>
|
|||
/// <param name="id">ID</param>
|
|||
/// <returns>无</returns>
|
|||
[HttpDelete] |
|||
[Route("{id}")] |
|||
|
|||
virtual public async Task DeleteAsync(Guid id) |
|||
{ |
|||
//var entity = await GetFromCacheAsync(id);
|
|||
//await Cache.DeleteAsync<HQKBSettleExtend>(id.ToString());
|
|||
await _repository.DeleteAsync(id); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 按IDs删除实体列表
|
|||
/// </summary>
|
|||
/// <param name="ids">IDs</param>
|
|||
/// <returns>是否执行成功</returns>
|
|||
[HttpPost] |
|||
[Route("delete")] |
|||
|
|||
virtual public async Task<bool> DeleteListAsync(List<Guid> ids) |
|||
{ |
|||
//foreach (var id in ids)
|
|||
//{
|
|||
// var entity = await GetFromCacheAsync(id);
|
|||
|
|||
//}
|
|||
|
|||
return await _repository.DeleteListAsync(ids); |
|||
} |
|||
|
|||
|
|||
///// <summary>
|
|||
|
|||
/// <summary>
|
|||
/// 根据筛选条件获取实体列表
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 请求条件包括:筛选条件列表,排序条件,数据数量,页码
|
|||
/// </remarks>
|
|||
/// <param name="input">请求条件</param>
|
|||
/// <returns>实体DTO列表</returns>
|
|||
[HttpPost] |
|||
[Route("list")] |
|||
|
|||
public async Task<PagedResultDto<HQKBSettleExtendDto>> GetListAsync(Guid parentId, HQKBSettleExtendRequestDto input) |
|||
{ |
|||
if (!string.IsNullOrEmpty(input.Version) ) |
|||
{ |
|||
input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "Version", Logic = EnumFilterLogic.And, Value = input.Version }); |
|||
} |
|||
else |
|||
{ |
|||
return new PagedResultDto<HQKBSettleExtendDto>(0,new List<HQKBSettleExtendDto>()); |
|||
} |
|||
var entities = await _repository.GetListByFilterAsync(input.BranchId, input.Filters, input.Sorting, input.MaxResultCount, |
|||
input.SkipCount, true); |
|||
var totalCount = await GetCountAsync(input); |
|||
var dtos = _objectMapper.Map<List<HQKBSettleExtend>, List<HQKBSettleExtendDto>>(entities); |
|||
return new PagedResultDto<HQKBSettleExtendDto>(totalCount, dtos); |
|||
} |
|||
|
|||
///// <summary>
|
|||
|
|||
/// <summary>
|
|||
/// 根据筛选条件获取实体列表
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 请求条件包括:筛选条件列表,排序条件,数据数量,页码
|
|||
/// </remarks>
|
|||
/// <param name="input">请求条件</param>
|
|||
/// <returns>实体DTO列表</returns>
|
|||
[HttpPost] |
|||
[Route("listVersion")] |
|||
|
|||
public async Task<PagedResultDto<HQKBSettleExtendVersionDto>> GetVersionListAsync(HQKBSettleExtendVersionRequestDto input) |
|||
{ |
|||
var entities = await _versionRepository.GetListByFilterAsync(input.BranchId, input.Filters, input.Sorting, int.MaxValue, |
|||
input.SkipCount, true); |
|||
|
|||
var totalCount = await GetCountAsync(input); |
|||
var dtos = _objectMapper.Map<List<HQKBSettleExtendVersion>, List<HQKBSettleExtendVersionDto>>(entities); |
|||
//foreach (var itm in dtos)
|
|||
//{
|
|||
// itm.Version = itm.Version + string.Format("({0})", itm.Factory);
|
|||
//}
|
|||
return new PagedResultDto<HQKBSettleExtendVersionDto>(totalCount, dtos); |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,361 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Diagnostics; |
|||
using System.Linq; |
|||
using System.Threading.Tasks; |
|||
using EFCore.BulkExtensions; |
|||
using Magicodes.ExporterAndImporter.Core; |
|||
using Magicodes.ExporterAndImporter.Csv; |
|||
using Magicodes.ExporterAndImporter.Excel; |
|||
using Microsoft.AspNetCore.Authorization; |
|||
using Microsoft.AspNetCore.Http; |
|||
using Microsoft.AspNetCore.Mvc; |
|||
using Microsoft.EntityFrameworkCore; |
|||
using Microsoft.Extensions.Caching.Distributed; |
|||
using Shouldly; |
|||
using Volo.Abp; |
|||
using Volo.Abp.Application.Dtos; |
|||
using Volo.Abp.Application.Services; |
|||
using Volo.Abp.Caching; |
|||
using Volo.Abp.Domain.Repositories; |
|||
using Volo.Abp.Guids; |
|||
using Volo.Abp.ObjectMapping; |
|||
using Volo.Abp.Uow; |
|||
using Win.Abp.Snowflakes; |
|||
using Win.Sfs.BaseData.ImportExcelCommon; |
|||
using Win.Sfs.SettleAccount.CommonManagers; |
|||
using Win.Sfs.SettleAccount.Constant; |
|||
using Win.Sfs.SettleAccount.Entities.JFCarConsigns; |
|||
using Win.Sfs.SettleAccount.Entities.Materials; |
|||
using Win.Sfs.SettleAccount.ExcelImporter; |
|||
using Win.Sfs.SettleAccount.ExportReports; |
|||
using Win.Sfs.SettleAccount.MaterialRelationships; |
|||
using Win.Sfs.Shared.CacheBase; |
|||
using Win.Sfs.Shared.Enums.SettleAccount; |
|||
using Win.Sfs.Shared.Filter; |
|||
using Win.Utils; |
|||
|
|||
namespace Win.Sfs.SettleAccount.JFCarConsigns |
|||
{ |
|||
|
|||
/// <summary>
|
|||
/// 区域相关应用服务
|
|||
/// </summary>
|
|||
//[AuthorizeSettleAccountPermissions.JFCarConsigns.Default)]
|
|||
[AllowAnonymous] |
|||
[Route("api/settleaccount/JFCarConsign")] |
|||
public class JFCarConsignAppService : SettleAccountApplicationBase<JFCarConsign>, IJFCarConsignAppService |
|||
{ |
|||
private readonly IGuidGenerator _guidGenerator; |
|||
|
|||
private readonly IObjectMapper _objectMapper; |
|||
|
|||
private readonly IExcelImportAppService _excelImportService; |
|||
|
|||
|
|||
private readonly ISettleAccountBranchEfCoreRepository<JFCarConsign, Guid> _repository; |
|||
|
|||
private readonly ISettleAccountBranchEfCoreRepository<JFCarConsignVersion, Guid> _versionRepository; |
|||
private readonly ISettleAccountBranchEfCoreRepository<MaterialRelationship, Guid> _MaterialRepository; |
|||
/// <summary>
|
|||
/// 构建方法
|
|||
/// </summary>
|
|||
/// <param name="guidGenerator">构建UID</param>
|
|||
/// <param name="objectMapper">自动map</param>
|
|||
/// <param name="repository">仓储接口</param>
|
|||
/// <param name="cache">缓存</param>
|
|||
public JFCarConsignAppService(IGuidGenerator guidGenerator, |
|||
IObjectMapper objectMapper, |
|||
IExcelImportAppService excelImportService, |
|||
ISnowflakeIdGenerator snowflakeIdGenerator, |
|||
ICommonManager commonManager, |
|||
ISettleAccountBranchEfCoreRepository<JFCarConsign, Guid> repository, |
|||
ISettleAccountBranchEfCoreRepository<JFCarConsignVersion, Guid> versionRepository, |
|||
ISettleAccountBranchEfCoreRepository<MaterialRelationship, Guid> MaterialRepository, |
|||
IDistributedCache<JFCarConsign> cache |
|||
) : base(cache,excelImportService,snowflakeIdGenerator,commonManager) |
|||
{ |
|||
_guidGenerator = guidGenerator; |
|||
_objectMapper = objectMapper; |
|||
_repository = repository; |
|||
_excelImportService = excelImportService; |
|||
_versionRepository = versionRepository; |
|||
_MaterialRepository = MaterialRepository; |
|||
} |
|||
|
|||
#region 导入导出功能
|
|||
/// <summary>
|
|||
/// 导入功能
|
|||
/// </summary>
|
|||
/// <param name="files">上传的文件(前端已经限制只能上传一个附件)</param>
|
|||
/// <returns></returns>
|
|||
[HttpPost] |
|||
[Route("ExcelImport")] |
|||
[DisableRequestSizeLimit] |
|||
//[AuthorizeSettleAccountPermissions.JFCarConsigns.Default)]
|
|||
|
|||
public async Task<string> JFCarConsignUploadExcelImport([FromForm] IFormFileCollection files, Guid branchId, string year, string period, string version, string customerCode,DateTime datetime) |
|||
{ |
|||
ExportImporter _exportImporter = new ExportImporter(); |
|||
var result = await _exportImporter.UploadExcelImport<ImportJFCarConsignDto>(files, _excelImportService); |
|||
var entityList = ObjectMapper.Map<List<ImportJFCarConsignDto>, List<JFCarConsign>>(result); |
|||
var _versionQuery = _versionRepository.Where(p => p.Version == version ); |
|||
await _versionQuery.BatchDeleteAsync(); |
|||
var _query = _repository.Where(p => p.Version == version); |
|||
await _query.BatchDeleteAsync(); |
|||
//List<String> errorList = new List<string>();
|
|||
var checkList = new List<ErrorExportDto>(); |
|||
//通过《零件关系匹配设置表》验证物料号
|
|||
foreach (var itm in entityList) |
|||
{ |
|||
if (!_MaterialRepository.Any(p => p.ShipMaterailCode == itm.MaterialCode)) |
|||
{ |
|||
checkList.Add(new ErrorExportDto(version,string.Empty, string.Empty, string.Empty,itm.MaterialCode, string.Empty, string.Format("发货看板物料号:{0}在《零件关系匹配设置表》中不存在!", itm.MaterialCode), string.Empty)); |
|||
//errorList.Add(string.Format("发货看板物料号:{0}在《零件关系匹配设置表》中不存在!", itm.MaterialCode));
|
|||
} |
|||
} |
|||
if (checkList.Count > 0) |
|||
{ |
|||
return await ExportErrorReportAsync(checkList); |
|||
} |
|||
var _id = GuidGenerator.Create(); |
|||
var _JFCarConsignList = new List<JFCarConsignVersion>(); |
|||
|
|||
_JFCarConsignList.Add(new JFCarConsignVersion(_id, branchId, period, version, customerCode, datetime)); |
|||
foreach (var itm in entityList) |
|||
{ |
|||
itm.State = (int)EnumSettleStatus.未结算; |
|||
itm.SetValue(GuidGenerator.Create(), branchId, period, version, customerCode, datetime,_id); |
|||
} |
|||
|
|||
|
|||
await _repository.GetDbContext().BulkInsertAsync<JFCarConsign>(entityList); |
|||
|
|||
await _versionRepository.GetDbContext().BulkInsertAsync(_JFCarConsignList); |
|||
|
|||
//st.Stop();
|
|||
return ApplicationConsts.SuccessStr; |
|||
} |
|||
|
|||
|
|||
#endregion
|
|||
|
|||
/// <summary>
|
|||
/// 按ID获取唯一实体
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 返回实体全部属性
|
|||
/// </remarks>
|
|||
/// <param name="id">ID</param>
|
|||
/// <returns>实体DTO</returns>
|
|||
[HttpGet] |
|||
[Route("{id}")] |
|||
////[AuthorizeSettleAccountPermissions.JFCarConsigns.Default)]
|
|||
virtual public async Task<JFCarConsignDto> GetAsync(Guid id) |
|||
{ |
|||
var result = await _repository.GetAsync(id); |
|||
var dto = _objectMapper.Map<JFCarConsign, JFCarConsignDto>(result); |
|||
return dto; |
|||
} |
|||
|
|||
|
|||
private async Task<JFCarConsign> GetFromCacheAsync(Guid id) |
|||
{ |
|||
var result = |
|||
await _repository.GetAsync(id) |
|||
; |
|||
|
|||
return result; |
|||
} |
|||
|
|||
private async Task<long> GetCountAsync(JFCarConsignRequestDto input) |
|||
{ |
|||
return await _repository.GetCountByFilterAsync(input.BranchId, input.Filters); |
|||
} |
|||
|
|||
private async Task<long> GetCountAsync(JFCarConsignVersionRequestDto input) |
|||
{ |
|||
return await _versionRepository.GetCountByFilterAsync(input.BranchId, input.Filters); |
|||
} |
|||
/// <summary>
|
|||
/// 获取实体总数
|
|||
/// </summary>
|
|||
/// <returns>实体总数</returns>
|
|||
[HttpGet] |
|||
[Route("count")] |
|||
////[AuthorizeSettleAccountPermissions.JFCarConsigns.Default)]
|
|||
virtual public async Task<long> GetTotalCountAsync(Guid branchId) |
|||
{ |
|||
return await _repository.GetCountAsync(branchId); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 删除实体
|
|||
/// </summary>
|
|||
/// <param name="id">ID</param>
|
|||
/// <returns>无</returns>
|
|||
[HttpDelete] |
|||
[Route("{id}")] |
|||
////[AuthorizeSettleAccountPermissions.JFCarConsigns.Delete)]
|
|||
virtual public async Task DeleteAsync(Guid id) |
|||
{ |
|||
//var entity = await GetFromCacheAsync(id);
|
|||
//await Cache.DeleteAsync<JFCarConsign>(id.ToString());
|
|||
await _repository.DeleteAsync(id); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 按IDs删除实体列表
|
|||
/// </summary>
|
|||
/// <param name="ids">IDs</param>
|
|||
/// <returns>是否执行成功</returns>
|
|||
[HttpPost] |
|||
[Route("delete")] |
|||
////[AuthorizeSettleAccountPermissions.JFCarConsigns.Delete)]
|
|||
virtual public async Task<bool> DeleteListAsync(List<Guid> ids) |
|||
{ |
|||
//foreach (var id in ids)
|
|||
//{
|
|||
// var entity = await GetFromCacheAsync(id);
|
|||
|
|||
//}
|
|||
|
|||
return await _repository.DeleteListAsync(ids); |
|||
} |
|||
|
|||
|
|||
///// <summary>
|
|||
|
|||
/// <summary>
|
|||
/// 根据筛选条件获取实体列表
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 请求条件包括:筛选条件列表,排序条件,数据数量,页码
|
|||
/// </remarks>
|
|||
/// <param name="input">请求条件</param>
|
|||
/// <returns>实体DTO列表</returns>
|
|||
[HttpPost] |
|||
[Route("list")] |
|||
////[AuthorizeSettleAccountPermissions.JFCarConsigns.Default)]
|
|||
|
|||
|
|||
public async Task<PagedResultDto<JFCarConsignDto>> GetListAsync(Guid parentId, JFCarConsignRequestDto input) |
|||
{ |
|||
if (input.ParentId != Guid.Empty) |
|||
{ |
|||
input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "ParentId", Logic = EnumFilterLogic.And, Value = input.ParentId.ToString() }); |
|||
} |
|||
else |
|||
{ |
|||
return new PagedResultDto<JFCarConsignDto>(0, new List<JFCarConsignDto>()); |
|||
} |
|||
|
|||
var entities = await _repository.GetListByFilterAsync(input.BranchId, input.Filters, input.Sorting, input.MaxResultCount, |
|||
input.SkipCount, true); |
|||
|
|||
var totalCount = await GetCountAsync(input); |
|||
var dtos = _objectMapper.Map<List<JFCarConsign>, List<JFCarConsignDto>>(entities); |
|||
|
|||
return new PagedResultDto<JFCarConsignDto>(totalCount, dtos); |
|||
} |
|||
|
|||
///// <summary>
|
|||
|
|||
/// <summary>
|
|||
/// 根据筛选条件获取实体列表
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 请求条件包括:筛选条件列表,排序条件,数据数量,页码
|
|||
/// </remarks>
|
|||
/// <param name="input">请求条件</param>
|
|||
/// <returns>实体DTO列表</returns>
|
|||
[HttpPost] |
|||
[Route("listVersion")] |
|||
//[AuthorizeSettleAccountPermissions.JFCarConsigns.Default)]
|
|||
public async Task<PagedResultDto<JFCarConsignVersionDto>> GetVersionListAsync(JFCarConsignVersionRequestDto input) |
|||
{ |
|||
var entities = await _versionRepository.GetListByFilterAsync(input.BranchId, input.Filters, input.Sorting, int.MaxValue, |
|||
input.SkipCount, true); |
|||
|
|||
var totalCount = await GetCountAsync(input); |
|||
var dtos = _objectMapper.Map<List<JFCarConsignVersion>, List<JFCarConsignVersionDto>>(entities); |
|||
|
|||
return new PagedResultDto<JFCarConsignVersionDto>(totalCount, dtos); |
|||
} |
|||
/// <summary>
|
|||
/// 导出文件
|
|||
/// </summary>
|
|||
/// <param name="input"></param>
|
|||
/// <returns></returns>
|
|||
[HttpPost] |
|||
[Route("Export")] |
|||
//[AuthorizeSettleAccountPermissions.JFCarConsigns.Default)]
|
|||
virtual public async Task<string> ExportAsync(JFCarConsignRequestDto input) |
|||
{ |
|||
|
|||
IExporter _csv = new CsvExporter(); |
|||
|
|||
IExporter _excel = new ExcelExporter(); |
|||
if (input.ParentId != Guid.Empty) |
|||
{ |
|||
input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "ParentId", Logic = EnumFilterLogic.And, Value = input.ParentId.ToString() }); |
|||
} |
|||
|
|||
var entities = await _repository.GetListByFilterAsync(input.BranchId, input.Filters, input.Sorting, int.MaxValue, |
|||
0, true); |
|||
|
|||
var dtoDetails = ObjectMapper.Map<List<JFCarConsign>, List<ExportJFCarConsignDto>>(entities); |
|||
|
|||
string _fileName = string.Empty; |
|||
//声明导出容器
|
|||
|
|||
byte[] result = null; |
|||
|
|||
|
|||
switch (input.FileType) |
|||
{ |
|||
case 0: |
|||
_fileName = string.Format("解放结算_{0}.csv", System.DateTime.Now.ToString("yyyyMMddHHmmss")); |
|||
result = await _csv.ExportAsByteArray(dtoDetails); |
|||
|
|||
|
|||
|
|||
break; |
|||
case 1: |
|||
_fileName = string.Format("解放结算_{0}.xlsx", System.DateTime.Now.ToString("yyyyMMddHHmmss")); |
|||
result = await _excel.ExportAsByteArray(dtoDetails); |
|||
break; |
|||
} |
|||
|
|||
result.ShouldNotBeNull(); |
|||
|
|||
//保存导出文件到服务器存成二进制
|
|||
await _excelImportService.SaveBlobAsync( |
|||
new SaveExcelImportInputDto |
|||
{ |
|||
Name = _fileName, |
|||
Content = result |
|||
} |
|||
); |
|||
return _fileName; |
|||
} |
|||
|
|||
[HttpPost] |
|||
[Route("jfupdate")] |
|||
|
|||
[UnitOfWork(isTransactional: false)] |
|||
public async Task<bool> UPdateFisAsync() |
|||
{ |
|||
|
|||
await _repository.GetDbContext().Database.ExecuteSqlRawAsync( |
|||
"EXEC sp_jf_update" |
|||
); |
|||
return true; |
|||
|
|||
|
|||
|
|||
} |
|||
|
|||
|
|||
} |
|||
} |
@ -0,0 +1,361 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Diagnostics; |
|||
using System.Linq; |
|||
using System.Threading.Tasks; |
|||
using EFCore.BulkExtensions; |
|||
using Magicodes.ExporterAndImporter.Core; |
|||
using Magicodes.ExporterAndImporter.Csv; |
|||
using Magicodes.ExporterAndImporter.Excel; |
|||
using Microsoft.AspNetCore.Authorization; |
|||
using Microsoft.AspNetCore.Http; |
|||
using Microsoft.AspNetCore.Mvc; |
|||
using Microsoft.EntityFrameworkCore; |
|||
using Microsoft.Extensions.Caching.Distributed; |
|||
using Shouldly; |
|||
using Volo.Abp; |
|||
using Volo.Abp.Application.Dtos; |
|||
using Volo.Abp.Application.Services; |
|||
using Volo.Abp.Caching; |
|||
using Volo.Abp.Domain.Repositories; |
|||
using Volo.Abp.Guids; |
|||
using Volo.Abp.ObjectMapping; |
|||
using Volo.Abp.Uow; |
|||
using Win.Abp.Snowflakes; |
|||
using Win.Sfs.BaseData.ImportExcelCommon; |
|||
using Win.Sfs.SettleAccount.CommonManagers; |
|||
using Win.Sfs.SettleAccount.Constant; |
|||
using Win.Sfs.SettleAccount.Entities.JFCarConsigns; |
|||
using Win.Sfs.SettleAccount.Entities.Materials; |
|||
using Win.Sfs.SettleAccount.ExcelImporter; |
|||
using Win.Sfs.SettleAccount.ExportReports; |
|||
using Win.Sfs.SettleAccount.MaterialRelationships; |
|||
using Win.Sfs.Shared.CacheBase; |
|||
using Win.Sfs.Shared.Enums.SettleAccount; |
|||
using Win.Sfs.Shared.Filter; |
|||
using Win.Utils; |
|||
|
|||
namespace Win.Sfs.SettleAccount.JFCarConsigns |
|||
{ |
|||
|
|||
/// <summary>
|
|||
/// 区域相关应用服务
|
|||
/// </summary>
|
|||
//[AuthorizeSettleAccountPermissions.JFCarConsigns.Default)]
|
|||
[AllowAnonymous] |
|||
[Route("api/settleaccount/JFCarConsign")] |
|||
public class JFCarConsignAppService : SettleAccountApplicationBase<JFCarConsign>, IJFCarConsignAppService |
|||
{ |
|||
private readonly IGuidGenerator _guidGenerator; |
|||
|
|||
private readonly IObjectMapper _objectMapper; |
|||
|
|||
private readonly IExcelImportAppService _excelImportService; |
|||
|
|||
|
|||
private readonly ISettleAccountBranchEfCoreRepository<JFCarConsign, Guid> _repository; |
|||
|
|||
private readonly ISettleAccountBranchEfCoreRepository<JFCarConsignVersion, Guid> _versionRepository; |
|||
private readonly ISettleAccountBranchEfCoreRepository<MaterialRelationship, Guid> _MaterialRepository; |
|||
/// <summary>
|
|||
/// 构建方法
|
|||
/// </summary>
|
|||
/// <param name="guidGenerator">构建UID</param>
|
|||
/// <param name="objectMapper">自动map</param>
|
|||
/// <param name="repository">仓储接口</param>
|
|||
/// <param name="cache">缓存</param>
|
|||
public JFCarConsignAppService(IGuidGenerator guidGenerator, |
|||
IObjectMapper objectMapper, |
|||
IExcelImportAppService excelImportService, |
|||
ISnowflakeIdGenerator snowflakeIdGenerator, |
|||
ICommonManager commonManager, |
|||
ISettleAccountBranchEfCoreRepository<JFCarConsign, Guid> repository, |
|||
ISettleAccountBranchEfCoreRepository<JFCarConsignVersion, Guid> versionRepository, |
|||
ISettleAccountBranchEfCoreRepository<MaterialRelationship, Guid> MaterialRepository, |
|||
IDistributedCache<JFCarConsign> cache |
|||
) : base(cache,excelImportService,snowflakeIdGenerator,commonManager) |
|||
{ |
|||
_guidGenerator = guidGenerator; |
|||
_objectMapper = objectMapper; |
|||
_repository = repository; |
|||
_excelImportService = excelImportService; |
|||
_versionRepository = versionRepository; |
|||
_MaterialRepository = MaterialRepository; |
|||
} |
|||
|
|||
#region 导入导出功能
|
|||
/// <summary>
|
|||
/// 导入功能
|
|||
/// </summary>
|
|||
/// <param name="files">上传的文件(前端已经限制只能上传一个附件)</param>
|
|||
/// <returns></returns>
|
|||
[HttpPost] |
|||
[Route("ExcelImport")] |
|||
[DisableRequestSizeLimit] |
|||
//[AuthorizeSettleAccountPermissions.JFCarConsigns.Default)]
|
|||
|
|||
public async Task<string> JFCarConsignUploadExcelImport([FromForm] IFormFileCollection files, Guid branchId, string year, string period, string version, string customerCode,DateTime datetime) |
|||
{ |
|||
ExportImporter _exportImporter = new ExportImporter(); |
|||
var result = await _exportImporter.UploadExcelImport<ImportJFCarConsignDto>(files, _excelImportService); |
|||
var entityList = ObjectMapper.Map<List<ImportJFCarConsignDto>, List<JFCarConsign>>(result); |
|||
var _versionQuery = _versionRepository.Where(p => p.Version == version ); |
|||
await _versionQuery.BatchDeleteAsync(); |
|||
var _query = _repository.Where(p => p.Version == version); |
|||
await _query.BatchDeleteAsync(); |
|||
//List<String> errorList = new List<string>();
|
|||
var checkList = new List<ErrorExportDto>(); |
|||
//通过《零件关系匹配设置表》验证物料号
|
|||
foreach (var itm in entityList) |
|||
{ |
|||
if (!_MaterialRepository.Any(p => p.ShipMaterailCode == itm.MaterialCode)) |
|||
{ |
|||
checkList.Add(new ErrorExportDto(version,string.Empty, string.Empty, string.Empty,itm.MaterialCode, string.Empty, string.Format("发货看板物料号:{0}在《零件关系匹配设置表》中不存在!", itm.MaterialCode), string.Empty)); |
|||
//errorList.Add(string.Format("发货看板物料号:{0}在《零件关系匹配设置表》中不存在!", itm.MaterialCode));
|
|||
} |
|||
} |
|||
if (checkList.Count > 0) |
|||
{ |
|||
return await ExportErrorReportAsync(checkList); |
|||
} |
|||
var _id = GuidGenerator.Create(); |
|||
var _JFCarConsignList = new List<JFCarConsignVersion>(); |
|||
|
|||
_JFCarConsignList.Add(new JFCarConsignVersion(_id, branchId, period, version, customerCode, datetime)); |
|||
foreach (var itm in entityList) |
|||
{ |
|||
itm.State = (int)EnumSettleStatus.未结算; |
|||
itm.SetValue(GuidGenerator.Create(), branchId, period, version, customerCode, datetime,_id); |
|||
} |
|||
|
|||
|
|||
await _repository.GetDbContext().BulkInsertAsync<JFCarConsign>(entityList); |
|||
|
|||
await _versionRepository.GetDbContext().BulkInsertAsync(_JFCarConsignList); |
|||
|
|||
//st.Stop();
|
|||
return ApplicationConsts.SuccessStr; |
|||
} |
|||
|
|||
|
|||
#endregion
|
|||
|
|||
/// <summary>
|
|||
/// 按ID获取唯一实体
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 返回实体全部属性
|
|||
/// </remarks>
|
|||
/// <param name="id">ID</param>
|
|||
/// <returns>实体DTO</returns>
|
|||
[HttpGet] |
|||
[Route("{id}")] |
|||
////[AuthorizeSettleAccountPermissions.JFCarConsigns.Default)]
|
|||
virtual public async Task<JFCarConsignDto> GetAsync(Guid id) |
|||
{ |
|||
var result = await _repository.GetAsync(id); |
|||
var dto = _objectMapper.Map<JFCarConsign, JFCarConsignDto>(result); |
|||
return dto; |
|||
} |
|||
|
|||
|
|||
private async Task<JFCarConsign> GetFromCacheAsync(Guid id) |
|||
{ |
|||
var result = |
|||
await _repository.GetAsync(id) |
|||
; |
|||
|
|||
return result; |
|||
} |
|||
|
|||
private async Task<long> GetCountAsync(JFCarConsignRequestDto input) |
|||
{ |
|||
return await _repository.GetCountByFilterAsync(input.BranchId, input.Filters); |
|||
} |
|||
|
|||
private async Task<long> GetCountAsync(JFCarConsignVersionRequestDto input) |
|||
{ |
|||
return await _versionRepository.GetCountByFilterAsync(input.BranchId, input.Filters); |
|||
} |
|||
/// <summary>
|
|||
/// 获取实体总数
|
|||
/// </summary>
|
|||
/// <returns>实体总数</returns>
|
|||
[HttpGet] |
|||
[Route("count")] |
|||
////[AuthorizeSettleAccountPermissions.JFCarConsigns.Default)]
|
|||
virtual public async Task<long> GetTotalCountAsync(Guid branchId) |
|||
{ |
|||
return await _repository.GetCountAsync(branchId); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 删除实体
|
|||
/// </summary>
|
|||
/// <param name="id">ID</param>
|
|||
/// <returns>无</returns>
|
|||
[HttpDelete] |
|||
[Route("{id}")] |
|||
////[AuthorizeSettleAccountPermissions.JFCarConsigns.Delete)]
|
|||
virtual public async Task DeleteAsync(Guid id) |
|||
{ |
|||
//var entity = await GetFromCacheAsync(id);
|
|||
//await Cache.DeleteAsync<JFCarConsign>(id.ToString());
|
|||
await _repository.DeleteAsync(id); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 按IDs删除实体列表
|
|||
/// </summary>
|
|||
/// <param name="ids">IDs</param>
|
|||
/// <returns>是否执行成功</returns>
|
|||
[HttpPost] |
|||
[Route("delete")] |
|||
////[AuthorizeSettleAccountPermissions.JFCarConsigns.Delete)]
|
|||
virtual public async Task<bool> DeleteListAsync(List<Guid> ids) |
|||
{ |
|||
//foreach (var id in ids)
|
|||
//{
|
|||
// var entity = await GetFromCacheAsync(id);
|
|||
|
|||
//}
|
|||
|
|||
return await _repository.DeleteListAsync(ids); |
|||
} |
|||
|
|||
|
|||
///// <summary>
|
|||
|
|||
/// <summary>
|
|||
/// 根据筛选条件获取实体列表
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 请求条件包括:筛选条件列表,排序条件,数据数量,页码
|
|||
/// </remarks>
|
|||
/// <param name="input">请求条件</param>
|
|||
/// <returns>实体DTO列表</returns>
|
|||
[HttpPost] |
|||
[Route("list")] |
|||
////[AuthorizeSettleAccountPermissions.JFCarConsigns.Default)]
|
|||
|
|||
|
|||
public async Task<PagedResultDto<JFCarConsignDto>> GetListAsync(Guid parentId, JFCarConsignRequestDto input) |
|||
{ |
|||
if (input.ParentId != Guid.Empty) |
|||
{ |
|||
input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "ParentId", Logic = EnumFilterLogic.And, Value = input.ParentId.ToString() }); |
|||
} |
|||
else |
|||
{ |
|||
return new PagedResultDto<JFCarConsignDto>(0, new List<JFCarConsignDto>()); |
|||
} |
|||
|
|||
var entities = await _repository.GetListByFilterAsync(input.BranchId, input.Filters, input.Sorting, input.MaxResultCount, |
|||
input.SkipCount, true); |
|||
|
|||
var totalCount = await GetCountAsync(input); |
|||
var dtos = _objectMapper.Map<List<JFCarConsign>, List<JFCarConsignDto>>(entities); |
|||
|
|||
return new PagedResultDto<JFCarConsignDto>(totalCount, dtos); |
|||
} |
|||
|
|||
///// <summary>
|
|||
|
|||
/// <summary>
|
|||
/// 根据筛选条件获取实体列表
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 请求条件包括:筛选条件列表,排序条件,数据数量,页码
|
|||
/// </remarks>
|
|||
/// <param name="input">请求条件</param>
|
|||
/// <returns>实体DTO列表</returns>
|
|||
[HttpPost] |
|||
[Route("listVersion")] |
|||
//[AuthorizeSettleAccountPermissions.JFCarConsigns.Default)]
|
|||
public async Task<PagedResultDto<JFCarConsignVersionDto>> GetVersionListAsync(JFCarConsignVersionRequestDto input) |
|||
{ |
|||
var entities = await _versionRepository.GetListByFilterAsync(input.BranchId, input.Filters, input.Sorting, int.MaxValue, |
|||
input.SkipCount, true); |
|||
|
|||
var totalCount = await GetCountAsync(input); |
|||
var dtos = _objectMapper.Map<List<JFCarConsignVersion>, List<JFCarConsignVersionDto>>(entities); |
|||
|
|||
return new PagedResultDto<JFCarConsignVersionDto>(totalCount, dtos); |
|||
} |
|||
/// <summary>
|
|||
/// 导出文件
|
|||
/// </summary>
|
|||
/// <param name="input"></param>
|
|||
/// <returns></returns>
|
|||
[HttpPost] |
|||
[Route("Export")] |
|||
//[AuthorizeSettleAccountPermissions.JFCarConsigns.Default)]
|
|||
virtual public async Task<string> ExportAsync(JFCarConsignRequestDto input) |
|||
{ |
|||
|
|||
IExporter _csv = new CsvExporter(); |
|||
|
|||
IExporter _excel = new ExcelExporter(); |
|||
if (input.ParentId != Guid.Empty) |
|||
{ |
|||
input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "ParentId", Logic = EnumFilterLogic.And, Value = input.ParentId.ToString() }); |
|||
} |
|||
|
|||
var entities = await _repository.GetListByFilterAsync(input.BranchId, input.Filters, input.Sorting, int.MaxValue, |
|||
0, true); |
|||
|
|||
var dtoDetails = ObjectMapper.Map<List<JFCarConsign>, List<ExportJFCarConsignDto>>(entities); |
|||
|
|||
string _fileName = string.Empty; |
|||
//声明导出容器
|
|||
|
|||
byte[] result = null; |
|||
|
|||
|
|||
switch (input.FileType) |
|||
{ |
|||
case 0: |
|||
_fileName = string.Format("解放结算_{0}.csv", System.DateTime.Now.ToString("yyyyMMddHHmmss")); |
|||
result = await _csv.ExportAsByteArray(dtoDetails); |
|||
|
|||
|
|||
|
|||
break; |
|||
case 1: |
|||
_fileName = string.Format("解放结算_{0}.xlsx", System.DateTime.Now.ToString("yyyyMMddHHmmss")); |
|||
result = await _excel.ExportAsByteArray(dtoDetails); |
|||
break; |
|||
} |
|||
|
|||
result.ShouldNotBeNull(); |
|||
|
|||
//保存导出文件到服务器存成二进制
|
|||
await _excelImportService.SaveBlobAsync( |
|||
new SaveExcelImportInputDto |
|||
{ |
|||
Name = _fileName, |
|||
Content = result |
|||
} |
|||
); |
|||
return _fileName; |
|||
} |
|||
|
|||
[HttpPost] |
|||
[Route("jfupdate")] |
|||
|
|||
[UnitOfWork(isTransactional: false)] |
|||
public async Task<bool> UPdateFisAsync() |
|||
{ |
|||
|
|||
await _repository.GetDbContext().Database.ExecuteSqlRawAsync( |
|||
"EXEC sp_jf_update" |
|||
); |
|||
return true; |
|||
|
|||
|
|||
|
|||
} |
|||
|
|||
|
|||
} |
|||
} |
@ -0,0 +1,328 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Diagnostics; |
|||
using System.Linq; |
|||
using System.Threading.Tasks; |
|||
using EFCore.BulkExtensions; |
|||
using Magicodes.ExporterAndImporter.Core; |
|||
using Magicodes.ExporterAndImporter.Csv; |
|||
using Magicodes.ExporterAndImporter.Excel; |
|||
using Microsoft.AspNetCore.Authorization; |
|||
using Microsoft.AspNetCore.Http; |
|||
using Microsoft.AspNetCore.Mvc; |
|||
using Microsoft.EntityFrameworkCore; |
|||
using Microsoft.Extensions.Caching.Distributed; |
|||
using Shouldly; |
|||
using Volo.Abp; |
|||
using Volo.Abp.Application.Dtos; |
|||
using Volo.Abp.Application.Services; |
|||
using Volo.Abp.Caching; |
|||
using Volo.Abp.Domain.Repositories; |
|||
using Volo.Abp.Guids; |
|||
using Volo.Abp.ObjectMapping; |
|||
using Volo.Abp.Uow; |
|||
using Win.Abp.Snowflakes; |
|||
using Win.Sfs.BaseData.ImportExcelCommon; |
|||
using Win.Sfs.SettleAccount.CommonManagers; |
|||
using Win.Sfs.SettleAccount.Constant; |
|||
using Win.Sfs.SettleAccount.Entities.JFCarKBs; |
|||
using Win.Sfs.SettleAccount.ExcelImporter; |
|||
using Win.Sfs.Shared.CacheBase; |
|||
using Win.Sfs.Shared.Enums.SettleAccount; |
|||
using Win.Sfs.Shared.Filter; |
|||
using Win.Utils; |
|||
|
|||
namespace Win.Sfs.SettleAccount.JFCarKBs |
|||
{ |
|||
|
|||
/// <summary>
|
|||
/// 区域相关应用服务
|
|||
/// </summary>
|
|||
//[AuthorizeSettleAccountPermissions.JFCarKBs.Default)]
|
|||
|
|||
[Route("api/settleaccount/JFCarKB")] |
|||
public class JFCarKBAppService : SettleAccountApplicationBase<JFCarKB>, IJFCarKBAppService |
|||
{ |
|||
private readonly IGuidGenerator _guidGenerator; |
|||
|
|||
private readonly IObjectMapper _objectMapper; |
|||
|
|||
private readonly IExcelImportAppService _excelImportService; |
|||
|
|||
|
|||
private readonly ISettleAccountBranchEfCoreRepository<JFCarKB, Guid> _repository; |
|||
|
|||
private readonly ISettleAccountBranchEfCoreRepository<JFCarKBVersion, Guid> _versionRepository; |
|||
/// <summary>
|
|||
/// 构建方法
|
|||
/// </summary>
|
|||
/// <param name="guidGenerator">构建UID</param>
|
|||
/// <param name="objectMapper">自动map</param>
|
|||
/// <param name="repository">仓储接口</param>
|
|||
/// <param name="cache">缓存</param>
|
|||
public JFCarKBAppService(IGuidGenerator guidGenerator, |
|||
IObjectMapper objectMapper, |
|||
IExcelImportAppService excelImportService, |
|||
ISnowflakeIdGenerator snowflakeIdGenerator, |
|||
ICommonManager commonManager, |
|||
ISettleAccountBranchEfCoreRepository<JFCarKB, Guid> repository, |
|||
ISettleAccountBranchEfCoreRepository<JFCarKBVersion, Guid> versionRepository, |
|||
IDistributedCache<JFCarKB> cache |
|||
) : base(cache,excelImportService,snowflakeIdGenerator,commonManager) |
|||
{ |
|||
_guidGenerator = guidGenerator; |
|||
_objectMapper = objectMapper; |
|||
_repository = repository; |
|||
_excelImportService = excelImportService; |
|||
_versionRepository = versionRepository; |
|||
} |
|||
|
|||
#region 导入导出功能
|
|||
/// <summary>
|
|||
/// 导入功能
|
|||
/// </summary>
|
|||
/// <param name="files">上传的文件(前端已经限制只能上传一个附件)</param>
|
|||
/// <returns></returns>
|
|||
[HttpPost] |
|||
[Route("ExcelImport")] |
|||
[DisableRequestSizeLimit] |
|||
|
|||
//[AuthorizeSettleAccountPermissions.JFCarKBs.Default)]
|
|||
public async Task<string> JFCarKBUploadExcelImport([FromForm] IFormFileCollection files, Guid branchId, string year, string period, string version, string customerCode,DateTime datetime) |
|||
{ |
|||
ExportImporter _exportImporter = new ExportImporter(); |
|||
var result = await _exportImporter.UploadExcelImport<ImportJFCarKBDto>(files, _excelImportService); |
|||
var entityList = ObjectMapper.Map<List<ImportJFCarKBDto>, List<JFCarKB>>(result); |
|||
var _versionQuery = _versionRepository.Where(p => p.Version == version); |
|||
await _versionQuery.BatchDeleteAsync(); |
|||
var _query = _repository.Where(p => p.Version == version); |
|||
await _query.BatchDeleteAsync(); |
|||
|
|||
|
|||
var _id = GuidGenerator.Create(); |
|||
var _JFCarKBList = new List<JFCarKBVersion>(); |
|||
|
|||
_JFCarKBList.Add(new JFCarKBVersion(_id, branchId, period, version, customerCode, datetime)); |
|||
foreach (var itm in entityList) |
|||
{ |
|||
itm.State= (int)EnumSettleStatus.未结算; |
|||
itm.SetValue(GuidGenerator.Create(), branchId, period, version, customerCode, datetime,_id); |
|||
} |
|||
var bulkConfig = new BulkConfig { SetOutputIdentity = true, BatchSize = 10000 }; |
|||
|
|||
await _repository.GetDbContext().BulkInsertAsync<JFCarKB>(entityList); |
|||
|
|||
await _versionRepository.GetDbContext().BulkInsertAsync(_JFCarKBList); |
|||
|
|||
return ApplicationConsts.SuccessStr; |
|||
} |
|||
|
|||
|
|||
#endregion
|
|||
|
|||
/// <summary>
|
|||
/// 按ID获取唯一实体
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 返回实体全部属性
|
|||
/// </remarks>
|
|||
/// <param name="id">ID</param>
|
|||
/// <returns>实体DTO</returns>
|
|||
[HttpGet] |
|||
[Route("{id}")] |
|||
////[AuthorizeSettleAccountPermissions.JFCarKBs.Default)]
|
|||
virtual public async Task<JFCarKBDto> GetAsync(Guid id) |
|||
{ |
|||
var result = await _repository.GetAsync(id); |
|||
var dto = _objectMapper.Map<JFCarKB, JFCarKBDto>(result); |
|||
return dto; |
|||
} |
|||
|
|||
|
|||
private async Task<JFCarKB> GetFromCacheAsync(Guid id) |
|||
{ |
|||
var result = |
|||
await _repository.GetAsync(id) |
|||
; |
|||
|
|||
return result; |
|||
} |
|||
|
|||
private async Task<long> GetCountAsync(JFCarKBRequestDto input) |
|||
{ |
|||
return await _repository.GetCountByFilterAsync(input.BranchId, input.Filters); |
|||
} |
|||
|
|||
private async Task<long> GetCountAsync(JFCarKBVersionRequestDto input) |
|||
{ |
|||
return await _versionRepository.GetCountByFilterAsync(input.BranchId, input.Filters); |
|||
} |
|||
/// <summary>
|
|||
/// 获取实体总数
|
|||
/// </summary>
|
|||
/// <returns>实体总数</returns>
|
|||
[HttpGet] |
|||
[Route("count")] |
|||
////[AuthorizeSettleAccountPermissions.JFCarKBs.Default)]
|
|||
virtual public async Task<long> GetTotalCountAsync(Guid branchId) |
|||
{ |
|||
return await _repository.GetCountAsync(branchId); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 删除实体
|
|||
/// </summary>
|
|||
/// <param name="id">ID</param>
|
|||
/// <returns>无</returns>
|
|||
[HttpDelete] |
|||
[Route("{id}")] |
|||
////[AuthorizeSettleAccountPermissions.JFCarKBs.Delete)]
|
|||
virtual public async Task DeleteAsync(Guid id) |
|||
{ |
|||
//var entity = await GetFromCacheAsync(id);
|
|||
//await Cache.DeleteAsync<JFCarKB>(id.ToString());
|
|||
await _repository.DeleteAsync(id); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 按IDs删除实体列表
|
|||
/// </summary>
|
|||
/// <param name="ids">IDs</param>
|
|||
/// <returns>是否执行成功</returns>
|
|||
[HttpPost] |
|||
[Route("delete")] |
|||
////[AuthorizeSettleAccountPermissions.JFCarKBs.Delete)]
|
|||
virtual public async Task<bool> DeleteListAsync(List<Guid> ids) |
|||
{ |
|||
//foreach (var id in ids)
|
|||
//{
|
|||
// var entity = await GetFromCacheAsync(id);
|
|||
|
|||
//}
|
|||
|
|||
return await _repository.DeleteListAsync(ids); |
|||
} |
|||
|
|||
|
|||
///// <summary>
|
|||
|
|||
/// <summary>
|
|||
/// 根据筛选条件获取实体列表
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 请求条件包括:筛选条件列表,排序条件,数据数量,页码
|
|||
/// </remarks>
|
|||
/// <param name="input">请求条件</param>
|
|||
/// <returns>实体DTO列表</returns>
|
|||
[HttpPost] |
|||
[Route("list")] |
|||
////[AuthorizeSettleAccountPermissions.JFCarKBs.Default)]
|
|||
|
|||
|
|||
public async Task<PagedResultDto<JFCarKBDto>> GetListAsync(Guid parentId, JFCarKBRequestDto input) |
|||
{ |
|||
if (input.ParentId != Guid.Empty) |
|||
{ |
|||
input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "ParentId", Logic = EnumFilterLogic.And, Value = input.ParentId.ToString() }); |
|||
} |
|||
else |
|||
{ |
|||
return new PagedResultDto<JFCarKBDto>(0, new List<JFCarKBDto>()); |
|||
} |
|||
|
|||
var entities = await _repository.GetListByFilterAsync(input.BranchId, input.Filters, input.Sorting, input.MaxResultCount, |
|||
input.SkipCount, true); |
|||
|
|||
var totalCount = await GetCountAsync(input); |
|||
var dtos = _objectMapper.Map<List<JFCarKB>, List<JFCarKBDto>>(entities); |
|||
|
|||
return new PagedResultDto<JFCarKBDto>(totalCount, dtos); |
|||
} |
|||
|
|||
///// <summary>
|
|||
|
|||
/// <summary>
|
|||
/// 根据筛选条件获取实体列表
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 请求条件包括:筛选条件列表,排序条件,数据数量,页码
|
|||
/// </remarks>
|
|||
/// <param name="input">请求条件</param>
|
|||
/// <returns>实体DTO列表</returns>
|
|||
[HttpPost] |
|||
[Route("listVersion")] |
|||
//[AuthorizeSettleAccountPermissions.JFCarKBs.Default)]
|
|||
public async Task<PagedResultDto<JFCarKBVersionDto>> GetVersionListAsync(JFCarKBVersionRequestDto input) |
|||
{ |
|||
var entities = await _versionRepository.GetListByFilterAsync(input.BranchId, input.Filters, input.Sorting, int.MaxValue, |
|||
input.SkipCount, true); |
|||
|
|||
var totalCount = await GetCountAsync(input); |
|||
var dtos = _objectMapper.Map<List<JFCarKBVersion>, List<JFCarKBVersionDto>>(entities); |
|||
|
|||
return new PagedResultDto<JFCarKBVersionDto>(totalCount, dtos); |
|||
} |
|||
/// <summary>
|
|||
/// 导出文件
|
|||
/// </summary>
|
|||
/// <param name="input"></param>
|
|||
/// <returns></returns>
|
|||
[HttpPost] |
|||
[Route("Export")] |
|||
//[AuthorizeSettleAccountPermissions.JFCarKBs.Default)]
|
|||
virtual public async Task<string> ExportAsync(JFCarKBRequestDto input) |
|||
{ |
|||
|
|||
IExporter _csv = new CsvExporter(); |
|||
|
|||
IExporter _excel = new ExcelExporter(); |
|||
|
|||
if (input.ParentId != Guid.Empty) |
|||
{ |
|||
input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "ParentId", Logic = EnumFilterLogic.And, Value = input.ParentId.ToString() }); |
|||
} |
|||
|
|||
var entities = await _repository.GetListByFilterAsync(input.BranchId, input.Filters, input.Sorting, int.MaxValue, |
|||
0, true); |
|||
|
|||
var dtoDetails = ObjectMapper.Map<List<JFCarKB>, List<ExportJFCarKBDto>>(entities); |
|||
|
|||
string _fileName = string.Empty; |
|||
//声明导出容器
|
|||
|
|||
byte[] result = null; |
|||
|
|||
//_fileName = CommonMethod.GetExcelFileNameByUserID(ApplicationConsts.Sec_JFCarKBFileName, CurrentUser.Id?.ToString(), ApplicationConsts.FileExtension);
|
|||
//result = await _excel.ExportAsByteArray(dtoDetails);
|
|||
switch (input.FileType) |
|||
{ |
|||
case 0: |
|||
|
|||
|
|||
_fileName = string.Format("解放看板_{0}.csv", System.DateTime.Now.ToString("yyyyMMddHHmmss")); |
|||
result = await _csv.ExportAsByteArray(dtoDetails); |
|||
|
|||
break; |
|||
case 1: |
|||
_fileName = string.Format("解放看板_{0}.xlsx", System.DateTime.Now.ToString("yyyyMMddHHmmss")); |
|||
result = await _excel.ExportAsByteArray(dtoDetails); |
|||
|
|||
break; |
|||
} |
|||
|
|||
|
|||
|
|||
result.ShouldNotBeNull(); |
|||
|
|||
//保存导出文件到服务器存成二进制
|
|||
await _excelImportService.SaveBlobAsync( |
|||
new SaveExcelImportInputDto |
|||
{ |
|||
Name = _fileName, |
|||
Content = result |
|||
} |
|||
); |
|||
return _fileName; |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,328 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Diagnostics; |
|||
using System.Linq; |
|||
using System.Threading.Tasks; |
|||
using EFCore.BulkExtensions; |
|||
using Magicodes.ExporterAndImporter.Core; |
|||
using Magicodes.ExporterAndImporter.Csv; |
|||
using Magicodes.ExporterAndImporter.Excel; |
|||
using Microsoft.AspNetCore.Authorization; |
|||
using Microsoft.AspNetCore.Http; |
|||
using Microsoft.AspNetCore.Mvc; |
|||
using Microsoft.EntityFrameworkCore; |
|||
using Microsoft.Extensions.Caching.Distributed; |
|||
using Shouldly; |
|||
using Volo.Abp; |
|||
using Volo.Abp.Application.Dtos; |
|||
using Volo.Abp.Application.Services; |
|||
using Volo.Abp.Caching; |
|||
using Volo.Abp.Domain.Repositories; |
|||
using Volo.Abp.Guids; |
|||
using Volo.Abp.ObjectMapping; |
|||
using Volo.Abp.Uow; |
|||
using Win.Abp.Snowflakes; |
|||
using Win.Sfs.BaseData.ImportExcelCommon; |
|||
using Win.Sfs.SettleAccount.CommonManagers; |
|||
using Win.Sfs.SettleAccount.Constant; |
|||
using Win.Sfs.SettleAccount.Entities.JFCarKBs; |
|||
using Win.Sfs.SettleAccount.ExcelImporter; |
|||
using Win.Sfs.Shared.CacheBase; |
|||
using Win.Sfs.Shared.Enums.SettleAccount; |
|||
using Win.Sfs.Shared.Filter; |
|||
using Win.Utils; |
|||
|
|||
namespace Win.Sfs.SettleAccount.JFCarKBs |
|||
{ |
|||
|
|||
/// <summary>
|
|||
/// 区域相关应用服务
|
|||
/// </summary>
|
|||
//[AuthorizeSettleAccountPermissions.JFCarKBs.Default)]
|
|||
|
|||
[Route("api/settleaccount/JFCarKB")] |
|||
public class JFCarKBAppService : SettleAccountApplicationBase<JFCarKB>, IJFCarKBAppService |
|||
{ |
|||
private readonly IGuidGenerator _guidGenerator; |
|||
|
|||
private readonly IObjectMapper _objectMapper; |
|||
|
|||
private readonly IExcelImportAppService _excelImportService; |
|||
|
|||
|
|||
private readonly ISettleAccountBranchEfCoreRepository<JFCarKB, Guid> _repository; |
|||
|
|||
private readonly ISettleAccountBranchEfCoreRepository<JFCarKBVersion, Guid> _versionRepository; |
|||
/// <summary>
|
|||
/// 构建方法
|
|||
/// </summary>
|
|||
/// <param name="guidGenerator">构建UID</param>
|
|||
/// <param name="objectMapper">自动map</param>
|
|||
/// <param name="repository">仓储接口</param>
|
|||
/// <param name="cache">缓存</param>
|
|||
public JFCarKBAppService(IGuidGenerator guidGenerator, |
|||
IObjectMapper objectMapper, |
|||
IExcelImportAppService excelImportService, |
|||
ISnowflakeIdGenerator snowflakeIdGenerator, |
|||
ICommonManager commonManager, |
|||
ISettleAccountBranchEfCoreRepository<JFCarKB, Guid> repository, |
|||
ISettleAccountBranchEfCoreRepository<JFCarKBVersion, Guid> versionRepository, |
|||
IDistributedCache<JFCarKB> cache |
|||
) : base(cache,excelImportService,snowflakeIdGenerator,commonManager) |
|||
{ |
|||
_guidGenerator = guidGenerator; |
|||
_objectMapper = objectMapper; |
|||
_repository = repository; |
|||
_excelImportService = excelImportService; |
|||
_versionRepository = versionRepository; |
|||
} |
|||
|
|||
#region 导入导出功能
|
|||
/// <summary>
|
|||
/// 导入功能
|
|||
/// </summary>
|
|||
/// <param name="files">上传的文件(前端已经限制只能上传一个附件)</param>
|
|||
/// <returns></returns>
|
|||
[HttpPost] |
|||
[Route("ExcelImport")] |
|||
[DisableRequestSizeLimit] |
|||
|
|||
//[AuthorizeSettleAccountPermissions.JFCarKBs.Default)]
|
|||
public async Task<string> JFCarKBUploadExcelImport([FromForm] IFormFileCollection files, Guid branchId, string year, string period, string version, string customerCode,DateTime datetime) |
|||
{ |
|||
ExportImporter _exportImporter = new ExportImporter(); |
|||
var result = await _exportImporter.UploadExcelImport<ImportJFCarKBDto>(files, _excelImportService); |
|||
var entityList = ObjectMapper.Map<List<ImportJFCarKBDto>, List<JFCarKB>>(result); |
|||
var _versionQuery = _versionRepository.Where(p => p.Version == version); |
|||
await _versionQuery.BatchDeleteAsync(); |
|||
var _query = _repository.Where(p => p.Version == version); |
|||
await _query.BatchDeleteAsync(); |
|||
|
|||
|
|||
var _id = GuidGenerator.Create(); |
|||
var _JFCarKBList = new List<JFCarKBVersion>(); |
|||
|
|||
_JFCarKBList.Add(new JFCarKBVersion(_id, branchId, period, version, customerCode, datetime)); |
|||
foreach (var itm in entityList) |
|||
{ |
|||
itm.State= (int)EnumSettleStatus.未结算; |
|||
itm.SetValue(GuidGenerator.Create(), branchId, period, version, customerCode, datetime,_id); |
|||
} |
|||
var bulkConfig = new BulkConfig { SetOutputIdentity = true, BatchSize = 10000 }; |
|||
|
|||
await _repository.GetDbContext().BulkInsertAsync<JFCarKB>(entityList); |
|||
|
|||
await _versionRepository.GetDbContext().BulkInsertAsync(_JFCarKBList); |
|||
|
|||
return ApplicationConsts.SuccessStr; |
|||
} |
|||
|
|||
|
|||
#endregion
|
|||
|
|||
/// <summary>
|
|||
/// 按ID获取唯一实体
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 返回实体全部属性
|
|||
/// </remarks>
|
|||
/// <param name="id">ID</param>
|
|||
/// <returns>实体DTO</returns>
|
|||
[HttpGet] |
|||
[Route("{id}")] |
|||
////[AuthorizeSettleAccountPermissions.JFCarKBs.Default)]
|
|||
virtual public async Task<JFCarKBDto> GetAsync(Guid id) |
|||
{ |
|||
var result = await _repository.GetAsync(id); |
|||
var dto = _objectMapper.Map<JFCarKB, JFCarKBDto>(result); |
|||
return dto; |
|||
} |
|||
|
|||
|
|||
private async Task<JFCarKB> GetFromCacheAsync(Guid id) |
|||
{ |
|||
var result = |
|||
await _repository.GetAsync(id) |
|||
; |
|||
|
|||
return result; |
|||
} |
|||
|
|||
private async Task<long> GetCountAsync(JFCarKBRequestDto input) |
|||
{ |
|||
return await _repository.GetCountByFilterAsync(input.BranchId, input.Filters); |
|||
} |
|||
|
|||
private async Task<long> GetCountAsync(JFCarKBVersionRequestDto input) |
|||
{ |
|||
return await _versionRepository.GetCountByFilterAsync(input.BranchId, input.Filters); |
|||
} |
|||
/// <summary>
|
|||
/// 获取实体总数
|
|||
/// </summary>
|
|||
/// <returns>实体总数</returns>
|
|||
[HttpGet] |
|||
[Route("count")] |
|||
////[AuthorizeSettleAccountPermissions.JFCarKBs.Default)]
|
|||
virtual public async Task<long> GetTotalCountAsync(Guid branchId) |
|||
{ |
|||
return await _repository.GetCountAsync(branchId); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 删除实体
|
|||
/// </summary>
|
|||
/// <param name="id">ID</param>
|
|||
/// <returns>无</returns>
|
|||
[HttpDelete] |
|||
[Route("{id}")] |
|||
////[AuthorizeSettleAccountPermissions.JFCarKBs.Delete)]
|
|||
virtual public async Task DeleteAsync(Guid id) |
|||
{ |
|||
//var entity = await GetFromCacheAsync(id);
|
|||
//await Cache.DeleteAsync<JFCarKB>(id.ToString());
|
|||
await _repository.DeleteAsync(id); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 按IDs删除实体列表
|
|||
/// </summary>
|
|||
/// <param name="ids">IDs</param>
|
|||
/// <returns>是否执行成功</returns>
|
|||
[HttpPost] |
|||
[Route("delete")] |
|||
////[AuthorizeSettleAccountPermissions.JFCarKBs.Delete)]
|
|||
virtual public async Task<bool> DeleteListAsync(List<Guid> ids) |
|||
{ |
|||
//foreach (var id in ids)
|
|||
//{
|
|||
// var entity = await GetFromCacheAsync(id);
|
|||
|
|||
//}
|
|||
|
|||
return await _repository.DeleteListAsync(ids); |
|||
} |
|||
|
|||
|
|||
///// <summary>
|
|||
|
|||
/// <summary>
|
|||
/// 根据筛选条件获取实体列表
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 请求条件包括:筛选条件列表,排序条件,数据数量,页码
|
|||
/// </remarks>
|
|||
/// <param name="input">请求条件</param>
|
|||
/// <returns>实体DTO列表</returns>
|
|||
[HttpPost] |
|||
[Route("list")] |
|||
////[AuthorizeSettleAccountPermissions.JFCarKBs.Default)]
|
|||
|
|||
|
|||
public async Task<PagedResultDto<JFCarKBDto>> GetListAsync(Guid parentId, JFCarKBRequestDto input) |
|||
{ |
|||
if (input.ParentId != Guid.Empty) |
|||
{ |
|||
input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "ParentId", Logic = EnumFilterLogic.And, Value = input.ParentId.ToString() }); |
|||
} |
|||
else |
|||
{ |
|||
return new PagedResultDto<JFCarKBDto>(0, new List<JFCarKBDto>()); |
|||
} |
|||
|
|||
var entities = await _repository.GetListByFilterAsync(input.BranchId, input.Filters, input.Sorting, input.MaxResultCount, |
|||
input.SkipCount, true); |
|||
|
|||
var totalCount = await GetCountAsync(input); |
|||
var dtos = _objectMapper.Map<List<JFCarKB>, List<JFCarKBDto>>(entities); |
|||
|
|||
return new PagedResultDto<JFCarKBDto>(totalCount, dtos); |
|||
} |
|||
|
|||
///// <summary>
|
|||
|
|||
/// <summary>
|
|||
/// 根据筛选条件获取实体列表
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 请求条件包括:筛选条件列表,排序条件,数据数量,页码
|
|||
/// </remarks>
|
|||
/// <param name="input">请求条件</param>
|
|||
/// <returns>实体DTO列表</returns>
|
|||
[HttpPost] |
|||
[Route("listVersion")] |
|||
//[AuthorizeSettleAccountPermissions.JFCarKBs.Default)]
|
|||
public async Task<PagedResultDto<JFCarKBVersionDto>> GetVersionListAsync(JFCarKBVersionRequestDto input) |
|||
{ |
|||
var entities = await _versionRepository.GetListByFilterAsync(input.BranchId, input.Filters, input.Sorting, int.MaxValue, |
|||
input.SkipCount, true); |
|||
|
|||
var totalCount = await GetCountAsync(input); |
|||
var dtos = _objectMapper.Map<List<JFCarKBVersion>, List<JFCarKBVersionDto>>(entities); |
|||
|
|||
return new PagedResultDto<JFCarKBVersionDto>(totalCount, dtos); |
|||
} |
|||
/// <summary>
|
|||
/// 导出文件
|
|||
/// </summary>
|
|||
/// <param name="input"></param>
|
|||
/// <returns></returns>
|
|||
[HttpPost] |
|||
[Route("Export")] |
|||
//[AuthorizeSettleAccountPermissions.JFCarKBs.Default)]
|
|||
virtual public async Task<string> ExportAsync(JFCarKBRequestDto input) |
|||
{ |
|||
|
|||
IExporter _csv = new CsvExporter(); |
|||
|
|||
IExporter _excel = new ExcelExporter(); |
|||
|
|||
if (input.ParentId != Guid.Empty) |
|||
{ |
|||
input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "ParentId", Logic = EnumFilterLogic.And, Value = input.ParentId.ToString() }); |
|||
} |
|||
|
|||
var entities = await _repository.GetListByFilterAsync(input.BranchId, input.Filters, input.Sorting, int.MaxValue, |
|||
0, true); |
|||
|
|||
var dtoDetails = ObjectMapper.Map<List<JFCarKB>, List<ExportJFCarKBDto>>(entities); |
|||
|
|||
string _fileName = string.Empty; |
|||
//声明导出容器
|
|||
|
|||
byte[] result = null; |
|||
|
|||
//_fileName = CommonMethod.GetExcelFileNameByUserID(ApplicationConsts.Sec_JFCarKBFileName, CurrentUser.Id?.ToString(), ApplicationConsts.FileExtension);
|
|||
//result = await _excel.ExportAsByteArray(dtoDetails);
|
|||
switch (input.FileType) |
|||
{ |
|||
case 0: |
|||
|
|||
|
|||
_fileName = string.Format("解放看板_{0}.csv", System.DateTime.Now.ToString("yyyyMMddHHmmss")); |
|||
result = await _csv.ExportAsByteArray(dtoDetails); |
|||
|
|||
break; |
|||
case 1: |
|||
_fileName = string.Format("解放看板_{0}.xlsx", System.DateTime.Now.ToString("yyyyMMddHHmmss")); |
|||
result = await _excel.ExportAsByteArray(dtoDetails); |
|||
|
|||
break; |
|||
} |
|||
|
|||
|
|||
|
|||
result.ShouldNotBeNull(); |
|||
|
|||
//保存导出文件到服务器存成二进制
|
|||
await _excelImportService.SaveBlobAsync( |
|||
new SaveExcelImportInputDto |
|||
{ |
|||
Name = _fileName, |
|||
Content = result |
|||
} |
|||
); |
|||
return _fileName; |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,652 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Threading.Tasks; |
|||
using Microsoft.AspNetCore.Authorization; |
|||
using Microsoft.AspNetCore.Http; |
|||
using Microsoft.AspNetCore.Mvc; |
|||
using Microsoft.Extensions.Caching.Distributed; |
|||
using AutoMapper; |
|||
using System.Linq; |
|||
using System.Text; |
|||
using Volo.Abp.Guids; |
|||
using Volo.Abp.Application.Services; |
|||
using Volo.Abp.Caching; |
|||
|
|||
using Volo.Abp.ObjectMapping; |
|||
using Win.Sfs.SettleAccount.ExcelImporter; |
|||
using Win.Sfs.Shared.CacheBase; |
|||
using Win.Utils; |
|||
using Volo.Abp.Application.Dtos; |
|||
using Win.Sfs.BaseData.ImportExcelCommon; |
|||
using Volo.Abp.Domain.Repositories; |
|||
using EFCore.BulkExtensions; |
|||
using System.IO; |
|||
using Microsoft.EntityFrameworkCore; |
|||
using Win.Sfs.SettleAccount.Entities.SettleAccountVersion; |
|||
using Win.Sfs.SettleAccount.FISes; |
|||
using Win.Sfs.Shared.Enums.SettleAccount; |
|||
using Win.Sfs.Shared.Filter; |
|||
using Shouldly; |
|||
using Magicodes.ExporterAndImporter.Csv; |
|||
using Magicodes.ExporterAndImporter.Core; |
|||
using Magicodes.ExporterAndImporter.Excel; |
|||
using System.Data.Common; |
|||
using Volo.Abp.Uow; |
|||
using Volo.Abp; |
|||
using Win.Abp.Snowflakes; |
|||
using Win.Sfs.SettleAccount.CommonManagers; |
|||
using Win.Sfs.SettleAccount.ExportReports; |
|||
using Win.Sfs.SettleAccount.Constant; |
|||
using Win.Sfs.SettleAccount.MaterialRelationships; |
|||
using Win.Sfs.SettleAccount.Entities.TaskJobs; |
|||
using Magicodes.ExporterAndImporter.Core.Models; |
|||
|
|||
using TaskJob.Services; |
|||
using TaskJob.EventArgs; |
|||
using Win.Sfs.SettleAccount.Entities.WMS; |
|||
using Win.Sfs.SettleAccount.Entities.Wms; |
|||
using Win.Sfs.SettleAccount.Repository; |
|||
using WY.NewJit.Extends.PaiGe.WMS; |
|||
using Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report; |
|||
|
|||
namespace Win.Sfs.SettleAccount.Entities.SettleAccounts |
|||
{ |
|||
/// <summary>
|
|||
/// 红旗H平台准时化-出库
|
|||
/// </summary>
|
|||
|
|||
|
|||
[Authorize(SettleAccountPermissions.WMSHQ.Default)] |
|||
[Route("api/settleaccount/WMSCusomerKanbanoutput")] |
|||
public class WMSCusomerKanbanAppService : |
|||
SettleAccountApplicationBase<WmsCustomerKanbanOutPutDetial> |
|||
{ |
|||
|
|||
private readonly ISettleAccountBranchEfCoreRepository<WmsCustomerKanbanOutPutDetial, Guid> _wmsRepository; |
|||
private readonly ISettleAccountBranchEfCoreRepository<WmsCustomerKanbanOutPut, Guid> _wmsVersionRepository; |
|||
private readonly WMSEfCoreRepository<WmsCustomerKanbanOutPutDetial> _wmsefRespository; |
|||
|
|||
private readonly WMSEfCoreRepository<TB_BILL> _wmstbRespository; |
|||
private readonly ISettleAccountBranchEfCoreRepository<TaskJob, Guid> _job; |
|||
private readonly IExcelImportAppService _excelImportService; |
|||
private readonly ErpPartDapperRepository _erpdapperRepository; |
|||
|
|||
|
|||
private readonly TaskJobService _service; |
|||
/// <summary>
|
|||
///
|
|||
/// </summary>
|
|||
/// <param name="wmsRepository"></param>
|
|||
/// <param name="job"></param>
|
|||
/// <param name="wmsVersionRepository"></param>
|
|||
/// <param name="wmsefRespository"></param>
|
|||
/// <param name="wmstbRespository"></param>
|
|||
public WMSCusomerKanbanAppService( |
|||
|
|||
|
|||
IExcelImportAppService excelImportService, |
|||
|
|||
ISettleAccountBranchEfCoreRepository<WmsCustomerKanbanOutPutDetial, Guid> wmsRepository, |
|||
ISettleAccountBranchEfCoreRepository<TaskJob, Guid> job, |
|||
ISettleAccountBranchEfCoreRepository<WmsCustomerKanbanOutPut, Guid> wmsVersionRepository, |
|||
WMSEfCoreRepository<WmsCustomerKanbanOutPutDetial> wmsefRespository, |
|||
WMSEfCoreRepository<TB_BILL> wmstbRespository, |
|||
IDistributedCache<WmsCustomerKanbanOutPutDetial> cache, |
|||
ISnowflakeIdGenerator snowflakeIdGenerator, |
|||
ErpPartDapperRepository erpdapperRepository, |
|||
ICommonManager commonManager |
|||
) : base(cache, excelImportService, snowflakeIdGenerator, commonManager) |
|||
{ |
|||
_job = job; |
|||
_wmstbRespository = wmstbRespository; |
|||
_wmsRepository = wmsRepository; |
|||
_wmsVersionRepository = wmsVersionRepository; |
|||
_wmsefRespository = wmsefRespository; |
|||
_excelImportService = excelImportService; |
|||
_erpdapperRepository = erpdapperRepository; |
|||
} |
|||
|
|||
private async Task<long> GetCountAsync(WmsKanbanOutPutDetialRequestDto input) |
|||
{ |
|||
return await _wmsRepository.GetCountByFilterAsync(GuidGenerator.Create(), input.Filters); |
|||
} |
|||
|
|||
private async Task<long> GetCountAsync(WmsKanbanOutPutRequestDto input) |
|||
{ |
|||
return await _wmsVersionRepository.GetCountByFilterAsync(GuidGenerator.Create(), input.Filters); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 准时化出库主表
|
|||
/// </summary>
|
|||
/// <param name="input"></param>
|
|||
/// <returns></returns>
|
|||
[HttpPost] |
|||
[Route("WmsCustomerKanbanList")] |
|||
//[Authorize(SettleAccountPermissions.SettleAccounts.Default)]
|
|||
virtual public async Task<PagedResultDto<WmsCustomerKanbanOutPut>> GetListAsync( WmsKanbanOutPutRequestDto input) |
|||
{ |
|||
|
|||
var entities = await _wmsVersionRepository.GetListByFilterAsync(GuidGenerator.Create(), input.Filters, input.Sorting, input.MaxResultCount, |
|||
input.SkipCount, true); |
|||
|
|||
var totalCount = await GetCountAsync(input); |
|||
|
|||
|
|||
return new PagedResultDto<WmsCustomerKanbanOutPut>(totalCount, entities); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 准时化出库明细
|
|||
/// </summary>
|
|||
/// <param name="input"></param>
|
|||
/// <returns></returns>
|
|||
[HttpPost] |
|||
[Route("WmsCustomerKanbanDetailList")] |
|||
//[Authorize(SettleAccountPermissions.SettleAccounts.Default)]
|
|||
virtual public async Task<PagedResultDto<WmsCustomerKanbanOutPutDetial>> GetListAsync(WmsKanbanOutPutDetialRequestDto input) |
|||
{ |
|||
//不用传version 单号能保证唯一
|
|||
input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "BillNum", Logic = EnumFilterLogic.And, Value = input.BillNum }); |
|||
//input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "State", Logic = EnumFilterLogic.And, Value = input.State.ToString() });
|
|||
|
|||
var entities = await _wmsRepository.GetListByFilterAsync(GuidGenerator.Create(), input.Filters, input.Sorting, input.MaxResultCount, |
|||
input.SkipCount, true); |
|||
|
|||
var totalCount = await GetCountAsync(input); |
|||
return new PagedResultDto<WmsCustomerKanbanOutPutDetial>(totalCount, entities); |
|||
} |
|||
/// <summary>
|
|||
/// 任务明细标记已确认
|
|||
/// </summary>
|
|||
/// <param name="files">上传的文件(前端已经限制只能上传一个附件)</param>
|
|||
/// <returns></returns>
|
|||
[HttpPost] |
|||
[Route("WmsCustomerKanbanOutPutAudit")] |
|||
[DisableRequestSizeLimit] |
|||
|
|||
public async Task<bool> WmsHQHKanbanAudit(List<Guid> ids) |
|||
{ |
|||
var _joblist =await _job.Where(p => ids.Contains(p.Id)).ToListAsync(); |
|||
foreach (var itm in _joblist) |
|||
{ |
|||
itm.FileName = "已确认"; |
|||
await _job.UpdateAsync(itm); |
|||
} |
|||
|
|||
return true; |
|||
} |
|||
/// <summary>
|
|||
///更新备注
|
|||
/// </summary>
|
|||
/// <param name="input"></param>
|
|||
/// <returns></returns>
|
|||
[HttpGet] |
|||
[Route("UpdateRemark")] |
|||
|
|||
public async Task<bool> UpdateRemark(Guid id, string remark) |
|||
{ |
|||
var entity = _wmsVersionRepository.FirstOrDefault(p => p.Id == id); |
|||
if (entity != null) |
|||
{ |
|||
entity.Remark = remark; |
|||
await _wmsVersionRepository.UpdateAsync(entity); |
|||
|
|||
} |
|||
return true; |
|||
} |
|||
|
|||
|
|||
|
|||
///// <summary>
|
|||
///// 选择任务,生成出库单,只包含已确认的单据
|
|||
///// </summary>
|
|||
///// <param name="ids"></param>
|
|||
///// <param name="version"></param>
|
|||
///// <returns></returns>
|
|||
//[HttpPost]
|
|||
//[Route("WmsWithOutKanbanOutPut")]
|
|||
//public async Task<string> WmsWithOutKanbanOutPut(WmsJitRequestDto input)
|
|||
//{
|
|||
// var _billNum = "KA" + DateTime.Now.ToString("yyyyMMddhhmmss");
|
|||
|
|||
// var _joblist = _job.Where(p => input.Guids.Contains(p.Id) && p.FileName == "已确认").ToList();
|
|||
// if (_joblist.Count() > 0)
|
|||
// {
|
|||
// var fileList = _joblist.Select(p => p.RealDownFileName).ToList();
|
|||
// List<WmsCustomerKanbanOutPutDetial> _lst = new List<WmsCustomerKanbanOutPutDetial>();
|
|||
// foreach (var filename in fileList)
|
|||
// {
|
|||
// string fileSavePath = Environment.CurrentDirectory + @"\wwwroot\files\host\my-file-container\" + filename;
|
|||
// ExcelHelper _excelHelper = new ExcelHelper(fileSavePath);
|
|||
// var _list = _excelHelper.ExcelToList<SettleKBWithOutCode>();
|
|||
// foreach (var itm in _list)
|
|||
// {
|
|||
|
|||
// var _entity= new WmsCustomerKanbanOutPutDetial(GuidGenerator.Create(), string.Empty, string.Empty, itm.MaterialCode, itm.MaterialDesc
|
|||
// , itm.SapMaterialGroup, string.Empty, string.Empty, 0, string.Empty, string.Empty, itm.Version, itm.SapMaterialCode,
|
|||
// _billNum, Guid.Empty, string.Empty, itm.InvoiceQty,itm.
|
|||
// );
|
|||
|
|||
// _lst.Add(_entity);
|
|||
// }
|
|||
|
|||
// }
|
|||
|
|||
// var outPutDetail = await _wmsRepository.Where(p => p.Version == input.Version && p.Kanban==string.Empty).ToListAsync();
|
|||
|
|||
|
|||
// await _wmsRepository.GetDbContext().BulkInsertAsync(_lst, new BulkConfig() { BulkCopyTimeout = 0, BatchSize = 10000 });
|
|||
// int _count = _wmsVersionRepository.Count(p => p.Version == input.Version && p.BillNum == _billNum);
|
|||
// if (_count == 0)
|
|||
// {
|
|||
// var _version = new WmsCustomerKanbanOutPut(GuidGenerator.Create(), input.Version, _billNum, CurrentUser.Email);
|
|||
|
|||
// await _wmsVersionRepository.InsertAsync(_version, true);
|
|||
// }
|
|||
|
|||
// foreach (var job in _joblist)
|
|||
// {
|
|||
// job.FileName = _billNum;
|
|||
// await _job.UpdateAsync(job);
|
|||
// }
|
|||
// }
|
|||
|
|||
// return ApplicationConsts.SuccessStr; ;
|
|||
//}
|
|||
|
|||
|
|||
/// <summary>
|
|||
/// 选择任务,生成出库单,只包含已确认的单据
|
|||
/// </summary>
|
|||
/// <param name="ids"></param>
|
|||
/// <param name="version"></param>
|
|||
/// <returns></returns>
|
|||
[HttpPost] |
|||
[Route("WmsCustomerKanbanOutPut")] |
|||
public async Task<string> WmsCustomerKanbanOutPut(WmsJitRequestDto input) |
|||
{ |
|||
var _billNum = "CKB" + DateTime.Now.ToString("yyyyMMddhhmmss"); |
|||
|
|||
var _joblist = _job.Where(p => input.Guids.Contains(p.Id) && p.FileName == "已确认").ToList(); |
|||
if (_joblist.Count() > 0) |
|||
{ |
|||
var fileList = _joblist.Select(p => p.RealDownFileName).ToList(); |
|||
List<WmsCustomerKanbanOutPutDetial> _lst = new List<WmsCustomerKanbanOutPutDetial>(); |
|||
foreach (var filename in fileList) |
|||
{ |
|||
string fileSavePath = Environment.CurrentDirectory + @"\wwwroot\files\host\my-file-container\" + filename; |
|||
ExcelHelper _excelHelper = new ExcelHelper(fileSavePath); |
|||
var _list = _excelHelper.ExcelToList<WmsCustomerKanbanOutPutDetial>(); |
|||
foreach (var itm in _list) |
|||
{ |
|||
itm.SetData(GuidGenerator.Create(),string.Empty,!string.IsNullOrEmpty(itm.WmsBillNum)? itm.WmsBillNum:string.Empty,input.Version,GuidGenerator.Create(),itm.CustomerCode); |
|||
} |
|||
_lst.AddRange(_list.ToArray()); |
|||
} |
|||
|
|||
foreach (var itm in _lst) |
|||
{ |
|||
if (string.IsNullOrEmpty(itm.Kanban)) |
|||
{ |
|||
itm.Kanban = "WMSDBoardNum"; |
|||
} |
|||
} |
|||
|
|||
var outPutDetail = await _wmsRepository.Where(p => p.Version == input.Version && p.State != 4 ).ToListAsync(); |
|||
|
|||
var error = from itm1 in outPutDetail |
|||
join itm2 in _lst on |
|||
new { itm1.SapMaterialCode, itm1.Kanban } |
|||
equals |
|||
new { itm2.SapMaterialCode, itm2.Kanban } |
|||
select itm1; |
|||
var errList = error.GroupBy(p => new { p.BillNum }).Select(p => new { BillNum = p.Key.BillNum, Number = p.Sum(itm => itm.Qty) }); |
|||
if (errList.Count() == 0) |
|||
{ |
|||
|
|||
var query = from itm1 in _lst |
|||
join itm2 in outPutDetail on |
|||
new { itm1.SapMaterialCode, itm1.Kanban } |
|||
equals |
|||
new { itm2.SapMaterialCode, itm2.Kanban } into temp1 |
|||
from tm1 in temp1.DefaultIfEmpty() |
|||
where tm1 == null |
|||
select itm1; |
|||
var _wmslst = query.ToList(); |
|||
foreach (var itm in _wmslst) |
|||
{ |
|||
itm.BillNum = _billNum; |
|||
} |
|||
await _wmsRepository.GetDbContext().BulkInsertAsync(_wmslst, new BulkConfig() { BulkCopyTimeout = 0, BatchSize = 10000 }); |
|||
int _count = _wmsVersionRepository.Count(p => p.Version == input.Version && p.BillNum == _billNum); |
|||
if (_count == 0) |
|||
{ |
|||
var _version = new WmsCustomerKanbanOutPut(GuidGenerator.Create(), input.Version, _billNum, CurrentUser.Email,""); |
|||
_version.Remark = !string.IsNullOrEmpty(_joblist.FirstOrDefault().Remark) ? _joblist.FirstOrDefault().Remark : string.Empty; |
|||
await _wmsVersionRepository.InsertAsync(_version, true); |
|||
} |
|||
|
|||
foreach (var job in _joblist) |
|||
{ |
|||
job.FileName = _billNum; |
|||
await _job.UpdateAsync(job); |
|||
} |
|||
} |
|||
else |
|||
{ |
|||
StringBuilder _buffer = new StringBuilder(); |
|||
foreach (var itm in errList) |
|||
{ |
|||
_buffer.AppendFormat("出库单号:{0}重复记录数:{1}条", itm.BillNum, itm.Number); |
|||
} |
|||
var _errinfo = _buffer.ToString(); |
|||
|
|||
foreach (var job in _joblist) |
|||
{ |
|||
job.FileName = _errinfo; |
|||
await _job.UpdateAsync(job); |
|||
} |
|||
} |
|||
} |
|||
else |
|||
{ |
|||
_billNum = string.Empty; |
|||
} |
|||
return ApplicationConsts.SuccessStr; ; |
|||
} |
|||
/// <summary>
|
|||
/// 出库界面功能,核准出库功能
|
|||
/// </summary>
|
|||
/// <param name="version"></param>
|
|||
/// <param name="p_list"></param>
|
|||
/// <returns></returns>
|
|||
[HttpPost] |
|||
[Route("WmsCustomerKanbanOutPut-Pass")] |
|||
[UnitOfWork(false)] |
|||
public async Task<bool> WmsCustomerKanbanOutPutPass(WmsJitRequestDto input) |
|||
{ |
|||
if (DateTime.Now.ToString("yyyyMM") != input.AccountDate.ToString("yyyyMM")) |
|||
{ |
|||
throw new BusinessException("8989", "填写过账日期应该为当月!"); |
|||
|
|||
} |
|||
|
|||
|
|||
|
|||
var sql = "DECLARE @return_value int\n" + |
|||
"EXEC @return_value = [dbo].[p_wms_output]\n" + |
|||
" @billnum = N'{0}',\n" + |
|||
" @type = 23,\n" + |
|||
" @date = N'{1}'\n" + |
|||
"SELECT 'Return Value' = @return_value"; |
|||
await _wmsRepository.GetDbContext().Database.ExecuteSqlRawAsync( |
|||
string.Format(sql, input.BillNum, input.AccountDate.ToShortDateString()) |
|||
); |
|||
|
|||
|
|||
|
|||
return true; |
|||
|
|||
} |
|||
/// <summary>
|
|||
///出库界面功能, 撤销核准出库
|
|||
/// </summary>
|
|||
/// <param name="ids"></param>
|
|||
/// <param name="version"></param>
|
|||
/// <returns></returns>
|
|||
[HttpPost] |
|||
[Route("WmsCustomerKanbanOutPut-Cancel")] |
|||
[UnitOfWork(false)] |
|||
public async Task<bool> WmsCustomerKanbanOutPutCancel(WmsJitRequestDto input) |
|||
{ |
|||
//if (DateTime.Now.ToString("yyyyMM") != input.AccountDate.ToString("yyyyMM"))
|
|||
//{
|
|||
// throw new BusinessException("8989", "填写过账日期应该为当月!");
|
|||
|
|||
//}
|
|||
|
|||
|
|||
if (input.Guids != null && input.Guids.Count() > 0) |
|||
{ |
|||
List<string> _ls = new List<string>(); |
|||
foreach (var itm in input.Guids) |
|||
{ |
|||
_ls.Add(string.Format("{0}", itm)); |
|||
} |
|||
|
|||
string str = string.Join(",", _ls.ToArray()); |
|||
|
|||
var sql = "DECLARE @return_value int\n" + |
|||
"EXEC @return_value = [dbo].[p_wms_output_cancel]\n" + |
|||
" @Guids ='{0}', \n" + |
|||
" @billnum = N'{1}',\n" + |
|||
" @type = 23,\n" + |
|||
" @accountdate = N'{2}'\n" + |
|||
"SELECT 'Return Value' = @return_value"; |
|||
|
|||
sql = string.Format(sql, str, input.BillNum, input.AccountDate.ToShortDateString()); |
|||
|
|||
await _wmsRepository.GetDbContext().Database.ExecuteSqlRawAsync( |
|||
sql |
|||
); |
|||
|
|||
} |
|||
|
|||
return true; |
|||
} |
|||
/// <summary>
|
|||
/// 出库界面功能删除
|
|||
/// </summary>
|
|||
/// <param name="version"></param>
|
|||
/// <param name="p_list"></param>
|
|||
/// <returns></returns>
|
|||
[HttpPost] |
|||
[Route("WmsOutPutDelete")] |
|||
[UnitOfWork(false)] |
|||
public async Task<bool> WmsOutPutDelete(WmsJitRequestDto input) |
|||
{ |
|||
var count = _wmsRepository.Count(p => p.BillNum == input.BillNum && p.State != 0); |
|||
|
|||
if (count > 0) |
|||
{ |
|||
return false; |
|||
} |
|||
var sql = "DECLARE @return_value int\n" + |
|||
"EXEC @return_value = [dbo].[p_wms_output_cancel_all]\n" + |
|||
" @billnum = N'{0}',\n" + |
|||
" @type = 23\n" + |
|||
"SELECT 'Return Value' = @return_value"; |
|||
await _wmsRepository.GetDbContext().Database.ExecuteSqlRawAsync( |
|||
string.Format(sql, input.BillNum) |
|||
); |
|||
|
|||
|
|||
|
|||
return true; |
|||
} |
|||
[HttpPost] |
|||
[Route("ExcelImport")] |
|||
[DisableRequestSizeLimit] |
|||
//[Authorize(SettleAccountPermissions.SettleAccounts.Default)]
|
|||
public async Task<string> ExcelImport([FromForm] IFormFileCollection files, string version,string customerCode) |
|||
{ |
|||
var _billNum = "CKB(" +customerCode+")"+ DateTime.Now.ToString("yyyyMMddhhmmss"); |
|||
var checkList = new List<ErrorExportDto>(); |
|||
ExportImporter _exportImporter = new ExportImporter(); |
|||
var result = await _exportImporter.ExtendExcelOfSheetOneImport<WmsCustomerKanbanOutPutDetial>(files, _excelImportService); |
|||
|
|||
//检验1:导入模板中的第一页签数据不能为空
|
|||
if (result == null || result.Count() == 0) |
|||
{ |
|||
checkList.Add(new ErrorExportDto(version, "自定义出库单导入", string.Empty, string.Empty, string.Empty, string.Empty, "导入模板中第一页签没有数据,请检查!", string.Empty)); |
|||
} |
|||
|
|||
if (checkList.Count > 0) |
|||
{ |
|||
return await ExportErrorReportAsync(checkList); |
|||
} |
|||
|
|||
|
|||
var filteResult = result.Where(p =>!string.IsNullOrEmpty(p.SapMaterialCode));//过滤掉物料号为空的数据
|
|||
|
|||
//和物料主数据中SAP物料号检验是否存在
|
|||
foreach (var itm in filteResult) |
|||
{ |
|||
if (!_erpdapperRepository.GetMaterialList().Any(p => p.MaterialCode == itm.SapMaterialCode)) |
|||
{ |
|||
checkList.Add(new ErrorExportDto(version, "自定义出库单导入", string.Empty, string.Empty, itm.SapMaterialCode, string.Empty, string.Format("物料主数据不存在当前导入的物料号{0}!", itm.SapMaterialCode), string.Empty)); |
|||
} |
|||
} |
|||
|
|||
//检验2:导入模板中的结算数据是否为0
|
|||
foreach (var itm in filteResult) |
|||
{ |
|||
if (itm.Qty == 0) |
|||
{ |
|||
checkList.Add(new ErrorExportDto(version, "自定义出库单导入", string.Empty, string.Empty, string.Empty, string.Empty, string.Format("导入模板中物料号{0}的结算数量为0,影响出库请检查!", itm.SapMaterialCode), string.Empty)); |
|||
} |
|||
} |
|||
|
|||
|
|||
List<WmsCustomerKanbanOutPutDetial> _lst = new List<WmsCustomerKanbanOutPutDetial>(); |
|||
var _lsCopy = new List<WmsCustomerKanbanOutPutDetial>(); |
|||
foreach (var itm in filteResult) |
|||
{ |
|||
WmsCustomerKanbanOutPutDetial _detail = new WmsCustomerKanbanOutPutDetial( |
|||
GuidGenerator.Create(), |
|||
!string.IsNullOrEmpty(itm.WmsBillNum) ? itm.WmsBillNum : string.Empty, |
|||
itm.Kanban, |
|||
itm.SapMaterialCode, |
|||
itm.MaterialDesc, |
|||
itm.MaterialGroup, |
|||
string.Empty, |
|||
string.Empty, |
|||
0, |
|||
!string.IsNullOrEmpty(itm.Extend1)?itm.Extend1: string.Empty, |
|||
!string.IsNullOrEmpty(itm.Extend2) ? itm.Extend2 : string.Empty, |
|||
version, |
|||
itm.MaterialCode, |
|||
itm.BillNum, |
|||
GuidGenerator.Create() |
|||
, string.Empty |
|||
,itm.Qty |
|||
|
|||
,itm.Price |
|||
,itm.Amt |
|||
,itm.CustomerCode |
|||
); |
|||
_lsCopy.Add(_detail); |
|||
} |
|||
_lst.AddRange(_lsCopy.ToArray()); |
|||
//看板编号为空,加个默认值
|
|||
foreach (var itm in _lst) |
|||
{ |
|||
if (string.IsNullOrEmpty(itm.Kanban)) |
|||
{ |
|||
itm.Kanban = "WMSDBoardNum"; |
|||
} |
|||
} |
|||
|
|||
//检验3:导入模板中物料号,不能重复
|
|||
var _isRepeatOfReportList = from arc in _lst |
|||
group arc by new { arc.Kanban, arc.SapMaterialCode, arc.Version } |
|||
into g |
|||
where g.Count() > 1 |
|||
select g; |
|||
foreach (var itm in _isRepeatOfReportList) |
|||
{ |
|||
checkList.Add(new ErrorExportDto(version, "自定义出库单", string.Empty, string.Empty, string.Empty, string.Empty, string.Format("导入模板中物料号{0}有重复,请检查!", itm.Key.SapMaterialCode), string.Empty)); |
|||
} |
|||
if (checkList.Count > 0) |
|||
{ |
|||
return await ExportErrorReportAsync(checkList); |
|||
} |
|||
|
|||
|
|||
|
|||
var outPutDetail = await _wmsRepository.Where(p => p.Version == version && p.State != 4 ).ToListAsync(); |
|||
|
|||
|
|||
var error = from itm1 in outPutDetail |
|||
join itm2 in _lst on |
|||
new { itm1.SapMaterialCode, itm1.Kanban } |
|||
equals |
|||
new { itm2.SapMaterialCode, itm2.Kanban} |
|||
select itm1; |
|||
var errList = error.GroupBy(p => new { p.BillNum }).Select(p => new { BillNum = p.Key.BillNum, Number = p.Count() }); |
|||
|
|||
|
|||
foreach (var itm in errList) |
|||
{ |
|||
checkList.Add(new ErrorExportDto() { Message = string.Format("出库单号:{0}重复记录数:{1}条", itm.BillNum, itm.Number) }); |
|||
} |
|||
if (checkList.Count > 0) |
|||
{ |
|||
|
|||
return await ExportErrorReportAsync(checkList); |
|||
} |
|||
|
|||
var query = from itm1 in _lst |
|||
join itm2 in outPutDetail on |
|||
new { itm1.SapMaterialCode, itm1.Kanban } |
|||
equals |
|||
new { itm2.SapMaterialCode, itm2.Kanban } into temp1 |
|||
from tm1 in temp1.DefaultIfEmpty() |
|||
where tm1 == null |
|||
select itm1; |
|||
var _wmslst = query.ToList(); |
|||
foreach (var itm in _wmslst) |
|||
{ |
|||
itm.BillNum = _billNum; |
|||
} |
|||
await _wmsRepository.GetDbContext().BulkInsertAsync(_wmslst, new BulkConfig() { BulkCopyTimeout = 0, BatchSize = 10000 }); |
|||
int _count = _wmsVersionRepository.Count(p => p.Version == version && p.BillNum == _billNum); |
|||
if (_count == 0) |
|||
{ |
|||
var _version = new WmsCustomerKanbanOutPut(GuidGenerator.Create(), version, _billNum, CurrentUser.Email,customerCode); |
|||
|
|||
await _wmsVersionRepository.InsertAsync(_version, true); |
|||
} |
|||
return ApplicationConsts.SuccessStr; |
|||
} |
|||
/// <summary>
|
|||
/// 导出
|
|||
/// </summary>
|
|||
/// <param name="input"></param>
|
|||
/// <returns></returns>
|
|||
[HttpPost] |
|||
[Route("Export")] |
|||
//[Authorize(SettleAccountPermissions.SettleAccounts.Default)]
|
|||
virtual public async Task<string> ExportAsync(WmsKanbanOutPutDetialRequestDto input) |
|||
{ |
|||
input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "BillNum", Logic = EnumFilterLogic.And, Value = input.BillNum }); |
|||
var entities = await _wmsRepository.GetListByFilterAsync(GuidGenerator.Create(), input.Filters, input.Sorting, int.MaxValue, |
|||
0, true); |
|||
|
|||
IExporter _excel = new ExcelExporter(); |
|||
byte[] result = null; |
|||
|
|||
var _fileName = string.Format("自定义客户出库单_{0}.xlsx", Guid.NewGuid().ToString()); |
|||
result = await _excel.ExportAsByteArray(entities); |
|||
|
|||
|
|||
result.ShouldNotBeNull(); |
|||
|
|||
//保存导出文件到服务器存成二进制
|
|||
await _excelImportService.SaveBlobAsync( |
|||
new SaveExcelImportInputDto |
|||
{ |
|||
Name = _fileName, |
|||
Content = result |
|||
} |
|||
); |
|||
return _fileName; |
|||
|
|||
|
|||
|
|||
} |
|||
|
|||
|
|||
} |
|||
} |
@ -0,0 +1,231 @@ |
|||
|
|||
using EFCore.BulkExtensions; |
|||
using Magicodes.ExporterAndImporter.Core; |
|||
using Magicodes.ExporterAndImporter.Excel; |
|||
using Microsoft.AspNetCore.Authorization; |
|||
using Microsoft.AspNetCore.Mvc; |
|||
using Microsoft.EntityFrameworkCore; |
|||
using Shouldly; |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.ComponentModel.DataAnnotations; |
|||
using System.Linq; |
|||
using System.Text; |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp; |
|||
using Volo.Abp.Application.Dtos; |
|||
using Volo.Abp.Caching; |
|||
using Volo.Abp.Domain.Repositories; |
|||
using Volo.Abp.Uow; |
|||
using Win.Abp.Snowflakes; |
|||
using Win.Sfs.BaseData.ImportExcelCommon; |
|||
using Win.Sfs.SettleAccount.CommonManagers; |
|||
using Win.Sfs.SettleAccount.Constant; |
|||
using Win.Sfs.SettleAccount.Entities.Wms; |
|||
using Win.Sfs.SettleAccount.Entities.Wms.WmsSumOutput; |
|||
using Win.Sfs.SettleAccount.Reports; |
|||
using Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report; |
|||
using Win.Sfs.Shared.DomainBase; |
|||
using Win.Sfs.Shared.Filter; |
|||
|
|||
namespace Win.Sfs.SettleAccount.Entities.WMS |
|||
{ |
|||
/// <summary>
|
|||
/// 撤销出库清单
|
|||
/// </summary>
|
|||
[Authorize(SettleAccountPermissions.WMSJIT.Default)] |
|||
[Route("api/settleaccount/WMSOutputDetailCancelDiffReport")] |
|||
public class WMSOutputDetailCancelDiffReportAppService : |
|||
SettleAccountApplicationBase<WmsDetailCancelReport> |
|||
{ |
|||
private readonly ISettleAccountBranchEfCoreRepository<WmsDetailCancelReport, Guid> _wmsRepository; |
|||
private readonly WmsOutputSumDapperRepository _dapper; |
|||
private readonly IExcelImportAppService _excelImportService; |
|||
|
|||
private readonly ErpSumOutputDapperRepository _erpDapper; |
|||
/// <summary>
|
|||
///
|
|||
/// </summary>
|
|||
/// <param name="wmsRepository"></param>
|
|||
/// <param name="job"></param>
|
|||
|
|||
public WMSOutputDetailCancelDiffReportAppService( |
|||
WmsOutputSumDapperRepository dapper, |
|||
ISettleAccountBranchEfCoreRepository<WmsDetailCancelReport, Guid> wmsRepository, |
|||
ISettleAccountBranchEfCoreRepository<TaskJob, Guid> job, |
|||
IExcelImportAppService excelImportService, |
|||
IDistributedCache<WmsDetailCancelReport> cache, |
|||
ISnowflakeIdGenerator snowflakeIdGenerator, |
|||
ICommonManager commonManager, |
|||
ErpSumOutputDapperRepository erpDapper |
|||
) : base(cache, excelImportService, snowflakeIdGenerator, commonManager) |
|||
{ |
|||
_erpDapper = erpDapper; |
|||
_wmsRepository = wmsRepository; |
|||
_dapper = dapper; |
|||
_excelImportService = excelImportService; |
|||
|
|||
} |
|||
|
|||
[HttpGet] |
|||
[Route("Make")] |
|||
[UnitOfWork(false)] |
|||
public async Task<string> ReportMake(string version, DateTime accountDate) |
|||
{ |
|||
var _ls = _dapper.GetWmsSumCancelReportList(version, "0");//报表
|
|||
|
|||
var _count = _wmsRepository.Count(p => p.Version == version && p.State > 0); |
|||
if (_count > 0) |
|||
{ |
|||
throw new BusinessException("8899", "不能重新生成此版本!"); |
|||
} |
|||
else |
|||
{ |
|||
var query = _wmsRepository.Where(p => p.Version == version); |
|||
await query.BatchDeleteAsync(); |
|||
} |
|||
List<WmsDetailCancelReport> _lst = new List<WmsDetailCancelReport>(); |
|||
if (_ls != null && _ls.Count() > 0) |
|||
{ |
|||
foreach (var itm in _ls) |
|||
{ |
|||
_lst.Add(new WmsDetailCancelReport( |
|||
Guid.NewGuid(), |
|||
itm.客户, |
|||
itm.出库类型, |
|||
version, |
|||
itm.结算单, |
|||
itm.通用代码号, |
|||
itm.物料号, |
|||
itm.结算数量, |
|||
itm.实际出库数量, |
|||
itm.差异数量, |
|||
itm.物料组编码, |
|||
itm.物料组车型, |
|||
itm.物料描述, |
|||
itm.备注, |
|||
0)); |
|||
} |
|||
} |
|||
await _wmsRepository.GetDbContext().BulkInsertAsync(_lst); |
|||
return ApplicationConsts.SuccessStr; |
|||
} |
|||
/// <summary>
|
|||
/// Wms汇总合计明细
|
|||
/// </summary>
|
|||
/// <param name="input"></param>
|
|||
/// <returns></returns>
|
|||
[HttpPost] |
|||
[Route("WmsDetailReport")] |
|||
|
|||
virtual public async Task<PagedResultDto<WmsDetailCancelReport>> GetListAsync(WmsRequestDetailReportDto input) |
|||
{ |
|||
input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "Version", Logic = EnumFilterLogic.And, Value = input.Version }); |
|||
//客户过滤
|
|||
if (!string.IsNullOrEmpty(input.Client)) |
|||
{ |
|||
input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "Client", Logic = EnumFilterLogic.And, Value = input.Client }); |
|||
} |
|||
//出库类型
|
|||
if (!string.IsNullOrEmpty(input.Type)) |
|||
{ |
|||
input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "Type", Logic = EnumFilterLogic.And, Value = input.Type }); |
|||
} |
|||
var entities = await _wmsRepository.GetListByFilterAsync(GuidGenerator.Create(), input.Filters, input.Sorting, input.MaxResultCount, |
|||
input.SkipCount, true); |
|||
var totalCount = await GetCountAsync(input); |
|||
return new PagedResultDto<WmsDetailCancelReport>(totalCount, entities); |
|||
} |
|||
|
|||
|
|||
private async Task<long> GetCountAsync(WmsRequestDetailReportDto input) |
|||
{ |
|||
input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "Version", Logic = EnumFilterLogic.And, Value = input.Version }); |
|||
return await _wmsRepository.GetCountByFilterAsync(GuidGenerator.Create(), input.Filters); |
|||
} |
|||
[HttpPost] |
|||
[Route("ModifyTaskState")] |
|||
|
|||
public virtual async Task<bool> ModifyTaskState(List<Guid> guids) |
|||
{ |
|||
if (guids != null && guids.Count() > 0) |
|||
{ |
|||
var str = "DECLARE @return_value int \n" + |
|||
"EXEC @return_value = [dbo].[p_wms_interface_cancel]\n" + |
|||
"@billnum = N'{0}', \n" + |
|||
"@type = {1}, \n" + |
|||
"@date = N'{2}', \n" + |
|||
"@switchcode = N'{3}', \n" + |
|||
"@partcode = N'{4}' \n" + |
|||
"SELECT 'Return Value' = @return_value "; |
|||
|
|||
var _ls = _wmsRepository.Where(p => guids.Contains(p.Id)); |
|||
foreach (var itm in _ls) |
|||
{ |
|||
var sql = string.Format(str, itm.BillNum, itm.Type, DateTime.Now, itm.SwitchCode, itm.MaterialCode); |
|||
_wmsRepository.GetDbContext().Database.SetCommandTimeout(300); |
|||
await _wmsRepository.GetDbContext().Database.ExecuteSqlRawAsync( |
|||
sql |
|||
); |
|||
} |
|||
} |
|||
//_wmsRepository.Where(p => p.BillNum ==)
|
|||
return true; |
|||
} |
|||
//[HttpPost]
|
|||
//[Route("Output")]
|
|||
|
|||
//virtual public async Task<bool> OutputAsync(WmsRequestDetailReportDto input)
|
|||
//{
|
|||
// var entities = await _wmsRepository.GetListByFilterAsync(GuidGenerator.Create(), input.Filters, input.Sorting, int.MaxValue,
|
|||
// 0, true);
|
|||
// List<WmsDetailCancelReport> _ls = new List<WmsDetailCancelReport>();
|
|||
// if (entities.Count() > 0)
|
|||
// {
|
|||
// var _entity = entities.FirstOrDefault();
|
|||
// if (_entity != null)
|
|||
// {
|
|||
// var _version = _entity.Version;
|
|||
// var _accountDate = _entity.AccountDate;
|
|||
// _erpDapper.InsertWmsSum(_ls, _version, _accountDate);
|
|||
// }
|
|||
// }
|
|||
// return true;
|
|||
//}
|
|||
[HttpPost] |
|||
[Route("Export")] |
|||
virtual public async Task<string> ExportAsync(WmsRequestDetailReportDto input) |
|||
{ |
|||
input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "Version", Logic = EnumFilterLogic.And, Value = input.Version }); |
|||
//客户过滤
|
|||
if (!string.IsNullOrEmpty(input.Client)) |
|||
{ |
|||
input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "Client", Logic = EnumFilterLogic.And, Value = input.Client }); |
|||
} |
|||
//出库类型
|
|||
if (!string.IsNullOrEmpty(input.Type)) |
|||
{ |
|||
input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "Type", Logic = EnumFilterLogic.And, Value = input.Type }); |
|||
} |
|||
var entities = await _wmsRepository.GetListByFilterAsync(GuidGenerator.Create(), input.Filters, input.Sorting, int.MaxValue, |
|||
0, true); |
|||
var dtoDetails = ObjectMapper.Map<List<WmsDetailCancelReport>, List<WmsDetailCancelReportDto>>(entities); |
|||
IExporter _excel = new ExcelExporter(); |
|||
byte[] result = null; |
|||
var _fileName = string.Format("撤销清单报表_{0}.xlsx", Guid.NewGuid().ToString()); |
|||
result = await _excel.ExportAsByteArray(dtoDetails); |
|||
result.ShouldNotBeNull(); |
|||
//保存导出文件到服务器存成二进制
|
|||
await _excelImportService.SaveBlobAsync( |
|||
new SaveExcelImportInputDto |
|||
{ |
|||
Name = _fileName, |
|||
Content = result |
|||
} |
|||
); |
|||
return _fileName; |
|||
} |
|||
|
|||
|
|||
} |
|||
} |
@ -0,0 +1,72 @@ |
|||
using Magicodes.ExporterAndImporter.Core; |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Text; |
|||
using System.Threading.Tasks; |
|||
using Win.Sfs.Shared.DomainBase; |
|||
|
|||
namespace Win.Sfs.SettleAccount.Entities.ERPShipping |
|||
{ |
|||
public class ERPShippingDetail : FullAuditedAggregateRootBase<Guid>, ISettleAccountEntityBase |
|||
{ |
|||
public ERPShippingDetail(Guid id,string person, decimal cost, string billNum, string unit, decimal qty, string output, string outputCode, string input, string inputCode, decimal outputAssQty, string model, decimal outputQty, string batchNum, DateTime billDate, string flag, string erpMaterialCode, string version):base(id) |
|||
{ |
|||
Person = person; |
|||
Cost = cost; |
|||
BillNum = billNum; |
|||
Unit = unit; |
|||
Qty = qty; |
|||
Output = output; |
|||
OutputCode = outputCode; |
|||
Input = input; |
|||
InputCode = inputCode; |
|||
OutputAssQty = outputAssQty; |
|||
Model = model; |
|||
OutputQty = outputQty; |
|||
BatchNum = batchNum; |
|||
BillDate = billDate; |
|||
Flag = flag; |
|||
ErpMaterialCode = erpMaterialCode; |
|||
Version = version; |
|||
} |
|||
|
|||
[ImporterHeader(Name = "保管")] |
|||
public string Person { set; get; } |
|||
[ImporterHeader(Name = "成本")] |
|||
public decimal Cost { set; get; } |
|||
[ImporterHeader(Name = "单据编号")] |
|||
public string BillNum { set; get; } |
|||
|
|||
[ImporterHeader(Name = "单位")] |
|||
public string Unit { set; get; } |
|||
|
|||
[ImporterHeader(Name = "调拨数量")] |
|||
public decimal Qty { set; get; } |
|||
[ImporterHeader(Name = "调出仓库")] |
|||
public string Output { set; get; } |
|||
[ImporterHeader(Name = "调出仓库代码")] |
|||
public string OutputCode { set; get; } |
|||
[ImporterHeader(Name = "调入仓库")] |
|||
|
|||
public string Input { set; get; } |
|||
[ImporterHeader(Name = "调入仓库代码")] |
|||
public string InputCode { set; get; } |
|||
[ImporterHeader(Name = "辅助出库关联数量")] |
|||
public decimal OutputAssQty { set; get; } |
|||
[ImporterHeader(Name = "规格型号")] |
|||
public string Model { set; get; } |
|||
[ImporterHeader(Name = "基本出库关联数量")] |
|||
public decimal OutputQty { set; get; } |
|||
[ImporterHeader(Name = "批号")] |
|||
public string BatchNum { set; get; } |
|||
[ImporterHeader(Name = "日期")] |
|||
public DateTime BillDate { set; get; } |
|||
[ImporterHeader(Name = "审核标志")] |
|||
public string Flag { get; set; } |
|||
[ImporterHeader(Name = "物料长代码")] |
|||
public string ErpMaterialCode { set; get; } |
|||
[ImporterHeader(Name = "期间")] |
|||
public string Version { get; set; } |
|||
} |
|||
} |
@ -0,0 +1,59 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Text; |
|||
using System.Threading.Tasks; |
|||
using Win.Sfs.Shared.DomainBase; |
|||
|
|||
namespace Win.Sfs.SettleAccount.Entities.ERPShipping |
|||
{ |
|||
|
|||
public class ERPShippingVersion : FullAuditedAggregateRootBase<Guid> |
|||
{ |
|||
|
|||
public ERPShippingVersion() |
|||
{ } |
|||
|
|||
public string Year { get; private set; } |
|||
/// <summary>
|
|||
/// 期间
|
|||
/// </summary>
|
|||
public string Period { get; private set; } |
|||
/// <summary>
|
|||
/// 版本号
|
|||
/// </summary>
|
|||
public string Version { get; private set; } |
|||
|
|||
|
|||
/// <summary>
|
|||
/// 工厂
|
|||
/// </summary>
|
|||
public string Factory { set; get; } |
|||
|
|||
/// <summary>
|
|||
/// 客户号
|
|||
/// </summary>
|
|||
public string CustomerCode { private set; get; } |
|||
|
|||
|
|||
public ERPShippingVersion( |
|||
Guid id, |
|||
Guid branchId, |
|||
string year, string period, string version, string customerCode, string factory) : base(id) |
|||
{ |
|||
BranchId = branchId; |
|||
Year = year; |
|||
Period = period; |
|||
Version = version; |
|||
CustomerCode = customerCode; |
|||
Factory = factory; |
|||
|
|||
} |
|||
|
|||
|
|||
} |
|||
|
|||
|
|||
|
|||
|
|||
} |
@ -0,0 +1,52 @@ |
|||
using Magicodes.ExporterAndImporter.Core; |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Text; |
|||
using System.Threading.Tasks; |
|||
using Win.Sfs.Shared.DomainBase; |
|||
|
|||
namespace Win.Sfs.SettleAccount.Entities.HQExtend |
|||
{ |
|||
public class HQKBExtend: FullAuditedAggregateRootBase<Guid>, ISettleAccountEntityBase |
|||
{ |
|||
public HQKBExtend(string taskBillNum, string billNum, string materialDesc, string materialCode, decimal qty, decimal price, decimal amt, decimal tax, decimal taxAmt, decimal totalAmt) |
|||
{ |
|||
TaskBillNum = taskBillNum; |
|||
BillNum = billNum; |
|||
MaterialDesc = materialDesc; |
|||
MaterialCode = materialCode; |
|||
Qty = qty; |
|||
Price = price; |
|||
Amt = amt; |
|||
Tax = tax; |
|||
TaxAmt = taxAmt; |
|||
TotalAmt = totalAmt; |
|||
} |
|||
|
|||
[ImporterHeader(Name = "试制任务单编号")] |
|||
|
|||
public string TaskBillNum { get; set; } |
|||
[ImporterHeader(Name = "采购申请单号")] |
|||
public string BillNum { get; set; } |
|||
[ImporterHeader(Name = "零件名称")] |
|||
public string MaterialDesc { get; set; } |
|||
[ImporterHeader(Name = "零件号")] |
|||
public string MaterialCode { get; set; } |
|||
[ImporterHeader(Name = "数量")] |
|||
public decimal Qty { get; set; } |
|||
[ImporterHeader(Name = "无税单价")] |
|||
public decimal Price { get; set; } |
|||
|
|||
[ImporterHeader(Name = "无税金额")] |
|||
public decimal Amt { get; set; } |
|||
[ImporterHeader(Name = "税率")] |
|||
public decimal Tax { get; set; } |
|||
[ImporterHeader(Name = "税额合计")] |
|||
public decimal TaxAmt { get; set; } |
|||
[ImporterHeader(Name = "价税合计")] |
|||
public decimal TotalAmt { get; set; } |
|||
[ImporterHeader(Name = "版本号",IsIgnore =false)] |
|||
public string Version { get ; set ; } |
|||
} |
|||
} |
@ -0,0 +1,55 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Text; |
|||
using System.Threading.Tasks; |
|||
using Win.Sfs.Shared.DomainBase; |
|||
|
|||
namespace Win.Sfs.SettleAccount.Entities.HQExtend |
|||
{ |
|||
public class HQKBExtendVersion : FullAuditedAggregateRootBase<Guid>, ISettleAccountEntityBase |
|||
{ |
|||
|
|||
|
|||
|
|||
|
|||
public HQKBExtendVersion() |
|||
{ } |
|||
|
|||
public string Year { get; set; } |
|||
/// <summary>
|
|||
/// 期间
|
|||
/// </summary>
|
|||
public string Period { get; set; } |
|||
/// <summary>
|
|||
/// 版本号
|
|||
/// </summary>
|
|||
public string Version { get; set; } |
|||
|
|||
|
|||
/// <summary>
|
|||
/// 工厂
|
|||
/// </summary>
|
|||
public string Factory { set; get; } |
|||
|
|||
/// <summary>
|
|||
/// 客户号
|
|||
/// </summary>
|
|||
public string CustomerCode { private set; get; } |
|||
|
|||
|
|||
public HQKBExtendVersion( |
|||
Guid id, |
|||
Guid branchId, |
|||
string year, string period, string version, string customerCode, string factory) : base(id) |
|||
{ |
|||
BranchId = branchId; |
|||
Year = year; |
|||
Period = period; |
|||
Version = version; |
|||
CustomerCode = customerCode; |
|||
Factory = factory; |
|||
|
|||
} |
|||
} |
|||
} |
@ -0,0 +1,52 @@ |
|||
using Magicodes.ExporterAndImporter.Core; |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Text; |
|||
using System.Threading.Tasks; |
|||
using Win.Sfs.Shared.DomainBase; |
|||
|
|||
namespace Win.Sfs.SettleAccount.Entities.HQExtend |
|||
{ |
|||
public class HQKBSettleExtend : FullAuditedAggregateRootBase<Guid>, ISettleAccountEntityBase |
|||
{ |
|||
public HQKBSettleExtend(string taskBillNum, string billNum, string materialDesc, string materialCode, decimal qty, decimal price, decimal amt, decimal tax, decimal taxAmt, decimal totalAmt) |
|||
{ |
|||
TaskBillNum = taskBillNum; |
|||
BillNum = billNum; |
|||
MaterialDesc = materialDesc; |
|||
MaterialCode = materialCode; |
|||
Qty = qty; |
|||
Price = price; |
|||
Amt = amt; |
|||
Tax = tax; |
|||
TaxAmt = taxAmt; |
|||
TotalAmt = totalAmt; |
|||
} |
|||
|
|||
[ImporterHeader(Name = "试制任务单编号")] |
|||
|
|||
public string TaskBillNum { get; set; } |
|||
[ImporterHeader(Name = "采购申请单号")] |
|||
public string BillNum { get; set; } |
|||
[ImporterHeader(Name = "零件名称")] |
|||
public string MaterialDesc { get; set; } |
|||
[ImporterHeader(Name = "零件号")] |
|||
public string MaterialCode { get; set; } |
|||
[ImporterHeader(Name = "数量")] |
|||
public decimal Qty { get; set; } |
|||
[ImporterHeader(Name = "无税单价")] |
|||
public decimal Price { get; set; } |
|||
|
|||
[ImporterHeader(Name = "无税金额")] |
|||
public decimal Amt { get; set; } |
|||
[ImporterHeader(Name = "税率")] |
|||
public decimal Tax { get; set; } |
|||
[ImporterHeader(Name = "税额合计")] |
|||
public decimal TaxAmt { get; set; } |
|||
[ImporterHeader(Name = "价税合计")] |
|||
public decimal TotalAmt { get; set; } |
|||
[ImporterHeader(Name = "版本号", IsIgnore = false)] |
|||
public string Version { get; set; } |
|||
} |
|||
} |
@ -0,0 +1,55 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Text; |
|||
using System.Threading.Tasks; |
|||
using Win.Sfs.Shared.DomainBase; |
|||
|
|||
namespace Win.Sfs.SettleAccount.Entities.HQExtend |
|||
{ |
|||
public class HQKBSettleExtendVersion : FullAuditedAggregateRootBase<Guid>, ISettleAccountEntityBase |
|||
{ |
|||
|
|||
|
|||
|
|||
|
|||
public HQKBSettleExtendVersion() |
|||
{ } |
|||
|
|||
public string Year { get; set; } |
|||
/// <summary>
|
|||
/// 期间
|
|||
/// </summary>
|
|||
public string Period { get; set; } |
|||
/// <summary>
|
|||
/// 版本号
|
|||
/// </summary>
|
|||
public string Version { get; set; } |
|||
|
|||
|
|||
/// <summary>
|
|||
/// 工厂
|
|||
/// </summary>
|
|||
public string Factory { set; get; } |
|||
|
|||
/// <summary>
|
|||
/// 客户号
|
|||
/// </summary>
|
|||
public string CustomerCode { private set; get; } |
|||
|
|||
|
|||
public HQKBSettleExtendVersion( |
|||
Guid id, |
|||
Guid branchId, |
|||
string year, string period, string version, string customerCode, string factory) : base(id) |
|||
{ |
|||
BranchId = branchId; |
|||
Year = year; |
|||
Period = period; |
|||
Version = version; |
|||
CustomerCode = customerCode; |
|||
Factory = factory; |
|||
|
|||
} |
|||
} |
|||
} |
File diff suppressed because it is too large
File diff suppressed because it is too large
File diff suppressed because it is too large
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue