yunfeng.liu 2 years ago
parent
commit
2b1136391e
  1. 523
      src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Logs/log-20220424.txt
  2. 4238
      src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Logs/log-20220428.txt
  3. 10
      src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/appsettings.Development.json
  4. 6
      src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/appsettings.json
  5. 2
      src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BT_Car/BT_Car_PlatformDto.cs
  6. 4
      src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BT_Car/BT_Car_PlatformExportDto.cs
  7. 4
      src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BT_Car/BT_Car_PlatformImportDto.cs
  8. 187
      src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/ERPShpping/ERPShppingDto.cs
  9. 273
      src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/HQExtend/HQKBExtendDto.cs
  10. 2
      src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/HQ_H/HQ_H_PlatformDto.cs
  11. 14
      src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Prices/PriceListDtoBase.cs
  12. 315
      src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/TaskListDto.cs
  13. 4
      src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/UnHQSettleAccounts/UnHQSettleDto.cs
  14. 2
      src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/UnHQSettleAccounts/UnHQSettleExportDto.cs
  15. 82
      src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Wms/WmsDetailReportDto.cs
  16. 3
      src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Wms/WmsJitOutPutDetialDto.cs
  17. 12
      src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/ReportRequestDto/ReportRequestDto.cs
  18. 4
      src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/SettleAccount.Application.Contracts.csproj
  19. 334
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BTCarConsigns_HS/BTCarConsignAppService.cs
  20. 369
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BTCarKBFirsts_HS/BTCarKBFirstAppService.cs
  21. 398
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/ErpShipping/ErpShippingAppService.cs
  22. 347
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/HQExtend/HQKBExtendAppService.cs
  23. 346
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/HQExtend/HQKBSettleExtendAppService.cs
  24. 2
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/HQ_F/HQ_F_PlatformAppService.cs
  25. 361
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/JFCarConsignAppService.cs
  26. 361
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/JFCarConsign_HS/JFCarConsignAppService.cs
  27. 328
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/JFCarKBAppService.cs
  28. 328
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/JFCarKBs_HS/JFCarKBAppService.cs
  29. 44
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppService.cs
  30. 150
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/SettleAccounts/SettleAccountAppService.cs
  31. 3
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/TaskJobs/JobAppService.cs
  32. 5
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/UnHQSettleAccounts/UnHQSettleAppService.cs
  33. 1
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/VWKanBan/VWKanBanAppService.cs
  34. 28
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/VWSparePart/SparePartAppService.cs
  35. 652
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSCusomerKanbanAppService.cs
  36. 7
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSHQFKanbanAppService.cs
  37. 10
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSHQFSharePartAppService .cs
  38. 59
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSHQHKanbanAppService.cs
  39. 43
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSHQHSharePartAppService.cs
  40. 15
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSJitAppService.cs
  41. 220
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSKanbanAppService.cs
  42. 235
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSKanbanExtendAppService.cs
  43. 59
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSSharePart90AppService.cs
  44. 141
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSSharePartAppService.cs
  45. 231
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsDetailCancelInterface.cs
  46. 49
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsDetailUnInterface.cs
  47. 69
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsHQCarAppService.cs
  48. 98
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsHQKBOutputAppService.cs
  49. 11
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsHQMKanbanAppService.cs
  50. 13
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsHQMSharePartAppService.cs
  51. 34
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsOneTimeSaleOutputAppService.cs
  52. 268
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsUnInterface.cs
  53. 96
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsUnSumInterface.cs
  54. 339
      src/Modules/SettleAccount/src/SettleAccount.Application/Reports/ReportServices/ReportMakeService.cs
  55. 7
      src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccount.Application.csproj
  56. 7
      src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs
  57. 4
      src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BT_Car/BT_Car_Platform.cs
  58. 72
      src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/ERPShipping/ERPShippingDetail.cs
  59. 59
      src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/ERPShipping/ERPShippingVersion.cs
  60. 52
      src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/HQExtend/HQKBExtend.cs
  61. 55
      src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/HQExtend/HQKBExtendVersion.cs
  62. 52
      src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/HQExtend/HQKBSettleExtend.cs
  63. 55
      src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/HQExtend/HQKBSettleExtendVersion.cs
  64. 2
      src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/HQ_F/HQ_F_Platform.cs
  65. 2
      src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/HQ_H/HQ_H_Platform.cs
  66. 7
      src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Materials/Material.cs
  67. 6
      src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/SettledPartAndErpPartPriceDiffs/SettledPartAndErpPartPriceDiff.cs
  68. 2
      src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/UnHQSettleAccounts/UnHQSettleAccount.cs
  69. 67
      src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/UnSettle/UnSettleDetailReport.cs
  70. 11
      src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/VWSparePart/SparePart.cs
  71. 322
      src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/WMS/TaskList.cs
  72. 116
      src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/WmsDetailReport.cs
  73. 2
      src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/InvoiceSettledDiffs/InvoiceSettledDiff.cs
  74. 2
      src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/ReportDetailBase.cs
  75. 5
      src/Modules/SettleAccount/src/SettleAccount.Domain/Settings/Helper.cs
  76. 87
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs
  77. 335
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20220413040718_5677.Designer.cs
  78. 131
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20220413040718_5677.cs
  79. 331
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/SettleAccountDbContextModelSnapshot.cs
  80. 35
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/ErpPartDapperRepository.cs
  81. 50
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/ErpSumOutputDapperRepository.cs
  82. 15
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQCarSettledDetailDapperRepository.cs
  83. 1094
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQFactorySettledDetailDapperRepository.cs
  84. 2274
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQHSettledDetailDapperRepository.cs
  85. 7
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/InvoiceSettledDetailDiffDapperRepository.cs
  86. 560
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/KanbanUnSettledDapperRepository.cs
  87. 235
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettleKBWithCodeDapperReportRepository.cs
  88. 129
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettleSparePart90DapperReportRepository.cs
  89. 1546
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettleSparePartDapperReportRepository.cs
  90. 4
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettledPartAndErpPartPriceDiffRepository.cs
  91. 267
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/UnSettleDiffDapperRepository.cs
  92. 269
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/UnSettledDetailDapperRepository.cs
  93. 87
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/WmsDapperRepository.cs
  94. 875
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/WmsOutputSumDapperRepository.cs
  95. 104
      src/Modules/SettleAccount/src/SettleAccount.HttpApi/BlobFileController.cs
  96. 18
      src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQCarSettledDetailDiffExportService.cs
  97. 5
      src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQFactoryUnSettledDetailDiffExportService.cs
  98. 66
      src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQHSettledDetailDiffExportService.cs
  99. 44
      src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQHSharePartSettledDetailDiffExportService.cs
  100. 65
      src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQHUnSettledDetailDiffExportService.cs

523
src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Logs/log-20220424.txt

@ -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"

4238
src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Logs/log-20220428.txt

File diff suppressed because it is too large

10
src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/appsettings.Development.json

@ -7,11 +7,11 @@
// "SettleAccountService": "Server=LAPTOP-V3U07C2O;Database=SettleAccountService;user id=sa;Password=1q2w!@#;"
//},
"ConnectionStrings": {
//"Default": "Server=127.0.0.1;Database=ABP;user id=sa;Password=1",
//"SettleAccountService": "Server=127.0.0.1;Database=SettleAccountService;user id=sa;Password=1;"
"Default": "Server=192.168.0.140;Database=ABP;User ID=sa;Password=Microsoft2008;",
"SettleAccountService": "Server=192.168.0.140;Database=SettleAccountService;user id=sa;password=Microsoft2008;",
"Wms": "Server=192.168.0.63;Database=CPAT_WMS;user id=sa;password=Microsoft2008;"
"Default": "Server=127.0.0.1;Database=ABP;user id=sa;Password=1",
"SettleAccountService": "Server=127.0.0.1;Database=SettleAccountService;user id=sa;Password=1;"
//"Default": "Server=192.168.0.140;Database=ABP;User ID=sa;Password=Microsoft2008;",
//"SettleAccountService": "Server=192.168.0.140;Database=SettleAccountService;user id=sa;password=Microsoft2008;",
//"Wms": "Server=192.168.0.63;Database=CPAT_WMS;user id=sa;password=Microsoft2008;"
},
"Logging": {

6
src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/appsettings.json

@ -9,9 +9,9 @@
"ConnectionStrings": {
//"Default": "Server=127.0.0.1;Database=ABP;user id=sa;Password=1",
//"SettleAccountService": "Server=127.0.0.1;Database=SettleAccountService;user id=sa;Password=1;"
"Default": "Server=192.168.0.140;Database=ABP;User ID=sa;Password=Microsoft2008;",
"SettleAccountService": "Server=192.168.0.140;Database=SettleAccountService;user id=sa;password=Microsoft2008;",
"Wms": "Server=192.168.0.63;Database=CPAT_WMS;user id=sa;password=Microsoft2008;"
"Default": "Server=127.0.0.1;Database=ABP;User ID=sa;Password=1;",
"SettleAccountService": "Server=127.0.0.1;Database=SettleAccountService;user id=sa;password=1;",
"Wms": "Server=127.0.0.1;Database=CPAT_WMS;user id=sa;password=1;"
},
"Logging": {

2
src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BT_Car/BT_Car_PlatformDto.cs

@ -14,7 +14,7 @@ namespace Win.Sfs.SettleAccount.Entities.BT_Car
/// </summary>
public string Factory { get; set; }
/// <summary>
///外部看板编
///外部
/// </summary>
public string ExternalKanbanNumber { get; set; }
/// <summary>

4
src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BT_Car/BT_Car_PlatformExportDto.cs

@ -15,9 +15,9 @@ namespace Win.Sfs.SettleAccount.Entities.BT_Car
[ExporterHeader(DisplayName = "工厂")]
public string Factory { get; set; }
/// <summary>
///外部看板编
///外部
/// </summary>
[ExporterHeader(DisplayName = "外部看板编号")]
[ExporterHeader(DisplayName = "外部号")]
public string ExternalKanbanNumber { get; set; }
/// <summary>
///看板编号

4
src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BT_Car/BT_Car_PlatformImportDto.cs

@ -15,9 +15,9 @@ namespace Win.Sfs.SettleAccount.Entities.BT_Car
[ImporterHeader(Name = "工厂")]
public string Factory { get; set; }
/// <summary>
///外部看板编
///外部
/// </summary>
[ImporterHeader(Name = "外部看板编号")]
[ImporterHeader(Name = "外部号")]
public string ExternalKanbanNumber { get; set; }
/// <summary>
///看板编号

187
src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/ERPShpping/ERPShppingDto.cs

@ -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; }
}
}

273
src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/HQExtend/HQKBExtendDto.cs

@ -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; }
}
}

2
src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/HQ_H/HQ_H_PlatformDto.cs

@ -15,7 +15,7 @@ namespace Win.Sfs.SettleAccount.Entities.HQ_H
/// </summary>
public string Factory { get; set; }
/// <summary>
///外部看板编
///外部
/// </summary>
public string ExternalKanbanNumber { get; set; }
/// <summary>

14
src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Prices/PriceListDtoBase.cs

@ -57,31 +57,31 @@ namespace Win.Sfs.SettleAccount.Entities.Prices
/// 版本
/// </summary>
[Display(Name = "版本")]
[ExporterHeader(DisplayName = "版本")]
[ExporterHeader(DisplayName = "版本",IsIgnore =true)]
public string Version { set; get; }
[ImporterHeader(Name = "有效从")]
[ExporterHeader(DisplayName = "有效从")]
public DateTime BeginDate { get; set; }
/// <summary>
///结算时间
/// </summary>
[ImporterHeader(Name = "有效到")]
[ExporterHeader(DisplayName = "有效到")]
public DateTime EndDate { get; set; }
/// <summary>
///价格
/// </summary>
[ImporterHeader(Name = "*金额")]
[ExporterHeader(DisplayName = "*金额")]
public decimal Price { get; set; }
/// <summary>
///物料编号
/// </summary>
[ImporterHeader(Name = "*物料编码")]
[ExporterHeader(DisplayName = "*物料编码")]
public string MaterialCode { get; set; }
/// <summary>
///价格类型
/// </summary>
[ImporterHeader(Name = "*分销渠道")]
[ExporterHeader(DisplayName = "*分销渠道",IsIgnore =true)]
public int Type { get; set; }
[ImporterHeader(Name = "*客户")]
[ExporterHeader(DisplayName = "*客户")]
public string CustomerCode { get; set; }
}

315
src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/TaskListDto.cs

@ -1,6 +1,7 @@
using Magicodes.ExporterAndImporter.Core;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
@ -22,9 +23,9 @@ namespace Win.Sfs.SettleAccount.Entities
[ExporterHeader(DisplayName = "入库库位")]
//入库库位
public string InPut { set; get; }
[ImporterHeader(Name = "状态")]
[ExporterHeader(DisplayName = "状态")]
public int State { get; set; }
//[ImporterHeader(Name = "状态")]
//[ExporterHeader(DisplayName = "状态")]
//public int State { get; set; }
[ImporterHeader(Name = "开票单价")]
[ExporterHeader(DisplayName = "开票单价")]
@ -79,6 +80,15 @@ namespace Win.Sfs.SettleAccount.Entities
[ImporterHeader(Name = "结算数量")]
public decimal Qty { set; get; }
[ExporterHeader(DisplayName = "状态")]
[ValueMapping("未处理", 0)]
[ValueMapping("申请出库", 1)]
[ValueMapping("确认出库", 2)]
[ValueMapping("不能出库", 3)]
[ValueMapping("取消出库", 4)]
public ExporterStatus State { set; get; }
}
@ -120,9 +130,16 @@ namespace Win.Sfs.SettleAccount.Entities
[ImporterHeader(Name = "入库库位", IsIgnore = true)]
//入库库位
public string InPut { set; get; }
[ExporterHeader(DisplayName = "状态")]
[ImporterHeader(Name = "状态", IsIgnore = true)]
public int State { get; set; }
[ValueMapping("未处理", 0)]
[ValueMapping("申请出库", 1)]
[ValueMapping("确认出库", 2)]
[ValueMapping("不能出库", 3)]
[ValueMapping("取消出库", 4)]
public ExporterStatus State { set; get; }
[ExporterHeader(DisplayName = "客户物料")]
[ImporterHeader(Name = "客户物料")]
/// <summary>
@ -180,12 +197,14 @@ namespace Win.Sfs.SettleAccount.Entities
public string Version { set; get; }
[ImporterHeader(Name = "是否备件")]
[ExporterHeader(DisplayName = "是否备件")]
public string IsBack { set; get; }
[ValueMapping("批量", 0)]
[ValueMapping("备件", 1)]
public ExporterIsBack IsBack { set; get; }
[ImporterHeader(Name = "结算数量")]
[ExporterHeader(DisplayName = "结算数量")]
public decimal Qty { set; get; }
[ImporterHeader(Name = "寄售库存数量", IsIgnore = true)]
[ExporterHeader(DisplayName = "寄售库存数量", IsIgnore = true)]
[ExporterHeader(DisplayName = "寄售库存数量")]
public decimal SockQty { set; get; }
[ImporterHeader(Name = "真实数量", IsIgnore = true)]
@ -193,7 +212,7 @@ namespace Win.Sfs.SettleAccount.Entities
public decimal RealityNumber { set; get; }
[ImporterHeader(Name = "出库数量", IsIgnore = true)]
[ExporterHeader(DisplayName = "出库数量", IsIgnore = true)]
[ExporterHeader(DisplayName = "出库数量")]
public decimal OutputQty { set; get; }
[ImporterHeader(Name = "Extend", IsIgnore = true)]
[ExporterHeader(DisplayName = "Extend", IsIgnore = true)]
@ -201,9 +220,15 @@ namespace Win.Sfs.SettleAccount.Entities
[ImporterHeader(Name = "BillNum", IsIgnore = true)]
[ExporterHeader(DisplayName = "BillNum", IsIgnore = true)]
public string BillNum { set; get; }
[ImporterHeader(Name = "状态", IsIgnore = true)]
[ExporterHeader(DisplayName = "状态", IsIgnore = true)]
public int State { set; get; }
[ExporterHeader(DisplayName = "状态")]
[ValueMapping("未处理", 0)]
[ValueMapping("申请出库", 1)]
[ValueMapping("确认出库", 2)]
[ValueMapping("不能出库", 3)]
[ValueMapping("取消出库", 4)]
public ExporterStatus State { set; get; }
[ImporterHeader(Name = "开票单价")]
[ExporterHeader(DisplayName = "开票单价")]
@ -212,10 +237,9 @@ namespace Win.Sfs.SettleAccount.Entities
[ExporterHeader(DisplayName = "开票金额")]
public decimal Amt { set; get; }
}
/// <summary>
/// 大众备件出库单
/// </summary>
@ -245,8 +269,16 @@ namespace Win.Sfs.SettleAccount.Entities
[ExporterHeader(DisplayName = "入库库位", IsIgnore = true)]
//入库库位
public string InPut { set; get; }
[ExporterHeader(DisplayName = "状态", IsIgnore = true)]
public int State { get; set; }
[ExporterHeader(DisplayName = "状态")]
[ValueMapping("未处理", 0)]
[ValueMapping("申请出库", 1)]
[ValueMapping("确认出库", 2)]
[ValueMapping("不能出库", 3)]
[ValueMapping("取消出库", 4)]
public ExporterStatus State { set; get; }
[ExporterHeader(DisplayName = "物料代码")]
/// <summary>
/// 扩展字段1
@ -272,10 +304,10 @@ namespace Win.Sfs.SettleAccount.Entities
[ExporterHeader(DisplayName = "任务代码", IsIgnore = true)]
public Guid TaskId { set; get; }
[ExporterHeader(DisplayName = "寄销库数量", IsIgnore = true)]
[ExporterHeader(DisplayName = "寄销库数量")]
public decimal StockQty { set; get; }
[ExporterHeader(DisplayName = "出库数量", IsIgnore = true)]
[ExporterHeader(DisplayName = "出库数量")]
public decimal OutPutQty { set; get; }
[ExporterHeader(DisplayName = "开票单价")]
@ -288,7 +320,7 @@ namespace Win.Sfs.SettleAccount.Entities
/// <summary>
/// 大众备件手工出库单
/// 大众备件手工出库单,带条码号
/// </summary>
public class WmsSharePart90OutPutDetialDto
{
@ -331,9 +363,16 @@ namespace Win.Sfs.SettleAccount.Entities
[ExporterHeader(DisplayName = "入库库位", IsIgnore = true)]
//入库库位
public string InPut { set; get; }
[ImporterHeader(Name = "状态", IsIgnore = true)]
[ExporterHeader(DisplayName = "状态", IsIgnore = true)]
public int State { get; set; }
[ExporterHeader(DisplayName = "状态")]
[ValueMapping("未处理", 0)]
[ValueMapping("申请出库", 1)]
[ValueMapping("确认出库", 2)]
[ValueMapping("不能出库", 3)]
[ValueMapping("取消出库", 4)]
public ExporterStatus State { set; get; }
[ImporterHeader(Name = "物料代码")]
[ExporterHeader(DisplayName = "物料代码")]
/// <summary>
@ -395,12 +434,14 @@ namespace Win.Sfs.SettleAccount.Entities
public string Version { set; get; }
[ImporterHeader(Name = "是否备件")]
[ExporterHeader(DisplayName = "是否备件")]
public string IsBack { set; get; }
[ValueMapping("批量", 0)]
[ValueMapping("备件", 1)]
public ExporterIsBack IsBack { set; get; }
[ImporterHeader(Name = "结算数量")]
[ExporterHeader(DisplayName = "结算数量")]
public decimal Qty { set; get; }
[ImporterHeader(Name = "寄售库存数量", IsIgnore = true)]
[ExporterHeader(DisplayName = "寄售库存数量", IsIgnore = true)]
[ExporterHeader(DisplayName = "寄售库存数量")]
public decimal SockQty { set; get; }
[ImporterHeader(Name = "真实数量", IsIgnore = true)]
@ -408,7 +449,7 @@ namespace Win.Sfs.SettleAccount.Entities
public decimal RealityNumber { set; get; }
[ImporterHeader(Name = "出库数量", IsIgnore = true)]
[ExporterHeader(DisplayName = "出库数量", IsIgnore = true)]
[ExporterHeader(DisplayName = "出库数量")]
public decimal OutputQty { set; get; }
[ImporterHeader(Name = "客户")]
[ExporterHeader(DisplayName = "客户")]
@ -416,9 +457,16 @@ namespace Win.Sfs.SettleAccount.Entities
[ImporterHeader(Name = "BillNum", IsIgnore = true)]
[ExporterHeader(DisplayName = "BillNum", IsIgnore = true)]
public string BillNum { set; get; }
[ImporterHeader(Name = "状态", IsIgnore = true)]
[ExporterHeader(DisplayName = "状态", IsIgnore = true)]
public int State { set; get; }
[ExporterHeader(DisplayName = "状态")]
[ValueMapping("未处理", 0)]
[ValueMapping("申请出库", 1)]
[ValueMapping("确认出库", 2)]
[ValueMapping("不能出库", 3)]
[ValueMapping("取消出库", 4)]
public ExporterStatus State { set; get; }
[ImporterHeader(Name = "开票单价")]
[ExporterHeader(DisplayName = "开票单价")]
@ -426,7 +474,6 @@ namespace Win.Sfs.SettleAccount.Entities
[ImporterHeader(Name = "开票金额")]
[ExporterHeader(DisplayName = "开票金额")]
public decimal Amt { set; get; }
}
@ -449,12 +496,14 @@ namespace Win.Sfs.SettleAccount.Entities
public string Version { set; get; }
[ImporterHeader(Name = "是否备件")]
[ExporterHeader(DisplayName = "是否备件")]
public string IsBack { set; get; }
[ValueMapping("批量", 0)]
[ValueMapping("备件", 1)]
public ExporterIsBack IsBack { set; get; }
[ImporterHeader(Name = "结算数量")]
[ExporterHeader(DisplayName = "结算数量")]
public decimal Qty { set; get; }
[ImporterHeader(Name = "寄售库存数量", IsIgnore = true)]
[ExporterHeader(DisplayName = "寄售库存数量", IsIgnore = true)]
[ExporterHeader(DisplayName = "寄售库存数量")]
public decimal SockQty { set; get; }
[ImporterHeader(Name = "真实数量", IsIgnore = true)]
@ -462,7 +511,7 @@ namespace Win.Sfs.SettleAccount.Entities
public decimal RealityNumber { set; get; }
[ImporterHeader(Name = "出库数量", IsIgnore = true)]
[ExporterHeader(DisplayName = "出库数量", IsIgnore = true)]
[ExporterHeader(DisplayName = "出库数量")]
public decimal OutputQty { set; get; }
[ImporterHeader(Name = "客户")]
[ExporterHeader(DisplayName = "客户")]
@ -470,9 +519,16 @@ namespace Win.Sfs.SettleAccount.Entities
[ImporterHeader(Name = "BillNum", IsIgnore = true)]
[ExporterHeader(DisplayName = "BillNum", IsIgnore = true)]
public string BillNum { set; get; }
[ImporterHeader(Name = "状态", IsIgnore = true)]
[ExporterHeader(DisplayName = "状态", IsIgnore = true)]
public int State { set; get; }
[ExporterHeader(DisplayName = "状态")]
[ValueMapping("未处理", 0)]
[ValueMapping("申请出库", 1)]
[ValueMapping("确认出库", 2)]
[ValueMapping("不能出库", 3)]
[ValueMapping("取消出库", 4)]
public ExporterStatus State { set; get; }
[ImporterHeader(Name = "开票单价")]
[ExporterHeader(DisplayName = "开票单价")]
@ -490,15 +546,17 @@ namespace Win.Sfs.SettleAccount.Entities
{
[ImporterHeader(Name = "是否备件", IsIgnore = true)]
[ExporterHeader(DisplayName = "是否备件", IsIgnore = true)]
public string IsSparePart { set; get; }
[ValueMapping("批量", 0)]
[ValueMapping("备件", 1)]
public ExporterIsBack IsSparePart { set; get; }
//交货单号
[ImporterHeader(Name = "寄销库数量", IsIgnore = true)]
[ExporterHeader(DisplayName = "寄销库数量", IsIgnore = true)]
[ExporterHeader(DisplayName = "寄销库数量")]
public decimal StockQty { set; get; }
[ImporterHeader(Name = "出库数量", IsIgnore = true)]
[ExporterHeader(DisplayName = "出库数量", IsIgnore = true)]
[ExporterHeader(DisplayName = "出库数量")]
public decimal OutPutQty { set; get; }
[ImporterHeader(Name = "组件组物料", IsIgnore = true)]
@ -531,9 +589,16 @@ namespace Win.Sfs.SettleAccount.Entities
[ExporterHeader(DisplayName = "入库库位", IsIgnore = true)]
//入库库位
public string InPut { set; get; }
[ImporterHeader(Name = "状态", IsIgnore = true)]
[ExporterHeader(DisplayName = "状态", IsIgnore = true)]
public int State { get; set; }
[ExporterHeader(DisplayName = "状态")]
[ValueMapping("未处理", 0)]
[ValueMapping("申请出库", 1)]
[ValueMapping("确认出库", 2)]
[ValueMapping("不能出库", 3)]
[ValueMapping("取消出库", 4)]
public ExporterStatus State { set; get; }
[ImporterHeader(Name = "结算物料号")]
[ExporterHeader(DisplayName = "结算物料号")]
/// <summary>
@ -574,7 +639,177 @@ namespace Win.Sfs.SettleAccount.Entities
public Guid TaskId { set; get; }
}
/// <summary>
/// 红旗一轿导入模板DTO
/// </summary>
public class WmsHQWithOutKanbanOutPutDetiaTemplatelDto
{
[ImporterHeader(Name = "版本号")]
[ExporterHeader(DisplayName = "版本号")]
public string Version { set; get; }
[ImporterHeader(Name = "物料号")]
[ExporterHeader(DisplayName = "物料号")]
public string SapMaterialCode { set; get; }
[ImporterHeader(Name = "物料描述")]
[ExporterHeader(DisplayName = "物料描述")]
public string MaterialDesc { set; get; }
[ImporterHeader(Name = "结算数量")]
[ExporterHeader(DisplayName = "结算数量")]
public decimal Qty { set; get; }
[ImporterHeader(Name = "开票单价")]
[ExporterHeader(DisplayName = "开票单价")]
public decimal Price { set; get; }
[ImporterHeader(Name = "开票金额")]
[ExporterHeader(DisplayName = "开票金额")]
public decimal Amt { set; get; }
[ImporterHeader(Name = "是否备件")]
[ExporterHeader(DisplayName = "是否备件")]
public string IsBack { set; get; }
[ImporterHeader(Name = "客户")]
[ExporterHeader(DisplayName = "客户")]
public string Extend { set; get; }
}
/// <summary>
/// 一次性销售导入模板DTO
/// </summary>
public class WmsOneTimeSaleOutPutDetialTempalteDTO
{
[ImporterHeader(Name = "版本号")]
[ExporterHeader(DisplayName = "版本号")]
public string Version { set; get; }
[ImporterHeader(Name = "客户")]
[ExporterHeader(DisplayName = "客户")]
public string Extend { set; get; }
[ImporterHeader(Name = "物料号")]
[ExporterHeader(DisplayName = "物料号")]
public string SapMaterialCode { set; get; }
[ImporterHeader(Name = "物料描述")]
[ExporterHeader(DisplayName = "物料描述")]
public string MaterialDesc { set; get; }
[ImporterHeader(Name = "是否备件", IsIgnore = true)]
[ExporterHeader(DisplayName = "是否备件", IsIgnore = true)]
public string IsBack { set; get; }
[ImporterHeader(Name = "结算数量")]
[ExporterHeader(DisplayName = "结算数量")]
public decimal Qty { set; get; }
[ImporterHeader(Name = "开票单价")]
[ExporterHeader(DisplayName = "开票单价")]
public decimal Price { set; get; }
[ImporterHeader(Name = "开票金额")]
[ExporterHeader(DisplayName = "开票金额")]
public decimal Amt { set; get; }
}
/// <summary>
/// 大众备件无单号出库单导入模板DTO
/// </summary>
public class WmsSharePartOutPutDetialTemplateDTO
{
[ImporterHeader(Name = "SAP编码")]
[ExporterHeader(DisplayName = "SAP编码")]
//物料号
public string MaterialCode { set; get; }
[ImporterHeader(Name = "物料描述")]
[ExporterHeader(DisplayName = "物料描述")]
//物料描述
public string MaterialDesc { set; get; }
[ImporterHeader(Name = "物料组(车型)")]
[ExporterHeader(DisplayName = "物料组(车型)")]
//物料组(车型)
public string MaterialGroup { set; get; }
[ImporterHeader(Name = "开票数量")]
[ExporterHeader(DisplayName = "开票数量")]
public decimal Qty { set; get; }
[ImporterHeader(Name = "开票单价")]
[ExporterHeader(DisplayName = "开票单价")]
public decimal Price { set; get; }
[ImporterHeader(Name = "开票金额")]
[ExporterHeader(DisplayName = "开票金额")]
public decimal Amt { set; get; }
}
public enum ExporterStatus
{
/// <summary>
/// 未处理
/// </summary>
[Display(Name = "未处理")]
Normal = 0,
/// <summary>
/// 申请出库
/// </summary>
[Display(Name = "申请出库")]
PupilsAway = 1,
/// <summary>
/// 确认出库
/// </summary>
[Display(Name = "确认出库")]
Suspension = 2,
/// <summary>
/// 不能出库
/// </summary>
[Display(Name = "不能出库")]
WorkStudy = 3,
/// <summary>
/// 取消出库
/// </summary>
[Display(Name = "取消出库")]
PostPractice = 4,
}
public enum ExporterIsBack
{
/// <summary>
/// 批量
/// </summary>
[Display(Name = "批量")]
Normal = 0,
/// <summary>
/// 备件
/// </summary>
[Display(Name = "备件")]
PupilsAway = 1,
}
}

4
src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/UnHQSettleAccounts/UnHQSettleDto.cs

@ -14,11 +14,11 @@ namespace Win.Sfs.SettleAccount.Entities.UnHQSettleAccounts
/// </summary>
public string Factory { get; set; }
/// <summary>
///外部看板编
///外部
/// </summary>
public string ExternalKanbanNumber { get; set; }
/// <summary>
///看板编号
///外部看板编号
/// </summary>
public string KanbanNumber { get; set; }
/// <summary>

2
src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/UnHQSettleAccounts/UnHQSettleExportDto.cs

@ -17,7 +17,7 @@ namespace Win.Sfs.SettleAccount.Entities.UnHQSettleAccounts
/// <summary>
///外部看板编号
/// </summary>
[ExporterHeader(DisplayName = "外部号")]
[ExporterHeader(DisplayName = "外部看板编号")]
public string ExternalKanbanNumber { get; set; }
/// <summary>
///看板编号

82
src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Wms/WmsDetailReportDto.cs

@ -1,4 +1,5 @@
using System;
using Magicodes.ExporterAndImporter.Core;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
@ -53,10 +54,10 @@ namespace Win.Sfs.SettleAccount.Entities.Wms.WmsSumOutput
[Display(Name = "备注")]
public string Remark1 { set; get; }
[Display(Name = "状态")]
[ExporterHeader(DisplayName = "状态",IsIgnore =true)]
public int State { set; get; }
[Display(Name = "期")]
[ExporterHeader(DisplayName = "账期",IsIgnore =true)]
public DateTime AccountDate { set; get; }
}
@ -121,7 +122,7 @@ namespace Win.Sfs.SettleAccount.Entities.Wms.WmsSumOutput
[Display(Name = "状态")]
public int State { set; get; }
[Display(Name = "期")]
[ExporterHeader(DisplayName = "账期", IsIgnore = true)]
public DateTime AccountDate { set; get; }
}
@ -178,17 +179,14 @@ namespace Win.Sfs.SettleAccount.Entities.Wms.WmsSumOutput
public string MaterialDesc { set; get; }
[Display(Name = "备注")]
public string Remark1 { set; get; }
[Display(Name = "状态")]
public int State { set; get; }
//[Display(Name = "状态")]
//public int State { set; get; }
}
/// <summary>
/// 有条码业务
/// </summary>
public class WmsDetailWithCodeReportDto
public class WmsDetailCancelReportDto
{
public WmsDetailWithCodeReportDto()
public WmsDetailCancelReportDto()
{
}
@ -243,4 +241,66 @@ namespace Win.Sfs.SettleAccount.Entities.Wms.WmsSumOutput
}
/// <summary>
/// 有条码业务
/// </summary>
public class WmsDetailWithCodeReportDto
{
public WmsDetailWithCodeReportDto()
{
}
//[Display(Name = "版本号")]
//public string Version { set; get; }
[Display(Name = "客户")]
public string Client { set; get; }
[Display(Name = "出库类型")]
public string Type { set; get; }
//[Display(Name = "结算编码")]
//public string SettleCode { set; get; }
//[Display(Name = "销售渠道")]
//public string SaleCode { set; get; }
//[Display(Name = "客户代码")]
//public string ClientCode { set; get; }
[Display(Name = "结算单")]
public string BillNum { set; get; }
[Display(Name = "交货编码")]
public string SwitchCode { set; get; }
[Display(Name = "物料号")]
public string MaterialCode { set; get; }
//[Display(Name = "寄售类别")]
//public string SaleType { set; get; }
[Display(Name = "结算数量")]
public decimal Qty { set; get; }
[Display(Name = "实际出库数量")]
public decimal OutputQty { set; get; }
[Display(Name = "差异数量")]
public decimal DiffQty { set; get; }
[Display(Name = "开票单价")]
public decimal Price { set; get; }
[Display(Name = "结算金额")]
public decimal Amt { set; get; }
//[Display(Name = "已出库金额")]
//public decimal OutPutAmt { set; get; }
//[Display(Name = "WMS待出库金额")]
//public decimal DiffAmt { set; get; }
[Display(Name = "物料组编码")]
public string EstimateType { set; get; }
[Display(Name = "物料组(车型)")]
public string MaterialGroup { set; get; }
[Display(Name = "物料组描述")]
public string MaterialDesc { set; get; }
[Display(Name = "备注")]
public string Remark1 { set; get; }
//[Display(Name = "状态")]
//public int State { set; get; }
}
}

3
src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Wms/WmsJitOutPutDetialDto.cs

@ -245,6 +245,9 @@ namespace Win.Sfs.SettleAccount.Entities.Wms
//物料组(车型)
public string MaterialGroup { set; get; }
[ImporterHeader(Name = "状态", IsIgnore = true)]
public int State { set; get; }

12
src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/ReportRequestDto/ReportRequestDto.cs

@ -29,9 +29,13 @@ namespace Win.Sfs.SettleAccount.Reports.ReportRequestDto
public string State { set; get; }
public string IsContainVersion { set; get; }
}
@ -59,8 +63,8 @@ namespace Win.Sfs.SettleAccount.Reports.ReportRequestDto
public string CustomerPartCode {set;get;}
public string EstimateTypeDesc {set;get;}
public string State {set;get;}
public DateTime Begin {set;get;}
public DateTime End { set; get; }
public string Begin {set;get;}
public string End { set; get; }
}
}

4
src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/SettleAccount.Application.Contracts.csproj

@ -24,5 +24,9 @@
<ProjectReference Include="..\SettleAccount.Domain\SettleAccount.Domain.csproj" />
<ProjectReference Include="..\SettleAccount.Domain.Shared\SettleAccount.Domain.Shared.csproj" />
</ItemGroup>
<ItemGroup>
<Folder Include="Entities\HQ\" />
</ItemGroup>
</Project>

334
src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BTCarConsigns_HS/BTCarConsignAppService.cs

@ -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;
}
}
}

369
src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BTCarKBFirsts_HS/BTCarKBFirstAppService.cs

@ -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;
}
}
}

398
src/Modules/SettleAccount/src/SettleAccount.Application/Entities/ErpShipping/ErpShippingAppService.cs

@ -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);
}
}
}

347
src/Modules/SettleAccount/src/SettleAccount.Application/Entities/HQExtend/HQKBExtendAppService.cs

@ -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);
}
}
}

346
src/Modules/SettleAccount/src/SettleAccount.Application/Entities/HQExtend/HQKBSettleExtendAppService.cs

@ -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);
}
}
}

2
src/Modules/SettleAccount/src/SettleAccount.Application/Entities/HQ_F/HQ_F_PlatformAppService.cs

@ -28,7 +28,7 @@ namespace Win.Sfs.SettleAccount.Entities.HQ_F
/// <summary>
/// 红旗F平台导入
/// </summary>
[Authorize(SettleAccountPermissions.HQ_FPlatform.Default)]
//[Authorize(SettleAccountPermissions.HQ_FPlatform.Default)]
//[AllowAnonymous]
[Route("api/settleaccount/HQFPlatform")]
public class HQ_F_PlatformAppService : SettleAccountApplicationBase<HQ_F_Platform>, IHQ_F_PlatformAppService

361
src/Modules/SettleAccount/src/SettleAccount.Application/Entities/JFCarConsignAppService.cs

@ -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;
}
}
}

361
src/Modules/SettleAccount/src/SettleAccount.Application/Entities/JFCarConsign_HS/JFCarConsignAppService.cs

@ -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;
}
}
}

328
src/Modules/SettleAccount/src/SettleAccount.Application/Entities/JFCarKBAppService.cs

@ -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;
}
}
}

328
src/Modules/SettleAccount/src/SettleAccount.Application/Entities/JFCarKBs_HS/JFCarKBAppService.cs

@ -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;
}
}
}

44
src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppService.cs

@ -4,17 +4,21 @@ using Magicodes.ExporterAndImporter.Excel;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using SettleAccount.Job.Services.Report;
using Shouldly;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TaskJob.EventArgs;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services;
using Volo.Abp.Uow;
using Win.Sfs.BaseData.ImportExcelCommon;
using Win.Sfs.SettleAccount.Constant;
using Win.Sfs.SettleAccount.Entities.ImportMap;
using Win.Sfs.SettleAccount.Entities.TaskJobs;
using Win.Sfs.SettleAccount.ExcelImporter;
using Win.Sfs.Shared.Filter;
@ -32,15 +36,53 @@ namespace Win.Sfs.SettleAccount.Entities.Prices
private readonly PriceListManager _mng;
private readonly IExcelImportAppService _excelImportService;
private readonly ISettleAccountBranchEfCoreRepository<ImportColumnMap, Guid> _mapRepository;
private readonly TaskJobService _service;
public PriceListAppService(
IExcelImportAppService excelImportService,
ISettleAccountBranchEfCoreRepository<ImportColumnMap, Guid> mapRepository,
PriceListManager mng
PriceListManager mng,
TaskJobService service
)
{
_mapRepository = mapRepository;
_excelImportService = excelImportService;
_mng = mng;
_service = service;
}
/// <summary>
/// 结算总成和ERP总成价格对比
/// </summary>
/// <param name="files">上传的文件(前端已经限制只能上传一个附件)</param>
/// <returns></returns>
[HttpGet]
[Route("BomDiffPrice-Make")]
[DisableRequestSizeLimit]
[Authorize(SettleAccountPermissions.PriceLists.Default)]
public async Task<string> SettledPartAndErpPartPriceDiffMake(string version, string customerCode)
{
List<CustomCondition> customConditionList = new List<CustomCondition>();
customConditionList.Add(new CustomCondition() { Name = "ProjectName", Value = "Bom定价差异明细" });
customConditionList.Add(new CustomCondition() { Name = "Version", Value = string.IsNullOrEmpty(version) ? string.Empty : version });
customConditionList.Add(new CustomCondition() { Name = "CustomerCode", Value = string.IsNullOrEmpty(customerCode) ? string.Empty : customerCode });
var _taskid = await _service.ExportEnqueueAsync("Bom定价差异明细", ExportExtentsion.Excel, version, string.Empty, CurrentUser, typeof(SettledPartAndErpPartPriceDiffExportService), customConditionList, (rs) =>
{
});
return _taskid;
}
[HttpPost]
[Route("job/list")]
[Authorize(SettleAccountPermissions.PriceLists.Default)]
[UnitOfWork(false)]
virtual public async Task<List<JobDto>> GetListAsync(JobRequestDto input)
{
return await _service.GetListAsync(input);
}
/// <summary>

150
src/Modules/SettleAccount/src/SettleAccount.Application/Entities/SettleAccounts/SettleAccountAppService.cs

@ -107,160 +107,10 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
_wmsefRespository = wmsefRespository;
}
/// <summary>
/// 选择结算明细任务列表,选择相关任务合拼导期间出库表
/// </summary>
/// <param name="files">上传的文件(前端已经限制只能上传一个附件)</param>
/// <returns></returns>
//[HttpGet]
//[Route("WmsJitOutPut")]
//[DisableRequestSizeLimit]
//public async Task<bool> WmsJitOutPut(List<string> fileList, string version)
//{
// List<WmsJitOutPutDetial> _lst = new List<WmsJitOutPutDetial>();
// foreach (var filename in fileList)
// {
// string fileSavePath = Environment.CurrentDirectory + @"\wwwroot\files\host\my-file-container\" + filename;
// IExcelImporter Importer = new Magicodes.ExporterAndImporter.Excel.ExcelImporter();
// var _list = await Importer.ImportSameSheets<WmsJitOutPutDetialDto, WmsJitOutPutDetial>(fileSavePath);
// foreach (var itm in _list)
// {
// var list = itm.Value.Data.ToList();
// _lst.AddRange(list.ToArray());
// }
// }
// var _ls1 = _lst.Where(p => p.ParentMaterialCode == p.MaterialCode).ToList();
// var outPutDetail= await _wmsRepository.Where(p => p.Version == version).ToListAsync();
// var query = from itm1 in _ls1
// join itm2 in outPutDetail on
// new { itm1.MaterialCode, itm1.KennCode, itm1.ChassisNumber }
// equals
// new { itm2.MaterialCode, itm2.KennCode, itm2.ChassisNumber } into temp1
// from tm1 in temp1.DefaultIfEmpty() where tm1==null
// select itm1;
// await _wmsRepository.GetDbContext().BulkInsertAsync(query.ToList(), new BulkConfig() { BulkCopyTimeout = 0 });
// int _count= _wmsVersionRepository.Count(p => p.Version == version);
// if (_count == 0)
// {
// var _version = new List<WmsJitOutPut>();
// _version.Add(new WmsJitOutPut { Version = version, BillNum = "T" +DateTime.Now.ToString("yyyyMMddhhmmssdddd"), Creator = CurrentUser.Email });
// await _wmsVersionRepository.GetDbContext().BulkInsertAsync(_version);
// }
// //_wmsRepository.Where(p=>p)
// return true;
//}
//[HttpGet]
//[Route("WmsJitOutPut-Pass")]
//public async Task<bool> WmsJitOutPutPass( string version, List<Guid> p_list=null)
//{
// if (p_list != null)
// {
// List<WmsJitOutPutDetial> _ls = new List<WmsJitOutPutDetial>();
// if (p_list.Count() > 0)
// {
// _ls = await _wmsRepository.Where(p => p_list.Contains(p.Id) && p.Version == version && p.State != 2).ToListAsync();
// }
// else
// {
// _ls = await _wmsRepository.Where(p => p.Version == version && p.State != 2).ToListAsync();
// }
// if (_ls.Count() > 0)
// {
// var _first = _ls.FirstOrDefault();
// var _guid = GuidGenerator.Create();
// foreach (var itm in _ls)
// {
// itm.TaskId = _guid;
// }
// await _wmsefRespository.GetDbContext().BulkInsertAsync(_ls);
// var uniapi = new TS_UNI_API(GuidGenerator.Create(), "1", version, "WmsJitOutPutDetail", _first.BillNum, 0,0, _guid)
// {
// TaskId = _guid,
// SourceBillNum = _first.BillNum,
// //TableName = "WmsJitOutPutDetail",
// InterfaceType = "1",
// Version = version,
// SettleAccountState = 0,
// WmsState=0
// };
// var _l = new List<TS_UNI_API>();
// _l.Add(uniapi);
// await _wmsefRespository.GetDbContext().BulkInsertAsync(_l);
// }
// }
// //_wmsDapper.GetListBySql<WmsJitOutPutDetial>("insert into WmsJitOutPutDetial", false);
// //_wmsDapper.DbConnection.ConnectionTimeout = 1200;
// //_wmsRepository.Where(p=>p)
// return true;
//}
//[HttpGet]
//[Route("WmsJitOutPut-Cancel")]
//public async Task<bool> WmsJitOutPutCancel(List<Guid> ids, string version)
//{
// //var _guid = GuidGenerator.Create();
// //foreach (var itm in _ls)
// //{
// // itm.TaskId = _guid;
// //}
// var _ls = await _wmsRepository.Where(p => ids.Contains(p.Id) && p.Version == version && p.State == 1).ToListAsync();
// var _first = _ls.FirstOrDefault();
// if (_ls.Count>0)
// {
// var _guid = GuidGenerator.Create();
// await _wmsefRespository.GetDbContext().BulkInsertAsync(_ls,new BulkConfig() { BulkCopyTimeout=0 });
// var uniapi = new TS_UNI_API(GuidGenerator.Create(), "1", version, "WmsJitOutPutDetail", _first.BillNum, 0,0, _guid)
// {
// TaskId = _guid,
// SourceBillNum = _first.BillNum,
// TableName = "WmsJitOutPutDetail",
// InterfaceType = "1",
// Version = version,
// WmsState= 0,
// SettleAccountState=0
// };
// var _l = new List<TS_UNI_API>();
// _l.Add(uniapi);
// await _wmsefRespository.GetDbContext().BulkInsertAsync(_l);
// }
// return true;
//}
[HttpPost]
[Route("testImport")]
[DisableRequestSizeLimit]
[UnitOfWork(false)]
public async Task<string> testUploadBeginInvoke([FromForm] IFormFileCollection files)
{
List<CustomCondition> customConditionList = new List<CustomCondition>();
customConditionList.Add(new CustomCondition() { Name = "Version", Value = "202107" });
customConditionList.Add(new CustomCondition() { Name = "CustomerCode", Value = "T20210701" });
customConditionList.Add(new CustomCondition() { Name = "BeginTime", Value = "T20210701" });
var _taskid = await _service.ImportEnqueueAsync<ImportTaskArgs>(files, "结算数据", CurrentUser, typeof(SettleAccountImportService),customConditionList,(rs)=> {
});
return _taskid;
}
/// <summary>
/// 导入功能
/// </summary>

3
src/Modules/SettleAccount/src/SettleAccount.Application/Entities/TaskJobs/JobAppService.cs

@ -39,7 +39,8 @@ using Win.Utils;
namespace Win.Sfs.SettleAccount.Entities.TaskJobs
{
[Authorize(SettleAccountPermissions.Reports.Default)]
//调整权限-派格张影导入数据时此模块她要看
[Authorize(SettleAccountPermissions.HQ_FPlatform.Default)]
//[AllowAnonymous]
[Route("api/settleaccount/Job")]
public class JobAppService: ApplicationService

5
src/Modules/SettleAccount/src/SettleAccount.Application/Entities/UnHQSettleAccounts/UnHQSettleAppService.cs

@ -86,12 +86,13 @@ namespace Win.Sfs.SettleAccount.Entities.UnHQSettleAccounts
public async Task<string> UnHQSettleUploadExcelImport([FromForm] IFormFileCollection files, Guid branchId, string year, string period, string version, string customerCode)
{
ExportImporter _exportImporter = new ExportImporter();
var result = await _exportImporter.UploadExcelImport<UnHQSettleImportDto>(files, _excelImportService);
var result_org = await _exportImporter.UploadExcelImport<UnHQSettleImportDto>(files, _excelImportService);
if (result == null || result.Count == 0)
if (result_org == null || result_org.Count == 0)
{
throw new BusinessException("导入模板数据不能为空!");
}
var result = result_org.Where(p => p.Factory != "L").ToList();//去掉工厂L
var entityList = ObjectMapper.Map<List<UnHQSettleImportDto>, List<UnHQSettleAccount>>(result);
//删除版本

1
src/Modules/SettleAccount/src/SettleAccount.Application/Entities/VWKanBan/VWKanBanAppService.cs

@ -304,6 +304,7 @@ namespace Win.Sfs.SettleAccount.Entities.VWKanBan
/// <returns></returns>
[HttpPost]
[Route("listversion")]
[Authorize(SettleAccountPermissions.VWKanBan.Default)]
public async Task<PagedResultDto<VWKanBanVersionDto>> GetVersionListAsync(VWKanBanVersionRequestDto input)
{
var entities = await _versionRepository.GetListByFilterAsync(input.BranchId, input.Filters, input.Sorting, int.MaxValue,

28
src/Modules/SettleAccount/src/SettleAccount.Application/Entities/VWSparePart/SparePartAppService.cs

@ -63,7 +63,7 @@ namespace Win.Sfs.SettleAccount.Entities.VWSparePart
/// <summary>
/// 导入功能
/// 大众备件明细数据导入功能(以后正常使用的功能),包含导入有空的订单号
/// </summary>
/// <param name="files">上传的文件(前端已经限制只能上传一个附件)</param>
/// <returns></returns>
@ -101,7 +101,17 @@ namespace Win.Sfs.SettleAccount.Entities.VWSparePart
_bomList.Add(new SparePartVersion(_id, branchId, year, period, version, customerCode));
foreach (var itm in entityList)
{
itm.SetValue(GuidGenerator.Create(), branchId, year, period, version, "not90");
if (string.IsNullOrEmpty(itm.PurchaseOrderNo))
{
//订单号不空
itm.SetValue(GuidGenerator.Create(), branchId, year, period, version, "not90", "NoOrder");
}
else
{
//赋值上主键ID
itm.SetValue(GuidGenerator.Create(), branchId, year, period, version, "not90");
}
}
if (checkList.Count > 0)
{
@ -112,6 +122,16 @@ namespace Win.Sfs.SettleAccount.Entities.VWSparePart
return ApplicationConsts.SuccessStr;
}
/// <summary>
/// 大众备件调整导入(财务期初时用的功能),订单号+物料号能一对一匹配
/// </summary>
/// <param name="files"></param>
/// <param name="branchId"></param>
/// <param name="year"></param>
/// <param name="period"></param>
/// <param name="version"></param>
/// <param name="customerCode"></param>
/// <returns></returns>
[HttpPost]
[Route("ExcelImport90")]
[DisableRequestSizeLimit]
@ -226,11 +246,11 @@ namespace Win.Sfs.SettleAccount.Entities.VWSparePart
switch (input.FileType)
{
case 0:
_fileName = string.Format("大众备件结算明细_{0}.csv", input.UserId.ToString());
_fileName = string.Format("大众备件结算调整_{0}.csv", input.UserId.ToString());
result = await _csv.ExportAsByteArray(dtoDetails);
break;
case 1:
_fileName = string.Format("大众备件结算明细_{0}.xlsx", input.UserId.ToString());
_fileName = string.Format("大众备件结算调整_{0}.xlsx", input.UserId.ToString());
result = await _excel.ExportAsByteArray(dtoDetails);
break;
}

652
src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSCusomerKanbanAppService.cs

@ -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;
}
}
}

7
src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSHQFKanbanAppService.cs

@ -356,6 +356,13 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
[UnitOfWork(false)]
public async Task<bool> WmsHQFKanbanOutPutPass(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" +

10
src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSHQFSharePartAppService .cs

@ -325,6 +325,11 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
[UnitOfWork(false)]
public async Task<bool> WmsSharePartOutPutPass(WmsJitRequestDto input)
{
if (DateTime.Now.ToString("yyyyMM") != input.AccountDate.ToString("yyyyMM"))
{
throw new BusinessException("8989", "填写过账日期应该为当月!");
}
if (input.Guids != null)
{
List<WmsHQFSharePartOutPutDetial> _ls = new List<WmsHQFSharePartOutPutDetial>();
@ -364,6 +369,11 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
[UnitOfWork(false)]
public async Task<bool> WmsOutPutDelete(WmsJitRequestDto input)
{
if (DateTime.Now.ToString("yyyyMM") != input.AccountDate.ToString("yyyyMM"))
{
throw new BusinessException("8989", "填写过账日期应该为当月!");
}
var count = _wmsRepository.Count(p => p.BillNum == input.BillNum && p.State != 0);
if (count > 0)

59
src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSHQHKanbanAppService.cs

@ -145,6 +145,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
{
//不用传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);
@ -280,7 +281,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
_lst.AddRange(_list.ToArray());
}
var outPutDetail = await _wmsRepository.Where(p => p.Version == input.Version).ToListAsync();
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
@ -353,6 +354,11 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
[UnitOfWork(false)]
public async Task<bool> WmsHQHKanbanOutPutPass(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" +
@ -376,6 +382,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
/// <returns></returns>
[HttpPost]
[Route("WmsHQHKanbanOutPut-Cancel")]
[UnitOfWork(false)]
public async Task<bool> WmsHQHKanbanOutPutCancel(WmsJitRequestDto input)
{
if (input.Guids != null && input.Guids.Count() > 0)
@ -443,9 +450,33 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
public async Task<string> ExcelImport([FromForm] IFormFileCollection files, string version)
{
var _billNum = "HQHKB" + DateTime.Now.ToString("yyyyMMddhhmmss");
var checkList = new List<ErrorExportDto>();
ExportImporter _exportImporter = new ExportImporter();
var result = await _exportImporter.ExtendExcelOfSheetOneImport<WmsHQHKanbanOutPutDetial>(files, _excelImportService);
var filteResult = result.Where(p => p.Kanban != "");//过滤掉看板号为空的数据
//检验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.Kanban));//过滤掉看板号为空的数据
//检验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.Kanban), string.Empty));
}
}
List<WmsHQHKanbanOutPutDetial> _lst = new List<WmsHQHKanbanOutPutDetial>();
var _lsCopy = new List<WmsHQHKanbanOutPutDetial>();
foreach (var itm in filteResult)
@ -475,7 +506,25 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
_lsCopy.Add(_detail);
}
_lst.AddRange(_lsCopy.ToArray());
var outPutDetail = await _wmsRepository.Where(p => p.Version == version).ToListAsync();
//检验3:导入模板中看板号+物料号,不能重复
var _isRepeatOfReportList = from arc in _lst
group arc by new { arc.Kanban, arc.MaterialCode, 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}组合物料号{1}有重复,请检查!", itm.Key.Kanban, itm.Key.MaterialCode), 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
@ -486,7 +535,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
select itm1;
var errList = error.GroupBy(p => new { p.BillNum }).Select(p => new { BillNum = p.Key.BillNum, Number = p.Count() });
var checkList = new List<ErrorExportDto>();
foreach (var itm in errList)
{
checkList.Add(new ErrorExportDto() { Message = string.Format("出库单号:{0}重复记录数:{1}条", itm.BillNum, itm.Number) });
@ -537,7 +586,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
IExporter _excel = new ExcelExporter();
byte[] result = null;
var _fileName = string.Format("红旗H平台出库单_{0}.xlsx", Guid.NewGuid().ToString());
var _fileName = string.Format("红旗批量出库单_{0}.xlsx", Guid.NewGuid().ToString());
result = await _excel.ExportAsByteArray(entities);

43
src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSHQHSharePartAppService.cs

@ -166,7 +166,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
var entities = await _wmsRepository.GetListByFilterAsync(GuidGenerator.Create(), input.Filters, input.Sorting, input.MaxResultCount,
input.SkipCount, true);
var totalCount = await GetCountAsync(input);
var stockList = _wmsDapper.GetSalesStock();
var stockList = _wmsDapper.GetSalesStock("BJ");
var query= from itm in entities
join itm1 in stockList on itm.MaterialCode equals itm1.SapCode
into temp1
@ -381,6 +381,11 @@ into temp1
[UnitOfWork(false)]
public async Task<bool> WmsSharePartOutPutPass(WmsJitRequestDto input)
{
if (DateTime.Now.ToString("yyyyMM") != input.AccountDate.ToString("yyyyMM"))
{
throw new BusinessException("8989", "填写过账日期应该为当月!");
}
if (input.Guids != null)
{
List<WmsHQHSharePartOutPutDetial> _ls = new List<WmsHQHSharePartOutPutDetial>();
@ -444,6 +449,7 @@ into temp1
/// <returns></returns>
[HttpPost]
[Route("WmsSharePartOutPut-Cancel")]
[UnitOfWork(false)]
public async Task<bool> WmsSharePartOutPutCancel(WmsJitRequestDto input)
{
if (input.Guids != null && input.Guids.Count() > 0)
@ -478,8 +484,28 @@ into temp1
public async Task<string> ExcelImport([FromForm] IFormFileCollection files, string version)
{
var _billNum = "BHQH" + DateTime.Now.ToString("yyyyMMddhhmmss");
var checkList = new List<ErrorExportDto>();
ExportImporter _exportImporter = new ExportImporter();
var result = await _exportImporter.ExtendExcelOfSheetOneImport<WmsHQHSharePartOutPutDetial>(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);
}
//检验2:导入模板中的结算数据是否为0
foreach (var itm in result)
{
if (itm.Qty == 0)
{
checkList.Add(new ErrorExportDto(version, "红旗备件出库单导入", string.Empty, string.Empty, string.Empty, string.Empty, string.Format("导入模板中SAP编码{0}结算数量为0,影响出库请检查!", itm.MaterialCode), string.Empty));
}
}
List<WmsHQHSharePartOutPutDetial> _lst = new List<WmsHQHSharePartOutPutDetial>();
var _lsCopy = new List<WmsHQHSharePartOutPutDetial>();
@ -510,6 +536,19 @@ into temp1
}
_lst.AddRange(_lsCopy.ToArray());
//检验3:导入模板中的SAP编号不能重复,按其汇总出库
var _isRepeatOfReportList = _lst.GroupBy(x => new { x.MaterialCode, x.Version }).Select(p => new { Count = p.Count(), MaterialCode = p.Key.MaterialCode });
foreach (var itm in _isRepeatOfReportList)
{
if (itm.Count > 1)
{
checkList.Add(new ErrorExportDto(version, "红旗备件出库单导入", string.Empty, string.Empty, string.Empty, string.Empty, string.Format("导入模板中的SAP编码{0}有重复!", itm.MaterialCode), string.Empty));
}
}
if (checkList.Count > 0)
{
return await ExportErrorReportAsync(checkList);
}
var outPutDetail = await _wmsRepository.Where(p => p.Version == version).ToListAsync();
@ -521,7 +560,7 @@ into temp1
select itm1;
var errList = error.GroupBy(p => new { p.BillNum }).Select(p => new { BillNum = p.Key.BillNum, Number = p.Count() });
var checkList = new List<ErrorExportDto>();
foreach (var itm in errList)
{
checkList.Add(new ErrorExportDto() { Message = string.Format("出库单号:{0}重复记录数:{1}条", itm.BillNum, itm.Number) });

15
src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSJitAppService.cs

@ -141,7 +141,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
var _ls1 = _lst.Where(p => p.ParentMaterialCode == p.MaterialCode).ToList();
var outPutDetail = await _wmsRepository.Where(p => p.Version == version).ToListAsync();
var outPutDetail = await _wmsRepository.Where(p => p.Version == version && p.State!=4).ToListAsync();
var error = from itm1 in outPutDetail
@ -329,7 +329,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
[HttpPost]
[Route("WmsJitOutPutCancel")]
[DisableRequestSizeLimit]
[UnitOfWork(false)]
public async Task<bool> WmsJitCancel(List<Guid> ids)
{
var _joblist = await _job.Where(p => ids.Contains(p.Id) && p.FileName == "已确认").ToListAsync();
@ -415,7 +415,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
_lst.AddRange(_lsCopy.ToArray());
}
var _ls1 = _lst.Where(p => p.ParentMaterialCode == p.MaterialCode).ToList();
var outPutDetail = await _wmsRepository.Where(p => p.Version == input.Version).ToListAsync();
var outPutDetail = await _wmsRepository.Where(p => p.Version == input.Version && p.State != 4 ).ToListAsync();
var error = from itm1 in outPutDetail
join itm2 in _ls1 on
@ -489,8 +489,13 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
[Authorize(SettleAccountPermissions.WMSJIT.Create)]
public async Task<bool> WmsJitOutPutPass(WmsJitRequestDto input)
{
var sql = "DECLARE @return_value int\n" +
//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 = 0,\n" +

220
src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSKanbanAppService.cs

@ -320,7 +320,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
_lst.AddRange(_list.ToArray());
}
// var _ls1 = _lst.Where(p => p.ParentMaterialCode == p.MaterialCode).ToList();
var outPutDetail = await _wmsRepository.Where(p => p.Version == input.Version).ToListAsync();
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
@ -344,6 +344,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
foreach (var itm in _wmslst)
{
itm.BillNum = _billNum;
itm.WmsBillNum = !string.IsNullOrEmpty(itm.WmsBillNum) ? itm.WmsBillNum : "PF";
}
await _wmsRepository.GetDbContext().BulkInsertAsync(_wmslst, new BulkConfig() { BulkCopyTimeout = 0, BatchSize = 10000 });
@ -394,16 +395,21 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
[UnitOfWork(false)]
public async Task<bool> WmsKanbanOutPutPass(WmsJitRequestDto input)
{
//if (DateTime.Now.ToString("yyyyMM") != input.AccountDate.ToString("yyyyMM"))
//{
// throw new BusinessException("8989", "填写过账日期应该为当月!");
//}
if (input.Guids != null)
{
List<WmsKanbanOutPutDetial> _ls = new List<WmsKanbanOutPutDetial>();
if (input.Guids.Count() > 0)
{
_ls = await _wmsRepository.Where(p => input.Guids.Contains(p.Id) && p.Version ==input.Version && p.BillNum == input.BillNum && p.State != 2).ToListAsync();
_ls = await _wmsRepository.Where(p => input.Guids.Contains(p.Id) && p.Version == input.Version && p.BillNum == input.BillNum && p.State != 2 && p.State != 4).ToListAsync();
}
else
{
_ls = await _wmsRepository.Where(p => p.Version == input.Version && p.BillNum == input.BillNum && p.State != 2).ToListAsync();
_ls = await _wmsRepository.Where(p => p.Version == input.Version && p.BillNum == input.BillNum && p.State != 2 && p.State!=4).ToListAsync();
}
if (_ls.Count() > 0)
{
@ -428,6 +434,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
/// <returns></returns>
[HttpPost]
[Route("WmsKanbanOutPut-Cancel")]
[UnitOfWork(false)]
public async Task<bool> WmsKanbanOutPutCancel(WmsJitRequestDto input)
{
if (input.Guids != null && input.Guids.Count() > 0)
@ -457,6 +464,78 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
}
return true;
}
/// <summary>
///出库界面功能, 撤销核准出库
/// </summary>
/// <param name="ids"></param>
/// <param name="version"></param>
/// <returns></returns>
[HttpPost]
[Route("Regenerate")]
public async Task<bool> WmsKanbanOutPutRegenerate(WmsJitRequestDto input)
{
if (input.Guids != null && input.Guids.Count() > 0)
{
List<string> _ls = new List<string>();
var _lst = _wmsRepository.Where(p => input.Guids.Contains(p.Id) && p.State == 4);
List<WmsKanbanOutPutDetial> _detail = new List<WmsKanbanOutPutDetial>();
foreach (var itm in _lst.ToList())
{
}
await _wmsRepository.BatchDeleteAsync();
//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 = 1,\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>
@ -514,51 +593,51 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
[HttpPost]
[Route("ExcelImportWithOutKanban")]
[DisableRequestSizeLimit]
//[Authorize(SettleAccountPermissions.SettleAccounts.Default)]
public async Task<string> ExcelImportWithOutKanban([FromForm] IFormFileCollection files, string version)
{
var _billNum = "KA" + DateTime.Now.ToString("yyyyMMddhhmmss");
//[HttpPost]
//[Route("ExcelImportWithOutKanban")]
//[DisableRequestSizeLimit]
////[Authorize(SettleAccountPermissions.SettleAccounts.Default)]
//public async Task<string> ExcelImportWithOutKanban([FromForm] IFormFileCollection files, string version)
//{
//var _billNum = "KA" + DateTime.Now.ToString("yyyyMMddhhmmss");
var _list= _dapper.GetNoKanbanSettleDetail(version);
//var _list= _dapper.GetNoKanbanSettleDetail(version);
var stockList = _wmsDapper.GetSalesStock();
var query = from itm in _list
join itm1 in stockList on itm.MaterialCode equals itm1.SapCode
into temp1
from tm1 in temp1.DefaultIfEmpty()
select new WmsWithOutKanbanOutPutDetial(
GuidGenerator.Create(),
"无看板",
itm.SapMaterialCode,
itm.MaterialDesc,
itm.Version,
string.Empty,
string.Empty,
itm.Qty,
tm1.Qty,
itm.Qty,
string.Empty,
_billNum,
0,
0,
itm.InvoicePrice
,itm.InvoiceAmt
);
//var stockList = _wmsDapper.GetSalesStock();
//var query = from itm in _list
// join itm1 in stockList on itm.MaterialCode equals itm1.SapCode
//into temp1
// from tm1 in temp1.DefaultIfEmpty()
// select new WmsWithOutKanbanOutPutDetial(
// GuidGenerator.Create(),
// "无看板",
// itm.SapMaterialCode,
// itm.MaterialDesc,
// itm.Version,
// string.Empty,
// string.Empty,
// itm.Qty,
// tm1.Qty,
// itm.Qty,
// string.Empty,
// _billNum,
// 0,
// 0,
// itm.InvoicePrice
// ,itm.InvoiceAmt
// );
await _wmsRepository.GetDbContext().BulkInsertAsync(query.ToList(), new BulkConfig() { BulkCopyTimeout = 0, BatchSize = 10000 });
int _count = _wmsVersionRepository.Count(p => p.Version == version && p.BillNum == _billNum);
if (_count == 0)
{
var _version = new WmsKanbanOutPut(GuidGenerator.Create(), version, _billNum, CurrentUser.Email);
await _wmsVersionRepository.InsertAsync(_version, true);
}
//await _wmsRepository.GetDbContext().BulkInsertAsync(query.ToList(), new BulkConfig() { BulkCopyTimeout = 0, BatchSize = 10000 });
//int _count = _wmsVersionRepository.Count(p => p.Version == version && p.BillNum == _billNum);
//if (_count == 0)
//{
// var _version = new WmsWithOutKanbanOutPut(GuidGenerator.Create(), version, _billNum, CurrentUser.Email);
// await _wmsVersionRepository.InsertAsync(_version, true);
//}
@ -658,11 +737,11 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
// var _version = new WmsKanbanOutPut(GuidGenerator.Create(), version, _billNum, CurrentUser.Email);
// await _wmsVersionRepository.InsertAsync(_version, true);
//}
return _billNum;
//return _billNum;
}
//}
@ -676,19 +755,39 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
//[Authorize(SettleAccountPermissions.SettleAccounts.Default)]
public async Task<string> ExcelImport([FromForm] IFormFileCollection files, string version)
{
var checkList = new List<ErrorExportDto>();
var _billNum = "K" + DateTime.Now.ToString("yyyyMMddhhmmss");
ExportImporter _exportImporter = new ExportImporter();
var result = await _exportImporter.ExtendExcelOfSheetOneImport<WmsKanbanOutPutDetial>(files, _excelImportService);
var filteResult = result.Where(p => p.Kanban != "");
//检验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);
}
//检验2:导入模板中的结算数据是否为0
foreach (var itm in result)
{
if (itm.Qty == 0)
{
checkList.Add(new ErrorExportDto(version, "大众看板出库单导入", string.Empty, string.Empty, string.Empty, string.Empty, string.Format("导入模板中看板号{0}的结算数量为0,影响出库请检查!", itm.Kanban), string.Empty));
}
}
//发现导入模板中存在空行,直接过滤掉
var filteResult = result.Where(p =>!string.IsNullOrEmpty(p.Kanban));
List<WmsKanbanOutPutDetial> _lst = new List<WmsKanbanOutPutDetial>();
var _lsCopy = new List<WmsKanbanOutPutDetial>();
foreach (var itm in filteResult)
{
WmsKanbanOutPutDetial _detail = new WmsKanbanOutPutDetial(
GuidGenerator.Create(),
!string.IsNullOrEmpty(itm.WmsBillNum)? itm.WmsBillNum:string.Empty,
!string.IsNullOrEmpty(itm.WmsBillNum) ? itm.WmsBillNum : string.Empty,
itm.Kanban,
itm.MaterialCode,
itm.MaterialDesc,
itm.MaterialGroup,
@ -710,7 +809,22 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
}
_lst.AddRange(_lsCopy.ToArray());
//检验3:导入模板中看板号+物料号,不能重复
var _isRepeatOfReportList = from arc in _lst
group arc by new { arc.Kanban, arc.MaterialCode,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}组合物料号{1}有重复,请检查!", itm.Key.Kanban, itm.Key.MaterialCode), string.Empty));
}
if (checkList.Count > 0)
{
return await ExportErrorReportAsync(checkList);
}
var outPutDetail = await _wmsRepository.Where(p => p.Version == version).ToListAsync();
@ -722,7 +836,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
select itm1;
var errList = error.GroupBy(p => new { p.BillNum }).Select(p => new { BillNum = p.Key.BillNum, Number = p.Sum(itm => itm.Qty) });
var checkList = new List<ErrorExportDto>();
foreach (var itm in errList)
{
checkList.Add(new ErrorExportDto() { Message = string.Format("出库单号:{0}重复记录数:{1}条", itm.BillNum, itm.Number) });
@ -778,11 +892,11 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
IExporter _excel = new ExcelExporter();
byte[] result = null;
var _fileName = string.Format("大众看板出库单_{0}.xlsx", Guid.NewGuid().ToString());
result = await _excel.ExportAsByteArray(dtos);
var _fileName = string.Format("大众看板出库单_{0}.xlsx", Guid.NewGuid().ToString());
result = await _excel.ExportAsByteArray(dtos);
result.ShouldNotBeNull();
//保存导出文件到服务器存成二进制

235
src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSKanbanExtendAppService.cs

@ -159,7 +159,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
input.SkipCount, true);
var totalCount = await GetCountAsync(input);
var stockList = _wmsDapper.GetSalesStock();
var stockList = _wmsDapper.GetSalesStock("PLJS");
var query = from itm in entities
join itm1 in stockList on itm.SapMaterialCode equals itm1.SapCode
into temp1
@ -200,7 +200,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
public async Task<bool> WmsSharePartUpdate(WmsWithOutKanbanOutPutDetial detial)
{
var _entityList = _wmsRepository.Where(p => p.Id == detial.BranchId).ToList();
var _entityList = _wmsRepository.Where(p => p.Id == detial.BranchId && p.State != 4 ).ToList();
if (_entityList.Count() > 0)
{
foreach (var itm in _entityList)
@ -234,6 +234,185 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
[HttpPost]
[Route("ExcelImportWithOutKanban")]
[DisableRequestSizeLimit]
//[Authorize(SettleAccountPermissions.SettleAccounts.Default)]
public async Task<string> ExcelImportWithOutKanban([FromForm] IFormFileCollection files, string version)
{
var _billNum = "KA" + DateTime.Now.ToString("yyyyMMddhhmmss");
//var _list = _dapper.GetNoKanbanSettleDetail(version);
//var stockList = _wmsDapper.GetSalesStock();
//var query = from itm in _list
// join itm1 in stockList on itm.MaterialCode equals itm1.SapCode
//into temp1
// from tm1 in temp1.DefaultIfEmpty()
// select new WmsWithOutKanbanOutPutDetial(
// GuidGenerator.Create(),
// "无看板",
// itm.SapMaterialCode,
// itm.MaterialDesc,
// itm.Version,
// string.Empty,
// string.Empty,
// itm.Qty,
// tm1.Qty,
// itm.Qty,
// string.Empty,
// _billNum,
// 0,
// 0,
// itm.InvoicePrice
// , itm.InvoiceAmt
// );
//await _wmsRepository.GetDbContext().BulkInsertAsync(query.ToList(), new BulkConfig() { BulkCopyTimeout = 0, BatchSize = 10000 });
//int _count = _wmsVersionRepository.Count(p => p.Version == version && p.BillNum == _billNum);
//if (_count == 0)
//{
// var _version = new WmsWithOutKanbanOutPut(GuidGenerator.Create(), version, _billNum, CurrentUser.Email);
// await _wmsVersionRepository.InsertAsync(_version, true);
//}
//return _billNum;
//var _lsCopy = new List<WmsWithOutKanbanOutPutDetial>();
//foreach (var itm in query.ToList())
//{
// WmsWithOutKanbanOutPutDetial _detail = new WmsWithOutKanbanOutPutDetial(
// GuidGenerator.Create(),
// "无看板",
// itm.SapMaterialCode,
// itm.MaterialDesc,
// itm.Version,
// string.Empty,
// string.Empty,
// itm.Qty,
// 0,
// itm.Qty,
// string.Empty,
// _billNum,
// 0,
// itm.
// );
// _lsCopy.Add(_detail);
//}
//_lst.AddRange(_lsCopy.ToArray());
ExportImporter _exportImporter = new ExportImporter();
var result = await _exportImporter.ExtendExcelImport<WmsWithOutKanbanOutPutDetial>(files, _excelImportService);
List<WmsWithOutKanbanOutPutDetial> _lst = new List<WmsWithOutKanbanOutPutDetial>();
var _lsCopy = new List<WmsWithOutKanbanOutPutDetial>();
foreach (var itm in result)
{
WmsWithOutKanbanOutPutDetial _detail = new WmsWithOutKanbanOutPutDetial(
GuidGenerator.Create(),
!string.IsNullOrEmpty(itm.Type) ? itm.Type : string.Empty,
itm.SapMaterialCode,
itm.MaterialDesc,
itm.Version,
itm.IsBack,
itm.Remark,
itm.Qty,
itm.SockQty,
itm.Qty,
itm.Extend,
itm.BillNum,0
,0,
itm.Price,
itm.Amt
);
_lsCopy.Add(_detail);
}
_lst.AddRange(_lsCopy.ToArray());
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 }
equals
new { itm2.SapMaterialCode }
select itm1;
var errList = error.GroupBy(p => new { p.BillNum }).Select(p => new { BillNum = p.Key.BillNum, Number = p.Sum(itm => itm.Qty) });
var checkList = new List<ErrorExportDto>();
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 }
equals
new { itm2.SapMaterialCode } 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 && _wmslst.Count()>0)
{
var _version = new WmsWithOutKanbanOutPut(GuidGenerator.Create(), version, _billNum, CurrentUser.Email);
await _wmsVersionRepository.InsertAsync(_version, true);
}
return ApplicationConsts.SuccessStr;
}
/// <summary>
/// 选择任务,生成出库单,只包含已确认的单据
/// </summary>
@ -246,24 +425,22 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
public async Task<string> WmsKanbanOutPut(WmsJitRequestDto input)
{
var _count1 = _wmsVersionRepository.Count(p => p.Version == input.Version);
if (_count1 > 0)
{
var checkList = new List<ErrorExportDto>();
//var _count1 = _wmsVersionRepository.Count(p => p.Version == input.Version );
//if (_count1 > 0)
//{
// var checkList = new List<ErrorExportDto>();
checkList.Add(new ErrorExportDto() { Message = "有重复期间数据" });
// checkList.Add(new ErrorExportDto() { Message = "有重复期间数据" });
if (checkList.Count > 0)
{
return await ExportErrorReportAsync(checkList);
}
}
// if (checkList.Count > 0)
// {
// return await ExportErrorReportAsync(checkList);
// }
//}
var _billNum = "KA" + DateTime.Now.ToString("yyyyMMddhhmmss");
var _list = _dapper.GetNoKanbanSettleDetail(input.Version);
var stockList = _wmsDapper.GetSalesStock();
var stockList = _wmsDapper.GetSalesStock("PLJS");
var query = from itm in _list
join itm1 in stockList on itm.SapMaterialCode equals itm1.SapCode
into temp1
@ -276,15 +453,15 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
itm.Version,
string.Empty,
string.Empty,
itm.InvoiceQty-itm.ClaimQty,
itm.InvoiceQty-itm.ClaimQty+itm.CP7ScrapQty,
tm1==null?0:tm1.Qty,
itm.InvoiceQty,
itm.InvoiceQty - itm.ClaimQty + itm.CP7ScrapQty,
string.Empty,
_billNum,
0,
0,
itm.InvoicePrice,
itm.InvoiceAmt
Math.Round(((itm.InvoiceQty - itm.ClaimQty + itm.CP7ScrapQty) * itm.InvoicePrice), 2)
);
@ -334,7 +511,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
// checkList.Add(new ErrorExportDto() { Message = string.Format("物料号:{0}出库数量大于结算数量或寄售库存数量!",itm.SapMaterialCode) });
//}
//if (checkList.Count > 0)
//{
@ -342,7 +519,11 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
// return await ExportErrorReportAsync(checkList, "校验失败.xlsx");
//}
//if (DateTime.Now.ToString("yyyyMM") != input.AccountDate.ToString("yyyyMM"))
//{
// throw new BusinessException("8989", "填写过账日期应该为当月!");
//}
@ -369,6 +550,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
/// <returns></returns>
[HttpPost]
[Route("WmsKanbanOutPut-Cancel")]
[UnitOfWork(false)]
public async Task<bool> WmsKanbanOutPutCancel(WmsJitRequestDto input)
{
if (input.Guids != null && input.Guids.Count() > 0)
@ -460,22 +642,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
}
);
return _fileName;
}
// 物料 物料组 物料描述 物料号 开始日期 结束日期 单位 出库数量 结算数量 寄售库存数量
}

59
src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSSharePart90AppService.cs

@ -11,6 +11,7 @@ using System.Collections.Generic;
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;
@ -174,7 +175,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
var totalCount = await GetCountAsync(input);
var stockList = _wmsDapper.GetSalesStock();
var stockList = _wmsDapper.GetSalesStock("BJJS");
var query = from itm in entities
join itm1 in stockList on itm.MaterialCode equals itm1.SapCode
into temp1
@ -282,7 +283,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
}
}
var outPutDetail = await _wmsRepository.Where(p => p.Version == input.Version).ToListAsync();
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
@ -373,16 +374,21 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
[UnitOfWork(false)]
public async Task<bool> WmsSharePartOutPutPass(WmsJitRequestDto input)
{
//if (DateTime.Now.ToString("yyyyMM") != input.AccountDate.ToString("yyyyMM"))
//{
// throw new BusinessException("8989", "填写过账日期应该为当月!");
//}
if (input.Guids != null)
{
List<WmsSharePart90OutPutDetial> _ls = new List<WmsSharePart90OutPutDetial>();
if (input.Guids.Count() > 0)
{
_ls = await _wmsRepository.Where(p => input.Guids.Contains(p.Id) && p.Version == input.Version && p.BillNum == input.BillNum && p.State != 2).ToListAsync();
_ls = await _wmsRepository.Where(p => input.Guids.Contains(p.Id) && p.Version == input.Version && p.BillNum == input.BillNum && p.State != 2 && p.State!=4).ToListAsync();
}
else
{
_ls = await _wmsRepository.Where(p => p.Version == input.Version && p.BillNum == input.BillNum && p.State != 2).ToListAsync();
_ls = await _wmsRepository.Where(p => p.Version == input.Version && p.BillNum == input.BillNum && p.State != 2 && p.State != 4).ToListAsync();
}
if (_ls.Count() > 0)
{
@ -407,6 +413,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
/// <returns></returns>
[HttpPost]
[Route("WmsSharePartOutPut-Cancel")]
[UnitOfWork(false)]
public async Task<bool> WmsSharePartOutPutCancel(WmsJitRequestDto input)
{
if (input.Guids != null && input.Guids.Count() > 0)
@ -477,9 +484,29 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
public async Task<string> ExcelImport([FromForm] IFormFileCollection files, string version)
{
var _billNum = "B" + DateTime.Now.ToString("yyyyMMddhhmmss");
var checkList = new List<ErrorExportDto>();
ExportImporter _exportImporter = new ExportImporter();
var result = await _exportImporter.ExtendExcelOfSheetOneImport<WmsSharePart90OutPutDetial>(files, _excelImportService);
var filteResult = result.Where(p => p.OrderBillNum != "");//过滤掉订单号为空的数据,限制这样数据导入
//检验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.OrderBillNum));//过滤掉订单号为空的数据,限制这样数据导入
//检验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.OrderBillNum), string.Empty));
}
}
List<WmsSharePart90OutPutDetial> _lst = new List<WmsSharePart90OutPutDetial>();
var _lsCopy = new List<WmsSharePart90OutPutDetial>();
@ -514,17 +541,33 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
}
_lst.AddRange(_lsCopy.ToArray());
//检验3:导入模板中订单号+物料号,不能重复
var _isRepeatOfReportList = from arc in _lst
group arc by new { arc.OrderBillNum, arc.MaterialCode }
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}组合物料号{1}有重复,请检查!", itm.Key.OrderBillNum, itm.Key.MaterialCode), string.Empty));
}
if (checkList.Count > 0)
{
return await ExportErrorReportAsync(checkList);
}
var outPutDetail = await _wmsRepository.Where(p => p.Version == version).ToListAsync();
var error = from itm1 in outPutDetail
join itm2 in _lst on
new { itm1.MaterialCode }
new { itm1.OrderBillNum, itm1.MaterialCode }
equals
new { itm2.MaterialCode }
new {itm2.OrderBillNum, itm2.MaterialCode }
select itm1;
var errList = error.GroupBy(p => new { p.BillNum }).Select(p => new { BillNum = p.Key.BillNum, Number = p.Sum(itm => itm.Qty) });
var checkList = new List<ErrorExportDto>();
foreach (var itm in errList)
{
checkList.Add(new ErrorExportDto() { Message = string.Format("出库单号:{0}重复记录数:{1}条", itm.BillNum, itm.Number) });

141
src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSSharePartAppService.cs

@ -52,7 +52,7 @@ using Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report;
namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
{
/// <summary>
/// wms出库
/// 大众备件无单号出库单
/// </summary>
//[AllowAnonymous]
@ -75,6 +75,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
private readonly IExcelImportAppService _excelImportService;
private readonly TaskJobService _service;
private readonly ErpPartDapperRepository _erpdapperRepository;
/// <summary>
///
/// </summary>
@ -94,6 +95,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
IDistributedCache<WmsSharePartOutPutDetial> cache,
ISnowflakeIdGenerator snowflakeIdGenerator,
ICommonManager commonManager,
ErpPartDapperRepository erpdapperRepository,
ISettleAccountBranchEfCoreRepository<WmsSharePart90OutPutDetial, Guid> wmsRepository90,
ISettleAccountBranchEfCoreRepository<WmsSharePart90OutPut, Guid> wmsVersionRepository90,
WmsDapperRepository wmsDapper
@ -109,6 +111,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
_wmsRepository90 = wmsRepository90;
_wmsVersionRepository90 = wmsVersionRepository90;
_erpdapperRepository = erpdapperRepository;
}
private async Task<long> GetCountAsync(WmsSharePartOutPutDetialRequestDto input)
@ -174,7 +177,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
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, input.MaxResultCount,
input.SkipCount, true);
var stockList = _wmsDapper.GetSalesStock();
var stockList = _wmsDapper.GetSalesStock("BJJS");
var query = from itm in entities
join itm1 in stockList on itm.MaterialCode equals itm1.SapCode
into temp1
@ -200,7 +203,8 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
tm1 == null ? 0 : tm1.Qty,
itm.OutPutQty,
itm.Price,
itm.Amt
itm.Amt,
itm.RealityNumber
);
@ -245,8 +249,8 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
if (_joblist.Count() > 0)
{
var fileList = _joblist.Select(p => p.RealDownFileName).ToList();
List<WmsSharePartOutPutDetial> _lst = new List<WmsSharePartOutPutDetial>();
List<WmsSharePart90OutPutDetial> _lstBill = new List<WmsSharePart90OutPutDetial>();
List<WmsSharePartOutPutDetial> _lst = new List<WmsSharePartOutPutDetial>();//无订单
List<WmsSharePart90OutPutDetial> _lst90Bill = new List<WmsSharePart90OutPutDetial>();//有订单
foreach (var filename in fileList)
{
string fileSavePath = Environment.CurrentDirectory + @"\wwwroot\files\host\my-file-container\" + filename;
@ -256,9 +260,9 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
var _list90Summary = _excelHelper.ExcelToListOne<WmsSharePart90OutPutDetial>();//有单号
var _list = _listSummary.Where(p => p.OrderBillNum == "").ToList();//过滤 没有采购订单号为空的集合
var _listBill = _list90Summary.Where(p => p.OrderBillNum != "").ToList();//过滤 有采购订单号的集合
//NoOrder用来标识采购订单号为空的数据
var _list = _listSummary.Where(p => p.OrderBillNum == "NoOrder").ToList();//有采购订单号的集合
var _list90Bill = _list90Summary.Where(p => !string.IsNullOrEmpty(p.OrderBillNum) && p.OrderBillNum != "NoOrder").ToList();//有采购订单号的集合
//var _list = _excelHelper.ExcelToList<WmsSharePartOutPutDetial>();
@ -288,15 +292,16 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
p.StockQty,
p.Qty,
p.Price,
p.Amt
p.Amt,
p.RealityNumber
));
_lst.AddRange(_list.ToArray());
}
if (_listBill != null && _listBill.Count() > 0)
if (_list90Bill != null && _list90Bill.Count() > 0)
{
var _lsAry = _listBill.Select(p => new
WmsSharePartOutPutDetial(
var _lsAry = _list90Bill.Select(p => new
WmsSharePart90OutPutDetial(
GuidGenerator.Create(),
p.WmsBillNum,
p.OrderBillNum,
@ -320,7 +325,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
p.Price,
p.Amt
));
_lstBill.AddRange(_listBill.ToArray());
_lst90Bill.AddRange(_list90Bill.ToArray());
}
}
@ -328,7 +333,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
if (_lst != null && _lst.Count>0)
{
//没有采购订单号
var outPutDetail = await _wmsRepository.Where(p => p.Version == input.Version && p.OrderBillNum == "").ToListAsync();
var outPutDetail = await _wmsRepository.Where(p => p.Version == input.Version && string.IsNullOrEmpty(p.OrderBillNum)).ToListAsync();
var error = from itm1 in outPutDetail
join itm2 in _lst on
@ -371,7 +376,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
p.StockQty,
p.Qty,
p.Price,
p.Amt
p.Amt,p.RealityNumber
)).ToList();
await _wmsRepository.GetDbContext().BulkInsertAsync(_wmslst, new BulkConfig() { BulkCopyTimeout = 0, BatchSize = 10000 });
int _count = _wmsVersionRepository.Count(p => p.Version == input.Version && p.BillNum == _billNoNum);
@ -409,13 +414,13 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
//有采购订单号
//往Set_WmsSharePart90OutPutDetial表中存储
if (_lstBill != null && _lstBill.Count>0)
if (_lst90Bill != null && _lst90Bill.Count>0)
{
//有采购订单号
var outPutDetailBill = await _wmsRepository90.Where(p => p.Version == input.Version && p.OrderBillNum != "").ToListAsync();
var outPutDetailBill = await _wmsRepository90.Where(p => p.Version == input.Version && !string.IsNullOrEmpty(p.OrderBillNum)).ToListAsync();
var error = from itm1 in outPutDetailBill
join itm2 in _lstBill on
join itm2 in _lst90Bill on
new { itm1.MaterialCode, itm1.OrderBillNum }
equals
new { itm2.MaterialCode, itm2.OrderBillNum }
@ -424,7 +429,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
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 queryBill = from itm1 in _lstBill
var queryBill = from itm1 in _lst90Bill
join itm2 in outPutDetailBill on
new { itm1.MaterialCode, itm1.OrderBillNum }
equals
@ -514,23 +519,28 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
[UnitOfWork(false)]
public async Task<bool> WmsSharePartOutPutPass(WmsJitRequestDto input)
{
//if (DateTime.Now.ToString("yyyyMM") != input.AccountDate.ToString("yyyyMM"))
//{
// throw new BusinessException("8989", "填写过账日期应该为当月!");
//}
if (input.Guids != null)
{
List<WmsSharePartOutPutDetial> _ls = new List<WmsSharePartOutPutDetial>();
if (input.Guids.Count() > 0)
{
_ls = await _wmsRepository.Where(p => input.Guids.Contains(p.Id) && p.Version == input.Version && p.BillNum == input.BillNum && p.State != 2).ToListAsync();
_ls = await _wmsRepository.Where(p => input.Guids.Contains(p.Id) && p.Version == input.Version && p.BillNum == input.BillNum && p.State != 2 && p.State!=4).ToListAsync();
}
else
{
_ls = await _wmsRepository.Where(p => p.Version == input.Version && p.BillNum == input.BillNum && p.State != 2).ToListAsync();
_ls = await _wmsRepository.Where(p => p.Version == input.Version && p.BillNum == input.BillNum && p.State != 2 && p.State!=4).ToListAsync();
}
if (_ls.Count() > 0)
{
var sql = "DECLARE @return_value int\n" +
"EXEC @return_value = [dbo].[p_wms_output]\n" +
" @billnum = N'{0}',\n" +
" @type = 10,\n" +
" @type = 2,\n" +
" @date = N'{1}'\n" +
"SELECT 'Return Value' = @return_value";
await _wmsRepository.GetDbContext().Database.ExecuteSqlRawAsync(
@ -569,6 +579,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
/// <returns></returns>
[HttpPost]
[Route("WmsSharePartOutPut-Cancel")]
[UnitOfWork(false)]
public async Task<bool> WmsSharePartOutPutCancel(WmsJitRequestDto input)
{
//没有有采购单据号的单子
@ -631,26 +642,59 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
return true;
}
/// <summary>
/// 出库单导入功能
/// </summary>
/// <param name="files"></param>
/// <param name="version"></param>
/// <returns></returns>
[HttpPost]
[Route("ExcelImport")]
[DisableRequestSizeLimit]
//[Authorize(SettleAccountPermissions.SettleAccounts.Default)]
public async Task<string> ExcelImport([FromForm] IFormFileCollection files, string version)
{
var checkList = new List<ErrorExportDto>();
ExportImporter _exportImporter = new ExportImporter();
var result = await _exportImporter.ExtendExcelOfSheetOneImport<WmsSharePartOutPutDetial>(files, _excelImportService);
var result_org = await _exportImporter.ExtendExcelOfSheetOneImport<WmsSharePartOutPutDetial>(files, _excelImportService);
//过滤掉隐藏的空白行20220527
var result = result_org.Where(p => !string.IsNullOrEmpty(p.MaterialCode)).ToList();
//检验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);
}
if (result == null)
//检验2:导入模板中的结算数据是否为0
foreach (var itm in result)
{
throw new BusinessException("导入的模板中没有数据,不能为空,请检查!");
if (itm.Qty == 0)
{
checkList.Add(new ErrorExportDto(version, "大众备件出库单导入", string.Empty, string.Empty, string.Empty, string.Empty, string.Format("导入模板中物料号{0}结算数量为0,影响出库请检查!", itm.MaterialCode), string.Empty));
}
}
//和物料主数据中SAP物料号检验是否存在
foreach (var itm in result)
{
if (!_erpdapperRepository.GetMaterialList().Any(p => p.MaterialCode == itm.MaterialCode))
{
checkList.Add(new ErrorExportDto(version, "大众备件出库单导入", string.Empty, string.Empty, itm.MaterialCode, string.Empty, string.Format("物料主数据不存在当前导入的物料号{0}!", itm.MaterialCode), string.Empty));
}
}
if (checkList.Count > 0)
{
return await ExportErrorReportAsync(checkList);
}
var result90 = await _exportImporter.ExtendExcelOfSheetOneImport<WmsSharePart90OutPutDetial>(files, _excelImportService);
var result_nobill = result.Where(p => p.OrderBillNum == "").ToList();
var result_withbill = result90.Where(p => p.OrderBillNum != "").ToList();
var result_nobill = result.Where(p =>string.IsNullOrEmpty(p.OrderBillNum)).ToList();//没有采购单号集合
var result_withbill = result90.Where(p =>!string.IsNullOrEmpty(p.OrderBillNum)).ToList();//有采购单号集合
//没有采购单号
@ -660,7 +704,8 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
List<WmsSharePartOutPutDetial> _lst = new List<WmsSharePartOutPutDetial>();
var _lsCopy = new List<WmsSharePartOutPutDetial>();
foreach (var itm in result_nobill)
var result_nobill_filter = result_nobill.Where(p => string.IsNullOrEmpty(p.OrderBillNum) && !string.IsNullOrEmpty(p.MaterialCode));
foreach (var itm in result_nobill_filter)
{
WmsSharePartOutPutDetial _detail = new WmsSharePartOutPutDetial(
GuidGenerator.Create(),
@ -683,12 +728,26 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
, 0
, itm.Qty
, itm.Price
, itm.Amt
, itm.Amt,itm.RealityNumber
);
_lsCopy.Add(_detail);
}
_lst.AddRange(_lsCopy.ToArray());
//检验3:导入模板中的SAP编号不能重复,按其汇总出库
var _isRepeatOfReportList = _lst.GroupBy(x => new { x.MaterialCode, x.Version }).Select(p => new { Count = p.Count(), MaterialCode = p.Key.MaterialCode });
foreach (var itm in _isRepeatOfReportList)
{
if (itm.Count > 1)
{
checkList.Add(new ErrorExportDto(version, "大众备件出库单导入", string.Empty, string.Empty, string.Empty, string.Empty, string.Format("导入模板中的物料编码{0}有重复!", itm.MaterialCode), string.Empty));
}
}
if (checkList.Count > 0)
{
return await ExportErrorReportAsync(checkList);
}
//var _ls1 = _lst.Where(p => p.ParentMaterialCode == p.MaterialCode).ToList();
var outPutDetail = await _wmsRepository.Where(p => p.Version == version).ToListAsync();
@ -701,7 +760,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
var errList = error.GroupBy(p => new { p.BillNum }).Select(p => new { BillNum = p.Key.BillNum, Number = p.Sum(itm => itm.Qty) });
var checkList = new List<ErrorExportDto>();
foreach (var itm in errList)
{
checkList.Add(new ErrorExportDto() { Message = string.Format("出库单号:{0}重复记录数:{1}条", itm.BillNum, itm.Number) });
@ -741,7 +800,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
List<WmsSharePart90OutPutDetial> _lst = new List<WmsSharePart90OutPutDetial>();
var _lsCopy = new List<WmsSharePart90OutPutDetial>();
var filte_result_withbill = result_withbill.Where(p => p.OrderBillNum != "");//采购单号为空的过滤掉
var filte_result_withbill = result_withbill.Where(p =>!string.IsNullOrEmpty(p.OrderBillNum));//采购单号为空的过滤掉
foreach (var itm in filte_result_withbill)
{
WmsSharePart90OutPutDetial _detail = new WmsSharePart90OutPutDetial(
@ -771,6 +830,21 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
}
_lst.AddRange(_lsCopy.ToArray());
//检验3:导入模板中的订单号+物料号不能重复
var _isRepeatOfReportList = _lst.GroupBy(x => new { x.MaterialCode,x.OrderBillNum, x.Version }).Select(p => new { Count = p.Count(), MaterialCode = p.Key.MaterialCode, OrderBillNum =p.Key.OrderBillNum});
foreach (var itm in _isRepeatOfReportList)
{
if (itm.Count > 1)
{
checkList.Add(new ErrorExportDto(version, "大众备件出库单导入", string.Empty, string.Empty, string.Empty, string.Empty, string.Format("导入模板中订单号{0}组合物料号{1}有重复,请检查!!",itm.OrderBillNum, itm.MaterialCode), string.Empty));
}
}
if (checkList.Count > 0)
{
return await ExportErrorReportAsync(checkList);
}
var outPutDetail = await _wmsRepository90.Where(p => p.Version == version).ToListAsync();
@ -784,7 +858,6 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
var errList = error.GroupBy(p => new { p.BillNum }).Select(p => new { BillNum = p.Key.BillNum, Number = p.Sum(itm => itm.Qty) });
var checkList = new List<ErrorExportDto>();
foreach (var itm in errList)
{
checkList.Add(new ErrorExportDto() { Message = string.Format("出库单号:{0}重复记录数:{1}条", itm.BillNum, itm.Number) });

231
src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsDetailCancelInterface.cs

@ -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;
}
}
}

49
src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsDetailUnInterface.cs

@ -2,7 +2,9 @@
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;
@ -28,6 +30,10 @@ using Win.Sfs.Shared.Filter;
namespace Win.Sfs.SettleAccount.Entities.WMS
{
/// <summary>
/// 出库差异清单
/// </summary>
[Authorize(SettleAccountPermissions.WMSJIT.Default)]
[Route("api/settleaccount/WMSOutputDetailDiffReport")]
public class WMSOutputDetailDiffReportAppService :
SettleAccountApplicationBase<WmsDetailDiffReport>
@ -115,6 +121,16 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
virtual public async Task<PagedResultDto<WmsDetailDiffReport>> 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);
@ -130,8 +146,29 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
[HttpPost]
[Route("ModifyTaskState")]
public virtual async Task<bool> SyncInterface()
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_modify]\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;
}
@ -160,6 +197,16 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
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<WmsDetailDiffReport>, List<WmsDetailDiffReportDto>>(entities);

69
src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsHQCarAppService.cs

@ -11,6 +11,7 @@ using System.Collections.Generic;
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;
@ -313,16 +314,21 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
[UnitOfWork(false)]
public async Task<bool> WmsSharePartOutPutPass(WmsJitRequestDto input)
{
//if (DateTime.Now.ToString("yyyyMM") != input.AccountDate.ToString("yyyyMM"))
//{
// throw new BusinessException("8989", "填写过账日期应该为当月!");
//}
if (input.Guids != null)
{
List<WmsHQCarOutPutDetial> _ls = new List<WmsHQCarOutPutDetial>();
if (input.Guids.Count() > 0)
{
_ls = await _wmsRepository.Where(p => input.Guids.Contains(p.Id) && p.Version == input.Version && p.BillNum == input.BillNum && p.State != 2).ToListAsync();
_ls = await _wmsRepository.Where(p => input.Guids.Contains(p.Id) && p.Version == input.Version && p.BillNum == input.BillNum && p.State != 2 && p.State!=4).ToListAsync();
}
else
{
_ls = await _wmsRepository.Where(p => p.Version == input.Version && p.BillNum == input.BillNum && p.State != 2).ToListAsync();
_ls = await _wmsRepository.Where(p => p.Version == input.Version && p.BillNum == input.BillNum && p.State != 2 && p.State!=4).ToListAsync();
}
if (_ls.Count() > 0)
{
@ -377,6 +383,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
/// <returns></returns>
[HttpPost]
[Route("WmsSharePartOutPut-Cancel")]
[UnitOfWork(false)]
public async Task<bool> WmsSharePartOutPutCancel(WmsJitRequestDto input)
{
if (input.Guids != null && input.Guids.Count() > 0)
@ -411,8 +418,29 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
public async Task<string> ExcelImport([FromForm] IFormFileCollection files, string version)
{
var _billNum = "BCar" + DateTime.Now.ToString("yyyyMMddhhmmss");
var checkList = new List<ErrorExportDto>();
ExportImporter _exportImporter = new ExportImporter();
var result = await _exportImporter.ExtendExcelOfSheetOneImport<WmsHQCarOutPutDetial>(files, _excelImportService);
var result_org = await _exportImporter.ExtendExcelOfSheetOneImport<WmsHQCarOutPutDetial>(files, _excelImportService);
//过滤掉物料号为空的数据
var result = result_org.Where(p => !string.IsNullOrEmpty(p.MaterialCode));
//检验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);
}
//检验2:导入模板中的结算数据是否为0
foreach (var itm in result)
{
if (itm.Qty == 0)
{
checkList.Add(new ErrorExportDto(version, "轿车出库单导入", string.Empty, string.Empty, string.Empty, string.Empty, string.Format("导入模板中SAP编码{0}结算数量为0,影响出库请检查!", itm.MaterialCode), string.Empty));
}
}
List<WmsHQCarOutPutDetial> _lst = new List<WmsHQCarOutPutDetial>();
var _lsCopy = new List<WmsHQCarOutPutDetial>();
@ -446,8 +474,23 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
}
_lst.AddRange(_lsCopy.ToArray());
//检验3:导入模板中的SAP编号不能重复,按其汇总出库
var _isRepeatOfReportList = _lst.GroupBy(x => new { x.MaterialCode, x.Version }).Select(p => new { Count = p.Count(), MaterialCode = p.Key.MaterialCode });
foreach (var itm in _isRepeatOfReportList)
{
if (itm.Count > 1)
{
checkList.Add(new ErrorExportDto(version, "轿车出库单导入", string.Empty, string.Empty, string.Empty, string.Empty, string.Format("导入模板中的SAP编码{0}有重复!", itm.MaterialCode), string.Empty));
}
}
if (checkList.Count > 0)
{
return await ExportErrorReportAsync(checkList);
}
var outPutDetail = await _wmsRepository.Where(p => p.Version == version).ToListAsync();
var outPutDetail = await _wmsRepository.Where(p => p.Version == version && p.State!=4).ToListAsync();
var error = from itm1 in outPutDetail
join itm2 in _lst on
@ -457,11 +500,20 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
select itm1;
var errList = error.GroupBy(p => new { p.BillNum }).Select(p => new { BillNum = p.Key.BillNum, Number = p.Count() });
var checkList = new List<ErrorExportDto>();
//检验4:出库单号不能重复
foreach (var itm in errList)
{
checkList.Add(new ErrorExportDto() { Message = string.Format("出库单号:{0}重复记录数:{1}条", itm.BillNum, itm.Number) });
}
////检验5,SAP编码在数据库中是否重复
//var _isRepeatOfDataBaseList = error.GroupBy(x => new { x.MaterialCode, x.Version }).Select(p => new { Count = p.Count(), MaterialCode = p.Key.MaterialCode });
//foreach (var itm in _isRepeatOfDataBaseList)
//{
// if (itm.Count > 1)
// {
// checkList.Add(new ErrorExportDto(version, "轿车出库单导入", string.Empty, string.Empty, string.Empty, string.Empty, string.Format("当期出库单中的SAP编码{0}在数据库中已经存在!", itm.MaterialCode), string.Empty));
// }
//}
if (checkList.Count > 0)
{
return await ExportErrorReportAsync(checkList);
@ -498,7 +550,12 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
//[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 });
if (!string.IsNullOrEmpty(input.BillNum))
{
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);

98
src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsHQKBOutputAppService.cs

@ -51,7 +51,9 @@ using Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report;
namespace Win.Sfs.SettleAccount.Entities.WMS
{
/// <summary>
/// 红旗一轿手工出库单
/// </summary>
[Route("api/settleaccount/WmsHQKBOutput")]
//[AllowAnonymous]
[Authorize(SettleAccountPermissions.WMSHQ.Default)]
@ -76,6 +78,9 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
private readonly TaskJobService _service;
private readonly WmsDapperRepository _wmsDapper;
private readonly ErpPartDapperRepository _erpdapperRepository;
/// <summary>
///
/// </summary>
@ -96,6 +101,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
IDistributedCache<WmsHQWithOutKanbanOutPutDetial> cache,
ISnowflakeIdGenerator snowflakeIdGenerator,
ICommonManager commonManager,
ErpPartDapperRepository erpdapperRepository,
WmsDapperRepository wmsDapper
) : base(cache, excelImportService, snowflakeIdGenerator, commonManager)
{
@ -107,6 +113,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
_excelImportService = excelImportService;
_dapper = dapper;
_wmsDapper = wmsDapper;
_erpdapperRepository = erpdapperRepository;
}
private async Task<long> GetCountAsync(WmsKanbanOutPutDetialRequestDto input)
@ -226,6 +233,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
}
/// <summary>
/// 选择任务,生成出库单,只包含已确认的单据
/// </summary>
@ -237,7 +245,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
[UnitOfWork(false)]
public async Task<string> WmsKanbanOutPut([FromForm] IFormFileCollection files, string version)
{
var checkList = new List<ErrorExportDto>();
//var _count1 = _wmsVersionRepository.Count(p => p.Version == version);
//if (_count1 > 0)
//{
@ -249,28 +257,82 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
// return await ExportErrorReportAsync(checkList);
// }
//}
var _billNum = "HQKB" + DateTime.Now.ToString("yyyyMMddhhmmss");
//var _list = _dapper.GetNoKanbanSettleDetail(input.Version);
ExportImporter _exportImporter = new ExportImporter();
var _list = await _exportImporter.ExtendExcelOfSheetOneImport<WmsHQWithOutKanbanOutPutDetial>(files, _excelImportService);
var _listOrgin = await _exportImporter.ExtendExcelOfSheetOneImport<WmsHQWithOutKanbanOutPutDetial>(files, _excelImportService);
if (_list == null || _list.Count == 0)
if (_listOrgin == null || _listOrgin.Count == 0)
{
throw new BusinessException("导入模板数据不能为空!");
}
//物料号不能为空,直接过滤掉,模板的中看不到有空行的情况,但是通过个IE这个插件发现有空行数据导入
var _list = _listOrgin.Where(p =>!string.IsNullOrEmpty(p.SapMaterialCode));
var stockList = _wmsDapper.GetSalesStock();
foreach (var itm in _list)
{
if (string.IsNullOrEmpty(itm.IsBack) || string.IsNullOrEmpty(itm.Extend))
{
checkList.Add(new ErrorExportDto(version, "红旗一轿出库单导入", string.Empty, string.Empty, string.Empty, string.Empty, string.Format("导入模板中SAP编码{0}的是否备件及客户号不能为空,影响出库请检查!", itm.SapMaterialCode), string.Empty));
}
}
foreach (var itm in _list)
{
if (itm.IsBack != "是" && itm.IsBack != "否")
{
checkList.Add(new ErrorExportDto(version, "红旗一轿出库单导入", string.Empty, string.Empty, string.Empty, string.Empty, string.Format("导入模板中SAP编码{0}的是否备件请填写是或否,影响出库请检查!", itm.SapMaterialCode), string.Empty));
}
}
//和物料主数据中SAP物料号检验是否存在
foreach (var itm in _list)
{
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));
}
}
if (checkList.Count > 0)
{
return await ExportErrorReportAsync(checkList);
}
//翻译一下是否备件
foreach (var itm in _list)
{
if (itm.IsBack.Trim() == "是")
{
itm.IsBack = "1";
}
else
{
itm.IsBack = "0";
}
}
var getbillName = "HQVSBT";//混合数据
if(_list.FirstOrDefault().Extend== "100113")
{
getbillName = "BT";//一轿
}
else if(_list.FirstOrDefault().Extend == "100053")
{
getbillName = "HQKB";//红旗
}
var _billNum = getbillName + DateTime.Now.ToString("yyyyMMddhhmmss");
var stockList = _wmsDapper.GetSalesStock("PLJS");
var query = from itm in _list
join itm1 in stockList on itm.SapMaterialCode equals itm1.SapCode
into temp1
from tm1 in temp1.DefaultIfEmpty()
select new WmsHQWithOutKanbanOutPutDetial(
GuidGenerator.Create(),
"无看板发货",
"红旗一轿手工出库",
itm.SapMaterialCode,
itm.MaterialDesc,
version,
@ -312,11 +374,11 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
List<WmsHQWithOutKanbanOutPutDetial> _ls = new List<WmsHQWithOutKanbanOutPutDetial>();
if (input.Guids.Count() > 0)
{
_ls = await _wmsRepository.Where(p => input.Guids.Contains(p.Id) && p.Version == input.Version && p.BillNum == input.BillNum && p.State != 2).ToListAsync();
_ls = await _wmsRepository.Where(p => input.Guids.Contains(p.Id) && p.Version == input.Version && p.BillNum == input.BillNum && p.State != 2 && p.State!=4).ToListAsync();
}
else
{
_ls = await _wmsRepository.Where(p => p.Version == input.Version && p.BillNum == input.BillNum && p.State != 2).ToListAsync();
_ls = await _wmsRepository.Where(p => p.Version == input.Version && p.BillNum == input.BillNum && p.State != 2 && p.State!=4).ToListAsync();
}
//_ls = _ls.Where(p => p.SockQty < p.OutputQty || p.Qty < p.OutputQty).ToList();
//var checkList = new List<ErrorExportDto>();
@ -329,6 +391,11 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
//{
// return await ExportErrorReportAsync(checkList,"校验失败.xlsx");
//}
//if (DateTime.Now.ToString("yyyyMM") != input.AccountDate.ToString("yyyyMM"))
//{
// throw new BusinessException("8989", "填写过账日期应该为当月!");
//}
if (_ls.Count() > 0)
@ -355,8 +422,16 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
/// <returns></returns>
[HttpPost]
[Route("WmsKanbanOutPut-Cancel")]
[UnitOfWork(false)]
public async Task<bool> WmsKanbanOutPutCancel(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>();
@ -418,13 +493,14 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
/// 导出
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
/// <returns></returns>7
[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);

11
src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsHQMKanbanAppService.cs

@ -11,6 +11,7 @@ using System.Collections.Generic;
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;
@ -272,6 +273,11 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
[UnitOfWork(false)]
public async Task<bool> WmsHQMKanbanOutPutPass(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" +
@ -297,6 +303,11 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
[Route("WmsHQMKanbanOutPut-Cancel")]
public async Task<bool> WmsHQMKanbanOutPutCancel(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>();

13
src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsHQMSharePartAppService.cs

@ -11,6 +11,7 @@ using System.Collections.Generic;
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;
@ -126,7 +127,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
input.SkipCount, true);
var totalCount = await GetCountAsync(input);
var stockList = _wmsDapper.GetSalesStock();
var stockList = _wmsDapper.GetSalesStock("BJJS");
@ -313,6 +314,11 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
[UnitOfWork(false)]
public async Task<bool> WmsSharePartOutPutPass(WmsJitRequestDto input)
{
if (DateTime.Now.ToString("yyyyMM") != input.AccountDate.ToString("yyyyMM"))
{
throw new BusinessException("8989", "填写过账日期应该为当月!");
}
if (input.Guids != null)
{
List<WmsHQMSharePartOutPutDetial> _ls = new List<WmsHQMSharePartOutPutDetial>();
@ -375,6 +381,11 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
[Route("WmsSharePartOutPut-Cancel")]
public async Task<bool> WmsSharePartOutPutCancel(WmsJitRequestDto input)
{
if (input.Guids != null && input.Guids.Count() > 0)
{
List<string> _ls = new List<string>();

34
src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsOneTimeSaleOutputAppService.cs

@ -50,6 +50,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
private readonly TaskJobService _service;
private readonly WmsDapperRepository _wmsDapper;
private readonly ErpPartDapperRepository _erpdapperRepository;
/// <summary>
///
/// </summary>
@ -70,6 +71,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
IDistributedCache<WmsOneTimeSaleOutPutDetial> cache,
ISnowflakeIdGenerator snowflakeIdGenerator,
ICommonManager commonManager,
ErpPartDapperRepository erpdapperRepository,
WmsDapperRepository wmsDapper
) : base(cache, excelImportService, snowflakeIdGenerator, commonManager)
{
@ -81,6 +83,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
_excelImportService = excelImportService;
_dapper = dapper;
_wmsDapper = wmsDapper;
_erpdapperRepository = erpdapperRepository;
}
private async Task<long> GetCountAsync(WmsOneTimeSaleOutPutDetialRequestDto input)
@ -211,7 +214,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
[UnitOfWork(false)]
public async Task<string> WmsKanbanOutPut([FromForm] IFormFileCollection files, string version)
{
var checkList = new List<ErrorExportDto>();
var _billNum = "OTS" + DateTime.Now.ToString("yyyyMMddhhmmss");
@ -219,11 +222,29 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
ExportImporter _exportImporter = new ExportImporter();
//只取导入模板第一个页签
var _list = await _exportImporter.ExtendExcelOfSheetOneImport<WmsOneTimeSaleOutPutDetial>(files, _excelImportService);
var _list_org = await _exportImporter.ExtendExcelOfSheetOneImport<WmsOneTimeSaleOutPutDetial>(files, _excelImportService);
// 根据物料号是否为空,过滤EXCEL自带的空行
var _list = _list_org.Where(p => !string.IsNullOrEmpty(p.SapMaterialCode));
if (_list == null || _list.Count == 0)
//检验1:导入模板中的第一页签数据不能为空
if (_list == null || _list.Count() == 0)
{
throw new BusinessException("导入模板数据不能为空!");
checkList.Add(new ErrorExportDto(version, "一次性寄售销售导入", string.Empty, string.Empty, string.Empty, string.Empty, "导入模板中第一页签没有数据,请检查!", string.Empty));
}
//和物料主数据中SAP物料号检验是否存在
foreach (var itm in _list)
{
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));
}
}
if (checkList.Count > 0)
{
return await ExportErrorReportAsync(checkList);
}
////插入数据前检验
@ -288,11 +309,11 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
List<WmsOneTimeSaleOutPutDetial> _ls = new List<WmsOneTimeSaleOutPutDetial>();
if (input.Guids.Count() > 0)
{
_ls = await _wmsRepository.Where(p => input.Guids.Contains(p.Id) && p.Version == input.Version && p.BillNum == input.BillNum && p.State != 2).ToListAsync();
_ls = await _wmsRepository.Where(p => input.Guids.Contains(p.Id) && p.Version == input.Version && p.BillNum == input.BillNum && p.State != 2 && p.State!=4).ToListAsync();
}
else
{
_ls = await _wmsRepository.Where(p => p.Version == input.Version && p.BillNum == input.BillNum && p.State != 2).ToListAsync();
_ls = await _wmsRepository.Where(p => p.Version == input.Version && p.BillNum == input.BillNum && p.State != 2 && p.State != 4).ToListAsync();
}
//_ls = _ls.Where(p => p.SockQty < p.OutputQty || p.Qty < p.OutputQty).ToList();
//var checkList = new List<ErrorExportDto>();
@ -331,6 +352,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
/// <returns></returns>
[HttpPost]
[Route("WmsKanbanOutPut-Cancel")]
[UnitOfWork(false)]
public async Task<bool> WmsKanbanOutPutCancel(WmsJitRequestDto input)
{
if (input.Guids != null && input.Guids.Count() > 0)

268
src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsUnInterface.cs

@ -2,6 +2,7 @@
using EFCore.BulkExtensions;
using Magicodes.ExporterAndImporter.Core;
using Magicodes.ExporterAndImporter.Excel;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Shouldly;
using System;
@ -21,6 +22,7 @@ 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.ExportReports;
using Win.Sfs.SettleAccount.Reports;
using Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report;
using Win.Sfs.Shared.DomainBase;
@ -28,6 +30,7 @@ using Win.Sfs.Shared.Filter;
namespace Win.Sfs.SettleAccount.Entities.WMS
{
[Authorize(SettleAccountPermissions.WMSJIT.Default)]
[Route("api/settleaccount/WMSOutputSumReport")]
public class WMSOutputSumReportAppService :
SettleAccountApplicationBase<WmsDetailReport>
@ -66,52 +69,97 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
[UnitOfWork(false)]
public async Task<string> ReportMake(string version)
{
var _ls= _dapper.GetWmsSumExtendList(version);//报表
var _ls= _dapper.GetWmsSumExtendList(version);//报表
var _count= _wmsRepository.Count(p => p.Version == version && p.State>0);
if (_count > 0)
{
throw new BusinessException("8899", "不能重新生成此版本!");
var _query= _wmsRepository.Where(p => p.State == 0 && p.Version == version);
_wmsRepository.GetDbContext().BulkDelete(_query.ToList());
await _query.BatchDeleteAsync();
var _query1= _wmsRepository.Where(p => p.Version == version);
var _existLst = _query1.ToList();
var _diffls = from itm1 in _ls
join itm2 in _existLst
on new { BillNum=itm1., MaterialCode=itm1., Pric=itm1. }
equals new { BillNum = itm2.BillNum, MaterialCode = itm2.MaterialCode, Pric = itm2.Price } into temp1
from tm1 in temp1.DefaultIfEmpty() where tm1 is null
select itm1;
var _difflst=_diffls.ToList();
List<WmsDetailReport> _lst = new List<WmsDetailReport>();
if (_difflst != null && _difflst.Count() > 0)
{
foreach (var itm in _difflst)
{
_lst.Add(new WmsDetailReport(Guid.NewGuid(),
int.Parse(itm.),
itm.,
itm.,
itm.,
itm.,
itm.,
itm.,
itm.,
String.Empty,
itm.,
itm.,
itm.,
itm.,
itm.,
itm.,
itm.WMS待出库金额,
itm.,
itm.,
itm.,
String.Empty,
0,
version,
DateTime.MaxValue
));
}
}
await _wmsRepository.GetDbContext().BulkInsertAsync(_lst);
}
else
{
var query = _wmsRepository.Where(p => p.Version == version);
_wmsRepository.GetDbContext().BulkDelete(query.ToList());
await query.BatchDeleteAsync();
}
List<WmsDetailReport> _lst = new List<WmsDetailReport>();
if (_ls != null && _ls.Count() > 0)
{
foreach (var itm in _ls)
List<WmsDetailReport> _lst = new List<WmsDetailReport>();
if (_ls != null && _ls.Count() > 0)
{
_lst.Add(new WmsDetailReport(Guid.NewGuid(),
int.Parse(itm.),
itm.,
itm.,
itm.,
itm.,
itm.,
itm.,
itm.,
String.Empty,
itm.,
itm.,
itm.,
itm.,
itm.,
itm.,
itm.WMS待出库金额,
itm.,
itm.,
itm.,
String.Empty,
0,
version,
DateTime.MaxValue
));
foreach (var itm in _ls)
{
_lst.Add(new WmsDetailReport(Guid.NewGuid(),
int.Parse(itm.),
itm.,
itm.,
itm.,
itm.,
itm.,
itm.,
itm.,
String.Empty,
itm.,
itm.,
itm.,
itm.,
itm.,
itm.,
itm.WMS待出库金额,
itm.,
itm.,
itm.,
String.Empty,
0,
version,
DateTime.MaxValue
));
}
}
}
await _wmsRepository.GetDbContext().BulkInsertAsync(_lst);
await _wmsRepository.GetDbContext().BulkInsertAsync(_lst);
}
return ApplicationConsts.SuccessStr;
}
/// <summary>
@ -124,7 +172,32 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
virtual public async Task<PagedResultDto<WmsDetailReport>> GetListAsync(WmsRequestDetailReportDto input)
{
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 });
}
if (!string.IsNullOrEmpty(input.MaterialGroup))
{
input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "MaterialGroup", Logic = EnumFilterLogic.And, Value = input.MaterialGroup });
}
if (!string.IsNullOrEmpty(input.BillNum))
{
input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "BillNum", Logic = EnumFilterLogic.And, Value = input.BillNum });
}
if (input.State!=4)
{
input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "State", Logic = EnumFilterLogic.And, Value = input.State.ToString() });
}
input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "Version", Logic = EnumFilterLogic.And, Value = input.Version });
var entities = await _wmsRepository.GetListByFilterAsync(GuidGenerator.Create(), input.Filters, input.Sorting, input.MaxResultCount,
input.SkipCount, true);
var totalCount = await GetCountAsync(input);
@ -150,6 +223,29 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
private async Task<long> GetCountAsync(WmsRequestDetailReportDto input)
{
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 });
}
if (!string.IsNullOrEmpty(input.MaterialGroup))
{
input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "MaterialGroup", Logic = EnumFilterLogic.And, Value = input.MaterialGroup });
}
if (!string.IsNullOrEmpty(input.BillNum))
{
input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "BillNum", Logic = EnumFilterLogic.And, Value = input.BillNum });
}
if (input.State != 4)
{
input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "State", Logic = EnumFilterLogic.And, Value = input.State.ToString() });
}
input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "Version", Logic = EnumFilterLogic.And, Value = input.Version });
// input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "BillNum", Logic = EnumFilterLogic.And, Value = input.BillNum });
return await _wmsRepository.GetCountByFilterAsync(GuidGenerator.Create(), input.Filters);
@ -159,12 +255,82 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
[HttpPost]
[Route("SyncSap")]
[UnitOfWork(false)]
virtual public async Task<bool> OutputAsync(WmsRequestDetailReportDto input)
virtual public async Task<string> OutputAsync(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 });
}
if (!string.IsNullOrEmpty(input.MaterialGroup))
{
input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "MaterialGroup", Logic = EnumFilterLogic.And, Value = input.MaterialGroup });
}
if (!string.IsNullOrEmpty(input.BillNum))
{
input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "BillNum", Logic = EnumFilterLogic.And, Value = input.BillNum });
}
//if (!string.IsNullOrEmpty(input.))
//{
// input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "MaterialGroup", Logic = EnumFilterLogic.And, Value = input.BillNum });
//}
input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "Version", Logic = EnumFilterLogic.And, Value = input.Version });//不能跨区间出库
var entities = await _wmsRepository.GetListByFilterAsync(GuidGenerator.Create(), input.Filters, input.Sorting, int.MaxValue,
0, true);
var checkList = new List<ErrorExportDto>();
var en1= entities.Where(p => p.OutputQty == 0).ToList();
foreach(var itm in en1)
{
checkList.Add(new ErrorExportDto() { Message = string.Format("结算号:{0}物料号:{1}实际出库数量为0不能同步Sap", itm.BillNum, itm.MaterialCode) });
}
var en2=entities.Where(p => p.OutputQty != p.Qty && p.OutputQty>0).ToList();
foreach (var itm in en2)
{
checkList.Add(new ErrorExportDto() { Message = string.Format("结算号:{0}物料号:{1}实际出库数量不等于结算数量不能同步Sap", itm.BillNum, itm.MaterialCode) });
}
var _count = entities.Count(p => p.State==2);
if (_count > 1)
{
throw new BusinessException("8989", "记录中有已经完成记录!");
}
if (checkList.Count > 0)
{
return await ExportErrorReportAsync(checkList);
}
int lineNumber = 1;
foreach (var itm in entities)
{
itm.LineNumber = lineNumber;
itm.State = 2;
lineNumber++;
}
await _wmsRepository.GetDbContext().BulkUpdateAsync(entities);
// var count = entities.GroupBy(p => new { p.Type, p.ClientCode }).Count();
//if (count > 1)
// {
// throw new BusinessException("8989", "记录不在同一物料组车型、出库类型、客户编码");
// return false;
// }
List<WmsDetailReport> _ls = new List<WmsDetailReport>();
if (entities.Count() > 0)
{
@ -176,17 +342,41 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
_erpDapper.InsertWmsSum(entities, _version, _accountDate);
}
}
return true;
return ApplicationConsts.SuccessStr;
}
[HttpPost]
[Route("Export")]
virtual public async Task<string> ExportAsync(WmsRequestDetailReportDto input)
{
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 });
}
if (!string.IsNullOrEmpty(input.MaterialGroup))
{
input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "MaterialGroup", Logic = EnumFilterLogic.And, Value = input.MaterialGroup });
}
if (!string.IsNullOrEmpty(input.BillNum))
{
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 = "Version", Logic = EnumFilterLogic.And, Value = input.Version });
var entities = await _wmsRepository.GetListByFilterAsync(GuidGenerator.Create(), input.Filters, input.Sorting, int.MaxValue,
0, true);
var dtoDetails = ObjectMapper.Map<List<WmsDetailReport>, List<WmsDetailReportDto>>(entities);
dtoDetails= dtoDetails.OrderBy( p => p.Type ).ThenBy(p=> p.BillNum).ToList();
IExporter _excel = new ExcelExporter();
byte[] result = null;
var _fileName = string.Format("汇总合计报表_{0}.xlsx", Guid.NewGuid().ToString());

96
src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsUnSumInterface.cs

@ -1,6 +1,7 @@
using EFCore.BulkExtensions;
using Magicodes.ExporterAndImporter.Core;
using Magicodes.ExporterAndImporter.Excel;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Shouldly;
using System;
@ -23,6 +24,10 @@ using Win.Sfs.Shared.Filter;
namespace Win.Sfs.SettleAccount.Entities.WMS
{
/// <summary>
/// 已结算出库查询
/// </summary>
[Authorize(SettleAccountPermissions.WMSJIT.Default)]
[Route("api/settleaccount/WMSOutputDetailWithCodeReport")]
public class WMSOutputDetailWithCodeReportAppService :
SettleAccountApplicationBase<WmsDetailWithCodeReport>
@ -56,24 +61,26 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
}
[HttpGet]
[HttpPost]
[Route("Make")]
[UnitOfWork(false)]
public async Task<string> ReportMake(string version, DateTime accountDate)
public async Task<string> ReportMake(WmsDetailWithCodeDto input)
{
//先删除
await _wmsRepository.BatchDeleteAsync();
//有条码的业务(可根据条码/K号/底盘号,查询是否结算过,结算期间)
var _ls = _dapper.GetWmsSearchWithCodeReportList(version, "0");
var _ls = _dapper.GetWmsSearchWithCodeReportList(input.cnumber, input.materialCode);
//var _count = _wmsRepository.Count(p =>p.State > 0);
//if (_count > 0)
//{
// throw new BusinessException("8899", "状态大于0不能生成!");
//}
//else
//{
// await _wmsRepository.BatchDeleteAsync();
//}
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<WmsDetailWithCodeReport> _lst = new List<WmsDetailWithCodeReport>();
if (_ls != null && _ls.Count() > 0)
{
@ -83,7 +90,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
Guid.NewGuid(),
itm.,
itm.,
version,
string.Empty,
itm.,
itm.,
itm.,
@ -94,7 +101,31 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
itm.,
itm.,
itm.,
0));
0,
itm.,
itm.,
itm.,
itm.
));
}
}
//get方法
//if (!string.IsNullOrEmpty(input.materialCode))
//{
// var _org_groupList = input.materialCode.Split(new char[] { '\n' }).Distinct().ToList();
// var _groupList = _org_groupList[0].Replace("\\n", ",").TrimEnd(',');
// if (_groupList.Count() > 0)
// {
// _lst = _lst.Where(p => _groupList.Contains(p.MaterialCode)).ToList();
// }
//}
//post方式
if (!string.IsNullOrEmpty(input.materialCode))
{
var _groupList = input.materialCode.Split(new char[] { '\n' }).Distinct().ToList();
if (_groupList.Count() > 0)
{
_lst = _lst.Where(p => _groupList.Contains(p.MaterialCode)).ToList();
}
}
await _wmsRepository.GetDbContext().BulkInsertAsync(_lst);
@ -110,19 +141,34 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
virtual public async Task<PagedResultDto<WmsDetailWithCodeReport>> GetListAsync(WmsRequestDetailReportDto input)
{
input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "Version", Logic = EnumFilterLogic.And, Value = input.Version });
//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<WmsDetailWithCodeReport>(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);
}
//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")]
@ -136,13 +182,23 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
[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 });
//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<WmsDetailWithCodeReport>, List<WmsDetailWithCodeReportDto>>(entities);
IExporter _excel = new ExcelExporter();
byte[] result = null;
var _fileName = string.Format("差异清单(有条码)报表_{0}.xlsx", Guid.NewGuid().ToString());
var _fileName = string.Format("已结算出库查询_{0}.xlsx", Guid.NewGuid().ToString());
result = await _excel.ExportAsByteArray(dtoDetails);
result.ShouldNotBeNull();
//保存导出文件到服务器存成二进制

339
src/Modules/SettleAccount/src/SettleAccount.Application/Reports/ReportServices/ReportMakeService.cs

@ -35,7 +35,7 @@ using Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report;
namespace Win.Sfs.SettleAccount.Reports.ReportServices
{
[Authorize(SettleAccountPermissions.Reports.Default)]
//[AllowAnonymous]
[Route("api/settleaccount/ReportMakeService")]
public class ReportService : ApplicationService
{
@ -141,9 +141,8 @@ namespace Win.Sfs.SettleAccount.Reports.ReportServices
customConditionList.Add(new CustomCondition() { Name = "ProjectName", Value = "有条码看板结算核对" });
customConditionList.Add(new CustomCondition() { Name = "Kanban", Value = input.KanBan ?? string.Empty });
customConditionList.Add(new CustomCondition() { Name = "SapMaterialCode", Value = input.SapMaterialCode ?? string.Empty });
customConditionList.Add(new CustomCondition() { Name = "BegingTime", Value = input.Begin.ToString() });
customConditionList.Add(new CustomCondition() { Name = "EndTime", Value = input.End.ToString() });
customConditionList.Add(new CustomCondition() { Name = "BegingTime", Value = input.Begin ?? string.Empty });
customConditionList.Add(new CustomCondition() { Name = "EndTime", Value = input.End ?? string.Empty });
var _taskid = await _service.ExportEnqueueAsync("看板结算输出", ExportExtentsion.Excel,input.Version ,string.Empty,CurrentUser, typeof(SettleKBWithCodeExportService), customConditionList, (rs) =>
{
});
@ -165,9 +164,8 @@ namespace Win.Sfs.SettleAccount.Reports.ReportServices
customConditionList.Add(new CustomCondition() { Name = "ProjectName", Value = "有条码看板结算核对" });
customConditionList.Add(new CustomCondition() { Name = "Kanban", Value = input.KanBan ?? string.Empty });
customConditionList.Add(new CustomCondition() { Name = "SapMaterialCode", Value = input.SapMaterialCode ?? string.Empty });
customConditionList.Add(new CustomCondition() { Name = "BegingTime", Value = input.Begin.ToString() });
customConditionList.Add(new CustomCondition() { Name = "EndTime", Value = input.End.ToString() });
customConditionList.Add(new CustomCondition() { Name = "BegingTime", Value = input.Begin ?? string.Empty });
customConditionList.Add(new CustomCondition() { Name = "EndTime", Value = input.End ?? string.Empty });
var _taskid = await _service.ExportEnqueueAsync("无条码看板结算输出", ExportExtentsion.Excel, input.Version,string.Empty, CurrentUser, typeof(SettleKBWithOutCodeExportService), customConditionList, (rs) =>
{
});
@ -176,7 +174,7 @@ namespace Win.Sfs.SettleAccount.Reports.ReportServices
#region 大众备件0-90天和90天以上输出
/// <summary>
/// 大众备件0-90天报表输出
/// 大众备件数据调整结算输出
/// </summary>
/// <param name="purchaseOrderNo"></param>
/// <param name="sapCode"></param>
@ -215,7 +213,7 @@ namespace Win.Sfs.SettleAccount.Reports.ReportServices
}
/// <summary>
/// 大众备件结算核对明细表
/// 大众备件输出(包括带订货单号和无订单号)
/// </summary>
/// <param name="purchaseOrderNo">采购订单号</param>
/// <param name="sapCode">厂内物料号</param>
@ -252,6 +250,45 @@ namespace Win.Sfs.SettleAccount.Reports.ReportServices
});
return _taskid;
}
/// <summary>
/// 大众备件未结明细
/// </summary>
/// <param name="purchaseOrderNo"></param>
/// <param name="sapCode"></param>
/// <param name="version"></param>
/// <param name="customerCode"></param>
/// <param name="factory"></param>
/// <param name="matialCode"></param>
/// <param name="state"></param>
/// <param name="begin"></param>
/// <param name="end"></param>
/// <returns></returns>
[HttpGet]
[Route("UnSettleSparePartExport")]
[DisableRequestSizeLimit]
public async Task<string> UnSettledSparePart(string purchaseOrderNo, string sapCode, string version, string customerCode, string factory, string matialCode,
string state, DateTime begin, DateTime end)
{
List<CustomCondition> customConditionList = new List<CustomCondition>();
customConditionList.Add(new CustomCondition() { Name = "Version", Value = version ?? string.Empty });
customConditionList.Add(new CustomCondition() { Name = "PurchaseOrderNo", Value = purchaseOrderNo ?? string.Empty });
customConditionList.Add(new CustomCondition() { Name = "SAPCode", Value = sapCode ?? string.Empty });
customConditionList.Add(new CustomCondition() { Name = "CustomerCode", Value = customerCode ?? string.Empty });
customConditionList.Add(new CustomCondition() { Name = "State", Value = state ?? "0" });
customConditionList.Add(new CustomCondition() { Name = "MatialCode", Value = matialCode ?? string.Empty });
customConditionList.Add(new CustomCondition() { Name = "ProjectName", Value = "大众备件结算核对" });
customConditionList.Add(new CustomCondition() { Name = "BegingTime", Value = begin.ToString() });
customConditionList.Add(new CustomCondition() { Name = "EndTime", Value = end.ToString() });
var _taskid = await _service.ExportEnqueueAsync("大众备件未结输出", ExportExtentsion.Excel, version, string.Empty, CurrentUser, typeof(SettleUnSparePartExportService), customConditionList, (rs) =>
{
});
return _taskid;
}
#endregion
/// <summary>
/// 无订单备件结算输出
@ -273,7 +310,6 @@ namespace Win.Sfs.SettleAccount.Reports.ReportServices
public async Task<string> SettledSparePartExtend(string purchaseOrderNo, string sapCode, string version, string customerCode, string factory, string matialCode,
string state, DateTime begin, DateTime end)
{
List<CustomCondition> customConditionList = new List<CustomCondition>();
customConditionList.Add(new CustomCondition() { Name = "Version", Value = version ?? string.Empty });
customConditionList.Add(new CustomCondition() { Name = "PurchaseOrderNo", Value = purchaseOrderNo ?? string.Empty });
@ -284,7 +320,6 @@ namespace Win.Sfs.SettleAccount.Reports.ReportServices
customConditionList.Add(new CustomCondition() { Name = "ProjectName", Value = "大众备件结算核对" });
customConditionList.Add(new CustomCondition() { Name = "BegingTime", Value = begin.ToString() });
customConditionList.Add(new CustomCondition() { Name = "EndTime", Value = end.ToString() });
var _taskid = await _service.ExportEnqueueAsync("无订单备件结算输出", ExportExtentsion.Excel, version, string.Empty, CurrentUser, typeof(SettleSparePartExportService), customConditionList, (rs) =>
{
@ -313,39 +348,39 @@ namespace Win.Sfs.SettleAccount.Reports.ReportServices
}
/// <summary>
/// 结算总成和ERP总成价格对比
/// </summary>
/// <param name="files">上传的文件(前端已经限制只能上传一个附件)</param>
/// <returns></returns>
[HttpGet]
[Route("BomDiffPrice-Make")]
[DisableRequestSizeLimit]
///// <summary>
///// 结算总成和ERP总成价格对比
///// </summary>
///// <param name="files">上传的文件(前端已经限制只能上传一个附件)</param>
///// <returns></returns>
//[HttpGet]
//[Route("BomDiffPrice-Make")]
//[DisableRequestSizeLimit]
public async Task<string> SettledPartAndErpPartPriceDiffMake(string version, string customerCode)
{
//public async Task<string> SettledPartAndErpPartPriceDiffMake(string version, string customerCode)
//{
if (!_relationshipRepository.Any(p => p.Version == version && p.CustomerCode == customerCode))
{
throw new BusinessException("8989", string.Format("不存总成与结算件零件关系{0}期间", version));
}
if (!_settlementPartVersionrepository.Any(p => p.Version == version && p.CustomerCode == customerCode))
{
throw new BusinessException("8989", string.Format("不存结算包价格{0}期间", version));
}
// //if (!_relationshipRepository.Any(p => p.Version == version && p.CustomerCode == customerCode))
// //{
// // throw new BusinessException("8989", string.Format("不存总成与结算件零件关系{0}期间", version));
// //}
// //if (!_settlementPartVersionrepository.Any(p => p.Version == version && p.CustomerCode == customerCode))
// //{
// // throw new BusinessException("8989", string.Format("不存结算包价格{0}期间", version));
// //}
List<CustomCondition> customConditionList = new List<CustomCondition>();
// List<CustomCondition> customConditionList = new List<CustomCondition>();
customConditionList.Add(new CustomCondition() { Name = "ProjectName", Value = "Bom定价差异明细" });
customConditionList.Add(new CustomCondition() { Name = "Version", Value = version ?? string.Empty });
customConditionList.Add(new CustomCondition() { Name = "CustomerCode", Value = customerCode });
// customConditionList.Add(new CustomCondition() { Name = "ProjectName", Value = "Bom定价差异明细" });
// customConditionList.Add(new CustomCondition() { Name = "Version", Value = string.IsNullOrEmpty(version) ? string.Empty : version });
// customConditionList.Add(new CustomCondition() { Name = "CustomerCode", Value = string.IsNullOrEmpty(customerCode)?string.Empty: customerCode });
var _taskid = await _service.ExportEnqueueAsync("Bom定价差异明细", ExportExtentsion.Excel, version, string.Empty, CurrentUser, typeof(SettledPartAndErpPartPriceDiffExportService), customConditionList, (rs) =>
{
// var _taskid = await _service.ExportEnqueueAsync("Bom定价差异明细", ExportExtentsion.Excel, version, string.Empty, CurrentUser, typeof(SettledPartAndErpPartPriceDiffExportService), customConditionList, (rs) =>
// {
});
return _taskid;
}
// });
// return _taskid;
//}
@ -396,20 +431,7 @@ namespace Win.Sfs.SettleAccount.Reports.ReportServices
)
{
//if (!_settleAccountVersionrepository.Any(p => p.Version == version))
//{
// throw new BusinessException("8989", string.Format("不存结算{0}期间",version));
//}
//if (!_invoiceVersionRepository.Any(p => p.Version == version))
//{
// throw new BusinessException("8989", string.Format("不存发票{0}期间", version));
//}
List<CustomCondition> customConditionList = new List<CustomCondition>();
customConditionList.Add(new CustomCondition() { Name = "Version", Value = version ?? string.Empty });
customConditionList.Add(new CustomCondition() { Name = "MatialCode", Value = matialCode ?? string.Empty });
@ -685,7 +707,6 @@ namespace Win.Sfs.SettleAccount.Reports.ReportServices
{
List<CustomCondition> customConditionList = new List<CustomCondition>();
customConditionList.Add(new CustomCondition() { Name = "Version", Value = input.Version });
customConditionList.Add(new CustomCondition() { Name = "BeginTime", Value = input.Begin });
customConditionList.Add(new CustomCondition() { Name = "EndTime", Value = input.End });
customConditionList.Add(new CustomCondition() { Name = "MaterialCode", Value = input.MaterialCode });
@ -708,6 +729,7 @@ namespace Win.Sfs.SettleAccount.Reports.ReportServices
[HttpPost]
[Route("HQHSettledDetailDiffExportService")]
[DisableRequestSizeLimit]
[UnitOfWork(false)]
public async Task<string> HQHSettledDetailDiffExportServiceMake(
HQKanbanRequestDto input
)
@ -755,6 +777,7 @@ namespace Win.Sfs.SettleAccount.Reports.ReportServices
customConditionList.Add(new CustomCondition() { Name = "Kanban", Value = input.Kanban });
customConditionList.Add(new CustomCondition() { Name = "MaterialGroup", Value = string.IsNullOrEmpty(input.MaterialGroup) ? string.Empty : input.MaterialGroup });
customConditionList.Add(new CustomCondition() { Name = "SapCode", Value = string.IsNullOrEmpty(input.SapCode) ? string.Empty : input.SapCode });
customConditionList.Add(new CustomCondition() { Name = "IsContainVersion", Value = input.IsContainVersion });
var _taskid = await _service.ExportEnqueueAsync("红旗工厂未结明细", ExportExtentsion.Excel, input.Version, string.IsNullOrEmpty(input.MaterialGroup) ? string.Empty : input.MaterialGroup, CurrentUser, typeof(HQHUnSettledDetailDiffExportService), customConditionList, (rs) =>
{
});
@ -785,6 +808,7 @@ namespace Win.Sfs.SettleAccount.Reports.ReportServices
customConditionList.Add(new CustomCondition() { Name = "Kanban", Value = input.Kanban });
customConditionList.Add(new CustomCondition() { Name = "MaterialGroup", Value = string.IsNullOrEmpty(input.MaterialGroup) ? string.Empty : input.MaterialGroup });
customConditionList.Add(new CustomCondition() { Name = "SapCode", Value = string.IsNullOrEmpty(input.SapCode) ? string.Empty : input.SapCode });
customConditionList.Add(new CustomCondition() { Name = "IsContainVersion", Value = input.IsContainVersion });
var _taskid = await _service.ExportEnqueueAsync("红旗未结核对", ExportExtentsion.Excel, input.Version, string.IsNullOrEmpty(input.MaterialGroup) ? string.Empty : input.MaterialGroup, CurrentUser, typeof(HQFactoryUnSettledDetailDiffExportService), customConditionList, (rs) =>
{
});
@ -820,118 +844,20 @@ namespace Win.Sfs.SettleAccount.Reports.ReportServices
return _taskid;
}
/// <summary>
///红旗F平台核对明细
/// </summary>
/// <param name="files">上传的文件(前端已经限制只能上传一个附件)</param>
/// <returns></returns>
[HttpPost]
[Route("HQFSettledDetailDiffExportService")]
[DisableRequestSizeLimit]
public async Task<string> HQFSettledDetailDiffExportServiceMake(
HQKanbanRequestDto input
)
{
List<CustomCondition> customConditionList = new List<CustomCondition>();
customConditionList.Add(new CustomCondition() { Name = "Version", Value = input.Version });
customConditionList.Add(new CustomCondition() { Name = "MaterialCode", Value = input.MaterialCode });
customConditionList.Add(new CustomCondition() { Name = "BeginTime", Value = input.Begin });
customConditionList.Add(new CustomCondition() { Name = "EndTime", Value = input.End });
customConditionList.Add(new CustomCondition() { Name = "MaterialCode", Value = input.MaterialCode });
customConditionList.Add(new CustomCondition() { Name = "AcceptNo", Value = input.AcceptNo });
customConditionList.Add(new CustomCondition() { Name = "WarehouseDesc", Value = input.WarehouseDesc });
customConditionList.Add(new CustomCondition() { Name = "Kanban", Value = input.Kanban });
customConditionList.Add(new CustomCondition() { Name = "MaterialGroup", Value = string.IsNullOrEmpty(input.MaterialGroup) ? string.Empty : input.MaterialGroup });
customConditionList.Add(new CustomCondition() { Name = "SapCode", Value = string.IsNullOrEmpty(input.SapCode) ? string.Empty : input.SapCode });
var _taskid = await _service.ExportEnqueueAsync("F平台核对明细", ExportExtentsion.Excel, input.Version, string.IsNullOrEmpty(input.MaterialGroup) ? string.Empty : input.MaterialGroup, CurrentUser, typeof(HQFSettledDetailDiffExportService), customConditionList, (rs) =>
{
});
return _taskid;
}
/// <summary>
/// 红旗F平台备件结算出库
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost]
[Route("HQFSharePartSettledDetailDiffExportService")]
[DisableRequestSizeLimit]
public async Task<string> HQFSharePartSettledDetailDiffExportServiceMake(
HQKanbanRequestDto input
)
{
List<CustomCondition> customConditionList = new List<CustomCondition>();
customConditionList.Add(new CustomCondition() { Name = "Version", Value = input.Version });
customConditionList.Add(new CustomCondition() { Name = "BeginTime", Value = input.Begin });
customConditionList.Add(new CustomCondition() { Name = "EndTime", Value = input.End });
customConditionList.Add(new CustomCondition() { Name = "MaterialCode", Value = input.MaterialCode });
customConditionList.Add(new CustomCondition() { Name = "AcceptNo", Value = input.AcceptNo });
customConditionList.Add(new CustomCondition() { Name = "WarehouseDesc", Value = input.WarehouseDesc });
customConditionList.Add(new CustomCondition() { Name = "Kanban", Value = input.Kanban });
customConditionList.Add(new CustomCondition() { Name = "MaterialGroup", Value = string.IsNullOrEmpty(input.MaterialGroup) ? string.Empty : input.MaterialGroup });
customConditionList.Add(new CustomCondition() { Name = "SapCode", Value = string.IsNullOrEmpty(input.SapCode) ? string.Empty : input.SapCode });
var _taskid = await _service.ExportEnqueueAsync("F平台备件核对明细", ExportExtentsion.Excel, input.Version, string.IsNullOrEmpty(input.MaterialGroup) ? string.Empty : input.MaterialGroup, CurrentUser, typeof(HQFSharePartSettledDetailDiffExportService), customConditionList, (rs) =>
{
});
return _taskid;
}
/// <summary>
///红旗M平台核对明细
/// </summary>
/// <param name="files">上传的文件(前端已经限制只能上传一个附件)</param>
/// <returns></returns>
[HttpPost]
[Route("HQMSettledDetailDiffExportService")]
[DisableRequestSizeLimit]
public async Task<string> HQMSettledDetailDiffExportServiceMake(
HQKanbanRequestDto input
)
{
List<CustomCondition> customConditionList = new List<CustomCondition>();
customConditionList.Add(new CustomCondition() { Name = "Version", Value = input.Version });
customConditionList.Add(new CustomCondition() { Name = "MaterialCode", Value = input.MaterialCode });
customConditionList.Add(new CustomCondition() { Name = "BeginTime", Value = input.Begin });
customConditionList.Add(new CustomCondition() { Name = "EndTime", Value = input.End });
customConditionList.Add(new CustomCondition() { Name = "MaterialCode", Value = input.MaterialCode });
customConditionList.Add(new CustomCondition() { Name = "AcceptNo", Value = input.AcceptNo });
customConditionList.Add(new CustomCondition() { Name = "WarehouseDesc", Value = input.WarehouseDesc });
customConditionList.Add(new CustomCondition() { Name = "Kanban", Value = input.Kanban });
customConditionList.Add(new CustomCondition() { Name = "MaterialGroup", Value = string.IsNullOrEmpty(input.MaterialGroup) ? string.Empty : input.MaterialGroup });
customConditionList.Add(new CustomCondition() { Name = "SapCode", Value = string.IsNullOrEmpty(input.SapCode) ? string.Empty : input.SapCode });
var _taskid = await _service.ExportEnqueueAsync("M平台核对明细", ExportExtentsion.Excel, input.Version, string.IsNullOrEmpty(input.MaterialGroup) ? string.Empty : input.MaterialGroup, CurrentUser, typeof(HQMSettledDetailDiffExportService), customConditionList, (rs) =>
{
});
return _taskid;
}
/// <summary>
/// 红旗M平台备件结算出库
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost]
[Route("HQMSharePartSettledDetailDiffExportService")]
[Route("FisUpdateExportService")]
[DisableRequestSizeLimit]
public async Task<string> HQMSharePartSettledDetailDiffExportServiceMake(
HQKanbanRequestDto input
)
[UnitOfWork(isTransactional: false)]
public async Task<string> FisUpdateExportServiceMake(
HQKanbanRequestDto input
)
{
List<CustomCondition> customConditionList = new List<CustomCondition>();
customConditionList.Add(new CustomCondition() { Name = "Version", Value = input.Version });
customConditionList.Add(new CustomCondition() { Name = "BeginTime", Value = input.Begin });
customConditionList.Add(new CustomCondition() { Name = "EndTime", Value = input.End });
customConditionList.Add(new CustomCondition() { Name = "MaterialCode", Value = input.MaterialCode });
customConditionList.Add(new CustomCondition() { Name = "AcceptNo", Value = input.AcceptNo });
customConditionList.Add(new CustomCondition() { Name = "WarehouseDesc", Value = input.WarehouseDesc });
customConditionList.Add(new CustomCondition() { Name = "Kanban", Value = input.Kanban });
customConditionList.Add(new CustomCondition() { Name = "MaterialGroup", Value = string.IsNullOrEmpty(input.MaterialGroup) ? string.Empty : input.MaterialGroup });
customConditionList.Add(new CustomCondition() { Name = "SapCode", Value = string.IsNullOrEmpty(input.SapCode) ? string.Empty : input.SapCode });
var _taskid = await _service.ExportEnqueueAsync("M平台备件核对明细", ExportExtentsion.Excel, input.Version, string.IsNullOrEmpty(input.MaterialGroup) ? string.Empty : input.MaterialGroup, CurrentUser, typeof(HQMSharePartSettledDetailDiffExportService), customConditionList, (rs) =>
var _taskid = await _service.ExportEnqueueAsync("Fis发货数据更新状态", ExportExtentsion.Excel, input.Version, null, CurrentUser, typeof(FisUpdateExportService), customConditionList, (rs) =>
{
});
return _taskid;
@ -940,104 +866,39 @@ namespace Win.Sfs.SettleAccount.Reports.ReportServices
/// <summary>
/// H平台未结明细
/// 结算未结寄售核对表
/// </summary>
/// <param name="input"></param>
/// <param name="files">上传的文件(前端已经限制只能上传一个附件)</param>
/// <returns></returns>
[HttpPost]
[Route("HQHShippingExportService")]
[Route("UnSettledSum-Make")]
[DisableRequestSizeLimit]
public async Task<string> HQHShippingExportServiceMake(
HQKanbanRequestDto input
)
{
List<CustomCondition> customConditionList = new List<CustomCondition>();
customConditionList.Add(new CustomCondition() { Name = "Version", Value = input.Version });
customConditionList.Add(new CustomCondition() { Name = "BeginTime", Value = input.Begin });
customConditionList.Add(new CustomCondition() { Name = "EndTime", Value = input.End });
customConditionList.Add(new CustomCondition() { Name = "MaterialCode", Value = input.MaterialCode });
var _taskid = await _service.ExportEnqueueAsync("H平台发运核对输出", ExportExtentsion.Excel, input.Version, null, CurrentUser, typeof(HQHShippingExportService), customConditionList, (rs) =>
{
});
return _taskid;
}
[UnitOfWork(false)]
public async Task<string> UnSettledSumServiceMake(
/// <summary>
/// F平台未结明细
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost]
[Route("HQHShippingExportService")]
[DisableRequestSizeLimit]
public async Task<string> HQFShippingExportServiceMake(
HQKanbanRequestDto input
)
{
List<CustomCondition> customConditionList = new List<CustomCondition>();
customConditionList.Add(new CustomCondition() { Name = "Version", Value = input.Version });
customConditionList.Add(new CustomCondition() { Name = "BeginTime", Value = input.Begin });
customConditionList.Add(new CustomCondition() { Name = "EndTime", Value = input.End });
var _taskid = await _service.ExportEnqueueAsync("F平台未结明细", ExportExtentsion.Excel, input.Version, null, CurrentUser, typeof(HQFShippingExportService), customConditionList, (rs) =>
{
});
return _taskid;
}
BaseRequestDto input
/// <summary>
/// M平台未明细
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost]
[Route("HQMShippingExportService")]
[DisableRequestSizeLimit]
public async Task<string> HQMShippingExportServiceMake(
HQKanbanRequestDto input
)
{
List<CustomCondition> customConditionList = new List<CustomCondition>();
customConditionList.Add(new CustomCondition() { Name = "Version", Value = input.Version });
customConditionList.Add(new CustomCondition() { Name = "BeginTime", Value = input.Begin });
customConditionList.Add(new CustomCondition() { Name = "EndTime", Value = input.End });
var _taskid = await _service.ExportEnqueueAsync("M平台未明细", ExportExtentsion.Excel, input.Version, null, CurrentUser, typeof(HQMShippingExportService), customConditionList, (rs) =>
{
});
return _taskid;
}
[HttpPost]
[Route("FisUpdateExportService")]
[DisableRequestSizeLimit]
[UnitOfWork(isTransactional: false)]
public async Task<string> FisUpdateExportServiceMake(
HQKanbanRequestDto input
)
{
List<CustomCondition> customConditionList = new List<CustomCondition>();
customConditionList.Add(new CustomCondition() { Name = "Version", Value = input.Version });
customConditionList.Add(new CustomCondition() { Name = "BeginTime", Value = input.Begin });
customConditionList.Add(new CustomCondition() { Name = "EndTime", Value = input.End });
var _taskid = await _service.ExportEnqueueAsync("Fis发货数据更新状态", ExportExtentsion.Excel, input.Version, null, CurrentUser, typeof(FisUpdateExportService), customConditionList, (rs) =>
customConditionList.Add(new CustomCondition() { Name = "Version", Value = !string.IsNullOrEmpty(input.Version) ? input.Version : string.Empty });
customConditionList.Add(new CustomCondition() { Name = "CustomerCode", Value = string.Empty });
customConditionList.Add(new CustomCondition() { Name = "MaterialCode", Value = !string.IsNullOrEmpty(input.MaterialCode) ? input.MaterialCode : string.Empty });
customConditionList.Add(new CustomCondition() { Name = "MaterialGroup", Value = !string.IsNullOrEmpty(input.MaterialGroup) ? input.MaterialGroup : string.Empty });
customConditionList.Add(new CustomCondition() { Name = "SapMaterialCode", Value = string.Empty });
customConditionList.Add(new CustomCondition() { Name = "Begin", Value = string.IsNullOrEmpty(input.Begin) ? string.Empty : input.Begin });
customConditionList.Add(new CustomCondition() { Name = "End", Value = string.IsNullOrEmpty(input.End) ? string.Empty : input.End });
customConditionList.Add(new CustomCondition() { Name = "KennCode", Value = string.IsNullOrEmpty(input.Kenncode) ? string.Empty : input.Kenncode });
customConditionList.Add(new CustomCondition() { Name = "ChassisNumber", Value = string.IsNullOrEmpty(input.ChassisNumber) ? string.Empty : input.ChassisNumber });
customConditionList.Add(new CustomCondition() { Name = "SapCode", Value = string.IsNullOrEmpty(input.SapCode) ? string.Empty : input.SapCode });
var _taskid = await _service.ExportEnqueueAsync("结算未结寄售核对表", ExportExtentsion.Excel, input.Version, string.IsNullOrEmpty(input.MaterialGroup) ? string.Empty : input.MaterialGroup, CurrentUser, typeof(UnSettledSumService), customConditionList, (rs) =>
{
});
return _taskid;
}
#endregion
}

7
src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccount.Application.csproj

@ -107,6 +107,13 @@
<None Remove="Reports\StockSettledDiffReports\**" />
<None Remove="Reports\StockUnsettledDiffReports\**" />
</ItemGroup>
<ItemGroup>
<Compile Remove="Entities\JFCarConsignAppService.cs" />
<Compile Remove="Entities\JFCarKBAppService.cs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="EFCore.BulkExtensions" Version="5.3.0" />

7
src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs

@ -267,7 +267,7 @@ namespace Win.Sfs.SettleAccount
CreateMapWMSOutputSum();
CreateMapWMSDiffOutputSum();
CreateMapWMSWithCodeOutputSum();
CreateMapWMSCacelOutputSum();
#endregion
}
@ -283,6 +283,11 @@ namespace Win.Sfs.SettleAccount
{
CreateMap<WmsDetailDiffReport, WmsDetailDiffReportDto>().ReverseMap();
}
private void CreateMapWMSCacelOutputSum()
{
CreateMap<WmsDetailCancelReport, WmsDetailCancelReportDto>().ReverseMap();
}
/// <summary>
/// 有条码业务

4
src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BT_Car/BT_Car_Platform.cs

@ -57,9 +57,9 @@ namespace Win.Sfs.SettleAccount.Entities.BT_Car
[Display(Name = "工厂")]
public string Factory { get; set; }
/// <summary>
///外部看板编
///外部
/// </summary>
[Display(Name = "外部看板编号")]
[Display(Name = "外部号")]
public string ExternalKanbanNumber { get; set; }
/// <summary>
///看板编号

72
src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/ERPShipping/ERPShippingDetail.cs

@ -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; }
}
}

59
src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/ERPShipping/ERPShippingVersion.cs

@ -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;
}
}
}

52
src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/HQExtend/HQKBExtend.cs

@ -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 ; }
}
}

55
src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/HQExtend/HQKBExtendVersion.cs

@ -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;
}
}
}

52
src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/HQExtend/HQKBSettleExtend.cs

@ -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; }
}
}

55
src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/HQExtend/HQKBSettleExtendVersion.cs

@ -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;
}
}
}

2
src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/HQ_F/HQ_F_Platform.cs

@ -69,7 +69,7 @@ namespace Win.Sfs.SettleAccount.Entities.HQ_F
/// <summary>
///外部看板编号
/// </summary>
[Display(Name = "外部看板编号")]
[Display(Name = "外部号")]
public string ExternalKanbanNumber { get; set; }
/// <summary>
///看板编号

2
src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/HQ_H/HQ_H_Platform.cs

@ -70,7 +70,7 @@ namespace Win.Sfs.SettleAccount.Entities.HQ_H
/// <summary>
///外部看板编号
/// </summary>
[Display(Name = "外部看板编号")]
[Display(Name = "外部号")]
public string ExternalKanbanNumber { get; set; }
/// <summary>
///看板编号

7
src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Materials/Material.cs

@ -37,6 +37,10 @@ namespace Win.Sfs.SettleAccount.Entities.Materials
/// 估价类描述
/// </summary>
public string EstimateTypeDesc { set; get; }
public string CustomerPartCode { set; get; }
public void SetId(Guid id, Guid branchId)
{
@ -63,7 +67,7 @@ namespace Win.Sfs.SettleAccount.Entities.Materials
Guid id,
Guid branchId,
string factory, string materialCode, string materialDesc, string unit, string estimateType, string estimateTypeDesc):base(id)
string factory, string materialCode, string materialDesc, string unit, string estimateType, string estimateTypeDesc) :base(id)
{
BranchId = branchId;
Factory = factory;
@ -72,6 +76,7 @@ namespace Win.Sfs.SettleAccount.Entities.Materials
Unit = unit;
EstimateType = estimateType;
EstimateTypeDesc = estimateTypeDesc;
}
}
}

6
src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/SettledPartAndErpPartPriceDiffs/SettledPartAndErpPartPriceDiff.cs

@ -19,9 +19,9 @@ namespace Win.Sfs.SettleAccount.Reports.SettledPartAndErpPartPriceDiffs
[ExporterHeader(DisplayName = "ERP物料编号")]
public string ErpMaterialCode { set; get; }
[ExporterHeader(DisplayName = "Bom组成价格")]
public decimal Price { set; get; }
[ExporterHeader(DisplayName = "总成定价")]
public decimal Price { set; get; }
[ExporterHeader(DisplayName = "Bom组成价格")]
public decimal SumPrice { get; set; }
[ExporterHeader(DisplayName = "差额")]
public decimal DiffPrice { get; set; }
@ -31,7 +31,7 @@ namespace Win.Sfs.SettleAccount.Reports.SettledPartAndErpPartPriceDiffs
[ExporterHeader(DisplayName = "组成组零件")]
public string ErpMaterialCode {set;get;}
[ExporterHeader(DisplayName = "Sap零件号")]
public string SettleMaterialCode {set;get;}
public string MaterialCode {set;get;}
[ExporterHeader(DisplayName = "客户零件号")]
public string ShipMaterailCode {set;get;}
[ExporterHeader(DisplayName = "物料描述")]

2
src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/UnHQSettleAccounts/UnHQSettleAccount.cs

@ -73,7 +73,7 @@ namespace Win.Sfs.SettleAccount.Entities.UnHQSettleAccounts
/// <summary>
///外部看板编号
/// </summary>
[Display(Name = "外部看板编号")]
[Display(Name = "外部号")]
public string ExternalKanbanNumber { get; set; }
/// <summary>
///看板编号

67
src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/UnSettle/UnSettleDetailReport.cs

@ -17,7 +17,7 @@ namespace Win.Sfs.SettleAccount.Entities.UnSettle
[ExporterHeader(DisplayName = "交货单号 ")]
public override string WmsBillNum { set; get; }
[ExporterHeader(DisplayName = "实际发货日期 ")]
public override DateTime CP5Time { set; get; }
public override string CP5Time { set; get; }
[ExporterHeader(DisplayName = "KENN号")]
public override string KENNCode { set; get; }
[ExporterHeader(DisplayName = "底盘号")]
@ -66,4 +66,69 @@ namespace Win.Sfs.SettleAccount.Entities.UnSettle
}
[ExcelExporter(MaxRowNumberOnASheet = 900000)]
public class UnSettleDetailReport1 : ReportDetailBase
{
[ExporterHeader(DisplayName = "交货单号 ")]
public override string WmsBillNum { set; get; }
[ExporterHeader(DisplayName = "实际发货日期 ")]
public override string CP5Time { set; get; }
[ExporterHeader(DisplayName = "KENN号")]
public override string KENNCode { set; get; }
[ExporterHeader(DisplayName = "底盘号")]
public override string ChassisNumber { set; get; }
[ExporterHeader(DisplayName = "交货状态", IsIgnore = true)]
public override string WmsState { set; get; }
[ExporterHeader(DisplayName = "物料号")]
public override string SapMaterialCode { set; get; }
[ExporterHeader(DisplayName = "物料描述 ")]
public override string MaterialDesc { set; get; }
[ExporterHeader(DisplayName = "客户物料 ")]
public override string MaterialCode { set; get; }
[ExporterHeader(DisplayName = "组件组物料 ")]
public override string ParentSapMaterialCode { set; get; }
[ExporterHeader(DisplayName = "组件组物料描述 ")]
public override string ParentMaterialDesc { set; get; }
[ExporterHeader(DisplayName = "物料组(车型) ")]
public override string MaterialGroup { set; get; }
[ExporterHeader(DisplayName = "定价 ")]
public override decimal Price { set; get; }
[ExporterHeader(DisplayName = "金额 ")]
public override decimal Amt { set; get; }
[ExporterHeader(DisplayName = "结算日期", IsIgnore = true)]
public override DateTime CP7Time { set; get; }
[ExporterHeader(DisplayName = "开票单价", IsIgnore = true)]
public override decimal InvoicePrice { set; get; }
[ExporterHeader(DisplayName = "结算平台未结数量 ")]
public decimal Qty { set; get; }
[ExporterHeader(DisplayName = "大众R3未结数量")]
public decimal UnSettleQty { set; get; }
[ExporterHeader(DisplayName = "差异金额")]
public decimal DiffAMT { set; get; }
[ExporterHeader(DisplayName = "退货数量")]
public decimal ReturnQty { set; get; }
[ExporterHeader(DisplayName = "差异数量")]
public decimal DiffQty { set; get; }
[ExporterHeader(DisplayName = "漏结标识 ")]
public string Flag { set; get; }
[ExporterHeader(DisplayName = "漏结期间 ")]
public string UnSettleVersion { set; get; }
[ExporterHeader(DisplayName = "说明 ")]
public string Remark { set; get; }
}
}

11
src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/VWSparePart/SparePart.cs

@ -25,6 +25,17 @@ namespace Win.Sfs.SettleAccount.Entities.VWSparePart
BranchId = branchId;
Extend = extend;
}
public void SetValue(Guid guid, Guid branchId, string year, string peroid, string version, string extend,string purchaseOrderNo)
{
Period = peroid;
Year = year;
Id = guid;
Version = version;
BranchId = branchId;
Extend = extend;
PurchaseOrderNo = purchaseOrderNo;
}
public SparePart(Guid Id, string year, string period, string version, string lineNumber,
string purchaseType,string purchaseOrderNo, string purchaseOrderNoItem, string purchaseOrderNoText,
decimal receiptQty, decimal invoicedQty, decimal amountNoTax, decimal purchasePriceNoTax,

322
src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/WMS/TaskList.cs

@ -56,6 +56,263 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
}
#region 客户代码
public class WmsCustomerKanbanOutPut : FullAuditedAggregateRootBase<Guid>
{
public WmsCustomerKanbanOutPut()
{
}
public WmsCustomerKanbanOutPut(Guid id, string version, string billNum, string creator,string customercode) : base(id)
{
Id = id;
Version = version;
BillNum = billNum;
Creator = creator;
CustomerCode = customercode;
}
public string Version { set; get; }
public string BillNum { set; get; }
public string Creator { set; get; }
public string CustomerCode { set; get; }
}
/// <summary>
/// H平台出库单
/// </summary>
public class WmsCustomerKanbanOutPutDetial : FullAuditedAggregateRootBase<Guid>
{
public WmsCustomerKanbanOutPutDetial()
{
}
public WmsCustomerKanbanOutPutDetial(Guid id, string wmsBillNum, string kanban, string sapmaterialCode, string materialDesc, string materialGroup,
string outPut, string inPut, int state, string extend1, string extend2, string extend3, string materialCode, string billNum,
Guid taskId, string remark, decimal qty, decimal price, decimal amt,string customerCode)
{
Id = id;
WmsBillNum = wmsBillNum;
Kanban = kanban;
SapMaterialCode = sapmaterialCode;
MaterialDesc = materialDesc;
MaterialGroup = materialGroup;
OutPut = outPut;
InPut = inPut;
State = state;
Extend1 = extend1;
Extend2 = extend2;
Version = extend3;
MaterialCode = materialCode;
BillNum = billNum;
TaskId = taskId;
Remark = remark;
Qty = qty;
Price = price;
Amt = amt;
CustomerCode = customerCode;
}
public void SetData(Guid id, string remark, string wmsbillnum, string version, Guid taskId,string customerCode)
{
Id = id;
Remark = remark;
WmsBillNum = wmsbillnum;
Version = version;
TaskId = taskId;
CustomerCode = customerCode;
}
[ImporterHeader(Name = "客户编码")]
[ExporterHeader(DisplayName = "客户编码")]
public string CustomerCode { set; get; }
[ImporterHeader(Name = "看板编号")]
[ExporterHeader(DisplayName = "看板编号")]
//KENN号
public string Kanban { set; get; }
[ImporterHeader(Name = "客户零件号", IsIgnore = true)]
[ExporterHeader(DisplayName = "客户零件号", IsIgnore = true)]
public string MaterialCode { set; get; }
[ImporterHeader(Name = "交货单号")]
[ExporterHeader(DisplayName = "交货单号")]
public string WmsBillNum { set; get; }
//[ImporterHeader(Name = "订货看板编号")]
////KENN号
//public string OrderBillNum { set; get; }
[ImporterHeader(Name = "SAP零件号")]
[ExporterHeader(DisplayName = "SAP零件号")]
//物料号
public string SapMaterialCode { set; get; }
[ImporterHeader(Name = "零件中文名称")]
[ExporterHeader(DisplayName = "零件中文名称")]
//物料描述
public string MaterialDesc { set; get; }
[ImporterHeader(Name = "物料组(车型)")]
[ExporterHeader(DisplayName = "物料组(车型)")]
//物料组(车型)
public string MaterialGroup { set; get; }
[ImporterHeader(Name = "出库库位", IsIgnore = true)]
[ExporterHeader(DisplayName = "出库库位", IsIgnore = true)]
//出库库位
public string OutPut { set; get; }
[ImporterHeader(Name = "入库库位", IsIgnore = true)]
[ExporterHeader(DisplayName = "入库库位", IsIgnore = true)]
//入库库位
public string InPut { set; get; }
[ImporterHeader(Name = "状态", IsIgnore = true)]
[ExporterHeader(DisplayName = "状态", IsIgnore = true)]
public int State { get; set; }
[ImporterHeader(Name = "发货零件号",IsIgnore =true)]
[ExporterHeader(DisplayName = "发货零件号",IsIgnore =true)]
/// <summary>
/// 扩展字段1
/// </summary>
public string Extend1 { set; get; }
[ImporterHeader(Name = "收货仓库", IsIgnore = true)]
[ExporterHeader(DisplayName = "收货仓库", IsIgnore = true)]
public string Extend2 { set; get; }
/// <summary>
/// 扩展字段3
/// </summary>
[ImporterHeader(Name = "版本号", IsIgnore = true)]
[ExporterHeader(DisplayName = "版本号", IsIgnore = true)]
public string Version { set; get; }
[ImporterHeader(Name = "结算数量")]
[ExporterHeader(DisplayName = "结算数量")]
public decimal Qty { set; get; }
[ImporterHeader(Name = "结算单价")]
[ExporterHeader(DisplayName = "结算单价")]
public decimal Price { set; get; }
[ImporterHeader(Name = "结算金额")]
[ExporterHeader(DisplayName = "结算金额")]
public decimal Amt { set; get; }
[ImporterHeader(Name = "数量", IsIgnore = true)]
[ExporterHeader(DisplayName = "数量", IsIgnore = true)]
public string BillNum { set; get; }
[ImporterHeader(Name = "任务描述", IsIgnore = true)]
[ExporterHeader(DisplayName = "任务描述", IsIgnore = true)]
public Guid TaskId { set; get; }
}
/// <summary>
/// 根据DTO自动生成模板,供前端下载模板用
/// </summary>
public class WmsCustomerKanbanOutPutDetialDTO
{
public WmsCustomerKanbanOutPutDetialDTO()
{
}
[ImporterHeader(Name = "客户编码")]
[ExporterHeader(DisplayName = "客户编码")]
public string CustomerCode { set; get; }
[ImporterHeader(Name = "看板编号")]
[ExporterHeader(DisplayName = "看板编号")]
//KENN号
public string Kanban { set; get; }
[ImporterHeader(Name = "客户零件号", IsIgnore = true)]
[ExporterHeader(DisplayName = "客户零件号", IsIgnore = true)]
public string MaterialCode { set; get; }
[ImporterHeader(Name = "交货单号", IsIgnore = true)]
[ExporterHeader(DisplayName = "交货单号", IsIgnore = true)]
public string WmsBillNum { set; get; }
//[ImporterHeader(Name = "订货看板编号")]
////KENN号
//public string OrderBillNum { set; get; }
[ImporterHeader(Name = "SAP零件号")]
[ExporterHeader(DisplayName = "SAP零件号")]
//物料号
public string SapMaterialCode { set; get; }
[ImporterHeader(Name = "零件中文名称")]
[ExporterHeader(DisplayName = "零件中文名称")]
//物料描述
public string MaterialDesc { set; get; }
[ImporterHeader(Name = "物料组(车型)", IsIgnore = true)]
[ExporterHeader(DisplayName = "物料组(车型)", IsIgnore = true)]
//物料组(车型)
public string MaterialGroup { set; get; }
[ImporterHeader(Name = "出库库位", IsIgnore = true)]
[ExporterHeader(DisplayName = "出库库位", IsIgnore = true)]
//出库库位
public string OutPut { set; get; }
[ImporterHeader(Name = "入库库位", IsIgnore = true)]
[ExporterHeader(DisplayName = "入库库位", IsIgnore = true)]
//入库库位
public string InPut { set; get; }
[ImporterHeader(Name = "状态", IsIgnore = true)]
[ExporterHeader(DisplayName = "状态", IsIgnore = true)]
public int State { get; set; }
[ImporterHeader(Name = "发货零件号", IsIgnore = true)]
[ExporterHeader(DisplayName = "发货零件号", IsIgnore = true)]
/// <summary>
/// 扩展字段1
/// </summary>
public string Extend1 { set; get; }
[ImporterHeader(Name = "收货仓库", IsIgnore = true)]
[ExporterHeader(DisplayName = "收货仓库", IsIgnore = true)]
public string Extend2 { set; get; }
/// <summary>
/// 扩展字段3
/// </summary>
[ImporterHeader(Name = "版本号", IsIgnore = true)]
[ExporterHeader(DisplayName = "版本号", IsIgnore = true)]
public string Version { set; get; }
[ImporterHeader(Name = "结算数量")]
[ExporterHeader(DisplayName = "结算数量")]
public decimal Qty { set; get; }
[ImporterHeader(Name = "结算单价")]
[ExporterHeader(DisplayName = "结算单价")]
public decimal Price { set; get; }
[ImporterHeader(Name = "结算金额")]
[ExporterHeader(DisplayName = "结算金额")]
public decimal Amt { set; get; }
[ImporterHeader(Name = "数量", IsIgnore = true)]
[ExporterHeader(DisplayName = "数量", IsIgnore = true)]
public string BillNum { set; get; }
[ImporterHeader(Name = "任务描述", IsIgnore = true)]
[ExporterHeader(DisplayName = "任务描述", IsIgnore = true)]
public Guid TaskId { set; get; }
}
#endregion
/// <summary>
/// 准时化出库主表
/// </summary>
@ -453,8 +710,6 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
Qty = qty;
SockQty = sockQty;
OutputQty = outputQty;
Extend = extend;
BillNum = billnum;
State = state;
@ -511,48 +766,43 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
[ExporterHeader(DisplayName = "开票金额")]
public decimal Amt { set; get; }
//以下继承的全部不导出
}
//[ExporterHeader(DisplayName = "BranchId", IsIgnore = true)]
//public Guid BranchId { set; get; }
//[ExporterHeader(DisplayName = "Enabled", IsIgnore = true)]
//public bool Enabled { set; get; }
//[ExporterHeader(DisplayName = "Remark", IsIgnore = true)]
//public string Remark { set; get; }
//[ExporterHeader(DisplayName = "IsDeleted", IsIgnore = true)]
//public bool IsDeleted { set; get; }
//[ExporterHeader(DisplayName = "DeleterId", IsIgnore = true)]
//public bool DeleterId { set; get; }
//[ExporterHeader(DisplayName = "DeletionTime", IsIgnore = true)]
//public DateTime DeletionTime { set; get; }
//[ExporterHeader(DisplayName = "LastModificationTime", IsIgnore = true)]
//public DateTime LastModificationTime { set; get; }
//[ExporterHeader(DisplayName = "LastModifierId", IsIgnore = true)]
//public Guid LastModifierId { set; get; }
//[ExporterHeader(DisplayName = "CreationTime", IsIgnore = true)]
//public DateTime CreationTime { set; get; }
//[ExporterHeader(DisplayName = "CreatorId", IsIgnore = true)]
//public Guid CreatorId { set; get; }
//[ExporterHeader(DisplayName = "ExtraProperties", IsIgnore = true)]
//public string ExtraProperties { set; get; }
//[ExporterHeader(DisplayName = "ConcurrencyStamp", IsIgnore = true)]
//public DateTime ConcurrencyStamp { set; get; }
//[ExporterHeader(DisplayName = "Id", IsIgnore = true)]
//public Guid Id { set; get; }
}
public class WmsHQWithOutKanbanOutPut : FullAuditedAggregateRootBase<Guid>
@ -1898,7 +2148,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
/// <summary>
/// 备件出库明细
/// 备件无单号出库明细
/// </summary>
//[ExcelImporter(SheetName = "大众备件数据输出")]
public class WmsSharePartOutPutDetial : FullAuditedAggregateRootBase<Guid>
@ -1910,7 +2160,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
public WmsSharePartOutPutDetial(Guid id, string wmsBillNum, string orderBillNum, string materialCode, string materialDesc,
string materialGroup, string outPut, string inPut, int state, string extend1, string extend2, string extend3,
string parentMaterialCode, string billNum, Guid taskId, string remark, decimal qty, decimal stockQty,
decimal outputQty, decimal price, decimal amt)
decimal outputQty, decimal price, decimal amt,decimal realqty)
{
Id = id;
WmsBillNum = wmsBillNum;
@ -1933,6 +2183,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
OutPutQty = outputQty;
Price = price;
Amt = amt;
RealityNumber = realqty;
}
@ -2017,6 +2268,13 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
[ImporterHeader(Name = "出库数量", IsIgnore = true)]
[ExporterHeader(DisplayName = "出库数量", IsIgnore = true)]
public decimal OutPutQty { set; get; }
[ImporterHeader(Name = "真实数量", IsIgnore = true)]
[ExporterHeader(DisplayName = "真实数量", IsIgnore = true)]
public decimal RealityNumber { set; get; }
[ImporterHeader(Name = "开票单价")]
[ExporterHeader(DisplayName = "开票单价")]

116
src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/WmsDetailReport.cs

@ -172,17 +172,13 @@ namespace Win.Sfs.SettleAccount.Entities
public int State { set; get; }
}
/// <summary>
/// 有条码
/// </summary>
public class WmsDetailWithCodeReport : FullAuditedAggregateRootBase<Guid>
public class WmsDetailCancelReport : FullAuditedAggregateRootBase<Guid>
{
public WmsDetailWithCodeReport()
public WmsDetailCancelReport()
{
}
public WmsDetailWithCodeReport(Guid id, string client, string type, string version, string billNum, string switchCode, string materialCode, decimal qty, decimal outputQty, decimal diffQty, string materialGroupCode, string materialGroup, string materialDesc, string remark1, int state) : base(id)
public WmsDetailCancelReport(Guid id, string client, string type, string version, string billNum, string switchCode, string materialCode, decimal qty, decimal outputQty, decimal diffQty, string materialGroupCode, string materialGroup, string materialDesc, string remark1, int state) : base(id)
{
Version = version;
Type = type;
@ -247,5 +243,111 @@ namespace Win.Sfs.SettleAccount.Entities
[Display(Name = "状态")]
public int State { set; get; }
}
/// <summary>
/// 有条码
/// </summary>
public class WmsDetailWithCodeReport : FullAuditedAggregateRootBase<Guid>
{
public WmsDetailWithCodeReport()
{
}
public WmsDetailWithCodeReport(Guid id, string client, string type, string version,
string billNum, string switchCode, string materialCode, decimal qty,
decimal outputQty, decimal diffQty, string materialGroupCode, string materialGroup,
string materialDesc, string remark1, int state,string lineNumber,
decimal price,string estimateType,decimal amt) : base(id)
{
Version = version;
Type = type;
Client = client;
BillNum = billNum;
SwitchCode = switchCode;
MaterialCode = materialCode;
Qty = qty;
OutputQty = outputQty;
DiffQty = diffQty;
EstimateType = materialGroupCode;
MaterialGroup = materialGroup;
MaterialDesc = materialDesc;
Remark1 = remark1;
State = state;
LineNumber = lineNumber;
//CNumber = cNumber;
Price = price;
Amt = amt;
}
[Display(Name = "结算金额")]
public decimal Amt { set; get; }
[Display(Name = "行号")]
public string LineNumber { set; get; }
//[Display(Name = "通用代码号")]
//public string CNumber { set; get; }
[Display(Name = "版本号")]
public string Version { set; get; }
[Display(Name = "客户")]
public string Client { set; get; }
[Display(Name = "出库类型")]
public string Type { set; get; }
//[Display(Name = "结算编码")]
//public string SettleCode { set; get; }
//[Display(Name = "销售渠道")]
//public string SaleCode { set; get; }
//[Display(Name = "客户代码")]
//public string ClientCode { set; get; }
[Display(Name = "结算单")]
public string BillNum { set; get; }
[Display(Name = "交货编码")]
public string SwitchCode { set; get; }
//[Display(Name = "寄售类别")]
//public string SaleType { set; get; }
[Display(Name = "结算数量")]
public decimal Qty { set; get; }
[Display(Name = "实际出库数量")]
public decimal OutputQty { set; get; }
[Display(Name = "差异数量")]
public decimal DiffQty { set; get; }
[Display(Name = "开票单价")]
public decimal Price { set; get; }
//[Display(Name = "已出库金额")]
//public decimal OutPutAmt { set; get; }
//[Display(Name = "WMS待出库金额")]
//public decimal DiffAmt { set; get; }
[Display(Name = "物料号")]
public string MaterialCode { set; get; }
[Display(Name = "物料组编码")]
public string EstimateType { set; get; }
[Display(Name = "物料组(车型)")]
public string MaterialGroup { set; get; }
[Display(Name = "物料组描述")]
public string MaterialDesc { set; get; }
[Display(Name = "备注")]
public string Remark1 { set; get; }
[Display(Name = "状态")]
public int State { set; get; }
}
public class WmsDetailWithCodeDto
{
public string cnumber { set; get; }
public string materialCode { set; get; }
}
}

2
src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/InvoiceSettledDiffs/InvoiceSettledDiff.cs

@ -44,7 +44,7 @@ namespace Win.Sfs.SettleAccount.Reports.InvoiceSettledDiffs
[ExporterHeader(DisplayName = "交货单号")]
public override string WmsBillNum { set; get; }
[ExporterHeader(DisplayName = "实际发货日期", Format = "yyyy-MM-dd")]
public override DateTime CP5Time { set; get; }
public override string CP5Time { set; get; }
[ExporterHeader(DisplayName = "KENN号")]
public override string KENNCode { set; get; }
[ExporterHeader(DisplayName = "底盘号")]

2
src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/ReportDetailBase.cs

@ -21,7 +21,7 @@ namespace Win.Sfs.SettleAccount.Reports
[ExporterHeader(DisplayName = "交货单号 ")]
public virtual string WmsBillNum { set; get; }
[ExporterHeader(DisplayName = "实际发货日期 ")]
public virtual DateTime CP5Time { set; get; }
public virtual string CP5Time { set; get; }
[ExporterHeader(DisplayName = "KENN号")]
public virtual string KENNCode { set; get; }
[ExporterHeader(DisplayName = "底盘号")]

5
src/Modules/SettleAccount/src/SettleAccount.Domain/Settings/Helper.cs

@ -12,6 +12,7 @@ using System.Reflection;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Volo.Abp;
using Win.Sfs.SettleAccount.Entities.ImportMap;
namespace Win.Sfs.SettleAccount
@ -290,6 +291,10 @@ namespace Win.Sfs.SettleAccount
}
}
IRow firstRow = sheet.GetRow(0);
if (firstRow == null)
{
throw new BusinessException("导入模板中sheet页为空,请检查!");
}
int cellCount = firstRow.LastCellNum;
Dictionary<int, string> _dicList = new Dictionary<int, string>();

87
src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs

@ -379,9 +379,13 @@ namespace Win.Sfs.SettleAccount
builder.ConfigureWmsDetailReport(options);
builder.ConfigureWmsDetailDiffReport(options);
builder.ConfigureWmsDetailCancelReport(options);
//有条码
builder.ConfigureWmsDetailWithCodeReport(options);
builder.ConfigureWmsCustomerKanbanOutPut(options);
builder.ConfigureWmsCustomerKanbanOutPutDetial(options);
#endregion
@ -609,6 +613,34 @@ namespace Win.Sfs.SettleAccount
});
}
private static void ConfigureWmsDetailCancelReport(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options)
{
builder.Entity<WmsDetailCancelReport>(b =>
{
b.ToTable($"{options.TablePrefix}_WmsDetailCancelReport", options.Schema);
b.ConfigureByConvention();
b.Property(x => x.BillNum).IsRequired().HasMaxLength(50);//必填项
b.Property(x => x.MaterialCode).HasMaxLength(50);
b.Property(x => x.MaterialDesc).HasMaxLength(100);
b.Property(x => x.Client).IsRequired().HasMaxLength(50);
b.Property(x => x.MaterialCode).HasMaxLength(50);
b.Property(x => x.MaterialDesc).HasMaxLength(150);
b.Property(x => x.MaterialGroup).HasMaxLength(50);
b.Property(x => x.MaterialGroupCode).HasMaxLength(50);
//创建组合索引
});
}
/// <summary>
/// 有条码
/// </summary>
@ -632,7 +664,7 @@ namespace Win.Sfs.SettleAccount
b.Property(x => x.MaterialDesc).HasMaxLength(150);
b.Property(x => x.MaterialGroup).HasMaxLength(50);
b.Property(x => x.MaterialGroupCode).HasMaxLength(50);
b.Property(x => x.EstimateType).HasMaxLength(50);
//创建组合索引
@ -1792,6 +1824,51 @@ namespace Win.Sfs.SettleAccount
}
private static void ConfigureWmsCustomerKanbanOutPut(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options)
{
builder.Entity<WmsCustomerKanbanOutPut>(b =>
{
b.ToTable($"{options.TablePrefix}_WmsCustomerKanbanOutPut", options.Schema);
b.ConfigureByConvention();
b.Property(x => x.BillNum).IsRequired().HasMaxLength(CommonConsts.MaxCodeLength);
b.Property(x => x.Version).IsRequired().HasMaxLength(CommonConsts.MaxCodeLength);
b.Property(x => x.CustomerCode).IsRequired().HasMaxLength(CommonConsts.MaxCodeLength);
b.HasIndex(x => new { x.BillNum });
});
}
private static void ConfigureWmsCustomerKanbanOutPutDetial(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options)
{
builder.Entity<WmsCustomerKanbanOutPutDetial>(b =>
{
b.ToTable($"{options.TablePrefix}_WmsCustomerKanbanOutPutDetial", options.Schema);
b.ConfigureByConvention();
b.Property(x => x.BillNum).IsRequired().HasMaxLength(CommonConsts.MaxCodeLength);
b.Property(x => x.WmsBillNum).IsRequired().HasMaxLength(CommonConsts.MaxCodeLength);
b.Property(x => x.Version).IsRequired().HasMaxLength(CommonConsts.MaxCodeLength);
b.Property(x => x.OutPut).HasMaxLength(CommonConsts.MaxCodeLength);
b.Property(x => x.InPut).HasMaxLength(CommonConsts.MaxCodeLength);
b.Property(x => x.CustomerCode).HasMaxLength(CommonConsts.MaxCodeLength);
b.Property(x => x.Kanban).HasMaxLength(CommonConsts.MaxCodeLength);
b.Property(x => x.SapMaterialCode).HasMaxLength(CommonConsts.MaxCodeLength);
b.Property(x => x.Extend1).HasMaxLength(CommonConsts.MaxCodeLength);
b.Property(x => x.Extend2).HasMaxLength(CommonConsts.MaxCodeLength);
b.Property(x => x.MaterialCode).HasMaxLength(CommonConsts.MaxCodeLength);
b.HasIndex(x => new { x.Version }).IsUnique().HasFilter(IsDeletedFilter);
});
}
private static void ConfigureWmsHQHSharePartOutPutVersion(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options)
{
@ -1877,6 +1954,12 @@ namespace Win.Sfs.SettleAccount
#endregion

335
src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20220311042548_Init.Designer.cs → src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20220413040718_5677.Designer.cs

@ -11,8 +11,8 @@ using Win.Sfs.SettleAccount;
namespace Win.Sfs.SettleAccount.Migrations
{
[DbContext(typeof(SettleAccountDbContext))]
[Migration("20220311042548_Init")]
partial class Init
[Migration("20220413040718_5677")]
partial class _5677
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
@ -8301,6 +8301,218 @@ namespace Win.Sfs.SettleAccount.Migrations
b.ToTable("Set_SparePart_Version");
});
modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.WMS.WmsCustomerKanbanOutPut", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<string>("BillNum")
.IsRequired()
.HasMaxLength(36)
.HasColumnType("nvarchar(36)");
b.Property<Guid>("BranchId")
.HasColumnType("uniqueidentifier");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasMaxLength(40)
.HasColumnType("nvarchar(40)")
.HasColumnName("ConcurrencyStamp");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime2")
.HasColumnName("CreationTime");
b.Property<string>("Creator")
.HasColumnType("nvarchar(max)");
b.Property<Guid?>("CreatorId")
.HasColumnType("uniqueidentifier")
.HasColumnName("CreatorId");
b.Property<string>("CustomerCode")
.IsRequired()
.HasMaxLength(36)
.HasColumnType("nvarchar(36)");
b.Property<Guid?>("DeleterId")
.HasColumnType("uniqueidentifier")
.HasColumnName("DeleterId");
b.Property<DateTime?>("DeletionTime")
.HasColumnType("datetime2")
.HasColumnName("DeletionTime");
b.Property<bool>("Enabled")
.HasColumnType("bit");
b.Property<string>("ExtraProperties")
.HasColumnType("nvarchar(max)")
.HasColumnName("ExtraProperties");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnType("bit")
.HasDefaultValue(false)
.HasColumnName("IsDeleted");
b.Property<DateTime?>("LastModificationTime")
.HasColumnType("datetime2")
.HasColumnName("LastModificationTime");
b.Property<Guid?>("LastModifierId")
.HasColumnType("uniqueidentifier")
.HasColumnName("LastModifierId");
b.Property<string>("Remark")
.HasColumnType("nvarchar(max)");
b.Property<string>("Version")
.IsRequired()
.HasMaxLength(36)
.HasColumnType("nvarchar(36)");
b.HasKey("Id");
b.HasIndex("BillNum");
b.ToTable("Set_WmsCustomerKanbanOutPut");
});
modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.WMS.WmsCustomerKanbanOutPutDetial", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<decimal>("Amt")
.HasColumnType("decimal(18,2)");
b.Property<string>("BillNum")
.IsRequired()
.HasMaxLength(36)
.HasColumnType("nvarchar(36)");
b.Property<Guid>("BranchId")
.HasColumnType("uniqueidentifier");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasMaxLength(40)
.HasColumnType("nvarchar(40)")
.HasColumnName("ConcurrencyStamp");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime2")
.HasColumnName("CreationTime");
b.Property<Guid?>("CreatorId")
.HasColumnType("uniqueidentifier")
.HasColumnName("CreatorId");
b.Property<string>("CustomerCode")
.HasMaxLength(36)
.HasColumnType("nvarchar(36)");
b.Property<Guid?>("DeleterId")
.HasColumnType("uniqueidentifier")
.HasColumnName("DeleterId");
b.Property<DateTime?>("DeletionTime")
.HasColumnType("datetime2")
.HasColumnName("DeletionTime");
b.Property<bool>("Enabled")
.HasColumnType("bit");
b.Property<string>("Extend1")
.HasMaxLength(36)
.HasColumnType("nvarchar(36)");
b.Property<string>("Extend2")
.HasMaxLength(36)
.HasColumnType("nvarchar(36)");
b.Property<string>("ExtraProperties")
.HasColumnType("nvarchar(max)")
.HasColumnName("ExtraProperties");
b.Property<string>("InPut")
.HasMaxLength(36)
.HasColumnType("nvarchar(36)");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnType("bit")
.HasDefaultValue(false)
.HasColumnName("IsDeleted");
b.Property<string>("Kanban")
.HasMaxLength(36)
.HasColumnType("nvarchar(36)");
b.Property<DateTime?>("LastModificationTime")
.HasColumnType("datetime2")
.HasColumnName("LastModificationTime");
b.Property<Guid?>("LastModifierId")
.HasColumnType("uniqueidentifier")
.HasColumnName("LastModifierId");
b.Property<string>("MaterialCode")
.HasMaxLength(36)
.HasColumnType("nvarchar(36)");
b.Property<string>("MaterialDesc")
.HasColumnType("nvarchar(max)");
b.Property<string>("MaterialGroup")
.HasColumnType("nvarchar(max)");
b.Property<string>("OutPut")
.HasMaxLength(36)
.HasColumnType("nvarchar(36)");
b.Property<decimal>("Price")
.HasColumnType("decimal(18,2)");
b.Property<decimal>("Qty")
.HasColumnType("decimal(18,2)");
b.Property<string>("Remark")
.HasColumnType("nvarchar(max)");
b.Property<string>("SapMaterialCode")
.HasMaxLength(36)
.HasColumnType("nvarchar(36)");
b.Property<int>("State")
.HasColumnType("int");
b.Property<Guid>("TaskId")
.HasColumnType("uniqueidentifier");
b.Property<string>("Version")
.IsRequired()
.HasMaxLength(36)
.HasColumnType("nvarchar(36)");
b.Property<string>("WmsBillNum")
.IsRequired()
.HasMaxLength(36)
.HasColumnType("nvarchar(36)");
b.HasKey("Id");
b.HasIndex("Version")
.IsUnique()
.HasFilter("IsDeleted=0");
b.ToTable("Set_WmsCustomerKanbanOutPutDetial");
});
modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.WMS.WmsHQCarOutPut", b =>
{
b.Property<Guid>("Id")
@ -11639,6 +11851,125 @@ namespace Win.Sfs.SettleAccount.Migrations
b.ToTable("Set_WmsDetailReport");
});
modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.WmsDetailWithCodeReport", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<decimal>("Amt")
.HasColumnType("decimal(18,2)");
b.Property<string>("BillNum")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<Guid>("BranchId")
.HasColumnType("uniqueidentifier");
b.Property<string>("Client")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasMaxLength(40)
.HasColumnType("nvarchar(40)")
.HasColumnName("ConcurrencyStamp");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime2")
.HasColumnName("CreationTime");
b.Property<Guid?>("CreatorId")
.HasColumnType("uniqueidentifier")
.HasColumnName("CreatorId");
b.Property<Guid?>("DeleterId")
.HasColumnType("uniqueidentifier")
.HasColumnName("DeleterId");
b.Property<DateTime?>("DeletionTime")
.HasColumnType("datetime2")
.HasColumnName("DeletionTime");
b.Property<decimal>("DiffQty")
.HasColumnType("decimal(18,2)");
b.Property<bool>("Enabled")
.HasColumnType("bit");
b.Property<string>("EstimateType")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("ExtraProperties")
.HasColumnType("nvarchar(max)")
.HasColumnName("ExtraProperties");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnType("bit")
.HasDefaultValue(false)
.HasColumnName("IsDeleted");
b.Property<DateTime?>("LastModificationTime")
.HasColumnType("datetime2")
.HasColumnName("LastModificationTime");
b.Property<Guid?>("LastModifierId")
.HasColumnType("uniqueidentifier")
.HasColumnName("LastModifierId");
b.Property<string>("LineNumber")
.HasColumnType("nvarchar(max)");
b.Property<string>("MaterialCode")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("MaterialDesc")
.HasMaxLength(150)
.HasColumnType("nvarchar(150)");
b.Property<string>("MaterialGroup")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<decimal>("OutputQty")
.HasColumnType("decimal(18,2)");
b.Property<decimal>("Price")
.HasColumnType("decimal(18,2)");
b.Property<decimal>("Qty")
.HasColumnType("decimal(18,2)");
b.Property<string>("Remark")
.HasColumnType("nvarchar(max)");
b.Property<string>("Remark1")
.HasColumnType("nvarchar(max)");
b.Property<int>("State")
.HasColumnType("int");
b.Property<string>("SwitchCode")
.HasColumnType("nvarchar(max)");
b.Property<string>("Type")
.HasColumnType("nvarchar(max)");
b.Property<string>("Version")
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Set_WmsDetailWithCodeReport");
});
modelBuilder.Entity("Win.Sfs.SettleAccount.EstimatedInventories.EstimatedInventoryDetail", b =>
{
b.Property<Guid>("Id")

131
src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20220311042548_Init.cs → src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20220413040718_5677.cs

@ -3,7 +3,7 @@ using Microsoft.EntityFrameworkCore.Migrations;
namespace Win.Sfs.SettleAccount.Migrations
{
public partial class Init : Migration
public partial class _5677 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
@ -3412,6 +3412,74 @@ namespace Win.Sfs.SettleAccount.Migrations
table.PrimaryKey("PK_Set_Unsettle_Version", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Set_WmsCustomerKanbanOutPut",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
Version = table.Column<string>(type: "nvarchar(36)", maxLength: 36, nullable: false),
BillNum = table.Column<string>(type: "nvarchar(36)", maxLength: 36, nullable: false),
Creator = table.Column<string>(type: "nvarchar(max)", nullable: true),
CustomerCode = table.Column<string>(type: "nvarchar(36)", maxLength: 36, nullable: false),
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true),
ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: true),
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true),
BranchId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
Enabled = table.Column<bool>(type: "bit", nullable: false),
Remark = table.Column<string>(type: "nvarchar(max)", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Set_WmsCustomerKanbanOutPut", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Set_WmsCustomerKanbanOutPutDetial",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
CustomerCode = table.Column<string>(type: "nvarchar(36)", maxLength: 36, nullable: true),
Kanban = table.Column<string>(type: "nvarchar(36)", maxLength: 36, nullable: true),
MaterialCode = table.Column<string>(type: "nvarchar(36)", maxLength: 36, nullable: true),
WmsBillNum = table.Column<string>(type: "nvarchar(36)", maxLength: 36, nullable: false),
SapMaterialCode = table.Column<string>(type: "nvarchar(36)", maxLength: 36, nullable: true),
MaterialDesc = table.Column<string>(type: "nvarchar(max)", nullable: true),
MaterialGroup = table.Column<string>(type: "nvarchar(max)", nullable: true),
OutPut = table.Column<string>(type: "nvarchar(36)", maxLength: 36, nullable: true),
InPut = table.Column<string>(type: "nvarchar(36)", maxLength: 36, nullable: true),
State = table.Column<int>(type: "int", nullable: false),
Extend1 = table.Column<string>(type: "nvarchar(36)", maxLength: 36, nullable: true),
Extend2 = table.Column<string>(type: "nvarchar(36)", maxLength: 36, nullable: true),
Version = table.Column<string>(type: "nvarchar(36)", maxLength: 36, nullable: false),
Qty = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
Price = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
Amt = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
BillNum = table.Column<string>(type: "nvarchar(36)", maxLength: 36, nullable: false),
TaskId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true),
ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: true),
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true),
BranchId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
Enabled = table.Column<bool>(type: "bit", nullable: false),
Remark = table.Column<string>(type: "nvarchar(max)", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Set_WmsCustomerKanbanOutPutDetial", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Set_WmsDetailDiffReport",
columns: table => new
@ -3494,6 +3562,46 @@ namespace Win.Sfs.SettleAccount.Migrations
table.PrimaryKey("PK_Set_WmsDetailReport", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Set_WmsDetailWithCodeReport",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
Amt = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
LineNumber = table.Column<string>(type: "nvarchar(max)", nullable: true),
Version = table.Column<string>(type: "nvarchar(max)", nullable: true),
Client = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
Type = table.Column<string>(type: "nvarchar(max)", nullable: true),
BillNum = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
SwitchCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
Qty = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
OutputQty = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
DiffQty = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
Price = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
MaterialCode = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
EstimateType = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
MaterialGroup = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
MaterialDesc = table.Column<string>(type: "nvarchar(150)", maxLength: 150, nullable: true),
Remark1 = table.Column<string>(type: "nvarchar(max)", nullable: true),
State = table.Column<int>(type: "int", nullable: false),
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true),
ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: true),
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true),
BranchId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
Enabled = table.Column<bool>(type: "bit", nullable: false),
Remark = table.Column<string>(type: "nvarchar(max)", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Set_WmsDetailWithCodeReport", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Set_WmsHQCarOutPut",
columns: table => new
@ -5520,6 +5628,18 @@ namespace Win.Sfs.SettleAccount.Migrations
unique: true,
filter: "IsDeleted=0");
migrationBuilder.CreateIndex(
name: "IX_Set_WmsCustomerKanbanOutPut_BillNum",
table: "Set_WmsCustomerKanbanOutPut",
column: "BillNum");
migrationBuilder.CreateIndex(
name: "IX_Set_WmsCustomerKanbanOutPutDetial_Version",
table: "Set_WmsCustomerKanbanOutPutDetial",
column: "Version",
unique: true,
filter: "IsDeleted=0");
migrationBuilder.CreateIndex(
name: "IX_Set_WmsHQCarOutPut_BillNum",
table: "Set_WmsHQCarOutPut",
@ -6045,12 +6165,21 @@ namespace Win.Sfs.SettleAccount.Migrations
migrationBuilder.DropTable(
name: "Set_Unsettle_Version");
migrationBuilder.DropTable(
name: "Set_WmsCustomerKanbanOutPut");
migrationBuilder.DropTable(
name: "Set_WmsCustomerKanbanOutPutDetial");
migrationBuilder.DropTable(
name: "Set_WmsDetailDiffReport");
migrationBuilder.DropTable(
name: "Set_WmsDetailReport");
migrationBuilder.DropTable(
name: "Set_WmsDetailWithCodeReport");
migrationBuilder.DropTable(
name: "Set_WmsHQCarOutPut");

331
src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/SettleAccountDbContextModelSnapshot.cs

@ -8299,6 +8299,218 @@ namespace Win.Sfs.SettleAccount.Migrations
b.ToTable("Set_SparePart_Version");
});
modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.WMS.WmsCustomerKanbanOutPut", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<string>("BillNum")
.IsRequired()
.HasMaxLength(36)
.HasColumnType("nvarchar(36)");
b.Property<Guid>("BranchId")
.HasColumnType("uniqueidentifier");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasMaxLength(40)
.HasColumnType("nvarchar(40)")
.HasColumnName("ConcurrencyStamp");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime2")
.HasColumnName("CreationTime");
b.Property<string>("Creator")
.HasColumnType("nvarchar(max)");
b.Property<Guid?>("CreatorId")
.HasColumnType("uniqueidentifier")
.HasColumnName("CreatorId");
b.Property<string>("CustomerCode")
.IsRequired()
.HasMaxLength(36)
.HasColumnType("nvarchar(36)");
b.Property<Guid?>("DeleterId")
.HasColumnType("uniqueidentifier")
.HasColumnName("DeleterId");
b.Property<DateTime?>("DeletionTime")
.HasColumnType("datetime2")
.HasColumnName("DeletionTime");
b.Property<bool>("Enabled")
.HasColumnType("bit");
b.Property<string>("ExtraProperties")
.HasColumnType("nvarchar(max)")
.HasColumnName("ExtraProperties");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnType("bit")
.HasDefaultValue(false)
.HasColumnName("IsDeleted");
b.Property<DateTime?>("LastModificationTime")
.HasColumnType("datetime2")
.HasColumnName("LastModificationTime");
b.Property<Guid?>("LastModifierId")
.HasColumnType("uniqueidentifier")
.HasColumnName("LastModifierId");
b.Property<string>("Remark")
.HasColumnType("nvarchar(max)");
b.Property<string>("Version")
.IsRequired()
.HasMaxLength(36)
.HasColumnType("nvarchar(36)");
b.HasKey("Id");
b.HasIndex("BillNum");
b.ToTable("Set_WmsCustomerKanbanOutPut");
});
modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.WMS.WmsCustomerKanbanOutPutDetial", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<decimal>("Amt")
.HasColumnType("decimal(18,2)");
b.Property<string>("BillNum")
.IsRequired()
.HasMaxLength(36)
.HasColumnType("nvarchar(36)");
b.Property<Guid>("BranchId")
.HasColumnType("uniqueidentifier");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasMaxLength(40)
.HasColumnType("nvarchar(40)")
.HasColumnName("ConcurrencyStamp");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime2")
.HasColumnName("CreationTime");
b.Property<Guid?>("CreatorId")
.HasColumnType("uniqueidentifier")
.HasColumnName("CreatorId");
b.Property<string>("CustomerCode")
.HasMaxLength(36)
.HasColumnType("nvarchar(36)");
b.Property<Guid?>("DeleterId")
.HasColumnType("uniqueidentifier")
.HasColumnName("DeleterId");
b.Property<DateTime?>("DeletionTime")
.HasColumnType("datetime2")
.HasColumnName("DeletionTime");
b.Property<bool>("Enabled")
.HasColumnType("bit");
b.Property<string>("Extend1")
.HasMaxLength(36)
.HasColumnType("nvarchar(36)");
b.Property<string>("Extend2")
.HasMaxLength(36)
.HasColumnType("nvarchar(36)");
b.Property<string>("ExtraProperties")
.HasColumnType("nvarchar(max)")
.HasColumnName("ExtraProperties");
b.Property<string>("InPut")
.HasMaxLength(36)
.HasColumnType("nvarchar(36)");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnType("bit")
.HasDefaultValue(false)
.HasColumnName("IsDeleted");
b.Property<string>("Kanban")
.HasMaxLength(36)
.HasColumnType("nvarchar(36)");
b.Property<DateTime?>("LastModificationTime")
.HasColumnType("datetime2")
.HasColumnName("LastModificationTime");
b.Property<Guid?>("LastModifierId")
.HasColumnType("uniqueidentifier")
.HasColumnName("LastModifierId");
b.Property<string>("MaterialCode")
.HasMaxLength(36)
.HasColumnType("nvarchar(36)");
b.Property<string>("MaterialDesc")
.HasColumnType("nvarchar(max)");
b.Property<string>("MaterialGroup")
.HasColumnType("nvarchar(max)");
b.Property<string>("OutPut")
.HasMaxLength(36)
.HasColumnType("nvarchar(36)");
b.Property<decimal>("Price")
.HasColumnType("decimal(18,2)");
b.Property<decimal>("Qty")
.HasColumnType("decimal(18,2)");
b.Property<string>("Remark")
.HasColumnType("nvarchar(max)");
b.Property<string>("SapMaterialCode")
.HasMaxLength(36)
.HasColumnType("nvarchar(36)");
b.Property<int>("State")
.HasColumnType("int");
b.Property<Guid>("TaskId")
.HasColumnType("uniqueidentifier");
b.Property<string>("Version")
.IsRequired()
.HasMaxLength(36)
.HasColumnType("nvarchar(36)");
b.Property<string>("WmsBillNum")
.IsRequired()
.HasMaxLength(36)
.HasColumnType("nvarchar(36)");
b.HasKey("Id");
b.HasIndex("Version")
.IsUnique()
.HasFilter("IsDeleted=0");
b.ToTable("Set_WmsCustomerKanbanOutPutDetial");
});
modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.WMS.WmsHQCarOutPut", b =>
{
b.Property<Guid>("Id")
@ -11637,6 +11849,125 @@ namespace Win.Sfs.SettleAccount.Migrations
b.ToTable("Set_WmsDetailReport");
});
modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.WmsDetailWithCodeReport", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<decimal>("Amt")
.HasColumnType("decimal(18,2)");
b.Property<string>("BillNum")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<Guid>("BranchId")
.HasColumnType("uniqueidentifier");
b.Property<string>("Client")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasMaxLength(40)
.HasColumnType("nvarchar(40)")
.HasColumnName("ConcurrencyStamp");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime2")
.HasColumnName("CreationTime");
b.Property<Guid?>("CreatorId")
.HasColumnType("uniqueidentifier")
.HasColumnName("CreatorId");
b.Property<Guid?>("DeleterId")
.HasColumnType("uniqueidentifier")
.HasColumnName("DeleterId");
b.Property<DateTime?>("DeletionTime")
.HasColumnType("datetime2")
.HasColumnName("DeletionTime");
b.Property<decimal>("DiffQty")
.HasColumnType("decimal(18,2)");
b.Property<bool>("Enabled")
.HasColumnType("bit");
b.Property<string>("EstimateType")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("ExtraProperties")
.HasColumnType("nvarchar(max)")
.HasColumnName("ExtraProperties");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnType("bit")
.HasDefaultValue(false)
.HasColumnName("IsDeleted");
b.Property<DateTime?>("LastModificationTime")
.HasColumnType("datetime2")
.HasColumnName("LastModificationTime");
b.Property<Guid?>("LastModifierId")
.HasColumnType("uniqueidentifier")
.HasColumnName("LastModifierId");
b.Property<string>("LineNumber")
.HasColumnType("nvarchar(max)");
b.Property<string>("MaterialCode")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("MaterialDesc")
.HasMaxLength(150)
.HasColumnType("nvarchar(150)");
b.Property<string>("MaterialGroup")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<decimal>("OutputQty")
.HasColumnType("decimal(18,2)");
b.Property<decimal>("Price")
.HasColumnType("decimal(18,2)");
b.Property<decimal>("Qty")
.HasColumnType("decimal(18,2)");
b.Property<string>("Remark")
.HasColumnType("nvarchar(max)");
b.Property<string>("Remark1")
.HasColumnType("nvarchar(max)");
b.Property<int>("State")
.HasColumnType("int");
b.Property<string>("SwitchCode")
.HasColumnType("nvarchar(max)");
b.Property<string>("Type")
.HasColumnType("nvarchar(max)");
b.Property<string>("Version")
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Set_WmsDetailWithCodeReport");
});
modelBuilder.Entity("Win.Sfs.SettleAccount.EstimatedInventories.EstimatedInventoryDetail", b =>
{
b.Property<Guid>("Id")

35
src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/ErpPartDapperRepository.cs

@ -40,29 +40,26 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
}
public virtual List<Material> GetMaterialList()
{
return DbConnection.Query<Material>("select max(Id) ID,'' Factory,MaterialCode,MaterialDesc,EstimateTypeDesc,EstimateType from Set_material group by MaterialCode,MaterialDesc,EstimateTypeDesc,EstimateType ").ToList();
}
public virtual List<T> GetSapList<T>(List<T> childList, string version, bool isNotHistoryPart = false) where T : ReportDetailBase, new()
{
List<Material> _materialList = new List<Material>();
List<ErpPrice> _priceList = new List<ErpPrice>();
//if (CacheManager.CacheMaterials != null)
//{
// _materialList = CacheManager.CacheMaterials;
// _materialList= CacheManager.CacheMaterials.GroupBy(p => new { p.MaterialCode }).Select(p => p.FirstOrDefault()).ToList();
//}
//else
//{
_materialList = DbConnection.Query<Material>("select max(Id) ID,'' Factory,MaterialCode,MaterialDesc,EstimateTypeDesc,EstimateType from Set_material group by MaterialCode,MaterialDesc,EstimateTypeDesc,EstimateType ").ToList();
//}
//if (CacheManager.CachePriceList != null)
//{
// _priceList = CacheManager.CachePriceList;
// _priceList = CacheManager.CachePriceList.GroupBy(p => new { p.SapErpPartCode }).Select(p => p.FirstOrDefault()).ToList();
//}
//else
//{
_priceList = DbConnection.Query<ErpPrice>("select Price SapPrice, MaterialCode SapErpPartCode from Set_PriceList where type='10' and version=(select max(version) from Set_PriceListVersion)").ToList();
//}
_materialList = DbConnection.Query<Material>("select max(Id) ID,'' Factory,MaterialCode,MaterialDesc,EstimateTypeDesc,EstimateType from Set_material group by MaterialCode,MaterialDesc,EstimateTypeDesc,EstimateType ").ToList();
_priceList = DbConnection.Query<ErpPrice>("select Price SapPrice, MaterialCode SapErpPartCode from Set_PriceList where type='10' and version=(select max(version) from Set_PriceListVersion)").ToList();
List<T> tmpList = new List<T>();
if (isNotHistoryPart == true)
{

50
src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/ErpSumOutputDapperRepository.cs

@ -172,7 +172,13 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
public virtual void InsertWmsSum(List<WmsDetailReport> p_list,string version,DateTime accountDate)
{
StringBuilder _buffer = new StringBuilder();
var billnum ="S" +DateTime.Now.ToString("yyyyMMddhhmmss");
var _ary=p_list.Select(p => p.BillNum).Distinct().ToList();
var billnum= string.Join(",", _ary);
//var billnum ="S" +DateTime.Now.ToString("yyyyMMddhhmmss");
var taskid = Guid.NewGuid().ToString();
foreach (var itm in p_list)
{
@ -199,7 +205,8 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" ,[ZNOTE4]\n" +
" ,[ZNOTE5]\n" +
" ,[STATE]\n" +
" ,[REMARK])\n" +
" ,[REMARK]" +
" ,[KOEIN] )\n" +
" VALUES\n" +
" ( '{0}' ,\n" +
" '{1}' , \n" +
@ -209,20 +216,20 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" '{5}' , \n" +
" '{6}' , \n" +
" '{7}' , \n" +
" '{8}' , \n" +
" '{8}' , \n" +
" '{9}' , \n" +
" '{10}' , \n" +
" '{11}' , \n" +
" '{12}' , \n" +
" '{13}' , \n" +
" '{13}' , \n" +
" '{14}' , \n" +
" '{15}' , \n" +
" '{16}' , \n" +
" '{17}' , \n" +
" '{18}' , \n" +
" '{19}' , \n" +
" {20} , \n" +
" '{21}' ) \n";
" {20} , \n" +
" '{21}' , '{22}' ) \n";
sql = string.Format(sql,
taskid,
@ -246,7 +253,8 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
itm.Type,
itm.OutPutAmt,
"0",
billnum
"",
"CNY"
);
_buffer.AppendLine(sql);
@ -278,21 +286,21 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" , '{6}' \n" +
" , '{7}' \n" +
" , '{8}' \n" +
" , {9} )";
" , '{9}' )";
sql=string.Format(sql,
taskid
, "TA_WMS_JSKH"
, count.ToString(),
5,
string.Empty,
DateTime.Now,
"1000",
billnum
,version
,accountDate.ToShortDateString()
);
sql = string.Format(sql,
taskid
, "TA_WMS_JSKH"
, count.ToString(),
0,
string.Empty,
DateTime.Now,
"1000",
billnum
, version
, accountDate.ToString("yyyy-MM-dd")
) ;
DbConnection.Execute(sql, null, null, 1200, null);
}

15
src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQCarSettledDetailDapperRepository.cs

@ -89,7 +89,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" C.EstimateTypeDesc 物料组,\n" +
" C.MaterialDesc 物料描述,\n" +
" CONVERT ( VARCHAR ( 100 ), A.AcceptanceDate, 23 ) 验收单日期,\n" +
" a.[AcceptanceNo] AS 结算验收单号,\n" +
" a.[ExternalKanbanNumber] AS 外部单号,\n" +
" ISNULL( A.Price, 0 ) 结算单价,\n" +
" ISNULL( A.Qty, 0 ) 结算数量,\n" +
" ISNULL( A.Price, 0 ) * ISNULL( A.Qty, 0 ) 结算金额,\n" +
@ -230,7 +230,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" C.EstimateTypeDesc 物料组,\n" +
" C.MaterialDesc 物料描述,\n" +
" CONVERT ( VARCHAR ( 100 ), A.AcceptanceDate, 23 ) 验收单日期,\n" +
" a.[AcceptanceNo] AS 结算验收单号,\n" +
" a.[ExternalKanbanNumber] AS 外部单号,\n" +
" ISNULL( A.Price, 0 ) 结算单价,\n" +
" ISNULL( A.Qty, 0 ) 结算数量,\n" +
" ISNULL( A.Price, 0 ) * ISNULL( A.Qty, 0 ) 结算金额,\n" +
@ -341,7 +341,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
public HQCarSettledDetailDiff(string sapMaterialCode, string materialCode, string materialDesc, decimal price,
string storageLocation, string storageLocationDesc, decimal selprice, decimal diffprice, decimal sumprice, decimal settleprice, decimal qty,
decimal sockQty,string metarialGroup,string acceptanceNo,string acceptanceDate)
decimal sockQty,string metarialGroup,string externalKanbanNumber, string acceptanceDate)
{
SAP编码 = sapMaterialCode;
= materialDesc;
@ -356,7 +356,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
= qty;
= settleprice;
= metarialGroup;
= acceptanceNo;
= externalKanbanNumber;
= acceptanceDate;
}
@ -377,9 +377,12 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
[ExporterHeader(DisplayName = "验收单日期")]
public string { set; get; }
[ExporterHeader(DisplayName = "结算验收单号")]
[ExporterHeader(DisplayName = "结算验收单号",IsIgnore =true)]
public string { set; get; }
[ExporterHeader(DisplayName = "外部单号")]
public string { set; get; }
[ExporterHeader(DisplayName = "物料组")]
public string { set; get; }
@ -407,7 +410,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
public decimal { set; get; }
[ExporterHeader(DisplayName = "差异总金额")]
public decimal { set; get; }
[ExporterHeader(DisplayName = "寄销库数量")]
[ExporterHeader(DisplayName = "寄销库数量",IsIgnore =true)]
public decimal { set; get; }

1094
src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQFactorySettledDetailDapperRepository.cs

File diff suppressed because it is too large

2274
src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQHSettledDetailDapperRepository.cs

File diff suppressed because it is too large

7
src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/InvoiceSettledDetailDiffDapperRepository.cs

@ -37,8 +37,9 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
else
{
string isExistSql = string.Format("SELECT count(1) lincount FROM [Set_Settle_RAM] WITH(SNAPSHOT) where Version = '{0}'", version);
int _count = DbConnection.ExecuteScalar<int>(isExistSql);
//string isExistSql = string.Format("SELECT count(1) lincount FROM [Set_Settle_RAM] WITH(SNAPSHOT) where Version = '{0}'", version);
//int _count = DbConnection.ExecuteScalar<int>(isExistSql);
int _count = 0;
string condition = " where 1=1 ";
if (!string.IsNullOrEmpty(begin))
@ -119,7 +120,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" FROM\n" +
" Set_PriceList \n" +
" WHERE\n" +
" version = ( SELECT Max( Version ) FROM Set_PriceList ) and type=10 ) TEMP2 ON TEMP1.SapMaterialCode = TEMP2.MaterialCode";
" version = ( SELECT Max( Version ) FROM Set_PriceList ) and type=10 ) TEMP2 ON TEMP1.SapMaterialCode = TEMP2.MaterialCode";
var _sql = string.Format(str, version, condition);
var _query = DbConnection.Query<InvoiceSettledDetailDiff>(_sql, null, null, true, 1200, null);

560
src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/KanbanUnSettledDapperRepository.cs

@ -75,13 +75,13 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
public string CustomerPartCode { set; get; }
[ExporterHeader(DisplayName = "物料组")]
public string MaterialGroup { set; get; }
[ExporterHeader(DisplayName = "结算数量")]
[ExporterHeader(DisplayName = "结算数量",IsIgnore =true)]
public decimal SettleQty { set; get; }
[ExporterHeader(DisplayName = "发货数量")]
public decimal WMSDeliveryQty { set; get; }
[ExporterHeader(DisplayName = "退货数量")]
public decimal BackQty { set; get; }
[ExporterHeader(DisplayName = "量")]
[ExporterHeader(DisplayName = "实际发货数量")]
public decimal DiffQty { set; get; }
@ -94,25 +94,16 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
public class KanbanUnSettledExtend
{
[ExporterHeader(DisplayName = "客户物料号")]
[ExporterHeader(DisplayName = "客户物料号")]
public string MaterialCode { set; get; }
[ExporterHeader(DisplayName = "物料号")]
public string SapCode { set; get; }
public string SapCode { set; get; }
[ExporterHeader(DisplayName = "物料名称")]
public string MaterialDesc { set; get; }
//[ExporterHeader(DisplayName = "ERP物料号")]
//public string CustomerPartCode { set; get; }
[ExporterHeader(DisplayName = "物料组车型")]
public string MaterialGroup { set; get; }
public string MaterialGroup { set; get; }
[ExporterHeader(DisplayName = "发货数量")]
public string Qty { set; get; }
[ExporterHeader(DisplayName = "结算数量")]
@ -130,6 +121,18 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
public class CompareKanban
{
public string WmsBillNum { set; get; }
public string MaterialCode { set; get; }
public string Kanban { set; get; }
public string WmsDate { set; get; }
}
public class KanbanUnSettledDapperRepository : DapperRepository<SettleAccountDbContext>, ITransientDependency
@ -139,6 +142,446 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
}
public virtual List<KanbanUnSettled> GetKanbanReportList(string version, string begintime, string endtime, string iscontionversion)
{
string contion = string.Empty;
//选中,是否过滤掉当期结算数据
if (iscontionversion == "0")
{
contion += string.Format(" WHERE Version <'{0}' and State=2 ", version);
}
else
{
contion += " WHERE 1=1 and State=2 ";
}
string str = string.Empty;
//str += " where 1=1 ";
if (!string.IsNullOrEmpty(begintime) && Convert.ToDateTime(begintime) != DateTime.MinValue)
{
str += string.Format(" and a.WMSActualGoodsDate >='{0}' ", begintime);
}
if (!string.IsNullOrEmpty(endtime) && Convert.ToDateTime(endtime) != DateTime.MinValue)
{
str += string.Format(" and a.WMSActualGoodsDate<='{0}' ", endtime);
}
string strDate = string.Empty;
//str += " where 1=1 ";
if (!string.IsNullOrEmpty(begintime) && Convert.ToDateTime(begintime) != DateTime.MinValue)
{
strDate += string.Format(" and WMSActualGoodsDate >='{0}' ", begintime);
}
if (!string.IsNullOrEmpty(endtime) && Convert.ToDateTime(endtime) != DateTime.MinValue)
{
strDate += string.Format(" and WMSActualGoodsDate<='{0}' ", endtime);
}
//财务又要把 有发货有结算,发货数量大于结算数量加上,又变了
string sql = "SELECT\n" +
" * \n" +
"FROM\n" +
" (\n" +
" SELECT\n" +
" * \n" +
" FROM\n" +
" (\n" +
" SELECT\n" +
" TEMP1.*,\n" +
" TEMP2.Price,\n" +
" ROUND( TEMP2.Price * TEMP1.DiffQty, 2 ) AS DiffAMT \n" +
" FROM\n" +
" (\n" +
" SELECT\n" +
" '' WmsBillNum,\n" +
" NULL BeginDate,\n" +
" a.Kanban,\n" +
" C.MaterialCode SapCode,\n" +
" C.MaterialDesc,\n" +
" C.CustomerPartCode,\n" +
" C.EstimateTypeDesc MaterialGroup,\n" +
" ISNULL( B.Qty, 0 ) SettleQty,\n" +
" ISNULL( a.WMSDeliveryQty, 0 ) WMSDeliveryQty,\n" +
" isnull( tt.qty, 0 ) BackQty,\n" +
" ( ISNULL( a.WMSDeliveryQty, 0 ) - ISNULL( b.Qty, 0 ) - isnull( tt.qty, 0 ) ) AS DiffQty \n" +
" FROM\n" +
" ( SELECT SUM ( WMSDeliveryQty ) WMSDeliveryQty, MaterialCode, Kanban FROM Set_WMSKanBanSettle WHERE 1 = 1 {1} GROUP BY MaterialCode, Kanban ) A\n" +
" LEFT JOIN ( SELECT SUM ( Qty ) Qty, Kanban, Extend1 AS MaterialCode FROM Set_WmsKanbanOutPutDetial {0} GROUP BY Kanban, Extend1 ) B ON A.Kanban = B.Kanban \n" +
" AND A.MaterialCode = B.MaterialCode\n" +
" LEFT JOIN Set_material AS C ON a.MaterialCode = C.CustomerPartCode\n" +
" LEFT JOIN set_backQty AS tt ON a.Kanban = tt.Code \n" +
" AND c.MaterialCode = tt.MaterialCode \n" +
" WHERE\n" +
" B.Kanban IS NULL \n" +
" AND B.MaterialCode IS NULL \n" +
" ) TEMP1\n" +
" LEFT JOIN ( SELECT Price, MaterialCode FROM Set_PriceList WHERE Version = '202110' ) TEMP2 ON TEMP1.SapCode = TEMP2.MaterialCode \n" +
" ) UNION1\n" +
" LEFT JOIN temp_vwkanban UNION2 ON UNION1.Kanban= UNION2.[看板号] \n" +
" AND UNION1.CustomerPartCode= UNION2.[客户零件号] \n" +
" WHERE\n" +
" UNION2.[看板号] IS NULL \n" +
" AND UNION2.[客户零件号] IS NULL \n" +
" ) UNION1 UNION ALL\n" +
"SELECT\n" +
" * \n" +
"FROM\n" +
" (\n" +
" SELECT\n" +
" * \n" +
" FROM\n" +
" (\n" +
" SELECT\n" +
" TEMP1.*,\n" +
" TEMP2.Price,\n" +
" ROUND( TEMP2.Price * TEMP1.DiffQty, 2 ) AS DiffAMT \n" +
" FROM\n" +
" (\n" +
" SELECT\n" +
" '' WmsBillNum,\n" +
" NULL BeginDate,\n" +
" a.Kanban,\n" +
" C.MaterialCode SapCode,\n" +
" C.MaterialDesc,\n" +
" C.CustomerPartCode,\n" +
" C.EstimateTypeDesc MaterialGroup,\n" +
" ISNULL( B.Qty, 0 ) SettleQty,\n" +
" ISNULL( a.WMSDeliveryQty, 0 ) WMSDeliveryQty,\n" +
" isnull( tt.qty, 0 ) BackQty,\n" +
" ( ISNULL( a.WMSDeliveryQty, 0 ) - ISNULL( b.Qty, 0 ) - isnull( tt.qty, 0 ) ) AS DiffQty \n" +
" FROM\n" +
" ( SELECT SUM ( WMSDeliveryQty ) WMSDeliveryQty, MaterialCode, Kanban FROM Set_WMSKanBanSettle WHERE 1 = 1 {1} GROUP BY MaterialCode, Kanban ) A\n" +
" INNER JOIN ( SELECT SUM ( Qty ) Qty, Kanban, Extend1 AS MaterialCode FROM Set_WmsKanbanOutPutDetial {0} GROUP BY Kanban, Extend1 ) B ON A.Kanban = B.Kanban \n" +
" AND A.MaterialCode = B.MaterialCode\n" +
" LEFT JOIN Set_material AS C ON a.MaterialCode = C.CustomerPartCode\n" +
" LEFT JOIN set_backQty AS tt ON a.Kanban = tt.Code \n" +
" AND c.MaterialCode = tt.MaterialCode \n" +
" WHERE\n" +
" a.WMSDeliveryQty> B.Qty \n" +
" AND ( a.WMSDeliveryQty- tt.Qty ) != B.Qty \n" +
" ) TEMP1\n" +
" LEFT JOIN ( SELECT Price, MaterialCode FROM Set_PriceList WHERE Version = '202110' ) TEMP2 ON TEMP1.SapCode = TEMP2.MaterialCode \n" +
" ) UNION1\n" +
" LEFT JOIN temp_vwkanban UNION2 ON UNION1.Kanban= UNION2.[看板号] \n" +
" AND UNION1.CustomerPartCode= UNION2.[客户零件号] \n" +
" WHERE\n" +
" UNION2.[看板号] IS NULL \n" +
" AND UNION2.[客户零件号] IS NULL \n" +
" ) UNION2";
//更改方案一
//string sql = "SELECT\n" +
//" * \n" +
//"FROM\n" +
//" (\n" +
//" SELECT\n" +
//" * \n" +
//" FROM\n" +
//" (\n" +
//" SELECT\n" +
//" TEMP1.*,\n" +
//" TEMP2.Price,\n" +
//" ROUND( TEMP2.Price * TEMP1.DiffQty, 2 ) AS DiffAMT \n" +
//" FROM\n" +
//" (\n" +
//" SELECT\n" +
//" '' WmsBillNum,\n" +
//" NULL BeginDate,\n" +
//" a.Kanban,\n" +
//" C.MaterialCode SapCode,\n" +
//" C.MaterialDesc,\n" +
//" C.CustomerPartCode,\n" +
//" C.EstimateTypeDesc MaterialGroup,\n" +
//" ISNULL( B.Qty, 0 ) SettleQty,\n" +
//" ISNULL( a.WMSDeliveryQty, 0 ) WMSDeliveryQty,\n" +
//" isnull( tt.qty, 0 ) BackQty,\n" +
//" ( ISNULL( a.WMSDeliveryQty, 0 ) - ISNULL( b.Qty, 0 ) - isnull( tt.qty, 0 ) ) AS DiffQty \n" +
//" FROM\n" +
//" ( SELECT SUM ( WMSDeliveryQty ) WMSDeliveryQty, MaterialCode, Kanban FROM Set_WMSKanBanSettle WHERE 1 = 1 {1} GROUP BY MaterialCode, Kanban ) A\n" +
//" LEFT JOIN ( SELECT SUM ( Qty ) Qty, Kanban, Extend1 AS MaterialCode FROM Set_WmsKanbanOutPutDetial {0} GROUP BY Kanban, Extend1 ) B ON A.Kanban = B.Kanban \n" +
//" AND A.MaterialCode = B.MaterialCode\n" +
//" LEFT JOIN Set_material AS C ON a.MaterialCode = C.CustomerPartCode\n" +
//" LEFT JOIN set_backQty AS tt ON a.Kanban = tt.Code \n" +
//" AND c.MaterialCode = tt.MaterialCode \n" +
//" WHERE\n" +
//" B.Kanban IS NULL \n" +
//" AND B.MaterialCode IS NULL \n" +
//" ) TEMP1\n" +
//" LEFT JOIN ( SELECT Price, MaterialCode FROM Set_PriceList WHERE Version = '202110' ) TEMP2 ON TEMP1.SapCode = TEMP2.MaterialCode \n" +
//" ) UNION1\n" +
//" LEFT JOIN temp_vwkanban UNION2 ON UNION1.Kanban= UNION2.[看板号] \n" +
//" AND UNION1.CustomerPartCode= UNION2.[客户零件号] \n" +
//" WHERE\n" +
//" UNION2.[看板号] IS NULL \n" +
//" AND UNION2.[客户零件号] IS NULL \n" +
//" ) aaa \n" +
//" WHERE 1=1";
#region 原定规则,又改了!
//string sql = "SELECT\n" +
//" * \n" +
//"FROM\n" +
//" (\n" +
//" SELECT\n" +
//" TEMP1.*,\n" +
//" TEMP2.Price,\n" +
//" ROUND( TEMP2.Price * TEMP1.DiffQty, 2 ) AS DiffAMT \n" +
//" FROM\n" +
//" (\n" +
//" SELECT\n" +
//" '' WmsBillNum,\n" +
//" NULL BeginDate,\n" +
//" a.Kanban,\n" +
//" C.MaterialCode SapCode,\n" +
//" C.MaterialDesc,\n" +
//" C.CustomerPartCode,\n" +
//" C.EstimateTypeDesc MaterialGroup,\n" +
//" ISNULL( B.Qty, 0 ) SettleQty,\n" +
//" ISNULL( a.WMSDeliveryQty, 0 ) WMSDeliveryQty,\n" +
//" isnull( tt.qty, 0 ) BackQty,\n" +
//" ( ISNULL( a.WMSDeliveryQty, 0 ) - ISNULL( b.Qty, 0 ) - isnull( tt.qty, 0 ) ) AS DiffQty \n" +
//" FROM\n" +
//" ( SELECT SUM ( WMSDeliveryQty ) WMSDeliveryQty, MaterialCode, Kanban FROM Set_WMSKanBanSettle WHERE 1=1 {1} GROUP BY MaterialCode, Kanban ) A\n" +
//" LEFT JOIN ( SELECT SUM ( Qty ) Qty, Kanban, MaterialCode FROM Set_KanBanSettle {0} GROUP BY Kanban, MaterialCode ) B ON A.Kanban = B.Kanban \n" +
//" AND A.MaterialCode = B.MaterialCode\n" +
//" LEFT JOIN Set_material AS C ON a.MaterialCode = C.CustomerPartCode\n" +
//" LEFT JOIN set_backQty AS tt ON a.Kanban = tt.Code \n" +
//" AND c.MaterialCode = tt.MaterialCode \n" +
//" WHERE\n" +
//" B.Kanban IS NULL \n" +
//" AND B.MaterialCode IS NULL \n" +
//" ) TEMP1\n" +
//" LEFT JOIN ( SELECT Price, MaterialCode FROM Set_PriceList WHERE Version = '202110' ) TEMP2 ON TEMP1.SapCode = TEMP2.MaterialCode \n" +
//" ) UNION1 UNION ALL\n" +
//"SELECT\n" +
//" * \n" +
//"FROM\n" +
//" (\n" +
//" SELECT\n" +
//" TEMP1.*,\n" +
//" TEMP2.Price,\n" +
//" ROUND( TEMP2.Price * TEMP1.DiffQty, 2 ) AS DiffAMT \n" +
//" FROM\n" +
//" (\n" +
//" SELECT\n" +
//" '' WmsBillNum,\n" +
//" NULL BeginDate,\n" +
//" a.Kanban,\n" +
//" C.MaterialCode SapCode,\n" +
//" C.MaterialDesc,\n" +
//" C.CustomerPartCode,\n" +
//" C.EstimateTypeDesc MaterialGroup,\n" +
//" ISNULL( B.Qty, 0 ) SettleQty,\n" +
//" ISNULL( a.WMSDeliveryQty, 0 ) WMSDeliveryQty,\n" +
//" isnull( tt.qty, 0 ) BackQty,\n" +
//" ( ISNULL( a.WMSDeliveryQty, 0 ) - ISNULL( b.Qty, 0 ) - isnull( tt.qty, 0 ) ) AS DiffQty \n" +
//" FROM\n" +
//" ( SELECT SUM ( WMSDeliveryQty ) WMSDeliveryQty, MaterialCode, Kanban FROM Set_WMSKanBanSettle WHERE 1=1 {1} GROUP BY MaterialCode, Kanban ) A\n" +
//" INNER JOIN ( SELECT SUM ( Qty ) Qty, Kanban, MaterialCode FROM Set_KanBanSettle {0} GROUP BY Kanban, MaterialCode ) B ON A.Kanban = B.Kanban \n" +
//" AND A.MaterialCode = B.MaterialCode\n" +
//" LEFT JOIN Set_material AS C ON a.MaterialCode = C.CustomerPartCode\n" +
//" LEFT JOIN set_backQty AS tt ON a.Kanban = tt.Code \n" +
//" AND c.MaterialCode = tt.MaterialCode \n" +
//" WHERE\n" +
//" a.WMSDeliveryQty> B.Qty AND (a.WMSDeliveryQty-tt.Qty)!=B.Qty \n" +
//" ) TEMP1\n" +
//" LEFT JOIN ( SELECT Price, MaterialCode FROM Set_PriceList WHERE Version = '202110' ) TEMP2 ON TEMP1.SapCode = TEMP2.MaterialCode \n" +
//" ) UNION2";
//20220424-财务要求:大众看板待设置不出现在未结数据里-更新
//string sql = "SELECT\n" +
//" * \n" +
//"FROM\n" +
//" (\n" +
//" SELECT\n" +
//" * \n" +
//" FROM\n" +
//" (\n" +
//" SELECT\n" +
//" * \n" +
//" FROM\n" +
//" (\n" +
//" SELECT\n" +
//" TEMP1.*,\n" +
//" TEMP2.Price,\n" +
//" ROUND( TEMP2.Price * TEMP1.DiffQty, 2 ) AS DiffAMT \n" +
//" FROM\n" +
//" (\n" +
//" SELECT\n" +
//" '' WmsBillNum,\n" +
//" NULL BeginDate,\n" +
//" a.Kanban,\n" +
//" C.MaterialCode SapCode,\n" +
//" C.MaterialDesc,\n" +
//" C.CustomerPartCode,\n" +
//" C.EstimateTypeDesc MaterialGroup,\n" +
//" ISNULL( B.Qty, 0 ) SettleQty,\n" +
//" ISNULL( a.WMSDeliveryQty, 0 ) WMSDeliveryQty,\n" +
//" isnull( tt.qty, 0 ) BackQty,\n" +
//" ( ISNULL( a.WMSDeliveryQty, 0 ) - ISNULL( b.Qty, 0 ) - isnull( tt.qty, 0 ) ) AS DiffQty \n" +
//" FROM\n" +
//" ( SELECT SUM ( WMSDeliveryQty ) WMSDeliveryQty, MaterialCode, Kanban FROM Set_WMSKanBanSettle WHERE 1 = 1 {1} GROUP BY MaterialCode, Kanban ) A\n" +
//" LEFT JOIN ( SELECT SUM ( Qty ) Qty, Kanban, MaterialCode FROM Set_KanBanSettle {0} GROUP BY Kanban, MaterialCode ) B ON A.Kanban = B.Kanban \n" +
//" AND A.MaterialCode = B.MaterialCode\n" +
//" LEFT JOIN Set_material AS C ON a.MaterialCode = C.CustomerPartCode\n" +
//" LEFT JOIN set_backQty AS tt ON a.Kanban = tt.Code \n" +
//" AND c.MaterialCode = tt.MaterialCode \n" +
//" WHERE\n" +
//" B.Kanban IS NULL \n" +
//" AND B.MaterialCode IS NULL \n" +
//" ) TEMP1\n" +
//" LEFT JOIN ( SELECT Price, MaterialCode FROM Set_PriceList WHERE Version = '202110' ) TEMP2 ON TEMP1.SapCode = TEMP2.MaterialCode \n" +
//" ) UNION1 UNION ALL\n" +
//" SELECT\n" +
//" * \n" +
//" FROM\n" +
//" (\n" +
//" SELECT\n" +
//" TEMP1.*,\n" +
//" TEMP2.Price,\n" +
//" ROUND( TEMP2.Price * TEMP1.DiffQty, 2 ) AS DiffAMT \n" +
//" FROM\n" +
//" (\n" +
//" SELECT\n" +
//" '' WmsBillNum,\n" +
//" NULL BeginDate,\n" +
//" a.Kanban,\n" +
//" C.MaterialCode SapCode,\n" +
//" C.MaterialDesc,\n" +
//" C.CustomerPartCode,\n" +
//" C.EstimateTypeDesc MaterialGroup,\n" +
//" ISNULL( B.Qty, 0 ) SettleQty,\n" +
//" ISNULL( a.WMSDeliveryQty, 0 ) WMSDeliveryQty,\n" +
//" isnull( tt.qty, 0 ) BackQty,\n" +
//" ( ISNULL( a.WMSDeliveryQty, 0 ) - ISNULL( b.Qty, 0 ) - isnull( tt.qty, 0 ) ) AS DiffQty \n" +
//" FROM\n" +
//" ( SELECT SUM ( WMSDeliveryQty ) WMSDeliveryQty, MaterialCode, Kanban FROM Set_WMSKanBanSettle WHERE 1 = 1 {1} GROUP BY MaterialCode, Kanban ) A\n" +
//" INNER JOIN ( SELECT SUM ( Qty ) Qty, Kanban, MaterialCode FROM Set_KanBanSettle {0} GROUP BY Kanban, MaterialCode ) B ON A.Kanban = B.Kanban \n" +
//" AND A.MaterialCode = B.MaterialCode\n" +
//" LEFT JOIN Set_material AS C ON a.MaterialCode = C.CustomerPartCode\n" +
//" LEFT JOIN set_backQty AS tt ON a.Kanban = tt.Code \n" +
//" AND c.MaterialCode = tt.MaterialCode \n" +
//" WHERE\n" +
//" a.WMSDeliveryQty> B.Qty \n" +
//" AND ( a.WMSDeliveryQty- tt.Qty ) != B.Qty \n" +
//" ) TEMP1\n" +
//" LEFT JOIN ( SELECT Price, MaterialCode FROM Set_PriceList WHERE Version = '202110' ) TEMP2 ON TEMP1.SapCode = TEMP2.MaterialCode \n" +
//" ) UNION2 \n" +
//" ) UNION12\n" +
//" LEFT JOIN temp_vwkanban UNION3 ON UNION12.Kanban= UNION3.[看板号] \n" +
//" AND UNION12.CustomerPartCode= UNION3.[客户零件号] \n" +
//" WHERE\n" +
//" UNION3.[看板号] IS NULL \n" +
//" AND UNION3.[客户零件号] IS NULL \n" +
//" ) aaa \n" +
//"WHERE\n" +
//" aaa.CustomerPartCode NOT IN ( '30G839904A041', '80D867172KJ7' ) ";
//财务香凝要求:交货数量-退货数量=结算数量 这样的不体现在未结中
#endregion
sql = string.Format(sql,contion,strDate);
//发运数据中,查出看板号+物料号相同的重复数据
var sql2 = "SELECT\n" +
" a.WMSDeliveryNote WmsBillNum,\n" +
" t1.MaterialCode MaterialCode,\n" +
" a.Kanban ,\n" +
" A.WMSActualGoodsDate WmsDate \n" +
"FROM\n" +
" Set_WMSKanBanSettle A\n" +
" INNER JOIN ( SELECT MaterialCode, Kanban FROM Set_WMSKanBanSettle GROUP BY MaterialCode, Kanban HAVING COUNT ( * ) > 1 ) B ON A.Kanban = B.Kanban \n" +
" AND A.MaterialCode = B.MaterialCode\n" +
" LEFT JOIN Set_material t1 ON a.MaterialCode= t1.CustomerPartCode\n" +
" WHERE 1=1 {0}";
var _sql2= string.Format(sql2, str);
var listCompare = DbConnection.Query<CompareKanban>(_sql2);
//查询发运表中,看权号+物料号没有重复的数据
var sql3 = "SELECT\n" +
" a.WMSDeliveryNote WmsBillNum,\n" +
" t1.MaterialCode MaterialCode,\n" +
" a.Kanban,\n" +
" A.WMSActualGoodsDate WmsDate \n" +
"FROM\n" +
" Set_WMSKanBanSettle A\n" +
" LEFT JOIN ( SELECT MaterialCode, Kanban FROM Set_WMSKanBanSettle GROUP BY MaterialCode, Kanban HAVING COUNT ( * ) > 1 ) B ON A.Kanban = B.Kanban \n" +
" AND A.MaterialCode = B.MaterialCode\n" +
" LEFT JOIN Set_material t1 ON a.MaterialCode= t1.CustomerPartCode \n" +
"WHERE\n" +
" B.Kanban IS NULL {0}";
var _sql3 = string.Format(sql3, str);
var listCompare1 = DbConnection.Query<CompareKanban>(_sql3);
//发运数据比较
List<CompareKanban> _ls = new List<CompareKanban>();
foreach (var itm in listCompare.ToList())
{
var first = _ls.FirstOrDefault(p => p.Kanban == itm.Kanban && p.MaterialCode == itm.MaterialCode);
if (first != null)
{
if (!string.IsNullOrEmpty(itm.WmsDate))
{
itm.WmsDate = DateTime.Parse(itm.WmsDate).ToShortDateString();
}
first.WmsBillNum += "," + itm.WmsBillNum;
first.WmsDate += "," + itm.WmsDate;
}
else
{
if (!string.IsNullOrEmpty(itm.WmsDate))
{
itm.WmsDate = DateTime.Parse(itm.WmsDate).ToShortDateString();
}
_ls.Add(itm);
}
}
foreach (var itm in listCompare1.ToList())
{
if (!string.IsNullOrEmpty(itm.WmsDate))
{
itm.WmsDate = DateTime.Parse(itm.WmsDate).ToShortDateString();
}
_ls.Add(itm);
}
var _query = DbConnection.Query<KanbanUnSettled>(sql, null, null, true, 1200, null);
var _list = _query.ToList();
//数据整合,相同看板号+物料号的交货单号合并成一行中以逗号分隔
foreach (var itm1 in _list)
{
var itm = _ls.FirstOrDefault(p => p.Kanban == itm1.Kanban && p.MaterialCode == itm1.SapCode);
if (itm != null)
{
itm1.WmsBillNum = itm.WmsBillNum;
itm1.BeginDate = itm.WmsDate;
}
}
return _list;
}
/// <summary>
/// 原始看板未结数据
/// </summary>
/// <param name="version"></param>
/// <param name="begintime"></param>
/// <param name="endtime"></param>
/// <param name="iscontionversion"></param>
/// <returns></returns>
public virtual List<KanbanUnSettled> GetOriginalKanbanReportList(string version, string begintime, string endtime, string iscontionversion)
{
string contion = string.Empty;
//选中,是否过滤掉当期结算数据
@ -191,15 +634,96 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" B.Kanban IS NULL \n" +
" AND B.MaterialCode IS NULL {0}\n" +
" ) TEMP1\n" +
" LEFT JOIN ( SELECT Price, MaterialCode FROM Set_PriceList WHERE version = ( SELECT MAX ( Version ) FROM Set_PriceList ) ) TEMP2 ON TEMP1.SapCode = TEMP2.MaterialCode";
" LEFT JOIN ( SELECT Price, MaterialCode FROM Set_PriceList WHERE Version = '202110' ) TEMP2 ON TEMP1.SapCode = TEMP2.MaterialCode";
sql = string.Format(sql, str, contion);
var _query = DbConnection.Query<KanbanUnSettled>(sql, null, null, true, 1200, null);
var _list = _query.ToList();
return _list;
}
/// <summary>
/// 有发货有结算,且发货数量大于结算数量的数据,将要整合到未结数据中
/// </summary>
/// <param name="version"></param>
/// <param name="begintime"></param>
/// <param name="endtime"></param>
/// <param name="iscontionversion"></param>
/// <returns></returns>
public virtual List<KanbanUnSettled> GetWMSKanbanReportList(string version, string begintime, string endtime, string iscontionversion)
{
string contion = string.Empty;
//选中,是否过滤掉当期结算数据
if (iscontionversion == "0")
{
contion += string.Format(" WHERE Version <'{0}' ", version);
}
else
{
contion += " WHERE 1=1 ";
}
string str = string.Empty;
//str += " where 1=1 ";
if (!string.IsNullOrEmpty(begintime) && Convert.ToDateTime(begintime) != DateTime.MinValue)
{
str += string.Format(" and a.WMSActualGoodsDate >='{0}' ", begintime);
}
if (!string.IsNullOrEmpty(endtime) && Convert.ToDateTime(endtime) != DateTime.MinValue)
{
str += string.Format(" and a.WMSActualGoodsDate<='{0}' ", endtime);
}
string sql = "SELECT\n" +
" TEMP1.*,\n" +
" TEMP2.Price,\n" +
" ROUND( TEMP2.Price * TEMP1.DiffQty, 2 ) AS DiffAMT \n" +
"FROM\n" +
" (\n" +
" SELECT\n" +
" a.WMSDeliveryNote WmsBillNum,\n" +
" CONVERT ( VARCHAR ( 100 ), a.WMSActualGoodsDate, 23 ) BeginDate,\n" +
" a.Kanban,\n" +
" C.MaterialCode SapCode,\n" +
" C.MaterialDesc,\n" +
" C.CustomerPartCode,\n" +
" C.EstimateTypeDesc MaterialGroup,\n" +
" ISNULL( B.Qty, 0 ) SettleQty,\n" +
" ISNULL( a.WMSDeliveryQty, 0 ) WMSDeliveryQty,\n" +
" isnull( tt.qty, 0 ) BackQty,\n" +
" ( ISNULL( a.WMSDeliveryQty, 0 ) - ISNULL( b.Qty, 0 ) - isnull( tt.qty, 0 ) ) AS DiffQty \n" +
" FROM\n" +
" ( SELECT SUM ( WMSDeliveryQty ) WMSDeliveryQty, MaterialCode, WMSDeliveryNote, Kanban, WMSActualGoodsDate FROM Set_WMSKanBanSettle GROUP BY MaterialCode, WMSDeliveryNote, Kanban, WMSActualGoodsDate ) A\n" +
" INNER JOIN ( SELECT SUM ( Qty ) Qty, Kanban, MaterialCode FROM Set_KanBanSettle {1} GROUP BY Kanban, MaterialCode ) B ON A.Kanban = B.Kanban\n" +
" AND A.MaterialCode = B.MaterialCode\n" +
" LEFT JOIN Set_material AS C ON a.MaterialCode = C.CustomerPartCode\n" +
" LEFT JOIN ( SELECT * FROM set_backQty ) AS tt ON a.Kanban = tt.Code \n" +
" AND a.MaterialCode = b.MaterialCode \n" +
" WHERE\n" +
" a.WMSDeliveryQty> B.Qty {0}\n" +
" ) TEMP1\n" +
" LEFT JOIN ( SELECT Price, MaterialCode FROM Set_PriceList WHERE Version = '202110' ) TEMP2 ON TEMP1.SapCode = TEMP2.MaterialCode";
sql = string.Format(sql, str, contion);
var _query = DbConnection.Query<KanbanUnSettled>(sql, null, null, true, 1200, null);
var _list = _query.ToList();
return _list;
}
public virtual List<KanbanUnSettledExtend> GetNoKanbanReportList(string version, string begintime, string endtime)
{
var sql = "SELECT\n" +
@ -222,7 +746,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" LEFT JOIN ( SELECT sum( qty ) Qty, MaterialCode FROM Set_KanBanSettle GROUP BY MaterialCode ) b ON a.MaterialCode = b.MaterialCode\n" +
" LEFT JOIN Set_material AS C ON a.MaterialCode = C.CustomerPartCode \n" +
" ) temp1\n" +
" LEFT JOIN ( SELECT Price, MaterialCode FROM Set_PriceList WHERE version = ( SELECT MAX( Version ) FROM Set_PriceList ) ) TEMP2 ON TEMP1.SapCode = TEMP2.MaterialCode";
" LEFT JOIN ( SELECT Price, MaterialCode FROM Set_PriceList WHERE Version = '202110' ) TEMP2 ON TEMP1.SapCode = TEMP2.MaterialCode";
string str = string.Empty;
str += " where 1=1 ";
var _query = DbConnection.Query<KanbanUnSettledExtend>(sql, null, null, true, 1200, null);
@ -247,7 +771,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" temp2.Price AS SalePrice \n" +
", temp1.ClaimQty \n"+
",temp1.CP7ScrapQty \n"+
", temp1.CP7ScrapQty \n"+
" FROM\n" +
" (\n" +

235
src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettleKBWithCodeDapperReportRepository.cs

@ -38,56 +38,77 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
{
condition += string.Format(" and c.WMSActualGoodsDate>='{0}' ", begintime);
}
if (!string.IsNullOrEmpty(endtime) && Convert.ToDateTime(begintime) != DateTime.MinValue)
if (!string.IsNullOrEmpty(endtime) && Convert.ToDateTime(endtime) != DateTime.MinValue)
{
condition += string.Format(" and c.WMSActualGoodsDate<='{0}' ", endtime);
}
var datestr= version.Substring(0, 4) +"-"+ version.Substring(4, 2) + "-01";
var date= DateTime.Parse(datestr).AddMonths(1).AddDays(-1);
var datetime=date.ToShortDateString()+" 23:59:59 ";
string sqlString = "SELECT\n" +
" * ,\n" +
" ISNULL( temp1.InvoicePrice * Qty, 0 ) AS InvoiceMoney,--开票金额\n" +
" ISNULL( Price * WMSDeliveryQty, 0 ) AS Amount,--金额\n" +
" ISNULL( Price * Qty, 0 ) AS SettlePrice,--结算金额\n" +
" ( Price - InvoicePrice ) AS InvoiceDiffPrice,--单价差异\n" +
" ISNULL( Price * Qty - InvoicePrice * Qty, 0 ) AS SumDiffMoney,--总金额差异\n" +
" '' DeliveryOrderNo --出库单号\n" +
" \n" +
"FROM\n" +
" (\n" +
" SELECT\n" +
" row_number ( ) OVER ( ORDER BY b.EstimateTypeDesc ) AS RowId,\n" +
" c.WMSDeliveryNote,--交货单号\n" +
" CONVERT ( VARCHAR ( 100 ), c.WMSActualGoodsDate, 23 ) AS WMSActualGoodsDate,--实际发货日期年-月-日\n" +
" a.Kanban,--条码号\n" +
" b.MaterialCode SapMaterialCode,--厂内物料号\n" +
" b.MaterialDesc,--物料描述\n" +
" b.CustomerPartCode,--客户物料\n" +
" b.EstimateTypeDesc,--物料组(车型)\n" +
" c.WMSDeliveryQty,--交货数量\n" +
" ISNULL( a.Qty, 0 ) AS SettleNumber,--结算数量\n" +
" CONVERT ( VARCHAR ( 100 ), a.SettleDate, 23 ) SettleDate,--结算日期\n" +
" ISNULL( a.Qty, 0 ) AS Qty,--用于计算\n" +
" ( ISNULL( a.Qty, 0 ) - ISNULL( c.WMSDeliveryQty, 0 ) ) AS SettleWMSDiffQty,--结算与发货差异\n" +
" 0 AS SettleInvoiceDiffQty,--结算与开票差异\n" +
" ISNULL( a.Qty, 0 ) AS InvoiceDiffQty,--开票数量,默认0,后续拿算法动态算\n" +
" ISNULL( d.InvoicePrice, 0 ) InvoicePrice --开票单价\n" +
" \n" +
" FROM\n" +
" Set_KanBanSettle AS a\n" +
" LEFT JOIN Set_material AS b ON a.MaterialCode= b.CustomerPartCode\n" +
" LEFT JOIN Set_WMSKanBanSettle c ON a.Kanban= c.Kanban \n" +
" AND a.MaterialCode= c.MaterialCode\n" +
" LEFT JOIN ( SELECT SUM ( amt ) / SUM ( Qty ) InvoicePrice, MaterialCode FROM set_invoice WHERE version = '{0}' GROUP BY materialcode ) d ON a.MaterialCode= d.MaterialCode \n" +
" WHERE\n" +
" a.VERSION= '{0}' {1} \n" +
" ) TEMP1\n" +
" LEFT JOIN ( SELECT Price, --定价\n" +
" MaterialCode --厂内物料号\n" +
" FROM Set_PriceList WHERE version = ( SELECT MAX ( Version ) FROM Set_PriceList ) ) TEMP2 ON TEMP1.SapMaterialCode= TEMP2.MaterialCode \n" +
"WHERE\n" +
" 1 =1";
" temp1.* ,\n" +
" ISNULL ( temp2.Price, 0 ) AS Price,--开票金额\n" +
" ISNULL ( temp1.InvoicePrice * temp1.Qty, 0 ) AS InvoiceMoney,--开票金额\n" +
" ISNULL ( Price * WMSDeliveryQty, 0 ) AS Amount,--金额\n" +
" ISNULL ( InvoicePrice * temp1.Qty, 0 ) AS SettlePrice,--结算金额\n" +
" ( Price - InvoicePrice ) AS InvoiceDiffPrice,--单价差异\n" +
" ISNULL ( Price * temp1.Qty - InvoicePrice * temp1.Qty, 0 ) AS SumDiffMoney,--总金额差异\n" +
" '' DeliveryOrderNo,--出库单号\n" +
" ISNULL ( temp3.Qty, 0 ) ReturnQty,\n" +
" WMSDeliveryQty - ISNULL ( temp3.Qty, 0 ) RealQty \n" +
"FROM\n" +
" (\n" +
" SELECT ROW_NUMBER\n" +
" ( ) OVER ( ORDER BY b.EstimateTypeDesc ) AS RowId,\n" +
" A.Kanban,--条码号\n" +
" b.MaterialCode,--厂内物料号\n" +
" b.MaterialDesc,--物料描述\n" +
" b.CustomerPartCode,--客户物料\n" +
" b.EstimateTypeDesc,--物料组(车型)\n" +
" C.WMSDeliveryQty,--交货数量\n" +
" ISNULL ( A.Qty, 0 ) AS SettleNumber,--结算数量\n" +
" CONVERT ( VARCHAR ( 100 ), A.SettleDate, 23 ) SettleDate,--结算日期\n" +
" ISNULL ( A.Qty, 0 ) AS Qty,--用于计算\n" +
" ( ISNULL ( A.Qty, 0 ) - ISNULL ( C.WMSDeliveryQty, 0 ) ) AS SettleWMSDiffQty,--结算与发货差异\n" +
" 0 AS SettleInvoiceDiffQty,--结算与开票差异\n" +
" ISNULL ( A.Qty, 0 ) AS InvoiceDiffQty,--开票数量,默认0,后续拿算法动态算\n" +
" ISNULL ( d.InvoicePrice, 0 ) InvoicePrice --开票单价\n" +
" \n" +
" FROM\n" +
" Set_KanBanSettle\n" +
" AS A LEFT JOIN Set_material AS b ON A.MaterialCode = b.CustomerPartCode\n" +
" LEFT JOIN (\n" +
"   SELECT\n" +
" ( temp1.Qty - ISNULL ( temp2.Qty, 0 ) ) WMSDeliveryQty,\n" +
" temp1.MaterialCode,\n" +
" temp1.Kanban \n" +
" FROM\n" +
" (\n" +
" ( SELECT SUM ( WMSDeliveryQty ) Qty, KanBan, MaterialCode FROM Set_WMSKanBanSettle GROUP BY KanBan, MaterialCode ) temp1\n" +
" LEFT JOIN ( SELECT SUM ( Qty ) Qty, Kanban, MaterialCode FROM Set_KanBanSettle WHERE VERSION < '{0}' GROUP BY kanban, MaterialCode ) temp2 ON temp1.Kanban = temp2.KanBan \n" +
" AND temp1.MaterialCode = temp2.MaterialCode \n" +
" ) \n" +
" ) C ON A.Kanban = C.Kanban \n" +
" AND A.MaterialCode = C.MaterialCode\n" +
" LEFT JOIN ( SELECT SUM ( amt ) / SUM ( Qty ) InvoicePrice, MaterialCode FROM set_invoice WHERE VERSION = '{0}' GROUP BY materialcode ) d ON A.MaterialCode = d.MaterialCode \n" +
" WHERE\n" +
" A.VERSION = '{0}' {1} \n" +
" ) TEMP1\n" +
" LEFT JOIN set_backQty temp3 ON temp1.Kanban = temp3.Code and temp1.MaterialCode=temp3.MaterialCode \n" +
" LEFT JOIN ( SELECT Price, --定价\n" +
" MaterialCode --厂内物料号\n" +
" FROM Set_PriceList WHERE VERSION = ( SELECT MAX ( VERSION ) FROM Set_PriceList ) ) TEMP2 ON TEMP1.MaterialCode = TEMP2.MaterialCode \n" +
"WHERE\n" +
" 1 = 1;";
string addwhere = string.Empty;
string addSqlStr = string.Format(sqlString, version, condition);
string addSqlStr = string.Format(sqlString, version, condition,datetime);
//if (!string.IsNullOrEmpty(kanBan))
//{
@ -108,8 +129,122 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
string _sql = string.Format(addSqlStr, addwhere);
var _query = DbConnection.Query<SettleKBWithCode>(_sql, null, null, true, 1200, null);
return _query.ToList();
var _lst = _query.ToList();
var sql1 = "SELECT \n" +
" A.WMSDeliveryNote WmsBillNum,\n" +
" t1.MaterialCode MaterialCode,\n" +
" A.Kanban,\n" +
" A.WMSActualGoodsDate WmsDate \n" +
" FROM\n" +
" Set_WMSKanBanSettle\n" +
" A INNER JOIN ( SELECT MaterialCode, Kanban FROM Set_WMSKanBanSettle GROUP BY MaterialCode, Kanban HAVING COUNT(1) = 1 ) B ON A.Kanban = B.Kanban \n" +
" AND A.MaterialCode = B.MaterialCode \n" +
" LEFT JOIN Set_material t1 ON A.MaterialCode = t1.CustomerPartCode where A.WMSDeliveryNote is not null\n";
var listCompare1 = DbConnection.Query<CompareExtend>(sql1);
List<CompareExtend> _ls1 = new List<CompareExtend>();
foreach (var itm in listCompare1.ToList())
{
var first = _ls1.FirstOrDefault(p => p.Kanban == itm.Kanban && p.MaterialCode == itm.MaterialCode);
if (first != null)
{
if (!string.IsNullOrEmpty(itm.WmsDate))
{
itm.WmsDate = DateTime.Parse(itm.WmsDate).ToShortDateString();
}
first.WmsBillNum += "," + itm.WmsBillNum;
first.WmsDate += "," + itm.WmsDate;
}
else
{
if (!string.IsNullOrEmpty(itm.WmsDate))
{
itm.WmsDate = DateTime.Parse(itm.WmsDate).ToShortDateString();
}
_ls1.Add(itm);
}
}
var sql2 = "SELECT \n" +
" A.WMSDeliveryNote WmsBillNum,\n" +
" t1.MaterialCode MaterialCode,\n" +
" A.Kanban,\n" +
" A.WMSActualGoodsDate WmsDate \n" +
" FROM\n" +
" Set_WMSKanBanSettle\n" +
" A INNER JOIN ( SELECT MaterialCode, Kanban FROM Set_WMSKanBanSettle GROUP BY MaterialCode, Kanban HAVING COUNT(*)> 1 ) B ON A.Kanban = B.Kanban \n" +
" AND A.MaterialCode = B.MaterialCode\n" +
" LEFT JOIN Set_material t1 ON A.MaterialCode = t1.CustomerPartCode";
var listCompare = DbConnection.Query<CompareExtend>(sql2);
List<CompareExtend> _ls = new List<CompareExtend>();
foreach (var itm in listCompare.ToList())
{
var first = _ls.FirstOrDefault(p => p.Kanban == itm.Kanban && p.MaterialCode == itm.MaterialCode);
if (first != null)
{
if (!string.IsNullOrEmpty(itm.WmsDate))
{
itm.WmsDate = DateTime.Parse(itm.WmsDate).ToShortDateString();
}
first.WmsBillNum += "," + itm.WmsBillNum;
first.WmsDate += "," + itm.WmsDate;
}
else
{
if (!string.IsNullOrEmpty(itm.WmsDate))
{
itm.WmsDate = DateTime.Parse(itm.WmsDate).ToShortDateString();
}
_ls.Add(itm);
}
}
foreach (var itm1 in _lst)
{
itm1.SettleWMSDiffQty = itm1.SettleNumber -( (!string.IsNullOrEmpty(itm1.RealQty))?decimal.Parse(itm1.RealQty): 0);
var item = _ls1.FirstOrDefault(p => p.Kanban == itm1.Kanban && p.MaterialCode == itm1.MaterialCode);
if (item != null)
{
itm1.WMSDeliveryNote = item.WmsBillNum;
itm1.WMSActualGoodsDate = item.WmsDate;
}
var itm = _ls.FirstOrDefault(p => p.Kanban == itm1.Kanban && p.MaterialCode == itm1.MaterialCode);
if (itm != null)
{
itm1.WMSDeliveryNote = itm.WmsBillNum;
itm1.WMSActualGoodsDate = itm.WmsDate;
}
}
return _lst;
}
@ -237,8 +372,8 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
[ExporterHeader(DisplayName = "交货单号")]
public string WMSDeliveryNote { set; get; }
[ExporterHeader(DisplayName = "实际发货日期", Format = "yyyy-MM-dd")]
public DateTime WMSActualGoodsDate { set; get; }
[ExporterHeader(DisplayName = "实际发货日期")]
public string WMSActualGoodsDate { set; get; }
[ExporterHeader(DisplayName = "条码号")]
public string Kanban { set; get; }
@ -301,7 +436,11 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
[ExporterHeader(DisplayName = "出库单号")]
public string DeliveryOrderNo { set; get; }
[ExporterHeader(DisplayName = "退货数量")]
public string ReturnQty { set; get; }
[ExporterHeader(DisplayName = "实际交货数量")]
public string RealQty { set; get; }
}

129
src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettleSparePart90DapperReportRepository.cs

@ -12,7 +12,7 @@ using Volo.Abp.EntityFrameworkCore;
namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
{
/// <summary>
/// 根据虚拟单号0-90天的是按照SAP物料号进行先进先出操作
/// 大众备件明细输出,
/// </summary>
public class SettleSparePart90DapperReportRepository : DapperRepository<SettleAccountDbContext>, ITransientDependency
{
@ -21,7 +21,113 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
{ }
/// <summary>
/// 大众备件数据调整:期初没有WMS发运数据,调整的数据就是给WMS一份,给结算一份
/// </summary>
/// <param name="purchaseOrderNo"></param>
/// <param name="version"></param>
/// <param name="sapCode"></param>
/// <param name="matialCode"></param>
/// <param name="begintime"></param>
/// <param name="endtime"></param>
/// <returns></returns>
public virtual List<SettleSparePart90Export> GetSettleSparePart90ReportList(string purchaseOrderNo, string version, string sapCode, string matialCode,
string begintime, string endtime)
{
string sqlString = "SELECT\n" +
" temp1.交货日期,\n" +
" temp1.交货单号,\n" +
" '' 订单日期,\n" +
" temp1.采购订单号,\n" +
" temp1.SAP编码,\n" +
" temp1.物料代码,\n" +
" temp1.物料描述,\n" +
" temp1.采购订单文本,\n" +
" temp1.发货数量,\n" +
" temp1.开票数量,\n" +
" ISNULL( temp1.发货数量, 0 ) - ISNULL( temp1.开票数量, 0 ) AS 发货与开票差异,\n" +
" temp1.开票单价,\n" +
" ISNULL( temp1.开票金额, 0 ) AS 开票金额,\n" +
" ISNULL( TEMP2.Price, 0 ) AS 定价,\n" +
" temp1.开票单价 - ISNULL( TEMP2.Price, 0 ) AS 单价差异 ,\n" +
" ( temp1.开票单价 - ISNULL( TEMP2.Price, 0 ) ) * temp1.开票数量 AS 差异总金额 \n" +
"FROM\n" +
" (\n" +
" SELECT\n" +
" a.Version AS 期间,\n" +
" a.PurchaseOrderNoText AS 采购订单文本,\n" +
" b.WMSDeliveryNote AS 交货单号,\n" +
" b.SpareDate AS 交货日期,\n" +
" a.PurchaseOrderNo AS 采购订单号,\n" +
" c.MaterialCode AS SAP编码,\n" +
" b.MaterialCode AS 物料代码,\n" +
" c.MaterialDesc AS 物料描述,\n" +
" c.EstimateTypeDesc AS 物料组,\n" +
" a.PurchasePriceNoTax AS 开票单价,\n" +
" 0 AS 数量差异,\n" +
" ISNULL( b.ReceiptQty, 0 ) AS 发货数量,\n" +
" ISNULL( a.InvoicedQty, 0 ) AS 开票数量 ,\n" +
" ISNULL( a.AmountNoTax, 0 ) AS 开票金额 \n" +
" FROM\n" +
" (\n" +
" SELECT SUM\n" +
" ( ReceiptQty ) AS ReceiptQty,\n" +
" PurchaseOrderNo,\n" +
" MaterialCode,\n" +
" Version,\n" +
" PurchasePriceNoTax,\n" +
" InvoicedQty,\n" +
" PurchaseOrderNoText,\n" +
" AmountNoTax \n" +
" FROM\n" +
" Set_SparePart where Extend='is90' \n" +
" GROUP BY\n" +
" PurchaseOrderNo,\n" +
" MaterialCode,\n" +
" Version,\n" +
" PurchasePriceNoTax,\n" +
" InvoicedQty,\n" +
" PurchaseOrderNoText,\n" +
" AmountNoTax \n" +
" ) AS a\n" +
" INNER JOIN (\n" +
" SELECT SUM\n" +
" ( ReceiptQty ) AS ReceiptQty,\n" +
" PurchaseOrderNo,\n" +
" SapCode,\n" +
" MaterialCode,\n" +
" WMSDeliveryNote,\n" +
" SpareDate \n" +
" FROM\n" +
" Set_WMSSparePart \n" +
" GROUP BY\n" +
" PurchaseOrderNo,\n" +
" SapCode,\n" +
" MaterialCode,\n" +
" WMSDeliveryNote,\n" +
" SpareDate \n" +
" ) AS b ON a.PurchaseOrderNo = b.PurchaseOrderNo \n" +
" AND a.MaterialCode = b.MaterialCode\n" +
" LEFT OUTER JOIN Set_material AS c ON a.MaterialCode = c.CustomerPartCode \n" +
" WHERE\n" +
" ( a.Version = '{0}' ) \n" +
" ) AS temp1\n" +
" LEFT OUTER JOIN ( SELECT Price, MaterialCode FROM Set_PriceList WHERE Version = '202110' ) AS TEMP2 ON temp1.SAP编码 = TEMP2.MaterialCode \n" +
"ORDER BY\n" +
" temp1.采购订单号";
string addwhere = string.Empty;
string addSqlStr = string.Format(sqlString, version);
string _sql = string.Format(addSqlStr, addwhere);
//string _sql = string.Format(sqlString, version);
var _query = DbConnection.Query<SettleSparePart90Export>(_sql, null, null, true, 1200, null);
return _query.ToList();
}
public virtual List<SettleSparePart90Export> GetSettleSparePart90ReportList_old(string purchaseOrderNo, string version, string sapCode, string matialCode,
string begintime, string endtime)
{
string sqlString = "SELECT\n" +
@ -70,7 +176,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" PurchaseOrderNoText,\n" +
" AmountNoTax \n" +
" FROM\n" +
" Set_SparePart \n" +
" Set_SparePart where Extend='is90' \n" +
" GROUP BY\n" +
" PurchaseOrderNo,\n" +
" MaterialCode,\n" +
@ -102,7 +208,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" WHERE\n" +
" ( a.Version = '{0}' ) \n" +
" ) AS temp1\n" +
" LEFT OUTER JOIN ( SELECT Price, MaterialCode FROM Set_PriceList WHERE ( Version = ( SELECT MAX ( Version ) AS Expr1 FROM Set_PriceList ) ) ) AS TEMP2 ON temp1.SAP编码 = TEMP2.MaterialCode \n" +
" LEFT OUTER JOIN ( SELECT Price, MaterialCode FROM Set_PriceList WHERE Version = '202110' ) AS TEMP2 ON temp1.SAP编码 = TEMP2.MaterialCode \n" +
"ORDER BY\n" +
" temp1.采购订单号";
@ -116,7 +222,16 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
}
/// <summary>
/// 大众备件未结明细
/// </summary>
/// <param name="purchaseOrderNo"></param>
/// <param name="version"></param>
/// <param name="sapCode"></param>
/// <param name="matialCode"></param>
/// <param name="begintime"></param>
/// <param name="endtime"></param>
/// <returns></returns>
public virtual List<SettleSparePart90Export> GetUnSettleSparePart90ReportList(string purchaseOrderNo, string version, string sapCode, string matialCode,
string begintime, string endtime)
{
@ -156,12 +271,12 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" ISNULL( b.AmountNoTax, 0 ) AS 开票金额 \n" +
" FROM\n" +
" Set_WMSSparePart a\n" +
" LEFT JOIN ( SELECT PurchaseOrderNo, Version, PurchaseOrderNoText, PurchasePriceNoTax, InvoicedQty, AmountNoTax FROM Set_SparePart WHERE Version = '{0}' ) b ON a.PurchaseOrderNo = b.PurchaseOrderNo\n" +
" LEFT JOIN ( SELECT PurchaseOrderNo, Version, PurchaseOrderNoText, PurchasePriceNoTax, InvoicedQty, AmountNoTax FROM Set_SparePart WHERE Version = '{0}' and Extend='is90' ) b ON a.PurchaseOrderNo = b.PurchaseOrderNo\n" +
" LEFT OUTER JOIN Set_material AS c ON a.MaterialCode = c.CustomerPartCode \n" +
" WHERE\n" +
" b.PurchaseOrderNo IS NULL \n" +
" ) AS temp1\n" +
" LEFT OUTER JOIN ( SELECT Price, MaterialCode FROM Set_PriceList WHERE ( Version = ( SELECT MAX ( Version ) AS Expr1 FROM Set_PriceList ) ) ) AS TEMP2 ON temp1.SAP编码 = TEMP2.MaterialCode \n" +
" LEFT OUTER JOIN ( SELECT Price, MaterialCode FROM Set_PriceList WHERE Version = '202110' ) AS TEMP2 ON temp1.SAP编码 = TEMP2.MaterialCode \n" +
"ORDER BY\n" +
" temp1.采购订单号";
@ -183,7 +298,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
// " a.PurchaseOrderNo 订单号,\n" +
// " a.MaterialCode 物料号 \n" +
// "FROM\n" +
// " ( SELECT SUM ( ReceiptQty ) ReceiptQty, PurchaseOrderNo, MaterialCode FROM Set_SparePart WHERE Version = '{0}' GROUP BY PurchaseOrderNo, MaterialCode ) A\n" +
// " ( SELECT SUM ( ReceiptQty ) ReceiptQty, PurchaseOrderNo, MaterialCode FROM Set_SparePart WHERE Version = '{0}' and Extend='is90' GROUP BY PurchaseOrderNo, MaterialCode ) A\n" +
// " LEFT JOIN ( SELECT SUM ( ReceiptQty ) ReceiptQty, PurchaseOrderNo, MaterialCode FROM Set_WMSSparePart GROUP BY PurchaseOrderNo, MaterialCode ) B ON A.MaterialCode = B.MaterialCode \n" +
// " AND A.PurchaseOrderNo = B.PurchaseOrderNo \n" +
// "WHERE\n" +

1546
src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettleSparePartDapperReportRepository.cs

File diff suppressed because it is too large

4
src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettledPartAndErpPartPriceDiffRepository.cs

@ -42,7 +42,7 @@ namespace Win.Sfs.SettleAccount.Repository.Report
" SettleMaterialCode,(\n" +
" Qty * isnull( b.Price, 0 )) amt \n" +
" FROM\n" +
" Set_MaterialRelationshipDetail a\n" +
" Set_MaterialRelationshipDetail_pg a\n" +
" LEFT JOIN ( SELECT Price, MaterialCode FROM Set_PriceList WHERE version = ( SELECT Max( Version ) FROM Set_PriceList ) AND type = 10 ) b ON a.SettleMaterialCode = b.MaterialCode \n" +
" ) temp1 \n" +
" GROUP BY\n" +
@ -60,7 +60,7 @@ namespace Win.Sfs.SettleAccount.Repository.Report
public virtual List<PartCodeDiff> GetDiffDetailReport(string year, string customcode, string version)
{
string sqlString = "select a.ErpMaterialCode,SettleMaterialCode,a.ShipMaterailCode,d.MaterialDesc,d.EstimateTypeDesc from\n" +
string sqlString = "select a.ErpMaterialCode,isnull(d.materialCode,SettleMaterialCode) MaterialCode,a.ShipMaterailCode,d.MaterialDesc,d.EstimateTypeDesc from\n" +
" Set_MaterialRelationshipDetail_pg a left join\n" +
" (\n" +
" SELECT\n" +

267
src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/UnSettleDiffDapperRepository.cs

@ -19,7 +19,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
[ExporterHeader(DisplayName = "交货单号")]
public override string WmsBillNum { set; get; }
[ExporterHeader(DisplayName = "实际发货日期",Format = "yyyy-MM-dd")]
public override DateTime CP5Time { set; get; }
public override string CP5Time { set; get; }
[ExporterHeader(DisplayName = "KENN号")]
public override string KENNCode { set; get; }
[ExporterHeader(DisplayName = "底盘号")]
@ -222,147 +222,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
//" SELECT\n" +
//" t1.*,\n" +
//" isnull( t1.UNSettleQty, 0 ) * isnull( T2.Price, 0 ) AMT,\n" +
//" T2.Price,\n" +
//" Qty -(\n" +
//" ISNULL( UnSettleQty, 0 )) DiffQty \n" +
//"FROM\n" +
//" (\n" +
//" SELECT\n" +
//" a.MaterialCode,\n" +
//" a.KENNCode,\n" +
//" a.ChassisNumber,\n" +
//" a.qty UNSettleQty,\n" +
//" isnull( b.qty, 0 ) qty,\n" +
//" a.CP5A CP5Time,\n" +
//" c.MaterialCode SapMaterialCode,\n" +
//" c.MaterialDesc MaterialDesc,\n" +
//" c.EstimateTypeDesc MaterialGroup,\n" +
//" a.model Factory \n" +
//" FROM\n" +
//" Set_unsettle a\n" +
//" LEFT JOIN (\n" +
//" SELECT\n" +
//" ItemCode,\n" +
//" KENNCode,\n" +
//" ChassisNumber2,\n" +
//" sum( qty ) qty \n" +
//" FROM\n" +
//" Set_fis \n" +
//" WHERE\n" +
//" state = 0 \n" +
//" OR state = 4 \n" +
//" GROUP BY\n" +
//" ItemCode,\n" +
//" KENNCode,\n" +
//" ChassisNumber2,\n" +
//" Model \n" +
//" ) b ON a.ChassisNumber = b.ChassisNumber2 \n" +
//" AND a.MaterialCode = b.ItemCode \n" +
//" AND a.KENNCode = b.KENNCode\n" +
//" LEFT JOIN Set_material c ON a.MaterialCode = c.CustomerPartCode {0}\n" +
//" ) t1\n" +
//" LEFT JOIN (\n" +
//" SELECT\n" +
//" MaterialCode,\n" +
//" Price \n" +
//" FROM\n" +
//" Set_PriceList \n" +
//" WHERE\n" +
//" version = ( SELECT max( version ) FROM Set_PriceListVersion )) t2 ON t1.SapMaterialCode = t2.MaterialCode \n" +
//"WHERE\n" +
//" 1 = 1";
// string sql2 =
//" SELECT\n " +
//" t1.*,\n" +
//" t1.Qty * T2.Price AMT,\n" +
//" T2.Price,\n" +
//" Qty -(\n" +
//" ISNULL( UnSettleQty, 0 )) DiffQty,\n" +
//" Qty -(\n" +
//" ISNULL( UnSettleQty, 0 ))* isnull( t2.Price, 0 ) DiffPrice \n" +
//"FROM\n" +
//" (\n" +
//" SELECT\n" +
//" temp1.WMSState,\n" +
//" temp1.WMSBillNum,\n" +
//" temp1.MaterialCode,\n" +
//" temp1.KENNCode,\n" +
//" temp1.ChassisNumber2,\n" +
//" temp1.Qty,\n" +
//" temp1.ChassisNumber,\n" +
//" temp1.CP5Time,\n" +
//" temp1.UnSettleQty,\n" +
//" temp1.SapMaterialCode,\n" +
//" temp1.MaterialDesc,\n" +
//" temp1.MaterialGroup,\n" +
//" temp2.MaterialCode AS ParentSapMaterialCode,\n" +
//" temp2.MaterialDesc AS ParentMaterialDesc \n" +
//" FROM\n" +
//" (\n" +
//" SELECT\n" +
//" a.WMSState,\n" +
//" a.WMSBillNum,\n" +
//" a.MaterialCode,\n" +
//" a.KENNCode,\n" +
//" a.ChassisNumber2,\n" +
//" a.Qty,\n" +
//" a.ParentCode,\n" +
//" a.ChassisNumber,\n" +
//" a.CP5Time,\n" +
//" b.Qty AS UnSettleQty,\n" +
//" C.MaterialCode AS SapMaterialCode,\n" +
//" C.MaterialDesc,\n" +
//" C.EstimateTypeDesc AS MaterialGroup \n" +
//" FROM\n" +
//" (\n" +
//" SELECT\n" +
//" WMSState,\n" +
//" WMSBillNum,\n" +
//" ItemCode AS MaterialCode,\n" +
//" KENNCode,\n" +
//" ChassisNumber2,\n" +
//" SUM( Qty ) AS Qty,\n" +
//" ErpMaterialCode AS ParentCode,\n" +
//" ChassisNumber,\n" +
//" CP5Time \n" +
//" FROM\n" +
//" Set_fis \n" +
//" WHERE\n" +
//" ( State = 0 ) \n" +
//" GROUP BY\n" +
//" ItemCode,\n" +
//" KENNCode,\n" +
//" ChassisNumber2,\n" +
//" WMSState,\n" +
//" WMSBillNum,\n" +
//" ErpMaterialCode,\n" +
//" ChassisNumber,\n" +
//" CP5Time \n" +
//" ) AS a\n" +
//" LEFT OUTER JOIN Set_Unsettle AS b ON a.ChassisNumber2 = b.ChassisNumber \n" +
//" AND b.MaterialCode = a.MaterialCode \n" +
//" AND a.KENNCode = b.KENNCode\n" +
//" LEFT OUTER JOIN Set_material AS C ON a.MaterialCode = C.CustomerPartCode {0}\n" +
//" ) AS temp1\n" +
//" LEFT OUTER JOIN Set_material AS temp2 ON temp1.ParentCode = temp2.MaterialCode \n" +
//" ) t1\n" +
//" LEFT JOIN (\n" +
//" SELECT\n" +
//" MaterialCode,\n" +
//" Price \n" +
//" FROM\n" +
//" Set_PriceList \n" +
//" WHERE\n" +
//" version = ( SELECT max( version ) FROM Set_PriceListVersion )) t2 ON t1.SapMaterialCode = t2.MaterialCode";
var _sql = string.Format(sql1, condition,version);
@ -371,5 +230,129 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
return _query.ToList();
}
public virtual List<UnSettleDiff> GetDiffReport1(int type, string begin, string end, string materialCode, string kennCode, string chassisNumber, string version)
{
string condition = " ";
//if (!string.IsNullOrEmpty(materialCode))
//{
// condition += string.Format(" and d.MaterialCode='{0}' ", materialCode);
//}
if (!string.IsNullOrEmpty(begin))
{
condition += string.Format(" and BeginTime>='{0}' ", begin);
}
if (!string.IsNullOrEmpty(end))
{
condition += string.Format(" and BeginTime<='{0}' ", end);
}
//if (!string.IsNullOrEmpty(kennCode))
//{
// condition += string.Format(" and a.kenncode='{0}' ", kennCode);
//}
//if (!string.IsNullOrEmpty(chassisNumber))
//{
// condition += string.Format(" and a.chassisNumber='{0}' ", chassisNumber);
//}
string sql1 =
"SELECT\n" +
" t1.*,\n" +
" Round(isnull( t1.UNSettleQty, 0 ) * isnull( T2.Price, 0 ),2) AMT,\n" +
" T2.Price,\n" +
" Qty -(\n" +
" ISNULL( UnSettleQty, 0 )) DiffQty ,\n" +
" Round((Qty - (ISNULL(UnSettleQty, 0))) * isnull(T2.Price, 0),2) DiffAmt \n" +
"FROM\n" +
" (\n" +
" SELECT\n" +
" temp1.*,\n" +
" temp2.MaterialDesc ParentMaterialDesc \n" +
" FROM\n" +
" (\n" +
" SELECT\n" +
" a.MaterialCode,\n" +
" isnull( b.OrderBillNum, a.KENNCode ) KENNCode,\n" +
" isnull( b.ChassisNumber, a.ChassisNumber ) ChassisNumber,\n" +
" a.qty UNSettleQty,\n" +
" isnull( b.qty, 0 ) qty,\n" +
" CONVERT(VARCHAR(10),a.CP5A,120) CP5Time,\n" +
" c.MaterialCode SapMaterialCode,\n" +
" c.MaterialDesc MaterialDesc,\n" +
" c.EstimateTypeDesc MaterialGroup,\n" +
" a.model Factory,\n" +
" b.ErpMaterialCode ParentSapMaterialCode,\n" +
" b.WMSBillNum, \n" +
" a.UnsettledReason " +
" FROM\n" +
" (select * from Set_unsettle where Version='{1}') a\n" +
" LEFT JOIN (\n" +
" SELECT\n" +
" OrderBillNum,\n" +
" ChassisNumber,\n" +
" ItemCode,\n" +
" KENNCode,\n" +
" ChassisNumber2,\n" +
"STUFF((SELECT ',' + ErpMaterialCode FROM Set_fis subTitle WHERE KENNCode =tm1.KENNCode\n" +
"and ChassisNumber2=tm1.ChassisNumber2 and ItemCode=tm1.ItemCode FOR XML PATH('')),1, 1, '') AS ErpMaterialCode,\n" +
"STUFF((SELECT ',' + WMSBillNum FROM Set_fis subTitle WHERE KENNCode =tm1.KENNCode\n" +
"and ChassisNumber2=tm1.ChassisNumber2 and ItemCode=tm1.ItemCode FOR XML PATH('')),1, 1, '') AS WMSBillNum,\n"+
" sum( qty ) qty \n" +
" FROM\n" +
" Set_fis tm1\n" +
" WHERE\n" +
" ( state = 0 \n" +
" OR state = 4) {0} \n" +
" GROUP BY\n" +
" ItemCode,\n" +
" KENNCode,\n" +
" ChassisNumber2,\n" +
" OrderBillNum,\n" +
" ChassisNumber\n" +
" ) b ON a.ChassisNumber = b.ChassisNumber2 \n" +
" AND a.MaterialCode = b.ItemCode \n" +
" AND a.KENNCode = b.KENNCode\n" +
" LEFT JOIN Set_material c ON a.MaterialCode = c.CustomerPartCode \n" +
" ) temp1\n" +
" LEFT JOIN (select max(Id) Id,MaterialCode,MaterialDesc from Set_material group by MaterialCode,MaterialDesc) temp2 ON SUBSTRING(temp1.ParentSapMaterialCode,1,8) = temp2.MaterialCode \n" +
" ) t1\n" +
" LEFT JOIN (\n" +
" SELECT\n" +
" MaterialCode,\n" +
" Price \n" +
" FROM\n" +
" Set_PriceList \n" +
" WHERE\n" +
" version = ( SELECT max( version ) FROM Set_PriceListVersion )) t2 ON t1.SapMaterialCode = t2.MaterialCode \n" +
"WHERE\n" +
" 1 = 1";
var _sql = string.Format(sql1, condition, version);
var _query = DbConnection.Query<UnSettleDiff>(_sql, null, null, true, 1200, null);
return _query.ToList();
}
}
}

269
src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/UnSettledDetailDapperRepository.cs

@ -19,6 +19,15 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
/// <summary>
/// 7.大众准时化未结明细表(包含漏结,漏结要有标识)
/// </summary>
///
public class FisRemoveItem
{
public string SapMaterialCode { set; get; }
public string ChassisNumber { set; get; }
public string MaterialDesc { set; get; }
}
public class UnSettledDetailDapperRepository : DapperRepository<SettleAccountDbContext>, ITransientDependency
{
@ -39,23 +48,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
{
str += string.Format(" and beginTime<='{0}' ", end);
}
//if (!string.IsNullOrEmpty(materialCode))
//{
// str += string.Format(" and ItemCode='{0}' ", materialCode);
//}
//string str2 = " ";
//if (!string.IsNullOrEmpty(sapCode))
//{
// str2 += string.Format(" and b.MaterialCode='{0}' ", sapCode);
//}
//if (!string.IsNullOrEmpty(materialGroup))
//{
// str += string.Format(" and MaterialGroup='{0}' ", materialGroup);
//}
//if (!string.IsNullOrEmpty(sapCode))
//{
// str += string.Format(" and SapCode='{0}' ", materialGroup);
//}
var sqlString =
" SELECT\n" +
@ -140,8 +133,9 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" LEFT JOIN Set_material B ON a.MaterialCode = b.CustomerPartCode \n" +
" LEFT JOIN (select max(Id) Id,MaterialCode,MaterialDesc from Set_material group by MaterialCode,MaterialDesc) d ON a.ParentSapMaterialCode = d.MaterialCode \n" +
" ) temp1\n" +
" LEFT JOIN ( SELECT Price, MaterialCode FROM Set_PriceList WHERE version = ( SELECT Max( Version ) FROM Set_PriceList ) ) temp2 ON temp1.SapMaterialCode = temp2.MaterialCode \n"+
" LEFT JOIN ( SELECT Price, MaterialCode FROM Set_PriceList WHERE version = ( SELECT Max( Version ) FROM Set_PriceList ) ) temp2 ON temp1.SapMaterialCode = temp2.MaterialCode \n" +
" left join set_backQty tt on temp1.SapMaterialCode = tt.MaterialCode and temp1.ChassisNumber = tt.Code ";
;
//var _materialList = DbConnection.Query<Material>("select * from set_material").ToList();
//var _priceList = DbConnection.Query<PriceList>("select MaterialCode,Price from Set_PriceList where version=(select max(version) from set_Set_PriceListVersion)").ToList();
@ -149,7 +143,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
string _sql = string.Format(sqlString, str, version);
;
var _query = DbConnection.Query<UnSettleDetailReport>(_sql);
var _query = DbConnection.Query<UnSettleDetailReport>(_sql, null, null, true, 1200, null);
var _list = _query.ToList();
@ -162,6 +156,227 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
return _list;
}
public virtual List<UnSettleDetailReport1> GetDiffReport1(string year, string begin, string end, string customcode, string version, string materialCode, string materialGroup, string sapCode)
{
string str = " ";
if (!string.IsNullOrEmpty(begin))
{
str += string.Format(" and beginTime>='{0}' ", begin);
}
if (!string.IsNullOrEmpty(end))
{
str += string.Format(" and beginTime<='{0}' ", end);
}
var sqlString =
"SELECT\n" +
"2 WMSState,\n" +
"temp1.WMSBillNum,\n" +
"temp1.UnSettleVersion\t\t ,\n" +
"temp1.CP5Time\t\t\t\t ,\n" +
"temp1.MaterialCode\t\t\t ,\n" +
"temp1.ChassisNumber\t\t\t ,\n" +
"temp1.KENNCode\t\t\t\t ,\n" +
"temp1.chassisNumber2\t\t ,\n" +
"temp1.KENNCode2\t\t\t\t ,\n" +
"temp1.QTY\t\t\t\t\t ,\n" +
"temp1.ParentSapMaterialCode\t ,\n" +
"temp1.FLAG\t\t\t\t\t ,\n" +
"temp1.UnSettleQty\t\t\t ,\n" +
"temp1.MaterialGroup\t\t\t ,\n" +
"temp1.MaterialDesc\t\t\t ,\n" +
"temp1.ParentMaterialDesc\t ,\n" +
"temp1.SapMaterialCode\t\t ,\n" +
"temp2.Price,\n" +
"ISNULL( temp1.QTY, 0 )* ISNULL( temp2.Price, 0 ) AMT,\n" +
"Round(ISNULL( temp1.DiffQty, 0 )* ISNULL( temp2.Price, 0 ),2) DiffAMT,\n" +
"temp1.DiffQty\n"+
"FROM\n" +
"(\n" +
"SELECT\n" +
"A.*,\n" +
"Isnull(F.Qty, 0) UnSettleQty,\n" +
"B.EstimateTypeDesc MaterialGroup,\n" +
"B.MaterialDesc MaterialDesc,\n" +
"d.MaterialDesc ParentMaterialDesc,\n" +
"B.MaterialCode SapMaterialCode,\n" +
"A.Qty-Isnull(F.Qty,\n" +
"0) DiffQty\n" +
"FROM\n" +
"(\n" +
"select\n" +
"\n" +
"MaterialCode,\n" +
"ChassisNumber,\n" +
"KENNCode,\n" +
"ChassisNumber2,\n" +
"KENNCode2,\n" +
"flag,\n" +
"\n" +
"STUFF((\n" +
"SELECT\n" +
"',' + ErpMaterialCode\n" +
"FROM\n" +
"Set_fis subTitle\n" +
"WHERE\n" +
"KENNCode = tm1.KENNCode2\n" +
"and ChassisNumber2 = tm1.ChassisNumber2\n" +
"and ItemCode = tm1.MaterialCode FOR XML PATH('')),\n" +
"1,\n" +
"1,\n" +
"'') AS ParentSapMaterialCode,\n" +
"STUFF((\n" +
"SELECT\n" +
"',' + WMSBillNum\n" +
"FROM\n" +
"Set_fis subTitle\n" +
"WHERE\n" +
"KENNCode = tm1.KENNCode2\n" +
"and ChassisNumber2 = tm1.ChassisNumber2\n" +
"and ItemCode = tm1.MaterialCode FOR XML PATH('')),\n" +
"1,\n" +
"1,\n" +
"'') AS WMSBillNum,\n" +
"STUFF((\n" +
"SELECT\n" +
"',' + CONVERT(VARCHAR(10),CP5Time,120)\n" +
"FROM\n" +
"Set_fis subTitle\n" +
"WHERE\n" +
"KENNCode = tm1.KENNCode2\n" +
"and ChassisNumber2 = tm1.ChassisNumber2\n" +
"and ItemCode = tm1.MaterialCode FOR XML PATH('')),\n" +
"1,\n" +
"1,\n" +
"'') AS CP5Time,\n" +
"STUFF((\n" +
"SELECT\n" +
"',' + UnSettleVersion\n" +
"FROM\n" +
"Set_fis subTitle\n" +
"WHERE\n" +
"KENNCode = tm1.KENNCode2\n" +
"and ChassisNumber2 = tm1.ChassisNumber2\n" +
"and ItemCode = tm1.MaterialCode FOR XML PATH('')),\n" +
"1,\n" +
"1,\n" +
"'') AS UnSettleVersion,\n" +
"sum(qty) qty\n" +
"from\n" +
"\n" +
"(\n" +
"SELECT\n" +
"WMSState,\n" +
"WMSBillNum,\n" +
"UnSettleVersion,\n" +
"BeginTime CP5Time,\n" +
"ItemCode MaterialCode,\n" +
"ChassisNumber,\n" +
"OrderBillNum KENNCode,\n" +
"ChassisNumber2,\n" +
"KENNCode KENNCode2,\n" +
"QTY,\n" +
"ErpMaterialCode ,\n" +
"'' FLAG\n" +
"FROM\n" +
"Set_fis\n" +
"where\n" +
"1 = 1\n" +
"AND STATE = 0 {0}\n" +
"UNION ALL\n" +
"SELECT\n" +
"\n" +
"WMSState,\n" +
"WMSBillNum,\n" +
"UnSettleVersion,\n" +
"BeginTime CP5Time,\n" +
"ItemCode MaterialCode,\n" +
"ChassisNumber,\n" +
"OrderBillNum KENNCode,\n" +
"ChassisNumber2,\n" +
"KENNCode KENNCode2,\n" +
"QTY,\n" +
"ErpMaterialCode ,\n" +
"'L' FLAG\n" +
"FROM\n" +
"Set_fis\n" +
"WHERE\n" +
"1 = 1\n" +
"AND STATE = 4 {0}\n" +
")\n" +
"tm1\n" +
"GROUP BY\n" +
"MaterialCode,\n" +
"KENNCode2,\n" +
"ChassisNumber2,\n" +
"KENNCode,\n" +
"ChassisNumber,\n" +
"FLAG\n" +
") A\n" +
"left join (\n" +
"select\n" +
"*\n" +
"from\n" +
"Set_Unsettle\n" +
"where\n" +
"version = '{1}') f\n" +
"on\n" +
"a.MaterialCode = f.MaterialCode\n" +
"and a.KENNCode2 = f.KENNCode\n" +
"and a.ChassisNumber2 = f.ChassisNumber\n" +
"LEFT JOIN Set_material B ON\n" +
"a.MaterialCode = b.CustomerPartCode\n" +
"LEFT JOIN (\n" +
"select\n" +
"max(Id) Id,\n" +
"MaterialCode,\n" +
"MaterialDesc\n" +
"from\n" +
"Set_material\n" +
"group by\n" +
"MaterialCode,\n" +
"MaterialDesc) d ON\n" +
"Substring(a.ParentSapMaterialCode,1,8) = d.MaterialCode\n" +
") temp1\n" +
"LEFT JOIN (\n" +
"SELECT\n" +
"Price,\n" +
"MaterialCode\n" +
"FROM\n" +
"Set_PriceList\n" +
"WHERE\n" +
"version = (\n" +
"SELECT\n" +
"Max(Version)\n" +
"FROM\n" +
"Set_PriceList ) ) temp2 ON\n" +
"temp1.SapMaterialCode = temp2.MaterialCode\n";
//var _materialList = DbConnection.Query<Material>("select * from set_material").ToList();
//var _priceList = DbConnection.Query<PriceList>("select MaterialCode,Price from Set_PriceList where version=(select max(version) from set_Set_PriceListVersion)").ToList();
string _sql = string.Format(sqlString, str, version);
;
var _query = DbConnection.Query<UnSettleDetailReport1 > (_sql, null, null, true, 1200, null); ;
var _list = _query.ToList();
//_list= _list.Where(p => p.SapMaterialCode == sapCode).ToList();
return _list;
}
/// <summary>
/// 漏结
/// </summary>
@ -275,8 +490,24 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
_list = _list.Where(p => p.SapMaterialCode == sapCode).ToList();
return _list;
}
public virtual List<FisRemoveItem> GetRemoveDetail()
{
var sqlString = "select * from Set_FisRemove";
string _sql = string.Format(sqlString);
;
var _query = DbConnection.Query<FisRemoveItem>(_sql);
var _list = _query.ToList();
return _list;
}
}
}

87
src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/WmsDapperRepository.cs

@ -16,7 +16,35 @@ using Win.Sfs.SettleAccount.Reports;
namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
{
public class SalesStockSum
{
public string Version { set; get; }
public string PartCode { set; get; }
public string LocCode { set; get; }
public decimal StartQty { set; get; }
public decimal InQty { set; get; }
public decimal OutQty { set; get; }
public decimal EndQty { set; get; }
public string Remark { set; get; }
public DateTime CreateTime { set; get; }
public string OperName { set; get; }
public DateTime StartTime { set; get; }
public DateTime EndTime { set; get; }
public string PartDesc { set; get; }
public string PartGroup { set; get; }
public string PartGroupDesc { set; get; }
}
public class SalesStock
{
@ -45,6 +73,63 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
}
public virtual List<SalesStock> GetSalesStock(string locCode)
{
string str = " select SUM(Qty) Qty,PartCode SapCode from TS_STOCK_DETAIL where AreaCode='SALE' and LocCode='{0}' group by PartCode ";
str=string.Format(str, locCode);
var _list = DbConnection.Query<SalesStock>(str);
return _list.ToList();
}
public virtual List<SalesStockSum> GetSalesStockSum(string version)
{
// string str =
// "SELECT A\n" +
//" .*,\n" +
//" B.PartDesc,\n" +
//" B.PartGroup \n" +
//"FROM\n" +
//" TM_PG_TIME_STOCK_DETAIL\n" +
//" A LEFT JOIN (\n" +
//" SELECT DISTINCT\n" +
//" [ PartCode ],\n" +
//" ( ISNULL ( [ PartDesc1 ], '' ) + ISNULL ( [ PartDesc2 ], '' ) ) PartDesc,\n" +
//" PartGroup \n" +
//" FROM\n" +
//" [ VIEW_PG_SIMPLE_PART ] \n" +
//" ) B ON A.PartCode = B.PartCode where a.version='{0}'";
string str = " SELECT A.*, \n" +
" B.PartDesc, \n" +
" B.PartGroup, \n" +
" B.PartGroupDesc \n" +
" FROM \n" +
" TM_PG_TIME_STOCK_DETAIL \n" +
" A LEFT JOIN ( \n" +
" SELECT DISTINCT \n" +
" PartCode, \n" +
" ( ISNULL ( [PartDesc1], '' ) + ISNULL ( [PartDesc2], '' ) ) PartDesc, \n" +
" PartGroup ,PartGroupDesc\n" +
" FROM \n" +
" VIEW_PG_SIMPLE_PART \n" +
" ) B ON A.PartCode = B.PartCode where a.version='{0}'";
str = string.Format(str, version);
var _list = DbConnection.Query<SalesStockSum>(str);
return _list.ToList();
}
//public virtual Dictionary<string,decimal> GetSapList<T>(List<T> childList, string version, bool isNotHistoryPart = false) where T : ReportDetailBase, new()
//{

875
src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/WmsOutputSumDapperRepository.cs

File diff suppressed because it is too large

104
src/Modules/SettleAccount/src/SettleAccount.HttpApi/BlobFileController.cs

@ -1,10 +1,17 @@
using Microsoft.AspNetCore.Mvc;
using Magicodes.ExporterAndImporter.Core.Extension;
using Magicodes.ExporterAndImporter.Excel;
using Microsoft.AspNetCore.Mvc;
using OfficeOpenXml;
using Shouldly;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Win.Sfs.BaseData.ImportExcelCommon;
using Win.Sfs.SettleAccount.Entities;
using Win.Sfs.SettleAccount.Entities.WMS;
namespace Win.Sfs.SettleAccount
{
@ -13,7 +20,7 @@ namespace Win.Sfs.SettleAccount
public class BlobFileController:SettleAccountController
{
private readonly IExcelImportAppService _excelImportService;
public IExcelImporter Importer = new ExcelImporter();//导入Excel
public BlobFileController(IExcelImportAppService excelImportService)
{
_excelImportService = excelImportService;
@ -31,5 +38,98 @@ namespace Win.Sfs.SettleAccount
return File(fileDto.Content, "application/octet-stream", fileDto.Name);
}
/// <summary>
/// 客户自定义发货结算导入模板
/// </summary>
/// <returns></returns>
[HttpPost]
[Route("saveCustomExcelTemplate")]
public async Task<string> SaveCustomExcelImportTemplate()
{
string fileName = "客户自定义发货结算导入模板.xlsx";
var result = await Importer.GenerateTemplateBytes<WmsCustomerKanbanOutPutDetialDTO>();
result.ShouldNotBeNull();
result.Length.ShouldBeGreaterThan(0);
await _excelImportService.SaveBlobAsync(
new SaveExcelImportInputDto
{
Name = fileName,
Content = result
}
);
return fileName;
}
/// <summary>
/// 红旗一轿手工出库单导入模板
/// </summary>
/// <returns></returns>
[HttpPost]
[Route("saveHQKBExcelTemplate")]
public async Task<string> SaveHQKBExcelImportTemplate()
{
string fileName = "红旗一轿手工出库单导入模板.xlsx";
var result = await Importer.GenerateTemplateBytes<WmsHQWithOutKanbanOutPutDetiaTemplatelDto>();
result.ShouldNotBeNull();
result.Length.ShouldBeGreaterThan(0);
await _excelImportService.SaveBlobAsync(
new SaveExcelImportInputDto
{
Name = fileName,
Content = result
}
);
return fileName;
}
/// <summary>
/// 一次性销售出库单导入模板
/// </summary>
/// <returns></returns>
[HttpPost]
[Route("saveOneTimeExcelTemplate")]
public async Task<string> SaveOneTimeExcelImportTemplate()
{
string fileName = "一次性寄售销售出库单导入模板.xlsx";
var result = await Importer.GenerateTemplateBytes<WmsOneTimeSaleOutPutDetialTempalteDTO>();
result.ShouldNotBeNull();
result.Length.ShouldBeGreaterThan(0);
await _excelImportService.SaveBlobAsync(
new SaveExcelImportInputDto
{
Name = fileName,
Content = result
}
);
return fileName;
}
/// <summary>
/// 大众备件无单号出库单导入模板
/// </summary>
/// <returns></returns>
[HttpPost]
[Route("saveVWBJNoCodeExcelTemplate")]
public async Task<string> aveVWBJNoCodeExcelTemplate()
{
string fileName = "大众备件无单号出库单导入模板.xlsx";
var result = await Importer.GenerateTemplateBytes<WmsSharePartOutPutDetialTemplateDTO>();
result.ShouldNotBeNull();
result.Length.ShouldBeGreaterThan(0);
await _excelImportService.SaveBlobAsync(
new SaveExcelImportInputDto
{
Name = fileName,
Content = result
}
);
return fileName;
}
}
}

18
src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQCarSettledDetailDiffExportService.cs

@ -66,7 +66,7 @@ namespace SettleAccount.Job.Services.Report
//不包含备品--求和出库
var _ls_sum = _dapperRepository.GetHQCarSettledDetailDiffSumReportList(version, materialCode, begin, end, materialGroup);
//按照零件号汇总数量,有一列显示寄售库数量
var stockList = _wmsDapper.GetSalesStock();
var stockList = _wmsDapper.GetSalesStock("PLJS");
var queryStockList = from itm in _ls_sum
join itm1 in stockList on itm.SAP编码 equals itm1.SapCode into temp1
from tm1 in temp1.DefaultIfEmpty()
@ -117,14 +117,14 @@ namespace SettleAccount.Job.Services.Report
//}
if (!string.IsNullOrEmpty(warehouseDesc))
{
var _groupList = warehouseDesc.Split(new char[] { '\n' }).Distinct().ToList();
if (_groupList.Count() > 0)
{
_ls = _ls.Where(p => _groupList.Contains(p.)).ToList();
}
}
//if (!string.IsNullOrEmpty(warehouseDesc))
//{
// var _groupList = warehouseDesc.Split(new char[] { '\n' }).Distinct().ToList();
// if (_groupList.Count() > 0)
// {
// _ls = _ls.Where(p => _groupList.Contains(p.收货仓库描述)).ToList();
// }
//}
if (!string.IsNullOrEmpty(materialGroup))
{

5
src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQFactoryUnSettledDetailDiffExportService.cs

@ -56,14 +56,15 @@ namespace SettleAccount.Job.Services.Report
var acceptNo = p_list.Where(p => p.Name == "AcceptNo").FirstOrDefault().Value;
var sapCode = p_list.Where(p => p.Name == "SapCode").FirstOrDefault().Value;
var warehouseDesc = p_list.Where(p => p.Name == "WarehouseDesc").FirstOrDefault().Value;
var iscontionversion = p_list.Where(p => p.Name == "IsContainVersion").FirstOrDefault().Value;
//红旗系统未对比对红旗主机厂未结
var _ls = _dapperRepository.GetSettleToFactoryDetailDiffReportList(version, materialCode, begin, end, materialGroup);
var _ls = _dapperRepository.GetSettleToFactoryDetailDiffReportList(version, materialCode, begin, end, materialGroup,iscontionversion);
//红旗主机厂未结比对红旗系统未对
var _ls_reversal = _dapperRepository.GetHQFactoryDetailDiffReportList(version, materialCode, begin, end, materialGroup);
var _ls_reversal = _dapperRepository.GetHQFactoryDetailDiffReportList(version, materialCode, begin, end, materialGroup, iscontionversion);
//if (!string.IsNullOrEmpty(kanban))

66
src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQHSettledDetailDiffExportService.cs

@ -9,6 +9,7 @@ using TaskJob.EventArgs;
using TaskJob.Interfaces;
using Volo.Abp.BlobStoring;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Uow;
using Win.Sfs.BaseData.ImportExcelCommon;
using Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report;
@ -44,6 +45,7 @@ namespace SettleAccount.Job.Services.Report
_dapperRepository = dapperRepository;
}
[UnitOfWork(false)]
public string ExportFile(Guid id, List<string> exportName, List<CustomCondition> p_list)
{
var _filename = exportName.FirstOrDefault();
@ -57,6 +59,7 @@ namespace SettleAccount.Job.Services.Report
var sapCode = p_list.Where(p => p.Name == "SapCode").FirstOrDefault().Value;
var warehouseDesc = p_list.Where(p => p.Name == "WarehouseDesc").FirstOrDefault().Value;
//红旗结算核对明细
var _ls = _dapperRepository.GetInvoiceSettledDetailDiffReportList(version, materialCode, begin, end, materialGroup);
//有结算无发货报表
@ -66,16 +69,18 @@ namespace SettleAccount.Job.Services.Report
//var _reversels = _dapperRepository.GetReverseSettledDetailDiffReportList(version, materialCode, begin, end, materialGroup);
var _lst = _dapperRepository.GetDiffQtyList(version);
foreach (var itm in _lst)
{
var _first = _ls.FirstOrDefault(p => p. == itm. && p. == itm.);
if (_first != null)
{
_first. = _first. + itm.;
_first. = itm.;
}
}
//var _lst = _dapperRepository.GetDiffQtyList(version);
//foreach (var itm in _lst)
//{
// var _first = _ls.FirstOrDefault(p => p.订货看板编号 == itm.看板号 && p.订货零件号 == itm.客户物料号);
// if (_first != null)
// {
// _first.结算数量 = _first.发货数量 + itm.差异数量;
// _first.数量差异 = itm.差异数量;
// }
//}
//订货看板编号
if (!string.IsNullOrEmpty(kanban))
{
var _groupList = kanban.Split(new char[] { '\n' }).Distinct().ToList();
@ -84,23 +89,26 @@ namespace SettleAccount.Job.Services.Report
_ls = _ls.Where(p => _groupList.Contains(p.)).ToList();
}
}
if (!string.IsNullOrEmpty(warehouseDesc))
{
var _groupList = warehouseDesc.Split(new char[] { '\n' }).Distinct().ToList();
if (_groupList.Count() > 0)
{
_ls = _ls.Where(p => _groupList.Contains(p.)).ToList();
}
}
if (!string.IsNullOrEmpty(acceptNo))
{
var _groupList = acceptNo.Split(new char[] { '\n' }).Distinct().ToList();
if (_groupList.Count() > 0)
{
_ls = _ls.Where(p => _groupList.Contains(p.)).ToList();
}
}
//if (!string.IsNullOrEmpty(warehouseDesc))
//{
// var _groupList = warehouseDesc.Split(new char[] { '\n' }).Distinct().ToList();
// if (_groupList.Count() > 0)
// {
// _ls = _ls.Where(p => _groupList.Contains(p.收货仓库描述)).ToList();
// }
//}
//if (!string.IsNullOrEmpty(acceptNo))
//{
// var _groupList = acceptNo.Split(new char[] { '\n' }).Distinct().ToList();
// if (_groupList.Count() > 0)
// {
// _ls = _ls.Where(p => _groupList.Contains(p.结算验收单号)).ToList();
// }
//}
//物料组车型
if (!string.IsNullOrEmpty(materialGroup))
{
var _groupList = materialGroup.Split(new char[] { ',' }).Distinct().ToList();
@ -109,14 +117,16 @@ namespace SettleAccount.Job.Services.Report
_ls = _ls.Where(p => _groupList.Contains(p.)).ToList();
}
}
//订货零件号
if (!string.IsNullOrEmpty(materialCode))
{
var _groupList = materialCode.Split(new char[] { '\n' }).Distinct().ToList();
if (_groupList.Count() > 0)
{
_ls = _ls.Where(p => _groupList.Contains(p.)).ToList();
_ls = _ls.Where(p => _groupList.Contains(p.)).ToList();
}
}
//厂内物料号
if (!string.IsNullOrEmpty(sapCode))
{
var _groupList = sapCode.Split(new char[] { '\n' }).Distinct().ToList();

44
src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQHSharePartSettledDetailDiffExportService.cs

@ -59,20 +59,21 @@ namespace SettleAccount.Job.Services.Report
var sapCode = p_list.Where(p => p.Name == "SapCode").FirstOrDefault().Value;
var warehouseDesc = p_list.Where(p => p.Name == "WarehouseDesc").FirstOrDefault().Value;
//备件明细数据
var _ls = _dapperRepository.GetSharePartSettledDetailDiffReportList(version, materialCode, begin, end, materialGroup);
//求和汇总
var _ls_sum = _dapperRepository.GetSharePartSumSettledDetailDiffReportList(version, materialCode, begin, end, materialGroup);
//按照零件号汇总数量,有一列显示寄售库数量
var stockList = _wmsDapper.GetSalesStock();
var stockList = _wmsDapper.GetSalesStock("BJJS");
var queryStockList = from itm in _ls_sum
join itm1 in stockList on itm.Sap编码 equals itm1.SapCode into temp1
from tm1 in temp1.DefaultIfEmpty()
select new HQHSharePartSettledDetailDiff(
select new HQHSharePartSettledDetailDiffSum(
itm.Sap编码,
itm.,
itm.,
itm.,
itm.,
itm.,
itm.,
@ -81,7 +82,8 @@ namespace SettleAccount.Job.Services.Report
itm.,
itm.,
itm.,
tm1 == null ? 0 : tm1.Qty
tm1 == null ? 0 : tm1.Qty,
itm.
);
//var _ls = _dapperRepository.GetInvoiceSettledDetailDiffReportList(version, materialCode, begin, end, materialGroup);
@ -101,36 +103,38 @@ namespace SettleAccount.Job.Services.Report
var _groupList = kanban.Split(new char[] { '\n' }).Distinct().ToList();
if (_groupList.Count() > 0)
{
_ls = _ls.Where(p => _groupList.Contains(p.)).ToList();
_ls = _ls.Where(p => _groupList.Contains(p.)).ToList();
}
}
if (!string.IsNullOrEmpty(warehouseDesc))
{
var _groupList = warehouseDesc.Split(new char[] { '\n' }).Distinct().ToList();
if (_groupList.Count() > 0)
{
_ls = _ls.Where(p => _groupList.Contains(p.)).ToList();
}
}
//if (!string.IsNullOrEmpty(acceptNo))
//if (!string.IsNullOrEmpty(warehouseDesc))
//{
// var _groupList = acceptNo.Split(new char[] { ',' }).Distinct().ToList();
// var _groupList = warehouseDesc.Split(new char[] { '\n' }).Distinct().ToList();
// if (_groupList.Count() > 0)
// {
// _ls = _ls.Where(p => _groupList.Contains(p.结算验收单号)).ToList();
// _ls = _ls.Where(p => _groupList.Contains(p.收货仓库描述)).ToList();
// }
//}
//if (!string.IsNullOrEmpty(materialGroup))
//if (!string.IsNullOrEmpty(acceptNo))
//{
// var _groupList = materialGroup.Split(new char[] { ',' }).Distinct().ToList();
// var _groupList = acceptNo.Split(new char[] { ',' }).Distinct().ToList();
// if (_groupList.Count() > 0)
// {
// _ls = _ls.Where(p => _groupList.Contains(p.物料组)).ToList();
// _ls = _ls.Where(p => _groupList.Contains(p.结算验收单号)).ToList();
// }
//}
if (!string.IsNullOrEmpty(materialGroup))
{
var _groupList = materialGroup.Split(new char[] { ',' }).Distinct().ToList();
if (_groupList.Count() > 0)
{
_ls = _ls.Where(p => _groupList.Contains(p.)).ToList();
}
}
if (!string.IsNullOrEmpty(materialCode))
{
var _groupList = materialCode.Split(new char[] { '\n' }).Distinct().ToList();

65
src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQHUnSettledDetailDiffExportService.cs

@ -56,56 +56,19 @@ namespace SettleAccount.Job.Services.Report
var acceptNo = p_list.Where(p => p.Name == "AcceptNo").FirstOrDefault().Value;
var sapCode = p_list.Where(p => p.Name == "SapCode").FirstOrDefault().Value;
var warehouseDesc = p_list.Where(p => p.Name == "WarehouseDesc").FirstOrDefault().Value;
var iscontionversion = p_list.Where(p => p.Name == "IsContainVersion").FirstOrDefault().Value;
//有发货无结算,单独拿出去,财务要求
var _ls = _dapperRepository.GetReverseSettledDetailDiffReportList(version, materialCode, begin, end, materialGroup);
//if (!string.IsNullOrEmpty(kanban))
//{
// var _groupList = kanban.Split(new char[] { '\n' }).Distinct().ToList();
// if (_groupList.Count() > 0)
// {
// _ls = _ls.Where(p => _groupList.Contains(p.订货看板编号)).ToList();
// }
//}
//if (!string.IsNullOrEmpty(warehouseDesc))
//{
// var _groupList = warehouseDesc.Split(new char[] { '\n' }).Distinct().ToList();
// if (_groupList.Count() > 0)
// {
// _ls = _ls.Where(p => _groupList.Contains(p.收货仓库描述)).ToList();
// }
//}
//if (!string.IsNullOrEmpty(acceptNo))
//{
// var _groupList = acceptNo.Split(new char[] { '\n' }).Distinct().ToList();
// if (_groupList.Count() > 0)
// {
// _ls = _ls.Where(p => _groupList.Contains(p.结算验收单号)).ToList();
// }
//}
//if (!string.IsNullOrEmpty(materialGroup))
//{
// var _groupList = materialGroup.Split(new char[] { ',' }).Distinct().ToList();
// if (_groupList.Count() > 0)
// {
// _ls = _ls.Where(p => _groupList.Contains(p.物料组)).ToList();
// }
//}
//if (!string.IsNullOrEmpty(materialCode))
//{
// var _groupList = materialCode.Split(new char[] { '\n' }).Distinct().ToList();
// if (_groupList.Count() > 0)
// {
// _ls = _ls.Where(p => _groupList.Contains(p.发货零件号)).ToList();
// }
//}
//有发货无结算+有发货有结算中发货数量大于结算数量的数据-----组合:红旗未结明细
var _ls = _dapperRepository.GetReverseSettledDetailDiffReportList(version, materialCode, begin, end, materialGroup, iscontionversion);
//原始正常的红旗未结数据(不包含有发货有结算中发货大于结算的数据,数量也未求和)
//var _ls_original = _dapperRepository.GetOriginalSettledDetailDiffReportList(version, materialCode, begin, end, materialGroup, iscontionversion);
//有发货有结算,且发货数量大于结算数量的数据汇总
//var _ls_innerjoin = _dapperRepository.GetInnerJoinSettledDetailDiffReportList(version, materialCode, begin, end, materialGroup, iscontionversion);
if (!string.IsNullOrEmpty(sapCode))
{
@ -117,12 +80,14 @@ namespace SettleAccount.Job.Services.Report
}
ExcelExporter _exporter = new ExcelExporter();//导出Excel
var result = _exporter.Append(_ls.ToList(), "有发货无结算对比")
var result = _exporter.Append(_ls.ToList(), "红旗看板未结明细")
//.SeparateBySheet()
//.Append(_lsnoSettle.ToList(), "有结算无发货对比")
//.Append(_ls_original.ToList(), "原始红旗未结数据")
// .SeparateBySheet()
//.Append(_ls_innerjoin.ToList(), "有发货有结算(发货数量大于结算)")
.ExportAppendDataAsByteArray();
result.ShouldNotBeNull();
_fileContainer.SaveAsync(_filename, result.Result, true);

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save